Normand Briere
2019-07-18 d7a17c35c443e2cb6c09eaa3cfeaf590a571faa1
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);
208
+ menu.add("-");
187209 clearItem = menu.add(new MenuItem("Clear"));
188210 clearItem.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,79 +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);
222338 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223339 relinkverticesItem.addActionListener(this);
340
+
341
+ if (Globals.ADVANCED)
342
+ {
224343 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225344 setMasterItem.addActionListener(this);
345
+ }
226346
227347 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
348
+// grabItem = menu.add(new MenuItem("Grab"));
349
+// grabItem.addActionListener(this);
230350 backItem = menu.add(new MenuItem("Back"));
231351 backItem.addActionListener(this);
232352 frontItem = menu.add(new MenuItem("Front"));
233353 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
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"));
237360 hideItem.addActionListener(this);
361
+ }
238362 ungroupItem = menu.add(new MenuItem("Ungroup"));
239363 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
364
+
365
+// menu.add("-");
366
+//
367
+// switchItem = menu.add(new MenuItem("Switch node"));
368
+// switchItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
247371 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248372 switchGeoItem.addActionListener(this);
249373 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250374 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
375
+ morphItem = menu.add(new MenuItem("Morph Group"));
252376 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);
253383 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254384 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
385
+ }
257386
258387 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
388
+// textureItem = menu.add(new MenuItem("Texture"));
389
+// textureItem.addActionListener(this);
261390 billboardItem = menu.add(new MenuItem("Billboard"));
262391 billboardItem.addActionListener(this);
263392 csgItem = menu.add(new MenuItem("CSG"));
264393 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
394
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266395 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
396
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268397 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
398
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270399 shadowZItem.addActionListener(this);
400
+ attributeItem = menu.add(new MenuItem("Attribute"));
401
+ attributeItem.addActionListener(this);
402
+
403
+ if (Globals.ADVANCED)
404
+ {
405
+ menu.add("-");
271406 linkerItem = menu.add(new MenuItem("Linker"));
272407 linkerItem.addActionListener(this);
273408 templateItem = menu.add(new MenuItem("Template"));
274409 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277410 pointflowItem = menu.add(new MenuItem("Point Flow"));
278411 pointflowItem.addActionListener(this);
412
+ }
279413 menu.add("-");
280414 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281415 resetTransformItem.addActionListener(this);
282416 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283417 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.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);
286424
287425 oe.menuBar.add(menu = new Menu("Geometry"));
288426 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +431,11 @@
293431 genNormalsCADItem.addActionListener(this);
294432 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295433 genNormalsMESHItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
296436 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297437 genNormalsMINEItem.addActionListener(this);
438
+ }
298439 stripifyItem = menu.add(new MenuItem("Stripify"));
299440 stripifyItem.addActionListener(this);
300441 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +457,34 @@
316457 reduce34MeshItem.addActionListener(this);
317458 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318459 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321460 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322461 clipMeshItem.addActionListener(this);
462
+
463
+ if (Globals.ADVANCED)
464
+ {
465
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
466
+ smoothMeshItem.addActionListener(this);
467
+ }
323468
324469 oe.menuBar.add(menu = new Menu("Attributes"));
325470 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326471 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);
327476 menu.add("-");
328477 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329478 liveleavesItem.addActionListener(this);
330479 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331480 unliveleavesItem.addActionListener(this);
481
+ if (Globals.ADVANCED)
482
+ {
332483 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333484 supportleavesItem.addActionListener(this);
334485 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335486 unsupportleavesItem.addActionListener(this);
487
+ }
336488 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337489 hideleavesItem.addActionListener(this);
338490 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +493,14 @@
341493 markleavesItem.addActionListener(this);
342494 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343495 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);
344504 menu.add("-");
345505 flipVItem = menu.add(new MenuItem("Flip V"));
346506 flipVItem.addActionListener(this);
....@@ -376,35 +536,41 @@
376536 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377537 sortbynameItem.addActionListener(this);
378538 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.
379546 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380547 extractGeometriesItem.addActionListener(this);
381548 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382549 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
550
+ }
387551
388552 oe.menuBar.add(menu = new Menu("Insert"));
389553 buildCreateMenu(menu);
390554
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402555 oe.menuBar.add(menu = new Menu("Tools"));
403556 buildToolsMenu(menu);
404557 }
405558
559
+
406560 void SetupUI2(ObjEditor oe)
407561 {
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
+
408574 //new Exception().printStackTrace();
409575
410576 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +599,230 @@
433599 oe.radioPanel.add(dummyButton);
434600 oe.buttonGroup.add(dummyButton);
435601 */
436
- aConstraints.gridy += 1;
602
+ cGridBag copyOptionsPanel = new cGridBag();
603
+
604
+ copyOptionsPanel.preferredHeight = 1;
437605
438606 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439607
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
608
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ //minButton.setToolTipText("Minimize window");
610
+ //minButton.addActionListener(this);
442611
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
445
- liveCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
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);
454624 screenfitButton.setToolTipText("Screen fit");
455625 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
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");
660
+ liveCB.addItemListener(this);
661
+
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");
668
+ fastCB.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);
675
+
457676 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458677 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464678
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- flashSelectionButton.addActionListener(this);
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));
473687
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
688
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482689 twoButton.setToolTipText("Show center view only");
483690 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
691
+ this.fullscreenLayout = twoButton;
692
+
693
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485694 fourButton.addActionListener(this);
486695 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
696
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488697 sixButton.setToolTipText("2-column layout left");
489698 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
699
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491700 threeButton.setToolTipText("2-column layout right");
492701 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
702
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494703 sevenButton.setToolTipText("3-column layout");
495704 sevenButton.addActionListener(this);
496705 //
497706
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
707
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ rootButton.setToolTipText("Edit selection in new tab");
500709 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
710
+
711
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503712 closeButton.setToolTipText("Close tab");
504713 closeButton.addActionListener(this);
505714 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506715 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515716
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
717
+ // INSERT
718
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ gridButton.setToolTipText("Create grid");
720
+ gridButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ boxButton.setToolTipText("Create box");
724
+ boxButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ sphereButton.setToolTipText("Create sphere");
728
+ sphereButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ coneButton.setToolTipText("Create cone");
732
+ coneButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ torusButton.setToolTipText("Create torus");
736
+ torusButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ superButton.setToolTipText("Create superellipsoid");
740
+ superButton.addActionListener(this);
741
+
742
+ if (Globals.ADVANCED)
743
+ {
744
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ kleinButton.setToolTipText("Create Klein bottle");
746
+ kleinButton.addActionListener(this);
747
+ }
748
+
749
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750
+ particlesButton.setToolTipText("Create particle system");
751
+ particlesButton.addActionListener(this);
752
+
753
+ oe.toolboxPanel.Return();
754
+
755
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
756
+ groupButton.setToolTipText("Create group");
757
+ groupButton.addActionListener(this);
758
+
759
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ compositeButton.setToolTipText("Create composite");
761
+ compositeButton.addActionListener(this);
762
+
763
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ switchButton.setToolTipText("Create item switcher");
765
+ switchButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ loopButton.setToolTipText("Create loop");
769
+ loopButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ textureButton.setToolTipText("Create texture");
773
+ textureButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ overlayButton.setToolTipText("Create overlay");
777
+ overlayButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ lightButton.setToolTipText("Create light");
781
+ lightButton.addActionListener(this);
782
+
783
+ for (int i=6; --i>=0;)
784
+ {
785
+ oe.toolboxPanel.Return();
786
+ oe.toolboxPanel.add(new cGridBag());
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
+ }
794
+
795
+ // EDIT panel
796
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ editButton.setToolTipText("Pin selection controls");
798
+ editButton.addActionListener(this);
799
+
800
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ uneditButton.setToolTipText("Remove selection controls");
517802 uneditButton.addActionListener(this);
518803
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
804
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
805
+ allParamsButton.setToolTipText("Show all controle");
531806 allParamsButton.addActionListener(this);
532807
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
808
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ clearPanelButton.setToolTipText("Clear edit panel");
810
+ clearPanelButton.addActionListener(this);
811
+
812
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
813
+ unselectButton.setToolTipText("Unselect");
538814 unselectButton.addActionListener(this);
539815
816
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ flashSelectionButton.setToolTipText("Highlight selection");
818
+ flashSelectionButton.addActionListener(this);
819
+
820
+ editCommandsPanel.preferredHeight = 1;
821
+
822
+ SetPinStates(false);
823
+// oe.treePanel.add(commandsPanel);
824
+// oe.treePanel.Return();
825
+
540826 // oe.aConstraints.gridx += 1;
541827 // oe.aConstraints.weighty = 0;
542828 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +834,25 @@
548834 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549835 // gcButton.addActionListener(this);
550836
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
837
+ cGridBag jSPPanel = new cGridBag();
838
+
839
+ JScrollPane jSP;
562840 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
841
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564842 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
584843
844
+ oe.treePanel.add(jSPPanel);
845
+ oe.treePanel.Return();
846
+
847
+ oe.treePanel.add(copyOptionsPanel);
848
+ oe.treePanel.Return();
849
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
850
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
851
+ sliderPane.preferredHeight = 1;
852
+
853
+// mainPanel.setDividerLocation(0.5); //1.0);
854
+// mainPanel.setResizeWeight(0.5);
855
+
585856 //jList.addListSelectionListener(this);
586857 oe.jTree.addTreeSelectionListener(this);
587858 //jTree.setRootVisible(false);
....@@ -604,83 +875,143 @@
604875 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605876 }
606877
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
878
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608879 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
880
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
881
+ colorCB.setToolTipText("Copy color when dropped");
882
+ colorCB.addItemListener(this);
618883
619
- // constraints.gridy += 1;
884
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
885
+ materialCB.setToolTipText("Copy material when dropped");
886
+ materialCB.addItemListener(this);
887
+
888
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
889
+ textureCB.setToolTipText("Copy texture when dropped");
890
+ textureCB.addItemListener(this);
891
+
892
+ panel.Return();
893
+
894
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
895
+ boxCB.setToolTipText("Display bounding boxes");
896
+ boxCB.addItemListener(this);
897
+
898
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
899
+ zoomBoxCB.setToolTipText("Display only for wheel");
900
+ zoomBoxCB.addItemListener(this);
901
+
902
+ if (true) // Globals.ADVANCED)
903
+ {
904
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
905
+// supportCB.setToolTipText("Enable rigging");
906
+// supportCB.addItemListener(this);
907
+
908
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
909
+ freezeCB.setToolTipText("Fast moving camera");
910
+ freezeCB.addItemListener(this);
911
+
620912 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621913 // localCB.addItemListener(this);
622914
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
915
+ panel.Return();
916
+
917
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625918 crowdCB.setToolTipText("Used for crowds");
626919 crowdCB.addItemListener(this);
627920
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
921
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630922 smoothCB.setToolTipText("Snapping delay");
631923 smoothCB.addItemListener(this);
632924
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
925
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635926 slowCB.setToolTipText("Smooth interpolation");
636927 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
639
- boxCB.setToolTipText("Display bounding boxes");
640
- boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
- zoomBoxCB.addItemListener(this);
645
-
928
+
646929 // constraints.gridy += 1;
647930 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648931 // speakerMocapCB.addItemListener(this);
649932
933
+ panel.Return();
934
+
650935 if (false)
651936 {
652937 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
938
+ //constraints.gridy += 1;
939
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655940 speakerCameraCB.addItemListener(this);
656941
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
942
+ //constraints.gridy += 1;
943
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659944 speakerFocusCB.addItemListener(this);
660945
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
946
+ //constraints.gridy += 1;
947
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663948 smoothfocusCB.addItemListener(this);
949
+ panel.Return();
664950 }
665951
666952 //constraints.gridx += 1;
667953 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668954 // debugCB.addItemListener(this);
669955
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
956
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
957
+ trackCB.setToolTipText("Enable tracking target");
958
+ trackCB.addItemListener(this);
959
+
960
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
961
+ oeilCB.setToolTipText("Move camera when tracking");
672962 oeilCB.addItemListener(this);
673963
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
964
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
965
+ shadowCB.setToolTipText("When live compute shadows");
966
+ shadowCB.addItemListener(this);
967
+
968
+ panel.Return();
969
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
970
+ toggleTextureCB.setToolTipText("Load textures");
971
+ toggleTextureCB.addItemListener(this);
972
+
973
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
974
+ toggleSwitchCB.setToolTipText("Choose a single item");
975
+ toggleSwitchCB.addItemListener(this);
976
+
977
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
978
+ autokeepCB.setToolTipText("On structure change");
979
+ autokeepCB.addItemListener(this);
980
+
981
+ panel.Return();
982
+ if (Globals.ADVANCED)
983
+ {
984
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676985 lookAtCB.setToolTipText("Look-at target");
677986 lookAtCB.addItemListener(this);
987
+ }
988
+
989
+ }
990
+
991
+ cGridBag fill = new cGridBag();
992
+ fill.preferredHeight = 200;
993
+ cGridBag fill2 = new cGridBag();
994
+ fill2.preferredHeight = 200;
995
+ cGridBag fill3 = new cGridBag();
996
+ fill3.preferredHeight = 200;
997
+
998
+ panel.add(fill);
999
+ panel.add(fill2);
1000
+ panel.add(fill3);
6781001
6791002 }
6801003
6811004 void EditObject(Object3D obj)
6821005 {
6831006 cRadio radioButton = new cRadio(obj.name);
1007
+
1008
+ // June 2019. Patch to avoid bug with transparency.
1009
+ radioButton.hadMaterial = obj.material != null;
1010
+ if (!radioButton.hadMaterial)
1011
+ {
1012
+ obj.material = new cMaterial();
1013
+ }
1014
+
6841015 radioButton.SetObject(obj);
6851016 radioButton.layout = sevenButton;
6861017 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +1020,11 @@
6891020 buttonGroup.add(radioButton);
6901021 radioButton.doClick();
6911022 }
1023
+
6921024 void SetupViews(ObjEditor oe)
6931025 {
1026
+ theFrame = this;
1027
+
6941028 oe.SetupViews();
6951029
6961030 System.out.println("SetupViews");
....@@ -699,23 +1033,28 @@
6991033 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7001034 }
7011035
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- JCheckBox smoothfocusCB;
1036
+ cToggleButton liveCB;
1037
+ cCheckBox supportCB;
1038
+ cCheckBox localCB;
1039
+ cCheckBox crowdCB;
1040
+ cCheckBox smoothCB;
1041
+ cToggleButton fastCB;
1042
+ cCheckBox slowCB;
1043
+ cCheckBox boxCB;
1044
+ cCheckBox zoomBoxCB;
1045
+ cCheckBox freezeCB;
1046
+ //cToggleButton trackCB;
1047
+ cCheckBox trackCB;
1048
+ cCheckBox smoothfocusCB;
7131049 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1050
+ cCheckBox speakerCameraCB;
1051
+ cCheckBox speakerFocusCB;
1052
+ cCheckBox debugCB;
1053
+
1054
+ cCheckBox oeilCB;
1055
+ cCheckBox shadowCB;
1056
+ cCheckBox autokeepCB;
1057
+ cCheckBox lookAtCB;
7191058
7201059 // static int COLOR = 1;
7211060 // static int MATERIAL = 2;
....@@ -723,9 +1062,9 @@
7231062
7241063 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251064
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1065
+ cCheckBox colorCB;
1066
+ cCheckBox materialCB;
1067
+ cCheckBox textureCB;
7291068
7301069 public void itemStateChanged(ItemEvent e)
7311070 {
....@@ -753,6 +1092,7 @@
7531092 } else if(e.getSource() == liveCB)
7541093 {
7551094 cameraView.ToggleLive();
1095
+ refreshContents(false);
7561096 }
7571097 else if(e.getSource() == supportCB)
7581098 {
....@@ -817,6 +1157,18 @@
8171157 {
8181158 cameraView.ToggleOeil();
8191159 }
1160
+ else if(e.getSource() == shadowCB)
1161
+ {
1162
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1163
+ }
1164
+ else if(e.getSource() == freezeCB)
1165
+ {
1166
+ Globals.FREEZEONMOVE ^= true;
1167
+ }
1168
+ else if(e.getSource() == autokeepCB)
1169
+ {
1170
+ Globals.REPLACEONMAKE ^= true;
1171
+ }
8201172 else if(e.getSource() == lookAtCB)
8211173 {
8221174 cameraView.ToggleLookAt();
....@@ -833,7 +1185,8 @@
8331185
8341186 /**/
8351187 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1188
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1189
+ TreePath path = objEditor.jTree.getSelectionPath();
8371190 if ((path == null) || (path.getPathCount() <= 1)) {
8381191 // We can't move the root node or an empty selection
8391192 return;
....@@ -896,8 +1249,6 @@
8961249 }
8971250 }
8981251
899
- String string = (String) object;
900
-
9011252 System.out.println("Transfer = " + object + "; drop : " + target);
9021253 // if( object instanceof java.io.File[])
9031254 // {
....@@ -905,7 +1256,11 @@
9051256 // objEditor.DropFile((java.io.File[]) object, true);
9061257 // return;
9071258 // }
908
- if (string.charAt(0) == '/')
1259
+
1260
+ String string = object.toString();
1261
+
1262
+ // File path for Mac and Windows
1263
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091264 {
9101265 // file(s)
9111266 String[] names = string.split("\n");
....@@ -932,7 +1287,7 @@
9321287
9331288 flashIt = false;
9341289 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1290
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361291 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371292
9381293 if (group.selection.size() == 1)
....@@ -948,23 +1303,33 @@
9481303
9491304 assert target == objEditor.jTree;
9501305 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1306
+ Object3D destinationLeaf;
9511307 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1308
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531309 } catch (Exception e) {
9541310 System.out.println("destinationPath : " + destinationPath);
9551311 return;
9561312 }
9571313
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1314
+ for (int i=group.selection.size(); --i>=0;)
9591315 {
1316
+ Object3D child = (Object3D)group.selection.elementAt(i);
1317
+
1318
+ // Cannot move into itself
1319
+ if (child == destinationLeaf)
1320
+ return;
1321
+ }
1322
+
1323
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1324
+// {
9601325 loadClipboard(true);
9611326 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1327
+ pasteInto(false, false);
1328
+// } else {
1329
+// loadClipboard(false);
1330
+// objEditor.jTree.setSelectionPath(destinationPath);
1331
+// pasteInto(false, false); // true); // ???
1332
+// }
9681333 }
9691334 public void dropActionChanged(DropTargetDragEvent dtde)
9701335 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1434,107 @@
10691434 {
10701435 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711436 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.addActionListener(this);
1437
+// gridItem = menu.add(new MenuItem("Grid"));
1438
+// gridItem.addActionListener(this);
1439
+// rectoidItem = menu.add(new MenuItem("Box"));
1440
+// rectoidItem.addActionListener(this);
1441
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1442
+// ellipsoidItem.addActionListener(this);
1443
+// coneItem = menu.add(new MenuItem("Cone"));
1444
+// coneItem.addActionListener(this);
1445
+// torusItem = menu.add(new MenuItem("Torus"));
1446
+// torusItem.addActionListener(this);
1447
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1448
+// superItem.addActionListener(this);
1449
+
1450
+ cameraItem = menu.add(new MenuItem("Camera"));
1451
+ cameraItem.addActionListener(this);
1452
+
1453
+ if (!Globals.ADVANCED)
1454
+ {
10841455 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851456 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1457
+ }
1458
+
1459
+// particleItem = menu.add(new MenuItem("Particle system"));
1460
+// particleItem.addActionListener(this);
1461
+ if (Globals.ADVANCED)
1462
+ {
10881463 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891464 ragdollItem.addActionListener(this);
10901465 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911466 ragdoll2Item.addActionListener(this);
1467
+ }
10921468 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1469
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941470 meshItem.addActionListener(this);
10951471 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961472 // meshGroupItem.addActionListener(this);
1473
+ if (Globals.ADVANCED)
1474
+ {
10971475 springItem = menu.add(new MenuItem("Spring"));
10981476 springItem.addActionListener(this);
10991477 flagItem = menu.add(new MenuItem("Flag"));
11001478 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051479 blobItem = menu.add(new MenuItem("Blob"));
11061480 blobItem.addActionListener(this);
11071481 latheItem = menu.add(new MenuItem("Lathe"));
11081482 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- lightItem.addActionListener(this);
1483
+ }
1484
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1485
+ bezierItem.addActionListener(this);
1486
+// overlayItem = menu.add(new MenuItem("Overlay"));
1487
+// overlayItem.addActionListener(this);
1488
+// lightItem = menu.add(new MenuItem("Light"));
1489
+// lightItem.addActionListener(this);
11111490 menu.add("-");
11121491 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131492 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1493
+// loopItem = menu.add(new MenuItem("Loop"));
1494
+// loopItem.addActionListener(this);
11161495 doubleItem = menu.add(new MenuItem("Fork"));
11171496 doubleItem.addActionListener(this);
1497
+ if (Globals.ADVANCED)
1498
+ {
11181499 tripleItem = menu.add(new MenuItem("Trident"));
11191500 tripleItem.addActionListener(this);
1501
+ }
11201502 }
11211503
11221504 void buildToolsMenu(Menu menu)
11231505 {
11241506 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251507 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1508
+ animationItem.setState(Globals.ANIMATION);
1509
+
1510
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1511
+ archiveItem.addActionListener(this);
11271512
11281513 menu.add("-");
11291514 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301515 parseverticesItem.addActionListener(this);
11311516 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321517 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1518
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341519 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371520 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381521 reduceMorphItem.addActionListener(this);
11391522 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401523 reduce34MorphItem.addActionListener(this);
1141
-
1142
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1143
- computeAOItem.addActionListener(this);
11441524 menu.add("-");
1145
-
11461525 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471526 memoryItem.addActionListener(this);
1527
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1528
+ computeAOItem.addActionListener(this);
1529
+
1530
+ if (Globals.ADVANCED)
1531
+ {
1532
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1533
+ mirrorItem.addActionListener(this);
1534
+ menu.add("-");
11481535 menu.add(analyzeItem = new MenuItem("Analyze"));
11491536 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1537
+ menu.add(dumpItem = new MenuItem("Print"));
11511538 dumpItem.addActionListener(this);
11521539 // menu.add(pathItem = new MenuItem("From-to path"));
11531540 // pathItem.addActionListener(this);
....@@ -1165,6 +1552,7 @@
11651552 menu.add("-");
11661553 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671554 editScriptItem.addActionListener(this);
1555
+ }
11681556 }
11691557
11701558 void ScreenFit()
....@@ -1287,9 +1675,24 @@
12871675 shadow.material = new cMaterial(obj.material);
12881676 shadow.material.diffuse = 0.0001f;
12891677 shadow.material.specular = 0.0001f;
1678
+ //shadow.projectedVertices[1].x = 300;
12901679
12911680 makeSomething(shadow);
12921681 }
1682
+
1683
+ private void ClearUnpinned()
1684
+ {
1685
+ //for (Object3D obj : listUI)
1686
+ for (int i=listUI.size(); --i>=0;)
1687
+ {
1688
+ Object3D obj = listUI.elementAt(i);
1689
+ if (!obj.pinned)
1690
+ {
1691
+ obj.CloseUI();
1692
+ listUI.remove(i);
1693
+ }
1694
+ }
1695
+ }
12931696
12941697 /**
12951698 * applyExample
....@@ -1493,9 +1896,9 @@
14931896
14941897 void Overwrite(int mask)
14951898 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1899
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971900 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1901
+ Object3D content = Grafreed.clipboard.get(0);
14991902
15001903 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011904 content = ((cGroup)content).get(0);
....@@ -1534,7 +1937,7 @@
15341937 {
15351938 ScreenFit();
15361939 } else
1537
- if (source == switchItem)
1940
+ if (source == switchViewItem)
15381941 {
15391942 cVector v1 = new cVector();
15401943 cVector v2 = new cVector();
....@@ -1543,11 +1946,11 @@
15431946 objEditor.cameraView.renderCamera.setAim(v2, v1);
15441947 objEditor.cameraView.repaint();
15451948 } else
1546
- if (source == rectoidItem)
1949
+ if (source == rectoidItem || source == boxButton)
15471950 {
15481951 makeSomething(new Box());
15491952 } else
1550
- if (source == particleItem)
1953
+ if (source == particleItem || source == particlesButton)
15511954 {
15521955 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15531956 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1626,27 +2029,27 @@
16262029
16272030 makeSomething(obj);
16282031 } else
1629
- if (source == gridItem)
2032
+ if (source == gridItem || source == gridButton)
16302033 {
16312034 makeSomething(new Grid());
16322035 } else
1633
- if (source == ellipsoidItem)
2036
+ if (source == ellipsoidItem || source == sphereButton)
16342037 {
16352038 makeSomething(new Sphere());
16362039 } else
1637
- if (source == coneItem)
2040
+ if (source == coneItem || source == coneButton)
16382041 {
16392042 makeSomething(new Cone());
16402043 } else
1641
- if (source == torusItem)
2044
+ if (source == torusItem || source == torusButton)
16422045 {
16432046 makeSomething(new Torus());
16442047 } else
1645
- if (source == superItem)
2048
+ if (source == superItem || source == superButton)
16462049 {
16472050 makeSomething(new Superellipsoid());
16482051 } else
1649
- if (source == kleinItem)
2052
+ if (source == kleinItem || source == kleinButton)
16502053 {
16512054 makeSomething(new Klein());
16522055 } else
....@@ -1666,7 +2069,7 @@
16662069 {
16672070 makeSomething(new BezierSurface());
16682071 } else
1669
- if (source == checkerItem)
2072
+ if (source == overlayItem || source == overlayButton)
16702073 {
16712074 /*
16722075 Object3D obj = new BezierSurface(5,8);
....@@ -1714,7 +2117,7 @@
17142117 s.setup();
17152118 makeSomething(s);
17162119 } else
1717
- if (source == lightItem)
2120
+ if (source == lightItem || source == lightButton)
17182121 {
17192122 makeSomething(new Light());
17202123 } else
....@@ -1764,30 +2167,30 @@
17642167
17652168 group(g);
17662169 } else
1767
- if (source == loopItem)
2170
+ if (source == loopItem || source == loopButton)
17682171 {
17692172 Composite csg = new GroupLeaf();
17702173 csg.count = 5;
17712174 group(csg);
1772
- Composite child = new cGroup();
2175
+ Composite child = new cGroup("Branch");
17732176 csg.addChild(child);
17742177 child.addChild(csg);
17752178 } else
17762179 if (source == doubleItem)
17772180 {
1778
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Fork");
17792182 csg.count = 5;
17802183 group(csg);
1781
- Composite child = new cGroup();
2184
+ Composite child = new cGroup("Branch A");
17822185 csg.addChild(child);
17832186 child.addChild(csg);
1784
- child = new cGroup();
2187
+ child = new cGroup("Branch B");
17852188 csg.addChild(child);
17862189 child.addChild(csg);
17872190 } else
17882191 if (source == tripleItem)
17892192 {
1790
- Composite csg = new GroupLeaf();
2193
+ Composite csg = new GroupLeaf("Trident");
17912194 csg.count = 4;
17922195 group(csg);
17932196 Composite child = new cGroup();
....@@ -1799,23 +2202,6 @@
17992202 child = new cGroup();
18002203 csg.addChild(child);
18012204 child.addChild(csg);
1802
- } else
1803
-
1804
- if (source == importGFDItem)
1805
- {
1806
- ImportGFD();
1807
- } else
1808
- if (source == importVRMLX3DItem)
1809
- {
1810
- ImportVRMLX3D();
1811
- } else
1812
- if (source == import3DSItem)
1813
- {
1814
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1815
- } else
1816
- if (source == importOBJItem)
1817
- {
1818
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18192205 } else
18202206 if (source == computeAOItem)
18212207 {
....@@ -1835,7 +2221,7 @@
18352221 if (source == invariantsItem)
18362222 {
18372223 System.out.println("Invariants:");
1838
- GrafreeD.grafreeD.universe.invariants();
2224
+ Grafreed.grafreeD.universe.invariants();
18392225 } else
18402226 if (source == memoryItem)
18412227 {
....@@ -1854,19 +2240,61 @@
18542240 {
18552241 DumpObject();
18562242 } else
2243
+ if (source == minButton)
2244
+ {
2245
+ Minimize();
2246
+ } else
2247
+ if (source == maxButton)
2248
+ {
2249
+ Maximize();
2250
+ } else
2251
+ if (source == fullButton)
2252
+ {
2253
+ ToggleFullScreen();
2254
+ } else
2255
+ if (source == undoButton)
2256
+ {
2257
+ // Go to previous version
2258
+ //if (!Undo())
2259
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2260
+ Undo();
2261
+ } else
2262
+ if (source == restoreButton)
2263
+ {
2264
+ // Restore current version
2265
+ Restore();
2266
+ } else
2267
+ if (source == replaceButton)
2268
+ {
2269
+ // Overwrite current version
2270
+ Replace();
2271
+ } else
2272
+ if (source == redoButton)
2273
+ {
2274
+ // Go to next version
2275
+ Redo();
2276
+ } else
2277
+ if (source == saveButton)
2278
+ {
2279
+ // Save a new version
2280
+ if (!Save(true))
2281
+ java.awt.Toolkit.getDefaultToolkit().beep();
2282
+ } else
2283
+ if (source == oneStepButton)
2284
+ {
2285
+ Globals.ONESTEP = true;
2286
+ cameraView.repaint();
2287
+ } else
18572288 if (source == screenfitButton)
18582289 {
1859
- //Reload(lastConverter, lastFilename, true);
18602290 ScreenFit();
18612291 } else
18622292 if (source == screenfitpointButton)
18632293 {
1864
- //Reload(lastConverter, lastFilename, true);
18652294 ScreenFitPoint();
18662295 } else
18672296 if (source == snapobjectButton)
18682297 {
1869
- //Reload(lastConverter, lastFilename, true);
18702298 SnapObject();
18712299 } else
18722300 // if (event.getSource() == recompileButton)
....@@ -1903,12 +2331,20 @@
19032331 {
19042332 loadClipboard(true);
19052333 } else
2334
+ if (source == undoItem)
2335
+ {
2336
+ Undo();
2337
+ } else
2338
+ if (source == redoItem)
2339
+ {
2340
+ Redo();
2341
+ } else
19062342 if (source == duplicateItem)
19072343 {
1908
- Object3D keep = GrafreeD.clipboard;
2344
+ Object3D keep = Grafreed.clipboard;
19092345 loadClipboard(false);
19102346 paste(false);
1911
- GrafreeD.clipboard = keep;
2347
+ Grafreed.clipboard = keep;
19122348 } else
19132349 if (source == cloneItem)
19142350 {
....@@ -1926,13 +2362,17 @@
19262362 {
19272363 paste(false);
19282364 } else
2365
+ if (source == pasteIntoItem)
2366
+ {
2367
+ pasteInto(true, false);
2368
+ } else
19292369 if (source == pasteLinkItem)
19302370 {
1931
- pasteInto(false);
2371
+ pasteInto(false, false);
19322372 } else
19332373 if (source == pasteCloneItem)
19342374 {
1935
- pasteInto(true);
2375
+ pasteInto(true, true);
19362376 } else
19372377 if (source == pasteExpandItem)
19382378 {
....@@ -2124,9 +2564,9 @@
21242564 // group.selection.get(0).setMasterThis(content); // should be identity
21252565 // refreshContents();
21262566 // }
2127
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2567
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21282568 {
2129
- Object3D content = GrafreeD.clipboard.get(0);
2569
+ Object3D content = Grafreed.clipboard.get(0);
21302570
21312571 if (content instanceof cGroup && ((cGroup)content).transientlink )
21322572 content = ((cGroup)content).get(0);
....@@ -2134,11 +2574,11 @@
21342574 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352575 for (int i=0; i<group.selection.size(); i++)
21362576 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2577
+ boolean random = CameraPane.SWITCH;
2578
+ CameraPane.SWITCH = false; // parse all random nodes
21392579 group.selection.get(i).linkVerticesThis(content);
21402580 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2581
+ CameraPane.SWITCH = random;
21422582 }
21432583 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442584 refreshContents();
....@@ -2148,20 +2588,20 @@
21482588 {
21492589 for (int i=0; i<group.selection.size(); i++)
21502590 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2591
+ boolean random = CameraPane.SWITCH;
2592
+ CameraPane.SWITCH = false; // parse all random nodes
21532593 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2594
+ CameraPane.SWITCH = random;
21552595 }
21562596
21572597 refreshContents();
21582598 } else
21592599 if (source == relinkverticesItem)
21602600 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2601
+ boolean random = CameraPane.SWITCH;
2602
+ CameraPane.SWITCH = false; // parse all random nodes
21632603 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2604
+ CameraPane.SWITCH = random;
21652605
21662606 refreshContents();
21672607 } else
....@@ -2176,9 +2616,9 @@
21762616 } else
21772617 if (source == setMasterItem)
21782618 {
2179
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2619
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21802620 {
2181
- Object3D content = GrafreeD.clipboard.get(0);
2621
+ Object3D content = Grafreed.clipboard.get(0);
21822622
21832623 if (content instanceof cGroup && ((cGroup)content).transientlink )
21842624 content = ((cGroup)content).get(0);
....@@ -2191,9 +2631,9 @@
21912631 {
21922632 if (group.selection.size() == 1)
21932633 {
2194
- if (GrafreeD.clipboard.size() == 1)
2634
+ if (Grafreed.clipboard.size() == 1)
21952635 {
2196
- Object3D content = GrafreeD.clipboard.get(0);
2636
+ Object3D content = Grafreed.clipboard.get(0);
21972637
21982638 if (content instanceof cGroup && ((cGroup)content).transientlink )
21992639 content = ((cGroup)content).get(0);
....@@ -2210,7 +2650,7 @@
22102650 {
22112651 RevertMeshes();
22122652 } else
2213
- if (source == resetMeshItem)
2653
+ if (source == resetAllItem)
22142654 {
22152655 ResetAll();
22162656 } else
....@@ -2230,9 +2670,9 @@
22302670 {
22312671 ClearSelection(true);
22322672 } else
2233
- if (source == grabItem)
2673
+ if (source == grabItem || source == groupButton)
22342674 {
2235
- group(new cGroup(), true);
2675
+ group(new cGroup(), false); // true);
22362676 } else
22372677 if (source == hideItem)
22382678 {
....@@ -2250,16 +2690,16 @@
22502690 {
22512691 makeSomething(new Camera());
22522692 } else
2253
- if (source == compositeItem)
2693
+ if (source == compositeItem || source == compositeButton)
22542694 {
22552695 group(new Composite());
22562696 } else
2257
- if (source == randomItem)
2697
+ if (source == switchItem || source == switchButton)
22582698 {
22592699 RandomNode random = new RandomNode();
22602700 group(random);
22612701 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2702
+ random.name = random.get(0).name + "Switch";
22632703 } else
22642704 if (source == physicsItem)
22652705 {
....@@ -2356,7 +2796,7 @@
23562796 {
23572797 group(new cLinker());
23582798 } else
2359
- if (source == textureItem)
2799
+ if (source == textureItem || source == textureButton)
23602800 {
23612801 group(new TextureNode());
23622802 } else
....@@ -2376,17 +2816,30 @@
23762816 {
23772817 CastShadow(2);
23782818 } else
2379
- if (source == ungroupItem)
2819
+ if (source == ungroupItem || source == ungroupButton)
23802820 {
2381
- //ungroup();
2821
+ boolean hasRoot = false;
2822
+
23822823 for (int i=0; i<group.selection.size(); i++)
23832824 {
2384
- Ungroup(group.selection.get(i));
2825
+ if (group.selection.get(i) == group)
2826
+ {
2827
+ hasRoot = true;
2828
+ break;
2829
+ }
23852830 }
23862831
2387
- ClearSelection(false);
2388
-
2389
- refreshContents();
2832
+ if (!hasRoot)
2833
+ {
2834
+ for (int i=0; i<group.selection.size(); i++)
2835
+ {
2836
+ Ungroup(group.selection.get(i));
2837
+ }
2838
+
2839
+ ClearSelection(false);
2840
+
2841
+ refreshContents();
2842
+ }
23902843 } else
23912844 if (source == genUVItem)
23922845 {
....@@ -2398,7 +2851,7 @@
23982851 } else
23992852 if (source == genNormalsMESHItem)
24002853 {
2401
- GenNormals(true); // TODO
2854
+ GenNormalsMESH();
24022855 } else
24032856 if (source == genNormalsORGANItem)
24042857 {
....@@ -2463,6 +2916,22 @@
24632916 if (source == unmarkleavesItem)
24642917 {
24652918 MarkLeaves(false);
2919
+ } else
2920
+ if (source == rewindleavesItem)
2921
+ {
2922
+ RewindLeaves(true);
2923
+ } else
2924
+ if (source == unrewindleavesItem)
2925
+ {
2926
+ RewindLeaves(false);
2927
+ } else
2928
+ if (source == randomleavesItem)
2929
+ {
2930
+ RandomLeaves(true);
2931
+ } else
2932
+ if (source == unrandomleavesItem)
2933
+ {
2934
+ RandomLeaves(false);
24662935 } else
24672936 if (source == flipVItem)
24682937 {
....@@ -2548,9 +3017,13 @@
25483017 {
25493018 SmoothMesh();
25503019 } else
2551
- if (source == transformgeometryItem)
3020
+ if (source == transformGeometryItem)
25523021 {
25533022 TransformGeometry();
3023
+ } else
3024
+ if (source == transformChildrenItem)
3025
+ {
3026
+ TransformChildren();
25543027 } else
25553028 if (source == resetTransformItem)
25563029 {
....@@ -2558,7 +3031,11 @@
25583031 } else
25593032 if (source == resetCentroidItem)
25603033 {
2561
- ResetCentroid();
3034
+ ResetCentroid(true);
3035
+ } else
3036
+ if (source == resetCentroidXZItem)
3037
+ {
3038
+ ResetCentroid(false);
25623039 } else
25633040 if (source == resetParentItem)
25643041 {
....@@ -2690,6 +3167,10 @@
26903167 if (source == twoButton)
26913168 {
26923169 radio.layout = twoButton;
3170
+
3171
+ if (CameraPane.FULLSCREEN)
3172
+ fullscreenLayout = radio.layout;
3173
+
26933174 // bug
26943175 //gridPanel.setDividerLocation(1.0);
26953176 //bigPanel.setDividerLocation(0.0);
....@@ -2720,12 +3201,33 @@
27203201 // centralPanel.setVisible(true);
27213202 // XYZPanel.setVisible(false);
27223203 bigThree.ClearUI();
2723
- bigThree.addComponent(centralPanel);
3204
+ bigThree.add(centralPanel);
27243205 bigThree.FlushUI();
3206
+
3207
+ cameraView.requestFocusInWindow();
3208
+
3209
+// refreshContents(true);
3210
+//
3211
+// try
3212
+// {
3213
+// java.awt.Robot bot = new java.awt.Robot();
3214
+// int mask = InputEvent.BUTTON1_MASK;
3215
+// bot.mouseMove(100, 100);
3216
+// bot.mousePress(mask);
3217
+// bot.mouseRelease(mask);
3218
+// }
3219
+// catch (Exception e)
3220
+// {
3221
+//
3222
+// }
3223
+
27253224 } else
27263225 if (source == threeButton)
27273226 {
27283227 radio.layout = threeButton;
3228
+
3229
+ if (CameraPane.FULLSCREEN)
3230
+ fullscreenLayout = radio.layout;
27293231
27303232 // bigThree.remove(scenePanel);
27313233 // bigThree.remove(centralPanel);
....@@ -2755,13 +3257,18 @@
27553257 // centralPanel.setVisible(true);
27563258 // XYZPanel.setVisible(true);
27573259 bigThree.ClearUI();
2758
- bigThree.addComponent(centralPanel);
2759
- bigThree.addComponent(XYZPanel);
3260
+ bigThree.add(centralPanel);
3261
+ bigThree.add(XYZPanel);
27603262 bigThree.FlushUI();
3263
+
3264
+ cameraView.requestFocusInWindow();
27613265 } else
27623266 if (source == fourButton)
27633267 {
27643268 radio.layout = fourButton;
3269
+
3270
+ if (CameraPane.FULLSCREEN)
3271
+ fullscreenLayout = radio.layout;
27653272
27663273 // bigThree.remove(scenePanel);
27673274 // bigThree.remove(centralPanel);
....@@ -2791,12 +3298,17 @@
27913298 // centralPanel.setVisible(false);
27923299 // XYZPanel.setVisible(false);
27933300 bigThree.ClearUI();
2794
- bigThree.addComponent(scenePanel);
3301
+ bigThree.add(scenePanel);
27953302 bigThree.FlushUI();
3303
+
3304
+ cameraView.requestFocusInWindow();
27963305 } else
27973306 if (source == sixButton)
27983307 {
27993308 radio.layout = sixButton;
3309
+
3310
+ if (CameraPane.FULLSCREEN)
3311
+ fullscreenLayout = radio.layout;
28003312
28013313 // bigThree.remove(scenePanel);
28023314 // bigThree.remove(centralPanel);
....@@ -2826,13 +3338,18 @@
28263338 // centralPanel.setVisible(true);
28273339 // XYZPanel.setVisible(false);
28283340 bigThree.ClearUI();
2829
- bigThree.addComponent(scenePanel);
2830
- bigThree.addComponent(centralPanel);
3341
+ bigThree.add(scenePanel);
3342
+ bigThree.add(centralPanel);
28313343 bigThree.FlushUI();
3344
+
3345
+ cameraView.requestFocusInWindow();
28323346 } else
28333347 if (source == sevenButton)
28343348 {
28353349 radio.layout = sevenButton;
3350
+
3351
+ if (CameraPane.FULLSCREEN)
3352
+ fullscreenLayout = radio.layout;
28363353
28373354 // bigThree.remove(scenePanel);
28383355 // bigThree.remove(centralPanel);
....@@ -2862,10 +3379,12 @@
28623379 // centralPanel.setVisible(true);
28633380 // XYZPanel.setVisible(true);
28643381 bigThree.ClearUI();
2865
- bigThree.addComponent(scenePanel);
2866
- bigThree.addComponent(centralPanel);
2867
- bigThree.addComponent(XYZPanel);
3382
+ bigThree.add(scenePanel);
3383
+ bigThree.add(centralPanel);
3384
+ bigThree.add(XYZPanel);
28683385 bigThree.FlushUI();
3386
+
3387
+ cameraView.requestFocusInWindow();
28693388 } else
28703389 if (source == rootButton)
28713390 {
....@@ -2877,6 +3396,7 @@
28773396 EditObject(obj);
28783397 }
28793398
3399
+ cameraView.requestFocusInWindow();
28803400 refreshContents(true);
28813401 } else
28823402 if (source == closeButton)
....@@ -2886,22 +3406,37 @@
28863406 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28873407 {
28883408 ab = (cRadio)e.nextElement();
2889
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3409
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28903410 {
3411
+ // Patch to avoid bug with transparency.
3412
+ if (!ab.hadMaterial)
3413
+ {
3414
+ ab.object.material = null;
3415
+ }
3416
+
28913417 buttonGroup.remove(ab);
28923418 radioPanel.remove(ab);
28933419
2894
- ab.GetObject().editWindow = null;
3420
+ //ab.GetObject().editWindow = null;
3421
+ ab.GetObject().manipWindow = null;
28953422 // ab.GetObject().objectUI = null; // ?????????
28963423
28973424 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28983425 break;
28993426 }
29003427 }
3428
+
3429
+ cameraView.requestFocusInWindow();
29013430 refreshContents(true);
29023431 } else
29033432 if (source == editItem || source == editButton)
29043433 {
3434
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3435
+ {
3436
+ Object3D child = (Object3D)e.nextElement();
3437
+ child.pinned = true;
3438
+ }
3439
+
29053440 EditSelection(false);
29063441 } else
29073442 if (source == uneditButton)
....@@ -2911,12 +3446,13 @@
29113446 Object3D child = (Object3D)e.nextElement();
29123447 if(child.editWindow != null)
29133448 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3449
+ child.pinned = false;
29143450 child.CloseUI();
29153451 listUI.remove(child);
29163452
2917
- child.editWindow = null; // ???????????
3453
+ //child.editWindow = null; // ???????????
29183454 }
2919
- objEditor.ctrlPanel.revalidate();
3455
+ objEditor.ctrlPanel.FlushUI();
29203456 //objEditor.jTree.clearSelection();
29213457 //objEditor.ResetSliders();
29223458 refreshContents(true);
....@@ -2927,6 +3463,7 @@
29273463 //copy.ClearUI();
29283464 for (Object3D obj : listUI)
29293465 {
3466
+ obj.pinned = false;
29303467 obj.CloseUI();
29313468 }
29323469 listUI.clear();
....@@ -2936,7 +3473,7 @@
29363473 {
29373474 assert(copy == group);
29383475
2939
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3476
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29403477
29413478 for (Object3D obj : listUI)
29423479 {
....@@ -2985,6 +3522,9 @@
29853522 }
29863523
29873524 copy = group;
3525
+
3526
+ SetUndoStates();
3527
+
29883528 //Globals.theRenderer.object = group;
29893529 if(!useclient)
29903530 {
....@@ -3000,20 +3540,46 @@
30003540 frontView.object = group;
30013541 sideView.object = group;
30023542 }
3003
- group.editWindow = this;
3543
+
3544
+// fix "+" issue
3545
+ //group.editWindow = this;
3546
+ group.manipWindow = this;
3547
+
30043548 /*
30053549 currentLayout = radio.layout;
30063550 if (currentLayout == null)
30073551 currentLayout = sevenButton;
30083552 */
30093553 radio.layout.doClick();
3554
+
3555
+ ClearUnpinned();
3556
+ Grafreed.Assert(group != null);
3557
+ Grafreed.Assert(group.selection != null);
3558
+ SetPinStates(group.selection.size() > 0);
3559
+ if (group.selection.size() == 1)
3560
+ EditSelection(false);
30103561 keepparent = group.parent;
30113562 // PARENT = NULL or not???
30123563 //group.parent = null; // ROOT
30133564 //group.attributes = -1;
30143565 ResetModel();
3566
+
3567
+ cameraView.requestFocusInWindow();
30153568 refreshContents(true);
3016
- }
3569
+ } else if (event.getSource() == editCameraItem)
3570
+ {
3571
+ cameraView.ProtectCamera();
3572
+ cameraView.repaint();
3573
+ return;
3574
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3575
+ {
3576
+ cameraView.RevertCamera();
3577
+ cameraView.repaint();
3578
+ return;
3579
+ // } else if (event.getSource() == textureButton)
3580
+ // {
3581
+ // return; // true;
3582
+ }
30173583 else
30183584 {
30193585 //return super.action(event, arg);
....@@ -3022,7 +3588,6 @@
30223588 }
30233589
30243590 boolean useclient = false;
3025
- cRadio radio;
30263591
30273592 void ToggleRoot()
30283593 {
....@@ -3074,6 +3639,28 @@
30743639 refreshContents();
30753640 }
30763641
3642
+ void TransformChildren()
3643
+ {
3644
+ Object3D obj;
3645
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3646
+ {
3647
+ obj = (Object3D)e.nextElement();
3648
+ obj.KeepTextureMatrices();
3649
+ obj.TransformChildren();
3650
+ obj.RestoreTextureMatrices();
3651
+
3652
+// if (obj.parent == null)
3653
+// {
3654
+// System.out.println("NULL PARENT!");
3655
+// new Exception().printStackTrace();
3656
+// }
3657
+// else
3658
+// TouchTransform(obj);
3659
+// //obj.parent.Touch();
3660
+ }
3661
+
3662
+ refreshContents();
3663
+ }
30773664
30783665 void ResetTransform()
30793666 {
....@@ -3186,7 +3773,7 @@
31863773 refreshContents();
31873774 }
31883775
3189
- void ResetCentroid()
3776
+ void ResetCentroid(boolean full)
31903777 {
31913778 Object3D obj;
31923779 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3201,12 +3788,16 @@
32013788 LA.matIdentity(Object3D.mat);
32023789 obj.getBounds(minima, maxima, false);
32033790 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3204
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3791
+ if (full)
3792
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32053793 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32063794 obj.TransformMesh(Object3D.mat);
3795
+
32073796 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3208
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3797
+ if (full)
3798
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32093799 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3800
+
32103801 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32113802 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32123803 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3235,7 +3826,8 @@
32353826
32363827 int size = obj.MemorySize();
32373828
3238
- System.err.println((size/1024) + " KB is the size of " + obj);
3829
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3830
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32393831 }
32403832 }
32413833 catch (Exception e)
....@@ -3272,9 +3864,9 @@
32723864 obj = (Object3D)e.nextElement();
32733865
32743866 System.out.println("Object is: " + obj);
3275
- GrafreeD.AnalyzeObject(obj);
3867
+ Grafreed.AnalyzeObject(obj);
32763868 System.out.println("Boundary rep: " + obj.bRep);
3277
- GrafreeD.AnalyzeObject(obj.bRep);
3869
+ Grafreed.AnalyzeObject(obj.bRep);
32783870
32793871 // System.err.println((size/1024) + " KB is the size of " + obj);
32803872 }
....@@ -3316,6 +3908,13 @@
33163908 void GenNormals(boolean crease)
33173909 {
33183910 group.GenNormalsS(crease);
3911
+
3912
+ refreshContents();
3913
+ }
3914
+
3915
+ void GenNormalsMESH()
3916
+ {
3917
+ group.GenNormalsMeshS();
33193918
33203919 refreshContents();
33213920 }
....@@ -3488,8 +4087,8 @@
34884087
34894088 void ParseVertices()
34904089 {
3491
- boolean epsequal = GrafreeD.epsequal;
3492
- GrafreeD.epsequal = true;
4090
+ boolean epsequal = Grafreed.epsequal;
4091
+ Grafreed.epsequal = true;
34934092
34944093 for (int i=0; i<group.selection.size(); i++)
34954094 {
....@@ -3514,7 +4113,7 @@
35144113 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35154114 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35164115
3517
- g.add(GrafreeD.clipboard);
4116
+ g.add(Grafreed.clipboard);
35184117
35194118 buffer.add(g);
35204119 }
....@@ -3529,7 +4128,7 @@
35294128 makeSomething(buffer, i==group.selection.size()-1);
35304129 }
35314130
3532
- GrafreeD.epsequal = epsequal;
4131
+ Grafreed.epsequal = epsequal;
35334132
35344133 refreshContents();
35354134 }
....@@ -3547,7 +4146,16 @@
35474146 String pigment = Object3D.GetPigment(tex);
35484147 //String bump = Object3D.GetBump(tex);
35494148
3550
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4149
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4150
+
4151
+ try
4152
+ {
4153
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4154
+ }
4155
+ catch (Exception e)
4156
+ {
4157
+ System.err.println("FAIL: " + node);
4158
+ }
35514159
35524160 double s = v.s;
35534161
....@@ -3635,11 +4243,11 @@
36354243
36364244 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36374245
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
4246
+ boolean random = CameraPane.SWITCH;
4247
+ CameraPane.SWITCH = false; // parse all random nodes
36404248 lowres.linkVerticesThis(null);
36414249 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
4250
+ CameraPane.SWITCH = random;
36434251
36444252 System.err.flush();
36454253
....@@ -3679,7 +4287,7 @@
36794287 return;
36804288
36814289 Object3D poses = group.selection.get(0);
3682
- Object3D ref = GrafreeD.clipboard.get(0);
4290
+ Object3D ref = Grafreed.clipboard.get(0);
36834291
36844292 Object3D newgroup = new Object3D("Po:" + poses.name);
36854293
....@@ -3873,9 +4481,9 @@
38734481
38744482 void ClipMesh()
38754483 {
3876
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4484
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38774485 {
3878
- Object3D content = GrafreeD.clipboard.get(0);
4486
+ Object3D content = Grafreed.clipboard.get(0);
38794487
38804488 if (content instanceof cGroup && ((cGroup)content).transientlink )
38814489 content = ((cGroup)content).get(0);
....@@ -3884,7 +4492,7 @@
38844492 // {
38854493 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38864494 // }
3887
- group.selection.ClipMesh(GrafreeD.clipboard);
4495
+ group.selection.ClipMesh(Grafreed.clipboard);
38884496 }
38894497 // group.selection.ClipMesh(GrafreeD.clipboard);
38904498 System.out.println("DONE.");
....@@ -3931,6 +4539,18 @@
39314539 void MarkLeaves(boolean hide)
39324540 {
39334541 group.selection.MarkLeaves(hide);
4542
+ refreshContents();
4543
+ }
4544
+
4545
+ void RewindLeaves(boolean hide)
4546
+ {
4547
+ group.selection.RewindLeaves(hide);
4548
+ refreshContents();
4549
+ }
4550
+
4551
+ void RandomLeaves(boolean hide)
4552
+ {
4553
+ group.selection.RandomLeaves(hide);
39344554 refreshContents();
39354555 }
39364556
....@@ -4005,10 +4625,6 @@
40054625 // }
40064626 // }
40074627
4008
- static boolean allparams = true;
4009
-
4010
- static Vector<Object3D> listUI = new Vector<Object3D>();
4011
-
40124628 void EditSelection(boolean newWindow)
40134629 {
40144630 // aConstraints.gridy = 0;
....@@ -4016,10 +4632,10 @@
40164632 {
40174633 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40184634 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4019
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4635
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40204636
40214637 Object3D elem = (Object3D)group.selection.elementAt(i);
4022
- if(elem != group)
4638
+ if(elem != group || !newWindow)
40234639 {
40244640 // if (!(elem instanceof Composite))
40254641 // newWindow = false;
....@@ -4101,7 +4717,8 @@
41014717 //new Exception().printStackTrace();
41024718
41034719 freezemodel = true;
4104
-
4720
+ ClearUnpinned();
4721
+
41054722 /**/
41064723 //switch (event.id)
41074724 {
....@@ -4109,7 +4726,6 @@
41094726 //case 702: // Event.LIST_DESELECT
41104727 group.deselectAll();
41114728 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4112
- objEditor.ClearInfo(); // .GetMaterial());
41134729 if (tps != null)
41144730 {
41154731 for (int i=0; i < tps.length; i++)
....@@ -4118,33 +4734,39 @@
41184734
41194735 //if (child.parent != null)
41204736 //child.parent.addSelectee(child);
4737
+ objEditor.SetMaterial(child);
41214738 group.addSelectee(child);
4122
- objEditor.SetMaterial(child); // .GetMaterial());
4123
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4124
- System.err.println("info : " + child.GetPath());
41254739 }
41264740 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4741
+// else
4742
+// {
4743
+// objEditor.SetMaterial(group); // .GetMaterial());
4744
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4745
+// System.err.println("info : " + group.GetPath());
4746
+// }
41334747
4134
- objEditor.SetText(); // jan 2014
4135
-
4136
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4748
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41374749 CameraPane.flash = true;
41384750
4139
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4751
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41404752 // a camera
41414753 {
4142
- CameraPane.camerachangeframe = 0; // don't refuse it
4143
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4754
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4755
+ {
4756
+ CameraPane.camerachangeframe = 0; // don't refuse it
4757
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4758
+ }
41444759 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41454760 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41464761 }
41474762
4763
+ if (tps != null && tps.length == 1)
4764
+ {
4765
+ EditSelection(false);
4766
+ }
4767
+
4768
+ SetPinStates(tps != null && tps.length > 0);
4769
+
41484770 refreshContents();
41494771 //return true;
41504772 }
....@@ -4153,6 +4775,35 @@
41534775
41544776 freezemodel = false;
41554777 }
4778
+
4779
+ void SetPinStates(boolean enabled)
4780
+ {
4781
+ editButton.setEnabled(enabled);
4782
+ uneditButton.setEnabled(enabled);
4783
+ unselectButton.setEnabled(enabled);
4784
+ flashSelectionButton.setEnabled(enabled);
4785
+ }
4786
+
4787
+ void refreshContents(boolean cp)
4788
+ {
4789
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4790
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4791
+ {
4792
+ objEditor.ClearInfo(); // .GetMaterial());
4793
+
4794
+ for (int i=0; i < group.selection.Size(); i++)
4795
+ {
4796
+ Object3D child = (Object3D) group.selection.get(i);
4797
+
4798
+ objEditor.AddInfo(child, this, true);
4799
+ System.err.println("info : " + child.GetPath());
4800
+ }
4801
+
4802
+ objEditor.SetText(); // jan 2014
4803
+ }
4804
+
4805
+ super.refreshContents(cp);
4806
+ }
41564807
41574808 void linkSomething(Object3D thing)
41584809 {
....@@ -4224,16 +4875,19 @@
42244875 {
42254876 if (group.selection.isEmpty())
42264877 return;
4227
- GrafreeD.clipboardIsTempGroup = false;
4878
+
4879
+ Grafreed.clipboardIsTempGroup = false;
42284880 Composite tGroup = null;
42294881 if (group.selection.size() > 0) // 1)
42304882 {
42314883 tGroup = new cGroup();
4232
- GrafreeD.clipboardIsTempGroup = true;
4884
+ Grafreed.clipboardIsTempGroup = true;
42334885 }
42344886
42354887 if (cut)
42364888 {
4889
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4890
+// Save();
42374891 //int indices[] = jList.getSelectedIndices();
42384892 //for (int i = indices.length - 1; i >= 0; i--)
42394893 //jList.remove(indices[i]);
....@@ -4269,16 +4923,16 @@
42694923 //System.out.println("cut " + child);
42704924 //System.out.println("parent = " + child.parent);
42714925 // tmp.addChild(child);
4272
- if (GrafreeD.clipboardIsTempGroup)
4926
+ if (Grafreed.clipboardIsTempGroup)
42734927 tGroup.add/*Child*/(tmp);
42744928 else
4275
- GrafreeD.clipboard = tmp;
4929
+ Grafreed.clipboard = tmp;
42764930 }
42774931 else
4278
- if (GrafreeD.clipboardIsTempGroup)
4932
+ if (Grafreed.clipboardIsTempGroup)
42794933 tGroup.add/*Child*/(child);
42804934 else
4281
- GrafreeD.clipboard = child;
4935
+ Grafreed.clipboard = child;
42824936 }
42834937
42844938 //ResetModel();
....@@ -4310,21 +4964,23 @@
43104964 //System.out.println("cut " + elem);
43114965 //System.out.println("parent = " + elem.parent);
43124966 // tmp.addChild(elem);
4313
- if (GrafreeD.clipboardIsTempGroup)
4967
+ if (Grafreed.clipboardIsTempGroup)
43144968 tGroup.add/*Child*/(tmp);
43154969 else
4316
- GrafreeD.clipboard = tmp;
4970
+ Grafreed.clipboard = tmp;
43174971 }
43184972 else
4319
- if (GrafreeD.clipboardIsTempGroup)
4973
+ if (Grafreed.clipboardIsTempGroup)
43204974 tGroup.add/*Child*/(child);
43214975 else
4322
- GrafreeD.clipboard = child;
4976
+ Grafreed.clipboard = child;
43234977 }
43244978
43254979 }
4326
- if (GrafreeD.clipboardIsTempGroup)
4327
- GrafreeD.clipboard = tGroup;
4980
+
4981
+ if (Grafreed.clipboardIsTempGroup)
4982
+ Grafreed.clipboard = tGroup;
4983
+
43284984 if (cut)
43294985 {
43304986 ResetModel();
....@@ -4334,11 +4990,15 @@
43344990
43354991 void paste(boolean expand)
43364992 {
4993
+ if (Globals.REPLACEONMAKE)
4994
+ Save();
4995
+ boolean keep = Globals.REPLACEONMAKE;
4996
+ Globals.REPLACEONMAKE = false;
43374997 // if (GrafreeD.clipboard == null)
43384998 // return;
43394999 boolean first = true;
43405000
4341
- if (GrafreeD.clipboardIsTempGroup)
5001
+ if (Grafreed.clipboardIsTempGroup)
43425002 {
43435003 Composite temp;
43445004
....@@ -4349,7 +5009,7 @@
43495009 temp = (Composite)Applet3D.clipboard.deepCopy();
43505010 */
43515011 Object3D elem;
4352
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5012
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43535013 {
43545014 Object3D child = (Object3D)e.nextElement();
43555015
....@@ -4383,21 +5043,22 @@
43835043 //Object3D cb = Applet3D.clipboard;
43845044 //temp.addChild(cb);
43855045 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4386
- assert(GrafreeD.clipboard.parent == null);
4387
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4388
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4389
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4390
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5046
+ assert(Grafreed.clipboard.parent == null);
5047
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5048
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5049
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5050
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43915051 else
4392
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4393
- GrafreeD.clipboard.get(0).parent = keepparent;
5052
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5053
+ Grafreed.clipboard.get(0).parent = keepparent;
43945054 }
43955055
5056
+ Globals.REPLACEONMAKE = keep;
43965057 ResetModel();
43975058 refreshContents();
43985059 }
43995060
4400
- void pasteInto(boolean copyit)
5061
+ void pasteInto(boolean copyit, boolean clone)
44015062 {
44025063 // if (GrafreeD.clipboard == null)
44035064 // return;
....@@ -4426,15 +5087,22 @@
44265087 if (copyit)
44275088 {
44285089 // paste(false);
4429
- CloneClipboard(false); // sept 2014
5090
+ if (clone)
5091
+ {
5092
+ CloneClipboard(false); // sept 2014
5093
+ }
5094
+ else
5095
+ {
5096
+ paste(false);
5097
+ }
44305098 }
44315099 else
44325100 {
44335101 boolean first = true;
44345102
4435
- if (GrafreeD.clipboardIsTempGroup)
5103
+ if (Grafreed.clipboardIsTempGroup)
44365104 {
4437
- Composite temp = (Composite)GrafreeD.clipboard;
5105
+ Composite temp = (Composite)Grafreed.clipboard;
44385106 Object3D copy;
44395107 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44405108 {
....@@ -4444,7 +5112,7 @@
44445112 }
44455113 } else
44465114 {
4447
- linkSomething(GrafreeD.clipboard); //.get(0));
5115
+ linkSomething(Grafreed.clipboard); //.get(0));
44485116 }
44495117 }
44505118 }
....@@ -4521,6 +5189,10 @@
45215189
45225190 void group(Object3D csg, boolean grab)
45235191 {
5192
+ if (Globals.REPLACEONMAKE)
5193
+ Save();
5194
+ boolean keep = Globals.REPLACEONMAKE;
5195
+ Globals.REPLACEONMAKE = false;
45245196 if (//false) // why??
45255197 !group.selection.isEmpty())
45265198 {
....@@ -4634,10 +5306,15 @@
46345306 //node.add(csg);
46355307 //makeSomething(node);
46365308 makeSomething(csg);
5309
+ Globals.REPLACEONMAKE = keep;
46375310 }
46385311
46395312 void Ungroup(Object3D g)
46405313 {
5314
+ if (Globals.REPLACEONMAKE)
5315
+ Save();
5316
+ boolean keep = Globals.REPLACEONMAKE;
5317
+ Globals.REPLACEONMAKE = false;
46415318 if (g instanceof HiddenObject)
46425319 {
46435320 HiddenObject h = (HiddenObject) g;
....@@ -4654,6 +5331,7 @@
46545331 objEditor.makeSomething(g.get(i), false);
46555332 }
46565333 }
5334
+ Globals.REPLACEONMAKE = keep;
46575335 }
46585336
46595337 void ungroup()
....@@ -4849,21 +5527,6 @@
48495527 }
48505528 */
48515529
4852
- void ImportGFD()
4853
- {
4854
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4855
- browser.show();
4856
- String filename = browser.getFile();
4857
- if (filename != null && filename.length() > 0)
4858
- {
4859
- String fullname = browser.getDirectory() + filename;
4860
-
4861
- //Object3D readobj =
4862
- objEditor.ReadGFD(fullname, objEditor);
4863
- //makeSomething(readobj);
4864
- }
4865
- }
4866
-
48675530 /*
48685531 public void Callback(Object obj)
48695532 {
....@@ -4887,26 +5550,9 @@
48875550 }
48885551 */
48895552
4890
- void ImportVRMLX3D()
4891
- {
4892
- if (GrafreeD.standAlone)
4893
- {
4894
- /**/
4895
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4896
- browser.show();
4897
- String filename = browser.getFile();
4898
- if (filename != null && filename.length() > 0)
4899
- {
4900
- String fullname = browser.getDirectory() + filename;
4901
- LoadVRMLX3D(fullname);
4902
- }
4903
- /**/
4904
- }
4905
- }
4906
-
49075553 String GetFile(String dialogName)
49085554 {
4909
- if (GrafreeD.standAlone)
5555
+ if (Grafreed.standAlone)
49105556 {
49115557 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49125558 browser.show();
....@@ -4970,10 +5616,33 @@
49705616 cButton flashSelectionButton;
49715617 cButton editButton;
49725618 cButton uneditButton;
5619
+ JCheckBox allParamsButton;
49735620 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755621 cButton unselectButton;
49765622
5623
+ cButton restoreCameraButton;
5624
+
5625
+ cButton saveButton;
5626
+ cButton oneStepButton;
5627
+
5628
+ cButton groupButton;
5629
+ cButton ungroupButton;
5630
+ cButton compositeButton;
5631
+ cButton switchButton;
5632
+ cButton loopButton;
5633
+ cButton textureButton;
5634
+
5635
+ cButton gridButton;
5636
+ cButton boxButton;
5637
+ cButton sphereButton;
5638
+ cButton coneButton;
5639
+ cButton torusButton;
5640
+ cButton superButton;
5641
+ cButton kleinButton;
5642
+ cButton particlesButton;
5643
+ cButton overlayButton;
5644
+ cButton lightButton;
5645
+
49775646 cButton screenfitButton;
49785647 cButton screenfitpointButton;
49795648 cButton snapobjectButton;
....@@ -4985,14 +5654,6 @@
49855654
49865655 cButton setsupportButton;
49875656
4988
- cButton twoButton;
4989
- cButton sixButton;
4990
- cButton threeButton;
4991
- cButton sevenButton;
4992
- cButton fourButton; // full panel
4993
- cButton oneButton; // full XYZ
4994
- //cButton currentLayout;
4995
-
49965657 //
49975658 //Composite
49985659 Object3D // to do !!
....@@ -5002,9 +5663,11 @@
50025663 //JTree jTree;
50035664 private MenuItem lookAtItem;
50045665 private MenuItem lookFromItem;
5005
- private MenuItem switchItem;
5666
+ private MenuItem switchViewItem;
50065667 private MenuItem cutItem;
5007
- private MenuItem duplicateItem;
5668
+ private MenuItem undoItem;
5669
+ private MenuItem redoItem;
5670
+ private JMenuItem duplicateItem;
50085671 private MenuItem cloneItem;
50095672 private MenuItem cloneSupportItem;
50105673 private MenuItem overwriteGeoItem;
....@@ -5017,7 +5680,7 @@
50175680 private MenuItem linkverticesItem;
50185681 private MenuItem relinkverticesItem;
50195682 private MenuItem setMasterItem;
5020
- private MenuItem resetMeshItem;
5683
+ private MenuItem resetAllItem;
50215684 private MenuItem stepAllItem;
50225685 private MenuItem revertMeshItem;
50235686 private MenuItem poseMeshItem;
....@@ -5028,6 +5691,7 @@
50285691 private MenuItem mergeGeometriesItem;
50295692 private MenuItem copyItem;
50305693 private MenuItem pasteItem;
5694
+ private MenuItem pasteIntoItem;
50315695 private MenuItem pasteLinkItem;
50325696 private MenuItem pasteCloneItem;
50335697 private MenuItem pasteExpandItem;
....@@ -5066,6 +5730,10 @@
50665730 private MenuItem showleavesItem;
50675731 private MenuItem markleavesItem;
50685732 private MenuItem unmarkleavesItem;
5733
+ private MenuItem rewindleavesItem;
5734
+ private MenuItem unrewindleavesItem;
5735
+ private MenuItem randomleavesItem;
5736
+ private MenuItem unrandomleavesItem;
50695737
50705738 private MenuItem flipVItem;
50715739 private MenuItem unflipVItem;
....@@ -5077,15 +5745,17 @@
50775745 private MenuItem panoTexturesItem;
50785746
50795747 private MenuItem resetCentroidItem;
5080
- private MenuItem transformgeometryItem;
5748
+ private MenuItem resetCentroidXZItem;
50815749 private MenuItem resetTransformItem;
5750
+ private MenuItem transformGeometryItem;
5751
+ private MenuItem transformChildrenItem;
50825752 private MenuItem hideItem;
50835753 private MenuItem grabItem;
50845754 private MenuItem backItem;
50855755 private MenuItem frontItem;
50865756 private MenuItem cameraItem;
50875757 private MenuItem compositeItem;
5088
- private MenuItem randomItem;
5758
+ private MenuItem switchItem;
50895759 private MenuItem physicsItem;
50905760 private MenuItem frameselectorItem;
50915761 private MenuItem scriptNodeItem;
....@@ -5125,7 +5795,7 @@
51255795 private MenuItem blobItem;
51265796 private MenuItem latheItem;
51275797 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5798
+ private MenuItem overlayItem;
51295799 private MenuItem meshItem;
51305800 // private MenuItem meshGroupItem;
51315801 private MenuItem springItem;
....@@ -5147,11 +5817,6 @@
51475817 private MenuItem doubleItem;
51485818 private MenuItem tripleItem;
51495819
5150
- private MenuItem importGFDItem;
5151
- private MenuItem importVRMLX3DItem;
5152
- private MenuItem import3DSItem;
5153
- private MenuItem importOBJItem;
5154
-
51555820 private MenuItem computeAOItem;
51565821 private MenuItem recompileItem;
51575822 private MenuItem editScriptItem;
....@@ -5161,4 +5826,8 @@
51615826 private MenuItem analyzeItem;
51625827 private MenuItem dumpItem;
51635828 //boolean freezemodel = false;
5829
+
5830
+ Menu cameraMenu;
5831
+ MenuItem editCameraItem;
5832
+ MenuItem restoreCameraItem;
51645833 }