Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -148,29 +148,28 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
- if (Globals.ADVANCED)
154
- {
155
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
156
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
157
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
158
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
159
- oe.cameraMenu.add("-");
160
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
161
- openWindowItem.addActionListener(this);
162
- editLeafItem.addActionListener(this);
163
- lookAtItem.addActionListener(this);
164
- //lookFromItem.addActinoListener(this);
165
- //switchItem.addActionListener(this);
166
- }
167
-
168153 Menu menu;
169154 oe.menuBar.add(menu = new Menu("Edit"));
170155 //editItem = menu.add(new MenuItem("Edit"));
171156 //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
172163 duplicateItem = menu.add(new MenuItem("Duplicate"));
173164 duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
174173 cutItem = menu.add(new MenuItem("Cut"));
175174 cutItem.addActionListener(this);
176175 copyItem = menu.add(new MenuItem("Copy"));
....@@ -178,10 +177,7 @@
178177 pasteItem = menu.add(new MenuItem("Paste"));
179178 pasteItem.addActionListener(this);
180179 menu.add("-");
181
- cloneItem = menu.add(new MenuItem("Clone"));
182
- cloneItem.addActionListener(this);
183
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
- cloneSupportItem.addActionListener(this);
180
+
185181 menu.add("-");
186182 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187183 pasteIntoItem.addActionListener(this);
....@@ -201,14 +197,97 @@
201197 clearAllItem = menu.add(new MenuItem("Clear All"));
202198 clearAllItem.addActionListener(this);
203199 }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
204236
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
275
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
276
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
277
+ //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
278
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
279
+ oe.cameraMenu.add("-");
280
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
281
+ openWindowItem.addActionListener(this);
282
+ editLeafItem.addActionListener(this);
283
+ lookAtItem.addActionListener(this);
284
+ //lookFromItem.addActinoListener(this);
285
+ //switchItem.addActionListener(this);
286
+ }
287
+
205288 oe.menuBar.add(menu = new Menu("Setting"));
206289 if (Globals.ADVANCED)
207290 {
208
- resetMeshItem = menu.add(new MenuItem("Reset All"));
209
- resetMeshItem.addActionListener(this);
210
- stepAllItem = menu.add(new MenuItem("Step All"));
211
- stepAllItem.addActionListener(this);
212291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
213292 revertMeshItem.addActionListener(this);
214293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -272,6 +351,7 @@
272351
273352 if (Globals.ADVANCED)
274353 {
354
+ menu.add("-");
275355 physicsItem = menu.add(new MenuItem("Physics"));
276356 physicsItem.addActionListener(this);
277357 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
....@@ -297,6 +377,7 @@
297377 shadowZItem.addActionListener(this);
298378 if (Globals.ADVANCED)
299379 {
380
+ menu.add("-");
300381 linkerItem = menu.add(new MenuItem("Linker"));
301382 linkerItem.addActionListener(this);
302383 attributeItem = menu.add(new MenuItem("Attribute"));
....@@ -305,14 +386,18 @@
305386 templateItem.addActionListener(this);
306387 pointflowItem = menu.add(new MenuItem("Point Flow"));
307388 pointflowItem.addActionListener(this);
308
- menu.add("-");
309389 }
390
+ menu.add("-");
310391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311392 resetTransformItem.addActionListener(this);
312393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
313394 resetCentroidItem.addActionListener(this);
314
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
316401
317402 oe.menuBar.add(menu = new Menu("Geometry"));
318403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -361,6 +446,10 @@
361446 oe.menuBar.add(menu = new Menu("Attributes"));
362447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
363448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
364453 menu.add("-");
365454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
366455 liveleavesItem.addActionListener(this);
....@@ -381,6 +470,14 @@
381470 markleavesItem.addActionListener(this);
382471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
383472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
384481 menu.add("-");
385482 flipVItem = menu.add(new MenuItem("Flip V"));
386483 flipVItem.addActionListener(this);
....@@ -415,32 +512,23 @@
415512 sortbysizeItem.addActionListener(this);
416513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
417514 sortbynameItem.addActionListener(this);
515
+ menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
418520 if (Globals.ADVANCED)
419521 {
420
- menu.add("-");
522
+ // Pretty much the same as duplicate and clone.
421523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422524 extractGeometriesItem.addActionListener(this);
423525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424526 cloneGeometriesItem.addActionListener(this);
425
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
426
- shareGeometriesItem.addActionListener(this);
427
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
428
- mergeGeometriesItem.addActionListener(this);
429527 }
430528
431529 oe.menuBar.add(menu = new Menu("Insert"));
432530 buildCreateMenu(menu);
433531
434
- oe.menuBar.add(menu = new Menu("Include"));
435
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
- importGFDItem.addActionListener(this);
437
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
- importVRMLX3DItem.addActionListener(this);
439
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
440
- importOBJItem.addActionListener(this);
441
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
442
- import3DSItem.addActionListener(this);
443
-
444532 oe.menuBar.add(menu = new Menu("Tools"));
445533 buildToolsMenu(menu);
446534 }
....@@ -477,11 +565,23 @@
477565 */
478566 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
479567
568
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ undoButton.setToolTipText("Undo changes");
570
+ undoButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ redoButton.setToolTipText("Redo changes");
574
+ redoButton.addActionListener(this);
575
+
576
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ saveButton.setToolTipText("Save changes");
578
+ saveButton.addActionListener(this);
579
+
480580 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
- liveCB.setToolTipText("Enabled animation");
581
+ liveCB.setToolTipText("Enable animation");
482582 liveCB.addItemListener(this);
483583
484
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
584
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485585 oneStepButton.setToolTipText("Animate one step forward");
486586 oneStepButton.addActionListener(this);
487587
....@@ -493,7 +593,7 @@
493593 trackCB.setToolTipText("Enable tracking");
494594 trackCB.addItemListener(this);
495595
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
497597 screenfitButton.setToolTipText("Screen fit");
498598 screenfitButton.addActionListener(this);
499599
....@@ -502,39 +602,39 @@
502602
503603 if (Globals.ADVANCED)
504604 {
505
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
605
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
506606 snapobjectButton.addActionListener(this);
507607 snapobjectButton.setToolTipText("Snap Object");
508608 }
509609
510
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
610
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
511611 flashSelectionButton.setToolTipText("Show selection");
512612 flashSelectionButton.addActionListener(this);
513613
514614 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515615
516
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517617 twoButton.setToolTipText("Show center view only");
518618 twoButton.addActionListener(this);
519
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520620 fourButton.addActionListener(this);
521621 fourButton.setToolTipText("Show left panel only");
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
622
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523623 sixButton.setToolTipText("2-column layout left");
524624 sixButton.addActionListener(this);
525
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526626 threeButton.setToolTipText("2-column layout right");
527627 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
529629 sevenButton.setToolTipText("3-column layout");
530630 sevenButton.addActionListener(this);
531631 //
532632
533
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
633
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534634 rootButton.setToolTipText("Edit selection in new tab");
535635 rootButton.addActionListener(this);
536636
537
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
637
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538638 closeButton.setToolTipText("Close tab");
539639 closeButton.addActionListener(this);
540640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -542,11 +642,11 @@
542642
543643 cGridBag commandsPanel = new cGridBag();
544644
545
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
645
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
546646 editButton.setToolTipText("Edit selection");
547647 editButton.addActionListener(this);
548648
549
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
550650 uneditButton.setToolTipText("Unedit selection");
551651 uneditButton.addActionListener(this);
552652
....@@ -554,11 +654,11 @@
554654 allParamsButton.setToolTipText("Edit all params");
555655 allParamsButton.addActionListener(this);
556656
557
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
657
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
558658 clearPanelButton.setToolTipText("Clear edit panel");
559659 clearPanelButton.addActionListener(this);
560660
561
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
562662 unselectButton.setToolTipText("Unselect");
563663 unselectButton.addActionListener(this);
564664
....@@ -641,7 +741,7 @@
641741 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642742 zoomBoxCB.addItemListener(this);
643743
644
- if (Globals.ADVANCED)
744
+ if (true) // Globals.ADVANCED)
645745 {
646746 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647747 supportCB.setToolTipText("Enable rigging");
....@@ -714,6 +814,7 @@
714814 buttonGroup.add(radioButton);
715815 radioButton.doClick();
716816 }
817
+
717818 void SetupViews(ObjEditor oe)
718819 {
719820 oe.SetupViews();
....@@ -778,6 +879,7 @@
778879 } else if(e.getSource() == liveCB)
779880 {
780881 cameraView.ToggleLive();
882
+ refreshContents(false);
781883 }
782884 else if(e.getSource() == supportCB)
783885 {
....@@ -930,7 +1032,9 @@
9301032 // objEditor.DropFile((java.io.File[]) object, true);
9311033 // return;
9321034 // }
933
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9341038 {
9351039 // file(s)
9361040 String[] names = string.split("\n");
....@@ -957,7 +1061,7 @@
9571061
9581062 flashIt = false;
9591063 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9611065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9621066
9631067 if (group.selection.size() == 1)
....@@ -1164,13 +1268,13 @@
11641268 parseverticesItem.addActionListener(this);
11651269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661270 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681272 alignItem.addActionListener(this);
11691273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701274 reduceMorphItem.addActionListener(this);
11711275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721276 reduce34MorphItem.addActionListener(this);
1173
-
1277
+ menu.add("-");
11741278 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751279 computeAOItem.addActionListener(this);
11761280
....@@ -1183,7 +1287,7 @@
11831287 memoryItem.addActionListener(this);
11841288 menu.add(analyzeItem = new MenuItem("Analyze"));
11851289 analyzeItem.addActionListener(this);
1186
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11871291 dumpItem.addActionListener(this);
11881292 // menu.add(pathItem = new MenuItem("From-to path"));
11891293 // pathItem.addActionListener(this);
....@@ -1530,9 +1634,9 @@
15301634
15311635 void Overwrite(int mask)
15321636 {
1533
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15341638 {
1535
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
15361640
15371641 if (content instanceof cGroup && ((cGroup)content).transientlink )
15381642 content = ((cGroup)content).get(0);
....@@ -1837,23 +1941,6 @@
18371941 csg.addChild(child);
18381942 child.addChild(csg);
18391943 } else
1840
-
1841
- if (source == importGFDItem)
1842
- {
1843
- ImportGFD();
1844
- } else
1845
- if (source == importVRMLX3DItem)
1846
- {
1847
- ImportVRMLX3D();
1848
- } else
1849
- if (source == import3DSItem)
1850
- {
1851
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1852
- } else
1853
- if (source == importOBJItem)
1854
- {
1855
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1856
- } else
18571944 if (source == computeAOItem)
18581945 {
18591946 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1872,7 +1959,7 @@
18721959 if (source == invariantsItem)
18731960 {
18741961 System.out.println("Invariants:");
1875
- GrafreeD.grafreeD.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
18761963 } else
18771964 if (source == memoryItem)
18781965 {
....@@ -1890,6 +1977,18 @@
18901977 if (source == dumpItem)
18911978 {
18921979 DumpObject();
1980
+ } else
1981
+ if (source == undoButton)
1982
+ {
1983
+ Undo();
1984
+ } else
1985
+ if (source == redoButton)
1986
+ {
1987
+ Redo();
1988
+ } else
1989
+ if (source == saveButton)
1990
+ {
1991
+ Save();
18931992 } else
18941993 if (source == oneStepButton)
18951994 {
....@@ -1945,12 +2044,20 @@
19452044 {
19462045 loadClipboard(true);
19472046 } else
2047
+ if (source == undoItem)
2048
+ {
2049
+ Undo();
2050
+ } else
2051
+ if (source == redoItem)
2052
+ {
2053
+ Redo();
2054
+ } else
19482055 if (source == duplicateItem)
19492056 {
1950
- Object3D keep = GrafreeD.clipboard;
2057
+ Object3D keep = Grafreed.clipboard;
19512058 loadClipboard(false);
19522059 paste(false);
1953
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
19542061 } else
19552062 if (source == cloneItem)
19562063 {
....@@ -2170,9 +2277,9 @@
21702277 // group.selection.get(0).setMasterThis(content); // should be identity
21712278 // refreshContents();
21722279 // }
2173
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21742281 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
21762283
21772284 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782285 content = ((cGroup)content).get(0);
....@@ -2222,9 +2329,9 @@
22222329 } else
22232330 if (source == setMasterItem)
22242331 {
2225
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22262333 {
2227
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
22282335
22292336 if (content instanceof cGroup && ((cGroup)content).transientlink )
22302337 content = ((cGroup)content).get(0);
....@@ -2237,9 +2344,9 @@
22372344 {
22382345 if (group.selection.size() == 1)
22392346 {
2240
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
22412348 {
2242
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
22432350
22442351 if (content instanceof cGroup && ((cGroup)content).transientlink )
22452352 content = ((cGroup)content).get(0);
....@@ -2256,7 +2363,7 @@
22562363 {
22572364 RevertMeshes();
22582365 } else
2259
- if (source == resetMeshItem)
2366
+ if (source == resetAllItem)
22602367 {
22612368 ResetAll();
22622369 } else
....@@ -2444,7 +2551,7 @@
24442551 } else
24452552 if (source == genNormalsMESHItem)
24462553 {
2447
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
24482555 } else
24492556 if (source == genNormalsORGANItem)
24502557 {
....@@ -2509,6 +2616,22 @@
25092616 if (source == unmarkleavesItem)
25102617 {
25112618 MarkLeaves(false);
2619
+ } else
2620
+ if (source == rewindleavesItem)
2621
+ {
2622
+ RewindLeaves(true);
2623
+ } else
2624
+ if (source == unrewindleavesItem)
2625
+ {
2626
+ RewindLeaves(false);
2627
+ } else
2628
+ if (source == randomleavesItem)
2629
+ {
2630
+ RandomLeaves(true);
2631
+ } else
2632
+ if (source == unrandomleavesItem)
2633
+ {
2634
+ RandomLeaves(false);
25122635 } else
25132636 if (source == flipVItem)
25142637 {
....@@ -2594,9 +2717,13 @@
25942717 {
25952718 SmoothMesh();
25962719 } else
2597
- if (source == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
25982721 {
25992722 TransformGeometry();
2723
+ } else
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
26002727 } else
26012728 if (source == resetTransformItem)
26022729 {
....@@ -2604,7 +2731,11 @@
26042731 } else
26052732 if (source == resetCentroidItem)
26062733 {
2607
- ResetCentroid();
2734
+ ResetCentroid(true);
2735
+ } else
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
26082739 } else
26092740 if (source == resetParentItem)
26102741 {
....@@ -2960,7 +3091,7 @@
29603091 child.CloseUI();
29613092 listUI.remove(child);
29623093
2963
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
29643095 }
29653096 objEditor.ctrlPanel.FlushUI();
29663097 //objEditor.jTree.clearSelection();
....@@ -3046,7 +3177,10 @@
30463177 frontView.object = group;
30473178 sideView.object = group;
30483179 }
3180
+
3181
+// fix "+" issue
30493182 group.editWindow = this;
3183
+
30503184 /*
30513185 currentLayout = radio.layout;
30523186 if (currentLayout == null)
....@@ -3059,7 +3193,20 @@
30593193 //group.attributes = -1;
30603194 ResetModel();
30613195 refreshContents(true);
3062
- }
3196
+ } else if (event.getSource() == editCameraItem)
3197
+ {
3198
+ cameraView.ProtectCamera();
3199
+ cameraView.repaint();
3200
+ return;
3201
+ } else if (event.getSource() == revertCameraItem)
3202
+ {
3203
+ cameraView.RevertCamera();
3204
+ cameraView.repaint();
3205
+ return;
3206
+ // } else if (event.getSource() == textureButton)
3207
+ // {
3208
+ // return; // true;
3209
+ }
30633210 else
30643211 {
30653212 //return super.action(event, arg);
....@@ -3120,6 +3267,28 @@
31203267 refreshContents();
31213268 }
31223269
3270
+ void TransformChildren()
3271
+ {
3272
+ Object3D obj;
3273
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3274
+ {
3275
+ obj = (Object3D)e.nextElement();
3276
+ obj.KeepTextureMatrices();
3277
+ obj.TransformChildren();
3278
+ obj.RestoreTextureMatrices();
3279
+
3280
+// if (obj.parent == null)
3281
+// {
3282
+// System.out.println("NULL PARENT!");
3283
+// new Exception().printStackTrace();
3284
+// }
3285
+// else
3286
+// TouchTransform(obj);
3287
+// //obj.parent.Touch();
3288
+ }
3289
+
3290
+ refreshContents();
3291
+ }
31233292
31243293 void ResetTransform()
31253294 {
....@@ -3232,7 +3401,7 @@
32323401 refreshContents();
32333402 }
32343403
3235
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
32363405 {
32373406 Object3D obj;
32383407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3247,12 +3416,16 @@
32473416 LA.matIdentity(Object3D.mat);
32483417 obj.getBounds(minima, maxima, false);
32493418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3250
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32513421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32523422 obj.TransformMesh(Object3D.mat);
3423
+
32533424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3254
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32553427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
32563429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32573430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32583431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3281,7 +3454,8 @@
32813454
32823455 int size = obj.MemorySize();
32833456
3284
- System.err.println((size/1024) + " KB is the size of " + obj);
3457
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3458
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32853459 }
32863460 }
32873461 catch (Exception e)
....@@ -3318,9 +3492,9 @@
33183492 obj = (Object3D)e.nextElement();
33193493
33203494 System.out.println("Object is: " + obj);
3321
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
33223496 System.out.println("Boundary rep: " + obj.bRep);
3323
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
33243498
33253499 // System.err.println((size/1024) + " KB is the size of " + obj);
33263500 }
....@@ -3362,6 +3536,13 @@
33623536 void GenNormals(boolean crease)
33633537 {
33643538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
33653546
33663547 refreshContents();
33673548 }
....@@ -3534,8 +3715,8 @@
35343715
35353716 void ParseVertices()
35363717 {
3537
- boolean epsequal = GrafreeD.epsequal;
3538
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
35393720
35403721 for (int i=0; i<group.selection.size(); i++)
35413722 {
....@@ -3560,7 +3741,7 @@
35603741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35613742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35623743
3563
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
35643745
35653746 buffer.add(g);
35663747 }
....@@ -3575,7 +3756,7 @@
35753756 makeSomething(buffer, i==group.selection.size()-1);
35763757 }
35773758
3578
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
35793760
35803761 refreshContents();
35813762 }
....@@ -3593,7 +3774,16 @@
35933774 String pigment = Object3D.GetPigment(tex);
35943775 //String bump = Object3D.GetBump(tex);
35953776
3596
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3777
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3778
+
3779
+ try
3780
+ {
3781
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3782
+ }
3783
+ catch (Exception e)
3784
+ {
3785
+ System.err.println("FAIL: " + node);
3786
+ }
35973787
35983788 double s = v.s;
35993789
....@@ -3725,7 +3915,7 @@
37253915 return;
37263916
37273917 Object3D poses = group.selection.get(0);
3728
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
37293919
37303920 Object3D newgroup = new Object3D("Po:" + poses.name);
37313921
....@@ -3919,9 +4109,9 @@
39194109
39204110 void ClipMesh()
39214111 {
3922
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39234113 {
3924
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
39254115
39264116 if (content instanceof cGroup && ((cGroup)content).transientlink )
39274117 content = ((cGroup)content).get(0);
....@@ -3930,7 +4120,7 @@
39304120 // {
39314121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39324122 // }
3933
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
39344124 }
39354125 // group.selection.ClipMesh(GrafreeD.clipboard);
39364126 System.out.println("DONE.");
....@@ -3977,6 +4167,18 @@
39774167 void MarkLeaves(boolean hide)
39784168 {
39794169 group.selection.MarkLeaves(hide);
4170
+ refreshContents();
4171
+ }
4172
+
4173
+ void RewindLeaves(boolean hide)
4174
+ {
4175
+ group.selection.RewindLeaves(hide);
4176
+ refreshContents();
4177
+ }
4178
+
4179
+ void RandomLeaves(boolean hide)
4180
+ {
4181
+ group.selection.RandomLeaves(hide);
39804182 refreshContents();
39814183 }
39824184
....@@ -4065,7 +4267,7 @@
40654267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40664268
40674269 Object3D elem = (Object3D)group.selection.elementAt(i);
4068
- if(elem != group)
4270
+ if(elem != group || !newWindow)
40694271 {
40704272 // if (!(elem instanceof Composite))
40714273 // newWindow = false;
....@@ -4155,7 +4357,6 @@
41554357 //case 702: // Event.LIST_DESELECT
41564358 group.deselectAll();
41574359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4158
- objEditor.ClearInfo(); // .GetMaterial());
41594360 if (tps != null)
41604361 {
41614362 for (int i=0; i < tps.length; i++)
....@@ -4164,10 +4365,8 @@
41644365
41654366 //if (child.parent != null)
41664367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
41674369 group.addSelectee(child);
4168
- objEditor.SetMaterial(child); // .GetMaterial());
4169
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4170
- System.err.println("info : " + child.GetPath());
41714370 }
41724371 }
41734372 // else
....@@ -4177,16 +4376,17 @@
41774376 // System.err.println("info : " + group.GetPath());
41784377 // }
41794378
4180
- objEditor.SetText(); // jan 2014
4181
-
4182
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4379
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41834380 CameraPane.flash = true;
41844381
4185
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41864383 // a camera
41874384 {
4188
- CameraPane.camerachangeframe = 0; // don't refuse it
4189
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4385
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4386
+ {
4387
+ CameraPane.camerachangeframe = 0; // don't refuse it
4388
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4389
+ }
41904390 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41914391 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41924392 }
....@@ -4199,6 +4399,26 @@
41994399
42004400 freezemodel = false;
42014401 }
4402
+
4403
+ void refreshContents(boolean cp)
4404
+ {
4405
+ if (!Globals.MOUSEDRAGGED)
4406
+ {
4407
+ objEditor.ClearInfo(); // .GetMaterial());
4408
+
4409
+ for (int i=0; i < group.selection.Size(); i++)
4410
+ {
4411
+ Object3D child = (Object3D) group.selection.get(i);
4412
+
4413
+ objEditor.AddInfo(child, this, true);
4414
+ System.err.println("info : " + child.GetPath());
4415
+ }
4416
+
4417
+ objEditor.SetText(); // jan 2014
4418
+ }
4419
+
4420
+ super.refreshContents(cp);
4421
+ }
42024422
42034423 void linkSomething(Object3D thing)
42044424 {
....@@ -4270,16 +4490,18 @@
42704490 {
42714491 if (group.selection.isEmpty())
42724492 return;
4273
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
42744495 Composite tGroup = null;
42754496 if (group.selection.size() > 0) // 1)
42764497 {
42774498 tGroup = new cGroup();
4278
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
42794500 }
42804501
42814502 if (cut)
42824503 {
4504
+ Save();
42834505 //int indices[] = jList.getSelectedIndices();
42844506 //for (int i = indices.length - 1; i >= 0; i--)
42854507 //jList.remove(indices[i]);
....@@ -4315,16 +4537,16 @@
43154537 //System.out.println("cut " + child);
43164538 //System.out.println("parent = " + child.parent);
43174539 // tmp.addChild(child);
4318
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
43194541 tGroup.add/*Child*/(tmp);
43204542 else
4321
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
43224544 }
43234545 else
4324
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
43254547 tGroup.add/*Child*/(child);
43264548 else
4327
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
43284550 }
43294551
43304552 //ResetModel();
....@@ -4356,21 +4578,23 @@
43564578 //System.out.println("cut " + elem);
43574579 //System.out.println("parent = " + elem.parent);
43584580 // tmp.addChild(elem);
4359
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
43604582 tGroup.add/*Child*/(tmp);
43614583 else
4362
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
43634585 }
43644586 else
4365
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
43664588 tGroup.add/*Child*/(child);
43674589 else
4368
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
43694591 }
43704592
43714593 }
4372
- if (GrafreeD.clipboardIsTempGroup)
4373
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
43744598 if (cut)
43754599 {
43764600 ResetModel();
....@@ -4384,7 +4608,7 @@
43844608 // return;
43854609 boolean first = true;
43864610
4387
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
43884612 {
43894613 Composite temp;
43904614
....@@ -4395,7 +4619,7 @@
43954619 temp = (Composite)Applet3D.clipboard.deepCopy();
43964620 */
43974621 Object3D elem;
4398
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4622
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43994623 {
44004624 Object3D child = (Object3D)e.nextElement();
44014625
....@@ -4429,14 +4653,14 @@
44294653 //Object3D cb = Applet3D.clipboard;
44304654 //temp.addChild(cb);
44314655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4432
- assert(GrafreeD.clipboard.parent == null);
4433
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4434
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4435
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4436
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4656
+ assert(Grafreed.clipboard.parent == null);
4657
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4658
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4659
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4660
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44374661 else
4438
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
44404664 }
44414665
44424666 ResetModel();
....@@ -4485,9 +4709,9 @@
44854709 {
44864710 boolean first = true;
44874711
4488
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
44894713 {
4490
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
44914715 Object3D copy;
44924716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44934717 {
....@@ -4497,7 +4721,7 @@
44974721 }
44984722 } else
44994723 {
4500
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
45014725 }
45024726 }
45034727 }
....@@ -4902,21 +5126,6 @@
49025126 }
49035127 */
49045128
4905
- void ImportGFD()
4906
- {
4907
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4908
- browser.show();
4909
- String filename = browser.getFile();
4910
- if (filename != null && filename.length() > 0)
4911
- {
4912
- String fullname = browser.getDirectory() + filename;
4913
-
4914
- //Object3D readobj =
4915
- objEditor.ReadGFD(fullname, objEditor);
4916
- //makeSomething(readobj);
4917
- }
4918
- }
4919
-
49205129 /*
49215130 public void Callback(Object obj)
49225131 {
....@@ -4940,26 +5149,9 @@
49405149 }
49415150 */
49425151
4943
- void ImportVRMLX3D()
4944
- {
4945
- if (GrafreeD.standAlone)
4946
- {
4947
- /**/
4948
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4949
- browser.show();
4950
- String filename = browser.getFile();
4951
- if (filename != null && filename.length() > 0)
4952
- {
4953
- String fullname = browser.getDirectory() + filename;
4954
- LoadVRMLX3D(fullname);
4955
- }
4956
- /**/
4957
- }
4958
- }
4959
-
49605152 String GetFile(String dialogName)
49615153 {
4962
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
49635155 {
49645156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49655157 browser.show();
....@@ -5027,6 +5219,9 @@
50275219 cButton clearpanelButton;
50285220 cButton unselectButton;
50295221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
50305225 cButton oneStepButton;
50315226
50325227 cButton screenfitButton;
....@@ -5059,6 +5254,8 @@
50595254 private MenuItem lookFromItem;
50605255 private MenuItem switchItem;
50615256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
50625259 private MenuItem duplicateItem;
50635260 private MenuItem cloneItem;
50645261 private MenuItem cloneSupportItem;
....@@ -5072,7 +5269,7 @@
50725269 private MenuItem linkverticesItem;
50735270 private MenuItem relinkverticesItem;
50745271 private MenuItem setMasterItem;
5075
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
50765273 private MenuItem stepAllItem;
50775274 private MenuItem revertMeshItem;
50785275 private MenuItem poseMeshItem;
....@@ -5122,6 +5319,10 @@
51225319 private MenuItem showleavesItem;
51235320 private MenuItem markleavesItem;
51245321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
51255326
51265327 private MenuItem flipVItem;
51275328 private MenuItem unflipVItem;
....@@ -5133,8 +5334,10 @@
51335334 private MenuItem panoTexturesItem;
51345335
51355336 private MenuItem resetCentroidItem;
5136
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
51375338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
51385341 private MenuItem hideItem;
51395342 private MenuItem grabItem;
51405343 private MenuItem backItem;
....@@ -5203,11 +5406,6 @@
52035406 private MenuItem doubleItem;
52045407 private MenuItem tripleItem;
52055408
5206
- private MenuItem importGFDItem;
5207
- private MenuItem importVRMLX3DItem;
5208
- private MenuItem import3DSItem;
5209
- private MenuItem importOBJItem;
5210
-
52115409 private MenuItem computeAOItem;
52125410 private MenuItem recompileItem;
52135411 private MenuItem editScriptItem;
....@@ -5217,4 +5415,8 @@
52175415 private MenuItem analyzeItem;
52185416 private MenuItem dumpItem;
52195417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
52205422 }