Normand Briere
2019-08-23 60cec91731a350fe67e9b5ffe7a00d70e9026314
GroupEditor.java
....@@ -29,7 +29,7 @@
2929 {
3030 cButton skyboxButton;
3131 final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
- row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF));
3333 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
3434 skyboxButton.setToolTipText(s.equals("") ? "No background" : s);
3535 skyboxButton.addActionListener(new ActionListener()
....@@ -46,7 +46,7 @@
4646 {
4747 cButton textureButton;
4848 final String path = "textures/" + f + "/" + c + "/"; // + t;
49
- row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF));
5050 textureButton.setToolTipText(c + count);
5151 textureButton.addActionListener(new ActionListener()
5252 {
....@@ -347,7 +347,7 @@
347347
348348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
349349 {
350
- JTabbedPane skyboxpane = new JTabbedPane();
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351351
352352 AddSkyboxTab0(skyboxpane);
353353 AddSkyboxTab1(skyboxpane);
....@@ -415,13 +415,15 @@
415415 this.copy = this.group = group;
416416 //selectees = this.group.selectees;
417417
418
- if (copy.versionlist == null)
419
- {
420
- copy.versionlist = new Object3D[100];
421
- copy.versionindex = -1;
422
-
423
- Save(true);
424
- }
418
+ assert(false);
419
+
420
+// if (copy.versionlist == null)
421
+// {
422
+// copy.versionlist = new Object3D[100];
423
+// copy.versionindex = -1;
424
+//
425
+// //Save(true);
426
+// }
425427
426428 if(ui)
427429 SetupUI(objEditor);
....@@ -444,13 +446,13 @@
444446
445447 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
446448
447
- if (copy.versionlist == null)
448
- {
449
- copy.versionlist = new Object3D[100];
450
- copy.versionindex = -1;
451
-
452
- Save(true);
453
- }
449
+// if (copy.versionlist == null)
450
+// {
451
+// copy.versionlist = new Object3D[100];
452
+// copy.versionindex = -1;
453
+//
454
+// //Save(true);
455
+// }
454456 }
455457
456458 void CloneSelection(boolean supports)
....@@ -833,6 +835,8 @@
833835 }
834836
835837 oe.menuBar.add(menu = new Menu("Attributes"));
838
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
839
+ clearVersionsItem.addActionListener(this);
836840 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
837841 clearMaterialsItem.addActionListener(this);
838842 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -855,9 +859,9 @@
855859 hideleavesItem.addActionListener(this);
856860 showleavesItem = menu.add(new MenuItem("Show Leaves"));
857861 showleavesItem.addActionListener(this);
858
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
862
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
859863 markleavesItem.addActionListener(this);
860
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
864
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
861865 unmarkleavesItem.addActionListener(this);
862866 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
863867 rewindleavesItem.addActionListener(this);
....@@ -934,6 +938,8 @@
934938 cGridBag currenttab;
935939 //boolean added; // patch for jar
936940
941
+ int totalcount = 0;
942
+
937943 int tabcount = 0;
938944 int colcount = 0;
939945 int rowcount = 0;
....@@ -962,7 +968,7 @@
962968 texturecount = 0;
963969 }
964970
965
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
971
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
966972 {
967973 //if (!added)
968974 {
....@@ -971,7 +977,8 @@
971977 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
972978 }
973979
974
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
980
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
981
+ totalcount++;
975982
976983 if (++colcount >= columns)
977984 {
....@@ -997,6 +1004,8 @@
9971004 container.add(resourcecontainer);
9981005
9991006 Grafreed.ParseResources("textures", this);
1007
+
1008
+ // 935. System.out.println("Total = " + totalcount);
10001009 }
10011010
10021011 void SetupUI2(ObjEditor oe)
....@@ -1036,9 +1045,9 @@
10361045 oe.radioPanel.add(dummyButton);
10371046 oe.buttonGroup.add(dummyButton);
10381047 */
1039
- cGridBag copyOptionsPanel = new cGridBag();
1048
+ cGridBag versionManagerPanel = new cGridBag();
10401049
1041
- copyOptionsPanel.preferredHeight = 2;
1050
+ versionManagerPanel.preferredHeight = 4;
10421051
10431052 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10441053
....@@ -1065,25 +1074,25 @@
10651074 // }
10661075 // });
10671076
1068
- oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10691078 collapseButton.setToolTipText("Collapse toolbar");
10701079 collapseButton.addActionListener(this);
10711080
1072
- oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1081
+ oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10731082 maximize3DButton.setToolTipText("Maximize 3D view");
10741083 maximize3DButton.addActionListener(this);
10751084
1076
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1085
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10771086 twoButton.setToolTipText("Show 3D view only");
10781087 twoButton.addActionListener(this);
10791088 this.fullscreenLayout = twoButton;
10801089
1081
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1090
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10821091 threeButton.setToolTipText("Show controls and 3D view");
10831092 threeButton.addActionListener(this);
10841093 if (Globals.ADVANCED)
10851094 {
1086
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1095
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10871096 sixButton.setToolTipText("Show 3D view and controls");
10881097 sixButton.addActionListener(this);
10891098 }
....@@ -1092,50 +1101,51 @@
10921101 // sevenButton.addActionListener(this);
10931102 //
10941103
1095
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1104
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10961105 fullButton.setToolTipText("Full-screen window");
10971106 fullButton.addActionListener(this);
10981107
1099
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1108
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11001109 screenfitButton.setToolTipText("Screen fit");
11011110 screenfitButton.addActionListener(this);
11021111
1103
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11041113 restoreCameraButton.setToolTipText("Restore viewpoint");
11051114 restoreCameraButton.addActionListener(this);
11061115
1107
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1116
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11081117 saveVersionButton.setToolTipText("Duplicate current version");
11091118 saveVersionButton.addActionListener(this);
11101119
1111
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11121121 deleteVersionButton.setToolTipText("Delete current version");
11131122 deleteVersionButton.addActionListener(this);
1123
+ deleteVersionButton.setEnabled(false);
11141124
1115
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11161126 previousVersionButton.setToolTipText("Previous version");
11171127 previousVersionButton.addActionListener(this);
11181128 previousVersionButton.setEnabled(false);
11191129
11201130 cGridBag updown = new cGridBag().setVertical(true);
1121
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1131
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11221132 restoreButton.setToolTipText("Undo (restore current version)");
11231133 restoreButton.addActionListener(this);
1124
- //restoreButton.setEnabled(false);
1134
+ restoreButton.setEnabled(false);
11251135
1126
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11271137 replaceButton.setToolTipText("Save (replace current version)");
11281138 replaceButton.addActionListener(this);
1129
- //replaceButton.setEnabled(false);
1139
+ replaceButton.setEnabled(false);
11301140
1131
- copyOptionsPanel.add(updown);
1141
+ versionManagerPanel.add(updown);
11321142
1133
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1143
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11341144 nextVersionButton.setToolTipText("Next version");
11351145 nextVersionButton.addActionListener(this);
11361146 nextVersionButton.setEnabled(false);
11371147
1138
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1148
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11391149 oneStepButton.setToolTipText("Animate one step forward");
11401150 oneStepButton.addActionListener(this);
11411151
....@@ -1158,11 +1168,11 @@
11581168
11591169 if (Globals.ADVANCED)
11601170 {
1161
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1171
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11621172 snapobjectButton.addActionListener(this);
11631173 snapobjectButton.setToolTipText("Snap Object");
11641174
1165
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11661176 fourButton.addActionListener(this);
11671177 fourButton.setToolTipText("Show control panel only");
11681178 }
....@@ -1170,11 +1180,11 @@
11701180 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11711181
11721182
1173
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11741184 rootButton.setToolTipText("Open selection in new tab");
11751185 rootButton.addActionListener(this);
11761186
1177
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11781188 closeButton.setToolTipText("Close tab");
11791189 closeButton.addActionListener(this);
11801190 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -1183,38 +1193,38 @@
11831193 cGridBag row1 = new cGridBag();
11841194
11851195 // INSERT
1186
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1196
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11871197 gridButton.setToolTipText("Create ground");
11881198 gridButton.addActionListener(this);
11891199
1190
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1200
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11911201 boxButton.setToolTipText("Create box");
11921202 boxButton.addActionListener(this);
11931203
1194
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1204
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11951205 superButton.setToolTipText("Create superellipsoid");
11961206 superButton.addActionListener(this);
11971207
1198
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1208
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11991209 sphereButton.setToolTipText("Create sphere");
12001210 sphereButton.addActionListener(this);
12011211
1202
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1212
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12031213 coneButton.setToolTipText("Create cone");
12041214 coneButton.addActionListener(this);
12051215
1206
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1216
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12071217 torusButton.setToolTipText("Create torus");
12081218 torusButton.addActionListener(this);
12091219
12101220 if (Globals.ADVANCED)
12111221 {
1212
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1222
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12131223 kleinButton.setToolTipText("Create Klein bottle");
12141224 kleinButton.addActionListener(this);
12151225 }
12161226
1217
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1227
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12181228 particlesButton.setToolTipText("Create particle system");
12191229 particlesButton.addActionListener(this);
12201230
....@@ -1222,31 +1232,31 @@
12221232
12231233 cGridBag row2 = new cGridBag();
12241234
1225
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1235
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12261236 groupButton.setToolTipText("Create group");
12271237 groupButton.addActionListener(this);
12281238
1229
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1239
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12301240 compositeButton.setToolTipText("Create composite");
12311241 compositeButton.addActionListener(this);
12321242
1233
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1243
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12341244 switchButton.setToolTipText("Create item switcher");
12351245 switchButton.addActionListener(this);
12361246
1237
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1247
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12381248 loopButton.setToolTipText("Create loop");
12391249 loopButton.addActionListener(this);
12401250
1241
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1251
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12421252 textureButton.setToolTipText("Create texture");
12431253 textureButton.addActionListener(this);
12441254
1245
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1255
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12461256 overlayButton.setToolTipText("Create overlay");
12471257 overlayButton.addActionListener(this);
12481258
1249
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1259
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12501260 lightButton.setToolTipText("Create light");
12511261 lightButton.addActionListener(this);
12521262
....@@ -1256,6 +1266,11 @@
12561266
12571267 CreateTexturePanel(textures);
12581268
1269
+ int tabCount = resourcecontainer.getTabCount();
1270
+
1271
+ if (tabCount > 0)
1272
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1273
+
12591274 oe.toolboxPanel.add(textures);
12601275
12611276 textures.preferredHeight = 100;
....@@ -1263,11 +1278,11 @@
12631278 CreateSkyboxPanel(oe.skyboxPanel);
12641279
12651280 // EDIT panel
1266
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1281
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12671282 editButton.setToolTipText("Pin selection controls");
12681283 editButton.addActionListener(this);
12691284
1270
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1285
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12711286 uneditButton.setToolTipText("Unpin and remove selection controls");
12721287 uneditButton.addActionListener(this);
12731288
....@@ -1275,7 +1290,7 @@
12751290 allParamsButton.setToolTipText("Show all controls");
12761291 allParamsButton.addActionListener(this);
12771292
1278
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1293
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12791294 clearPanelButton.setToolTipText("Clear all controls");
12801295 clearPanelButton.addActionListener(this);
12811296
....@@ -1283,7 +1298,7 @@
12831298 //unselectButton.setToolTipText("Unselect");
12841299 //unselectButton.addActionListener(this);
12851300
1286
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1301
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12871302 flashSelectionButton.setToolTipText("Highlight selection");
12881303 flashSelectionButton.addActionListener(this);
12891304
....@@ -1306,6 +1321,8 @@
13061321
13071322 cGridBag jSPPanel = new cGridBag();
13081323
1324
+ jSPPanel.preferredHeight = 20;
1325
+
13091326 JScrollPane jSP;
13101327 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13111328 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1314,11 +1331,11 @@
13141331 oe.treePanel.add(jSPPanel);
13151332 oe.treePanel.Return();
13161333
1317
- oe.treePanel.add(copyOptionsPanel);
1334
+ oe.treePanel.add(versionManagerPanel);
13181335 oe.treePanel.Return();
1319
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1320
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1321
- sliderPane.preferredHeight = 1;
1336
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1337
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1338
+ versionSliderPane.preferredHeight = 3;
13221339
13231340 // mainPanel.setDividerLocation(0.1); //1.0);
13241341 mainPanel.setResizeWeight(0.4);
....@@ -2112,24 +2129,24 @@
21122129 switch(axis)
21132130 {
21142131 case 0 :
2115
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2116
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
2117
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2118
- vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z;
2132
+ vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z;
2133
+ vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z;
2134
+ vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z;
2135
+ vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z;
21192136 norm = cVector.X;
21202137 break;
21212138 case 1 :
2122
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2123
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2124
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2125
- vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z;
2139
+ vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z;
2140
+ vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z;
2141
+ vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z;
2142
+ vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z;
21262143 norm = cVector.Y;
21272144 break;
21282145 case 2 :
2129
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2130
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2131
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
2132
- vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z;
2146
+ vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f;
2147
+ vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f;
2148
+ vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f;
2149
+ vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f;
21332150 norm = cVector.Z;
21342151 break;
21352152 }
....@@ -3451,6 +3468,10 @@
34513468 {
34523469 ClearMaterials();
34533470 } else
3471
+ if (source == clearVersionsItem)
3472
+ {
3473
+ ClearVersions();
3474
+ } else
34543475 if (source == liveleavesItem)
34553476 {
34563477 LiveLeaves(true);
....@@ -3963,6 +3984,8 @@
39633984 if (source == closeButton)
39643985 {
39653986 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3987
+ Replace();
3988
+
39663989 cRadio ab;
39673990 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39683991 {
....@@ -4061,6 +4084,8 @@
40614084 } else
40624085 if(source instanceof cRadio)
40634086 {
4087
+ Replace();
4088
+
40644089 group.parent = keepparent;
40654090 group.attributes = 0;
40664091 //group.editWindow = null;
....@@ -4116,13 +4141,23 @@
41164141
41174142 if (copy.versionlist == null)
41184143 {
4119
- copy.versionlist = new Object3D[100];
41204144 copy.versionindex = -1;
41214145
41224146 // Cannot work with loops
4123
- // To fix this issue, first mark all nodes above the root,
4147
+ // To fix this issue, we first mark all nodes above the root,
41244148 // and check if any of these nodes are reachable below the root.
4125
- //Save(true);
4149
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4150
+
4151
+ if (copy.versionlist == null && !copy.HasTags())
4152
+ {
4153
+ copy.versionlist = new Object3D[100];
4154
+
4155
+ //Save(true);
4156
+ }
4157
+ else
4158
+ copy.versionindex = -2;
4159
+
4160
+ Grafreed.grafreed.universe.TagObjects(copy, false);
41264161 }
41274162
41284163 SetVersionStates();
....@@ -4270,7 +4305,7 @@
42704305 TouchTransform(obj);
42714306 continue;
42724307 }
4273
- if ((mask&2) != 0) // Scale
4308
+ if ((mask&2) != 0) // Scale/rotation
42744309 {
42754310 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42764311 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4278,10 +4313,6 @@
42784313 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42794314 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42804315 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4281
- }
4282
- if ((mask&4) != 0) // Rotation
4283
- {
4284
- // ?
42854316 }
42864317 if ((mask&1) != 0) // Translation
42874318 {
....@@ -5090,6 +5121,12 @@
50905121 refreshContents();
50915122 }
50925123
5124
+ void ClearVersions()
5125
+ {
5126
+ group.selection.ClearVersions();
5127
+ refreshContents();
5128
+ }
5129
+
50935130 void FlipV(boolean flip)
50945131 {
50955132 group.selection.FlipV(flip);
....@@ -5380,6 +5417,7 @@
53805417
53815418 void refreshContents(boolean cp)
53825419 {
5420
+ if (Globals.ADVANCED)
53835421 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53845422 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53855423 {
....@@ -6330,6 +6368,7 @@
63306368 private MenuItem clipMeshItem;
63316369 private MenuItem smoothMeshItem;
63326370 private MenuItem clearMaterialsItem;
6371
+ private MenuItem clearVersionsItem;
63336372
63346373 private MenuItem liveleavesItem;
63356374 private MenuItem unliveleavesItem;