Normand Briere
2019-07-20 0a52bd4800459cd9935f360d7ca9555b6bea2146
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"));
....@@ -285,6 +431,13 @@
285431 genNormalsORGANItem.addActionListener(this);
286432 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287433 genNormalsCADItem.addActionListener(this);
434
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
435
+ genNormalsMESHItem.addActionListener(this);
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
439
+ genNormalsMINEItem.addActionListener(this);
440
+ }
288441 stripifyItem = menu.add(new MenuItem("Stripify"));
289442 stripifyItem.addActionListener(this);
290443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +459,34 @@
306459 reduce34MeshItem.addActionListener(this);
307460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308461 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
313470
314471 oe.menuBar.add(menu = new Menu("Attributes"));
315472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316473 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);
317478 menu.add("-");
318479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319480 liveleavesItem.addActionListener(this);
320481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
322485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323486 supportleavesItem.addActionListener(this);
324487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325488 unsupportleavesItem.addActionListener(this);
489
+ }
326490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327491 hideleavesItem.addActionListener(this);
328492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +495,14 @@
331495 markleavesItem.addActionListener(this);
332496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333497 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);
334506 menu.add("-");
335507 flipVItem = menu.add(new MenuItem("Flip V"));
336508 flipVItem.addActionListener(this);
....@@ -366,35 +538,41 @@
366538 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367539 sortbynameItem.addActionListener(this);
368540 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.
369548 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370549 extractGeometriesItem.addActionListener(this);
371550 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372551 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
552
+ }
377553
378554 oe.menuBar.add(menu = new Menu("Insert"));
379555 buildCreateMenu(menu);
380556
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392557 oe.menuBar.add(menu = new Menu("Tools"));
393558 buildToolsMenu(menu);
394559 }
395560
561
+
396562 void SetupUI2(ObjEditor oe)
397563 {
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
+
398576 //new Exception().printStackTrace();
399577
400578 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +601,231 @@
423601 oe.radioPanel.add(dummyButton);
424602 oe.buttonGroup.add(dummyButton);
425603 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
604
+ cGridBag copyOptionsPanel = new cGridBag();
605
+
606
+ copyOptionsPanel.preferredHeight = 1;
429607
430
- 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");
431662 liveCB.addItemListener(this);
432663
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- 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");
451670 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- 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);
458677
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
493
- trackCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
497
- screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
499678 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500679 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505680
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
512
- flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- 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));
516689
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
519
- twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521691 fourButton.addActionListener(this);
522
- 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");
523701 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
- threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
527
- 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);
528708 //
529709
530
- 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");
531712 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- 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");
534716 closeButton.addActionListener(this);
535717 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536718 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538
-
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
541
- editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545719
546
- 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");
547805 uneditButton.addActionListener(this);
548806
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- 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");
561809 allParamsButton.addActionListener(this);
562810
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- 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");
568817 unselectButton.addActionListener(this);
569818
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
+
570829 // oe.aConstraints.gridx += 1;
571830 // oe.aConstraints.weighty = 0;
572831 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +837,25 @@
578837 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579838 // gcButton.addActionListener(this);
580839
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
840
+ cGridBag jSPPanel = new cGridBag();
841
+
842
+ JScrollPane jSP;
592843 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
844
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594845 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
599
-
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
604
- colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
607
- materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
- textureCB.addItemListener(this);
611
-
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
614846
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
+
615859 //jList.addListSelectionListener(this);
616860 oe.jTree.addTreeSelectionListener(this);
617861 //jTree.setRootVisible(false);
....@@ -630,23 +874,160 @@
630874 dgr.addDragGestureListener(this);
631875 }catch(Exception e) {}
632876 */
633
- radio.layout = sevenButton;
877
+ radio.layout = sixButton; // sevenButton;
634878 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635879 }
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
+ }
6361006
6371007 void EditObject(Object3D obj)
6381008 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- 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();
6471025 }
1026
+
6481027 void SetupViews(ObjEditor oe)
6491028 {
1029
+ theFrame = this;
1030
+
6501031 oe.SetupViews();
6511032
6521033 System.out.println("SetupViews");
....@@ -655,22 +1036,28 @@
6551036 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561037 }
6571038
658
- JCheckBox liveCB;
659
- JCheckBox supportCB;
660
- JCheckBox localCB;
661
- JCheckBox crowdCB;
662
- JCheckBox smoothCB;
663
- JCheckBox fastCB;
664
- JCheckBox slowCB;
665
- JCheckBox boxCB;
666
- JCheckBox trackCB;
667
- 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;
6681052 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1053
+ cCheckBox speakerCameraCB;
1054
+ cCheckBox speakerFocusCB;
1055
+ cCheckBox debugCB;
1056
+
1057
+ cCheckBox oeilCB;
1058
+ cCheckBox shadowCB;
1059
+ cCheckBox autokeepCB;
1060
+ cCheckBox lookAtCB;
6741061
6751062 // static int COLOR = 1;
6761063 // static int MATERIAL = 2;
....@@ -678,9 +1065,9 @@
6781065
6791066 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801067
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1068
+ cCheckBox colorCB;
1069
+ cCheckBox materialCB;
1070
+ cCheckBox textureCB;
6841071
6851072 public void itemStateChanged(ItemEvent e)
6861073 {
....@@ -705,10 +1092,10 @@
7051092 dropAttributes |= Object3D.TEXTURE;
7061093 else
7071094 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1095
+ } else if(e.getSource() == liveCB)
7101096 {
7111097 cameraView.ToggleLive();
1098
+ refreshContents(false);
7121099 }
7131100 else if(e.getSource() == supportCB)
7141101 {
....@@ -744,6 +1131,10 @@
7441131 cameraView.repaint();
7451132 // refreshContents();
7461133 }
1134
+ else if(e.getSource() == zoomBoxCB)
1135
+ {
1136
+ cameraView.ToggleZoomBoxMode();
1137
+ }
7471138 else if(e.getSource() == smoothfocusCB)
7481139 {
7491140 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1160,18 @@
7691160 {
7701161 cameraView.ToggleOeil();
7711162 }
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
+ }
7721175 else if(e.getSource() == lookAtCB)
7731176 {
7741177 cameraView.ToggleLookAt();
....@@ -785,7 +1188,8 @@
7851188
7861189 /**/
7871190 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1191
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1192
+ TreePath path = objEditor.jTree.getSelectionPath();
7891193 if ((path == null) || (path.getPathCount() <= 1)) {
7901194 // We can't move the root node or an empty selection
7911195 return;
....@@ -848,8 +1252,6 @@
8481252 }
8491253 }
8501254
851
- String string = (String) object;
852
-
8531255 System.out.println("Transfer = " + object + "; drop : " + target);
8541256 // if( object instanceof java.io.File[])
8551257 // {
....@@ -857,7 +1259,11 @@
8571259 // objEditor.DropFile((java.io.File[]) object, true);
8581260 // return;
8591261 // }
860
- 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) == ':')
8611267 {
8621268 // file(s)
8631269 String[] names = string.split("\n");
....@@ -884,7 +1290,7 @@
8841290
8851291 flashIt = false;
8861292 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1293
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881294 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891295
8901296 if (group.selection.size() == 1)
....@@ -900,23 +1306,33 @@
9001306
9011307 assert target == objEditor.jTree;
9021308 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1309
+ Object3D destinationLeaf;
9031310 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1311
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051312 } catch (Exception e) {
9061313 System.out.println("destinationPath : " + destinationPath);
9071314 return;
9081315 }
9091316
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1317
+ for (int i=group.selection.size(); --i>=0;)
9111318 {
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
+// {
9121328 loadClipboard(true);
9131329 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1330
+ pasteInto(false, false);
1331
+// } else {
1332
+// loadClipboard(false);
1333
+// objEditor.jTree.setSelectionPath(destinationPath);
1334
+// pasteInto(false, false); // true); // ???
1335
+// }
9201336 }
9211337 public void dropActionChanged(DropTargetDragEvent dtde)
9221338 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1437,107 @@
10211437 {
10221438 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231439 //heightFieldItem.addActionListener(this);
1024
- gridItem = menu.add(new MenuItem("Grid"));
1025
- gridItem.addActionListener(this);
1026
- rectoidItem = menu.add(new MenuItem("Box"));
1027
- rectoidItem.addActionListener(this);
1028
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1029
- ellipsoidItem.addActionListener(this);
1030
- coneItem = menu.add(new MenuItem("Cone"));
1031
- coneItem.addActionListener(this);
1032
- torusItem = menu.add(new MenuItem("Torus"));
1033
- torusItem.addActionListener(this);
1034
- superItem = menu.add(new MenuItem("Superellipsoid"));
1035
- superItem.addActionListener(this);
1036
- particleItem = menu.add(new MenuItem("Particle system"));
1037
- 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
+ {
10381466 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391467 ragdollItem.addActionListener(this);
10401468 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411469 ragdoll2Item.addActionListener(this);
1470
+ }
10421471 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1472
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441473 meshItem.addActionListener(this);
10451474 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461475 // meshGroupItem.addActionListener(this);
1476
+ if (Globals.ADVANCED)
1477
+ {
10471478 springItem = menu.add(new MenuItem("Spring"));
10481479 springItem.addActionListener(this);
10491480 flagItem = menu.add(new MenuItem("Flag"));
10501481 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551482 blobItem = menu.add(new MenuItem("Blob"));
10561483 blobItem.addActionListener(this);
10571484 latheItem = menu.add(new MenuItem("Lathe"));
10581485 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- 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);
10611493 menu.add("-");
10621494 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631495 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1496
+// loopItem = menu.add(new MenuItem("Loop"));
1497
+// loopItem.addActionListener(this);
10661498 doubleItem = menu.add(new MenuItem("Fork"));
10671499 doubleItem.addActionListener(this);
1500
+ if (Globals.ADVANCED)
1501
+ {
10681502 tripleItem = menu.add(new MenuItem("Trident"));
10691503 tripleItem.addActionListener(this);
1504
+ }
10701505 }
10711506
10721507 void buildToolsMenu(Menu menu)
10731508 {
10741509 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751510 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1511
+ animationItem.setState(Globals.ANIMATION);
1512
+
1513
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1514
+ archiveItem.addActionListener(this);
10771515
10781516 menu.add("-");
10791517 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801518 parseverticesItem.addActionListener(this);
10811519 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821520 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1521
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841522 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871523 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881524 reduceMorphItem.addActionListener(this);
10891525 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901526 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941527 menu.add("-");
1095
-
10961528 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971529 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("-");
10981538 menu.add(analyzeItem = new MenuItem("Analyze"));
10991539 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1540
+ menu.add(dumpItem = new MenuItem("Print"));
11011541 dumpItem.addActionListener(this);
11021542 // menu.add(pathItem = new MenuItem("From-to path"));
11031543 // pathItem.addActionListener(this);
....@@ -1106,6 +1546,8 @@
11061546 resetParentItem.addActionListener(this);
11071547 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081548 repairParentItem.addActionListener(this);
1549
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1550
+ repairShadowItem.addActionListener(this);
11091551 menu.add(invariantsItem = new MenuItem("Invariants"));
11101552 invariantsItem.addActionListener(this);
11111553 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1555,7 @@
11131555 menu.add("-");
11141556 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151557 editScriptItem.addActionListener(this);
1558
+ }
11161559 }
11171560
11181561 void ScreenFit()
....@@ -1235,9 +1678,34 @@
12351678 shadow.material = new cMaterial(obj.material);
12361679 shadow.material.diffuse = 0.0001f;
12371680 shadow.material.specular = 0.0001f;
1681
+ //shadow.projectedVertices[1].x = 300;
12381682
12391683 makeSomething(shadow);
12401684 }
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
+ }
12411709
12421710 /**
12431711 * applyExample
....@@ -1441,9 +1909,9 @@
14411909
14421910 void Overwrite(int mask)
14431911 {
1444
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1912
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451913 {
1446
- Object3D content = GrafreeD.clipboard.get(0);
1914
+ Object3D content = Grafreed.clipboard.get(0);
14471915
14481916 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491917 content = ((cGroup)content).get(0);
....@@ -1466,6 +1934,7 @@
14661934 //
14671935 public void actionPerformed(ActionEvent event) // , Object arg)
14681936 {
1937
+ Object source = event.getSource();
14691938 /*
14701939 if (event.getSource() == nameField)
14711940 {
....@@ -1477,11 +1946,11 @@
14771946 }
14781947 else
14791948 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1949
+ if (source == lookAtItem || source == lookFromItem)
14811950 {
14821951 ScreenFit();
14831952 } else
1484
- if (event.getSource() == switchItem)
1953
+ if (source == switchViewItem)
14851954 {
14861955 cVector v1 = new cVector();
14871956 cVector v2 = new cVector();
....@@ -1490,11 +1959,11 @@
14901959 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911960 objEditor.cameraView.repaint();
14921961 } else
1493
- if (event.getSource() == rectoidItem)
1962
+ if (source == rectoidItem || source == boxButton)
14941963 {
14951964 makeSomething(new Box());
14961965 } else
1497
- if (event.getSource() == particleItem)
1966
+ if (source == particleItem || source == particlesButton)
14981967 {
14991968 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001969 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1984,9 @@
15151984 applyExample(particleGeom, "SMOKE");
15161985 makeSomething(particleGeom);
15171986 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1987
+ if (source == ragdollItem || source == ragdoll2Item)
15191988 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1989
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211990
15221991 ragdoll.toParent = LA.newMatrix();
15231992 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +2004,7 @@
15352004 } else
15362005 /*
15372006 */
1538
- if (event.getSource() == heightFieldItem)
2007
+ if (source == heightFieldItem)
15392008 {
15402009 Object3D obj = new Object3D();
15412010
....@@ -1573,27 +2042,31 @@
15732042
15742043 makeSomething(obj);
15752044 } else
1576
- if (event.getSource() == gridItem)
2045
+ if (source == gridItem || source == gridButton)
15772046 {
15782047 makeSomething(new Grid());
15792048 } else
1580
- if (event.getSource() == ellipsoidItem)
2049
+ if (source == ellipsoidItem || source == sphereButton)
15812050 {
15822051 makeSomething(new Sphere());
15832052 } else
1584
- if (event.getSource() == coneItem)
2053
+ if (source == coneItem || source == coneButton)
15852054 {
15862055 makeSomething(new Cone());
15872056 } else
1588
- if (event.getSource() == torusItem)
2057
+ if (source == torusItem || source == torusButton)
15892058 {
15902059 makeSomething(new Torus());
15912060 } else
1592
- if (event.getSource() == superItem)
2061
+ if (source == superItem || source == superButton)
15932062 {
15942063 makeSomething(new Superellipsoid());
15952064 } else
1596
- if (event.getSource() == blobItem)
2065
+ if (source == kleinItem || source == kleinButton)
2066
+ {
2067
+ makeSomething(new Klein());
2068
+ } else
2069
+ if (source == blobItem)
15972070 {
15982071 Blob blob = new Blob();
15992072 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2074,15 @@
16012074 //blob.retile();
16022075 makeSomething(blob);
16032076 } else
1604
- if (event.getSource() == latheItem)
2077
+ if (source == latheItem)
16052078 {
16062079 makeSomething(new Lathe());
16072080 } else
1608
- if (event.getSource() == bezierItem)
2081
+ if (source == bezierItem)
16092082 {
16102083 makeSomething(new BezierSurface());
16112084 } else
1612
- if (event.getSource() == checkerItem)
2085
+ if (source == overlayItem || source == overlayButton)
16132086 {
16142087 /*
16152088 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2097,7 @@
16242097 */
16252098 makeSomething(new Checker());
16262099 } else
1627
- if (event.getSource() == meshItem)
2100
+ if (source == meshItem)
16282101 {
16292102 Object3D itemtomake = new Object3D();
16302103 Object3D child;
....@@ -1645,35 +2118,35 @@
16452118 makeSomething(child);
16462119 }
16472120 } else
1648
- if (event.getSource() == springItem)
2121
+ if (source == springItem)
16492122 {
16502123 cSpring s = new cSpring();
16512124 s.setup();
16522125 makeSomething(s);
16532126 } else
1654
- if (event.getSource() == flagItem)
2127
+ if (source == flagItem)
16552128 {
16562129 cSpring s = new cFlag();
16572130 s.setup();
16582131 makeSomething(s);
16592132 } else
1660
- if (event.getSource() == lightItem)
2133
+ if (source == lightItem || source == lightButton)
16612134 {
16622135 makeSomething(new Light());
16632136 } else
1664
- if (event.getSource() == csgItem)
2137
+ if (source == csgItem)
16652138 {
16662139 group(new CSG());
16672140 } else
1668
- if (event.getSource() == templateItem)
2141
+ if (source == templateItem)
16692142 {
16702143 group(new cTemplate());
16712144 } else
1672
- if (event.getSource() == attributeItem)
2145
+ if (source == attributeItem)
16732146 {
16742147 makeSomething(new Attribute());
16752148 } else
1676
- if (event.getSource() == pointflowItem)
2149
+ if (source == pointflowItem)
16772150 {
16782151 makeSomething(new PointFlow());
16792152 } else
....@@ -1685,7 +2158,7 @@
16852158 } else
16862159 */
16872160
1688
- if (event.getSource() == superLoopItem)
2161
+ if (source == superLoopItem)
16892162 {
16902163 Composite g = new cGroup();
16912164 for (int i=0; i<15; i++)
....@@ -1707,30 +2180,30 @@
17072180
17082181 group(g);
17092182 } else
1710
- if (event.getSource() == loopItem)
2183
+ if (source == loopItem || source == loopButton)
17112184 {
17122185 Composite csg = new GroupLeaf();
17132186 csg.count = 5;
17142187 group(csg);
1715
- Composite child = new cGroup();
2188
+ Composite child = new cGroup("Branch");
17162189 csg.addChild(child);
17172190 child.addChild(csg);
17182191 } else
1719
- if (event.getSource() == doubleItem)
2192
+ if (source == doubleItem)
17202193 {
1721
- Composite csg = new GroupLeaf();
2194
+ Composite csg = new GroupLeaf("Fork");
17222195 csg.count = 5;
17232196 group(csg);
1724
- Composite child = new cGroup();
2197
+ Composite child = new cGroup("Branch A");
17252198 csg.addChild(child);
17262199 child.addChild(csg);
1727
- child = new cGroup();
2200
+ child = new cGroup("Branch B");
17282201 csg.addChild(child);
17292202 child.addChild(csg);
17302203 } else
1731
- if (event.getSource() == tripleItem)
2204
+ if (source == tripleItem)
17322205 {
1733
- Composite csg = new GroupLeaf();
2206
+ Composite csg = new GroupLeaf("Trident");
17342207 csg.count = 4;
17352208 group(csg);
17362209 Composite child = new cGroup();
....@@ -1743,73 +2216,98 @@
17432216 csg.addChild(child);
17442217 child.addChild(csg);
17452218 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2219
+ if (source == computeAOItem)
17482220 {
1749
- ImportGFD();
2221
+ Globals.drawMode = CameraPane.OCCLUSION;
2222
+ Globals.theRenderer.repaint();
17502223 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
2224
+ if (source == recompileItem)
17692225 {
17702226 Recompile();
17712227 refreshContents();
17722228 } else
1773
- if (event.getSource() == editScriptItem)
2229
+ if (source == editScriptItem)
17742230 {
17752231 OpenDialog();
17762232 refreshContents();
17772233 } else
1778
- if (event.getSource() == invariantsItem)
2234
+ if (source == invariantsItem)
17792235 {
17802236 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
2237
+ Grafreed.grafreeD.universe.invariants();
17822238 } else
1783
- if (event.getSource() == memoryItem)
2239
+ if (source == memoryItem)
17842240 {
17852241 //System.out.println("Invariants:");
17862242 PrintMemory();
17872243 } else
1788
- if (event.getSource() == pathItem)
2244
+ if (source == pathItem)
17892245 {
17902246 PrintPath();
17912247 } else
1792
- if (event.getSource() == analyzeItem)
2248
+ if (source == analyzeItem)
17932249 {
17942250 AnalyzeObject();
17952251 } else
1796
- if (event.getSource() == dumpItem)
2252
+ if (source == dumpItem)
17972253 {
17982254 DumpObject();
17992255 } else
1800
- if (event.getSource() == screenfitButton)
2256
+ if (source == minButton)
18012257 {
1802
- //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
+ {
18032303 ScreenFit();
18042304 } else
1805
- if (event.getSource() == screenfitpointButton)
2305
+ if (source == screenfitpointButton)
18062306 {
1807
- //Reload(lastConverter, lastFilename, true);
18082307 ScreenFitPoint();
18092308 } else
1810
- if (event.getSource() == snapobjectButton)
2309
+ if (source == snapobjectButton)
18112310 {
1812
- //Reload(lastConverter, lastFilename, true);
18132311 SnapObject();
18142312 } else
18152313 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2316,13 @@
18182316 // Recompile();
18192317 // refreshContents();
18202318 // } else
1821
- if (event.getSource() == gcButton)
2319
+ if (source == gcButton)
18222320 {
18232321 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242322 System.gc();
18252323 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262324 } else
1827
- if (event.getSource() == editLeafItem)
2325
+ if (source == editLeafItem)
18282326 {
18292327 Object3D obj;
18302328 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +2336,74 @@
18382336 }
18392337 refreshContents(true);
18402338 } else
1841
- if (event.getSource() == openWindowItem)
2339
+ if (source == openWindowItem)
18422340 {
18432341 EditSelection(true);
18442342 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2343
+ if (source == cutItem || source == clearButton)
18462344 {
18472345 loadClipboard(true);
18482346 } else
1849
- if (event.getSource() == duplicateItem)
2347
+ if (source == undoItem)
18502348 {
1851
- 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;
18522358 loadClipboard(false);
18532359 paste(false);
1854
- GrafreeD.clipboard = keep;
2360
+ Grafreed.clipboard = keep;
18552361 } else
1856
- if (event.getSource() == cloneItem)
2362
+ if (source == cloneItem)
18572363 {
18582364 CloneSelection(false);
18592365 } else
1860
- if (event.getSource() == cloneSupportItem)
2366
+ if (source == cloneSupportItem)
18612367 {
18622368 CloneSelection(true);
18632369 } else
1864
- if (event.getSource() == copyItem)
2370
+ if (source == copyItem)
18652371 {
18662372 loadClipboard(false);
18672373 } else
1868
- if (event.getSource() == pasteItem)
2374
+ if (source == pasteItem)
18692375 {
18702376 paste(false);
18712377 } else
1872
- if (event.getSource() == pasteLinkItem)
2378
+ if (source == pasteIntoItem)
18732379 {
1874
- pasteInto(false);
2380
+ pasteInto(true, false);
18752381 } else
1876
- if (event.getSource() == pasteCloneItem)
2382
+ if (source == pasteLinkItem)
18772383 {
1878
- pasteInto(true);
2384
+ pasteInto(false, false);
18792385 } else
1880
- if (event.getSource() == pasteExpandItem)
2386
+ if (source == pasteCloneItem)
2387
+ {
2388
+ pasteInto(true, true);
2389
+ } else
2390
+ if (source == pasteExpandItem)
18812391 {
18822392 paste(true);
18832393 } else
1884
- if (event.getSource() == synchronizeItem)
2394
+ if (source == synchronizeItem)
18852395 {
18862396 Overwrite(Object3D.TRANSFORM);
18872397 } else
1888
- if (event.getSource() == overwriteNameItem)
2398
+ if (source == overwriteNameItem)
18892399 {
18902400 Overwrite(Object3D.NAME);
18912401 } else
1892
- if (event.getSource() == overwriteUVItem)
2402
+ if (source == overwriteUVItem)
18932403 {
18942404 Overwrite(Object3D.UV);
18952405 } else
1896
- if (event.getSource() == overwriteMatItem)
2406
+ if (source == overwriteMatItem)
18972407 {
18982408 /* july 2015
18992409 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2423,7 @@
19132423
19142424 Overwrite(dropAttributes);
19152425 }
1916
- if (event.getSource() == overwriteGeoItem)
2426
+ if (source == overwriteGeoItem)
19172427 {
19182428 Overwrite(Object3D.GEOMETRY);
19192429 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2440,7 @@
19302440 // refreshContents();
19312441 // }
19322442 } else
1933
- if (event.getSource() == generateMeshItem)
2443
+ if (source == generateMeshItem)
19342444 {
19352445 //if (group.selection.size() == 1)
19362446 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2451,7 @@
19412451 ResetModel();
19422452 refreshContents();
19432453 } else
1944
- if (event.getSource() == extractGeometriesItem)
2454
+ if (source == extractGeometriesItem)
19452455 {
19462456 boolean one = false;
19472457
....@@ -1968,7 +2478,7 @@
19682478 ResetModel();
19692479 refreshContents();
19702480 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2481
+ if (source == cloneGeometriesItem)
19722482 {
19732483 boolean one = false;
19742484
....@@ -1994,32 +2504,37 @@
19942504 ResetModel();
19952505 refreshContents();
19962506 } else
1997
- if (event.getSource() == shareGeometriesItem)
2507
+ if (source == shareGeometriesItem)
19982508 {
19992509 boolean one = false;
20002510
20012511 if (group.selection.size() == 1)
20022512 one = true;
20032513
2514
+ Object3D merge = null;
2515
+
20042516 Object3D content = new cGroup();
20052517
20062518 for (int i=0; i<group.selection.size(); i++)
20072519 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2520
+ merge = new Merge(group.selection.get(i));
20092521
20102522 if (one)
2011
- makeSomething(sel, false);
2523
+ makeSomething(merge, false);
20122524 else
2013
- content.addChild(sel);
2525
+ content.addChild(merge);
20142526 }
20152527
20162528 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2529
+ makeSomething(content, true);
2530
+ else
2531
+ {
2532
+ ResetModel();
2533
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2534
+ refreshContents();
2535
+ }
20212536 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2537
+ if (source == mergeGeometriesItem)
20232538 {
20242539 boolean one = false;
20252540
....@@ -2049,7 +2564,7 @@
20492564 ResetModel();
20502565 refreshContents();
20512566 } else
2052
- if (event.getSource() == linkverticesItem)
2567
+ if (source == linkverticesItem)
20532568 {
20542569 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552570 // {
....@@ -2062,39 +2577,48 @@
20622577 // group.selection.get(0).setMasterThis(content); // should be identity
20632578 // refreshContents();
20642579 // }
2065
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2580
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20662581 {
2067
- Object3D content = GrafreeD.clipboard.get(0);
2582
+ Object3D content = Grafreed.clipboard.get(0);
20682583
20692584 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702585 content = ((cGroup)content).get(0);
20712586
2072
- 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));
20732588 for (int i=0; i<group.selection.size(); i++)
20742589 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2590
+ boolean random = CameraPane.SWITCH;
2591
+ CameraPane.SWITCH = false; // parse all random nodes
20772592 group.selection.get(i).linkVerticesThis(content);
20782593 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2594
+ CameraPane.SWITCH = random;
20802595 }
2081
- 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));
20822597 refreshContents();
20832598 }
20842599 } else
2085
- if (event.getSource() == resetsupportItem)
2600
+ if (source == resetsupportItem)
20862601 {
20872602 for (int i=0; i<group.selection.size(); i++)
20882603 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2604
+ boolean random = CameraPane.SWITCH;
2605
+ CameraPane.SWITCH = false; // parse all random nodes
20912606 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2607
+ CameraPane.SWITCH = random;
20932608 }
20942609
20952610 refreshContents();
20962611 } else
2097
- 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)
20982622 {
20992623 for (int i=0; i<group.selection.size(); i++)
21002624 {
....@@ -2103,11 +2627,11 @@
21032627
21042628 refreshContents();
21052629 } else
2106
- if (event.getSource() == setMasterItem)
2630
+ if (source == setMasterItem)
21072631 {
2108
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2632
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21092633 {
2110
- Object3D content = GrafreeD.clipboard.get(0);
2634
+ Object3D content = Grafreed.clipboard.get(0);
21112635
21122636 if (content instanceof cGroup && ((cGroup)content).transientlink )
21132637 content = ((cGroup)content).get(0);
....@@ -2116,13 +2640,13 @@
21162640 refreshContents();
21172641 }
21182642 } else
2119
- if (event.getSource() == poseMeshItem)
2643
+ if (source == poseMeshItem)
21202644 {
21212645 if (group.selection.size() == 1)
21222646 {
2123
- if (GrafreeD.clipboard.size() == 1)
2647
+ if (Grafreed.clipboard.size() == 1)
21242648 {
2125
- Object3D content = GrafreeD.clipboard.get(0);
2649
+ Object3D content = Grafreed.clipboard.get(0);
21262650
21272651 if (content instanceof cGroup && ((cGroup)content).transientlink )
21282652 content = ((cGroup)content).get(0);
....@@ -2135,19 +2659,19 @@
21352659 }
21362660
21372661 } else
2138
- if (event.getSource() == revertMeshItem)
2662
+ if (source == revertMeshItem)
21392663 {
21402664 RevertMeshes();
21412665 } else
2142
- if (event.getSource() == resetMeshItem)
2666
+ if (source == resetAllItem)
21432667 {
21442668 ResetAll();
21452669 } else
2146
- if (event.getSource() == stepAllItem)
2670
+ if (source == stepAllItem)
21472671 {
21482672 StepAll();
21492673 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2674
+ if (source == deleteItem) // || event.getSource() == clearButton)
21512675 {
21522676 //int indices[] = jList.getSelectedIndices();
21532677 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2679,46 @@
21552679
21562680 ClearSelection(false);
21572681 } else
2158
- if (event.getSource() == clearAllItem)
2682
+ if (source == clearAllItem)
21592683 {
21602684 ClearSelection(true);
21612685 } else
2162
- if (event.getSource() == grabItem)
2686
+ if (source == grabItem || source == groupButton)
21632687 {
2164
- group(new cGroup(), true);
2688
+ group(new cGroup(), false); // true);
21652689 } else
2166
- if (event.getSource() == frontItem)
2690
+ if (source == hideItem)
2691
+ {
2692
+ group(new HiddenObject());
2693
+ } else
2694
+ if (source == frontItem)
21672695 {
21682696 front();
21692697 } else
2170
- if (event.getSource() == backItem)
2698
+ if (source == backItem)
21712699 {
21722700 back();
21732701 } else
2174
- if (event.getSource() == cameraItem)
2702
+ if (source == cameraItem)
21752703 {
21762704 makeSomething(new Camera());
21772705 } else
2178
- if (event.getSource() == compositeItem)
2706
+ if (source == compositeItem || source == compositeButton)
21792707 {
21802708 group(new Composite());
21812709 } else
2182
- if (event.getSource() == randomItem)
2710
+ if (source == switchItem || source == switchButton)
21832711 {
21842712 RandomNode random = new RandomNode();
21852713 group(random);
21862714 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2715
+ random.name = random.get(0).name + "Switch";
21882716 } else
2189
- if (event.getSource() == physicsItem)
2717
+ if (source == physicsItem)
21902718 {
21912719 group(new PhysicsNode());
21922720 } else
2193
- if (event.getSource() == frameselectorItem)
2721
+ if (source == frameselectorItem)
21942722 {
21952723 for (int i=0; i<group.selection.size(); i++)
21962724 {
....@@ -2202,7 +2730,7 @@
22022730 ResetModel();
22032731 refreshContents();
22042732 } else
2205
- if (event.getSource() == switchGeoItem)
2733
+ if (source == switchGeoItem)
22062734 {
22072735 for (int i=0; i<group.selection.size(); i++)
22082736 {
....@@ -2214,7 +2742,7 @@
22142742 ResetModel();
22152743 refreshContents();
22162744 } else
2217
- if (event.getSource() == switchTransfoItem)
2745
+ if (source == switchTransfoItem)
22182746 {
22192747 for (int i=0; i<group.selection.size(); i++)
22202748 {
....@@ -2226,7 +2754,7 @@
22262754 ResetModel();
22272755 refreshContents();
22282756 } else
2229
- if (event.getSource() == morphItem)
2757
+ if (source == morphItem)
22302758 {
22312759 for (int i=0; i<group.selection.size(); i++)
22322760 {
....@@ -2238,7 +2766,7 @@
22382766 ResetModel();
22392767 refreshContents();
22402768 } else
2241
- if (event.getSource() == scriptNodeItem)
2769
+ if (source == scriptNodeItem)
22422770 {
22432771 boolean atleastone = false;
22442772
....@@ -2277,195 +2805,252 @@
22772805 }
22782806 }
22792807 } else
2280
- if (event.getSource() == linkerItem)
2808
+ if (source == linkerItem)
22812809 {
22822810 group(new cLinker());
22832811 } else
2284
- if (event.getSource() == textureItem)
2812
+ if (source == textureItem || source == textureButton)
22852813 {
22862814 group(new TextureNode());
22872815 } else
2288
- if (event.getSource() == shadowXItem)
2816
+ if (source == billboardItem)
2817
+ {
2818
+ group(new BillboardNode());
2819
+ } else
2820
+ if (source == shadowXItem)
22892821 {
22902822 CastShadow(0);
22912823 } else
2292
- if (event.getSource() == shadowYItem)
2824
+ if (source == shadowYItem)
22932825 {
22942826 CastShadow(1);
22952827 } else
2296
- if (event.getSource() == shadowZItem)
2828
+ if (source == shadowZItem)
22972829 {
22982830 CastShadow(2);
22992831 } else
2300
- if (event.getSource() == ungroupItem)
2832
+ if (source == ungroupItem || source == ungroupButton)
23012833 {
2302
- 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
+ }
23032856 } else
2304
- if (event.getSource() == genUVItem)
2857
+ if (source == genUVItem)
23052858 {
23062859 GenUV();
23072860 } else
2308
- if (event.getSource() == genNormalsCADItem)
2861
+ if (source == genNormalsCADItem)
23092862 {
23102863 GenNormals(true);
23112864 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2865
+ if (source == genNormalsMESHItem)
2866
+ {
2867
+ GenNormalsMESH();
2868
+ } else
2869
+ if (source == genNormalsORGANItem)
23132870 {
23142871 GenNormals(false);
23152872 } else
2316
- if (event.getSource() == stripifyItem)
2873
+ if (source == genNormalsMINEItem)
2874
+ {
2875
+ GenNormalsMINE();
2876
+ } else
2877
+ if (source == stripifyItem)
23172878 {
23182879 Stripify();
23192880 } else
2320
- if (event.getSource() == unstripifyItem)
2881
+ if (source == unstripifyItem)
23212882 {
23222883 Unstripify();
23232884 } else
2324
- if (event.getSource() == trimItem)
2885
+ if (source == trimItem)
23252886 {
23262887 Trim();
23272888 } else
2328
- if (event.getSource() == untrimItem)
2889
+ if (source == untrimItem)
23292890 {
23302891 Untrim();
23312892 } else
2332
- if (event.getSource() == clearColorsItem)
2893
+ if (source == clearColorsItem)
23332894 {
23342895 ClearColors();
23352896 } else
2336
- if (event.getSource() == clearMaterialsItem)
2897
+ if (source == clearMaterialsItem)
23372898 {
23382899 ClearMaterials();
23392900 } else
2340
- if (event.getSource() == liveleavesItem)
2901
+ if (source == liveleavesItem)
23412902 {
23422903 LiveLeaves(true);
23432904 } else
2344
- if (event.getSource() == unliveleavesItem)
2905
+ if (source == unliveleavesItem)
23452906 {
23462907 LiveLeaves(false);
23472908 } else
2348
- if (event.getSource() == supportleavesItem)
2909
+ if (source == supportleavesItem)
23492910 {
23502911 SupportLeaves(true);
23512912 } else
2352
- if (event.getSource() == unsupportleavesItem)
2913
+ if (source == unsupportleavesItem)
23532914 {
23542915 SupportLeaves(false);
23552916 } else
2356
- if (event.getSource() == hideleavesItem)
2917
+ if (source == hideleavesItem)
23572918 {
23582919 HideLeaves(true);
23592920 } else
2360
- if (event.getSource() == showleavesItem)
2921
+ if (source == showleavesItem)
23612922 {
23622923 HideLeaves(false);
23632924 } else
2364
- if (event.getSource() == markleavesItem)
2925
+ if (source == markleavesItem)
23652926 {
23662927 MarkLeaves(true);
23672928 } else
2368
- if (event.getSource() == unmarkleavesItem)
2929
+ if (source == unmarkleavesItem)
23692930 {
23702931 MarkLeaves(false);
23712932 } else
2372
- 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)
23732950 {
23742951 FlipV(true);
23752952 } else
2376
- if (event.getSource() == unflipVItem)
2953
+ if (source == unflipVItem)
23772954 {
23782955 FlipV(false);
23792956 } else
2380
- if (event.getSource() == lowTexturesItem)
2957
+ if (source == lowTexturesItem)
23812958 {
23822959 SetTexRes(0);
23832960 } else
2384
- if (event.getSource() == normalTexturesItem)
2961
+ if (source == normalTexturesItem)
23852962 {
23862963 SetTexRes(1);
23872964 } else
2388
- if (event.getSource() == highTexturesItem)
2965
+ if (source == highTexturesItem)
23892966 {
23902967 SetTexRes(2);
23912968 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2969
+ if (source == veryhighTexturesItem)
23932970 {
23942971 SetTexRes(3);
23952972 } else
2396
- if (event.getSource() == maxTexturesItem)
2973
+ if (source == maxTexturesItem)
23972974 {
23982975 SetTexRes(4);
23992976 } else
2400
- if (event.getSource() == panoTexturesItem)
2977
+ if (source == panoTexturesItem)
24012978 {
24022979 SetTexRes(5);
24032980 } else
2404
- if (event.getSource() == reverseNormalsItem)
2981
+ if (source == reverseNormalsItem)
24052982 {
24062983 ReverseNormals();
24072984 } else
2408
- if (event.getSource() == parseverticesItem)
2985
+ if (source == parseverticesItem)
24092986 {
24102987 ParseVertices();
24112988 } else
2412
- if (event.getSource() == textureFieldItem)
2989
+ if (source == textureFieldItem)
24132990 {
24142991 TextureVertices();
24152992 } else
2416
- if (event.getSource() == alignItem)
2993
+ if (source == alignItem)
24172994 {
24182995 Align();
24192996 } else
2420
- if (event.getSource() == mirrorItem)
2997
+ if (source == mirrorItem)
24212998 {
24222999 MirrorPoses();
24233000 } else
2424
- if (event.getSource() == reduceMorphItem)
3001
+ if (source == reduceMorphItem)
24253002 {
24263003 MeshReduction(false);
24273004 } else
2428
- if (event.getSource() == reduce34MorphItem)
3005
+ if (source == reduce34MorphItem)
24293006 {
24303007 MeshReduction(true);
24313008 } else
2432
- if (event.getSource() == reverseTrianglesItem)
3009
+ if (source == reverseTrianglesItem)
24333010 {
24343011 ReverseTriangles();
24353012 } else
2436
- if (event.getSource() == reduceMeshItem)
3013
+ if (source == reduceMeshItem)
24373014 {
24383015 ReduceMesh(false);
24393016 } else
2440
- if (event.getSource() == reduce34MeshItem)
3017
+ if (source == reduce34MeshItem)
24413018 {
24423019 ReduceMesh(true);
24433020 } else
2444
- if (event.getSource() == increaseMeshItem)
3021
+ if (source == increaseMeshItem)
24453022 {
24463023 IncreaseMesh();
24473024 } else
2448
- if (event.getSource() == clipMeshItem)
3025
+ if (source == clipMeshItem)
24493026 {
24503027 ClipMesh();
24513028 } else
2452
- if (event.getSource() == smoothMeshItem)
3029
+ if (source == smoothMeshItem)
24533030 {
24543031 SmoothMesh();
24553032 } else
2456
- if (event.getSource() == transformgeometryItem)
3033
+ if (source == transformGeometryItem)
24573034 {
24583035 TransformGeometry();
24593036 } else
2460
- if (event.getSource() == resetTransformItem)
3037
+ if (source == transformChildrenItem)
3038
+ {
3039
+ TransformChildren();
3040
+ } else
3041
+ if (source == resetTransformItem)
24613042 {
24623043 ResetTransform();
24633044 } else
2464
- if (event.getSource() == resetCentroidItem)
3045
+ if (source == resetCentroidItem)
24653046 {
2466
- ResetCentroid();
3047
+ ResetCentroid(true);
24673048 } else
2468
- if (event.getSource() == resetParentItem)
3049
+ if (source == resetCentroidXZItem)
3050
+ {
3051
+ ResetCentroid(false);
3052
+ } else
3053
+ if (source == resetParentItem)
24693054 {
24703055 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24713056 {
....@@ -2475,7 +3060,7 @@
24753060
24763061 refreshContents();
24773062 } else
2478
- if (event.getSource() == repairParentItem)
3063
+ if (source == repairParentItem)
24793064 {
24803065 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24813066 {
....@@ -2489,7 +3074,21 @@
24893074
24903075 refreshContents();
24913076 } else
2492
- 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)
24933092 {
24943093 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24953094 {
....@@ -2501,7 +3100,7 @@
25013100 ResetModel();
25023101 refreshContents();
25033102 } else
2504
- if (event.getSource() == sortbynameItem)
3103
+ if (source == sortbynameItem)
25053104 {
25063105 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25073106 {
....@@ -2513,7 +3112,7 @@
25133112 ResetModel();
25143113 refreshContents();
25153114 } else
2516
- if (event.getSource() == attachPigmentItem)
3115
+ if (source == attachPigmentItem)
25173116 {
25183117 String texture = GetFile("Attach pigment");
25193118 Object3D obj;
....@@ -2525,7 +3124,7 @@
25253124
25263125 refreshContents();
25273126 } else
2528
- if (event.getSource() == detachPigmentItem)
3127
+ if (source == detachPigmentItem)
25293128 {
25303129 Object3D obj;
25313130 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +3135,7 @@
25363135
25373136 refreshContents();
25383137 } else
2539
- if (event.getSource() == attachBumpItem)
3138
+ if (source == attachBumpItem)
25403139 {
25413140 String texture = GetFile("Attach bump");
25423141 Object3D obj;
....@@ -2548,7 +3147,7 @@
25483147
25493148 refreshContents();
25503149 } else
2551
- if (event.getSource() == detachBumpItem)
3150
+ if (source == detachBumpItem)
25523151 {
25533152 Object3D obj;
25543153 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +3158,7 @@
25593158
25603159 refreshContents();
25613160 } else
2562
- if (event.getSource() == pigmentBumpItem)
3161
+ if (source == pigmentBumpItem)
25633162 {
25643163 Object3D obj;
25653164 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +3169,237 @@
25703169
25713170 refreshContents();
25723171 } else
2573
- if (event.getSource() == flashSelectionButton)
3172
+ if (source == flashSelectionButton)
25743173 {
25753174 CameraPane.flash = true;
25763175 refreshContents();
25773176 } else
2578
- if (event.getSource() == oneButton)
3177
+ if (source == oneButton)
25793178 {
25803179 } else
2581
- if (event.getSource() == twoButton)
3180
+ if (source == twoButton)
25823181 {
25833182 radio.layout = twoButton;
3183
+
3184
+ if (CameraPane.FULLSCREEN)
3185
+ fullscreenLayout = radio.layout;
3186
+
25843187 // bug
25853188 //gridPanel.setDividerLocation(1.0);
25863189 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- 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
+
26113237 } else
2612
- if (event.getSource() == threeButton)
3238
+ if (source == threeButton)
26133239 {
26143240 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- 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();
26393278 } else
2640
- if (event.getSource() == fourButton)
3279
+ if (source == fourButton)
26413280 {
26423281 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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();
26673318 } else
2668
- if (event.getSource() == sixButton)
3319
+ if (source == sixButton)
26693320 {
26703321 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- 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();
26953359 } else
2696
- if (event.getSource() == sevenButton)
3360
+ if (source == sevenButton)
26973361 {
26983362 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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();
27233401 } else
2724
- if (event.getSource() == rootButton)
3402
+ if (source == rootButton)
27253403 {
27263404 Object3D obj;
27273405 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2731,66 +3409,84 @@
27313409 EditObject(obj);
27323410 }
27333411
3412
+ cameraView.requestFocusInWindow();
27343413 refreshContents(true);
27353414 } else
2736
- if (event.getSource() == closeButton)
3415
+ if (source == closeButton)
27373416 {
27383417 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27393418 cRadio ab;
27403419 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27413420 {
27423421 ab = (cRadio)e.nextElement();
2743
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3422
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27443423 {
3424
+ // Patch to avoid bug with transparency.
3425
+ if (!ab.hadMaterial)
3426
+ {
3427
+ ab.object.material = null;
3428
+ }
3429
+
27453430 buttonGroup.remove(ab);
27463431 radioPanel.remove(ab);
27473432
2748
- ab.GetObject().editWindow = null;
3433
+ //ab.GetObject().editWindow = null;
3434
+ ab.GetObject().manipWindow = null;
27493435 // ab.GetObject().objectUI = null; // ?????????
27503436
27513437 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27523438 break;
27533439 }
27543440 }
3441
+
3442
+ cameraView.requestFocusInWindow();
27553443 refreshContents(true);
27563444 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
3445
+ if (source == editItem || source == editButton)
27583446 {
3447
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3448
+ {
3449
+ Object3D child = (Object3D)e.nextElement();
3450
+ child.pinned = true;
3451
+ }
3452
+
27593453 EditSelection(false);
27603454 } else
2761
- if (event.getSource() == uneditButton)
3455
+ if (source == uneditButton)
27623456 {
27633457 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27643458 {
27653459 Object3D child = (Object3D)e.nextElement();
27663460 if(child.editWindow != null)
27673461 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3462
+ child.pinned = false;
27683463 child.CloseUI();
27693464 listUI.remove(child);
27703465
2771
- child.editWindow = null; // ???????????
3466
+ //child.editWindow = null; // ???????????
27723467 }
2773
- objEditor.ctrlPanel.revalidate();
3468
+ objEditor.ctrlPanel.FlushUI();
27743469 //objEditor.jTree.clearSelection();
27753470 //objEditor.ResetSliders();
27763471 refreshContents(true);
27773472 } else
2778
- if (event.getSource() == clearPanelButton)
3473
+ if (source == clearPanelButton)
27793474 {
27803475 assert(copy == group);
27813476 //copy.ClearUI();
27823477 for (Object3D obj : listUI)
27833478 {
3479
+ obj.pinned = false;
27843480 obj.CloseUI();
27853481 }
27863482 listUI.clear();
27873483 refreshContents(true);
27883484 } else
2789
- if (event.getSource() == allParamsButton)
3485
+ if (source == allParamsButton)
27903486 {
27913487 assert(copy == group);
27923488
2793
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3489
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27943490
27953491 for (Object3D obj : listUI)
27963492 {
....@@ -2807,19 +3503,19 @@
28073503
28083504 refreshContents(true);
28093505 } else
2810
- if (event.getSource() == unselectButton)
3506
+ if (source == unselectButton)
28113507 {
28123508 objEditor.jTree.clearSelection();
28133509 // ?? oct 2012 GrafreeD.clipboard.clear();
28143510 objEditor.ResetSliders();
28153511 refreshContents(true);
28163512 } else
2817
- if(event.getSource() instanceof cRadio)
3513
+ if(source instanceof cRadio)
28183514 {
28193515 group.parent = keepparent;
28203516 group.attributes = 0;
28213517 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3518
+ /*cRadio*/ radio = (cRadio)source;
28233519 Object3D obj = radio.GetObject();
28243520 System.out.println("Edit " + obj);
28253521 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3535,10 @@
28393535 }
28403536
28413537 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3538
+
3539
+ SetUndoStates();
3540
+
3541
+ //Globals.theRenderer.object = group;
28433542 if(!useclient)
28443543 {
28453544 cameraView.renderCamera = radio.camera;
....@@ -2848,25 +3547,52 @@
28483547 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493548 cameraView.targetLookAt.set(radio.camera.lookAt);
28503549 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3550
+ //cameraView.lighttouched = true;
3551
+ Globals.lighttouched = true;
28523552 topView.object = group;
28533553 frontView.object = group;
28543554 sideView.object = group;
28553555 }
2856
- group.editWindow = this;
3556
+
3557
+// fix "+" issue
3558
+ //group.editWindow = this;
3559
+ group.manipWindow = this;
3560
+
28573561 /*
28583562 currentLayout = radio.layout;
28593563 if (currentLayout == null)
28603564 currentLayout = sevenButton;
28613565 */
28623566 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);
28633574 keepparent = group.parent;
28643575 // PARENT = NULL or not???
28653576 //group.parent = null; // ROOT
28663577 //group.attributes = -1;
28673578 ResetModel();
3579
+
3580
+ cameraView.requestFocusInWindow();
28683581 refreshContents(true);
2869
- }
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
+ }
28703596 else
28713597 {
28723598 //return super.action(event, arg);
....@@ -2875,7 +3601,6 @@
28753601 }
28763602
28773603 boolean useclient = false;
2878
- cRadio radio;
28793604
28803605 void ToggleRoot()
28813606 {
....@@ -2884,7 +3609,7 @@
28843609 if (useclient)
28853610 {
28863611 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3612
+ Globals.lighttouched = true;
28883613 //topView.object = client;
28893614 //frontView.object = client;
28903615 //sideView.object = client;
....@@ -2892,7 +3617,7 @@
28923617 else
28933618 {
28943619 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3620
+ Globals.lighttouched = true;
28963621 //topView.object = group;
28973622 //frontView.object = group;
28983623 //sideView.object = group;
....@@ -2927,6 +3652,28 @@
29273652 refreshContents();
29283653 }
29293654
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
+ }
29303677
29313678 void ResetTransform()
29323679 {
....@@ -3039,7 +3786,7 @@
30393786 refreshContents();
30403787 }
30413788
3042
- void ResetCentroid()
3789
+ void ResetCentroid(boolean full)
30433790 {
30443791 Object3D obj;
30453792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3054,12 +3801,16 @@
30543801 LA.matIdentity(Object3D.mat);
30553802 obj.getBounds(minima, maxima, false);
30563803 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3804
+ if (full)
3805
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30583806 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30593807 obj.TransformMesh(Object3D.mat);
3808
+
30603809 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3061
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3810
+ if (full)
3811
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30623812 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3813
+
30633814 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30643815 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30653816 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3088,7 +3839,8 @@
30883839
30893840 int size = obj.MemorySize();
30903841
3091
- 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)");
30923844 }
30933845 }
30943846 catch (Exception e)
....@@ -3125,9 +3877,9 @@
31253877 obj = (Object3D)e.nextElement();
31263878
31273879 System.out.println("Object is: " + obj);
3128
- GrafreeD.AnalyzeObject(obj);
3880
+ Grafreed.AnalyzeObject(obj);
31293881 System.out.println("Boundary rep: " + obj.bRep);
3130
- GrafreeD.AnalyzeObject(obj.bRep);
3882
+ Grafreed.AnalyzeObject(obj.bRep);
31313883
31323884 // System.err.println((size/1024) + " KB is the size of " + obj);
31333885 }
....@@ -3169,6 +3921,20 @@
31693921 void GenNormals(boolean crease)
31703922 {
31713923 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();
31723938
31733939 refreshContents();
31743940 }
....@@ -3334,8 +4100,8 @@
33344100
33354101 void ParseVertices()
33364102 {
3337
- boolean epsequal = GrafreeD.epsequal;
3338
- GrafreeD.epsequal = true;
4103
+ boolean epsequal = Grafreed.epsequal;
4104
+ Grafreed.epsequal = true;
33394105
33404106 for (int i=0; i<group.selection.size(); i++)
33414107 {
....@@ -3360,7 +4126,7 @@
33604126 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33614127 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33624128
3363
- g.add(GrafreeD.clipboard);
4129
+ g.add(Grafreed.clipboard);
33644130
33654131 buffer.add(g);
33664132 }
....@@ -3375,7 +4141,7 @@
33754141 makeSomething(buffer, i==group.selection.size()-1);
33764142 }
33774143
3378
- GrafreeD.epsequal = epsequal;
4144
+ Grafreed.epsequal = epsequal;
33794145
33804146 refreshContents();
33814147 }
....@@ -3393,7 +4159,16 @@
33934159 String pigment = Object3D.GetPigment(tex);
33944160 //String bump = Object3D.GetBump(tex);
33954161
3396
- 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(pigment, false, node.texres);
4167
+ }
4168
+ catch (Exception e)
4169
+ {
4170
+ System.err.println("FAIL: " + node);
4171
+ }
33974172
33984173 double s = v.s;
33994174
....@@ -3441,12 +4216,26 @@
34414216
34424217 void Align()
34434218 {
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
+
34444233 for (int i=0; i<group.selection.size(); i++)
34454234 {
34464235 Object3D obj = group.selection.get(i);
34474236
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- 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);
34504239 }
34514240
34524241 refreshContents();
....@@ -3467,11 +4256,11 @@
34674256
34684257 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34694258
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
4259
+ boolean random = CameraPane.SWITCH;
4260
+ CameraPane.SWITCH = false; // parse all random nodes
34724261 lowres.linkVerticesThis(null);
34734262 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
4263
+ CameraPane.SWITCH = random;
34754264
34764265 System.err.flush();
34774266
....@@ -3511,7 +4300,7 @@
35114300 return;
35124301
35134302 Object3D poses = group.selection.get(0);
3514
- Object3D ref = GrafreeD.clipboard.get(0);
4303
+ Object3D ref = Grafreed.clipboard.get(0);
35154304
35164305 Object3D newgroup = new Object3D("Po:" + poses.name);
35174306
....@@ -3680,7 +4469,7 @@
36804469 group.selection.RelinkToSupport(); // july 2014
36814470 System.out.println("DONE.");
36824471 refreshContents();
3683
- 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));
36844473 }
36854474
36864475 void ReduceMesh(boolean reduction34)
....@@ -3705,9 +4494,9 @@
37054494
37064495 void ClipMesh()
37074496 {
3708
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4497
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37094498 {
3710
- Object3D content = GrafreeD.clipboard.get(0);
4499
+ Object3D content = Grafreed.clipboard.get(0);
37114500
37124501 if (content instanceof cGroup && ((cGroup)content).transientlink )
37134502 content = ((cGroup)content).get(0);
....@@ -3716,7 +4505,7 @@
37164505 // {
37174506 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37184507 // }
3719
- group.selection.ClipMesh(GrafreeD.clipboard);
4508
+ group.selection.ClipMesh(Grafreed.clipboard);
37204509 }
37214510 // group.selection.ClipMesh(GrafreeD.clipboard);
37224511 System.out.println("DONE.");
....@@ -3763,6 +4552,18 @@
37634552 void MarkLeaves(boolean hide)
37644553 {
37654554 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);
37664567 refreshContents();
37674568 }
37684569
....@@ -3837,28 +4638,25 @@
38374638 // }
38384639 // }
38394640
3840
- static boolean allparams = true;
3841
-
3842
- static Vector<Object3D> listUI = new Vector<Object3D>();
3843
-
38444641 void EditSelection(boolean newWindow)
38454642 {
4643
+ if (group.selection == null)
4644
+ {
4645
+ EditElement(group, newWindow); // ? new
4646
+ return;
4647
+ }
4648
+
38464649 // aConstraints.gridy = 0;
38474650 for (int i=0; i<group.selection.size(); i++)
38484651 {
38494652 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38504653 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3851
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4654
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38524655
38534656 Object3D elem = (Object3D)group.selection.elementAt(i);
3854
- if(elem != group)
4657
+ if(elem != group || !newWindow)
38554658 {
3856
- // if (!(elem instanceof Composite))
3857
- // newWindow = false;
3858
- listUI.add(elem);
3859
- elem.openEditWindow(this, newWindow); //, false);
3860
- System.out.println("edit : " + elem);
3861
- elem.editWindow.refreshContents(true); // ? new
4659
+ EditElement(elem, newWindow); // ? new
38624660 }
38634661 }
38644662 }
....@@ -3933,7 +4731,8 @@
39334731 //new Exception().printStackTrace();
39344732
39354733 freezemodel = true;
3936
-
4734
+ ClearUnpinned();
4735
+
39374736 /**/
39384737 //switch (event.id)
39394738 {
....@@ -3941,7 +4740,6 @@
39414740 //case 702: // Event.LIST_DESELECT
39424741 group.deselectAll();
39434742 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3944
- objEditor.ClearInfo(); // .GetMaterial());
39454743 if (tps != null)
39464744 {
39474745 for (int i=0; i < tps.length; i++)
....@@ -3950,33 +4748,39 @@
39504748
39514749 //if (child.parent != null)
39524750 //child.parent.addSelectee(child);
4751
+ objEditor.SetMaterial(child);
39534752 group.addSelectee(child);
3954
- objEditor.SetMaterial(child); // .GetMaterial());
3955
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3956
- System.err.println("info : " + child.GetPath());
39574753 }
39584754 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4755
+// else
4756
+// {
4757
+// objEditor.SetMaterial(group); // .GetMaterial());
4758
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4759
+// System.err.println("info : " + group.GetPath());
4760
+// }
39654761
3966
- objEditor.SetText(); // jan 2014
3967
-
3968
- 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))
39694763 CameraPane.flash = true;
39704764
3971
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4765
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39724766 // a camera
39734767 {
3974
- CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // 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;
39784775 }
39794776
4777
+ if (tps != null && tps.length == 1)
4778
+ {
4779
+ EditSelection(false);
4780
+ }
4781
+
4782
+ SetPinStates(tps != null && tps.length > 0);
4783
+
39804784 refreshContents();
39814785 //return true;
39824786 }
....@@ -3985,6 +4789,35 @@
39854789
39864790 freezemodel = false;
39874791 }
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
+ }
39884821
39894822 void linkSomething(Object3D thing)
39904823 {
....@@ -4056,16 +4889,19 @@
40564889 {
40574890 if (group.selection.isEmpty())
40584891 return;
4059
- GrafreeD.clipboardIsTempGroup = false;
4892
+
4893
+ Grafreed.clipboardIsTempGroup = false;
40604894 Composite tGroup = null;
40614895 if (group.selection.size() > 0) // 1)
40624896 {
40634897 tGroup = new cGroup();
4064
- GrafreeD.clipboardIsTempGroup = true;
4898
+ Grafreed.clipboardIsTempGroup = true;
40654899 }
40664900
40674901 if (cut)
40684902 {
4903
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4904
+// Save();
40694905 //int indices[] = jList.getSelectedIndices();
40704906 //for (int i = indices.length - 1; i >= 0; i--)
40714907 //jList.remove(indices[i]);
....@@ -4101,16 +4937,16 @@
41014937 //System.out.println("cut " + child);
41024938 //System.out.println("parent = " + child.parent);
41034939 // tmp.addChild(child);
4104
- if (GrafreeD.clipboardIsTempGroup)
4940
+ if (Grafreed.clipboardIsTempGroup)
41054941 tGroup.add/*Child*/(tmp);
41064942 else
4107
- GrafreeD.clipboard = tmp;
4943
+ Grafreed.clipboard = tmp;
41084944 }
41094945 else
4110
- if (GrafreeD.clipboardIsTempGroup)
4946
+ if (Grafreed.clipboardIsTempGroup)
41114947 tGroup.add/*Child*/(child);
41124948 else
4113
- GrafreeD.clipboard = child;
4949
+ Grafreed.clipboard = child;
41144950 }
41154951
41164952 //ResetModel();
....@@ -4142,21 +4978,23 @@
41424978 //System.out.println("cut " + elem);
41434979 //System.out.println("parent = " + elem.parent);
41444980 // tmp.addChild(elem);
4145
- if (GrafreeD.clipboardIsTempGroup)
4981
+ if (Grafreed.clipboardIsTempGroup)
41464982 tGroup.add/*Child*/(tmp);
41474983 else
4148
- GrafreeD.clipboard = tmp;
4984
+ Grafreed.clipboard = tmp;
41494985 }
41504986 else
4151
- if (GrafreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
41524988 tGroup.add/*Child*/(child);
41534989 else
4154
- GrafreeD.clipboard = child;
4990
+ Grafreed.clipboard = child;
41554991 }
41564992
41574993 }
4158
- if (GrafreeD.clipboardIsTempGroup)
4159
- GrafreeD.clipboard = tGroup;
4994
+
4995
+ if (Grafreed.clipboardIsTempGroup)
4996
+ Grafreed.clipboard = tGroup;
4997
+
41604998 if (cut)
41614999 {
41625000 ResetModel();
....@@ -4166,11 +5004,15 @@
41665004
41675005 void paste(boolean expand)
41685006 {
5007
+ if (Globals.REPLACEONMAKE)
5008
+ Save();
5009
+ boolean keep = Globals.REPLACEONMAKE;
5010
+ Globals.REPLACEONMAKE = false;
41695011 // if (GrafreeD.clipboard == null)
41705012 // return;
41715013 boolean first = true;
41725014
4173
- if (GrafreeD.clipboardIsTempGroup)
5015
+ if (Grafreed.clipboardIsTempGroup)
41745016 {
41755017 Composite temp;
41765018
....@@ -4181,7 +5023,7 @@
41815023 temp = (Composite)Applet3D.clipboard.deepCopy();
41825024 */
41835025 Object3D elem;
4184
- 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))
41855027 {
41865028 Object3D child = (Object3D)e.nextElement();
41875029
....@@ -4215,21 +5057,22 @@
42155057 //Object3D cb = Applet3D.clipboard;
42165058 //temp.addChild(cb);
42175059 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4218
- assert(GrafreeD.clipboard.parent == null);
4219
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
- 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());
42235065 else
4224
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
- GrafreeD.clipboard.get(0).parent = keepparent;
5066
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5067
+ Grafreed.clipboard.get(0).parent = keepparent;
42265068 }
42275069
5070
+ Globals.REPLACEONMAKE = keep;
42285071 ResetModel();
42295072 refreshContents();
42305073 }
42315074
4232
- void pasteInto(boolean copyit)
5075
+ void pasteInto(boolean copyit, boolean clone)
42335076 {
42345077 // if (GrafreeD.clipboard == null)
42355078 // return;
....@@ -4258,15 +5101,22 @@
42585101 if (copyit)
42595102 {
42605103 // paste(false);
4261
- CloneClipboard(false); // sept 2014
5104
+ if (clone)
5105
+ {
5106
+ CloneClipboard(false); // sept 2014
5107
+ }
5108
+ else
5109
+ {
5110
+ paste(false);
5111
+ }
42625112 }
42635113 else
42645114 {
42655115 boolean first = true;
42665116
4267
- if (GrafreeD.clipboardIsTempGroup)
5117
+ if (Grafreed.clipboardIsTempGroup)
42685118 {
4269
- Composite temp = (Composite)GrafreeD.clipboard;
5119
+ Composite temp = (Composite)Grafreed.clipboard;
42705120 Object3D copy;
42715121 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42725122 {
....@@ -4276,7 +5126,7 @@
42765126 }
42775127 } else
42785128 {
4279
- linkSomething(GrafreeD.clipboard); //.get(0));
5129
+ linkSomething(Grafreed.clipboard); //.get(0));
42805130 }
42815131 }
42825132 }
....@@ -4353,6 +5203,10 @@
43535203
43545204 void group(Object3D csg, boolean grab)
43555205 {
5206
+ if (Globals.REPLACEONMAKE)
5207
+ Save();
5208
+ boolean keep = Globals.REPLACEONMAKE;
5209
+ Globals.REPLACEONMAKE = false;
43565210 if (//false) // why??
43575211 !group.selection.isEmpty())
43585212 {
....@@ -4466,8 +5320,34 @@
44665320 //node.add(csg);
44675321 //makeSomething(node);
44685322 makeSomething(csg);
5323
+ Globals.REPLACEONMAKE = keep;
44695324 }
44705325
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
+
44715351 void ungroup()
44725352 {
44735353 /*
....@@ -4661,21 +5541,6 @@
46615541 }
46625542 */
46635543
4664
- void ImportGFD()
4665
- {
4666
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4667
- browser.show();
4668
- String filename = browser.getFile();
4669
- if (filename != null && filename.length() > 0)
4670
- {
4671
- String fullname = browser.getDirectory() + filename;
4672
-
4673
- //Object3D readobj =
4674
- objEditor.ReadGFD(fullname, objEditor);
4675
- //makeSomething(readobj);
4676
- }
4677
- }
4678
-
46795544 /*
46805545 public void Callback(Object obj)
46815546 {
....@@ -4699,26 +5564,9 @@
46995564 }
47005565 */
47015566
4702
- void ImportVRMLX3D()
4703
- {
4704
- if (GrafreeD.standAlone)
4705
- {
4706
- /**/
4707
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4708
- browser.show();
4709
- String filename = browser.getFile();
4710
- if (filename != null && filename.length() > 0)
4711
- {
4712
- String fullname = browser.getDirectory() + filename;
4713
- LoadVRMLX3D(fullname);
4714
- }
4715
- /**/
4716
- }
4717
- }
4718
-
47195567 String GetFile(String dialogName)
47205568 {
4721
- if (GrafreeD.standAlone)
5569
+ if (Grafreed.standAlone)
47225570 {
47235571 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47245572 browser.show();
....@@ -4782,10 +5630,33 @@
47825630 cButton flashSelectionButton;
47835631 cButton editButton;
47845632 cButton uneditButton;
5633
+ JCheckBox allParamsButton;
47855634 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875635 cButton unselectButton;
47885636
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
+
47895660 cButton screenfitButton;
47905661 cButton screenfitpointButton;
47915662 cButton snapobjectButton;
....@@ -4797,14 +5668,6 @@
47975668
47985669 cButton setsupportButton;
47995670
4800
- cButton twoButton;
4801
- cButton sixButton;
4802
- cButton threeButton;
4803
- cButton sevenButton;
4804
- cButton fourButton; // full panel
4805
- cButton oneButton; // full XYZ
4806
- //cButton currentLayout;
4807
-
48085671 //
48095672 //Composite
48105673 Object3D // to do !!
....@@ -4814,9 +5677,11 @@
48145677 //JTree jTree;
48155678 private MenuItem lookAtItem;
48165679 private MenuItem lookFromItem;
4817
- private MenuItem switchItem;
5680
+ private MenuItem switchViewItem;
48185681 private MenuItem cutItem;
4819
- private MenuItem duplicateItem;
5682
+ private MenuItem undoItem;
5683
+ private MenuItem redoItem;
5684
+ private JMenuItem duplicateItem;
48205685 private MenuItem cloneItem;
48215686 private MenuItem cloneSupportItem;
48225687 private MenuItem overwriteGeoItem;
....@@ -4827,8 +5692,9 @@
48275692 private MenuItem resetsupportItem;
48285693 private MenuItem resetreferencesItem;
48295694 private MenuItem linkverticesItem;
5695
+ private MenuItem relinkverticesItem;
48305696 private MenuItem setMasterItem;
4831
- private MenuItem resetMeshItem;
5697
+ private MenuItem resetAllItem;
48325698 private MenuItem stepAllItem;
48335699 private MenuItem revertMeshItem;
48345700 private MenuItem poseMeshItem;
....@@ -4839,14 +5705,17 @@
48395705 private MenuItem mergeGeometriesItem;
48405706 private MenuItem copyItem;
48415707 private MenuItem pasteItem;
5708
+ private MenuItem pasteIntoItem;
48425709 private MenuItem pasteLinkItem;
48435710 private MenuItem pasteCloneItem;
48445711 private MenuItem pasteExpandItem;
4845
- private MenuItem clearItem;
5712
+ private MenuItem deleteItem;
48465713 private MenuItem clearAllItem;
48475714 private MenuItem genUVItem;
5715
+ private MenuItem genNormalsMESHItem;
48485716 private MenuItem genNormalsCADItem;
48495717 private MenuItem genNormalsORGANItem;
5718
+ private MenuItem genNormalsMINEItem;
48505719 private MenuItem stripifyItem;
48515720 private MenuItem unstripifyItem;
48525721 private MenuItem trimItem;
....@@ -4875,6 +5744,10 @@
48755744 private MenuItem showleavesItem;
48765745 private MenuItem markleavesItem;
48775746 private MenuItem unmarkleavesItem;
5747
+ private MenuItem rewindleavesItem;
5748
+ private MenuItem unrewindleavesItem;
5749
+ private MenuItem randomleavesItem;
5750
+ private MenuItem unrandomleavesItem;
48785751
48795752 private MenuItem flipVItem;
48805753 private MenuItem unflipVItem;
....@@ -4886,14 +5759,17 @@
48865759 private MenuItem panoTexturesItem;
48875760
48885761 private MenuItem resetCentroidItem;
4889
- private MenuItem transformgeometryItem;
5762
+ private MenuItem resetCentroidXZItem;
48905763 private MenuItem resetTransformItem;
5764
+ private MenuItem transformGeometryItem;
5765
+ private MenuItem transformChildrenItem;
5766
+ private MenuItem hideItem;
48915767 private MenuItem grabItem;
48925768 private MenuItem backItem;
48935769 private MenuItem frontItem;
48945770 private MenuItem cameraItem;
48955771 private MenuItem compositeItem;
4896
- private MenuItem randomItem;
5772
+ private MenuItem switchItem;
48975773 private MenuItem physicsItem;
48985774 private MenuItem frameselectorItem;
48995775 private MenuItem scriptNodeItem;
....@@ -4908,6 +5784,7 @@
49085784
49095785 private MenuItem resetParentItem;
49105786 private MenuItem repairParentItem;
5787
+ private MenuItem repairShadowItem;
49115788 private MenuItem sortbysizeItem;
49125789 private MenuItem sortbynameItem;
49135790
....@@ -4928,10 +5805,11 @@
49285805 private MenuItem coneItem;
49295806 private MenuItem torusItem;
49305807 private MenuItem superItem;
5808
+ private MenuItem kleinItem;
49315809 private MenuItem blobItem;
49325810 private MenuItem latheItem;
49335811 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5812
+ private MenuItem overlayItem;
49355813 private MenuItem meshItem;
49365814 // private MenuItem meshGroupItem;
49375815 private MenuItem springItem;
....@@ -4940,6 +5818,7 @@
49405818 private MenuItem csgItem;
49415819 private MenuItem templateItem;
49425820 private MenuItem textureItem;
5821
+ private MenuItem billboardItem;
49435822 private MenuItem shadowXItem;
49445823 private MenuItem shadowYItem;
49455824 private MenuItem shadowZItem;
....@@ -4952,11 +5831,6 @@
49525831 private MenuItem doubleItem;
49535832 private MenuItem tripleItem;
49545833
4955
- private MenuItem importGFDItem;
4956
- private MenuItem importVRMLX3DItem;
4957
- private MenuItem import3DSItem;
4958
- private MenuItem importOBJItem;
4959
-
49605834 private MenuItem computeAOItem;
49615835 private MenuItem recompileItem;
49625836 private MenuItem editScriptItem;
....@@ -4966,4 +5840,8 @@
49665840 private MenuItem analyzeItem;
49675841 private MenuItem dumpItem;
49685842 //boolean freezemodel = false;
5843
+
5844
+ Menu cameraMenu;
5845
+ MenuItem editCameraItem;
5846
+ MenuItem restoreCameraItem;
49695847 }