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,29 +148,28 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
- if (Globals.ADVANCED)
154
- {
155
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
156
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
157
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
158
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
159
- oe.cameraMenu.add("-");
160
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
161
- openWindowItem.addActionListener(this);
162
- editLeafItem.addActionListener(this);
163
- lookAtItem.addActionListener(this);
164
- //lookFromItem.addActinoListener(this);
165
- //switchItem.addActionListener(this);
166
- }
167
-
168153 Menu menu;
169154 oe.menuBar.add(menu = new Menu("Edit"));
170155 //editItem = menu.add(new MenuItem("Edit"));
171156 //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
172163 duplicateItem = menu.add(new MenuItem("Duplicate"));
173164 duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
174173 cutItem = menu.add(new MenuItem("Cut"));
175174 cutItem.addActionListener(this);
176175 copyItem = menu.add(new MenuItem("Copy"));
....@@ -178,10 +177,7 @@
178177 pasteItem = menu.add(new MenuItem("Paste"));
179178 pasteItem.addActionListener(this);
180179 menu.add("-");
181
- cloneItem = menu.add(new MenuItem("Clone"));
182
- cloneItem.addActionListener(this);
183
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
- cloneSupportItem.addActionListener(this);
180
+
185181 menu.add("-");
186182 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187183 pasteIntoItem.addActionListener(this);
....@@ -201,14 +197,97 @@
201197 clearAllItem = menu.add(new MenuItem("Clear All"));
202198 clearAllItem.addActionListener(this);
203199 }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
204236
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(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
+
205288 oe.menuBar.add(menu = new Menu("Setting"));
206289 if (Globals.ADVANCED)
207290 {
208
- resetMeshItem = menu.add(new MenuItem("Reset All"));
209
- resetMeshItem.addActionListener(this);
210
- stepAllItem = menu.add(new MenuItem("Step All"));
211
- stepAllItem.addActionListener(this);
212291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
213292 revertMeshItem.addActionListener(this);
214293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -272,6 +351,7 @@
272351
273352 if (Globals.ADVANCED)
274353 {
354
+ menu.add("-");
275355 physicsItem = menu.add(new MenuItem("Physics"));
276356 physicsItem.addActionListener(this);
277357 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
....@@ -297,6 +377,7 @@
297377 shadowZItem.addActionListener(this);
298378 if (Globals.ADVANCED)
299379 {
380
+ menu.add("-");
300381 linkerItem = menu.add(new MenuItem("Linker"));
301382 linkerItem.addActionListener(this);
302383 attributeItem = menu.add(new MenuItem("Attribute"));
....@@ -305,14 +386,18 @@
305386 templateItem.addActionListener(this);
306387 pointflowItem = menu.add(new MenuItem("Point Flow"));
307388 pointflowItem.addActionListener(this);
308
- menu.add("-");
309389 }
390
+ menu.add("-");
310391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311392 resetTransformItem.addActionListener(this);
312393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
313394 resetCentroidItem.addActionListener(this);
314
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
316401
317402 oe.menuBar.add(menu = new Menu("Geometry"));
318403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -361,6 +446,10 @@
361446 oe.menuBar.add(menu = new Menu("Attributes"));
362447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
363448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
364453 menu.add("-");
365454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
366455 liveleavesItem.addActionListener(this);
....@@ -381,6 +470,14 @@
381470 markleavesItem.addActionListener(this);
382471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
383472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
384481 menu.add("-");
385482 flipVItem = menu.add(new MenuItem("Flip V"));
386483 flipVItem.addActionListener(this);
....@@ -415,38 +512,41 @@
415512 sortbysizeItem.addActionListener(this);
416513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
417514 sortbynameItem.addActionListener(this);
515
+ menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
418520 if (Globals.ADVANCED)
419521 {
420
- menu.add("-");
522
+ // Pretty much the same as duplicate and clone.
421523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422524 extractGeometriesItem.addActionListener(this);
423525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424526 cloneGeometriesItem.addActionListener(this);
425
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
426
- shareGeometriesItem.addActionListener(this);
427
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
428
- mergeGeometriesItem.addActionListener(this);
429527 }
430528
431529 oe.menuBar.add(menu = new Menu("Insert"));
432530 buildCreateMenu(menu);
433531
434
- oe.menuBar.add(menu = new Menu("Include"));
435
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
- importGFDItem.addActionListener(this);
437
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
- importVRMLX3DItem.addActionListener(this);
439
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
440
- importOBJItem.addActionListener(this);
441
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
442
- import3DSItem.addActionListener(this);
443
-
444532 oe.menuBar.add(menu = new Menu("Tools"));
445533 buildToolsMenu(menu);
446534 }
447535
448536 void SetupUI2(ObjEditor oe)
449537 {
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
+
450550 //new Exception().printStackTrace();
451551
452552 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -477,11 +577,35 @@
477577 */
478578 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
479579
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
+
480604 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
- liveCB.setToolTipText("Enabled animation");
605
+ liveCB.setToolTipText("Enable animation");
482606 liveCB.addItemListener(this);
483607
484
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485609 oneStepButton.setToolTipText("Animate one step forward");
486610 oneStepButton.addActionListener(this);
487611
....@@ -489,11 +613,11 @@
489613 fastCB.setToolTipText("Fast mode");
490614 fastCB.addItemListener(this);
491615
492
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
493617 trackCB.setToolTipText("Enable tracking");
494618 trackCB.addItemListener(this);
495619
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
497621 screenfitButton.setToolTipText("Screen fit");
498622 screenfitButton.addActionListener(this);
499623
....@@ -502,39 +626,39 @@
502626
503627 if (Globals.ADVANCED)
504628 {
505
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
506630 snapobjectButton.addActionListener(this);
507631 snapobjectButton.setToolTipText("Snap Object");
508632 }
509633
510
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
634
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
511635 flashSelectionButton.setToolTipText("Show selection");
512636 flashSelectionButton.addActionListener(this);
513637
514638 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515639
516
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
640
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517641 twoButton.setToolTipText("Show center view only");
518642 twoButton.addActionListener(this);
519
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
643
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520644 fourButton.addActionListener(this);
521645 fourButton.setToolTipText("Show left panel only");
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
646
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523647 sixButton.setToolTipText("2-column layout left");
524648 sixButton.addActionListener(this);
525
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526650 threeButton.setToolTipText("2-column layout right");
527651 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
652
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
529653 sevenButton.setToolTipText("3-column layout");
530654 sevenButton.addActionListener(this);
531655 //
532656
533
- 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);
534658 rootButton.setToolTipText("Edit selection in new tab");
535659 rootButton.addActionListener(this);
536660
537
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538662 closeButton.setToolTipText("Close tab");
539663 closeButton.addActionListener(this);
540664 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -542,11 +666,11 @@
542666
543667 cGridBag commandsPanel = new cGridBag();
544668
545
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
669
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
546670 editButton.setToolTipText("Edit selection");
547671 editButton.addActionListener(this);
548672
549
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
673
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
550674 uneditButton.setToolTipText("Unedit selection");
551675 uneditButton.addActionListener(this);
552676
....@@ -554,11 +678,11 @@
554678 allParamsButton.setToolTipText("Edit all params");
555679 allParamsButton.addActionListener(this);
556680
557
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
681
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
558682 clearPanelButton.setToolTipText("Clear edit panel");
559683 clearPanelButton.addActionListener(this);
560684
561
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
685
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
562686 unselectButton.setToolTipText("Unselect");
563687 unselectButton.addActionListener(this);
564688
....@@ -641,7 +765,7 @@
641765 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642766 zoomBoxCB.addItemListener(this);
643767
644
- if (Globals.ADVANCED)
768
+ if (true) // Globals.ADVANCED)
645769 {
646770 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647771 supportCB.setToolTipText("Enable rigging");
....@@ -714,8 +838,11 @@
714838 buttonGroup.add(radioButton);
715839 radioButton.doClick();
716840 }
841
+
717842 void SetupViews(ObjEditor oe)
718843 {
844
+ theFrame = this;
845
+
719846 oe.SetupViews();
720847
721848 System.out.println("SetupViews");
....@@ -778,6 +905,7 @@
778905 } else if(e.getSource() == liveCB)
779906 {
780907 cameraView.ToggleLive();
908
+ refreshContents(false);
781909 }
782910 else if(e.getSource() == supportCB)
783911 {
....@@ -930,7 +1058,9 @@
9301058 // objEditor.DropFile((java.io.File[]) object, true);
9311059 // return;
9321060 // }
933
- if (string.charAt(0) == '/')
1061
+
1062
+ // File path for Mac and Windows
1063
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9341064 {
9351065 // file(s)
9361066 String[] names = string.split("\n");
....@@ -957,7 +1087,7 @@
9571087
9581088 flashIt = false;
9591089 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1090
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9611091 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9621092
9631093 if (group.selection.size() == 1)
....@@ -1164,13 +1294,13 @@
11641294 parseverticesItem.addActionListener(this);
11651295 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661296 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1297
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681298 alignItem.addActionListener(this);
11691299 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701300 reduceMorphItem.addActionListener(this);
11711301 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721302 reduce34MorphItem.addActionListener(this);
1173
-
1303
+ menu.add("-");
11741304 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751305 computeAOItem.addActionListener(this);
11761306
....@@ -1183,7 +1313,7 @@
11831313 memoryItem.addActionListener(this);
11841314 menu.add(analyzeItem = new MenuItem("Analyze"));
11851315 analyzeItem.addActionListener(this);
1186
- menu.add(dumpItem = new MenuItem("Dump"));
1316
+ menu.add(dumpItem = new MenuItem("Print"));
11871317 dumpItem.addActionListener(this);
11881318 // menu.add(pathItem = new MenuItem("From-to path"));
11891319 // pathItem.addActionListener(this);
....@@ -1530,9 +1660,9 @@
15301660
15311661 void Overwrite(int mask)
15321662 {
1533
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1663
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15341664 {
1535
- Object3D content = GrafreeD.clipboard.get(0);
1665
+ Object3D content = Grafreed.clipboard.get(0);
15361666
15371667 if (content instanceof cGroup && ((cGroup)content).transientlink )
15381668 content = ((cGroup)content).get(0);
....@@ -1837,23 +1967,6 @@
18371967 csg.addChild(child);
18381968 child.addChild(csg);
18391969 } else
1840
-
1841
- if (source == importGFDItem)
1842
- {
1843
- ImportGFD();
1844
- } else
1845
- if (source == importVRMLX3DItem)
1846
- {
1847
- ImportVRMLX3D();
1848
- } else
1849
- if (source == import3DSItem)
1850
- {
1851
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1852
- } else
1853
- if (source == importOBJItem)
1854
- {
1855
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1856
- } else
18571970 if (source == computeAOItem)
18581971 {
18591972 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1872,7 +1985,7 @@
18721985 if (source == invariantsItem)
18731986 {
18741987 System.out.println("Invariants:");
1875
- GrafreeD.grafreeD.universe.invariants();
1988
+ Grafreed.grafreeD.universe.invariants();
18761989 } else
18771990 if (source == memoryItem)
18781991 {
....@@ -1890,6 +2003,30 @@
18902003 if (source == dumpItem)
18912004 {
18922005 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();
18932030 } else
18942031 if (source == oneStepButton)
18952032 {
....@@ -1945,12 +2082,20 @@
19452082 {
19462083 loadClipboard(true);
19472084 } else
2085
+ if (source == undoItem)
2086
+ {
2087
+ Undo();
2088
+ } else
2089
+ if (source == redoItem)
2090
+ {
2091
+ Redo();
2092
+ } else
19482093 if (source == duplicateItem)
19492094 {
1950
- Object3D keep = GrafreeD.clipboard;
2095
+ Object3D keep = Grafreed.clipboard;
19512096 loadClipboard(false);
19522097 paste(false);
1953
- GrafreeD.clipboard = keep;
2098
+ Grafreed.clipboard = keep;
19542099 } else
19552100 if (source == cloneItem)
19562101 {
....@@ -2170,9 +2315,9 @@
21702315 // group.selection.get(0).setMasterThis(content); // should be identity
21712316 // refreshContents();
21722317 // }
2173
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2318
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21742319 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2320
+ Object3D content = Grafreed.clipboard.get(0);
21762321
21772322 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782323 content = ((cGroup)content).get(0);
....@@ -2222,9 +2367,9 @@
22222367 } else
22232368 if (source == setMasterItem)
22242369 {
2225
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2370
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22262371 {
2227
- Object3D content = GrafreeD.clipboard.get(0);
2372
+ Object3D content = Grafreed.clipboard.get(0);
22282373
22292374 if (content instanceof cGroup && ((cGroup)content).transientlink )
22302375 content = ((cGroup)content).get(0);
....@@ -2237,9 +2382,9 @@
22372382 {
22382383 if (group.selection.size() == 1)
22392384 {
2240
- if (GrafreeD.clipboard.size() == 1)
2385
+ if (Grafreed.clipboard.size() == 1)
22412386 {
2242
- Object3D content = GrafreeD.clipboard.get(0);
2387
+ Object3D content = Grafreed.clipboard.get(0);
22432388
22442389 if (content instanceof cGroup && ((cGroup)content).transientlink )
22452390 content = ((cGroup)content).get(0);
....@@ -2256,7 +2401,7 @@
22562401 {
22572402 RevertMeshes();
22582403 } else
2259
- if (source == resetMeshItem)
2404
+ if (source == resetAllItem)
22602405 {
22612406 ResetAll();
22622407 } else
....@@ -2444,7 +2589,7 @@
24442589 } else
24452590 if (source == genNormalsMESHItem)
24462591 {
2447
- GenNormals(true); // TODO
2592
+ GenNormalsMESH();
24482593 } else
24492594 if (source == genNormalsORGANItem)
24502595 {
....@@ -2509,6 +2654,22 @@
25092654 if (source == unmarkleavesItem)
25102655 {
25112656 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);
25122673 } else
25132674 if (source == flipVItem)
25142675 {
....@@ -2594,9 +2755,13 @@
25942755 {
25952756 SmoothMesh();
25962757 } else
2597
- if (source == transformgeometryItem)
2758
+ if (source == transformGeometryItem)
25982759 {
25992760 TransformGeometry();
2761
+ } else
2762
+ if (source == transformChildrenItem)
2763
+ {
2764
+ TransformChildren();
26002765 } else
26012766 if (source == resetTransformItem)
26022767 {
....@@ -2604,7 +2769,11 @@
26042769 } else
26052770 if (source == resetCentroidItem)
26062771 {
2607
- ResetCentroid();
2772
+ ResetCentroid(true);
2773
+ } else
2774
+ if (source == resetCentroidXZItem)
2775
+ {
2776
+ ResetCentroid(false);
26082777 } else
26092778 if (source == resetParentItem)
26102779 {
....@@ -2768,6 +2937,24 @@
27682937 bigThree.ClearUI();
27692938 bigThree.add(centralPanel);
27702939 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
+
27712958 } else
27722959 if (source == threeButton)
27732960 {
....@@ -2804,6 +2991,8 @@
28042991 bigThree.add(centralPanel);
28052992 bigThree.add(XYZPanel);
28062993 bigThree.FlushUI();
2994
+
2995
+ cameraView.requestFocusInWindow();
28072996 } else
28082997 if (source == fourButton)
28092998 {
....@@ -2839,6 +3028,8 @@
28393028 bigThree.ClearUI();
28403029 bigThree.add(scenePanel);
28413030 bigThree.FlushUI();
3031
+
3032
+ cameraView.requestFocusInWindow();
28423033 } else
28433034 if (source == sixButton)
28443035 {
....@@ -2875,6 +3066,8 @@
28753066 bigThree.add(scenePanel);
28763067 bigThree.add(centralPanel);
28773068 bigThree.FlushUI();
3069
+
3070
+ cameraView.requestFocusInWindow();
28783071 } else
28793072 if (source == sevenButton)
28803073 {
....@@ -2912,6 +3105,8 @@
29123105 bigThree.add(centralPanel);
29133106 bigThree.add(XYZPanel);
29143107 bigThree.FlushUI();
3108
+
3109
+ cameraView.requestFocusInWindow();
29153110 } else
29163111 if (source == rootButton)
29173112 {
....@@ -2923,6 +3118,7 @@
29233118 EditObject(obj);
29243119 }
29253120
3121
+ cameraView.requestFocusInWindow();
29263122 refreshContents(true);
29273123 } else
29283124 if (source == closeButton)
....@@ -2944,6 +3140,8 @@
29443140 break;
29453141 }
29463142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
29473145 refreshContents(true);
29483146 } else
29493147 if (source == editItem || source == editButton)
....@@ -2960,7 +3158,7 @@
29603158 child.CloseUI();
29613159 listUI.remove(child);
29623160
2963
- child.editWindow = null; // ???????????
3161
+ //child.editWindow = null; // ???????????
29643162 }
29653163 objEditor.ctrlPanel.FlushUI();
29663164 //objEditor.jTree.clearSelection();
....@@ -3046,7 +3244,10 @@
30463244 frontView.object = group;
30473245 sideView.object = group;
30483246 }
3049
- group.editWindow = this;
3247
+
3248
+// fix "+" issue
3249
+ //group.editWindow = this;
3250
+
30503251 /*
30513252 currentLayout = radio.layout;
30523253 if (currentLayout == null)
....@@ -3058,8 +3259,23 @@
30583259 //group.parent = null; // ROOT
30593260 //group.attributes = -1;
30603261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
30613264 refreshContents(true);
3062
- }
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
+ }
30633279 else
30643280 {
30653281 //return super.action(event, arg);
....@@ -3068,7 +3284,6 @@
30683284 }
30693285
30703286 boolean useclient = false;
3071
- cRadio radio;
30723287
30733288 void ToggleRoot()
30743289 {
....@@ -3120,6 +3335,28 @@
31203335 refreshContents();
31213336 }
31223337
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
+ }
31233360
31243361 void ResetTransform()
31253362 {
....@@ -3232,7 +3469,7 @@
32323469 refreshContents();
32333470 }
32343471
3235
- void ResetCentroid()
3472
+ void ResetCentroid(boolean full)
32363473 {
32373474 Object3D obj;
32383475 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3247,12 +3484,16 @@
32473484 LA.matIdentity(Object3D.mat);
32483485 obj.getBounds(minima, maxima, false);
32493486 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3250
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3487
+ if (full)
3488
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32513489 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32523490 obj.TransformMesh(Object3D.mat);
3491
+
32533492 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3254
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3493
+ if (full)
3494
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32553495 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3496
+
32563497 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32573498 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32583499 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3281,7 +3522,8 @@
32813522
32823523 int size = obj.MemorySize();
32833524
3284
- 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)");
32853527 }
32863528 }
32873529 catch (Exception e)
....@@ -3318,9 +3560,9 @@
33183560 obj = (Object3D)e.nextElement();
33193561
33203562 System.out.println("Object is: " + obj);
3321
- GrafreeD.AnalyzeObject(obj);
3563
+ Grafreed.AnalyzeObject(obj);
33223564 System.out.println("Boundary rep: " + obj.bRep);
3323
- GrafreeD.AnalyzeObject(obj.bRep);
3565
+ Grafreed.AnalyzeObject(obj.bRep);
33243566
33253567 // System.err.println((size/1024) + " KB is the size of " + obj);
33263568 }
....@@ -3362,6 +3604,13 @@
33623604 void GenNormals(boolean crease)
33633605 {
33643606 group.GenNormalsS(crease);
3607
+
3608
+ refreshContents();
3609
+ }
3610
+
3611
+ void GenNormalsMESH()
3612
+ {
3613
+ group.GenNormalsMeshS();
33653614
33663615 refreshContents();
33673616 }
....@@ -3534,8 +3783,8 @@
35343783
35353784 void ParseVertices()
35363785 {
3537
- boolean epsequal = GrafreeD.epsequal;
3538
- GrafreeD.epsequal = true;
3786
+ boolean epsequal = Grafreed.epsequal;
3787
+ Grafreed.epsequal = true;
35393788
35403789 for (int i=0; i<group.selection.size(); i++)
35413790 {
....@@ -3560,7 +3809,7 @@
35603809 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35613810 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35623811
3563
- g.add(GrafreeD.clipboard);
3812
+ g.add(Grafreed.clipboard);
35643813
35653814 buffer.add(g);
35663815 }
....@@ -3575,7 +3824,7 @@
35753824 makeSomething(buffer, i==group.selection.size()-1);
35763825 }
35773826
3578
- GrafreeD.epsequal = epsequal;
3827
+ Grafreed.epsequal = epsequal;
35793828
35803829 refreshContents();
35813830 }
....@@ -3593,7 +3842,16 @@
35933842 String pigment = Object3D.GetPigment(tex);
35943843 //String bump = Object3D.GetBump(tex);
35953844
3596
- 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
+ }
35973855
35983856 double s = v.s;
35993857
....@@ -3725,7 +3983,7 @@
37253983 return;
37263984
37273985 Object3D poses = group.selection.get(0);
3728
- Object3D ref = GrafreeD.clipboard.get(0);
3986
+ Object3D ref = Grafreed.clipboard.get(0);
37293987
37303988 Object3D newgroup = new Object3D("Po:" + poses.name);
37313989
....@@ -3919,9 +4177,9 @@
39194177
39204178 void ClipMesh()
39214179 {
3922
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4180
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39234181 {
3924
- Object3D content = GrafreeD.clipboard.get(0);
4182
+ Object3D content = Grafreed.clipboard.get(0);
39254183
39264184 if (content instanceof cGroup && ((cGroup)content).transientlink )
39274185 content = ((cGroup)content).get(0);
....@@ -3930,7 +4188,7 @@
39304188 // {
39314189 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39324190 // }
3933
- group.selection.ClipMesh(GrafreeD.clipboard);
4191
+ group.selection.ClipMesh(Grafreed.clipboard);
39344192 }
39354193 // group.selection.ClipMesh(GrafreeD.clipboard);
39364194 System.out.println("DONE.");
....@@ -3977,6 +4235,18 @@
39774235 void MarkLeaves(boolean hide)
39784236 {
39794237 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);
39804250 refreshContents();
39814251 }
39824252
....@@ -4065,7 +4335,7 @@
40654335 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40664336
40674337 Object3D elem = (Object3D)group.selection.elementAt(i);
4068
- if(elem != group)
4338
+ if(elem != group || !newWindow)
40694339 {
40704340 // if (!(elem instanceof Composite))
40714341 // newWindow = false;
....@@ -4155,7 +4425,6 @@
41554425 //case 702: // Event.LIST_DESELECT
41564426 group.deselectAll();
41574427 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4158
- objEditor.ClearInfo(); // .GetMaterial());
41594428 if (tps != null)
41604429 {
41614430 for (int i=0; i < tps.length; i++)
....@@ -4164,10 +4433,8 @@
41644433
41654434 //if (child.parent != null)
41664435 //child.parent.addSelectee(child);
4436
+ objEditor.SetMaterial(child);
41674437 group.addSelectee(child);
4168
- objEditor.SetMaterial(child); // .GetMaterial());
4169
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4170
- System.err.println("info : " + child.GetPath());
41714438 }
41724439 }
41734440 // else
....@@ -4177,16 +4444,17 @@
41774444 // System.err.println("info : " + group.GetPath());
41784445 // }
41794446
4180
- objEditor.SetText(); // jan 2014
4181
-
4182
- 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))
41834448 CameraPane.flash = true;
41844449
4185
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4450
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41864451 // a camera
41874452 {
4188
- CameraPane.camerachangeframe = 0; // don't refuse it
4189
- 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
+ }
41904458 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41914459 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41924460 }
....@@ -4199,6 +4467,26 @@
41994467
42004468 freezemodel = false;
42014469 }
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
+ }
42024490
42034491 void linkSomething(Object3D thing)
42044492 {
....@@ -4270,16 +4558,18 @@
42704558 {
42714559 if (group.selection.isEmpty())
42724560 return;
4273
- GrafreeD.clipboardIsTempGroup = false;
4561
+
4562
+ Grafreed.clipboardIsTempGroup = false;
42744563 Composite tGroup = null;
42754564 if (group.selection.size() > 0) // 1)
42764565 {
42774566 tGroup = new cGroup();
4278
- GrafreeD.clipboardIsTempGroup = true;
4567
+ Grafreed.clipboardIsTempGroup = true;
42794568 }
42804569
42814570 if (cut)
42824571 {
4572
+ Save();
42834573 //int indices[] = jList.getSelectedIndices();
42844574 //for (int i = indices.length - 1; i >= 0; i--)
42854575 //jList.remove(indices[i]);
....@@ -4315,16 +4605,16 @@
43154605 //System.out.println("cut " + child);
43164606 //System.out.println("parent = " + child.parent);
43174607 // tmp.addChild(child);
4318
- if (GrafreeD.clipboardIsTempGroup)
4608
+ if (Grafreed.clipboardIsTempGroup)
43194609 tGroup.add/*Child*/(tmp);
43204610 else
4321
- GrafreeD.clipboard = tmp;
4611
+ Grafreed.clipboard = tmp;
43224612 }
43234613 else
4324
- if (GrafreeD.clipboardIsTempGroup)
4614
+ if (Grafreed.clipboardIsTempGroup)
43254615 tGroup.add/*Child*/(child);
43264616 else
4327
- GrafreeD.clipboard = child;
4617
+ Grafreed.clipboard = child;
43284618 }
43294619
43304620 //ResetModel();
....@@ -4356,21 +4646,23 @@
43564646 //System.out.println("cut " + elem);
43574647 //System.out.println("parent = " + elem.parent);
43584648 // tmp.addChild(elem);
4359
- if (GrafreeD.clipboardIsTempGroup)
4649
+ if (Grafreed.clipboardIsTempGroup)
43604650 tGroup.add/*Child*/(tmp);
43614651 else
4362
- GrafreeD.clipboard = tmp;
4652
+ Grafreed.clipboard = tmp;
43634653 }
43644654 else
4365
- if (GrafreeD.clipboardIsTempGroup)
4655
+ if (Grafreed.clipboardIsTempGroup)
43664656 tGroup.add/*Child*/(child);
43674657 else
4368
- GrafreeD.clipboard = child;
4658
+ Grafreed.clipboard = child;
43694659 }
43704660
43714661 }
4372
- if (GrafreeD.clipboardIsTempGroup)
4373
- GrafreeD.clipboard = tGroup;
4662
+
4663
+ if (Grafreed.clipboardIsTempGroup)
4664
+ Grafreed.clipboard = tGroup;
4665
+
43744666 if (cut)
43754667 {
43764668 ResetModel();
....@@ -4384,7 +4676,7 @@
43844676 // return;
43854677 boolean first = true;
43864678
4387
- if (GrafreeD.clipboardIsTempGroup)
4679
+ if (Grafreed.clipboardIsTempGroup)
43884680 {
43894681 Composite temp;
43904682
....@@ -4395,7 +4687,7 @@
43954687 temp = (Composite)Applet3D.clipboard.deepCopy();
43964688 */
43974689 Object3D elem;
4398
- 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))
43994691 {
44004692 Object3D child = (Object3D)e.nextElement();
44014693
....@@ -4429,14 +4721,14 @@
44294721 //Object3D cb = Applet3D.clipboard;
44304722 //temp.addChild(cb);
44314723 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4432
- assert(GrafreeD.clipboard.parent == null);
4433
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4434
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4435
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4436
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
44374729 else
4438
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
- GrafreeD.clipboard.get(0).parent = keepparent;
4730
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4731
+ Grafreed.clipboard.get(0).parent = keepparent;
44404732 }
44414733
44424734 ResetModel();
....@@ -4485,9 +4777,9 @@
44854777 {
44864778 boolean first = true;
44874779
4488
- if (GrafreeD.clipboardIsTempGroup)
4780
+ if (Grafreed.clipboardIsTempGroup)
44894781 {
4490
- Composite temp = (Composite)GrafreeD.clipboard;
4782
+ Composite temp = (Composite)Grafreed.clipboard;
44914783 Object3D copy;
44924784 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44934785 {
....@@ -4497,7 +4789,7 @@
44974789 }
44984790 } else
44994791 {
4500
- linkSomething(GrafreeD.clipboard); //.get(0));
4792
+ linkSomething(Grafreed.clipboard); //.get(0));
45014793 }
45024794 }
45034795 }
....@@ -4902,21 +5194,6 @@
49025194 }
49035195 */
49045196
4905
- void ImportGFD()
4906
- {
4907
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4908
- browser.show();
4909
- String filename = browser.getFile();
4910
- if (filename != null && filename.length() > 0)
4911
- {
4912
- String fullname = browser.getDirectory() + filename;
4913
-
4914
- //Object3D readobj =
4915
- objEditor.ReadGFD(fullname, objEditor);
4916
- //makeSomething(readobj);
4917
- }
4918
- }
4919
-
49205197 /*
49215198 public void Callback(Object obj)
49225199 {
....@@ -4940,26 +5217,9 @@
49405217 }
49415218 */
49425219
4943
- void ImportVRMLX3D()
4944
- {
4945
- if (GrafreeD.standAlone)
4946
- {
4947
- /**/
4948
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4949
- browser.show();
4950
- String filename = browser.getFile();
4951
- if (filename != null && filename.length() > 0)
4952
- {
4953
- String fullname = browser.getDirectory() + filename;
4954
- LoadVRMLX3D(fullname);
4955
- }
4956
- /**/
4957
- }
4958
- }
4959
-
49605220 String GetFile(String dialogName)
49615221 {
4962
- if (GrafreeD.standAlone)
5222
+ if (Grafreed.standAlone)
49635223 {
49645224 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49655225 browser.show();
....@@ -5027,6 +5287,12 @@
50275287 cButton clearpanelButton;
50285288 cButton unselectButton;
50295289
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
5293
+ cButton undoButton;
5294
+ cButton redoButton;
5295
+ cButton saveButton;
50305296 cButton oneStepButton;
50315297
50325298 cButton screenfitButton;
....@@ -5040,14 +5306,6 @@
50405306
50415307 cButton setsupportButton;
50425308
5043
- cButton twoButton;
5044
- cButton sixButton;
5045
- cButton threeButton;
5046
- cButton sevenButton;
5047
- cButton fourButton; // full panel
5048
- cButton oneButton; // full XYZ
5049
- //cButton currentLayout;
5050
-
50515309 //
50525310 //Composite
50535311 Object3D // to do !!
....@@ -5059,6 +5317,8 @@
50595317 private MenuItem lookFromItem;
50605318 private MenuItem switchItem;
50615319 private MenuItem cutItem;
5320
+ private MenuItem undoItem;
5321
+ private MenuItem redoItem;
50625322 private MenuItem duplicateItem;
50635323 private MenuItem cloneItem;
50645324 private MenuItem cloneSupportItem;
....@@ -5072,7 +5332,7 @@
50725332 private MenuItem linkverticesItem;
50735333 private MenuItem relinkverticesItem;
50745334 private MenuItem setMasterItem;
5075
- private MenuItem resetMeshItem;
5335
+ private MenuItem resetAllItem;
50765336 private MenuItem stepAllItem;
50775337 private MenuItem revertMeshItem;
50785338 private MenuItem poseMeshItem;
....@@ -5122,6 +5382,10 @@
51225382 private MenuItem showleavesItem;
51235383 private MenuItem markleavesItem;
51245384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
51255389
51265390 private MenuItem flipVItem;
51275391 private MenuItem unflipVItem;
....@@ -5133,8 +5397,10 @@
51335397 private MenuItem panoTexturesItem;
51345398
51355399 private MenuItem resetCentroidItem;
5136
- private MenuItem transformgeometryItem;
5400
+ private MenuItem resetCentroidXZItem;
51375401 private MenuItem resetTransformItem;
5402
+ private MenuItem transformGeometryItem;
5403
+ private MenuItem transformChildrenItem;
51385404 private MenuItem hideItem;
51395405 private MenuItem grabItem;
51405406 private MenuItem backItem;
....@@ -5203,11 +5469,6 @@
52035469 private MenuItem doubleItem;
52045470 private MenuItem tripleItem;
52055471
5206
- private MenuItem importGFDItem;
5207
- private MenuItem importVRMLX3DItem;
5208
- private MenuItem import3DSItem;
5209
- private MenuItem importOBJItem;
5210
-
52115472 private MenuItem computeAOItem;
52125473 private MenuItem recompileItem;
52135474 private MenuItem editScriptItem;
....@@ -5217,4 +5478,8 @@
52175478 private MenuItem analyzeItem;
52185479 private MenuItem dumpItem;
52195480 //boolean freezemodel = false;
5481
+
5482
+ Menu cameraMenu;
5483
+ MenuItem editCameraItem;
5484
+ MenuItem revertCameraItem;
52205485 }