Normand Briere
2019-06-23 8088590686a45e71278f9a52bb9cc37943dc0c37
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,27 +148,18 @@
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);
174165 cloneItem = menu.add(new MenuItem("Clone"));
....@@ -206,14 +197,97 @@
206197 clearAllItem = menu.add(new MenuItem("Clear All"));
207198 clearAllItem.addActionListener(this);
208199 }
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());
209236
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(Globals.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
+
210288 oe.menuBar.add(menu = new Menu("Setting"));
211289 if (Globals.ADVANCED)
212290 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218292 revertMeshItem.addActionListener(this);
219293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -318,8 +392,12 @@
318392 resetTransformItem.addActionListener(this);
319393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320394 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- 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);
323401
324402 oe.menuBar.add(menu = new Menu("Geometry"));
325403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -368,6 +446,10 @@
368446 oe.menuBar.add(menu = new Menu("Attributes"));
369447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370448 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);
371453 menu.add("-");
372454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
373455 liveleavesItem.addActionListener(this);
....@@ -388,6 +470,14 @@
388470 markleavesItem.addActionListener(this);
389471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
390472 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);
391481 menu.add("-");
392482 flipVItem = menu.add(new MenuItem("Flip V"));
393483 flipVItem.addActionListener(this);
....@@ -422,41 +512,41 @@
422512 sortbysizeItem.addActionListener(this);
423513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424514 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);
425520 if (Globals.ADVANCED)
426521 {
427
- menu.add("-");
522
+ // Pretty much the same as duplicate and clone.
428523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429524 extractGeometriesItem.addActionListener(this);
430525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431526 cloneGeometriesItem.addActionListener(this);
432
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
- shareGeometriesItem.addActionListener(this);
434
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
- mergeGeometriesItem.addActionListener(this);
436527 }
437528
438529 oe.menuBar.add(menu = new Menu("Insert"));
439530 buildCreateMenu(menu);
440531
441
- oe.menuBar.add(menu = new Menu("Include"));
442
- importOBJItem = menu.add(new MenuItem("OBJ file..."));
443
- importOBJItem.addActionListener(this);
444
- menu.add("-");
445
- import3DSItem = menu.add(new MenuItem("3DS file..."));
446
- import3DSItem.addActionListener(this);
447
- menu.add("-");
448
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
- importVRMLX3DItem.addActionListener(this);
450
- menu.add("-");
451
- importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
- importGFDItem.addActionListener(this);
453
-
454532 oe.menuBar.add(menu = new Menu("Tools"));
455533 buildToolsMenu(menu);
456534 }
457535
458536 void SetupUI2(ObjEditor oe)
459537 {
538
+ // June 2019
539
+ if (oe == null)
540
+ {
541
+ //super.SetupUI2(this);
542
+ //return;
543
+ }
544
+
545
+ if (copy != group)
546
+ {
547
+ //super.SetupUI2(this);
548
+ }
549
+
460550 //new Exception().printStackTrace();
461551
462552 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -487,11 +577,35 @@
487577 */
488578 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
489579
580
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
581
+ //minButton.setToolTipText("Minimize window");
582
+ //minButton.addActionListener(this);
583
+
584
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ maxButton.setToolTipText("Maximize window");
586
+ maxButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ fullButton.setToolTipText("Full-screen window");
590
+ fullButton.addActionListener(this);
591
+
592
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
593
+ undoButton.setToolTipText("Undo changes");
594
+ undoButton.addActionListener(this);
595
+
596
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ redoButton.setToolTipText("Redo changes");
598
+ redoButton.addActionListener(this);
599
+
600
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
601
+ saveButton.setToolTipText("Save changes");
602
+ saveButton.addActionListener(this);
603
+
490604 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
- liveCB.setToolTipText("Enabled animation");
605
+ liveCB.setToolTipText("Enable animation");
492606 liveCB.addItemListener(this);
493607
494
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495609 oneStepButton.setToolTipText("Animate one step forward");
496610 oneStepButton.addActionListener(this);
497611
....@@ -499,11 +613,11 @@
499613 fastCB.setToolTipText("Fast mode");
500614 fastCB.addItemListener(this);
501615
502
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
503617 trackCB.setToolTipText("Enable tracking");
504618 trackCB.addItemListener(this);
505619
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
507621 screenfitButton.setToolTipText("Screen fit");
508622 screenfitButton.addActionListener(this);
509623
....@@ -512,39 +626,39 @@
512626
513627 if (Globals.ADVANCED)
514628 {
515
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516630 snapobjectButton.addActionListener(this);
517631 snapobjectButton.setToolTipText("Snap Object");
518632 }
519633
520
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
634
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521635 flashSelectionButton.setToolTipText("Show selection");
522636 flashSelectionButton.addActionListener(this);
523637
524638 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525639
526
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
640
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527641 twoButton.setToolTipText("Show center view only");
528642 twoButton.addActionListener(this);
529
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
643
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530644 fourButton.addActionListener(this);
531645 fourButton.setToolTipText("Show left panel only");
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
646
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533647 sixButton.setToolTipText("2-column layout left");
534648 sixButton.addActionListener(this);
535
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536650 threeButton.setToolTipText("2-column layout right");
537651 threeButton.addActionListener(this);
538
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
652
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
539653 sevenButton.setToolTipText("3-column layout");
540654 sevenButton.addActionListener(this);
541655 //
542656
543
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544658 rootButton.setToolTipText("Edit selection in new tab");
545659 rootButton.addActionListener(this);
546660
547
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548662 closeButton.setToolTipText("Close tab");
549663 closeButton.addActionListener(this);
550664 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -552,11 +666,11 @@
552666
553667 cGridBag commandsPanel = new cGridBag();
554668
555
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
669
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
556670 editButton.setToolTipText("Edit selection");
557671 editButton.addActionListener(this);
558672
559
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
673
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560674 uneditButton.setToolTipText("Unedit selection");
561675 uneditButton.addActionListener(this);
562676
....@@ -564,11 +678,11 @@
564678 allParamsButton.setToolTipText("Edit all params");
565679 allParamsButton.addActionListener(this);
566680
567
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
681
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
568682 clearPanelButton.setToolTipText("Clear edit panel");
569683 clearPanelButton.addActionListener(this);
570684
571
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
685
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
572686 unselectButton.setToolTipText("Unselect");
573687 unselectButton.addActionListener(this);
574688
....@@ -651,7 +765,7 @@
651765 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
652766 zoomBoxCB.addItemListener(this);
653767
654
- if (Globals.ADVANCED)
768
+ if (true) // Globals.ADVANCED)
655769 {
656770 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657771 supportCB.setToolTipText("Enable rigging");
....@@ -724,8 +838,11 @@
724838 buttonGroup.add(radioButton);
725839 radioButton.doClick();
726840 }
841
+
727842 void SetupViews(ObjEditor oe)
728843 {
844
+ theFrame = this;
845
+
729846 oe.SetupViews();
730847
731848 System.out.println("SetupViews");
....@@ -788,6 +905,7 @@
788905 } else if(e.getSource() == liveCB)
789906 {
790907 cameraView.ToggleLive();
908
+ refreshContents(false);
791909 }
792910 else if(e.getSource() == supportCB)
793911 {
....@@ -940,7 +1058,9 @@
9401058 // objEditor.DropFile((java.io.File[]) object, true);
9411059 // return;
9421060 // }
943
- if (string.charAt(0) == '/')
1061
+
1062
+ // File path for Mac and Windows
1063
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9441064 {
9451065 // file(s)
9461066 String[] names = string.split("\n");
....@@ -967,7 +1087,7 @@
9671087
9681088 flashIt = false;
9691089 CameraPane pane = (CameraPane) target;
970
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1090
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9711091 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9721092
9731093 if (group.selection.size() == 1)
....@@ -1193,7 +1313,7 @@
11931313 memoryItem.addActionListener(this);
11941314 menu.add(analyzeItem = new MenuItem("Analyze"));
11951315 analyzeItem.addActionListener(this);
1196
- menu.add(dumpItem = new MenuItem("Dump"));
1316
+ menu.add(dumpItem = new MenuItem("Print"));
11971317 dumpItem.addActionListener(this);
11981318 // menu.add(pathItem = new MenuItem("From-to path"));
11991319 // pathItem.addActionListener(this);
....@@ -1540,9 +1660,9 @@
15401660
15411661 void Overwrite(int mask)
15421662 {
1543
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1663
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15441664 {
1545
- Object3D content = GrafreeD.clipboard.get(0);
1665
+ Object3D content = Grafreed.clipboard.get(0);
15461666
15471667 if (content instanceof cGroup && ((cGroup)content).transientlink )
15481668 content = ((cGroup)content).get(0);
....@@ -1847,31 +1967,6 @@
18471967 csg.addChild(child);
18481968 child.addChild(csg);
18491969 } else
1850
-
1851
- if (source == importGFDItem)
1852
- {
1853
- ImportGFD();
1854
- } else
1855
- if (source == importVRMLX3DItem)
1856
- {
1857
- ImportVRMLX3D();
1858
- } else
1859
- if (source == import3DSItem)
1860
- {
1861
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1862
- } else
1863
- if (source == importOBJItem)
1864
- {
1865
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
- browser.setVisible(true);
1868
- String filename = browser.getFile();
1869
- if (filename != null && filename.length() > 0)
1870
- {
1871
- String fullname = browser.getDirectory() + filename;
1872
- makeSomething(ReadOBJ(fullname), true);
1873
- }
1874
- } else
18751970 if (source == computeAOItem)
18761971 {
18771972 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1890,7 +1985,7 @@
18901985 if (source == invariantsItem)
18911986 {
18921987 System.out.println("Invariants:");
1893
- GrafreeD.grafreeD.universe.invariants();
1988
+ Grafreed.grafreeD.universe.invariants();
18941989 } else
18951990 if (source == memoryItem)
18961991 {
....@@ -1908,6 +2003,30 @@
19082003 if (source == dumpItem)
19092004 {
19102005 DumpObject();
2006
+ } else
2007
+ if (source == minButton)
2008
+ {
2009
+ Minimize();
2010
+ } else
2011
+ if (source == maxButton)
2012
+ {
2013
+ Maximize();
2014
+ } else
2015
+ if (source == fullButton)
2016
+ {
2017
+ ToggleFullScreen();
2018
+ } else
2019
+ if (source == undoButton)
2020
+ {
2021
+ Undo();
2022
+ } else
2023
+ if (source == redoButton)
2024
+ {
2025
+ Redo();
2026
+ } else
2027
+ if (source == saveButton)
2028
+ {
2029
+ Save();
19112030 } else
19122031 if (source == oneStepButton)
19132032 {
....@@ -1963,12 +2082,20 @@
19632082 {
19642083 loadClipboard(true);
19652084 } else
2085
+ if (source == undoItem)
2086
+ {
2087
+ Undo();
2088
+ } else
2089
+ if (source == redoItem)
2090
+ {
2091
+ Redo();
2092
+ } else
19662093 if (source == duplicateItem)
19672094 {
1968
- Object3D keep = GrafreeD.clipboard;
2095
+ Object3D keep = Grafreed.clipboard;
19692096 loadClipboard(false);
19702097 paste(false);
1971
- GrafreeD.clipboard = keep;
2098
+ Grafreed.clipboard = keep;
19722099 } else
19732100 if (source == cloneItem)
19742101 {
....@@ -2188,9 +2315,9 @@
21882315 // group.selection.get(0).setMasterThis(content); // should be identity
21892316 // refreshContents();
21902317 // }
2191
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2318
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21922319 {
2193
- Object3D content = GrafreeD.clipboard.get(0);
2320
+ Object3D content = Grafreed.clipboard.get(0);
21942321
21952322 if (content instanceof cGroup && ((cGroup)content).transientlink )
21962323 content = ((cGroup)content).get(0);
....@@ -2240,9 +2367,9 @@
22402367 } else
22412368 if (source == setMasterItem)
22422369 {
2243
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2370
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22442371 {
2245
- Object3D content = GrafreeD.clipboard.get(0);
2372
+ Object3D content = Grafreed.clipboard.get(0);
22462373
22472374 if (content instanceof cGroup && ((cGroup)content).transientlink )
22482375 content = ((cGroup)content).get(0);
....@@ -2255,9 +2382,9 @@
22552382 {
22562383 if (group.selection.size() == 1)
22572384 {
2258
- if (GrafreeD.clipboard.size() == 1)
2385
+ if (Grafreed.clipboard.size() == 1)
22592386 {
2260
- Object3D content = GrafreeD.clipboard.get(0);
2387
+ Object3D content = Grafreed.clipboard.get(0);
22612388
22622389 if (content instanceof cGroup && ((cGroup)content).transientlink )
22632390 content = ((cGroup)content).get(0);
....@@ -2274,7 +2401,7 @@
22742401 {
22752402 RevertMeshes();
22762403 } else
2277
- if (source == resetMeshItem)
2404
+ if (source == resetAllItem)
22782405 {
22792406 ResetAll();
22802407 } else
....@@ -2462,7 +2589,7 @@
24622589 } else
24632590 if (source == genNormalsMESHItem)
24642591 {
2465
- GenNormals(true); // TODO
2592
+ GenNormalsMESH();
24662593 } else
24672594 if (source == genNormalsORGANItem)
24682595 {
....@@ -2527,6 +2654,22 @@
25272654 if (source == unmarkleavesItem)
25282655 {
25292656 MarkLeaves(false);
2657
+ } else
2658
+ if (source == rewindleavesItem)
2659
+ {
2660
+ RewindLeaves(true);
2661
+ } else
2662
+ if (source == unrewindleavesItem)
2663
+ {
2664
+ RewindLeaves(false);
2665
+ } else
2666
+ if (source == randomleavesItem)
2667
+ {
2668
+ RandomLeaves(true);
2669
+ } else
2670
+ if (source == unrandomleavesItem)
2671
+ {
2672
+ RandomLeaves(false);
25302673 } else
25312674 if (source == flipVItem)
25322675 {
....@@ -2612,9 +2755,13 @@
26122755 {
26132756 SmoothMesh();
26142757 } else
2615
- if (source == transformgeometryItem)
2758
+ if (source == transformGeometryItem)
26162759 {
26172760 TransformGeometry();
2761
+ } else
2762
+ if (source == transformChildrenItem)
2763
+ {
2764
+ TransformChildren();
26182765 } else
26192766 if (source == resetTransformItem)
26202767 {
....@@ -2622,7 +2769,11 @@
26222769 } else
26232770 if (source == resetCentroidItem)
26242771 {
2625
- ResetCentroid();
2772
+ ResetCentroid(true);
2773
+ } else
2774
+ if (source == resetCentroidXZItem)
2775
+ {
2776
+ ResetCentroid(false);
26262777 } else
26272778 if (source == resetParentItem)
26282779 {
....@@ -2786,6 +2937,24 @@
27862937 bigThree.ClearUI();
27872938 bigThree.add(centralPanel);
27882939 bigThree.FlushUI();
2940
+
2941
+ cameraView.requestFocusInWindow();
2942
+
2943
+// refreshContents(true);
2944
+//
2945
+// try
2946
+// {
2947
+// java.awt.Robot bot = new java.awt.Robot();
2948
+// int mask = InputEvent.BUTTON1_MASK;
2949
+// bot.mouseMove(100, 100);
2950
+// bot.mousePress(mask);
2951
+// bot.mouseRelease(mask);
2952
+// }
2953
+// catch (Exception e)
2954
+// {
2955
+//
2956
+// }
2957
+
27892958 } else
27902959 if (source == threeButton)
27912960 {
....@@ -2822,6 +2991,8 @@
28222991 bigThree.add(centralPanel);
28232992 bigThree.add(XYZPanel);
28242993 bigThree.FlushUI();
2994
+
2995
+ cameraView.requestFocusInWindow();
28252996 } else
28262997 if (source == fourButton)
28272998 {
....@@ -2857,6 +3028,8 @@
28573028 bigThree.ClearUI();
28583029 bigThree.add(scenePanel);
28593030 bigThree.FlushUI();
3031
+
3032
+ cameraView.requestFocusInWindow();
28603033 } else
28613034 if (source == sixButton)
28623035 {
....@@ -2893,6 +3066,8 @@
28933066 bigThree.add(scenePanel);
28943067 bigThree.add(centralPanel);
28953068 bigThree.FlushUI();
3069
+
3070
+ cameraView.requestFocusInWindow();
28963071 } else
28973072 if (source == sevenButton)
28983073 {
....@@ -2930,6 +3105,8 @@
29303105 bigThree.add(centralPanel);
29313106 bigThree.add(XYZPanel);
29323107 bigThree.FlushUI();
3108
+
3109
+ cameraView.requestFocusInWindow();
29333110 } else
29343111 if (source == rootButton)
29353112 {
....@@ -2941,6 +3118,7 @@
29413118 EditObject(obj);
29423119 }
29433120
3121
+ cameraView.requestFocusInWindow();
29443122 refreshContents(true);
29453123 } else
29463124 if (source == closeButton)
....@@ -2962,6 +3140,8 @@
29623140 break;
29633141 }
29643142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
29653145 refreshContents(true);
29663146 } else
29673147 if (source == editItem || source == editButton)
....@@ -2978,7 +3158,7 @@
29783158 child.CloseUI();
29793159 listUI.remove(child);
29803160
2981
- child.editWindow = null; // ???????????
3161
+ //child.editWindow = null; // ???????????
29823162 }
29833163 objEditor.ctrlPanel.FlushUI();
29843164 //objEditor.jTree.clearSelection();
....@@ -3064,7 +3244,10 @@
30643244 frontView.object = group;
30653245 sideView.object = group;
30663246 }
3067
- group.editWindow = this;
3247
+
3248
+// fix "+" issue
3249
+ //group.editWindow = this;
3250
+
30683251 /*
30693252 currentLayout = radio.layout;
30703253 if (currentLayout == null)
....@@ -3076,8 +3259,23 @@
30763259 //group.parent = null; // ROOT
30773260 //group.attributes = -1;
30783261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
30793264 refreshContents(true);
3080
- }
3265
+ } else if (event.getSource() == editCameraItem)
3266
+ {
3267
+ cameraView.ProtectCamera();
3268
+ cameraView.repaint();
3269
+ return;
3270
+ } else if (event.getSource() == revertCameraItem)
3271
+ {
3272
+ cameraView.RevertCamera();
3273
+ cameraView.repaint();
3274
+ return;
3275
+ // } else if (event.getSource() == textureButton)
3276
+ // {
3277
+ // return; // true;
3278
+ }
30813279 else
30823280 {
30833281 //return super.action(event, arg);
....@@ -3086,7 +3284,6 @@
30863284 }
30873285
30883286 boolean useclient = false;
3089
- cRadio radio;
30903287
30913288 void ToggleRoot()
30923289 {
....@@ -3138,6 +3335,28 @@
31383335 refreshContents();
31393336 }
31403337
3338
+ void TransformChildren()
3339
+ {
3340
+ Object3D obj;
3341
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3342
+ {
3343
+ obj = (Object3D)e.nextElement();
3344
+ obj.KeepTextureMatrices();
3345
+ obj.TransformChildren();
3346
+ obj.RestoreTextureMatrices();
3347
+
3348
+// if (obj.parent == null)
3349
+// {
3350
+// System.out.println("NULL PARENT!");
3351
+// new Exception().printStackTrace();
3352
+// }
3353
+// else
3354
+// TouchTransform(obj);
3355
+// //obj.parent.Touch();
3356
+ }
3357
+
3358
+ refreshContents();
3359
+ }
31413360
31423361 void ResetTransform()
31433362 {
....@@ -3250,7 +3469,7 @@
32503469 refreshContents();
32513470 }
32523471
3253
- void ResetCentroid()
3472
+ void ResetCentroid(boolean full)
32543473 {
32553474 Object3D obj;
32563475 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3265,12 +3484,16 @@
32653484 LA.matIdentity(Object3D.mat);
32663485 obj.getBounds(minima, maxima, false);
32673486 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3268
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3487
+ if (full)
3488
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32693489 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32703490 obj.TransformMesh(Object3D.mat);
3491
+
32713492 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3272
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3493
+ if (full)
3494
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32733495 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3496
+
32743497 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32753498 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32763499 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3299,7 +3522,8 @@
32993522
33003523 int size = obj.MemorySize();
33013524
3302
- System.err.println((size/1024) + " KB is the size of " + obj);
3525
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3526
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33033527 }
33043528 }
33053529 catch (Exception e)
....@@ -3336,9 +3560,9 @@
33363560 obj = (Object3D)e.nextElement();
33373561
33383562 System.out.println("Object is: " + obj);
3339
- GrafreeD.AnalyzeObject(obj);
3563
+ Grafreed.AnalyzeObject(obj);
33403564 System.out.println("Boundary rep: " + obj.bRep);
3341
- GrafreeD.AnalyzeObject(obj.bRep);
3565
+ Grafreed.AnalyzeObject(obj.bRep);
33423566
33433567 // System.err.println((size/1024) + " KB is the size of " + obj);
33443568 }
....@@ -3380,6 +3604,13 @@
33803604 void GenNormals(boolean crease)
33813605 {
33823606 group.GenNormalsS(crease);
3607
+
3608
+ refreshContents();
3609
+ }
3610
+
3611
+ void GenNormalsMESH()
3612
+ {
3613
+ group.GenNormalsMeshS();
33833614
33843615 refreshContents();
33853616 }
....@@ -3552,8 +3783,8 @@
35523783
35533784 void ParseVertices()
35543785 {
3555
- boolean epsequal = GrafreeD.epsequal;
3556
- GrafreeD.epsequal = true;
3786
+ boolean epsequal = Grafreed.epsequal;
3787
+ Grafreed.epsequal = true;
35573788
35583789 for (int i=0; i<group.selection.size(); i++)
35593790 {
....@@ -3578,7 +3809,7 @@
35783809 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35793810 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35803811
3581
- g.add(GrafreeD.clipboard);
3812
+ g.add(Grafreed.clipboard);
35823813
35833814 buffer.add(g);
35843815 }
....@@ -3593,7 +3824,7 @@
35933824 makeSomething(buffer, i==group.selection.size()-1);
35943825 }
35953826
3596
- GrafreeD.epsequal = epsequal;
3827
+ Grafreed.epsequal = epsequal;
35973828
35983829 refreshContents();
35993830 }
....@@ -3611,7 +3842,16 @@
36113842 String pigment = Object3D.GetPigment(tex);
36123843 //String bump = Object3D.GetBump(tex);
36133844
3614
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3845
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3846
+
3847
+ try
3848
+ {
3849
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3850
+ }
3851
+ catch (Exception e)
3852
+ {
3853
+ System.err.println("FAIL: " + node);
3854
+ }
36153855
36163856 double s = v.s;
36173857
....@@ -3743,7 +3983,7 @@
37433983 return;
37443984
37453985 Object3D poses = group.selection.get(0);
3746
- Object3D ref = GrafreeD.clipboard.get(0);
3986
+ Object3D ref = Grafreed.clipboard.get(0);
37473987
37483988 Object3D newgroup = new Object3D("Po:" + poses.name);
37493989
....@@ -3937,9 +4177,9 @@
39374177
39384178 void ClipMesh()
39394179 {
3940
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4180
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39414181 {
3942
- Object3D content = GrafreeD.clipboard.get(0);
4182
+ Object3D content = Grafreed.clipboard.get(0);
39434183
39444184 if (content instanceof cGroup && ((cGroup)content).transientlink )
39454185 content = ((cGroup)content).get(0);
....@@ -3948,7 +4188,7 @@
39484188 // {
39494189 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39504190 // }
3951
- group.selection.ClipMesh(GrafreeD.clipboard);
4191
+ group.selection.ClipMesh(Grafreed.clipboard);
39524192 }
39534193 // group.selection.ClipMesh(GrafreeD.clipboard);
39544194 System.out.println("DONE.");
....@@ -3995,6 +4235,18 @@
39954235 void MarkLeaves(boolean hide)
39964236 {
39974237 group.selection.MarkLeaves(hide);
4238
+ refreshContents();
4239
+ }
4240
+
4241
+ void RewindLeaves(boolean hide)
4242
+ {
4243
+ group.selection.RewindLeaves(hide);
4244
+ refreshContents();
4245
+ }
4246
+
4247
+ void RandomLeaves(boolean hide)
4248
+ {
4249
+ group.selection.RandomLeaves(hide);
39984250 refreshContents();
39994251 }
40004252
....@@ -4083,7 +4335,7 @@
40834335 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40844336
40854337 Object3D elem = (Object3D)group.selection.elementAt(i);
4086
- if(elem != group)
4338
+ if(elem != group || !newWindow)
40874339 {
40884340 // if (!(elem instanceof Composite))
40894341 // newWindow = false;
....@@ -4173,7 +4425,6 @@
41734425 //case 702: // Event.LIST_DESELECT
41744426 group.deselectAll();
41754427 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4176
- objEditor.ClearInfo(); // .GetMaterial());
41774428 if (tps != null)
41784429 {
41794430 for (int i=0; i < tps.length; i++)
....@@ -4182,10 +4433,8 @@
41824433
41834434 //if (child.parent != null)
41844435 //child.parent.addSelectee(child);
4436
+ objEditor.SetMaterial(child);
41854437 group.addSelectee(child);
4186
- objEditor.SetMaterial(child); // .GetMaterial());
4187
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4188
- System.err.println("info : " + child.GetPath());
41894438 }
41904439 }
41914440 // else
....@@ -4195,16 +4444,17 @@
41954444 // System.err.println("info : " + group.GetPath());
41964445 // }
41974446
4198
- objEditor.SetText(); // jan 2014
4199
-
4200
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4447
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
42014448 CameraPane.flash = true;
42024449
4203
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4450
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42044451 // a camera
42054452 {
4206
- CameraPane.camerachangeframe = 0; // don't refuse it
4207
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4453
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4454
+ {
4455
+ CameraPane.camerachangeframe = 0; // don't refuse it
4456
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4457
+ }
42084458 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42094459 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42104460 }
....@@ -4217,6 +4467,26 @@
42174467
42184468 freezemodel = false;
42194469 }
4470
+
4471
+ void refreshContents(boolean cp)
4472
+ {
4473
+ if (!Globals.MOUSEDRAGGED)
4474
+ {
4475
+ objEditor.ClearInfo(); // .GetMaterial());
4476
+
4477
+ for (int i=0; i < group.selection.Size(); i++)
4478
+ {
4479
+ Object3D child = (Object3D) group.selection.get(i);
4480
+
4481
+ objEditor.AddInfo(child, this, true);
4482
+ System.err.println("info : " + child.GetPath());
4483
+ }
4484
+
4485
+ objEditor.SetText(); // jan 2014
4486
+ }
4487
+
4488
+ super.refreshContents(cp);
4489
+ }
42204490
42214491 void linkSomething(Object3D thing)
42224492 {
....@@ -4288,16 +4558,18 @@
42884558 {
42894559 if (group.selection.isEmpty())
42904560 return;
4291
- GrafreeD.clipboardIsTempGroup = false;
4561
+
4562
+ Grafreed.clipboardIsTempGroup = false;
42924563 Composite tGroup = null;
42934564 if (group.selection.size() > 0) // 1)
42944565 {
42954566 tGroup = new cGroup();
4296
- GrafreeD.clipboardIsTempGroup = true;
4567
+ Grafreed.clipboardIsTempGroup = true;
42974568 }
42984569
42994570 if (cut)
43004571 {
4572
+ Save();
43014573 //int indices[] = jList.getSelectedIndices();
43024574 //for (int i = indices.length - 1; i >= 0; i--)
43034575 //jList.remove(indices[i]);
....@@ -4333,16 +4605,16 @@
43334605 //System.out.println("cut " + child);
43344606 //System.out.println("parent = " + child.parent);
43354607 // tmp.addChild(child);
4336
- if (GrafreeD.clipboardIsTempGroup)
4608
+ if (Grafreed.clipboardIsTempGroup)
43374609 tGroup.add/*Child*/(tmp);
43384610 else
4339
- GrafreeD.clipboard = tmp;
4611
+ Grafreed.clipboard = tmp;
43404612 }
43414613 else
4342
- if (GrafreeD.clipboardIsTempGroup)
4614
+ if (Grafreed.clipboardIsTempGroup)
43434615 tGroup.add/*Child*/(child);
43444616 else
4345
- GrafreeD.clipboard = child;
4617
+ Grafreed.clipboard = child;
43464618 }
43474619
43484620 //ResetModel();
....@@ -4374,21 +4646,23 @@
43744646 //System.out.println("cut " + elem);
43754647 //System.out.println("parent = " + elem.parent);
43764648 // tmp.addChild(elem);
4377
- if (GrafreeD.clipboardIsTempGroup)
4649
+ if (Grafreed.clipboardIsTempGroup)
43784650 tGroup.add/*Child*/(tmp);
43794651 else
4380
- GrafreeD.clipboard = tmp;
4652
+ Grafreed.clipboard = tmp;
43814653 }
43824654 else
4383
- if (GrafreeD.clipboardIsTempGroup)
4655
+ if (Grafreed.clipboardIsTempGroup)
43844656 tGroup.add/*Child*/(child);
43854657 else
4386
- GrafreeD.clipboard = child;
4658
+ Grafreed.clipboard = child;
43874659 }
43884660
43894661 }
4390
- if (GrafreeD.clipboardIsTempGroup)
4391
- GrafreeD.clipboard = tGroup;
4662
+
4663
+ if (Grafreed.clipboardIsTempGroup)
4664
+ Grafreed.clipboard = tGroup;
4665
+
43924666 if (cut)
43934667 {
43944668 ResetModel();
....@@ -4402,7 +4676,7 @@
44024676 // return;
44034677 boolean first = true;
44044678
4405
- if (GrafreeD.clipboardIsTempGroup)
4679
+ if (Grafreed.clipboardIsTempGroup)
44064680 {
44074681 Composite temp;
44084682
....@@ -4413,7 +4687,7 @@
44134687 temp = (Composite)Applet3D.clipboard.deepCopy();
44144688 */
44154689 Object3D elem;
4416
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4690
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44174691 {
44184692 Object3D child = (Object3D)e.nextElement();
44194693
....@@ -4447,14 +4721,14 @@
44474721 //Object3D cb = Applet3D.clipboard;
44484722 //temp.addChild(cb);
44494723 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4450
- assert(GrafreeD.clipboard.parent == null);
4451
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4452
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4453
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4454
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4724
+ assert(Grafreed.clipboard.parent == null);
4725
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4726
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4727
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4728
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44554729 else
4456
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4457
- GrafreeD.clipboard.get(0).parent = keepparent;
4730
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4731
+ Grafreed.clipboard.get(0).parent = keepparent;
44584732 }
44594733
44604734 ResetModel();
....@@ -4503,9 +4777,9 @@
45034777 {
45044778 boolean first = true;
45054779
4506
- if (GrafreeD.clipboardIsTempGroup)
4780
+ if (Grafreed.clipboardIsTempGroup)
45074781 {
4508
- Composite temp = (Composite)GrafreeD.clipboard;
4782
+ Composite temp = (Composite)Grafreed.clipboard;
45094783 Object3D copy;
45104784 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45114785 {
....@@ -4515,7 +4789,7 @@
45154789 }
45164790 } else
45174791 {
4518
- linkSomething(GrafreeD.clipboard); //.get(0));
4792
+ linkSomething(Grafreed.clipboard); //.get(0));
45194793 }
45204794 }
45214795 }
....@@ -4920,21 +5194,6 @@
49205194 }
49215195 */
49225196
4923
- void ImportGFD()
4924
- {
4925
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4926
- browser.show();
4927
- String filename = browser.getFile();
4928
- if (filename != null && filename.length() > 0)
4929
- {
4930
- String fullname = browser.getDirectory() + filename;
4931
-
4932
- //Object3D readobj =
4933
- objEditor.ReadGFD(fullname, objEditor);
4934
- //makeSomething(readobj);
4935
- }
4936
- }
4937
-
49385197 /*
49395198 public void Callback(Object obj)
49405199 {
....@@ -4958,26 +5217,9 @@
49585217 }
49595218 */
49605219
4961
- void ImportVRMLX3D()
4962
- {
4963
- if (GrafreeD.standAlone)
4964
- {
4965
- /**/
4966
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4967
- browser.show();
4968
- String filename = browser.getFile();
4969
- if (filename != null && filename.length() > 0)
4970
- {
4971
- String fullname = browser.getDirectory() + filename;
4972
- LoadVRMLX3D(fullname);
4973
- }
4974
- /**/
4975
- }
4976
- }
4977
-
49785220 String GetFile(String dialogName)
49795221 {
4980
- if (GrafreeD.standAlone)
5222
+ if (Grafreed.standAlone)
49815223 {
49825224 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49835225 browser.show();
....@@ -5045,6 +5287,12 @@
50455287 cButton clearpanelButton;
50465288 cButton unselectButton;
50475289
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
5293
+ cButton undoButton;
5294
+ cButton redoButton;
5295
+ cButton saveButton;
50485296 cButton oneStepButton;
50495297
50505298 cButton screenfitButton;
....@@ -5058,14 +5306,6 @@
50585306
50595307 cButton setsupportButton;
50605308
5061
- cButton twoButton;
5062
- cButton sixButton;
5063
- cButton threeButton;
5064
- cButton sevenButton;
5065
- cButton fourButton; // full panel
5066
- cButton oneButton; // full XYZ
5067
- //cButton currentLayout;
5068
-
50695309 //
50705310 //Composite
50715311 Object3D // to do !!
....@@ -5077,6 +5317,8 @@
50775317 private MenuItem lookFromItem;
50785318 private MenuItem switchItem;
50795319 private MenuItem cutItem;
5320
+ private MenuItem undoItem;
5321
+ private MenuItem redoItem;
50805322 private MenuItem duplicateItem;
50815323 private MenuItem cloneItem;
50825324 private MenuItem cloneSupportItem;
....@@ -5090,7 +5332,7 @@
50905332 private MenuItem linkverticesItem;
50915333 private MenuItem relinkverticesItem;
50925334 private MenuItem setMasterItem;
5093
- private MenuItem resetMeshItem;
5335
+ private MenuItem resetAllItem;
50945336 private MenuItem stepAllItem;
50955337 private MenuItem revertMeshItem;
50965338 private MenuItem poseMeshItem;
....@@ -5140,6 +5382,10 @@
51405382 private MenuItem showleavesItem;
51415383 private MenuItem markleavesItem;
51425384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
51435389
51445390 private MenuItem flipVItem;
51455391 private MenuItem unflipVItem;
....@@ -5151,8 +5397,10 @@
51515397 private MenuItem panoTexturesItem;
51525398
51535399 private MenuItem resetCentroidItem;
5154
- private MenuItem transformgeometryItem;
5400
+ private MenuItem resetCentroidXZItem;
51555401 private MenuItem resetTransformItem;
5402
+ private MenuItem transformGeometryItem;
5403
+ private MenuItem transformChildrenItem;
51565404 private MenuItem hideItem;
51575405 private MenuItem grabItem;
51585406 private MenuItem backItem;
....@@ -5221,11 +5469,6 @@
52215469 private MenuItem doubleItem;
52225470 private MenuItem tripleItem;
52235471
5224
- private MenuItem importGFDItem;
5225
- private MenuItem importVRMLX3DItem;
5226
- private MenuItem import3DSItem;
5227
- private MenuItem importOBJItem;
5228
-
52295472 private MenuItem computeAOItem;
52305473 private MenuItem recompileItem;
52315474 private MenuItem editScriptItem;
....@@ -5235,4 +5478,8 @@
52355478 private MenuItem analyzeItem;
52365479 private MenuItem dumpItem;
52375480 //boolean freezemodel = false;
5481
+
5482
+ Menu cameraMenu;
5483
+ MenuItem editCameraItem;
5484
+ MenuItem revertCameraItem;
52385485 }