Normand Briere
2019-07-19 e79247ef52a0bbb3864d46bb1e2c716005b3ecf3
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,7 +80,13 @@
7380 this.copy = this.group = copy;
7481 //selectees = this.group.selectees;
7582
76
- SetupMenu2(objEditor);
83
+ if (copy.versions == null)
84
+ {
85
+ copy.versions = new byte[100][];
86
+ copy.versionindex = -1;
87
+ }
88
+
89
+ SetupMenu2(this); //objEditor);
7790 SetupUI2(objEditor);
7891 objEditor.SetupUI(true);
7992 SetupViews(objEditor);
....@@ -83,7 +96,11 @@
8396
8497 void CloneSelection(boolean supports)
8598 {
86
- // Object3D keep = GraphreeD.clipboard;
99
+ if (Globals.REPLACEONMAKE)
100
+ Save();
101
+ boolean keep = Globals.REPLACEONMAKE;
102
+ Globals.REPLACEONMAKE = false;
103
+ // Object3D keep = GrafreeD.clipboard;
87104 //Object3D obj;
88105 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89106 {
....@@ -93,18 +110,19 @@
93110
94111 makeSomething(clone, i==group.selection.size()-1);
95112 }
113
+ Globals.REPLACEONMAKE = keep;
96114 }
97115
98116 void CloneClipboard(boolean supports)
99117 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));
118
+ assert(Grafreed.clipboard.parent == null);
119
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
120
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
121
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
122
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105123 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
124
+ makeSomething(CloneObject(Grafreed.clipboard, false));
125
+ Grafreed.clipboard.get(0).parent = keepparent;
108126 }
109127
110128 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +136,7 @@
118136 // obj.support = null;
119137 if (!supports)
120138 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
139
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122140 obj.parent = parent;
123141 // obj.support = support;
124142 // clone.support = support; // aout 2013
....@@ -147,30 +165,29 @@
147165
148166 //JTextField nameField;
149167
150
- void SetupMenu2(ObjEditor oe)
168
+ void SetupMenu2(GroupEditor oe)
151169 {
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);
170
+ oe.jTree = new cTree();
171
+
163172 Menu menu;
164173 oe.menuBar.add(menu = new Menu("Edit"));
165174 //editItem = menu.add(new MenuItem("Edit"));
166175 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
176
+
177
+// undoItem = menu.add(new MenuItem("Undo"));
178
+// undoItem.addActionListener(this);
179
+// redoItem = menu.add(new MenuItem("Redo"));
180
+// redoItem.addActionListener(this);
181
+// menu.add("-");
182
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168183 duplicateItem.addActionListener(this);
169
- menu.add("-");
170184 cloneItem = menu.add(new MenuItem("Clone"));
171185 cloneItem.addActionListener(this);
186
+ if (Globals.ADVANCED)
187
+ {
172188 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173189 cloneSupportItem.addActionListener(this);
190
+ }
174191 menu.add("-");
175192 cutItem = menu.add(new MenuItem("Cut"));
176193 cutItem.addActionListener(this);
....@@ -178,27 +195,123 @@
178195 copyItem.addActionListener(this);
179196 pasteItem = menu.add(new MenuItem("Paste"));
180197 pasteItem.addActionListener(this);
198
+
199
+ menu.add("-");
200
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
201
+ pasteIntoItem.addActionListener(this);
181202 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182203 pasteLinkItem.addActionListener(this);
183204 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184205 pasteCloneItem.addActionListener(this);
185206 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186207 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
208
+ menu.add("-");
209
+ deleteItem = menu.add(new MenuItem("Delete"));
210
+ deleteItem.addActionListener(this);
211
+
212
+ if (Globals.ADVANCED)
213
+ {
214
+ // Deletes the cameras...
189215 clearAllItem = menu.add(new MenuItem("Clear All"));
190216 clearAllItem.addActionListener(this);
217
+ }
218
+
219
+ menuBar.add(cameraMenu = new Menu("View"));
220
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
221
+ //zBufferItem.addActionListener(this);
222
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
223
+ //normalLensItem.addActionListener(this);
224
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
225
+ restoreCameraItem.addActionListener(this);
226
+
227
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
228
+// toggleFullScreenItem.addItemListener(this);
229
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
230
+// cameraMenu.add("-");
231
+//
232
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
233
+// toggleTextureItem.addItemListener(this);
234
+// toggleTextureItem.setState(CameraPane.textureon);
235
+//
236
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
237
+// toggleSwitchItem.addItemListener(this);
238
+// toggleSwitchItem.setState(CameraPane.SWITCH);
239
+
240
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
241
+ toggleHandleItem.addItemListener(this);
242
+ toggleHandleItem.setState(CameraPane.HANDLES);
243
+
244
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
245
+ togglePaintItem.addItemListener(this);
246
+ togglePaintItem.setState(CameraPane.PAINTMODE);
247
+
248
+ if (Globals.ADVANCED)
249
+ {
250
+ cameraMenu.add("-");
251
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
252
+ toggleLiveItem.addItemListener(this);
253
+ toggleLiveItem.setState(Globals.isLIVE());
191254
255
+ cameraMenu.add(stepItem = new MenuItem("Step"));
256
+ stepItem.addActionListener(this);
257
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
258
+ // toggleDLItem.addItemListener(this);
259
+ // toggleDLItem.setState(false);
260
+
261
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
262
+ toggleRenderItem.addItemListener(this);
263
+ toggleRenderItem.setState(!CameraPane.frozen);
264
+
265
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
266
+ toggleDebugItem.addItemListener(this);
267
+ toggleDebugItem.setState(Globals.DEBUG);
268
+
269
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
270
+ toggleFrustumItem.addItemListener(this);
271
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
272
+
273
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
274
+ toggleFootContactItem.addItemListener(this);
275
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
276
+
277
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
278
+ toggleTimelineItem.addItemListener(this);
279
+ }
280
+
281
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
282
+// toggleRootItem.addItemListener(this);
283
+// toggleRootItem.setState(false);
284
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
285
+// animationItem.addItemListener(this);
286
+// animationItem.setState(CameraPane.ANIMATION);
287
+ cameraMenu.add("-");
288
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
289
+ editCameraItem.addActionListener(this);
290
+
291
+ if (Globals.ADVANCED)
292
+ {
293
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
294
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
295
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
296
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
297
+ oe.cameraMenu.add("-");
298
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
299
+ openWindowItem.addActionListener(this);
300
+ editLeafItem.addActionListener(this);
301
+ lookAtItem.addActionListener(this);
302
+ //lookFromItem.addActinoListener(this);
303
+ //switchViewItem.addActionListener(this);
304
+ }
305
+
192306 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);
307
+ if (Globals.ADVANCED)
308
+ {
197309 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198310 revertMeshItem.addActionListener(this);
199311 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200312 resetreferencesItem.addActionListener(this);
201313 menu.add("-");
314
+ }
202315 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203316 overwriteGeoItem.addActionListener(this);
204317 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +323,104 @@
210323 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211324 overwriteUVItem.addActionListener(this);
212325 menu.add("-");
326
+ if (Globals.ADVANCED)
327
+ {
213328 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214329 generateMeshItem.addActionListener(this);
215330 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216331 poseMeshItem.addActionListener(this);
217332 menu.add("-");
333
+ }
218334 resetsupportItem = menu.add(new MenuItem("Reset support"));
219335 resetsupportItem.addActionListener(this);
220336 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221337 linkverticesItem.addActionListener(this);
338
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
339
+ relinkverticesItem.addActionListener(this);
340
+
341
+ if (Globals.ADVANCED)
342
+ {
222343 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223344 setMasterItem.addActionListener(this);
345
+ }
224346
225347 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
348
+// grabItem = menu.add(new MenuItem("Grab"));
349
+// grabItem.addActionListener(this);
230350 backItem = menu.add(new MenuItem("Back"));
231351 backItem.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);
352
+ frontItem = menu.add(new MenuItem("Front"));
353
+ frontItem.addActionListener(this);
354
+// compositeItem = menu.add(new MenuItem("Composite"));
355
+// compositeItem.addActionListener(this);
356
+
357
+ if (Globals.ADVANCED)
358
+ {
359
+ hideItem = menu.add(new MenuItem("Hidden Group"));
360
+ hideItem.addActionListener(this);
361
+ }
362
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
363
+ ungroupItem.addActionListener(this);
364
+
365
+// menu.add("-");
366
+//
367
+// switchItem = menu.add(new MenuItem("Switch node"));
368
+// switchItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
241371 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242372 switchGeoItem.addActionListener(this);
243373 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244374 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
375
+ morphItem = menu.add(new MenuItem("Morph Group"));
246376 morphItem.addActionListener(this);
377
+
378
+ menu.add("-");
379
+ physicsItem = menu.add(new MenuItem("Physics"));
380
+ physicsItem.addActionListener(this);
381
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
382
+ frameselectorItem.addActionListener(this);
247383 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248384 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
385
+ }
251386
252387 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
388
+// textureItem = menu.add(new MenuItem("Texture"));
389
+// textureItem.addActionListener(this);
390
+ billboardItem = menu.add(new MenuItem("Billboard"));
391
+ billboardItem.addActionListener(this);
255392 csgItem = menu.add(new MenuItem("CSG"));
256393 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
394
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258395 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
396
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260397 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
398
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262399 shadowZItem.addActionListener(this);
400
+ attributeItem = menu.add(new MenuItem("Attribute"));
401
+ attributeItem.addActionListener(this);
402
+
403
+ if (Globals.ADVANCED)
404
+ {
405
+ menu.add("-");
263406 linkerItem = menu.add(new MenuItem("Linker"));
264407 linkerItem.addActionListener(this);
265408 templateItem = menu.add(new MenuItem("Template"));
266409 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269410 pointflowItem = menu.add(new MenuItem("Point Flow"));
270411 pointflowItem.addActionListener(this);
412
+ }
271413 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274414 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275415 resetTransformItem.addActionListener(this);
276416 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277417 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
418
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
419
+ resetCentroidXZItem.addActionListener(this);
420
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
421
+ transformGeometryItem.addActionListener(this);
422
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
423
+ transformChildrenItem.addActionListener(this);
280424
281425 oe.menuBar.add(menu = new Menu("Geometry"));
282426 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +429,13 @@
285429 genNormalsORGANItem.addActionListener(this);
286430 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287431 genNormalsCADItem.addActionListener(this);
432
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
433
+ genNormalsMESHItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437
+ genNormalsMINEItem.addActionListener(this);
438
+ }
288439 stripifyItem = menu.add(new MenuItem("Stripify"));
289440 stripifyItem.addActionListener(this);
290441 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +457,34 @@
306457 reduce34MeshItem.addActionListener(this);
307458 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308459 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311460 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312461 clipMeshItem.addActionListener(this);
462
+
463
+ if (Globals.ADVANCED)
464
+ {
465
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
466
+ smoothMeshItem.addActionListener(this);
467
+ }
313468
314469 oe.menuBar.add(menu = new Menu("Attributes"));
315470 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316471 clearMaterialsItem.addActionListener(this);
472
+ resetAllItem = menu.add(new MenuItem("Reset All"));
473
+ resetAllItem.addActionListener(this);
474
+ stepAllItem = menu.add(new MenuItem("Step All"));
475
+ stepAllItem.addActionListener(this);
317476 menu.add("-");
318477 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319478 liveleavesItem.addActionListener(this);
320479 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321480 unliveleavesItem.addActionListener(this);
481
+ if (Globals.ADVANCED)
482
+ {
322483 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323484 supportleavesItem.addActionListener(this);
324485 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325486 unsupportleavesItem.addActionListener(this);
487
+ }
326488 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327489 hideleavesItem.addActionListener(this);
328490 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +493,14 @@
331493 markleavesItem.addActionListener(this);
332494 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333495 unmarkleavesItem.addActionListener(this);
496
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
497
+ rewindleavesItem.addActionListener(this);
498
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
499
+ unrewindleavesItem.addActionListener(this);
500
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
501
+ randomleavesItem.addActionListener(this);
502
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
503
+ unrandomleavesItem.addActionListener(this);
334504 menu.add("-");
335505 flipVItem = menu.add(new MenuItem("Flip V"));
336506 flipVItem.addActionListener(this);
....@@ -366,35 +536,41 @@
366536 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367537 sortbynameItem.addActionListener(this);
368538 menu.add("-");
539
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
540
+ shareGeometriesItem.addActionListener(this);
541
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
542
+ mergeGeometriesItem.addActionListener(this);
543
+ if (Globals.ADVANCED)
544
+ {
545
+ // Pretty much the same as duplicate and clone.
369546 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370547 extractGeometriesItem.addActionListener(this);
371548 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372549 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);
550
+ }
377551
378552 oe.menuBar.add(menu = new Menu("Insert"));
379553 buildCreateMenu(menu);
380554
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD 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
-
392555 oe.menuBar.add(menu = new Menu("Tools"));
393556 buildToolsMenu(menu);
394557 }
395558
559
+
396560 void SetupUI2(ObjEditor oe)
397561 {
562
+ // June 2019
563
+ if (oe == null)
564
+ {
565
+ //super.SetupUI2(this);
566
+ //return;
567
+ }
568
+
569
+ if (copy != group)
570
+ {
571
+ //super.SetupUI2(this);
572
+ }
573
+
398574 //new Exception().printStackTrace();
399575
400576 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +599,231 @@
423599 oe.radioPanel.add(dummyButton);
424600 oe.buttonGroup.add(dummyButton);
425601 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
602
+ cGridBag copyOptionsPanel = new cGridBag();
603
+
604
+ copyOptionsPanel.preferredHeight = 1;
429605
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
606
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
607
+
608
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ //minButton.setToolTipText("Minimize window");
610
+ //minButton.addActionListener(this);
611
+
612
+ if (Globals.ADVANCED)
613
+ {
614
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ maxButton.setToolTipText("Maximize window");
616
+ maxButton.addActionListener(this);
617
+ }
618
+
619
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ fullButton.setToolTipText("Full-screen window");
621
+ fullButton.addActionListener(this);
622
+
623
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ screenfitButton.setToolTipText("Screen fit");
625
+ screenfitButton.addActionListener(this);
626
+
627
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
628
+ restoreCameraButton.setToolTipText("Restore viewpoint");
629
+ restoreCameraButton.addActionListener(this);
630
+
631
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ saveButton.setToolTipText("New version");
633
+ saveButton.addActionListener(this);
634
+
635
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ undoButton.setToolTipText("Previous version");
637
+ undoButton.addActionListener(this);
638
+ undoButton.setEnabled(false);
639
+
640
+ cGridBag updown = new cGridBag().setVertical(true);
641
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ restoreButton.setToolTipText("Restore current");
643
+ restoreButton.addActionListener(this);
644
+ restoreButton.setEnabled(false);
645
+
646
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ replaceButton.setToolTipText("Replace current");
648
+ replaceButton.addActionListener(this);
649
+ replaceButton.setEnabled(false);
650
+
651
+ copyOptionsPanel.add(updown);
652
+
653
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ redoButton.setToolTipText("Next version");
655
+ redoButton.addActionListener(this);
656
+ redoButton.setEnabled(false);
657
+
658
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
659
+ liveCB.setToolTipText("Enable animation");
431660 liveCB.addItemListener(this);
432661
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);
662
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
+ oneStepButton.setToolTipText("Animate one step forward");
664
+ oneStepButton.addActionListener(this);
665
+
666
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
667
+ fastCB.setToolTipText("Fast mode");
451668 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);
669
+
670
+ //oe.toolboxPanel.Return();
671
+
672
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
673
+// trackCB.setToolTipText("Enable tracking");
674
+// trackCB.addItemListener(this);
458675
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;
499676 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500677 // 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;
505678
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;
679
+ if (Globals.ADVANCED)
680
+ {
681
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ snapobjectButton.addActionListener(this);
683
+ snapobjectButton.setToolTipText("Snap Object");
684
+ }
685
+
686
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
516687
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
519
- twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
688
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521689 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
690
+ fourButton.setToolTipText("Show left panel only");
691
+
692
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ twoButton.setToolTipText("Show right view only");
694
+ twoButton.addActionListener(this);
695
+ this.fullscreenLayout = twoButton;
696
+
697
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ sixButton.setToolTipText("Show left and right");
523699 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);
700
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+// threeButton.setToolTipText("2-column layout right");
702
+// threeButton.addActionListener(this);
703
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+// sevenButton.setToolTipText("3-column layout");
705
+// sevenButton.addActionListener(this);
528706 //
529707
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
708
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ rootButton.setToolTipText("Open selection in new tab");
531710 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
711
+
712
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ closeButton.setToolTipText("Close tab");
534714 closeButton.addActionListener(this);
535715 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536716 //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;
545717
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
718
+ // INSERT
719
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
720
+ gridButton.setToolTipText("Create grid");
721
+ gridButton.addActionListener(this);
722
+
723
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ boxButton.setToolTipText("Create box");
725
+ boxButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
728
+ sphereButton.setToolTipText("Create sphere");
729
+ sphereButton.addActionListener(this);
730
+
731
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
732
+ coneButton.setToolTipText("Create cone");
733
+ coneButton.addActionListener(this);
734
+
735
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+ torusButton.setToolTipText("Create torus");
737
+ torusButton.addActionListener(this);
738
+
739
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
740
+ superButton.setToolTipText("Create superellipsoid");
741
+ superButton.addActionListener(this);
742
+
743
+ if (Globals.ADVANCED)
744
+ {
745
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
746
+ kleinButton.setToolTipText("Create Klein bottle");
747
+ kleinButton.addActionListener(this);
748
+ }
749
+
750
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
751
+ particlesButton.setToolTipText("Create particle system");
752
+ particlesButton.addActionListener(this);
753
+
754
+ oe.toolboxPanel.Return();
755
+
756
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
757
+ groupButton.setToolTipText("Create group");
758
+ groupButton.addActionListener(this);
759
+
760
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
761
+ compositeButton.setToolTipText("Create composite");
762
+ compositeButton.addActionListener(this);
763
+
764
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
765
+ switchButton.setToolTipText("Create item switcher");
766
+ switchButton.addActionListener(this);
767
+
768
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
769
+ loopButton.setToolTipText("Create loop");
770
+ loopButton.addActionListener(this);
771
+
772
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
773
+ textureButton.setToolTipText("Create texture");
774
+ textureButton.addActionListener(this);
775
+
776
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
777
+ overlayButton.setToolTipText("Create overlay");
778
+ overlayButton.addActionListener(this);
779
+
780
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
781
+ lightButton.setToolTipText("Create light");
782
+ lightButton.addActionListener(this);
783
+
784
+ for (int i=6; --i>=0;)
785
+ {
786
+ oe.toolboxPanel.Return();
787
+ oe.toolboxPanel.add(new cGridBag());
788
+ oe.toolboxPanel.add(new cGridBag());
789
+ oe.toolboxPanel.add(new cGridBag());
790
+ oe.toolboxPanel.add(new cGridBag());
791
+ oe.toolboxPanel.add(new cGridBag());
792
+ oe.toolboxPanel.add(new cGridBag());
793
+ oe.toolboxPanel.add(new cGridBag());
794
+ }
795
+
796
+ // EDIT panel
797
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
798
+ editButton.setToolTipText("Pin selection controls");
799
+ editButton.addActionListener(this);
800
+
801
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
802
+ uneditButton.setToolTipText("Remove selection controls");
547803 uneditButton.addActionListener(this);
548804
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);
805
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
806
+ allParamsButton.setToolTipText("Show all controle");
561807 allParamsButton.addActionListener(this);
562808
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);
809
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
810
+ clearPanelButton.setToolTipText("Clear edit panel");
811
+ clearPanelButton.addActionListener(this);
812
+
813
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
814
+ unselectButton.setToolTipText("Unselect");
568815 unselectButton.addActionListener(this);
569816
817
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
818
+ flashSelectionButton.setToolTipText("Highlight selection");
819
+ flashSelectionButton.addActionListener(this);
820
+
821
+ editCommandsPanel.preferredHeight = 1;
822
+
823
+ SetPinStates(false);
824
+// oe.treePanel.add(commandsPanel);
825
+// oe.treePanel.Return();
826
+
570827 // oe.aConstraints.gridx += 1;
571828 // oe.aConstraints.weighty = 0;
572829 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +835,25 @@
578835 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579836 // gcButton.addActionListener(this);
580837
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;
838
+ cGridBag jSPPanel = new cGridBag();
839
+
840
+ JScrollPane jSP;
592841 //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);
842
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594843 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;
614844
845
+ oe.treePanel.add(jSPPanel);
846
+ oe.treePanel.Return();
847
+
848
+ oe.treePanel.add(copyOptionsPanel);
849
+ oe.treePanel.Return();
850
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
851
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
852
+ sliderPane.preferredHeight = 1;
853
+
854
+// mainPanel.setDividerLocation(0.5); //1.0);
855
+// mainPanel.setResizeWeight(0.5);
856
+
615857 //jList.addListSelectionListener(this);
616858 oe.jTree.addTreeSelectionListener(this);
617859 //jTree.setRootVisible(false);
....@@ -630,23 +872,160 @@
630872 dgr.addDragGestureListener(this);
631873 }catch(Exception e) {}
632874 */
633
- radio.layout = sevenButton;
875
+ radio.layout = sixButton; // sevenButton;
634876 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635877 }
878
+
879
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
880
+ {
881
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
882
+ colorCB.setToolTipText("Copy color when dropped");
883
+ colorCB.addItemListener(this);
884
+
885
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
886
+ materialCB.setToolTipText("Copy material when dropped");
887
+ materialCB.addItemListener(this);
888
+
889
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
890
+ textureCB.setToolTipText("Copy texture when dropped");
891
+ textureCB.addItemListener(this);
892
+
893
+ panel.Return();
894
+
895
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
896
+ boxCB.setToolTipText("Display bounding boxes");
897
+ boxCB.addItemListener(this);
898
+
899
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
900
+ zoomBoxCB.setToolTipText("Display only for wheel");
901
+ zoomBoxCB.addItemListener(this);
902
+
903
+ if (true) // Globals.ADVANCED)
904
+ {
905
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
906
+// supportCB.setToolTipText("Enable rigging");
907
+// supportCB.addItemListener(this);
908
+
909
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
910
+ freezeCB.setToolTipText("Fast moving camera");
911
+ freezeCB.addItemListener(this);
912
+
913
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
914
+ // localCB.addItemListener(this);
915
+
916
+ panel.Return();
917
+
918
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
919
+ crowdCB.setToolTipText("Used for crowds");
920
+ crowdCB.addItemListener(this);
921
+
922
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
923
+ smoothCB.setToolTipText("Snapping delay");
924
+ smoothCB.addItemListener(this);
925
+
926
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
927
+ slowCB.setToolTipText("Smooth interpolation");
928
+ slowCB.addItemListener(this);
929
+
930
+// constraints.gridy += 1;
931
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
932
+// speakerMocapCB.addItemListener(this);
933
+
934
+ panel.Return();
935
+
936
+ if (false)
937
+ {
938
+ // handled in scripts
939
+ //constraints.gridy += 1;
940
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
941
+ speakerCameraCB.addItemListener(this);
942
+
943
+ //constraints.gridy += 1;
944
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
945
+ speakerFocusCB.addItemListener(this);
946
+
947
+ //constraints.gridy += 1;
948
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
949
+ smoothfocusCB.addItemListener(this);
950
+ panel.Return();
951
+ }
952
+
953
+//constraints.gridx += 1;
954
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
955
+// debugCB.addItemListener(this);
956
+
957
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
958
+ trackCB.setToolTipText("Enable tracking target");
959
+ trackCB.addItemListener(this);
960
+
961
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
962
+ oeilCB.setToolTipText("Move camera when tracking");
963
+ oeilCB.addItemListener(this);
964
+
965
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
966
+ shadowCB.setToolTipText("When live compute shadows");
967
+ shadowCB.addItemListener(this);
968
+
969
+ panel.Return();
970
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
971
+ toggleTextureCB.setToolTipText("Load textures");
972
+ toggleTextureCB.addItemListener(this);
973
+
974
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
975
+ toggleSwitchCB.setToolTipText("Choose a single item");
976
+ toggleSwitchCB.addItemListener(this);
977
+
978
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
979
+ autokeepCB.setToolTipText("On structure change");
980
+ autokeepCB.addItemListener(this);
981
+
982
+ panel.Return();
983
+ if (Globals.ADVANCED)
984
+ {
985
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
986
+ lookAtCB.setToolTipText("Look-at target");
987
+ lookAtCB.addItemListener(this);
988
+ }
989
+
990
+ }
991
+
992
+ cGridBag fill = new cGridBag();
993
+ fill.preferredHeight = 200;
994
+ cGridBag fill2 = new cGridBag();
995
+ fill2.preferredHeight = 200;
996
+ cGridBag fill3 = new cGridBag();
997
+ fill3.preferredHeight = 200;
998
+
999
+ panel.add(fill);
1000
+ panel.add(fill2);
1001
+ panel.add(fill3);
1002
+
1003
+ }
6361004
6371005 void EditObject(Object3D obj)
6381006 {
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();
1007
+ cRadio radioButton = new cRadio(obj.name);
1008
+
1009
+ // June 2019. Patch to avoid bug with transparency.
1010
+ radioButton.hadMaterial = obj.material != null;
1011
+ if (!radioButton.hadMaterial)
1012
+ {
1013
+ obj.material = new cMaterial();
1014
+ }
1015
+
1016
+ radioButton.SetObject(obj);
1017
+ radioButton.layout = sixButton; // sevenButton;
1018
+ radioButton.SetCamera(cameraView.renderCamera, false);
1019
+ radioButton.addActionListener(this);
1020
+ radioPanel.add(radioButton);
1021
+ buttonGroup.add(radioButton);
1022
+ radioButton.doClick();
6471023 }
1024
+
6481025 void SetupViews(ObjEditor oe)
6491026 {
1027
+ theFrame = this;
1028
+
6501029 oe.SetupViews();
6511030
6521031 System.out.println("SetupViews");
....@@ -655,22 +1034,28 @@
6551034 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561035 }
6571036
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;
1037
+ cToggleButton liveCB;
1038
+ cCheckBox supportCB;
1039
+ cCheckBox localCB;
1040
+ cCheckBox crowdCB;
1041
+ cCheckBox smoothCB;
1042
+ cToggleButton fastCB;
1043
+ cCheckBox slowCB;
1044
+ cCheckBox boxCB;
1045
+ cCheckBox zoomBoxCB;
1046
+ cCheckBox freezeCB;
1047
+ //cToggleButton trackCB;
1048
+ cCheckBox trackCB;
1049
+ cCheckBox smoothfocusCB;
6681050 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1051
+ cCheckBox speakerCameraCB;
1052
+ cCheckBox speakerFocusCB;
1053
+ cCheckBox debugCB;
1054
+
1055
+ cCheckBox oeilCB;
1056
+ cCheckBox shadowCB;
1057
+ cCheckBox autokeepCB;
1058
+ cCheckBox lookAtCB;
6741059
6751060 // static int COLOR = 1;
6761061 // static int MATERIAL = 2;
....@@ -678,9 +1063,9 @@
6781063
6791064 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801065
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1066
+ cCheckBox colorCB;
1067
+ cCheckBox materialCB;
1068
+ cCheckBox textureCB;
6841069
6851070 public void itemStateChanged(ItemEvent e)
6861071 {
....@@ -705,10 +1090,10 @@
7051090 dropAttributes |= Object3D.TEXTURE;
7061091 else
7071092 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1093
+ } else if(e.getSource() == liveCB)
7101094 {
7111095 cameraView.ToggleLive();
1096
+ refreshContents(false);
7121097 }
7131098 else if(e.getSource() == supportCB)
7141099 {
....@@ -744,6 +1129,10 @@
7441129 cameraView.repaint();
7451130 // refreshContents();
7461131 }
1132
+ else if(e.getSource() == zoomBoxCB)
1133
+ {
1134
+ cameraView.ToggleZoomBoxMode();
1135
+ }
7471136 else if(e.getSource() == smoothfocusCB)
7481137 {
7491138 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1158,18 @@
7691158 {
7701159 cameraView.ToggleOeil();
7711160 }
1161
+ else if(e.getSource() == shadowCB)
1162
+ {
1163
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1164
+ }
1165
+ else if(e.getSource() == freezeCB)
1166
+ {
1167
+ Globals.FREEZEONMOVE ^= true;
1168
+ }
1169
+ else if(e.getSource() == autokeepCB)
1170
+ {
1171
+ Globals.REPLACEONMAKE ^= true;
1172
+ }
7721173 else if(e.getSource() == lookAtCB)
7731174 {
7741175 cameraView.ToggleLookAt();
....@@ -785,7 +1186,8 @@
7851186
7861187 /**/
7871188 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1189
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1190
+ TreePath path = objEditor.jTree.getSelectionPath();
7891191 if ((path == null) || (path.getPathCount() <= 1)) {
7901192 // We can't move the root node or an empty selection
7911193 return;
....@@ -848,8 +1250,6 @@
8481250 }
8491251 }
8501252
851
- String string = (String) object;
852
-
8531253 System.out.println("Transfer = " + object + "; drop : " + target);
8541254 // if( object instanceof java.io.File[])
8551255 // {
....@@ -857,7 +1257,11 @@
8571257 // objEditor.DropFile((java.io.File[]) object, true);
8581258 // return;
8591259 // }
860
- if (string.charAt(0) == '/')
1260
+
1261
+ String string = object.toString();
1262
+
1263
+ // File path for Mac and Windows
1264
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611265 {
8621266 // file(s)
8631267 String[] names = string.split("\n");
....@@ -884,7 +1288,7 @@
8841288
8851289 flashIt = false;
8861290 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1291
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881292 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891293
8901294 if (group.selection.size() == 1)
....@@ -900,23 +1304,33 @@
9001304
9011305 assert target == objEditor.jTree;
9021306 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1307
+ Object3D destinationLeaf;
9031308 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1309
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051310 } catch (Exception e) {
9061311 System.out.println("destinationPath : " + destinationPath);
9071312 return;
9081313 }
9091314
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1315
+ for (int i=group.selection.size(); --i>=0;)
9111316 {
1317
+ Object3D child = (Object3D)group.selection.elementAt(i);
1318
+
1319
+ // Cannot move into itself
1320
+ if (child == destinationLeaf)
1321
+ return;
1322
+ }
1323
+
1324
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1325
+// {
9121326 loadClipboard(true);
9131327 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1328
+ pasteInto(false, false);
1329
+// } else {
1330
+// loadClipboard(false);
1331
+// objEditor.jTree.setSelectionPath(destinationPath);
1332
+// pasteInto(false, false); // true); // ???
1333
+// }
9201334 }
9211335 public void dropActionChanged(DropTargetDragEvent dtde)
9221336 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1435,107 @@
10211435 {
10221436 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231437 //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);
1438
+// gridItem = menu.add(new MenuItem("Grid"));
1439
+// gridItem.addActionListener(this);
1440
+// rectoidItem = menu.add(new MenuItem("Box"));
1441
+// rectoidItem.addActionListener(this);
1442
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1443
+// ellipsoidItem.addActionListener(this);
1444
+// coneItem = menu.add(new MenuItem("Cone"));
1445
+// coneItem.addActionListener(this);
1446
+// torusItem = menu.add(new MenuItem("Torus"));
1447
+// torusItem.addActionListener(this);
1448
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1449
+// superItem.addActionListener(this);
1450
+
1451
+ cameraItem = menu.add(new MenuItem("Camera"));
1452
+ cameraItem.addActionListener(this);
1453
+
1454
+ if (!Globals.ADVANCED)
1455
+ {
1456
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1457
+ kleinItem.addActionListener(this);
1458
+ }
1459
+
1460
+// particleItem = menu.add(new MenuItem("Particle system"));
1461
+// particleItem.addActionListener(this);
1462
+ if (Globals.ADVANCED)
1463
+ {
10381464 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391465 ragdollItem.addActionListener(this);
10401466 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411467 ragdoll2Item.addActionListener(this);
1468
+ }
10421469 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1470
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441471 meshItem.addActionListener(this);
10451472 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461473 // meshGroupItem.addActionListener(this);
1474
+ if (Globals.ADVANCED)
1475
+ {
10471476 springItem = menu.add(new MenuItem("Spring"));
10481477 springItem.addActionListener(this);
10491478 flagItem = menu.add(new MenuItem("Flag"));
10501479 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);
10551480 blobItem = menu.add(new MenuItem("Blob"));
10561481 blobItem.addActionListener(this);
10571482 latheItem = menu.add(new MenuItem("Lathe"));
10581483 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1484
+ }
1485
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1486
+ bezierItem.addActionListener(this);
1487
+// overlayItem = menu.add(new MenuItem("Overlay"));
1488
+// overlayItem.addActionListener(this);
1489
+// lightItem = menu.add(new MenuItem("Light"));
1490
+// lightItem.addActionListener(this);
10611491 menu.add("-");
10621492 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631493 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1494
+// loopItem = menu.add(new MenuItem("Loop"));
1495
+// loopItem.addActionListener(this);
10661496 doubleItem = menu.add(new MenuItem("Fork"));
10671497 doubleItem.addActionListener(this);
1498
+ if (Globals.ADVANCED)
1499
+ {
10681500 tripleItem = menu.add(new MenuItem("Trident"));
10691501 tripleItem.addActionListener(this);
1502
+ }
10701503 }
10711504
10721505 void buildToolsMenu(Menu menu)
10731506 {
10741507 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751508 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1509
+ animationItem.setState(Globals.ANIMATION);
1510
+
1511
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1512
+ archiveItem.addActionListener(this);
10771513
10781514 menu.add("-");
10791515 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801516 parseverticesItem.addActionListener(this);
10811517 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821518 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1519
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841520 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871521 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881522 reduceMorphItem.addActionListener(this);
10891523 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901524 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941525 menu.add("-");
1095
-
10961526 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971527 memoryItem.addActionListener(this);
1528
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1529
+ computeAOItem.addActionListener(this);
1530
+
1531
+ if (Globals.ADVANCED)
1532
+ {
1533
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1534
+ mirrorItem.addActionListener(this);
1535
+ menu.add("-");
10981536 menu.add(analyzeItem = new MenuItem("Analyze"));
10991537 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1538
+ menu.add(dumpItem = new MenuItem("Print"));
11011539 dumpItem.addActionListener(this);
11021540 // menu.add(pathItem = new MenuItem("From-to path"));
11031541 // pathItem.addActionListener(this);
....@@ -1106,6 +1544,8 @@
11061544 resetParentItem.addActionListener(this);
11071545 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081546 repairParentItem.addActionListener(this);
1547
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1548
+ repairShadowItem.addActionListener(this);
11091549 menu.add(invariantsItem = new MenuItem("Invariants"));
11101550 invariantsItem.addActionListener(this);
11111551 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1553,7 @@
11131553 menu.add("-");
11141554 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151555 editScriptItem.addActionListener(this);
1556
+ }
11161557 }
11171558
11181559 void ScreenFit()
....@@ -1235,9 +1676,34 @@
12351676 shadow.material = new cMaterial(obj.material);
12361677 shadow.material.diffuse = 0.0001f;
12371678 shadow.material.specular = 0.0001f;
1679
+ //shadow.projectedVertices[1].x = 300;
12381680
12391681 makeSomething(shadow);
12401682 }
1683
+
1684
+ private void ClearUnpinned()
1685
+ {
1686
+ //for (Object3D obj : listUI)
1687
+ for (int i=listUI.size(); --i>=0;)
1688
+ {
1689
+ Object3D obj = listUI.elementAt(i);
1690
+ if (!obj.pinned)
1691
+ {
1692
+ obj.CloseUI();
1693
+ listUI.remove(i);
1694
+ }
1695
+ }
1696
+ }
1697
+
1698
+ private void EditElement(Object3D elem, boolean newWindow)
1699
+ {
1700
+ // if (!(elem instanceof Composite))
1701
+ // newWindow = false;
1702
+ listUI.add(elem);
1703
+ elem.openEditWindow(this, newWindow); //, false);
1704
+ System.out.println("edit : " + elem);
1705
+ elem.editWindow.refreshContents(true); // ? new
1706
+ }
12411707
12421708 /**
12431709 * applyExample
....@@ -1441,9 +1907,9 @@
14411907
14421908 void Overwrite(int mask)
14431909 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1910
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451911 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1912
+ Object3D content = Grafreed.clipboard.get(0);
14471913
14481914 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491915 content = ((cGroup)content).get(0);
....@@ -1466,6 +1932,7 @@
14661932 //
14671933 public void actionPerformed(ActionEvent event) // , Object arg)
14681934 {
1935
+ Object source = event.getSource();
14691936 /*
14701937 if (event.getSource() == nameField)
14711938 {
....@@ -1477,11 +1944,11 @@
14771944 }
14781945 else
14791946 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1947
+ if (source == lookAtItem || source == lookFromItem)
14811948 {
14821949 ScreenFit();
14831950 } else
1484
- if (event.getSource() == switchItem)
1951
+ if (source == switchViewItem)
14851952 {
14861953 cVector v1 = new cVector();
14871954 cVector v2 = new cVector();
....@@ -1490,11 +1957,11 @@
14901957 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911958 objEditor.cameraView.repaint();
14921959 } else
1493
- if (event.getSource() == rectoidItem)
1960
+ if (source == rectoidItem || source == boxButton)
14941961 {
14951962 makeSomething(new Box());
14961963 } else
1497
- if (event.getSource() == particleItem)
1964
+ if (source == particleItem || source == particlesButton)
14981965 {
14991966 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001967 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1982,9 @@
15151982 applyExample(particleGeom, "SMOKE");
15161983 makeSomething(particleGeom);
15171984 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1985
+ if (source == ragdollItem || source == ragdoll2Item)
15191986 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1987
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211988
15221989 ragdoll.toParent = LA.newMatrix();
15231990 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +2002,7 @@
15352002 } else
15362003 /*
15372004 */
1538
- if (event.getSource() == heightFieldItem)
2005
+ if (source == heightFieldItem)
15392006 {
15402007 Object3D obj = new Object3D();
15412008
....@@ -1573,27 +2040,31 @@
15732040
15742041 makeSomething(obj);
15752042 } else
1576
- if (event.getSource() == gridItem)
2043
+ if (source == gridItem || source == gridButton)
15772044 {
15782045 makeSomething(new Grid());
15792046 } else
1580
- if (event.getSource() == ellipsoidItem)
2047
+ if (source == ellipsoidItem || source == sphereButton)
15812048 {
15822049 makeSomething(new Sphere());
15832050 } else
1584
- if (event.getSource() == coneItem)
2051
+ if (source == coneItem || source == coneButton)
15852052 {
15862053 makeSomething(new Cone());
15872054 } else
1588
- if (event.getSource() == torusItem)
2055
+ if (source == torusItem || source == torusButton)
15892056 {
15902057 makeSomething(new Torus());
15912058 } else
1592
- if (event.getSource() == superItem)
2059
+ if (source == superItem || source == superButton)
15932060 {
15942061 makeSomething(new Superellipsoid());
15952062 } else
1596
- if (event.getSource() == blobItem)
2063
+ if (source == kleinItem || source == kleinButton)
2064
+ {
2065
+ makeSomething(new Klein());
2066
+ } else
2067
+ if (source == blobItem)
15972068 {
15982069 Blob blob = new Blob();
15992070 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2072,15 @@
16012072 //blob.retile();
16022073 makeSomething(blob);
16032074 } else
1604
- if (event.getSource() == latheItem)
2075
+ if (source == latheItem)
16052076 {
16062077 makeSomething(new Lathe());
16072078 } else
1608
- if (event.getSource() == bezierItem)
2079
+ if (source == bezierItem)
16092080 {
16102081 makeSomething(new BezierSurface());
16112082 } else
1612
- if (event.getSource() == checkerItem)
2083
+ if (source == overlayItem || source == overlayButton)
16132084 {
16142085 /*
16152086 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2095,7 @@
16242095 */
16252096 makeSomething(new Checker());
16262097 } else
1627
- if (event.getSource() == meshItem)
2098
+ if (source == meshItem)
16282099 {
16292100 Object3D itemtomake = new Object3D();
16302101 Object3D child;
....@@ -1645,35 +2116,35 @@
16452116 makeSomething(child);
16462117 }
16472118 } else
1648
- if (event.getSource() == springItem)
2119
+ if (source == springItem)
16492120 {
16502121 cSpring s = new cSpring();
16512122 s.setup();
16522123 makeSomething(s);
16532124 } else
1654
- if (event.getSource() == flagItem)
2125
+ if (source == flagItem)
16552126 {
16562127 cSpring s = new cFlag();
16572128 s.setup();
16582129 makeSomething(s);
16592130 } else
1660
- if (event.getSource() == lightItem)
2131
+ if (source == lightItem || source == lightButton)
16612132 {
16622133 makeSomething(new Light());
16632134 } else
1664
- if (event.getSource() == csgItem)
2135
+ if (source == csgItem)
16652136 {
16662137 group(new CSG());
16672138 } else
1668
- if (event.getSource() == templateItem)
2139
+ if (source == templateItem)
16692140 {
16702141 group(new cTemplate());
16712142 } else
1672
- if (event.getSource() == attributeItem)
2143
+ if (source == attributeItem)
16732144 {
16742145 makeSomething(new Attribute());
16752146 } else
1676
- if (event.getSource() == pointflowItem)
2147
+ if (source == pointflowItem)
16772148 {
16782149 makeSomething(new PointFlow());
16792150 } else
....@@ -1685,7 +2156,7 @@
16852156 } else
16862157 */
16872158
1688
- if (event.getSource() == superLoopItem)
2159
+ if (source == superLoopItem)
16892160 {
16902161 Composite g = new cGroup();
16912162 for (int i=0; i<15; i++)
....@@ -1707,30 +2178,30 @@
17072178
17082179 group(g);
17092180 } else
1710
- if (event.getSource() == loopItem)
2181
+ if (source == loopItem || source == loopButton)
17112182 {
17122183 Composite csg = new GroupLeaf();
17132184 csg.count = 5;
17142185 group(csg);
1715
- Composite child = new cGroup();
2186
+ Composite child = new cGroup("Branch");
17162187 csg.addChild(child);
17172188 child.addChild(csg);
17182189 } else
1719
- if (event.getSource() == doubleItem)
2190
+ if (source == doubleItem)
17202191 {
1721
- Composite csg = new GroupLeaf();
2192
+ Composite csg = new GroupLeaf("Fork");
17222193 csg.count = 5;
17232194 group(csg);
1724
- Composite child = new cGroup();
2195
+ Composite child = new cGroup("Branch A");
17252196 csg.addChild(child);
17262197 child.addChild(csg);
1727
- child = new cGroup();
2198
+ child = new cGroup("Branch B");
17282199 csg.addChild(child);
17292200 child.addChild(csg);
17302201 } else
1731
- if (event.getSource() == tripleItem)
2202
+ if (source == tripleItem)
17322203 {
1733
- Composite csg = new GroupLeaf();
2204
+ Composite csg = new GroupLeaf("Trident");
17342205 csg.count = 4;
17352206 group(csg);
17362207 Composite child = new cGroup();
....@@ -1743,73 +2214,98 @@
17432214 csg.addChild(child);
17442215 child.addChild(csg);
17452216 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2217
+ if (source == computeAOItem)
17482218 {
1749
- ImportGFD();
2219
+ Globals.drawMode = CameraPane.OCCLUSION;
2220
+ Globals.theRenderer.repaint();
17502221 } 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)
2222
+ if (source == recompileItem)
17692223 {
17702224 Recompile();
17712225 refreshContents();
17722226 } else
1773
- if (event.getSource() == editScriptItem)
2227
+ if (source == editScriptItem)
17742228 {
17752229 OpenDialog();
17762230 refreshContents();
17772231 } else
1778
- if (event.getSource() == invariantsItem)
2232
+ if (source == invariantsItem)
17792233 {
17802234 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2235
+ Grafreed.grafreeD.universe.invariants();
17822236 } else
1783
- if (event.getSource() == memoryItem)
2237
+ if (source == memoryItem)
17842238 {
17852239 //System.out.println("Invariants:");
17862240 PrintMemory();
17872241 } else
1788
- if (event.getSource() == pathItem)
2242
+ if (source == pathItem)
17892243 {
17902244 PrintPath();
17912245 } else
1792
- if (event.getSource() == analyzeItem)
2246
+ if (source == analyzeItem)
17932247 {
17942248 AnalyzeObject();
17952249 } else
1796
- if (event.getSource() == dumpItem)
2250
+ if (source == dumpItem)
17972251 {
17982252 DumpObject();
17992253 } else
1800
- if (event.getSource() == screenfitButton)
2254
+ if (source == minButton)
18012255 {
1802
- //Reload(lastConverter, lastFilename, true);
2256
+ Minimize();
2257
+ } else
2258
+ if (source == maxButton)
2259
+ {
2260
+ Maximize();
2261
+ } else
2262
+ if (source == fullButton)
2263
+ {
2264
+ ToggleFullScreen();
2265
+ } else
2266
+ if (source == undoButton)
2267
+ {
2268
+ // Go to previous version
2269
+ //if (!Undo())
2270
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2271
+ Undo();
2272
+ } else
2273
+ if (source == restoreButton)
2274
+ {
2275
+ // Restore current version
2276
+ Restore();
2277
+ } else
2278
+ if (source == replaceButton)
2279
+ {
2280
+ // Overwrite current version
2281
+ Replace();
2282
+ } else
2283
+ if (source == redoButton)
2284
+ {
2285
+ // Go to next version
2286
+ Redo();
2287
+ } else
2288
+ if (source == saveButton)
2289
+ {
2290
+ // Save a new version
2291
+ if (!Save(true))
2292
+ java.awt.Toolkit.getDefaultToolkit().beep();
2293
+ } else
2294
+ if (source == oneStepButton)
2295
+ {
2296
+ Globals.ONESTEP = true;
2297
+ cameraView.repaint();
2298
+ } else
2299
+ if (source == screenfitButton)
2300
+ {
18032301 ScreenFit();
18042302 } else
1805
- if (event.getSource() == screenfitpointButton)
2303
+ if (source == screenfitpointButton)
18062304 {
1807
- //Reload(lastConverter, lastFilename, true);
18082305 ScreenFitPoint();
18092306 } else
1810
- if (event.getSource() == snapobjectButton)
2307
+ if (source == snapobjectButton)
18112308 {
1812
- //Reload(lastConverter, lastFilename, true);
18132309 SnapObject();
18142310 } else
18152311 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2314,13 @@
18182314 // Recompile();
18192315 // refreshContents();
18202316 // } else
1821
- if (event.getSource() == gcButton)
2317
+ if (source == gcButton)
18222318 {
18232319 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242320 System.gc();
18252321 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262322 } else
1827
- if (event.getSource() == editLeafItem)
2323
+ if (source == editLeafItem)
18282324 {
18292325 Object3D obj;
18302326 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2334,78 @@
18382334 }
18392335 refreshContents(true);
18402336 } else
1841
- if (event.getSource() == openWindowItem)
2337
+ if (source == openWindowItem)
18422338 {
18432339 EditSelection(true);
18442340 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2341
+ if (source == cutItem || source == clearButton)
18462342 {
18472343 loadClipboard(true);
18482344 } else
1849
- if (event.getSource() == duplicateItem)
2345
+ if (source == undoItem)
18502346 {
1851
- Object3D keep = GraphreeD.clipboard;
2347
+ Undo();
2348
+ } else
2349
+ if (source == redoItem)
2350
+ {
2351
+ Redo();
2352
+ } else
2353
+ if (source == duplicateItem)
2354
+ {
2355
+ Object3D keep = Grafreed.clipboard;
18522356 loadClipboard(false);
18532357 paste(false);
1854
- GraphreeD.clipboard = keep;
2358
+ Grafreed.clipboard = keep;
18552359 } else
1856
- if (event.getSource() == cloneItem)
2360
+ if (source == cloneItem)
18572361 {
18582362 CloneSelection(false);
18592363 } else
1860
- if (event.getSource() == cloneSupportItem)
2364
+ if (source == cloneSupportItem)
18612365 {
18622366 CloneSelection(true);
18632367 } else
1864
- if (event.getSource() == copyItem)
2368
+ if (source == copyItem)
18652369 {
18662370 loadClipboard(false);
18672371 } else
1868
- if (event.getSource() == pasteItem)
2372
+ if (source == pasteItem)
18692373 {
18702374 paste(false);
18712375 } else
1872
- if (event.getSource() == pasteLinkItem)
2376
+ if (source == pasteIntoItem)
18732377 {
1874
- pasteInto(false);
2378
+ pasteInto(true, false);
18752379 } else
1876
- if (event.getSource() == pasteCloneItem)
2380
+ if (source == pasteLinkItem)
18772381 {
1878
- pasteInto(true);
2382
+ pasteInto(false, false);
18792383 } else
1880
- if (event.getSource() == pasteExpandItem)
2384
+ if (source == pasteCloneItem)
2385
+ {
2386
+ pasteInto(true, true);
2387
+ } else
2388
+ if (source == pasteExpandItem)
18812389 {
18822390 paste(true);
18832391 } else
1884
- if (event.getSource() == synchronizeItem)
2392
+ if (source == synchronizeItem)
18852393 {
18862394 Overwrite(Object3D.TRANSFORM);
18872395 } else
1888
- if (event.getSource() == overwriteNameItem)
2396
+ if (source == overwriteNameItem)
18892397 {
18902398 Overwrite(Object3D.NAME);
18912399 } else
1892
- if (event.getSource() == overwriteUVItem)
2400
+ if (source == overwriteUVItem)
18932401 {
18942402 Overwrite(Object3D.UV);
18952403 } else
1896
- if (event.getSource() == overwriteMatItem)
2404
+ if (source == overwriteMatItem)
18972405 {
2406
+ /* july 2015
18982407 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2408
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002409 else
19012410 {
19022411 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2417,16 @@
19082417 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092418 }
19102419 }
2420
+ */
2421
+
2422
+ Overwrite(dropAttributes);
19112423 }
1912
- if (event.getSource() == overwriteGeoItem)
2424
+ if (source == overwriteGeoItem)
19132425 {
19142426 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2427
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162428 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2429
+// Object3D content = GrafreeD.clipboard.get(0);
19182430 //
19192431 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202432 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2438,7 @@
19262438 // refreshContents();
19272439 // }
19282440 } else
1929
- if (event.getSource() == generateMeshItem)
2441
+ if (source == generateMeshItem)
19302442 {
19312443 //if (group.selection.size() == 1)
19322444 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2449,7 @@
19372449 ResetModel();
19382450 refreshContents();
19392451 } else
1940
- if (event.getSource() == extractGeometriesItem)
2452
+ if (source == extractGeometriesItem)
19412453 {
19422454 boolean one = false;
19432455
....@@ -1964,7 +2476,7 @@
19642476 ResetModel();
19652477 refreshContents();
19662478 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2479
+ if (source == cloneGeometriesItem)
19682480 {
19692481 boolean one = false;
19702482
....@@ -1990,32 +2502,37 @@
19902502 ResetModel();
19912503 refreshContents();
19922504 } else
1993
- if (event.getSource() == shareGeometriesItem)
2505
+ if (source == shareGeometriesItem)
19942506 {
19952507 boolean one = false;
19962508
19972509 if (group.selection.size() == 1)
19982510 one = true;
19992511
2512
+ Object3D merge = null;
2513
+
20002514 Object3D content = new cGroup();
20012515
20022516 for (int i=0; i<group.selection.size(); i++)
20032517 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2518
+ merge = new Merge(group.selection.get(i));
20052519
20062520 if (one)
2007
- makeSomething(sel, false);
2521
+ makeSomething(merge, false);
20082522 else
2009
- content.addChild(sel);
2523
+ content.addChild(merge);
20102524 }
20112525
20122526 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2527
+ makeSomething(content, true);
2528
+ else
2529
+ {
2530
+ ResetModel();
2531
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2532
+ refreshContents();
2533
+ }
20172534 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2535
+ if (source == mergeGeometriesItem)
20192536 {
20202537 boolean one = false;
20212538
....@@ -2045,11 +2562,11 @@
20452562 ResetModel();
20462563 refreshContents();
20472564 } else
2048
- if (event.getSource() == linkverticesItem)
2565
+ if (source == linkverticesItem)
20492566 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2567
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512568 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2569
+// Object3D content = GrafreeD.clipboard.get(0);
20532570 //
20542571 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552572 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2575,48 @@
20582575 // group.selection.get(0).setMasterThis(content); // should be identity
20592576 // refreshContents();
20602577 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2578
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622579 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2580
+ Object3D content = Grafreed.clipboard.get(0);
20642581
20652582 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662583 content = ((cGroup)content).get(0);
20672584
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2585
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692586 for (int i=0; i<group.selection.size(); i++)
20702587 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2588
+ boolean random = CameraPane.SWITCH;
2589
+ CameraPane.SWITCH = false; // parse all random nodes
20732590 group.selection.get(i).linkVerticesThis(content);
20742591 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2592
+ CameraPane.SWITCH = random;
20762593 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2594
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782595 refreshContents();
20792596 }
20802597 } else
2081
- if (event.getSource() == resetsupportItem)
2598
+ if (source == resetsupportItem)
20822599 {
20832600 for (int i=0; i<group.selection.size(); i++)
20842601 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2602
+ boolean random = CameraPane.SWITCH;
2603
+ CameraPane.SWITCH = false; // parse all random nodes
20872604 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2605
+ CameraPane.SWITCH = random;
20892606 }
20902607
20912608 refreshContents();
20922609 } else
2093
- if (event.getSource() == resetreferencesItem)
2610
+ if (source == relinkverticesItem)
2611
+ {
2612
+ boolean random = CameraPane.SWITCH;
2613
+ CameraPane.SWITCH = false; // parse all random nodes
2614
+ group.selection.RelinkToSupport();
2615
+ CameraPane.SWITCH = random;
2616
+
2617
+ refreshContents();
2618
+ } else
2619
+ if (source == resetreferencesItem)
20942620 {
20952621 for (int i=0; i<group.selection.size(); i++)
20962622 {
....@@ -2099,11 +2625,11 @@
20992625
21002626 refreshContents();
21012627 } else
2102
- if (event.getSource() == setMasterItem)
2628
+ if (source == setMasterItem)
21032629 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2630
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052631 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2632
+ Object3D content = Grafreed.clipboard.get(0);
21072633
21082634 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092635 content = ((cGroup)content).get(0);
....@@ -2112,13 +2638,13 @@
21122638 refreshContents();
21132639 }
21142640 } else
2115
- if (event.getSource() == poseMeshItem)
2641
+ if (source == poseMeshItem)
21162642 {
21172643 if (group.selection.size() == 1)
21182644 {
2119
- if (GraphreeD.clipboard.size() == 1)
2645
+ if (Grafreed.clipboard.size() == 1)
21202646 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2647
+ Object3D content = Grafreed.clipboard.get(0);
21222648
21232649 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242650 content = ((cGroup)content).get(0);
....@@ -2131,19 +2657,19 @@
21312657 }
21322658
21332659 } else
2134
- if (event.getSource() == revertMeshItem)
2660
+ if (source == revertMeshItem)
21352661 {
21362662 RevertMeshes();
21372663 } else
2138
- if (event.getSource() == resetMeshItem)
2664
+ if (source == resetAllItem)
21392665 {
21402666 ResetAll();
21412667 } else
2142
- if (event.getSource() == stepAllItem)
2668
+ if (source == stepAllItem)
21432669 {
21442670 StepAll();
21452671 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2672
+ if (source == deleteItem) // || event.getSource() == clearButton)
21472673 {
21482674 //int indices[] = jList.getSelectedIndices();
21492675 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2677,46 @@
21512677
21522678 ClearSelection(false);
21532679 } else
2154
- if (event.getSource() == clearAllItem)
2680
+ if (source == clearAllItem)
21552681 {
21562682 ClearSelection(true);
21572683 } else
2158
- if (event.getSource() == grabItem)
2684
+ if (source == grabItem || source == groupButton)
21592685 {
2160
- group(new cGroup(), true);
2686
+ group(new cGroup(), false); // true);
21612687 } else
2162
- if (event.getSource() == frontItem)
2688
+ if (source == hideItem)
2689
+ {
2690
+ group(new HiddenObject());
2691
+ } else
2692
+ if (source == frontItem)
21632693 {
21642694 front();
21652695 } else
2166
- if (event.getSource() == backItem)
2696
+ if (source == backItem)
21672697 {
21682698 back();
21692699 } else
2170
- if (event.getSource() == cameraItem)
2700
+ if (source == cameraItem)
21712701 {
21722702 makeSomething(new Camera());
21732703 } else
2174
- if (event.getSource() == compositeItem)
2704
+ if (source == compositeItem || source == compositeButton)
21752705 {
21762706 group(new Composite());
21772707 } else
2178
- if (event.getSource() == randomItem)
2708
+ if (source == switchItem || source == switchButton)
21792709 {
21802710 RandomNode random = new RandomNode();
21812711 group(random);
21822712 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2713
+ random.name = random.get(0).name + "Switch";
21842714 } else
2185
- if (event.getSource() == physicsItem)
2715
+ if (source == physicsItem)
21862716 {
21872717 group(new PhysicsNode());
21882718 } else
2189
- if (event.getSource() == frameselectorItem)
2719
+ if (source == frameselectorItem)
21902720 {
21912721 for (int i=0; i<group.selection.size(); i++)
21922722 {
....@@ -2198,7 +2728,7 @@
21982728 ResetModel();
21992729 refreshContents();
22002730 } else
2201
- if (event.getSource() == switchGeoItem)
2731
+ if (source == switchGeoItem)
22022732 {
22032733 for (int i=0; i<group.selection.size(); i++)
22042734 {
....@@ -2210,7 +2740,7 @@
22102740 ResetModel();
22112741 refreshContents();
22122742 } else
2213
- if (event.getSource() == switchTransfoItem)
2743
+ if (source == switchTransfoItem)
22142744 {
22152745 for (int i=0; i<group.selection.size(); i++)
22162746 {
....@@ -2222,7 +2752,7 @@
22222752 ResetModel();
22232753 refreshContents();
22242754 } else
2225
- if (event.getSource() == morphItem)
2755
+ if (source == morphItem)
22262756 {
22272757 for (int i=0; i<group.selection.size(); i++)
22282758 {
....@@ -2234,7 +2764,7 @@
22342764 ResetModel();
22352765 refreshContents();
22362766 } else
2237
- if (event.getSource() == scriptNodeItem)
2767
+ if (source == scriptNodeItem)
22382768 {
22392769 boolean atleastone = false;
22402770
....@@ -2273,195 +2803,252 @@
22732803 }
22742804 }
22752805 } else
2276
- if (event.getSource() == linkerItem)
2806
+ if (source == linkerItem)
22772807 {
22782808 group(new cLinker());
22792809 } else
2280
- if (event.getSource() == textureItem)
2810
+ if (source == textureItem || source == textureButton)
22812811 {
22822812 group(new TextureNode());
22832813 } else
2284
- if (event.getSource() == shadowXItem)
2814
+ if (source == billboardItem)
2815
+ {
2816
+ group(new BillboardNode());
2817
+ } else
2818
+ if (source == shadowXItem)
22852819 {
22862820 CastShadow(0);
22872821 } else
2288
- if (event.getSource() == shadowYItem)
2822
+ if (source == shadowYItem)
22892823 {
22902824 CastShadow(1);
22912825 } else
2292
- if (event.getSource() == shadowZItem)
2826
+ if (source == shadowZItem)
22932827 {
22942828 CastShadow(2);
22952829 } else
2296
- if (event.getSource() == ungroupItem)
2830
+ if (source == ungroupItem || source == ungroupButton)
22972831 {
2298
- ungroup();
2832
+ boolean hasRoot = false;
2833
+
2834
+ for (int i=0; i<group.selection.size(); i++)
2835
+ {
2836
+ if (group.selection.get(i) == group)
2837
+ {
2838
+ hasRoot = true;
2839
+ break;
2840
+ }
2841
+ }
2842
+
2843
+ if (!hasRoot)
2844
+ {
2845
+ for (int i=0; i<group.selection.size(); i++)
2846
+ {
2847
+ Ungroup(group.selection.get(i));
2848
+ }
2849
+
2850
+ ClearSelection(false);
2851
+
2852
+ refreshContents();
2853
+ }
22992854 } else
2300
- if (event.getSource() == genUVItem)
2855
+ if (source == genUVItem)
23012856 {
23022857 GenUV();
23032858 } else
2304
- if (event.getSource() == genNormalsCADItem)
2859
+ if (source == genNormalsCADItem)
23052860 {
23062861 GenNormals(true);
23072862 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2863
+ if (source == genNormalsMESHItem)
2864
+ {
2865
+ GenNormalsMESH();
2866
+ } else
2867
+ if (source == genNormalsORGANItem)
23092868 {
23102869 GenNormals(false);
23112870 } else
2312
- if (event.getSource() == stripifyItem)
2871
+ if (source == genNormalsMINEItem)
2872
+ {
2873
+ GenNormalsMINE();
2874
+ } else
2875
+ if (source == stripifyItem)
23132876 {
23142877 Stripify();
23152878 } else
2316
- if (event.getSource() == unstripifyItem)
2879
+ if (source == unstripifyItem)
23172880 {
23182881 Unstripify();
23192882 } else
2320
- if (event.getSource() == trimItem)
2883
+ if (source == trimItem)
23212884 {
23222885 Trim();
23232886 } else
2324
- if (event.getSource() == untrimItem)
2887
+ if (source == untrimItem)
23252888 {
23262889 Untrim();
23272890 } else
2328
- if (event.getSource() == clearColorsItem)
2891
+ if (source == clearColorsItem)
23292892 {
23302893 ClearColors();
23312894 } else
2332
- if (event.getSource() == clearMaterialsItem)
2895
+ if (source == clearMaterialsItem)
23332896 {
23342897 ClearMaterials();
23352898 } else
2336
- if (event.getSource() == liveleavesItem)
2899
+ if (source == liveleavesItem)
23372900 {
23382901 LiveLeaves(true);
23392902 } else
2340
- if (event.getSource() == unliveleavesItem)
2903
+ if (source == unliveleavesItem)
23412904 {
23422905 LiveLeaves(false);
23432906 } else
2344
- if (event.getSource() == supportleavesItem)
2907
+ if (source == supportleavesItem)
23452908 {
23462909 SupportLeaves(true);
23472910 } else
2348
- if (event.getSource() == unsupportleavesItem)
2911
+ if (source == unsupportleavesItem)
23492912 {
23502913 SupportLeaves(false);
23512914 } else
2352
- if (event.getSource() == hideleavesItem)
2915
+ if (source == hideleavesItem)
23532916 {
23542917 HideLeaves(true);
23552918 } else
2356
- if (event.getSource() == showleavesItem)
2919
+ if (source == showleavesItem)
23572920 {
23582921 HideLeaves(false);
23592922 } else
2360
- if (event.getSource() == markleavesItem)
2923
+ if (source == markleavesItem)
23612924 {
23622925 MarkLeaves(true);
23632926 } else
2364
- if (event.getSource() == unmarkleavesItem)
2927
+ if (source == unmarkleavesItem)
23652928 {
23662929 MarkLeaves(false);
23672930 } else
2368
- if (event.getSource() == flipVItem)
2931
+ if (source == rewindleavesItem)
2932
+ {
2933
+ RewindLeaves(true);
2934
+ } else
2935
+ if (source == unrewindleavesItem)
2936
+ {
2937
+ RewindLeaves(false);
2938
+ } else
2939
+ if (source == randomleavesItem)
2940
+ {
2941
+ RandomLeaves(true);
2942
+ } else
2943
+ if (source == unrandomleavesItem)
2944
+ {
2945
+ RandomLeaves(false);
2946
+ } else
2947
+ if (source == flipVItem)
23692948 {
23702949 FlipV(true);
23712950 } else
2372
- if (event.getSource() == unflipVItem)
2951
+ if (source == unflipVItem)
23732952 {
23742953 FlipV(false);
23752954 } else
2376
- if (event.getSource() == lowTexturesItem)
2955
+ if (source == lowTexturesItem)
23772956 {
23782957 SetTexRes(0);
23792958 } else
2380
- if (event.getSource() == normalTexturesItem)
2959
+ if (source == normalTexturesItem)
23812960 {
23822961 SetTexRes(1);
23832962 } else
2384
- if (event.getSource() == highTexturesItem)
2963
+ if (source == highTexturesItem)
23852964 {
23862965 SetTexRes(2);
23872966 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2967
+ if (source == veryhighTexturesItem)
23892968 {
23902969 SetTexRes(3);
23912970 } else
2392
- if (event.getSource() == maxTexturesItem)
2971
+ if (source == maxTexturesItem)
23932972 {
23942973 SetTexRes(4);
23952974 } else
2396
- if (event.getSource() == panoTexturesItem)
2975
+ if (source == panoTexturesItem)
23972976 {
23982977 SetTexRes(5);
23992978 } else
2400
- if (event.getSource() == reverseNormalsItem)
2979
+ if (source == reverseNormalsItem)
24012980 {
24022981 ReverseNormals();
24032982 } else
2404
- if (event.getSource() == parseverticesItem)
2983
+ if (source == parseverticesItem)
24052984 {
24062985 ParseVertices();
24072986 } else
2408
- if (event.getSource() == textureFieldItem)
2987
+ if (source == textureFieldItem)
24092988 {
24102989 TextureVertices();
24112990 } else
2412
- if (event.getSource() == alignItem)
2991
+ if (source == alignItem)
24132992 {
24142993 Align();
24152994 } else
2416
- if (event.getSource() == mirrorItem)
2995
+ if (source == mirrorItem)
24172996 {
24182997 MirrorPoses();
24192998 } else
2420
- if (event.getSource() == reduceMorphItem)
2999
+ if (source == reduceMorphItem)
24213000 {
24223001 MeshReduction(false);
24233002 } else
2424
- if (event.getSource() == reduce34MorphItem)
3003
+ if (source == reduce34MorphItem)
24253004 {
24263005 MeshReduction(true);
24273006 } else
2428
- if (event.getSource() == reverseTrianglesItem)
3007
+ if (source == reverseTrianglesItem)
24293008 {
24303009 ReverseTriangles();
24313010 } else
2432
- if (event.getSource() == reduceMeshItem)
3011
+ if (source == reduceMeshItem)
24333012 {
24343013 ReduceMesh(false);
24353014 } else
2436
- if (event.getSource() == reduce34MeshItem)
3015
+ if (source == reduce34MeshItem)
24373016 {
24383017 ReduceMesh(true);
24393018 } else
2440
- if (event.getSource() == increaseMeshItem)
3019
+ if (source == increaseMeshItem)
24413020 {
24423021 IncreaseMesh();
24433022 } else
2444
- if (event.getSource() == clipMeshItem)
3023
+ if (source == clipMeshItem)
24453024 {
24463025 ClipMesh();
24473026 } else
2448
- if (event.getSource() == smoothMeshItem)
3027
+ if (source == smoothMeshItem)
24493028 {
24503029 SmoothMesh();
24513030 } else
2452
- if (event.getSource() == transformgeometryItem)
3031
+ if (source == transformGeometryItem)
24533032 {
24543033 TransformGeometry();
24553034 } else
2456
- if (event.getSource() == resetTransformItem)
3035
+ if (source == transformChildrenItem)
3036
+ {
3037
+ TransformChildren();
3038
+ } else
3039
+ if (source == resetTransformItem)
24573040 {
24583041 ResetTransform();
24593042 } else
2460
- if (event.getSource() == resetCentroidItem)
3043
+ if (source == resetCentroidItem)
24613044 {
2462
- ResetCentroid();
3045
+ ResetCentroid(true);
24633046 } else
2464
- if (event.getSource() == resetParentItem)
3047
+ if (source == resetCentroidXZItem)
3048
+ {
3049
+ ResetCentroid(false);
3050
+ } else
3051
+ if (source == resetParentItem)
24653052 {
24663053 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673054 {
....@@ -2471,7 +3058,7 @@
24713058
24723059 refreshContents();
24733060 } else
2474
- if (event.getSource() == repairParentItem)
3061
+ if (source == repairParentItem)
24753062 {
24763063 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773064 {
....@@ -2485,7 +3072,21 @@
24853072
24863073 refreshContents();
24873074 } else
2488
- if (event.getSource() == sortbysizeItem)
3075
+ if (source == repairShadowItem)
3076
+ {
3077
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3078
+ {
3079
+ Object3D obj = (Object3D)e.nextElement();
3080
+ obj.RepairShadow();
3081
+// for (int i=0; i<obj.size(); i++)
3082
+// {
3083
+// obj.get(i).parent = obj;
3084
+// }
3085
+ }
3086
+
3087
+ refreshContents();
3088
+ } else
3089
+ if (source == sortbysizeItem)
24893090 {
24903091 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913092 {
....@@ -2497,7 +3098,7 @@
24973098 ResetModel();
24983099 refreshContents();
24993100 } else
2500
- if (event.getSource() == sortbynameItem)
3101
+ if (source == sortbynameItem)
25013102 {
25023103 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033104 {
....@@ -2509,7 +3110,7 @@
25093110 ResetModel();
25103111 refreshContents();
25113112 } else
2512
- if (event.getSource() == attachPigmentItem)
3113
+ if (source == attachPigmentItem)
25133114 {
25143115 String texture = GetFile("Attach pigment");
25153116 Object3D obj;
....@@ -2521,7 +3122,7 @@
25213122
25223123 refreshContents();
25233124 } else
2524
- if (event.getSource() == detachPigmentItem)
3125
+ if (source == detachPigmentItem)
25253126 {
25263127 Object3D obj;
25273128 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3133,7 @@
25323133
25333134 refreshContents();
25343135 } else
2535
- if (event.getSource() == attachBumpItem)
3136
+ if (source == attachBumpItem)
25363137 {
25373138 String texture = GetFile("Attach bump");
25383139 Object3D obj;
....@@ -2544,7 +3145,7 @@
25443145
25453146 refreshContents();
25463147 } else
2547
- if (event.getSource() == detachBumpItem)
3148
+ if (source == detachBumpItem)
25483149 {
25493150 Object3D obj;
25503151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +3156,7 @@
25553156
25563157 refreshContents();
25573158 } else
2558
- if (event.getSource() == pigmentBumpItem)
3159
+ if (source == pigmentBumpItem)
25593160 {
25603161 Object3D obj;
25613162 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3167,237 @@
25663167
25673168 refreshContents();
25683169 } else
2569
- if (event.getSource() == flashSelectionButton)
3170
+ if (source == flashSelectionButton)
25703171 {
25713172 CameraPane.flash = true;
25723173 refreshContents();
25733174 } else
2574
- if (event.getSource() == oneButton)
3175
+ if (source == oneButton)
25753176 {
25763177 } else
2577
- if (event.getSource() == twoButton)
3178
+ if (source == twoButton)
25783179 {
25793180 radio.layout = twoButton;
3181
+
3182
+ if (CameraPane.FULLSCREEN)
3183
+ fullscreenLayout = radio.layout;
3184
+
25803185 // bug
25813186 //gridPanel.setDividerLocation(1.0);
25823187 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3188
+// bigThree.remove(scenePanel);
3189
+// bigThree.remove(centralPanel);
3190
+// bigThree.remove(XYZPanel);
3191
+// aWindowConstraints.gridx = 0;
3192
+// aWindowConstraints.gridy = 0;
3193
+// aWindowConstraints.gridwidth = 1;
3194
+// // aConstraints.gridheight = 3;
3195
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3196
+// aWindowConstraints.weightx = 0;
3197
+// aWindowConstraints.weighty = 1;
3198
+// //bigThree.add(jtp, aWindowConstraints);
3199
+// aWindowConstraints.weightx = 1;
3200
+// aWindowConstraints.gridwidth = 3;
3201
+// // aConstraints.gridheight = 3;
3202
+// aWindowConstraints.gridx = 1;
3203
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3204
+// bigThree.add(centralPanel, aWindowConstraints);
3205
+// aWindowConstraints.weightx = 0;
3206
+// aWindowConstraints.gridx = 4;
3207
+// aWindowConstraints.gridwidth = 1;
3208
+// // aConstraints.gridheight = 3;
3209
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3210
+// //bigThree.add(XYZPanel, aWindowConstraints);
3211
+// scenePanel.setVisible(false);
3212
+// centralPanel.setVisible(true);
3213
+// XYZPanel.setVisible(false);
3214
+ bigThree.ClearUI();
3215
+ bigThree.add(centralPanel);
3216
+ bigThree.FlushUI();
3217
+
3218
+ cameraView.requestFocusInWindow();
3219
+
3220
+// refreshContents(true);
3221
+//
3222
+// try
3223
+// {
3224
+// java.awt.Robot bot = new java.awt.Robot();
3225
+// int mask = InputEvent.BUTTON1_MASK;
3226
+// bot.mouseMove(100, 100);
3227
+// bot.mousePress(mask);
3228
+// bot.mouseRelease(mask);
3229
+// }
3230
+// catch (Exception e)
3231
+// {
3232
+//
3233
+// }
3234
+
26073235 } else
2608
- if (event.getSource() == threeButton)
3236
+ if (source == threeButton)
26093237 {
26103238 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
3239
+
3240
+ if (CameraPane.FULLSCREEN)
3241
+ fullscreenLayout = radio.layout;
3242
+
3243
+// bigThree.remove(scenePanel);
3244
+// bigThree.remove(centralPanel);
3245
+// bigThree.remove(XYZPanel);
3246
+// aWindowConstraints.gridx = 0;
3247
+// aWindowConstraints.gridy = 0;
3248
+// aWindowConstraints.gridwidth = 1;
3249
+// // aConstraints.gridheight = 3;
3250
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3251
+// aWindowConstraints.weightx = 0;
3252
+// aWindowConstraints.weighty = 1;
3253
+// //bigThree.add(jtp, aWindowConstraints);
3254
+// aWindowConstraints.weightx = 1;
3255
+// aWindowConstraints.gridwidth = 3;
3256
+// // aConstraints.gridheight = 3;
3257
+// aWindowConstraints.gridx = 1;
3258
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3259
+// bigThree.add(centralPanel, aWindowConstraints);
3260
+// aWindowConstraints.weightx = 0;
3261
+// aWindowConstraints.gridx = 4;
3262
+// aWindowConstraints.gridwidth = 1;
3263
+// // aConstraints.gridheight = 3;
3264
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3265
+// bigThree.add(XYZPanel, aWindowConstraints);
3266
+// bigThree.validate();
3267
+// scenePanel.setVisible(false);
3268
+// centralPanel.setVisible(true);
3269
+// XYZPanel.setVisible(true);
3270
+ bigThree.ClearUI();
3271
+ bigThree.add(centralPanel);
3272
+ bigThree.add(XYZPanel);
3273
+ bigThree.FlushUI();
3274
+
3275
+ cameraView.requestFocusInWindow();
26353276 } else
2636
- if (event.getSource() == fourButton)
3277
+ if (source == fourButton)
26373278 {
26383279 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3280
+
3281
+ if (CameraPane.FULLSCREEN)
3282
+ fullscreenLayout = radio.layout;
3283
+
3284
+// bigThree.remove(scenePanel);
3285
+// bigThree.remove(centralPanel);
3286
+// bigThree.remove(XYZPanel);
3287
+// aWindowConstraints.gridx = 0;
3288
+// aWindowConstraints.gridy = 0;
3289
+// aWindowConstraints.gridwidth = 1;
3290
+// // aWindowConstraints.gridheight = 3;
3291
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3292
+// aWindowConstraints.weightx = 1;
3293
+// aWindowConstraints.weighty = 1;
3294
+// bigThree.add(scenePanel, aWindowConstraints);
3295
+// aWindowConstraints.weightx = 1;
3296
+// aWindowConstraints.gridwidth = 3;
3297
+// // aConstraints.gridheight = 3;
3298
+// aWindowConstraints.gridx = 1;
3299
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3300
+// //bigThree.add(cameraPanel, aWindowConstraints);
3301
+// aWindowConstraints.weightx = 0;
3302
+// aWindowConstraints.gridx = 4;
3303
+// aWindowConstraints.gridwidth = 1;
3304
+// // aWindowConstraints.gridheight = 3;
3305
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3306
+// //bigThree.add(XYZPanel, aWindowConstraints);
3307
+// bigThree.validate();
3308
+// scenePanel.setVisible(true);
3309
+// centralPanel.setVisible(false);
3310
+// XYZPanel.setVisible(false);
3311
+ bigThree.ClearUI();
3312
+ bigThree.add(scenePanel);
3313
+ bigThree.FlushUI();
3314
+
3315
+ cameraView.requestFocusInWindow();
26633316 } else
2664
- if (event.getSource() == sixButton)
3317
+ if (source == sixButton)
26653318 {
26663319 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
3320
+
3321
+ if (CameraPane.FULLSCREEN)
3322
+ fullscreenLayout = radio.layout;
3323
+
3324
+// bigThree.remove(scenePanel);
3325
+// bigThree.remove(centralPanel);
3326
+// bigThree.remove(XYZPanel);
3327
+// aWindowConstraints.gridx = 0;
3328
+// aWindowConstraints.gridy = 0;
3329
+// aWindowConstraints.gridwidth = 1;
3330
+// // aConstraints.gridheight = 3;
3331
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3332
+// aWindowConstraints.weightx = 0;
3333
+// aWindowConstraints.weighty = 1;
3334
+// bigThree.add(scenePanel, aWindowConstraints);
3335
+// aWindowConstraints.weightx = 1;
3336
+// aWindowConstraints.gridwidth = 3;
3337
+// // aWindowConstraints.gridheight = 3;
3338
+// aWindowConstraints.gridx = 1;
3339
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3340
+// bigThree.add(centralPanel, aWindowConstraints);
3341
+// aWindowConstraints.weightx = 0;
3342
+// aWindowConstraints.gridx = 4;
3343
+// aWindowConstraints.gridwidth = 1;
3344
+// // aWindowConstraints.gridheight = 3;
3345
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3346
+// //bigThree.add(XYZPanel, aConstraints);
3347
+// bigThree.validate();
3348
+// scenePanel.setVisible(true);
3349
+// centralPanel.setVisible(true);
3350
+// XYZPanel.setVisible(false);
3351
+ bigThree.ClearUI();
3352
+ bigThree.add(scenePanel);
3353
+ bigThree.add(centralPanel);
3354
+ bigThree.FlushUI();
3355
+
3356
+ cameraView.requestFocusInWindow();
26913357 } else
2692
- if (event.getSource() == sevenButton)
3358
+ if (source == sevenButton)
26933359 {
26943360 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3361
+
3362
+ if (CameraPane.FULLSCREEN)
3363
+ fullscreenLayout = radio.layout;
3364
+
3365
+// bigThree.remove(scenePanel);
3366
+// bigThree.remove(centralPanel);
3367
+// bigThree.remove(XYZPanel);
3368
+// aWindowConstraints.gridx = 0;
3369
+// aWindowConstraints.gridy = 0;
3370
+// aWindowConstraints.gridwidth = 1;
3371
+// // aWindowConstraints.gridheight = 3;
3372
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3373
+// aWindowConstraints.weightx = 0;
3374
+// aWindowConstraints.weighty = 1;
3375
+// bigThree.add(scenePanel, aWindowConstraints);
3376
+// aWindowConstraints.weightx = 1;
3377
+// aWindowConstraints.gridwidth = 3;
3378
+// // aWindowConstraints.gridheight = 3;
3379
+// aWindowConstraints.gridx = 1;
3380
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3381
+// bigThree.add(centralPanel, aWindowConstraints);
3382
+// aWindowConstraints.weightx = 0;
3383
+// aWindowConstraints.gridx = 4;
3384
+// aWindowConstraints.gridwidth = 1;
3385
+// // aConstraints.gridheight = 3;
3386
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3387
+// bigThree.add(XYZPanel, aWindowConstraints);
3388
+// bigThree.validate();
3389
+// scenePanel.setVisible(true);
3390
+// centralPanel.setVisible(true);
3391
+// XYZPanel.setVisible(true);
3392
+ bigThree.ClearUI();
3393
+ bigThree.add(scenePanel);
3394
+ bigThree.add(centralPanel);
3395
+ bigThree.add(XYZPanel);
3396
+ bigThree.FlushUI();
3397
+
3398
+ cameraView.requestFocusInWindow();
27193399 } else
2720
- if (event.getSource() == rootButton)
3400
+ if (source == rootButton)
27213401 {
27223402 Object3D obj;
27233403 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3407,84 @@
27273407 EditObject(obj);
27283408 }
27293409
3410
+ cameraView.requestFocusInWindow();
27303411 refreshContents(true);
27313412 } else
2732
- if (event.getSource() == closeButton)
3413
+ if (source == closeButton)
27333414 {
27343415 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353416 cRadio ab;
27363417 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373418 {
27383419 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3420
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403421 {
3422
+ // Patch to avoid bug with transparency.
3423
+ if (!ab.hadMaterial)
3424
+ {
3425
+ ab.object.material = null;
3426
+ }
3427
+
27413428 buttonGroup.remove(ab);
27423429 radioPanel.remove(ab);
27433430
2744
- ab.GetObject().editWindow = null;
3431
+ //ab.GetObject().editWindow = null;
3432
+ ab.GetObject().manipWindow = null;
27453433 // ab.GetObject().objectUI = null; // ?????????
27463434
27473435 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483436 break;
27493437 }
27503438 }
3439
+
3440
+ cameraView.requestFocusInWindow();
27513441 refreshContents(true);
27523442 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3443
+ if (source == editItem || source == editButton)
27543444 {
3445
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3446
+ {
3447
+ Object3D child = (Object3D)e.nextElement();
3448
+ child.pinned = true;
3449
+ }
3450
+
27553451 EditSelection(false);
27563452 } else
2757
- if (event.getSource() == uneditButton)
3453
+ if (source == uneditButton)
27583454 {
27593455 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603456 {
27613457 Object3D child = (Object3D)e.nextElement();
27623458 if(child.editWindow != null)
27633459 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3460
+ child.pinned = false;
27643461 child.CloseUI();
27653462 listUI.remove(child);
27663463
2767
- child.editWindow = null; // ???????????
3464
+ //child.editWindow = null; // ???????????
27683465 }
2769
- objEditor.ctrlPanel.revalidate();
3466
+ objEditor.ctrlPanel.FlushUI();
27703467 //objEditor.jTree.clearSelection();
27713468 //objEditor.ResetSliders();
27723469 refreshContents(true);
27733470 } else
2774
- if (event.getSource() == clearPanelButton)
3471
+ if (source == clearPanelButton)
27753472 {
27763473 assert(copy == group);
27773474 //copy.ClearUI();
27783475 for (Object3D obj : listUI)
27793476 {
3477
+ obj.pinned = false;
27803478 obj.CloseUI();
27813479 }
27823480 listUI.clear();
27833481 refreshContents(true);
27843482 } else
2785
- if (event.getSource() == allParamsButton)
3483
+ if (source == allParamsButton)
27863484 {
27873485 assert(copy == group);
27883486
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3487
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903488
27913489 for (Object3D obj : listUI)
27923490 {
....@@ -2803,19 +3501,19 @@
28033501
28043502 refreshContents(true);
28053503 } else
2806
- if (event.getSource() == unselectButton)
3504
+ if (source == unselectButton)
28073505 {
28083506 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3507
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103508 objEditor.ResetSliders();
28113509 refreshContents(true);
28123510 } else
2813
- if(event.getSource() instanceof cRadio)
3511
+ if(source instanceof cRadio)
28143512 {
28153513 group.parent = keepparent;
28163514 group.attributes = 0;
28173515 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3516
+ /*cRadio*/ radio = (cRadio)source;
28193517 Object3D obj = radio.GetObject();
28203518 System.out.println("Edit " + obj);
28213519 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3533,10 @@
28353533 }
28363534
28373535 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3536
+
3537
+ SetUndoStates();
3538
+
3539
+ //Globals.theRenderer.object = group;
28393540 if(!useclient)
28403541 {
28413542 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3545,52 @@
28443545 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453546 cameraView.targetLookAt.set(radio.camera.lookAt);
28463547 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3548
+ //cameraView.lighttouched = true;
3549
+ Globals.lighttouched = true;
28483550 topView.object = group;
28493551 frontView.object = group;
28503552 sideView.object = group;
28513553 }
2852
- group.editWindow = this;
3554
+
3555
+// fix "+" issue
3556
+ //group.editWindow = this;
3557
+ group.manipWindow = this;
3558
+
28533559 /*
28543560 currentLayout = radio.layout;
28553561 if (currentLayout == null)
28563562 currentLayout = sevenButton;
28573563 */
28583564 radio.layout.doClick();
3565
+
3566
+ ClearUnpinned();
3567
+ //Grafreed.Assert(group != null);
3568
+ //Grafreed.Assert(group.selection != null);
3569
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3570
+ if (group.selection == null || group.selection.size() == 1)
3571
+ EditSelection(false);
28593572 keepparent = group.parent;
28603573 // PARENT = NULL or not???
28613574 //group.parent = null; // ROOT
28623575 //group.attributes = -1;
28633576 ResetModel();
3577
+
3578
+ cameraView.requestFocusInWindow();
28643579 refreshContents(true);
2865
- }
3580
+ } else if (event.getSource() == editCameraItem)
3581
+ {
3582
+ cameraView.ProtectCamera();
3583
+ cameraView.repaint();
3584
+ return;
3585
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3586
+ {
3587
+ cameraView.RevertCamera();
3588
+ cameraView.repaint();
3589
+ return;
3590
+ // } else if (event.getSource() == textureButton)
3591
+ // {
3592
+ // return; // true;
3593
+ }
28663594 else
28673595 {
28683596 //return super.action(event, arg);
....@@ -2871,7 +3599,6 @@
28713599 }
28723600
28733601 boolean useclient = false;
2874
- cRadio radio;
28753602
28763603 void ToggleRoot()
28773604 {
....@@ -2880,7 +3607,7 @@
28803607 if (useclient)
28813608 {
28823609 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3610
+ Globals.lighttouched = true;
28843611 //topView.object = client;
28853612 //frontView.object = client;
28863613 //sideView.object = client;
....@@ -2888,7 +3615,7 @@
28883615 else
28893616 {
28903617 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3618
+ Globals.lighttouched = true;
28923619 //topView.object = group;
28933620 //frontView.object = group;
28943621 //sideView.object = group;
....@@ -2923,6 +3650,28 @@
29233650 refreshContents();
29243651 }
29253652
3653
+ void TransformChildren()
3654
+ {
3655
+ Object3D obj;
3656
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3657
+ {
3658
+ obj = (Object3D)e.nextElement();
3659
+ obj.KeepTextureMatrices();
3660
+ obj.TransformChildren();
3661
+ obj.RestoreTextureMatrices();
3662
+
3663
+// if (obj.parent == null)
3664
+// {
3665
+// System.out.println("NULL PARENT!");
3666
+// new Exception().printStackTrace();
3667
+// }
3668
+// else
3669
+// TouchTransform(obj);
3670
+// //obj.parent.Touch();
3671
+ }
3672
+
3673
+ refreshContents();
3674
+ }
29263675
29273676 void ResetTransform()
29283677 {
....@@ -3035,7 +3784,7 @@
30353784 refreshContents();
30363785 }
30373786
3038
- void ResetCentroid()
3787
+ void ResetCentroid(boolean full)
30393788 {
30403789 Object3D obj;
30413790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3799,16 @@
30503799 LA.matIdentity(Object3D.mat);
30513800 obj.getBounds(minima, maxima, false);
30523801 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3802
+ if (full)
3803
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543804 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553805 obj.TransformMesh(Object3D.mat);
3806
+
30563807 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3808
+ if (full)
3809
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583810 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3811
+
30593812 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603813 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613814 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3837,8 @@
30843837
30853838 int size = obj.MemorySize();
30863839
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3840
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3841
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883842 }
30893843 }
30903844 catch (Exception e)
....@@ -3121,9 +3875,9 @@
31213875 obj = (Object3D)e.nextElement();
31223876
31233877 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3878
+ Grafreed.AnalyzeObject(obj);
31253879 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3880
+ Grafreed.AnalyzeObject(obj.bRep);
31273881
31283882 // System.err.println((size/1024) + " KB is the size of " + obj);
31293883 }
....@@ -3165,6 +3919,20 @@
31653919 void GenNormals(boolean crease)
31663920 {
31673921 group.GenNormalsS(crease);
3922
+
3923
+ refreshContents();
3924
+ }
3925
+
3926
+ void GenNormalsMESH()
3927
+ {
3928
+ group.GenNormalsMeshS();
3929
+
3930
+ refreshContents();
3931
+ }
3932
+
3933
+ void GenNormalsMINE()
3934
+ {
3935
+ group.selection.GenNormalsMINE();
31683936
31693937 refreshContents();
31703938 }
....@@ -3250,7 +4018,7 @@
32504018 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32514019 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32524020 //
3253
-// g.add(GraphreeD.clipboard);
4021
+// g.add(GrafreeD.clipboard);
32544022 //
32554023 // buffer.add(g);
32564024 // }
....@@ -3269,8 +4037,8 @@
32694037 // nodes = new Object3D();
32704038 // vertices = new Vector<Vertex>();
32714039 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
4040
+// boolean epsequal = GrafreeD.epsequal;
4041
+// GrafreeD.epsequal = true;
32744042 //
32754043 // for (int i=0; i<group.selection.size(); i++)
32764044 // {
....@@ -3311,7 +4079,7 @@
33114079 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124080 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134081 //
3314
-// g.add(GraphreeD.clipboard);
4082
+// g.add(GrafreeD.clipboard);
33154083 //
33164084 // buffer.add(g);
33174085 // }
....@@ -3319,7 +4087,7 @@
33194087 // makeSomething(buffer, i==group.selection.size()-1);
33204088 // }
33214089 //
3322
-// GraphreeD.epsequal = epsequal;
4090
+// GrafreeD.epsequal = epsequal;
33234091 //
33244092 // //buffer = null;
33254093 // temprep = null;
....@@ -3330,8 +4098,8 @@
33304098
33314099 void ParseVertices()
33324100 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4101
+ boolean epsequal = Grafreed.epsequal;
4102
+ Grafreed.epsequal = true;
33354103
33364104 for (int i=0; i<group.selection.size(); i++)
33374105 {
....@@ -3356,7 +4124,7 @@
33564124 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574125 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584126
3359
- g.add(GraphreeD.clipboard);
4127
+ g.add(Grafreed.clipboard);
33604128
33614129 buffer.add(g);
33624130 }
....@@ -3371,7 +4139,7 @@
33714139 makeSomething(buffer, i==group.selection.size()-1);
33724140 }
33734141
3374
- GraphreeD.epsequal = epsequal;
4142
+ Grafreed.epsequal = epsequal;
33754143
33764144 refreshContents();
33774145 }
....@@ -3389,7 +4157,16 @@
33894157 String pigment = Object3D.GetPigment(tex);
33904158 //String bump = Object3D.GetBump(tex);
33914159
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4160
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4161
+
4162
+ try
4163
+ {
4164
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4165
+ }
4166
+ catch (Exception e)
4167
+ {
4168
+ System.err.println("FAIL: " + node);
4169
+ }
33934170
33944171 double s = v.s;
33954172
....@@ -3416,7 +4193,7 @@
34164193 scale /= 3;
34174194
34184195 scale /= 0xFF;
3419
- scale /= 4;
4196
+ // c'est quoi ca? scale /= 4;
34204197
34214198 //v.AO = scale;
34224199
....@@ -3437,12 +4214,26 @@
34374214
34384215 void Align()
34394216 {
4217
+ if (group.selection.size() == 0)
4218
+ return;
4219
+
4220
+ cVector bbmin = new cVector();
4221
+ cVector bbmax = new cVector();
4222
+
4223
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4224
+
4225
+ double dx = bbmax.x - bbmin.x;
4226
+ double dy = bbmax.y - bbmin.y;
4227
+ double dz = bbmax.z - bbmin.z;
4228
+
4229
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4230
+
34404231 for (int i=0; i<group.selection.size(); i++)
34414232 {
34424233 Object3D obj = group.selection.get(i);
34434234
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4235
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4236
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464237 }
34474238
34484239 refreshContents();
....@@ -3455,7 +4246,7 @@
34554246 // ref.SaveSupports();
34564247 // Object3D par = ref.parent;
34574248 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4249
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594250 // ref.parent = par;
34604251 // ref.RestoreSupports();
34614252
....@@ -3463,11 +4254,11 @@
34634254
34644255 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654256
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4257
+ boolean random = CameraPane.SWITCH;
4258
+ CameraPane.SWITCH = false; // parse all random nodes
34684259 lowres.linkVerticesThis(null);
34694260 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4261
+ CameraPane.SWITCH = random;
34714262
34724263 System.err.flush();
34734264
....@@ -3485,7 +4276,7 @@
34854276 // lowres.SaveSupports();
34864277 // par = lowres.parent;
34874278 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4279
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894280 Object3D newlow = CloneObject(lowres, false);
34904281 newlow.name = sn.switchobject.get(i).name;
34914282 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4298,7 @@
35074298 return;
35084299
35094300 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4301
+ Object3D ref = Grafreed.clipboard.get(0);
35114302
35124303 Object3D newgroup = new Object3D("Po:" + poses.name);
35134304
....@@ -3676,7 +4467,7 @@
36764467 group.selection.RelinkToSupport(); // july 2014
36774468 System.out.println("DONE.");
36784469 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4470
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804471 }
36814472
36824473 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4492,20 @@
37014492
37024493 void ClipMesh()
37034494 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4495
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054496 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4497
+ Object3D content = Grafreed.clipboard.get(0);
37074498
37084499 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094500 content = ((cGroup)content).get(0);
37104501
37114502 // for (int i=0; i<group.selection.size(); i++)
37124503 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4504
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144505 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4506
+ group.selection.ClipMesh(Grafreed.clipboard);
37164507 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4508
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184509 System.out.println("DONE.");
37194510 refreshContents();
37204511 }
....@@ -3759,6 +4550,18 @@
37594550 void MarkLeaves(boolean hide)
37604551 {
37614552 group.selection.MarkLeaves(hide);
4553
+ refreshContents();
4554
+ }
4555
+
4556
+ void RewindLeaves(boolean hide)
4557
+ {
4558
+ group.selection.RewindLeaves(hide);
4559
+ refreshContents();
4560
+ }
4561
+
4562
+ void RandomLeaves(boolean hide)
4563
+ {
4564
+ group.selection.RandomLeaves(hide);
37624565 refreshContents();
37634566 }
37644567
....@@ -3833,28 +4636,25 @@
38334636 // }
38344637 // }
38354638
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38404639 void EditSelection(boolean newWindow)
38414640 {
4641
+ if (group.selection == null)
4642
+ {
4643
+ EditElement(group, newWindow); // ? new
4644
+ return;
4645
+ }
4646
+
38424647 // aConstraints.gridy = 0;
38434648 for (int i=0; i<group.selection.size(); i++)
38444649 {
38454650 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464651 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4652
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484653
38494654 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4655
+ if(elem != group || !newWindow)
38514656 {
3852
- // if (!(elem instanceof Composite))
3853
- // newWindow = false;
3854
- listUI.add(elem);
3855
- elem.openEditWindow(this, newWindow); //, false);
3856
- System.out.println("edit : " + elem);
3857
- elem.editWindow.refreshContents(true); // ? new
4657
+ EditElement(elem, newWindow); // ? new
38584658 }
38594659 }
38604660 }
....@@ -3929,7 +4729,8 @@
39294729 //new Exception().printStackTrace();
39304730
39314731 freezemodel = true;
3932
-
4732
+ ClearUnpinned();
4733
+
39334734 /**/
39344735 //switch (event.id)
39354736 {
....@@ -3937,7 +4738,6 @@
39374738 //case 702: // Event.LIST_DESELECT
39384739 group.deselectAll();
39394740 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414741 if (tps != null)
39424742 {
39434743 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +4746,39 @@
39464746
39474747 //if (child.parent != null)
39484748 //child.parent.addSelectee(child);
4749
+ objEditor.SetMaterial(child);
39494750 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534751 }
39544752 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4753
+// else
4754
+// {
4755
+// objEditor.SetMaterial(group); // .GetMaterial());
4756
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4757
+// System.err.println("info : " + group.GetPath());
4758
+// }
39614759
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4760
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654761 CameraPane.flash = true;
39664762
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4763
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684764 // a camera
39694765 {
3970
- CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4766
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4767
+ {
4768
+ CameraPane.camerachangeframe = 0; // don't refuse it
4769
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4770
+ }
4771
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4772
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744773 }
39754774
4775
+ if (tps != null && tps.length == 1)
4776
+ {
4777
+ EditSelection(false);
4778
+ }
4779
+
4780
+ SetPinStates(tps != null && tps.length > 0);
4781
+
39764782 refreshContents();
39774783 //return true;
39784784 }
....@@ -3981,6 +4787,35 @@
39814787
39824788 freezemodel = false;
39834789 }
4790
+
4791
+ void SetPinStates(boolean enabled)
4792
+ {
4793
+ editButton.setEnabled(enabled);
4794
+ uneditButton.setEnabled(enabled);
4795
+ unselectButton.setEnabled(enabled);
4796
+ flashSelectionButton.setEnabled(enabled);
4797
+ }
4798
+
4799
+ void refreshContents(boolean cp)
4800
+ {
4801
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4802
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4803
+ {
4804
+ objEditor.ClearInfo(); // .GetMaterial());
4805
+
4806
+ for (int i=0; i < group.selection.Size(); i++)
4807
+ {
4808
+ Object3D child = (Object3D) group.selection.get(i);
4809
+
4810
+ objEditor.AddInfo(child, this, true);
4811
+ System.err.println("info : " + child.GetPath());
4812
+ }
4813
+
4814
+ objEditor.SetText(); // jan 2014
4815
+ }
4816
+
4817
+ super.refreshContents(cp);
4818
+ }
39844819
39854820 void linkSomething(Object3D thing)
39864821 {
....@@ -4052,16 +4887,19 @@
40524887 {
40534888 if (group.selection.isEmpty())
40544889 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4890
+
4891
+ Grafreed.clipboardIsTempGroup = false;
40564892 Composite tGroup = null;
40574893 if (group.selection.size() > 0) // 1)
40584894 {
40594895 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4896
+ Grafreed.clipboardIsTempGroup = true;
40614897 }
40624898
40634899 if (cut)
40644900 {
4901
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4902
+// Save();
40654903 //int indices[] = jList.getSelectedIndices();
40664904 //for (int i = indices.length - 1; i >= 0; i--)
40674905 //jList.remove(indices[i]);
....@@ -4097,16 +4935,16 @@
40974935 //System.out.println("cut " + child);
40984936 //System.out.println("parent = " + child.parent);
40994937 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4938
+ if (Grafreed.clipboardIsTempGroup)
41014939 tGroup.add/*Child*/(tmp);
41024940 else
4103
- GraphreeD.clipboard = tmp;
4941
+ Grafreed.clipboard = tmp;
41044942 }
41054943 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4944
+ if (Grafreed.clipboardIsTempGroup)
41074945 tGroup.add/*Child*/(child);
41084946 else
4109
- GraphreeD.clipboard = child;
4947
+ Grafreed.clipboard = child;
41104948 }
41114949
41124950 //ResetModel();
....@@ -4138,21 +4976,23 @@
41384976 //System.out.println("cut " + elem);
41394977 //System.out.println("parent = " + elem.parent);
41404978 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4979
+ if (Grafreed.clipboardIsTempGroup)
41424980 tGroup.add/*Child*/(tmp);
41434981 else
4144
- GraphreeD.clipboard = tmp;
4982
+ Grafreed.clipboard = tmp;
41454983 }
41464984 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4985
+ if (Grafreed.clipboardIsTempGroup)
41484986 tGroup.add/*Child*/(child);
41494987 else
4150
- GraphreeD.clipboard = child;
4988
+ Grafreed.clipboard = child;
41514989 }
41524990
41534991 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4992
+
4993
+ if (Grafreed.clipboardIsTempGroup)
4994
+ Grafreed.clipboard = tGroup;
4995
+
41564996 if (cut)
41574997 {
41584998 ResetModel();
....@@ -4162,11 +5002,15 @@
41625002
41635003 void paste(boolean expand)
41645004 {
4165
- // if (GraphreeD.clipboard == null)
5005
+ if (Globals.REPLACEONMAKE)
5006
+ Save();
5007
+ boolean keep = Globals.REPLACEONMAKE;
5008
+ Globals.REPLACEONMAKE = false;
5009
+ // if (GrafreeD.clipboard == null)
41665010 // return;
41675011 boolean first = true;
41685012
4169
- if (GraphreeD.clipboardIsTempGroup)
5013
+ if (Grafreed.clipboardIsTempGroup)
41705014 {
41715015 Composite temp;
41725016
....@@ -4177,7 +5021,7 @@
41775021 temp = (Composite)Applet3D.clipboard.deepCopy();
41785022 */
41795023 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5024
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41815025 {
41825026 Object3D child = (Object3D)e.nextElement();
41835027
....@@ -4191,7 +5035,7 @@
41915035 else
41925036 elem = child.deepCopy(); // ?
41935037 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5038
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41955039 // elem = elem.get(0);
41965040 makeSomething(elem, true); // ?? first);
41975041 //group.addChild(elem);
....@@ -4211,23 +5055,24 @@
42115055 //Object3D cb = Applet3D.clipboard;
42125056 //temp.addChild(cb);
42135057 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
5058
+ assert(Grafreed.clipboard.parent == null);
5059
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5060
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5061
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5062
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42195063 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5064
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5065
+ Grafreed.clipboard.get(0).parent = keepparent;
42225066 }
42235067
5068
+ Globals.REPLACEONMAKE = keep;
42245069 ResetModel();
42255070 refreshContents();
42265071 }
42275072
4228
- void pasteInto(boolean copyit)
5073
+ void pasteInto(boolean copyit, boolean clone)
42295074 {
4230
-// if (GraphreeD.clipboard == null)
5075
+// if (GrafreeD.clipboard == null)
42315076 // return;
42325077
42335078 if (group.selection.size() != 1)
....@@ -4254,15 +5099,22 @@
42545099 if (copyit)
42555100 {
42565101 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5102
+ if (clone)
5103
+ {
5104
+ CloneClipboard(false); // sept 2014
5105
+ }
5106
+ else
5107
+ {
5108
+ paste(false);
5109
+ }
42585110 }
42595111 else
42605112 {
42615113 boolean first = true;
42625114
4263
- if (GraphreeD.clipboardIsTempGroup)
5115
+ if (Grafreed.clipboardIsTempGroup)
42645116 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5117
+ Composite temp = (Composite)Grafreed.clipboard;
42665118 Object3D copy;
42675119 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685120 {
....@@ -4272,7 +5124,7 @@
42725124 }
42735125 } else
42745126 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5127
+ linkSomething(Grafreed.clipboard); //.get(0));
42765128 }
42775129 }
42785130 }
....@@ -4349,6 +5201,10 @@
43495201
43505202 void group(Object3D csg, boolean grab)
43515203 {
5204
+ if (Globals.REPLACEONMAKE)
5205
+ Save();
5206
+ boolean keep = Globals.REPLACEONMAKE;
5207
+ Globals.REPLACEONMAKE = false;
43525208 if (//false) // why??
43535209 !group.selection.isEmpty())
43545210 {
....@@ -4462,8 +5318,34 @@
44625318 //node.add(csg);
44635319 //makeSomething(node);
44645320 makeSomething(csg);
5321
+ Globals.REPLACEONMAKE = keep;
44655322 }
44665323
5324
+ void Ungroup(Object3D g)
5325
+ {
5326
+ if (Globals.REPLACEONMAKE)
5327
+ Save();
5328
+ boolean keep = Globals.REPLACEONMAKE;
5329
+ Globals.REPLACEONMAKE = false;
5330
+ if (g instanceof HiddenObject)
5331
+ {
5332
+ HiddenObject h = (HiddenObject) g;
5333
+
5334
+ for (int i=0; i<h.ActualSize(); i++)
5335
+ {
5336
+ objEditor.makeSomething(h.get(i), false);
5337
+ }
5338
+ }
5339
+ else
5340
+ {
5341
+ for (int i=0; i<g.Size(); i++)
5342
+ {
5343
+ objEditor.makeSomething(g.get(i), false);
5344
+ }
5345
+ }
5346
+ Globals.REPLACEONMAKE = keep;
5347
+ }
5348
+
44675349 void ungroup()
44685350 {
44695351 /*
....@@ -4657,21 +5539,6 @@
46575539 }
46585540 */
46595541
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755542 /*
46765543 public void Callback(Object obj)
46775544 {
....@@ -4695,26 +5562,9 @@
46955562 }
46965563 */
46975564
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155565 String GetFile(String dialogName)
47165566 {
4717
- if (GraphreeD.standAlone)
5567
+ if (Grafreed.standAlone)
47185568 {
47195569 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205570 browser.show();
....@@ -4778,10 +5628,33 @@
47785628 cButton flashSelectionButton;
47795629 cButton editButton;
47805630 cButton uneditButton;
5631
+ JCheckBox allParamsButton;
47815632 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835633 cButton unselectButton;
47845634
5635
+ cButton restoreCameraButton;
5636
+
5637
+ cButton saveButton;
5638
+ cButton oneStepButton;
5639
+
5640
+ cButton groupButton;
5641
+ cButton ungroupButton;
5642
+ cButton compositeButton;
5643
+ cButton switchButton;
5644
+ cButton loopButton;
5645
+ cButton textureButton;
5646
+
5647
+ cButton gridButton;
5648
+ cButton boxButton;
5649
+ cButton sphereButton;
5650
+ cButton coneButton;
5651
+ cButton torusButton;
5652
+ cButton superButton;
5653
+ cButton kleinButton;
5654
+ cButton particlesButton;
5655
+ cButton overlayButton;
5656
+ cButton lightButton;
5657
+
47855658 cButton screenfitButton;
47865659 cButton screenfitpointButton;
47875660 cButton snapobjectButton;
....@@ -4793,14 +5666,6 @@
47935666
47945667 cButton setsupportButton;
47955668
4796
- cButton twoButton;
4797
- cButton sixButton;
4798
- cButton threeButton;
4799
- cButton sevenButton;
4800
- cButton fourButton; // full panel
4801
- cButton oneButton; // full XYZ
4802
- //cButton currentLayout;
4803
-
48045669 //
48055670 //Composite
48065671 Object3D // to do !!
....@@ -4810,9 +5675,11 @@
48105675 //JTree jTree;
48115676 private MenuItem lookAtItem;
48125677 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
5678
+ private MenuItem switchViewItem;
48145679 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5680
+ private MenuItem undoItem;
5681
+ private MenuItem redoItem;
5682
+ private JMenuItem duplicateItem;
48165683 private MenuItem cloneItem;
48175684 private MenuItem cloneSupportItem;
48185685 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5690,9 @@
48235690 private MenuItem resetsupportItem;
48245691 private MenuItem resetreferencesItem;
48255692 private MenuItem linkverticesItem;
5693
+ private MenuItem relinkverticesItem;
48265694 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5695
+ private MenuItem resetAllItem;
48285696 private MenuItem stepAllItem;
48295697 private MenuItem revertMeshItem;
48305698 private MenuItem poseMeshItem;
....@@ -4835,14 +5703,17 @@
48355703 private MenuItem mergeGeometriesItem;
48365704 private MenuItem copyItem;
48375705 private MenuItem pasteItem;
5706
+ private MenuItem pasteIntoItem;
48385707 private MenuItem pasteLinkItem;
48395708 private MenuItem pasteCloneItem;
48405709 private MenuItem pasteExpandItem;
4841
- private MenuItem clearItem;
5710
+ private MenuItem deleteItem;
48425711 private MenuItem clearAllItem;
48435712 private MenuItem genUVItem;
5713
+ private MenuItem genNormalsMESHItem;
48445714 private MenuItem genNormalsCADItem;
48455715 private MenuItem genNormalsORGANItem;
5716
+ private MenuItem genNormalsMINEItem;
48465717 private MenuItem stripifyItem;
48475718 private MenuItem unstripifyItem;
48485719 private MenuItem trimItem;
....@@ -4871,6 +5742,10 @@
48715742 private MenuItem showleavesItem;
48725743 private MenuItem markleavesItem;
48735744 private MenuItem unmarkleavesItem;
5745
+ private MenuItem rewindleavesItem;
5746
+ private MenuItem unrewindleavesItem;
5747
+ private MenuItem randomleavesItem;
5748
+ private MenuItem unrandomleavesItem;
48745749
48755750 private MenuItem flipVItem;
48765751 private MenuItem unflipVItem;
....@@ -4882,14 +5757,17 @@
48825757 private MenuItem panoTexturesItem;
48835758
48845759 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5760
+ private MenuItem resetCentroidXZItem;
48865761 private MenuItem resetTransformItem;
5762
+ private MenuItem transformGeometryItem;
5763
+ private MenuItem transformChildrenItem;
5764
+ private MenuItem hideItem;
48875765 private MenuItem grabItem;
48885766 private MenuItem backItem;
48895767 private MenuItem frontItem;
48905768 private MenuItem cameraItem;
48915769 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
5770
+ private MenuItem switchItem;
48935771 private MenuItem physicsItem;
48945772 private MenuItem frameselectorItem;
48955773 private MenuItem scriptNodeItem;
....@@ -4904,6 +5782,7 @@
49045782
49055783 private MenuItem resetParentItem;
49065784 private MenuItem repairParentItem;
5785
+ private MenuItem repairShadowItem;
49075786 private MenuItem sortbysizeItem;
49085787 private MenuItem sortbynameItem;
49095788
....@@ -4924,10 +5803,11 @@
49245803 private MenuItem coneItem;
49255804 private MenuItem torusItem;
49265805 private MenuItem superItem;
5806
+ private MenuItem kleinItem;
49275807 private MenuItem blobItem;
49285808 private MenuItem latheItem;
49295809 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5810
+ private MenuItem overlayItem;
49315811 private MenuItem meshItem;
49325812 // private MenuItem meshGroupItem;
49335813 private MenuItem springItem;
....@@ -4936,6 +5816,7 @@
49365816 private MenuItem csgItem;
49375817 private MenuItem templateItem;
49385818 private MenuItem textureItem;
5819
+ private MenuItem billboardItem;
49395820 private MenuItem shadowXItem;
49405821 private MenuItem shadowYItem;
49415822 private MenuItem shadowZItem;
....@@ -4948,11 +5829,6 @@
49485829 private MenuItem doubleItem;
49495830 private MenuItem tripleItem;
49505831
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565832 private MenuItem computeAOItem;
49575833 private MenuItem recompileItem;
49585834 private MenuItem editScriptItem;
....@@ -4962,4 +5838,8 @@
49625838 private MenuItem analyzeItem;
49635839 private MenuItem dumpItem;
49645840 //boolean freezemodel = false;
5841
+
5842
+ Menu cameraMenu;
5843
+ MenuItem editCameraItem;
5844
+ MenuItem restoreCameraItem;
49655845 }