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"));
....@@ -285,6 +429,13 @@
285429 genNormalsORGANItem.addActionListener(this);
286430 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287431 genNormalsCADItem.addActionListener(this);
432
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
433
+ genNormalsMESHItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437
+ genNormalsMINEItem.addActionListener(this);
438
+ }
288439 stripifyItem = menu.add(new MenuItem("Stripify"));
289440 stripifyItem.addActionListener(this);
290441 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +457,34 @@
306457 reduce34MeshItem.addActionListener(this);
307458 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308459 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311460 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312461 clipMeshItem.addActionListener(this);
462
+
463
+ if (Globals.ADVANCED)
464
+ {
465
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
466
+ smoothMeshItem.addActionListener(this);
467
+ }
313468
314469 oe.menuBar.add(menu = new Menu("Attributes"));
315470 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316471 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);
317476 menu.add("-");
318477 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319478 liveleavesItem.addActionListener(this);
320479 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321480 unliveleavesItem.addActionListener(this);
481
+ if (Globals.ADVANCED)
482
+ {
322483 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323484 supportleavesItem.addActionListener(this);
324485 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325486 unsupportleavesItem.addActionListener(this);
487
+ }
326488 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327489 hideleavesItem.addActionListener(this);
328490 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +493,14 @@
331493 markleavesItem.addActionListener(this);
332494 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333495 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);
334504 menu.add("-");
335505 flipVItem = menu.add(new MenuItem("Flip V"));
336506 flipVItem.addActionListener(this);
....@@ -366,35 +536,41 @@
366536 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367537 sortbynameItem.addActionListener(this);
368538 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.
369546 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370547 extractGeometriesItem.addActionListener(this);
371548 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372549 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
550
+ }
377551
378552 oe.menuBar.add(menu = new Menu("Insert"));
379553 buildCreateMenu(menu);
380554
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392555 oe.menuBar.add(menu = new Menu("Tools"));
393556 buildToolsMenu(menu);
394557 }
395558
559
+
396560 void SetupUI2(ObjEditor oe)
397561 {
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
+
398574 //new Exception().printStackTrace();
399575
400576 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +599,231 @@
423599 oe.radioPanel.add(dummyButton);
424600 oe.buttonGroup.add(dummyButton);
425601 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
602
+ cGridBag copyOptionsPanel = new cGridBag();
603
+
604
+ copyOptionsPanel.preferredHeight = 1;
429605
430
- 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");
431660 liveCB.addItemListener(this);
432661
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
451668 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
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);
458675
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
493
- trackCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
497
- screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
499676 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500677 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505678
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
512
- flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
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));
516687
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
519
- twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
688
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521689 fourButton.addActionListener(this);
522
- 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");
523699 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
- threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
527
- sevenButton.addActionListener(this);
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);
528706 //
529707
530
- 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");
531710 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- 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");
534714 closeButton.addActionListener(this);
535715 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536716 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538
-
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
541
- editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545717
546
- 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");
547803 uneditButton.addActionListener(this);
548804
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
805
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
806
+ allParamsButton.setToolTipText("Show all controle");
561807 allParamsButton.addActionListener(this);
562808
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
568815 unselectButton.addActionListener(this);
569816
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
+
570827 // oe.aConstraints.gridx += 1;
571828 // oe.aConstraints.weighty = 0;
572829 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +835,25 @@
578835 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579836 // gcButton.addActionListener(this);
580837
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
838
+ cGridBag jSPPanel = new cGridBag();
839
+
840
+ JScrollPane jSP;
592841 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
842
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594843 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
599
-
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
604
- colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
607
- materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
- textureCB.addItemListener(this);
611
-
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
614844
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
+
615857 //jList.addListSelectionListener(this);
616858 oe.jTree.addTreeSelectionListener(this);
617859 //jTree.setRootVisible(false);
....@@ -630,23 +872,160 @@
630872 dgr.addDragGestureListener(this);
631873 }catch(Exception e) {}
632874 */
633
- radio.layout = sevenButton;
875
+ radio.layout = sixButton; // sevenButton;
634876 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635877 }
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
+ }
6361004
6371005 void EditObject(Object3D obj)
6381006 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
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();
6471023 }
1024
+
6481025 void SetupViews(ObjEditor oe)
6491026 {
1027
+ theFrame = this;
1028
+
6501029 oe.SetupViews();
6511030
6521031 System.out.println("SetupViews");
....@@ -655,22 +1034,28 @@
6551034 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561035 }
6571036
658
- JCheckBox liveCB;
659
- JCheckBox supportCB;
660
- JCheckBox localCB;
661
- JCheckBox crowdCB;
662
- JCheckBox smoothCB;
663
- JCheckBox fastCB;
664
- JCheckBox slowCB;
665
- JCheckBox boxCB;
666
- JCheckBox trackCB;
667
- JCheckBox smoothfocusCB;
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;
6681050 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1051
+ cCheckBox speakerCameraCB;
1052
+ cCheckBox speakerFocusCB;
1053
+ cCheckBox debugCB;
1054
+
1055
+ cCheckBox oeilCB;
1056
+ cCheckBox shadowCB;
1057
+ cCheckBox autokeepCB;
1058
+ cCheckBox lookAtCB;
6741059
6751060 // static int COLOR = 1;
6761061 // static int MATERIAL = 2;
....@@ -678,9 +1063,9 @@
6781063
6791064 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801065
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1066
+ cCheckBox colorCB;
1067
+ cCheckBox materialCB;
1068
+ cCheckBox textureCB;
6841069
6851070 public void itemStateChanged(ItemEvent e)
6861071 {
....@@ -705,10 +1090,10 @@
7051090 dropAttributes |= Object3D.TEXTURE;
7061091 else
7071092 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1093
+ } else if(e.getSource() == liveCB)
7101094 {
7111095 cameraView.ToggleLive();
1096
+ refreshContents(false);
7121097 }
7131098 else if(e.getSource() == supportCB)
7141099 {
....@@ -744,6 +1129,10 @@
7441129 cameraView.repaint();
7451130 // refreshContents();
7461131 }
1132
+ else if(e.getSource() == zoomBoxCB)
1133
+ {
1134
+ cameraView.ToggleZoomBoxMode();
1135
+ }
7471136 else if(e.getSource() == smoothfocusCB)
7481137 {
7491138 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1158,18 @@
7691158 {
7701159 cameraView.ToggleOeil();
7711160 }
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
+ }
7721173 else if(e.getSource() == lookAtCB)
7731174 {
7741175 cameraView.ToggleLookAt();
....@@ -785,7 +1186,8 @@
7851186
7861187 /**/
7871188 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1189
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1190
+ TreePath path = objEditor.jTree.getSelectionPath();
7891191 if ((path == null) || (path.getPathCount() <= 1)) {
7901192 // We can't move the root node or an empty selection
7911193 return;
....@@ -848,8 +1250,6 @@
8481250 }
8491251 }
8501252
851
- String string = (String) object;
852
-
8531253 System.out.println("Transfer = " + object + "; drop : " + target);
8541254 // if( object instanceof java.io.File[])
8551255 // {
....@@ -857,7 +1257,11 @@
8571257 // objEditor.DropFile((java.io.File[]) object, true);
8581258 // return;
8591259 // }
860
- 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) == ':')
8611265 {
8621266 // file(s)
8631267 String[] names = string.split("\n");
....@@ -884,7 +1288,7 @@
8841288
8851289 flashIt = false;
8861290 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1291
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881292 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891293
8901294 if (group.selection.size() == 1)
....@@ -900,23 +1304,33 @@
9001304
9011305 assert target == objEditor.jTree;
9021306 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1307
+ Object3D destinationLeaf;
9031308 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1309
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051310 } catch (Exception e) {
9061311 System.out.println("destinationPath : " + destinationPath);
9071312 return;
9081313 }
9091314
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1315
+ for (int i=group.selection.size(); --i>=0;)
9111316 {
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
+// {
9121326 loadClipboard(true);
9131327 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1328
+ pasteInto(false, false);
1329
+// } else {
1330
+// loadClipboard(false);
1331
+// objEditor.jTree.setSelectionPath(destinationPath);
1332
+// pasteInto(false, false); // true); // ???
1333
+// }
9201334 }
9211335 public void dropActionChanged(DropTargetDragEvent dtde)
9221336 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1435,107 @@
10211435 {
10221436 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231437 //heightFieldItem.addActionListener(this);
1024
- gridItem = menu.add(new MenuItem("Grid"));
1025
- gridItem.addActionListener(this);
1026
- rectoidItem = menu.add(new MenuItem("Box"));
1027
- rectoidItem.addActionListener(this);
1028
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1029
- ellipsoidItem.addActionListener(this);
1030
- coneItem = menu.add(new MenuItem("Cone"));
1031
- coneItem.addActionListener(this);
1032
- torusItem = menu.add(new MenuItem("Torus"));
1033
- torusItem.addActionListener(this);
1034
- superItem = menu.add(new MenuItem("Superellipsoid"));
1035
- superItem.addActionListener(this);
1036
- particleItem = menu.add(new MenuItem("Particle system"));
1037
- particleItem.addActionListener(this);
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
+ {
10381464 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391465 ragdollItem.addActionListener(this);
10401466 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411467 ragdoll2Item.addActionListener(this);
1468
+ }
10421469 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1470
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441471 meshItem.addActionListener(this);
10451472 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461473 // meshGroupItem.addActionListener(this);
1474
+ if (Globals.ADVANCED)
1475
+ {
10471476 springItem = menu.add(new MenuItem("Spring"));
10481477 springItem.addActionListener(this);
10491478 flagItem = menu.add(new MenuItem("Flag"));
10501479 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551480 blobItem = menu.add(new MenuItem("Blob"));
10561481 blobItem.addActionListener(this);
10571482 latheItem = menu.add(new MenuItem("Lathe"));
10581483 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- 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);
10611491 menu.add("-");
10621492 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631493 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1494
+// loopItem = menu.add(new MenuItem("Loop"));
1495
+// loopItem.addActionListener(this);
10661496 doubleItem = menu.add(new MenuItem("Fork"));
10671497 doubleItem.addActionListener(this);
1498
+ if (Globals.ADVANCED)
1499
+ {
10681500 tripleItem = menu.add(new MenuItem("Trident"));
10691501 tripleItem.addActionListener(this);
1502
+ }
10701503 }
10711504
10721505 void buildToolsMenu(Menu menu)
10731506 {
10741507 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751508 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1509
+ animationItem.setState(Globals.ANIMATION);
1510
+
1511
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1512
+ archiveItem.addActionListener(this);
10771513
10781514 menu.add("-");
10791515 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801516 parseverticesItem.addActionListener(this);
10811517 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821518 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1519
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841520 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871521 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881522 reduceMorphItem.addActionListener(this);
10891523 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901524 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941525 menu.add("-");
1095
-
10961526 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971527 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("-");
10981536 menu.add(analyzeItem = new MenuItem("Analyze"));
10991537 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1538
+ menu.add(dumpItem = new MenuItem("Print"));
11011539 dumpItem.addActionListener(this);
11021540 // menu.add(pathItem = new MenuItem("From-to path"));
11031541 // pathItem.addActionListener(this);
....@@ -1106,6 +1544,8 @@
11061544 resetParentItem.addActionListener(this);
11071545 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081546 repairParentItem.addActionListener(this);
1547
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1548
+ repairShadowItem.addActionListener(this);
11091549 menu.add(invariantsItem = new MenuItem("Invariants"));
11101550 invariantsItem.addActionListener(this);
11111551 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1553,7 @@
11131553 menu.add("-");
11141554 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151555 editScriptItem.addActionListener(this);
1556
+ }
11161557 }
11171558
11181559 void ScreenFit()
....@@ -1235,9 +1676,34 @@
12351676 shadow.material = new cMaterial(obj.material);
12361677 shadow.material.diffuse = 0.0001f;
12371678 shadow.material.specular = 0.0001f;
1679
+ //shadow.projectedVertices[1].x = 300;
12381680
12391681 makeSomething(shadow);
12401682 }
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
+ }
12411707
12421708 /**
12431709 * applyExample
....@@ -1441,9 +1907,9 @@
14411907
14421908 void Overwrite(int mask)
14431909 {
1444
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1910
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451911 {
1446
- Object3D content = GrafreeD.clipboard.get(0);
1912
+ Object3D content = Grafreed.clipboard.get(0);
14471913
14481914 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491915 content = ((cGroup)content).get(0);
....@@ -1466,6 +1932,7 @@
14661932 //
14671933 public void actionPerformed(ActionEvent event) // , Object arg)
14681934 {
1935
+ Object source = event.getSource();
14691936 /*
14701937 if (event.getSource() == nameField)
14711938 {
....@@ -1477,11 +1944,11 @@
14771944 }
14781945 else
14791946 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1947
+ if (source == lookAtItem || source == lookFromItem)
14811948 {
14821949 ScreenFit();
14831950 } else
1484
- if (event.getSource() == switchItem)
1951
+ if (source == switchViewItem)
14851952 {
14861953 cVector v1 = new cVector();
14871954 cVector v2 = new cVector();
....@@ -1490,11 +1957,11 @@
14901957 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911958 objEditor.cameraView.repaint();
14921959 } else
1493
- if (event.getSource() == rectoidItem)
1960
+ if (source == rectoidItem || source == boxButton)
14941961 {
14951962 makeSomething(new Box());
14961963 } else
1497
- if (event.getSource() == particleItem)
1964
+ if (source == particleItem || source == particlesButton)
14981965 {
14991966 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001967 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1982,9 @@
15151982 applyExample(particleGeom, "SMOKE");
15161983 makeSomething(particleGeom);
15171984 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1985
+ if (source == ragdollItem || source == ragdoll2Item)
15191986 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1987
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211988
15221989 ragdoll.toParent = LA.newMatrix();
15231990 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +2002,7 @@
15352002 } else
15362003 /*
15372004 */
1538
- if (event.getSource() == heightFieldItem)
2005
+ if (source == heightFieldItem)
15392006 {
15402007 Object3D obj = new Object3D();
15412008
....@@ -1573,27 +2040,31 @@
15732040
15742041 makeSomething(obj);
15752042 } else
1576
- if (event.getSource() == gridItem)
2043
+ if (source == gridItem || source == gridButton)
15772044 {
15782045 makeSomething(new Grid());
15792046 } else
1580
- if (event.getSource() == ellipsoidItem)
2047
+ if (source == ellipsoidItem || source == sphereButton)
15812048 {
15822049 makeSomething(new Sphere());
15832050 } else
1584
- if (event.getSource() == coneItem)
2051
+ if (source == coneItem || source == coneButton)
15852052 {
15862053 makeSomething(new Cone());
15872054 } else
1588
- if (event.getSource() == torusItem)
2055
+ if (source == torusItem || source == torusButton)
15892056 {
15902057 makeSomething(new Torus());
15912058 } else
1592
- if (event.getSource() == superItem)
2059
+ if (source == superItem || source == superButton)
15932060 {
15942061 makeSomething(new Superellipsoid());
15952062 } else
1596
- if (event.getSource() == blobItem)
2063
+ if (source == kleinItem || source == kleinButton)
2064
+ {
2065
+ makeSomething(new Klein());
2066
+ } else
2067
+ if (source == blobItem)
15972068 {
15982069 Blob blob = new Blob();
15992070 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2072,15 @@
16012072 //blob.retile();
16022073 makeSomething(blob);
16032074 } else
1604
- if (event.getSource() == latheItem)
2075
+ if (source == latheItem)
16052076 {
16062077 makeSomething(new Lathe());
16072078 } else
1608
- if (event.getSource() == bezierItem)
2079
+ if (source == bezierItem)
16092080 {
16102081 makeSomething(new BezierSurface());
16112082 } else
1612
- if (event.getSource() == checkerItem)
2083
+ if (source == overlayItem || source == overlayButton)
16132084 {
16142085 /*
16152086 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2095,7 @@
16242095 */
16252096 makeSomething(new Checker());
16262097 } else
1627
- if (event.getSource() == meshItem)
2098
+ if (source == meshItem)
16282099 {
16292100 Object3D itemtomake = new Object3D();
16302101 Object3D child;
....@@ -1645,35 +2116,35 @@
16452116 makeSomething(child);
16462117 }
16472118 } else
1648
- if (event.getSource() == springItem)
2119
+ if (source == springItem)
16492120 {
16502121 cSpring s = new cSpring();
16512122 s.setup();
16522123 makeSomething(s);
16532124 } else
1654
- if (event.getSource() == flagItem)
2125
+ if (source == flagItem)
16552126 {
16562127 cSpring s = new cFlag();
16572128 s.setup();
16582129 makeSomething(s);
16592130 } else
1660
- if (event.getSource() == lightItem)
2131
+ if (source == lightItem || source == lightButton)
16612132 {
16622133 makeSomething(new Light());
16632134 } else
1664
- if (event.getSource() == csgItem)
2135
+ if (source == csgItem)
16652136 {
16662137 group(new CSG());
16672138 } else
1668
- if (event.getSource() == templateItem)
2139
+ if (source == templateItem)
16692140 {
16702141 group(new cTemplate());
16712142 } else
1672
- if (event.getSource() == attributeItem)
2143
+ if (source == attributeItem)
16732144 {
16742145 makeSomething(new Attribute());
16752146 } else
1676
- if (event.getSource() == pointflowItem)
2147
+ if (source == pointflowItem)
16772148 {
16782149 makeSomething(new PointFlow());
16792150 } else
....@@ -1685,7 +2156,7 @@
16852156 } else
16862157 */
16872158
1688
- if (event.getSource() == superLoopItem)
2159
+ if (source == superLoopItem)
16892160 {
16902161 Composite g = new cGroup();
16912162 for (int i=0; i<15; i++)
....@@ -1707,30 +2178,30 @@
17072178
17082179 group(g);
17092180 } else
1710
- if (event.getSource() == loopItem)
2181
+ if (source == loopItem || source == loopButton)
17112182 {
17122183 Composite csg = new GroupLeaf();
17132184 csg.count = 5;
17142185 group(csg);
1715
- Composite child = new cGroup();
2186
+ Composite child = new cGroup("Branch");
17162187 csg.addChild(child);
17172188 child.addChild(csg);
17182189 } else
1719
- if (event.getSource() == doubleItem)
2190
+ if (source == doubleItem)
17202191 {
1721
- Composite csg = new GroupLeaf();
2192
+ Composite csg = new GroupLeaf("Fork");
17222193 csg.count = 5;
17232194 group(csg);
1724
- Composite child = new cGroup();
2195
+ Composite child = new cGroup("Branch A");
17252196 csg.addChild(child);
17262197 child.addChild(csg);
1727
- child = new cGroup();
2198
+ child = new cGroup("Branch B");
17282199 csg.addChild(child);
17292200 child.addChild(csg);
17302201 } else
1731
- if (event.getSource() == tripleItem)
2202
+ if (source == tripleItem)
17322203 {
1733
- Composite csg = new GroupLeaf();
2204
+ Composite csg = new GroupLeaf("Trident");
17342205 csg.count = 4;
17352206 group(csg);
17362207 Composite child = new cGroup();
....@@ -1743,73 +2214,98 @@
17432214 csg.addChild(child);
17442215 child.addChild(csg);
17452216 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2217
+ if (source == computeAOItem)
17482218 {
1749
- ImportGFD();
2219
+ Globals.drawMode = CameraPane.OCCLUSION;
2220
+ Globals.theRenderer.repaint();
17502221 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
2222
+ if (source == recompileItem)
17692223 {
17702224 Recompile();
17712225 refreshContents();
17722226 } else
1773
- if (event.getSource() == editScriptItem)
2227
+ if (source == editScriptItem)
17742228 {
17752229 OpenDialog();
17762230 refreshContents();
17772231 } else
1778
- if (event.getSource() == invariantsItem)
2232
+ if (source == invariantsItem)
17792233 {
17802234 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
2235
+ Grafreed.grafreeD.universe.invariants();
17822236 } else
1783
- if (event.getSource() == memoryItem)
2237
+ if (source == memoryItem)
17842238 {
17852239 //System.out.println("Invariants:");
17862240 PrintMemory();
17872241 } else
1788
- if (event.getSource() == pathItem)
2242
+ if (source == pathItem)
17892243 {
17902244 PrintPath();
17912245 } else
1792
- if (event.getSource() == analyzeItem)
2246
+ if (source == analyzeItem)
17932247 {
17942248 AnalyzeObject();
17952249 } else
1796
- if (event.getSource() == dumpItem)
2250
+ if (source == dumpItem)
17972251 {
17982252 DumpObject();
17992253 } else
1800
- if (event.getSource() == screenfitButton)
2254
+ if (source == minButton)
18012255 {
1802
- //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
+ {
18032301 ScreenFit();
18042302 } else
1805
- if (event.getSource() == screenfitpointButton)
2303
+ if (source == screenfitpointButton)
18062304 {
1807
- //Reload(lastConverter, lastFilename, true);
18082305 ScreenFitPoint();
18092306 } else
1810
- if (event.getSource() == snapobjectButton)
2307
+ if (source == snapobjectButton)
18112308 {
1812
- //Reload(lastConverter, lastFilename, true);
18132309 SnapObject();
18142310 } else
18152311 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2314,13 @@
18182314 // Recompile();
18192315 // refreshContents();
18202316 // } else
1821
- if (event.getSource() == gcButton)
2317
+ if (source == gcButton)
18222318 {
18232319 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242320 System.gc();
18252321 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262322 } else
1827
- if (event.getSource() == editLeafItem)
2323
+ if (source == editLeafItem)
18282324 {
18292325 Object3D obj;
18302326 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +2334,74 @@
18382334 }
18392335 refreshContents(true);
18402336 } else
1841
- if (event.getSource() == openWindowItem)
2337
+ if (source == openWindowItem)
18422338 {
18432339 EditSelection(true);
18442340 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2341
+ if (source == cutItem || source == clearButton)
18462342 {
18472343 loadClipboard(true);
18482344 } else
1849
- if (event.getSource() == duplicateItem)
2345
+ if (source == undoItem)
18502346 {
1851
- 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;
18522356 loadClipboard(false);
18532357 paste(false);
1854
- GrafreeD.clipboard = keep;
2358
+ Grafreed.clipboard = keep;
18552359 } else
1856
- if (event.getSource() == cloneItem)
2360
+ if (source == cloneItem)
18572361 {
18582362 CloneSelection(false);
18592363 } else
1860
- if (event.getSource() == cloneSupportItem)
2364
+ if (source == cloneSupportItem)
18612365 {
18622366 CloneSelection(true);
18632367 } else
1864
- if (event.getSource() == copyItem)
2368
+ if (source == copyItem)
18652369 {
18662370 loadClipboard(false);
18672371 } else
1868
- if (event.getSource() == pasteItem)
2372
+ if (source == pasteItem)
18692373 {
18702374 paste(false);
18712375 } else
1872
- if (event.getSource() == pasteLinkItem)
2376
+ if (source == pasteIntoItem)
18732377 {
1874
- pasteInto(false);
2378
+ pasteInto(true, false);
18752379 } else
1876
- if (event.getSource() == pasteCloneItem)
2380
+ if (source == pasteLinkItem)
18772381 {
1878
- pasteInto(true);
2382
+ pasteInto(false, false);
18792383 } else
1880
- if (event.getSource() == pasteExpandItem)
2384
+ if (source == pasteCloneItem)
2385
+ {
2386
+ pasteInto(true, true);
2387
+ } else
2388
+ if (source == pasteExpandItem)
18812389 {
18822390 paste(true);
18832391 } else
1884
- if (event.getSource() == synchronizeItem)
2392
+ if (source == synchronizeItem)
18852393 {
18862394 Overwrite(Object3D.TRANSFORM);
18872395 } else
1888
- if (event.getSource() == overwriteNameItem)
2396
+ if (source == overwriteNameItem)
18892397 {
18902398 Overwrite(Object3D.NAME);
18912399 } else
1892
- if (event.getSource() == overwriteUVItem)
2400
+ if (source == overwriteUVItem)
18932401 {
18942402 Overwrite(Object3D.UV);
18952403 } else
1896
- if (event.getSource() == overwriteMatItem)
2404
+ if (source == overwriteMatItem)
18972405 {
18982406 /* july 2015
18992407 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2421,7 @@
19132421
19142422 Overwrite(dropAttributes);
19152423 }
1916
- if (event.getSource() == overwriteGeoItem)
2424
+ if (source == overwriteGeoItem)
19172425 {
19182426 Overwrite(Object3D.GEOMETRY);
19192427 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2438,7 @@
19302438 // refreshContents();
19312439 // }
19322440 } else
1933
- if (event.getSource() == generateMeshItem)
2441
+ if (source == generateMeshItem)
19342442 {
19352443 //if (group.selection.size() == 1)
19362444 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2449,7 @@
19412449 ResetModel();
19422450 refreshContents();
19432451 } else
1944
- if (event.getSource() == extractGeometriesItem)
2452
+ if (source == extractGeometriesItem)
19452453 {
19462454 boolean one = false;
19472455
....@@ -1968,7 +2476,7 @@
19682476 ResetModel();
19692477 refreshContents();
19702478 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2479
+ if (source == cloneGeometriesItem)
19722480 {
19732481 boolean one = false;
19742482
....@@ -1994,32 +2502,37 @@
19942502 ResetModel();
19952503 refreshContents();
19962504 } else
1997
- if (event.getSource() == shareGeometriesItem)
2505
+ if (source == shareGeometriesItem)
19982506 {
19992507 boolean one = false;
20002508
20012509 if (group.selection.size() == 1)
20022510 one = true;
20032511
2512
+ Object3D merge = null;
2513
+
20042514 Object3D content = new cGroup();
20052515
20062516 for (int i=0; i<group.selection.size(); i++)
20072517 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2518
+ merge = new Merge(group.selection.get(i));
20092519
20102520 if (one)
2011
- makeSomething(sel, false);
2521
+ makeSomething(merge, false);
20122522 else
2013
- content.addChild(sel);
2523
+ content.addChild(merge);
20142524 }
20152525
20162526 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2527
+ makeSomething(content, true);
2528
+ else
2529
+ {
2530
+ ResetModel();
2531
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2532
+ refreshContents();
2533
+ }
20212534 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2535
+ if (source == mergeGeometriesItem)
20232536 {
20242537 boolean one = false;
20252538
....@@ -2049,7 +2562,7 @@
20492562 ResetModel();
20502563 refreshContents();
20512564 } else
2052
- if (event.getSource() == linkverticesItem)
2565
+ if (source == linkverticesItem)
20532566 {
20542567 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552568 // {
....@@ -2062,39 +2575,48 @@
20622575 // group.selection.get(0).setMasterThis(content); // should be identity
20632576 // refreshContents();
20642577 // }
2065
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2578
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20662579 {
2067
- Object3D content = GrafreeD.clipboard.get(0);
2580
+ Object3D content = Grafreed.clipboard.get(0);
20682581
20692582 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702583 content = ((cGroup)content).get(0);
20712584
2072
- 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));
20732586 for (int i=0; i<group.selection.size(); i++)
20742587 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2588
+ boolean random = CameraPane.SWITCH;
2589
+ CameraPane.SWITCH = false; // parse all random nodes
20772590 group.selection.get(i).linkVerticesThis(content);
20782591 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2592
+ CameraPane.SWITCH = random;
20802593 }
2081
- 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));
20822595 refreshContents();
20832596 }
20842597 } else
2085
- if (event.getSource() == resetsupportItem)
2598
+ if (source == resetsupportItem)
20862599 {
20872600 for (int i=0; i<group.selection.size(); i++)
20882601 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2602
+ boolean random = CameraPane.SWITCH;
2603
+ CameraPane.SWITCH = false; // parse all random nodes
20912604 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2605
+ CameraPane.SWITCH = random;
20932606 }
20942607
20952608 refreshContents();
20962609 } else
2097
- 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)
20982620 {
20992621 for (int i=0; i<group.selection.size(); i++)
21002622 {
....@@ -2103,11 +2625,11 @@
21032625
21042626 refreshContents();
21052627 } else
2106
- if (event.getSource() == setMasterItem)
2628
+ if (source == setMasterItem)
21072629 {
2108
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2630
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21092631 {
2110
- Object3D content = GrafreeD.clipboard.get(0);
2632
+ Object3D content = Grafreed.clipboard.get(0);
21112633
21122634 if (content instanceof cGroup && ((cGroup)content).transientlink )
21132635 content = ((cGroup)content).get(0);
....@@ -2116,13 +2638,13 @@
21162638 refreshContents();
21172639 }
21182640 } else
2119
- if (event.getSource() == poseMeshItem)
2641
+ if (source == poseMeshItem)
21202642 {
21212643 if (group.selection.size() == 1)
21222644 {
2123
- if (GrafreeD.clipboard.size() == 1)
2645
+ if (Grafreed.clipboard.size() == 1)
21242646 {
2125
- Object3D content = GrafreeD.clipboard.get(0);
2647
+ Object3D content = Grafreed.clipboard.get(0);
21262648
21272649 if (content instanceof cGroup && ((cGroup)content).transientlink )
21282650 content = ((cGroup)content).get(0);
....@@ -2135,19 +2657,19 @@
21352657 }
21362658
21372659 } else
2138
- if (event.getSource() == revertMeshItem)
2660
+ if (source == revertMeshItem)
21392661 {
21402662 RevertMeshes();
21412663 } else
2142
- if (event.getSource() == resetMeshItem)
2664
+ if (source == resetAllItem)
21432665 {
21442666 ResetAll();
21452667 } else
2146
- if (event.getSource() == stepAllItem)
2668
+ if (source == stepAllItem)
21472669 {
21482670 StepAll();
21492671 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2672
+ if (source == deleteItem) // || event.getSource() == clearButton)
21512673 {
21522674 //int indices[] = jList.getSelectedIndices();
21532675 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2677,46 @@
21552677
21562678 ClearSelection(false);
21572679 } else
2158
- if (event.getSource() == clearAllItem)
2680
+ if (source == clearAllItem)
21592681 {
21602682 ClearSelection(true);
21612683 } else
2162
- if (event.getSource() == grabItem)
2684
+ if (source == grabItem || source == groupButton)
21632685 {
2164
- group(new cGroup(), true);
2686
+ group(new cGroup(), false); // true);
21652687 } else
2166
- if (event.getSource() == frontItem)
2688
+ if (source == hideItem)
2689
+ {
2690
+ group(new HiddenObject());
2691
+ } else
2692
+ if (source == frontItem)
21672693 {
21682694 front();
21692695 } else
2170
- if (event.getSource() == backItem)
2696
+ if (source == backItem)
21712697 {
21722698 back();
21732699 } else
2174
- if (event.getSource() == cameraItem)
2700
+ if (source == cameraItem)
21752701 {
21762702 makeSomething(new Camera());
21772703 } else
2178
- if (event.getSource() == compositeItem)
2704
+ if (source == compositeItem || source == compositeButton)
21792705 {
21802706 group(new Composite());
21812707 } else
2182
- if (event.getSource() == randomItem)
2708
+ if (source == switchItem || source == switchButton)
21832709 {
21842710 RandomNode random = new RandomNode();
21852711 group(random);
21862712 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2713
+ random.name = random.get(0).name + "Switch";
21882714 } else
2189
- if (event.getSource() == physicsItem)
2715
+ if (source == physicsItem)
21902716 {
21912717 group(new PhysicsNode());
21922718 } else
2193
- if (event.getSource() == frameselectorItem)
2719
+ if (source == frameselectorItem)
21942720 {
21952721 for (int i=0; i<group.selection.size(); i++)
21962722 {
....@@ -2202,7 +2728,7 @@
22022728 ResetModel();
22032729 refreshContents();
22042730 } else
2205
- if (event.getSource() == switchGeoItem)
2731
+ if (source == switchGeoItem)
22062732 {
22072733 for (int i=0; i<group.selection.size(); i++)
22082734 {
....@@ -2214,7 +2740,7 @@
22142740 ResetModel();
22152741 refreshContents();
22162742 } else
2217
- if (event.getSource() == switchTransfoItem)
2743
+ if (source == switchTransfoItem)
22182744 {
22192745 for (int i=0; i<group.selection.size(); i++)
22202746 {
....@@ -2226,7 +2752,7 @@
22262752 ResetModel();
22272753 refreshContents();
22282754 } else
2229
- if (event.getSource() == morphItem)
2755
+ if (source == morphItem)
22302756 {
22312757 for (int i=0; i<group.selection.size(); i++)
22322758 {
....@@ -2238,7 +2764,7 @@
22382764 ResetModel();
22392765 refreshContents();
22402766 } else
2241
- if (event.getSource() == scriptNodeItem)
2767
+ if (source == scriptNodeItem)
22422768 {
22432769 boolean atleastone = false;
22442770
....@@ -2277,195 +2803,252 @@
22772803 }
22782804 }
22792805 } else
2280
- if (event.getSource() == linkerItem)
2806
+ if (source == linkerItem)
22812807 {
22822808 group(new cLinker());
22832809 } else
2284
- if (event.getSource() == textureItem)
2810
+ if (source == textureItem || source == textureButton)
22852811 {
22862812 group(new TextureNode());
22872813 } else
2288
- if (event.getSource() == shadowXItem)
2814
+ if (source == billboardItem)
2815
+ {
2816
+ group(new BillboardNode());
2817
+ } else
2818
+ if (source == shadowXItem)
22892819 {
22902820 CastShadow(0);
22912821 } else
2292
- if (event.getSource() == shadowYItem)
2822
+ if (source == shadowYItem)
22932823 {
22942824 CastShadow(1);
22952825 } else
2296
- if (event.getSource() == shadowZItem)
2826
+ if (source == shadowZItem)
22972827 {
22982828 CastShadow(2);
22992829 } else
2300
- if (event.getSource() == ungroupItem)
2830
+ if (source == ungroupItem || source == ungroupButton)
23012831 {
2302
- 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
+ }
23032854 } else
2304
- if (event.getSource() == genUVItem)
2855
+ if (source == genUVItem)
23052856 {
23062857 GenUV();
23072858 } else
2308
- if (event.getSource() == genNormalsCADItem)
2859
+ if (source == genNormalsCADItem)
23092860 {
23102861 GenNormals(true);
23112862 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2863
+ if (source == genNormalsMESHItem)
2864
+ {
2865
+ GenNormalsMESH();
2866
+ } else
2867
+ if (source == genNormalsORGANItem)
23132868 {
23142869 GenNormals(false);
23152870 } else
2316
- if (event.getSource() == stripifyItem)
2871
+ if (source == genNormalsMINEItem)
2872
+ {
2873
+ GenNormalsMINE();
2874
+ } else
2875
+ if (source == stripifyItem)
23172876 {
23182877 Stripify();
23192878 } else
2320
- if (event.getSource() == unstripifyItem)
2879
+ if (source == unstripifyItem)
23212880 {
23222881 Unstripify();
23232882 } else
2324
- if (event.getSource() == trimItem)
2883
+ if (source == trimItem)
23252884 {
23262885 Trim();
23272886 } else
2328
- if (event.getSource() == untrimItem)
2887
+ if (source == untrimItem)
23292888 {
23302889 Untrim();
23312890 } else
2332
- if (event.getSource() == clearColorsItem)
2891
+ if (source == clearColorsItem)
23332892 {
23342893 ClearColors();
23352894 } else
2336
- if (event.getSource() == clearMaterialsItem)
2895
+ if (source == clearMaterialsItem)
23372896 {
23382897 ClearMaterials();
23392898 } else
2340
- if (event.getSource() == liveleavesItem)
2899
+ if (source == liveleavesItem)
23412900 {
23422901 LiveLeaves(true);
23432902 } else
2344
- if (event.getSource() == unliveleavesItem)
2903
+ if (source == unliveleavesItem)
23452904 {
23462905 LiveLeaves(false);
23472906 } else
2348
- if (event.getSource() == supportleavesItem)
2907
+ if (source == supportleavesItem)
23492908 {
23502909 SupportLeaves(true);
23512910 } else
2352
- if (event.getSource() == unsupportleavesItem)
2911
+ if (source == unsupportleavesItem)
23532912 {
23542913 SupportLeaves(false);
23552914 } else
2356
- if (event.getSource() == hideleavesItem)
2915
+ if (source == hideleavesItem)
23572916 {
23582917 HideLeaves(true);
23592918 } else
2360
- if (event.getSource() == showleavesItem)
2919
+ if (source == showleavesItem)
23612920 {
23622921 HideLeaves(false);
23632922 } else
2364
- if (event.getSource() == markleavesItem)
2923
+ if (source == markleavesItem)
23652924 {
23662925 MarkLeaves(true);
23672926 } else
2368
- if (event.getSource() == unmarkleavesItem)
2927
+ if (source == unmarkleavesItem)
23692928 {
23702929 MarkLeaves(false);
23712930 } else
2372
- 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)
23732948 {
23742949 FlipV(true);
23752950 } else
2376
- if (event.getSource() == unflipVItem)
2951
+ if (source == unflipVItem)
23772952 {
23782953 FlipV(false);
23792954 } else
2380
- if (event.getSource() == lowTexturesItem)
2955
+ if (source == lowTexturesItem)
23812956 {
23822957 SetTexRes(0);
23832958 } else
2384
- if (event.getSource() == normalTexturesItem)
2959
+ if (source == normalTexturesItem)
23852960 {
23862961 SetTexRes(1);
23872962 } else
2388
- if (event.getSource() == highTexturesItem)
2963
+ if (source == highTexturesItem)
23892964 {
23902965 SetTexRes(2);
23912966 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2967
+ if (source == veryhighTexturesItem)
23932968 {
23942969 SetTexRes(3);
23952970 } else
2396
- if (event.getSource() == maxTexturesItem)
2971
+ if (source == maxTexturesItem)
23972972 {
23982973 SetTexRes(4);
23992974 } else
2400
- if (event.getSource() == panoTexturesItem)
2975
+ if (source == panoTexturesItem)
24012976 {
24022977 SetTexRes(5);
24032978 } else
2404
- if (event.getSource() == reverseNormalsItem)
2979
+ if (source == reverseNormalsItem)
24052980 {
24062981 ReverseNormals();
24072982 } else
2408
- if (event.getSource() == parseverticesItem)
2983
+ if (source == parseverticesItem)
24092984 {
24102985 ParseVertices();
24112986 } else
2412
- if (event.getSource() == textureFieldItem)
2987
+ if (source == textureFieldItem)
24132988 {
24142989 TextureVertices();
24152990 } else
2416
- if (event.getSource() == alignItem)
2991
+ if (source == alignItem)
24172992 {
24182993 Align();
24192994 } else
2420
- if (event.getSource() == mirrorItem)
2995
+ if (source == mirrorItem)
24212996 {
24222997 MirrorPoses();
24232998 } else
2424
- if (event.getSource() == reduceMorphItem)
2999
+ if (source == reduceMorphItem)
24253000 {
24263001 MeshReduction(false);
24273002 } else
2428
- if (event.getSource() == reduce34MorphItem)
3003
+ if (source == reduce34MorphItem)
24293004 {
24303005 MeshReduction(true);
24313006 } else
2432
- if (event.getSource() == reverseTrianglesItem)
3007
+ if (source == reverseTrianglesItem)
24333008 {
24343009 ReverseTriangles();
24353010 } else
2436
- if (event.getSource() == reduceMeshItem)
3011
+ if (source == reduceMeshItem)
24373012 {
24383013 ReduceMesh(false);
24393014 } else
2440
- if (event.getSource() == reduce34MeshItem)
3015
+ if (source == reduce34MeshItem)
24413016 {
24423017 ReduceMesh(true);
24433018 } else
2444
- if (event.getSource() == increaseMeshItem)
3019
+ if (source == increaseMeshItem)
24453020 {
24463021 IncreaseMesh();
24473022 } else
2448
- if (event.getSource() == clipMeshItem)
3023
+ if (source == clipMeshItem)
24493024 {
24503025 ClipMesh();
24513026 } else
2452
- if (event.getSource() == smoothMeshItem)
3027
+ if (source == smoothMeshItem)
24533028 {
24543029 SmoothMesh();
24553030 } else
2456
- if (event.getSource() == transformgeometryItem)
3031
+ if (source == transformGeometryItem)
24573032 {
24583033 TransformGeometry();
24593034 } else
2460
- if (event.getSource() == resetTransformItem)
3035
+ if (source == transformChildrenItem)
3036
+ {
3037
+ TransformChildren();
3038
+ } else
3039
+ if (source == resetTransformItem)
24613040 {
24623041 ResetTransform();
24633042 } else
2464
- if (event.getSource() == resetCentroidItem)
3043
+ if (source == resetCentroidItem)
24653044 {
2466
- ResetCentroid();
3045
+ ResetCentroid(true);
24673046 } else
2468
- if (event.getSource() == resetParentItem)
3047
+ if (source == resetCentroidXZItem)
3048
+ {
3049
+ ResetCentroid(false);
3050
+ } else
3051
+ if (source == resetParentItem)
24693052 {
24703053 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24713054 {
....@@ -2475,7 +3058,7 @@
24753058
24763059 refreshContents();
24773060 } else
2478
- if (event.getSource() == repairParentItem)
3061
+ if (source == repairParentItem)
24793062 {
24803063 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24813064 {
....@@ -2489,7 +3072,21 @@
24893072
24903073 refreshContents();
24913074 } else
2492
- 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)
24933090 {
24943091 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24953092 {
....@@ -2501,7 +3098,7 @@
25013098 ResetModel();
25023099 refreshContents();
25033100 } else
2504
- if (event.getSource() == sortbynameItem)
3101
+ if (source == sortbynameItem)
25053102 {
25063103 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25073104 {
....@@ -2513,7 +3110,7 @@
25133110 ResetModel();
25143111 refreshContents();
25153112 } else
2516
- if (event.getSource() == attachPigmentItem)
3113
+ if (source == attachPigmentItem)
25173114 {
25183115 String texture = GetFile("Attach pigment");
25193116 Object3D obj;
....@@ -2525,7 +3122,7 @@
25253122
25263123 refreshContents();
25273124 } else
2528
- if (event.getSource() == detachPigmentItem)
3125
+ if (source == detachPigmentItem)
25293126 {
25303127 Object3D obj;
25313128 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +3133,7 @@
25363133
25373134 refreshContents();
25383135 } else
2539
- if (event.getSource() == attachBumpItem)
3136
+ if (source == attachBumpItem)
25403137 {
25413138 String texture = GetFile("Attach bump");
25423139 Object3D obj;
....@@ -2548,7 +3145,7 @@
25483145
25493146 refreshContents();
25503147 } else
2551
- if (event.getSource() == detachBumpItem)
3148
+ if (source == detachBumpItem)
25523149 {
25533150 Object3D obj;
25543151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +3156,7 @@
25593156
25603157 refreshContents();
25613158 } else
2562
- if (event.getSource() == pigmentBumpItem)
3159
+ if (source == pigmentBumpItem)
25633160 {
25643161 Object3D obj;
25653162 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +3167,237 @@
25703167
25713168 refreshContents();
25723169 } else
2573
- if (event.getSource() == flashSelectionButton)
3170
+ if (source == flashSelectionButton)
25743171 {
25753172 CameraPane.flash = true;
25763173 refreshContents();
25773174 } else
2578
- if (event.getSource() == oneButton)
3175
+ if (source == oneButton)
25793176 {
25803177 } else
2581
- if (event.getSource() == twoButton)
3178
+ if (source == twoButton)
25823179 {
25833180 radio.layout = twoButton;
3181
+
3182
+ if (CameraPane.FULLSCREEN)
3183
+ fullscreenLayout = radio.layout;
3184
+
25843185 // bug
25853186 //gridPanel.setDividerLocation(1.0);
25863187 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- 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
+
26113235 } else
2612
- if (event.getSource() == threeButton)
3236
+ if (source == threeButton)
26133237 {
26143238 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- 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();
26393276 } else
2640
- if (event.getSource() == fourButton)
3277
+ if (source == fourButton)
26413278 {
26423279 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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();
26673316 } else
2668
- if (event.getSource() == sixButton)
3317
+ if (source == sixButton)
26693318 {
26703319 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- 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();
26953357 } else
2696
- if (event.getSource() == sevenButton)
3358
+ if (source == sevenButton)
26973359 {
26983360 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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();
27233399 } else
2724
- if (event.getSource() == rootButton)
3400
+ if (source == rootButton)
27253401 {
27263402 Object3D obj;
27273403 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2731,66 +3407,84 @@
27313407 EditObject(obj);
27323408 }
27333409
3410
+ cameraView.requestFocusInWindow();
27343411 refreshContents(true);
27353412 } else
2736
- if (event.getSource() == closeButton)
3413
+ if (source == closeButton)
27373414 {
27383415 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27393416 cRadio ab;
27403417 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27413418 {
27423419 ab = (cRadio)e.nextElement();
2743
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3420
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27443421 {
3422
+ // Patch to avoid bug with transparency.
3423
+ if (!ab.hadMaterial)
3424
+ {
3425
+ ab.object.material = null;
3426
+ }
3427
+
27453428 buttonGroup.remove(ab);
27463429 radioPanel.remove(ab);
27473430
2748
- ab.GetObject().editWindow = null;
3431
+ //ab.GetObject().editWindow = null;
3432
+ ab.GetObject().manipWindow = null;
27493433 // ab.GetObject().objectUI = null; // ?????????
27503434
27513435 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27523436 break;
27533437 }
27543438 }
3439
+
3440
+ cameraView.requestFocusInWindow();
27553441 refreshContents(true);
27563442 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
3443
+ if (source == editItem || source == editButton)
27583444 {
3445
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3446
+ {
3447
+ Object3D child = (Object3D)e.nextElement();
3448
+ child.pinned = true;
3449
+ }
3450
+
27593451 EditSelection(false);
27603452 } else
2761
- if (event.getSource() == uneditButton)
3453
+ if (source == uneditButton)
27623454 {
27633455 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27643456 {
27653457 Object3D child = (Object3D)e.nextElement();
27663458 if(child.editWindow != null)
27673459 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3460
+ child.pinned = false;
27683461 child.CloseUI();
27693462 listUI.remove(child);
27703463
2771
- child.editWindow = null; // ???????????
3464
+ //child.editWindow = null; // ???????????
27723465 }
2773
- objEditor.ctrlPanel.revalidate();
3466
+ objEditor.ctrlPanel.FlushUI();
27743467 //objEditor.jTree.clearSelection();
27753468 //objEditor.ResetSliders();
27763469 refreshContents(true);
27773470 } else
2778
- if (event.getSource() == clearPanelButton)
3471
+ if (source == clearPanelButton)
27793472 {
27803473 assert(copy == group);
27813474 //copy.ClearUI();
27823475 for (Object3D obj : listUI)
27833476 {
3477
+ obj.pinned = false;
27843478 obj.CloseUI();
27853479 }
27863480 listUI.clear();
27873481 refreshContents(true);
27883482 } else
2789
- if (event.getSource() == allParamsButton)
3483
+ if (source == allParamsButton)
27903484 {
27913485 assert(copy == group);
27923486
2793
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3487
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27943488
27953489 for (Object3D obj : listUI)
27963490 {
....@@ -2807,19 +3501,19 @@
28073501
28083502 refreshContents(true);
28093503 } else
2810
- if (event.getSource() == unselectButton)
3504
+ if (source == unselectButton)
28113505 {
28123506 objEditor.jTree.clearSelection();
28133507 // ?? oct 2012 GrafreeD.clipboard.clear();
28143508 objEditor.ResetSliders();
28153509 refreshContents(true);
28163510 } else
2817
- if(event.getSource() instanceof cRadio)
3511
+ if(source instanceof cRadio)
28183512 {
28193513 group.parent = keepparent;
28203514 group.attributes = 0;
28213515 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3516
+ /*cRadio*/ radio = (cRadio)source;
28233517 Object3D obj = radio.GetObject();
28243518 System.out.println("Edit " + obj);
28253519 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3533,10 @@
28393533 }
28403534
28413535 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3536
+
3537
+ SetUndoStates();
3538
+
3539
+ //Globals.theRenderer.object = group;
28433540 if(!useclient)
28443541 {
28453542 cameraView.renderCamera = radio.camera;
....@@ -2848,25 +3545,52 @@
28483545 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493546 cameraView.targetLookAt.set(radio.camera.lookAt);
28503547 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3548
+ //cameraView.lighttouched = true;
3549
+ Globals.lighttouched = true;
28523550 topView.object = group;
28533551 frontView.object = group;
28543552 sideView.object = group;
28553553 }
2856
- group.editWindow = this;
3554
+
3555
+// fix "+" issue
3556
+ //group.editWindow = this;
3557
+ group.manipWindow = this;
3558
+
28573559 /*
28583560 currentLayout = radio.layout;
28593561 if (currentLayout == null)
28603562 currentLayout = sevenButton;
28613563 */
28623564 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);
28633572 keepparent = group.parent;
28643573 // PARENT = NULL or not???
28653574 //group.parent = null; // ROOT
28663575 //group.attributes = -1;
28673576 ResetModel();
3577
+
3578
+ cameraView.requestFocusInWindow();
28683579 refreshContents(true);
2869
- }
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
+ }
28703594 else
28713595 {
28723596 //return super.action(event, arg);
....@@ -2875,7 +3599,6 @@
28753599 }
28763600
28773601 boolean useclient = false;
2878
- cRadio radio;
28793602
28803603 void ToggleRoot()
28813604 {
....@@ -2884,7 +3607,7 @@
28843607 if (useclient)
28853608 {
28863609 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3610
+ Globals.lighttouched = true;
28883611 //topView.object = client;
28893612 //frontView.object = client;
28903613 //sideView.object = client;
....@@ -2892,7 +3615,7 @@
28923615 else
28933616 {
28943617 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3618
+ Globals.lighttouched = true;
28963619 //topView.object = group;
28973620 //frontView.object = group;
28983621 //sideView.object = group;
....@@ -2927,6 +3650,28 @@
29273650 refreshContents();
29283651 }
29293652
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
+ }
29303675
29313676 void ResetTransform()
29323677 {
....@@ -3039,7 +3784,7 @@
30393784 refreshContents();
30403785 }
30413786
3042
- void ResetCentroid()
3787
+ void ResetCentroid(boolean full)
30433788 {
30443789 Object3D obj;
30453790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3054,12 +3799,16 @@
30543799 LA.matIdentity(Object3D.mat);
30553800 obj.getBounds(minima, maxima, false);
30563801 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3802
+ if (full)
3803
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30583804 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30593805 obj.TransformMesh(Object3D.mat);
3806
+
30603807 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3061
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3808
+ if (full)
3809
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30623810 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3811
+
30633812 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30643813 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30653814 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3088,7 +3837,8 @@
30883837
30893838 int size = obj.MemorySize();
30903839
3091
- 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)");
30923842 }
30933843 }
30943844 catch (Exception e)
....@@ -3125,9 +3875,9 @@
31253875 obj = (Object3D)e.nextElement();
31263876
31273877 System.out.println("Object is: " + obj);
3128
- GrafreeD.AnalyzeObject(obj);
3878
+ Grafreed.AnalyzeObject(obj);
31293879 System.out.println("Boundary rep: " + obj.bRep);
3130
- GrafreeD.AnalyzeObject(obj.bRep);
3880
+ Grafreed.AnalyzeObject(obj.bRep);
31313881
31323882 // System.err.println((size/1024) + " KB is the size of " + obj);
31333883 }
....@@ -3169,6 +3919,20 @@
31693919 void GenNormals(boolean crease)
31703920 {
31713921 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();
31723936
31733937 refreshContents();
31743938 }
....@@ -3334,8 +4098,8 @@
33344098
33354099 void ParseVertices()
33364100 {
3337
- boolean epsequal = GrafreeD.epsequal;
3338
- GrafreeD.epsequal = true;
4101
+ boolean epsequal = Grafreed.epsequal;
4102
+ Grafreed.epsequal = true;
33394103
33404104 for (int i=0; i<group.selection.size(); i++)
33414105 {
....@@ -3360,7 +4124,7 @@
33604124 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33614125 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33624126
3363
- g.add(GrafreeD.clipboard);
4127
+ g.add(Grafreed.clipboard);
33644128
33654129 buffer.add(g);
33664130 }
....@@ -3375,7 +4139,7 @@
33754139 makeSomething(buffer, i==group.selection.size()-1);
33764140 }
33774141
3378
- GrafreeD.epsequal = epsequal;
4142
+ Grafreed.epsequal = epsequal;
33794143
33804144 refreshContents();
33814145 }
....@@ -3393,7 +4157,16 @@
33934157 String pigment = Object3D.GetPigment(tex);
33944158 //String bump = Object3D.GetBump(tex);
33954159
3396
- 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
+ }
33974170
33984171 double s = v.s;
33994172
....@@ -3441,12 +4214,26 @@
34414214
34424215 void Align()
34434216 {
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
+
34444231 for (int i=0; i<group.selection.size(); i++)
34454232 {
34464233 Object3D obj = group.selection.get(i);
34474234
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- 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);
34504237 }
34514238
34524239 refreshContents();
....@@ -3467,11 +4254,11 @@
34674254
34684255 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34694256
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
4257
+ boolean random = CameraPane.SWITCH;
4258
+ CameraPane.SWITCH = false; // parse all random nodes
34724259 lowres.linkVerticesThis(null);
34734260 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
4261
+ CameraPane.SWITCH = random;
34754262
34764263 System.err.flush();
34774264
....@@ -3511,7 +4298,7 @@
35114298 return;
35124299
35134300 Object3D poses = group.selection.get(0);
3514
- Object3D ref = GrafreeD.clipboard.get(0);
4301
+ Object3D ref = Grafreed.clipboard.get(0);
35154302
35164303 Object3D newgroup = new Object3D("Po:" + poses.name);
35174304
....@@ -3680,7 +4467,7 @@
36804467 group.selection.RelinkToSupport(); // july 2014
36814468 System.out.println("DONE.");
36824469 refreshContents();
3683
- 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));
36844471 }
36854472
36864473 void ReduceMesh(boolean reduction34)
....@@ -3705,9 +4492,9 @@
37054492
37064493 void ClipMesh()
37074494 {
3708
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4495
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37094496 {
3710
- Object3D content = GrafreeD.clipboard.get(0);
4497
+ Object3D content = Grafreed.clipboard.get(0);
37114498
37124499 if (content instanceof cGroup && ((cGroup)content).transientlink )
37134500 content = ((cGroup)content).get(0);
....@@ -3716,7 +4503,7 @@
37164503 // {
37174504 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37184505 // }
3719
- group.selection.ClipMesh(GrafreeD.clipboard);
4506
+ group.selection.ClipMesh(Grafreed.clipboard);
37204507 }
37214508 // group.selection.ClipMesh(GrafreeD.clipboard);
37224509 System.out.println("DONE.");
....@@ -3763,6 +4550,18 @@
37634550 void MarkLeaves(boolean hide)
37644551 {
37654552 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);
37664565 refreshContents();
37674566 }
37684567
....@@ -3837,28 +4636,25 @@
38374636 // }
38384637 // }
38394638
3840
- static boolean allparams = true;
3841
-
3842
- static Vector<Object3D> listUI = new Vector<Object3D>();
3843
-
38444639 void EditSelection(boolean newWindow)
38454640 {
4641
+ if (group.selection == null)
4642
+ {
4643
+ EditElement(group, newWindow); // ? new
4644
+ return;
4645
+ }
4646
+
38464647 // aConstraints.gridy = 0;
38474648 for (int i=0; i<group.selection.size(); i++)
38484649 {
38494650 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38504651 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3851
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4652
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38524653
38534654 Object3D elem = (Object3D)group.selection.elementAt(i);
3854
- if(elem != group)
4655
+ if(elem != group || !newWindow)
38554656 {
3856
- // if (!(elem instanceof Composite))
3857
- // newWindow = false;
3858
- listUI.add(elem);
3859
- elem.openEditWindow(this, newWindow); //, false);
3860
- System.out.println("edit : " + elem);
3861
- elem.editWindow.refreshContents(true); // ? new
4657
+ EditElement(elem, newWindow); // ? new
38624658 }
38634659 }
38644660 }
....@@ -3933,7 +4729,8 @@
39334729 //new Exception().printStackTrace();
39344730
39354731 freezemodel = true;
3936
-
4732
+ ClearUnpinned();
4733
+
39374734 /**/
39384735 //switch (event.id)
39394736 {
....@@ -3941,7 +4738,6 @@
39414738 //case 702: // Event.LIST_DESELECT
39424739 group.deselectAll();
39434740 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3944
- objEditor.ClearInfo(); // .GetMaterial());
39454741 if (tps != null)
39464742 {
39474743 for (int i=0; i < tps.length; i++)
....@@ -3950,33 +4746,39 @@
39504746
39514747 //if (child.parent != null)
39524748 //child.parent.addSelectee(child);
4749
+ objEditor.SetMaterial(child);
39534750 group.addSelectee(child);
3954
- objEditor.SetMaterial(child); // .GetMaterial());
3955
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3956
- System.err.println("info : " + child.GetPath());
39574751 }
39584752 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4753
+// else
4754
+// {
4755
+// objEditor.SetMaterial(group); // .GetMaterial());
4756
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4757
+// System.err.println("info : " + group.GetPath());
4758
+// }
39654759
3966
- objEditor.SetText(); // jan 2014
3967
-
3968
- 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))
39694761 CameraPane.flash = true;
39704762
3971
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4763
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39724764 // a camera
39734765 {
3974
- CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // 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;
39784773 }
39794774
4775
+ if (tps != null && tps.length == 1)
4776
+ {
4777
+ EditSelection(false);
4778
+ }
4779
+
4780
+ SetPinStates(tps != null && tps.length > 0);
4781
+
39804782 refreshContents();
39814783 //return true;
39824784 }
....@@ -3985,6 +4787,35 @@
39854787
39864788 freezemodel = false;
39874789 }
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
+ }
39884819
39894820 void linkSomething(Object3D thing)
39904821 {
....@@ -4056,16 +4887,19 @@
40564887 {
40574888 if (group.selection.isEmpty())
40584889 return;
4059
- GrafreeD.clipboardIsTempGroup = false;
4890
+
4891
+ Grafreed.clipboardIsTempGroup = false;
40604892 Composite tGroup = null;
40614893 if (group.selection.size() > 0) // 1)
40624894 {
40634895 tGroup = new cGroup();
4064
- GrafreeD.clipboardIsTempGroup = true;
4896
+ Grafreed.clipboardIsTempGroup = true;
40654897 }
40664898
40674899 if (cut)
40684900 {
4901
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4902
+// Save();
40694903 //int indices[] = jList.getSelectedIndices();
40704904 //for (int i = indices.length - 1; i >= 0; i--)
40714905 //jList.remove(indices[i]);
....@@ -4101,16 +4935,16 @@
41014935 //System.out.println("cut " + child);
41024936 //System.out.println("parent = " + child.parent);
41034937 // tmp.addChild(child);
4104
- if (GrafreeD.clipboardIsTempGroup)
4938
+ if (Grafreed.clipboardIsTempGroup)
41054939 tGroup.add/*Child*/(tmp);
41064940 else
4107
- GrafreeD.clipboard = tmp;
4941
+ Grafreed.clipboard = tmp;
41084942 }
41094943 else
4110
- if (GrafreeD.clipboardIsTempGroup)
4944
+ if (Grafreed.clipboardIsTempGroup)
41114945 tGroup.add/*Child*/(child);
41124946 else
4113
- GrafreeD.clipboard = child;
4947
+ Grafreed.clipboard = child;
41144948 }
41154949
41164950 //ResetModel();
....@@ -4142,21 +4976,23 @@
41424976 //System.out.println("cut " + elem);
41434977 //System.out.println("parent = " + elem.parent);
41444978 // tmp.addChild(elem);
4145
- if (GrafreeD.clipboardIsTempGroup)
4979
+ if (Grafreed.clipboardIsTempGroup)
41464980 tGroup.add/*Child*/(tmp);
41474981 else
4148
- GrafreeD.clipboard = tmp;
4982
+ Grafreed.clipboard = tmp;
41494983 }
41504984 else
4151
- if (GrafreeD.clipboardIsTempGroup)
4985
+ if (Grafreed.clipboardIsTempGroup)
41524986 tGroup.add/*Child*/(child);
41534987 else
4154
- GrafreeD.clipboard = child;
4988
+ Grafreed.clipboard = child;
41554989 }
41564990
41574991 }
4158
- if (GrafreeD.clipboardIsTempGroup)
4159
- GrafreeD.clipboard = tGroup;
4992
+
4993
+ if (Grafreed.clipboardIsTempGroup)
4994
+ Grafreed.clipboard = tGroup;
4995
+
41604996 if (cut)
41614997 {
41624998 ResetModel();
....@@ -4166,11 +5002,15 @@
41665002
41675003 void paste(boolean expand)
41685004 {
5005
+ if (Globals.REPLACEONMAKE)
5006
+ Save();
5007
+ boolean keep = Globals.REPLACEONMAKE;
5008
+ Globals.REPLACEONMAKE = false;
41695009 // if (GrafreeD.clipboard == null)
41705010 // return;
41715011 boolean first = true;
41725012
4173
- if (GrafreeD.clipboardIsTempGroup)
5013
+ if (Grafreed.clipboardIsTempGroup)
41745014 {
41755015 Composite temp;
41765016
....@@ -4181,7 +5021,7 @@
41815021 temp = (Composite)Applet3D.clipboard.deepCopy();
41825022 */
41835023 Object3D elem;
4184
- 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))
41855025 {
41865026 Object3D child = (Object3D)e.nextElement();
41875027
....@@ -4215,21 +5055,22 @@
42155055 //Object3D cb = Applet3D.clipboard;
42165056 //temp.addChild(cb);
42175057 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4218
- assert(GrafreeD.clipboard.parent == null);
4219
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
- 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());
42235063 else
4224
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
- GrafreeD.clipboard.get(0).parent = keepparent;
5064
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5065
+ Grafreed.clipboard.get(0).parent = keepparent;
42265066 }
42275067
5068
+ Globals.REPLACEONMAKE = keep;
42285069 ResetModel();
42295070 refreshContents();
42305071 }
42315072
4232
- void pasteInto(boolean copyit)
5073
+ void pasteInto(boolean copyit, boolean clone)
42335074 {
42345075 // if (GrafreeD.clipboard == null)
42355076 // return;
....@@ -4258,15 +5099,22 @@
42585099 if (copyit)
42595100 {
42605101 // paste(false);
4261
- CloneClipboard(false); // sept 2014
5102
+ if (clone)
5103
+ {
5104
+ CloneClipboard(false); // sept 2014
5105
+ }
5106
+ else
5107
+ {
5108
+ paste(false);
5109
+ }
42625110 }
42635111 else
42645112 {
42655113 boolean first = true;
42665114
4267
- if (GrafreeD.clipboardIsTempGroup)
5115
+ if (Grafreed.clipboardIsTempGroup)
42685116 {
4269
- Composite temp = (Composite)GrafreeD.clipboard;
5117
+ Composite temp = (Composite)Grafreed.clipboard;
42705118 Object3D copy;
42715119 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42725120 {
....@@ -4276,7 +5124,7 @@
42765124 }
42775125 } else
42785126 {
4279
- linkSomething(GrafreeD.clipboard); //.get(0));
5127
+ linkSomething(Grafreed.clipboard); //.get(0));
42805128 }
42815129 }
42825130 }
....@@ -4353,6 +5201,10 @@
43535201
43545202 void group(Object3D csg, boolean grab)
43555203 {
5204
+ if (Globals.REPLACEONMAKE)
5205
+ Save();
5206
+ boolean keep = Globals.REPLACEONMAKE;
5207
+ Globals.REPLACEONMAKE = false;
43565208 if (//false) // why??
43575209 !group.selection.isEmpty())
43585210 {
....@@ -4466,8 +5318,34 @@
44665318 //node.add(csg);
44675319 //makeSomething(node);
44685320 makeSomething(csg);
5321
+ Globals.REPLACEONMAKE = keep;
44695322 }
44705323
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
+
44715349 void ungroup()
44725350 {
44735351 /*
....@@ -4661,21 +5539,6 @@
46615539 }
46625540 */
46635541
4664
- void ImportGFD()
4665
- {
4666
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4667
- browser.show();
4668
- String filename = browser.getFile();
4669
- if (filename != null && filename.length() > 0)
4670
- {
4671
- String fullname = browser.getDirectory() + filename;
4672
-
4673
- //Object3D readobj =
4674
- objEditor.ReadGFD(fullname, objEditor);
4675
- //makeSomething(readobj);
4676
- }
4677
- }
4678
-
46795542 /*
46805543 public void Callback(Object obj)
46815544 {
....@@ -4699,26 +5562,9 @@
46995562 }
47005563 */
47015564
4702
- void ImportVRMLX3D()
4703
- {
4704
- if (GrafreeD.standAlone)
4705
- {
4706
- /**/
4707
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4708
- browser.show();
4709
- String filename = browser.getFile();
4710
- if (filename != null && filename.length() > 0)
4711
- {
4712
- String fullname = browser.getDirectory() + filename;
4713
- LoadVRMLX3D(fullname);
4714
- }
4715
- /**/
4716
- }
4717
- }
4718
-
47195565 String GetFile(String dialogName)
47205566 {
4721
- if (GrafreeD.standAlone)
5567
+ if (Grafreed.standAlone)
47225568 {
47235569 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47245570 browser.show();
....@@ -4782,10 +5628,33 @@
47825628 cButton flashSelectionButton;
47835629 cButton editButton;
47845630 cButton uneditButton;
5631
+ JCheckBox allParamsButton;
47855632 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875633 cButton unselectButton;
47885634
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
+
47895658 cButton screenfitButton;
47905659 cButton screenfitpointButton;
47915660 cButton snapobjectButton;
....@@ -4797,14 +5666,6 @@
47975666
47985667 cButton setsupportButton;
47995668
4800
- cButton twoButton;
4801
- cButton sixButton;
4802
- cButton threeButton;
4803
- cButton sevenButton;
4804
- cButton fourButton; // full panel
4805
- cButton oneButton; // full XYZ
4806
- //cButton currentLayout;
4807
-
48085669 //
48095670 //Composite
48105671 Object3D // to do !!
....@@ -4814,9 +5675,11 @@
48145675 //JTree jTree;
48155676 private MenuItem lookAtItem;
48165677 private MenuItem lookFromItem;
4817
- private MenuItem switchItem;
5678
+ private MenuItem switchViewItem;
48185679 private MenuItem cutItem;
4819
- private MenuItem duplicateItem;
5680
+ private MenuItem undoItem;
5681
+ private MenuItem redoItem;
5682
+ private JMenuItem duplicateItem;
48205683 private MenuItem cloneItem;
48215684 private MenuItem cloneSupportItem;
48225685 private MenuItem overwriteGeoItem;
....@@ -4827,8 +5690,9 @@
48275690 private MenuItem resetsupportItem;
48285691 private MenuItem resetreferencesItem;
48295692 private MenuItem linkverticesItem;
5693
+ private MenuItem relinkverticesItem;
48305694 private MenuItem setMasterItem;
4831
- private MenuItem resetMeshItem;
5695
+ private MenuItem resetAllItem;
48325696 private MenuItem stepAllItem;
48335697 private MenuItem revertMeshItem;
48345698 private MenuItem poseMeshItem;
....@@ -4839,14 +5703,17 @@
48395703 private MenuItem mergeGeometriesItem;
48405704 private MenuItem copyItem;
48415705 private MenuItem pasteItem;
5706
+ private MenuItem pasteIntoItem;
48425707 private MenuItem pasteLinkItem;
48435708 private MenuItem pasteCloneItem;
48445709 private MenuItem pasteExpandItem;
4845
- private MenuItem clearItem;
5710
+ private MenuItem deleteItem;
48465711 private MenuItem clearAllItem;
48475712 private MenuItem genUVItem;
5713
+ private MenuItem genNormalsMESHItem;
48485714 private MenuItem genNormalsCADItem;
48495715 private MenuItem genNormalsORGANItem;
5716
+ private MenuItem genNormalsMINEItem;
48505717 private MenuItem stripifyItem;
48515718 private MenuItem unstripifyItem;
48525719 private MenuItem trimItem;
....@@ -4875,6 +5742,10 @@
48755742 private MenuItem showleavesItem;
48765743 private MenuItem markleavesItem;
48775744 private MenuItem unmarkleavesItem;
5745
+ private MenuItem rewindleavesItem;
5746
+ private MenuItem unrewindleavesItem;
5747
+ private MenuItem randomleavesItem;
5748
+ private MenuItem unrandomleavesItem;
48785749
48795750 private MenuItem flipVItem;
48805751 private MenuItem unflipVItem;
....@@ -4886,14 +5757,17 @@
48865757 private MenuItem panoTexturesItem;
48875758
48885759 private MenuItem resetCentroidItem;
4889
- private MenuItem transformgeometryItem;
5760
+ private MenuItem resetCentroidXZItem;
48905761 private MenuItem resetTransformItem;
5762
+ private MenuItem transformGeometryItem;
5763
+ private MenuItem transformChildrenItem;
5764
+ private MenuItem hideItem;
48915765 private MenuItem grabItem;
48925766 private MenuItem backItem;
48935767 private MenuItem frontItem;
48945768 private MenuItem cameraItem;
48955769 private MenuItem compositeItem;
4896
- private MenuItem randomItem;
5770
+ private MenuItem switchItem;
48975771 private MenuItem physicsItem;
48985772 private MenuItem frameselectorItem;
48995773 private MenuItem scriptNodeItem;
....@@ -4908,6 +5782,7 @@
49085782
49095783 private MenuItem resetParentItem;
49105784 private MenuItem repairParentItem;
5785
+ private MenuItem repairShadowItem;
49115786 private MenuItem sortbysizeItem;
49125787 private MenuItem sortbynameItem;
49135788
....@@ -4928,10 +5803,11 @@
49285803 private MenuItem coneItem;
49295804 private MenuItem torusItem;
49305805 private MenuItem superItem;
5806
+ private MenuItem kleinItem;
49315807 private MenuItem blobItem;
49325808 private MenuItem latheItem;
49335809 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5810
+ private MenuItem overlayItem;
49355811 private MenuItem meshItem;
49365812 // private MenuItem meshGroupItem;
49375813 private MenuItem springItem;
....@@ -4940,6 +5816,7 @@
49405816 private MenuItem csgItem;
49415817 private MenuItem templateItem;
49425818 private MenuItem textureItem;
5819
+ private MenuItem billboardItem;
49435820 private MenuItem shadowXItem;
49445821 private MenuItem shadowYItem;
49455822 private MenuItem shadowZItem;
....@@ -4952,11 +5829,6 @@
49525829 private MenuItem doubleItem;
49535830 private MenuItem tripleItem;
49545831
4955
- private MenuItem importGFDItem;
4956
- private MenuItem importVRMLX3DItem;
4957
- private MenuItem import3DSItem;
4958
- private MenuItem importOBJItem;
4959
-
49605832 private MenuItem computeAOItem;
49615833 private MenuItem recompileItem;
49625834 private MenuItem editScriptItem;
....@@ -4966,4 +5838,8 @@
49665838 private MenuItem analyzeItem;
49675839 private MenuItem dumpItem;
49685840 //boolean freezemodel = false;
5841
+
5842
+ Menu cameraMenu;
5843
+ MenuItem editCameraItem;
5844
+ MenuItem restoreCameraItem;
49695845 }