Normand Briere
2019-07-19 e79247ef52a0bbb3864d46bb1e2c716005b3ecf3
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,7 +80,13 @@
7380 this.copy = this.group = copy;
7481 //selectees = this.group.selectees;
7582
76
- SetupMenu2(objEditor);
83
+ if (copy.versions == null)
84
+ {
85
+ copy.versions = new byte[100][];
86
+ copy.versionindex = -1;
87
+ }
88
+
89
+ SetupMenu2(this); //objEditor);
7790 SetupUI2(objEditor);
7891 objEditor.SetupUI(true);
7992 SetupViews(objEditor);
....@@ -83,6 +96,10 @@
8396
8497 void CloneSelection(boolean supports)
8598 {
99
+ if (Globals.REPLACEONMAKE)
100
+ Save();
101
+ boolean keep = Globals.REPLACEONMAKE;
102
+ Globals.REPLACEONMAKE = false;
86103 // Object3D keep = GrafreeD.clipboard;
87104 //Object3D obj;
88105 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +110,19 @@
93110
94111 makeSomething(clone, i==group.selection.size()-1);
95112 }
113
+ Globals.REPLACEONMAKE = keep;
96114 }
97115
98116 void CloneClipboard(boolean supports)
99117 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
118
+ assert(Grafreed.clipboard.parent == null);
119
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
120
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
121
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
122
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105123 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
124
+ makeSomething(CloneObject(Grafreed.clipboard, false));
125
+ Grafreed.clipboard.get(0).parent = keepparent;
108126 }
109127
110128 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +136,7 @@
118136 // obj.support = null;
119137 if (!supports)
120138 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
139
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122140 obj.parent = parent;
123141 // obj.support = support;
124142 // clone.support = support; // aout 2013
....@@ -147,30 +165,29 @@
147165
148166 //JTextField nameField;
149167
150
- void SetupMenu2(ObjEditor oe)
168
+ void SetupMenu2(GroupEditor oe)
151169 {
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);
170
+ oe.jTree = new cTree();
171
+
163172 Menu menu;
164173 oe.menuBar.add(menu = new Menu("Edit"));
165174 //editItem = menu.add(new MenuItem("Edit"));
166175 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
176
+
177
+// undoItem = menu.add(new MenuItem("Undo"));
178
+// undoItem.addActionListener(this);
179
+// redoItem = menu.add(new MenuItem("Redo"));
180
+// redoItem.addActionListener(this);
181
+// menu.add("-");
182
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168183 duplicateItem.addActionListener(this);
169
- menu.add("-");
170184 cloneItem = menu.add(new MenuItem("Clone"));
171185 cloneItem.addActionListener(this);
186
+ if (Globals.ADVANCED)
187
+ {
172188 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173189 cloneSupportItem.addActionListener(this);
190
+ }
174191 menu.add("-");
175192 cutItem = menu.add(new MenuItem("Cut"));
176193 cutItem.addActionListener(this);
....@@ -178,27 +195,123 @@
178195 copyItem.addActionListener(this);
179196 pasteItem = menu.add(new MenuItem("Paste"));
180197 pasteItem.addActionListener(this);
198
+
199
+ menu.add("-");
200
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
201
+ pasteIntoItem.addActionListener(this);
181202 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182203 pasteLinkItem.addActionListener(this);
183204 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184205 pasteCloneItem.addActionListener(this);
185206 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186207 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
208
+ menu.add("-");
209
+ deleteItem = menu.add(new MenuItem("Delete"));
210
+ deleteItem.addActionListener(this);
211
+
212
+ if (Globals.ADVANCED)
213
+ {
214
+ // Deletes the cameras...
189215 clearAllItem = menu.add(new MenuItem("Clear All"));
190216 clearAllItem.addActionListener(this);
217
+ }
218
+
219
+ menuBar.add(cameraMenu = new Menu("View"));
220
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
221
+ //zBufferItem.addActionListener(this);
222
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
223
+ //normalLensItem.addActionListener(this);
224
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
225
+ restoreCameraItem.addActionListener(this);
226
+
227
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
228
+// toggleFullScreenItem.addItemListener(this);
229
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
230
+// cameraMenu.add("-");
231
+//
232
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
233
+// toggleTextureItem.addItemListener(this);
234
+// toggleTextureItem.setState(CameraPane.textureon);
235
+//
236
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
237
+// toggleSwitchItem.addItemListener(this);
238
+// toggleSwitchItem.setState(CameraPane.SWITCH);
239
+
240
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
241
+ toggleHandleItem.addItemListener(this);
242
+ toggleHandleItem.setState(CameraPane.HANDLES);
243
+
244
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
245
+ togglePaintItem.addItemListener(this);
246
+ togglePaintItem.setState(CameraPane.PAINTMODE);
247
+
248
+ if (Globals.ADVANCED)
249
+ {
250
+ cameraMenu.add("-");
251
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
252
+ toggleLiveItem.addItemListener(this);
253
+ toggleLiveItem.setState(Globals.isLIVE());
191254
255
+ cameraMenu.add(stepItem = new MenuItem("Step"));
256
+ stepItem.addActionListener(this);
257
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
258
+ // toggleDLItem.addItemListener(this);
259
+ // toggleDLItem.setState(false);
260
+
261
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
262
+ toggleRenderItem.addItemListener(this);
263
+ toggleRenderItem.setState(!CameraPane.frozen);
264
+
265
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
266
+ toggleDebugItem.addItemListener(this);
267
+ toggleDebugItem.setState(Globals.DEBUG);
268
+
269
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
270
+ toggleFrustumItem.addItemListener(this);
271
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
272
+
273
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
274
+ toggleFootContactItem.addItemListener(this);
275
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
276
+
277
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
278
+ toggleTimelineItem.addItemListener(this);
279
+ }
280
+
281
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
282
+// toggleRootItem.addItemListener(this);
283
+// toggleRootItem.setState(false);
284
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
285
+// animationItem.addItemListener(this);
286
+// animationItem.setState(CameraPane.ANIMATION);
287
+ cameraMenu.add("-");
288
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
289
+ editCameraItem.addActionListener(this);
290
+
291
+ if (Globals.ADVANCED)
292
+ {
293
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
294
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
295
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
296
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
297
+ oe.cameraMenu.add("-");
298
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
299
+ openWindowItem.addActionListener(this);
300
+ editLeafItem.addActionListener(this);
301
+ lookAtItem.addActionListener(this);
302
+ //lookFromItem.addActinoListener(this);
303
+ //switchViewItem.addActionListener(this);
304
+ }
305
+
192306 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);
307
+ if (Globals.ADVANCED)
308
+ {
197309 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198310 revertMeshItem.addActionListener(this);
199311 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200312 resetreferencesItem.addActionListener(this);
201313 menu.add("-");
314
+ }
202315 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203316 overwriteGeoItem.addActionListener(this);
204317 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +323,104 @@
210323 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211324 overwriteUVItem.addActionListener(this);
212325 menu.add("-");
326
+ if (Globals.ADVANCED)
327
+ {
213328 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214329 generateMeshItem.addActionListener(this);
215330 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216331 poseMeshItem.addActionListener(this);
217332 menu.add("-");
333
+ }
218334 resetsupportItem = menu.add(new MenuItem("Reset support"));
219335 resetsupportItem.addActionListener(this);
220336 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221337 linkverticesItem.addActionListener(this);
338
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
339
+ relinkverticesItem.addActionListener(this);
340
+
341
+ if (Globals.ADVANCED)
342
+ {
222343 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223344 setMasterItem.addActionListener(this);
345
+ }
224346
225347 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
348
+// grabItem = menu.add(new MenuItem("Grab"));
349
+// grabItem.addActionListener(this);
228350 backItem = menu.add(new MenuItem("Back"));
229351 backItem.addActionListener(this);
230352 frontItem = menu.add(new MenuItem("Front"));
231353 frontItem.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
+// compositeItem = menu.add(new MenuItem("Composite"));
355
+// compositeItem.addActionListener(this);
356
+
357
+ if (Globals.ADVANCED)
358
+ {
359
+ hideItem = menu.add(new MenuItem("Hidden Group"));
360
+ hideItem.addActionListener(this);
361
+ }
362
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
363
+ ungroupItem.addActionListener(this);
364
+
365
+// menu.add("-");
366
+//
367
+// switchItem = menu.add(new MenuItem("Switch node"));
368
+// switchItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
241371 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242372 switchGeoItem.addActionListener(this);
243373 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244374 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
375
+ morphItem = menu.add(new MenuItem("Morph Group"));
246376 morphItem.addActionListener(this);
377
+
378
+ menu.add("-");
379
+ physicsItem = menu.add(new MenuItem("Physics"));
380
+ physicsItem.addActionListener(this);
381
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
382
+ frameselectorItem.addActionListener(this);
247383 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248384 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
385
+ }
251386
252387 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
388
+// textureItem = menu.add(new MenuItem("Texture"));
389
+// textureItem.addActionListener(this);
390
+ billboardItem = menu.add(new MenuItem("Billboard"));
391
+ billboardItem.addActionListener(this);
255392 csgItem = menu.add(new MenuItem("CSG"));
256393 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
394
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258395 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
396
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260397 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
398
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262399 shadowZItem.addActionListener(this);
400
+ attributeItem = menu.add(new MenuItem("Attribute"));
401
+ attributeItem.addActionListener(this);
402
+
403
+ if (Globals.ADVANCED)
404
+ {
405
+ menu.add("-");
263406 linkerItem = menu.add(new MenuItem("Linker"));
264407 linkerItem.addActionListener(this);
265408 templateItem = menu.add(new MenuItem("Template"));
266409 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269410 pointflowItem = menu.add(new MenuItem("Point Flow"));
270411 pointflowItem.addActionListener(this);
412
+ }
271413 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274414 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275415 resetTransformItem.addActionListener(this);
276416 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277417 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
418
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
419
+ resetCentroidXZItem.addActionListener(this);
420
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
421
+ transformGeometryItem.addActionListener(this);
422
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
423
+ transformChildrenItem.addActionListener(this);
280424
281425 oe.menuBar.add(menu = new Menu("Geometry"));
282426 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +431,11 @@
287431 genNormalsCADItem.addActionListener(this);
288432 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289433 genNormalsMESHItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437
+ genNormalsMINEItem.addActionListener(this);
438
+ }
290439 stripifyItem = menu.add(new MenuItem("Stripify"));
291440 stripifyItem.addActionListener(this);
292441 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +457,34 @@
308457 reduce34MeshItem.addActionListener(this);
309458 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310459 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313460 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314461 clipMeshItem.addActionListener(this);
462
+
463
+ if (Globals.ADVANCED)
464
+ {
465
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
466
+ smoothMeshItem.addActionListener(this);
467
+ }
315468
316469 oe.menuBar.add(menu = new Menu("Attributes"));
317470 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318471 clearMaterialsItem.addActionListener(this);
472
+ resetAllItem = menu.add(new MenuItem("Reset All"));
473
+ resetAllItem.addActionListener(this);
474
+ stepAllItem = menu.add(new MenuItem("Step All"));
475
+ stepAllItem.addActionListener(this);
319476 menu.add("-");
320477 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321478 liveleavesItem.addActionListener(this);
322479 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323480 unliveleavesItem.addActionListener(this);
481
+ if (Globals.ADVANCED)
482
+ {
324483 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325484 supportleavesItem.addActionListener(this);
326485 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327486 unsupportleavesItem.addActionListener(this);
487
+ }
328488 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329489 hideleavesItem.addActionListener(this);
330490 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +493,14 @@
333493 markleavesItem.addActionListener(this);
334494 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335495 unmarkleavesItem.addActionListener(this);
496
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
497
+ rewindleavesItem.addActionListener(this);
498
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
499
+ unrewindleavesItem.addActionListener(this);
500
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
501
+ randomleavesItem.addActionListener(this);
502
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
503
+ unrandomleavesItem.addActionListener(this);
336504 menu.add("-");
337505 flipVItem = menu.add(new MenuItem("Flip V"));
338506 flipVItem.addActionListener(this);
....@@ -368,35 +536,41 @@
368536 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369537 sortbynameItem.addActionListener(this);
370538 menu.add("-");
539
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
540
+ shareGeometriesItem.addActionListener(this);
541
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
542
+ mergeGeometriesItem.addActionListener(this);
543
+ if (Globals.ADVANCED)
544
+ {
545
+ // Pretty much the same as duplicate and clone.
371546 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372547 extractGeometriesItem.addActionListener(this);
373548 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374549 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
550
+ }
379551
380552 oe.menuBar.add(menu = new Menu("Insert"));
381553 buildCreateMenu(menu);
382554
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394555 oe.menuBar.add(menu = new Menu("Tools"));
395556 buildToolsMenu(menu);
396557 }
397558
559
+
398560 void SetupUI2(ObjEditor oe)
399561 {
562
+ // June 2019
563
+ if (oe == null)
564
+ {
565
+ //super.SetupUI2(this);
566
+ //return;
567
+ }
568
+
569
+ if (copy != group)
570
+ {
571
+ //super.SetupUI2(this);
572
+ }
573
+
400574 //new Exception().printStackTrace();
401575
402576 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -425,150 +599,231 @@
425599 oe.radioPanel.add(dummyButton);
426600 oe.buttonGroup.add(dummyButton);
427601 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
602
+ cGridBag copyOptionsPanel = new cGridBag();
603
+
604
+ copyOptionsPanel.preferredHeight = 1;
431605
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
606
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
607
+
608
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ //minButton.setToolTipText("Minimize window");
610
+ //minButton.addActionListener(this);
611
+
612
+ if (Globals.ADVANCED)
613
+ {
614
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ maxButton.setToolTipText("Maximize window");
616
+ maxButton.addActionListener(this);
617
+ }
618
+
619
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ fullButton.setToolTipText("Full-screen window");
621
+ fullButton.addActionListener(this);
622
+
623
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ screenfitButton.setToolTipText("Screen fit");
625
+ screenfitButton.addActionListener(this);
626
+
627
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
628
+ restoreCameraButton.setToolTipText("Restore viewpoint");
629
+ restoreCameraButton.addActionListener(this);
630
+
631
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ saveButton.setToolTipText("New version");
633
+ saveButton.addActionListener(this);
634
+
635
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ undoButton.setToolTipText("Previous version");
637
+ undoButton.addActionListener(this);
638
+ undoButton.setEnabled(false);
639
+
640
+ cGridBag updown = new cGridBag().setVertical(true);
641
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ restoreButton.setToolTipText("Restore current");
643
+ restoreButton.addActionListener(this);
644
+ restoreButton.setEnabled(false);
645
+
646
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ replaceButton.setToolTipText("Replace current");
648
+ replaceButton.addActionListener(this);
649
+ replaceButton.setEnabled(false);
650
+
651
+ copyOptionsPanel.add(updown);
652
+
653
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ redoButton.setToolTipText("Next version");
655
+ redoButton.addActionListener(this);
656
+ redoButton.setEnabled(false);
657
+
658
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
659
+ liveCB.setToolTipText("Enable animation");
433660 liveCB.addItemListener(this);
434661
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
662
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
+ oneStepButton.setToolTipText("Animate one step forward");
664
+ oneStepButton.addActionListener(this);
665
+
666
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
667
+ fastCB.setToolTipText("Fast mode");
453668 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
669
+
670
+ //oe.toolboxPanel.Return();
671
+
672
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
673
+// trackCB.setToolTipText("Enable tracking");
674
+// trackCB.addItemListener(this);
460675
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
495
- trackCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
499
- screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
501676 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502677 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507678
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
514
- flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
679
+ if (Globals.ADVANCED)
680
+ {
681
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ snapobjectButton.addActionListener(this);
683
+ snapobjectButton.setToolTipText("Snap Object");
684
+ }
685
+
686
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
518687
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
521
- twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
688
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523689 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
690
+ fourButton.setToolTipText("Show left panel only");
691
+
692
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ twoButton.setToolTipText("Show right view only");
694
+ twoButton.addActionListener(this);
695
+ this.fullscreenLayout = twoButton;
696
+
697
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ sixButton.setToolTipText("Show left and right");
525699 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
527
- threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
529
- sevenButton.addActionListener(this);
700
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+// threeButton.setToolTipText("2-column layout right");
702
+// threeButton.addActionListener(this);
703
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+// sevenButton.setToolTipText("3-column layout");
705
+// sevenButton.addActionListener(this);
530706 //
531707
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
708
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ rootButton.setToolTipText("Open selection in new tab");
533710 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
711
+
712
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ closeButton.setToolTipText("Close tab");
536714 closeButton.addActionListener(this);
537715 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538716 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540
-
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
- editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547717
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
718
+ // INSERT
719
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
720
+ gridButton.setToolTipText("Create grid");
721
+ gridButton.addActionListener(this);
722
+
723
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ boxButton.setToolTipText("Create box");
725
+ boxButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
728
+ sphereButton.setToolTipText("Create sphere");
729
+ sphereButton.addActionListener(this);
730
+
731
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
732
+ coneButton.setToolTipText("Create cone");
733
+ coneButton.addActionListener(this);
734
+
735
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+ torusButton.setToolTipText("Create torus");
737
+ torusButton.addActionListener(this);
738
+
739
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
740
+ superButton.setToolTipText("Create superellipsoid");
741
+ superButton.addActionListener(this);
742
+
743
+ if (Globals.ADVANCED)
744
+ {
745
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
746
+ kleinButton.setToolTipText("Create Klein bottle");
747
+ kleinButton.addActionListener(this);
748
+ }
749
+
750
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
751
+ particlesButton.setToolTipText("Create particle system");
752
+ particlesButton.addActionListener(this);
753
+
754
+ oe.toolboxPanel.Return();
755
+
756
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
757
+ groupButton.setToolTipText("Create group");
758
+ groupButton.addActionListener(this);
759
+
760
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
761
+ compositeButton.setToolTipText("Create composite");
762
+ compositeButton.addActionListener(this);
763
+
764
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
765
+ switchButton.setToolTipText("Create item switcher");
766
+ switchButton.addActionListener(this);
767
+
768
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
769
+ loopButton.setToolTipText("Create loop");
770
+ loopButton.addActionListener(this);
771
+
772
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
773
+ textureButton.setToolTipText("Create texture");
774
+ textureButton.addActionListener(this);
775
+
776
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
777
+ overlayButton.setToolTipText("Create overlay");
778
+ overlayButton.addActionListener(this);
779
+
780
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
781
+ lightButton.setToolTipText("Create light");
782
+ lightButton.addActionListener(this);
783
+
784
+ for (int i=6; --i>=0;)
785
+ {
786
+ oe.toolboxPanel.Return();
787
+ oe.toolboxPanel.add(new cGridBag());
788
+ oe.toolboxPanel.add(new cGridBag());
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
+ }
795
+
796
+ // EDIT panel
797
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
798
+ editButton.setToolTipText("Pin selection controls");
799
+ editButton.addActionListener(this);
800
+
801
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
802
+ uneditButton.setToolTipText("Remove selection controls");
549803 uneditButton.addActionListener(this);
550804
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
805
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
806
+ allParamsButton.setToolTipText("Show all controle");
563807 allParamsButton.addActionListener(this);
564808
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
809
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
810
+ clearPanelButton.setToolTipText("Clear edit panel");
811
+ clearPanelButton.addActionListener(this);
812
+
813
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
814
+ unselectButton.setToolTipText("Unselect");
570815 unselectButton.addActionListener(this);
571816
817
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
818
+ flashSelectionButton.setToolTipText("Highlight selection");
819
+ flashSelectionButton.addActionListener(this);
820
+
821
+ editCommandsPanel.preferredHeight = 1;
822
+
823
+ SetPinStates(false);
824
+// oe.treePanel.add(commandsPanel);
825
+// oe.treePanel.Return();
826
+
572827 // oe.aConstraints.gridx += 1;
573828 // oe.aConstraints.weighty = 0;
574829 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +835,25 @@
580835 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581836 // gcButton.addActionListener(this);
582837
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
838
+ cGridBag jSPPanel = new cGridBag();
839
+
840
+ JScrollPane jSP;
594841 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
842
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596843 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
601
-
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
- colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
609
- materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
612
- textureCB.addItemListener(this);
613
-
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
616844
845
+ oe.treePanel.add(jSPPanel);
846
+ oe.treePanel.Return();
847
+
848
+ oe.treePanel.add(copyOptionsPanel);
849
+ oe.treePanel.Return();
850
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
851
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
852
+ sliderPane.preferredHeight = 1;
853
+
854
+// mainPanel.setDividerLocation(0.5); //1.0);
855
+// mainPanel.setResizeWeight(0.5);
856
+
617857 //jList.addListSelectionListener(this);
618858 oe.jTree.addTreeSelectionListener(this);
619859 //jTree.setRootVisible(false);
....@@ -632,23 +872,160 @@
632872 dgr.addDragGestureListener(this);
633873 }catch(Exception e) {}
634874 */
635
- radio.layout = sevenButton;
875
+ radio.layout = sixButton; // sevenButton;
636876 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637877 }
878
+
879
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
880
+ {
881
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
882
+ colorCB.setToolTipText("Copy color when dropped");
883
+ colorCB.addItemListener(this);
884
+
885
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
886
+ materialCB.setToolTipText("Copy material when dropped");
887
+ materialCB.addItemListener(this);
888
+
889
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
890
+ textureCB.setToolTipText("Copy texture when dropped");
891
+ textureCB.addItemListener(this);
892
+
893
+ panel.Return();
894
+
895
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
896
+ boxCB.setToolTipText("Display bounding boxes");
897
+ boxCB.addItemListener(this);
898
+
899
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
900
+ zoomBoxCB.setToolTipText("Display only for wheel");
901
+ zoomBoxCB.addItemListener(this);
902
+
903
+ if (true) // Globals.ADVANCED)
904
+ {
905
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
906
+// supportCB.setToolTipText("Enable rigging");
907
+// supportCB.addItemListener(this);
908
+
909
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
910
+ freezeCB.setToolTipText("Fast moving camera");
911
+ freezeCB.addItemListener(this);
912
+
913
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
914
+ // localCB.addItemListener(this);
915
+
916
+ panel.Return();
917
+
918
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
919
+ crowdCB.setToolTipText("Used for crowds");
920
+ crowdCB.addItemListener(this);
921
+
922
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
923
+ smoothCB.setToolTipText("Snapping delay");
924
+ smoothCB.addItemListener(this);
925
+
926
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
927
+ slowCB.setToolTipText("Smooth interpolation");
928
+ slowCB.addItemListener(this);
929
+
930
+// constraints.gridy += 1;
931
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
932
+// speakerMocapCB.addItemListener(this);
933
+
934
+ panel.Return();
935
+
936
+ if (false)
937
+ {
938
+ // handled in scripts
939
+ //constraints.gridy += 1;
940
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
941
+ speakerCameraCB.addItemListener(this);
942
+
943
+ //constraints.gridy += 1;
944
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
945
+ speakerFocusCB.addItemListener(this);
946
+
947
+ //constraints.gridy += 1;
948
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
949
+ smoothfocusCB.addItemListener(this);
950
+ panel.Return();
951
+ }
952
+
953
+//constraints.gridx += 1;
954
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
955
+// debugCB.addItemListener(this);
956
+
957
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
958
+ trackCB.setToolTipText("Enable tracking target");
959
+ trackCB.addItemListener(this);
960
+
961
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
962
+ oeilCB.setToolTipText("Move camera when tracking");
963
+ oeilCB.addItemListener(this);
964
+
965
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
966
+ shadowCB.setToolTipText("When live compute shadows");
967
+ shadowCB.addItemListener(this);
968
+
969
+ panel.Return();
970
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
971
+ toggleTextureCB.setToolTipText("Load textures");
972
+ toggleTextureCB.addItemListener(this);
973
+
974
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
975
+ toggleSwitchCB.setToolTipText("Choose a single item");
976
+ toggleSwitchCB.addItemListener(this);
977
+
978
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
979
+ autokeepCB.setToolTipText("On structure change");
980
+ autokeepCB.addItemListener(this);
981
+
982
+ panel.Return();
983
+ if (Globals.ADVANCED)
984
+ {
985
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
986
+ lookAtCB.setToolTipText("Look-at target");
987
+ lookAtCB.addItemListener(this);
988
+ }
989
+
990
+ }
991
+
992
+ cGridBag fill = new cGridBag();
993
+ fill.preferredHeight = 200;
994
+ cGridBag fill2 = new cGridBag();
995
+ fill2.preferredHeight = 200;
996
+ cGridBag fill3 = new cGridBag();
997
+ fill3.preferredHeight = 200;
998
+
999
+ panel.add(fill);
1000
+ panel.add(fill2);
1001
+ panel.add(fill3);
1002
+
1003
+ }
6381004
6391005 void EditObject(Object3D obj)
6401006 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
1007
+ cRadio radioButton = new cRadio(obj.name);
1008
+
1009
+ // June 2019. Patch to avoid bug with transparency.
1010
+ radioButton.hadMaterial = obj.material != null;
1011
+ if (!radioButton.hadMaterial)
1012
+ {
1013
+ obj.material = new cMaterial();
1014
+ }
1015
+
1016
+ radioButton.SetObject(obj);
1017
+ radioButton.layout = sixButton; // sevenButton;
1018
+ radioButton.SetCamera(cameraView.renderCamera, false);
1019
+ radioButton.addActionListener(this);
1020
+ radioPanel.add(radioButton);
1021
+ buttonGroup.add(radioButton);
1022
+ radioButton.doClick();
6491023 }
1024
+
6501025 void SetupViews(ObjEditor oe)
6511026 {
1027
+ theFrame = this;
1028
+
6521029 oe.SetupViews();
6531030
6541031 System.out.println("SetupViews");
....@@ -657,22 +1034,28 @@
6571034 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6581035 }
6591036
660
- JCheckBox liveCB;
661
- JCheckBox supportCB;
662
- JCheckBox localCB;
663
- JCheckBox crowdCB;
664
- JCheckBox smoothCB;
665
- JCheckBox fastCB;
666
- JCheckBox slowCB;
667
- JCheckBox boxCB;
668
- JCheckBox trackCB;
669
- JCheckBox smoothfocusCB;
1037
+ cToggleButton liveCB;
1038
+ cCheckBox supportCB;
1039
+ cCheckBox localCB;
1040
+ cCheckBox crowdCB;
1041
+ cCheckBox smoothCB;
1042
+ cToggleButton fastCB;
1043
+ cCheckBox slowCB;
1044
+ cCheckBox boxCB;
1045
+ cCheckBox zoomBoxCB;
1046
+ cCheckBox freezeCB;
1047
+ //cToggleButton trackCB;
1048
+ cCheckBox trackCB;
1049
+ cCheckBox smoothfocusCB;
6701050 // JCheckBox speakerMocapCB;
671
- JCheckBox speakerCameraCB;
672
- JCheckBox speakerFocusCB;
673
- JCheckBox debugCB;
674
- JCheckBox oeilCB;
675
- JCheckBox lookAtCB;
1051
+ cCheckBox speakerCameraCB;
1052
+ cCheckBox speakerFocusCB;
1053
+ cCheckBox debugCB;
1054
+
1055
+ cCheckBox oeilCB;
1056
+ cCheckBox shadowCB;
1057
+ cCheckBox autokeepCB;
1058
+ cCheckBox lookAtCB;
6761059
6771060 // static int COLOR = 1;
6781061 // static int MATERIAL = 2;
....@@ -680,9 +1063,9 @@
6801063
6811064 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6821065
683
- JCheckBox colorCB;
684
- JCheckBox materialCB;
685
- JCheckBox textureCB;
1066
+ cCheckBox colorCB;
1067
+ cCheckBox materialCB;
1068
+ cCheckBox textureCB;
6861069
6871070 public void itemStateChanged(ItemEvent e)
6881071 {
....@@ -707,10 +1090,10 @@
7071090 dropAttributes |= Object3D.TEXTURE;
7081091 else
7091092 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
1093
+ } else if(e.getSource() == liveCB)
7121094 {
7131095 cameraView.ToggleLive();
1096
+ refreshContents(false);
7141097 }
7151098 else if(e.getSource() == supportCB)
7161099 {
....@@ -746,6 +1129,10 @@
7461129 cameraView.repaint();
7471130 // refreshContents();
7481131 }
1132
+ else if(e.getSource() == zoomBoxCB)
1133
+ {
1134
+ cameraView.ToggleZoomBoxMode();
1135
+ }
7491136 else if(e.getSource() == smoothfocusCB)
7501137 {
7511138 cameraView.ToggleSmoothFocus();
....@@ -771,6 +1158,18 @@
7711158 {
7721159 cameraView.ToggleOeil();
7731160 }
1161
+ else if(e.getSource() == shadowCB)
1162
+ {
1163
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1164
+ }
1165
+ else if(e.getSource() == freezeCB)
1166
+ {
1167
+ Globals.FREEZEONMOVE ^= true;
1168
+ }
1169
+ else if(e.getSource() == autokeepCB)
1170
+ {
1171
+ Globals.REPLACEONMAKE ^= true;
1172
+ }
7741173 else if(e.getSource() == lookAtCB)
7751174 {
7761175 cameraView.ToggleLookAt();
....@@ -787,7 +1186,8 @@
7871186
7881187 /**/
7891188 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
790
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1189
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1190
+ TreePath path = objEditor.jTree.getSelectionPath();
7911191 if ((path == null) || (path.getPathCount() <= 1)) {
7921192 // We can't move the root node or an empty selection
7931193 return;
....@@ -850,8 +1250,6 @@
8501250 }
8511251 }
8521252
853
- String string = (String) object;
854
-
8551253 System.out.println("Transfer = " + object + "; drop : " + target);
8561254 // if( object instanceof java.io.File[])
8571255 // {
....@@ -859,7 +1257,11 @@
8591257 // objEditor.DropFile((java.io.File[]) object, true);
8601258 // return;
8611259 // }
862
- if (string.charAt(0) == '/')
1260
+
1261
+ String string = object.toString();
1262
+
1263
+ // File path for Mac and Windows
1264
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631265 {
8641266 // file(s)
8651267 String[] names = string.split("\n");
....@@ -886,7 +1288,7 @@
8861288
8871289 flashIt = false;
8881290 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1291
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901292 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911293
8921294 if (group.selection.size() == 1)
....@@ -902,23 +1304,33 @@
9021304
9031305 assert target == objEditor.jTree;
9041306 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1307
+ Object3D destinationLeaf;
9051308 try {
906
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1309
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9071310 } catch (Exception e) {
9081311 System.out.println("destinationPath : " + destinationPath);
9091312 return;
9101313 }
9111314
912
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1315
+ for (int i=group.selection.size(); --i>=0;)
9131316 {
1317
+ Object3D child = (Object3D)group.selection.elementAt(i);
1318
+
1319
+ // Cannot move into itself
1320
+ if (child == destinationLeaf)
1321
+ return;
1322
+ }
1323
+
1324
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1325
+// {
9141326 loadClipboard(true);
9151327 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
917
- } else {
918
- loadClipboard(false);
919
- objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
921
- }
1328
+ pasteInto(false, false);
1329
+// } else {
1330
+// loadClipboard(false);
1331
+// objEditor.jTree.setSelectionPath(destinationPath);
1332
+// pasteInto(false, false); // true); // ???
1333
+// }
9221334 }
9231335 public void dropActionChanged(DropTargetDragEvent dtde)
9241336 // Called if the user has modified the current drop gesture
....@@ -1023,83 +1435,107 @@
10231435 {
10241436 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10251437 //heightFieldItem.addActionListener(this);
1026
- gridItem = menu.add(new MenuItem("Grid"));
1027
- gridItem.addActionListener(this);
1028
- rectoidItem = menu.add(new MenuItem("Box"));
1029
- rectoidItem.addActionListener(this);
1030
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1031
- ellipsoidItem.addActionListener(this);
1032
- coneItem = menu.add(new MenuItem("Cone"));
1033
- coneItem.addActionListener(this);
1034
- torusItem = menu.add(new MenuItem("Torus"));
1035
- torusItem.addActionListener(this);
1036
- superItem = menu.add(new MenuItem("Superellipsoid"));
1037
- superItem.addActionListener(this);
1038
- particleItem = menu.add(new MenuItem("Particle system"));
1039
- particleItem.addActionListener(this);
1438
+// gridItem = menu.add(new MenuItem("Grid"));
1439
+// gridItem.addActionListener(this);
1440
+// rectoidItem = menu.add(new MenuItem("Box"));
1441
+// rectoidItem.addActionListener(this);
1442
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1443
+// ellipsoidItem.addActionListener(this);
1444
+// coneItem = menu.add(new MenuItem("Cone"));
1445
+// coneItem.addActionListener(this);
1446
+// torusItem = menu.add(new MenuItem("Torus"));
1447
+// torusItem.addActionListener(this);
1448
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1449
+// superItem.addActionListener(this);
1450
+
1451
+ cameraItem = menu.add(new MenuItem("Camera"));
1452
+ cameraItem.addActionListener(this);
1453
+
1454
+ if (!Globals.ADVANCED)
1455
+ {
1456
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1457
+ kleinItem.addActionListener(this);
1458
+ }
1459
+
1460
+// particleItem = menu.add(new MenuItem("Particle system"));
1461
+// particleItem.addActionListener(this);
1462
+ if (Globals.ADVANCED)
1463
+ {
10401464 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411465 ragdollItem.addActionListener(this);
10421466 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431467 ragdoll2Item.addActionListener(this);
1468
+ }
10441469 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1470
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461471 meshItem.addActionListener(this);
10471472 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481473 // meshGroupItem.addActionListener(this);
1474
+ if (Globals.ADVANCED)
1475
+ {
10491476 springItem = menu.add(new MenuItem("Spring"));
10501477 springItem.addActionListener(this);
10511478 flagItem = menu.add(new MenuItem("Flag"));
10521479 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571480 blobItem = menu.add(new MenuItem("Blob"));
10581481 blobItem.addActionListener(this);
10591482 latheItem = menu.add(new MenuItem("Lathe"));
10601483 latheItem.addActionListener(this);
1061
- lightItem = menu.add(new MenuItem("Light"));
1062
- lightItem.addActionListener(this);
1484
+ }
1485
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1486
+ bezierItem.addActionListener(this);
1487
+// overlayItem = menu.add(new MenuItem("Overlay"));
1488
+// overlayItem.addActionListener(this);
1489
+// lightItem = menu.add(new MenuItem("Light"));
1490
+// lightItem.addActionListener(this);
10631491 menu.add("-");
10641492 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10651493 //superLoopItem.addActionListener(this);
1066
- loopItem = menu.add(new MenuItem("Loop"));
1067
- loopItem.addActionListener(this);
1494
+// loopItem = menu.add(new MenuItem("Loop"));
1495
+// loopItem.addActionListener(this);
10681496 doubleItem = menu.add(new MenuItem("Fork"));
10691497 doubleItem.addActionListener(this);
1498
+ if (Globals.ADVANCED)
1499
+ {
10701500 tripleItem = menu.add(new MenuItem("Trident"));
10711501 tripleItem.addActionListener(this);
1502
+ }
10721503 }
10731504
10741505 void buildToolsMenu(Menu menu)
10751506 {
10761507 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771508 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1509
+ animationItem.setState(Globals.ANIMATION);
1510
+
1511
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1512
+ archiveItem.addActionListener(this);
10791513
10801514 menu.add("-");
10811515 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821516 parseverticesItem.addActionListener(this);
10831517 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841518 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1519
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861520 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891521 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901522 reduceMorphItem.addActionListener(this);
10911523 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921524 reduce34MorphItem.addActionListener(this);
1093
-
1094
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1095
- computeAOItem.addActionListener(this);
10961525 menu.add("-");
1097
-
10981526 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991527 memoryItem.addActionListener(this);
1528
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1529
+ computeAOItem.addActionListener(this);
1530
+
1531
+ if (Globals.ADVANCED)
1532
+ {
1533
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1534
+ mirrorItem.addActionListener(this);
1535
+ menu.add("-");
11001536 menu.add(analyzeItem = new MenuItem("Analyze"));
11011537 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1538
+ menu.add(dumpItem = new MenuItem("Print"));
11031539 dumpItem.addActionListener(this);
11041540 // menu.add(pathItem = new MenuItem("From-to path"));
11051541 // pathItem.addActionListener(this);
....@@ -1108,6 +1544,8 @@
11081544 resetParentItem.addActionListener(this);
11091545 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101546 repairParentItem.addActionListener(this);
1547
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1548
+ repairShadowItem.addActionListener(this);
11111549 menu.add(invariantsItem = new MenuItem("Invariants"));
11121550 invariantsItem.addActionListener(this);
11131551 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1553,7 @@
11151553 menu.add("-");
11161554 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171555 editScriptItem.addActionListener(this);
1556
+ }
11181557 }
11191558
11201559 void ScreenFit()
....@@ -1237,9 +1676,34 @@
12371676 shadow.material = new cMaterial(obj.material);
12381677 shadow.material.diffuse = 0.0001f;
12391678 shadow.material.specular = 0.0001f;
1679
+ //shadow.projectedVertices[1].x = 300;
12401680
12411681 makeSomething(shadow);
12421682 }
1683
+
1684
+ private void ClearUnpinned()
1685
+ {
1686
+ //for (Object3D obj : listUI)
1687
+ for (int i=listUI.size(); --i>=0;)
1688
+ {
1689
+ Object3D obj = listUI.elementAt(i);
1690
+ if (!obj.pinned)
1691
+ {
1692
+ obj.CloseUI();
1693
+ listUI.remove(i);
1694
+ }
1695
+ }
1696
+ }
1697
+
1698
+ private void EditElement(Object3D elem, boolean newWindow)
1699
+ {
1700
+ // if (!(elem instanceof Composite))
1701
+ // newWindow = false;
1702
+ listUI.add(elem);
1703
+ elem.openEditWindow(this, newWindow); //, false);
1704
+ System.out.println("edit : " + elem);
1705
+ elem.editWindow.refreshContents(true); // ? new
1706
+ }
12431707
12441708 /**
12451709 * applyExample
....@@ -1443,9 +1907,9 @@
14431907
14441908 void Overwrite(int mask)
14451909 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1910
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471911 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1912
+ Object3D content = Grafreed.clipboard.get(0);
14491913
14501914 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511915 content = ((cGroup)content).get(0);
....@@ -1468,6 +1932,7 @@
14681932 //
14691933 public void actionPerformed(ActionEvent event) // , Object arg)
14701934 {
1935
+ Object source = event.getSource();
14711936 /*
14721937 if (event.getSource() == nameField)
14731938 {
....@@ -1479,11 +1944,11 @@
14791944 }
14801945 else
14811946 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1947
+ if (source == lookAtItem || source == lookFromItem)
14831948 {
14841949 ScreenFit();
14851950 } else
1486
- if (event.getSource() == switchItem)
1951
+ if (source == switchViewItem)
14871952 {
14881953 cVector v1 = new cVector();
14891954 cVector v2 = new cVector();
....@@ -1492,11 +1957,11 @@
14921957 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931958 objEditor.cameraView.repaint();
14941959 } else
1495
- if (event.getSource() == rectoidItem)
1960
+ if (source == rectoidItem || source == boxButton)
14961961 {
14971962 makeSomething(new Box());
14981963 } else
1499
- if (event.getSource() == particleItem)
1964
+ if (source == particleItem || source == particlesButton)
15001965 {
15011966 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021967 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1982,9 @@
15171982 applyExample(particleGeom, "SMOKE");
15181983 makeSomething(particleGeom);
15191984 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1985
+ if (source == ragdollItem || source == ragdoll2Item)
15211986 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1987
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231988
15241989 ragdoll.toParent = LA.newMatrix();
15251990 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +2002,7 @@
15372002 } else
15382003 /*
15392004 */
1540
- if (event.getSource() == heightFieldItem)
2005
+ if (source == heightFieldItem)
15412006 {
15422007 Object3D obj = new Object3D();
15432008
....@@ -1575,27 +2040,31 @@
15752040
15762041 makeSomething(obj);
15772042 } else
1578
- if (event.getSource() == gridItem)
2043
+ if (source == gridItem || source == gridButton)
15792044 {
15802045 makeSomething(new Grid());
15812046 } else
1582
- if (event.getSource() == ellipsoidItem)
2047
+ if (source == ellipsoidItem || source == sphereButton)
15832048 {
15842049 makeSomething(new Sphere());
15852050 } else
1586
- if (event.getSource() == coneItem)
2051
+ if (source == coneItem || source == coneButton)
15872052 {
15882053 makeSomething(new Cone());
15892054 } else
1590
- if (event.getSource() == torusItem)
2055
+ if (source == torusItem || source == torusButton)
15912056 {
15922057 makeSomething(new Torus());
15932058 } else
1594
- if (event.getSource() == superItem)
2059
+ if (source == superItem || source == superButton)
15952060 {
15962061 makeSomething(new Superellipsoid());
15972062 } else
1598
- if (event.getSource() == blobItem)
2063
+ if (source == kleinItem || source == kleinButton)
2064
+ {
2065
+ makeSomething(new Klein());
2066
+ } else
2067
+ if (source == blobItem)
15992068 {
16002069 Blob blob = new Blob();
16012070 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +2072,15 @@
16032072 //blob.retile();
16042073 makeSomething(blob);
16052074 } else
1606
- if (event.getSource() == latheItem)
2075
+ if (source == latheItem)
16072076 {
16082077 makeSomething(new Lathe());
16092078 } else
1610
- if (event.getSource() == bezierItem)
2079
+ if (source == bezierItem)
16112080 {
16122081 makeSomething(new BezierSurface());
16132082 } else
1614
- if (event.getSource() == checkerItem)
2083
+ if (source == overlayItem || source == overlayButton)
16152084 {
16162085 /*
16172086 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +2095,7 @@
16262095 */
16272096 makeSomething(new Checker());
16282097 } else
1629
- if (event.getSource() == meshItem)
2098
+ if (source == meshItem)
16302099 {
16312100 Object3D itemtomake = new Object3D();
16322101 Object3D child;
....@@ -1647,35 +2116,35 @@
16472116 makeSomething(child);
16482117 }
16492118 } else
1650
- if (event.getSource() == springItem)
2119
+ if (source == springItem)
16512120 {
16522121 cSpring s = new cSpring();
16532122 s.setup();
16542123 makeSomething(s);
16552124 } else
1656
- if (event.getSource() == flagItem)
2125
+ if (source == flagItem)
16572126 {
16582127 cSpring s = new cFlag();
16592128 s.setup();
16602129 makeSomething(s);
16612130 } else
1662
- if (event.getSource() == lightItem)
2131
+ if (source == lightItem || source == lightButton)
16632132 {
16642133 makeSomething(new Light());
16652134 } else
1666
- if (event.getSource() == csgItem)
2135
+ if (source == csgItem)
16672136 {
16682137 group(new CSG());
16692138 } else
1670
- if (event.getSource() == templateItem)
2139
+ if (source == templateItem)
16712140 {
16722141 group(new cTemplate());
16732142 } else
1674
- if (event.getSource() == attributeItem)
2143
+ if (source == attributeItem)
16752144 {
16762145 makeSomething(new Attribute());
16772146 } else
1678
- if (event.getSource() == pointflowItem)
2147
+ if (source == pointflowItem)
16792148 {
16802149 makeSomething(new PointFlow());
16812150 } else
....@@ -1687,7 +2156,7 @@
16872156 } else
16882157 */
16892158
1690
- if (event.getSource() == superLoopItem)
2159
+ if (source == superLoopItem)
16912160 {
16922161 Composite g = new cGroup();
16932162 for (int i=0; i<15; i++)
....@@ -1709,30 +2178,30 @@
17092178
17102179 group(g);
17112180 } else
1712
- if (event.getSource() == loopItem)
2181
+ if (source == loopItem || source == loopButton)
17132182 {
17142183 Composite csg = new GroupLeaf();
17152184 csg.count = 5;
17162185 group(csg);
1717
- Composite child = new cGroup();
2186
+ Composite child = new cGroup("Branch");
17182187 csg.addChild(child);
17192188 child.addChild(csg);
17202189 } else
1721
- if (event.getSource() == doubleItem)
2190
+ if (source == doubleItem)
17222191 {
1723
- Composite csg = new GroupLeaf();
2192
+ Composite csg = new GroupLeaf("Fork");
17242193 csg.count = 5;
17252194 group(csg);
1726
- Composite child = new cGroup();
2195
+ Composite child = new cGroup("Branch A");
17272196 csg.addChild(child);
17282197 child.addChild(csg);
1729
- child = new cGroup();
2198
+ child = new cGroup("Branch B");
17302199 csg.addChild(child);
17312200 child.addChild(csg);
17322201 } else
1733
- if (event.getSource() == tripleItem)
2202
+ if (source == tripleItem)
17342203 {
1735
- Composite csg = new GroupLeaf();
2204
+ Composite csg = new GroupLeaf("Trident");
17362205 csg.count = 4;
17372206 group(csg);
17382207 Composite child = new cGroup();
....@@ -1745,73 +2214,98 @@
17452214 csg.addChild(child);
17462215 child.addChild(csg);
17472216 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
2217
+ if (source == computeAOItem)
17502218 {
1751
- ImportGFD();
2219
+ Globals.drawMode = CameraPane.OCCLUSION;
2220
+ Globals.theRenderer.repaint();
17522221 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
2222
+ if (source == recompileItem)
17712223 {
17722224 Recompile();
17732225 refreshContents();
17742226 } else
1775
- if (event.getSource() == editScriptItem)
2227
+ if (source == editScriptItem)
17762228 {
17772229 OpenDialog();
17782230 refreshContents();
17792231 } else
1780
- if (event.getSource() == invariantsItem)
2232
+ if (source == invariantsItem)
17812233 {
17822234 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
2235
+ Grafreed.grafreeD.universe.invariants();
17842236 } else
1785
- if (event.getSource() == memoryItem)
2237
+ if (source == memoryItem)
17862238 {
17872239 //System.out.println("Invariants:");
17882240 PrintMemory();
17892241 } else
1790
- if (event.getSource() == pathItem)
2242
+ if (source == pathItem)
17912243 {
17922244 PrintPath();
17932245 } else
1794
- if (event.getSource() == analyzeItem)
2246
+ if (source == analyzeItem)
17952247 {
17962248 AnalyzeObject();
17972249 } else
1798
- if (event.getSource() == dumpItem)
2250
+ if (source == dumpItem)
17992251 {
18002252 DumpObject();
18012253 } else
1802
- if (event.getSource() == screenfitButton)
2254
+ if (source == minButton)
18032255 {
1804
- //Reload(lastConverter, lastFilename, true);
2256
+ Minimize();
2257
+ } else
2258
+ if (source == maxButton)
2259
+ {
2260
+ Maximize();
2261
+ } else
2262
+ if (source == fullButton)
2263
+ {
2264
+ ToggleFullScreen();
2265
+ } else
2266
+ if (source == undoButton)
2267
+ {
2268
+ // Go to previous version
2269
+ //if (!Undo())
2270
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2271
+ Undo();
2272
+ } else
2273
+ if (source == restoreButton)
2274
+ {
2275
+ // Restore current version
2276
+ Restore();
2277
+ } else
2278
+ if (source == replaceButton)
2279
+ {
2280
+ // Overwrite current version
2281
+ Replace();
2282
+ } else
2283
+ if (source == redoButton)
2284
+ {
2285
+ // Go to next version
2286
+ Redo();
2287
+ } else
2288
+ if (source == saveButton)
2289
+ {
2290
+ // Save a new version
2291
+ if (!Save(true))
2292
+ java.awt.Toolkit.getDefaultToolkit().beep();
2293
+ } else
2294
+ if (source == oneStepButton)
2295
+ {
2296
+ Globals.ONESTEP = true;
2297
+ cameraView.repaint();
2298
+ } else
2299
+ if (source == screenfitButton)
2300
+ {
18052301 ScreenFit();
18062302 } else
1807
- if (event.getSource() == screenfitpointButton)
2303
+ if (source == screenfitpointButton)
18082304 {
1809
- //Reload(lastConverter, lastFilename, true);
18102305 ScreenFitPoint();
18112306 } else
1812
- if (event.getSource() == snapobjectButton)
2307
+ if (source == snapobjectButton)
18132308 {
1814
- //Reload(lastConverter, lastFilename, true);
18152309 SnapObject();
18162310 } else
18172311 // if (event.getSource() == recompileButton)
....@@ -1820,13 +2314,13 @@
18202314 // Recompile();
18212315 // refreshContents();
18222316 // } else
1823
- if (event.getSource() == gcButton)
2317
+ if (source == gcButton)
18242318 {
18252319 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262320 System.gc();
18272321 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282322 } else
1829
- if (event.getSource() == editLeafItem)
2323
+ if (source == editLeafItem)
18302324 {
18312325 Object3D obj;
18322326 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2334,74 @@
18402334 }
18412335 refreshContents(true);
18422336 } else
1843
- if (event.getSource() == openWindowItem)
2337
+ if (source == openWindowItem)
18442338 {
18452339 EditSelection(true);
18462340 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2341
+ if (source == cutItem || source == clearButton)
18482342 {
18492343 loadClipboard(true);
18502344 } else
1851
- if (event.getSource() == duplicateItem)
2345
+ if (source == undoItem)
18522346 {
1853
- Object3D keep = GrafreeD.clipboard;
2347
+ Undo();
2348
+ } else
2349
+ if (source == redoItem)
2350
+ {
2351
+ Redo();
2352
+ } else
2353
+ if (source == duplicateItem)
2354
+ {
2355
+ Object3D keep = Grafreed.clipboard;
18542356 loadClipboard(false);
18552357 paste(false);
1856
- GrafreeD.clipboard = keep;
2358
+ Grafreed.clipboard = keep;
18572359 } else
1858
- if (event.getSource() == cloneItem)
2360
+ if (source == cloneItem)
18592361 {
18602362 CloneSelection(false);
18612363 } else
1862
- if (event.getSource() == cloneSupportItem)
2364
+ if (source == cloneSupportItem)
18632365 {
18642366 CloneSelection(true);
18652367 } else
1866
- if (event.getSource() == copyItem)
2368
+ if (source == copyItem)
18672369 {
18682370 loadClipboard(false);
18692371 } else
1870
- if (event.getSource() == pasteItem)
2372
+ if (source == pasteItem)
18712373 {
18722374 paste(false);
18732375 } else
1874
- if (event.getSource() == pasteLinkItem)
2376
+ if (source == pasteIntoItem)
18752377 {
1876
- pasteInto(false);
2378
+ pasteInto(true, false);
18772379 } else
1878
- if (event.getSource() == pasteCloneItem)
2380
+ if (source == pasteLinkItem)
18792381 {
1880
- pasteInto(true);
2382
+ pasteInto(false, false);
18812383 } else
1882
- if (event.getSource() == pasteExpandItem)
2384
+ if (source == pasteCloneItem)
2385
+ {
2386
+ pasteInto(true, true);
2387
+ } else
2388
+ if (source == pasteExpandItem)
18832389 {
18842390 paste(true);
18852391 } else
1886
- if (event.getSource() == synchronizeItem)
2392
+ if (source == synchronizeItem)
18872393 {
18882394 Overwrite(Object3D.TRANSFORM);
18892395 } else
1890
- if (event.getSource() == overwriteNameItem)
2396
+ if (source == overwriteNameItem)
18912397 {
18922398 Overwrite(Object3D.NAME);
18932399 } else
1894
- if (event.getSource() == overwriteUVItem)
2400
+ if (source == overwriteUVItem)
18952401 {
18962402 Overwrite(Object3D.UV);
18972403 } else
1898
- if (event.getSource() == overwriteMatItem)
2404
+ if (source == overwriteMatItem)
18992405 {
19002406 /* july 2015
19012407 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2421,7 @@
19152421
19162422 Overwrite(dropAttributes);
19172423 }
1918
- if (event.getSource() == overwriteGeoItem)
2424
+ if (source == overwriteGeoItem)
19192425 {
19202426 Overwrite(Object3D.GEOMETRY);
19212427 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2438,7 @@
19322438 // refreshContents();
19332439 // }
19342440 } else
1935
- if (event.getSource() == generateMeshItem)
2441
+ if (source == generateMeshItem)
19362442 {
19372443 //if (group.selection.size() == 1)
19382444 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2449,7 @@
19432449 ResetModel();
19442450 refreshContents();
19452451 } else
1946
- if (event.getSource() == extractGeometriesItem)
2452
+ if (source == extractGeometriesItem)
19472453 {
19482454 boolean one = false;
19492455
....@@ -1970,7 +2476,7 @@
19702476 ResetModel();
19712477 refreshContents();
19722478 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2479
+ if (source == cloneGeometriesItem)
19742480 {
19752481 boolean one = false;
19762482
....@@ -1996,32 +2502,37 @@
19962502 ResetModel();
19972503 refreshContents();
19982504 } else
1999
- if (event.getSource() == shareGeometriesItem)
2505
+ if (source == shareGeometriesItem)
20002506 {
20012507 boolean one = false;
20022508
20032509 if (group.selection.size() == 1)
20042510 one = true;
20052511
2512
+ Object3D merge = null;
2513
+
20062514 Object3D content = new cGroup();
20072515
20082516 for (int i=0; i<group.selection.size(); i++)
20092517 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2518
+ merge = new Merge(group.selection.get(i));
20112519
20122520 if (one)
2013
- makeSomething(sel, false);
2521
+ makeSomething(merge, false);
20142522 else
2015
- content.addChild(sel);
2523
+ content.addChild(merge);
20162524 }
20172525
20182526 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2527
+ makeSomething(content, true);
2528
+ else
2529
+ {
2530
+ ResetModel();
2531
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2532
+ refreshContents();
2533
+ }
20232534 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2535
+ if (source == mergeGeometriesItem)
20252536 {
20262537 boolean one = false;
20272538
....@@ -2051,7 +2562,7 @@
20512562 ResetModel();
20522563 refreshContents();
20532564 } else
2054
- if (event.getSource() == linkverticesItem)
2565
+ if (source == linkverticesItem)
20552566 {
20562567 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572568 // {
....@@ -2064,39 +2575,48 @@
20642575 // group.selection.get(0).setMasterThis(content); // should be identity
20652576 // refreshContents();
20662577 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2578
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682579 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2580
+ Object3D content = Grafreed.clipboard.get(0);
20702581
20712582 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722583 content = ((cGroup)content).get(0);
20732584
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2585
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752586 for (int i=0; i<group.selection.size(); i++)
20762587 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2588
+ boolean random = CameraPane.SWITCH;
2589
+ CameraPane.SWITCH = false; // parse all random nodes
20792590 group.selection.get(i).linkVerticesThis(content);
20802591 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2592
+ CameraPane.SWITCH = random;
20822593 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2594
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842595 refreshContents();
20852596 }
20862597 } else
2087
- if (event.getSource() == resetsupportItem)
2598
+ if (source == resetsupportItem)
20882599 {
20892600 for (int i=0; i<group.selection.size(); i++)
20902601 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2602
+ boolean random = CameraPane.SWITCH;
2603
+ CameraPane.SWITCH = false; // parse all random nodes
20932604 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2605
+ CameraPane.SWITCH = random;
20952606 }
20962607
20972608 refreshContents();
20982609 } else
2099
- if (event.getSource() == resetreferencesItem)
2610
+ if (source == relinkverticesItem)
2611
+ {
2612
+ boolean random = CameraPane.SWITCH;
2613
+ CameraPane.SWITCH = false; // parse all random nodes
2614
+ group.selection.RelinkToSupport();
2615
+ CameraPane.SWITCH = random;
2616
+
2617
+ refreshContents();
2618
+ } else
2619
+ if (source == resetreferencesItem)
21002620 {
21012621 for (int i=0; i<group.selection.size(); i++)
21022622 {
....@@ -2105,11 +2625,11 @@
21052625
21062626 refreshContents();
21072627 } else
2108
- if (event.getSource() == setMasterItem)
2628
+ if (source == setMasterItem)
21092629 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2630
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112631 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2632
+ Object3D content = Grafreed.clipboard.get(0);
21132633
21142634 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152635 content = ((cGroup)content).get(0);
....@@ -2118,13 +2638,13 @@
21182638 refreshContents();
21192639 }
21202640 } else
2121
- if (event.getSource() == poseMeshItem)
2641
+ if (source == poseMeshItem)
21222642 {
21232643 if (group.selection.size() == 1)
21242644 {
2125
- if (GrafreeD.clipboard.size() == 1)
2645
+ if (Grafreed.clipboard.size() == 1)
21262646 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2647
+ Object3D content = Grafreed.clipboard.get(0);
21282648
21292649 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302650 content = ((cGroup)content).get(0);
....@@ -2137,19 +2657,19 @@
21372657 }
21382658
21392659 } else
2140
- if (event.getSource() == revertMeshItem)
2660
+ if (source == revertMeshItem)
21412661 {
21422662 RevertMeshes();
21432663 } else
2144
- if (event.getSource() == resetMeshItem)
2664
+ if (source == resetAllItem)
21452665 {
21462666 ResetAll();
21472667 } else
2148
- if (event.getSource() == stepAllItem)
2668
+ if (source == stepAllItem)
21492669 {
21502670 StepAll();
21512671 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2672
+ if (source == deleteItem) // || event.getSource() == clearButton)
21532673 {
21542674 //int indices[] = jList.getSelectedIndices();
21552675 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2677,46 @@
21572677
21582678 ClearSelection(false);
21592679 } else
2160
- if (event.getSource() == clearAllItem)
2680
+ if (source == clearAllItem)
21612681 {
21622682 ClearSelection(true);
21632683 } else
2164
- if (event.getSource() == grabItem)
2684
+ if (source == grabItem || source == groupButton)
21652685 {
2166
- group(new cGroup(), true);
2686
+ group(new cGroup(), false); // true);
21672687 } else
2168
- if (event.getSource() == frontItem)
2688
+ if (source == hideItem)
2689
+ {
2690
+ group(new HiddenObject());
2691
+ } else
2692
+ if (source == frontItem)
21692693 {
21702694 front();
21712695 } else
2172
- if (event.getSource() == backItem)
2696
+ if (source == backItem)
21732697 {
21742698 back();
21752699 } else
2176
- if (event.getSource() == cameraItem)
2700
+ if (source == cameraItem)
21772701 {
21782702 makeSomething(new Camera());
21792703 } else
2180
- if (event.getSource() == compositeItem)
2704
+ if (source == compositeItem || source == compositeButton)
21812705 {
21822706 group(new Composite());
21832707 } else
2184
- if (event.getSource() == randomItem)
2708
+ if (source == switchItem || source == switchButton)
21852709 {
21862710 RandomNode random = new RandomNode();
21872711 group(random);
21882712 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2713
+ random.name = random.get(0).name + "Switch";
21902714 } else
2191
- if (event.getSource() == physicsItem)
2715
+ if (source == physicsItem)
21922716 {
21932717 group(new PhysicsNode());
21942718 } else
2195
- if (event.getSource() == frameselectorItem)
2719
+ if (source == frameselectorItem)
21962720 {
21972721 for (int i=0; i<group.selection.size(); i++)
21982722 {
....@@ -2204,7 +2728,7 @@
22042728 ResetModel();
22052729 refreshContents();
22062730 } else
2207
- if (event.getSource() == switchGeoItem)
2731
+ if (source == switchGeoItem)
22082732 {
22092733 for (int i=0; i<group.selection.size(); i++)
22102734 {
....@@ -2216,7 +2740,7 @@
22162740 ResetModel();
22172741 refreshContents();
22182742 } else
2219
- if (event.getSource() == switchTransfoItem)
2743
+ if (source == switchTransfoItem)
22202744 {
22212745 for (int i=0; i<group.selection.size(); i++)
22222746 {
....@@ -2228,7 +2752,7 @@
22282752 ResetModel();
22292753 refreshContents();
22302754 } else
2231
- if (event.getSource() == morphItem)
2755
+ if (source == morphItem)
22322756 {
22332757 for (int i=0; i<group.selection.size(); i++)
22342758 {
....@@ -2240,7 +2764,7 @@
22402764 ResetModel();
22412765 refreshContents();
22422766 } else
2243
- if (event.getSource() == scriptNodeItem)
2767
+ if (source == scriptNodeItem)
22442768 {
22452769 boolean atleastone = false;
22462770
....@@ -2279,199 +2803,252 @@
22792803 }
22802804 }
22812805 } else
2282
- if (event.getSource() == linkerItem)
2806
+ if (source == linkerItem)
22832807 {
22842808 group(new cLinker());
22852809 } else
2286
- if (event.getSource() == textureItem)
2810
+ if (source == textureItem || source == textureButton)
22872811 {
22882812 group(new TextureNode());
22892813 } else
2290
- if (event.getSource() == shadowXItem)
2814
+ if (source == billboardItem)
2815
+ {
2816
+ group(new BillboardNode());
2817
+ } else
2818
+ if (source == shadowXItem)
22912819 {
22922820 CastShadow(0);
22932821 } else
2294
- if (event.getSource() == shadowYItem)
2822
+ if (source == shadowYItem)
22952823 {
22962824 CastShadow(1);
22972825 } else
2298
- if (event.getSource() == shadowZItem)
2826
+ if (source == shadowZItem)
22992827 {
23002828 CastShadow(2);
23012829 } else
2302
- if (event.getSource() == ungroupItem)
2830
+ if (source == ungroupItem || source == ungroupButton)
23032831 {
2304
- ungroup();
2832
+ boolean hasRoot = false;
2833
+
2834
+ for (int i=0; i<group.selection.size(); i++)
2835
+ {
2836
+ if (group.selection.get(i) == group)
2837
+ {
2838
+ hasRoot = true;
2839
+ break;
2840
+ }
2841
+ }
2842
+
2843
+ if (!hasRoot)
2844
+ {
2845
+ for (int i=0; i<group.selection.size(); i++)
2846
+ {
2847
+ Ungroup(group.selection.get(i));
2848
+ }
2849
+
2850
+ ClearSelection(false);
2851
+
2852
+ refreshContents();
2853
+ }
23052854 } else
2306
- if (event.getSource() == genUVItem)
2855
+ if (source == genUVItem)
23072856 {
23082857 GenUV();
23092858 } else
2310
- if (event.getSource() == genNormalsCADItem)
2859
+ if (source == genNormalsCADItem)
23112860 {
23122861 GenNormals(true);
23132862 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2863
+ if (source == genNormalsMESHItem)
23152864 {
2316
- GenNormals(true); // TODO
2865
+ GenNormalsMESH();
23172866 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2867
+ if (source == genNormalsORGANItem)
23192868 {
23202869 GenNormals(false);
23212870 } else
2322
- if (event.getSource() == stripifyItem)
2871
+ if (source == genNormalsMINEItem)
2872
+ {
2873
+ GenNormalsMINE();
2874
+ } else
2875
+ if (source == stripifyItem)
23232876 {
23242877 Stripify();
23252878 } else
2326
- if (event.getSource() == unstripifyItem)
2879
+ if (source == unstripifyItem)
23272880 {
23282881 Unstripify();
23292882 } else
2330
- if (event.getSource() == trimItem)
2883
+ if (source == trimItem)
23312884 {
23322885 Trim();
23332886 } else
2334
- if (event.getSource() == untrimItem)
2887
+ if (source == untrimItem)
23352888 {
23362889 Untrim();
23372890 } else
2338
- if (event.getSource() == clearColorsItem)
2891
+ if (source == clearColorsItem)
23392892 {
23402893 ClearColors();
23412894 } else
2342
- if (event.getSource() == clearMaterialsItem)
2895
+ if (source == clearMaterialsItem)
23432896 {
23442897 ClearMaterials();
23452898 } else
2346
- if (event.getSource() == liveleavesItem)
2899
+ if (source == liveleavesItem)
23472900 {
23482901 LiveLeaves(true);
23492902 } else
2350
- if (event.getSource() == unliveleavesItem)
2903
+ if (source == unliveleavesItem)
23512904 {
23522905 LiveLeaves(false);
23532906 } else
2354
- if (event.getSource() == supportleavesItem)
2907
+ if (source == supportleavesItem)
23552908 {
23562909 SupportLeaves(true);
23572910 } else
2358
- if (event.getSource() == unsupportleavesItem)
2911
+ if (source == unsupportleavesItem)
23592912 {
23602913 SupportLeaves(false);
23612914 } else
2362
- if (event.getSource() == hideleavesItem)
2915
+ if (source == hideleavesItem)
23632916 {
23642917 HideLeaves(true);
23652918 } else
2366
- if (event.getSource() == showleavesItem)
2919
+ if (source == showleavesItem)
23672920 {
23682921 HideLeaves(false);
23692922 } else
2370
- if (event.getSource() == markleavesItem)
2923
+ if (source == markleavesItem)
23712924 {
23722925 MarkLeaves(true);
23732926 } else
2374
- if (event.getSource() == unmarkleavesItem)
2927
+ if (source == unmarkleavesItem)
23752928 {
23762929 MarkLeaves(false);
23772930 } else
2378
- if (event.getSource() == flipVItem)
2931
+ if (source == rewindleavesItem)
2932
+ {
2933
+ RewindLeaves(true);
2934
+ } else
2935
+ if (source == unrewindleavesItem)
2936
+ {
2937
+ RewindLeaves(false);
2938
+ } else
2939
+ if (source == randomleavesItem)
2940
+ {
2941
+ RandomLeaves(true);
2942
+ } else
2943
+ if (source == unrandomleavesItem)
2944
+ {
2945
+ RandomLeaves(false);
2946
+ } else
2947
+ if (source == flipVItem)
23792948 {
23802949 FlipV(true);
23812950 } else
2382
- if (event.getSource() == unflipVItem)
2951
+ if (source == unflipVItem)
23832952 {
23842953 FlipV(false);
23852954 } else
2386
- if (event.getSource() == lowTexturesItem)
2955
+ if (source == lowTexturesItem)
23872956 {
23882957 SetTexRes(0);
23892958 } else
2390
- if (event.getSource() == normalTexturesItem)
2959
+ if (source == normalTexturesItem)
23912960 {
23922961 SetTexRes(1);
23932962 } else
2394
- if (event.getSource() == highTexturesItem)
2963
+ if (source == highTexturesItem)
23952964 {
23962965 SetTexRes(2);
23972966 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2967
+ if (source == veryhighTexturesItem)
23992968 {
24002969 SetTexRes(3);
24012970 } else
2402
- if (event.getSource() == maxTexturesItem)
2971
+ if (source == maxTexturesItem)
24032972 {
24042973 SetTexRes(4);
24052974 } else
2406
- if (event.getSource() == panoTexturesItem)
2975
+ if (source == panoTexturesItem)
24072976 {
24082977 SetTexRes(5);
24092978 } else
2410
- if (event.getSource() == reverseNormalsItem)
2979
+ if (source == reverseNormalsItem)
24112980 {
24122981 ReverseNormals();
24132982 } else
2414
- if (event.getSource() == parseverticesItem)
2983
+ if (source == parseverticesItem)
24152984 {
24162985 ParseVertices();
24172986 } else
2418
- if (event.getSource() == textureFieldItem)
2987
+ if (source == textureFieldItem)
24192988 {
24202989 TextureVertices();
24212990 } else
2422
- if (event.getSource() == alignItem)
2991
+ if (source == alignItem)
24232992 {
24242993 Align();
24252994 } else
2426
- if (event.getSource() == mirrorItem)
2995
+ if (source == mirrorItem)
24272996 {
24282997 MirrorPoses();
24292998 } else
2430
- if (event.getSource() == reduceMorphItem)
2999
+ if (source == reduceMorphItem)
24313000 {
24323001 MeshReduction(false);
24333002 } else
2434
- if (event.getSource() == reduce34MorphItem)
3003
+ if (source == reduce34MorphItem)
24353004 {
24363005 MeshReduction(true);
24373006 } else
2438
- if (event.getSource() == reverseTrianglesItem)
3007
+ if (source == reverseTrianglesItem)
24393008 {
24403009 ReverseTriangles();
24413010 } else
2442
- if (event.getSource() == reduceMeshItem)
3011
+ if (source == reduceMeshItem)
24433012 {
24443013 ReduceMesh(false);
24453014 } else
2446
- if (event.getSource() == reduce34MeshItem)
3015
+ if (source == reduce34MeshItem)
24473016 {
24483017 ReduceMesh(true);
24493018 } else
2450
- if (event.getSource() == increaseMeshItem)
3019
+ if (source == increaseMeshItem)
24513020 {
24523021 IncreaseMesh();
24533022 } else
2454
- if (event.getSource() == clipMeshItem)
3023
+ if (source == clipMeshItem)
24553024 {
24563025 ClipMesh();
24573026 } else
2458
- if (event.getSource() == smoothMeshItem)
3027
+ if (source == smoothMeshItem)
24593028 {
24603029 SmoothMesh();
24613030 } else
2462
- if (event.getSource() == transformgeometryItem)
3031
+ if (source == transformGeometryItem)
24633032 {
24643033 TransformGeometry();
24653034 } else
2466
- if (event.getSource() == resetTransformItem)
3035
+ if (source == transformChildrenItem)
3036
+ {
3037
+ TransformChildren();
3038
+ } else
3039
+ if (source == resetTransformItem)
24673040 {
24683041 ResetTransform();
24693042 } else
2470
- if (event.getSource() == resetCentroidItem)
3043
+ if (source == resetCentroidItem)
24713044 {
2472
- ResetCentroid();
3045
+ ResetCentroid(true);
24733046 } else
2474
- if (event.getSource() == resetParentItem)
3047
+ if (source == resetCentroidXZItem)
3048
+ {
3049
+ ResetCentroid(false);
3050
+ } else
3051
+ if (source == resetParentItem)
24753052 {
24763053 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773054 {
....@@ -2481,7 +3058,7 @@
24813058
24823059 refreshContents();
24833060 } else
2484
- if (event.getSource() == repairParentItem)
3061
+ if (source == repairParentItem)
24853062 {
24863063 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24873064 {
....@@ -2495,7 +3072,21 @@
24953072
24963073 refreshContents();
24973074 } else
2498
- if (event.getSource() == sortbysizeItem)
3075
+ if (source == repairShadowItem)
3076
+ {
3077
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3078
+ {
3079
+ Object3D obj = (Object3D)e.nextElement();
3080
+ obj.RepairShadow();
3081
+// for (int i=0; i<obj.size(); i++)
3082
+// {
3083
+// obj.get(i).parent = obj;
3084
+// }
3085
+ }
3086
+
3087
+ refreshContents();
3088
+ } else
3089
+ if (source == sortbysizeItem)
24993090 {
25003091 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25013092 {
....@@ -2507,7 +3098,7 @@
25073098 ResetModel();
25083099 refreshContents();
25093100 } else
2510
- if (event.getSource() == sortbynameItem)
3101
+ if (source == sortbynameItem)
25113102 {
25123103 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25133104 {
....@@ -2519,7 +3110,7 @@
25193110 ResetModel();
25203111 refreshContents();
25213112 } else
2522
- if (event.getSource() == attachPigmentItem)
3113
+ if (source == attachPigmentItem)
25233114 {
25243115 String texture = GetFile("Attach pigment");
25253116 Object3D obj;
....@@ -2531,7 +3122,7 @@
25313122
25323123 refreshContents();
25333124 } else
2534
- if (event.getSource() == detachPigmentItem)
3125
+ if (source == detachPigmentItem)
25353126 {
25363127 Object3D obj;
25373128 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +3133,7 @@
25423133
25433134 refreshContents();
25443135 } else
2545
- if (event.getSource() == attachBumpItem)
3136
+ if (source == attachBumpItem)
25463137 {
25473138 String texture = GetFile("Attach bump");
25483139 Object3D obj;
....@@ -2554,7 +3145,7 @@
25543145
25553146 refreshContents();
25563147 } else
2557
- if (event.getSource() == detachBumpItem)
3148
+ if (source == detachBumpItem)
25583149 {
25593150 Object3D obj;
25603151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +3156,7 @@
25653156
25663157 refreshContents();
25673158 } else
2568
- if (event.getSource() == pigmentBumpItem)
3159
+ if (source == pigmentBumpItem)
25693160 {
25703161 Object3D obj;
25713162 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +3167,237 @@
25763167
25773168 refreshContents();
25783169 } else
2579
- if (event.getSource() == flashSelectionButton)
3170
+ if (source == flashSelectionButton)
25803171 {
25813172 CameraPane.flash = true;
25823173 refreshContents();
25833174 } else
2584
- if (event.getSource() == oneButton)
3175
+ if (source == oneButton)
25853176 {
25863177 } else
2587
- if (event.getSource() == twoButton)
3178
+ if (source == twoButton)
25883179 {
25893180 radio.layout = twoButton;
3181
+
3182
+ if (CameraPane.FULLSCREEN)
3183
+ fullscreenLayout = radio.layout;
3184
+
25903185 // bug
25913186 //gridPanel.setDividerLocation(1.0);
25923187 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
3188
+// bigThree.remove(scenePanel);
3189
+// bigThree.remove(centralPanel);
3190
+// bigThree.remove(XYZPanel);
3191
+// aWindowConstraints.gridx = 0;
3192
+// aWindowConstraints.gridy = 0;
3193
+// aWindowConstraints.gridwidth = 1;
3194
+// // aConstraints.gridheight = 3;
3195
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3196
+// aWindowConstraints.weightx = 0;
3197
+// aWindowConstraints.weighty = 1;
3198
+// //bigThree.add(jtp, aWindowConstraints);
3199
+// aWindowConstraints.weightx = 1;
3200
+// aWindowConstraints.gridwidth = 3;
3201
+// // aConstraints.gridheight = 3;
3202
+// aWindowConstraints.gridx = 1;
3203
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3204
+// bigThree.add(centralPanel, aWindowConstraints);
3205
+// aWindowConstraints.weightx = 0;
3206
+// aWindowConstraints.gridx = 4;
3207
+// aWindowConstraints.gridwidth = 1;
3208
+// // aConstraints.gridheight = 3;
3209
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3210
+// //bigThree.add(XYZPanel, aWindowConstraints);
3211
+// scenePanel.setVisible(false);
3212
+// centralPanel.setVisible(true);
3213
+// XYZPanel.setVisible(false);
3214
+ bigThree.ClearUI();
3215
+ bigThree.add(centralPanel);
3216
+ bigThree.FlushUI();
3217
+
3218
+ cameraView.requestFocusInWindow();
3219
+
3220
+// refreshContents(true);
3221
+//
3222
+// try
3223
+// {
3224
+// java.awt.Robot bot = new java.awt.Robot();
3225
+// int mask = InputEvent.BUTTON1_MASK;
3226
+// bot.mouseMove(100, 100);
3227
+// bot.mousePress(mask);
3228
+// bot.mouseRelease(mask);
3229
+// }
3230
+// catch (Exception e)
3231
+// {
3232
+//
3233
+// }
3234
+
26173235 } else
2618
- if (event.getSource() == threeButton)
3236
+ if (source == threeButton)
26193237 {
26203238 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
3239
+
3240
+ if (CameraPane.FULLSCREEN)
3241
+ fullscreenLayout = radio.layout;
3242
+
3243
+// bigThree.remove(scenePanel);
3244
+// bigThree.remove(centralPanel);
3245
+// bigThree.remove(XYZPanel);
3246
+// aWindowConstraints.gridx = 0;
3247
+// aWindowConstraints.gridy = 0;
3248
+// aWindowConstraints.gridwidth = 1;
3249
+// // aConstraints.gridheight = 3;
3250
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3251
+// aWindowConstraints.weightx = 0;
3252
+// aWindowConstraints.weighty = 1;
3253
+// //bigThree.add(jtp, aWindowConstraints);
3254
+// aWindowConstraints.weightx = 1;
3255
+// aWindowConstraints.gridwidth = 3;
3256
+// // aConstraints.gridheight = 3;
3257
+// aWindowConstraints.gridx = 1;
3258
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3259
+// bigThree.add(centralPanel, aWindowConstraints);
3260
+// aWindowConstraints.weightx = 0;
3261
+// aWindowConstraints.gridx = 4;
3262
+// aWindowConstraints.gridwidth = 1;
3263
+// // aConstraints.gridheight = 3;
3264
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3265
+// bigThree.add(XYZPanel, aWindowConstraints);
3266
+// bigThree.validate();
3267
+// scenePanel.setVisible(false);
3268
+// centralPanel.setVisible(true);
3269
+// XYZPanel.setVisible(true);
3270
+ bigThree.ClearUI();
3271
+ bigThree.add(centralPanel);
3272
+ bigThree.add(XYZPanel);
3273
+ bigThree.FlushUI();
3274
+
3275
+ cameraView.requestFocusInWindow();
26453276 } else
2646
- if (event.getSource() == fourButton)
3277
+ if (source == fourButton)
26473278 {
26483279 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
3280
+
3281
+ if (CameraPane.FULLSCREEN)
3282
+ fullscreenLayout = radio.layout;
3283
+
3284
+// bigThree.remove(scenePanel);
3285
+// bigThree.remove(centralPanel);
3286
+// bigThree.remove(XYZPanel);
3287
+// aWindowConstraints.gridx = 0;
3288
+// aWindowConstraints.gridy = 0;
3289
+// aWindowConstraints.gridwidth = 1;
3290
+// // aWindowConstraints.gridheight = 3;
3291
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3292
+// aWindowConstraints.weightx = 1;
3293
+// aWindowConstraints.weighty = 1;
3294
+// bigThree.add(scenePanel, aWindowConstraints);
3295
+// aWindowConstraints.weightx = 1;
3296
+// aWindowConstraints.gridwidth = 3;
3297
+// // aConstraints.gridheight = 3;
3298
+// aWindowConstraints.gridx = 1;
3299
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3300
+// //bigThree.add(cameraPanel, aWindowConstraints);
3301
+// aWindowConstraints.weightx = 0;
3302
+// aWindowConstraints.gridx = 4;
3303
+// aWindowConstraints.gridwidth = 1;
3304
+// // aWindowConstraints.gridheight = 3;
3305
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3306
+// //bigThree.add(XYZPanel, aWindowConstraints);
3307
+// bigThree.validate();
3308
+// scenePanel.setVisible(true);
3309
+// centralPanel.setVisible(false);
3310
+// XYZPanel.setVisible(false);
3311
+ bigThree.ClearUI();
3312
+ bigThree.add(scenePanel);
3313
+ bigThree.FlushUI();
3314
+
3315
+ cameraView.requestFocusInWindow();
26733316 } else
2674
- if (event.getSource() == sixButton)
3317
+ if (source == sixButton)
26753318 {
26763319 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
3320
+
3321
+ if (CameraPane.FULLSCREEN)
3322
+ fullscreenLayout = radio.layout;
3323
+
3324
+// bigThree.remove(scenePanel);
3325
+// bigThree.remove(centralPanel);
3326
+// bigThree.remove(XYZPanel);
3327
+// aWindowConstraints.gridx = 0;
3328
+// aWindowConstraints.gridy = 0;
3329
+// aWindowConstraints.gridwidth = 1;
3330
+// // aConstraints.gridheight = 3;
3331
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3332
+// aWindowConstraints.weightx = 0;
3333
+// aWindowConstraints.weighty = 1;
3334
+// bigThree.add(scenePanel, aWindowConstraints);
3335
+// aWindowConstraints.weightx = 1;
3336
+// aWindowConstraints.gridwidth = 3;
3337
+// // aWindowConstraints.gridheight = 3;
3338
+// aWindowConstraints.gridx = 1;
3339
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3340
+// bigThree.add(centralPanel, aWindowConstraints);
3341
+// aWindowConstraints.weightx = 0;
3342
+// aWindowConstraints.gridx = 4;
3343
+// aWindowConstraints.gridwidth = 1;
3344
+// // aWindowConstraints.gridheight = 3;
3345
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3346
+// //bigThree.add(XYZPanel, aConstraints);
3347
+// bigThree.validate();
3348
+// scenePanel.setVisible(true);
3349
+// centralPanel.setVisible(true);
3350
+// XYZPanel.setVisible(false);
3351
+ bigThree.ClearUI();
3352
+ bigThree.add(scenePanel);
3353
+ bigThree.add(centralPanel);
3354
+ bigThree.FlushUI();
3355
+
3356
+ cameraView.requestFocusInWindow();
27013357 } else
2702
- if (event.getSource() == sevenButton)
3358
+ if (source == sevenButton)
27033359 {
27043360 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
3361
+
3362
+ if (CameraPane.FULLSCREEN)
3363
+ fullscreenLayout = radio.layout;
3364
+
3365
+// bigThree.remove(scenePanel);
3366
+// bigThree.remove(centralPanel);
3367
+// bigThree.remove(XYZPanel);
3368
+// aWindowConstraints.gridx = 0;
3369
+// aWindowConstraints.gridy = 0;
3370
+// aWindowConstraints.gridwidth = 1;
3371
+// // aWindowConstraints.gridheight = 3;
3372
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3373
+// aWindowConstraints.weightx = 0;
3374
+// aWindowConstraints.weighty = 1;
3375
+// bigThree.add(scenePanel, aWindowConstraints);
3376
+// aWindowConstraints.weightx = 1;
3377
+// aWindowConstraints.gridwidth = 3;
3378
+// // aWindowConstraints.gridheight = 3;
3379
+// aWindowConstraints.gridx = 1;
3380
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3381
+// bigThree.add(centralPanel, aWindowConstraints);
3382
+// aWindowConstraints.weightx = 0;
3383
+// aWindowConstraints.gridx = 4;
3384
+// aWindowConstraints.gridwidth = 1;
3385
+// // aConstraints.gridheight = 3;
3386
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3387
+// bigThree.add(XYZPanel, aWindowConstraints);
3388
+// bigThree.validate();
3389
+// scenePanel.setVisible(true);
3390
+// centralPanel.setVisible(true);
3391
+// XYZPanel.setVisible(true);
3392
+ bigThree.ClearUI();
3393
+ bigThree.add(scenePanel);
3394
+ bigThree.add(centralPanel);
3395
+ bigThree.add(XYZPanel);
3396
+ bigThree.FlushUI();
3397
+
3398
+ cameraView.requestFocusInWindow();
27293399 } else
2730
- if (event.getSource() == rootButton)
3400
+ if (source == rootButton)
27313401 {
27323402 Object3D obj;
27333403 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2737,66 +3407,84 @@
27373407 EditObject(obj);
27383408 }
27393409
3410
+ cameraView.requestFocusInWindow();
27403411 refreshContents(true);
27413412 } else
2742
- if (event.getSource() == closeButton)
3413
+ if (source == closeButton)
27433414 {
27443415 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453416 cRadio ab;
27463417 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27473418 {
27483419 ab = (cRadio)e.nextElement();
2749
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3420
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27503421 {
3422
+ // Patch to avoid bug with transparency.
3423
+ if (!ab.hadMaterial)
3424
+ {
3425
+ ab.object.material = null;
3426
+ }
3427
+
27513428 buttonGroup.remove(ab);
27523429 radioPanel.remove(ab);
27533430
2754
- ab.GetObject().editWindow = null;
3431
+ //ab.GetObject().editWindow = null;
3432
+ ab.GetObject().manipWindow = null;
27553433 // ab.GetObject().objectUI = null; // ?????????
27563434
27573435 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27583436 break;
27593437 }
27603438 }
3439
+
3440
+ cameraView.requestFocusInWindow();
27613441 refreshContents(true);
27623442 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3443
+ if (source == editItem || source == editButton)
27643444 {
3445
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3446
+ {
3447
+ Object3D child = (Object3D)e.nextElement();
3448
+ child.pinned = true;
3449
+ }
3450
+
27653451 EditSelection(false);
27663452 } else
2767
- if (event.getSource() == uneditButton)
3453
+ if (source == uneditButton)
27683454 {
27693455 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703456 {
27713457 Object3D child = (Object3D)e.nextElement();
27723458 if(child.editWindow != null)
27733459 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3460
+ child.pinned = false;
27743461 child.CloseUI();
27753462 listUI.remove(child);
27763463
2777
- child.editWindow = null; // ???????????
3464
+ //child.editWindow = null; // ???????????
27783465 }
2779
- objEditor.ctrlPanel.revalidate();
3466
+ objEditor.ctrlPanel.FlushUI();
27803467 //objEditor.jTree.clearSelection();
27813468 //objEditor.ResetSliders();
27823469 refreshContents(true);
27833470 } else
2784
- if (event.getSource() == clearPanelButton)
3471
+ if (source == clearPanelButton)
27853472 {
27863473 assert(copy == group);
27873474 //copy.ClearUI();
27883475 for (Object3D obj : listUI)
27893476 {
3477
+ obj.pinned = false;
27903478 obj.CloseUI();
27913479 }
27923480 listUI.clear();
27933481 refreshContents(true);
27943482 } else
2795
- if (event.getSource() == allParamsButton)
3483
+ if (source == allParamsButton)
27963484 {
27973485 assert(copy == group);
27983486
2799
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3487
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28003488
28013489 for (Object3D obj : listUI)
28023490 {
....@@ -2813,19 +3501,19 @@
28133501
28143502 refreshContents(true);
28153503 } else
2816
- if (event.getSource() == unselectButton)
3504
+ if (source == unselectButton)
28173505 {
28183506 objEditor.jTree.clearSelection();
28193507 // ?? oct 2012 GrafreeD.clipboard.clear();
28203508 objEditor.ResetSliders();
28213509 refreshContents(true);
28223510 } else
2823
- if(event.getSource() instanceof cRadio)
3511
+ if(source instanceof cRadio)
28243512 {
28253513 group.parent = keepparent;
28263514 group.attributes = 0;
28273515 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3516
+ /*cRadio*/ radio = (cRadio)source;
28293517 Object3D obj = radio.GetObject();
28303518 System.out.println("Edit " + obj);
28313519 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3533,10 @@
28453533 }
28463534
28473535 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3536
+
3537
+ SetUndoStates();
3538
+
3539
+ //Globals.theRenderer.object = group;
28493540 if(!useclient)
28503541 {
28513542 cameraView.renderCamera = radio.camera;
....@@ -2854,25 +3545,52 @@
28543545 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553546 cameraView.targetLookAt.set(radio.camera.lookAt);
28563547 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3548
+ //cameraView.lighttouched = true;
3549
+ Globals.lighttouched = true;
28583550 topView.object = group;
28593551 frontView.object = group;
28603552 sideView.object = group;
28613553 }
2862
- group.editWindow = this;
3554
+
3555
+// fix "+" issue
3556
+ //group.editWindow = this;
3557
+ group.manipWindow = this;
3558
+
28633559 /*
28643560 currentLayout = radio.layout;
28653561 if (currentLayout == null)
28663562 currentLayout = sevenButton;
28673563 */
28683564 radio.layout.doClick();
3565
+
3566
+ ClearUnpinned();
3567
+ //Grafreed.Assert(group != null);
3568
+ //Grafreed.Assert(group.selection != null);
3569
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3570
+ if (group.selection == null || group.selection.size() == 1)
3571
+ EditSelection(false);
28693572 keepparent = group.parent;
28703573 // PARENT = NULL or not???
28713574 //group.parent = null; // ROOT
28723575 //group.attributes = -1;
28733576 ResetModel();
3577
+
3578
+ cameraView.requestFocusInWindow();
28743579 refreshContents(true);
2875
- }
3580
+ } else if (event.getSource() == editCameraItem)
3581
+ {
3582
+ cameraView.ProtectCamera();
3583
+ cameraView.repaint();
3584
+ return;
3585
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3586
+ {
3587
+ cameraView.RevertCamera();
3588
+ cameraView.repaint();
3589
+ return;
3590
+ // } else if (event.getSource() == textureButton)
3591
+ // {
3592
+ // return; // true;
3593
+ }
28763594 else
28773595 {
28783596 //return super.action(event, arg);
....@@ -2881,7 +3599,6 @@
28813599 }
28823600
28833601 boolean useclient = false;
2884
- cRadio radio;
28853602
28863603 void ToggleRoot()
28873604 {
....@@ -2890,7 +3607,7 @@
28903607 if (useclient)
28913608 {
28923609 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3610
+ Globals.lighttouched = true;
28943611 //topView.object = client;
28953612 //frontView.object = client;
28963613 //sideView.object = client;
....@@ -2898,7 +3615,7 @@
28983615 else
28993616 {
29003617 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3618
+ Globals.lighttouched = true;
29023619 //topView.object = group;
29033620 //frontView.object = group;
29043621 //sideView.object = group;
....@@ -2933,6 +3650,28 @@
29333650 refreshContents();
29343651 }
29353652
3653
+ void TransformChildren()
3654
+ {
3655
+ Object3D obj;
3656
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3657
+ {
3658
+ obj = (Object3D)e.nextElement();
3659
+ obj.KeepTextureMatrices();
3660
+ obj.TransformChildren();
3661
+ obj.RestoreTextureMatrices();
3662
+
3663
+// if (obj.parent == null)
3664
+// {
3665
+// System.out.println("NULL PARENT!");
3666
+// new Exception().printStackTrace();
3667
+// }
3668
+// else
3669
+// TouchTransform(obj);
3670
+// //obj.parent.Touch();
3671
+ }
3672
+
3673
+ refreshContents();
3674
+ }
29363675
29373676 void ResetTransform()
29383677 {
....@@ -3045,7 +3784,7 @@
30453784 refreshContents();
30463785 }
30473786
3048
- void ResetCentroid()
3787
+ void ResetCentroid(boolean full)
30493788 {
30503789 Object3D obj;
30513790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3799,16 @@
30603799 LA.matIdentity(Object3D.mat);
30613800 obj.getBounds(minima, maxima, false);
30623801 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3802
+ if (full)
3803
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643804 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653805 obj.TransformMesh(Object3D.mat);
3806
+
30663807 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3808
+ if (full)
3809
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683810 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3811
+
30693812 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703813 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713814 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3837,8 @@
30943837
30953838 int size = obj.MemorySize();
30963839
3097
- System.err.println((size/1024) + " KB is the size of " + obj);
3840
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3841
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30983842 }
30993843 }
31003844 catch (Exception e)
....@@ -3131,9 +3875,9 @@
31313875 obj = (Object3D)e.nextElement();
31323876
31333877 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3878
+ Grafreed.AnalyzeObject(obj);
31353879 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3880
+ Grafreed.AnalyzeObject(obj.bRep);
31373881
31383882 // System.err.println((size/1024) + " KB is the size of " + obj);
31393883 }
....@@ -3175,6 +3919,20 @@
31753919 void GenNormals(boolean crease)
31763920 {
31773921 group.GenNormalsS(crease);
3922
+
3923
+ refreshContents();
3924
+ }
3925
+
3926
+ void GenNormalsMESH()
3927
+ {
3928
+ group.GenNormalsMeshS();
3929
+
3930
+ refreshContents();
3931
+ }
3932
+
3933
+ void GenNormalsMINE()
3934
+ {
3935
+ group.selection.GenNormalsMINE();
31783936
31793937 refreshContents();
31803938 }
....@@ -3340,8 +4098,8 @@
33404098
33414099 void ParseVertices()
33424100 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
4101
+ boolean epsequal = Grafreed.epsequal;
4102
+ Grafreed.epsequal = true;
33454103
33464104 for (int i=0; i<group.selection.size(); i++)
33474105 {
....@@ -3366,7 +4124,7 @@
33664124 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33674125 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33684126
3369
- g.add(GrafreeD.clipboard);
4127
+ g.add(Grafreed.clipboard);
33704128
33714129 buffer.add(g);
33724130 }
....@@ -3381,7 +4139,7 @@
33814139 makeSomething(buffer, i==group.selection.size()-1);
33824140 }
33834141
3384
- GrafreeD.epsequal = epsequal;
4142
+ Grafreed.epsequal = epsequal;
33854143
33864144 refreshContents();
33874145 }
....@@ -3399,7 +4157,16 @@
33994157 String pigment = Object3D.GetPigment(tex);
34004158 //String bump = Object3D.GetBump(tex);
34014159
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4160
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4161
+
4162
+ try
4163
+ {
4164
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4165
+ }
4166
+ catch (Exception e)
4167
+ {
4168
+ System.err.println("FAIL: " + node);
4169
+ }
34034170
34044171 double s = v.s;
34054172
....@@ -3447,12 +4214,26 @@
34474214
34484215 void Align()
34494216 {
4217
+ if (group.selection.size() == 0)
4218
+ return;
4219
+
4220
+ cVector bbmin = new cVector();
4221
+ cVector bbmax = new cVector();
4222
+
4223
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4224
+
4225
+ double dx = bbmax.x - bbmin.x;
4226
+ double dy = bbmax.y - bbmin.y;
4227
+ double dz = bbmax.z - bbmin.z;
4228
+
4229
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4230
+
34504231 for (int i=0; i<group.selection.size(); i++)
34514232 {
34524233 Object3D obj = group.selection.get(i);
34534234
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4235
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4236
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34564237 }
34574238
34584239 refreshContents();
....@@ -3473,11 +4254,11 @@
34734254
34744255 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34754256
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
4257
+ boolean random = CameraPane.SWITCH;
4258
+ CameraPane.SWITCH = false; // parse all random nodes
34784259 lowres.linkVerticesThis(null);
34794260 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
4261
+ CameraPane.SWITCH = random;
34814262
34824263 System.err.flush();
34834264
....@@ -3517,7 +4298,7 @@
35174298 return;
35184299
35194300 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
4301
+ Object3D ref = Grafreed.clipboard.get(0);
35214302
35224303 Object3D newgroup = new Object3D("Po:" + poses.name);
35234304
....@@ -3686,7 +4467,7 @@
36864467 group.selection.RelinkToSupport(); // july 2014
36874468 System.out.println("DONE.");
36884469 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4470
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904471 }
36914472
36924473 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4492,9 @@
37114492
37124493 void ClipMesh()
37134494 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4495
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154496 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4497
+ Object3D content = Grafreed.clipboard.get(0);
37174498
37184499 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194500 content = ((cGroup)content).get(0);
....@@ -3722,7 +4503,7 @@
37224503 // {
37234504 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244505 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4506
+ group.selection.ClipMesh(Grafreed.clipboard);
37264507 }
37274508 // group.selection.ClipMesh(GrafreeD.clipboard);
37284509 System.out.println("DONE.");
....@@ -3769,6 +4550,18 @@
37694550 void MarkLeaves(boolean hide)
37704551 {
37714552 group.selection.MarkLeaves(hide);
4553
+ refreshContents();
4554
+ }
4555
+
4556
+ void RewindLeaves(boolean hide)
4557
+ {
4558
+ group.selection.RewindLeaves(hide);
4559
+ refreshContents();
4560
+ }
4561
+
4562
+ void RandomLeaves(boolean hide)
4563
+ {
4564
+ group.selection.RandomLeaves(hide);
37724565 refreshContents();
37734566 }
37744567
....@@ -3843,28 +4636,25 @@
38434636 // }
38444637 // }
38454638
3846
- static boolean allparams = true;
3847
-
3848
- static Vector<Object3D> listUI = new Vector<Object3D>();
3849
-
38504639 void EditSelection(boolean newWindow)
38514640 {
4641
+ if (group.selection == null)
4642
+ {
4643
+ EditElement(group, newWindow); // ? new
4644
+ return;
4645
+ }
4646
+
38524647 // aConstraints.gridy = 0;
38534648 for (int i=0; i<group.selection.size(); i++)
38544649 {
38554650 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38564651 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3857
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4652
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584653
38594654 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4655
+ if(elem != group || !newWindow)
38614656 {
3862
- // if (!(elem instanceof Composite))
3863
- // newWindow = false;
3864
- listUI.add(elem);
3865
- elem.openEditWindow(this, newWindow); //, false);
3866
- System.out.println("edit : " + elem);
3867
- elem.editWindow.refreshContents(true); // ? new
4657
+ EditElement(elem, newWindow); // ? new
38684658 }
38694659 }
38704660 }
....@@ -3939,7 +4729,8 @@
39394729 //new Exception().printStackTrace();
39404730
39414731 freezemodel = true;
3942
-
4732
+ ClearUnpinned();
4733
+
39434734 /**/
39444735 //switch (event.id)
39454736 {
....@@ -3947,7 +4738,6 @@
39474738 //case 702: // Event.LIST_DESELECT
39484739 group.deselectAll();
39494740 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514741 if (tps != null)
39524742 {
39534743 for (int i=0; i < tps.length; i++)
....@@ -3956,33 +4746,39 @@
39564746
39574747 //if (child.parent != null)
39584748 //child.parent.addSelectee(child);
4749
+ objEditor.SetMaterial(child);
39594750 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634751 }
39644752 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4753
+// else
4754
+// {
4755
+// objEditor.SetMaterial(group); // .GetMaterial());
4756
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4757
+// System.err.println("info : " + group.GetPath());
4758
+// }
39714759
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4760
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39754761 CameraPane.flash = true;
39764762
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4763
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784764 // a camera
39794765 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4766
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4767
+ {
4768
+ CameraPane.camerachangeframe = 0; // don't refuse it
4769
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4770
+ }
4771
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4772
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844773 }
39854774
4775
+ if (tps != null && tps.length == 1)
4776
+ {
4777
+ EditSelection(false);
4778
+ }
4779
+
4780
+ SetPinStates(tps != null && tps.length > 0);
4781
+
39864782 refreshContents();
39874783 //return true;
39884784 }
....@@ -3991,6 +4787,35 @@
39914787
39924788 freezemodel = false;
39934789 }
4790
+
4791
+ void SetPinStates(boolean enabled)
4792
+ {
4793
+ editButton.setEnabled(enabled);
4794
+ uneditButton.setEnabled(enabled);
4795
+ unselectButton.setEnabled(enabled);
4796
+ flashSelectionButton.setEnabled(enabled);
4797
+ }
4798
+
4799
+ void refreshContents(boolean cp)
4800
+ {
4801
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4802
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4803
+ {
4804
+ objEditor.ClearInfo(); // .GetMaterial());
4805
+
4806
+ for (int i=0; i < group.selection.Size(); i++)
4807
+ {
4808
+ Object3D child = (Object3D) group.selection.get(i);
4809
+
4810
+ objEditor.AddInfo(child, this, true);
4811
+ System.err.println("info : " + child.GetPath());
4812
+ }
4813
+
4814
+ objEditor.SetText(); // jan 2014
4815
+ }
4816
+
4817
+ super.refreshContents(cp);
4818
+ }
39944819
39954820 void linkSomething(Object3D thing)
39964821 {
....@@ -4062,16 +4887,19 @@
40624887 {
40634888 if (group.selection.isEmpty())
40644889 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4890
+
4891
+ Grafreed.clipboardIsTempGroup = false;
40664892 Composite tGroup = null;
40674893 if (group.selection.size() > 0) // 1)
40684894 {
40694895 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4896
+ Grafreed.clipboardIsTempGroup = true;
40714897 }
40724898
40734899 if (cut)
40744900 {
4901
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4902
+// Save();
40754903 //int indices[] = jList.getSelectedIndices();
40764904 //for (int i = indices.length - 1; i >= 0; i--)
40774905 //jList.remove(indices[i]);
....@@ -4107,16 +4935,16 @@
41074935 //System.out.println("cut " + child);
41084936 //System.out.println("parent = " + child.parent);
41094937 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4938
+ if (Grafreed.clipboardIsTempGroup)
41114939 tGroup.add/*Child*/(tmp);
41124940 else
4113
- GrafreeD.clipboard = tmp;
4941
+ Grafreed.clipboard = tmp;
41144942 }
41154943 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4944
+ if (Grafreed.clipboardIsTempGroup)
41174945 tGroup.add/*Child*/(child);
41184946 else
4119
- GrafreeD.clipboard = child;
4947
+ Grafreed.clipboard = child;
41204948 }
41214949
41224950 //ResetModel();
....@@ -4148,21 +4976,23 @@
41484976 //System.out.println("cut " + elem);
41494977 //System.out.println("parent = " + elem.parent);
41504978 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4979
+ if (Grafreed.clipboardIsTempGroup)
41524980 tGroup.add/*Child*/(tmp);
41534981 else
4154
- GrafreeD.clipboard = tmp;
4982
+ Grafreed.clipboard = tmp;
41554983 }
41564984 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4985
+ if (Grafreed.clipboardIsTempGroup)
41584986 tGroup.add/*Child*/(child);
41594987 else
4160
- GrafreeD.clipboard = child;
4988
+ Grafreed.clipboard = child;
41614989 }
41624990
41634991 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4992
+
4993
+ if (Grafreed.clipboardIsTempGroup)
4994
+ Grafreed.clipboard = tGroup;
4995
+
41664996 if (cut)
41674997 {
41684998 ResetModel();
....@@ -4172,11 +5002,15 @@
41725002
41735003 void paste(boolean expand)
41745004 {
5005
+ if (Globals.REPLACEONMAKE)
5006
+ Save();
5007
+ boolean keep = Globals.REPLACEONMAKE;
5008
+ Globals.REPLACEONMAKE = false;
41755009 // if (GrafreeD.clipboard == null)
41765010 // return;
41775011 boolean first = true;
41785012
4179
- if (GrafreeD.clipboardIsTempGroup)
5013
+ if (Grafreed.clipboardIsTempGroup)
41805014 {
41815015 Composite temp;
41825016
....@@ -4187,7 +5021,7 @@
41875021 temp = (Composite)Applet3D.clipboard.deepCopy();
41885022 */
41895023 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5024
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41915025 {
41925026 Object3D child = (Object3D)e.nextElement();
41935027
....@@ -4221,21 +5055,22 @@
42215055 //Object3D cb = Applet3D.clipboard;
42225056 //temp.addChild(cb);
42235057 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5058
+ assert(Grafreed.clipboard.parent == null);
5059
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5060
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5061
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5062
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42295063 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
5064
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5065
+ Grafreed.clipboard.get(0).parent = keepparent;
42325066 }
42335067
5068
+ Globals.REPLACEONMAKE = keep;
42345069 ResetModel();
42355070 refreshContents();
42365071 }
42375072
4238
- void pasteInto(boolean copyit)
5073
+ void pasteInto(boolean copyit, boolean clone)
42395074 {
42405075 // if (GrafreeD.clipboard == null)
42415076 // return;
....@@ -4264,15 +5099,22 @@
42645099 if (copyit)
42655100 {
42665101 // paste(false);
4267
- CloneClipboard(false); // sept 2014
5102
+ if (clone)
5103
+ {
5104
+ CloneClipboard(false); // sept 2014
5105
+ }
5106
+ else
5107
+ {
5108
+ paste(false);
5109
+ }
42685110 }
42695111 else
42705112 {
42715113 boolean first = true;
42725114
4273
- if (GrafreeD.clipboardIsTempGroup)
5115
+ if (Grafreed.clipboardIsTempGroup)
42745116 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
5117
+ Composite temp = (Composite)Grafreed.clipboard;
42765118 Object3D copy;
42775119 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42785120 {
....@@ -4282,7 +5124,7 @@
42825124 }
42835125 } else
42845126 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
5127
+ linkSomething(Grafreed.clipboard); //.get(0));
42865128 }
42875129 }
42885130 }
....@@ -4359,6 +5201,10 @@
43595201
43605202 void group(Object3D csg, boolean grab)
43615203 {
5204
+ if (Globals.REPLACEONMAKE)
5205
+ Save();
5206
+ boolean keep = Globals.REPLACEONMAKE;
5207
+ Globals.REPLACEONMAKE = false;
43625208 if (//false) // why??
43635209 !group.selection.isEmpty())
43645210 {
....@@ -4472,8 +5318,34 @@
44725318 //node.add(csg);
44735319 //makeSomething(node);
44745320 makeSomething(csg);
5321
+ Globals.REPLACEONMAKE = keep;
44755322 }
44765323
5324
+ void Ungroup(Object3D g)
5325
+ {
5326
+ if (Globals.REPLACEONMAKE)
5327
+ Save();
5328
+ boolean keep = Globals.REPLACEONMAKE;
5329
+ Globals.REPLACEONMAKE = false;
5330
+ if (g instanceof HiddenObject)
5331
+ {
5332
+ HiddenObject h = (HiddenObject) g;
5333
+
5334
+ for (int i=0; i<h.ActualSize(); i++)
5335
+ {
5336
+ objEditor.makeSomething(h.get(i), false);
5337
+ }
5338
+ }
5339
+ else
5340
+ {
5341
+ for (int i=0; i<g.Size(); i++)
5342
+ {
5343
+ objEditor.makeSomething(g.get(i), false);
5344
+ }
5345
+ }
5346
+ Globals.REPLACEONMAKE = keep;
5347
+ }
5348
+
44775349 void ungroup()
44785350 {
44795351 /*
....@@ -4667,21 +5539,6 @@
46675539 }
46685540 */
46695541
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855542 /*
46865543 public void Callback(Object obj)
46875544 {
....@@ -4705,26 +5562,9 @@
47055562 }
47065563 */
47075564
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255565 String GetFile(String dialogName)
47265566 {
4727
- if (GrafreeD.standAlone)
5567
+ if (Grafreed.standAlone)
47285568 {
47295569 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305570 browser.show();
....@@ -4788,10 +5628,33 @@
47885628 cButton flashSelectionButton;
47895629 cButton editButton;
47905630 cButton uneditButton;
5631
+ JCheckBox allParamsButton;
47915632 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935633 cButton unselectButton;
47945634
5635
+ cButton restoreCameraButton;
5636
+
5637
+ cButton saveButton;
5638
+ cButton oneStepButton;
5639
+
5640
+ cButton groupButton;
5641
+ cButton ungroupButton;
5642
+ cButton compositeButton;
5643
+ cButton switchButton;
5644
+ cButton loopButton;
5645
+ cButton textureButton;
5646
+
5647
+ cButton gridButton;
5648
+ cButton boxButton;
5649
+ cButton sphereButton;
5650
+ cButton coneButton;
5651
+ cButton torusButton;
5652
+ cButton superButton;
5653
+ cButton kleinButton;
5654
+ cButton particlesButton;
5655
+ cButton overlayButton;
5656
+ cButton lightButton;
5657
+
47955658 cButton screenfitButton;
47965659 cButton screenfitpointButton;
47975660 cButton snapobjectButton;
....@@ -4803,14 +5666,6 @@
48035666
48045667 cButton setsupportButton;
48055668
4806
- cButton twoButton;
4807
- cButton sixButton;
4808
- cButton threeButton;
4809
- cButton sevenButton;
4810
- cButton fourButton; // full panel
4811
- cButton oneButton; // full XYZ
4812
- //cButton currentLayout;
4813
-
48145669 //
48155670 //Composite
48165671 Object3D // to do !!
....@@ -4820,9 +5675,11 @@
48205675 //JTree jTree;
48215676 private MenuItem lookAtItem;
48225677 private MenuItem lookFromItem;
4823
- private MenuItem switchItem;
5678
+ private MenuItem switchViewItem;
48245679 private MenuItem cutItem;
4825
- private MenuItem duplicateItem;
5680
+ private MenuItem undoItem;
5681
+ private MenuItem redoItem;
5682
+ private JMenuItem duplicateItem;
48265683 private MenuItem cloneItem;
48275684 private MenuItem cloneSupportItem;
48285685 private MenuItem overwriteGeoItem;
....@@ -4833,8 +5690,9 @@
48335690 private MenuItem resetsupportItem;
48345691 private MenuItem resetreferencesItem;
48355692 private MenuItem linkverticesItem;
5693
+ private MenuItem relinkverticesItem;
48365694 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5695
+ private MenuItem resetAllItem;
48385696 private MenuItem stepAllItem;
48395697 private MenuItem revertMeshItem;
48405698 private MenuItem poseMeshItem;
....@@ -4845,15 +5703,17 @@
48455703 private MenuItem mergeGeometriesItem;
48465704 private MenuItem copyItem;
48475705 private MenuItem pasteItem;
5706
+ private MenuItem pasteIntoItem;
48485707 private MenuItem pasteLinkItem;
48495708 private MenuItem pasteCloneItem;
48505709 private MenuItem pasteExpandItem;
4851
- private MenuItem clearItem;
5710
+ private MenuItem deleteItem;
48525711 private MenuItem clearAllItem;
48535712 private MenuItem genUVItem;
48545713 private MenuItem genNormalsMESHItem;
48555714 private MenuItem genNormalsCADItem;
48565715 private MenuItem genNormalsORGANItem;
5716
+ private MenuItem genNormalsMINEItem;
48575717 private MenuItem stripifyItem;
48585718 private MenuItem unstripifyItem;
48595719 private MenuItem trimItem;
....@@ -4882,6 +5742,10 @@
48825742 private MenuItem showleavesItem;
48835743 private MenuItem markleavesItem;
48845744 private MenuItem unmarkleavesItem;
5745
+ private MenuItem rewindleavesItem;
5746
+ private MenuItem unrewindleavesItem;
5747
+ private MenuItem randomleavesItem;
5748
+ private MenuItem unrandomleavesItem;
48855749
48865750 private MenuItem flipVItem;
48875751 private MenuItem unflipVItem;
....@@ -4893,14 +5757,17 @@
48935757 private MenuItem panoTexturesItem;
48945758
48955759 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5760
+ private MenuItem resetCentroidXZItem;
48975761 private MenuItem resetTransformItem;
5762
+ private MenuItem transformGeometryItem;
5763
+ private MenuItem transformChildrenItem;
5764
+ private MenuItem hideItem;
48985765 private MenuItem grabItem;
48995766 private MenuItem backItem;
49005767 private MenuItem frontItem;
49015768 private MenuItem cameraItem;
49025769 private MenuItem compositeItem;
4903
- private MenuItem randomItem;
5770
+ private MenuItem switchItem;
49045771 private MenuItem physicsItem;
49055772 private MenuItem frameselectorItem;
49065773 private MenuItem scriptNodeItem;
....@@ -4915,6 +5782,7 @@
49155782
49165783 private MenuItem resetParentItem;
49175784 private MenuItem repairParentItem;
5785
+ private MenuItem repairShadowItem;
49185786 private MenuItem sortbysizeItem;
49195787 private MenuItem sortbynameItem;
49205788
....@@ -4935,10 +5803,11 @@
49355803 private MenuItem coneItem;
49365804 private MenuItem torusItem;
49375805 private MenuItem superItem;
5806
+ private MenuItem kleinItem;
49385807 private MenuItem blobItem;
49395808 private MenuItem latheItem;
49405809 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5810
+ private MenuItem overlayItem;
49425811 private MenuItem meshItem;
49435812 // private MenuItem meshGroupItem;
49445813 private MenuItem springItem;
....@@ -4947,6 +5816,7 @@
49475816 private MenuItem csgItem;
49485817 private MenuItem templateItem;
49495818 private MenuItem textureItem;
5819
+ private MenuItem billboardItem;
49505820 private MenuItem shadowXItem;
49515821 private MenuItem shadowYItem;
49525822 private MenuItem shadowZItem;
....@@ -4959,11 +5829,6 @@
49595829 private MenuItem doubleItem;
49605830 private MenuItem tripleItem;
49615831
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675832 private MenuItem computeAOItem;
49685833 private MenuItem recompileItem;
49695834 private MenuItem editScriptItem;
....@@ -4973,4 +5838,8 @@
49735838 private MenuItem analyzeItem;
49745839 private MenuItem dumpItem;
49755840 //boolean freezemodel = false;
5841
+
5842
+ Menu cameraMenu;
5843
+ MenuItem editCameraItem;
5844
+ MenuItem restoreCameraItem;
49765845 }