Normand Briere
2019-07-18 d7a17c35c443e2cb6c09eaa3cfeaf590a571faa1
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);
208
+ menu.add("-");
187209 clearItem = menu.add(new MenuItem("Clear"));
188210 clearItem.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("My 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,230 @@
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);
688
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
+ twoButton.setToolTipText("Show center view only");
519690 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
691
+ this.fullscreenLayout = twoButton;
692
+
693
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521694 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
695
+ fourButton.setToolTipText("Show left panel only");
696
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
+ sixButton.setToolTipText("2-column layout left");
523698 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
699
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ threeButton.setToolTipText("2-column layout right");
525701 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
702
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
+ sevenButton.setToolTipText("3-column layout");
527704 sevenButton.addActionListener(this);
528705 //
529706
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
707
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ rootButton.setToolTipText("Edit selection in new tab");
531709 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
710
+
711
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
712
+ closeButton.setToolTipText("Close tab");
534713 closeButton.addActionListener(this);
535714 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536715 //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;
545716
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
717
+ // INSERT
718
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ gridButton.setToolTipText("Create grid");
720
+ gridButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ boxButton.setToolTipText("Create box");
724
+ boxButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ sphereButton.setToolTipText("Create sphere");
728
+ sphereButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ coneButton.setToolTipText("Create cone");
732
+ coneButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ torusButton.setToolTipText("Create torus");
736
+ torusButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ superButton.setToolTipText("Create superellipsoid");
740
+ superButton.addActionListener(this);
741
+
742
+ if (Globals.ADVANCED)
743
+ {
744
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ kleinButton.setToolTipText("Create Klein bottle");
746
+ kleinButton.addActionListener(this);
747
+ }
748
+
749
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750
+ particlesButton.setToolTipText("Create particle system");
751
+ particlesButton.addActionListener(this);
752
+
753
+ oe.toolboxPanel.Return();
754
+
755
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
756
+ groupButton.setToolTipText("Create group");
757
+ groupButton.addActionListener(this);
758
+
759
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ compositeButton.setToolTipText("Create composite");
761
+ compositeButton.addActionListener(this);
762
+
763
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ switchButton.setToolTipText("Create item switcher");
765
+ switchButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ loopButton.setToolTipText("Create loop");
769
+ loopButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ textureButton.setToolTipText("Create texture");
773
+ textureButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ overlayButton.setToolTipText("Create overlay");
777
+ overlayButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ lightButton.setToolTipText("Create light");
781
+ lightButton.addActionListener(this);
782
+
783
+ for (int i=6; --i>=0;)
784
+ {
785
+ oe.toolboxPanel.Return();
786
+ oe.toolboxPanel.add(new cGridBag());
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
+ }
794
+
795
+ // EDIT panel
796
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ editButton.setToolTipText("Pin selection controls");
798
+ editButton.addActionListener(this);
799
+
800
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ uneditButton.setToolTipText("Remove selection controls");
547802 uneditButton.addActionListener(this);
548803
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);
804
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
805
+ allParamsButton.setToolTipText("Show all controle");
561806 allParamsButton.addActionListener(this);
562807
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);
808
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ clearPanelButton.setToolTipText("Clear edit panel");
810
+ clearPanelButton.addActionListener(this);
811
+
812
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
813
+ unselectButton.setToolTipText("Unselect");
568814 unselectButton.addActionListener(this);
569815
816
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ flashSelectionButton.setToolTipText("Highlight selection");
818
+ flashSelectionButton.addActionListener(this);
819
+
820
+ editCommandsPanel.preferredHeight = 1;
821
+
822
+ SetPinStates(false);
823
+// oe.treePanel.add(commandsPanel);
824
+// oe.treePanel.Return();
825
+
570826 // oe.aConstraints.gridx += 1;
571827 // oe.aConstraints.weighty = 0;
572828 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +834,25 @@
578834 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579835 // gcButton.addActionListener(this);
580836
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;
837
+ cGridBag jSPPanel = new cGridBag();
838
+
839
+ JScrollPane jSP;
592840 //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);
841
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594842 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;
614843
844
+ oe.treePanel.add(jSPPanel);
845
+ oe.treePanel.Return();
846
+
847
+ oe.treePanel.add(copyOptionsPanel);
848
+ oe.treePanel.Return();
849
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
850
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
851
+ sliderPane.preferredHeight = 1;
852
+
853
+// mainPanel.setDividerLocation(0.5); //1.0);
854
+// mainPanel.setResizeWeight(0.5);
855
+
615856 //jList.addListSelectionListener(this);
616857 oe.jTree.addTreeSelectionListener(this);
617858 //jTree.setRootVisible(false);
....@@ -633,20 +874,157 @@
633874 radio.layout = sevenButton;
634875 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635876 }
877
+
878
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
879
+ {
880
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
881
+ colorCB.setToolTipText("Copy color when dropped");
882
+ colorCB.addItemListener(this);
883
+
884
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
885
+ materialCB.setToolTipText("Copy material when dropped");
886
+ materialCB.addItemListener(this);
887
+
888
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
889
+ textureCB.setToolTipText("Copy texture when dropped");
890
+ textureCB.addItemListener(this);
891
+
892
+ panel.Return();
893
+
894
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
895
+ boxCB.setToolTipText("Display bounding boxes");
896
+ boxCB.addItemListener(this);
897
+
898
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
899
+ zoomBoxCB.setToolTipText("Display only for wheel");
900
+ zoomBoxCB.addItemListener(this);
901
+
902
+ if (true) // Globals.ADVANCED)
903
+ {
904
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
905
+// supportCB.setToolTipText("Enable rigging");
906
+// supportCB.addItemListener(this);
907
+
908
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
909
+ freezeCB.setToolTipText("Fast moving camera");
910
+ freezeCB.addItemListener(this);
911
+
912
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
913
+ // localCB.addItemListener(this);
914
+
915
+ panel.Return();
916
+
917
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
918
+ crowdCB.setToolTipText("Used for crowds");
919
+ crowdCB.addItemListener(this);
920
+
921
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
922
+ smoothCB.setToolTipText("Snapping delay");
923
+ smoothCB.addItemListener(this);
924
+
925
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
926
+ slowCB.setToolTipText("Smooth interpolation");
927
+ slowCB.addItemListener(this);
928
+
929
+// constraints.gridy += 1;
930
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
931
+// speakerMocapCB.addItemListener(this);
932
+
933
+ panel.Return();
934
+
935
+ if (false)
936
+ {
937
+ // handled in scripts
938
+ //constraints.gridy += 1;
939
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
940
+ speakerCameraCB.addItemListener(this);
941
+
942
+ //constraints.gridy += 1;
943
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
944
+ speakerFocusCB.addItemListener(this);
945
+
946
+ //constraints.gridy += 1;
947
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
948
+ smoothfocusCB.addItemListener(this);
949
+ panel.Return();
950
+ }
951
+
952
+//constraints.gridx += 1;
953
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
954
+// debugCB.addItemListener(this);
955
+
956
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
957
+ trackCB.setToolTipText("Enable tracking target");
958
+ trackCB.addItemListener(this);
959
+
960
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
961
+ oeilCB.setToolTipText("Move camera when tracking");
962
+ oeilCB.addItemListener(this);
963
+
964
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
965
+ shadowCB.setToolTipText("When live compute shadows");
966
+ shadowCB.addItemListener(this);
967
+
968
+ panel.Return();
969
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
970
+ toggleTextureCB.setToolTipText("Load textures");
971
+ toggleTextureCB.addItemListener(this);
972
+
973
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
974
+ toggleSwitchCB.setToolTipText("Choose a single item");
975
+ toggleSwitchCB.addItemListener(this);
976
+
977
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
978
+ autokeepCB.setToolTipText("On structure change");
979
+ autokeepCB.addItemListener(this);
980
+
981
+ panel.Return();
982
+ if (Globals.ADVANCED)
983
+ {
984
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
985
+ lookAtCB.setToolTipText("Look-at target");
986
+ lookAtCB.addItemListener(this);
987
+ }
988
+
989
+ }
990
+
991
+ cGridBag fill = new cGridBag();
992
+ fill.preferredHeight = 200;
993
+ cGridBag fill2 = new cGridBag();
994
+ fill2.preferredHeight = 200;
995
+ cGridBag fill3 = new cGridBag();
996
+ fill3.preferredHeight = 200;
997
+
998
+ panel.add(fill);
999
+ panel.add(fill2);
1000
+ panel.add(fill3);
1001
+
1002
+ }
6361003
6371004 void EditObject(Object3D obj)
6381005 {
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();
1006
+ cRadio radioButton = new cRadio(obj.name);
1007
+
1008
+ // June 2019. Patch to avoid bug with transparency.
1009
+ radioButton.hadMaterial = obj.material != null;
1010
+ if (!radioButton.hadMaterial)
1011
+ {
1012
+ obj.material = new cMaterial();
1013
+ }
1014
+
1015
+ radioButton.SetObject(obj);
1016
+ radioButton.layout = sevenButton;
1017
+ radioButton.SetCamera(cameraView.renderCamera, false);
1018
+ radioButton.addActionListener(this);
1019
+ radioPanel.add(radioButton);
1020
+ buttonGroup.add(radioButton);
1021
+ radioButton.doClick();
6471022 }
1023
+
6481024 void SetupViews(ObjEditor oe)
6491025 {
1026
+ theFrame = this;
1027
+
6501028 oe.SetupViews();
6511029
6521030 System.out.println("SetupViews");
....@@ -655,22 +1033,28 @@
6551033 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561034 }
6571035
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;
1036
+ cToggleButton liveCB;
1037
+ cCheckBox supportCB;
1038
+ cCheckBox localCB;
1039
+ cCheckBox crowdCB;
1040
+ cCheckBox smoothCB;
1041
+ cToggleButton fastCB;
1042
+ cCheckBox slowCB;
1043
+ cCheckBox boxCB;
1044
+ cCheckBox zoomBoxCB;
1045
+ cCheckBox freezeCB;
1046
+ //cToggleButton trackCB;
1047
+ cCheckBox trackCB;
1048
+ cCheckBox smoothfocusCB;
6681049 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1050
+ cCheckBox speakerCameraCB;
1051
+ cCheckBox speakerFocusCB;
1052
+ cCheckBox debugCB;
1053
+
1054
+ cCheckBox oeilCB;
1055
+ cCheckBox shadowCB;
1056
+ cCheckBox autokeepCB;
1057
+ cCheckBox lookAtCB;
6741058
6751059 // static int COLOR = 1;
6761060 // static int MATERIAL = 2;
....@@ -678,9 +1062,9 @@
6781062
6791063 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801064
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1065
+ cCheckBox colorCB;
1066
+ cCheckBox materialCB;
1067
+ cCheckBox textureCB;
6841068
6851069 public void itemStateChanged(ItemEvent e)
6861070 {
....@@ -705,10 +1089,10 @@
7051089 dropAttributes |= Object3D.TEXTURE;
7061090 else
7071091 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1092
+ } else if(e.getSource() == liveCB)
7101093 {
7111094 cameraView.ToggleLive();
1095
+ refreshContents(false);
7121096 }
7131097 else if(e.getSource() == supportCB)
7141098 {
....@@ -744,6 +1128,10 @@
7441128 cameraView.repaint();
7451129 // refreshContents();
7461130 }
1131
+ else if(e.getSource() == zoomBoxCB)
1132
+ {
1133
+ cameraView.ToggleZoomBoxMode();
1134
+ }
7471135 else if(e.getSource() == smoothfocusCB)
7481136 {
7491137 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1157,18 @@
7691157 {
7701158 cameraView.ToggleOeil();
7711159 }
1160
+ else if(e.getSource() == shadowCB)
1161
+ {
1162
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1163
+ }
1164
+ else if(e.getSource() == freezeCB)
1165
+ {
1166
+ Globals.FREEZEONMOVE ^= true;
1167
+ }
1168
+ else if(e.getSource() == autokeepCB)
1169
+ {
1170
+ Globals.REPLACEONMAKE ^= true;
1171
+ }
7721172 else if(e.getSource() == lookAtCB)
7731173 {
7741174 cameraView.ToggleLookAt();
....@@ -785,7 +1185,8 @@
7851185
7861186 /**/
7871187 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1188
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1189
+ TreePath path = objEditor.jTree.getSelectionPath();
7891190 if ((path == null) || (path.getPathCount() <= 1)) {
7901191 // We can't move the root node or an empty selection
7911192 return;
....@@ -848,8 +1249,6 @@
8481249 }
8491250 }
8501251
851
- String string = (String) object;
852
-
8531252 System.out.println("Transfer = " + object + "; drop : " + target);
8541253 // if( object instanceof java.io.File[])
8551254 // {
....@@ -857,7 +1256,11 @@
8571256 // objEditor.DropFile((java.io.File[]) object, true);
8581257 // return;
8591258 // }
860
- if (string.charAt(0) == '/')
1259
+
1260
+ String string = object.toString();
1261
+
1262
+ // File path for Mac and Windows
1263
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611264 {
8621265 // file(s)
8631266 String[] names = string.split("\n");
....@@ -884,7 +1287,7 @@
8841287
8851288 flashIt = false;
8861289 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1290
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881291 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891292
8901293 if (group.selection.size() == 1)
....@@ -900,23 +1303,33 @@
9001303
9011304 assert target == objEditor.jTree;
9021305 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1306
+ Object3D destinationLeaf;
9031307 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1308
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051309 } catch (Exception e) {
9061310 System.out.println("destinationPath : " + destinationPath);
9071311 return;
9081312 }
9091313
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1314
+ for (int i=group.selection.size(); --i>=0;)
9111315 {
1316
+ Object3D child = (Object3D)group.selection.elementAt(i);
1317
+
1318
+ // Cannot move into itself
1319
+ if (child == destinationLeaf)
1320
+ return;
1321
+ }
1322
+
1323
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1324
+// {
9121325 loadClipboard(true);
9131326 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1327
+ pasteInto(false, false);
1328
+// } else {
1329
+// loadClipboard(false);
1330
+// objEditor.jTree.setSelectionPath(destinationPath);
1331
+// pasteInto(false, false); // true); // ???
1332
+// }
9201333 }
9211334 public void dropActionChanged(DropTargetDragEvent dtde)
9221335 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1434,107 @@
10211434 {
10221435 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231436 //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);
1437
+// gridItem = menu.add(new MenuItem("Grid"));
1438
+// gridItem.addActionListener(this);
1439
+// rectoidItem = menu.add(new MenuItem("Box"));
1440
+// rectoidItem.addActionListener(this);
1441
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1442
+// ellipsoidItem.addActionListener(this);
1443
+// coneItem = menu.add(new MenuItem("Cone"));
1444
+// coneItem.addActionListener(this);
1445
+// torusItem = menu.add(new MenuItem("Torus"));
1446
+// torusItem.addActionListener(this);
1447
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1448
+// superItem.addActionListener(this);
1449
+
1450
+ cameraItem = menu.add(new MenuItem("Camera"));
1451
+ cameraItem.addActionListener(this);
1452
+
1453
+ if (!Globals.ADVANCED)
1454
+ {
1455
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1456
+ kleinItem.addActionListener(this);
1457
+ }
1458
+
1459
+// particleItem = menu.add(new MenuItem("Particle system"));
1460
+// particleItem.addActionListener(this);
1461
+ if (Globals.ADVANCED)
1462
+ {
10381463 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391464 ragdollItem.addActionListener(this);
10401465 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411466 ragdoll2Item.addActionListener(this);
1467
+ }
10421468 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1469
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441470 meshItem.addActionListener(this);
10451471 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461472 // meshGroupItem.addActionListener(this);
1473
+ if (Globals.ADVANCED)
1474
+ {
10471475 springItem = menu.add(new MenuItem("Spring"));
10481476 springItem.addActionListener(this);
10491477 flagItem = menu.add(new MenuItem("Flag"));
10501478 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);
10551479 blobItem = menu.add(new MenuItem("Blob"));
10561480 blobItem.addActionListener(this);
10571481 latheItem = menu.add(new MenuItem("Lathe"));
10581482 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1483
+ }
1484
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1485
+ bezierItem.addActionListener(this);
1486
+// overlayItem = menu.add(new MenuItem("Overlay"));
1487
+// overlayItem.addActionListener(this);
1488
+// lightItem = menu.add(new MenuItem("Light"));
1489
+// lightItem.addActionListener(this);
10611490 menu.add("-");
10621491 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631492 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1493
+// loopItem = menu.add(new MenuItem("Loop"));
1494
+// loopItem.addActionListener(this);
10661495 doubleItem = menu.add(new MenuItem("Fork"));
10671496 doubleItem.addActionListener(this);
1497
+ if (Globals.ADVANCED)
1498
+ {
10681499 tripleItem = menu.add(new MenuItem("Trident"));
10691500 tripleItem.addActionListener(this);
1501
+ }
10701502 }
10711503
10721504 void buildToolsMenu(Menu menu)
10731505 {
10741506 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751507 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1508
+ animationItem.setState(Globals.ANIMATION);
1509
+
1510
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1511
+ archiveItem.addActionListener(this);
10771512
10781513 menu.add("-");
10791514 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801515 parseverticesItem.addActionListener(this);
10811516 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821517 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1518
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841519 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871520 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881521 reduceMorphItem.addActionListener(this);
10891522 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901523 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941524 menu.add("-");
1095
-
10961525 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971526 memoryItem.addActionListener(this);
1527
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1528
+ computeAOItem.addActionListener(this);
1529
+
1530
+ if (Globals.ADVANCED)
1531
+ {
1532
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1533
+ mirrorItem.addActionListener(this);
1534
+ menu.add("-");
10981535 menu.add(analyzeItem = new MenuItem("Analyze"));
10991536 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1537
+ menu.add(dumpItem = new MenuItem("Print"));
11011538 dumpItem.addActionListener(this);
11021539 // menu.add(pathItem = new MenuItem("From-to path"));
11031540 // pathItem.addActionListener(this);
....@@ -1106,6 +1543,8 @@
11061543 resetParentItem.addActionListener(this);
11071544 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081545 repairParentItem.addActionListener(this);
1546
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1547
+ repairShadowItem.addActionListener(this);
11091548 menu.add(invariantsItem = new MenuItem("Invariants"));
11101549 invariantsItem.addActionListener(this);
11111550 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1552,7 @@
11131552 menu.add("-");
11141553 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151554 editScriptItem.addActionListener(this);
1555
+ }
11161556 }
11171557
11181558 void ScreenFit()
....@@ -1235,9 +1675,24 @@
12351675 shadow.material = new cMaterial(obj.material);
12361676 shadow.material.diffuse = 0.0001f;
12371677 shadow.material.specular = 0.0001f;
1678
+ //shadow.projectedVertices[1].x = 300;
12381679
12391680 makeSomething(shadow);
12401681 }
1682
+
1683
+ private void ClearUnpinned()
1684
+ {
1685
+ //for (Object3D obj : listUI)
1686
+ for (int i=listUI.size(); --i>=0;)
1687
+ {
1688
+ Object3D obj = listUI.elementAt(i);
1689
+ if (!obj.pinned)
1690
+ {
1691
+ obj.CloseUI();
1692
+ listUI.remove(i);
1693
+ }
1694
+ }
1695
+ }
12411696
12421697 /**
12431698 * applyExample
....@@ -1441,9 +1896,9 @@
14411896
14421897 void Overwrite(int mask)
14431898 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1899
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451900 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1901
+ Object3D content = Grafreed.clipboard.get(0);
14471902
14481903 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491904 content = ((cGroup)content).get(0);
....@@ -1466,6 +1921,7 @@
14661921 //
14671922 public void actionPerformed(ActionEvent event) // , Object arg)
14681923 {
1924
+ Object source = event.getSource();
14691925 /*
14701926 if (event.getSource() == nameField)
14711927 {
....@@ -1477,11 +1933,11 @@
14771933 }
14781934 else
14791935 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1936
+ if (source == lookAtItem || source == lookFromItem)
14811937 {
14821938 ScreenFit();
14831939 } else
1484
- if (event.getSource() == switchItem)
1940
+ if (source == switchViewItem)
14851941 {
14861942 cVector v1 = new cVector();
14871943 cVector v2 = new cVector();
....@@ -1490,11 +1946,11 @@
14901946 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911947 objEditor.cameraView.repaint();
14921948 } else
1493
- if (event.getSource() == rectoidItem)
1949
+ if (source == rectoidItem || source == boxButton)
14941950 {
14951951 makeSomething(new Box());
14961952 } else
1497
- if (event.getSource() == particleItem)
1953
+ if (source == particleItem || source == particlesButton)
14981954 {
14991955 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001956 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1971,9 @@
15151971 applyExample(particleGeom, "SMOKE");
15161972 makeSomething(particleGeom);
15171973 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1974
+ if (source == ragdollItem || source == ragdoll2Item)
15191975 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1976
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211977
15221978 ragdoll.toParent = LA.newMatrix();
15231979 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1991,7 @@
15351991 } else
15361992 /*
15371993 */
1538
- if (event.getSource() == heightFieldItem)
1994
+ if (source == heightFieldItem)
15391995 {
15401996 Object3D obj = new Object3D();
15411997
....@@ -1573,27 +2029,31 @@
15732029
15742030 makeSomething(obj);
15752031 } else
1576
- if (event.getSource() == gridItem)
2032
+ if (source == gridItem || source == gridButton)
15772033 {
15782034 makeSomething(new Grid());
15792035 } else
1580
- if (event.getSource() == ellipsoidItem)
2036
+ if (source == ellipsoidItem || source == sphereButton)
15812037 {
15822038 makeSomething(new Sphere());
15832039 } else
1584
- if (event.getSource() == coneItem)
2040
+ if (source == coneItem || source == coneButton)
15852041 {
15862042 makeSomething(new Cone());
15872043 } else
1588
- if (event.getSource() == torusItem)
2044
+ if (source == torusItem || source == torusButton)
15892045 {
15902046 makeSomething(new Torus());
15912047 } else
1592
- if (event.getSource() == superItem)
2048
+ if (source == superItem || source == superButton)
15932049 {
15942050 makeSomething(new Superellipsoid());
15952051 } else
1596
- if (event.getSource() == blobItem)
2052
+ if (source == kleinItem || source == kleinButton)
2053
+ {
2054
+ makeSomething(new Klein());
2055
+ } else
2056
+ if (source == blobItem)
15972057 {
15982058 Blob blob = new Blob();
15992059 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2061,15 @@
16012061 //blob.retile();
16022062 makeSomething(blob);
16032063 } else
1604
- if (event.getSource() == latheItem)
2064
+ if (source == latheItem)
16052065 {
16062066 makeSomething(new Lathe());
16072067 } else
1608
- if (event.getSource() == bezierItem)
2068
+ if (source == bezierItem)
16092069 {
16102070 makeSomething(new BezierSurface());
16112071 } else
1612
- if (event.getSource() == checkerItem)
2072
+ if (source == overlayItem || source == overlayButton)
16132073 {
16142074 /*
16152075 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2084,7 @@
16242084 */
16252085 makeSomething(new Checker());
16262086 } else
1627
- if (event.getSource() == meshItem)
2087
+ if (source == meshItem)
16282088 {
16292089 Object3D itemtomake = new Object3D();
16302090 Object3D child;
....@@ -1645,35 +2105,35 @@
16452105 makeSomething(child);
16462106 }
16472107 } else
1648
- if (event.getSource() == springItem)
2108
+ if (source == springItem)
16492109 {
16502110 cSpring s = new cSpring();
16512111 s.setup();
16522112 makeSomething(s);
16532113 } else
1654
- if (event.getSource() == flagItem)
2114
+ if (source == flagItem)
16552115 {
16562116 cSpring s = new cFlag();
16572117 s.setup();
16582118 makeSomething(s);
16592119 } else
1660
- if (event.getSource() == lightItem)
2120
+ if (source == lightItem || source == lightButton)
16612121 {
16622122 makeSomething(new Light());
16632123 } else
1664
- if (event.getSource() == csgItem)
2124
+ if (source == csgItem)
16652125 {
16662126 group(new CSG());
16672127 } else
1668
- if (event.getSource() == templateItem)
2128
+ if (source == templateItem)
16692129 {
16702130 group(new cTemplate());
16712131 } else
1672
- if (event.getSource() == attributeItem)
2132
+ if (source == attributeItem)
16732133 {
16742134 makeSomething(new Attribute());
16752135 } else
1676
- if (event.getSource() == pointflowItem)
2136
+ if (source == pointflowItem)
16772137 {
16782138 makeSomething(new PointFlow());
16792139 } else
....@@ -1685,7 +2145,7 @@
16852145 } else
16862146 */
16872147
1688
- if (event.getSource() == superLoopItem)
2148
+ if (source == superLoopItem)
16892149 {
16902150 Composite g = new cGroup();
16912151 for (int i=0; i<15; i++)
....@@ -1707,30 +2167,30 @@
17072167
17082168 group(g);
17092169 } else
1710
- if (event.getSource() == loopItem)
2170
+ if (source == loopItem || source == loopButton)
17112171 {
17122172 Composite csg = new GroupLeaf();
17132173 csg.count = 5;
17142174 group(csg);
1715
- Composite child = new cGroup();
2175
+ Composite child = new cGroup("Branch");
17162176 csg.addChild(child);
17172177 child.addChild(csg);
17182178 } else
1719
- if (event.getSource() == doubleItem)
2179
+ if (source == doubleItem)
17202180 {
1721
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Fork");
17222182 csg.count = 5;
17232183 group(csg);
1724
- Composite child = new cGroup();
2184
+ Composite child = new cGroup("Branch A");
17252185 csg.addChild(child);
17262186 child.addChild(csg);
1727
- child = new cGroup();
2187
+ child = new cGroup("Branch B");
17282188 csg.addChild(child);
17292189 child.addChild(csg);
17302190 } else
1731
- if (event.getSource() == tripleItem)
2191
+ if (source == tripleItem)
17322192 {
1733
- Composite csg = new GroupLeaf();
2193
+ Composite csg = new GroupLeaf("Trident");
17342194 csg.count = 4;
17352195 group(csg);
17362196 Composite child = new cGroup();
....@@ -1743,73 +2203,98 @@
17432203 csg.addChild(child);
17442204 child.addChild(csg);
17452205 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2206
+ if (source == computeAOItem)
17482207 {
1749
- ImportGFD();
2208
+ Globals.drawMode = CameraPane.OCCLUSION;
2209
+ Globals.theRenderer.repaint();
17502210 } 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)
2211
+ if (source == recompileItem)
17692212 {
17702213 Recompile();
17712214 refreshContents();
17722215 } else
1773
- if (event.getSource() == editScriptItem)
2216
+ if (source == editScriptItem)
17742217 {
17752218 OpenDialog();
17762219 refreshContents();
17772220 } else
1778
- if (event.getSource() == invariantsItem)
2221
+ if (source == invariantsItem)
17792222 {
17802223 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2224
+ Grafreed.grafreeD.universe.invariants();
17822225 } else
1783
- if (event.getSource() == memoryItem)
2226
+ if (source == memoryItem)
17842227 {
17852228 //System.out.println("Invariants:");
17862229 PrintMemory();
17872230 } else
1788
- if (event.getSource() == pathItem)
2231
+ if (source == pathItem)
17892232 {
17902233 PrintPath();
17912234 } else
1792
- if (event.getSource() == analyzeItem)
2235
+ if (source == analyzeItem)
17932236 {
17942237 AnalyzeObject();
17952238 } else
1796
- if (event.getSource() == dumpItem)
2239
+ if (source == dumpItem)
17972240 {
17982241 DumpObject();
17992242 } else
1800
- if (event.getSource() == screenfitButton)
2243
+ if (source == minButton)
18012244 {
1802
- //Reload(lastConverter, lastFilename, true);
2245
+ Minimize();
2246
+ } else
2247
+ if (source == maxButton)
2248
+ {
2249
+ Maximize();
2250
+ } else
2251
+ if (source == fullButton)
2252
+ {
2253
+ ToggleFullScreen();
2254
+ } else
2255
+ if (source == undoButton)
2256
+ {
2257
+ // Go to previous version
2258
+ //if (!Undo())
2259
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2260
+ Undo();
2261
+ } else
2262
+ if (source == restoreButton)
2263
+ {
2264
+ // Restore current version
2265
+ Restore();
2266
+ } else
2267
+ if (source == replaceButton)
2268
+ {
2269
+ // Overwrite current version
2270
+ Replace();
2271
+ } else
2272
+ if (source == redoButton)
2273
+ {
2274
+ // Go to next version
2275
+ Redo();
2276
+ } else
2277
+ if (source == saveButton)
2278
+ {
2279
+ // Save a new version
2280
+ if (!Save(true))
2281
+ java.awt.Toolkit.getDefaultToolkit().beep();
2282
+ } else
2283
+ if (source == oneStepButton)
2284
+ {
2285
+ Globals.ONESTEP = true;
2286
+ cameraView.repaint();
2287
+ } else
2288
+ if (source == screenfitButton)
2289
+ {
18032290 ScreenFit();
18042291 } else
1805
- if (event.getSource() == screenfitpointButton)
2292
+ if (source == screenfitpointButton)
18062293 {
1807
- //Reload(lastConverter, lastFilename, true);
18082294 ScreenFitPoint();
18092295 } else
1810
- if (event.getSource() == snapobjectButton)
2296
+ if (source == snapobjectButton)
18112297 {
1812
- //Reload(lastConverter, lastFilename, true);
18132298 SnapObject();
18142299 } else
18152300 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2303,13 @@
18182303 // Recompile();
18192304 // refreshContents();
18202305 // } else
1821
- if (event.getSource() == gcButton)
2306
+ if (source == gcButton)
18222307 {
18232308 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242309 System.gc();
18252310 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262311 } else
1827
- if (event.getSource() == editLeafItem)
2312
+ if (source == editLeafItem)
18282313 {
18292314 Object3D obj;
18302315 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2323,78 @@
18382323 }
18392324 refreshContents(true);
18402325 } else
1841
- if (event.getSource() == openWindowItem)
2326
+ if (source == openWindowItem)
18422327 {
18432328 EditSelection(true);
18442329 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2330
+ if (source == cutItem || source == clearButton)
18462331 {
18472332 loadClipboard(true);
18482333 } else
1849
- if (event.getSource() == duplicateItem)
2334
+ if (source == undoItem)
18502335 {
1851
- Object3D keep = GraphreeD.clipboard;
2336
+ Undo();
2337
+ } else
2338
+ if (source == redoItem)
2339
+ {
2340
+ Redo();
2341
+ } else
2342
+ if (source == duplicateItem)
2343
+ {
2344
+ Object3D keep = Grafreed.clipboard;
18522345 loadClipboard(false);
18532346 paste(false);
1854
- GraphreeD.clipboard = keep;
2347
+ Grafreed.clipboard = keep;
18552348 } else
1856
- if (event.getSource() == cloneItem)
2349
+ if (source == cloneItem)
18572350 {
18582351 CloneSelection(false);
18592352 } else
1860
- if (event.getSource() == cloneSupportItem)
2353
+ if (source == cloneSupportItem)
18612354 {
18622355 CloneSelection(true);
18632356 } else
1864
- if (event.getSource() == copyItem)
2357
+ if (source == copyItem)
18652358 {
18662359 loadClipboard(false);
18672360 } else
1868
- if (event.getSource() == pasteItem)
2361
+ if (source == pasteItem)
18692362 {
18702363 paste(false);
18712364 } else
1872
- if (event.getSource() == pasteLinkItem)
2365
+ if (source == pasteIntoItem)
18732366 {
1874
- pasteInto(false);
2367
+ pasteInto(true, false);
18752368 } else
1876
- if (event.getSource() == pasteCloneItem)
2369
+ if (source == pasteLinkItem)
18772370 {
1878
- pasteInto(true);
2371
+ pasteInto(false, false);
18792372 } else
1880
- if (event.getSource() == pasteExpandItem)
2373
+ if (source == pasteCloneItem)
2374
+ {
2375
+ pasteInto(true, true);
2376
+ } else
2377
+ if (source == pasteExpandItem)
18812378 {
18822379 paste(true);
18832380 } else
1884
- if (event.getSource() == synchronizeItem)
2381
+ if (source == synchronizeItem)
18852382 {
18862383 Overwrite(Object3D.TRANSFORM);
18872384 } else
1888
- if (event.getSource() == overwriteNameItem)
2385
+ if (source == overwriteNameItem)
18892386 {
18902387 Overwrite(Object3D.NAME);
18912388 } else
1892
- if (event.getSource() == overwriteUVItem)
2389
+ if (source == overwriteUVItem)
18932390 {
18942391 Overwrite(Object3D.UV);
18952392 } else
1896
- if (event.getSource() == overwriteMatItem)
2393
+ if (source == overwriteMatItem)
18972394 {
2395
+ /* july 2015
18982396 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2397
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002398 else
19012399 {
19022400 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2406,16 @@
19082406 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092407 }
19102408 }
2409
+ */
2410
+
2411
+ Overwrite(dropAttributes);
19112412 }
1912
- if (event.getSource() == overwriteGeoItem)
2413
+ if (source == overwriteGeoItem)
19132414 {
19142415 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2416
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162417 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2418
+// Object3D content = GrafreeD.clipboard.get(0);
19182419 //
19192420 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202421 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2427,7 @@
19262427 // refreshContents();
19272428 // }
19282429 } else
1929
- if (event.getSource() == generateMeshItem)
2430
+ if (source == generateMeshItem)
19302431 {
19312432 //if (group.selection.size() == 1)
19322433 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2438,7 @@
19372438 ResetModel();
19382439 refreshContents();
19392440 } else
1940
- if (event.getSource() == extractGeometriesItem)
2441
+ if (source == extractGeometriesItem)
19412442 {
19422443 boolean one = false;
19432444
....@@ -1964,7 +2465,7 @@
19642465 ResetModel();
19652466 refreshContents();
19662467 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2468
+ if (source == cloneGeometriesItem)
19682469 {
19692470 boolean one = false;
19702471
....@@ -1990,32 +2491,37 @@
19902491 ResetModel();
19912492 refreshContents();
19922493 } else
1993
- if (event.getSource() == shareGeometriesItem)
2494
+ if (source == shareGeometriesItem)
19942495 {
19952496 boolean one = false;
19962497
19972498 if (group.selection.size() == 1)
19982499 one = true;
19992500
2501
+ Object3D merge = null;
2502
+
20002503 Object3D content = new cGroup();
20012504
20022505 for (int i=0; i<group.selection.size(); i++)
20032506 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2507
+ merge = new Merge(group.selection.get(i));
20052508
20062509 if (one)
2007
- makeSomething(sel, false);
2510
+ makeSomething(merge, false);
20082511 else
2009
- content.addChild(sel);
2512
+ content.addChild(merge);
20102513 }
20112514
20122515 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2516
+ makeSomething(content, true);
2517
+ else
2518
+ {
2519
+ ResetModel();
2520
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2521
+ refreshContents();
2522
+ }
20172523 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2524
+ if (source == mergeGeometriesItem)
20192525 {
20202526 boolean one = false;
20212527
....@@ -2045,11 +2551,11 @@
20452551 ResetModel();
20462552 refreshContents();
20472553 } else
2048
- if (event.getSource() == linkverticesItem)
2554
+ if (source == linkverticesItem)
20492555 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2556
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512557 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2558
+// Object3D content = GrafreeD.clipboard.get(0);
20532559 //
20542560 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552561 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2564,48 @@
20582564 // group.selection.get(0).setMasterThis(content); // should be identity
20592565 // refreshContents();
20602566 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2567
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622568 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2569
+ Object3D content = Grafreed.clipboard.get(0);
20642570
20652571 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662572 content = ((cGroup)content).get(0);
20672573
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2574
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692575 for (int i=0; i<group.selection.size(); i++)
20702576 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2577
+ boolean random = CameraPane.SWITCH;
2578
+ CameraPane.SWITCH = false; // parse all random nodes
20732579 group.selection.get(i).linkVerticesThis(content);
20742580 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2581
+ CameraPane.SWITCH = random;
20762582 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2583
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782584 refreshContents();
20792585 }
20802586 } else
2081
- if (event.getSource() == resetsupportItem)
2587
+ if (source == resetsupportItem)
20822588 {
20832589 for (int i=0; i<group.selection.size(); i++)
20842590 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2591
+ boolean random = CameraPane.SWITCH;
2592
+ CameraPane.SWITCH = false; // parse all random nodes
20872593 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2594
+ CameraPane.SWITCH = random;
20892595 }
20902596
20912597 refreshContents();
20922598 } else
2093
- if (event.getSource() == resetreferencesItem)
2599
+ if (source == relinkverticesItem)
2600
+ {
2601
+ boolean random = CameraPane.SWITCH;
2602
+ CameraPane.SWITCH = false; // parse all random nodes
2603
+ group.selection.RelinkToSupport();
2604
+ CameraPane.SWITCH = random;
2605
+
2606
+ refreshContents();
2607
+ } else
2608
+ if (source == resetreferencesItem)
20942609 {
20952610 for (int i=0; i<group.selection.size(); i++)
20962611 {
....@@ -2099,11 +2614,11 @@
20992614
21002615 refreshContents();
21012616 } else
2102
- if (event.getSource() == setMasterItem)
2617
+ if (source == setMasterItem)
21032618 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2619
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052620 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2621
+ Object3D content = Grafreed.clipboard.get(0);
21072622
21082623 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092624 content = ((cGroup)content).get(0);
....@@ -2112,13 +2627,13 @@
21122627 refreshContents();
21132628 }
21142629 } else
2115
- if (event.getSource() == poseMeshItem)
2630
+ if (source == poseMeshItem)
21162631 {
21172632 if (group.selection.size() == 1)
21182633 {
2119
- if (GraphreeD.clipboard.size() == 1)
2634
+ if (Grafreed.clipboard.size() == 1)
21202635 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2636
+ Object3D content = Grafreed.clipboard.get(0);
21222637
21232638 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242639 content = ((cGroup)content).get(0);
....@@ -2131,19 +2646,19 @@
21312646 }
21322647
21332648 } else
2134
- if (event.getSource() == revertMeshItem)
2649
+ if (source == revertMeshItem)
21352650 {
21362651 RevertMeshes();
21372652 } else
2138
- if (event.getSource() == resetMeshItem)
2653
+ if (source == resetAllItem)
21392654 {
21402655 ResetAll();
21412656 } else
2142
- if (event.getSource() == stepAllItem)
2657
+ if (source == stepAllItem)
21432658 {
21442659 StepAll();
21452660 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2661
+ if (source == clearItem) // || event.getSource() == clearButton)
21472662 {
21482663 //int indices[] = jList.getSelectedIndices();
21492664 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2666,46 @@
21512666
21522667 ClearSelection(false);
21532668 } else
2154
- if (event.getSource() == clearAllItem)
2669
+ if (source == clearAllItem)
21552670 {
21562671 ClearSelection(true);
21572672 } else
2158
- if (event.getSource() == grabItem)
2673
+ if (source == grabItem || source == groupButton)
21592674 {
2160
- group(new cGroup(), true);
2675
+ group(new cGroup(), false); // true);
21612676 } else
2162
- if (event.getSource() == frontItem)
2677
+ if (source == hideItem)
2678
+ {
2679
+ group(new HiddenObject());
2680
+ } else
2681
+ if (source == frontItem)
21632682 {
21642683 front();
21652684 } else
2166
- if (event.getSource() == backItem)
2685
+ if (source == backItem)
21672686 {
21682687 back();
21692688 } else
2170
- if (event.getSource() == cameraItem)
2689
+ if (source == cameraItem)
21712690 {
21722691 makeSomething(new Camera());
21732692 } else
2174
- if (event.getSource() == compositeItem)
2693
+ if (source == compositeItem || source == compositeButton)
21752694 {
21762695 group(new Composite());
21772696 } else
2178
- if (event.getSource() == randomItem)
2697
+ if (source == switchItem || source == switchButton)
21792698 {
21802699 RandomNode random = new RandomNode();
21812700 group(random);
21822701 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2702
+ random.name = random.get(0).name + "Switch";
21842703 } else
2185
- if (event.getSource() == physicsItem)
2704
+ if (source == physicsItem)
21862705 {
21872706 group(new PhysicsNode());
21882707 } else
2189
- if (event.getSource() == frameselectorItem)
2708
+ if (source == frameselectorItem)
21902709 {
21912710 for (int i=0; i<group.selection.size(); i++)
21922711 {
....@@ -2198,7 +2717,7 @@
21982717 ResetModel();
21992718 refreshContents();
22002719 } else
2201
- if (event.getSource() == switchGeoItem)
2720
+ if (source == switchGeoItem)
22022721 {
22032722 for (int i=0; i<group.selection.size(); i++)
22042723 {
....@@ -2210,7 +2729,7 @@
22102729 ResetModel();
22112730 refreshContents();
22122731 } else
2213
- if (event.getSource() == switchTransfoItem)
2732
+ if (source == switchTransfoItem)
22142733 {
22152734 for (int i=0; i<group.selection.size(); i++)
22162735 {
....@@ -2222,7 +2741,7 @@
22222741 ResetModel();
22232742 refreshContents();
22242743 } else
2225
- if (event.getSource() == morphItem)
2744
+ if (source == morphItem)
22262745 {
22272746 for (int i=0; i<group.selection.size(); i++)
22282747 {
....@@ -2234,7 +2753,7 @@
22342753 ResetModel();
22352754 refreshContents();
22362755 } else
2237
- if (event.getSource() == scriptNodeItem)
2756
+ if (source == scriptNodeItem)
22382757 {
22392758 boolean atleastone = false;
22402759
....@@ -2273,195 +2792,252 @@
22732792 }
22742793 }
22752794 } else
2276
- if (event.getSource() == linkerItem)
2795
+ if (source == linkerItem)
22772796 {
22782797 group(new cLinker());
22792798 } else
2280
- if (event.getSource() == textureItem)
2799
+ if (source == textureItem || source == textureButton)
22812800 {
22822801 group(new TextureNode());
22832802 } else
2284
- if (event.getSource() == shadowXItem)
2803
+ if (source == billboardItem)
2804
+ {
2805
+ group(new BillboardNode());
2806
+ } else
2807
+ if (source == shadowXItem)
22852808 {
22862809 CastShadow(0);
22872810 } else
2288
- if (event.getSource() == shadowYItem)
2811
+ if (source == shadowYItem)
22892812 {
22902813 CastShadow(1);
22912814 } else
2292
- if (event.getSource() == shadowZItem)
2815
+ if (source == shadowZItem)
22932816 {
22942817 CastShadow(2);
22952818 } else
2296
- if (event.getSource() == ungroupItem)
2819
+ if (source == ungroupItem || source == ungroupButton)
22972820 {
2298
- ungroup();
2821
+ boolean hasRoot = false;
2822
+
2823
+ for (int i=0; i<group.selection.size(); i++)
2824
+ {
2825
+ if (group.selection.get(i) == group)
2826
+ {
2827
+ hasRoot = true;
2828
+ break;
2829
+ }
2830
+ }
2831
+
2832
+ if (!hasRoot)
2833
+ {
2834
+ for (int i=0; i<group.selection.size(); i++)
2835
+ {
2836
+ Ungroup(group.selection.get(i));
2837
+ }
2838
+
2839
+ ClearSelection(false);
2840
+
2841
+ refreshContents();
2842
+ }
22992843 } else
2300
- if (event.getSource() == genUVItem)
2844
+ if (source == genUVItem)
23012845 {
23022846 GenUV();
23032847 } else
2304
- if (event.getSource() == genNormalsCADItem)
2848
+ if (source == genNormalsCADItem)
23052849 {
23062850 GenNormals(true);
23072851 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2852
+ if (source == genNormalsMESHItem)
2853
+ {
2854
+ GenNormalsMESH();
2855
+ } else
2856
+ if (source == genNormalsORGANItem)
23092857 {
23102858 GenNormals(false);
23112859 } else
2312
- if (event.getSource() == stripifyItem)
2860
+ if (source == genNormalsMINEItem)
2861
+ {
2862
+ GenNormalsMINE();
2863
+ } else
2864
+ if (source == stripifyItem)
23132865 {
23142866 Stripify();
23152867 } else
2316
- if (event.getSource() == unstripifyItem)
2868
+ if (source == unstripifyItem)
23172869 {
23182870 Unstripify();
23192871 } else
2320
- if (event.getSource() == trimItem)
2872
+ if (source == trimItem)
23212873 {
23222874 Trim();
23232875 } else
2324
- if (event.getSource() == untrimItem)
2876
+ if (source == untrimItem)
23252877 {
23262878 Untrim();
23272879 } else
2328
- if (event.getSource() == clearColorsItem)
2880
+ if (source == clearColorsItem)
23292881 {
23302882 ClearColors();
23312883 } else
2332
- if (event.getSource() == clearMaterialsItem)
2884
+ if (source == clearMaterialsItem)
23332885 {
23342886 ClearMaterials();
23352887 } else
2336
- if (event.getSource() == liveleavesItem)
2888
+ if (source == liveleavesItem)
23372889 {
23382890 LiveLeaves(true);
23392891 } else
2340
- if (event.getSource() == unliveleavesItem)
2892
+ if (source == unliveleavesItem)
23412893 {
23422894 LiveLeaves(false);
23432895 } else
2344
- if (event.getSource() == supportleavesItem)
2896
+ if (source == supportleavesItem)
23452897 {
23462898 SupportLeaves(true);
23472899 } else
2348
- if (event.getSource() == unsupportleavesItem)
2900
+ if (source == unsupportleavesItem)
23492901 {
23502902 SupportLeaves(false);
23512903 } else
2352
- if (event.getSource() == hideleavesItem)
2904
+ if (source == hideleavesItem)
23532905 {
23542906 HideLeaves(true);
23552907 } else
2356
- if (event.getSource() == showleavesItem)
2908
+ if (source == showleavesItem)
23572909 {
23582910 HideLeaves(false);
23592911 } else
2360
- if (event.getSource() == markleavesItem)
2912
+ if (source == markleavesItem)
23612913 {
23622914 MarkLeaves(true);
23632915 } else
2364
- if (event.getSource() == unmarkleavesItem)
2916
+ if (source == unmarkleavesItem)
23652917 {
23662918 MarkLeaves(false);
23672919 } else
2368
- if (event.getSource() == flipVItem)
2920
+ if (source == rewindleavesItem)
2921
+ {
2922
+ RewindLeaves(true);
2923
+ } else
2924
+ if (source == unrewindleavesItem)
2925
+ {
2926
+ RewindLeaves(false);
2927
+ } else
2928
+ if (source == randomleavesItem)
2929
+ {
2930
+ RandomLeaves(true);
2931
+ } else
2932
+ if (source == unrandomleavesItem)
2933
+ {
2934
+ RandomLeaves(false);
2935
+ } else
2936
+ if (source == flipVItem)
23692937 {
23702938 FlipV(true);
23712939 } else
2372
- if (event.getSource() == unflipVItem)
2940
+ if (source == unflipVItem)
23732941 {
23742942 FlipV(false);
23752943 } else
2376
- if (event.getSource() == lowTexturesItem)
2944
+ if (source == lowTexturesItem)
23772945 {
23782946 SetTexRes(0);
23792947 } else
2380
- if (event.getSource() == normalTexturesItem)
2948
+ if (source == normalTexturesItem)
23812949 {
23822950 SetTexRes(1);
23832951 } else
2384
- if (event.getSource() == highTexturesItem)
2952
+ if (source == highTexturesItem)
23852953 {
23862954 SetTexRes(2);
23872955 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2956
+ if (source == veryhighTexturesItem)
23892957 {
23902958 SetTexRes(3);
23912959 } else
2392
- if (event.getSource() == maxTexturesItem)
2960
+ if (source == maxTexturesItem)
23932961 {
23942962 SetTexRes(4);
23952963 } else
2396
- if (event.getSource() == panoTexturesItem)
2964
+ if (source == panoTexturesItem)
23972965 {
23982966 SetTexRes(5);
23992967 } else
2400
- if (event.getSource() == reverseNormalsItem)
2968
+ if (source == reverseNormalsItem)
24012969 {
24022970 ReverseNormals();
24032971 } else
2404
- if (event.getSource() == parseverticesItem)
2972
+ if (source == parseverticesItem)
24052973 {
24062974 ParseVertices();
24072975 } else
2408
- if (event.getSource() == textureFieldItem)
2976
+ if (source == textureFieldItem)
24092977 {
24102978 TextureVertices();
24112979 } else
2412
- if (event.getSource() == alignItem)
2980
+ if (source == alignItem)
24132981 {
24142982 Align();
24152983 } else
2416
- if (event.getSource() == mirrorItem)
2984
+ if (source == mirrorItem)
24172985 {
24182986 MirrorPoses();
24192987 } else
2420
- if (event.getSource() == reduceMorphItem)
2988
+ if (source == reduceMorphItem)
24212989 {
24222990 MeshReduction(false);
24232991 } else
2424
- if (event.getSource() == reduce34MorphItem)
2992
+ if (source == reduce34MorphItem)
24252993 {
24262994 MeshReduction(true);
24272995 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2996
+ if (source == reverseTrianglesItem)
24292997 {
24302998 ReverseTriangles();
24312999 } else
2432
- if (event.getSource() == reduceMeshItem)
3000
+ if (source == reduceMeshItem)
24333001 {
24343002 ReduceMesh(false);
24353003 } else
2436
- if (event.getSource() == reduce34MeshItem)
3004
+ if (source == reduce34MeshItem)
24373005 {
24383006 ReduceMesh(true);
24393007 } else
2440
- if (event.getSource() == increaseMeshItem)
3008
+ if (source == increaseMeshItem)
24413009 {
24423010 IncreaseMesh();
24433011 } else
2444
- if (event.getSource() == clipMeshItem)
3012
+ if (source == clipMeshItem)
24453013 {
24463014 ClipMesh();
24473015 } else
2448
- if (event.getSource() == smoothMeshItem)
3016
+ if (source == smoothMeshItem)
24493017 {
24503018 SmoothMesh();
24513019 } else
2452
- if (event.getSource() == transformgeometryItem)
3020
+ if (source == transformGeometryItem)
24533021 {
24543022 TransformGeometry();
24553023 } else
2456
- if (event.getSource() == resetTransformItem)
3024
+ if (source == transformChildrenItem)
3025
+ {
3026
+ TransformChildren();
3027
+ } else
3028
+ if (source == resetTransformItem)
24573029 {
24583030 ResetTransform();
24593031 } else
2460
- if (event.getSource() == resetCentroidItem)
3032
+ if (source == resetCentroidItem)
24613033 {
2462
- ResetCentroid();
3034
+ ResetCentroid(true);
24633035 } else
2464
- if (event.getSource() == resetParentItem)
3036
+ if (source == resetCentroidXZItem)
3037
+ {
3038
+ ResetCentroid(false);
3039
+ } else
3040
+ if (source == resetParentItem)
24653041 {
24663042 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673043 {
....@@ -2471,7 +3047,7 @@
24713047
24723048 refreshContents();
24733049 } else
2474
- if (event.getSource() == repairParentItem)
3050
+ if (source == repairParentItem)
24753051 {
24763052 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773053 {
....@@ -2485,7 +3061,21 @@
24853061
24863062 refreshContents();
24873063 } else
2488
- if (event.getSource() == sortbysizeItem)
3064
+ if (source == repairShadowItem)
3065
+ {
3066
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3067
+ {
3068
+ Object3D obj = (Object3D)e.nextElement();
3069
+ obj.RepairShadow();
3070
+// for (int i=0; i<obj.size(); i++)
3071
+// {
3072
+// obj.get(i).parent = obj;
3073
+// }
3074
+ }
3075
+
3076
+ refreshContents();
3077
+ } else
3078
+ if (source == sortbysizeItem)
24893079 {
24903080 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913081 {
....@@ -2497,7 +3087,7 @@
24973087 ResetModel();
24983088 refreshContents();
24993089 } else
2500
- if (event.getSource() == sortbynameItem)
3090
+ if (source == sortbynameItem)
25013091 {
25023092 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033093 {
....@@ -2509,7 +3099,7 @@
25093099 ResetModel();
25103100 refreshContents();
25113101 } else
2512
- if (event.getSource() == attachPigmentItem)
3102
+ if (source == attachPigmentItem)
25133103 {
25143104 String texture = GetFile("Attach pigment");
25153105 Object3D obj;
....@@ -2521,7 +3111,7 @@
25213111
25223112 refreshContents();
25233113 } else
2524
- if (event.getSource() == detachPigmentItem)
3114
+ if (source == detachPigmentItem)
25253115 {
25263116 Object3D obj;
25273117 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3122,7 @@
25323122
25333123 refreshContents();
25343124 } else
2535
- if (event.getSource() == attachBumpItem)
3125
+ if (source == attachBumpItem)
25363126 {
25373127 String texture = GetFile("Attach bump");
25383128 Object3D obj;
....@@ -2544,7 +3134,7 @@
25443134
25453135 refreshContents();
25463136 } else
2547
- if (event.getSource() == detachBumpItem)
3137
+ if (source == detachBumpItem)
25483138 {
25493139 Object3D obj;
25503140 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +3145,7 @@
25553145
25563146 refreshContents();
25573147 } else
2558
- if (event.getSource() == pigmentBumpItem)
3148
+ if (source == pigmentBumpItem)
25593149 {
25603150 Object3D obj;
25613151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3156,237 @@
25663156
25673157 refreshContents();
25683158 } else
2569
- if (event.getSource() == flashSelectionButton)
3159
+ if (source == flashSelectionButton)
25703160 {
25713161 CameraPane.flash = true;
25723162 refreshContents();
25733163 } else
2574
- if (event.getSource() == oneButton)
3164
+ if (source == oneButton)
25753165 {
25763166 } else
2577
- if (event.getSource() == twoButton)
3167
+ if (source == twoButton)
25783168 {
25793169 radio.layout = twoButton;
3170
+
3171
+ if (CameraPane.FULLSCREEN)
3172
+ fullscreenLayout = radio.layout;
3173
+
25803174 // bug
25813175 //gridPanel.setDividerLocation(1.0);
25823176 //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();
3177
+// bigThree.remove(scenePanel);
3178
+// bigThree.remove(centralPanel);
3179
+// bigThree.remove(XYZPanel);
3180
+// aWindowConstraints.gridx = 0;
3181
+// aWindowConstraints.gridy = 0;
3182
+// aWindowConstraints.gridwidth = 1;
3183
+// // aConstraints.gridheight = 3;
3184
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3185
+// aWindowConstraints.weightx = 0;
3186
+// aWindowConstraints.weighty = 1;
3187
+// //bigThree.add(jtp, aWindowConstraints);
3188
+// aWindowConstraints.weightx = 1;
3189
+// aWindowConstraints.gridwidth = 3;
3190
+// // aConstraints.gridheight = 3;
3191
+// aWindowConstraints.gridx = 1;
3192
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3193
+// bigThree.add(centralPanel, aWindowConstraints);
3194
+// aWindowConstraints.weightx = 0;
3195
+// aWindowConstraints.gridx = 4;
3196
+// aWindowConstraints.gridwidth = 1;
3197
+// // aConstraints.gridheight = 3;
3198
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3199
+// //bigThree.add(XYZPanel, aWindowConstraints);
3200
+// scenePanel.setVisible(false);
3201
+// centralPanel.setVisible(true);
3202
+// XYZPanel.setVisible(false);
3203
+ bigThree.ClearUI();
3204
+ bigThree.add(centralPanel);
3205
+ bigThree.FlushUI();
3206
+
3207
+ cameraView.requestFocusInWindow();
3208
+
3209
+// refreshContents(true);
3210
+//
3211
+// try
3212
+// {
3213
+// java.awt.Robot bot = new java.awt.Robot();
3214
+// int mask = InputEvent.BUTTON1_MASK;
3215
+// bot.mouseMove(100, 100);
3216
+// bot.mousePress(mask);
3217
+// bot.mouseRelease(mask);
3218
+// }
3219
+// catch (Exception e)
3220
+// {
3221
+//
3222
+// }
3223
+
26073224 } else
2608
- if (event.getSource() == threeButton)
3225
+ if (source == threeButton)
26093226 {
26103227 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();
3228
+
3229
+ if (CameraPane.FULLSCREEN)
3230
+ fullscreenLayout = radio.layout;
3231
+
3232
+// bigThree.remove(scenePanel);
3233
+// bigThree.remove(centralPanel);
3234
+// bigThree.remove(XYZPanel);
3235
+// aWindowConstraints.gridx = 0;
3236
+// aWindowConstraints.gridy = 0;
3237
+// aWindowConstraints.gridwidth = 1;
3238
+// // aConstraints.gridheight = 3;
3239
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3240
+// aWindowConstraints.weightx = 0;
3241
+// aWindowConstraints.weighty = 1;
3242
+// //bigThree.add(jtp, aWindowConstraints);
3243
+// aWindowConstraints.weightx = 1;
3244
+// aWindowConstraints.gridwidth = 3;
3245
+// // aConstraints.gridheight = 3;
3246
+// aWindowConstraints.gridx = 1;
3247
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3248
+// bigThree.add(centralPanel, aWindowConstraints);
3249
+// aWindowConstraints.weightx = 0;
3250
+// aWindowConstraints.gridx = 4;
3251
+// aWindowConstraints.gridwidth = 1;
3252
+// // aConstraints.gridheight = 3;
3253
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3254
+// bigThree.add(XYZPanel, aWindowConstraints);
3255
+// bigThree.validate();
3256
+// scenePanel.setVisible(false);
3257
+// centralPanel.setVisible(true);
3258
+// XYZPanel.setVisible(true);
3259
+ bigThree.ClearUI();
3260
+ bigThree.add(centralPanel);
3261
+ bigThree.add(XYZPanel);
3262
+ bigThree.FlushUI();
3263
+
3264
+ cameraView.requestFocusInWindow();
26353265 } else
2636
- if (event.getSource() == fourButton)
3266
+ if (source == fourButton)
26373267 {
26383268 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();
3269
+
3270
+ if (CameraPane.FULLSCREEN)
3271
+ fullscreenLayout = radio.layout;
3272
+
3273
+// bigThree.remove(scenePanel);
3274
+// bigThree.remove(centralPanel);
3275
+// bigThree.remove(XYZPanel);
3276
+// aWindowConstraints.gridx = 0;
3277
+// aWindowConstraints.gridy = 0;
3278
+// aWindowConstraints.gridwidth = 1;
3279
+// // aWindowConstraints.gridheight = 3;
3280
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3281
+// aWindowConstraints.weightx = 1;
3282
+// aWindowConstraints.weighty = 1;
3283
+// bigThree.add(scenePanel, aWindowConstraints);
3284
+// aWindowConstraints.weightx = 1;
3285
+// aWindowConstraints.gridwidth = 3;
3286
+// // aConstraints.gridheight = 3;
3287
+// aWindowConstraints.gridx = 1;
3288
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3289
+// //bigThree.add(cameraPanel, aWindowConstraints);
3290
+// aWindowConstraints.weightx = 0;
3291
+// aWindowConstraints.gridx = 4;
3292
+// aWindowConstraints.gridwidth = 1;
3293
+// // aWindowConstraints.gridheight = 3;
3294
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3295
+// //bigThree.add(XYZPanel, aWindowConstraints);
3296
+// bigThree.validate();
3297
+// scenePanel.setVisible(true);
3298
+// centralPanel.setVisible(false);
3299
+// XYZPanel.setVisible(false);
3300
+ bigThree.ClearUI();
3301
+ bigThree.add(scenePanel);
3302
+ bigThree.FlushUI();
3303
+
3304
+ cameraView.requestFocusInWindow();
26633305 } else
2664
- if (event.getSource() == sixButton)
3306
+ if (source == sixButton)
26653307 {
26663308 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();
3309
+
3310
+ if (CameraPane.FULLSCREEN)
3311
+ fullscreenLayout = radio.layout;
3312
+
3313
+// bigThree.remove(scenePanel);
3314
+// bigThree.remove(centralPanel);
3315
+// bigThree.remove(XYZPanel);
3316
+// aWindowConstraints.gridx = 0;
3317
+// aWindowConstraints.gridy = 0;
3318
+// aWindowConstraints.gridwidth = 1;
3319
+// // aConstraints.gridheight = 3;
3320
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3321
+// aWindowConstraints.weightx = 0;
3322
+// aWindowConstraints.weighty = 1;
3323
+// bigThree.add(scenePanel, aWindowConstraints);
3324
+// aWindowConstraints.weightx = 1;
3325
+// aWindowConstraints.gridwidth = 3;
3326
+// // aWindowConstraints.gridheight = 3;
3327
+// aWindowConstraints.gridx = 1;
3328
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3329
+// bigThree.add(centralPanel, aWindowConstraints);
3330
+// aWindowConstraints.weightx = 0;
3331
+// aWindowConstraints.gridx = 4;
3332
+// aWindowConstraints.gridwidth = 1;
3333
+// // aWindowConstraints.gridheight = 3;
3334
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3335
+// //bigThree.add(XYZPanel, aConstraints);
3336
+// bigThree.validate();
3337
+// scenePanel.setVisible(true);
3338
+// centralPanel.setVisible(true);
3339
+// XYZPanel.setVisible(false);
3340
+ bigThree.ClearUI();
3341
+ bigThree.add(scenePanel);
3342
+ bigThree.add(centralPanel);
3343
+ bigThree.FlushUI();
3344
+
3345
+ cameraView.requestFocusInWindow();
26913346 } else
2692
- if (event.getSource() == sevenButton)
3347
+ if (source == sevenButton)
26933348 {
26943349 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();
3350
+
3351
+ if (CameraPane.FULLSCREEN)
3352
+ fullscreenLayout = radio.layout;
3353
+
3354
+// bigThree.remove(scenePanel);
3355
+// bigThree.remove(centralPanel);
3356
+// bigThree.remove(XYZPanel);
3357
+// aWindowConstraints.gridx = 0;
3358
+// aWindowConstraints.gridy = 0;
3359
+// aWindowConstraints.gridwidth = 1;
3360
+// // aWindowConstraints.gridheight = 3;
3361
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3362
+// aWindowConstraints.weightx = 0;
3363
+// aWindowConstraints.weighty = 1;
3364
+// bigThree.add(scenePanel, aWindowConstraints);
3365
+// aWindowConstraints.weightx = 1;
3366
+// aWindowConstraints.gridwidth = 3;
3367
+// // aWindowConstraints.gridheight = 3;
3368
+// aWindowConstraints.gridx = 1;
3369
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3370
+// bigThree.add(centralPanel, aWindowConstraints);
3371
+// aWindowConstraints.weightx = 0;
3372
+// aWindowConstraints.gridx = 4;
3373
+// aWindowConstraints.gridwidth = 1;
3374
+// // aConstraints.gridheight = 3;
3375
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3376
+// bigThree.add(XYZPanel, aWindowConstraints);
3377
+// bigThree.validate();
3378
+// scenePanel.setVisible(true);
3379
+// centralPanel.setVisible(true);
3380
+// XYZPanel.setVisible(true);
3381
+ bigThree.ClearUI();
3382
+ bigThree.add(scenePanel);
3383
+ bigThree.add(centralPanel);
3384
+ bigThree.add(XYZPanel);
3385
+ bigThree.FlushUI();
3386
+
3387
+ cameraView.requestFocusInWindow();
27193388 } else
2720
- if (event.getSource() == rootButton)
3389
+ if (source == rootButton)
27213390 {
27223391 Object3D obj;
27233392 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3396,84 @@
27273396 EditObject(obj);
27283397 }
27293398
3399
+ cameraView.requestFocusInWindow();
27303400 refreshContents(true);
27313401 } else
2732
- if (event.getSource() == closeButton)
3402
+ if (source == closeButton)
27333403 {
27343404 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353405 cRadio ab;
27363406 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373407 {
27383408 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3409
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403410 {
3411
+ // Patch to avoid bug with transparency.
3412
+ if (!ab.hadMaterial)
3413
+ {
3414
+ ab.object.material = null;
3415
+ }
3416
+
27413417 buttonGroup.remove(ab);
27423418 radioPanel.remove(ab);
27433419
2744
- ab.GetObject().editWindow = null;
3420
+ //ab.GetObject().editWindow = null;
3421
+ ab.GetObject().manipWindow = null;
27453422 // ab.GetObject().objectUI = null; // ?????????
27463423
27473424 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483425 break;
27493426 }
27503427 }
3428
+
3429
+ cameraView.requestFocusInWindow();
27513430 refreshContents(true);
27523431 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3432
+ if (source == editItem || source == editButton)
27543433 {
3434
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3435
+ {
3436
+ Object3D child = (Object3D)e.nextElement();
3437
+ child.pinned = true;
3438
+ }
3439
+
27553440 EditSelection(false);
27563441 } else
2757
- if (event.getSource() == uneditButton)
3442
+ if (source == uneditButton)
27583443 {
27593444 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603445 {
27613446 Object3D child = (Object3D)e.nextElement();
27623447 if(child.editWindow != null)
27633448 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3449
+ child.pinned = false;
27643450 child.CloseUI();
27653451 listUI.remove(child);
27663452
2767
- child.editWindow = null; // ???????????
3453
+ //child.editWindow = null; // ???????????
27683454 }
2769
- objEditor.ctrlPanel.revalidate();
3455
+ objEditor.ctrlPanel.FlushUI();
27703456 //objEditor.jTree.clearSelection();
27713457 //objEditor.ResetSliders();
27723458 refreshContents(true);
27733459 } else
2774
- if (event.getSource() == clearPanelButton)
3460
+ if (source == clearPanelButton)
27753461 {
27763462 assert(copy == group);
27773463 //copy.ClearUI();
27783464 for (Object3D obj : listUI)
27793465 {
3466
+ obj.pinned = false;
27803467 obj.CloseUI();
27813468 }
27823469 listUI.clear();
27833470 refreshContents(true);
27843471 } else
2785
- if (event.getSource() == allParamsButton)
3472
+ if (source == allParamsButton)
27863473 {
27873474 assert(copy == group);
27883475
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3476
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903477
27913478 for (Object3D obj : listUI)
27923479 {
....@@ -2803,19 +3490,19 @@
28033490
28043491 refreshContents(true);
28053492 } else
2806
- if (event.getSource() == unselectButton)
3493
+ if (source == unselectButton)
28073494 {
28083495 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3496
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103497 objEditor.ResetSliders();
28113498 refreshContents(true);
28123499 } else
2813
- if(event.getSource() instanceof cRadio)
3500
+ if(source instanceof cRadio)
28143501 {
28153502 group.parent = keepparent;
28163503 group.attributes = 0;
28173504 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3505
+ /*cRadio*/ radio = (cRadio)source;
28193506 Object3D obj = radio.GetObject();
28203507 System.out.println("Edit " + obj);
28213508 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3522,10 @@
28353522 }
28363523
28373524 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3525
+
3526
+ SetUndoStates();
3527
+
3528
+ //Globals.theRenderer.object = group;
28393529 if(!useclient)
28403530 {
28413531 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3534,52 @@
28443534 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453535 cameraView.targetLookAt.set(radio.camera.lookAt);
28463536 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3537
+ //cameraView.lighttouched = true;
3538
+ Globals.lighttouched = true;
28483539 topView.object = group;
28493540 frontView.object = group;
28503541 sideView.object = group;
28513542 }
2852
- group.editWindow = this;
3543
+
3544
+// fix "+" issue
3545
+ //group.editWindow = this;
3546
+ group.manipWindow = this;
3547
+
28533548 /*
28543549 currentLayout = radio.layout;
28553550 if (currentLayout == null)
28563551 currentLayout = sevenButton;
28573552 */
28583553 radio.layout.doClick();
3554
+
3555
+ ClearUnpinned();
3556
+ Grafreed.Assert(group != null);
3557
+ Grafreed.Assert(group.selection != null);
3558
+ SetPinStates(group.selection.size() > 0);
3559
+ if (group.selection.size() == 1)
3560
+ EditSelection(false);
28593561 keepparent = group.parent;
28603562 // PARENT = NULL or not???
28613563 //group.parent = null; // ROOT
28623564 //group.attributes = -1;
28633565 ResetModel();
3566
+
3567
+ cameraView.requestFocusInWindow();
28643568 refreshContents(true);
2865
- }
3569
+ } else if (event.getSource() == editCameraItem)
3570
+ {
3571
+ cameraView.ProtectCamera();
3572
+ cameraView.repaint();
3573
+ return;
3574
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3575
+ {
3576
+ cameraView.RevertCamera();
3577
+ cameraView.repaint();
3578
+ return;
3579
+ // } else if (event.getSource() == textureButton)
3580
+ // {
3581
+ // return; // true;
3582
+ }
28663583 else
28673584 {
28683585 //return super.action(event, arg);
....@@ -2871,7 +3588,6 @@
28713588 }
28723589
28733590 boolean useclient = false;
2874
- cRadio radio;
28753591
28763592 void ToggleRoot()
28773593 {
....@@ -2880,7 +3596,7 @@
28803596 if (useclient)
28813597 {
28823598 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3599
+ Globals.lighttouched = true;
28843600 //topView.object = client;
28853601 //frontView.object = client;
28863602 //sideView.object = client;
....@@ -2888,7 +3604,7 @@
28883604 else
28893605 {
28903606 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3607
+ Globals.lighttouched = true;
28923608 //topView.object = group;
28933609 //frontView.object = group;
28943610 //sideView.object = group;
....@@ -2923,6 +3639,28 @@
29233639 refreshContents();
29243640 }
29253641
3642
+ void TransformChildren()
3643
+ {
3644
+ Object3D obj;
3645
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3646
+ {
3647
+ obj = (Object3D)e.nextElement();
3648
+ obj.KeepTextureMatrices();
3649
+ obj.TransformChildren();
3650
+ obj.RestoreTextureMatrices();
3651
+
3652
+// if (obj.parent == null)
3653
+// {
3654
+// System.out.println("NULL PARENT!");
3655
+// new Exception().printStackTrace();
3656
+// }
3657
+// else
3658
+// TouchTransform(obj);
3659
+// //obj.parent.Touch();
3660
+ }
3661
+
3662
+ refreshContents();
3663
+ }
29263664
29273665 void ResetTransform()
29283666 {
....@@ -3035,7 +3773,7 @@
30353773 refreshContents();
30363774 }
30373775
3038
- void ResetCentroid()
3776
+ void ResetCentroid(boolean full)
30393777 {
30403778 Object3D obj;
30413779 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3788,16 @@
30503788 LA.matIdentity(Object3D.mat);
30513789 obj.getBounds(minima, maxima, false);
30523790 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3791
+ if (full)
3792
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543793 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553794 obj.TransformMesh(Object3D.mat);
3795
+
30563796 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3797
+ if (full)
3798
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583799 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3800
+
30593801 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603802 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613803 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3826,8 @@
30843826
30853827 int size = obj.MemorySize();
30863828
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3829
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3830
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883831 }
30893832 }
30903833 catch (Exception e)
....@@ -3121,9 +3864,9 @@
31213864 obj = (Object3D)e.nextElement();
31223865
31233866 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3867
+ Grafreed.AnalyzeObject(obj);
31253868 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3869
+ Grafreed.AnalyzeObject(obj.bRep);
31273870
31283871 // System.err.println((size/1024) + " KB is the size of " + obj);
31293872 }
....@@ -3165,6 +3908,20 @@
31653908 void GenNormals(boolean crease)
31663909 {
31673910 group.GenNormalsS(crease);
3911
+
3912
+ refreshContents();
3913
+ }
3914
+
3915
+ void GenNormalsMESH()
3916
+ {
3917
+ group.GenNormalsMeshS();
3918
+
3919
+ refreshContents();
3920
+ }
3921
+
3922
+ void GenNormalsMINE()
3923
+ {
3924
+ group.selection.GenNormalsMINE();
31683925
31693926 refreshContents();
31703927 }
....@@ -3250,7 +4007,7 @@
32504007 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32514008 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32524009 //
3253
-// g.add(GraphreeD.clipboard);
4010
+// g.add(GrafreeD.clipboard);
32544011 //
32554012 // buffer.add(g);
32564013 // }
....@@ -3269,8 +4026,8 @@
32694026 // nodes = new Object3D();
32704027 // vertices = new Vector<Vertex>();
32714028 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
4029
+// boolean epsequal = GrafreeD.epsequal;
4030
+// GrafreeD.epsequal = true;
32744031 //
32754032 // for (int i=0; i<group.selection.size(); i++)
32764033 // {
....@@ -3311,7 +4068,7 @@
33114068 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124069 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134070 //
3314
-// g.add(GraphreeD.clipboard);
4071
+// g.add(GrafreeD.clipboard);
33154072 //
33164073 // buffer.add(g);
33174074 // }
....@@ -3319,7 +4076,7 @@
33194076 // makeSomething(buffer, i==group.selection.size()-1);
33204077 // }
33214078 //
3322
-// GraphreeD.epsequal = epsequal;
4079
+// GrafreeD.epsequal = epsequal;
33234080 //
33244081 // //buffer = null;
33254082 // temprep = null;
....@@ -3330,8 +4087,8 @@
33304087
33314088 void ParseVertices()
33324089 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4090
+ boolean epsequal = Grafreed.epsequal;
4091
+ Grafreed.epsequal = true;
33354092
33364093 for (int i=0; i<group.selection.size(); i++)
33374094 {
....@@ -3356,7 +4113,7 @@
33564113 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574114 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584115
3359
- g.add(GraphreeD.clipboard);
4116
+ g.add(Grafreed.clipboard);
33604117
33614118 buffer.add(g);
33624119 }
....@@ -3371,7 +4128,7 @@
33714128 makeSomething(buffer, i==group.selection.size()-1);
33724129 }
33734130
3374
- GraphreeD.epsequal = epsequal;
4131
+ Grafreed.epsequal = epsequal;
33754132
33764133 refreshContents();
33774134 }
....@@ -3389,7 +4146,16 @@
33894146 String pigment = Object3D.GetPigment(tex);
33904147 //String bump = Object3D.GetBump(tex);
33914148
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4149
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4150
+
4151
+ try
4152
+ {
4153
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4154
+ }
4155
+ catch (Exception e)
4156
+ {
4157
+ System.err.println("FAIL: " + node);
4158
+ }
33934159
33944160 double s = v.s;
33954161
....@@ -3416,7 +4182,7 @@
34164182 scale /= 3;
34174183
34184184 scale /= 0xFF;
3419
- scale /= 4;
4185
+ // c'est quoi ca? scale /= 4;
34204186
34214187 //v.AO = scale;
34224188
....@@ -3437,12 +4203,26 @@
34374203
34384204 void Align()
34394205 {
4206
+ if (group.selection.size() == 0)
4207
+ return;
4208
+
4209
+ cVector bbmin = new cVector();
4210
+ cVector bbmax = new cVector();
4211
+
4212
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4213
+
4214
+ double dx = bbmax.x - bbmin.x;
4215
+ double dy = bbmax.y - bbmin.y;
4216
+ double dz = bbmax.z - bbmin.z;
4217
+
4218
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4219
+
34404220 for (int i=0; i<group.selection.size(); i++)
34414221 {
34424222 Object3D obj = group.selection.get(i);
34434223
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4224
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4225
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464226 }
34474227
34484228 refreshContents();
....@@ -3455,7 +4235,7 @@
34554235 // ref.SaveSupports();
34564236 // Object3D par = ref.parent;
34574237 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4238
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594239 // ref.parent = par;
34604240 // ref.RestoreSupports();
34614241
....@@ -3463,11 +4243,11 @@
34634243
34644244 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654245
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4246
+ boolean random = CameraPane.SWITCH;
4247
+ CameraPane.SWITCH = false; // parse all random nodes
34684248 lowres.linkVerticesThis(null);
34694249 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4250
+ CameraPane.SWITCH = random;
34714251
34724252 System.err.flush();
34734253
....@@ -3485,7 +4265,7 @@
34854265 // lowres.SaveSupports();
34864266 // par = lowres.parent;
34874267 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4268
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894269 Object3D newlow = CloneObject(lowres, false);
34904270 newlow.name = sn.switchobject.get(i).name;
34914271 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4287,7 @@
35074287 return;
35084288
35094289 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4290
+ Object3D ref = Grafreed.clipboard.get(0);
35114291
35124292 Object3D newgroup = new Object3D("Po:" + poses.name);
35134293
....@@ -3676,7 +4456,7 @@
36764456 group.selection.RelinkToSupport(); // july 2014
36774457 System.out.println("DONE.");
36784458 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4459
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804460 }
36814461
36824462 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4481,20 @@
37014481
37024482 void ClipMesh()
37034483 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4484
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054485 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4486
+ Object3D content = Grafreed.clipboard.get(0);
37074487
37084488 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094489 content = ((cGroup)content).get(0);
37104490
37114491 // for (int i=0; i<group.selection.size(); i++)
37124492 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4493
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144494 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4495
+ group.selection.ClipMesh(Grafreed.clipboard);
37164496 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4497
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184498 System.out.println("DONE.");
37194499 refreshContents();
37204500 }
....@@ -3759,6 +4539,18 @@
37594539 void MarkLeaves(boolean hide)
37604540 {
37614541 group.selection.MarkLeaves(hide);
4542
+ refreshContents();
4543
+ }
4544
+
4545
+ void RewindLeaves(boolean hide)
4546
+ {
4547
+ group.selection.RewindLeaves(hide);
4548
+ refreshContents();
4549
+ }
4550
+
4551
+ void RandomLeaves(boolean hide)
4552
+ {
4553
+ group.selection.RandomLeaves(hide);
37624554 refreshContents();
37634555 }
37644556
....@@ -3833,10 +4625,6 @@
38334625 // }
38344626 // }
38354627
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38404628 void EditSelection(boolean newWindow)
38414629 {
38424630 // aConstraints.gridy = 0;
....@@ -3844,10 +4632,10 @@
38444632 {
38454633 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464634 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4635
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484636
38494637 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4638
+ if(elem != group || !newWindow)
38514639 {
38524640 // if (!(elem instanceof Composite))
38534641 // newWindow = false;
....@@ -3929,7 +4717,8 @@
39294717 //new Exception().printStackTrace();
39304718
39314719 freezemodel = true;
3932
-
4720
+ ClearUnpinned();
4721
+
39334722 /**/
39344723 //switch (event.id)
39354724 {
....@@ -3937,7 +4726,6 @@
39374726 //case 702: // Event.LIST_DESELECT
39384727 group.deselectAll();
39394728 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414729 if (tps != null)
39424730 {
39434731 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +4734,39 @@
39464734
39474735 //if (child.parent != null)
39484736 //child.parent.addSelectee(child);
4737
+ objEditor.SetMaterial(child);
39494738 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534739 }
39544740 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4741
+// else
4742
+// {
4743
+// objEditor.SetMaterial(group); // .GetMaterial());
4744
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4745
+// System.err.println("info : " + group.GetPath());
4746
+// }
39614747
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4748
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654749 CameraPane.flash = true;
39664750
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4751
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684752 // a camera
39694753 {
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;
4754
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4755
+ {
4756
+ CameraPane.camerachangeframe = 0; // don't refuse it
4757
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4758
+ }
4759
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4760
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744761 }
39754762
4763
+ if (tps != null && tps.length == 1)
4764
+ {
4765
+ EditSelection(false);
4766
+ }
4767
+
4768
+ SetPinStates(tps != null && tps.length > 0);
4769
+
39764770 refreshContents();
39774771 //return true;
39784772 }
....@@ -3981,6 +4775,35 @@
39814775
39824776 freezemodel = false;
39834777 }
4778
+
4779
+ void SetPinStates(boolean enabled)
4780
+ {
4781
+ editButton.setEnabled(enabled);
4782
+ uneditButton.setEnabled(enabled);
4783
+ unselectButton.setEnabled(enabled);
4784
+ flashSelectionButton.setEnabled(enabled);
4785
+ }
4786
+
4787
+ void refreshContents(boolean cp)
4788
+ {
4789
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4790
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4791
+ {
4792
+ objEditor.ClearInfo(); // .GetMaterial());
4793
+
4794
+ for (int i=0; i < group.selection.Size(); i++)
4795
+ {
4796
+ Object3D child = (Object3D) group.selection.get(i);
4797
+
4798
+ objEditor.AddInfo(child, this, true);
4799
+ System.err.println("info : " + child.GetPath());
4800
+ }
4801
+
4802
+ objEditor.SetText(); // jan 2014
4803
+ }
4804
+
4805
+ super.refreshContents(cp);
4806
+ }
39844807
39854808 void linkSomething(Object3D thing)
39864809 {
....@@ -4052,16 +4875,19 @@
40524875 {
40534876 if (group.selection.isEmpty())
40544877 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4878
+
4879
+ Grafreed.clipboardIsTempGroup = false;
40564880 Composite tGroup = null;
40574881 if (group.selection.size() > 0) // 1)
40584882 {
40594883 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4884
+ Grafreed.clipboardIsTempGroup = true;
40614885 }
40624886
40634887 if (cut)
40644888 {
4889
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4890
+// Save();
40654891 //int indices[] = jList.getSelectedIndices();
40664892 //for (int i = indices.length - 1; i >= 0; i--)
40674893 //jList.remove(indices[i]);
....@@ -4097,16 +4923,16 @@
40974923 //System.out.println("cut " + child);
40984924 //System.out.println("parent = " + child.parent);
40994925 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4926
+ if (Grafreed.clipboardIsTempGroup)
41014927 tGroup.add/*Child*/(tmp);
41024928 else
4103
- GraphreeD.clipboard = tmp;
4929
+ Grafreed.clipboard = tmp;
41044930 }
41054931 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4932
+ if (Grafreed.clipboardIsTempGroup)
41074933 tGroup.add/*Child*/(child);
41084934 else
4109
- GraphreeD.clipboard = child;
4935
+ Grafreed.clipboard = child;
41104936 }
41114937
41124938 //ResetModel();
....@@ -4138,21 +4964,23 @@
41384964 //System.out.println("cut " + elem);
41394965 //System.out.println("parent = " + elem.parent);
41404966 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4967
+ if (Grafreed.clipboardIsTempGroup)
41424968 tGroup.add/*Child*/(tmp);
41434969 else
4144
- GraphreeD.clipboard = tmp;
4970
+ Grafreed.clipboard = tmp;
41454971 }
41464972 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4973
+ if (Grafreed.clipboardIsTempGroup)
41484974 tGroup.add/*Child*/(child);
41494975 else
4150
- GraphreeD.clipboard = child;
4976
+ Grafreed.clipboard = child;
41514977 }
41524978
41534979 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4980
+
4981
+ if (Grafreed.clipboardIsTempGroup)
4982
+ Grafreed.clipboard = tGroup;
4983
+
41564984 if (cut)
41574985 {
41584986 ResetModel();
....@@ -4162,11 +4990,15 @@
41624990
41634991 void paste(boolean expand)
41644992 {
4165
- // if (GraphreeD.clipboard == null)
4993
+ if (Globals.REPLACEONMAKE)
4994
+ Save();
4995
+ boolean keep = Globals.REPLACEONMAKE;
4996
+ Globals.REPLACEONMAKE = false;
4997
+ // if (GrafreeD.clipboard == null)
41664998 // return;
41674999 boolean first = true;
41685000
4169
- if (GraphreeD.clipboardIsTempGroup)
5001
+ if (Grafreed.clipboardIsTempGroup)
41705002 {
41715003 Composite temp;
41725004
....@@ -4177,7 +5009,7 @@
41775009 temp = (Composite)Applet3D.clipboard.deepCopy();
41785010 */
41795011 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5012
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41815013 {
41825014 Object3D child = (Object3D)e.nextElement();
41835015
....@@ -4191,7 +5023,7 @@
41915023 else
41925024 elem = child.deepCopy(); // ?
41935025 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5026
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41955027 // elem = elem.get(0);
41965028 makeSomething(elem, true); // ?? first);
41975029 //group.addChild(elem);
....@@ -4211,23 +5043,24 @@
42115043 //Object3D cb = Applet3D.clipboard;
42125044 //temp.addChild(cb);
42135045 //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());
5046
+ assert(Grafreed.clipboard.parent == null);
5047
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5048
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5049
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5050
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42195051 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5052
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5053
+ Grafreed.clipboard.get(0).parent = keepparent;
42225054 }
42235055
5056
+ Globals.REPLACEONMAKE = keep;
42245057 ResetModel();
42255058 refreshContents();
42265059 }
42275060
4228
- void pasteInto(boolean copyit)
5061
+ void pasteInto(boolean copyit, boolean clone)
42295062 {
4230
-// if (GraphreeD.clipboard == null)
5063
+// if (GrafreeD.clipboard == null)
42315064 // return;
42325065
42335066 if (group.selection.size() != 1)
....@@ -4254,15 +5087,22 @@
42545087 if (copyit)
42555088 {
42565089 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5090
+ if (clone)
5091
+ {
5092
+ CloneClipboard(false); // sept 2014
5093
+ }
5094
+ else
5095
+ {
5096
+ paste(false);
5097
+ }
42585098 }
42595099 else
42605100 {
42615101 boolean first = true;
42625102
4263
- if (GraphreeD.clipboardIsTempGroup)
5103
+ if (Grafreed.clipboardIsTempGroup)
42645104 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5105
+ Composite temp = (Composite)Grafreed.clipboard;
42665106 Object3D copy;
42675107 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685108 {
....@@ -4272,7 +5112,7 @@
42725112 }
42735113 } else
42745114 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5115
+ linkSomething(Grafreed.clipboard); //.get(0));
42765116 }
42775117 }
42785118 }
....@@ -4349,6 +5189,10 @@
43495189
43505190 void group(Object3D csg, boolean grab)
43515191 {
5192
+ if (Globals.REPLACEONMAKE)
5193
+ Save();
5194
+ boolean keep = Globals.REPLACEONMAKE;
5195
+ Globals.REPLACEONMAKE = false;
43525196 if (//false) // why??
43535197 !group.selection.isEmpty())
43545198 {
....@@ -4462,8 +5306,34 @@
44625306 //node.add(csg);
44635307 //makeSomething(node);
44645308 makeSomething(csg);
5309
+ Globals.REPLACEONMAKE = keep;
44655310 }
44665311
5312
+ void Ungroup(Object3D g)
5313
+ {
5314
+ if (Globals.REPLACEONMAKE)
5315
+ Save();
5316
+ boolean keep = Globals.REPLACEONMAKE;
5317
+ Globals.REPLACEONMAKE = false;
5318
+ if (g instanceof HiddenObject)
5319
+ {
5320
+ HiddenObject h = (HiddenObject) g;
5321
+
5322
+ for (int i=0; i<h.ActualSize(); i++)
5323
+ {
5324
+ objEditor.makeSomething(h.get(i), false);
5325
+ }
5326
+ }
5327
+ else
5328
+ {
5329
+ for (int i=0; i<g.Size(); i++)
5330
+ {
5331
+ objEditor.makeSomething(g.get(i), false);
5332
+ }
5333
+ }
5334
+ Globals.REPLACEONMAKE = keep;
5335
+ }
5336
+
44675337 void ungroup()
44685338 {
44695339 /*
....@@ -4657,21 +5527,6 @@
46575527 }
46585528 */
46595529
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
-
46755530 /*
46765531 public void Callback(Object obj)
46775532 {
....@@ -4695,26 +5550,9 @@
46955550 }
46965551 */
46975552
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
-
47155553 String GetFile(String dialogName)
47165554 {
4717
- if (GraphreeD.standAlone)
5555
+ if (Grafreed.standAlone)
47185556 {
47195557 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205558 browser.show();
....@@ -4778,10 +5616,33 @@
47785616 cButton flashSelectionButton;
47795617 cButton editButton;
47805618 cButton uneditButton;
5619
+ JCheckBox allParamsButton;
47815620 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835621 cButton unselectButton;
47845622
5623
+ cButton restoreCameraButton;
5624
+
5625
+ cButton saveButton;
5626
+ cButton oneStepButton;
5627
+
5628
+ cButton groupButton;
5629
+ cButton ungroupButton;
5630
+ cButton compositeButton;
5631
+ cButton switchButton;
5632
+ cButton loopButton;
5633
+ cButton textureButton;
5634
+
5635
+ cButton gridButton;
5636
+ cButton boxButton;
5637
+ cButton sphereButton;
5638
+ cButton coneButton;
5639
+ cButton torusButton;
5640
+ cButton superButton;
5641
+ cButton kleinButton;
5642
+ cButton particlesButton;
5643
+ cButton overlayButton;
5644
+ cButton lightButton;
5645
+
47855646 cButton screenfitButton;
47865647 cButton screenfitpointButton;
47875648 cButton snapobjectButton;
....@@ -4793,14 +5654,6 @@
47935654
47945655 cButton setsupportButton;
47955656
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
-
48045657 //
48055658 //Composite
48065659 Object3D // to do !!
....@@ -4810,9 +5663,11 @@
48105663 //JTree jTree;
48115664 private MenuItem lookAtItem;
48125665 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
5666
+ private MenuItem switchViewItem;
48145667 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5668
+ private MenuItem undoItem;
5669
+ private MenuItem redoItem;
5670
+ private JMenuItem duplicateItem;
48165671 private MenuItem cloneItem;
48175672 private MenuItem cloneSupportItem;
48185673 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5678,9 @@
48235678 private MenuItem resetsupportItem;
48245679 private MenuItem resetreferencesItem;
48255680 private MenuItem linkverticesItem;
5681
+ private MenuItem relinkverticesItem;
48265682 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5683
+ private MenuItem resetAllItem;
48285684 private MenuItem stepAllItem;
48295685 private MenuItem revertMeshItem;
48305686 private MenuItem poseMeshItem;
....@@ -4835,14 +5691,17 @@
48355691 private MenuItem mergeGeometriesItem;
48365692 private MenuItem copyItem;
48375693 private MenuItem pasteItem;
5694
+ private MenuItem pasteIntoItem;
48385695 private MenuItem pasteLinkItem;
48395696 private MenuItem pasteCloneItem;
48405697 private MenuItem pasteExpandItem;
48415698 private MenuItem clearItem;
48425699 private MenuItem clearAllItem;
48435700 private MenuItem genUVItem;
5701
+ private MenuItem genNormalsMESHItem;
48445702 private MenuItem genNormalsCADItem;
48455703 private MenuItem genNormalsORGANItem;
5704
+ private MenuItem genNormalsMINEItem;
48465705 private MenuItem stripifyItem;
48475706 private MenuItem unstripifyItem;
48485707 private MenuItem trimItem;
....@@ -4871,6 +5730,10 @@
48715730 private MenuItem showleavesItem;
48725731 private MenuItem markleavesItem;
48735732 private MenuItem unmarkleavesItem;
5733
+ private MenuItem rewindleavesItem;
5734
+ private MenuItem unrewindleavesItem;
5735
+ private MenuItem randomleavesItem;
5736
+ private MenuItem unrandomleavesItem;
48745737
48755738 private MenuItem flipVItem;
48765739 private MenuItem unflipVItem;
....@@ -4882,14 +5745,17 @@
48825745 private MenuItem panoTexturesItem;
48835746
48845747 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5748
+ private MenuItem resetCentroidXZItem;
48865749 private MenuItem resetTransformItem;
5750
+ private MenuItem transformGeometryItem;
5751
+ private MenuItem transformChildrenItem;
5752
+ private MenuItem hideItem;
48875753 private MenuItem grabItem;
48885754 private MenuItem backItem;
48895755 private MenuItem frontItem;
48905756 private MenuItem cameraItem;
48915757 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
5758
+ private MenuItem switchItem;
48935759 private MenuItem physicsItem;
48945760 private MenuItem frameselectorItem;
48955761 private MenuItem scriptNodeItem;
....@@ -4904,6 +5770,7 @@
49045770
49055771 private MenuItem resetParentItem;
49065772 private MenuItem repairParentItem;
5773
+ private MenuItem repairShadowItem;
49075774 private MenuItem sortbysizeItem;
49085775 private MenuItem sortbynameItem;
49095776
....@@ -4924,10 +5791,11 @@
49245791 private MenuItem coneItem;
49255792 private MenuItem torusItem;
49265793 private MenuItem superItem;
5794
+ private MenuItem kleinItem;
49275795 private MenuItem blobItem;
49285796 private MenuItem latheItem;
49295797 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5798
+ private MenuItem overlayItem;
49315799 private MenuItem meshItem;
49325800 // private MenuItem meshGroupItem;
49335801 private MenuItem springItem;
....@@ -4936,6 +5804,7 @@
49365804 private MenuItem csgItem;
49375805 private MenuItem templateItem;
49385806 private MenuItem textureItem;
5807
+ private MenuItem billboardItem;
49395808 private MenuItem shadowXItem;
49405809 private MenuItem shadowYItem;
49415810 private MenuItem shadowZItem;
....@@ -4948,11 +5817,6 @@
49485817 private MenuItem doubleItem;
49495818 private MenuItem tripleItem;
49505819
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565820 private MenuItem computeAOItem;
49575821 private MenuItem recompileItem;
49585822 private MenuItem editScriptItem;
....@@ -4962,4 +5826,8 @@
49625826 private MenuItem analyzeItem;
49635827 private MenuItem dumpItem;
49645828 //boolean freezemodel = false;
5829
+
5830
+ Menu cameraMenu;
5831
+ MenuItem editCameraItem;
5832
+ MenuItem restoreCameraItem;
49655833 }