Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
GroupEditor.java
....@@ -154,6 +154,12 @@
154154 oe.menuBar.add(menu = new Menu("Edit"));
155155 //editItem = menu.add(new MenuItem("Edit"));
156156 //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("-");
157163 duplicateItem = menu.add(new MenuItem("Duplicate"));
158164 duplicateItem.addActionListener(this);
159165 cloneItem = menu.add(new MenuItem("Clone"));
....@@ -170,7 +176,6 @@
170176 copyItem.addActionListener(this);
171177 pasteItem = menu.add(new MenuItem("Paste"));
172178 pasteItem.addActionListener(this);
173
- menu.add("-");
174179
175180 menu.add("-");
176181 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -197,7 +202,7 @@
197202 //zBufferItem.addActionListener(this);
198203 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199204 //normalLensItem.addActionListener(this);
200
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
201206 revertCameraItem.addActionListener(this);
202207
203208 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
....@@ -240,7 +245,7 @@
240245
241246 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242247 toggleDebugItem.addItemListener(this);
243
- toggleDebugItem.setState(CameraPane.DEBUG);
248
+ toggleDebugItem.setState(Globals.DEBUG);
244249
245250 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246251 toggleFrustumItem.addItemListener(this);
....@@ -261,7 +266,7 @@
261266 // animationItem.addItemListener(this);
262267 // animationItem.setState(CameraPane.ANIMATION);
263268 cameraMenu.add("-");
264
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
265270 editCameraItem.addActionListener(this);
266271
267272 if (Globals.ADVANCED)
....@@ -363,11 +368,11 @@
363368 billboardItem.addActionListener(this);
364369 csgItem = menu.add(new MenuItem("CSG"));
365370 csgItem.addActionListener(this);
366
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
367372 shadowXItem.addActionListener(this);
368
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
369374 shadowYItem.addActionListener(this);
370
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
371376 shadowZItem.addActionListener(this);
372377 if (Globals.ADVANCED)
373378 {
....@@ -464,6 +469,14 @@
464469 markleavesItem.addActionListener(this);
465470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
466471 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);
467480 menu.add("-");
468481 flipVItem = menu.add(new MenuItem("Flip V"));
469482 flipVItem.addActionListener(this);
....@@ -521,6 +534,18 @@
521534
522535 void SetupUI2(ObjEditor oe)
523536 {
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
+
524549 //new Exception().printStackTrace();
525550
526551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -551,23 +576,47 @@
551576 */
552577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
553578
554
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
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 = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
555604 liveCB.setToolTipText("Enable animation");
556605 liveCB.addItemListener(this);
557606
558
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559
- oneStepButton.setToolTipText("Animate one step forward");
560
- oneStepButton.addActionListener(this);
561
-
562
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
607
+ oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
563608 fastCB.setToolTipText("Fast mode");
564609 fastCB.addItemListener(this);
565610
566
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ oneStepButton.setToolTipText("Animate one step forward");
613
+ oneStepButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
567616 trackCB.setToolTipText("Enable tracking");
568617 trackCB.addItemListener(this);
569618
570
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571620 screenfitButton.setToolTipText("Screen fit");
572621 screenfitButton.addActionListener(this);
573622
....@@ -581,25 +630,25 @@
581630 snapobjectButton.setToolTipText("Snap Object");
582631 }
583632
584
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
- flashSelectionButton.setToolTipText("Show selection");
633
+ oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Highlight selection");
586635 flashSelectionButton.addActionListener(this);
587636
588637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
589638
590
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591640 twoButton.setToolTipText("Show center view only");
592641 twoButton.addActionListener(this);
593
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594643 fourButton.addActionListener(this);
595644 fourButton.setToolTipText("Show left panel only");
596
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597646 sixButton.setToolTipText("2-column layout left");
598647 sixButton.addActionListener(this);
599
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600649 threeButton.setToolTipText("2-column layout right");
601650 threeButton.addActionListener(this);
602
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603652 sevenButton.setToolTipText("3-column layout");
604653 sevenButton.addActionListener(this);
605654 //
....@@ -614,32 +663,30 @@
614663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
615664 //clearButton.addActionListener(this);
616665
617
- cGridBag commandsPanel = new cGridBag();
618
-
619
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620667 editButton.setToolTipText("Edit selection");
621668 editButton.addActionListener(this);
622669
623
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624671 uneditButton.setToolTipText("Unedit selection");
625672 uneditButton.addActionListener(this);
626673
627
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628675 allParamsButton.setToolTipText("Edit all params");
629676 allParamsButton.addActionListener(this);
630677
631
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632679 clearPanelButton.setToolTipText("Clear edit panel");
633680 clearPanelButton.addActionListener(this);
634681
635
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636683 unselectButton.setToolTipText("Unselect");
637684 unselectButton.addActionListener(this);
638685
639
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
640687
641
- oe.treePanel.add(commandsPanel);
642
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
643690
644691 // oe.aConstraints.gridx += 1;
645692 // oe.aConstraints.weighty = 0;
....@@ -761,11 +808,23 @@
761808 // debugCB.addItemListener(this);
762809
763810 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
764812 oeilCB.addItemListener(this);
765813
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
+ autosaveCB.setToolTipText("Auto-save on structure change");
820
+ autosaveCB.addItemListener(this);
821
+
822
+ if (Globals.ADVANCED)
823
+ {
766824 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
767825 lookAtCB.setToolTipText("Look-at target");
768826 lookAtCB.addItemListener(this);
827
+ }
769828
770829 }
771830
....@@ -780,6 +839,14 @@
780839 void EditObject(Object3D obj)
781840 {
782841 cRadio radioButton = new cRadio(obj.name);
842
+
843
+ // Patch to avoid bug with transparency.
844
+ radioButton.hadMaterial = obj.material != null;
845
+ if (!radioButton.hadMaterial)
846
+ {
847
+ obj.material = new cMaterial();
848
+ }
849
+
783850 radioButton.SetObject(obj);
784851 radioButton.layout = sevenButton;
785852 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -791,6 +858,8 @@
791858
792859 void SetupViews(ObjEditor oe)
793860 {
861
+ theFrame = this;
862
+
794863 oe.SetupViews();
795864
796865 System.out.println("SetupViews");
....@@ -799,23 +868,26 @@
799868 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
800869 }
801870
802
- JCheckBox liveCB;
803
- JCheckBox supportCB;
804
- JCheckBox localCB;
805
- JCheckBox crowdCB;
806
- JCheckBox smoothCB;
807
- JCheckBox fastCB;
808
- JCheckBox slowCB;
809
- JCheckBox boxCB;
810
- JCheckBox zoomBoxCB;
811
- JCheckBox trackCB;
812
- JCheckBox smoothfocusCB;
871
+ cCheckBox liveCB;
872
+ cCheckBox supportCB;
873
+ cCheckBox localCB;
874
+ cCheckBox crowdCB;
875
+ cCheckBox smoothCB;
876
+ cCheckBox fastCB;
877
+ cCheckBox slowCB;
878
+ cCheckBox boxCB;
879
+ cCheckBox zoomBoxCB;
880
+ cCheckBox trackCB;
881
+ cCheckBox smoothfocusCB;
813882 // JCheckBox speakerMocapCB;
814
- JCheckBox speakerCameraCB;
815
- JCheckBox speakerFocusCB;
816
- JCheckBox debugCB;
817
- JCheckBox oeilCB;
818
- JCheckBox lookAtCB;
883
+ cCheckBox speakerCameraCB;
884
+ cCheckBox speakerFocusCB;
885
+ cCheckBox debugCB;
886
+
887
+ cCheckBox oeilCB;
888
+ cCheckBox shadowCB;
889
+ cCheckBox autosaveCB;
890
+ cCheckBox lookAtCB;
819891
820892 // static int COLOR = 1;
821893 // static int MATERIAL = 2;
....@@ -823,9 +895,9 @@
823895
824896 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
825897
826
- JCheckBox colorCB;
827
- JCheckBox materialCB;
828
- JCheckBox textureCB;
898
+ cCheckBox colorCB;
899
+ cCheckBox materialCB;
900
+ cCheckBox textureCB;
829901
830902 public void itemStateChanged(ItemEvent e)
831903 {
....@@ -853,6 +925,7 @@
853925 } else if(e.getSource() == liveCB)
854926 {
855927 cameraView.ToggleLive();
928
+ refreshContents(false);
856929 }
857930 else if(e.getSource() == supportCB)
858931 {
....@@ -916,6 +989,14 @@
916989 else if(e.getSource() == oeilCB)
917990 {
918991 cameraView.ToggleOeil();
992
+ }
993
+ else if(e.getSource() == shadowCB)
994
+ {
995
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
996
+ }
997
+ else if(e.getSource() == autosaveCB)
998
+ {
999
+ Globals.SAVEONMAKE ^= true;
9191000 }
9201001 else if(e.getSource() == lookAtCB)
9211002 {
....@@ -1260,7 +1341,7 @@
12601341 memoryItem.addActionListener(this);
12611342 menu.add(analyzeItem = new MenuItem("Analyze"));
12621343 analyzeItem.addActionListener(this);
1263
- menu.add(dumpItem = new MenuItem("Dump"));
1344
+ menu.add(dumpItem = new MenuItem("Print"));
12641345 dumpItem.addActionListener(this);
12651346 // menu.add(pathItem = new MenuItem("From-to path"));
12661347 // pathItem.addActionListener(this);
....@@ -1401,6 +1482,7 @@
14011482 shadow.material = new cMaterial(obj.material);
14021483 shadow.material.diffuse = 0.0001f;
14031484 shadow.material.specular = 0.0001f;
1485
+ //shadow.projectedVertices[1].x = 300;
14041486
14051487 makeSomething(shadow);
14061488 }
....@@ -1951,6 +2033,30 @@
19512033 {
19522034 DumpObject();
19532035 } else
2036
+ if (source == minButton)
2037
+ {
2038
+ Minimize();
2039
+ } else
2040
+ if (source == maxButton)
2041
+ {
2042
+ Maximize();
2043
+ } else
2044
+ if (source == fullButton)
2045
+ {
2046
+ ToggleFullScreen();
2047
+ } else
2048
+ if (source == undoButton)
2049
+ {
2050
+ Undo();
2051
+ } else
2052
+ if (source == redoButton)
2053
+ {
2054
+ Redo();
2055
+ } else
2056
+ if (source == saveButton)
2057
+ {
2058
+ Save();
2059
+ } else
19542060 if (source == oneStepButton)
19552061 {
19562062 Globals.ONESTEP = true;
....@@ -2004,6 +2110,14 @@
20042110 if (source == cutItem || source == clearButton)
20052111 {
20062112 loadClipboard(true);
2113
+ } else
2114
+ if (source == undoItem)
2115
+ {
2116
+ Undo();
2117
+ } else
2118
+ if (source == redoItem)
2119
+ {
2120
+ Redo();
20072121 } else
20082122 if (source == duplicateItem)
20092123 {
....@@ -2504,7 +2618,7 @@
25042618 } else
25052619 if (source == genNormalsMESHItem)
25062620 {
2507
- GenNormals(true); // TODO
2621
+ GenNormalsMESH();
25082622 } else
25092623 if (source == genNormalsORGANItem)
25102624 {
....@@ -2569,6 +2683,22 @@
25692683 if (source == unmarkleavesItem)
25702684 {
25712685 MarkLeaves(false);
2686
+ } else
2687
+ if (source == rewindleavesItem)
2688
+ {
2689
+ RewindLeaves(true);
2690
+ } else
2691
+ if (source == unrewindleavesItem)
2692
+ {
2693
+ RewindLeaves(false);
2694
+ } else
2695
+ if (source == randomleavesItem)
2696
+ {
2697
+ RandomLeaves(true);
2698
+ } else
2699
+ if (source == unrandomleavesItem)
2700
+ {
2701
+ RandomLeaves(false);
25722702 } else
25732703 if (source == flipVItem)
25742704 {
....@@ -2836,6 +2966,24 @@
28362966 bigThree.ClearUI();
28372967 bigThree.add(centralPanel);
28382968 bigThree.FlushUI();
2969
+
2970
+ cameraView.requestFocusInWindow();
2971
+
2972
+// refreshContents(true);
2973
+//
2974
+// try
2975
+// {
2976
+// java.awt.Robot bot = new java.awt.Robot();
2977
+// int mask = InputEvent.BUTTON1_MASK;
2978
+// bot.mouseMove(100, 100);
2979
+// bot.mousePress(mask);
2980
+// bot.mouseRelease(mask);
2981
+// }
2982
+// catch (Exception e)
2983
+// {
2984
+//
2985
+// }
2986
+
28392987 } else
28402988 if (source == threeButton)
28412989 {
....@@ -2872,6 +3020,8 @@
28723020 bigThree.add(centralPanel);
28733021 bigThree.add(XYZPanel);
28743022 bigThree.FlushUI();
3023
+
3024
+ cameraView.requestFocusInWindow();
28753025 } else
28763026 if (source == fourButton)
28773027 {
....@@ -2907,6 +3057,8 @@
29073057 bigThree.ClearUI();
29083058 bigThree.add(scenePanel);
29093059 bigThree.FlushUI();
3060
+
3061
+ cameraView.requestFocusInWindow();
29103062 } else
29113063 if (source == sixButton)
29123064 {
....@@ -2943,6 +3095,8 @@
29433095 bigThree.add(scenePanel);
29443096 bigThree.add(centralPanel);
29453097 bigThree.FlushUI();
3098
+
3099
+ cameraView.requestFocusInWindow();
29463100 } else
29473101 if (source == sevenButton)
29483102 {
....@@ -2980,6 +3134,8 @@
29803134 bigThree.add(centralPanel);
29813135 bigThree.add(XYZPanel);
29823136 bigThree.FlushUI();
3137
+
3138
+ cameraView.requestFocusInWindow();
29833139 } else
29843140 if (source == rootButton)
29853141 {
....@@ -2991,6 +3147,7 @@
29913147 EditObject(obj);
29923148 }
29933149
3150
+ cameraView.requestFocusInWindow();
29943151 refreshContents(true);
29953152 } else
29963153 if (source == closeButton)
....@@ -3000,18 +3157,27 @@
30003157 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30013158 {
30023159 ab = (cRadio)e.nextElement();
3003
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3160
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30043161 {
3162
+ // Patch to avoid bug with transparency.
3163
+ if (!ab.hadMaterial)
3164
+ {
3165
+ ab.object.material = null;
3166
+ }
3167
+
30053168 buttonGroup.remove(ab);
30063169 radioPanel.remove(ab);
30073170
3008
- ab.GetObject().editWindow = null;
3171
+ //ab.GetObject().editWindow = null;
3172
+ ab.GetObject().manipWindow = null;
30093173 // ab.GetObject().objectUI = null; // ?????????
30103174
30113175 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30123176 break;
30133177 }
30143178 }
3179
+
3180
+ cameraView.requestFocusInWindow();
30153181 refreshContents(true);
30163182 } else
30173183 if (source == editItem || source == editButton)
....@@ -3028,7 +3194,7 @@
30283194 child.CloseUI();
30293195 listUI.remove(child);
30303196
3031
- child.editWindow = null; // ???????????
3197
+ //child.editWindow = null; // ???????????
30323198 }
30333199 objEditor.ctrlPanel.FlushUI();
30343200 //objEditor.jTree.clearSelection();
....@@ -3115,7 +3281,9 @@
31153281 sideView.object = group;
31163282 }
31173283
3118
-// fix "+" issue group.editWindow = this;
3284
+// fix "+" issue
3285
+ //group.editWindow = this;
3286
+ group.manipWindow = this;
31193287
31203288 /*
31213289 currentLayout = radio.layout;
....@@ -3128,6 +3296,8 @@
31283296 //group.parent = null; // ROOT
31293297 //group.attributes = -1;
31303298 ResetModel();
3299
+
3300
+ cameraView.requestFocusInWindow();
31313301 refreshContents(true);
31323302 } else if (event.getSource() == editCameraItem)
31333303 {
....@@ -3151,7 +3321,6 @@
31513321 }
31523322
31533323 boolean useclient = false;
3154
- cRadio radio;
31553324
31563325 void ToggleRoot()
31573326 {
....@@ -3390,7 +3559,8 @@
33903559
33913560 int size = obj.MemorySize();
33923561
3393
- System.err.println((size/1024) + " KB is the size of " + obj);
3562
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3563
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33943564 }
33953565 }
33963566 catch (Exception e)
....@@ -3471,6 +3641,13 @@
34713641 void GenNormals(boolean crease)
34723642 {
34733643 group.GenNormalsS(crease);
3644
+
3645
+ refreshContents();
3646
+ }
3647
+
3648
+ void GenNormalsMESH()
3649
+ {
3650
+ group.GenNormalsMeshS();
34743651
34753652 refreshContents();
34763653 }
....@@ -4098,6 +4275,18 @@
40984275 refreshContents();
40994276 }
41004277
4278
+ void RewindLeaves(boolean hide)
4279
+ {
4280
+ group.selection.RewindLeaves(hide);
4281
+ refreshContents();
4282
+ }
4283
+
4284
+ void RandomLeaves(boolean hide)
4285
+ {
4286
+ group.selection.RandomLeaves(hide);
4287
+ refreshContents();
4288
+ }
4289
+
41014290 void SetTexRes(int tr)
41024291 {
41034292 group.selection.SetTexRes(tr);
....@@ -4273,7 +4462,6 @@
42734462 //case 702: // Event.LIST_DESELECT
42744463 group.deselectAll();
42754464 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4276
- objEditor.ClearInfo(); // .GetMaterial());
42774465 if (tps != null)
42784466 {
42794467 for (int i=0; i < tps.length; i++)
....@@ -4282,10 +4470,8 @@
42824470
42834471 //if (child.parent != null)
42844472 //child.parent.addSelectee(child);
4473
+ objEditor.SetMaterial(child);
42854474 group.addSelectee(child);
4286
- objEditor.SetMaterial(child); // .GetMaterial());
4287
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4288
- System.err.println("info : " + child.GetPath());
42894475 }
42904476 }
42914477 // else
....@@ -4295,16 +4481,17 @@
42954481 // System.err.println("info : " + group.GetPath());
42964482 // }
42974483
4298
- objEditor.SetText(); // jan 2014
4299
-
4300
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4484
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43014485 CameraPane.flash = true;
43024486
4303
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4487
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43044488 // a camera
43054489 {
4306
- CameraPane.camerachangeframe = 0; // don't refuse it
4307
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4490
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4491
+ {
4492
+ CameraPane.camerachangeframe = 0; // don't refuse it
4493
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4494
+ }
43084495 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
43094496 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43104497 }
....@@ -4317,6 +4504,26 @@
43174504
43184505 freezemodel = false;
43194506 }
4507
+
4508
+ void refreshContents(boolean cp)
4509
+ {
4510
+ if (!Globals.MOUSEDRAGGED)
4511
+ {
4512
+ objEditor.ClearInfo(); // .GetMaterial());
4513
+
4514
+ for (int i=0; i < group.selection.Size(); i++)
4515
+ {
4516
+ Object3D child = (Object3D) group.selection.get(i);
4517
+
4518
+ objEditor.AddInfo(child, this, true);
4519
+ System.err.println("info : " + child.GetPath());
4520
+ }
4521
+
4522
+ objEditor.SetText(); // jan 2014
4523
+ }
4524
+
4525
+ super.refreshContents(cp);
4526
+ }
43204527
43214528 void linkSomething(Object3D thing)
43224529 {
....@@ -4388,6 +4595,7 @@
43884595 {
43894596 if (group.selection.isEmpty())
43904597 return;
4598
+
43914599 Grafreed.clipboardIsTempGroup = false;
43924600 Composite tGroup = null;
43934601 if (group.selection.size() > 0) // 1)
....@@ -4398,6 +4606,8 @@
43984606
43994607 if (cut)
44004608 {
4609
+ if (Globals.SAVEONMAKE)
4610
+ Save();
44014611 //int indices[] = jList.getSelectedIndices();
44024612 //for (int i = indices.length - 1; i >= 0; i--)
44034613 //jList.remove(indices[i]);
....@@ -4487,8 +4697,10 @@
44874697 }
44884698
44894699 }
4700
+
44904701 if (Grafreed.clipboardIsTempGroup)
44914702 Grafreed.clipboard = tGroup;
4703
+
44924704 if (cut)
44934705 {
44944706 ResetModel();
....@@ -5113,6 +5325,12 @@
51135325 cButton clearpanelButton;
51145326 cButton unselectButton;
51155327
5328
+ cButton minButton;
5329
+ cButton maxButton;
5330
+ cButton fullButton;
5331
+ cButton undoButton;
5332
+ cButton redoButton;
5333
+ cButton saveButton;
51165334 cButton oneStepButton;
51175335
51185336 cButton screenfitButton;
....@@ -5126,14 +5344,6 @@
51265344
51275345 cButton setsupportButton;
51285346
5129
- cButton twoButton;
5130
- cButton sixButton;
5131
- cButton threeButton;
5132
- cButton sevenButton;
5133
- cButton fourButton; // full panel
5134
- cButton oneButton; // full XYZ
5135
- //cButton currentLayout;
5136
-
51375347 //
51385348 //Composite
51395349 Object3D // to do !!
....@@ -5145,6 +5355,8 @@
51455355 private MenuItem lookFromItem;
51465356 private MenuItem switchItem;
51475357 private MenuItem cutItem;
5358
+ private MenuItem undoItem;
5359
+ private MenuItem redoItem;
51485360 private MenuItem duplicateItem;
51495361 private MenuItem cloneItem;
51505362 private MenuItem cloneSupportItem;
....@@ -5208,6 +5420,10 @@
52085420 private MenuItem showleavesItem;
52095421 private MenuItem markleavesItem;
52105422 private MenuItem unmarkleavesItem;
5423
+ private MenuItem rewindleavesItem;
5424
+ private MenuItem unrewindleavesItem;
5425
+ private MenuItem randomleavesItem;
5426
+ private MenuItem unrandomleavesItem;
52115427
52125428 private MenuItem flipVItem;
52135429 private MenuItem unflipVItem;