Normand Briere
2019-07-21 d32f24f147068e6cbecb31c7f98047f68bc8b58a
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -59,6 +60,12 @@
5960 this.copy = this.group = group;
6061 //selectees = this.group.selectees;
6162
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6269 if(ui)
6370 SetupUI(objEditor);
6471 }
....@@ -73,17 +80,29 @@
7380 this.copy = this.group = copy;
7481 //selectees = this.group.selectees;
7582
76
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7784 SetupUI2(objEditor);
7885 objEditor.SetupUI(true);
7986 SetupViews(objEditor);
8087
8188 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
8297 }
8398
8499 void CloneSelection(boolean supports)
85100 {
86
- // Object3D keep = GraphreeD.clipboard;
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
105
+ // Object3D keep = GrafreeD.clipboard;
87106 //Object3D obj;
88107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89108 {
....@@ -93,18 +112,19 @@
93112
94113 makeSomething(clone, i==group.selection.size()-1);
95114 }
115
+ Globals.REPLACEONMAKE = keep;
96116 }
97117
98118 void CloneClipboard(boolean supports)
99119 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));
120
+ assert(Grafreed.clipboard.parent == null);
121
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
122
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
123
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
124
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105125 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
126
+ makeSomething(CloneObject(Grafreed.clipboard, false));
127
+ Grafreed.clipboard.get(0).parent = keepparent;
108128 }
109129
110130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +138,7 @@
118138 // obj.support = null;
119139 if (!supports)
120140 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122142 obj.parent = parent;
123143 // obj.support = support;
124144 // clone.support = support; // aout 2013
....@@ -147,30 +167,29 @@
147167
148168 //JTextField nameField;
149169
150
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
151171 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
172
+ oe.jTree = new cTree();
173
+
163174 Menu menu;
164175 oe.menuBar.add(menu = new Menu("Edit"));
165176 //editItem = menu.add(new MenuItem("Edit"));
166177 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
178
+
179
+// undoItem = menu.add(new MenuItem("Undo"));
180
+// undoItem.addActionListener(this);
181
+// redoItem = menu.add(new MenuItem("Redo"));
182
+// redoItem.addActionListener(this);
183
+// menu.add("-");
184
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168185 duplicateItem.addActionListener(this);
169
- menu.add("-");
170186 cloneItem = menu.add(new MenuItem("Clone"));
171187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
172190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173191 cloneSupportItem.addActionListener(this);
192
+ }
174193 menu.add("-");
175194 cutItem = menu.add(new MenuItem("Cut"));
176195 cutItem.addActionListener(this);
....@@ -178,27 +197,123 @@
178197 copyItem.addActionListener(this);
179198 pasteItem = menu.add(new MenuItem("Paste"));
180199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
181204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182205 pasteLinkItem.addActionListener(this);
183206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184207 pasteCloneItem.addActionListener(this);
185208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186209 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
210
+ menu.add("-");
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
213
+
214
+ if (Globals.ADVANCED)
215
+ {
216
+ // Deletes the cameras...
189217 clearAllItem = menu.add(new MenuItem("Clear All"));
190218 clearAllItem.addActionListener(this);
219
+ }
220
+
221
+ menuBar.add(cameraMenu = new Menu("View"));
222
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
223
+ //zBufferItem.addActionListener(this);
224
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
225
+ //normalLensItem.addActionListener(this);
226
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
227
+ restoreCameraItem.addActionListener(this);
228
+
229
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
230
+// toggleFullScreenItem.addItemListener(this);
231
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
232
+// cameraMenu.add("-");
233
+//
234
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
235
+// toggleTextureItem.addItemListener(this);
236
+// toggleTextureItem.setState(CameraPane.textureon);
237
+//
238
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
239
+// toggleSwitchItem.addItemListener(this);
240
+// toggleSwitchItem.setState(CameraPane.SWITCH);
241
+
242
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
243
+ toggleHandleItem.addItemListener(this);
244
+ toggleHandleItem.setState(CameraPane.HANDLES);
245
+
246
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
247
+ togglePaintItem.addItemListener(this);
248
+ togglePaintItem.setState(CameraPane.PAINTMODE);
249
+
250
+ if (Globals.ADVANCED)
251
+ {
252
+ cameraMenu.add("-");
253
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
254
+ toggleLiveItem.addItemListener(this);
255
+ toggleLiveItem.setState(Globals.isLIVE());
191256
257
+ cameraMenu.add(stepItem = new MenuItem("Step"));
258
+ stepItem.addActionListener(this);
259
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
260
+ // toggleDLItem.addItemListener(this);
261
+ // toggleDLItem.setState(false);
262
+
263
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
264
+ toggleRenderItem.addItemListener(this);
265
+ toggleRenderItem.setState(!CameraPane.frozen);
266
+
267
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
268
+ toggleDebugItem.addItemListener(this);
269
+ toggleDebugItem.setState(Globals.DEBUG);
270
+
271
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
272
+ toggleFrustumItem.addItemListener(this);
273
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
274
+
275
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
276
+ toggleFootContactItem.addItemListener(this);
277
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
278
+
279
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
280
+ toggleTimelineItem.addItemListener(this);
281
+ }
282
+
283
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
284
+// toggleRootItem.addItemListener(this);
285
+// toggleRootItem.setState(false);
286
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
287
+// animationItem.addItemListener(this);
288
+// animationItem.setState(CameraPane.ANIMATION);
289
+ cameraMenu.add("-");
290
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
291
+ editCameraItem.addActionListener(this);
292
+
293
+ if (Globals.ADVANCED)
294
+ {
295
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
296
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
297
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
298
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
299
+ oe.cameraMenu.add("-");
300
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
301
+ openWindowItem.addActionListener(this);
302
+ editLeafItem.addActionListener(this);
303
+ lookAtItem.addActionListener(this);
304
+ //lookFromItem.addActinoListener(this);
305
+ //switchViewItem.addActionListener(this);
306
+ }
307
+
192308 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
309
+ if (Globals.ADVANCED)
310
+ {
197311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198312 revertMeshItem.addActionListener(this);
199313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200314 resetreferencesItem.addActionListener(this);
201315 menu.add("-");
316
+ }
202317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203318 overwriteGeoItem.addActionListener(this);
204319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +325,104 @@
210325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211326 overwriteUVItem.addActionListener(this);
212327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
213330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214331 generateMeshItem.addActionListener(this);
215332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216333 poseMeshItem.addActionListener(this);
217334 menu.add("-");
335
+ }
218336 resetsupportItem = menu.add(new MenuItem("Reset support"));
219337 resetsupportItem.addActionListener(this);
220338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221339 linkverticesItem.addActionListener(this);
340
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
341
+ relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
222345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223346 setMasterItem.addActionListener(this);
347
+ }
224348
225349 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
230352 backItem = menu.add(new MenuItem("Back"));
231353 backItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
354
+ frontItem = menu.add(new MenuItem("Front"));
355
+ frontItem.addActionListener(this);
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
361
+ hideItem = menu.add(new MenuItem("Hidden Group"));
362
+ hideItem.addActionListener(this);
363
+ }
364
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
365
+ ungroupItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
241373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242374 switchGeoItem.addActionListener(this);
243375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244376 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
246378 morphItem.addActionListener(this);
379
+
380
+ menu.add("-");
381
+ physicsItem = menu.add(new MenuItem("Physics"));
382
+ physicsItem.addActionListener(this);
383
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
384
+ frameselectorItem.addActionListener(this);
247385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248386 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
387
+ }
251388
252389 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
392
+ billboardItem = menu.add(new MenuItem("Billboard"));
393
+ billboardItem.addActionListener(this);
255394 csgItem = menu.add(new MenuItem("CSG"));
256395 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258397 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260399 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
263408 linkerItem = menu.add(new MenuItem("Linker"));
264409 linkerItem.addActionListener(this);
265410 templateItem = menu.add(new MenuItem("Template"));
266411 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269412 pointflowItem = menu.add(new MenuItem("Point Flow"));
270413 pointflowItem.addActionListener(this);
414
+ }
271415 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275417 resetTransformItem.addActionListener(this);
276418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277419 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
420
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
421
+ resetCentroidXZItem.addActionListener(this);
422
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
423
+ transformGeometryItem.addActionListener(this);
424
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
425
+ transformChildrenItem.addActionListener(this);
280426
281427 oe.menuBar.add(menu = new Menu("Geometry"));
282428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +431,13 @@
285431 genNormalsORGANItem.addActionListener(this);
286432 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287433 genNormalsCADItem.addActionListener(this);
434
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
435
+ genNormalsMESHItem.addActionListener(this);
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
439
+ genNormalsMINEItem.addActionListener(this);
440
+ }
288441 stripifyItem = menu.add(new MenuItem("Stripify"));
289442 stripifyItem.addActionListener(this);
290443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +459,34 @@
306459 reduce34MeshItem.addActionListener(this);
307460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308461 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
313470
314471 oe.menuBar.add(menu = new Menu("Attributes"));
315472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316473 clearMaterialsItem.addActionListener(this);
474
+ resetAllItem = menu.add(new MenuItem("Reset All"));
475
+ resetAllItem.addActionListener(this);
476
+ stepAllItem = menu.add(new MenuItem("Step All"));
477
+ stepAllItem.addActionListener(this);
317478 menu.add("-");
318479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319480 liveleavesItem.addActionListener(this);
320481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
322485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323486 supportleavesItem.addActionListener(this);
324487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325488 unsupportleavesItem.addActionListener(this);
489
+ }
326490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327491 hideleavesItem.addActionListener(this);
328492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +495,14 @@
331495 markleavesItem.addActionListener(this);
332496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333497 unmarkleavesItem.addActionListener(this);
498
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
499
+ rewindleavesItem.addActionListener(this);
500
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
501
+ unrewindleavesItem.addActionListener(this);
502
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
503
+ randomleavesItem.addActionListener(this);
504
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
505
+ unrandomleavesItem.addActionListener(this);
334506 menu.add("-");
335507 flipVItem = menu.add(new MenuItem("Flip V"));
336508 flipVItem.addActionListener(this);
....@@ -366,35 +538,41 @@
366538 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367539 sortbynameItem.addActionListener(this);
368540 menu.add("-");
541
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
542
+ shareGeometriesItem.addActionListener(this);
543
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
544
+ mergeGeometriesItem.addActionListener(this);
545
+ if (Globals.ADVANCED)
546
+ {
547
+ // Pretty much the same as duplicate and clone.
369548 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370549 extractGeometriesItem.addActionListener(this);
371550 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372551 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
552
+ }
377553
378554 oe.menuBar.add(menu = new Menu("Insert"));
379555 buildCreateMenu(menu);
380556
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392557 oe.menuBar.add(menu = new Menu("Tools"));
393558 buildToolsMenu(menu);
394559 }
395560
561
+
396562 void SetupUI2(ObjEditor oe)
397563 {
564
+ // June 2019
565
+ if (oe == null)
566
+ {
567
+ //super.SetupUI2(this);
568
+ //return;
569
+ }
570
+
571
+ if (copy != group)
572
+ {
573
+ //super.SetupUI2(this);
574
+ }
575
+
398576 //new Exception().printStackTrace();
399577
400578 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +601,231 @@
423601 oe.radioPanel.add(dummyButton);
424602 oe.buttonGroup.add(dummyButton);
425603 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
604
+ cGridBag copyOptionsPanel = new cGridBag();
605
+
606
+ copyOptionsPanel.preferredHeight = 1;
429607
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
608
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
609
+
610
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ //minButton.setToolTipText("Minimize window");
612
+ //minButton.addActionListener(this);
613
+
614
+ if (Globals.ADVANCED)
615
+ {
616
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ maxButton.setToolTipText("Maximize window");
618
+ maxButton.addActionListener(this);
619
+ }
620
+
621
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ fullButton.setToolTipText("Full-screen window");
623
+ fullButton.addActionListener(this);
624
+
625
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ screenfitButton.setToolTipText("Screen fit");
627
+ screenfitButton.addActionListener(this);
628
+
629
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ restoreCameraButton.setToolTipText("Restore viewpoint");
631
+ restoreCameraButton.addActionListener(this);
632
+
633
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ saveButton.setToolTipText("New version");
635
+ saveButton.addActionListener(this);
636
+
637
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ undoButton.setToolTipText("Previous version");
639
+ undoButton.addActionListener(this);
640
+ undoButton.setEnabled(false);
641
+
642
+ cGridBag updown = new cGridBag().setVertical(true);
643
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ restoreButton.setToolTipText("Restore current");
645
+ restoreButton.addActionListener(this);
646
+ restoreButton.setEnabled(false);
647
+
648
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ replaceButton.setToolTipText("Replace current");
650
+ replaceButton.addActionListener(this);
651
+ replaceButton.setEnabled(false);
652
+
653
+ copyOptionsPanel.add(updown);
654
+
655
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ redoButton.setToolTipText("Next version");
657
+ redoButton.addActionListener(this);
658
+ redoButton.setEnabled(false);
659
+
660
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
661
+ liveCB.setToolTipText("Enable animation");
431662 liveCB.addItemListener(this);
432663
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
664
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ oneStepButton.setToolTipText("Animate one step forward");
666
+ oneStepButton.addActionListener(this);
667
+
668
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
669
+ fastCB.setToolTipText("Fast mode");
451670 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
671
+
672
+ //oe.toolboxPanel.Return();
673
+
674
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
675
+// trackCB.setToolTipText("Enable tracking");
676
+// trackCB.addItemListener(this);
458677
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
493
- trackCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
497
- screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
499678 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500679 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505680
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
512
- flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
681
+ if (Globals.ADVANCED)
682
+ {
683
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ snapobjectButton.addActionListener(this);
685
+ snapobjectButton.setToolTipText("Snap Object");
686
+ }
687
+
688
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
516689
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
519
- twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521691 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
692
+ fourButton.setToolTipText("Show left panel only");
693
+
694
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ twoButton.setToolTipText("Show right view only");
696
+ twoButton.addActionListener(this);
697
+ this.fullscreenLayout = twoButton;
698
+
699
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ sixButton.setToolTipText("Show left and right");
523701 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
- threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
527
- sevenButton.addActionListener(this);
702
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
+// threeButton.setToolTipText("2-column layout right");
704
+// threeButton.addActionListener(this);
705
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
706
+// sevenButton.setToolTipText("3-column layout");
707
+// sevenButton.addActionListener(this);
528708 //
529709
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
710
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ rootButton.setToolTipText("Open selection in new tab");
531712 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
713
+
714
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ closeButton.setToolTipText("Close tab");
534716 closeButton.addActionListener(this);
535717 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536718 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538
-
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
541
- editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545719
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
720
+ // INSERT
721
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
722
+ gridButton.setToolTipText("Create grid");
723
+ gridButton.addActionListener(this);
724
+
725
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
+ boxButton.setToolTipText("Create box");
727
+ boxButton.addActionListener(this);
728
+
729
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ sphereButton.setToolTipText("Create sphere");
731
+ sphereButton.addActionListener(this);
732
+
733
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
734
+ coneButton.setToolTipText("Create cone");
735
+ coneButton.addActionListener(this);
736
+
737
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ torusButton.setToolTipText("Create torus");
739
+ torusButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ superButton.setToolTipText("Create superellipsoid");
743
+ superButton.addActionListener(this);
744
+
745
+ if (Globals.ADVANCED)
746
+ {
747
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ kleinButton.setToolTipText("Create Klein bottle");
749
+ kleinButton.addActionListener(this);
750
+ }
751
+
752
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ particlesButton.setToolTipText("Create particle system");
754
+ particlesButton.addActionListener(this);
755
+
756
+ oe.toolboxPanel.Return();
757
+
758
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
759
+ groupButton.setToolTipText("Create group");
760
+ groupButton.addActionListener(this);
761
+
762
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
763
+ compositeButton.setToolTipText("Create composite");
764
+ compositeButton.addActionListener(this);
765
+
766
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
767
+ switchButton.setToolTipText("Create item switcher");
768
+ switchButton.addActionListener(this);
769
+
770
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
771
+ loopButton.setToolTipText("Create loop");
772
+ loopButton.addActionListener(this);
773
+
774
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ textureButton.setToolTipText("Create texture");
776
+ textureButton.addActionListener(this);
777
+
778
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
779
+ overlayButton.setToolTipText("Create overlay");
780
+ overlayButton.addActionListener(this);
781
+
782
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
783
+ lightButton.setToolTipText("Create light");
784
+ lightButton.addActionListener(this);
785
+
786
+ for (int i=6; --i>=0;)
787
+ {
788
+ oe.toolboxPanel.Return();
789
+ oe.toolboxPanel.add(new cGridBag());
790
+ oe.toolboxPanel.add(new cGridBag());
791
+ oe.toolboxPanel.add(new cGridBag());
792
+ oe.toolboxPanel.add(new cGridBag());
793
+ oe.toolboxPanel.add(new cGridBag());
794
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ }
797
+
798
+ // EDIT panel
799
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
800
+ editButton.setToolTipText("Pin selection controls");
801
+ editButton.addActionListener(this);
802
+
803
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
804
+ uneditButton.setToolTipText("Remove selection controls");
547805 uneditButton.addActionListener(this);
548806
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
807
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
808
+ allParamsButton.setToolTipText("Show all controle");
561809 allParamsButton.addActionListener(this);
562810
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
811
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
812
+ clearPanelButton.setToolTipText("Clear edit panel");
813
+ clearPanelButton.addActionListener(this);
814
+
815
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
816
+ unselectButton.setToolTipText("Unselect");
568817 unselectButton.addActionListener(this);
569818
819
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
820
+ flashSelectionButton.setToolTipText("Highlight selection");
821
+ flashSelectionButton.addActionListener(this);
822
+
823
+ editCommandsPanel.preferredHeight = 1;
824
+
825
+ SetPinStates(false);
826
+// oe.treePanel.add(commandsPanel);
827
+// oe.treePanel.Return();
828
+
570829 // oe.aConstraints.gridx += 1;
571830 // oe.aConstraints.weighty = 0;
572831 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +837,25 @@
578837 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579838 // gcButton.addActionListener(this);
580839
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
840
+ cGridBag jSPPanel = new cGridBag();
841
+
842
+ JScrollPane jSP;
592843 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
844
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594845 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
599
-
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
604
- colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
607
- materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
- textureCB.addItemListener(this);
611
-
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
614846
847
+ oe.treePanel.add(jSPPanel);
848
+ oe.treePanel.Return();
849
+
850
+ oe.treePanel.add(copyOptionsPanel);
851
+ oe.treePanel.Return();
852
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
853
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
854
+ sliderPane.preferredHeight = 1;
855
+
856
+// mainPanel.setDividerLocation(0.5); //1.0);
857
+// mainPanel.setResizeWeight(0.5);
858
+
615859 //jList.addListSelectionListener(this);
616860 oe.jTree.addTreeSelectionListener(this);
617861 //jTree.setRootVisible(false);
....@@ -630,23 +874,160 @@
630874 dgr.addDragGestureListener(this);
631875 }catch(Exception e) {}
632876 */
633
- radio.layout = sevenButton;
877
+ radio.layout = sixButton; // sevenButton;
634878 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635879 }
880
+
881
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
882
+ {
883
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
884
+ colorCB.setToolTipText("Copy color when dropped");
885
+ colorCB.addItemListener(this);
886
+
887
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
888
+ materialCB.setToolTipText("Copy material when dropped");
889
+ materialCB.addItemListener(this);
890
+
891
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
892
+ textureCB.setToolTipText("Copy texture when dropped");
893
+ textureCB.addItemListener(this);
894
+
895
+ panel.Return();
896
+
897
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
898
+ boxCB.setToolTipText("Display bounding boxes");
899
+ boxCB.addItemListener(this);
900
+
901
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
902
+ zoomBoxCB.setToolTipText("Display only for wheel");
903
+ zoomBoxCB.addItemListener(this);
904
+
905
+ if (true) // Globals.ADVANCED)
906
+ {
907
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
908
+// supportCB.setToolTipText("Enable rigging");
909
+// supportCB.addItemListener(this);
910
+
911
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
912
+ freezeCB.setToolTipText("Fast moving camera");
913
+ freezeCB.addItemListener(this);
914
+
915
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
916
+ // localCB.addItemListener(this);
917
+
918
+ panel.Return();
919
+
920
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
921
+ crowdCB.setToolTipText("Used for crowds");
922
+ crowdCB.addItemListener(this);
923
+
924
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
925
+ smoothCB.setToolTipText("Snapping delay");
926
+ smoothCB.addItemListener(this);
927
+
928
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
929
+ slowCB.setToolTipText("Smooth interpolation");
930
+ slowCB.addItemListener(this);
931
+
932
+// constraints.gridy += 1;
933
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
934
+// speakerMocapCB.addItemListener(this);
935
+
936
+ panel.Return();
937
+
938
+ if (false)
939
+ {
940
+ // handled in scripts
941
+ //constraints.gridy += 1;
942
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
943
+ speakerCameraCB.addItemListener(this);
944
+
945
+ //constraints.gridy += 1;
946
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
947
+ speakerFocusCB.addItemListener(this);
948
+
949
+ //constraints.gridy += 1;
950
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
951
+ smoothfocusCB.addItemListener(this);
952
+ panel.Return();
953
+ }
954
+
955
+//constraints.gridx += 1;
956
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
957
+// debugCB.addItemListener(this);
958
+
959
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
960
+ trackCB.setToolTipText("Enable tracking target");
961
+ trackCB.addItemListener(this);
962
+
963
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
964
+ oeilCB.setToolTipText("Move camera when tracking");
965
+ oeilCB.addItemListener(this);
966
+
967
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
968
+ shadowCB.setToolTipText("When live compute shadows");
969
+ shadowCB.addItemListener(this);
970
+
971
+ panel.Return();
972
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
973
+ toggleTextureCB.setToolTipText("Load textures");
974
+ toggleTextureCB.addItemListener(this);
975
+
976
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
977
+ toggleSwitchCB.setToolTipText("Choose a single item");
978
+ toggleSwitchCB.addItemListener(this);
979
+
980
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
981
+ autokeepCB.setToolTipText("On structure change");
982
+ autokeepCB.addItemListener(this);
983
+
984
+ panel.Return();
985
+ if (Globals.ADVANCED)
986
+ {
987
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
988
+ lookAtCB.setToolTipText("Look-at target");
989
+ lookAtCB.addItemListener(this);
990
+ }
991
+
992
+ }
993
+
994
+ cGridBag fill = new cGridBag();
995
+ fill.preferredHeight = 200;
996
+ cGridBag fill2 = new cGridBag();
997
+ fill2.preferredHeight = 200;
998
+ cGridBag fill3 = new cGridBag();
999
+ fill3.preferredHeight = 200;
1000
+
1001
+ panel.add(fill);
1002
+ panel.add(fill2);
1003
+ panel.add(fill3);
1004
+
1005
+ }
6361006
6371007 void EditObject(Object3D obj)
6381008 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
1009
+ cRadio radioButton = new cRadio(obj.name);
1010
+
1011
+ // June 2019. Patch to avoid bug with transparency.
1012
+ radioButton.hadMaterial = obj.material != null;
1013
+ if (!radioButton.hadMaterial)
1014
+ {
1015
+ obj.material = new cMaterial();
1016
+ }
1017
+
1018
+ radioButton.SetObject(obj);
1019
+ radioButton.layout = sixButton; // sevenButton;
1020
+ radioButton.SetCamera(cameraView.renderCamera, false);
1021
+ radioButton.addActionListener(this);
1022
+ radioPanel.add(radioButton);
1023
+ buttonGroup.add(radioButton);
1024
+ radioButton.doClick();
6471025 }
1026
+
6481027 void SetupViews(ObjEditor oe)
6491028 {
1029
+ theFrame = this;
1030
+
6501031 oe.SetupViews();
6511032
6521033 System.out.println("SetupViews");
....@@ -655,22 +1036,28 @@
6551036 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561037 }
6571038
658
- JCheckBox liveCB;
659
- JCheckBox supportCB;
660
- JCheckBox localCB;
661
- JCheckBox crowdCB;
662
- JCheckBox smoothCB;
663
- JCheckBox fastCB;
664
- JCheckBox slowCB;
665
- JCheckBox boxCB;
666
- JCheckBox trackCB;
667
- JCheckBox smoothfocusCB;
1039
+ cToggleButton liveCB;
1040
+ cCheckBox supportCB;
1041
+ cCheckBox localCB;
1042
+ cCheckBox crowdCB;
1043
+ cCheckBox smoothCB;
1044
+ cToggleButton fastCB;
1045
+ cCheckBox slowCB;
1046
+ cCheckBox boxCB;
1047
+ cCheckBox zoomBoxCB;
1048
+ cCheckBox freezeCB;
1049
+ //cToggleButton trackCB;
1050
+ cCheckBox trackCB;
1051
+ cCheckBox smoothfocusCB;
6681052 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1053
+ cCheckBox speakerCameraCB;
1054
+ cCheckBox speakerFocusCB;
1055
+ cCheckBox debugCB;
1056
+
1057
+ cCheckBox oeilCB;
1058
+ cCheckBox shadowCB;
1059
+ cCheckBox autokeepCB;
1060
+ cCheckBox lookAtCB;
6741061
6751062 // static int COLOR = 1;
6761063 // static int MATERIAL = 2;
....@@ -678,9 +1065,9 @@
6781065
6791066 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801067
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1068
+ cCheckBox colorCB;
1069
+ cCheckBox materialCB;
1070
+ cCheckBox textureCB;
6841071
6851072 public void itemStateChanged(ItemEvent e)
6861073 {
....@@ -705,10 +1092,10 @@
7051092 dropAttributes |= Object3D.TEXTURE;
7061093 else
7071094 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1095
+ } else if(e.getSource() == liveCB)
7101096 {
7111097 cameraView.ToggleLive();
1098
+ refreshContents(false);
7121099 }
7131100 else if(e.getSource() == supportCB)
7141101 {
....@@ -744,6 +1131,10 @@
7441131 cameraView.repaint();
7451132 // refreshContents();
7461133 }
1134
+ else if(e.getSource() == zoomBoxCB)
1135
+ {
1136
+ cameraView.ToggleZoomBoxMode();
1137
+ }
7471138 else if(e.getSource() == smoothfocusCB)
7481139 {
7491140 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1160,18 @@
7691160 {
7701161 cameraView.ToggleOeil();
7711162 }
1163
+ else if(e.getSource() == shadowCB)
1164
+ {
1165
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1166
+ }
1167
+ else if(e.getSource() == freezeCB)
1168
+ {
1169
+ Globals.FREEZEONMOVE ^= true;
1170
+ }
1171
+ else if(e.getSource() == autokeepCB)
1172
+ {
1173
+ Globals.REPLACEONMAKE ^= true;
1174
+ }
7721175 else if(e.getSource() == lookAtCB)
7731176 {
7741177 cameraView.ToggleLookAt();
....@@ -785,7 +1188,8 @@
7851188
7861189 /**/
7871190 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1191
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1192
+ TreePath path = objEditor.jTree.getSelectionPath();
7891193 if ((path == null) || (path.getPathCount() <= 1)) {
7901194 // We can't move the root node or an empty selection
7911195 return;
....@@ -848,8 +1252,6 @@
8481252 }
8491253 }
8501254
851
- String string = (String) object;
852
-
8531255 System.out.println("Transfer = " + object + "; drop : " + target);
8541256 // if( object instanceof java.io.File[])
8551257 // {
....@@ -857,7 +1259,11 @@
8571259 // objEditor.DropFile((java.io.File[]) object, true);
8581260 // return;
8591261 // }
860
- if (string.charAt(0) == '/')
1262
+
1263
+ String string = object.toString();
1264
+
1265
+ // File path for Mac and Windows
1266
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611267 {
8621268 // file(s)
8631269 String[] names = string.split("\n");
....@@ -884,7 +1290,7 @@
8841290
8851291 flashIt = false;
8861292 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1293
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881294 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891295
8901296 if (group.selection.size() == 1)
....@@ -900,23 +1306,33 @@
9001306
9011307 assert target == objEditor.jTree;
9021308 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1309
+ Object3D destinationLeaf;
9031310 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1311
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051312 } catch (Exception e) {
9061313 System.out.println("destinationPath : " + destinationPath);
9071314 return;
9081315 }
9091316
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1317
+ for (int i=group.selection.size(); --i>=0;)
9111318 {
1319
+ Object3D child = (Object3D)group.selection.elementAt(i);
1320
+
1321
+ // Cannot move into itself
1322
+ if (child == destinationLeaf)
1323
+ return;
1324
+ }
1325
+
1326
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1327
+// {
9121328 loadClipboard(true);
9131329 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1330
+ pasteInto(false, false);
1331
+// } else {
1332
+// loadClipboard(false);
1333
+// objEditor.jTree.setSelectionPath(destinationPath);
1334
+// pasteInto(false, false); // true); // ???
1335
+// }
9201336 }
9211337 public void dropActionChanged(DropTargetDragEvent dtde)
9221338 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1437,107 @@
10211437 {
10221438 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231439 //heightFieldItem.addActionListener(this);
1024
- gridItem = menu.add(new MenuItem("Grid"));
1025
- gridItem.addActionListener(this);
1026
- rectoidItem = menu.add(new MenuItem("Box"));
1027
- rectoidItem.addActionListener(this);
1028
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1029
- ellipsoidItem.addActionListener(this);
1030
- coneItem = menu.add(new MenuItem("Cone"));
1031
- coneItem.addActionListener(this);
1032
- torusItem = menu.add(new MenuItem("Torus"));
1033
- torusItem.addActionListener(this);
1034
- superItem = menu.add(new MenuItem("Superellipsoid"));
1035
- superItem.addActionListener(this);
1036
- particleItem = menu.add(new MenuItem("Particle system"));
1037
- particleItem.addActionListener(this);
1440
+// gridItem = menu.add(new MenuItem("Grid"));
1441
+// gridItem.addActionListener(this);
1442
+// rectoidItem = menu.add(new MenuItem("Box"));
1443
+// rectoidItem.addActionListener(this);
1444
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1445
+// ellipsoidItem.addActionListener(this);
1446
+// coneItem = menu.add(new MenuItem("Cone"));
1447
+// coneItem.addActionListener(this);
1448
+// torusItem = menu.add(new MenuItem("Torus"));
1449
+// torusItem.addActionListener(this);
1450
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1451
+// superItem.addActionListener(this);
1452
+
1453
+ cameraItem = menu.add(new MenuItem("Camera"));
1454
+ cameraItem.addActionListener(this);
1455
+
1456
+ if (!Globals.ADVANCED)
1457
+ {
1458
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1459
+ kleinItem.addActionListener(this);
1460
+ }
1461
+
1462
+// particleItem = menu.add(new MenuItem("Particle system"));
1463
+// particleItem.addActionListener(this);
1464
+ if (Globals.ADVANCED)
1465
+ {
10381466 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391467 ragdollItem.addActionListener(this);
10401468 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411469 ragdoll2Item.addActionListener(this);
1470
+ }
10421471 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1472
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441473 meshItem.addActionListener(this);
10451474 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461475 // meshGroupItem.addActionListener(this);
1476
+ if (Globals.ADVANCED)
1477
+ {
10471478 springItem = menu.add(new MenuItem("Spring"));
10481479 springItem.addActionListener(this);
10491480 flagItem = menu.add(new MenuItem("Flag"));
10501481 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551482 blobItem = menu.add(new MenuItem("Blob"));
10561483 blobItem.addActionListener(this);
10571484 latheItem = menu.add(new MenuItem("Lathe"));
10581485 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1486
+ }
1487
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1488
+ bezierItem.addActionListener(this);
1489
+// overlayItem = menu.add(new MenuItem("Overlay"));
1490
+// overlayItem.addActionListener(this);
1491
+// lightItem = menu.add(new MenuItem("Light"));
1492
+// lightItem.addActionListener(this);
10611493 menu.add("-");
10621494 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631495 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1496
+// loopItem = menu.add(new MenuItem("Loop"));
1497
+// loopItem.addActionListener(this);
10661498 doubleItem = menu.add(new MenuItem("Fork"));
10671499 doubleItem.addActionListener(this);
1500
+ if (Globals.ADVANCED)
1501
+ {
10681502 tripleItem = menu.add(new MenuItem("Trident"));
10691503 tripleItem.addActionListener(this);
1504
+ }
10701505 }
10711506
10721507 void buildToolsMenu(Menu menu)
10731508 {
10741509 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751510 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1511
+ animationItem.setState(Globals.ANIMATION);
1512
+
1513
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1514
+ archiveItem.addActionListener(this);
10771515
10781516 menu.add("-");
10791517 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801518 parseverticesItem.addActionListener(this);
10811519 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821520 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1521
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841522 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871523 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881524 reduceMorphItem.addActionListener(this);
10891525 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901526 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941527 menu.add("-");
1095
-
10961528 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971529 memoryItem.addActionListener(this);
1530
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1531
+ computeAOItem.addActionListener(this);
1532
+
1533
+ if (Globals.ADVANCED)
1534
+ {
1535
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1536
+ mirrorItem.addActionListener(this);
1537
+ menu.add("-");
10981538 menu.add(analyzeItem = new MenuItem("Analyze"));
10991539 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1540
+ menu.add(dumpItem = new MenuItem("Print"));
11011541 dumpItem.addActionListener(this);
11021542 // menu.add(pathItem = new MenuItem("From-to path"));
11031543 // pathItem.addActionListener(this);
....@@ -1106,6 +1546,8 @@
11061546 resetParentItem.addActionListener(this);
11071547 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081548 repairParentItem.addActionListener(this);
1549
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1550
+ repairShadowItem.addActionListener(this);
11091551 menu.add(invariantsItem = new MenuItem("Invariants"));
11101552 invariantsItem.addActionListener(this);
11111553 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1555,7 @@
11131555 menu.add("-");
11141556 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151557 editScriptItem.addActionListener(this);
1558
+ }
11161559 }
11171560
11181561 void ScreenFit()
....@@ -1235,9 +1678,34 @@
12351678 shadow.material = new cMaterial(obj.material);
12361679 shadow.material.diffuse = 0.0001f;
12371680 shadow.material.specular = 0.0001f;
1681
+ //shadow.projectedVertices[1].x = 300;
12381682
12391683 makeSomething(shadow);
12401684 }
1685
+
1686
+ private void ClearUnpinned()
1687
+ {
1688
+ //for (Object3D obj : listUI)
1689
+ for (int i=listUI.size(); --i>=0;)
1690
+ {
1691
+ Object3D obj = listUI.elementAt(i);
1692
+ if (!obj.pinned)
1693
+ {
1694
+ obj.CloseUI();
1695
+ listUI.remove(i);
1696
+ }
1697
+ }
1698
+ }
1699
+
1700
+ private void EditElement(Object3D elem, boolean newWindow)
1701
+ {
1702
+ // if (!(elem instanceof Composite))
1703
+ // newWindow = false;
1704
+ listUI.add(elem);
1705
+ elem.openEditWindow(this, newWindow); //, false);
1706
+ System.out.println("edit : " + elem);
1707
+ elem.editWindow.refreshContents(true); // ? new
1708
+ }
12411709
12421710 /**
12431711 * applyExample
....@@ -1441,9 +1909,9 @@
14411909
14421910 void Overwrite(int mask)
14431911 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1912
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451913 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1914
+ Object3D content = Grafreed.clipboard.get(0);
14471915
14481916 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491917 content = ((cGroup)content).get(0);
....@@ -1466,6 +1934,7 @@
14661934 //
14671935 public void actionPerformed(ActionEvent event) // , Object arg)
14681936 {
1937
+ Object source = event.getSource();
14691938 /*
14701939 if (event.getSource() == nameField)
14711940 {
....@@ -1477,11 +1946,11 @@
14771946 }
14781947 else
14791948 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1949
+ if (source == lookAtItem || source == lookFromItem)
14811950 {
14821951 ScreenFit();
14831952 } else
1484
- if (event.getSource() == switchItem)
1953
+ if (source == switchViewItem)
14851954 {
14861955 cVector v1 = new cVector();
14871956 cVector v2 = new cVector();
....@@ -1490,11 +1959,11 @@
14901959 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911960 objEditor.cameraView.repaint();
14921961 } else
1493
- if (event.getSource() == rectoidItem)
1962
+ if (source == rectoidItem || source == boxButton)
14941963 {
14951964 makeSomething(new Box());
14961965 } else
1497
- if (event.getSource() == particleItem)
1966
+ if (source == particleItem || source == particlesButton)
14981967 {
14991968 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001969 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1984,9 @@
15151984 applyExample(particleGeom, "SMOKE");
15161985 makeSomething(particleGeom);
15171986 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1987
+ if (source == ragdollItem || source == ragdoll2Item)
15191988 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1989
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211990
15221991 ragdoll.toParent = LA.newMatrix();
15231992 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +2004,7 @@
15352004 } else
15362005 /*
15372006 */
1538
- if (event.getSource() == heightFieldItem)
2007
+ if (source == heightFieldItem)
15392008 {
15402009 Object3D obj = new Object3D();
15412010
....@@ -1573,27 +2042,31 @@
15732042
15742043 makeSomething(obj);
15752044 } else
1576
- if (event.getSource() == gridItem)
2045
+ if (source == gridItem || source == gridButton)
15772046 {
15782047 makeSomething(new Grid());
15792048 } else
1580
- if (event.getSource() == ellipsoidItem)
2049
+ if (source == ellipsoidItem || source == sphereButton)
15812050 {
15822051 makeSomething(new Sphere());
15832052 } else
1584
- if (event.getSource() == coneItem)
2053
+ if (source == coneItem || source == coneButton)
15852054 {
15862055 makeSomething(new Cone());
15872056 } else
1588
- if (event.getSource() == torusItem)
2057
+ if (source == torusItem || source == torusButton)
15892058 {
15902059 makeSomething(new Torus());
15912060 } else
1592
- if (event.getSource() == superItem)
2061
+ if (source == superItem || source == superButton)
15932062 {
15942063 makeSomething(new Superellipsoid());
15952064 } else
1596
- if (event.getSource() == blobItem)
2065
+ if (source == kleinItem || source == kleinButton)
2066
+ {
2067
+ makeSomething(new Klein());
2068
+ } else
2069
+ if (source == blobItem)
15972070 {
15982071 Blob blob = new Blob();
15992072 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2074,15 @@
16012074 //blob.retile();
16022075 makeSomething(blob);
16032076 } else
1604
- if (event.getSource() == latheItem)
2077
+ if (source == latheItem)
16052078 {
16062079 makeSomething(new Lathe());
16072080 } else
1608
- if (event.getSource() == bezierItem)
2081
+ if (source == bezierItem)
16092082 {
16102083 makeSomething(new BezierSurface());
16112084 } else
1612
- if (event.getSource() == checkerItem)
2085
+ if (source == overlayItem || source == overlayButton)
16132086 {
16142087 /*
16152088 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2097,7 @@
16242097 */
16252098 makeSomething(new Checker());
16262099 } else
1627
- if (event.getSource() == meshItem)
2100
+ if (source == meshItem)
16282101 {
16292102 Object3D itemtomake = new Object3D();
16302103 Object3D child;
....@@ -1645,35 +2118,35 @@
16452118 makeSomething(child);
16462119 }
16472120 } else
1648
- if (event.getSource() == springItem)
2121
+ if (source == springItem)
16492122 {
16502123 cSpring s = new cSpring();
16512124 s.setup();
16522125 makeSomething(s);
16532126 } else
1654
- if (event.getSource() == flagItem)
2127
+ if (source == flagItem)
16552128 {
16562129 cSpring s = new cFlag();
16572130 s.setup();
16582131 makeSomething(s);
16592132 } else
1660
- if (event.getSource() == lightItem)
2133
+ if (source == lightItem || source == lightButton)
16612134 {
16622135 makeSomething(new Light());
16632136 } else
1664
- if (event.getSource() == csgItem)
2137
+ if (source == csgItem)
16652138 {
16662139 group(new CSG());
16672140 } else
1668
- if (event.getSource() == templateItem)
2141
+ if (source == templateItem)
16692142 {
16702143 group(new cTemplate());
16712144 } else
1672
- if (event.getSource() == attributeItem)
2145
+ if (source == attributeItem)
16732146 {
16742147 makeSomething(new Attribute());
16752148 } else
1676
- if (event.getSource() == pointflowItem)
2149
+ if (source == pointflowItem)
16772150 {
16782151 makeSomething(new PointFlow());
16792152 } else
....@@ -1685,7 +2158,7 @@
16852158 } else
16862159 */
16872160
1688
- if (event.getSource() == superLoopItem)
2161
+ if (source == superLoopItem)
16892162 {
16902163 Composite g = new cGroup();
16912164 for (int i=0; i<15; i++)
....@@ -1707,30 +2180,30 @@
17072180
17082181 group(g);
17092182 } else
1710
- if (event.getSource() == loopItem)
2183
+ if (source == loopItem || source == loopButton)
17112184 {
17122185 Composite csg = new GroupLeaf();
17132186 csg.count = 5;
17142187 group(csg);
1715
- Composite child = new cGroup();
2188
+ Composite child = new cGroup("Branch");
17162189 csg.addChild(child);
17172190 child.addChild(csg);
17182191 } else
1719
- if (event.getSource() == doubleItem)
2192
+ if (source == doubleItem)
17202193 {
1721
- Composite csg = new GroupLeaf();
2194
+ Composite csg = new GroupLeaf("Fork");
17222195 csg.count = 5;
17232196 group(csg);
1724
- Composite child = new cGroup();
2197
+ Composite child = new cGroup("Branch A");
17252198 csg.addChild(child);
17262199 child.addChild(csg);
1727
- child = new cGroup();
2200
+ child = new cGroup("Branch B");
17282201 csg.addChild(child);
17292202 child.addChild(csg);
17302203 } else
1731
- if (event.getSource() == tripleItem)
2204
+ if (source == tripleItem)
17322205 {
1733
- Composite csg = new GroupLeaf();
2206
+ Composite csg = new GroupLeaf("Trident");
17342207 csg.count = 4;
17352208 group(csg);
17362209 Composite child = new cGroup();
....@@ -1743,73 +2216,98 @@
17432216 csg.addChild(child);
17442217 child.addChild(csg);
17452218 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2219
+ if (source == computeAOItem)
17482220 {
1749
- ImportGFD();
2221
+ Globals.drawMode = CameraPane.OCCLUSION;
2222
+ Globals.theRenderer.repaint();
17502223 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
2224
+ if (source == recompileItem)
17692225 {
17702226 Recompile();
17712227 refreshContents();
17722228 } else
1773
- if (event.getSource() == editScriptItem)
2229
+ if (source == editScriptItem)
17742230 {
17752231 OpenDialog();
17762232 refreshContents();
17772233 } else
1778
- if (event.getSource() == invariantsItem)
2234
+ if (source == invariantsItem)
17792235 {
17802236 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2237
+ Grafreed.grafreeD.universe.invariants();
17822238 } else
1783
- if (event.getSource() == memoryItem)
2239
+ if (source == memoryItem)
17842240 {
17852241 //System.out.println("Invariants:");
17862242 PrintMemory();
17872243 } else
1788
- if (event.getSource() == pathItem)
2244
+ if (source == pathItem)
17892245 {
17902246 PrintPath();
17912247 } else
1792
- if (event.getSource() == analyzeItem)
2248
+ if (source == analyzeItem)
17932249 {
17942250 AnalyzeObject();
17952251 } else
1796
- if (event.getSource() == dumpItem)
2252
+ if (source == dumpItem)
17972253 {
17982254 DumpObject();
17992255 } else
1800
- if (event.getSource() == screenfitButton)
2256
+ if (source == minButton)
18012257 {
1802
- //Reload(lastConverter, lastFilename, true);
2258
+ Minimize();
2259
+ } else
2260
+ if (source == maxButton)
2261
+ {
2262
+ Maximize();
2263
+ } else
2264
+ if (source == fullButton)
2265
+ {
2266
+ ToggleFullScreen();
2267
+ } else
2268
+ if (source == undoButton)
2269
+ {
2270
+ // Go to previous version
2271
+ //if (!Undo())
2272
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2273
+ Undo();
2274
+ } else
2275
+ if (source == restoreButton)
2276
+ {
2277
+ // Restore current version
2278
+ Restore();
2279
+ } else
2280
+ if (source == replaceButton)
2281
+ {
2282
+ // Overwrite current version
2283
+ Replace();
2284
+ } else
2285
+ if (source == redoButton)
2286
+ {
2287
+ // Go to next version
2288
+ Redo();
2289
+ } else
2290
+ if (source == saveButton)
2291
+ {
2292
+ // Save a new version
2293
+ if (!Save(true))
2294
+ java.awt.Toolkit.getDefaultToolkit().beep();
2295
+ } else
2296
+ if (source == oneStepButton)
2297
+ {
2298
+ Globals.ONESTEP = true;
2299
+ cameraView.repaint();
2300
+ } else
2301
+ if (source == screenfitButton)
2302
+ {
18032303 ScreenFit();
18042304 } else
1805
- if (event.getSource() == screenfitpointButton)
2305
+ if (source == screenfitpointButton)
18062306 {
1807
- //Reload(lastConverter, lastFilename, true);
18082307 ScreenFitPoint();
18092308 } else
1810
- if (event.getSource() == snapobjectButton)
2309
+ if (source == snapobjectButton)
18112310 {
1812
- //Reload(lastConverter, lastFilename, true);
18132311 SnapObject();
18142312 } else
18152313 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2316,13 @@
18182316 // Recompile();
18192317 // refreshContents();
18202318 // } else
1821
- if (event.getSource() == gcButton)
2319
+ if (source == gcButton)
18222320 {
18232321 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242322 System.gc();
18252323 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262324 } else
1827
- if (event.getSource() == editLeafItem)
2325
+ if (source == editLeafItem)
18282326 {
18292327 Object3D obj;
18302328 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2336,78 @@
18382336 }
18392337 refreshContents(true);
18402338 } else
1841
- if (event.getSource() == openWindowItem)
2339
+ if (source == openWindowItem)
18422340 {
18432341 EditSelection(true);
18442342 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2343
+ if (source == cutItem || source == clearButton)
18462344 {
18472345 loadClipboard(true);
18482346 } else
1849
- if (event.getSource() == duplicateItem)
2347
+ if (source == undoItem)
18502348 {
1851
- Object3D keep = GraphreeD.clipboard;
2349
+ Undo();
2350
+ } else
2351
+ if (source == redoItem)
2352
+ {
2353
+ Redo();
2354
+ } else
2355
+ if (source == duplicateItem)
2356
+ {
2357
+ Object3D keep = Grafreed.clipboard;
18522358 loadClipboard(false);
18532359 paste(false);
1854
- GraphreeD.clipboard = keep;
2360
+ Grafreed.clipboard = keep;
18552361 } else
1856
- if (event.getSource() == cloneItem)
2362
+ if (source == cloneItem)
18572363 {
18582364 CloneSelection(false);
18592365 } else
1860
- if (event.getSource() == cloneSupportItem)
2366
+ if (source == cloneSupportItem)
18612367 {
18622368 CloneSelection(true);
18632369 } else
1864
- if (event.getSource() == copyItem)
2370
+ if (source == copyItem)
18652371 {
18662372 loadClipboard(false);
18672373 } else
1868
- if (event.getSource() == pasteItem)
2374
+ if (source == pasteItem)
18692375 {
18702376 paste(false);
18712377 } else
1872
- if (event.getSource() == pasteLinkItem)
2378
+ if (source == pasteIntoItem)
18732379 {
1874
- pasteInto(false);
2380
+ pasteInto(true, false);
18752381 } else
1876
- if (event.getSource() == pasteCloneItem)
2382
+ if (source == pasteLinkItem)
18772383 {
1878
- pasteInto(true);
2384
+ pasteInto(false, false);
18792385 } else
1880
- if (event.getSource() == pasteExpandItem)
2386
+ if (source == pasteCloneItem)
2387
+ {
2388
+ pasteInto(true, true);
2389
+ } else
2390
+ if (source == pasteExpandItem)
18812391 {
18822392 paste(true);
18832393 } else
1884
- if (event.getSource() == synchronizeItem)
2394
+ if (source == synchronizeItem)
18852395 {
18862396 Overwrite(Object3D.TRANSFORM);
18872397 } else
1888
- if (event.getSource() == overwriteNameItem)
2398
+ if (source == overwriteNameItem)
18892399 {
18902400 Overwrite(Object3D.NAME);
18912401 } else
1892
- if (event.getSource() == overwriteUVItem)
2402
+ if (source == overwriteUVItem)
18932403 {
18942404 Overwrite(Object3D.UV);
18952405 } else
1896
- if (event.getSource() == overwriteMatItem)
2406
+ if (source == overwriteMatItem)
18972407 {
2408
+ /* july 2015
18982409 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2410
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002411 else
19012412 {
19022413 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2419,16 @@
19082419 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092420 }
19102421 }
2422
+ */
2423
+
2424
+ Overwrite(dropAttributes);
19112425 }
1912
- if (event.getSource() == overwriteGeoItem)
2426
+ if (source == overwriteGeoItem)
19132427 {
19142428 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2429
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162430 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2431
+// Object3D content = GrafreeD.clipboard.get(0);
19182432 //
19192433 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202434 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2440,7 @@
19262440 // refreshContents();
19272441 // }
19282442 } else
1929
- if (event.getSource() == generateMeshItem)
2443
+ if (source == generateMeshItem)
19302444 {
19312445 //if (group.selection.size() == 1)
19322446 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2451,7 @@
19372451 ResetModel();
19382452 refreshContents();
19392453 } else
1940
- if (event.getSource() == extractGeometriesItem)
2454
+ if (source == extractGeometriesItem)
19412455 {
19422456 boolean one = false;
19432457
....@@ -1964,7 +2478,7 @@
19642478 ResetModel();
19652479 refreshContents();
19662480 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2481
+ if (source == cloneGeometriesItem)
19682482 {
19692483 boolean one = false;
19702484
....@@ -1990,32 +2504,37 @@
19902504 ResetModel();
19912505 refreshContents();
19922506 } else
1993
- if (event.getSource() == shareGeometriesItem)
2507
+ if (source == shareGeometriesItem)
19942508 {
19952509 boolean one = false;
19962510
19972511 if (group.selection.size() == 1)
19982512 one = true;
19992513
2514
+ Object3D merge = null;
2515
+
20002516 Object3D content = new cGroup();
20012517
20022518 for (int i=0; i<group.selection.size(); i++)
20032519 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2520
+ merge = new Merge(group.selection.get(i));
20052521
20062522 if (one)
2007
- makeSomething(sel, false);
2523
+ makeSomething(merge, false);
20082524 else
2009
- content.addChild(sel);
2525
+ content.addChild(merge);
20102526 }
20112527
20122528 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2529
+ makeSomething(content, true);
2530
+ else
2531
+ {
2532
+ ResetModel();
2533
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2534
+ refreshContents();
2535
+ }
20172536 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2537
+ if (source == mergeGeometriesItem)
20192538 {
20202539 boolean one = false;
20212540
....@@ -2045,11 +2564,11 @@
20452564 ResetModel();
20462565 refreshContents();
20472566 } else
2048
- if (event.getSource() == linkverticesItem)
2567
+ if (source == linkverticesItem)
20492568 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2569
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512570 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2571
+// Object3D content = GrafreeD.clipboard.get(0);
20532572 //
20542573 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552574 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2577,48 @@
20582577 // group.selection.get(0).setMasterThis(content); // should be identity
20592578 // refreshContents();
20602579 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2580
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622581 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2582
+ Object3D content = Grafreed.clipboard.get(0);
20642583
20652584 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662585 content = ((cGroup)content).get(0);
20672586
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2587
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692588 for (int i=0; i<group.selection.size(); i++)
20702589 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2590
+ boolean random = CameraPane.SWITCH;
2591
+ CameraPane.SWITCH = false; // parse all random nodes
20732592 group.selection.get(i).linkVerticesThis(content);
20742593 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2594
+ CameraPane.SWITCH = random;
20762595 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2596
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782597 refreshContents();
20792598 }
20802599 } else
2081
- if (event.getSource() == resetsupportItem)
2600
+ if (source == resetsupportItem)
20822601 {
20832602 for (int i=0; i<group.selection.size(); i++)
20842603 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2604
+ boolean random = CameraPane.SWITCH;
2605
+ CameraPane.SWITCH = false; // parse all random nodes
20872606 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2607
+ CameraPane.SWITCH = random;
20892608 }
20902609
20912610 refreshContents();
20922611 } else
2093
- if (event.getSource() == resetreferencesItem)
2612
+ if (source == relinkverticesItem)
2613
+ {
2614
+ boolean random = CameraPane.SWITCH;
2615
+ CameraPane.SWITCH = false; // parse all random nodes
2616
+ group.selection.RelinkToSupport();
2617
+ CameraPane.SWITCH = random;
2618
+
2619
+ refreshContents();
2620
+ } else
2621
+ if (source == resetreferencesItem)
20942622 {
20952623 for (int i=0; i<group.selection.size(); i++)
20962624 {
....@@ -2099,11 +2627,11 @@
20992627
21002628 refreshContents();
21012629 } else
2102
- if (event.getSource() == setMasterItem)
2630
+ if (source == setMasterItem)
21032631 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2632
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052633 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2634
+ Object3D content = Grafreed.clipboard.get(0);
21072635
21082636 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092637 content = ((cGroup)content).get(0);
....@@ -2112,13 +2640,13 @@
21122640 refreshContents();
21132641 }
21142642 } else
2115
- if (event.getSource() == poseMeshItem)
2643
+ if (source == poseMeshItem)
21162644 {
21172645 if (group.selection.size() == 1)
21182646 {
2119
- if (GraphreeD.clipboard.size() == 1)
2647
+ if (Grafreed.clipboard.size() == 1)
21202648 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2649
+ Object3D content = Grafreed.clipboard.get(0);
21222650
21232651 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242652 content = ((cGroup)content).get(0);
....@@ -2131,19 +2659,19 @@
21312659 }
21322660
21332661 } else
2134
- if (event.getSource() == revertMeshItem)
2662
+ if (source == revertMeshItem)
21352663 {
21362664 RevertMeshes();
21372665 } else
2138
- if (event.getSource() == resetMeshItem)
2666
+ if (source == resetAllItem)
21392667 {
21402668 ResetAll();
21412669 } else
2142
- if (event.getSource() == stepAllItem)
2670
+ if (source == stepAllItem)
21432671 {
21442672 StepAll();
21452673 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2674
+ if (source == deleteItem) // || event.getSource() == clearButton)
21472675 {
21482676 //int indices[] = jList.getSelectedIndices();
21492677 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2679,46 @@
21512679
21522680 ClearSelection(false);
21532681 } else
2154
- if (event.getSource() == clearAllItem)
2682
+ if (source == clearAllItem)
21552683 {
21562684 ClearSelection(true);
21572685 } else
2158
- if (event.getSource() == grabItem)
2686
+ if (source == grabItem || source == groupButton)
21592687 {
2160
- group(new cGroup(), true);
2688
+ group(new cGroup(), false); // true);
21612689 } else
2162
- if (event.getSource() == frontItem)
2690
+ if (source == hideItem)
2691
+ {
2692
+ group(new HiddenObject());
2693
+ } else
2694
+ if (source == frontItem)
21632695 {
21642696 front();
21652697 } else
2166
- if (event.getSource() == backItem)
2698
+ if (source == backItem)
21672699 {
21682700 back();
21692701 } else
2170
- if (event.getSource() == cameraItem)
2702
+ if (source == cameraItem)
21712703 {
21722704 makeSomething(new Camera());
21732705 } else
2174
- if (event.getSource() == compositeItem)
2706
+ if (source == compositeItem || source == compositeButton)
21752707 {
21762708 group(new Composite());
21772709 } else
2178
- if (event.getSource() == randomItem)
2710
+ if (source == switchItem || source == switchButton)
21792711 {
21802712 RandomNode random = new RandomNode();
21812713 group(random);
21822714 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2715
+ random.name = random.get(0).name + "Switch";
21842716 } else
2185
- if (event.getSource() == physicsItem)
2717
+ if (source == physicsItem)
21862718 {
21872719 group(new PhysicsNode());
21882720 } else
2189
- if (event.getSource() == frameselectorItem)
2721
+ if (source == frameselectorItem)
21902722 {
21912723 for (int i=0; i<group.selection.size(); i++)
21922724 {
....@@ -2198,7 +2730,7 @@
21982730 ResetModel();
21992731 refreshContents();
22002732 } else
2201
- if (event.getSource() == switchGeoItem)
2733
+ if (source == switchGeoItem)
22022734 {
22032735 for (int i=0; i<group.selection.size(); i++)
22042736 {
....@@ -2210,7 +2742,7 @@
22102742 ResetModel();
22112743 refreshContents();
22122744 } else
2213
- if (event.getSource() == switchTransfoItem)
2745
+ if (source == switchTransfoItem)
22142746 {
22152747 for (int i=0; i<group.selection.size(); i++)
22162748 {
....@@ -2222,7 +2754,7 @@
22222754 ResetModel();
22232755 refreshContents();
22242756 } else
2225
- if (event.getSource() == morphItem)
2757
+ if (source == morphItem)
22262758 {
22272759 for (int i=0; i<group.selection.size(); i++)
22282760 {
....@@ -2234,7 +2766,7 @@
22342766 ResetModel();
22352767 refreshContents();
22362768 } else
2237
- if (event.getSource() == scriptNodeItem)
2769
+ if (source == scriptNodeItem)
22382770 {
22392771 boolean atleastone = false;
22402772
....@@ -2273,195 +2805,252 @@
22732805 }
22742806 }
22752807 } else
2276
- if (event.getSource() == linkerItem)
2808
+ if (source == linkerItem)
22772809 {
22782810 group(new cLinker());
22792811 } else
2280
- if (event.getSource() == textureItem)
2812
+ if (source == textureItem || source == textureButton)
22812813 {
22822814 group(new TextureNode());
22832815 } else
2284
- if (event.getSource() == shadowXItem)
2816
+ if (source == billboardItem)
2817
+ {
2818
+ group(new BillboardNode());
2819
+ } else
2820
+ if (source == shadowXItem)
22852821 {
22862822 CastShadow(0);
22872823 } else
2288
- if (event.getSource() == shadowYItem)
2824
+ if (source == shadowYItem)
22892825 {
22902826 CastShadow(1);
22912827 } else
2292
- if (event.getSource() == shadowZItem)
2828
+ if (source == shadowZItem)
22932829 {
22942830 CastShadow(2);
22952831 } else
2296
- if (event.getSource() == ungroupItem)
2832
+ if (source == ungroupItem || source == ungroupButton)
22972833 {
2298
- ungroup();
2834
+ boolean hasRoot = false;
2835
+
2836
+ for (int i=0; i<group.selection.size(); i++)
2837
+ {
2838
+ if (group.selection.get(i) == group)
2839
+ {
2840
+ hasRoot = true;
2841
+ break;
2842
+ }
2843
+ }
2844
+
2845
+ if (!hasRoot)
2846
+ {
2847
+ for (int i=0; i<group.selection.size(); i++)
2848
+ {
2849
+ Ungroup(group.selection.get(i));
2850
+ }
2851
+
2852
+ ClearSelection(false);
2853
+
2854
+ refreshContents();
2855
+ }
22992856 } else
2300
- if (event.getSource() == genUVItem)
2857
+ if (source == genUVItem)
23012858 {
23022859 GenUV();
23032860 } else
2304
- if (event.getSource() == genNormalsCADItem)
2861
+ if (source == genNormalsCADItem)
23052862 {
23062863 GenNormals(true);
23072864 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2865
+ if (source == genNormalsMESHItem)
2866
+ {
2867
+ GenNormalsMESH();
2868
+ } else
2869
+ if (source == genNormalsORGANItem)
23092870 {
23102871 GenNormals(false);
23112872 } else
2312
- if (event.getSource() == stripifyItem)
2873
+ if (source == genNormalsMINEItem)
2874
+ {
2875
+ GenNormalsMINE();
2876
+ } else
2877
+ if (source == stripifyItem)
23132878 {
23142879 Stripify();
23152880 } else
2316
- if (event.getSource() == unstripifyItem)
2881
+ if (source == unstripifyItem)
23172882 {
23182883 Unstripify();
23192884 } else
2320
- if (event.getSource() == trimItem)
2885
+ if (source == trimItem)
23212886 {
23222887 Trim();
23232888 } else
2324
- if (event.getSource() == untrimItem)
2889
+ if (source == untrimItem)
23252890 {
23262891 Untrim();
23272892 } else
2328
- if (event.getSource() == clearColorsItem)
2893
+ if (source == clearColorsItem)
23292894 {
23302895 ClearColors();
23312896 } else
2332
- if (event.getSource() == clearMaterialsItem)
2897
+ if (source == clearMaterialsItem)
23332898 {
23342899 ClearMaterials();
23352900 } else
2336
- if (event.getSource() == liveleavesItem)
2901
+ if (source == liveleavesItem)
23372902 {
23382903 LiveLeaves(true);
23392904 } else
2340
- if (event.getSource() == unliveleavesItem)
2905
+ if (source == unliveleavesItem)
23412906 {
23422907 LiveLeaves(false);
23432908 } else
2344
- if (event.getSource() == supportleavesItem)
2909
+ if (source == supportleavesItem)
23452910 {
23462911 SupportLeaves(true);
23472912 } else
2348
- if (event.getSource() == unsupportleavesItem)
2913
+ if (source == unsupportleavesItem)
23492914 {
23502915 SupportLeaves(false);
23512916 } else
2352
- if (event.getSource() == hideleavesItem)
2917
+ if (source == hideleavesItem)
23532918 {
23542919 HideLeaves(true);
23552920 } else
2356
- if (event.getSource() == showleavesItem)
2921
+ if (source == showleavesItem)
23572922 {
23582923 HideLeaves(false);
23592924 } else
2360
- if (event.getSource() == markleavesItem)
2925
+ if (source == markleavesItem)
23612926 {
23622927 MarkLeaves(true);
23632928 } else
2364
- if (event.getSource() == unmarkleavesItem)
2929
+ if (source == unmarkleavesItem)
23652930 {
23662931 MarkLeaves(false);
23672932 } else
2368
- if (event.getSource() == flipVItem)
2933
+ if (source == rewindleavesItem)
2934
+ {
2935
+ RewindLeaves(true);
2936
+ } else
2937
+ if (source == unrewindleavesItem)
2938
+ {
2939
+ RewindLeaves(false);
2940
+ } else
2941
+ if (source == randomleavesItem)
2942
+ {
2943
+ RandomLeaves(true);
2944
+ } else
2945
+ if (source == unrandomleavesItem)
2946
+ {
2947
+ RandomLeaves(false);
2948
+ } else
2949
+ if (source == flipVItem)
23692950 {
23702951 FlipV(true);
23712952 } else
2372
- if (event.getSource() == unflipVItem)
2953
+ if (source == unflipVItem)
23732954 {
23742955 FlipV(false);
23752956 } else
2376
- if (event.getSource() == lowTexturesItem)
2957
+ if (source == lowTexturesItem)
23772958 {
23782959 SetTexRes(0);
23792960 } else
2380
- if (event.getSource() == normalTexturesItem)
2961
+ if (source == normalTexturesItem)
23812962 {
23822963 SetTexRes(1);
23832964 } else
2384
- if (event.getSource() == highTexturesItem)
2965
+ if (source == highTexturesItem)
23852966 {
23862967 SetTexRes(2);
23872968 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2969
+ if (source == veryhighTexturesItem)
23892970 {
23902971 SetTexRes(3);
23912972 } else
2392
- if (event.getSource() == maxTexturesItem)
2973
+ if (source == maxTexturesItem)
23932974 {
23942975 SetTexRes(4);
23952976 } else
2396
- if (event.getSource() == panoTexturesItem)
2977
+ if (source == panoTexturesItem)
23972978 {
23982979 SetTexRes(5);
23992980 } else
2400
- if (event.getSource() == reverseNormalsItem)
2981
+ if (source == reverseNormalsItem)
24012982 {
24022983 ReverseNormals();
24032984 } else
2404
- if (event.getSource() == parseverticesItem)
2985
+ if (source == parseverticesItem)
24052986 {
24062987 ParseVertices();
24072988 } else
2408
- if (event.getSource() == textureFieldItem)
2989
+ if (source == textureFieldItem)
24092990 {
24102991 TextureVertices();
24112992 } else
2412
- if (event.getSource() == alignItem)
2993
+ if (source == alignItem)
24132994 {
24142995 Align();
24152996 } else
2416
- if (event.getSource() == mirrorItem)
2997
+ if (source == mirrorItem)
24172998 {
24182999 MirrorPoses();
24193000 } else
2420
- if (event.getSource() == reduceMorphItem)
3001
+ if (source == reduceMorphItem)
24213002 {
24223003 MeshReduction(false);
24233004 } else
2424
- if (event.getSource() == reduce34MorphItem)
3005
+ if (source == reduce34MorphItem)
24253006 {
24263007 MeshReduction(true);
24273008 } else
2428
- if (event.getSource() == reverseTrianglesItem)
3009
+ if (source == reverseTrianglesItem)
24293010 {
24303011 ReverseTriangles();
24313012 } else
2432
- if (event.getSource() == reduceMeshItem)
3013
+ if (source == reduceMeshItem)
24333014 {
24343015 ReduceMesh(false);
24353016 } else
2436
- if (event.getSource() == reduce34MeshItem)
3017
+ if (source == reduce34MeshItem)
24373018 {
24383019 ReduceMesh(true);
24393020 } else
2440
- if (event.getSource() == increaseMeshItem)
3021
+ if (source == increaseMeshItem)
24413022 {
24423023 IncreaseMesh();
24433024 } else
2444
- if (event.getSource() == clipMeshItem)
3025
+ if (source == clipMeshItem)
24453026 {
24463027 ClipMesh();
24473028 } else
2448
- if (event.getSource() == smoothMeshItem)
3029
+ if (source == smoothMeshItem)
24493030 {
24503031 SmoothMesh();
24513032 } else
2452
- if (event.getSource() == transformgeometryItem)
3033
+ if (source == transformGeometryItem)
24533034 {
24543035 TransformGeometry();
24553036 } else
2456
- if (event.getSource() == resetTransformItem)
3037
+ if (source == transformChildrenItem)
3038
+ {
3039
+ TransformChildren();
3040
+ } else
3041
+ if (source == resetTransformItem)
24573042 {
24583043 ResetTransform();
24593044 } else
2460
- if (event.getSource() == resetCentroidItem)
3045
+ if (source == resetCentroidItem)
24613046 {
2462
- ResetCentroid();
3047
+ ResetCentroid(true);
24633048 } else
2464
- if (event.getSource() == resetParentItem)
3049
+ if (source == resetCentroidXZItem)
3050
+ {
3051
+ ResetCentroid(false);
3052
+ } else
3053
+ if (source == resetParentItem)
24653054 {
24663055 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673056 {
....@@ -2471,7 +3060,7 @@
24713060
24723061 refreshContents();
24733062 } else
2474
- if (event.getSource() == repairParentItem)
3063
+ if (source == repairParentItem)
24753064 {
24763065 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773066 {
....@@ -2485,7 +3074,21 @@
24853074
24863075 refreshContents();
24873076 } else
2488
- if (event.getSource() == sortbysizeItem)
3077
+ if (source == repairShadowItem)
3078
+ {
3079
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3080
+ {
3081
+ Object3D obj = (Object3D)e.nextElement();
3082
+ obj.RepairShadow();
3083
+// for (int i=0; i<obj.size(); i++)
3084
+// {
3085
+// obj.get(i).parent = obj;
3086
+// }
3087
+ }
3088
+
3089
+ refreshContents();
3090
+ } else
3091
+ if (source == sortbysizeItem)
24893092 {
24903093 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913094 {
....@@ -2497,7 +3100,7 @@
24973100 ResetModel();
24983101 refreshContents();
24993102 } else
2500
- if (event.getSource() == sortbynameItem)
3103
+ if (source == sortbynameItem)
25013104 {
25023105 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033106 {
....@@ -2509,7 +3112,7 @@
25093112 ResetModel();
25103113 refreshContents();
25113114 } else
2512
- if (event.getSource() == attachPigmentItem)
3115
+ if (source == attachPigmentItem)
25133116 {
25143117 String texture = GetFile("Attach pigment");
25153118 Object3D obj;
....@@ -2521,7 +3124,7 @@
25213124
25223125 refreshContents();
25233126 } else
2524
- if (event.getSource() == detachPigmentItem)
3127
+ if (source == detachPigmentItem)
25253128 {
25263129 Object3D obj;
25273130 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3135,7 @@
25323135
25333136 refreshContents();
25343137 } else
2535
- if (event.getSource() == attachBumpItem)
3138
+ if (source == attachBumpItem)
25363139 {
25373140 String texture = GetFile("Attach bump");
25383141 Object3D obj;
....@@ -2544,18 +3147,18 @@
25443147
25453148 refreshContents();
25463149 } else
2547
- if (event.getSource() == detachBumpItem)
3150
+ if (source == detachBumpItem)
25483151 {
25493152 Object3D obj;
25503153 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25513154 {
25523155 obj = (Object3D)e.nextElement();
2553
- obj.SetBumpTexture(null);
3156
+ obj.ResetBumpTexture();
25543157 }
25553158
25563159 refreshContents();
25573160 } else
2558
- if (event.getSource() == pigmentBumpItem)
3161
+ if (source == pigmentBumpItem)
25593162 {
25603163 Object3D obj;
25613164 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3169,237 @@
25663169
25673170 refreshContents();
25683171 } else
2569
- if (event.getSource() == flashSelectionButton)
3172
+ if (source == flashSelectionButton)
25703173 {
25713174 CameraPane.flash = true;
25723175 refreshContents();
25733176 } else
2574
- if (event.getSource() == oneButton)
3177
+ if (source == oneButton)
25753178 {
25763179 } else
2577
- if (event.getSource() == twoButton)
3180
+ if (source == twoButton)
25783181 {
25793182 radio.layout = twoButton;
3183
+
3184
+ if (CameraPane.FULLSCREEN)
3185
+ fullscreenLayout = radio.layout;
3186
+
25803187 // bug
25813188 //gridPanel.setDividerLocation(1.0);
25823189 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3190
+// bigThree.remove(scenePanel);
3191
+// bigThree.remove(centralPanel);
3192
+// bigThree.remove(XYZPanel);
3193
+// aWindowConstraints.gridx = 0;
3194
+// aWindowConstraints.gridy = 0;
3195
+// aWindowConstraints.gridwidth = 1;
3196
+// // aConstraints.gridheight = 3;
3197
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3198
+// aWindowConstraints.weightx = 0;
3199
+// aWindowConstraints.weighty = 1;
3200
+// //bigThree.add(jtp, aWindowConstraints);
3201
+// aWindowConstraints.weightx = 1;
3202
+// aWindowConstraints.gridwidth = 3;
3203
+// // aConstraints.gridheight = 3;
3204
+// aWindowConstraints.gridx = 1;
3205
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3206
+// bigThree.add(centralPanel, aWindowConstraints);
3207
+// aWindowConstraints.weightx = 0;
3208
+// aWindowConstraints.gridx = 4;
3209
+// aWindowConstraints.gridwidth = 1;
3210
+// // aConstraints.gridheight = 3;
3211
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3212
+// //bigThree.add(XYZPanel, aWindowConstraints);
3213
+// scenePanel.setVisible(false);
3214
+// centralPanel.setVisible(true);
3215
+// XYZPanel.setVisible(false);
3216
+ bigThree.ClearUI();
3217
+ bigThree.add(centralPanel);
3218
+ bigThree.FlushUI();
3219
+
3220
+ cameraView.requestFocusInWindow();
3221
+
3222
+// refreshContents(true);
3223
+//
3224
+// try
3225
+// {
3226
+// java.awt.Robot bot = new java.awt.Robot();
3227
+// int mask = InputEvent.BUTTON1_MASK;
3228
+// bot.mouseMove(100, 100);
3229
+// bot.mousePress(mask);
3230
+// bot.mouseRelease(mask);
3231
+// }
3232
+// catch (Exception e)
3233
+// {
3234
+//
3235
+// }
3236
+
26073237 } else
2608
- if (event.getSource() == threeButton)
3238
+ if (source == threeButton)
26093239 {
26103240 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
3241
+
3242
+ if (CameraPane.FULLSCREEN)
3243
+ fullscreenLayout = radio.layout;
3244
+
3245
+// bigThree.remove(scenePanel);
3246
+// bigThree.remove(centralPanel);
3247
+// bigThree.remove(XYZPanel);
3248
+// aWindowConstraints.gridx = 0;
3249
+// aWindowConstraints.gridy = 0;
3250
+// aWindowConstraints.gridwidth = 1;
3251
+// // aConstraints.gridheight = 3;
3252
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3253
+// aWindowConstraints.weightx = 0;
3254
+// aWindowConstraints.weighty = 1;
3255
+// //bigThree.add(jtp, aWindowConstraints);
3256
+// aWindowConstraints.weightx = 1;
3257
+// aWindowConstraints.gridwidth = 3;
3258
+// // aConstraints.gridheight = 3;
3259
+// aWindowConstraints.gridx = 1;
3260
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3261
+// bigThree.add(centralPanel, aWindowConstraints);
3262
+// aWindowConstraints.weightx = 0;
3263
+// aWindowConstraints.gridx = 4;
3264
+// aWindowConstraints.gridwidth = 1;
3265
+// // aConstraints.gridheight = 3;
3266
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3267
+// bigThree.add(XYZPanel, aWindowConstraints);
3268
+// bigThree.validate();
3269
+// scenePanel.setVisible(false);
3270
+// centralPanel.setVisible(true);
3271
+// XYZPanel.setVisible(true);
3272
+ bigThree.ClearUI();
3273
+ bigThree.add(centralPanel);
3274
+ bigThree.add(XYZPanel);
3275
+ bigThree.FlushUI();
3276
+
3277
+ cameraView.requestFocusInWindow();
26353278 } else
2636
- if (event.getSource() == fourButton)
3279
+ if (source == fourButton)
26373280 {
26383281 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3282
+
3283
+ if (CameraPane.FULLSCREEN)
3284
+ fullscreenLayout = radio.layout;
3285
+
3286
+// bigThree.remove(scenePanel);
3287
+// bigThree.remove(centralPanel);
3288
+// bigThree.remove(XYZPanel);
3289
+// aWindowConstraints.gridx = 0;
3290
+// aWindowConstraints.gridy = 0;
3291
+// aWindowConstraints.gridwidth = 1;
3292
+// // aWindowConstraints.gridheight = 3;
3293
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3294
+// aWindowConstraints.weightx = 1;
3295
+// aWindowConstraints.weighty = 1;
3296
+// bigThree.add(scenePanel, aWindowConstraints);
3297
+// aWindowConstraints.weightx = 1;
3298
+// aWindowConstraints.gridwidth = 3;
3299
+// // aConstraints.gridheight = 3;
3300
+// aWindowConstraints.gridx = 1;
3301
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3302
+// //bigThree.add(cameraPanel, aWindowConstraints);
3303
+// aWindowConstraints.weightx = 0;
3304
+// aWindowConstraints.gridx = 4;
3305
+// aWindowConstraints.gridwidth = 1;
3306
+// // aWindowConstraints.gridheight = 3;
3307
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3308
+// //bigThree.add(XYZPanel, aWindowConstraints);
3309
+// bigThree.validate();
3310
+// scenePanel.setVisible(true);
3311
+// centralPanel.setVisible(false);
3312
+// XYZPanel.setVisible(false);
3313
+ bigThree.ClearUI();
3314
+ bigThree.add(scenePanel);
3315
+ bigThree.FlushUI();
3316
+
3317
+ cameraView.requestFocusInWindow();
26633318 } else
2664
- if (event.getSource() == sixButton)
3319
+ if (source == sixButton)
26653320 {
26663321 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
3322
+
3323
+ if (CameraPane.FULLSCREEN)
3324
+ fullscreenLayout = radio.layout;
3325
+
3326
+// bigThree.remove(scenePanel);
3327
+// bigThree.remove(centralPanel);
3328
+// bigThree.remove(XYZPanel);
3329
+// aWindowConstraints.gridx = 0;
3330
+// aWindowConstraints.gridy = 0;
3331
+// aWindowConstraints.gridwidth = 1;
3332
+// // aConstraints.gridheight = 3;
3333
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3334
+// aWindowConstraints.weightx = 0;
3335
+// aWindowConstraints.weighty = 1;
3336
+// bigThree.add(scenePanel, aWindowConstraints);
3337
+// aWindowConstraints.weightx = 1;
3338
+// aWindowConstraints.gridwidth = 3;
3339
+// // aWindowConstraints.gridheight = 3;
3340
+// aWindowConstraints.gridx = 1;
3341
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3342
+// bigThree.add(centralPanel, aWindowConstraints);
3343
+// aWindowConstraints.weightx = 0;
3344
+// aWindowConstraints.gridx = 4;
3345
+// aWindowConstraints.gridwidth = 1;
3346
+// // aWindowConstraints.gridheight = 3;
3347
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3348
+// //bigThree.add(XYZPanel, aConstraints);
3349
+// bigThree.validate();
3350
+// scenePanel.setVisible(true);
3351
+// centralPanel.setVisible(true);
3352
+// XYZPanel.setVisible(false);
3353
+ bigThree.ClearUI();
3354
+ bigThree.add(scenePanel);
3355
+ bigThree.add(centralPanel);
3356
+ bigThree.FlushUI();
3357
+
3358
+ cameraView.requestFocusInWindow();
26913359 } else
2692
- if (event.getSource() == sevenButton)
3360
+ if (source == sevenButton)
26933361 {
26943362 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3363
+
3364
+ if (CameraPane.FULLSCREEN)
3365
+ fullscreenLayout = radio.layout;
3366
+
3367
+// bigThree.remove(scenePanel);
3368
+// bigThree.remove(centralPanel);
3369
+// bigThree.remove(XYZPanel);
3370
+// aWindowConstraints.gridx = 0;
3371
+// aWindowConstraints.gridy = 0;
3372
+// aWindowConstraints.gridwidth = 1;
3373
+// // aWindowConstraints.gridheight = 3;
3374
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3375
+// aWindowConstraints.weightx = 0;
3376
+// aWindowConstraints.weighty = 1;
3377
+// bigThree.add(scenePanel, aWindowConstraints);
3378
+// aWindowConstraints.weightx = 1;
3379
+// aWindowConstraints.gridwidth = 3;
3380
+// // aWindowConstraints.gridheight = 3;
3381
+// aWindowConstraints.gridx = 1;
3382
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3383
+// bigThree.add(centralPanel, aWindowConstraints);
3384
+// aWindowConstraints.weightx = 0;
3385
+// aWindowConstraints.gridx = 4;
3386
+// aWindowConstraints.gridwidth = 1;
3387
+// // aConstraints.gridheight = 3;
3388
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3389
+// bigThree.add(XYZPanel, aWindowConstraints);
3390
+// bigThree.validate();
3391
+// scenePanel.setVisible(true);
3392
+// centralPanel.setVisible(true);
3393
+// XYZPanel.setVisible(true);
3394
+ bigThree.ClearUI();
3395
+ bigThree.add(scenePanel);
3396
+ bigThree.add(centralPanel);
3397
+ bigThree.add(XYZPanel);
3398
+ bigThree.FlushUI();
3399
+
3400
+ cameraView.requestFocusInWindow();
27193401 } else
2720
- if (event.getSource() == rootButton)
3402
+ if (source == rootButton)
27213403 {
27223404 Object3D obj;
27233405 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3409,84 @@
27273409 EditObject(obj);
27283410 }
27293411
3412
+ cameraView.requestFocusInWindow();
27303413 refreshContents(true);
27313414 } else
2732
- if (event.getSource() == closeButton)
3415
+ if (source == closeButton)
27333416 {
27343417 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353418 cRadio ab;
27363419 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373420 {
27383421 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3422
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403423 {
3424
+ // Patch to avoid bug with transparency.
3425
+ if (!ab.hadMaterial)
3426
+ {
3427
+ ab.object.material = null;
3428
+ }
3429
+
27413430 buttonGroup.remove(ab);
27423431 radioPanel.remove(ab);
27433432
2744
- ab.GetObject().editWindow = null;
3433
+ //ab.GetObject().editWindow = null;
3434
+ ab.GetObject().manipWindow = null;
27453435 // ab.GetObject().objectUI = null; // ?????????
27463436
27473437 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483438 break;
27493439 }
27503440 }
3441
+
3442
+ cameraView.requestFocusInWindow();
27513443 refreshContents(true);
27523444 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3445
+ if (source == editItem || source == editButton)
27543446 {
3447
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3448
+ {
3449
+ Object3D child = (Object3D)e.nextElement();
3450
+ child.pinned = true;
3451
+ }
3452
+
27553453 EditSelection(false);
27563454 } else
2757
- if (event.getSource() == uneditButton)
3455
+ if (source == uneditButton)
27583456 {
27593457 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603458 {
27613459 Object3D child = (Object3D)e.nextElement();
27623460 if(child.editWindow != null)
27633461 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3462
+ child.pinned = false;
27643463 child.CloseUI();
27653464 listUI.remove(child);
27663465
2767
- child.editWindow = null; // ???????????
3466
+ //child.editWindow = null; // ???????????
27683467 }
2769
- objEditor.ctrlPanel.revalidate();
3468
+ objEditor.ctrlPanel.FlushUI();
27703469 //objEditor.jTree.clearSelection();
27713470 //objEditor.ResetSliders();
27723471 refreshContents(true);
27733472 } else
2774
- if (event.getSource() == clearPanelButton)
3473
+ if (source == clearPanelButton)
27753474 {
27763475 assert(copy == group);
27773476 //copy.ClearUI();
27783477 for (Object3D obj : listUI)
27793478 {
3479
+ obj.pinned = false;
27803480 obj.CloseUI();
27813481 }
27823482 listUI.clear();
27833483 refreshContents(true);
27843484 } else
2785
- if (event.getSource() == allParamsButton)
3485
+ if (source == allParamsButton)
27863486 {
27873487 assert(copy == group);
27883488
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3489
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903490
27913491 for (Object3D obj : listUI)
27923492 {
....@@ -2803,19 +3503,19 @@
28033503
28043504 refreshContents(true);
28053505 } else
2806
- if (event.getSource() == unselectButton)
3506
+ if (source == unselectButton)
28073507 {
28083508 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3509
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103510 objEditor.ResetSliders();
28113511 refreshContents(true);
28123512 } else
2813
- if(event.getSource() instanceof cRadio)
3513
+ if(source instanceof cRadio)
28143514 {
28153515 group.parent = keepparent;
28163516 group.attributes = 0;
28173517 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3518
+ /*cRadio*/ radio = (cRadio)source;
28193519 Object3D obj = radio.GetObject();
28203520 System.out.println("Edit " + obj);
28213521 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3535,10 @@
28353535 }
28363536
28373537 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3538
+
3539
+ SetUndoStates();
3540
+
3541
+ //Globals.theRenderer.object = group;
28393542 if(!useclient)
28403543 {
28413544 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3547,52 @@
28443547 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453548 cameraView.targetLookAt.set(radio.camera.lookAt);
28463549 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3550
+ //cameraView.lighttouched = true;
3551
+ Globals.lighttouched = true;
28483552 topView.object = group;
28493553 frontView.object = group;
28503554 sideView.object = group;
28513555 }
2852
- group.editWindow = this;
3556
+
3557
+// fix "+" issue
3558
+ //group.editWindow = this;
3559
+ group.manipWindow = this;
3560
+
28533561 /*
28543562 currentLayout = radio.layout;
28553563 if (currentLayout == null)
28563564 currentLayout = sevenButton;
28573565 */
28583566 radio.layout.doClick();
3567
+
3568
+ ClearUnpinned();
3569
+ //Grafreed.Assert(group != null);
3570
+ //Grafreed.Assert(group.selection != null);
3571
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3572
+ if (group.selection == null || group.selection.size() == 1)
3573
+ EditSelection(false);
28593574 keepparent = group.parent;
28603575 // PARENT = NULL or not???
28613576 //group.parent = null; // ROOT
28623577 //group.attributes = -1;
28633578 ResetModel();
3579
+
3580
+ cameraView.requestFocusInWindow();
28643581 refreshContents(true);
2865
- }
3582
+ } else if (event.getSource() == editCameraItem)
3583
+ {
3584
+ cameraView.ProtectCamera();
3585
+ cameraView.repaint();
3586
+ return;
3587
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3588
+ {
3589
+ cameraView.RevertCamera();
3590
+ cameraView.repaint();
3591
+ return;
3592
+ // } else if (event.getSource() == textureButton)
3593
+ // {
3594
+ // return; // true;
3595
+ }
28663596 else
28673597 {
28683598 //return super.action(event, arg);
....@@ -2871,7 +3601,6 @@
28713601 }
28723602
28733603 boolean useclient = false;
2874
- cRadio radio;
28753604
28763605 void ToggleRoot()
28773606 {
....@@ -2880,7 +3609,7 @@
28803609 if (useclient)
28813610 {
28823611 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3612
+ Globals.lighttouched = true;
28843613 //topView.object = client;
28853614 //frontView.object = client;
28863615 //sideView.object = client;
....@@ -2888,7 +3617,7 @@
28883617 else
28893618 {
28903619 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3620
+ Globals.lighttouched = true;
28923621 //topView.object = group;
28933622 //frontView.object = group;
28943623 //sideView.object = group;
....@@ -2923,6 +3652,28 @@
29233652 refreshContents();
29243653 }
29253654
3655
+ void TransformChildren()
3656
+ {
3657
+ Object3D obj;
3658
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3659
+ {
3660
+ obj = (Object3D)e.nextElement();
3661
+ obj.KeepTextureMatrices();
3662
+ obj.TransformChildren();
3663
+ obj.RestoreTextureMatrices();
3664
+
3665
+// if (obj.parent == null)
3666
+// {
3667
+// System.out.println("NULL PARENT!");
3668
+// new Exception().printStackTrace();
3669
+// }
3670
+// else
3671
+// TouchTransform(obj);
3672
+// //obj.parent.Touch();
3673
+ }
3674
+
3675
+ refreshContents();
3676
+ }
29263677
29273678 void ResetTransform()
29283679 {
....@@ -3035,7 +3786,7 @@
30353786 refreshContents();
30363787 }
30373788
3038
- void ResetCentroid()
3789
+ void ResetCentroid(boolean full)
30393790 {
30403791 Object3D obj;
30413792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3801,16 @@
30503801 LA.matIdentity(Object3D.mat);
30513802 obj.getBounds(minima, maxima, false);
30523803 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3804
+ if (full)
3805
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543806 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553807 obj.TransformMesh(Object3D.mat);
3808
+
30563809 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3810
+ if (full)
3811
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583812 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3813
+
30593814 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603815 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613816 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3839,8 @@
30843839
30853840 int size = obj.MemorySize();
30863841
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3842
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3843
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883844 }
30893845 }
30903846 catch (Exception e)
....@@ -3121,9 +3877,9 @@
31213877 obj = (Object3D)e.nextElement();
31223878
31233879 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3880
+ Grafreed.AnalyzeObject(obj);
31253881 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3882
+ Grafreed.AnalyzeObject(obj.bRep);
31273883
31283884 // System.err.println((size/1024) + " KB is the size of " + obj);
31293885 }
....@@ -3165,6 +3921,20 @@
31653921 void GenNormals(boolean crease)
31663922 {
31673923 group.GenNormalsS(crease);
3924
+
3925
+ refreshContents();
3926
+ }
3927
+
3928
+ void GenNormalsMESH()
3929
+ {
3930
+ group.GenNormalsMeshS();
3931
+
3932
+ refreshContents();
3933
+ }
3934
+
3935
+ void GenNormalsMINE()
3936
+ {
3937
+ group.selection.GenNormalsMINE();
31683938
31693939 refreshContents();
31703940 }
....@@ -3250,7 +4020,7 @@
32504020 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32514021 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32524022 //
3253
-// g.add(GraphreeD.clipboard);
4023
+// g.add(GrafreeD.clipboard);
32544024 //
32554025 // buffer.add(g);
32564026 // }
....@@ -3269,8 +4039,8 @@
32694039 // nodes = new Object3D();
32704040 // vertices = new Vector<Vertex>();
32714041 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
4042
+// boolean epsequal = GrafreeD.epsequal;
4043
+// GrafreeD.epsequal = true;
32744044 //
32754045 // for (int i=0; i<group.selection.size(); i++)
32764046 // {
....@@ -3311,7 +4081,7 @@
33114081 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124082 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134083 //
3314
-// g.add(GraphreeD.clipboard);
4084
+// g.add(GrafreeD.clipboard);
33154085 //
33164086 // buffer.add(g);
33174087 // }
....@@ -3319,7 +4089,7 @@
33194089 // makeSomething(buffer, i==group.selection.size()-1);
33204090 // }
33214091 //
3322
-// GraphreeD.epsequal = epsequal;
4092
+// GrafreeD.epsequal = epsequal;
33234093 //
33244094 // //buffer = null;
33254095 // temprep = null;
....@@ -3330,8 +4100,8 @@
33304100
33314101 void ParseVertices()
33324102 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4103
+ boolean epsequal = Grafreed.epsequal;
4104
+ Grafreed.epsequal = true;
33354105
33364106 for (int i=0; i<group.selection.size(); i++)
33374107 {
....@@ -3356,7 +4126,7 @@
33564126 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574127 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584128
3359
- g.add(GraphreeD.clipboard);
4129
+ g.add(Grafreed.clipboard);
33604130
33614131 buffer.add(g);
33624132 }
....@@ -3371,7 +4141,7 @@
33714141 makeSomething(buffer, i==group.selection.size()-1);
33724142 }
33734143
3374
- GraphreeD.epsequal = epsequal;
4144
+ Grafreed.epsequal = epsequal;
33754145
33764146 refreshContents();
33774147 }
....@@ -3389,7 +4159,16 @@
33894159 String pigment = Object3D.GetPigment(tex);
33904160 //String bump = Object3D.GetBump(tex);
33914161
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4162
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4163
+
4164
+ try
4165
+ {
4166
+ texturedata = Globals.theRenderer.GetTextureData(tex.pigmenttexture, pigment, false, node.texres);
4167
+ }
4168
+ catch (Exception e)
4169
+ {
4170
+ System.err.println("FAIL: " + node);
4171
+ }
33934172
33944173 double s = v.s;
33954174
....@@ -3416,7 +4195,7 @@
34164195 scale /= 3;
34174196
34184197 scale /= 0xFF;
3419
- scale /= 4;
4198
+ // c'est quoi ca? scale /= 4;
34204199
34214200 //v.AO = scale;
34224201
....@@ -3437,12 +4216,26 @@
34374216
34384217 void Align()
34394218 {
4219
+ if (group.selection.size() == 0)
4220
+ return;
4221
+
4222
+ cVector bbmin = new cVector();
4223
+ cVector bbmax = new cVector();
4224
+
4225
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4226
+
4227
+ double dx = bbmax.x - bbmin.x;
4228
+ double dy = bbmax.y - bbmin.y;
4229
+ double dz = bbmax.z - bbmin.z;
4230
+
4231
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4232
+
34404233 for (int i=0; i<group.selection.size(); i++)
34414234 {
34424235 Object3D obj = group.selection.get(i);
34434236
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4237
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4238
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464239 }
34474240
34484241 refreshContents();
....@@ -3455,7 +4248,7 @@
34554248 // ref.SaveSupports();
34564249 // Object3D par = ref.parent;
34574250 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4251
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594252 // ref.parent = par;
34604253 // ref.RestoreSupports();
34614254
....@@ -3463,11 +4256,11 @@
34634256
34644257 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654258
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4259
+ boolean random = CameraPane.SWITCH;
4260
+ CameraPane.SWITCH = false; // parse all random nodes
34684261 lowres.linkVerticesThis(null);
34694262 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4263
+ CameraPane.SWITCH = random;
34714264
34724265 System.err.flush();
34734266
....@@ -3485,7 +4278,7 @@
34854278 // lowres.SaveSupports();
34864279 // par = lowres.parent;
34874280 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4281
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894282 Object3D newlow = CloneObject(lowres, false);
34904283 newlow.name = sn.switchobject.get(i).name;
34914284 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4300,7 @@
35074300 return;
35084301
35094302 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4303
+ Object3D ref = Grafreed.clipboard.get(0);
35114304
35124305 Object3D newgroup = new Object3D("Po:" + poses.name);
35134306
....@@ -3676,7 +4469,7 @@
36764469 group.selection.RelinkToSupport(); // july 2014
36774470 System.out.println("DONE.");
36784471 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4472
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804473 }
36814474
36824475 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4494,20 @@
37014494
37024495 void ClipMesh()
37034496 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4497
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054498 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4499
+ Object3D content = Grafreed.clipboard.get(0);
37074500
37084501 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094502 content = ((cGroup)content).get(0);
37104503
37114504 // for (int i=0; i<group.selection.size(); i++)
37124505 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4506
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144507 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4508
+ group.selection.ClipMesh(Grafreed.clipboard);
37164509 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4510
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184511 System.out.println("DONE.");
37194512 refreshContents();
37204513 }
....@@ -3759,6 +4552,18 @@
37594552 void MarkLeaves(boolean hide)
37604553 {
37614554 group.selection.MarkLeaves(hide);
4555
+ refreshContents();
4556
+ }
4557
+
4558
+ void RewindLeaves(boolean hide)
4559
+ {
4560
+ group.selection.RewindLeaves(hide);
4561
+ refreshContents();
4562
+ }
4563
+
4564
+ void RandomLeaves(boolean hide)
4565
+ {
4566
+ group.selection.RandomLeaves(hide);
37624567 refreshContents();
37634568 }
37644569
....@@ -3833,28 +4638,25 @@
38334638 // }
38344639 // }
38354640
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38404641 void EditSelection(boolean newWindow)
38414642 {
4643
+ if (group.selection == null)
4644
+ {
4645
+ EditElement(group, newWindow); // ? new
4646
+ return;
4647
+ }
4648
+
38424649 // aConstraints.gridy = 0;
38434650 for (int i=0; i<group.selection.size(); i++)
38444651 {
38454652 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464653 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4654
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484655
38494656 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4657
+ if(elem != group || !newWindow)
38514658 {
3852
- // if (!(elem instanceof Composite))
3853
- // newWindow = false;
3854
- listUI.add(elem);
3855
- elem.openEditWindow(this, newWindow); //, false);
3856
- System.out.println("edit : " + elem);
3857
- elem.editWindow.refreshContents(true); // ? new
4659
+ EditElement(elem, newWindow); // ? new
38584660 }
38594661 }
38604662 }
....@@ -3929,7 +4731,8 @@
39294731 //new Exception().printStackTrace();
39304732
39314733 freezemodel = true;
3932
-
4734
+ ClearUnpinned();
4735
+
39334736 /**/
39344737 //switch (event.id)
39354738 {
....@@ -3937,7 +4740,6 @@
39374740 //case 702: // Event.LIST_DESELECT
39384741 group.deselectAll();
39394742 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414743 if (tps != null)
39424744 {
39434745 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +4748,39 @@
39464748
39474749 //if (child.parent != null)
39484750 //child.parent.addSelectee(child);
4751
+ objEditor.SetMaterial(child);
39494752 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534753 }
39544754 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4755
+// else
4756
+// {
4757
+// objEditor.SetMaterial(group); // .GetMaterial());
4758
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4759
+// System.err.println("info : " + group.GetPath());
4760
+// }
39614761
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4762
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654763 CameraPane.flash = true;
39664764
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4765
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684766 // a camera
39694767 {
3970
- CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4768
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4769
+ {
4770
+ CameraPane.camerachangeframe = 0; // don't refuse it
4771
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4772
+ }
4773
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4774
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744775 }
39754776
4777
+ if (tps != null && tps.length == 1)
4778
+ {
4779
+ EditSelection(false);
4780
+ }
4781
+
4782
+ SetPinStates(tps != null && tps.length > 0);
4783
+
39764784 refreshContents();
39774785 //return true;
39784786 }
....@@ -3981,6 +4789,35 @@
39814789
39824790 freezemodel = false;
39834791 }
4792
+
4793
+ void SetPinStates(boolean enabled)
4794
+ {
4795
+ editButton.setEnabled(enabled);
4796
+ uneditButton.setEnabled(enabled);
4797
+ unselectButton.setEnabled(enabled);
4798
+ flashSelectionButton.setEnabled(enabled);
4799
+ }
4800
+
4801
+ void refreshContents(boolean cp)
4802
+ {
4803
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4804
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4805
+ {
4806
+ objEditor.ClearInfo(); // .GetMaterial());
4807
+
4808
+ for (int i=0; i < group.selection.Size(); i++)
4809
+ {
4810
+ Object3D child = (Object3D) group.selection.get(i);
4811
+
4812
+ objEditor.AddInfo(child, this, true);
4813
+ System.err.println("info : " + child.GetPath());
4814
+ }
4815
+
4816
+ objEditor.SetText(); // jan 2014
4817
+ }
4818
+
4819
+ super.refreshContents(cp);
4820
+ }
39844821
39854822 void linkSomething(Object3D thing)
39864823 {
....@@ -4052,16 +4889,19 @@
40524889 {
40534890 if (group.selection.isEmpty())
40544891 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4892
+
4893
+ Grafreed.clipboardIsTempGroup = false;
40564894 Composite tGroup = null;
40574895 if (group.selection.size() > 0) // 1)
40584896 {
40594897 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4898
+ Grafreed.clipboardIsTempGroup = true;
40614899 }
40624900
40634901 if (cut)
40644902 {
4903
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4904
+// Save();
40654905 //int indices[] = jList.getSelectedIndices();
40664906 //for (int i = indices.length - 1; i >= 0; i--)
40674907 //jList.remove(indices[i]);
....@@ -4097,16 +4937,16 @@
40974937 //System.out.println("cut " + child);
40984938 //System.out.println("parent = " + child.parent);
40994939 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4940
+ if (Grafreed.clipboardIsTempGroup)
41014941 tGroup.add/*Child*/(tmp);
41024942 else
4103
- GraphreeD.clipboard = tmp;
4943
+ Grafreed.clipboard = tmp;
41044944 }
41054945 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4946
+ if (Grafreed.clipboardIsTempGroup)
41074947 tGroup.add/*Child*/(child);
41084948 else
4109
- GraphreeD.clipboard = child;
4949
+ Grafreed.clipboard = child;
41104950 }
41114951
41124952 //ResetModel();
....@@ -4138,21 +4978,23 @@
41384978 //System.out.println("cut " + elem);
41394979 //System.out.println("parent = " + elem.parent);
41404980 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4981
+ if (Grafreed.clipboardIsTempGroup)
41424982 tGroup.add/*Child*/(tmp);
41434983 else
4144
- GraphreeD.clipboard = tmp;
4984
+ Grafreed.clipboard = tmp;
41454985 }
41464986 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
41484988 tGroup.add/*Child*/(child);
41494989 else
4150
- GraphreeD.clipboard = child;
4990
+ Grafreed.clipboard = child;
41514991 }
41524992
41534993 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4994
+
4995
+ if (Grafreed.clipboardIsTempGroup)
4996
+ Grafreed.clipboard = tGroup;
4997
+
41564998 if (cut)
41574999 {
41585000 ResetModel();
....@@ -4162,11 +5004,15 @@
41625004
41635005 void paste(boolean expand)
41645006 {
4165
- // if (GraphreeD.clipboard == null)
5007
+ if (Globals.REPLACEONMAKE)
5008
+ Save();
5009
+ boolean keep = Globals.REPLACEONMAKE;
5010
+ Globals.REPLACEONMAKE = false;
5011
+ // if (GrafreeD.clipboard == null)
41665012 // return;
41675013 boolean first = true;
41685014
4169
- if (GraphreeD.clipboardIsTempGroup)
5015
+ if (Grafreed.clipboardIsTempGroup)
41705016 {
41715017 Composite temp;
41725018
....@@ -4177,7 +5023,7 @@
41775023 temp = (Composite)Applet3D.clipboard.deepCopy();
41785024 */
41795025 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5026
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41815027 {
41825028 Object3D child = (Object3D)e.nextElement();
41835029
....@@ -4191,7 +5037,7 @@
41915037 else
41925038 elem = child.deepCopy(); // ?
41935039 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5040
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41955041 // elem = elem.get(0);
41965042 makeSomething(elem, true); // ?? first);
41975043 //group.addChild(elem);
....@@ -4211,23 +5057,24 @@
42115057 //Object3D cb = Applet3D.clipboard;
42125058 //temp.addChild(cb);
42135059 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
5060
+ assert(Grafreed.clipboard.parent == null);
5061
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5062
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5063
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5064
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42195065 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5066
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5067
+ Grafreed.clipboard.get(0).parent = keepparent;
42225068 }
42235069
5070
+ Globals.REPLACEONMAKE = keep;
42245071 ResetModel();
42255072 refreshContents();
42265073 }
42275074
4228
- void pasteInto(boolean copyit)
5075
+ void pasteInto(boolean copyit, boolean clone)
42295076 {
4230
-// if (GraphreeD.clipboard == null)
5077
+// if (GrafreeD.clipboard == null)
42315078 // return;
42325079
42335080 if (group.selection.size() != 1)
....@@ -4254,15 +5101,22 @@
42545101 if (copyit)
42555102 {
42565103 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5104
+ if (clone)
5105
+ {
5106
+ CloneClipboard(false); // sept 2014
5107
+ }
5108
+ else
5109
+ {
5110
+ paste(false);
5111
+ }
42585112 }
42595113 else
42605114 {
42615115 boolean first = true;
42625116
4263
- if (GraphreeD.clipboardIsTempGroup)
5117
+ if (Grafreed.clipboardIsTempGroup)
42645118 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5119
+ Composite temp = (Composite)Grafreed.clipboard;
42665120 Object3D copy;
42675121 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685122 {
....@@ -4272,7 +5126,7 @@
42725126 }
42735127 } else
42745128 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5129
+ linkSomething(Grafreed.clipboard); //.get(0));
42765130 }
42775131 }
42785132 }
....@@ -4349,6 +5203,10 @@
43495203
43505204 void group(Object3D csg, boolean grab)
43515205 {
5206
+ if (Globals.REPLACEONMAKE)
5207
+ Save();
5208
+ boolean keep = Globals.REPLACEONMAKE;
5209
+ Globals.REPLACEONMAKE = false;
43525210 if (//false) // why??
43535211 !group.selection.isEmpty())
43545212 {
....@@ -4462,8 +5320,34 @@
44625320 //node.add(csg);
44635321 //makeSomething(node);
44645322 makeSomething(csg);
5323
+ Globals.REPLACEONMAKE = keep;
44655324 }
44665325
5326
+ void Ungroup(Object3D g)
5327
+ {
5328
+ if (Globals.REPLACEONMAKE)
5329
+ Save();
5330
+ boolean keep = Globals.REPLACEONMAKE;
5331
+ Globals.REPLACEONMAKE = false;
5332
+ if (g instanceof HiddenObject)
5333
+ {
5334
+ HiddenObject h = (HiddenObject) g;
5335
+
5336
+ for (int i=0; i<h.ActualSize(); i++)
5337
+ {
5338
+ objEditor.makeSomething(h.get(i), false);
5339
+ }
5340
+ }
5341
+ else
5342
+ {
5343
+ for (int i=0; i<g.Size(); i++)
5344
+ {
5345
+ objEditor.makeSomething(g.get(i), false);
5346
+ }
5347
+ }
5348
+ Globals.REPLACEONMAKE = keep;
5349
+ }
5350
+
44675351 void ungroup()
44685352 {
44695353 /*
....@@ -4657,21 +5541,6 @@
46575541 }
46585542 */
46595543
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755544 /*
46765545 public void Callback(Object obj)
46775546 {
....@@ -4695,26 +5564,9 @@
46955564 }
46965565 */
46975566
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155567 String GetFile(String dialogName)
47165568 {
4717
- if (GraphreeD.standAlone)
5569
+ if (Grafreed.standAlone)
47185570 {
47195571 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205572 browser.show();
....@@ -4778,10 +5630,33 @@
47785630 cButton flashSelectionButton;
47795631 cButton editButton;
47805632 cButton uneditButton;
5633
+ JCheckBox allParamsButton;
47815634 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835635 cButton unselectButton;
47845636
5637
+ cButton restoreCameraButton;
5638
+
5639
+ cButton saveButton;
5640
+ cButton oneStepButton;
5641
+
5642
+ cButton groupButton;
5643
+ cButton ungroupButton;
5644
+ cButton compositeButton;
5645
+ cButton switchButton;
5646
+ cButton loopButton;
5647
+ cButton textureButton;
5648
+
5649
+ cButton gridButton;
5650
+ cButton boxButton;
5651
+ cButton sphereButton;
5652
+ cButton coneButton;
5653
+ cButton torusButton;
5654
+ cButton superButton;
5655
+ cButton kleinButton;
5656
+ cButton particlesButton;
5657
+ cButton overlayButton;
5658
+ cButton lightButton;
5659
+
47855660 cButton screenfitButton;
47865661 cButton screenfitpointButton;
47875662 cButton snapobjectButton;
....@@ -4793,14 +5668,6 @@
47935668
47945669 cButton setsupportButton;
47955670
4796
- cButton twoButton;
4797
- cButton sixButton;
4798
- cButton threeButton;
4799
- cButton sevenButton;
4800
- cButton fourButton; // full panel
4801
- cButton oneButton; // full XYZ
4802
- //cButton currentLayout;
4803
-
48045671 //
48055672 //Composite
48065673 Object3D // to do !!
....@@ -4810,9 +5677,11 @@
48105677 //JTree jTree;
48115678 private MenuItem lookAtItem;
48125679 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
5680
+ private MenuItem switchViewItem;
48145681 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5682
+ private MenuItem undoItem;
5683
+ private MenuItem redoItem;
5684
+ private JMenuItem duplicateItem;
48165685 private MenuItem cloneItem;
48175686 private MenuItem cloneSupportItem;
48185687 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5692,9 @@
48235692 private MenuItem resetsupportItem;
48245693 private MenuItem resetreferencesItem;
48255694 private MenuItem linkverticesItem;
5695
+ private MenuItem relinkverticesItem;
48265696 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5697
+ private MenuItem resetAllItem;
48285698 private MenuItem stepAllItem;
48295699 private MenuItem revertMeshItem;
48305700 private MenuItem poseMeshItem;
....@@ -4835,14 +5705,17 @@
48355705 private MenuItem mergeGeometriesItem;
48365706 private MenuItem copyItem;
48375707 private MenuItem pasteItem;
5708
+ private MenuItem pasteIntoItem;
48385709 private MenuItem pasteLinkItem;
48395710 private MenuItem pasteCloneItem;
48405711 private MenuItem pasteExpandItem;
4841
- private MenuItem clearItem;
5712
+ private MenuItem deleteItem;
48425713 private MenuItem clearAllItem;
48435714 private MenuItem genUVItem;
5715
+ private MenuItem genNormalsMESHItem;
48445716 private MenuItem genNormalsCADItem;
48455717 private MenuItem genNormalsORGANItem;
5718
+ private MenuItem genNormalsMINEItem;
48465719 private MenuItem stripifyItem;
48475720 private MenuItem unstripifyItem;
48485721 private MenuItem trimItem;
....@@ -4871,6 +5744,10 @@
48715744 private MenuItem showleavesItem;
48725745 private MenuItem markleavesItem;
48735746 private MenuItem unmarkleavesItem;
5747
+ private MenuItem rewindleavesItem;
5748
+ private MenuItem unrewindleavesItem;
5749
+ private MenuItem randomleavesItem;
5750
+ private MenuItem unrandomleavesItem;
48745751
48755752 private MenuItem flipVItem;
48765753 private MenuItem unflipVItem;
....@@ -4882,14 +5759,17 @@
48825759 private MenuItem panoTexturesItem;
48835760
48845761 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5762
+ private MenuItem resetCentroidXZItem;
48865763 private MenuItem resetTransformItem;
5764
+ private MenuItem transformGeometryItem;
5765
+ private MenuItem transformChildrenItem;
5766
+ private MenuItem hideItem;
48875767 private MenuItem grabItem;
48885768 private MenuItem backItem;
48895769 private MenuItem frontItem;
48905770 private MenuItem cameraItem;
48915771 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
5772
+ private MenuItem switchItem;
48935773 private MenuItem physicsItem;
48945774 private MenuItem frameselectorItem;
48955775 private MenuItem scriptNodeItem;
....@@ -4904,6 +5784,7 @@
49045784
49055785 private MenuItem resetParentItem;
49065786 private MenuItem repairParentItem;
5787
+ private MenuItem repairShadowItem;
49075788 private MenuItem sortbysizeItem;
49085789 private MenuItem sortbynameItem;
49095790
....@@ -4924,10 +5805,11 @@
49245805 private MenuItem coneItem;
49255806 private MenuItem torusItem;
49265807 private MenuItem superItem;
5808
+ private MenuItem kleinItem;
49275809 private MenuItem blobItem;
49285810 private MenuItem latheItem;
49295811 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5812
+ private MenuItem overlayItem;
49315813 private MenuItem meshItem;
49325814 // private MenuItem meshGroupItem;
49335815 private MenuItem springItem;
....@@ -4936,6 +5818,7 @@
49365818 private MenuItem csgItem;
49375819 private MenuItem templateItem;
49385820 private MenuItem textureItem;
5821
+ private MenuItem billboardItem;
49395822 private MenuItem shadowXItem;
49405823 private MenuItem shadowYItem;
49415824 private MenuItem shadowZItem;
....@@ -4948,11 +5831,6 @@
49485831 private MenuItem doubleItem;
49495832 private MenuItem tripleItem;
49505833
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565834 private MenuItem computeAOItem;
49575835 private MenuItem recompileItem;
49585836 private MenuItem editScriptItem;
....@@ -4962,4 +5840,8 @@
49625840 private MenuItem analyzeItem;
49635841 private MenuItem dumpItem;
49645842 //boolean freezemodel = false;
5843
+
5844
+ Menu cameraMenu;
5845
+ MenuItem editCameraItem;
5846
+ MenuItem restoreCameraItem;
49655847 }