Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
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"));
....@@ -185,7 +176,6 @@
185176 copyItem.addActionListener(this);
186177 pasteItem = menu.add(new MenuItem("Paste"));
187178 pasteItem.addActionListener(this);
188
- menu.add("-");
189179
190180 menu.add("-");
191181 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -206,14 +196,97 @@
206196 clearAllItem = menu.add(new MenuItem("Clear All"));
207197 clearAllItem.addActionListener(this);
208198 }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
209235
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
274
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
+ //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
277
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278
+ oe.cameraMenu.add("-");
279
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
280
+ openWindowItem.addActionListener(this);
281
+ editLeafItem.addActionListener(this);
282
+ lookAtItem.addActionListener(this);
283
+ //lookFromItem.addActinoListener(this);
284
+ //switchItem.addActionListener(this);
285
+ }
286
+
210287 oe.menuBar.add(menu = new Menu("Setting"));
211288 if (Globals.ADVANCED)
212289 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218291 revertMeshItem.addActionListener(this);
219292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -295,11 +368,11 @@
295368 billboardItem.addActionListener(this);
296369 csgItem = menu.add(new MenuItem("CSG"));
297370 csgItem.addActionListener(this);
298
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
299372 shadowXItem.addActionListener(this);
300
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
301374 shadowYItem.addActionListener(this);
302
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
303376 shadowZItem.addActionListener(this);
304377 if (Globals.ADVANCED)
305378 {
....@@ -318,8 +391,12 @@
318391 resetTransformItem.addActionListener(this);
319392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320393 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
323400
324401 oe.menuBar.add(menu = new Menu("Geometry"));
325402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -368,6 +445,10 @@
368445 oe.menuBar.add(menu = new Menu("Attributes"));
369446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
371452 menu.add("-");
372453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
373454 liveleavesItem.addActionListener(this);
....@@ -388,6 +469,14 @@
388469 markleavesItem.addActionListener(this);
389470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
390471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
391480 menu.add("-");
392481 flipVItem = menu.add(new MenuItem("Flip V"));
393482 flipVItem.addActionListener(this);
....@@ -422,38 +511,41 @@
422511 sortbysizeItem.addActionListener(this);
423512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424513 sortbynameItem.addActionListener(this);
514
+ menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
425519 if (Globals.ADVANCED)
426520 {
427
- menu.add("-");
521
+ // Pretty much the same as duplicate and clone.
428522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429523 extractGeometriesItem.addActionListener(this);
430524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431525 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);
436526 }
437527
438528 oe.menuBar.add(menu = new Menu("Insert"));
439529 buildCreateMenu(menu);
440530
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
-
451531 oe.menuBar.add(menu = new Menu("Tools"));
452532 buildToolsMenu(menu);
453533 }
454534
455535 void SetupUI2(ObjEditor oe)
456536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
457549 //new Exception().printStackTrace();
458550
459551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -484,11 +576,35 @@
484576 */
485577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
486578
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
487603 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
- liveCB.setToolTipText("Enabled animation");
604
+ liveCB.setToolTipText("Enable animation");
489605 liveCB.addItemListener(this);
490606
491
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492608 oneStepButton.setToolTipText("Animate one step forward");
493609 oneStepButton.addActionListener(this);
494610
....@@ -496,11 +612,11 @@
496612 fastCB.setToolTipText("Fast mode");
497613 fastCB.addItemListener(this);
498614
499
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
500616 trackCB.setToolTipText("Enable tracking");
501617 trackCB.addItemListener(this);
502618
503
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504620 screenfitButton.setToolTipText("Screen fit");
505621 screenfitButton.addActionListener(this);
506622
....@@ -509,70 +625,68 @@
509625
510626 if (Globals.ADVANCED)
511627 {
512
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
513629 snapobjectButton.addActionListener(this);
514630 snapobjectButton.setToolTipText("Snap Object");
515631 }
516632
517
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
518634 flashSelectionButton.setToolTipText("Show selection");
519635 flashSelectionButton.addActionListener(this);
520636
521637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522638
523
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
524640 twoButton.setToolTipText("Show center view only");
525641 twoButton.addActionListener(this);
526
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527643 fourButton.addActionListener(this);
528644 fourButton.setToolTipText("Show left panel only");
529
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530646 sixButton.setToolTipText("2-column layout left");
531647 sixButton.addActionListener(this);
532
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533649 threeButton.setToolTipText("2-column layout right");
534650 threeButton.addActionListener(this);
535
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536652 sevenButton.setToolTipText("3-column layout");
537653 sevenButton.addActionListener(this);
538654 //
539655
540
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541657 rootButton.setToolTipText("Edit selection in new tab");
542658 rootButton.addActionListener(this);
543659
544
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
545661 closeButton.setToolTipText("Close tab");
546662 closeButton.addActionListener(this);
547663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
548664 //clearButton.addActionListener(this);
549665
550
- cGridBag commandsPanel = new cGridBag();
551
-
552
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553667 editButton.setToolTipText("Edit selection");
554668 editButton.addActionListener(this);
555669
556
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557671 uneditButton.setToolTipText("Unedit selection");
558672 uneditButton.addActionListener(this);
559673
560
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561675 allParamsButton.setToolTipText("Edit all params");
562676 allParamsButton.addActionListener(this);
563677
564
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565679 clearPanelButton.setToolTipText("Clear edit panel");
566680 clearPanelButton.addActionListener(this);
567681
568
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569683 unselectButton.setToolTipText("Unselect");
570684 unselectButton.addActionListener(this);
571685
572
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
573687
574
- oe.treePanel.add(commandsPanel);
575
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
576690
577691 // oe.aConstraints.gridx += 1;
578692 // oe.aConstraints.weighty = 0;
....@@ -648,7 +762,7 @@
648762 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649763 zoomBoxCB.addItemListener(this);
650764
651
- if (Globals.ADVANCED)
765
+ if (true) // Globals.ADVANCED)
652766 {
653767 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654768 supportCB.setToolTipText("Enable rigging");
....@@ -721,8 +835,11 @@
721835 buttonGroup.add(radioButton);
722836 radioButton.doClick();
723837 }
838
+
724839 void SetupViews(ObjEditor oe)
725840 {
841
+ theFrame = this;
842
+
726843 oe.SetupViews();
727844
728845 System.out.println("SetupViews");
....@@ -785,6 +902,7 @@
785902 } else if(e.getSource() == liveCB)
786903 {
787904 cameraView.ToggleLive();
905
+ refreshContents(false);
788906 }
789907 else if(e.getSource() == supportCB)
790908 {
....@@ -937,7 +1055,9 @@
9371055 // objEditor.DropFile((java.io.File[]) object, true);
9381056 // return;
9391057 // }
940
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9411061 {
9421062 // file(s)
9431063 String[] names = string.split("\n");
....@@ -964,7 +1084,7 @@
9641084
9651085 flashIt = false;
9661086 CameraPane pane = (CameraPane) target;
967
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9681088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9691089
9701090 if (group.selection.size() == 1)
....@@ -1190,7 +1310,7 @@
11901310 memoryItem.addActionListener(this);
11911311 menu.add(analyzeItem = new MenuItem("Analyze"));
11921312 analyzeItem.addActionListener(this);
1193
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11941314 dumpItem.addActionListener(this);
11951315 // menu.add(pathItem = new MenuItem("From-to path"));
11961316 // pathItem.addActionListener(this);
....@@ -1331,6 +1451,7 @@
13311451 shadow.material = new cMaterial(obj.material);
13321452 shadow.material.diffuse = 0.0001f;
13331453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
13341455
13351456 makeSomething(shadow);
13361457 }
....@@ -1537,9 +1658,9 @@
15371658
15381659 void Overwrite(int mask)
15391660 {
1540
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15411662 {
1542
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
15431664
15441665 if (content instanceof cGroup && ((cGroup)content).transientlink )
15451666 content = ((cGroup)content).get(0);
....@@ -1844,23 +1965,6 @@
18441965 csg.addChild(child);
18451966 child.addChild(csg);
18461967 } 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
18641968 if (source == computeAOItem)
18651969 {
18661970 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1879,7 +1983,7 @@
18791983 if (source == invariantsItem)
18801984 {
18811985 System.out.println("Invariants:");
1882
- GrafreeD.grafreeD.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
18831987 } else
18841988 if (source == memoryItem)
18851989 {
....@@ -1897,6 +2001,30 @@
18972001 if (source == dumpItem)
18982002 {
18992003 DumpObject();
2004
+ } else
2005
+ if (source == minButton)
2006
+ {
2007
+ Minimize();
2008
+ } else
2009
+ if (source == maxButton)
2010
+ {
2011
+ Maximize();
2012
+ } else
2013
+ if (source == fullButton)
2014
+ {
2015
+ ToggleFullScreen();
2016
+ } else
2017
+ if (source == undoButton)
2018
+ {
2019
+ Undo();
2020
+ } else
2021
+ if (source == redoButton)
2022
+ {
2023
+ Redo();
2024
+ } else
2025
+ if (source == saveButton)
2026
+ {
2027
+ Save();
19002028 } else
19012029 if (source == oneStepButton)
19022030 {
....@@ -1952,12 +2080,20 @@
19522080 {
19532081 loadClipboard(true);
19542082 } else
2083
+ if (source == undoItem)
2084
+ {
2085
+ Undo();
2086
+ } else
2087
+ if (source == redoItem)
2088
+ {
2089
+ Redo();
2090
+ } else
19552091 if (source == duplicateItem)
19562092 {
1957
- Object3D keep = GrafreeD.clipboard;
2093
+ Object3D keep = Grafreed.clipboard;
19582094 loadClipboard(false);
19592095 paste(false);
1960
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
19612097 } else
19622098 if (source == cloneItem)
19632099 {
....@@ -2177,9 +2313,9 @@
21772313 // group.selection.get(0).setMasterThis(content); // should be identity
21782314 // refreshContents();
21792315 // }
2180
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21812317 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
21832319
21842320 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852321 content = ((cGroup)content).get(0);
....@@ -2229,9 +2365,9 @@
22292365 } else
22302366 if (source == setMasterItem)
22312367 {
2232
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22332369 {
2234
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
22352371
22362372 if (content instanceof cGroup && ((cGroup)content).transientlink )
22372373 content = ((cGroup)content).get(0);
....@@ -2244,9 +2380,9 @@
22442380 {
22452381 if (group.selection.size() == 1)
22462382 {
2247
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
22482384 {
2249
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
22502386
22512387 if (content instanceof cGroup && ((cGroup)content).transientlink )
22522388 content = ((cGroup)content).get(0);
....@@ -2263,7 +2399,7 @@
22632399 {
22642400 RevertMeshes();
22652401 } else
2266
- if (source == resetMeshItem)
2402
+ if (source == resetAllItem)
22672403 {
22682404 ResetAll();
22692405 } else
....@@ -2451,7 +2587,7 @@
24512587 } else
24522588 if (source == genNormalsMESHItem)
24532589 {
2454
- GenNormals(true); // TODO
2590
+ GenNormalsMESH();
24552591 } else
24562592 if (source == genNormalsORGANItem)
24572593 {
....@@ -2516,6 +2652,22 @@
25162652 if (source == unmarkleavesItem)
25172653 {
25182654 MarkLeaves(false);
2655
+ } else
2656
+ if (source == rewindleavesItem)
2657
+ {
2658
+ RewindLeaves(true);
2659
+ } else
2660
+ if (source == unrewindleavesItem)
2661
+ {
2662
+ RewindLeaves(false);
2663
+ } else
2664
+ if (source == randomleavesItem)
2665
+ {
2666
+ RandomLeaves(true);
2667
+ } else
2668
+ if (source == unrandomleavesItem)
2669
+ {
2670
+ RandomLeaves(false);
25192671 } else
25202672 if (source == flipVItem)
25212673 {
....@@ -2601,9 +2753,13 @@
26012753 {
26022754 SmoothMesh();
26032755 } else
2604
- if (source == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
26052757 {
26062758 TransformGeometry();
2759
+ } else
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
26072763 } else
26082764 if (source == resetTransformItem)
26092765 {
....@@ -2611,7 +2767,11 @@
26112767 } else
26122768 if (source == resetCentroidItem)
26132769 {
2614
- ResetCentroid();
2770
+ ResetCentroid(true);
2771
+ } else
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
26152775 } else
26162776 if (source == resetParentItem)
26172777 {
....@@ -2775,6 +2935,24 @@
27752935 bigThree.ClearUI();
27762936 bigThree.add(centralPanel);
27772937 bigThree.FlushUI();
2938
+
2939
+ cameraView.requestFocusInWindow();
2940
+
2941
+// refreshContents(true);
2942
+//
2943
+// try
2944
+// {
2945
+// java.awt.Robot bot = new java.awt.Robot();
2946
+// int mask = InputEvent.BUTTON1_MASK;
2947
+// bot.mouseMove(100, 100);
2948
+// bot.mousePress(mask);
2949
+// bot.mouseRelease(mask);
2950
+// }
2951
+// catch (Exception e)
2952
+// {
2953
+//
2954
+// }
2955
+
27782956 } else
27792957 if (source == threeButton)
27802958 {
....@@ -2811,6 +2989,8 @@
28112989 bigThree.add(centralPanel);
28122990 bigThree.add(XYZPanel);
28132991 bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
28142994 } else
28152995 if (source == fourButton)
28162996 {
....@@ -2846,6 +3026,8 @@
28463026 bigThree.ClearUI();
28473027 bigThree.add(scenePanel);
28483028 bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
28493031 } else
28503032 if (source == sixButton)
28513033 {
....@@ -2882,6 +3064,8 @@
28823064 bigThree.add(scenePanel);
28833065 bigThree.add(centralPanel);
28843066 bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
28853069 } else
28863070 if (source == sevenButton)
28873071 {
....@@ -2919,6 +3103,8 @@
29193103 bigThree.add(centralPanel);
29203104 bigThree.add(XYZPanel);
29213105 bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
29223108 } else
29233109 if (source == rootButton)
29243110 {
....@@ -2930,6 +3116,7 @@
29303116 EditObject(obj);
29313117 }
29323118
3119
+ cameraView.requestFocusInWindow();
29333120 refreshContents(true);
29343121 } else
29353122 if (source == closeButton)
....@@ -2951,6 +3138,8 @@
29513138 break;
29523139 }
29533140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
29543143 refreshContents(true);
29553144 } else
29563145 if (source == editItem || source == editButton)
....@@ -2967,7 +3156,7 @@
29673156 child.CloseUI();
29683157 listUI.remove(child);
29693158
2970
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
29713160 }
29723161 objEditor.ctrlPanel.FlushUI();
29733162 //objEditor.jTree.clearSelection();
....@@ -3053,7 +3242,10 @@
30533242 frontView.object = group;
30543243 sideView.object = group;
30553244 }
3056
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
30573249 /*
30583250 currentLayout = radio.layout;
30593251 if (currentLayout == null)
....@@ -3065,8 +3257,23 @@
30653257 //group.parent = null; // ROOT
30663258 //group.attributes = -1;
30673259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
30683262 refreshContents(true);
3069
- }
3263
+ } else if (event.getSource() == editCameraItem)
3264
+ {
3265
+ cameraView.ProtectCamera();
3266
+ cameraView.repaint();
3267
+ return;
3268
+ } else if (event.getSource() == revertCameraItem)
3269
+ {
3270
+ cameraView.RevertCamera();
3271
+ cameraView.repaint();
3272
+ return;
3273
+ // } else if (event.getSource() == textureButton)
3274
+ // {
3275
+ // return; // true;
3276
+ }
30703277 else
30713278 {
30723279 //return super.action(event, arg);
....@@ -3075,7 +3282,6 @@
30753282 }
30763283
30773284 boolean useclient = false;
3078
- cRadio radio;
30793285
30803286 void ToggleRoot()
30813287 {
....@@ -3127,6 +3333,28 @@
31273333 refreshContents();
31283334 }
31293335
3336
+ void TransformChildren()
3337
+ {
3338
+ Object3D obj;
3339
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3340
+ {
3341
+ obj = (Object3D)e.nextElement();
3342
+ obj.KeepTextureMatrices();
3343
+ obj.TransformChildren();
3344
+ obj.RestoreTextureMatrices();
3345
+
3346
+// if (obj.parent == null)
3347
+// {
3348
+// System.out.println("NULL PARENT!");
3349
+// new Exception().printStackTrace();
3350
+// }
3351
+// else
3352
+// TouchTransform(obj);
3353
+// //obj.parent.Touch();
3354
+ }
3355
+
3356
+ refreshContents();
3357
+ }
31303358
31313359 void ResetTransform()
31323360 {
....@@ -3239,7 +3467,7 @@
32393467 refreshContents();
32403468 }
32413469
3242
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
32433471 {
32443472 Object3D obj;
32453473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3254,12 +3482,16 @@
32543482 LA.matIdentity(Object3D.mat);
32553483 obj.getBounds(minima, maxima, false);
32563484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3257
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32583487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32593488 obj.TransformMesh(Object3D.mat);
3489
+
32603490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3261
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32623493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
32633495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32643496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32653497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3288,7 +3520,8 @@
32883520
32893521 int size = obj.MemorySize();
32903522
3291
- System.err.println((size/1024) + " KB is the size of " + obj);
3523
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3524
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32923525 }
32933526 }
32943527 catch (Exception e)
....@@ -3325,9 +3558,9 @@
33253558 obj = (Object3D)e.nextElement();
33263559
33273560 System.out.println("Object is: " + obj);
3328
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
33293562 System.out.println("Boundary rep: " + obj.bRep);
3330
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
33313564
33323565 // System.err.println((size/1024) + " KB is the size of " + obj);
33333566 }
....@@ -3369,6 +3602,13 @@
33693602 void GenNormals(boolean crease)
33703603 {
33713604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
33723612
33733613 refreshContents();
33743614 }
....@@ -3541,8 +3781,8 @@
35413781
35423782 void ParseVertices()
35433783 {
3544
- boolean epsequal = GrafreeD.epsequal;
3545
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
35463786
35473787 for (int i=0; i<group.selection.size(); i++)
35483788 {
....@@ -3567,7 +3807,7 @@
35673807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35683808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35693809
3570
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
35713811
35723812 buffer.add(g);
35733813 }
....@@ -3582,7 +3822,7 @@
35823822 makeSomething(buffer, i==group.selection.size()-1);
35833823 }
35843824
3585
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
35863826
35873827 refreshContents();
35883828 }
....@@ -3600,7 +3840,16 @@
36003840 String pigment = Object3D.GetPigment(tex);
36013841 //String bump = Object3D.GetBump(tex);
36023842
3603
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3843
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3844
+
3845
+ try
3846
+ {
3847
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3848
+ }
3849
+ catch (Exception e)
3850
+ {
3851
+ System.err.println("FAIL: " + node);
3852
+ }
36043853
36053854 double s = v.s;
36063855
....@@ -3732,7 +3981,7 @@
37323981 return;
37333982
37343983 Object3D poses = group.selection.get(0);
3735
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
37363985
37373986 Object3D newgroup = new Object3D("Po:" + poses.name);
37383987
....@@ -3926,9 +4175,9 @@
39264175
39274176 void ClipMesh()
39284177 {
3929
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39304179 {
3931
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
39324181
39334182 if (content instanceof cGroup && ((cGroup)content).transientlink )
39344183 content = ((cGroup)content).get(0);
....@@ -3937,7 +4186,7 @@
39374186 // {
39384187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39394188 // }
3940
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
39414190 }
39424191 // group.selection.ClipMesh(GrafreeD.clipboard);
39434192 System.out.println("DONE.");
....@@ -3984,6 +4233,18 @@
39844233 void MarkLeaves(boolean hide)
39854234 {
39864235 group.selection.MarkLeaves(hide);
4236
+ refreshContents();
4237
+ }
4238
+
4239
+ void RewindLeaves(boolean hide)
4240
+ {
4241
+ group.selection.RewindLeaves(hide);
4242
+ refreshContents();
4243
+ }
4244
+
4245
+ void RandomLeaves(boolean hide)
4246
+ {
4247
+ group.selection.RandomLeaves(hide);
39874248 refreshContents();
39884249 }
39894250
....@@ -4072,7 +4333,7 @@
40724333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40734334
40744335 Object3D elem = (Object3D)group.selection.elementAt(i);
4075
- if(elem != group)
4336
+ if(elem != group || !newWindow)
40764337 {
40774338 // if (!(elem instanceof Composite))
40784339 // newWindow = false;
....@@ -4162,7 +4423,6 @@
41624423 //case 702: // Event.LIST_DESELECT
41634424 group.deselectAll();
41644425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4165
- objEditor.ClearInfo(); // .GetMaterial());
41664426 if (tps != null)
41674427 {
41684428 for (int i=0; i < tps.length; i++)
....@@ -4171,10 +4431,8 @@
41714431
41724432 //if (child.parent != null)
41734433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
41744435 group.addSelectee(child);
4175
- objEditor.SetMaterial(child); // .GetMaterial());
4176
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4177
- System.err.println("info : " + child.GetPath());
41784436 }
41794437 }
41804438 // else
....@@ -4184,16 +4442,17 @@
41844442 // System.err.println("info : " + group.GetPath());
41854443 // }
41864444
4187
- objEditor.SetText(); // jan 2014
4188
-
4189
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4445
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41904446 CameraPane.flash = true;
41914447
4192
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41934449 // a camera
41944450 {
4195
- CameraPane.camerachangeframe = 0; // don't refuse it
4196
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4451
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4452
+ {
4453
+ CameraPane.camerachangeframe = 0; // don't refuse it
4454
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4455
+ }
41974456 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41984457 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41994458 }
....@@ -4206,6 +4465,26 @@
42064465
42074466 freezemodel = false;
42084467 }
4468
+
4469
+ void refreshContents(boolean cp)
4470
+ {
4471
+ if (!Globals.MOUSEDRAGGED)
4472
+ {
4473
+ objEditor.ClearInfo(); // .GetMaterial());
4474
+
4475
+ for (int i=0; i < group.selection.Size(); i++)
4476
+ {
4477
+ Object3D child = (Object3D) group.selection.get(i);
4478
+
4479
+ objEditor.AddInfo(child, this, true);
4480
+ System.err.println("info : " + child.GetPath());
4481
+ }
4482
+
4483
+ objEditor.SetText(); // jan 2014
4484
+ }
4485
+
4486
+ super.refreshContents(cp);
4487
+ }
42094488
42104489 void linkSomething(Object3D thing)
42114490 {
....@@ -4277,16 +4556,18 @@
42774556 {
42784557 if (group.selection.isEmpty())
42794558 return;
4280
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
42814561 Composite tGroup = null;
42824562 if (group.selection.size() > 0) // 1)
42834563 {
42844564 tGroup = new cGroup();
4285
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
42864566 }
42874567
42884568 if (cut)
42894569 {
4570
+ Save();
42904571 //int indices[] = jList.getSelectedIndices();
42914572 //for (int i = indices.length - 1; i >= 0; i--)
42924573 //jList.remove(indices[i]);
....@@ -4322,16 +4603,16 @@
43224603 //System.out.println("cut " + child);
43234604 //System.out.println("parent = " + child.parent);
43244605 // tmp.addChild(child);
4325
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
43264607 tGroup.add/*Child*/(tmp);
43274608 else
4328
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
43294610 }
43304611 else
4331
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
43324613 tGroup.add/*Child*/(child);
43334614 else
4334
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
43354616 }
43364617
43374618 //ResetModel();
....@@ -4363,21 +4644,23 @@
43634644 //System.out.println("cut " + elem);
43644645 //System.out.println("parent = " + elem.parent);
43654646 // tmp.addChild(elem);
4366
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
43674648 tGroup.add/*Child*/(tmp);
43684649 else
4369
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
43704651 }
43714652 else
4372
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
43734654 tGroup.add/*Child*/(child);
43744655 else
4375
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
43764657 }
43774658
43784659 }
4379
- if (GrafreeD.clipboardIsTempGroup)
4380
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
43814664 if (cut)
43824665 {
43834666 ResetModel();
....@@ -4391,7 +4674,7 @@
43914674 // return;
43924675 boolean first = true;
43934676
4394
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
43954678 {
43964679 Composite temp;
43974680
....@@ -4402,7 +4685,7 @@
44024685 temp = (Composite)Applet3D.clipboard.deepCopy();
44034686 */
44044687 Object3D elem;
4405
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4688
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44064689 {
44074690 Object3D child = (Object3D)e.nextElement();
44084691
....@@ -4436,14 +4719,14 @@
44364719 //Object3D cb = Applet3D.clipboard;
44374720 //temp.addChild(cb);
44384721 //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());
4722
+ assert(Grafreed.clipboard.parent == null);
4723
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4724
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4725
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4726
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44444727 else
4445
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4446
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
44474730 }
44484731
44494732 ResetModel();
....@@ -4492,9 +4775,9 @@
44924775 {
44934776 boolean first = true;
44944777
4495
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
44964779 {
4497
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
44984781 Object3D copy;
44994782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45004783 {
....@@ -4504,7 +4787,7 @@
45044787 }
45054788 } else
45064789 {
4507
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
45084791 }
45094792 }
45104793 }
....@@ -4909,21 +5192,6 @@
49095192 }
49105193 */
49115194
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
-
49275195 /*
49285196 public void Callback(Object obj)
49295197 {
....@@ -4947,26 +5215,9 @@
49475215 }
49485216 */
49495217
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
-
49675218 String GetFile(String dialogName)
49685219 {
4969
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
49705221 {
49715222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49725223 browser.show();
....@@ -5034,6 +5285,12 @@
50345285 cButton clearpanelButton;
50355286 cButton unselectButton;
50365287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
50375294 cButton oneStepButton;
50385295
50395296 cButton screenfitButton;
....@@ -5047,14 +5304,6 @@
50475304
50485305 cButton setsupportButton;
50495306
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
-
50585307 //
50595308 //Composite
50605309 Object3D // to do !!
....@@ -5066,6 +5315,8 @@
50665315 private MenuItem lookFromItem;
50675316 private MenuItem switchItem;
50685317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
50695320 private MenuItem duplicateItem;
50705321 private MenuItem cloneItem;
50715322 private MenuItem cloneSupportItem;
....@@ -5079,7 +5330,7 @@
50795330 private MenuItem linkverticesItem;
50805331 private MenuItem relinkverticesItem;
50815332 private MenuItem setMasterItem;
5082
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
50835334 private MenuItem stepAllItem;
50845335 private MenuItem revertMeshItem;
50855336 private MenuItem poseMeshItem;
....@@ -5129,6 +5380,10 @@
51295380 private MenuItem showleavesItem;
51305381 private MenuItem markleavesItem;
51315382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
51325387
51335388 private MenuItem flipVItem;
51345389 private MenuItem unflipVItem;
....@@ -5140,8 +5395,10 @@
51405395 private MenuItem panoTexturesItem;
51415396
51425397 private MenuItem resetCentroidItem;
5143
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
51445399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
51455402 private MenuItem hideItem;
51465403 private MenuItem grabItem;
51475404 private MenuItem backItem;
....@@ -5210,11 +5467,6 @@
52105467 private MenuItem doubleItem;
52115468 private MenuItem tripleItem;
52125469
5213
- private MenuItem importGFDItem;
5214
- private MenuItem importVRMLX3DItem;
5215
- private MenuItem import3DSItem;
5216
- private MenuItem importOBJItem;
5217
-
52185470 private MenuItem computeAOItem;
52195471 private MenuItem recompileItem;
52205472 private MenuItem editScriptItem;
....@@ -5224,4 +5476,8 @@
52245476 private MenuItem analyzeItem;
52255477 private MenuItem dumpItem;
52265478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
52275483 }