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,38 +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
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
443
- importGFDItem.addActionListener(this);
444
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
445
- importVRMLX3DItem.addActionListener(this);
446
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
- importOBJItem.addActionListener(this);
448
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
- import3DSItem.addActionListener(this);
450
-
451532 oe.menuBar.add(menu = new Menu("Tools"));
452533 buildToolsMenu(menu);
453534 }
454535
455536 void SetupUI2(ObjEditor oe)
456537 {
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
+
457550 //new Exception().printStackTrace();
458551
459552 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -484,11 +577,35 @@
484577 */
485578 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
486579
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
+
487604 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
- liveCB.setToolTipText("Enabled animation");
605
+ liveCB.setToolTipText("Enable animation");
489606 liveCB.addItemListener(this);
490607
491
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492609 oneStepButton.setToolTipText("Animate one step forward");
493610 oneStepButton.addActionListener(this);
494611
....@@ -496,11 +613,11 @@
496613 fastCB.setToolTipText("Fast mode");
497614 fastCB.addItemListener(this);
498615
499
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
500617 trackCB.setToolTipText("Enable tracking");
501618 trackCB.addItemListener(this);
502619
503
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504621 screenfitButton.setToolTipText("Screen fit");
505622 screenfitButton.addActionListener(this);
506623
....@@ -509,39 +626,39 @@
509626
510627 if (Globals.ADVANCED)
511628 {
512
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
513630 snapobjectButton.addActionListener(this);
514631 snapobjectButton.setToolTipText("Snap Object");
515632 }
516633
517
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
634
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
518635 flashSelectionButton.setToolTipText("Show selection");
519636 flashSelectionButton.addActionListener(this);
520637
521638 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522639
523
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
640
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
524641 twoButton.setToolTipText("Show center view only");
525642 twoButton.addActionListener(this);
526
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
643
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527644 fourButton.addActionListener(this);
528645 fourButton.setToolTipText("Show left panel only");
529
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
646
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530647 sixButton.setToolTipText("2-column layout left");
531648 sixButton.addActionListener(this);
532
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533650 threeButton.setToolTipText("2-column layout right");
534651 threeButton.addActionListener(this);
535
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
652
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536653 sevenButton.setToolTipText("3-column layout");
537654 sevenButton.addActionListener(this);
538655 //
539656
540
- 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);
541658 rootButton.setToolTipText("Edit selection in new tab");
542659 rootButton.addActionListener(this);
543660
544
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
545662 closeButton.setToolTipText("Close tab");
546663 closeButton.addActionListener(this);
547664 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -549,11 +666,11 @@
549666
550667 cGridBag commandsPanel = new cGridBag();
551668
552
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
669
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553670 editButton.setToolTipText("Edit selection");
554671 editButton.addActionListener(this);
555672
556
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
673
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557674 uneditButton.setToolTipText("Unedit selection");
558675 uneditButton.addActionListener(this);
559676
....@@ -561,11 +678,11 @@
561678 allParamsButton.setToolTipText("Edit all params");
562679 allParamsButton.addActionListener(this);
563680
564
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
681
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565682 clearPanelButton.setToolTipText("Clear edit panel");
566683 clearPanelButton.addActionListener(this);
567684
568
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
685
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569686 unselectButton.setToolTipText("Unselect");
570687 unselectButton.addActionListener(this);
571688
....@@ -648,7 +765,7 @@
648765 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649766 zoomBoxCB.addItemListener(this);
650767
651
- if (Globals.ADVANCED)
768
+ if (true) // Globals.ADVANCED)
652769 {
653770 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654771 supportCB.setToolTipText("Enable rigging");
....@@ -721,8 +838,11 @@
721838 buttonGroup.add(radioButton);
722839 radioButton.doClick();
723840 }
841
+
724842 void SetupViews(ObjEditor oe)
725843 {
844
+ theFrame = this;
845
+
726846 oe.SetupViews();
727847
728848 System.out.println("SetupViews");
....@@ -785,6 +905,7 @@
785905 } else if(e.getSource() == liveCB)
786906 {
787907 cameraView.ToggleLive();
908
+ refreshContents(false);
788909 }
789910 else if(e.getSource() == supportCB)
790911 {
....@@ -937,7 +1058,9 @@
9371058 // objEditor.DropFile((java.io.File[]) object, true);
9381059 // return;
9391060 // }
940
- if (string.charAt(0) == '/')
1061
+
1062
+ // File path for Mac and Windows
1063
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9411064 {
9421065 // file(s)
9431066 String[] names = string.split("\n");
....@@ -964,7 +1087,7 @@
9641087
9651088 flashIt = false;
9661089 CameraPane pane = (CameraPane) target;
967
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1090
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9681091 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9691092
9701093 if (group.selection.size() == 1)
....@@ -1190,7 +1313,7 @@
11901313 memoryItem.addActionListener(this);
11911314 menu.add(analyzeItem = new MenuItem("Analyze"));
11921315 analyzeItem.addActionListener(this);
1193
- menu.add(dumpItem = new MenuItem("Dump"));
1316
+ menu.add(dumpItem = new MenuItem("Print"));
11941317 dumpItem.addActionListener(this);
11951318 // menu.add(pathItem = new MenuItem("From-to path"));
11961319 // pathItem.addActionListener(this);
....@@ -1537,9 +1660,9 @@
15371660
15381661 void Overwrite(int mask)
15391662 {
1540
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1663
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15411664 {
1542
- Object3D content = GrafreeD.clipboard.get(0);
1665
+ Object3D content = Grafreed.clipboard.get(0);
15431666
15441667 if (content instanceof cGroup && ((cGroup)content).transientlink )
15451668 content = ((cGroup)content).get(0);
....@@ -1844,23 +1967,6 @@
18441967 csg.addChild(child);
18451968 child.addChild(csg);
18461969 } else
1847
-
1848
- if (source == importGFDItem)
1849
- {
1850
- ImportGFD();
1851
- } else
1852
- if (source == importVRMLX3DItem)
1853
- {
1854
- ImportVRMLX3D();
1855
- } else
1856
- if (source == import3DSItem)
1857
- {
1858
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1859
- } else
1860
- if (source == importOBJItem)
1861
- {
1862
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1863
- } else
18641970 if (source == computeAOItem)
18651971 {
18661972 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1879,7 +1985,7 @@
18791985 if (source == invariantsItem)
18801986 {
18811987 System.out.println("Invariants:");
1882
- GrafreeD.grafreeD.universe.invariants();
1988
+ Grafreed.grafreeD.universe.invariants();
18831989 } else
18841990 if (source == memoryItem)
18851991 {
....@@ -1897,6 +2003,30 @@
18972003 if (source == dumpItem)
18982004 {
18992005 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();
19002030 } else
19012031 if (source == oneStepButton)
19022032 {
....@@ -1952,12 +2082,20 @@
19522082 {
19532083 loadClipboard(true);
19542084 } else
2085
+ if (source == undoItem)
2086
+ {
2087
+ Undo();
2088
+ } else
2089
+ if (source == redoItem)
2090
+ {
2091
+ Redo();
2092
+ } else
19552093 if (source == duplicateItem)
19562094 {
1957
- Object3D keep = GrafreeD.clipboard;
2095
+ Object3D keep = Grafreed.clipboard;
19582096 loadClipboard(false);
19592097 paste(false);
1960
- GrafreeD.clipboard = keep;
2098
+ Grafreed.clipboard = keep;
19612099 } else
19622100 if (source == cloneItem)
19632101 {
....@@ -2177,9 +2315,9 @@
21772315 // group.selection.get(0).setMasterThis(content); // should be identity
21782316 // refreshContents();
21792317 // }
2180
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2318
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21812319 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2320
+ Object3D content = Grafreed.clipboard.get(0);
21832321
21842322 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852323 content = ((cGroup)content).get(0);
....@@ -2229,9 +2367,9 @@
22292367 } else
22302368 if (source == setMasterItem)
22312369 {
2232
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2370
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22332371 {
2234
- Object3D content = GrafreeD.clipboard.get(0);
2372
+ Object3D content = Grafreed.clipboard.get(0);
22352373
22362374 if (content instanceof cGroup && ((cGroup)content).transientlink )
22372375 content = ((cGroup)content).get(0);
....@@ -2244,9 +2382,9 @@
22442382 {
22452383 if (group.selection.size() == 1)
22462384 {
2247
- if (GrafreeD.clipboard.size() == 1)
2385
+ if (Grafreed.clipboard.size() == 1)
22482386 {
2249
- Object3D content = GrafreeD.clipboard.get(0);
2387
+ Object3D content = Grafreed.clipboard.get(0);
22502388
22512389 if (content instanceof cGroup && ((cGroup)content).transientlink )
22522390 content = ((cGroup)content).get(0);
....@@ -2263,7 +2401,7 @@
22632401 {
22642402 RevertMeshes();
22652403 } else
2266
- if (source == resetMeshItem)
2404
+ if (source == resetAllItem)
22672405 {
22682406 ResetAll();
22692407 } else
....@@ -2451,7 +2589,7 @@
24512589 } else
24522590 if (source == genNormalsMESHItem)
24532591 {
2454
- GenNormals(true); // TODO
2592
+ GenNormalsMESH();
24552593 } else
24562594 if (source == genNormalsORGANItem)
24572595 {
....@@ -2516,6 +2654,22 @@
25162654 if (source == unmarkleavesItem)
25172655 {
25182656 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);
25192673 } else
25202674 if (source == flipVItem)
25212675 {
....@@ -2601,9 +2755,13 @@
26012755 {
26022756 SmoothMesh();
26032757 } else
2604
- if (source == transformgeometryItem)
2758
+ if (source == transformGeometryItem)
26052759 {
26062760 TransformGeometry();
2761
+ } else
2762
+ if (source == transformChildrenItem)
2763
+ {
2764
+ TransformChildren();
26072765 } else
26082766 if (source == resetTransformItem)
26092767 {
....@@ -2611,7 +2769,11 @@
26112769 } else
26122770 if (source == resetCentroidItem)
26132771 {
2614
- ResetCentroid();
2772
+ ResetCentroid(true);
2773
+ } else
2774
+ if (source == resetCentroidXZItem)
2775
+ {
2776
+ ResetCentroid(false);
26152777 } else
26162778 if (source == resetParentItem)
26172779 {
....@@ -2775,6 +2937,24 @@
27752937 bigThree.ClearUI();
27762938 bigThree.add(centralPanel);
27772939 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
+
27782958 } else
27792959 if (source == threeButton)
27802960 {
....@@ -2811,6 +2991,8 @@
28112991 bigThree.add(centralPanel);
28122992 bigThree.add(XYZPanel);
28132993 bigThree.FlushUI();
2994
+
2995
+ cameraView.requestFocusInWindow();
28142996 } else
28152997 if (source == fourButton)
28162998 {
....@@ -2846,6 +3028,8 @@
28463028 bigThree.ClearUI();
28473029 bigThree.add(scenePanel);
28483030 bigThree.FlushUI();
3031
+
3032
+ cameraView.requestFocusInWindow();
28493033 } else
28503034 if (source == sixButton)
28513035 {
....@@ -2882,6 +3066,8 @@
28823066 bigThree.add(scenePanel);
28833067 bigThree.add(centralPanel);
28843068 bigThree.FlushUI();
3069
+
3070
+ cameraView.requestFocusInWindow();
28853071 } else
28863072 if (source == sevenButton)
28873073 {
....@@ -2919,6 +3105,8 @@
29193105 bigThree.add(centralPanel);
29203106 bigThree.add(XYZPanel);
29213107 bigThree.FlushUI();
3108
+
3109
+ cameraView.requestFocusInWindow();
29223110 } else
29233111 if (source == rootButton)
29243112 {
....@@ -2930,6 +3118,7 @@
29303118 EditObject(obj);
29313119 }
29323120
3121
+ cameraView.requestFocusInWindow();
29333122 refreshContents(true);
29343123 } else
29353124 if (source == closeButton)
....@@ -2951,6 +3140,8 @@
29513140 break;
29523141 }
29533142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
29543145 refreshContents(true);
29553146 } else
29563147 if (source == editItem || source == editButton)
....@@ -2967,7 +3158,7 @@
29673158 child.CloseUI();
29683159 listUI.remove(child);
29693160
2970
- child.editWindow = null; // ???????????
3161
+ //child.editWindow = null; // ???????????
29713162 }
29723163 objEditor.ctrlPanel.FlushUI();
29733164 //objEditor.jTree.clearSelection();
....@@ -3053,7 +3244,10 @@
30533244 frontView.object = group;
30543245 sideView.object = group;
30553246 }
3056
- group.editWindow = this;
3247
+
3248
+// fix "+" issue
3249
+ //group.editWindow = this;
3250
+
30573251 /*
30583252 currentLayout = radio.layout;
30593253 if (currentLayout == null)
....@@ -3065,8 +3259,23 @@
30653259 //group.parent = null; // ROOT
30663260 //group.attributes = -1;
30673261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
30683264 refreshContents(true);
3069
- }
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
+ }
30703279 else
30713280 {
30723281 //return super.action(event, arg);
....@@ -3075,7 +3284,6 @@
30753284 }
30763285
30773286 boolean useclient = false;
3078
- cRadio radio;
30793287
30803288 void ToggleRoot()
30813289 {
....@@ -3127,6 +3335,28 @@
31273335 refreshContents();
31283336 }
31293337
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
+ }
31303360
31313361 void ResetTransform()
31323362 {
....@@ -3239,7 +3469,7 @@
32393469 refreshContents();
32403470 }
32413471
3242
- void ResetCentroid()
3472
+ void ResetCentroid(boolean full)
32433473 {
32443474 Object3D obj;
32453475 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3254,12 +3484,16 @@
32543484 LA.matIdentity(Object3D.mat);
32553485 obj.getBounds(minima, maxima, false);
32563486 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3257
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3487
+ if (full)
3488
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32583489 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32593490 obj.TransformMesh(Object3D.mat);
3491
+
32603492 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3261
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3493
+ if (full)
3494
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32623495 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3496
+
32633497 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32643498 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32653499 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3288,7 +3522,8 @@
32883522
32893523 int size = obj.MemorySize();
32903524
3291
- 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)");
32923527 }
32933528 }
32943529 catch (Exception e)
....@@ -3325,9 +3560,9 @@
33253560 obj = (Object3D)e.nextElement();
33263561
33273562 System.out.println("Object is: " + obj);
3328
- GrafreeD.AnalyzeObject(obj);
3563
+ Grafreed.AnalyzeObject(obj);
33293564 System.out.println("Boundary rep: " + obj.bRep);
3330
- GrafreeD.AnalyzeObject(obj.bRep);
3565
+ Grafreed.AnalyzeObject(obj.bRep);
33313566
33323567 // System.err.println((size/1024) + " KB is the size of " + obj);
33333568 }
....@@ -3369,6 +3604,13 @@
33693604 void GenNormals(boolean crease)
33703605 {
33713606 group.GenNormalsS(crease);
3607
+
3608
+ refreshContents();
3609
+ }
3610
+
3611
+ void GenNormalsMESH()
3612
+ {
3613
+ group.GenNormalsMeshS();
33723614
33733615 refreshContents();
33743616 }
....@@ -3541,8 +3783,8 @@
35413783
35423784 void ParseVertices()
35433785 {
3544
- boolean epsequal = GrafreeD.epsequal;
3545
- GrafreeD.epsequal = true;
3786
+ boolean epsequal = Grafreed.epsequal;
3787
+ Grafreed.epsequal = true;
35463788
35473789 for (int i=0; i<group.selection.size(); i++)
35483790 {
....@@ -3567,7 +3809,7 @@
35673809 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35683810 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35693811
3570
- g.add(GrafreeD.clipboard);
3812
+ g.add(Grafreed.clipboard);
35713813
35723814 buffer.add(g);
35733815 }
....@@ -3582,7 +3824,7 @@
35823824 makeSomething(buffer, i==group.selection.size()-1);
35833825 }
35843826
3585
- GrafreeD.epsequal = epsequal;
3827
+ Grafreed.epsequal = epsequal;
35863828
35873829 refreshContents();
35883830 }
....@@ -3600,7 +3842,16 @@
36003842 String pigment = Object3D.GetPigment(tex);
36013843 //String bump = Object3D.GetBump(tex);
36023844
3603
- 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
+ }
36043855
36053856 double s = v.s;
36063857
....@@ -3732,7 +3983,7 @@
37323983 return;
37333984
37343985 Object3D poses = group.selection.get(0);
3735
- Object3D ref = GrafreeD.clipboard.get(0);
3986
+ Object3D ref = Grafreed.clipboard.get(0);
37363987
37373988 Object3D newgroup = new Object3D("Po:" + poses.name);
37383989
....@@ -3926,9 +4177,9 @@
39264177
39274178 void ClipMesh()
39284179 {
3929
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4180
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39304181 {
3931
- Object3D content = GrafreeD.clipboard.get(0);
4182
+ Object3D content = Grafreed.clipboard.get(0);
39324183
39334184 if (content instanceof cGroup && ((cGroup)content).transientlink )
39344185 content = ((cGroup)content).get(0);
....@@ -3937,7 +4188,7 @@
39374188 // {
39384189 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39394190 // }
3940
- group.selection.ClipMesh(GrafreeD.clipboard);
4191
+ group.selection.ClipMesh(Grafreed.clipboard);
39414192 }
39424193 // group.selection.ClipMesh(GrafreeD.clipboard);
39434194 System.out.println("DONE.");
....@@ -3984,6 +4235,18 @@
39844235 void MarkLeaves(boolean hide)
39854236 {
39864237 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);
39874250 refreshContents();
39884251 }
39894252
....@@ -4072,7 +4335,7 @@
40724335 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40734336
40744337 Object3D elem = (Object3D)group.selection.elementAt(i);
4075
- if(elem != group)
4338
+ if(elem != group || !newWindow)
40764339 {
40774340 // if (!(elem instanceof Composite))
40784341 // newWindow = false;
....@@ -4162,7 +4425,6 @@
41624425 //case 702: // Event.LIST_DESELECT
41634426 group.deselectAll();
41644427 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4165
- objEditor.ClearInfo(); // .GetMaterial());
41664428 if (tps != null)
41674429 {
41684430 for (int i=0; i < tps.length; i++)
....@@ -4171,10 +4433,8 @@
41714433
41724434 //if (child.parent != null)
41734435 //child.parent.addSelectee(child);
4436
+ objEditor.SetMaterial(child);
41744437 group.addSelectee(child);
4175
- objEditor.SetMaterial(child); // .GetMaterial());
4176
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4177
- System.err.println("info : " + child.GetPath());
41784438 }
41794439 }
41804440 // else
....@@ -4184,16 +4444,17 @@
41844444 // System.err.println("info : " + group.GetPath());
41854445 // }
41864446
4187
- objEditor.SetText(); // jan 2014
4188
-
4189
- 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))
41904448 CameraPane.flash = true;
41914449
4192
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4450
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41934451 // a camera
41944452 {
4195
- CameraPane.camerachangeframe = 0; // don't refuse it
4196
- 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
+ }
41974458 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41984459 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41994460 }
....@@ -4206,6 +4467,26 @@
42064467
42074468 freezemodel = false;
42084469 }
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
+ }
42094490
42104491 void linkSomething(Object3D thing)
42114492 {
....@@ -4277,16 +4558,18 @@
42774558 {
42784559 if (group.selection.isEmpty())
42794560 return;
4280
- GrafreeD.clipboardIsTempGroup = false;
4561
+
4562
+ Grafreed.clipboardIsTempGroup = false;
42814563 Composite tGroup = null;
42824564 if (group.selection.size() > 0) // 1)
42834565 {
42844566 tGroup = new cGroup();
4285
- GrafreeD.clipboardIsTempGroup = true;
4567
+ Grafreed.clipboardIsTempGroup = true;
42864568 }
42874569
42884570 if (cut)
42894571 {
4572
+ Save();
42904573 //int indices[] = jList.getSelectedIndices();
42914574 //for (int i = indices.length - 1; i >= 0; i--)
42924575 //jList.remove(indices[i]);
....@@ -4322,16 +4605,16 @@
43224605 //System.out.println("cut " + child);
43234606 //System.out.println("parent = " + child.parent);
43244607 // tmp.addChild(child);
4325
- if (GrafreeD.clipboardIsTempGroup)
4608
+ if (Grafreed.clipboardIsTempGroup)
43264609 tGroup.add/*Child*/(tmp);
43274610 else
4328
- GrafreeD.clipboard = tmp;
4611
+ Grafreed.clipboard = tmp;
43294612 }
43304613 else
4331
- if (GrafreeD.clipboardIsTempGroup)
4614
+ if (Grafreed.clipboardIsTempGroup)
43324615 tGroup.add/*Child*/(child);
43334616 else
4334
- GrafreeD.clipboard = child;
4617
+ Grafreed.clipboard = child;
43354618 }
43364619
43374620 //ResetModel();
....@@ -4363,21 +4646,23 @@
43634646 //System.out.println("cut " + elem);
43644647 //System.out.println("parent = " + elem.parent);
43654648 // tmp.addChild(elem);
4366
- if (GrafreeD.clipboardIsTempGroup)
4649
+ if (Grafreed.clipboardIsTempGroup)
43674650 tGroup.add/*Child*/(tmp);
43684651 else
4369
- GrafreeD.clipboard = tmp;
4652
+ Grafreed.clipboard = tmp;
43704653 }
43714654 else
4372
- if (GrafreeD.clipboardIsTempGroup)
4655
+ if (Grafreed.clipboardIsTempGroup)
43734656 tGroup.add/*Child*/(child);
43744657 else
4375
- GrafreeD.clipboard = child;
4658
+ Grafreed.clipboard = child;
43764659 }
43774660
43784661 }
4379
- if (GrafreeD.clipboardIsTempGroup)
4380
- GrafreeD.clipboard = tGroup;
4662
+
4663
+ if (Grafreed.clipboardIsTempGroup)
4664
+ Grafreed.clipboard = tGroup;
4665
+
43814666 if (cut)
43824667 {
43834668 ResetModel();
....@@ -4391,7 +4676,7 @@
43914676 // return;
43924677 boolean first = true;
43934678
4394
- if (GrafreeD.clipboardIsTempGroup)
4679
+ if (Grafreed.clipboardIsTempGroup)
43954680 {
43964681 Composite temp;
43974682
....@@ -4402,7 +4687,7 @@
44024687 temp = (Composite)Applet3D.clipboard.deepCopy();
44034688 */
44044689 Object3D elem;
4405
- 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))
44064691 {
44074692 Object3D child = (Object3D)e.nextElement();
44084693
....@@ -4436,14 +4721,14 @@
44364721 //Object3D cb = Applet3D.clipboard;
44374722 //temp.addChild(cb);
44384723 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4439
- assert(GrafreeD.clipboard.parent == null);
4440
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4441
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4442
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4443
- 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());
44444729 else
4445
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4446
- GrafreeD.clipboard.get(0).parent = keepparent;
4730
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4731
+ Grafreed.clipboard.get(0).parent = keepparent;
44474732 }
44484733
44494734 ResetModel();
....@@ -4492,9 +4777,9 @@
44924777 {
44934778 boolean first = true;
44944779
4495
- if (GrafreeD.clipboardIsTempGroup)
4780
+ if (Grafreed.clipboardIsTempGroup)
44964781 {
4497
- Composite temp = (Composite)GrafreeD.clipboard;
4782
+ Composite temp = (Composite)Grafreed.clipboard;
44984783 Object3D copy;
44994784 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45004785 {
....@@ -4504,7 +4789,7 @@
45044789 }
45054790 } else
45064791 {
4507
- linkSomething(GrafreeD.clipboard); //.get(0));
4792
+ linkSomething(Grafreed.clipboard); //.get(0));
45084793 }
45094794 }
45104795 }
....@@ -4909,21 +5194,6 @@
49095194 }
49105195 */
49115196
4912
- void ImportGFD()
4913
- {
4914
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4915
- browser.show();
4916
- String filename = browser.getFile();
4917
- if (filename != null && filename.length() > 0)
4918
- {
4919
- String fullname = browser.getDirectory() + filename;
4920
-
4921
- //Object3D readobj =
4922
- objEditor.ReadGFD(fullname, objEditor);
4923
- //makeSomething(readobj);
4924
- }
4925
- }
4926
-
49275197 /*
49285198 public void Callback(Object obj)
49295199 {
....@@ -4947,26 +5217,9 @@
49475217 }
49485218 */
49495219
4950
- void ImportVRMLX3D()
4951
- {
4952
- if (GrafreeD.standAlone)
4953
- {
4954
- /**/
4955
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4956
- browser.show();
4957
- String filename = browser.getFile();
4958
- if (filename != null && filename.length() > 0)
4959
- {
4960
- String fullname = browser.getDirectory() + filename;
4961
- LoadVRMLX3D(fullname);
4962
- }
4963
- /**/
4964
- }
4965
- }
4966
-
49675220 String GetFile(String dialogName)
49685221 {
4969
- if (GrafreeD.standAlone)
5222
+ if (Grafreed.standAlone)
49705223 {
49715224 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49725225 browser.show();
....@@ -5034,6 +5287,12 @@
50345287 cButton clearpanelButton;
50355288 cButton unselectButton;
50365289
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
5293
+ cButton undoButton;
5294
+ cButton redoButton;
5295
+ cButton saveButton;
50375296 cButton oneStepButton;
50385297
50395298 cButton screenfitButton;
....@@ -5047,14 +5306,6 @@
50475306
50485307 cButton setsupportButton;
50495308
5050
- cButton twoButton;
5051
- cButton sixButton;
5052
- cButton threeButton;
5053
- cButton sevenButton;
5054
- cButton fourButton; // full panel
5055
- cButton oneButton; // full XYZ
5056
- //cButton currentLayout;
5057
-
50585309 //
50595310 //Composite
50605311 Object3D // to do !!
....@@ -5066,6 +5317,8 @@
50665317 private MenuItem lookFromItem;
50675318 private MenuItem switchItem;
50685319 private MenuItem cutItem;
5320
+ private MenuItem undoItem;
5321
+ private MenuItem redoItem;
50695322 private MenuItem duplicateItem;
50705323 private MenuItem cloneItem;
50715324 private MenuItem cloneSupportItem;
....@@ -5079,7 +5332,7 @@
50795332 private MenuItem linkverticesItem;
50805333 private MenuItem relinkverticesItem;
50815334 private MenuItem setMasterItem;
5082
- private MenuItem resetMeshItem;
5335
+ private MenuItem resetAllItem;
50835336 private MenuItem stepAllItem;
50845337 private MenuItem revertMeshItem;
50855338 private MenuItem poseMeshItem;
....@@ -5129,6 +5382,10 @@
51295382 private MenuItem showleavesItem;
51305383 private MenuItem markleavesItem;
51315384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
51325389
51335390 private MenuItem flipVItem;
51345391 private MenuItem unflipVItem;
....@@ -5140,8 +5397,10 @@
51405397 private MenuItem panoTexturesItem;
51415398
51425399 private MenuItem resetCentroidItem;
5143
- private MenuItem transformgeometryItem;
5400
+ private MenuItem resetCentroidXZItem;
51445401 private MenuItem resetTransformItem;
5402
+ private MenuItem transformGeometryItem;
5403
+ private MenuItem transformChildrenItem;
51455404 private MenuItem hideItem;
51465405 private MenuItem grabItem;
51475406 private MenuItem backItem;
....@@ -5210,11 +5469,6 @@
52105469 private MenuItem doubleItem;
52115470 private MenuItem tripleItem;
52125471
5213
- private MenuItem importGFDItem;
5214
- private MenuItem importVRMLX3DItem;
5215
- private MenuItem import3DSItem;
5216
- private MenuItem importOBJItem;
5217
-
52185472 private MenuItem computeAOItem;
52195473 private MenuItem recompileItem;
52205474 private MenuItem editScriptItem;
....@@ -5224,4 +5478,8 @@
52245478 private MenuItem analyzeItem;
52255479 private MenuItem dumpItem;
52265480 //boolean freezemodel = false;
5481
+
5482
+ Menu cameraMenu;
5483
+ MenuItem editCameraItem;
5484
+ MenuItem revertCameraItem;
52275485 }