Normand Briere
2019-07-19 e79247ef52a0bbb3864d46bb1e2c716005b3ecf3
GroupEditor.java
....@@ -60,6 +60,12 @@
6060 this.copy = this.group = group;
6161 //selectees = this.group.selectees;
6262
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6369 if(ui)
6470 SetupUI(objEditor);
6571 }
....@@ -74,7 +80,13 @@
7480 this.copy = this.group = copy;
7581 //selectees = this.group.selectees;
7682
77
- SetupMenu2(objEditor);
83
+ if (copy.versions == null)
84
+ {
85
+ copy.versions = new byte[100][];
86
+ copy.versionindex = -1;
87
+ }
88
+
89
+ SetupMenu2(this); //objEditor);
7890 SetupUI2(objEditor);
7991 objEditor.SetupUI(true);
8092 SetupViews(objEditor);
....@@ -84,6 +96,10 @@
8496
8597 void CloneSelection(boolean supports)
8698 {
99
+ if (Globals.REPLACEONMAKE)
100
+ Save();
101
+ boolean keep = Globals.REPLACEONMAKE;
102
+ Globals.REPLACEONMAKE = false;
87103 // Object3D keep = GrafreeD.clipboard;
88104 //Object3D obj;
89105 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +110,19 @@
94110
95111 makeSomething(clone, i==group.selection.size()-1);
96112 }
113
+ Globals.REPLACEONMAKE = keep;
97114 }
98115
99116 void CloneClipboard(boolean supports)
100117 {
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));
118
+ assert(Grafreed.clipboard.parent == null);
119
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
120
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
121
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
122
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106123 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
124
+ makeSomething(CloneObject(Grafreed.clipboard, false));
125
+ Grafreed.clipboard.get(0).parent = keepparent;
109126 }
110127
111128 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +136,7 @@
119136 // obj.support = null;
120137 if (!supports)
121138 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
139
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123140 obj.parent = parent;
124141 // obj.support = support;
125142 // clone.support = support; // aout 2013
....@@ -148,30 +165,29 @@
148165
149166 //JTextField nameField;
150167
151
- void SetupMenu2(ObjEditor oe)
168
+ void SetupMenu2(GroupEditor oe)
152169 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
170
+ oe.jTree = new cTree();
171
+
164172 Menu menu;
165173 oe.menuBar.add(menu = new Menu("Edit"));
166174 //editItem = menu.add(new MenuItem("Edit"));
167175 //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
176
+
177
+// undoItem = menu.add(new MenuItem("Undo"));
178
+// undoItem.addActionListener(this);
179
+// redoItem = menu.add(new MenuItem("Redo"));
180
+// redoItem.addActionListener(this);
181
+// menu.add("-");
182
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
169183 duplicateItem.addActionListener(this);
170
- menu.add("-");
171184 cloneItem = menu.add(new MenuItem("Clone"));
172185 cloneItem.addActionListener(this);
186
+ if (Globals.ADVANCED)
187
+ {
173188 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174189 cloneSupportItem.addActionListener(this);
190
+ }
175191 menu.add("-");
176192 cutItem = menu.add(new MenuItem("Cut"));
177193 cutItem.addActionListener(this);
....@@ -179,27 +195,123 @@
179195 copyItem.addActionListener(this);
180196 pasteItem = menu.add(new MenuItem("Paste"));
181197 pasteItem.addActionListener(this);
198
+
199
+ menu.add("-");
200
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
201
+ pasteIntoItem.addActionListener(this);
182202 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183203 pasteLinkItem.addActionListener(this);
184204 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185205 pasteCloneItem.addActionListener(this);
186206 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187207 // pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
208
+ menu.add("-");
209
+ deleteItem = menu.add(new MenuItem("Delete"));
210
+ deleteItem.addActionListener(this);
211
+
212
+ if (Globals.ADVANCED)
213
+ {
214
+ // Deletes the cameras...
190215 clearAllItem = menu.add(new MenuItem("Clear All"));
191216 clearAllItem.addActionListener(this);
217
+ }
218
+
219
+ menuBar.add(cameraMenu = new Menu("View"));
220
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
221
+ //zBufferItem.addActionListener(this);
222
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
223
+ //normalLensItem.addActionListener(this);
224
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
225
+ restoreCameraItem.addActionListener(this);
226
+
227
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
228
+// toggleFullScreenItem.addItemListener(this);
229
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
230
+// cameraMenu.add("-");
231
+//
232
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
233
+// toggleTextureItem.addItemListener(this);
234
+// toggleTextureItem.setState(CameraPane.textureon);
235
+//
236
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
237
+// toggleSwitchItem.addItemListener(this);
238
+// toggleSwitchItem.setState(CameraPane.SWITCH);
239
+
240
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
241
+ toggleHandleItem.addItemListener(this);
242
+ toggleHandleItem.setState(CameraPane.HANDLES);
243
+
244
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
245
+ togglePaintItem.addItemListener(this);
246
+ togglePaintItem.setState(CameraPane.PAINTMODE);
247
+
248
+ if (Globals.ADVANCED)
249
+ {
250
+ cameraMenu.add("-");
251
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
252
+ toggleLiveItem.addItemListener(this);
253
+ toggleLiveItem.setState(Globals.isLIVE());
192254
255
+ cameraMenu.add(stepItem = new MenuItem("Step"));
256
+ stepItem.addActionListener(this);
257
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
258
+ // toggleDLItem.addItemListener(this);
259
+ // toggleDLItem.setState(false);
260
+
261
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
262
+ toggleRenderItem.addItemListener(this);
263
+ toggleRenderItem.setState(!CameraPane.frozen);
264
+
265
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
266
+ toggleDebugItem.addItemListener(this);
267
+ toggleDebugItem.setState(Globals.DEBUG);
268
+
269
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
270
+ toggleFrustumItem.addItemListener(this);
271
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
272
+
273
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
274
+ toggleFootContactItem.addItemListener(this);
275
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
276
+
277
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
278
+ toggleTimelineItem.addItemListener(this);
279
+ }
280
+
281
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
282
+// toggleRootItem.addItemListener(this);
283
+// toggleRootItem.setState(false);
284
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
285
+// animationItem.addItemListener(this);
286
+// animationItem.setState(CameraPane.ANIMATION);
287
+ cameraMenu.add("-");
288
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
289
+ editCameraItem.addActionListener(this);
290
+
291
+ if (Globals.ADVANCED)
292
+ {
293
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
294
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
295
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
296
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
297
+ oe.cameraMenu.add("-");
298
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
299
+ openWindowItem.addActionListener(this);
300
+ editLeafItem.addActionListener(this);
301
+ lookAtItem.addActionListener(this);
302
+ //lookFromItem.addActinoListener(this);
303
+ //switchViewItem.addActionListener(this);
304
+ }
305
+
193306 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
307
+ if (Globals.ADVANCED)
308
+ {
198309 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199310 revertMeshItem.addActionListener(this);
200311 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201312 resetreferencesItem.addActionListener(this);
202313 menu.add("-");
314
+ }
203315 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204316 overwriteGeoItem.addActionListener(this);
205317 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +323,104 @@
211323 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212324 overwriteUVItem.addActionListener(this);
213325 menu.add("-");
326
+ if (Globals.ADVANCED)
327
+ {
214328 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215329 generateMeshItem.addActionListener(this);
216330 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217331 poseMeshItem.addActionListener(this);
218332 menu.add("-");
333
+ }
219334 resetsupportItem = menu.add(new MenuItem("Reset support"));
220335 resetsupportItem.addActionListener(this);
221336 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222337 linkverticesItem.addActionListener(this);
223338 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224339 relinkverticesItem.addActionListener(this);
340
+
341
+ if (Globals.ADVANCED)
342
+ {
225343 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226344 setMasterItem.addActionListener(this);
345
+ }
227346
228347 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
348
+// grabItem = menu.add(new MenuItem("Grab"));
349
+// grabItem.addActionListener(this);
231350 backItem = menu.add(new MenuItem("Back"));
232351 backItem.addActionListener(this);
233352 frontItem = menu.add(new MenuItem("Front"));
234353 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
354
+// compositeItem = menu.add(new MenuItem("Composite"));
355
+// compositeItem.addActionListener(this);
356
+
357
+ if (Globals.ADVANCED)
358
+ {
359
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238360 hideItem.addActionListener(this);
361
+ }
239362 ungroupItem = menu.add(new MenuItem("Ungroup"));
240363 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
364
+
365
+// menu.add("-");
366
+//
367
+// switchItem = menu.add(new MenuItem("Switch node"));
368
+// switchItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
248371 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249372 switchGeoItem.addActionListener(this);
250373 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251374 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
375
+ morphItem = menu.add(new MenuItem("Morph Group"));
253376 morphItem.addActionListener(this);
377
+
378
+ menu.add("-");
379
+ physicsItem = menu.add(new MenuItem("Physics"));
380
+ physicsItem.addActionListener(this);
381
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
382
+ frameselectorItem.addActionListener(this);
254383 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255384 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
385
+ }
258386
259387 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
388
+// textureItem = menu.add(new MenuItem("Texture"));
389
+// textureItem.addActionListener(this);
262390 billboardItem = menu.add(new MenuItem("Billboard"));
263391 billboardItem.addActionListener(this);
264392 csgItem = menu.add(new MenuItem("CSG"));
265393 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
394
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267395 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
396
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269397 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
398
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271399 shadowZItem.addActionListener(this);
400
+ attributeItem = menu.add(new MenuItem("Attribute"));
401
+ attributeItem.addActionListener(this);
402
+
403
+ if (Globals.ADVANCED)
404
+ {
405
+ menu.add("-");
272406 linkerItem = menu.add(new MenuItem("Linker"));
273407 linkerItem.addActionListener(this);
274408 templateItem = menu.add(new MenuItem("Template"));
275409 templateItem.addActionListener(this);
276
- attributeItem = menu.add(new MenuItem("Attribute"));
277
- attributeItem.addActionListener(this);
278410 pointflowItem = menu.add(new MenuItem("Point Flow"));
279411 pointflowItem.addActionListener(this);
412
+ }
280413 menu.add("-");
281414 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282415 resetTransformItem.addActionListener(this);
283416 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284417 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
418
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
419
+ resetCentroidXZItem.addActionListener(this);
420
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
421
+ transformGeometryItem.addActionListener(this);
422
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
423
+ transformChildrenItem.addActionListener(this);
287424
288425 oe.menuBar.add(menu = new Menu("Geometry"));
289426 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +431,11 @@
294431 genNormalsCADItem.addActionListener(this);
295432 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296433 genNormalsMESHItem.addActionListener(this);
297
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
434
+ if (Globals.ADVANCED)
435
+ {
436
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
298437 genNormalsMINEItem.addActionListener(this);
438
+ }
299439 stripifyItem = menu.add(new MenuItem("Stripify"));
300440 stripifyItem.addActionListener(this);
301441 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +457,34 @@
317457 reduce34MeshItem.addActionListener(this);
318458 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319459 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322460 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323461 clipMeshItem.addActionListener(this);
462
+
463
+ if (Globals.ADVANCED)
464
+ {
465
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
466
+ smoothMeshItem.addActionListener(this);
467
+ }
324468
325469 oe.menuBar.add(menu = new Menu("Attributes"));
326470 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327471 clearMaterialsItem.addActionListener(this);
472
+ resetAllItem = menu.add(new MenuItem("Reset All"));
473
+ resetAllItem.addActionListener(this);
474
+ stepAllItem = menu.add(new MenuItem("Step All"));
475
+ stepAllItem.addActionListener(this);
328476 menu.add("-");
329477 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330478 liveleavesItem.addActionListener(this);
331479 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332480 unliveleavesItem.addActionListener(this);
481
+ if (Globals.ADVANCED)
482
+ {
333483 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334484 supportleavesItem.addActionListener(this);
335485 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336486 unsupportleavesItem.addActionListener(this);
487
+ }
337488 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338489 hideleavesItem.addActionListener(this);
339490 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +493,14 @@
342493 markleavesItem.addActionListener(this);
343494 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344495 unmarkleavesItem.addActionListener(this);
496
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
497
+ rewindleavesItem.addActionListener(this);
498
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
499
+ unrewindleavesItem.addActionListener(this);
500
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
501
+ randomleavesItem.addActionListener(this);
502
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
503
+ unrandomleavesItem.addActionListener(this);
345504 menu.add("-");
346505 flipVItem = menu.add(new MenuItem("Flip V"));
347506 flipVItem.addActionListener(this);
....@@ -377,35 +536,41 @@
377536 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378537 sortbynameItem.addActionListener(this);
379538 menu.add("-");
539
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
540
+ shareGeometriesItem.addActionListener(this);
541
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
542
+ mergeGeometriesItem.addActionListener(this);
543
+ if (Globals.ADVANCED)
544
+ {
545
+ // Pretty much the same as duplicate and clone.
380546 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381547 extractGeometriesItem.addActionListener(this);
382548 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383549 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
550
+ }
388551
389552 oe.menuBar.add(menu = new Menu("Insert"));
390553 buildCreateMenu(menu);
391554
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403555 oe.menuBar.add(menu = new Menu("Tools"));
404556 buildToolsMenu(menu);
405557 }
406558
559
+
407560 void SetupUI2(ObjEditor oe)
408561 {
562
+ // June 2019
563
+ if (oe == null)
564
+ {
565
+ //super.SetupUI2(this);
566
+ //return;
567
+ }
568
+
569
+ if (copy != group)
570
+ {
571
+ //super.SetupUI2(this);
572
+ }
573
+
409574 //new Exception().printStackTrace();
410575
411576 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,110 +599,231 @@
434599 oe.radioPanel.add(dummyButton);
435600 oe.buttonGroup.add(dummyButton);
436601 */
437
- aConstraints.gridy += 1;
602
+ cGridBag copyOptionsPanel = new cGridBag();
603
+
604
+ copyOptionsPanel.preferredHeight = 1;
438605
439606 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
440607
441
- oe.aConstraints.gridwidth = 1;
442
- oe.aConstraints.gridx = 0;
608
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ //minButton.setToolTipText("Minimize window");
610
+ //minButton.addActionListener(this);
443611
444
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
445
- liveCB.setToolTipText("Enabled animation");
446
- liveCB.addItemListener(this);
447
-
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
450
- trackCB.setToolTipText("Enable tracking");
451
- trackCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
612
+ if (Globals.ADVANCED)
613
+ {
614
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ maxButton.setToolTipText("Maximize window");
616
+ maxButton.addActionListener(this);
617
+ }
618
+
619
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ fullButton.setToolTipText("Full-screen window");
621
+ fullButton.addActionListener(this);
622
+
623
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
455624 screenfitButton.setToolTipText("Screen fit");
456625 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
626
+
627
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
628
+ restoreCameraButton.setToolTipText("Restore viewpoint");
629
+ restoreCameraButton.addActionListener(this);
630
+
631
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ saveButton.setToolTipText("New version");
633
+ saveButton.addActionListener(this);
634
+
635
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ undoButton.setToolTipText("Previous version");
637
+ undoButton.addActionListener(this);
638
+ undoButton.setEnabled(false);
639
+
640
+ cGridBag updown = new cGridBag().setVertical(true);
641
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ restoreButton.setToolTipText("Restore current");
643
+ restoreButton.addActionListener(this);
644
+ restoreButton.setEnabled(false);
645
+
646
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ replaceButton.setToolTipText("Replace current");
648
+ replaceButton.addActionListener(this);
649
+ replaceButton.setEnabled(false);
650
+
651
+ copyOptionsPanel.add(updown);
652
+
653
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ redoButton.setToolTipText("Next version");
655
+ redoButton.addActionListener(this);
656
+ redoButton.setEnabled(false);
657
+
658
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
659
+ liveCB.setToolTipText("Enable animation");
660
+ liveCB.addItemListener(this);
661
+
662
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
+ oneStepButton.setToolTipText("Animate one step forward");
664
+ oneStepButton.addActionListener(this);
665
+
666
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
667
+ fastCB.setToolTipText("Fast mode");
668
+ fastCB.addItemListener(this);
669
+
670
+ //oe.toolboxPanel.Return();
671
+
672
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
673
+// trackCB.setToolTipText("Enable tracking");
674
+// trackCB.addItemListener(this);
675
+
458676 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
459677 // screenfitpointButton.addActionListener(this);
460
-// oe.aConstraints.gridx += 1;
461
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
462
- snapobjectButton.addActionListener(this);
463
- snapobjectButton.setToolTipText("Snap Object");
464
- oe.aConstraints.gridx += 1;
465678
466
- //aConstraints.gridx = 0;
467
- //aConstraints.gridy += 1;
468
- oe.aConstraints.weighty = 0;
469
- oe.aConstraints.gridwidth = 1;
470
-
471
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
472
- flashSelectionButton.setToolTipText("Show selection");
473
- flashSelectionButton.addActionListener(this);
679
+ if (Globals.ADVANCED)
680
+ {
681
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ snapobjectButton.addActionListener(this);
683
+ snapobjectButton.setToolTipText("Snap Object");
684
+ }
685
+
686
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
474687
475
- oe.toolbarPanel.add(new cButton(" ", false));
476
-
477
- oe.aConstraints.gridx += 1;
478
- oe.aConstraints.weighty = 0;
479
- oe.aConstraints.gridwidth = 1;
480
-
481
- //
482
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
483
- twoButton.setToolTipText("Show center view only");
484
- twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
688
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
486689 fourButton.addActionListener(this);
487690 fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
489
- sixButton.setToolTipText("2-column layout left");
691
+
692
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ twoButton.setToolTipText("Show right view only");
694
+ twoButton.addActionListener(this);
695
+ this.fullscreenLayout = twoButton;
696
+
697
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ sixButton.setToolTipText("Show left and right");
490699 sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
492
- threeButton.setToolTipText("2-column layout right");
493
- threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
495
- sevenButton.setToolTipText("3-column layout");
496
- sevenButton.addActionListener(this);
700
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+// threeButton.setToolTipText("2-column layout right");
702
+// threeButton.addActionListener(this);
703
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+// sevenButton.setToolTipText("3-column layout");
705
+// sevenButton.addActionListener(this);
497706 //
498707
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- rootButton.setToolTipText("Edit object in new tab");
708
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ rootButton.setToolTipText("Open selection in new tab");
501710 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
711
+
712
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504713 closeButton.setToolTipText("Close tab");
505714 closeButton.addActionListener(this);
506715 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
507716 //clearButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509
-
510
- oe.aConstraints.gridx = 1; //
511
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
512
- editButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516717
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
718
+ // INSERT
719
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
720
+ gridButton.setToolTipText("Create grid");
721
+ gridButton.addActionListener(this);
722
+
723
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ boxButton.setToolTipText("Create box");
725
+ boxButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
728
+ sphereButton.setToolTipText("Create sphere");
729
+ sphereButton.addActionListener(this);
730
+
731
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
732
+ coneButton.setToolTipText("Create cone");
733
+ coneButton.addActionListener(this);
734
+
735
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+ torusButton.setToolTipText("Create torus");
737
+ torusButton.addActionListener(this);
738
+
739
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
740
+ superButton.setToolTipText("Create superellipsoid");
741
+ superButton.addActionListener(this);
742
+
743
+ if (Globals.ADVANCED)
744
+ {
745
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
746
+ kleinButton.setToolTipText("Create Klein bottle");
747
+ kleinButton.addActionListener(this);
748
+ }
749
+
750
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
751
+ particlesButton.setToolTipText("Create particle system");
752
+ particlesButton.addActionListener(this);
753
+
754
+ oe.toolboxPanel.Return();
755
+
756
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
757
+ groupButton.setToolTipText("Create group");
758
+ groupButton.addActionListener(this);
759
+
760
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
761
+ compositeButton.setToolTipText("Create composite");
762
+ compositeButton.addActionListener(this);
763
+
764
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
765
+ switchButton.setToolTipText("Create item switcher");
766
+ switchButton.addActionListener(this);
767
+
768
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
769
+ loopButton.setToolTipText("Create loop");
770
+ loopButton.addActionListener(this);
771
+
772
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
773
+ textureButton.setToolTipText("Create texture");
774
+ textureButton.addActionListener(this);
775
+
776
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
777
+ overlayButton.setToolTipText("Create overlay");
778
+ overlayButton.addActionListener(this);
779
+
780
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
781
+ lightButton.setToolTipText("Create light");
782
+ lightButton.addActionListener(this);
783
+
784
+ for (int i=6; --i>=0;)
785
+ {
786
+ oe.toolboxPanel.Return();
787
+ oe.toolboxPanel.add(new cGridBag());
788
+ oe.toolboxPanel.add(new cGridBag());
789
+ oe.toolboxPanel.add(new cGridBag());
790
+ oe.toolboxPanel.add(new cGridBag());
791
+ oe.toolboxPanel.add(new cGridBag());
792
+ oe.toolboxPanel.add(new cGridBag());
793
+ oe.toolboxPanel.add(new cGridBag());
794
+ }
795
+
796
+ // EDIT panel
797
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
798
+ editButton.setToolTipText("Pin selection controls");
799
+ editButton.addActionListener(this);
800
+
801
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
802
+ uneditButton.setToolTipText("Remove selection controls");
518803 uneditButton.addActionListener(this);
519804
520
- oe.aConstraints.gridx += 1;
521
- oe.aConstraints.weighty = 0;
522
- oe.aConstraints.gridwidth = 1;
523
-
524
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
525
- clearPanelButton.addActionListener(this);
526
-
527
- oe.aConstraints.gridx += 1;
528
- oe.aConstraints.weighty = 0;
529
- oe.aConstraints.gridwidth = 1;
530
-
531
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
805
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
806
+ allParamsButton.setToolTipText("Show all controle");
532807 allParamsButton.addActionListener(this);
533808
534
- oe.aConstraints.gridx += 1;
535
- oe.aConstraints.weighty = 0;
536
- oe.aConstraints.gridwidth = 1;
537
-
538
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
809
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
810
+ clearPanelButton.setToolTipText("Clear edit panel");
811
+ clearPanelButton.addActionListener(this);
812
+
813
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
814
+ unselectButton.setToolTipText("Unselect");
539815 unselectButton.addActionListener(this);
540816
817
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
818
+ flashSelectionButton.setToolTipText("Highlight selection");
819
+ flashSelectionButton.addActionListener(this);
820
+
821
+ editCommandsPanel.preferredHeight = 1;
822
+
823
+ SetPinStates(false);
824
+// oe.treePanel.add(commandsPanel);
825
+// oe.treePanel.Return();
826
+
541827 // oe.aConstraints.gridx += 1;
542828 // oe.aConstraints.weighty = 0;
543829 // oe.aConstraints.gridwidth = 1;
....@@ -549,40 +835,25 @@
549835 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
550836 // gcButton.addActionListener(this);
551837
552
- oe.aConstraints.gridx = 0;
553
- oe.aConstraints.gridy += 1;
554
-
555
- //ctrlPanel.add(objList = new List(5, true));
556
- oe.aConstraints.gridwidth = 100;
557
- // oe.aConstraints.gridheight = 100;
558
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
559
- oe.aConstraints.gridheight = 1;
560
- oe.aConstraints.weighty = 0.5;
561
- oe.aConstraints.gridx = 0;
562
- JScrollPane jSP;
838
+ cGridBag jSPPanel = new cGridBag();
839
+
840
+ JScrollPane jSP;
563841 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
564
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
842
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
565843 ResetModel();
566
- oe.aConstraints.weighty = 0.5;
567
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
568
- oe.aConstraints.gridy += 1;
569
- oe.aConstraints.gridwidth = 1;
570
-
571
- oe.aConstraints.weighty = 0;
572
- oe.aConstraints.gridwidth = 2;
573
-
574
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
575
- colorCB.addItemListener(this);
576
- oe.aConstraints.gridx += 2;
577
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
578
- materialCB.addItemListener(this);
579
- oe.aConstraints.gridx += 2;
580
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
581
- textureCB.addItemListener(this);
582
-
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585844
845
+ oe.treePanel.add(jSPPanel);
846
+ oe.treePanel.Return();
847
+
848
+ oe.treePanel.add(copyOptionsPanel);
849
+ oe.treePanel.Return();
850
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
851
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
852
+ sliderPane.preferredHeight = 1;
853
+
854
+// mainPanel.setDividerLocation(0.5); //1.0);
855
+// mainPanel.setResizeWeight(0.5);
856
+
586857 //jList.addListSelectionListener(this);
587858 oe.jTree.addTreeSelectionListener(this);
588859 //jTree.setRootVisible(false);
....@@ -601,53 +872,67 @@
601872 dgr.addDragGestureListener(this);
602873 }catch(Exception e) {}
603874 */
604
- radio.layout = sevenButton;
875
+ radio.layout = sixButton; // sevenButton;
605876 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
606877 }
607878
608879 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609880 {
610
- //constraints.gridx = 0;
611
- //constraints.gridy = 0;
612
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
- fastCB.setToolTipText("Fast mode");
614
- fastCB.addItemListener(this);
615
- //constraints.gridy += 1;
616
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
- supportCB.setToolTipText("Enabled rigging");
618
- supportCB.addItemListener(this);
881
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
882
+ colorCB.setToolTipText("Copy color when dropped");
883
+ colorCB.addItemListener(this);
619884
620
- // constraints.gridy += 1;
885
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
886
+ materialCB.setToolTipText("Copy material when dropped");
887
+ materialCB.addItemListener(this);
888
+
889
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
890
+ textureCB.setToolTipText("Copy texture when dropped");
891
+ textureCB.addItemListener(this);
892
+
893
+ panel.Return();
894
+
895
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
896
+ boxCB.setToolTipText("Display bounding boxes");
897
+ boxCB.addItemListener(this);
898
+
899
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
900
+ zoomBoxCB.setToolTipText("Display only for wheel");
901
+ zoomBoxCB.addItemListener(this);
902
+
903
+ if (true) // Globals.ADVANCED)
904
+ {
905
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
906
+// supportCB.setToolTipText("Enable rigging");
907
+// supportCB.addItemListener(this);
908
+
909
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
910
+ freezeCB.setToolTipText("Fast moving camera");
911
+ freezeCB.addItemListener(this);
912
+
621913 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622914 // localCB.addItemListener(this);
623915
624
- //constraints.gridy += 1;
916
+ panel.Return();
917
+
625918 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
626919 crowdCB.setToolTipText("Used for crowds");
627920 crowdCB.addItemListener(this);
628921
629
- //constraints.gridy += 1;
630922 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
631923 smoothCB.setToolTipText("Snapping delay");
632924 smoothCB.addItemListener(this);
633925
634
- //constraints.gridy += 1;
635926 panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636927 slowCB.setToolTipText("Smooth interpolation");
637928 slowCB.addItemListener(this);
638
- //constraints.gridy += 1;
639
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640
- boxCB.setToolTipText("Display bounding boxes");
641
- boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
643
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645
- zoomBoxCB.addItemListener(this);
646
-
929
+
647930 // constraints.gridy += 1;
648931 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649932 // speakerMocapCB.addItemListener(this);
650933
934
+ panel.Return();
935
+
651936 if (false)
652937 {
653938 // handled in scripts
....@@ -662,36 +947,85 @@
662947 //constraints.gridy += 1;
663948 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
664949 smoothfocusCB.addItemListener(this);
950
+ panel.Return();
665951 }
666952
667953 //constraints.gridx += 1;
668954 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669955 // debugCB.addItemListener(this);
670956
671
- //constraints.gridy += 1;
957
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
958
+ trackCB.setToolTipText("Enable tracking target");
959
+ trackCB.addItemListener(this);
960
+
672961 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
962
+ oeilCB.setToolTipText("Move camera when tracking");
673963 oeilCB.addItemListener(this);
674964
675
- //constraints.gridy += 1;
965
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
966
+ shadowCB.setToolTipText("When live compute shadows");
967
+ shadowCB.addItemListener(this);
968
+
969
+ panel.Return();
970
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
971
+ toggleTextureCB.setToolTipText("Load textures");
972
+ toggleTextureCB.addItemListener(this);
973
+
974
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
975
+ toggleSwitchCB.setToolTipText("Choose a single item");
976
+ toggleSwitchCB.addItemListener(this);
977
+
978
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
979
+ autokeepCB.setToolTipText("On structure change");
980
+ autokeepCB.addItemListener(this);
981
+
982
+ panel.Return();
983
+ if (Globals.ADVANCED)
984
+ {
676985 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677986 lookAtCB.setToolTipText("Look-at target");
678987 lookAtCB.addItemListener(this);
988
+ }
989
+
990
+ }
991
+
992
+ cGridBag fill = new cGridBag();
993
+ fill.preferredHeight = 200;
994
+ cGridBag fill2 = new cGridBag();
995
+ fill2.preferredHeight = 200;
996
+ cGridBag fill3 = new cGridBag();
997
+ fill3.preferredHeight = 200;
998
+
999
+ panel.add(fill);
1000
+ panel.add(fill2);
1001
+ panel.add(fill3);
6791002
6801003 }
6811004
6821005 void EditObject(Object3D obj)
6831006 {
6841007 cRadio radioButton = new cRadio(obj.name);
1008
+
1009
+ // June 2019. Patch to avoid bug with transparency.
1010
+ radioButton.hadMaterial = obj.material != null;
1011
+ if (!radioButton.hadMaterial)
1012
+ {
1013
+ obj.material = new cMaterial();
1014
+ }
1015
+
6851016 radioButton.SetObject(obj);
686
- radioButton.layout = sevenButton;
1017
+ radioButton.layout = sixButton; // sevenButton;
6871018 radioButton.SetCamera(cameraView.renderCamera, false);
6881019 radioButton.addActionListener(this);
6891020 radioPanel.add(radioButton);
6901021 buttonGroup.add(radioButton);
6911022 radioButton.doClick();
6921023 }
1024
+
6931025 void SetupViews(ObjEditor oe)
6941026 {
1027
+ theFrame = this;
1028
+
6951029 oe.SetupViews();
6961030
6971031 System.out.println("SetupViews");
....@@ -700,23 +1034,28 @@
7001034 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7011035 }
7021036
703
- JCheckBox liveCB;
704
- JCheckBox supportCB;
705
- JCheckBox localCB;
706
- JCheckBox crowdCB;
707
- JCheckBox smoothCB;
708
- JCheckBox fastCB;
709
- JCheckBox slowCB;
710
- JCheckBox boxCB;
711
- JCheckBox zoomBoxCB;
712
- JCheckBox trackCB;
713
- JCheckBox smoothfocusCB;
1037
+ cToggleButton liveCB;
1038
+ cCheckBox supportCB;
1039
+ cCheckBox localCB;
1040
+ cCheckBox crowdCB;
1041
+ cCheckBox smoothCB;
1042
+ cToggleButton fastCB;
1043
+ cCheckBox slowCB;
1044
+ cCheckBox boxCB;
1045
+ cCheckBox zoomBoxCB;
1046
+ cCheckBox freezeCB;
1047
+ //cToggleButton trackCB;
1048
+ cCheckBox trackCB;
1049
+ cCheckBox smoothfocusCB;
7141050 // JCheckBox speakerMocapCB;
715
- JCheckBox speakerCameraCB;
716
- JCheckBox speakerFocusCB;
717
- JCheckBox debugCB;
718
- JCheckBox oeilCB;
719
- JCheckBox lookAtCB;
1051
+ cCheckBox speakerCameraCB;
1052
+ cCheckBox speakerFocusCB;
1053
+ cCheckBox debugCB;
1054
+
1055
+ cCheckBox oeilCB;
1056
+ cCheckBox shadowCB;
1057
+ cCheckBox autokeepCB;
1058
+ cCheckBox lookAtCB;
7201059
7211060 // static int COLOR = 1;
7221061 // static int MATERIAL = 2;
....@@ -724,9 +1063,9 @@
7241063
7251064 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7261065
727
- JCheckBox colorCB;
728
- JCheckBox materialCB;
729
- JCheckBox textureCB;
1066
+ cCheckBox colorCB;
1067
+ cCheckBox materialCB;
1068
+ cCheckBox textureCB;
7301069
7311070 public void itemStateChanged(ItemEvent e)
7321071 {
....@@ -754,6 +1093,7 @@
7541093 } else if(e.getSource() == liveCB)
7551094 {
7561095 cameraView.ToggleLive();
1096
+ refreshContents(false);
7571097 }
7581098 else if(e.getSource() == supportCB)
7591099 {
....@@ -818,6 +1158,18 @@
8181158 {
8191159 cameraView.ToggleOeil();
8201160 }
1161
+ else if(e.getSource() == shadowCB)
1162
+ {
1163
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1164
+ }
1165
+ else if(e.getSource() == freezeCB)
1166
+ {
1167
+ Globals.FREEZEONMOVE ^= true;
1168
+ }
1169
+ else if(e.getSource() == autokeepCB)
1170
+ {
1171
+ Globals.REPLACEONMAKE ^= true;
1172
+ }
8211173 else if(e.getSource() == lookAtCB)
8221174 {
8231175 cameraView.ToggleLookAt();
....@@ -834,7 +1186,8 @@
8341186
8351187 /**/
8361188 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
837
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1189
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1190
+ TreePath path = objEditor.jTree.getSelectionPath();
8381191 if ((path == null) || (path.getPathCount() <= 1)) {
8391192 // We can't move the root node or an empty selection
8401193 return;
....@@ -897,8 +1250,6 @@
8971250 }
8981251 }
8991252
900
- String string = (String) object;
901
-
9021253 System.out.println("Transfer = " + object + "; drop : " + target);
9031254 // if( object instanceof java.io.File[])
9041255 // {
....@@ -906,7 +1257,11 @@
9061257 // objEditor.DropFile((java.io.File[]) object, true);
9071258 // return;
9081259 // }
909
- if (string.charAt(0) == '/')
1260
+
1261
+ String string = object.toString();
1262
+
1263
+ // File path for Mac and Windows
1264
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9101265 {
9111266 // file(s)
9121267 String[] names = string.split("\n");
....@@ -933,7 +1288,7 @@
9331288
9341289 flashIt = false;
9351290 CameraPane pane = (CameraPane) target;
936
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1291
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9371292 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9381293
9391294 if (group.selection.size() == 1)
....@@ -949,23 +1304,33 @@
9491304
9501305 assert target == objEditor.jTree;
9511306 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1307
+ Object3D destinationLeaf;
9521308 try {
953
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1309
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9541310 } catch (Exception e) {
9551311 System.out.println("destinationPath : " + destinationPath);
9561312 return;
9571313 }
9581314
959
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1315
+ for (int i=group.selection.size(); --i>=0;)
9601316 {
1317
+ Object3D child = (Object3D)group.selection.elementAt(i);
1318
+
1319
+ // Cannot move into itself
1320
+ if (child == destinationLeaf)
1321
+ return;
1322
+ }
1323
+
1324
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1325
+// {
9611326 loadClipboard(true);
9621327 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
964
- } else {
965
- loadClipboard(false);
966
- objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
968
- }
1328
+ pasteInto(false, false);
1329
+// } else {
1330
+// loadClipboard(false);
1331
+// objEditor.jTree.setSelectionPath(destinationPath);
1332
+// pasteInto(false, false); // true); // ???
1333
+// }
9691334 }
9701335 public void dropActionChanged(DropTargetDragEvent dtde)
9711336 // Called if the user has modified the current drop gesture
....@@ -1070,85 +1435,107 @@
10701435 {
10711436 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10721437 //heightFieldItem.addActionListener(this);
1073
- gridItem = menu.add(new MenuItem("Grid"));
1074
- gridItem.addActionListener(this);
1075
- rectoidItem = menu.add(new MenuItem("Box"));
1076
- rectoidItem.addActionListener(this);
1077
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1078
- ellipsoidItem.addActionListener(this);
1079
- coneItem = menu.add(new MenuItem("Cone"));
1080
- coneItem.addActionListener(this);
1081
- torusItem = menu.add(new MenuItem("Torus"));
1082
- torusItem.addActionListener(this);
1083
- superItem = menu.add(new MenuItem("Superellipsoid"));
1084
- superItem.addActionListener(this);
1438
+// gridItem = menu.add(new MenuItem("Grid"));
1439
+// gridItem.addActionListener(this);
1440
+// rectoidItem = menu.add(new MenuItem("Box"));
1441
+// rectoidItem.addActionListener(this);
1442
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1443
+// ellipsoidItem.addActionListener(this);
1444
+// coneItem = menu.add(new MenuItem("Cone"));
1445
+// coneItem.addActionListener(this);
1446
+// torusItem = menu.add(new MenuItem("Torus"));
1447
+// torusItem.addActionListener(this);
1448
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1449
+// superItem.addActionListener(this);
1450
+
1451
+ cameraItem = menu.add(new MenuItem("Camera"));
1452
+ cameraItem.addActionListener(this);
1453
+
1454
+ if (!Globals.ADVANCED)
1455
+ {
10851456 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10861457 kleinItem.addActionListener(this);
1087
- particleItem = menu.add(new MenuItem("Particle system"));
1088
- particleItem.addActionListener(this);
1458
+ }
1459
+
1460
+// particleItem = menu.add(new MenuItem("Particle system"));
1461
+// particleItem.addActionListener(this);
1462
+ if (Globals.ADVANCED)
1463
+ {
10891464 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901465 ragdollItem.addActionListener(this);
10911466 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921467 ragdoll2Item.addActionListener(this);
1468
+ }
10931469 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1470
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951471 meshItem.addActionListener(this);
10961472 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971473 // meshGroupItem.addActionListener(this);
1474
+ if (Globals.ADVANCED)
1475
+ {
10981476 springItem = menu.add(new MenuItem("Spring"));
10991477 springItem.addActionListener(this);
11001478 flagItem = menu.add(new MenuItem("Flag"));
11011479 flagItem.addActionListener(this);
1102
- bezierItem = menu.add(new MenuItem("Patch"));
1103
- bezierItem.addActionListener(this);
1104
- checkerItem = menu.add(new MenuItem("Checker"));
1105
- checkerItem.addActionListener(this);
11061480 blobItem = menu.add(new MenuItem("Blob"));
11071481 blobItem.addActionListener(this);
11081482 latheItem = menu.add(new MenuItem("Lathe"));
11091483 latheItem.addActionListener(this);
1110
- lightItem = menu.add(new MenuItem("Light"));
1111
- lightItem.addActionListener(this);
1484
+ }
1485
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1486
+ bezierItem.addActionListener(this);
1487
+// overlayItem = menu.add(new MenuItem("Overlay"));
1488
+// overlayItem.addActionListener(this);
1489
+// lightItem = menu.add(new MenuItem("Light"));
1490
+// lightItem.addActionListener(this);
11121491 menu.add("-");
11131492 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11141493 //superLoopItem.addActionListener(this);
1115
- loopItem = menu.add(new MenuItem("Loop"));
1116
- loopItem.addActionListener(this);
1494
+// loopItem = menu.add(new MenuItem("Loop"));
1495
+// loopItem.addActionListener(this);
11171496 doubleItem = menu.add(new MenuItem("Fork"));
11181497 doubleItem.addActionListener(this);
1498
+ if (Globals.ADVANCED)
1499
+ {
11191500 tripleItem = menu.add(new MenuItem("Trident"));
11201501 tripleItem.addActionListener(this);
1502
+ }
11211503 }
11221504
11231505 void buildToolsMenu(Menu menu)
11241506 {
11251507 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261508 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1509
+ animationItem.setState(Globals.ANIMATION);
1510
+
1511
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1512
+ archiveItem.addActionListener(this);
11281513
11291514 menu.add("-");
11301515 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311516 parseverticesItem.addActionListener(this);
11321517 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331518 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1519
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351520 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381521 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391522 reduceMorphItem.addActionListener(this);
11401523 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411524 reduce34MorphItem.addActionListener(this);
1142
-
1143
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1144
- computeAOItem.addActionListener(this);
11451525 menu.add("-");
1146
-
11471526 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481527 memoryItem.addActionListener(this);
1528
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1529
+ computeAOItem.addActionListener(this);
1530
+
1531
+ if (Globals.ADVANCED)
1532
+ {
1533
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1534
+ mirrorItem.addActionListener(this);
1535
+ menu.add("-");
11491536 menu.add(analyzeItem = new MenuItem("Analyze"));
11501537 analyzeItem.addActionListener(this);
1151
- menu.add(dumpItem = new MenuItem("Dump"));
1538
+ menu.add(dumpItem = new MenuItem("Print"));
11521539 dumpItem.addActionListener(this);
11531540 // menu.add(pathItem = new MenuItem("From-to path"));
11541541 // pathItem.addActionListener(this);
....@@ -1166,6 +1553,7 @@
11661553 menu.add("-");
11671554 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681555 editScriptItem.addActionListener(this);
1556
+ }
11691557 }
11701558
11711559 void ScreenFit()
....@@ -1288,9 +1676,34 @@
12881676 shadow.material = new cMaterial(obj.material);
12891677 shadow.material.diffuse = 0.0001f;
12901678 shadow.material.specular = 0.0001f;
1679
+ //shadow.projectedVertices[1].x = 300;
12911680
12921681 makeSomething(shadow);
12931682 }
1683
+
1684
+ private void ClearUnpinned()
1685
+ {
1686
+ //for (Object3D obj : listUI)
1687
+ for (int i=listUI.size(); --i>=0;)
1688
+ {
1689
+ Object3D obj = listUI.elementAt(i);
1690
+ if (!obj.pinned)
1691
+ {
1692
+ obj.CloseUI();
1693
+ listUI.remove(i);
1694
+ }
1695
+ }
1696
+ }
1697
+
1698
+ private void EditElement(Object3D elem, boolean newWindow)
1699
+ {
1700
+ // if (!(elem instanceof Composite))
1701
+ // newWindow = false;
1702
+ listUI.add(elem);
1703
+ elem.openEditWindow(this, newWindow); //, false);
1704
+ System.out.println("edit : " + elem);
1705
+ elem.editWindow.refreshContents(true); // ? new
1706
+ }
12941707
12951708 /**
12961709 * applyExample
....@@ -1494,9 +1907,9 @@
14941907
14951908 void Overwrite(int mask)
14961909 {
1497
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1910
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14981911 {
1499
- Object3D content = GrafreeD.clipboard.get(0);
1912
+ Object3D content = Grafreed.clipboard.get(0);
15001913
15011914 if (content instanceof cGroup && ((cGroup)content).transientlink )
15021915 content = ((cGroup)content).get(0);
....@@ -1535,7 +1948,7 @@
15351948 {
15361949 ScreenFit();
15371950 } else
1538
- if (source == switchItem)
1951
+ if (source == switchViewItem)
15391952 {
15401953 cVector v1 = new cVector();
15411954 cVector v2 = new cVector();
....@@ -1544,11 +1957,11 @@
15441957 objEditor.cameraView.renderCamera.setAim(v2, v1);
15451958 objEditor.cameraView.repaint();
15461959 } else
1547
- if (source == rectoidItem)
1960
+ if (source == rectoidItem || source == boxButton)
15481961 {
15491962 makeSomething(new Box());
15501963 } else
1551
- if (source == particleItem)
1964
+ if (source == particleItem || source == particlesButton)
15521965 {
15531966 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15541967 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1627,27 +2040,27 @@
16272040
16282041 makeSomething(obj);
16292042 } else
1630
- if (source == gridItem)
2043
+ if (source == gridItem || source == gridButton)
16312044 {
16322045 makeSomething(new Grid());
16332046 } else
1634
- if (source == ellipsoidItem)
2047
+ if (source == ellipsoidItem || source == sphereButton)
16352048 {
16362049 makeSomething(new Sphere());
16372050 } else
1638
- if (source == coneItem)
2051
+ if (source == coneItem || source == coneButton)
16392052 {
16402053 makeSomething(new Cone());
16412054 } else
1642
- if (source == torusItem)
2055
+ if (source == torusItem || source == torusButton)
16432056 {
16442057 makeSomething(new Torus());
16452058 } else
1646
- if (source == superItem)
2059
+ if (source == superItem || source == superButton)
16472060 {
16482061 makeSomething(new Superellipsoid());
16492062 } else
1650
- if (source == kleinItem)
2063
+ if (source == kleinItem || source == kleinButton)
16512064 {
16522065 makeSomething(new Klein());
16532066 } else
....@@ -1667,7 +2080,7 @@
16672080 {
16682081 makeSomething(new BezierSurface());
16692082 } else
1670
- if (source == checkerItem)
2083
+ if (source == overlayItem || source == overlayButton)
16712084 {
16722085 /*
16732086 Object3D obj = new BezierSurface(5,8);
....@@ -1715,7 +2128,7 @@
17152128 s.setup();
17162129 makeSomething(s);
17172130 } else
1718
- if (source == lightItem)
2131
+ if (source == lightItem || source == lightButton)
17192132 {
17202133 makeSomething(new Light());
17212134 } else
....@@ -1765,30 +2178,30 @@
17652178
17662179 group(g);
17672180 } else
1768
- if (source == loopItem)
2181
+ if (source == loopItem || source == loopButton)
17692182 {
17702183 Composite csg = new GroupLeaf();
17712184 csg.count = 5;
17722185 group(csg);
1773
- Composite child = new cGroup();
2186
+ Composite child = new cGroup("Branch");
17742187 csg.addChild(child);
17752188 child.addChild(csg);
17762189 } else
17772190 if (source == doubleItem)
17782191 {
1779
- Composite csg = new GroupLeaf();
2192
+ Composite csg = new GroupLeaf("Fork");
17802193 csg.count = 5;
17812194 group(csg);
1782
- Composite child = new cGroup();
2195
+ Composite child = new cGroup("Branch A");
17832196 csg.addChild(child);
17842197 child.addChild(csg);
1785
- child = new cGroup();
2198
+ child = new cGroup("Branch B");
17862199 csg.addChild(child);
17872200 child.addChild(csg);
17882201 } else
17892202 if (source == tripleItem)
17902203 {
1791
- Composite csg = new GroupLeaf();
2204
+ Composite csg = new GroupLeaf("Trident");
17922205 csg.count = 4;
17932206 group(csg);
17942207 Composite child = new cGroup();
....@@ -1800,23 +2213,6 @@
18002213 child = new cGroup();
18012214 csg.addChild(child);
18022215 child.addChild(csg);
1803
- } else
1804
-
1805
- if (source == importGFDItem)
1806
- {
1807
- ImportGFD();
1808
- } else
1809
- if (source == importVRMLX3DItem)
1810
- {
1811
- ImportVRMLX3D();
1812
- } else
1813
- if (source == import3DSItem)
1814
- {
1815
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1816
- } else
1817
- if (source == importOBJItem)
1818
- {
1819
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18202216 } else
18212217 if (source == computeAOItem)
18222218 {
....@@ -1836,7 +2232,7 @@
18362232 if (source == invariantsItem)
18372233 {
18382234 System.out.println("Invariants:");
1839
- GrafreeD.grafreeD.universe.invariants();
2235
+ Grafreed.grafreeD.universe.invariants();
18402236 } else
18412237 if (source == memoryItem)
18422238 {
....@@ -1855,19 +2251,61 @@
18552251 {
18562252 DumpObject();
18572253 } else
2254
+ if (source == minButton)
2255
+ {
2256
+ Minimize();
2257
+ } else
2258
+ if (source == maxButton)
2259
+ {
2260
+ Maximize();
2261
+ } else
2262
+ if (source == fullButton)
2263
+ {
2264
+ ToggleFullScreen();
2265
+ } else
2266
+ if (source == undoButton)
2267
+ {
2268
+ // Go to previous version
2269
+ //if (!Undo())
2270
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2271
+ Undo();
2272
+ } else
2273
+ if (source == restoreButton)
2274
+ {
2275
+ // Restore current version
2276
+ Restore();
2277
+ } else
2278
+ if (source == replaceButton)
2279
+ {
2280
+ // Overwrite current version
2281
+ Replace();
2282
+ } else
2283
+ if (source == redoButton)
2284
+ {
2285
+ // Go to next version
2286
+ Redo();
2287
+ } else
2288
+ if (source == saveButton)
2289
+ {
2290
+ // Save a new version
2291
+ if (!Save(true))
2292
+ java.awt.Toolkit.getDefaultToolkit().beep();
2293
+ } else
2294
+ if (source == oneStepButton)
2295
+ {
2296
+ Globals.ONESTEP = true;
2297
+ cameraView.repaint();
2298
+ } else
18582299 if (source == screenfitButton)
18592300 {
1860
- //Reload(lastConverter, lastFilename, true);
18612301 ScreenFit();
18622302 } else
18632303 if (source == screenfitpointButton)
18642304 {
1865
- //Reload(lastConverter, lastFilename, true);
18662305 ScreenFitPoint();
18672306 } else
18682307 if (source == snapobjectButton)
18692308 {
1870
- //Reload(lastConverter, lastFilename, true);
18712309 SnapObject();
18722310 } else
18732311 // if (event.getSource() == recompileButton)
....@@ -1904,12 +2342,20 @@
19042342 {
19052343 loadClipboard(true);
19062344 } else
2345
+ if (source == undoItem)
2346
+ {
2347
+ Undo();
2348
+ } else
2349
+ if (source == redoItem)
2350
+ {
2351
+ Redo();
2352
+ } else
19072353 if (source == duplicateItem)
19082354 {
1909
- Object3D keep = GrafreeD.clipboard;
2355
+ Object3D keep = Grafreed.clipboard;
19102356 loadClipboard(false);
19112357 paste(false);
1912
- GrafreeD.clipboard = keep;
2358
+ Grafreed.clipboard = keep;
19132359 } else
19142360 if (source == cloneItem)
19152361 {
....@@ -1927,13 +2373,17 @@
19272373 {
19282374 paste(false);
19292375 } else
2376
+ if (source == pasteIntoItem)
2377
+ {
2378
+ pasteInto(true, false);
2379
+ } else
19302380 if (source == pasteLinkItem)
19312381 {
1932
- pasteInto(false);
2382
+ pasteInto(false, false);
19332383 } else
19342384 if (source == pasteCloneItem)
19352385 {
1936
- pasteInto(true);
2386
+ pasteInto(true, true);
19372387 } else
19382388 if (source == pasteExpandItem)
19392389 {
....@@ -2125,9 +2575,9 @@
21252575 // group.selection.get(0).setMasterThis(content); // should be identity
21262576 // refreshContents();
21272577 // }
2128
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2578
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21292579 {
2130
- Object3D content = GrafreeD.clipboard.get(0);
2580
+ Object3D content = Grafreed.clipboard.get(0);
21312581
21322582 if (content instanceof cGroup && ((cGroup)content).transientlink )
21332583 content = ((cGroup)content).get(0);
....@@ -2135,11 +2585,11 @@
21352585 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21362586 for (int i=0; i<group.selection.size(); i++)
21372587 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2588
+ boolean random = CameraPane.SWITCH;
2589
+ CameraPane.SWITCH = false; // parse all random nodes
21402590 group.selection.get(i).linkVerticesThis(content);
21412591 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
2592
+ CameraPane.SWITCH = random;
21432593 }
21442594 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21452595 refreshContents();
....@@ -2149,20 +2599,20 @@
21492599 {
21502600 for (int i=0; i<group.selection.size(); i++)
21512601 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2602
+ boolean random = CameraPane.SWITCH;
2603
+ CameraPane.SWITCH = false; // parse all random nodes
21542604 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
2605
+ CameraPane.SWITCH = random;
21562606 }
21572607
21582608 refreshContents();
21592609 } else
21602610 if (source == relinkverticesItem)
21612611 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
2612
+ boolean random = CameraPane.SWITCH;
2613
+ CameraPane.SWITCH = false; // parse all random nodes
21642614 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
2615
+ CameraPane.SWITCH = random;
21662616
21672617 refreshContents();
21682618 } else
....@@ -2177,9 +2627,9 @@
21772627 } else
21782628 if (source == setMasterItem)
21792629 {
2180
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2630
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21812631 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2632
+ Object3D content = Grafreed.clipboard.get(0);
21832633
21842634 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852635 content = ((cGroup)content).get(0);
....@@ -2192,9 +2642,9 @@
21922642 {
21932643 if (group.selection.size() == 1)
21942644 {
2195
- if (GrafreeD.clipboard.size() == 1)
2645
+ if (Grafreed.clipboard.size() == 1)
21962646 {
2197
- Object3D content = GrafreeD.clipboard.get(0);
2647
+ Object3D content = Grafreed.clipboard.get(0);
21982648
21992649 if (content instanceof cGroup && ((cGroup)content).transientlink )
22002650 content = ((cGroup)content).get(0);
....@@ -2211,7 +2661,7 @@
22112661 {
22122662 RevertMeshes();
22132663 } else
2214
- if (source == resetMeshItem)
2664
+ if (source == resetAllItem)
22152665 {
22162666 ResetAll();
22172667 } else
....@@ -2219,7 +2669,7 @@
22192669 {
22202670 StepAll();
22212671 } else
2222
- if (source == clearItem) // || event.getSource() == clearButton)
2672
+ if (source == deleteItem) // || event.getSource() == clearButton)
22232673 {
22242674 //int indices[] = jList.getSelectedIndices();
22252675 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2231,9 +2681,9 @@
22312681 {
22322682 ClearSelection(true);
22332683 } else
2234
- if (source == grabItem)
2684
+ if (source == grabItem || source == groupButton)
22352685 {
2236
- group(new cGroup(), true);
2686
+ group(new cGroup(), false); // true);
22372687 } else
22382688 if (source == hideItem)
22392689 {
....@@ -2251,16 +2701,16 @@
22512701 {
22522702 makeSomething(new Camera());
22532703 } else
2254
- if (source == compositeItem)
2704
+ if (source == compositeItem || source == compositeButton)
22552705 {
22562706 group(new Composite());
22572707 } else
2258
- if (source == randomItem)
2708
+ if (source == switchItem || source == switchButton)
22592709 {
22602710 RandomNode random = new RandomNode();
22612711 group(random);
22622712 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
2713
+ random.name = random.get(0).name + "Switch";
22642714 } else
22652715 if (source == physicsItem)
22662716 {
....@@ -2357,7 +2807,7 @@
23572807 {
23582808 group(new cLinker());
23592809 } else
2360
- if (source == textureItem)
2810
+ if (source == textureItem || source == textureButton)
23612811 {
23622812 group(new TextureNode());
23632813 } else
....@@ -2377,17 +2827,30 @@
23772827 {
23782828 CastShadow(2);
23792829 } else
2380
- if (source == ungroupItem)
2830
+ if (source == ungroupItem || source == ungroupButton)
23812831 {
2382
- //ungroup();
2832
+ boolean hasRoot = false;
2833
+
23832834 for (int i=0; i<group.selection.size(); i++)
23842835 {
2385
- Ungroup(group.selection.get(i));
2836
+ if (group.selection.get(i) == group)
2837
+ {
2838
+ hasRoot = true;
2839
+ break;
2840
+ }
23862841 }
23872842
2388
- ClearSelection(false);
2389
-
2390
- refreshContents();
2843
+ if (!hasRoot)
2844
+ {
2845
+ for (int i=0; i<group.selection.size(); i++)
2846
+ {
2847
+ Ungroup(group.selection.get(i));
2848
+ }
2849
+
2850
+ ClearSelection(false);
2851
+
2852
+ refreshContents();
2853
+ }
23912854 } else
23922855 if (source == genUVItem)
23932856 {
....@@ -2399,7 +2862,7 @@
23992862 } else
24002863 if (source == genNormalsMESHItem)
24012864 {
2402
- GenNormals(true); // TODO
2865
+ GenNormalsMESH();
24032866 } else
24042867 if (source == genNormalsORGANItem)
24052868 {
....@@ -2464,6 +2927,22 @@
24642927 if (source == unmarkleavesItem)
24652928 {
24662929 MarkLeaves(false);
2930
+ } else
2931
+ if (source == rewindleavesItem)
2932
+ {
2933
+ RewindLeaves(true);
2934
+ } else
2935
+ if (source == unrewindleavesItem)
2936
+ {
2937
+ RewindLeaves(false);
2938
+ } else
2939
+ if (source == randomleavesItem)
2940
+ {
2941
+ RandomLeaves(true);
2942
+ } else
2943
+ if (source == unrandomleavesItem)
2944
+ {
2945
+ RandomLeaves(false);
24672946 } else
24682947 if (source == flipVItem)
24692948 {
....@@ -2549,9 +3028,13 @@
25493028 {
25503029 SmoothMesh();
25513030 } else
2552
- if (source == transformgeometryItem)
3031
+ if (source == transformGeometryItem)
25533032 {
25543033 TransformGeometry();
3034
+ } else
3035
+ if (source == transformChildrenItem)
3036
+ {
3037
+ TransformChildren();
25553038 } else
25563039 if (source == resetTransformItem)
25573040 {
....@@ -2559,7 +3042,11 @@
25593042 } else
25603043 if (source == resetCentroidItem)
25613044 {
2562
- ResetCentroid();
3045
+ ResetCentroid(true);
3046
+ } else
3047
+ if (source == resetCentroidXZItem)
3048
+ {
3049
+ ResetCentroid(false);
25633050 } else
25643051 if (source == resetParentItem)
25653052 {
....@@ -2691,6 +3178,10 @@
26913178 if (source == twoButton)
26923179 {
26933180 radio.layout = twoButton;
3181
+
3182
+ if (CameraPane.FULLSCREEN)
3183
+ fullscreenLayout = radio.layout;
3184
+
26943185 // bug
26953186 //gridPanel.setDividerLocation(1.0);
26963187 //bigPanel.setDividerLocation(0.0);
....@@ -2723,10 +3214,31 @@
27233214 bigThree.ClearUI();
27243215 bigThree.add(centralPanel);
27253216 bigThree.FlushUI();
3217
+
3218
+ cameraView.requestFocusInWindow();
3219
+
3220
+// refreshContents(true);
3221
+//
3222
+// try
3223
+// {
3224
+// java.awt.Robot bot = new java.awt.Robot();
3225
+// int mask = InputEvent.BUTTON1_MASK;
3226
+// bot.mouseMove(100, 100);
3227
+// bot.mousePress(mask);
3228
+// bot.mouseRelease(mask);
3229
+// }
3230
+// catch (Exception e)
3231
+// {
3232
+//
3233
+// }
3234
+
27263235 } else
27273236 if (source == threeButton)
27283237 {
27293238 radio.layout = threeButton;
3239
+
3240
+ if (CameraPane.FULLSCREEN)
3241
+ fullscreenLayout = radio.layout;
27303242
27313243 // bigThree.remove(scenePanel);
27323244 // bigThree.remove(centralPanel);
....@@ -2759,10 +3271,15 @@
27593271 bigThree.add(centralPanel);
27603272 bigThree.add(XYZPanel);
27613273 bigThree.FlushUI();
3274
+
3275
+ cameraView.requestFocusInWindow();
27623276 } else
27633277 if (source == fourButton)
27643278 {
27653279 radio.layout = fourButton;
3280
+
3281
+ if (CameraPane.FULLSCREEN)
3282
+ fullscreenLayout = radio.layout;
27663283
27673284 // bigThree.remove(scenePanel);
27683285 // bigThree.remove(centralPanel);
....@@ -2794,10 +3311,15 @@
27943311 bigThree.ClearUI();
27953312 bigThree.add(scenePanel);
27963313 bigThree.FlushUI();
3314
+
3315
+ cameraView.requestFocusInWindow();
27973316 } else
27983317 if (source == sixButton)
27993318 {
28003319 radio.layout = sixButton;
3320
+
3321
+ if (CameraPane.FULLSCREEN)
3322
+ fullscreenLayout = radio.layout;
28013323
28023324 // bigThree.remove(scenePanel);
28033325 // bigThree.remove(centralPanel);
....@@ -2830,10 +3352,15 @@
28303352 bigThree.add(scenePanel);
28313353 bigThree.add(centralPanel);
28323354 bigThree.FlushUI();
3355
+
3356
+ cameraView.requestFocusInWindow();
28333357 } else
28343358 if (source == sevenButton)
28353359 {
28363360 radio.layout = sevenButton;
3361
+
3362
+ if (CameraPane.FULLSCREEN)
3363
+ fullscreenLayout = radio.layout;
28373364
28383365 // bigThree.remove(scenePanel);
28393366 // bigThree.remove(centralPanel);
....@@ -2867,6 +3394,8 @@
28673394 bigThree.add(centralPanel);
28683395 bigThree.add(XYZPanel);
28693396 bigThree.FlushUI();
3397
+
3398
+ cameraView.requestFocusInWindow();
28703399 } else
28713400 if (source == rootButton)
28723401 {
....@@ -2878,6 +3407,7 @@
28783407 EditObject(obj);
28793408 }
28803409
3410
+ cameraView.requestFocusInWindow();
28813411 refreshContents(true);
28823412 } else
28833413 if (source == closeButton)
....@@ -2887,22 +3417,37 @@
28873417 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28883418 {
28893419 ab = (cRadio)e.nextElement();
2890
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3420
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28913421 {
3422
+ // Patch to avoid bug with transparency.
3423
+ if (!ab.hadMaterial)
3424
+ {
3425
+ ab.object.material = null;
3426
+ }
3427
+
28923428 buttonGroup.remove(ab);
28933429 radioPanel.remove(ab);
28943430
2895
- ab.GetObject().editWindow = null;
3431
+ //ab.GetObject().editWindow = null;
3432
+ ab.GetObject().manipWindow = null;
28963433 // ab.GetObject().objectUI = null; // ?????????
28973434
28983435 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28993436 break;
29003437 }
29013438 }
3439
+
3440
+ cameraView.requestFocusInWindow();
29023441 refreshContents(true);
29033442 } else
29043443 if (source == editItem || source == editButton)
29053444 {
3445
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3446
+ {
3447
+ Object3D child = (Object3D)e.nextElement();
3448
+ child.pinned = true;
3449
+ }
3450
+
29063451 EditSelection(false);
29073452 } else
29083453 if (source == uneditButton)
....@@ -2912,12 +3457,13 @@
29123457 Object3D child = (Object3D)e.nextElement();
29133458 if(child.editWindow != null)
29143459 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3460
+ child.pinned = false;
29153461 child.CloseUI();
29163462 listUI.remove(child);
29173463
2918
- child.editWindow = null; // ???????????
3464
+ //child.editWindow = null; // ???????????
29193465 }
2920
- objEditor.ctrlPanel.validate();
3466
+ objEditor.ctrlPanel.FlushUI();
29213467 //objEditor.jTree.clearSelection();
29223468 //objEditor.ResetSliders();
29233469 refreshContents(true);
....@@ -2928,6 +3474,7 @@
29283474 //copy.ClearUI();
29293475 for (Object3D obj : listUI)
29303476 {
3477
+ obj.pinned = false;
29313478 obj.CloseUI();
29323479 }
29333480 listUI.clear();
....@@ -2937,7 +3484,7 @@
29373484 {
29383485 assert(copy == group);
29393486
2940
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3487
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29413488
29423489 for (Object3D obj : listUI)
29433490 {
....@@ -2986,6 +3533,9 @@
29863533 }
29873534
29883535 copy = group;
3536
+
3537
+ SetUndoStates();
3538
+
29893539 //Globals.theRenderer.object = group;
29903540 if(!useclient)
29913541 {
....@@ -3001,20 +3551,46 @@
30013551 frontView.object = group;
30023552 sideView.object = group;
30033553 }
3004
- group.editWindow = this;
3554
+
3555
+// fix "+" issue
3556
+ //group.editWindow = this;
3557
+ group.manipWindow = this;
3558
+
30053559 /*
30063560 currentLayout = radio.layout;
30073561 if (currentLayout == null)
30083562 currentLayout = sevenButton;
30093563 */
30103564 radio.layout.doClick();
3565
+
3566
+ ClearUnpinned();
3567
+ //Grafreed.Assert(group != null);
3568
+ //Grafreed.Assert(group.selection != null);
3569
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3570
+ if (group.selection == null || group.selection.size() == 1)
3571
+ EditSelection(false);
30113572 keepparent = group.parent;
30123573 // PARENT = NULL or not???
30133574 //group.parent = null; // ROOT
30143575 //group.attributes = -1;
30153576 ResetModel();
3577
+
3578
+ cameraView.requestFocusInWindow();
30163579 refreshContents(true);
3017
- }
3580
+ } else if (event.getSource() == editCameraItem)
3581
+ {
3582
+ cameraView.ProtectCamera();
3583
+ cameraView.repaint();
3584
+ return;
3585
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3586
+ {
3587
+ cameraView.RevertCamera();
3588
+ cameraView.repaint();
3589
+ return;
3590
+ // } else if (event.getSource() == textureButton)
3591
+ // {
3592
+ // return; // true;
3593
+ }
30183594 else
30193595 {
30203596 //return super.action(event, arg);
....@@ -3023,7 +3599,6 @@
30233599 }
30243600
30253601 boolean useclient = false;
3026
- cRadio radio;
30273602
30283603 void ToggleRoot()
30293604 {
....@@ -3075,6 +3650,28 @@
30753650 refreshContents();
30763651 }
30773652
3653
+ void TransformChildren()
3654
+ {
3655
+ Object3D obj;
3656
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3657
+ {
3658
+ obj = (Object3D)e.nextElement();
3659
+ obj.KeepTextureMatrices();
3660
+ obj.TransformChildren();
3661
+ obj.RestoreTextureMatrices();
3662
+
3663
+// if (obj.parent == null)
3664
+// {
3665
+// System.out.println("NULL PARENT!");
3666
+// new Exception().printStackTrace();
3667
+// }
3668
+// else
3669
+// TouchTransform(obj);
3670
+// //obj.parent.Touch();
3671
+ }
3672
+
3673
+ refreshContents();
3674
+ }
30783675
30793676 void ResetTransform()
30803677 {
....@@ -3187,7 +3784,7 @@
31873784 refreshContents();
31883785 }
31893786
3190
- void ResetCentroid()
3787
+ void ResetCentroid(boolean full)
31913788 {
31923789 Object3D obj;
31933790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3202,12 +3799,16 @@
32023799 LA.matIdentity(Object3D.mat);
32033800 obj.getBounds(minima, maxima, false);
32043801 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3205
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3802
+ if (full)
3803
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32063804 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32073805 obj.TransformMesh(Object3D.mat);
3806
+
32083807 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3209
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3808
+ if (full)
3809
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32103810 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3811
+
32113812 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32123813 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32133814 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3236,7 +3837,8 @@
32363837
32373838 int size = obj.MemorySize();
32383839
3239
- System.err.println((size/1024) + " KB is the size of " + obj);
3840
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3841
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32403842 }
32413843 }
32423844 catch (Exception e)
....@@ -3273,9 +3875,9 @@
32733875 obj = (Object3D)e.nextElement();
32743876
32753877 System.out.println("Object is: " + obj);
3276
- GrafreeD.AnalyzeObject(obj);
3878
+ Grafreed.AnalyzeObject(obj);
32773879 System.out.println("Boundary rep: " + obj.bRep);
3278
- GrafreeD.AnalyzeObject(obj.bRep);
3880
+ Grafreed.AnalyzeObject(obj.bRep);
32793881
32803882 // System.err.println((size/1024) + " KB is the size of " + obj);
32813883 }
....@@ -3317,6 +3919,13 @@
33173919 void GenNormals(boolean crease)
33183920 {
33193921 group.GenNormalsS(crease);
3922
+
3923
+ refreshContents();
3924
+ }
3925
+
3926
+ void GenNormalsMESH()
3927
+ {
3928
+ group.GenNormalsMeshS();
33203929
33213930 refreshContents();
33223931 }
....@@ -3489,8 +4098,8 @@
34894098
34904099 void ParseVertices()
34914100 {
3492
- boolean epsequal = GrafreeD.epsequal;
3493
- GrafreeD.epsequal = true;
4101
+ boolean epsequal = Grafreed.epsequal;
4102
+ Grafreed.epsequal = true;
34944103
34954104 for (int i=0; i<group.selection.size(); i++)
34964105 {
....@@ -3515,7 +4124,7 @@
35154124 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35164125 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35174126
3518
- g.add(GrafreeD.clipboard);
4127
+ g.add(Grafreed.clipboard);
35194128
35204129 buffer.add(g);
35214130 }
....@@ -3530,7 +4139,7 @@
35304139 makeSomething(buffer, i==group.selection.size()-1);
35314140 }
35324141
3533
- GrafreeD.epsequal = epsequal;
4142
+ Grafreed.epsequal = epsequal;
35344143
35354144 refreshContents();
35364145 }
....@@ -3548,7 +4157,16 @@
35484157 String pigment = Object3D.GetPigment(tex);
35494158 //String bump = Object3D.GetBump(tex);
35504159
3551
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4160
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4161
+
4162
+ try
4163
+ {
4164
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4165
+ }
4166
+ catch (Exception e)
4167
+ {
4168
+ System.err.println("FAIL: " + node);
4169
+ }
35524170
35534171 double s = v.s;
35544172
....@@ -3636,11 +4254,11 @@
36364254
36374255 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36384256
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
4257
+ boolean random = CameraPane.SWITCH;
4258
+ CameraPane.SWITCH = false; // parse all random nodes
36414259 lowres.linkVerticesThis(null);
36424260 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
4261
+ CameraPane.SWITCH = random;
36444262
36454263 System.err.flush();
36464264
....@@ -3680,7 +4298,7 @@
36804298 return;
36814299
36824300 Object3D poses = group.selection.get(0);
3683
- Object3D ref = GrafreeD.clipboard.get(0);
4301
+ Object3D ref = Grafreed.clipboard.get(0);
36844302
36854303 Object3D newgroup = new Object3D("Po:" + poses.name);
36864304
....@@ -3874,9 +4492,9 @@
38744492
38754493 void ClipMesh()
38764494 {
3877
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4495
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38784496 {
3879
- Object3D content = GrafreeD.clipboard.get(0);
4497
+ Object3D content = Grafreed.clipboard.get(0);
38804498
38814499 if (content instanceof cGroup && ((cGroup)content).transientlink )
38824500 content = ((cGroup)content).get(0);
....@@ -3885,7 +4503,7 @@
38854503 // {
38864504 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38874505 // }
3888
- group.selection.ClipMesh(GrafreeD.clipboard);
4506
+ group.selection.ClipMesh(Grafreed.clipboard);
38894507 }
38904508 // group.selection.ClipMesh(GrafreeD.clipboard);
38914509 System.out.println("DONE.");
....@@ -3932,6 +4550,18 @@
39324550 void MarkLeaves(boolean hide)
39334551 {
39344552 group.selection.MarkLeaves(hide);
4553
+ refreshContents();
4554
+ }
4555
+
4556
+ void RewindLeaves(boolean hide)
4557
+ {
4558
+ group.selection.RewindLeaves(hide);
4559
+ refreshContents();
4560
+ }
4561
+
4562
+ void RandomLeaves(boolean hide)
4563
+ {
4564
+ group.selection.RandomLeaves(hide);
39354565 refreshContents();
39364566 }
39374567
....@@ -4006,28 +4636,25 @@
40064636 // }
40074637 // }
40084638
4009
- static boolean allparams = true;
4010
-
4011
- static Vector<Object3D> listUI = new Vector<Object3D>();
4012
-
40134639 void EditSelection(boolean newWindow)
40144640 {
4641
+ if (group.selection == null)
4642
+ {
4643
+ EditElement(group, newWindow); // ? new
4644
+ return;
4645
+ }
4646
+
40154647 // aConstraints.gridy = 0;
40164648 for (int i=0; i<group.selection.size(); i++)
40174649 {
40184650 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40194651 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4020
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4652
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40214653
40224654 Object3D elem = (Object3D)group.selection.elementAt(i);
4023
- if(elem != group)
4655
+ if(elem != group || !newWindow)
40244656 {
4025
- // if (!(elem instanceof Composite))
4026
- // newWindow = false;
4027
- listUI.add(elem);
4028
- elem.openEditWindow(this, newWindow); //, false);
4029
- System.out.println("edit : " + elem);
4030
- elem.editWindow.refreshContents(true); // ? new
4657
+ EditElement(elem, newWindow); // ? new
40314658 }
40324659 }
40334660 }
....@@ -4102,7 +4729,8 @@
41024729 //new Exception().printStackTrace();
41034730
41044731 freezemodel = true;
4105
-
4732
+ ClearUnpinned();
4733
+
41064734 /**/
41074735 //switch (event.id)
41084736 {
....@@ -4110,7 +4738,6 @@
41104738 //case 702: // Event.LIST_DESELECT
41114739 group.deselectAll();
41124740 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4113
- objEditor.ClearInfo(); // .GetMaterial());
41144741 if (tps != null)
41154742 {
41164743 for (int i=0; i < tps.length; i++)
....@@ -4119,33 +4746,39 @@
41194746
41204747 //if (child.parent != null)
41214748 //child.parent.addSelectee(child);
4749
+ objEditor.SetMaterial(child);
41224750 group.addSelectee(child);
4123
- objEditor.SetMaterial(child); // .GetMaterial());
4124
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4125
- System.err.println("info : " + child.GetPath());
41264751 }
41274752 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
4753
+// else
4754
+// {
4755
+// objEditor.SetMaterial(group); // .GetMaterial());
4756
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4757
+// System.err.println("info : " + group.GetPath());
4758
+// }
41344759
4135
- objEditor.SetText(); // jan 2014
4136
-
4137
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4760
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41384761 CameraPane.flash = true;
41394762
4140
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4763
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41414764 // a camera
41424765 {
4143
- CameraPane.camerachangeframe = 0; // don't refuse it
4144
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4766
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4767
+ {
4768
+ CameraPane.camerachangeframe = 0; // don't refuse it
4769
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4770
+ }
41454771 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41464772 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41474773 }
41484774
4775
+ if (tps != null && tps.length == 1)
4776
+ {
4777
+ EditSelection(false);
4778
+ }
4779
+
4780
+ SetPinStates(tps != null && tps.length > 0);
4781
+
41494782 refreshContents();
41504783 //return true;
41514784 }
....@@ -4154,6 +4787,35 @@
41544787
41554788 freezemodel = false;
41564789 }
4790
+
4791
+ void SetPinStates(boolean enabled)
4792
+ {
4793
+ editButton.setEnabled(enabled);
4794
+ uneditButton.setEnabled(enabled);
4795
+ unselectButton.setEnabled(enabled);
4796
+ flashSelectionButton.setEnabled(enabled);
4797
+ }
4798
+
4799
+ void refreshContents(boolean cp)
4800
+ {
4801
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4802
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4803
+ {
4804
+ objEditor.ClearInfo(); // .GetMaterial());
4805
+
4806
+ for (int i=0; i < group.selection.Size(); i++)
4807
+ {
4808
+ Object3D child = (Object3D) group.selection.get(i);
4809
+
4810
+ objEditor.AddInfo(child, this, true);
4811
+ System.err.println("info : " + child.GetPath());
4812
+ }
4813
+
4814
+ objEditor.SetText(); // jan 2014
4815
+ }
4816
+
4817
+ super.refreshContents(cp);
4818
+ }
41574819
41584820 void linkSomething(Object3D thing)
41594821 {
....@@ -4225,16 +4887,19 @@
42254887 {
42264888 if (group.selection.isEmpty())
42274889 return;
4228
- GrafreeD.clipboardIsTempGroup = false;
4890
+
4891
+ Grafreed.clipboardIsTempGroup = false;
42294892 Composite tGroup = null;
42304893 if (group.selection.size() > 0) // 1)
42314894 {
42324895 tGroup = new cGroup();
4233
- GrafreeD.clipboardIsTempGroup = true;
4896
+ Grafreed.clipboardIsTempGroup = true;
42344897 }
42354898
42364899 if (cut)
42374900 {
4901
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4902
+// Save();
42384903 //int indices[] = jList.getSelectedIndices();
42394904 //for (int i = indices.length - 1; i >= 0; i--)
42404905 //jList.remove(indices[i]);
....@@ -4270,16 +4935,16 @@
42704935 //System.out.println("cut " + child);
42714936 //System.out.println("parent = " + child.parent);
42724937 // tmp.addChild(child);
4273
- if (GrafreeD.clipboardIsTempGroup)
4938
+ if (Grafreed.clipboardIsTempGroup)
42744939 tGroup.add/*Child*/(tmp);
42754940 else
4276
- GrafreeD.clipboard = tmp;
4941
+ Grafreed.clipboard = tmp;
42774942 }
42784943 else
4279
- if (GrafreeD.clipboardIsTempGroup)
4944
+ if (Grafreed.clipboardIsTempGroup)
42804945 tGroup.add/*Child*/(child);
42814946 else
4282
- GrafreeD.clipboard = child;
4947
+ Grafreed.clipboard = child;
42834948 }
42844949
42854950 //ResetModel();
....@@ -4311,21 +4976,23 @@
43114976 //System.out.println("cut " + elem);
43124977 //System.out.println("parent = " + elem.parent);
43134978 // tmp.addChild(elem);
4314
- if (GrafreeD.clipboardIsTempGroup)
4979
+ if (Grafreed.clipboardIsTempGroup)
43154980 tGroup.add/*Child*/(tmp);
43164981 else
4317
- GrafreeD.clipboard = tmp;
4982
+ Grafreed.clipboard = tmp;
43184983 }
43194984 else
4320
- if (GrafreeD.clipboardIsTempGroup)
4985
+ if (Grafreed.clipboardIsTempGroup)
43214986 tGroup.add/*Child*/(child);
43224987 else
4323
- GrafreeD.clipboard = child;
4988
+ Grafreed.clipboard = child;
43244989 }
43254990
43264991 }
4327
- if (GrafreeD.clipboardIsTempGroup)
4328
- GrafreeD.clipboard = tGroup;
4992
+
4993
+ if (Grafreed.clipboardIsTempGroup)
4994
+ Grafreed.clipboard = tGroup;
4995
+
43294996 if (cut)
43304997 {
43314998 ResetModel();
....@@ -4335,11 +5002,15 @@
43355002
43365003 void paste(boolean expand)
43375004 {
5005
+ if (Globals.REPLACEONMAKE)
5006
+ Save();
5007
+ boolean keep = Globals.REPLACEONMAKE;
5008
+ Globals.REPLACEONMAKE = false;
43385009 // if (GrafreeD.clipboard == null)
43395010 // return;
43405011 boolean first = true;
43415012
4342
- if (GrafreeD.clipboardIsTempGroup)
5013
+ if (Grafreed.clipboardIsTempGroup)
43435014 {
43445015 Composite temp;
43455016
....@@ -4350,7 +5021,7 @@
43505021 temp = (Composite)Applet3D.clipboard.deepCopy();
43515022 */
43525023 Object3D elem;
4353
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5024
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43545025 {
43555026 Object3D child = (Object3D)e.nextElement();
43565027
....@@ -4384,21 +5055,22 @@
43845055 //Object3D cb = Applet3D.clipboard;
43855056 //temp.addChild(cb);
43865057 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4387
- assert(GrafreeD.clipboard.parent == null);
4388
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4389
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4390
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4391
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5058
+ assert(Grafreed.clipboard.parent == null);
5059
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5060
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5061
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5062
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43925063 else
4393
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4394
- GrafreeD.clipboard.get(0).parent = keepparent;
5064
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5065
+ Grafreed.clipboard.get(0).parent = keepparent;
43955066 }
43965067
5068
+ Globals.REPLACEONMAKE = keep;
43975069 ResetModel();
43985070 refreshContents();
43995071 }
44005072
4401
- void pasteInto(boolean copyit)
5073
+ void pasteInto(boolean copyit, boolean clone)
44025074 {
44035075 // if (GrafreeD.clipboard == null)
44045076 // return;
....@@ -4427,15 +5099,22 @@
44275099 if (copyit)
44285100 {
44295101 // paste(false);
4430
- CloneClipboard(false); // sept 2014
5102
+ if (clone)
5103
+ {
5104
+ CloneClipboard(false); // sept 2014
5105
+ }
5106
+ else
5107
+ {
5108
+ paste(false);
5109
+ }
44315110 }
44325111 else
44335112 {
44345113 boolean first = true;
44355114
4436
- if (GrafreeD.clipboardIsTempGroup)
5115
+ if (Grafreed.clipboardIsTempGroup)
44375116 {
4438
- Composite temp = (Composite)GrafreeD.clipboard;
5117
+ Composite temp = (Composite)Grafreed.clipboard;
44395118 Object3D copy;
44405119 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44415120 {
....@@ -4445,7 +5124,7 @@
44455124 }
44465125 } else
44475126 {
4448
- linkSomething(GrafreeD.clipboard); //.get(0));
5127
+ linkSomething(Grafreed.clipboard); //.get(0));
44495128 }
44505129 }
44515130 }
....@@ -4522,6 +5201,10 @@
45225201
45235202 void group(Object3D csg, boolean grab)
45245203 {
5204
+ if (Globals.REPLACEONMAKE)
5205
+ Save();
5206
+ boolean keep = Globals.REPLACEONMAKE;
5207
+ Globals.REPLACEONMAKE = false;
45255208 if (//false) // why??
45265209 !group.selection.isEmpty())
45275210 {
....@@ -4635,10 +5318,15 @@
46355318 //node.add(csg);
46365319 //makeSomething(node);
46375320 makeSomething(csg);
5321
+ Globals.REPLACEONMAKE = keep;
46385322 }
46395323
46405324 void Ungroup(Object3D g)
46415325 {
5326
+ if (Globals.REPLACEONMAKE)
5327
+ Save();
5328
+ boolean keep = Globals.REPLACEONMAKE;
5329
+ Globals.REPLACEONMAKE = false;
46425330 if (g instanceof HiddenObject)
46435331 {
46445332 HiddenObject h = (HiddenObject) g;
....@@ -4655,6 +5343,7 @@
46555343 objEditor.makeSomething(g.get(i), false);
46565344 }
46575345 }
5346
+ Globals.REPLACEONMAKE = keep;
46585347 }
46595348
46605349 void ungroup()
....@@ -4850,21 +5539,6 @@
48505539 }
48515540 */
48525541
4853
- void ImportGFD()
4854
- {
4855
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4856
- browser.show();
4857
- String filename = browser.getFile();
4858
- if (filename != null && filename.length() > 0)
4859
- {
4860
- String fullname = browser.getDirectory() + filename;
4861
-
4862
- //Object3D readobj =
4863
- objEditor.ReadGFD(fullname, objEditor);
4864
- //makeSomething(readobj);
4865
- }
4866
- }
4867
-
48685542 /*
48695543 public void Callback(Object obj)
48705544 {
....@@ -4888,26 +5562,9 @@
48885562 }
48895563 */
48905564
4891
- void ImportVRMLX3D()
4892
- {
4893
- if (GrafreeD.standAlone)
4894
- {
4895
- /**/
4896
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4897
- browser.show();
4898
- String filename = browser.getFile();
4899
- if (filename != null && filename.length() > 0)
4900
- {
4901
- String fullname = browser.getDirectory() + filename;
4902
- LoadVRMLX3D(fullname);
4903
- }
4904
- /**/
4905
- }
4906
- }
4907
-
49085565 String GetFile(String dialogName)
49095566 {
4910
- if (GrafreeD.standAlone)
5567
+ if (Grafreed.standAlone)
49115568 {
49125569 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49135570 browser.show();
....@@ -4971,10 +5628,33 @@
49715628 cButton flashSelectionButton;
49725629 cButton editButton;
49735630 cButton uneditButton;
5631
+ JCheckBox allParamsButton;
49745632 cButton clearpanelButton;
4975
- cButton allParamsButton;
49765633 cButton unselectButton;
49775634
5635
+ cButton restoreCameraButton;
5636
+
5637
+ cButton saveButton;
5638
+ cButton oneStepButton;
5639
+
5640
+ cButton groupButton;
5641
+ cButton ungroupButton;
5642
+ cButton compositeButton;
5643
+ cButton switchButton;
5644
+ cButton loopButton;
5645
+ cButton textureButton;
5646
+
5647
+ cButton gridButton;
5648
+ cButton boxButton;
5649
+ cButton sphereButton;
5650
+ cButton coneButton;
5651
+ cButton torusButton;
5652
+ cButton superButton;
5653
+ cButton kleinButton;
5654
+ cButton particlesButton;
5655
+ cButton overlayButton;
5656
+ cButton lightButton;
5657
+
49785658 cButton screenfitButton;
49795659 cButton screenfitpointButton;
49805660 cButton snapobjectButton;
....@@ -4986,14 +5666,6 @@
49865666
49875667 cButton setsupportButton;
49885668
4989
- cButton twoButton;
4990
- cButton sixButton;
4991
- cButton threeButton;
4992
- cButton sevenButton;
4993
- cButton fourButton; // full panel
4994
- cButton oneButton; // full XYZ
4995
- //cButton currentLayout;
4996
-
49975669 //
49985670 //Composite
49995671 Object3D // to do !!
....@@ -5003,9 +5675,11 @@
50035675 //JTree jTree;
50045676 private MenuItem lookAtItem;
50055677 private MenuItem lookFromItem;
5006
- private MenuItem switchItem;
5678
+ private MenuItem switchViewItem;
50075679 private MenuItem cutItem;
5008
- private MenuItem duplicateItem;
5680
+ private MenuItem undoItem;
5681
+ private MenuItem redoItem;
5682
+ private JMenuItem duplicateItem;
50095683 private MenuItem cloneItem;
50105684 private MenuItem cloneSupportItem;
50115685 private MenuItem overwriteGeoItem;
....@@ -5018,7 +5692,7 @@
50185692 private MenuItem linkverticesItem;
50195693 private MenuItem relinkverticesItem;
50205694 private MenuItem setMasterItem;
5021
- private MenuItem resetMeshItem;
5695
+ private MenuItem resetAllItem;
50225696 private MenuItem stepAllItem;
50235697 private MenuItem revertMeshItem;
50245698 private MenuItem poseMeshItem;
....@@ -5029,10 +5703,11 @@
50295703 private MenuItem mergeGeometriesItem;
50305704 private MenuItem copyItem;
50315705 private MenuItem pasteItem;
5706
+ private MenuItem pasteIntoItem;
50325707 private MenuItem pasteLinkItem;
50335708 private MenuItem pasteCloneItem;
50345709 private MenuItem pasteExpandItem;
5035
- private MenuItem clearItem;
5710
+ private MenuItem deleteItem;
50365711 private MenuItem clearAllItem;
50375712 private MenuItem genUVItem;
50385713 private MenuItem genNormalsMESHItem;
....@@ -5067,6 +5742,10 @@
50675742 private MenuItem showleavesItem;
50685743 private MenuItem markleavesItem;
50695744 private MenuItem unmarkleavesItem;
5745
+ private MenuItem rewindleavesItem;
5746
+ private MenuItem unrewindleavesItem;
5747
+ private MenuItem randomleavesItem;
5748
+ private MenuItem unrandomleavesItem;
50705749
50715750 private MenuItem flipVItem;
50725751 private MenuItem unflipVItem;
....@@ -5078,15 +5757,17 @@
50785757 private MenuItem panoTexturesItem;
50795758
50805759 private MenuItem resetCentroidItem;
5081
- private MenuItem transformgeometryItem;
5760
+ private MenuItem resetCentroidXZItem;
50825761 private MenuItem resetTransformItem;
5762
+ private MenuItem transformGeometryItem;
5763
+ private MenuItem transformChildrenItem;
50835764 private MenuItem hideItem;
50845765 private MenuItem grabItem;
50855766 private MenuItem backItem;
50865767 private MenuItem frontItem;
50875768 private MenuItem cameraItem;
50885769 private MenuItem compositeItem;
5089
- private MenuItem randomItem;
5770
+ private MenuItem switchItem;
50905771 private MenuItem physicsItem;
50915772 private MenuItem frameselectorItem;
50925773 private MenuItem scriptNodeItem;
....@@ -5126,7 +5807,7 @@
51265807 private MenuItem blobItem;
51275808 private MenuItem latheItem;
51285809 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
5810
+ private MenuItem overlayItem;
51305811 private MenuItem meshItem;
51315812 // private MenuItem meshGroupItem;
51325813 private MenuItem springItem;
....@@ -5148,11 +5829,6 @@
51485829 private MenuItem doubleItem;
51495830 private MenuItem tripleItem;
51505831
5151
- private MenuItem importGFDItem;
5152
- private MenuItem importVRMLX3DItem;
5153
- private MenuItem import3DSItem;
5154
- private MenuItem importOBJItem;
5155
-
51565832 private MenuItem computeAOItem;
51575833 private MenuItem recompileItem;
51585834 private MenuItem editScriptItem;
....@@ -5162,4 +5838,8 @@
51625838 private MenuItem analyzeItem;
51635839 private MenuItem dumpItem;
51645840 //boolean freezemodel = false;
5841
+
5842
+ Menu cameraMenu;
5843
+ MenuItem editCameraItem;
5844
+ MenuItem restoreCameraItem;
51655845 }