Normand Briere
2019-07-21 40f408aaee14abd85d391008b4d22977dc586b50
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -59,6 +60,12 @@
5960 this.copy = this.group = group;
6061 //selectees = this.group.selectees;
6162
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6269 if(ui)
6370 SetupUI(objEditor);
6471 }
....@@ -73,16 +80,28 @@
7380 this.copy = this.group = copy;
7481 //selectees = this.group.selectees;
7582
76
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7784 SetupUI2(objEditor);
7885 objEditor.SetupUI(true);
7986 SetupViews(objEditor);
8087
8188 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
8297 }
8398
8499 void CloneSelection(boolean supports)
85100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
86105 // Object3D keep = GrafreeD.clipboard;
87106 //Object3D obj;
88107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +112,19 @@
93112
94113 makeSomething(clone, i==group.selection.size()-1);
95114 }
115
+ Globals.REPLACEONMAKE = keep;
96116 }
97117
98118 void CloneClipboard(boolean supports)
99119 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
120
+ assert(Grafreed.clipboard.parent == null);
121
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
122
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
123
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
124
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105125 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
126
+ makeSomething(CloneObject(Grafreed.clipboard, false));
127
+ Grafreed.clipboard.get(0).parent = keepparent;
108128 }
109129
110130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +138,7 @@
118138 // obj.support = null;
119139 if (!supports)
120140 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122142 obj.parent = parent;
123143 // obj.support = support;
124144 // clone.support = support; // aout 2013
....@@ -147,30 +167,29 @@
147167
148168 //JTextField nameField;
149169
150
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
151171 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
172
+ oe.jTree = new cTree();
173
+
163174 Menu menu;
164175 oe.menuBar.add(menu = new Menu("Edit"));
165176 //editItem = menu.add(new MenuItem("Edit"));
166177 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
178
+
179
+// undoItem = menu.add(new MenuItem("Undo"));
180
+// undoItem.addActionListener(this);
181
+// redoItem = menu.add(new MenuItem("Redo"));
182
+// redoItem.addActionListener(this);
183
+// menu.add("-");
184
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168185 duplicateItem.addActionListener(this);
169
- menu.add("-");
170186 cloneItem = menu.add(new MenuItem("Clone"));
171187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
172190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173191 cloneSupportItem.addActionListener(this);
192
+ }
174193 menu.add("-");
175194 cutItem = menu.add(new MenuItem("Cut"));
176195 cutItem.addActionListener(this);
....@@ -178,27 +197,123 @@
178197 copyItem.addActionListener(this);
179198 pasteItem = menu.add(new MenuItem("Paste"));
180199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
181204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182205 pasteLinkItem.addActionListener(this);
183206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184207 pasteCloneItem.addActionListener(this);
185208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186209 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
210
+ menu.add("-");
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
213
+
214
+ if (Globals.ADVANCED)
215
+ {
216
+ // Deletes the cameras...
189217 clearAllItem = menu.add(new MenuItem("Clear All"));
190218 clearAllItem.addActionListener(this);
219
+ }
220
+
221
+ menuBar.add(cameraMenu = new Menu("View"));
222
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
223
+ //zBufferItem.addActionListener(this);
224
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
225
+ //normalLensItem.addActionListener(this);
226
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
227
+ restoreCameraItem.addActionListener(this);
228
+
229
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
230
+// toggleFullScreenItem.addItemListener(this);
231
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
232
+// cameraMenu.add("-");
233
+//
234
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
235
+// toggleTextureItem.addItemListener(this);
236
+// toggleTextureItem.setState(CameraPane.textureon);
237
+//
238
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
239
+// toggleSwitchItem.addItemListener(this);
240
+// toggleSwitchItem.setState(CameraPane.SWITCH);
241
+
242
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
243
+ toggleHandleItem.addItemListener(this);
244
+ toggleHandleItem.setState(CameraPane.HANDLES);
245
+
246
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
247
+ togglePaintItem.addItemListener(this);
248
+ togglePaintItem.setState(CameraPane.PAINTMODE);
249
+
250
+ if (Globals.ADVANCED)
251
+ {
252
+ cameraMenu.add("-");
253
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
254
+ toggleLiveItem.addItemListener(this);
255
+ toggleLiveItem.setState(Globals.isLIVE());
191256
257
+ cameraMenu.add(stepItem = new MenuItem("Step"));
258
+ stepItem.addActionListener(this);
259
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
260
+ // toggleDLItem.addItemListener(this);
261
+ // toggleDLItem.setState(false);
262
+
263
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
264
+ toggleRenderItem.addItemListener(this);
265
+ toggleRenderItem.setState(!CameraPane.frozen);
266
+
267
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
268
+ toggleDebugItem.addItemListener(this);
269
+ toggleDebugItem.setState(Globals.DEBUG);
270
+
271
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
272
+ toggleFrustumItem.addItemListener(this);
273
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
274
+
275
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
276
+ toggleFootContactItem.addItemListener(this);
277
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
278
+
279
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
280
+ toggleTimelineItem.addItemListener(this);
281
+ }
282
+
283
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
284
+// toggleRootItem.addItemListener(this);
285
+// toggleRootItem.setState(false);
286
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
287
+// animationItem.addItemListener(this);
288
+// animationItem.setState(CameraPane.ANIMATION);
289
+ cameraMenu.add("-");
290
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
291
+ editCameraItem.addActionListener(this);
292
+
293
+ if (Globals.ADVANCED)
294
+ {
295
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
296
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
297
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
298
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
299
+ oe.cameraMenu.add("-");
300
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
301
+ openWindowItem.addActionListener(this);
302
+ editLeafItem.addActionListener(this);
303
+ lookAtItem.addActionListener(this);
304
+ //lookFromItem.addActinoListener(this);
305
+ //switchViewItem.addActionListener(this);
306
+ }
307
+
192308 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
309
+ if (Globals.ADVANCED)
310
+ {
197311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198312 revertMeshItem.addActionListener(this);
199313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200314 resetreferencesItem.addActionListener(this);
201315 menu.add("-");
316
+ }
202317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203318 overwriteGeoItem.addActionListener(this);
204319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +325,104 @@
210325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211326 overwriteUVItem.addActionListener(this);
212327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
213330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214331 generateMeshItem.addActionListener(this);
215332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216333 poseMeshItem.addActionListener(this);
217334 menu.add("-");
335
+ }
218336 resetsupportItem = menu.add(new MenuItem("Reset support"));
219337 resetsupportItem.addActionListener(this);
220338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221339 linkverticesItem.addActionListener(this);
340
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
341
+ relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
222345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223346 setMasterItem.addActionListener(this);
347
+ }
224348
225349 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
228352 backItem = menu.add(new MenuItem("Back"));
229353 backItem.addActionListener(this);
230354 frontItem = menu.add(new MenuItem("Front"));
231355 frontItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
361
+ hideItem = menu.add(new MenuItem("Hidden Group"));
362
+ hideItem.addActionListener(this);
363
+ }
364
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
365
+ ungroupItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
241373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242374 switchGeoItem.addActionListener(this);
243375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244376 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
246378 morphItem.addActionListener(this);
379
+
380
+ menu.add("-");
381
+ physicsItem = menu.add(new MenuItem("Physics"));
382
+ physicsItem.addActionListener(this);
383
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
384
+ frameselectorItem.addActionListener(this);
247385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248386 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
387
+ }
251388
252389 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
392
+ billboardItem = menu.add(new MenuItem("Billboard"));
393
+ billboardItem.addActionListener(this);
255394 csgItem = menu.add(new MenuItem("CSG"));
256395 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258397 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260399 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
263408 linkerItem = menu.add(new MenuItem("Linker"));
264409 linkerItem.addActionListener(this);
265410 templateItem = menu.add(new MenuItem("Template"));
266411 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269412 pointflowItem = menu.add(new MenuItem("Point Flow"));
270413 pointflowItem.addActionListener(this);
414
+ }
271415 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275417 resetTransformItem.addActionListener(this);
276418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277419 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
420
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
421
+ resetCentroidXZItem.addActionListener(this);
422
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
423
+ transformGeometryItem.addActionListener(this);
424
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
425
+ transformChildrenItem.addActionListener(this);
280426
281427 oe.menuBar.add(menu = new Menu("Geometry"));
282428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +433,11 @@
287433 genNormalsCADItem.addActionListener(this);
288434 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289435 genNormalsMESHItem.addActionListener(this);
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
439
+ genNormalsMINEItem.addActionListener(this);
440
+ }
290441 stripifyItem = menu.add(new MenuItem("Stripify"));
291442 stripifyItem.addActionListener(this);
292443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +459,34 @@
308459 reduce34MeshItem.addActionListener(this);
309460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310461 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
315470
316471 oe.menuBar.add(menu = new Menu("Attributes"));
317472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318473 clearMaterialsItem.addActionListener(this);
474
+ resetAllItem = menu.add(new MenuItem("Reset All"));
475
+ resetAllItem.addActionListener(this);
476
+ stepAllItem = menu.add(new MenuItem("Step All"));
477
+ stepAllItem.addActionListener(this);
319478 menu.add("-");
320479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321480 liveleavesItem.addActionListener(this);
322481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
324485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325486 supportleavesItem.addActionListener(this);
326487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327488 unsupportleavesItem.addActionListener(this);
489
+ }
328490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329491 hideleavesItem.addActionListener(this);
330492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +495,14 @@
333495 markleavesItem.addActionListener(this);
334496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335497 unmarkleavesItem.addActionListener(this);
498
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
499
+ rewindleavesItem.addActionListener(this);
500
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
501
+ unrewindleavesItem.addActionListener(this);
502
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
503
+ randomleavesItem.addActionListener(this);
504
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
505
+ unrandomleavesItem.addActionListener(this);
336506 menu.add("-");
337507 flipVItem = menu.add(new MenuItem("Flip V"));
338508 flipVItem.addActionListener(this);
....@@ -368,35 +538,41 @@
368538 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369539 sortbynameItem.addActionListener(this);
370540 menu.add("-");
541
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
542
+ shareGeometriesItem.addActionListener(this);
543
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
544
+ mergeGeometriesItem.addActionListener(this);
545
+ if (Globals.ADVANCED)
546
+ {
547
+ // Pretty much the same as duplicate and clone.
371548 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372549 extractGeometriesItem.addActionListener(this);
373550 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374551 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
552
+ }
379553
380554 oe.menuBar.add(menu = new Menu("Insert"));
381555 buildCreateMenu(menu);
382556
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394557 oe.menuBar.add(menu = new Menu("Tools"));
395558 buildToolsMenu(menu);
396559 }
397560
561
+
398562 void SetupUI2(ObjEditor oe)
399563 {
564
+ // June 2019
565
+ if (oe == null)
566
+ {
567
+ //super.SetupUI2(this);
568
+ //return;
569
+ }
570
+
571
+ if (copy != group)
572
+ {
573
+ //super.SetupUI2(this);
574
+ }
575
+
400576 //new Exception().printStackTrace();
401577
402578 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -425,150 +601,231 @@
425601 oe.radioPanel.add(dummyButton);
426602 oe.buttonGroup.add(dummyButton);
427603 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
604
+ cGridBag copyOptionsPanel = new cGridBag();
605
+
606
+ copyOptionsPanel.preferredHeight = 1;
431607
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
608
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
609
+
610
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ //minButton.setToolTipText("Minimize window");
612
+ //minButton.addActionListener(this);
613
+
614
+ if (Globals.ADVANCED)
615
+ {
616
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ maxButton.setToolTipText("Maximize window");
618
+ maxButton.addActionListener(this);
619
+ }
620
+
621
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ fullButton.setToolTipText("Full-screen window");
623
+ fullButton.addActionListener(this);
624
+
625
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ screenfitButton.setToolTipText("Screen fit");
627
+ screenfitButton.addActionListener(this);
628
+
629
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ restoreCameraButton.setToolTipText("Restore viewpoint");
631
+ restoreCameraButton.addActionListener(this);
632
+
633
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ saveButton.setToolTipText("New version");
635
+ saveButton.addActionListener(this);
636
+
637
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ undoButton.setToolTipText("Previous version");
639
+ undoButton.addActionListener(this);
640
+ undoButton.setEnabled(false);
641
+
642
+ cGridBag updown = new cGridBag().setVertical(true);
643
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ restoreButton.setToolTipText("Restore current");
645
+ restoreButton.addActionListener(this);
646
+ restoreButton.setEnabled(false);
647
+
648
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ replaceButton.setToolTipText("Replace current");
650
+ replaceButton.addActionListener(this);
651
+ replaceButton.setEnabled(false);
652
+
653
+ copyOptionsPanel.add(updown);
654
+
655
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ redoButton.setToolTipText("Next version");
657
+ redoButton.addActionListener(this);
658
+ redoButton.setEnabled(false);
659
+
660
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
661
+ liveCB.setToolTipText("Enable animation");
433662 liveCB.addItemListener(this);
434663
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
664
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ oneStepButton.setToolTipText("Animate one step forward");
666
+ oneStepButton.addActionListener(this);
667
+
668
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
669
+ fastCB.setToolTipText("Fast mode");
453670 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
671
+
672
+ //oe.toolboxPanel.Return();
673
+
674
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
675
+// trackCB.setToolTipText("Enable tracking");
676
+// trackCB.addItemListener(this);
460677
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
495
- trackCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
499
- screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
501678 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502679 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507680
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
514
- flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
681
+ if (Globals.ADVANCED)
682
+ {
683
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ snapobjectButton.addActionListener(this);
685
+ snapobjectButton.setToolTipText("Snap Object");
686
+ }
687
+
688
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
518689
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
521
- twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523691 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
692
+ fourButton.setToolTipText("Show left panel only");
693
+
694
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ twoButton.setToolTipText("Show right view only");
696
+ twoButton.addActionListener(this);
697
+ this.fullscreenLayout = twoButton;
698
+
699
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ sixButton.setToolTipText("Show left and right");
525701 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
527
- threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
529
- sevenButton.addActionListener(this);
702
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
+// threeButton.setToolTipText("2-column layout right");
704
+// threeButton.addActionListener(this);
705
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
706
+// sevenButton.setToolTipText("3-column layout");
707
+// sevenButton.addActionListener(this);
530708 //
531709
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
710
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ rootButton.setToolTipText("Open selection in new tab");
533712 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
713
+
714
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ closeButton.setToolTipText("Close tab");
536716 closeButton.addActionListener(this);
537717 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538718 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540
-
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
- editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547719
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
720
+ // INSERT
721
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
722
+ gridButton.setToolTipText("Create grid");
723
+ gridButton.addActionListener(this);
724
+
725
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
+ boxButton.setToolTipText("Create box");
727
+ boxButton.addActionListener(this);
728
+
729
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ sphereButton.setToolTipText("Create sphere");
731
+ sphereButton.addActionListener(this);
732
+
733
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
734
+ coneButton.setToolTipText("Create cone");
735
+ coneButton.addActionListener(this);
736
+
737
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ torusButton.setToolTipText("Create torus");
739
+ torusButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ superButton.setToolTipText("Create superellipsoid");
743
+ superButton.addActionListener(this);
744
+
745
+ if (Globals.ADVANCED)
746
+ {
747
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ kleinButton.setToolTipText("Create Klein bottle");
749
+ kleinButton.addActionListener(this);
750
+ }
751
+
752
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ particlesButton.setToolTipText("Create particle system");
754
+ particlesButton.addActionListener(this);
755
+
756
+ oe.toolboxPanel.Return();
757
+
758
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
759
+ groupButton.setToolTipText("Create group");
760
+ groupButton.addActionListener(this);
761
+
762
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
763
+ compositeButton.setToolTipText("Create composite");
764
+ compositeButton.addActionListener(this);
765
+
766
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
767
+ switchButton.setToolTipText("Create item switcher");
768
+ switchButton.addActionListener(this);
769
+
770
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
771
+ loopButton.setToolTipText("Create loop");
772
+ loopButton.addActionListener(this);
773
+
774
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ textureButton.setToolTipText("Create texture");
776
+ textureButton.addActionListener(this);
777
+
778
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
779
+ overlayButton.setToolTipText("Create overlay");
780
+ overlayButton.addActionListener(this);
781
+
782
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
783
+ lightButton.setToolTipText("Create light");
784
+ lightButton.addActionListener(this);
785
+
786
+ for (int i=6; --i>=0;)
787
+ {
788
+ oe.toolboxPanel.Return();
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
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ }
797
+
798
+ // EDIT panel
799
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
800
+ editButton.setToolTipText("Pin selection controls");
801
+ editButton.addActionListener(this);
802
+
803
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
804
+ uneditButton.setToolTipText("Remove selection controls");
549805 uneditButton.addActionListener(this);
550806
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
807
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
808
+ allParamsButton.setToolTipText("Show all controle");
563809 allParamsButton.addActionListener(this);
564810
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
811
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
812
+ clearPanelButton.setToolTipText("Clear edit panel");
813
+ clearPanelButton.addActionListener(this);
814
+
815
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
816
+ unselectButton.setToolTipText("Unselect");
570817 unselectButton.addActionListener(this);
571818
819
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
820
+ flashSelectionButton.setToolTipText("Highlight selection");
821
+ flashSelectionButton.addActionListener(this);
822
+
823
+ editCommandsPanel.preferredHeight = 1;
824
+
825
+ SetPinStates(false);
826
+// oe.treePanel.add(commandsPanel);
827
+// oe.treePanel.Return();
828
+
572829 // oe.aConstraints.gridx += 1;
573830 // oe.aConstraints.weighty = 0;
574831 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +837,25 @@
580837 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581838 // gcButton.addActionListener(this);
582839
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
840
+ cGridBag jSPPanel = new cGridBag();
841
+
842
+ JScrollPane jSP;
594843 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
844
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596845 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
601
-
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
- colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
609
- materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
612
- textureCB.addItemListener(this);
613
-
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
616846
847
+ oe.treePanel.add(jSPPanel);
848
+ oe.treePanel.Return();
849
+
850
+ oe.treePanel.add(copyOptionsPanel);
851
+ oe.treePanel.Return();
852
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
853
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
854
+ sliderPane.preferredHeight = 1;
855
+
856
+// mainPanel.setDividerLocation(0.5); //1.0);
857
+// mainPanel.setResizeWeight(0.5);
858
+
617859 //jList.addListSelectionListener(this);
618860 oe.jTree.addTreeSelectionListener(this);
619861 //jTree.setRootVisible(false);
....@@ -632,23 +874,160 @@
632874 dgr.addDragGestureListener(this);
633875 }catch(Exception e) {}
634876 */
635
- radio.layout = sevenButton;
877
+ radio.layout = sixButton; // sevenButton;
636878 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637879 }
880
+
881
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
882
+ {
883
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
884
+ colorCB.setToolTipText("Copy color when dropped");
885
+ colorCB.addItemListener(this);
886
+
887
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
888
+ materialCB.setToolTipText("Copy material when dropped");
889
+ materialCB.addItemListener(this);
890
+
891
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
892
+ textureCB.setToolTipText("Copy texture when dropped");
893
+ textureCB.addItemListener(this);
894
+
895
+ panel.Return();
896
+
897
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
898
+ boxCB.setToolTipText("Display bounding boxes");
899
+ boxCB.addItemListener(this);
900
+
901
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
902
+ zoomBoxCB.setToolTipText("Display only for wheel");
903
+ zoomBoxCB.addItemListener(this);
904
+
905
+ if (true) // Globals.ADVANCED)
906
+ {
907
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
908
+// supportCB.setToolTipText("Enable rigging");
909
+// supportCB.addItemListener(this);
910
+
911
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
912
+ freezeCB.setToolTipText("Fast moving camera");
913
+ freezeCB.addItemListener(this);
914
+
915
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
916
+ // localCB.addItemListener(this);
917
+
918
+ panel.Return();
919
+
920
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
921
+ crowdCB.setToolTipText("Used for crowds");
922
+ crowdCB.addItemListener(this);
923
+
924
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
925
+ smoothCB.setToolTipText("Snapping delay");
926
+ smoothCB.addItemListener(this);
927
+
928
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
929
+ slowCB.setToolTipText("Smooth interpolation");
930
+ slowCB.addItemListener(this);
931
+
932
+// constraints.gridy += 1;
933
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
934
+// speakerMocapCB.addItemListener(this);
935
+
936
+ panel.Return();
937
+
938
+ if (false)
939
+ {
940
+ // handled in scripts
941
+ //constraints.gridy += 1;
942
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
943
+ speakerCameraCB.addItemListener(this);
944
+
945
+ //constraints.gridy += 1;
946
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
947
+ speakerFocusCB.addItemListener(this);
948
+
949
+ //constraints.gridy += 1;
950
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
951
+ smoothfocusCB.addItemListener(this);
952
+ panel.Return();
953
+ }
954
+
955
+//constraints.gridx += 1;
956
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
957
+// debugCB.addItemListener(this);
958
+
959
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
960
+ trackCB.setToolTipText("Enable tracking target");
961
+ trackCB.addItemListener(this);
962
+
963
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
964
+ oeilCB.setToolTipText("Move camera when tracking");
965
+ oeilCB.addItemListener(this);
966
+
967
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
968
+ shadowCB.setToolTipText("When live compute shadows");
969
+ shadowCB.addItemListener(this);
970
+
971
+ panel.Return();
972
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
973
+ toggleTextureCB.setToolTipText("Load textures");
974
+ toggleTextureCB.addItemListener(this);
975
+
976
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
977
+ toggleSwitchCB.setToolTipText("Choose a single item");
978
+ toggleSwitchCB.addItemListener(this);
979
+
980
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
981
+ autokeepCB.setToolTipText("On structure change");
982
+ autokeepCB.addItemListener(this);
983
+
984
+ panel.Return();
985
+ if (Globals.ADVANCED)
986
+ {
987
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
988
+ lookAtCB.setToolTipText("Look-at target");
989
+ lookAtCB.addItemListener(this);
990
+ }
991
+
992
+ }
993
+
994
+ cGridBag fill = new cGridBag();
995
+ fill.preferredHeight = 200;
996
+ cGridBag fill2 = new cGridBag();
997
+ fill2.preferredHeight = 200;
998
+ cGridBag fill3 = new cGridBag();
999
+ fill3.preferredHeight = 200;
1000
+
1001
+ panel.add(fill);
1002
+ panel.add(fill2);
1003
+ panel.add(fill3);
1004
+
1005
+ }
6381006
6391007 void EditObject(Object3D obj)
6401008 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
1009
+ cRadio radioButton = new cRadio(obj.name);
1010
+
1011
+ // June 2019. Patch to avoid bug with transparency.
1012
+ radioButton.hadMaterial = obj.material != null;
1013
+ if (!radioButton.hadMaterial)
1014
+ {
1015
+ obj.material = new cMaterial();
1016
+ }
1017
+
1018
+ radioButton.SetObject(obj);
1019
+ radioButton.layout = sixButton; // sevenButton;
1020
+ radioButton.SetCamera(cameraView.renderCamera, false);
1021
+ radioButton.addActionListener(this);
1022
+ radioPanel.add(radioButton);
1023
+ buttonGroup.add(radioButton);
1024
+ radioButton.doClick();
6491025 }
1026
+
6501027 void SetupViews(ObjEditor oe)
6511028 {
1029
+ theFrame = this;
1030
+
6521031 oe.SetupViews();
6531032
6541033 System.out.println("SetupViews");
....@@ -657,22 +1036,28 @@
6571036 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6581037 }
6591038
660
- JCheckBox liveCB;
661
- JCheckBox supportCB;
662
- JCheckBox localCB;
663
- JCheckBox crowdCB;
664
- JCheckBox smoothCB;
665
- JCheckBox fastCB;
666
- JCheckBox slowCB;
667
- JCheckBox boxCB;
668
- JCheckBox trackCB;
669
- JCheckBox smoothfocusCB;
1039
+ cToggleButton liveCB;
1040
+ cCheckBox supportCB;
1041
+ cCheckBox localCB;
1042
+ cCheckBox crowdCB;
1043
+ cCheckBox smoothCB;
1044
+ cToggleButton fastCB;
1045
+ cCheckBox slowCB;
1046
+ cCheckBox boxCB;
1047
+ cCheckBox zoomBoxCB;
1048
+ cCheckBox freezeCB;
1049
+ //cToggleButton trackCB;
1050
+ cCheckBox trackCB;
1051
+ cCheckBox smoothfocusCB;
6701052 // JCheckBox speakerMocapCB;
671
- JCheckBox speakerCameraCB;
672
- JCheckBox speakerFocusCB;
673
- JCheckBox debugCB;
674
- JCheckBox oeilCB;
675
- JCheckBox lookAtCB;
1053
+ cCheckBox speakerCameraCB;
1054
+ cCheckBox speakerFocusCB;
1055
+ cCheckBox debugCB;
1056
+
1057
+ cCheckBox oeilCB;
1058
+ cCheckBox shadowCB;
1059
+ cCheckBox autokeepCB;
1060
+ cCheckBox lookAtCB;
6761061
6771062 // static int COLOR = 1;
6781063 // static int MATERIAL = 2;
....@@ -680,9 +1065,9 @@
6801065
6811066 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6821067
683
- JCheckBox colorCB;
684
- JCheckBox materialCB;
685
- JCheckBox textureCB;
1068
+ cCheckBox colorCB;
1069
+ cCheckBox materialCB;
1070
+ cCheckBox textureCB;
6861071
6871072 public void itemStateChanged(ItemEvent e)
6881073 {
....@@ -707,10 +1092,10 @@
7071092 dropAttributes |= Object3D.TEXTURE;
7081093 else
7091094 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
1095
+ } else if(e.getSource() == liveCB)
7121096 {
7131097 cameraView.ToggleLive();
1098
+ refreshContents(false);
7141099 }
7151100 else if(e.getSource() == supportCB)
7161101 {
....@@ -746,6 +1131,10 @@
7461131 cameraView.repaint();
7471132 // refreshContents();
7481133 }
1134
+ else if(e.getSource() == zoomBoxCB)
1135
+ {
1136
+ cameraView.ToggleZoomBoxMode();
1137
+ }
7491138 else if(e.getSource() == smoothfocusCB)
7501139 {
7511140 cameraView.ToggleSmoothFocus();
....@@ -771,6 +1160,18 @@
7711160 {
7721161 cameraView.ToggleOeil();
7731162 }
1163
+ else if(e.getSource() == shadowCB)
1164
+ {
1165
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1166
+ }
1167
+ else if(e.getSource() == freezeCB)
1168
+ {
1169
+ Globals.FREEZEONMOVE ^= true;
1170
+ }
1171
+ else if(e.getSource() == autokeepCB)
1172
+ {
1173
+ Globals.REPLACEONMAKE ^= true;
1174
+ }
7741175 else if(e.getSource() == lookAtCB)
7751176 {
7761177 cameraView.ToggleLookAt();
....@@ -787,7 +1188,8 @@
7871188
7881189 /**/
7891190 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
790
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1191
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1192
+ TreePath path = objEditor.jTree.getSelectionPath();
7911193 if ((path == null) || (path.getPathCount() <= 1)) {
7921194 // We can't move the root node or an empty selection
7931195 return;
....@@ -850,8 +1252,6 @@
8501252 }
8511253 }
8521254
853
- String string = (String) object;
854
-
8551255 System.out.println("Transfer = " + object + "; drop : " + target);
8561256 // if( object instanceof java.io.File[])
8571257 // {
....@@ -859,7 +1259,11 @@
8591259 // objEditor.DropFile((java.io.File[]) object, true);
8601260 // return;
8611261 // }
862
- if (string.charAt(0) == '/')
1262
+
1263
+ String string = object.toString();
1264
+
1265
+ // File path for Mac and Windows
1266
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631267 {
8641268 // file(s)
8651269 String[] names = string.split("\n");
....@@ -886,7 +1290,7 @@
8861290
8871291 flashIt = false;
8881292 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1293
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901294 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911295
8921296 if (group.selection.size() == 1)
....@@ -902,23 +1306,33 @@
9021306
9031307 assert target == objEditor.jTree;
9041308 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1309
+ Object3D destinationLeaf;
9051310 try {
906
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1311
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9071312 } catch (Exception e) {
9081313 System.out.println("destinationPath : " + destinationPath);
9091314 return;
9101315 }
9111316
912
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1317
+ for (int i=group.selection.size(); --i>=0;)
9131318 {
1319
+ Object3D child = (Object3D)group.selection.elementAt(i);
1320
+
1321
+ // Cannot move into itself
1322
+ if (child == destinationLeaf)
1323
+ return;
1324
+ }
1325
+
1326
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1327
+// {
9141328 loadClipboard(true);
9151329 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
917
- } else {
918
- loadClipboard(false);
919
- objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
921
- }
1330
+ pasteInto(false, false);
1331
+// } else {
1332
+// loadClipboard(false);
1333
+// objEditor.jTree.setSelectionPath(destinationPath);
1334
+// pasteInto(false, false); // true); // ???
1335
+// }
9221336 }
9231337 public void dropActionChanged(DropTargetDragEvent dtde)
9241338 // Called if the user has modified the current drop gesture
....@@ -1023,83 +1437,107 @@
10231437 {
10241438 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10251439 //heightFieldItem.addActionListener(this);
1026
- gridItem = menu.add(new MenuItem("Grid"));
1027
- gridItem.addActionListener(this);
1028
- rectoidItem = menu.add(new MenuItem("Box"));
1029
- rectoidItem.addActionListener(this);
1030
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1031
- ellipsoidItem.addActionListener(this);
1032
- coneItem = menu.add(new MenuItem("Cone"));
1033
- coneItem.addActionListener(this);
1034
- torusItem = menu.add(new MenuItem("Torus"));
1035
- torusItem.addActionListener(this);
1036
- superItem = menu.add(new MenuItem("Superellipsoid"));
1037
- superItem.addActionListener(this);
1038
- particleItem = menu.add(new MenuItem("Particle system"));
1039
- particleItem.addActionListener(this);
1440
+// gridItem = menu.add(new MenuItem("Grid"));
1441
+// gridItem.addActionListener(this);
1442
+// rectoidItem = menu.add(new MenuItem("Box"));
1443
+// rectoidItem.addActionListener(this);
1444
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1445
+// ellipsoidItem.addActionListener(this);
1446
+// coneItem = menu.add(new MenuItem("Cone"));
1447
+// coneItem.addActionListener(this);
1448
+// torusItem = menu.add(new MenuItem("Torus"));
1449
+// torusItem.addActionListener(this);
1450
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1451
+// superItem.addActionListener(this);
1452
+
1453
+ cameraItem = menu.add(new MenuItem("Camera"));
1454
+ cameraItem.addActionListener(this);
1455
+
1456
+ if (!Globals.ADVANCED)
1457
+ {
1458
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1459
+ kleinItem.addActionListener(this);
1460
+ }
1461
+
1462
+// particleItem = menu.add(new MenuItem("Particle system"));
1463
+// particleItem.addActionListener(this);
1464
+ if (Globals.ADVANCED)
1465
+ {
10401466 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411467 ragdollItem.addActionListener(this);
10421468 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431469 ragdoll2Item.addActionListener(this);
1470
+ }
10441471 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1472
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461473 meshItem.addActionListener(this);
10471474 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481475 // meshGroupItem.addActionListener(this);
1476
+ if (Globals.ADVANCED)
1477
+ {
10491478 springItem = menu.add(new MenuItem("Spring"));
10501479 springItem.addActionListener(this);
10511480 flagItem = menu.add(new MenuItem("Flag"));
10521481 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571482 blobItem = menu.add(new MenuItem("Blob"));
10581483 blobItem.addActionListener(this);
10591484 latheItem = menu.add(new MenuItem("Lathe"));
10601485 latheItem.addActionListener(this);
1061
- lightItem = menu.add(new MenuItem("Light"));
1062
- lightItem.addActionListener(this);
1486
+ }
1487
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1488
+ bezierItem.addActionListener(this);
1489
+// overlayItem = menu.add(new MenuItem("Overlay"));
1490
+// overlayItem.addActionListener(this);
1491
+// lightItem = menu.add(new MenuItem("Light"));
1492
+// lightItem.addActionListener(this);
10631493 menu.add("-");
10641494 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10651495 //superLoopItem.addActionListener(this);
1066
- loopItem = menu.add(new MenuItem("Loop"));
1067
- loopItem.addActionListener(this);
1496
+// loopItem = menu.add(new MenuItem("Loop"));
1497
+// loopItem.addActionListener(this);
10681498 doubleItem = menu.add(new MenuItem("Fork"));
10691499 doubleItem.addActionListener(this);
1500
+ if (Globals.ADVANCED)
1501
+ {
10701502 tripleItem = menu.add(new MenuItem("Trident"));
10711503 tripleItem.addActionListener(this);
1504
+ }
10721505 }
10731506
10741507 void buildToolsMenu(Menu menu)
10751508 {
10761509 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771510 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1511
+ animationItem.setState(Globals.ANIMATION);
1512
+
1513
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1514
+ archiveItem.addActionListener(this);
10791515
10801516 menu.add("-");
10811517 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821518 parseverticesItem.addActionListener(this);
10831519 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841520 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1521
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861522 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891523 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901524 reduceMorphItem.addActionListener(this);
10911525 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921526 reduce34MorphItem.addActionListener(this);
1093
-
1094
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1095
- computeAOItem.addActionListener(this);
10961527 menu.add("-");
1097
-
10981528 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991529 memoryItem.addActionListener(this);
1530
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1531
+ computeAOItem.addActionListener(this);
1532
+
1533
+ if (Globals.ADVANCED)
1534
+ {
1535
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1536
+ mirrorItem.addActionListener(this);
1537
+ menu.add("-");
11001538 menu.add(analyzeItem = new MenuItem("Analyze"));
11011539 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1540
+ menu.add(dumpItem = new MenuItem("Print"));
11031541 dumpItem.addActionListener(this);
11041542 // menu.add(pathItem = new MenuItem("From-to path"));
11051543 // pathItem.addActionListener(this);
....@@ -1108,6 +1546,8 @@
11081546 resetParentItem.addActionListener(this);
11091547 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101548 repairParentItem.addActionListener(this);
1549
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1550
+ repairShadowItem.addActionListener(this);
11111551 menu.add(invariantsItem = new MenuItem("Invariants"));
11121552 invariantsItem.addActionListener(this);
11131553 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1555,7 @@
11151555 menu.add("-");
11161556 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171557 editScriptItem.addActionListener(this);
1558
+ }
11181559 }
11191560
11201561 void ScreenFit()
....@@ -1237,9 +1678,34 @@
12371678 shadow.material = new cMaterial(obj.material);
12381679 shadow.material.diffuse = 0.0001f;
12391680 shadow.material.specular = 0.0001f;
1681
+ //shadow.projectedVertices[1].x = 300;
12401682
12411683 makeSomething(shadow);
12421684 }
1685
+
1686
+ private void ClearUnpinned()
1687
+ {
1688
+ //for (Object3D obj : listUI)
1689
+ for (int i=listUI.size(); --i>=0;)
1690
+ {
1691
+ Object3D obj = listUI.elementAt(i);
1692
+ if (!obj.pinned)
1693
+ {
1694
+ obj.CloseUI();
1695
+ listUI.remove(i);
1696
+ }
1697
+ }
1698
+ }
1699
+
1700
+ private void EditElement(Object3D elem, boolean newWindow)
1701
+ {
1702
+ // if (!(elem instanceof Composite))
1703
+ // newWindow = false;
1704
+ listUI.add(elem);
1705
+ elem.openEditWindow(this, newWindow); //, false);
1706
+ System.out.println("edit : " + elem);
1707
+ elem.editWindow.refreshContents(true); // ? new
1708
+ }
12431709
12441710 /**
12451711 * applyExample
....@@ -1443,9 +1909,9 @@
14431909
14441910 void Overwrite(int mask)
14451911 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1912
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471913 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1914
+ Object3D content = Grafreed.clipboard.get(0);
14491915
14501916 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511917 content = ((cGroup)content).get(0);
....@@ -1468,6 +1934,7 @@
14681934 //
14691935 public void actionPerformed(ActionEvent event) // , Object arg)
14701936 {
1937
+ Object source = event.getSource();
14711938 /*
14721939 if (event.getSource() == nameField)
14731940 {
....@@ -1479,11 +1946,11 @@
14791946 }
14801947 else
14811948 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1949
+ if (source == lookAtItem || source == lookFromItem)
14831950 {
14841951 ScreenFit();
14851952 } else
1486
- if (event.getSource() == switchItem)
1953
+ if (source == switchViewItem)
14871954 {
14881955 cVector v1 = new cVector();
14891956 cVector v2 = new cVector();
....@@ -1492,11 +1959,11 @@
14921959 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931960 objEditor.cameraView.repaint();
14941961 } else
1495
- if (event.getSource() == rectoidItem)
1962
+ if (source == rectoidItem || source == boxButton)
14961963 {
14971964 makeSomething(new Box());
14981965 } else
1499
- if (event.getSource() == particleItem)
1966
+ if (source == particleItem || source == particlesButton)
15001967 {
15011968 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021969 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1984,9 @@
15171984 applyExample(particleGeom, "SMOKE");
15181985 makeSomething(particleGeom);
15191986 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1987
+ if (source == ragdollItem || source == ragdoll2Item)
15211988 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1989
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231990
15241991 ragdoll.toParent = LA.newMatrix();
15251992 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +2004,7 @@
15372004 } else
15382005 /*
15392006 */
1540
- if (event.getSource() == heightFieldItem)
2007
+ if (source == heightFieldItem)
15412008 {
15422009 Object3D obj = new Object3D();
15432010
....@@ -1575,27 +2042,31 @@
15752042
15762043 makeSomething(obj);
15772044 } else
1578
- if (event.getSource() == gridItem)
2045
+ if (source == gridItem || source == gridButton)
15792046 {
15802047 makeSomething(new Grid());
15812048 } else
1582
- if (event.getSource() == ellipsoidItem)
2049
+ if (source == ellipsoidItem || source == sphereButton)
15832050 {
15842051 makeSomething(new Sphere());
15852052 } else
1586
- if (event.getSource() == coneItem)
2053
+ if (source == coneItem || source == coneButton)
15872054 {
15882055 makeSomething(new Cone());
15892056 } else
1590
- if (event.getSource() == torusItem)
2057
+ if (source == torusItem || source == torusButton)
15912058 {
15922059 makeSomething(new Torus());
15932060 } else
1594
- if (event.getSource() == superItem)
2061
+ if (source == superItem || source == superButton)
15952062 {
15962063 makeSomething(new Superellipsoid());
15972064 } else
1598
- if (event.getSource() == blobItem)
2065
+ if (source == kleinItem || source == kleinButton)
2066
+ {
2067
+ makeSomething(new Klein());
2068
+ } else
2069
+ if (source == blobItem)
15992070 {
16002071 Blob blob = new Blob();
16012072 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +2074,15 @@
16032074 //blob.retile();
16042075 makeSomething(blob);
16052076 } else
1606
- if (event.getSource() == latheItem)
2077
+ if (source == latheItem)
16072078 {
16082079 makeSomething(new Lathe());
16092080 } else
1610
- if (event.getSource() == bezierItem)
2081
+ if (source == bezierItem)
16112082 {
16122083 makeSomething(new BezierSurface());
16132084 } else
1614
- if (event.getSource() == checkerItem)
2085
+ if (source == overlayItem || source == overlayButton)
16152086 {
16162087 /*
16172088 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +2097,7 @@
16262097 */
16272098 makeSomething(new Checker());
16282099 } else
1629
- if (event.getSource() == meshItem)
2100
+ if (source == meshItem)
16302101 {
16312102 Object3D itemtomake = new Object3D();
16322103 Object3D child;
....@@ -1647,35 +2118,35 @@
16472118 makeSomething(child);
16482119 }
16492120 } else
1650
- if (event.getSource() == springItem)
2121
+ if (source == springItem)
16512122 {
16522123 cSpring s = new cSpring();
16532124 s.setup();
16542125 makeSomething(s);
16552126 } else
1656
- if (event.getSource() == flagItem)
2127
+ if (source == flagItem)
16572128 {
16582129 cSpring s = new cFlag();
16592130 s.setup();
16602131 makeSomething(s);
16612132 } else
1662
- if (event.getSource() == lightItem)
2133
+ if (source == lightItem || source == lightButton)
16632134 {
16642135 makeSomething(new Light());
16652136 } else
1666
- if (event.getSource() == csgItem)
2137
+ if (source == csgItem)
16672138 {
16682139 group(new CSG());
16692140 } else
1670
- if (event.getSource() == templateItem)
2141
+ if (source == templateItem)
16712142 {
16722143 group(new cTemplate());
16732144 } else
1674
- if (event.getSource() == attributeItem)
2145
+ if (source == attributeItem)
16752146 {
16762147 makeSomething(new Attribute());
16772148 } else
1678
- if (event.getSource() == pointflowItem)
2149
+ if (source == pointflowItem)
16792150 {
16802151 makeSomething(new PointFlow());
16812152 } else
....@@ -1687,7 +2158,7 @@
16872158 } else
16882159 */
16892160
1690
- if (event.getSource() == superLoopItem)
2161
+ if (source == superLoopItem)
16912162 {
16922163 Composite g = new cGroup();
16932164 for (int i=0; i<15; i++)
....@@ -1709,30 +2180,30 @@
17092180
17102181 group(g);
17112182 } else
1712
- if (event.getSource() == loopItem)
2183
+ if (source == loopItem || source == loopButton)
17132184 {
17142185 Composite csg = new GroupLeaf();
17152186 csg.count = 5;
17162187 group(csg);
1717
- Composite child = new cGroup();
2188
+ Composite child = new cGroup("Branch");
17182189 csg.addChild(child);
17192190 child.addChild(csg);
17202191 } else
1721
- if (event.getSource() == doubleItem)
2192
+ if (source == doubleItem)
17222193 {
1723
- Composite csg = new GroupLeaf();
2194
+ Composite csg = new GroupLeaf("Fork");
17242195 csg.count = 5;
17252196 group(csg);
1726
- Composite child = new cGroup();
2197
+ Composite child = new cGroup("Branch A");
17272198 csg.addChild(child);
17282199 child.addChild(csg);
1729
- child = new cGroup();
2200
+ child = new cGroup("Branch B");
17302201 csg.addChild(child);
17312202 child.addChild(csg);
17322203 } else
1733
- if (event.getSource() == tripleItem)
2204
+ if (source == tripleItem)
17342205 {
1735
- Composite csg = new GroupLeaf();
2206
+ Composite csg = new GroupLeaf("Trident");
17362207 csg.count = 4;
17372208 group(csg);
17382209 Composite child = new cGroup();
....@@ -1745,73 +2216,98 @@
17452216 csg.addChild(child);
17462217 child.addChild(csg);
17472218 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
2219
+ if (source == computeAOItem)
17502220 {
1751
- ImportGFD();
2221
+ Globals.drawMode = CameraPane.OCCLUSION;
2222
+ Globals.theRenderer.repaint();
17522223 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
2224
+ if (source == recompileItem)
17712225 {
17722226 Recompile();
17732227 refreshContents();
17742228 } else
1775
- if (event.getSource() == editScriptItem)
2229
+ if (source == editScriptItem)
17762230 {
17772231 OpenDialog();
17782232 refreshContents();
17792233 } else
1780
- if (event.getSource() == invariantsItem)
2234
+ if (source == invariantsItem)
17812235 {
17822236 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
2237
+ Grafreed.grafreeD.universe.invariants();
17842238 } else
1785
- if (event.getSource() == memoryItem)
2239
+ if (source == memoryItem)
17862240 {
17872241 //System.out.println("Invariants:");
17882242 PrintMemory();
17892243 } else
1790
- if (event.getSource() == pathItem)
2244
+ if (source == pathItem)
17912245 {
17922246 PrintPath();
17932247 } else
1794
- if (event.getSource() == analyzeItem)
2248
+ if (source == analyzeItem)
17952249 {
17962250 AnalyzeObject();
17972251 } else
1798
- if (event.getSource() == dumpItem)
2252
+ if (source == dumpItem)
17992253 {
18002254 DumpObject();
18012255 } else
1802
- if (event.getSource() == screenfitButton)
2256
+ if (source == minButton)
18032257 {
1804
- //Reload(lastConverter, lastFilename, true);
2258
+ Minimize();
2259
+ } else
2260
+ if (source == maxButton)
2261
+ {
2262
+ Maximize();
2263
+ } else
2264
+ if (source == fullButton)
2265
+ {
2266
+ ToggleFullScreen();
2267
+ } else
2268
+ if (source == undoButton)
2269
+ {
2270
+ // Go to previous version
2271
+ //if (!Undo())
2272
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2273
+ Undo();
2274
+ } else
2275
+ if (source == restoreButton)
2276
+ {
2277
+ // Restore current version
2278
+ Restore();
2279
+ } else
2280
+ if (source == replaceButton)
2281
+ {
2282
+ // Overwrite current version
2283
+ Replace();
2284
+ } else
2285
+ if (source == redoButton)
2286
+ {
2287
+ // Go to next version
2288
+ Redo();
2289
+ } else
2290
+ if (source == saveButton)
2291
+ {
2292
+ // Save a new version
2293
+ if (!Save(true))
2294
+ java.awt.Toolkit.getDefaultToolkit().beep();
2295
+ } else
2296
+ if (source == oneStepButton)
2297
+ {
2298
+ Globals.ONESTEP = true;
2299
+ cameraView.repaint();
2300
+ } else
2301
+ if (source == screenfitButton)
2302
+ {
18052303 ScreenFit();
18062304 } else
1807
- if (event.getSource() == screenfitpointButton)
2305
+ if (source == screenfitpointButton)
18082306 {
1809
- //Reload(lastConverter, lastFilename, true);
18102307 ScreenFitPoint();
18112308 } else
1812
- if (event.getSource() == snapobjectButton)
2309
+ if (source == snapobjectButton)
18132310 {
1814
- //Reload(lastConverter, lastFilename, true);
18152311 SnapObject();
18162312 } else
18172313 // if (event.getSource() == recompileButton)
....@@ -1820,13 +2316,13 @@
18202316 // Recompile();
18212317 // refreshContents();
18222318 // } else
1823
- if (event.getSource() == gcButton)
2319
+ if (source == gcButton)
18242320 {
18252321 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262322 System.gc();
18272323 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282324 } else
1829
- if (event.getSource() == editLeafItem)
2325
+ if (source == editLeafItem)
18302326 {
18312327 Object3D obj;
18322328 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2336,74 @@
18402336 }
18412337 refreshContents(true);
18422338 } else
1843
- if (event.getSource() == openWindowItem)
2339
+ if (source == openWindowItem)
18442340 {
18452341 EditSelection(true);
18462342 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2343
+ if (source == cutItem || source == clearButton)
18482344 {
18492345 loadClipboard(true);
18502346 } else
1851
- if (event.getSource() == duplicateItem)
2347
+ if (source == undoItem)
18522348 {
1853
- Object3D keep = GrafreeD.clipboard;
2349
+ Undo();
2350
+ } else
2351
+ if (source == redoItem)
2352
+ {
2353
+ Redo();
2354
+ } else
2355
+ if (source == duplicateItem)
2356
+ {
2357
+ Object3D keep = Grafreed.clipboard;
18542358 loadClipboard(false);
18552359 paste(false);
1856
- GrafreeD.clipboard = keep;
2360
+ Grafreed.clipboard = keep;
18572361 } else
1858
- if (event.getSource() == cloneItem)
2362
+ if (source == cloneItem)
18592363 {
18602364 CloneSelection(false);
18612365 } else
1862
- if (event.getSource() == cloneSupportItem)
2366
+ if (source == cloneSupportItem)
18632367 {
18642368 CloneSelection(true);
18652369 } else
1866
- if (event.getSource() == copyItem)
2370
+ if (source == copyItem)
18672371 {
18682372 loadClipboard(false);
18692373 } else
1870
- if (event.getSource() == pasteItem)
2374
+ if (source == pasteItem)
18712375 {
18722376 paste(false);
18732377 } else
1874
- if (event.getSource() == pasteLinkItem)
2378
+ if (source == pasteIntoItem)
18752379 {
1876
- pasteInto(false);
2380
+ pasteInto(true, false);
18772381 } else
1878
- if (event.getSource() == pasteCloneItem)
2382
+ if (source == pasteLinkItem)
18792383 {
1880
- pasteInto(true);
2384
+ pasteInto(false, false);
18812385 } else
1882
- if (event.getSource() == pasteExpandItem)
2386
+ if (source == pasteCloneItem)
2387
+ {
2388
+ pasteInto(true, true);
2389
+ } else
2390
+ if (source == pasteExpandItem)
18832391 {
18842392 paste(true);
18852393 } else
1886
- if (event.getSource() == synchronizeItem)
2394
+ if (source == synchronizeItem)
18872395 {
18882396 Overwrite(Object3D.TRANSFORM);
18892397 } else
1890
- if (event.getSource() == overwriteNameItem)
2398
+ if (source == overwriteNameItem)
18912399 {
18922400 Overwrite(Object3D.NAME);
18932401 } else
1894
- if (event.getSource() == overwriteUVItem)
2402
+ if (source == overwriteUVItem)
18952403 {
18962404 Overwrite(Object3D.UV);
18972405 } else
1898
- if (event.getSource() == overwriteMatItem)
2406
+ if (source == overwriteMatItem)
18992407 {
19002408 /* july 2015
19012409 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2423,7 @@
19152423
19162424 Overwrite(dropAttributes);
19172425 }
1918
- if (event.getSource() == overwriteGeoItem)
2426
+ if (source == overwriteGeoItem)
19192427 {
19202428 Overwrite(Object3D.GEOMETRY);
19212429 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2440,7 @@
19322440 // refreshContents();
19332441 // }
19342442 } else
1935
- if (event.getSource() == generateMeshItem)
2443
+ if (source == generateMeshItem)
19362444 {
19372445 //if (group.selection.size() == 1)
19382446 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2451,7 @@
19432451 ResetModel();
19442452 refreshContents();
19452453 } else
1946
- if (event.getSource() == extractGeometriesItem)
2454
+ if (source == extractGeometriesItem)
19472455 {
19482456 boolean one = false;
19492457
....@@ -1970,7 +2478,7 @@
19702478 ResetModel();
19712479 refreshContents();
19722480 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2481
+ if (source == cloneGeometriesItem)
19742482 {
19752483 boolean one = false;
19762484
....@@ -1996,32 +2504,37 @@
19962504 ResetModel();
19972505 refreshContents();
19982506 } else
1999
- if (event.getSource() == shareGeometriesItem)
2507
+ if (source == shareGeometriesItem)
20002508 {
20012509 boolean one = false;
20022510
20032511 if (group.selection.size() == 1)
20042512 one = true;
20052513
2514
+ Object3D merge = null;
2515
+
20062516 Object3D content = new cGroup();
20072517
20082518 for (int i=0; i<group.selection.size(); i++)
20092519 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2520
+ merge = new Merge(group.selection.get(i));
20112521
20122522 if (one)
2013
- makeSomething(sel, false);
2523
+ makeSomething(merge, false);
20142524 else
2015
- content.addChild(sel);
2525
+ content.addChild(merge);
20162526 }
20172527
20182528 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2529
+ makeSomething(content, true);
2530
+ else
2531
+ {
2532
+ ResetModel();
2533
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2534
+ refreshContents();
2535
+ }
20232536 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2537
+ if (source == mergeGeometriesItem)
20252538 {
20262539 boolean one = false;
20272540
....@@ -2051,7 +2564,7 @@
20512564 ResetModel();
20522565 refreshContents();
20532566 } else
2054
- if (event.getSource() == linkverticesItem)
2567
+ if (source == linkverticesItem)
20552568 {
20562569 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572570 // {
....@@ -2064,39 +2577,48 @@
20642577 // group.selection.get(0).setMasterThis(content); // should be identity
20652578 // refreshContents();
20662579 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2580
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682581 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2582
+ Object3D content = Grafreed.clipboard.get(0);
20702583
20712584 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722585 content = ((cGroup)content).get(0);
20732586
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2587
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752588 for (int i=0; i<group.selection.size(); i++)
20762589 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2590
+ boolean random = CameraPane.SWITCH;
2591
+ CameraPane.SWITCH = false; // parse all random nodes
20792592 group.selection.get(i).linkVerticesThis(content);
20802593 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2594
+ CameraPane.SWITCH = random;
20822595 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2596
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842597 refreshContents();
20852598 }
20862599 } else
2087
- if (event.getSource() == resetsupportItem)
2600
+ if (source == resetsupportItem)
20882601 {
20892602 for (int i=0; i<group.selection.size(); i++)
20902603 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2604
+ boolean random = CameraPane.SWITCH;
2605
+ CameraPane.SWITCH = false; // parse all random nodes
20932606 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2607
+ CameraPane.SWITCH = random;
20952608 }
20962609
20972610 refreshContents();
20982611 } else
2099
- if (event.getSource() == resetreferencesItem)
2612
+ if (source == relinkverticesItem)
2613
+ {
2614
+ boolean random = CameraPane.SWITCH;
2615
+ CameraPane.SWITCH = false; // parse all random nodes
2616
+ group.selection.RelinkToSupport();
2617
+ CameraPane.SWITCH = random;
2618
+
2619
+ refreshContents();
2620
+ } else
2621
+ if (source == resetreferencesItem)
21002622 {
21012623 for (int i=0; i<group.selection.size(); i++)
21022624 {
....@@ -2105,11 +2627,11 @@
21052627
21062628 refreshContents();
21072629 } else
2108
- if (event.getSource() == setMasterItem)
2630
+ if (source == setMasterItem)
21092631 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2632
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112633 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2634
+ Object3D content = Grafreed.clipboard.get(0);
21132635
21142636 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152637 content = ((cGroup)content).get(0);
....@@ -2118,13 +2640,13 @@
21182640 refreshContents();
21192641 }
21202642 } else
2121
- if (event.getSource() == poseMeshItem)
2643
+ if (source == poseMeshItem)
21222644 {
21232645 if (group.selection.size() == 1)
21242646 {
2125
- if (GrafreeD.clipboard.size() == 1)
2647
+ if (Grafreed.clipboard.size() == 1)
21262648 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2649
+ Object3D content = Grafreed.clipboard.get(0);
21282650
21292651 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302652 content = ((cGroup)content).get(0);
....@@ -2137,19 +2659,19 @@
21372659 }
21382660
21392661 } else
2140
- if (event.getSource() == revertMeshItem)
2662
+ if (source == revertMeshItem)
21412663 {
21422664 RevertMeshes();
21432665 } else
2144
- if (event.getSource() == resetMeshItem)
2666
+ if (source == resetAllItem)
21452667 {
21462668 ResetAll();
21472669 } else
2148
- if (event.getSource() == stepAllItem)
2670
+ if (source == stepAllItem)
21492671 {
21502672 StepAll();
21512673 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2674
+ if (source == deleteItem) // || event.getSource() == clearButton)
21532675 {
21542676 //int indices[] = jList.getSelectedIndices();
21552677 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2679,46 @@
21572679
21582680 ClearSelection(false);
21592681 } else
2160
- if (event.getSource() == clearAllItem)
2682
+ if (source == clearAllItem)
21612683 {
21622684 ClearSelection(true);
21632685 } else
2164
- if (event.getSource() == grabItem)
2686
+ if (source == grabItem || source == groupButton)
21652687 {
2166
- group(new cGroup(), true);
2688
+ group(new cGroup(), false); // true);
21672689 } else
2168
- if (event.getSource() == frontItem)
2690
+ if (source == hideItem)
2691
+ {
2692
+ group(new HiddenObject());
2693
+ } else
2694
+ if (source == frontItem)
21692695 {
21702696 front();
21712697 } else
2172
- if (event.getSource() == backItem)
2698
+ if (source == backItem)
21732699 {
21742700 back();
21752701 } else
2176
- if (event.getSource() == cameraItem)
2702
+ if (source == cameraItem)
21772703 {
21782704 makeSomething(new Camera());
21792705 } else
2180
- if (event.getSource() == compositeItem)
2706
+ if (source == compositeItem || source == compositeButton)
21812707 {
21822708 group(new Composite());
21832709 } else
2184
- if (event.getSource() == randomItem)
2710
+ if (source == switchItem || source == switchButton)
21852711 {
21862712 RandomNode random = new RandomNode();
21872713 group(random);
21882714 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2715
+ random.name = random.get(0).name + "Switch";
21902716 } else
2191
- if (event.getSource() == physicsItem)
2717
+ if (source == physicsItem)
21922718 {
21932719 group(new PhysicsNode());
21942720 } else
2195
- if (event.getSource() == frameselectorItem)
2721
+ if (source == frameselectorItem)
21962722 {
21972723 for (int i=0; i<group.selection.size(); i++)
21982724 {
....@@ -2204,7 +2730,7 @@
22042730 ResetModel();
22052731 refreshContents();
22062732 } else
2207
- if (event.getSource() == switchGeoItem)
2733
+ if (source == switchGeoItem)
22082734 {
22092735 for (int i=0; i<group.selection.size(); i++)
22102736 {
....@@ -2216,7 +2742,7 @@
22162742 ResetModel();
22172743 refreshContents();
22182744 } else
2219
- if (event.getSource() == switchTransfoItem)
2745
+ if (source == switchTransfoItem)
22202746 {
22212747 for (int i=0; i<group.selection.size(); i++)
22222748 {
....@@ -2228,7 +2754,7 @@
22282754 ResetModel();
22292755 refreshContents();
22302756 } else
2231
- if (event.getSource() == morphItem)
2757
+ if (source == morphItem)
22322758 {
22332759 for (int i=0; i<group.selection.size(); i++)
22342760 {
....@@ -2240,7 +2766,7 @@
22402766 ResetModel();
22412767 refreshContents();
22422768 } else
2243
- if (event.getSource() == scriptNodeItem)
2769
+ if (source == scriptNodeItem)
22442770 {
22452771 boolean atleastone = false;
22462772
....@@ -2279,199 +2805,252 @@
22792805 }
22802806 }
22812807 } else
2282
- if (event.getSource() == linkerItem)
2808
+ if (source == linkerItem)
22832809 {
22842810 group(new cLinker());
22852811 } else
2286
- if (event.getSource() == textureItem)
2812
+ if (source == textureItem || source == textureButton)
22872813 {
22882814 group(new TextureNode());
22892815 } else
2290
- if (event.getSource() == shadowXItem)
2816
+ if (source == billboardItem)
2817
+ {
2818
+ group(new BillboardNode());
2819
+ } else
2820
+ if (source == shadowXItem)
22912821 {
22922822 CastShadow(0);
22932823 } else
2294
- if (event.getSource() == shadowYItem)
2824
+ if (source == shadowYItem)
22952825 {
22962826 CastShadow(1);
22972827 } else
2298
- if (event.getSource() == shadowZItem)
2828
+ if (source == shadowZItem)
22992829 {
23002830 CastShadow(2);
23012831 } else
2302
- if (event.getSource() == ungroupItem)
2832
+ if (source == ungroupItem || source == ungroupButton)
23032833 {
2304
- ungroup();
2834
+ boolean hasRoot = false;
2835
+
2836
+ for (int i=0; i<group.selection.size(); i++)
2837
+ {
2838
+ if (group.selection.get(i) == group)
2839
+ {
2840
+ hasRoot = true;
2841
+ break;
2842
+ }
2843
+ }
2844
+
2845
+ if (!hasRoot)
2846
+ {
2847
+ for (int i=0; i<group.selection.size(); i++)
2848
+ {
2849
+ Ungroup(group.selection.get(i));
2850
+ }
2851
+
2852
+ ClearSelection(false);
2853
+
2854
+ refreshContents();
2855
+ }
23052856 } else
2306
- if (event.getSource() == genUVItem)
2857
+ if (source == genUVItem)
23072858 {
23082859 GenUV();
23092860 } else
2310
- if (event.getSource() == genNormalsCADItem)
2861
+ if (source == genNormalsCADItem)
23112862 {
23122863 GenNormals(true);
23132864 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2865
+ if (source == genNormalsMESHItem)
23152866 {
2316
- GenNormals(true); // TODO
2867
+ GenNormalsMESH();
23172868 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2869
+ if (source == genNormalsORGANItem)
23192870 {
23202871 GenNormals(false);
23212872 } else
2322
- if (event.getSource() == stripifyItem)
2873
+ if (source == genNormalsMINEItem)
2874
+ {
2875
+ GenNormalsMINE();
2876
+ } else
2877
+ if (source == stripifyItem)
23232878 {
23242879 Stripify();
23252880 } else
2326
- if (event.getSource() == unstripifyItem)
2881
+ if (source == unstripifyItem)
23272882 {
23282883 Unstripify();
23292884 } else
2330
- if (event.getSource() == trimItem)
2885
+ if (source == trimItem)
23312886 {
23322887 Trim();
23332888 } else
2334
- if (event.getSource() == untrimItem)
2889
+ if (source == untrimItem)
23352890 {
23362891 Untrim();
23372892 } else
2338
- if (event.getSource() == clearColorsItem)
2893
+ if (source == clearColorsItem)
23392894 {
23402895 ClearColors();
23412896 } else
2342
- if (event.getSource() == clearMaterialsItem)
2897
+ if (source == clearMaterialsItem)
23432898 {
23442899 ClearMaterials();
23452900 } else
2346
- if (event.getSource() == liveleavesItem)
2901
+ if (source == liveleavesItem)
23472902 {
23482903 LiveLeaves(true);
23492904 } else
2350
- if (event.getSource() == unliveleavesItem)
2905
+ if (source == unliveleavesItem)
23512906 {
23522907 LiveLeaves(false);
23532908 } else
2354
- if (event.getSource() == supportleavesItem)
2909
+ if (source == supportleavesItem)
23552910 {
23562911 SupportLeaves(true);
23572912 } else
2358
- if (event.getSource() == unsupportleavesItem)
2913
+ if (source == unsupportleavesItem)
23592914 {
23602915 SupportLeaves(false);
23612916 } else
2362
- if (event.getSource() == hideleavesItem)
2917
+ if (source == hideleavesItem)
23632918 {
23642919 HideLeaves(true);
23652920 } else
2366
- if (event.getSource() == showleavesItem)
2921
+ if (source == showleavesItem)
23672922 {
23682923 HideLeaves(false);
23692924 } else
2370
- if (event.getSource() == markleavesItem)
2925
+ if (source == markleavesItem)
23712926 {
23722927 MarkLeaves(true);
23732928 } else
2374
- if (event.getSource() == unmarkleavesItem)
2929
+ if (source == unmarkleavesItem)
23752930 {
23762931 MarkLeaves(false);
23772932 } else
2378
- if (event.getSource() == flipVItem)
2933
+ if (source == rewindleavesItem)
2934
+ {
2935
+ RewindLeaves(true);
2936
+ } else
2937
+ if (source == unrewindleavesItem)
2938
+ {
2939
+ RewindLeaves(false);
2940
+ } else
2941
+ if (source == randomleavesItem)
2942
+ {
2943
+ RandomLeaves(true);
2944
+ } else
2945
+ if (source == unrandomleavesItem)
2946
+ {
2947
+ RandomLeaves(false);
2948
+ } else
2949
+ if (source == flipVItem)
23792950 {
23802951 FlipV(true);
23812952 } else
2382
- if (event.getSource() == unflipVItem)
2953
+ if (source == unflipVItem)
23832954 {
23842955 FlipV(false);
23852956 } else
2386
- if (event.getSource() == lowTexturesItem)
2957
+ if (source == lowTexturesItem)
23872958 {
23882959 SetTexRes(0);
23892960 } else
2390
- if (event.getSource() == normalTexturesItem)
2961
+ if (source == normalTexturesItem)
23912962 {
23922963 SetTexRes(1);
23932964 } else
2394
- if (event.getSource() == highTexturesItem)
2965
+ if (source == highTexturesItem)
23952966 {
23962967 SetTexRes(2);
23972968 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2969
+ if (source == veryhighTexturesItem)
23992970 {
24002971 SetTexRes(3);
24012972 } else
2402
- if (event.getSource() == maxTexturesItem)
2973
+ if (source == maxTexturesItem)
24032974 {
24042975 SetTexRes(4);
24052976 } else
2406
- if (event.getSource() == panoTexturesItem)
2977
+ if (source == panoTexturesItem)
24072978 {
24082979 SetTexRes(5);
24092980 } else
2410
- if (event.getSource() == reverseNormalsItem)
2981
+ if (source == reverseNormalsItem)
24112982 {
24122983 ReverseNormals();
24132984 } else
2414
- if (event.getSource() == parseverticesItem)
2985
+ if (source == parseverticesItem)
24152986 {
24162987 ParseVertices();
24172988 } else
2418
- if (event.getSource() == textureFieldItem)
2989
+ if (source == textureFieldItem)
24192990 {
24202991 TextureVertices();
24212992 } else
2422
- if (event.getSource() == alignItem)
2993
+ if (source == alignItem)
24232994 {
24242995 Align();
24252996 } else
2426
- if (event.getSource() == mirrorItem)
2997
+ if (source == mirrorItem)
24272998 {
24282999 MirrorPoses();
24293000 } else
2430
- if (event.getSource() == reduceMorphItem)
3001
+ if (source == reduceMorphItem)
24313002 {
24323003 MeshReduction(false);
24333004 } else
2434
- if (event.getSource() == reduce34MorphItem)
3005
+ if (source == reduce34MorphItem)
24353006 {
24363007 MeshReduction(true);
24373008 } else
2438
- if (event.getSource() == reverseTrianglesItem)
3009
+ if (source == reverseTrianglesItem)
24393010 {
24403011 ReverseTriangles();
24413012 } else
2442
- if (event.getSource() == reduceMeshItem)
3013
+ if (source == reduceMeshItem)
24433014 {
24443015 ReduceMesh(false);
24453016 } else
2446
- if (event.getSource() == reduce34MeshItem)
3017
+ if (source == reduce34MeshItem)
24473018 {
24483019 ReduceMesh(true);
24493020 } else
2450
- if (event.getSource() == increaseMeshItem)
3021
+ if (source == increaseMeshItem)
24513022 {
24523023 IncreaseMesh();
24533024 } else
2454
- if (event.getSource() == clipMeshItem)
3025
+ if (source == clipMeshItem)
24553026 {
24563027 ClipMesh();
24573028 } else
2458
- if (event.getSource() == smoothMeshItem)
3029
+ if (source == smoothMeshItem)
24593030 {
24603031 SmoothMesh();
24613032 } else
2462
- if (event.getSource() == transformgeometryItem)
3033
+ if (source == transformGeometryItem)
24633034 {
24643035 TransformGeometry();
24653036 } else
2466
- if (event.getSource() == resetTransformItem)
3037
+ if (source == transformChildrenItem)
3038
+ {
3039
+ TransformChildren();
3040
+ } else
3041
+ if (source == resetTransformItem)
24673042 {
24683043 ResetTransform();
24693044 } else
2470
- if (event.getSource() == resetCentroidItem)
3045
+ if (source == resetCentroidItem)
24713046 {
2472
- ResetCentroid();
3047
+ ResetCentroid(true);
24733048 } else
2474
- if (event.getSource() == resetParentItem)
3049
+ if (source == resetCentroidXZItem)
3050
+ {
3051
+ ResetCentroid(false);
3052
+ } else
3053
+ if (source == resetParentItem)
24753054 {
24763055 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773056 {
....@@ -2481,7 +3060,7 @@
24813060
24823061 refreshContents();
24833062 } else
2484
- if (event.getSource() == repairParentItem)
3063
+ if (source == repairParentItem)
24853064 {
24863065 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24873066 {
....@@ -2495,7 +3074,21 @@
24953074
24963075 refreshContents();
24973076 } else
2498
- if (event.getSource() == sortbysizeItem)
3077
+ if (source == repairShadowItem)
3078
+ {
3079
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3080
+ {
3081
+ Object3D obj = (Object3D)e.nextElement();
3082
+ obj.RepairShadow();
3083
+// for (int i=0; i<obj.size(); i++)
3084
+// {
3085
+// obj.get(i).parent = obj;
3086
+// }
3087
+ }
3088
+
3089
+ refreshContents();
3090
+ } else
3091
+ if (source == sortbysizeItem)
24993092 {
25003093 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25013094 {
....@@ -2507,7 +3100,7 @@
25073100 ResetModel();
25083101 refreshContents();
25093102 } else
2510
- if (event.getSource() == sortbynameItem)
3103
+ if (source == sortbynameItem)
25113104 {
25123105 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25133106 {
....@@ -2519,7 +3112,7 @@
25193112 ResetModel();
25203113 refreshContents();
25213114 } else
2522
- if (event.getSource() == attachPigmentItem)
3115
+ if (source == attachPigmentItem)
25233116 {
25243117 String texture = GetFile("Attach pigment");
25253118 Object3D obj;
....@@ -2531,7 +3124,7 @@
25313124
25323125 refreshContents();
25333126 } else
2534
- if (event.getSource() == detachPigmentItem)
3127
+ if (source == detachPigmentItem)
25353128 {
25363129 Object3D obj;
25373130 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +3135,7 @@
25423135
25433136 refreshContents();
25443137 } else
2545
- if (event.getSource() == attachBumpItem)
3138
+ if (source == attachBumpItem)
25463139 {
25473140 String texture = GetFile("Attach bump");
25483141 Object3D obj;
....@@ -2554,7 +3147,7 @@
25543147
25553148 refreshContents();
25563149 } else
2557
- if (event.getSource() == detachBumpItem)
3150
+ if (source == detachBumpItem)
25583151 {
25593152 Object3D obj;
25603153 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +3158,7 @@
25653158
25663159 refreshContents();
25673160 } else
2568
- if (event.getSource() == pigmentBumpItem)
3161
+ if (source == pigmentBumpItem)
25693162 {
25703163 Object3D obj;
25713164 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +3169,237 @@
25763169
25773170 refreshContents();
25783171 } else
2579
- if (event.getSource() == flashSelectionButton)
3172
+ if (source == flashSelectionButton)
25803173 {
25813174 CameraPane.flash = true;
25823175 refreshContents();
25833176 } else
2584
- if (event.getSource() == oneButton)
3177
+ if (source == oneButton)
25853178 {
25863179 } else
2587
- if (event.getSource() == twoButton)
3180
+ if (source == twoButton)
25883181 {
25893182 radio.layout = twoButton;
3183
+
3184
+ if (CameraPane.FULLSCREEN)
3185
+ fullscreenLayout = radio.layout;
3186
+
25903187 // bug
25913188 //gridPanel.setDividerLocation(1.0);
25923189 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
3190
+// bigThree.remove(scenePanel);
3191
+// bigThree.remove(centralPanel);
3192
+// bigThree.remove(XYZPanel);
3193
+// aWindowConstraints.gridx = 0;
3194
+// aWindowConstraints.gridy = 0;
3195
+// aWindowConstraints.gridwidth = 1;
3196
+// // aConstraints.gridheight = 3;
3197
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3198
+// aWindowConstraints.weightx = 0;
3199
+// aWindowConstraints.weighty = 1;
3200
+// //bigThree.add(jtp, aWindowConstraints);
3201
+// aWindowConstraints.weightx = 1;
3202
+// aWindowConstraints.gridwidth = 3;
3203
+// // aConstraints.gridheight = 3;
3204
+// aWindowConstraints.gridx = 1;
3205
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3206
+// bigThree.add(centralPanel, aWindowConstraints);
3207
+// aWindowConstraints.weightx = 0;
3208
+// aWindowConstraints.gridx = 4;
3209
+// aWindowConstraints.gridwidth = 1;
3210
+// // aConstraints.gridheight = 3;
3211
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3212
+// //bigThree.add(XYZPanel, aWindowConstraints);
3213
+// scenePanel.setVisible(false);
3214
+// centralPanel.setVisible(true);
3215
+// XYZPanel.setVisible(false);
3216
+ bigThree.ClearUI();
3217
+ bigThree.add(centralPanel);
3218
+ bigThree.FlushUI();
3219
+
3220
+ cameraView.requestFocusInWindow();
3221
+
3222
+// refreshContents(true);
3223
+//
3224
+// try
3225
+// {
3226
+// java.awt.Robot bot = new java.awt.Robot();
3227
+// int mask = InputEvent.BUTTON1_MASK;
3228
+// bot.mouseMove(100, 100);
3229
+// bot.mousePress(mask);
3230
+// bot.mouseRelease(mask);
3231
+// }
3232
+// catch (Exception e)
3233
+// {
3234
+//
3235
+// }
3236
+
26173237 } else
2618
- if (event.getSource() == threeButton)
3238
+ if (source == threeButton)
26193239 {
26203240 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
3241
+
3242
+ if (CameraPane.FULLSCREEN)
3243
+ fullscreenLayout = radio.layout;
3244
+
3245
+// bigThree.remove(scenePanel);
3246
+// bigThree.remove(centralPanel);
3247
+// bigThree.remove(XYZPanel);
3248
+// aWindowConstraints.gridx = 0;
3249
+// aWindowConstraints.gridy = 0;
3250
+// aWindowConstraints.gridwidth = 1;
3251
+// // aConstraints.gridheight = 3;
3252
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3253
+// aWindowConstraints.weightx = 0;
3254
+// aWindowConstraints.weighty = 1;
3255
+// //bigThree.add(jtp, aWindowConstraints);
3256
+// aWindowConstraints.weightx = 1;
3257
+// aWindowConstraints.gridwidth = 3;
3258
+// // aConstraints.gridheight = 3;
3259
+// aWindowConstraints.gridx = 1;
3260
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3261
+// bigThree.add(centralPanel, aWindowConstraints);
3262
+// aWindowConstraints.weightx = 0;
3263
+// aWindowConstraints.gridx = 4;
3264
+// aWindowConstraints.gridwidth = 1;
3265
+// // aConstraints.gridheight = 3;
3266
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3267
+// bigThree.add(XYZPanel, aWindowConstraints);
3268
+// bigThree.validate();
3269
+// scenePanel.setVisible(false);
3270
+// centralPanel.setVisible(true);
3271
+// XYZPanel.setVisible(true);
3272
+ bigThree.ClearUI();
3273
+ bigThree.add(centralPanel);
3274
+ bigThree.add(XYZPanel);
3275
+ bigThree.FlushUI();
3276
+
3277
+ cameraView.requestFocusInWindow();
26453278 } else
2646
- if (event.getSource() == fourButton)
3279
+ if (source == fourButton)
26473280 {
26483281 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
3282
+
3283
+ if (CameraPane.FULLSCREEN)
3284
+ fullscreenLayout = radio.layout;
3285
+
3286
+// bigThree.remove(scenePanel);
3287
+// bigThree.remove(centralPanel);
3288
+// bigThree.remove(XYZPanel);
3289
+// aWindowConstraints.gridx = 0;
3290
+// aWindowConstraints.gridy = 0;
3291
+// aWindowConstraints.gridwidth = 1;
3292
+// // aWindowConstraints.gridheight = 3;
3293
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3294
+// aWindowConstraints.weightx = 1;
3295
+// aWindowConstraints.weighty = 1;
3296
+// bigThree.add(scenePanel, aWindowConstraints);
3297
+// aWindowConstraints.weightx = 1;
3298
+// aWindowConstraints.gridwidth = 3;
3299
+// // aConstraints.gridheight = 3;
3300
+// aWindowConstraints.gridx = 1;
3301
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3302
+// //bigThree.add(cameraPanel, aWindowConstraints);
3303
+// aWindowConstraints.weightx = 0;
3304
+// aWindowConstraints.gridx = 4;
3305
+// aWindowConstraints.gridwidth = 1;
3306
+// // aWindowConstraints.gridheight = 3;
3307
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3308
+// //bigThree.add(XYZPanel, aWindowConstraints);
3309
+// bigThree.validate();
3310
+// scenePanel.setVisible(true);
3311
+// centralPanel.setVisible(false);
3312
+// XYZPanel.setVisible(false);
3313
+ bigThree.ClearUI();
3314
+ bigThree.add(scenePanel);
3315
+ bigThree.FlushUI();
3316
+
3317
+ cameraView.requestFocusInWindow();
26733318 } else
2674
- if (event.getSource() == sixButton)
3319
+ if (source == sixButton)
26753320 {
26763321 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
3322
+
3323
+ if (CameraPane.FULLSCREEN)
3324
+ fullscreenLayout = radio.layout;
3325
+
3326
+// bigThree.remove(scenePanel);
3327
+// bigThree.remove(centralPanel);
3328
+// bigThree.remove(XYZPanel);
3329
+// aWindowConstraints.gridx = 0;
3330
+// aWindowConstraints.gridy = 0;
3331
+// aWindowConstraints.gridwidth = 1;
3332
+// // aConstraints.gridheight = 3;
3333
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3334
+// aWindowConstraints.weightx = 0;
3335
+// aWindowConstraints.weighty = 1;
3336
+// bigThree.add(scenePanel, aWindowConstraints);
3337
+// aWindowConstraints.weightx = 1;
3338
+// aWindowConstraints.gridwidth = 3;
3339
+// // aWindowConstraints.gridheight = 3;
3340
+// aWindowConstraints.gridx = 1;
3341
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3342
+// bigThree.add(centralPanel, aWindowConstraints);
3343
+// aWindowConstraints.weightx = 0;
3344
+// aWindowConstraints.gridx = 4;
3345
+// aWindowConstraints.gridwidth = 1;
3346
+// // aWindowConstraints.gridheight = 3;
3347
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3348
+// //bigThree.add(XYZPanel, aConstraints);
3349
+// bigThree.validate();
3350
+// scenePanel.setVisible(true);
3351
+// centralPanel.setVisible(true);
3352
+// XYZPanel.setVisible(false);
3353
+ bigThree.ClearUI();
3354
+ bigThree.add(scenePanel);
3355
+ bigThree.add(centralPanel);
3356
+ bigThree.FlushUI();
3357
+
3358
+ cameraView.requestFocusInWindow();
27013359 } else
2702
- if (event.getSource() == sevenButton)
3360
+ if (source == sevenButton)
27033361 {
27043362 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
3363
+
3364
+ if (CameraPane.FULLSCREEN)
3365
+ fullscreenLayout = radio.layout;
3366
+
3367
+// bigThree.remove(scenePanel);
3368
+// bigThree.remove(centralPanel);
3369
+// bigThree.remove(XYZPanel);
3370
+// aWindowConstraints.gridx = 0;
3371
+// aWindowConstraints.gridy = 0;
3372
+// aWindowConstraints.gridwidth = 1;
3373
+// // aWindowConstraints.gridheight = 3;
3374
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3375
+// aWindowConstraints.weightx = 0;
3376
+// aWindowConstraints.weighty = 1;
3377
+// bigThree.add(scenePanel, aWindowConstraints);
3378
+// aWindowConstraints.weightx = 1;
3379
+// aWindowConstraints.gridwidth = 3;
3380
+// // aWindowConstraints.gridheight = 3;
3381
+// aWindowConstraints.gridx = 1;
3382
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3383
+// bigThree.add(centralPanel, aWindowConstraints);
3384
+// aWindowConstraints.weightx = 0;
3385
+// aWindowConstraints.gridx = 4;
3386
+// aWindowConstraints.gridwidth = 1;
3387
+// // aConstraints.gridheight = 3;
3388
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3389
+// bigThree.add(XYZPanel, aWindowConstraints);
3390
+// bigThree.validate();
3391
+// scenePanel.setVisible(true);
3392
+// centralPanel.setVisible(true);
3393
+// XYZPanel.setVisible(true);
3394
+ bigThree.ClearUI();
3395
+ bigThree.add(scenePanel);
3396
+ bigThree.add(centralPanel);
3397
+ bigThree.add(XYZPanel);
3398
+ bigThree.FlushUI();
3399
+
3400
+ cameraView.requestFocusInWindow();
27293401 } else
2730
- if (event.getSource() == rootButton)
3402
+ if (source == rootButton)
27313403 {
27323404 Object3D obj;
27333405 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2737,66 +3409,84 @@
27373409 EditObject(obj);
27383410 }
27393411
3412
+ cameraView.requestFocusInWindow();
27403413 refreshContents(true);
27413414 } else
2742
- if (event.getSource() == closeButton)
3415
+ if (source == closeButton)
27433416 {
27443417 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453418 cRadio ab;
27463419 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27473420 {
27483421 ab = (cRadio)e.nextElement();
2749
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3422
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27503423 {
3424
+ // Patch to avoid bug with transparency.
3425
+ if (!ab.hadMaterial)
3426
+ {
3427
+ ab.object.material = null;
3428
+ }
3429
+
27513430 buttonGroup.remove(ab);
27523431 radioPanel.remove(ab);
27533432
2754
- ab.GetObject().editWindow = null;
3433
+ //ab.GetObject().editWindow = null;
3434
+ ab.GetObject().manipWindow = null;
27553435 // ab.GetObject().objectUI = null; // ?????????
27563436
27573437 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27583438 break;
27593439 }
27603440 }
3441
+
3442
+ cameraView.requestFocusInWindow();
27613443 refreshContents(true);
27623444 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3445
+ if (source == editItem || source == editButton)
27643446 {
3447
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3448
+ {
3449
+ Object3D child = (Object3D)e.nextElement();
3450
+ child.pinned = true;
3451
+ }
3452
+
27653453 EditSelection(false);
27663454 } else
2767
- if (event.getSource() == uneditButton)
3455
+ if (source == uneditButton)
27683456 {
27693457 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703458 {
27713459 Object3D child = (Object3D)e.nextElement();
27723460 if(child.editWindow != null)
27733461 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3462
+ child.pinned = false;
27743463 child.CloseUI();
27753464 listUI.remove(child);
27763465
2777
- child.editWindow = null; // ???????????
3466
+ //child.editWindow = null; // ???????????
27783467 }
2779
- objEditor.ctrlPanel.revalidate();
3468
+ objEditor.ctrlPanel.FlushUI();
27803469 //objEditor.jTree.clearSelection();
27813470 //objEditor.ResetSliders();
27823471 refreshContents(true);
27833472 } else
2784
- if (event.getSource() == clearPanelButton)
3473
+ if (source == clearPanelButton)
27853474 {
27863475 assert(copy == group);
27873476 //copy.ClearUI();
27883477 for (Object3D obj : listUI)
27893478 {
3479
+ obj.pinned = false;
27903480 obj.CloseUI();
27913481 }
27923482 listUI.clear();
27933483 refreshContents(true);
27943484 } else
2795
- if (event.getSource() == allParamsButton)
3485
+ if (source == allParamsButton)
27963486 {
27973487 assert(copy == group);
27983488
2799
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3489
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28003490
28013491 for (Object3D obj : listUI)
28023492 {
....@@ -2813,19 +3503,19 @@
28133503
28143504 refreshContents(true);
28153505 } else
2816
- if (event.getSource() == unselectButton)
3506
+ if (source == unselectButton)
28173507 {
28183508 objEditor.jTree.clearSelection();
28193509 // ?? oct 2012 GrafreeD.clipboard.clear();
28203510 objEditor.ResetSliders();
28213511 refreshContents(true);
28223512 } else
2823
- if(event.getSource() instanceof cRadio)
3513
+ if(source instanceof cRadio)
28243514 {
28253515 group.parent = keepparent;
28263516 group.attributes = 0;
28273517 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3518
+ /*cRadio*/ radio = (cRadio)source;
28293519 Object3D obj = radio.GetObject();
28303520 System.out.println("Edit " + obj);
28313521 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3535,10 @@
28453535 }
28463536
28473537 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3538
+
3539
+ SetUndoStates();
3540
+
3541
+ //Globals.theRenderer.object = group;
28493542 if(!useclient)
28503543 {
28513544 cameraView.renderCamera = radio.camera;
....@@ -2854,25 +3547,52 @@
28543547 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553548 cameraView.targetLookAt.set(radio.camera.lookAt);
28563549 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3550
+ //cameraView.lighttouched = true;
3551
+ Globals.lighttouched = true;
28583552 topView.object = group;
28593553 frontView.object = group;
28603554 sideView.object = group;
28613555 }
2862
- group.editWindow = this;
3556
+
3557
+// fix "+" issue
3558
+ //group.editWindow = this;
3559
+ group.manipWindow = this;
3560
+
28633561 /*
28643562 currentLayout = radio.layout;
28653563 if (currentLayout == null)
28663564 currentLayout = sevenButton;
28673565 */
28683566 radio.layout.doClick();
3567
+
3568
+ ClearUnpinned();
3569
+ //Grafreed.Assert(group != null);
3570
+ //Grafreed.Assert(group.selection != null);
3571
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3572
+ if (group.selection == null || group.selection.size() == 1)
3573
+ EditSelection(false);
28693574 keepparent = group.parent;
28703575 // PARENT = NULL or not???
28713576 //group.parent = null; // ROOT
28723577 //group.attributes = -1;
28733578 ResetModel();
3579
+
3580
+ cameraView.requestFocusInWindow();
28743581 refreshContents(true);
2875
- }
3582
+ } else if (event.getSource() == editCameraItem)
3583
+ {
3584
+ cameraView.ProtectCamera();
3585
+ cameraView.repaint();
3586
+ return;
3587
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3588
+ {
3589
+ cameraView.RevertCamera();
3590
+ cameraView.repaint();
3591
+ return;
3592
+ // } else if (event.getSource() == textureButton)
3593
+ // {
3594
+ // return; // true;
3595
+ }
28763596 else
28773597 {
28783598 //return super.action(event, arg);
....@@ -2881,7 +3601,6 @@
28813601 }
28823602
28833603 boolean useclient = false;
2884
- cRadio radio;
28853604
28863605 void ToggleRoot()
28873606 {
....@@ -2890,7 +3609,7 @@
28903609 if (useclient)
28913610 {
28923611 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3612
+ Globals.lighttouched = true;
28943613 //topView.object = client;
28953614 //frontView.object = client;
28963615 //sideView.object = client;
....@@ -2898,7 +3617,7 @@
28983617 else
28993618 {
29003619 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3620
+ Globals.lighttouched = true;
29023621 //topView.object = group;
29033622 //frontView.object = group;
29043623 //sideView.object = group;
....@@ -2933,6 +3652,28 @@
29333652 refreshContents();
29343653 }
29353654
3655
+ void TransformChildren()
3656
+ {
3657
+ Object3D obj;
3658
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3659
+ {
3660
+ obj = (Object3D)e.nextElement();
3661
+ obj.KeepTextureMatrices();
3662
+ obj.TransformChildren();
3663
+ obj.RestoreTextureMatrices();
3664
+
3665
+// if (obj.parent == null)
3666
+// {
3667
+// System.out.println("NULL PARENT!");
3668
+// new Exception().printStackTrace();
3669
+// }
3670
+// else
3671
+// TouchTransform(obj);
3672
+// //obj.parent.Touch();
3673
+ }
3674
+
3675
+ refreshContents();
3676
+ }
29363677
29373678 void ResetTransform()
29383679 {
....@@ -3045,7 +3786,7 @@
30453786 refreshContents();
30463787 }
30473788
3048
- void ResetCentroid()
3789
+ void ResetCentroid(boolean full)
30493790 {
30503791 Object3D obj;
30513792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3801,16 @@
30603801 LA.matIdentity(Object3D.mat);
30613802 obj.getBounds(minima, maxima, false);
30623803 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3804
+ if (full)
3805
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643806 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653807 obj.TransformMesh(Object3D.mat);
3808
+
30663809 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3810
+ if (full)
3811
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683812 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3813
+
30693814 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703815 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713816 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3839,8 @@
30943839
30953840 int size = obj.MemorySize();
30963841
3097
- System.err.println((size/1024) + " KB is the size of " + obj);
3842
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3843
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30983844 }
30993845 }
31003846 catch (Exception e)
....@@ -3131,9 +3877,9 @@
31313877 obj = (Object3D)e.nextElement();
31323878
31333879 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3880
+ Grafreed.AnalyzeObject(obj);
31353881 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3882
+ Grafreed.AnalyzeObject(obj.bRep);
31373883
31383884 // System.err.println((size/1024) + " KB is the size of " + obj);
31393885 }
....@@ -3175,6 +3921,20 @@
31753921 void GenNormals(boolean crease)
31763922 {
31773923 group.GenNormalsS(crease);
3924
+
3925
+ refreshContents();
3926
+ }
3927
+
3928
+ void GenNormalsMESH()
3929
+ {
3930
+ group.GenNormalsMeshS();
3931
+
3932
+ refreshContents();
3933
+ }
3934
+
3935
+ void GenNormalsMINE()
3936
+ {
3937
+ group.selection.GenNormalsMINE();
31783938
31793939 refreshContents();
31803940 }
....@@ -3340,8 +4100,8 @@
33404100
33414101 void ParseVertices()
33424102 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
4103
+ boolean epsequal = Grafreed.epsequal;
4104
+ Grafreed.epsequal = true;
33454105
33464106 for (int i=0; i<group.selection.size(); i++)
33474107 {
....@@ -3366,7 +4126,7 @@
33664126 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33674127 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33684128
3369
- g.add(GrafreeD.clipboard);
4129
+ g.add(Grafreed.clipboard);
33704130
33714131 buffer.add(g);
33724132 }
....@@ -3381,7 +4141,7 @@
33814141 makeSomething(buffer, i==group.selection.size()-1);
33824142 }
33834143
3384
- GrafreeD.epsequal = epsequal;
4144
+ Grafreed.epsequal = epsequal;
33854145
33864146 refreshContents();
33874147 }
....@@ -3399,7 +4159,16 @@
33994159 String pigment = Object3D.GetPigment(tex);
34004160 //String bump = Object3D.GetBump(tex);
34014161
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4162
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4163
+
4164
+ try
4165
+ {
4166
+ texturedata = Globals.theRenderer.GetTextureData(tex.pigmenttexture, pigment, false, node.texres);
4167
+ }
4168
+ catch (Exception e)
4169
+ {
4170
+ System.err.println("FAIL: " + node);
4171
+ }
34034172
34044173 double s = v.s;
34054174
....@@ -3447,12 +4216,26 @@
34474216
34484217 void Align()
34494218 {
4219
+ if (group.selection.size() == 0)
4220
+ return;
4221
+
4222
+ cVector bbmin = new cVector();
4223
+ cVector bbmax = new cVector();
4224
+
4225
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4226
+
4227
+ double dx = bbmax.x - bbmin.x;
4228
+ double dy = bbmax.y - bbmin.y;
4229
+ double dz = bbmax.z - bbmin.z;
4230
+
4231
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4232
+
34504233 for (int i=0; i<group.selection.size(); i++)
34514234 {
34524235 Object3D obj = group.selection.get(i);
34534236
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4237
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4238
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34564239 }
34574240
34584241 refreshContents();
....@@ -3473,11 +4256,11 @@
34734256
34744257 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34754258
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
4259
+ boolean random = CameraPane.SWITCH;
4260
+ CameraPane.SWITCH = false; // parse all random nodes
34784261 lowres.linkVerticesThis(null);
34794262 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
4263
+ CameraPane.SWITCH = random;
34814264
34824265 System.err.flush();
34834266
....@@ -3517,7 +4300,7 @@
35174300 return;
35184301
35194302 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
4303
+ Object3D ref = Grafreed.clipboard.get(0);
35214304
35224305 Object3D newgroup = new Object3D("Po:" + poses.name);
35234306
....@@ -3686,7 +4469,7 @@
36864469 group.selection.RelinkToSupport(); // july 2014
36874470 System.out.println("DONE.");
36884471 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4472
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904473 }
36914474
36924475 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4494,9 @@
37114494
37124495 void ClipMesh()
37134496 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4497
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154498 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4499
+ Object3D content = Grafreed.clipboard.get(0);
37174500
37184501 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194502 content = ((cGroup)content).get(0);
....@@ -3722,7 +4505,7 @@
37224505 // {
37234506 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244507 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4508
+ group.selection.ClipMesh(Grafreed.clipboard);
37264509 }
37274510 // group.selection.ClipMesh(GrafreeD.clipboard);
37284511 System.out.println("DONE.");
....@@ -3769,6 +4552,18 @@
37694552 void MarkLeaves(boolean hide)
37704553 {
37714554 group.selection.MarkLeaves(hide);
4555
+ refreshContents();
4556
+ }
4557
+
4558
+ void RewindLeaves(boolean hide)
4559
+ {
4560
+ group.selection.RewindLeaves(hide);
4561
+ refreshContents();
4562
+ }
4563
+
4564
+ void RandomLeaves(boolean hide)
4565
+ {
4566
+ group.selection.RandomLeaves(hide);
37724567 refreshContents();
37734568 }
37744569
....@@ -3843,28 +4638,25 @@
38434638 // }
38444639 // }
38454640
3846
- static boolean allparams = true;
3847
-
3848
- static Vector<Object3D> listUI = new Vector<Object3D>();
3849
-
38504641 void EditSelection(boolean newWindow)
38514642 {
4643
+ if (group.selection == null)
4644
+ {
4645
+ EditElement(group, newWindow); // ? new
4646
+ return;
4647
+ }
4648
+
38524649 // aConstraints.gridy = 0;
38534650 for (int i=0; i<group.selection.size(); i++)
38544651 {
38554652 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38564653 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3857
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4654
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584655
38594656 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4657
+ if(elem != group || !newWindow)
38614658 {
3862
- // if (!(elem instanceof Composite))
3863
- // newWindow = false;
3864
- listUI.add(elem);
3865
- elem.openEditWindow(this, newWindow); //, false);
3866
- System.out.println("edit : " + elem);
3867
- elem.editWindow.refreshContents(true); // ? new
4659
+ EditElement(elem, newWindow); // ? new
38684660 }
38694661 }
38704662 }
....@@ -3939,7 +4731,8 @@
39394731 //new Exception().printStackTrace();
39404732
39414733 freezemodel = true;
3942
-
4734
+ ClearUnpinned();
4735
+
39434736 /**/
39444737 //switch (event.id)
39454738 {
....@@ -3947,7 +4740,6 @@
39474740 //case 702: // Event.LIST_DESELECT
39484741 group.deselectAll();
39494742 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514743 if (tps != null)
39524744 {
39534745 for (int i=0; i < tps.length; i++)
....@@ -3956,33 +4748,39 @@
39564748
39574749 //if (child.parent != null)
39584750 //child.parent.addSelectee(child);
4751
+ objEditor.SetMaterial(child);
39594752 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634753 }
39644754 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4755
+// else
4756
+// {
4757
+// objEditor.SetMaterial(group); // .GetMaterial());
4758
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4759
+// System.err.println("info : " + group.GetPath());
4760
+// }
39714761
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4762
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39754763 CameraPane.flash = true;
39764764
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4765
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784766 // a camera
39794767 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4768
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4769
+ {
4770
+ CameraPane.camerachangeframe = 0; // don't refuse it
4771
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4772
+ }
4773
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4774
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844775 }
39854776
4777
+ if (tps != null && tps.length == 1)
4778
+ {
4779
+ EditSelection(false);
4780
+ }
4781
+
4782
+ SetPinStates(tps != null && tps.length > 0);
4783
+
39864784 refreshContents();
39874785 //return true;
39884786 }
....@@ -3991,6 +4789,35 @@
39914789
39924790 freezemodel = false;
39934791 }
4792
+
4793
+ void SetPinStates(boolean enabled)
4794
+ {
4795
+ editButton.setEnabled(enabled);
4796
+ uneditButton.setEnabled(enabled);
4797
+ unselectButton.setEnabled(enabled);
4798
+ flashSelectionButton.setEnabled(enabled);
4799
+ }
4800
+
4801
+ void refreshContents(boolean cp)
4802
+ {
4803
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4804
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4805
+ {
4806
+ objEditor.ClearInfo(); // .GetMaterial());
4807
+
4808
+ for (int i=0; i < group.selection.Size(); i++)
4809
+ {
4810
+ Object3D child = (Object3D) group.selection.get(i);
4811
+
4812
+ objEditor.AddInfo(child, this, true);
4813
+ System.err.println("info : " + child.GetPath());
4814
+ }
4815
+
4816
+ objEditor.SetText(); // jan 2014
4817
+ }
4818
+
4819
+ super.refreshContents(cp);
4820
+ }
39944821
39954822 void linkSomething(Object3D thing)
39964823 {
....@@ -4062,16 +4889,19 @@
40624889 {
40634890 if (group.selection.isEmpty())
40644891 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4892
+
4893
+ Grafreed.clipboardIsTempGroup = false;
40664894 Composite tGroup = null;
40674895 if (group.selection.size() > 0) // 1)
40684896 {
40694897 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4898
+ Grafreed.clipboardIsTempGroup = true;
40714899 }
40724900
40734901 if (cut)
40744902 {
4903
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4904
+// Save();
40754905 //int indices[] = jList.getSelectedIndices();
40764906 //for (int i = indices.length - 1; i >= 0; i--)
40774907 //jList.remove(indices[i]);
....@@ -4107,16 +4937,16 @@
41074937 //System.out.println("cut " + child);
41084938 //System.out.println("parent = " + child.parent);
41094939 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4940
+ if (Grafreed.clipboardIsTempGroup)
41114941 tGroup.add/*Child*/(tmp);
41124942 else
4113
- GrafreeD.clipboard = tmp;
4943
+ Grafreed.clipboard = tmp;
41144944 }
41154945 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4946
+ if (Grafreed.clipboardIsTempGroup)
41174947 tGroup.add/*Child*/(child);
41184948 else
4119
- GrafreeD.clipboard = child;
4949
+ Grafreed.clipboard = child;
41204950 }
41214951
41224952 //ResetModel();
....@@ -4148,21 +4978,23 @@
41484978 //System.out.println("cut " + elem);
41494979 //System.out.println("parent = " + elem.parent);
41504980 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4981
+ if (Grafreed.clipboardIsTempGroup)
41524982 tGroup.add/*Child*/(tmp);
41534983 else
4154
- GrafreeD.clipboard = tmp;
4984
+ Grafreed.clipboard = tmp;
41554985 }
41564986 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
41584988 tGroup.add/*Child*/(child);
41594989 else
4160
- GrafreeD.clipboard = child;
4990
+ Grafreed.clipboard = child;
41614991 }
41624992
41634993 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4994
+
4995
+ if (Grafreed.clipboardIsTempGroup)
4996
+ Grafreed.clipboard = tGroup;
4997
+
41664998 if (cut)
41674999 {
41685000 ResetModel();
....@@ -4172,11 +5004,15 @@
41725004
41735005 void paste(boolean expand)
41745006 {
5007
+ if (Globals.REPLACEONMAKE)
5008
+ Save();
5009
+ boolean keep = Globals.REPLACEONMAKE;
5010
+ Globals.REPLACEONMAKE = false;
41755011 // if (GrafreeD.clipboard == null)
41765012 // return;
41775013 boolean first = true;
41785014
4179
- if (GrafreeD.clipboardIsTempGroup)
5015
+ if (Grafreed.clipboardIsTempGroup)
41805016 {
41815017 Composite temp;
41825018
....@@ -4187,7 +5023,7 @@
41875023 temp = (Composite)Applet3D.clipboard.deepCopy();
41885024 */
41895025 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5026
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41915027 {
41925028 Object3D child = (Object3D)e.nextElement();
41935029
....@@ -4221,21 +5057,22 @@
42215057 //Object3D cb = Applet3D.clipboard;
42225058 //temp.addChild(cb);
42235059 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5060
+ assert(Grafreed.clipboard.parent == null);
5061
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5062
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5063
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5064
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42295065 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
5066
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5067
+ Grafreed.clipboard.get(0).parent = keepparent;
42325068 }
42335069
5070
+ Globals.REPLACEONMAKE = keep;
42345071 ResetModel();
42355072 refreshContents();
42365073 }
42375074
4238
- void pasteInto(boolean copyit)
5075
+ void pasteInto(boolean copyit, boolean clone)
42395076 {
42405077 // if (GrafreeD.clipboard == null)
42415078 // return;
....@@ -4264,15 +5101,22 @@
42645101 if (copyit)
42655102 {
42665103 // paste(false);
4267
- CloneClipboard(false); // sept 2014
5104
+ if (clone)
5105
+ {
5106
+ CloneClipboard(false); // sept 2014
5107
+ }
5108
+ else
5109
+ {
5110
+ paste(false);
5111
+ }
42685112 }
42695113 else
42705114 {
42715115 boolean first = true;
42725116
4273
- if (GrafreeD.clipboardIsTempGroup)
5117
+ if (Grafreed.clipboardIsTempGroup)
42745118 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
5119
+ Composite temp = (Composite)Grafreed.clipboard;
42765120 Object3D copy;
42775121 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42785122 {
....@@ -4282,7 +5126,7 @@
42825126 }
42835127 } else
42845128 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
5129
+ linkSomething(Grafreed.clipboard); //.get(0));
42865130 }
42875131 }
42885132 }
....@@ -4359,6 +5203,10 @@
43595203
43605204 void group(Object3D csg, boolean grab)
43615205 {
5206
+ if (Globals.REPLACEONMAKE)
5207
+ Save();
5208
+ boolean keep = Globals.REPLACEONMAKE;
5209
+ Globals.REPLACEONMAKE = false;
43625210 if (//false) // why??
43635211 !group.selection.isEmpty())
43645212 {
....@@ -4472,8 +5320,34 @@
44725320 //node.add(csg);
44735321 //makeSomething(node);
44745322 makeSomething(csg);
5323
+ Globals.REPLACEONMAKE = keep;
44755324 }
44765325
5326
+ void Ungroup(Object3D g)
5327
+ {
5328
+ if (Globals.REPLACEONMAKE)
5329
+ Save();
5330
+ boolean keep = Globals.REPLACEONMAKE;
5331
+ Globals.REPLACEONMAKE = false;
5332
+ if (g instanceof HiddenObject)
5333
+ {
5334
+ HiddenObject h = (HiddenObject) g;
5335
+
5336
+ for (int i=0; i<h.ActualSize(); i++)
5337
+ {
5338
+ objEditor.makeSomething(h.get(i), false);
5339
+ }
5340
+ }
5341
+ else
5342
+ {
5343
+ for (int i=0; i<g.Size(); i++)
5344
+ {
5345
+ objEditor.makeSomething(g.get(i), false);
5346
+ }
5347
+ }
5348
+ Globals.REPLACEONMAKE = keep;
5349
+ }
5350
+
44775351 void ungroup()
44785352 {
44795353 /*
....@@ -4667,21 +5541,6 @@
46675541 }
46685542 */
46695543
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855544 /*
46865545 public void Callback(Object obj)
46875546 {
....@@ -4705,26 +5564,9 @@
47055564 }
47065565 */
47075566
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255567 String GetFile(String dialogName)
47265568 {
4727
- if (GrafreeD.standAlone)
5569
+ if (Grafreed.standAlone)
47285570 {
47295571 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305572 browser.show();
....@@ -4788,10 +5630,33 @@
47885630 cButton flashSelectionButton;
47895631 cButton editButton;
47905632 cButton uneditButton;
5633
+ JCheckBox allParamsButton;
47915634 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935635 cButton unselectButton;
47945636
5637
+ cButton restoreCameraButton;
5638
+
5639
+ cButton saveButton;
5640
+ cButton oneStepButton;
5641
+
5642
+ cButton groupButton;
5643
+ cButton ungroupButton;
5644
+ cButton compositeButton;
5645
+ cButton switchButton;
5646
+ cButton loopButton;
5647
+ cButton textureButton;
5648
+
5649
+ cButton gridButton;
5650
+ cButton boxButton;
5651
+ cButton sphereButton;
5652
+ cButton coneButton;
5653
+ cButton torusButton;
5654
+ cButton superButton;
5655
+ cButton kleinButton;
5656
+ cButton particlesButton;
5657
+ cButton overlayButton;
5658
+ cButton lightButton;
5659
+
47955660 cButton screenfitButton;
47965661 cButton screenfitpointButton;
47975662 cButton snapobjectButton;
....@@ -4803,14 +5668,6 @@
48035668
48045669 cButton setsupportButton;
48055670
4806
- cButton twoButton;
4807
- cButton sixButton;
4808
- cButton threeButton;
4809
- cButton sevenButton;
4810
- cButton fourButton; // full panel
4811
- cButton oneButton; // full XYZ
4812
- //cButton currentLayout;
4813
-
48145671 //
48155672 //Composite
48165673 Object3D // to do !!
....@@ -4820,9 +5677,11 @@
48205677 //JTree jTree;
48215678 private MenuItem lookAtItem;
48225679 private MenuItem lookFromItem;
4823
- private MenuItem switchItem;
5680
+ private MenuItem switchViewItem;
48245681 private MenuItem cutItem;
4825
- private MenuItem duplicateItem;
5682
+ private MenuItem undoItem;
5683
+ private MenuItem redoItem;
5684
+ private JMenuItem duplicateItem;
48265685 private MenuItem cloneItem;
48275686 private MenuItem cloneSupportItem;
48285687 private MenuItem overwriteGeoItem;
....@@ -4833,8 +5692,9 @@
48335692 private MenuItem resetsupportItem;
48345693 private MenuItem resetreferencesItem;
48355694 private MenuItem linkverticesItem;
5695
+ private MenuItem relinkverticesItem;
48365696 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5697
+ private MenuItem resetAllItem;
48385698 private MenuItem stepAllItem;
48395699 private MenuItem revertMeshItem;
48405700 private MenuItem poseMeshItem;
....@@ -4845,15 +5705,17 @@
48455705 private MenuItem mergeGeometriesItem;
48465706 private MenuItem copyItem;
48475707 private MenuItem pasteItem;
5708
+ private MenuItem pasteIntoItem;
48485709 private MenuItem pasteLinkItem;
48495710 private MenuItem pasteCloneItem;
48505711 private MenuItem pasteExpandItem;
4851
- private MenuItem clearItem;
5712
+ private MenuItem deleteItem;
48525713 private MenuItem clearAllItem;
48535714 private MenuItem genUVItem;
48545715 private MenuItem genNormalsMESHItem;
48555716 private MenuItem genNormalsCADItem;
48565717 private MenuItem genNormalsORGANItem;
5718
+ private MenuItem genNormalsMINEItem;
48575719 private MenuItem stripifyItem;
48585720 private MenuItem unstripifyItem;
48595721 private MenuItem trimItem;
....@@ -4882,6 +5744,10 @@
48825744 private MenuItem showleavesItem;
48835745 private MenuItem markleavesItem;
48845746 private MenuItem unmarkleavesItem;
5747
+ private MenuItem rewindleavesItem;
5748
+ private MenuItem unrewindleavesItem;
5749
+ private MenuItem randomleavesItem;
5750
+ private MenuItem unrandomleavesItem;
48855751
48865752 private MenuItem flipVItem;
48875753 private MenuItem unflipVItem;
....@@ -4893,14 +5759,17 @@
48935759 private MenuItem panoTexturesItem;
48945760
48955761 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5762
+ private MenuItem resetCentroidXZItem;
48975763 private MenuItem resetTransformItem;
5764
+ private MenuItem transformGeometryItem;
5765
+ private MenuItem transformChildrenItem;
5766
+ private MenuItem hideItem;
48985767 private MenuItem grabItem;
48995768 private MenuItem backItem;
49005769 private MenuItem frontItem;
49015770 private MenuItem cameraItem;
49025771 private MenuItem compositeItem;
4903
- private MenuItem randomItem;
5772
+ private MenuItem switchItem;
49045773 private MenuItem physicsItem;
49055774 private MenuItem frameselectorItem;
49065775 private MenuItem scriptNodeItem;
....@@ -4915,6 +5784,7 @@
49155784
49165785 private MenuItem resetParentItem;
49175786 private MenuItem repairParentItem;
5787
+ private MenuItem repairShadowItem;
49185788 private MenuItem sortbysizeItem;
49195789 private MenuItem sortbynameItem;
49205790
....@@ -4935,10 +5805,11 @@
49355805 private MenuItem coneItem;
49365806 private MenuItem torusItem;
49375807 private MenuItem superItem;
5808
+ private MenuItem kleinItem;
49385809 private MenuItem blobItem;
49395810 private MenuItem latheItem;
49405811 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5812
+ private MenuItem overlayItem;
49425813 private MenuItem meshItem;
49435814 // private MenuItem meshGroupItem;
49445815 private MenuItem springItem;
....@@ -4947,6 +5818,7 @@
49475818 private MenuItem csgItem;
49485819 private MenuItem templateItem;
49495820 private MenuItem textureItem;
5821
+ private MenuItem billboardItem;
49505822 private MenuItem shadowXItem;
49515823 private MenuItem shadowYItem;
49525824 private MenuItem shadowZItem;
....@@ -4959,11 +5831,6 @@
49595831 private MenuItem doubleItem;
49605832 private MenuItem tripleItem;
49615833
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675834 private MenuItem computeAOItem;
49685835 private MenuItem recompileItem;
49695836 private MenuItem editScriptItem;
....@@ -4973,4 +5840,8 @@
49735840 private MenuItem analyzeItem;
49745841 private MenuItem dumpItem;
49755842 //boolean freezemodel = false;
5843
+
5844
+ Menu cameraMenu;
5845
+ MenuItem editCameraItem;
5846
+ MenuItem restoreCameraItem;
49765847 }