Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
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,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -83,7 +84,11 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ if (Globals.REPLACEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.REPLACEONMAKE;
90
+ Globals.REPLACEONMAKE = false;
91
+ // Object3D keep = GrafreeD.clipboard;
8792 //Object3D obj;
8893 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8994 {
....@@ -93,18 +98,19 @@
9398
9499 makeSomething(clone, i==group.selection.size()-1);
95100 }
101
+ Globals.REPLACEONMAKE = keep;
96102 }
97103
98104 void CloneClipboard(boolean supports)
99105 {
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));
106
+ assert(Grafreed.clipboard.parent == null);
107
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
108
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
109
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
110
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105111 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
112
+ makeSomething(CloneObject(Grafreed.clipboard, false));
113
+ Grafreed.clipboard.get(0).parent = keepparent;
108114 }
109115
110116 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +124,7 @@
118124 // obj.support = null;
119125 if (!supports)
120126 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
127
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122128 obj.parent = parent;
123129 // obj.support = support;
124130 // clone.support = support; // aout 2013
....@@ -147,30 +153,29 @@
147153
148154 //JTextField nameField;
149155
150
- void SetupMenu2(ObjEditor oe)
156
+ void SetupMenu2(GroupEditor oe)
151157 {
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);
158
+ oe.jTree = new cTree();
159
+
163160 Menu menu;
164161 oe.menuBar.add(menu = new Menu("Edit"));
165162 //editItem = menu.add(new MenuItem("Edit"));
166163 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+
165
+// undoItem = menu.add(new MenuItem("Undo"));
166
+// undoItem.addActionListener(this);
167
+// redoItem = menu.add(new MenuItem("Redo"));
168
+// redoItem.addActionListener(this);
169
+// menu.add("-");
170
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168171 duplicateItem.addActionListener(this);
169
- menu.add("-");
170172 cloneItem = menu.add(new MenuItem("Clone"));
171173 cloneItem.addActionListener(this);
174
+ if (Globals.ADVANCED)
175
+ {
172176 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173177 cloneSupportItem.addActionListener(this);
178
+ }
174179 menu.add("-");
175180 cutItem = menu.add(new MenuItem("Cut"));
176181 cutItem.addActionListener(this);
....@@ -178,27 +183,123 @@
178183 copyItem.addActionListener(this);
179184 pasteItem = menu.add(new MenuItem("Paste"));
180185 pasteItem.addActionListener(this);
186
+
187
+ menu.add("-");
188
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
189
+ pasteIntoItem.addActionListener(this);
181190 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182191 pasteLinkItem.addActionListener(this);
183192 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184193 pasteCloneItem.addActionListener(this);
185194 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186195 // pasteExpandItem.addActionListener(this);
196
+ menu.add("-");
187197 clearItem = menu.add(new MenuItem("Clear"));
188198 clearItem.addActionListener(this);
199
+
200
+ if (Globals.ADVANCED)
201
+ {
202
+ // Deletes the cameras...
189203 clearAllItem = menu.add(new MenuItem("Clear All"));
190204 clearAllItem.addActionListener(this);
205
+ }
206
+
207
+ menuBar.add(cameraMenu = new Menu("View"));
208
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
209
+ //zBufferItem.addActionListener(this);
210
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
211
+ //normalLensItem.addActionListener(this);
212
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
213
+ restoreCameraItem.addActionListener(this);
214
+
215
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
216
+// toggleFullScreenItem.addItemListener(this);
217
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
218
+// cameraMenu.add("-");
219
+//
220
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
221
+// toggleTextureItem.addItemListener(this);
222
+// toggleTextureItem.setState(CameraPane.textureon);
223
+//
224
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
225
+// toggleSwitchItem.addItemListener(this);
226
+// toggleSwitchItem.setState(CameraPane.SWITCH);
227
+
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
229
+ toggleHandleItem.addItemListener(this);
230
+ toggleHandleItem.setState(CameraPane.HANDLES);
231
+
232
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
233
+ togglePaintItem.addItemListener(this);
234
+ togglePaintItem.setState(CameraPane.PAINTMODE);
235
+
236
+ if (Globals.ADVANCED)
237
+ {
238
+ cameraMenu.add("-");
239
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
240
+ toggleLiveItem.addItemListener(this);
241
+ toggleLiveItem.setState(Globals.isLIVE());
191242
243
+ cameraMenu.add(stepItem = new MenuItem("Step"));
244
+ stepItem.addActionListener(this);
245
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
246
+ // toggleDLItem.addItemListener(this);
247
+ // toggleDLItem.setState(false);
248
+
249
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
250
+ toggleRenderItem.addItemListener(this);
251
+ toggleRenderItem.setState(!CameraPane.frozen);
252
+
253
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
254
+ toggleDebugItem.addItemListener(this);
255
+ toggleDebugItem.setState(Globals.DEBUG);
256
+
257
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
258
+ toggleFrustumItem.addItemListener(this);
259
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
260
+
261
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
262
+ toggleFootContactItem.addItemListener(this);
263
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
264
+
265
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
266
+ toggleTimelineItem.addItemListener(this);
267
+ }
268
+
269
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
270
+// toggleRootItem.addItemListener(this);
271
+// toggleRootItem.setState(false);
272
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
273
+// animationItem.addItemListener(this);
274
+// animationItem.setState(CameraPane.ANIMATION);
275
+ cameraMenu.add("-");
276
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
277
+ editCameraItem.addActionListener(this);
278
+
279
+ if (Globals.ADVANCED)
280
+ {
281
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
282
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
283
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
284
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
285
+ oe.cameraMenu.add("-");
286
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
287
+ openWindowItem.addActionListener(this);
288
+ editLeafItem.addActionListener(this);
289
+ lookAtItem.addActionListener(this);
290
+ //lookFromItem.addActinoListener(this);
291
+ //switchViewItem.addActionListener(this);
292
+ }
293
+
192294 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);
295
+ if (Globals.ADVANCED)
296
+ {
197297 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198298 revertMeshItem.addActionListener(this);
199299 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200300 resetreferencesItem.addActionListener(this);
201301 menu.add("-");
302
+ }
202303 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203304 overwriteGeoItem.addActionListener(this);
204305 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +311,104 @@
210311 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211312 overwriteUVItem.addActionListener(this);
212313 menu.add("-");
314
+ if (Globals.ADVANCED)
315
+ {
213316 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214317 generateMeshItem.addActionListener(this);
215318 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216319 poseMeshItem.addActionListener(this);
217320 menu.add("-");
321
+ }
218322 resetsupportItem = menu.add(new MenuItem("Reset support"));
219323 resetsupportItem.addActionListener(this);
220324 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221325 linkverticesItem.addActionListener(this);
326
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
327
+ relinkverticesItem.addActionListener(this);
328
+
329
+ if (Globals.ADVANCED)
330
+ {
222331 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223332 setMasterItem.addActionListener(this);
333
+ }
224334
225335 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);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
230338 backItem = menu.add(new MenuItem("Back"));
231339 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);
340
+ frontItem = menu.add(new MenuItem("Front"));
341
+ frontItem.addActionListener(this);
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
347
+ hideItem = menu.add(new MenuItem("Hidden Group"));
348
+ hideItem.addActionListener(this);
349
+ }
350
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
351
+ ungroupItem.addActionListener(this);
352
+
353
+// menu.add("-");
354
+//
355
+// switchItem = menu.add(new MenuItem("Switch node"));
356
+// switchItem.addActionListener(this);
357
+ if (Globals.ADVANCED)
358
+ {
241359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242360 switchGeoItem.addActionListener(this);
243361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244362 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
363
+ morphItem = menu.add(new MenuItem("Morph Group"));
246364 morphItem.addActionListener(this);
365
+
366
+ menu.add("-");
367
+ physicsItem = menu.add(new MenuItem("Physics"));
368
+ physicsItem.addActionListener(this);
369
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
370
+ frameselectorItem.addActionListener(this);
247371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248372 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
373
+ }
251374
252375 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
378
+ billboardItem = menu.add(new MenuItem("Billboard"));
379
+ billboardItem.addActionListener(this);
255380 csgItem = menu.add(new MenuItem("CSG"));
256381 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258383 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260385 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
391
+ if (Globals.ADVANCED)
392
+ {
393
+ menu.add("-");
263394 linkerItem = menu.add(new MenuItem("Linker"));
264395 linkerItem.addActionListener(this);
265396 templateItem = menu.add(new MenuItem("Template"));
266397 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269398 pointflowItem = menu.add(new MenuItem("Point Flow"));
270399 pointflowItem.addActionListener(this);
400
+ }
271401 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274402 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275403 resetTransformItem.addActionListener(this);
276404 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277405 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
406
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
407
+ resetCentroidXZItem.addActionListener(this);
408
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
409
+ transformGeometryItem.addActionListener(this);
410
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
411
+ transformChildrenItem.addActionListener(this);
280412
281413 oe.menuBar.add(menu = new Menu("Geometry"));
282414 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +417,13 @@
285417 genNormalsORGANItem.addActionListener(this);
286418 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287419 genNormalsCADItem.addActionListener(this);
420
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
421
+ genNormalsMESHItem.addActionListener(this);
422
+ if (Globals.ADVANCED)
423
+ {
424
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
425
+ genNormalsMINEItem.addActionListener(this);
426
+ }
288427 stripifyItem = menu.add(new MenuItem("Stripify"));
289428 stripifyItem.addActionListener(this);
290429 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +445,34 @@
306445 reduce34MeshItem.addActionListener(this);
307446 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308447 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311448 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312449 clipMeshItem.addActionListener(this);
450
+
451
+ if (Globals.ADVANCED)
452
+ {
453
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
454
+ smoothMeshItem.addActionListener(this);
455
+ }
313456
314457 oe.menuBar.add(menu = new Menu("Attributes"));
315458 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316459 clearMaterialsItem.addActionListener(this);
460
+ resetAllItem = menu.add(new MenuItem("Reset All"));
461
+ resetAllItem.addActionListener(this);
462
+ stepAllItem = menu.add(new MenuItem("Step All"));
463
+ stepAllItem.addActionListener(this);
317464 menu.add("-");
318465 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319466 liveleavesItem.addActionListener(this);
320467 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321468 unliveleavesItem.addActionListener(this);
469
+ if (Globals.ADVANCED)
470
+ {
322471 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323472 supportleavesItem.addActionListener(this);
324473 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325474 unsupportleavesItem.addActionListener(this);
475
+ }
326476 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327477 hideleavesItem.addActionListener(this);
328478 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +481,14 @@
331481 markleavesItem.addActionListener(this);
332482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333483 unmarkleavesItem.addActionListener(this);
484
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
485
+ rewindleavesItem.addActionListener(this);
486
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
487
+ unrewindleavesItem.addActionListener(this);
488
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
489
+ randomleavesItem.addActionListener(this);
490
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
491
+ unrandomleavesItem.addActionListener(this);
334492 menu.add("-");
335493 flipVItem = menu.add(new MenuItem("Flip V"));
336494 flipVItem.addActionListener(this);
....@@ -366,35 +524,41 @@
366524 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367525 sortbynameItem.addActionListener(this);
368526 menu.add("-");
527
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
528
+ shareGeometriesItem.addActionListener(this);
529
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
530
+ mergeGeometriesItem.addActionListener(this);
531
+ if (Globals.ADVANCED)
532
+ {
533
+ // Pretty much the same as duplicate and clone.
369534 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370535 extractGeometriesItem.addActionListener(this);
371536 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372537 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);
538
+ }
377539
378540 oe.menuBar.add(menu = new Menu("Insert"));
379541 buildCreateMenu(menu);
380542
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
-
392543 oe.menuBar.add(menu = new Menu("Tools"));
393544 buildToolsMenu(menu);
394545 }
395546
547
+
396548 void SetupUI2(ObjEditor oe)
397549 {
550
+ // June 2019
551
+ if (oe == null)
552
+ {
553
+ //super.SetupUI2(this);
554
+ //return;
555
+ }
556
+
557
+ if (copy != group)
558
+ {
559
+ //super.SetupUI2(this);
560
+ }
561
+
398562 //new Exception().printStackTrace();
399563
400564 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +587,230 @@
423587 oe.radioPanel.add(dummyButton);
424588 oe.buttonGroup.add(dummyButton);
425589 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
590
+ cGridBag copyOptionsPanel = new cGridBag();
591
+
592
+ copyOptionsPanel.preferredHeight = 1;
429593
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
594
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
595
+
596
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ //minButton.setToolTipText("Minimize window");
598
+ //minButton.addActionListener(this);
599
+
600
+ if (Globals.ADVANCED)
601
+ {
602
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ maxButton.setToolTipText("Maximize window");
604
+ maxButton.addActionListener(this);
605
+ }
606
+
607
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ fullButton.setToolTipText("Full-screen window");
609
+ fullButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ screenfitButton.setToolTipText("Screen fit");
613
+ screenfitButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ restoreCameraButton.setToolTipText("Restore viewpoint");
617
+ restoreCameraButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ saveButton.setToolTipText("New version");
621
+ saveButton.addActionListener(this);
622
+
623
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ undoButton.setToolTipText("Previous version");
625
+ undoButton.addActionListener(this);
626
+ undoButton.setEnabled(false);
627
+
628
+ cGridBag updown = new cGridBag().setVertical(true);
629
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ restoreButton.setToolTipText("Restore current");
631
+ restoreButton.addActionListener(this);
632
+ restoreButton.setEnabled(false);
633
+
634
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ replaceButton.setToolTipText("Replace current");
636
+ replaceButton.addActionListener(this);
637
+ replaceButton.setEnabled(false);
638
+
639
+ copyOptionsPanel.add(updown);
640
+
641
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ redoButton.setToolTipText("Next version");
643
+ redoButton.addActionListener(this);
644
+ redoButton.setEnabled(false);
645
+
646
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
647
+ liveCB.setToolTipText("Enable animation");
431648 liveCB.addItemListener(this);
432649
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);
650
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oneStepButton.setToolTipText("Animate one step forward");
652
+ oneStepButton.addActionListener(this);
653
+
654
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
655
+ fastCB.setToolTipText("Fast mode");
451656 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);
657
+
658
+ //oe.toolboxPanel.Return();
659
+
660
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
661
+// trackCB.setToolTipText("Enable tracking");
662
+// trackCB.addItemListener(this);
458663
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;
499664 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500665 // 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;
505666
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;
667
+ if (Globals.ADVANCED)
668
+ {
669
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ snapobjectButton.addActionListener(this);
671
+ snapobjectButton.setToolTipText("Snap Object");
672
+ }
673
+
674
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
516675
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
+ twoButton.setToolTipText("Show center view only");
519678 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
679
+ this.fullscreenLayout = twoButton;
680
+
681
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521682 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
683
+ fourButton.setToolTipText("Show left panel only");
684
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
685
+ sixButton.setToolTipText("2-column layout left");
523686 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
687
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ threeButton.setToolTipText("2-column layout right");
525689 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
691
+ sevenButton.setToolTipText("3-column layout");
527692 sevenButton.addActionListener(this);
528693 //
529694
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
695
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ rootButton.setToolTipText("Edit selection in new tab");
531697 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
698
+
699
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ closeButton.setToolTipText("Close tab");
534701 closeButton.addActionListener(this);
535702 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536703 //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;
545704
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
705
+ // INSERT
706
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
707
+ gridButton.setToolTipText("Create grid");
708
+ gridButton.addActionListener(this);
709
+
710
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ boxButton.setToolTipText("Create box");
712
+ boxButton.addActionListener(this);
713
+
714
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ sphereButton.setToolTipText("Create sphere");
716
+ sphereButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ coneButton.setToolTipText("Create cone");
720
+ coneButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ torusButton.setToolTipText("Create torus");
724
+ torusButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ superButton.setToolTipText("Create superellipsoid");
728
+ superButton.addActionListener(this);
729
+
730
+ if (Globals.ADVANCED)
731
+ {
732
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ kleinButton.setToolTipText("Create Klein bottle");
734
+ kleinButton.addActionListener(this);
735
+ }
736
+
737
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ particlesButton.setToolTipText("Create particle system");
739
+ particlesButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.Return();
742
+
743
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
744
+ groupButton.setToolTipText("Create group");
745
+ groupButton.addActionListener(this);
746
+
747
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ compositeButton.setToolTipText("Create composite");
749
+ compositeButton.addActionListener(this);
750
+
751
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ switchButton.setToolTipText("Create item switcher");
753
+ switchButton.addActionListener(this);
754
+
755
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
756
+ loopButton.setToolTipText("Create loop");
757
+ loopButton.addActionListener(this);
758
+
759
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ textureButton.setToolTipText("Create texture");
761
+ textureButton.addActionListener(this);
762
+
763
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ overlayButton.setToolTipText("Create overlay");
765
+ overlayButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ lightButton.setToolTipText("Create light");
769
+ lightButton.addActionListener(this);
770
+
771
+ for (int i=6; --i>=0;)
772
+ {
773
+ oe.toolboxPanel.Return();
774
+ oe.toolboxPanel.add(new cGridBag());
775
+ oe.toolboxPanel.add(new cGridBag());
776
+ oe.toolboxPanel.add(new cGridBag());
777
+ oe.toolboxPanel.add(new cGridBag());
778
+ oe.toolboxPanel.add(new cGridBag());
779
+ oe.toolboxPanel.add(new cGridBag());
780
+ oe.toolboxPanel.add(new cGridBag());
781
+ }
782
+
783
+ // EDIT panel
784
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ editButton.setToolTipText("Pin selection controls");
786
+ editButton.addActionListener(this);
787
+
788
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
789
+ uneditButton.setToolTipText("Remove selection controls");
547790 uneditButton.addActionListener(this);
548791
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);
792
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
793
+ allParamsButton.setToolTipText("Show all controle");
561794 allParamsButton.addActionListener(this);
562795
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);
796
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ clearPanelButton.setToolTipText("Clear edit panel");
798
+ clearPanelButton.addActionListener(this);
799
+
800
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ unselectButton.setToolTipText("Unselect");
568802 unselectButton.addActionListener(this);
569803
804
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ flashSelectionButton.setToolTipText("Highlight selection");
806
+ flashSelectionButton.addActionListener(this);
807
+
808
+ editCommandsPanel.preferredHeight = 1;
809
+
810
+ SetPinStates(false);
811
+// oe.treePanel.add(commandsPanel);
812
+// oe.treePanel.Return();
813
+
570814 // oe.aConstraints.gridx += 1;
571815 // oe.aConstraints.weighty = 0;
572816 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +822,25 @@
578822 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579823 // gcButton.addActionListener(this);
580824
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;
825
+ cGridBag jSPPanel = new cGridBag();
826
+
827
+ JScrollPane jSP;
592828 //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);
829
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594830 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;
614831
832
+ oe.treePanel.add(jSPPanel);
833
+ oe.treePanel.Return();
834
+
835
+ oe.treePanel.add(copyOptionsPanel);
836
+ oe.treePanel.Return();
837
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0);
838
+ versionField = (cNumberSlider)sliderPane.getComponent(1);
839
+ sliderPane.preferredHeight = 1;
840
+
841
+// mainPanel.setDividerLocation(0.5); //1.0);
842
+// mainPanel.setResizeWeight(0.5);
843
+
615844 //jList.addListSelectionListener(this);
616845 oe.jTree.addTreeSelectionListener(this);
617846 //jTree.setRootVisible(false);
....@@ -633,20 +862,157 @@
633862 radio.layout = sevenButton;
634863 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635864 }
865
+
866
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
867
+ {
868
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
869
+ colorCB.setToolTipText("Copy color when dropped");
870
+ colorCB.addItemListener(this);
871
+
872
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
873
+ materialCB.setToolTipText("Copy material when dropped");
874
+ materialCB.addItemListener(this);
875
+
876
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
877
+ textureCB.setToolTipText("Copy texture when dropped");
878
+ textureCB.addItemListener(this);
879
+
880
+ panel.Return();
881
+
882
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
883
+ boxCB.setToolTipText("Display bounding boxes");
884
+ boxCB.addItemListener(this);
885
+
886
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
887
+ zoomBoxCB.setToolTipText("Display only for wheel");
888
+ zoomBoxCB.addItemListener(this);
889
+
890
+ if (true) // Globals.ADVANCED)
891
+ {
892
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
893
+// supportCB.setToolTipText("Enable rigging");
894
+// supportCB.addItemListener(this);
895
+
896
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
897
+ freezeCB.setToolTipText("Fast moving camera");
898
+ freezeCB.addItemListener(this);
899
+
900
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
901
+ // localCB.addItemListener(this);
902
+
903
+ panel.Return();
904
+
905
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
906
+ crowdCB.setToolTipText("Used for crowds");
907
+ crowdCB.addItemListener(this);
908
+
909
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
910
+ smoothCB.setToolTipText("Snapping delay");
911
+ smoothCB.addItemListener(this);
912
+
913
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
914
+ slowCB.setToolTipText("Smooth interpolation");
915
+ slowCB.addItemListener(this);
916
+
917
+// constraints.gridy += 1;
918
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
919
+// speakerMocapCB.addItemListener(this);
920
+
921
+ panel.Return();
922
+
923
+ if (false)
924
+ {
925
+ // handled in scripts
926
+ //constraints.gridy += 1;
927
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
928
+ speakerCameraCB.addItemListener(this);
929
+
930
+ //constraints.gridy += 1;
931
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
932
+ speakerFocusCB.addItemListener(this);
933
+
934
+ //constraints.gridy += 1;
935
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
936
+ smoothfocusCB.addItemListener(this);
937
+ panel.Return();
938
+ }
939
+
940
+//constraints.gridx += 1;
941
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
942
+// debugCB.addItemListener(this);
943
+
944
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
945
+ trackCB.setToolTipText("Enable tracking target");
946
+ trackCB.addItemListener(this);
947
+
948
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
949
+ oeilCB.setToolTipText("Move camera when tracking");
950
+ oeilCB.addItemListener(this);
951
+
952
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
953
+ shadowCB.setToolTipText("When live compute shadows");
954
+ shadowCB.addItemListener(this);
955
+
956
+ panel.Return();
957
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
958
+ toggleTextureCB.setToolTipText("Load textures");
959
+ toggleTextureCB.addItemListener(this);
960
+
961
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
962
+ toggleSwitchCB.setToolTipText("Choose a single item");
963
+ toggleSwitchCB.addItemListener(this);
964
+
965
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
966
+ autokeepCB.setToolTipText("On structure change");
967
+ autokeepCB.addItemListener(this);
968
+
969
+ panel.Return();
970
+ if (Globals.ADVANCED)
971
+ {
972
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
973
+ lookAtCB.setToolTipText("Look-at target");
974
+ lookAtCB.addItemListener(this);
975
+ }
976
+
977
+ }
978
+
979
+ cGridBag fill = new cGridBag();
980
+ fill.preferredHeight = 200;
981
+ cGridBag fill2 = new cGridBag();
982
+ fill2.preferredHeight = 200;
983
+ cGridBag fill3 = new cGridBag();
984
+ fill3.preferredHeight = 200;
985
+
986
+ panel.add(fill);
987
+ panel.add(fill2);
988
+ panel.add(fill3);
989
+
990
+ }
636991
637992 void EditObject(Object3D obj)
638993 {
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();
994
+ cRadio radioButton = new cRadio(obj.name);
995
+
996
+ // June 2019. Patch to avoid bug with transparency.
997
+ radioButton.hadMaterial = obj.material != null;
998
+ if (!radioButton.hadMaterial)
999
+ {
1000
+ obj.material = new cMaterial();
1001
+ }
1002
+
1003
+ radioButton.SetObject(obj);
1004
+ radioButton.layout = sevenButton;
1005
+ radioButton.SetCamera(cameraView.renderCamera, false);
1006
+ radioButton.addActionListener(this);
1007
+ radioPanel.add(radioButton);
1008
+ buttonGroup.add(radioButton);
1009
+ radioButton.doClick();
6471010 }
1011
+
6481012 void SetupViews(ObjEditor oe)
6491013 {
1014
+ theFrame = this;
1015
+
6501016 oe.SetupViews();
6511017
6521018 System.out.println("SetupViews");
....@@ -655,22 +1021,28 @@
6551021 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561022 }
6571023
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;
1024
+ cToggleButton liveCB;
1025
+ cCheckBox supportCB;
1026
+ cCheckBox localCB;
1027
+ cCheckBox crowdCB;
1028
+ cCheckBox smoothCB;
1029
+ cToggleButton fastCB;
1030
+ cCheckBox slowCB;
1031
+ cCheckBox boxCB;
1032
+ cCheckBox zoomBoxCB;
1033
+ cCheckBox freezeCB;
1034
+ //cToggleButton trackCB;
1035
+ cCheckBox trackCB;
1036
+ cCheckBox smoothfocusCB;
6681037 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1038
+ cCheckBox speakerCameraCB;
1039
+ cCheckBox speakerFocusCB;
1040
+ cCheckBox debugCB;
1041
+
1042
+ cCheckBox oeilCB;
1043
+ cCheckBox shadowCB;
1044
+ cCheckBox autokeepCB;
1045
+ cCheckBox lookAtCB;
6741046
6751047 // static int COLOR = 1;
6761048 // static int MATERIAL = 2;
....@@ -678,9 +1050,9 @@
6781050
6791051 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801052
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1053
+ cCheckBox colorCB;
1054
+ cCheckBox materialCB;
1055
+ cCheckBox textureCB;
6841056
6851057 public void itemStateChanged(ItemEvent e)
6861058 {
....@@ -705,10 +1077,10 @@
7051077 dropAttributes |= Object3D.TEXTURE;
7061078 else
7071079 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1080
+ } else if(e.getSource() == liveCB)
7101081 {
7111082 cameraView.ToggleLive();
1083
+ refreshContents(false);
7121084 }
7131085 else if(e.getSource() == supportCB)
7141086 {
....@@ -744,6 +1116,10 @@
7441116 cameraView.repaint();
7451117 // refreshContents();
7461118 }
1119
+ else if(e.getSource() == zoomBoxCB)
1120
+ {
1121
+ cameraView.ToggleZoomBoxMode();
1122
+ }
7471123 else if(e.getSource() == smoothfocusCB)
7481124 {
7491125 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1145,18 @@
7691145 {
7701146 cameraView.ToggleOeil();
7711147 }
1148
+ else if(e.getSource() == shadowCB)
1149
+ {
1150
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1151
+ }
1152
+ else if(e.getSource() == freezeCB)
1153
+ {
1154
+ Globals.FREEZEONMOVE ^= true;
1155
+ }
1156
+ else if(e.getSource() == autokeepCB)
1157
+ {
1158
+ Globals.REPLACEONMAKE ^= true;
1159
+ }
7721160 else if(e.getSource() == lookAtCB)
7731161 {
7741162 cameraView.ToggleLookAt();
....@@ -785,7 +1173,8 @@
7851173
7861174 /**/
7871175 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1176
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1177
+ TreePath path = objEditor.jTree.getSelectionPath();
7891178 if ((path == null) || (path.getPathCount() <= 1)) {
7901179 // We can't move the root node or an empty selection
7911180 return;
....@@ -848,8 +1237,6 @@
8481237 }
8491238 }
8501239
851
- String string = (String) object;
852
-
8531240 System.out.println("Transfer = " + object + "; drop : " + target);
8541241 // if( object instanceof java.io.File[])
8551242 // {
....@@ -857,7 +1244,11 @@
8571244 // objEditor.DropFile((java.io.File[]) object, true);
8581245 // return;
8591246 // }
860
- if (string.charAt(0) == '/')
1247
+
1248
+ String string = object.toString();
1249
+
1250
+ // File path for Mac and Windows
1251
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611252 {
8621253 // file(s)
8631254 String[] names = string.split("\n");
....@@ -884,7 +1275,7 @@
8841275
8851276 flashIt = false;
8861277 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1278
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881279 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891280
8901281 if (group.selection.size() == 1)
....@@ -900,23 +1291,33 @@
9001291
9011292 assert target == objEditor.jTree;
9021293 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1294
+ Object3D destinationLeaf;
9031295 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1296
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051297 } catch (Exception e) {
9061298 System.out.println("destinationPath : " + destinationPath);
9071299 return;
9081300 }
9091301
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1302
+ for (int i=group.selection.size(); --i>=0;)
9111303 {
1304
+ Object3D child = (Object3D)group.selection.elementAt(i);
1305
+
1306
+ // Cannot move into itself
1307
+ if (child == destinationLeaf)
1308
+ return;
1309
+ }
1310
+
1311
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1312
+// {
9121313 loadClipboard(true);
9131314 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1315
+ pasteInto(false, false);
1316
+// } else {
1317
+// loadClipboard(false);
1318
+// objEditor.jTree.setSelectionPath(destinationPath);
1319
+// pasteInto(false, false); // true); // ???
1320
+// }
9201321 }
9211322 public void dropActionChanged(DropTargetDragEvent dtde)
9221323 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1422,107 @@
10211422 {
10221423 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231424 //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);
1425
+// gridItem = menu.add(new MenuItem("Grid"));
1426
+// gridItem.addActionListener(this);
1427
+// rectoidItem = menu.add(new MenuItem("Box"));
1428
+// rectoidItem.addActionListener(this);
1429
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1430
+// ellipsoidItem.addActionListener(this);
1431
+// coneItem = menu.add(new MenuItem("Cone"));
1432
+// coneItem.addActionListener(this);
1433
+// torusItem = menu.add(new MenuItem("Torus"));
1434
+// torusItem.addActionListener(this);
1435
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1436
+// superItem.addActionListener(this);
1437
+
1438
+ cameraItem = menu.add(new MenuItem("Camera"));
1439
+ cameraItem.addActionListener(this);
1440
+
1441
+ if (!Globals.ADVANCED)
1442
+ {
1443
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1444
+ kleinItem.addActionListener(this);
1445
+ }
1446
+
1447
+// particleItem = menu.add(new MenuItem("Particle system"));
1448
+// particleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
10381451 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391452 ragdollItem.addActionListener(this);
10401453 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411454 ragdoll2Item.addActionListener(this);
1455
+ }
10421456 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1457
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441458 meshItem.addActionListener(this);
10451459 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461460 // meshGroupItem.addActionListener(this);
1461
+ if (Globals.ADVANCED)
1462
+ {
10471463 springItem = menu.add(new MenuItem("Spring"));
10481464 springItem.addActionListener(this);
10491465 flagItem = menu.add(new MenuItem("Flag"));
10501466 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);
10551467 blobItem = menu.add(new MenuItem("Blob"));
10561468 blobItem.addActionListener(this);
10571469 latheItem = menu.add(new MenuItem("Lathe"));
10581470 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1471
+ }
1472
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1473
+ bezierItem.addActionListener(this);
1474
+// overlayItem = menu.add(new MenuItem("Overlay"));
1475
+// overlayItem.addActionListener(this);
1476
+// lightItem = menu.add(new MenuItem("Light"));
1477
+// lightItem.addActionListener(this);
10611478 menu.add("-");
10621479 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631480 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1481
+// loopItem = menu.add(new MenuItem("Loop"));
1482
+// loopItem.addActionListener(this);
10661483 doubleItem = menu.add(new MenuItem("Fork"));
10671484 doubleItem.addActionListener(this);
1485
+ if (Globals.ADVANCED)
1486
+ {
10681487 tripleItem = menu.add(new MenuItem("Trident"));
10691488 tripleItem.addActionListener(this);
1489
+ }
10701490 }
10711491
10721492 void buildToolsMenu(Menu menu)
10731493 {
10741494 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751495 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1496
+ animationItem.setState(Globals.ANIMATION);
1497
+
1498
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1499
+ archiveItem.addActionListener(this);
10771500
10781501 menu.add("-");
10791502 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801503 parseverticesItem.addActionListener(this);
10811504 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821505 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1506
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841507 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871508 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881509 reduceMorphItem.addActionListener(this);
10891510 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901511 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941512 menu.add("-");
1095
-
10961513 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971514 memoryItem.addActionListener(this);
1515
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1516
+ computeAOItem.addActionListener(this);
1517
+
1518
+ if (Globals.ADVANCED)
1519
+ {
1520
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1521
+ mirrorItem.addActionListener(this);
1522
+ menu.add("-");
10981523 menu.add(analyzeItem = new MenuItem("Analyze"));
10991524 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1525
+ menu.add(dumpItem = new MenuItem("Print"));
11011526 dumpItem.addActionListener(this);
11021527 // menu.add(pathItem = new MenuItem("From-to path"));
11031528 // pathItem.addActionListener(this);
....@@ -1106,6 +1531,8 @@
11061531 resetParentItem.addActionListener(this);
11071532 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081533 repairParentItem.addActionListener(this);
1534
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1535
+ repairShadowItem.addActionListener(this);
11091536 menu.add(invariantsItem = new MenuItem("Invariants"));
11101537 invariantsItem.addActionListener(this);
11111538 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1540,7 @@
11131540 menu.add("-");
11141541 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151542 editScriptItem.addActionListener(this);
1543
+ }
11161544 }
11171545
11181546 void ScreenFit()
....@@ -1235,9 +1663,24 @@
12351663 shadow.material = new cMaterial(obj.material);
12361664 shadow.material.diffuse = 0.0001f;
12371665 shadow.material.specular = 0.0001f;
1666
+ //shadow.projectedVertices[1].x = 300;
12381667
12391668 makeSomething(shadow);
12401669 }
1670
+
1671
+ private void ClearUnpinned()
1672
+ {
1673
+ //for (Object3D obj : listUI)
1674
+ for (int i=listUI.size(); --i>=0;)
1675
+ {
1676
+ Object3D obj = listUI.elementAt(i);
1677
+ if (!obj.pinned)
1678
+ {
1679
+ obj.CloseUI();
1680
+ listUI.remove(i);
1681
+ }
1682
+ }
1683
+ }
12411684
12421685 /**
12431686 * applyExample
....@@ -1441,9 +1884,9 @@
14411884
14421885 void Overwrite(int mask)
14431886 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1887
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451888 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1889
+ Object3D content = Grafreed.clipboard.get(0);
14471890
14481891 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491892 content = ((cGroup)content).get(0);
....@@ -1466,6 +1909,7 @@
14661909 //
14671910 public void actionPerformed(ActionEvent event) // , Object arg)
14681911 {
1912
+ Object source = event.getSource();
14691913 /*
14701914 if (event.getSource() == nameField)
14711915 {
....@@ -1477,11 +1921,11 @@
14771921 }
14781922 else
14791923 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1924
+ if (source == lookAtItem || source == lookFromItem)
14811925 {
14821926 ScreenFit();
14831927 } else
1484
- if (event.getSource() == switchItem)
1928
+ if (source == switchViewItem)
14851929 {
14861930 cVector v1 = new cVector();
14871931 cVector v2 = new cVector();
....@@ -1490,11 +1934,11 @@
14901934 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911935 objEditor.cameraView.repaint();
14921936 } else
1493
- if (event.getSource() == rectoidItem)
1937
+ if (source == rectoidItem || source == boxButton)
14941938 {
14951939 makeSomething(new Box());
14961940 } else
1497
- if (event.getSource() == particleItem)
1941
+ if (source == particleItem || source == particlesButton)
14981942 {
14991943 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001944 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1959,9 @@
15151959 applyExample(particleGeom, "SMOKE");
15161960 makeSomething(particleGeom);
15171961 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1962
+ if (source == ragdollItem || source == ragdoll2Item)
15191963 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1964
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211965
15221966 ragdoll.toParent = LA.newMatrix();
15231967 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1979,7 @@
15351979 } else
15361980 /*
15371981 */
1538
- if (event.getSource() == heightFieldItem)
1982
+ if (source == heightFieldItem)
15391983 {
15401984 Object3D obj = new Object3D();
15411985
....@@ -1573,27 +2017,31 @@
15732017
15742018 makeSomething(obj);
15752019 } else
1576
- if (event.getSource() == gridItem)
2020
+ if (source == gridItem || source == gridButton)
15772021 {
15782022 makeSomething(new Grid());
15792023 } else
1580
- if (event.getSource() == ellipsoidItem)
2024
+ if (source == ellipsoidItem || source == sphereButton)
15812025 {
15822026 makeSomething(new Sphere());
15832027 } else
1584
- if (event.getSource() == coneItem)
2028
+ if (source == coneItem || source == coneButton)
15852029 {
15862030 makeSomething(new Cone());
15872031 } else
1588
- if (event.getSource() == torusItem)
2032
+ if (source == torusItem || source == torusButton)
15892033 {
15902034 makeSomething(new Torus());
15912035 } else
1592
- if (event.getSource() == superItem)
2036
+ if (source == superItem || source == superButton)
15932037 {
15942038 makeSomething(new Superellipsoid());
15952039 } else
1596
- if (event.getSource() == blobItem)
2040
+ if (source == kleinItem || source == kleinButton)
2041
+ {
2042
+ makeSomething(new Klein());
2043
+ } else
2044
+ if (source == blobItem)
15972045 {
15982046 Blob blob = new Blob();
15992047 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2049,15 @@
16012049 //blob.retile();
16022050 makeSomething(blob);
16032051 } else
1604
- if (event.getSource() == latheItem)
2052
+ if (source == latheItem)
16052053 {
16062054 makeSomething(new Lathe());
16072055 } else
1608
- if (event.getSource() == bezierItem)
2056
+ if (source == bezierItem)
16092057 {
16102058 makeSomething(new BezierSurface());
16112059 } else
1612
- if (event.getSource() == checkerItem)
2060
+ if (source == overlayItem || source == overlayButton)
16132061 {
16142062 /*
16152063 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2072,7 @@
16242072 */
16252073 makeSomething(new Checker());
16262074 } else
1627
- if (event.getSource() == meshItem)
2075
+ if (source == meshItem)
16282076 {
16292077 Object3D itemtomake = new Object3D();
16302078 Object3D child;
....@@ -1645,35 +2093,35 @@
16452093 makeSomething(child);
16462094 }
16472095 } else
1648
- if (event.getSource() == springItem)
2096
+ if (source == springItem)
16492097 {
16502098 cSpring s = new cSpring();
16512099 s.setup();
16522100 makeSomething(s);
16532101 } else
1654
- if (event.getSource() == flagItem)
2102
+ if (source == flagItem)
16552103 {
16562104 cSpring s = new cFlag();
16572105 s.setup();
16582106 makeSomething(s);
16592107 } else
1660
- if (event.getSource() == lightItem)
2108
+ if (source == lightItem || source == lightButton)
16612109 {
16622110 makeSomething(new Light());
16632111 } else
1664
- if (event.getSource() == csgItem)
2112
+ if (source == csgItem)
16652113 {
16662114 group(new CSG());
16672115 } else
1668
- if (event.getSource() == templateItem)
2116
+ if (source == templateItem)
16692117 {
16702118 group(new cTemplate());
16712119 } else
1672
- if (event.getSource() == attributeItem)
2120
+ if (source == attributeItem)
16732121 {
16742122 makeSomething(new Attribute());
16752123 } else
1676
- if (event.getSource() == pointflowItem)
2124
+ if (source == pointflowItem)
16772125 {
16782126 makeSomething(new PointFlow());
16792127 } else
....@@ -1685,7 +2133,7 @@
16852133 } else
16862134 */
16872135
1688
- if (event.getSource() == superLoopItem)
2136
+ if (source == superLoopItem)
16892137 {
16902138 Composite g = new cGroup();
16912139 for (int i=0; i<15; i++)
....@@ -1707,30 +2155,30 @@
17072155
17082156 group(g);
17092157 } else
1710
- if (event.getSource() == loopItem)
2158
+ if (source == loopItem || source == loopButton)
17112159 {
17122160 Composite csg = new GroupLeaf();
17132161 csg.count = 5;
17142162 group(csg);
1715
- Composite child = new cGroup();
2163
+ Composite child = new cGroup("Branch");
17162164 csg.addChild(child);
17172165 child.addChild(csg);
17182166 } else
1719
- if (event.getSource() == doubleItem)
2167
+ if (source == doubleItem)
17202168 {
1721
- Composite csg = new GroupLeaf();
2169
+ Composite csg = new GroupLeaf("Fork");
17222170 csg.count = 5;
17232171 group(csg);
1724
- Composite child = new cGroup();
2172
+ Composite child = new cGroup("Branch A");
17252173 csg.addChild(child);
17262174 child.addChild(csg);
1727
- child = new cGroup();
2175
+ child = new cGroup("Branch B");
17282176 csg.addChild(child);
17292177 child.addChild(csg);
17302178 } else
1731
- if (event.getSource() == tripleItem)
2179
+ if (source == tripleItem)
17322180 {
1733
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Trident");
17342182 csg.count = 4;
17352183 group(csg);
17362184 Composite child = new cGroup();
....@@ -1743,73 +2191,98 @@
17432191 csg.addChild(child);
17442192 child.addChild(csg);
17452193 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2194
+ if (source == computeAOItem)
17482195 {
1749
- ImportGFD();
2196
+ Globals.drawMode = CameraPane.OCCLUSION;
2197
+ Globals.theRenderer.repaint();
17502198 } 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)
2199
+ if (source == recompileItem)
17692200 {
17702201 Recompile();
17712202 refreshContents();
17722203 } else
1773
- if (event.getSource() == editScriptItem)
2204
+ if (source == editScriptItem)
17742205 {
17752206 OpenDialog();
17762207 refreshContents();
17772208 } else
1778
- if (event.getSource() == invariantsItem)
2209
+ if (source == invariantsItem)
17792210 {
17802211 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2212
+ Grafreed.grafreeD.universe.invariants();
17822213 } else
1783
- if (event.getSource() == memoryItem)
2214
+ if (source == memoryItem)
17842215 {
17852216 //System.out.println("Invariants:");
17862217 PrintMemory();
17872218 } else
1788
- if (event.getSource() == pathItem)
2219
+ if (source == pathItem)
17892220 {
17902221 PrintPath();
17912222 } else
1792
- if (event.getSource() == analyzeItem)
2223
+ if (source == analyzeItem)
17932224 {
17942225 AnalyzeObject();
17952226 } else
1796
- if (event.getSource() == dumpItem)
2227
+ if (source == dumpItem)
17972228 {
17982229 DumpObject();
17992230 } else
1800
- if (event.getSource() == screenfitButton)
2231
+ if (source == minButton)
18012232 {
1802
- //Reload(lastConverter, lastFilename, true);
2233
+ Minimize();
2234
+ } else
2235
+ if (source == maxButton)
2236
+ {
2237
+ Maximize();
2238
+ } else
2239
+ if (source == fullButton)
2240
+ {
2241
+ ToggleFullScreen();
2242
+ } else
2243
+ if (source == undoButton)
2244
+ {
2245
+ // Go to previous version
2246
+ //if (!Undo())
2247
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2248
+ Undo();
2249
+ } else
2250
+ if (source == restoreButton)
2251
+ {
2252
+ // Restore current version
2253
+ Restore();
2254
+ } else
2255
+ if (source == replaceButton)
2256
+ {
2257
+ // Overwrite current version
2258
+ Replace();
2259
+ } else
2260
+ if (source == redoButton)
2261
+ {
2262
+ // Go to next version
2263
+ Redo();
2264
+ } else
2265
+ if (source == saveButton)
2266
+ {
2267
+ // Save a new version
2268
+ if (!Save(true))
2269
+ java.awt.Toolkit.getDefaultToolkit().beep();
2270
+ } else
2271
+ if (source == oneStepButton)
2272
+ {
2273
+ Globals.ONESTEP = true;
2274
+ cameraView.repaint();
2275
+ } else
2276
+ if (source == screenfitButton)
2277
+ {
18032278 ScreenFit();
18042279 } else
1805
- if (event.getSource() == screenfitpointButton)
2280
+ if (source == screenfitpointButton)
18062281 {
1807
- //Reload(lastConverter, lastFilename, true);
18082282 ScreenFitPoint();
18092283 } else
1810
- if (event.getSource() == snapobjectButton)
2284
+ if (source == snapobjectButton)
18112285 {
1812
- //Reload(lastConverter, lastFilename, true);
18132286 SnapObject();
18142287 } else
18152288 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2291,13 @@
18182291 // Recompile();
18192292 // refreshContents();
18202293 // } else
1821
- if (event.getSource() == gcButton)
2294
+ if (source == gcButton)
18222295 {
18232296 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242297 System.gc();
18252298 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262299 } else
1827
- if (event.getSource() == editLeafItem)
2300
+ if (source == editLeafItem)
18282301 {
18292302 Object3D obj;
18302303 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2311,78 @@
18382311 }
18392312 refreshContents(true);
18402313 } else
1841
- if (event.getSource() == openWindowItem)
2314
+ if (source == openWindowItem)
18422315 {
18432316 EditSelection(true);
18442317 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2318
+ if (source == cutItem || source == clearButton)
18462319 {
18472320 loadClipboard(true);
18482321 } else
1849
- if (event.getSource() == duplicateItem)
2322
+ if (source == undoItem)
18502323 {
1851
- Object3D keep = GraphreeD.clipboard;
2324
+ Undo();
2325
+ } else
2326
+ if (source == redoItem)
2327
+ {
2328
+ Redo();
2329
+ } else
2330
+ if (source == duplicateItem)
2331
+ {
2332
+ Object3D keep = Grafreed.clipboard;
18522333 loadClipboard(false);
18532334 paste(false);
1854
- GraphreeD.clipboard = keep;
2335
+ Grafreed.clipboard = keep;
18552336 } else
1856
- if (event.getSource() == cloneItem)
2337
+ if (source == cloneItem)
18572338 {
18582339 CloneSelection(false);
18592340 } else
1860
- if (event.getSource() == cloneSupportItem)
2341
+ if (source == cloneSupportItem)
18612342 {
18622343 CloneSelection(true);
18632344 } else
1864
- if (event.getSource() == copyItem)
2345
+ if (source == copyItem)
18652346 {
18662347 loadClipboard(false);
18672348 } else
1868
- if (event.getSource() == pasteItem)
2349
+ if (source == pasteItem)
18692350 {
18702351 paste(false);
18712352 } else
1872
- if (event.getSource() == pasteLinkItem)
2353
+ if (source == pasteIntoItem)
18732354 {
1874
- pasteInto(false);
2355
+ pasteInto(true, false);
18752356 } else
1876
- if (event.getSource() == pasteCloneItem)
2357
+ if (source == pasteLinkItem)
18772358 {
1878
- pasteInto(true);
2359
+ pasteInto(false, false);
18792360 } else
1880
- if (event.getSource() == pasteExpandItem)
2361
+ if (source == pasteCloneItem)
2362
+ {
2363
+ pasteInto(true, true);
2364
+ } else
2365
+ if (source == pasteExpandItem)
18812366 {
18822367 paste(true);
18832368 } else
1884
- if (event.getSource() == synchronizeItem)
2369
+ if (source == synchronizeItem)
18852370 {
18862371 Overwrite(Object3D.TRANSFORM);
18872372 } else
1888
- if (event.getSource() == overwriteNameItem)
2373
+ if (source == overwriteNameItem)
18892374 {
18902375 Overwrite(Object3D.NAME);
18912376 } else
1892
- if (event.getSource() == overwriteUVItem)
2377
+ if (source == overwriteUVItem)
18932378 {
18942379 Overwrite(Object3D.UV);
18952380 } else
1896
- if (event.getSource() == overwriteMatItem)
2381
+ if (source == overwriteMatItem)
18972382 {
2383
+ /* july 2015
18982384 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2385
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002386 else
19012387 {
19022388 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2394,16 @@
19082394 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092395 }
19102396 }
2397
+ */
2398
+
2399
+ Overwrite(dropAttributes);
19112400 }
1912
- if (event.getSource() == overwriteGeoItem)
2401
+ if (source == overwriteGeoItem)
19132402 {
19142403 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2404
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162405 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2406
+// Object3D content = GrafreeD.clipboard.get(0);
19182407 //
19192408 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202409 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2415,7 @@
19262415 // refreshContents();
19272416 // }
19282417 } else
1929
- if (event.getSource() == generateMeshItem)
2418
+ if (source == generateMeshItem)
19302419 {
19312420 //if (group.selection.size() == 1)
19322421 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2426,7 @@
19372426 ResetModel();
19382427 refreshContents();
19392428 } else
1940
- if (event.getSource() == extractGeometriesItem)
2429
+ if (source == extractGeometriesItem)
19412430 {
19422431 boolean one = false;
19432432
....@@ -1964,7 +2453,7 @@
19642453 ResetModel();
19652454 refreshContents();
19662455 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2456
+ if (source == cloneGeometriesItem)
19682457 {
19692458 boolean one = false;
19702459
....@@ -1990,32 +2479,37 @@
19902479 ResetModel();
19912480 refreshContents();
19922481 } else
1993
- if (event.getSource() == shareGeometriesItem)
2482
+ if (source == shareGeometriesItem)
19942483 {
19952484 boolean one = false;
19962485
19972486 if (group.selection.size() == 1)
19982487 one = true;
19992488
2489
+ Object3D merge = null;
2490
+
20002491 Object3D content = new cGroup();
20012492
20022493 for (int i=0; i<group.selection.size(); i++)
20032494 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2495
+ merge = new Merge(group.selection.get(i));
20052496
20062497 if (one)
2007
- makeSomething(sel, false);
2498
+ makeSomething(merge, false);
20082499 else
2009
- content.addChild(sel);
2500
+ content.addChild(merge);
20102501 }
20112502
20122503 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2504
+ makeSomething(content, true);
2505
+ else
2506
+ {
2507
+ ResetModel();
2508
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2509
+ refreshContents();
2510
+ }
20172511 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2512
+ if (source == mergeGeometriesItem)
20192513 {
20202514 boolean one = false;
20212515
....@@ -2045,11 +2539,11 @@
20452539 ResetModel();
20462540 refreshContents();
20472541 } else
2048
- if (event.getSource() == linkverticesItem)
2542
+ if (source == linkverticesItem)
20492543 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2544
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512545 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2546
+// Object3D content = GrafreeD.clipboard.get(0);
20532547 //
20542548 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552549 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2552,48 @@
20582552 // group.selection.get(0).setMasterThis(content); // should be identity
20592553 // refreshContents();
20602554 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2555
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622556 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2557
+ Object3D content = Grafreed.clipboard.get(0);
20642558
20652559 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662560 content = ((cGroup)content).get(0);
20672561
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2562
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692563 for (int i=0; i<group.selection.size(); i++)
20702564 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2565
+ boolean random = CameraPane.SWITCH;
2566
+ CameraPane.SWITCH = false; // parse all random nodes
20732567 group.selection.get(i).linkVerticesThis(content);
20742568 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2569
+ CameraPane.SWITCH = random;
20762570 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2571
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782572 refreshContents();
20792573 }
20802574 } else
2081
- if (event.getSource() == resetsupportItem)
2575
+ if (source == resetsupportItem)
20822576 {
20832577 for (int i=0; i<group.selection.size(); i++)
20842578 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2579
+ boolean random = CameraPane.SWITCH;
2580
+ CameraPane.SWITCH = false; // parse all random nodes
20872581 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2582
+ CameraPane.SWITCH = random;
20892583 }
20902584
20912585 refreshContents();
20922586 } else
2093
- if (event.getSource() == resetreferencesItem)
2587
+ if (source == relinkverticesItem)
2588
+ {
2589
+ boolean random = CameraPane.SWITCH;
2590
+ CameraPane.SWITCH = false; // parse all random nodes
2591
+ group.selection.RelinkToSupport();
2592
+ CameraPane.SWITCH = random;
2593
+
2594
+ refreshContents();
2595
+ } else
2596
+ if (source == resetreferencesItem)
20942597 {
20952598 for (int i=0; i<group.selection.size(); i++)
20962599 {
....@@ -2099,11 +2602,11 @@
20992602
21002603 refreshContents();
21012604 } else
2102
- if (event.getSource() == setMasterItem)
2605
+ if (source == setMasterItem)
21032606 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2607
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052608 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2609
+ Object3D content = Grafreed.clipboard.get(0);
21072610
21082611 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092612 content = ((cGroup)content).get(0);
....@@ -2112,13 +2615,13 @@
21122615 refreshContents();
21132616 }
21142617 } else
2115
- if (event.getSource() == poseMeshItem)
2618
+ if (source == poseMeshItem)
21162619 {
21172620 if (group.selection.size() == 1)
21182621 {
2119
- if (GraphreeD.clipboard.size() == 1)
2622
+ if (Grafreed.clipboard.size() == 1)
21202623 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2624
+ Object3D content = Grafreed.clipboard.get(0);
21222625
21232626 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242627 content = ((cGroup)content).get(0);
....@@ -2131,19 +2634,19 @@
21312634 }
21322635
21332636 } else
2134
- if (event.getSource() == revertMeshItem)
2637
+ if (source == revertMeshItem)
21352638 {
21362639 RevertMeshes();
21372640 } else
2138
- if (event.getSource() == resetMeshItem)
2641
+ if (source == resetAllItem)
21392642 {
21402643 ResetAll();
21412644 } else
2142
- if (event.getSource() == stepAllItem)
2645
+ if (source == stepAllItem)
21432646 {
21442647 StepAll();
21452648 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2649
+ if (source == clearItem) // || event.getSource() == clearButton)
21472650 {
21482651 //int indices[] = jList.getSelectedIndices();
21492652 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2654,46 @@
21512654
21522655 ClearSelection(false);
21532656 } else
2154
- if (event.getSource() == clearAllItem)
2657
+ if (source == clearAllItem)
21552658 {
21562659 ClearSelection(true);
21572660 } else
2158
- if (event.getSource() == grabItem)
2661
+ if (source == grabItem || source == groupButton)
21592662 {
2160
- group(new cGroup(), true);
2663
+ group(new cGroup(), false); // true);
21612664 } else
2162
- if (event.getSource() == frontItem)
2665
+ if (source == hideItem)
2666
+ {
2667
+ group(new HiddenObject());
2668
+ } else
2669
+ if (source == frontItem)
21632670 {
21642671 front();
21652672 } else
2166
- if (event.getSource() == backItem)
2673
+ if (source == backItem)
21672674 {
21682675 back();
21692676 } else
2170
- if (event.getSource() == cameraItem)
2677
+ if (source == cameraItem)
21712678 {
21722679 makeSomething(new Camera());
21732680 } else
2174
- if (event.getSource() == compositeItem)
2681
+ if (source == compositeItem || source == compositeButton)
21752682 {
21762683 group(new Composite());
21772684 } else
2178
- if (event.getSource() == randomItem)
2685
+ if (source == switchItem || source == switchButton)
21792686 {
21802687 RandomNode random = new RandomNode();
21812688 group(random);
21822689 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2690
+ random.name = random.get(0).name + "Switch";
21842691 } else
2185
- if (event.getSource() == physicsItem)
2692
+ if (source == physicsItem)
21862693 {
21872694 group(new PhysicsNode());
21882695 } else
2189
- if (event.getSource() == frameselectorItem)
2696
+ if (source == frameselectorItem)
21902697 {
21912698 for (int i=0; i<group.selection.size(); i++)
21922699 {
....@@ -2198,7 +2705,7 @@
21982705 ResetModel();
21992706 refreshContents();
22002707 } else
2201
- if (event.getSource() == switchGeoItem)
2708
+ if (source == switchGeoItem)
22022709 {
22032710 for (int i=0; i<group.selection.size(); i++)
22042711 {
....@@ -2210,7 +2717,7 @@
22102717 ResetModel();
22112718 refreshContents();
22122719 } else
2213
- if (event.getSource() == switchTransfoItem)
2720
+ if (source == switchTransfoItem)
22142721 {
22152722 for (int i=0; i<group.selection.size(); i++)
22162723 {
....@@ -2222,7 +2729,7 @@
22222729 ResetModel();
22232730 refreshContents();
22242731 } else
2225
- if (event.getSource() == morphItem)
2732
+ if (source == morphItem)
22262733 {
22272734 for (int i=0; i<group.selection.size(); i++)
22282735 {
....@@ -2234,7 +2741,7 @@
22342741 ResetModel();
22352742 refreshContents();
22362743 } else
2237
- if (event.getSource() == scriptNodeItem)
2744
+ if (source == scriptNodeItem)
22382745 {
22392746 boolean atleastone = false;
22402747
....@@ -2273,195 +2780,252 @@
22732780 }
22742781 }
22752782 } else
2276
- if (event.getSource() == linkerItem)
2783
+ if (source == linkerItem)
22772784 {
22782785 group(new cLinker());
22792786 } else
2280
- if (event.getSource() == textureItem)
2787
+ if (source == textureItem || source == textureButton)
22812788 {
22822789 group(new TextureNode());
22832790 } else
2284
- if (event.getSource() == shadowXItem)
2791
+ if (source == billboardItem)
2792
+ {
2793
+ group(new BillboardNode());
2794
+ } else
2795
+ if (source == shadowXItem)
22852796 {
22862797 CastShadow(0);
22872798 } else
2288
- if (event.getSource() == shadowYItem)
2799
+ if (source == shadowYItem)
22892800 {
22902801 CastShadow(1);
22912802 } else
2292
- if (event.getSource() == shadowZItem)
2803
+ if (source == shadowZItem)
22932804 {
22942805 CastShadow(2);
22952806 } else
2296
- if (event.getSource() == ungroupItem)
2807
+ if (source == ungroupItem || source == ungroupButton)
22972808 {
2298
- ungroup();
2809
+ boolean hasRoot = false;
2810
+
2811
+ for (int i=0; i<group.selection.size(); i++)
2812
+ {
2813
+ if (group.selection.get(i) == group)
2814
+ {
2815
+ hasRoot = true;
2816
+ break;
2817
+ }
2818
+ }
2819
+
2820
+ if (!hasRoot)
2821
+ {
2822
+ for (int i=0; i<group.selection.size(); i++)
2823
+ {
2824
+ Ungroup(group.selection.get(i));
2825
+ }
2826
+
2827
+ ClearSelection(false);
2828
+
2829
+ refreshContents();
2830
+ }
22992831 } else
2300
- if (event.getSource() == genUVItem)
2832
+ if (source == genUVItem)
23012833 {
23022834 GenUV();
23032835 } else
2304
- if (event.getSource() == genNormalsCADItem)
2836
+ if (source == genNormalsCADItem)
23052837 {
23062838 GenNormals(true);
23072839 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2840
+ if (source == genNormalsMESHItem)
2841
+ {
2842
+ GenNormalsMESH();
2843
+ } else
2844
+ if (source == genNormalsORGANItem)
23092845 {
23102846 GenNormals(false);
23112847 } else
2312
- if (event.getSource() == stripifyItem)
2848
+ if (source == genNormalsMINEItem)
2849
+ {
2850
+ GenNormalsMINE();
2851
+ } else
2852
+ if (source == stripifyItem)
23132853 {
23142854 Stripify();
23152855 } else
2316
- if (event.getSource() == unstripifyItem)
2856
+ if (source == unstripifyItem)
23172857 {
23182858 Unstripify();
23192859 } else
2320
- if (event.getSource() == trimItem)
2860
+ if (source == trimItem)
23212861 {
23222862 Trim();
23232863 } else
2324
- if (event.getSource() == untrimItem)
2864
+ if (source == untrimItem)
23252865 {
23262866 Untrim();
23272867 } else
2328
- if (event.getSource() == clearColorsItem)
2868
+ if (source == clearColorsItem)
23292869 {
23302870 ClearColors();
23312871 } else
2332
- if (event.getSource() == clearMaterialsItem)
2872
+ if (source == clearMaterialsItem)
23332873 {
23342874 ClearMaterials();
23352875 } else
2336
- if (event.getSource() == liveleavesItem)
2876
+ if (source == liveleavesItem)
23372877 {
23382878 LiveLeaves(true);
23392879 } else
2340
- if (event.getSource() == unliveleavesItem)
2880
+ if (source == unliveleavesItem)
23412881 {
23422882 LiveLeaves(false);
23432883 } else
2344
- if (event.getSource() == supportleavesItem)
2884
+ if (source == supportleavesItem)
23452885 {
23462886 SupportLeaves(true);
23472887 } else
2348
- if (event.getSource() == unsupportleavesItem)
2888
+ if (source == unsupportleavesItem)
23492889 {
23502890 SupportLeaves(false);
23512891 } else
2352
- if (event.getSource() == hideleavesItem)
2892
+ if (source == hideleavesItem)
23532893 {
23542894 HideLeaves(true);
23552895 } else
2356
- if (event.getSource() == showleavesItem)
2896
+ if (source == showleavesItem)
23572897 {
23582898 HideLeaves(false);
23592899 } else
2360
- if (event.getSource() == markleavesItem)
2900
+ if (source == markleavesItem)
23612901 {
23622902 MarkLeaves(true);
23632903 } else
2364
- if (event.getSource() == unmarkleavesItem)
2904
+ if (source == unmarkleavesItem)
23652905 {
23662906 MarkLeaves(false);
23672907 } else
2368
- if (event.getSource() == flipVItem)
2908
+ if (source == rewindleavesItem)
2909
+ {
2910
+ RewindLeaves(true);
2911
+ } else
2912
+ if (source == unrewindleavesItem)
2913
+ {
2914
+ RewindLeaves(false);
2915
+ } else
2916
+ if (source == randomleavesItem)
2917
+ {
2918
+ RandomLeaves(true);
2919
+ } else
2920
+ if (source == unrandomleavesItem)
2921
+ {
2922
+ RandomLeaves(false);
2923
+ } else
2924
+ if (source == flipVItem)
23692925 {
23702926 FlipV(true);
23712927 } else
2372
- if (event.getSource() == unflipVItem)
2928
+ if (source == unflipVItem)
23732929 {
23742930 FlipV(false);
23752931 } else
2376
- if (event.getSource() == lowTexturesItem)
2932
+ if (source == lowTexturesItem)
23772933 {
23782934 SetTexRes(0);
23792935 } else
2380
- if (event.getSource() == normalTexturesItem)
2936
+ if (source == normalTexturesItem)
23812937 {
23822938 SetTexRes(1);
23832939 } else
2384
- if (event.getSource() == highTexturesItem)
2940
+ if (source == highTexturesItem)
23852941 {
23862942 SetTexRes(2);
23872943 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2944
+ if (source == veryhighTexturesItem)
23892945 {
23902946 SetTexRes(3);
23912947 } else
2392
- if (event.getSource() == maxTexturesItem)
2948
+ if (source == maxTexturesItem)
23932949 {
23942950 SetTexRes(4);
23952951 } else
2396
- if (event.getSource() == panoTexturesItem)
2952
+ if (source == panoTexturesItem)
23972953 {
23982954 SetTexRes(5);
23992955 } else
2400
- if (event.getSource() == reverseNormalsItem)
2956
+ if (source == reverseNormalsItem)
24012957 {
24022958 ReverseNormals();
24032959 } else
2404
- if (event.getSource() == parseverticesItem)
2960
+ if (source == parseverticesItem)
24052961 {
24062962 ParseVertices();
24072963 } else
2408
- if (event.getSource() == textureFieldItem)
2964
+ if (source == textureFieldItem)
24092965 {
24102966 TextureVertices();
24112967 } else
2412
- if (event.getSource() == alignItem)
2968
+ if (source == alignItem)
24132969 {
24142970 Align();
24152971 } else
2416
- if (event.getSource() == mirrorItem)
2972
+ if (source == mirrorItem)
24172973 {
24182974 MirrorPoses();
24192975 } else
2420
- if (event.getSource() == reduceMorphItem)
2976
+ if (source == reduceMorphItem)
24212977 {
24222978 MeshReduction(false);
24232979 } else
2424
- if (event.getSource() == reduce34MorphItem)
2980
+ if (source == reduce34MorphItem)
24252981 {
24262982 MeshReduction(true);
24272983 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2984
+ if (source == reverseTrianglesItem)
24292985 {
24302986 ReverseTriangles();
24312987 } else
2432
- if (event.getSource() == reduceMeshItem)
2988
+ if (source == reduceMeshItem)
24332989 {
24342990 ReduceMesh(false);
24352991 } else
2436
- if (event.getSource() == reduce34MeshItem)
2992
+ if (source == reduce34MeshItem)
24372993 {
24382994 ReduceMesh(true);
24392995 } else
2440
- if (event.getSource() == increaseMeshItem)
2996
+ if (source == increaseMeshItem)
24412997 {
24422998 IncreaseMesh();
24432999 } else
2444
- if (event.getSource() == clipMeshItem)
3000
+ if (source == clipMeshItem)
24453001 {
24463002 ClipMesh();
24473003 } else
2448
- if (event.getSource() == smoothMeshItem)
3004
+ if (source == smoothMeshItem)
24493005 {
24503006 SmoothMesh();
24513007 } else
2452
- if (event.getSource() == transformgeometryItem)
3008
+ if (source == transformGeometryItem)
24533009 {
24543010 TransformGeometry();
24553011 } else
2456
- if (event.getSource() == resetTransformItem)
3012
+ if (source == transformChildrenItem)
3013
+ {
3014
+ TransformChildren();
3015
+ } else
3016
+ if (source == resetTransformItem)
24573017 {
24583018 ResetTransform();
24593019 } else
2460
- if (event.getSource() == resetCentroidItem)
3020
+ if (source == resetCentroidItem)
24613021 {
2462
- ResetCentroid();
3022
+ ResetCentroid(true);
24633023 } else
2464
- if (event.getSource() == resetParentItem)
3024
+ if (source == resetCentroidXZItem)
3025
+ {
3026
+ ResetCentroid(false);
3027
+ } else
3028
+ if (source == resetParentItem)
24653029 {
24663030 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673031 {
....@@ -2471,7 +3035,7 @@
24713035
24723036 refreshContents();
24733037 } else
2474
- if (event.getSource() == repairParentItem)
3038
+ if (source == repairParentItem)
24753039 {
24763040 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773041 {
....@@ -2485,7 +3049,21 @@
24853049
24863050 refreshContents();
24873051 } else
2488
- if (event.getSource() == sortbysizeItem)
3052
+ if (source == repairShadowItem)
3053
+ {
3054
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3055
+ {
3056
+ Object3D obj = (Object3D)e.nextElement();
3057
+ obj.RepairShadow();
3058
+// for (int i=0; i<obj.size(); i++)
3059
+// {
3060
+// obj.get(i).parent = obj;
3061
+// }
3062
+ }
3063
+
3064
+ refreshContents();
3065
+ } else
3066
+ if (source == sortbysizeItem)
24893067 {
24903068 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913069 {
....@@ -2497,7 +3075,7 @@
24973075 ResetModel();
24983076 refreshContents();
24993077 } else
2500
- if (event.getSource() == sortbynameItem)
3078
+ if (source == sortbynameItem)
25013079 {
25023080 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033081 {
....@@ -2509,7 +3087,7 @@
25093087 ResetModel();
25103088 refreshContents();
25113089 } else
2512
- if (event.getSource() == attachPigmentItem)
3090
+ if (source == attachPigmentItem)
25133091 {
25143092 String texture = GetFile("Attach pigment");
25153093 Object3D obj;
....@@ -2521,7 +3099,7 @@
25213099
25223100 refreshContents();
25233101 } else
2524
- if (event.getSource() == detachPigmentItem)
3102
+ if (source == detachPigmentItem)
25253103 {
25263104 Object3D obj;
25273105 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3110,7 @@
25323110
25333111 refreshContents();
25343112 } else
2535
- if (event.getSource() == attachBumpItem)
3113
+ if (source == attachBumpItem)
25363114 {
25373115 String texture = GetFile("Attach bump");
25383116 Object3D obj;
....@@ -2544,7 +3122,7 @@
25443122
25453123 refreshContents();
25463124 } else
2547
- if (event.getSource() == detachBumpItem)
3125
+ if (source == detachBumpItem)
25483126 {
25493127 Object3D obj;
25503128 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +3133,7 @@
25553133
25563134 refreshContents();
25573135 } else
2558
- if (event.getSource() == pigmentBumpItem)
3136
+ if (source == pigmentBumpItem)
25593137 {
25603138 Object3D obj;
25613139 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3144,237 @@
25663144
25673145 refreshContents();
25683146 } else
2569
- if (event.getSource() == flashSelectionButton)
3147
+ if (source == flashSelectionButton)
25703148 {
25713149 CameraPane.flash = true;
25723150 refreshContents();
25733151 } else
2574
- if (event.getSource() == oneButton)
3152
+ if (source == oneButton)
25753153 {
25763154 } else
2577
- if (event.getSource() == twoButton)
3155
+ if (source == twoButton)
25783156 {
25793157 radio.layout = twoButton;
3158
+
3159
+ if (CameraPane.FULLSCREEN)
3160
+ fullscreenLayout = radio.layout;
3161
+
25803162 // bug
25813163 //gridPanel.setDividerLocation(1.0);
25823164 //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();
3165
+// bigThree.remove(scenePanel);
3166
+// bigThree.remove(centralPanel);
3167
+// bigThree.remove(XYZPanel);
3168
+// aWindowConstraints.gridx = 0;
3169
+// aWindowConstraints.gridy = 0;
3170
+// aWindowConstraints.gridwidth = 1;
3171
+// // aConstraints.gridheight = 3;
3172
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3173
+// aWindowConstraints.weightx = 0;
3174
+// aWindowConstraints.weighty = 1;
3175
+// //bigThree.add(jtp, aWindowConstraints);
3176
+// aWindowConstraints.weightx = 1;
3177
+// aWindowConstraints.gridwidth = 3;
3178
+// // aConstraints.gridheight = 3;
3179
+// aWindowConstraints.gridx = 1;
3180
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3181
+// bigThree.add(centralPanel, aWindowConstraints);
3182
+// aWindowConstraints.weightx = 0;
3183
+// aWindowConstraints.gridx = 4;
3184
+// aWindowConstraints.gridwidth = 1;
3185
+// // aConstraints.gridheight = 3;
3186
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3187
+// //bigThree.add(XYZPanel, aWindowConstraints);
3188
+// scenePanel.setVisible(false);
3189
+// centralPanel.setVisible(true);
3190
+// XYZPanel.setVisible(false);
3191
+ bigThree.ClearUI();
3192
+ bigThree.add(centralPanel);
3193
+ bigThree.FlushUI();
3194
+
3195
+ cameraView.requestFocusInWindow();
3196
+
3197
+// refreshContents(true);
3198
+//
3199
+// try
3200
+// {
3201
+// java.awt.Robot bot = new java.awt.Robot();
3202
+// int mask = InputEvent.BUTTON1_MASK;
3203
+// bot.mouseMove(100, 100);
3204
+// bot.mousePress(mask);
3205
+// bot.mouseRelease(mask);
3206
+// }
3207
+// catch (Exception e)
3208
+// {
3209
+//
3210
+// }
3211
+
26073212 } else
2608
- if (event.getSource() == threeButton)
3213
+ if (source == threeButton)
26093214 {
26103215 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();
3216
+
3217
+ if (CameraPane.FULLSCREEN)
3218
+ fullscreenLayout = radio.layout;
3219
+
3220
+// bigThree.remove(scenePanel);
3221
+// bigThree.remove(centralPanel);
3222
+// bigThree.remove(XYZPanel);
3223
+// aWindowConstraints.gridx = 0;
3224
+// aWindowConstraints.gridy = 0;
3225
+// aWindowConstraints.gridwidth = 1;
3226
+// // aConstraints.gridheight = 3;
3227
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3228
+// aWindowConstraints.weightx = 0;
3229
+// aWindowConstraints.weighty = 1;
3230
+// //bigThree.add(jtp, aWindowConstraints);
3231
+// aWindowConstraints.weightx = 1;
3232
+// aWindowConstraints.gridwidth = 3;
3233
+// // aConstraints.gridheight = 3;
3234
+// aWindowConstraints.gridx = 1;
3235
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3236
+// bigThree.add(centralPanel, aWindowConstraints);
3237
+// aWindowConstraints.weightx = 0;
3238
+// aWindowConstraints.gridx = 4;
3239
+// aWindowConstraints.gridwidth = 1;
3240
+// // aConstraints.gridheight = 3;
3241
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3242
+// bigThree.add(XYZPanel, aWindowConstraints);
3243
+// bigThree.validate();
3244
+// scenePanel.setVisible(false);
3245
+// centralPanel.setVisible(true);
3246
+// XYZPanel.setVisible(true);
3247
+ bigThree.ClearUI();
3248
+ bigThree.add(centralPanel);
3249
+ bigThree.add(XYZPanel);
3250
+ bigThree.FlushUI();
3251
+
3252
+ cameraView.requestFocusInWindow();
26353253 } else
2636
- if (event.getSource() == fourButton)
3254
+ if (source == fourButton)
26373255 {
26383256 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();
3257
+
3258
+ if (CameraPane.FULLSCREEN)
3259
+ fullscreenLayout = radio.layout;
3260
+
3261
+// bigThree.remove(scenePanel);
3262
+// bigThree.remove(centralPanel);
3263
+// bigThree.remove(XYZPanel);
3264
+// aWindowConstraints.gridx = 0;
3265
+// aWindowConstraints.gridy = 0;
3266
+// aWindowConstraints.gridwidth = 1;
3267
+// // aWindowConstraints.gridheight = 3;
3268
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3269
+// aWindowConstraints.weightx = 1;
3270
+// aWindowConstraints.weighty = 1;
3271
+// bigThree.add(scenePanel, aWindowConstraints);
3272
+// aWindowConstraints.weightx = 1;
3273
+// aWindowConstraints.gridwidth = 3;
3274
+// // aConstraints.gridheight = 3;
3275
+// aWindowConstraints.gridx = 1;
3276
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3277
+// //bigThree.add(cameraPanel, aWindowConstraints);
3278
+// aWindowConstraints.weightx = 0;
3279
+// aWindowConstraints.gridx = 4;
3280
+// aWindowConstraints.gridwidth = 1;
3281
+// // aWindowConstraints.gridheight = 3;
3282
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3283
+// //bigThree.add(XYZPanel, aWindowConstraints);
3284
+// bigThree.validate();
3285
+// scenePanel.setVisible(true);
3286
+// centralPanel.setVisible(false);
3287
+// XYZPanel.setVisible(false);
3288
+ bigThree.ClearUI();
3289
+ bigThree.add(scenePanel);
3290
+ bigThree.FlushUI();
3291
+
3292
+ cameraView.requestFocusInWindow();
26633293 } else
2664
- if (event.getSource() == sixButton)
3294
+ if (source == sixButton)
26653295 {
26663296 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();
3297
+
3298
+ if (CameraPane.FULLSCREEN)
3299
+ fullscreenLayout = radio.layout;
3300
+
3301
+// bigThree.remove(scenePanel);
3302
+// bigThree.remove(centralPanel);
3303
+// bigThree.remove(XYZPanel);
3304
+// aWindowConstraints.gridx = 0;
3305
+// aWindowConstraints.gridy = 0;
3306
+// aWindowConstraints.gridwidth = 1;
3307
+// // aConstraints.gridheight = 3;
3308
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3309
+// aWindowConstraints.weightx = 0;
3310
+// aWindowConstraints.weighty = 1;
3311
+// bigThree.add(scenePanel, aWindowConstraints);
3312
+// aWindowConstraints.weightx = 1;
3313
+// aWindowConstraints.gridwidth = 3;
3314
+// // aWindowConstraints.gridheight = 3;
3315
+// aWindowConstraints.gridx = 1;
3316
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3317
+// bigThree.add(centralPanel, aWindowConstraints);
3318
+// aWindowConstraints.weightx = 0;
3319
+// aWindowConstraints.gridx = 4;
3320
+// aWindowConstraints.gridwidth = 1;
3321
+// // aWindowConstraints.gridheight = 3;
3322
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3323
+// //bigThree.add(XYZPanel, aConstraints);
3324
+// bigThree.validate();
3325
+// scenePanel.setVisible(true);
3326
+// centralPanel.setVisible(true);
3327
+// XYZPanel.setVisible(false);
3328
+ bigThree.ClearUI();
3329
+ bigThree.add(scenePanel);
3330
+ bigThree.add(centralPanel);
3331
+ bigThree.FlushUI();
3332
+
3333
+ cameraView.requestFocusInWindow();
26913334 } else
2692
- if (event.getSource() == sevenButton)
3335
+ if (source == sevenButton)
26933336 {
26943337 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();
3338
+
3339
+ if (CameraPane.FULLSCREEN)
3340
+ fullscreenLayout = radio.layout;
3341
+
3342
+// bigThree.remove(scenePanel);
3343
+// bigThree.remove(centralPanel);
3344
+// bigThree.remove(XYZPanel);
3345
+// aWindowConstraints.gridx = 0;
3346
+// aWindowConstraints.gridy = 0;
3347
+// aWindowConstraints.gridwidth = 1;
3348
+// // aWindowConstraints.gridheight = 3;
3349
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3350
+// aWindowConstraints.weightx = 0;
3351
+// aWindowConstraints.weighty = 1;
3352
+// bigThree.add(scenePanel, aWindowConstraints);
3353
+// aWindowConstraints.weightx = 1;
3354
+// aWindowConstraints.gridwidth = 3;
3355
+// // aWindowConstraints.gridheight = 3;
3356
+// aWindowConstraints.gridx = 1;
3357
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3358
+// bigThree.add(centralPanel, aWindowConstraints);
3359
+// aWindowConstraints.weightx = 0;
3360
+// aWindowConstraints.gridx = 4;
3361
+// aWindowConstraints.gridwidth = 1;
3362
+// // aConstraints.gridheight = 3;
3363
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3364
+// bigThree.add(XYZPanel, aWindowConstraints);
3365
+// bigThree.validate();
3366
+// scenePanel.setVisible(true);
3367
+// centralPanel.setVisible(true);
3368
+// XYZPanel.setVisible(true);
3369
+ bigThree.ClearUI();
3370
+ bigThree.add(scenePanel);
3371
+ bigThree.add(centralPanel);
3372
+ bigThree.add(XYZPanel);
3373
+ bigThree.FlushUI();
3374
+
3375
+ cameraView.requestFocusInWindow();
27193376 } else
2720
- if (event.getSource() == rootButton)
3377
+ if (source == rootButton)
27213378 {
27223379 Object3D obj;
27233380 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3384,84 @@
27273384 EditObject(obj);
27283385 }
27293386
3387
+ cameraView.requestFocusInWindow();
27303388 refreshContents(true);
27313389 } else
2732
- if (event.getSource() == closeButton)
3390
+ if (source == closeButton)
27333391 {
27343392 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353393 cRadio ab;
27363394 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373395 {
27383396 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3397
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403398 {
3399
+ // Patch to avoid bug with transparency.
3400
+ if (!ab.hadMaterial)
3401
+ {
3402
+ ab.object.material = null;
3403
+ }
3404
+
27413405 buttonGroup.remove(ab);
27423406 radioPanel.remove(ab);
27433407
2744
- ab.GetObject().editWindow = null;
3408
+ //ab.GetObject().editWindow = null;
3409
+ ab.GetObject().manipWindow = null;
27453410 // ab.GetObject().objectUI = null; // ?????????
27463411
27473412 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483413 break;
27493414 }
27503415 }
3416
+
3417
+ cameraView.requestFocusInWindow();
27513418 refreshContents(true);
27523419 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3420
+ if (source == editItem || source == editButton)
27543421 {
3422
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3423
+ {
3424
+ Object3D child = (Object3D)e.nextElement();
3425
+ child.pinned = true;
3426
+ }
3427
+
27553428 EditSelection(false);
27563429 } else
2757
- if (event.getSource() == uneditButton)
3430
+ if (source == uneditButton)
27583431 {
27593432 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603433 {
27613434 Object3D child = (Object3D)e.nextElement();
27623435 if(child.editWindow != null)
27633436 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3437
+ child.pinned = false;
27643438 child.CloseUI();
27653439 listUI.remove(child);
27663440
2767
- child.editWindow = null; // ???????????
3441
+ //child.editWindow = null; // ???????????
27683442 }
2769
- objEditor.ctrlPanel.revalidate();
3443
+ objEditor.ctrlPanel.FlushUI();
27703444 //objEditor.jTree.clearSelection();
27713445 //objEditor.ResetSliders();
27723446 refreshContents(true);
27733447 } else
2774
- if (event.getSource() == clearPanelButton)
3448
+ if (source == clearPanelButton)
27753449 {
27763450 assert(copy == group);
27773451 //copy.ClearUI();
27783452 for (Object3D obj : listUI)
27793453 {
3454
+ obj.pinned = false;
27803455 obj.CloseUI();
27813456 }
27823457 listUI.clear();
27833458 refreshContents(true);
27843459 } else
2785
- if (event.getSource() == allParamsButton)
3460
+ if (source == allParamsButton)
27863461 {
27873462 assert(copy == group);
27883463
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3464
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903465
27913466 for (Object3D obj : listUI)
27923467 {
....@@ -2803,19 +3478,19 @@
28033478
28043479 refreshContents(true);
28053480 } else
2806
- if (event.getSource() == unselectButton)
3481
+ if (source == unselectButton)
28073482 {
28083483 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3484
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103485 objEditor.ResetSliders();
28113486 refreshContents(true);
28123487 } else
2813
- if(event.getSource() instanceof cRadio)
3488
+ if(source instanceof cRadio)
28143489 {
28153490 group.parent = keepparent;
28163491 group.attributes = 0;
28173492 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3493
+ /*cRadio*/ radio = (cRadio)source;
28193494 Object3D obj = radio.GetObject();
28203495 System.out.println("Edit " + obj);
28213496 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3510,10 @@
28353510 }
28363511
28373512 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3513
+
3514
+ SetUndoStates();
3515
+
3516
+ //Globals.theRenderer.object = group;
28393517 if(!useclient)
28403518 {
28413519 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3522,50 @@
28443522 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453523 cameraView.targetLookAt.set(radio.camera.lookAt);
28463524 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3525
+ //cameraView.lighttouched = true;
3526
+ Globals.lighttouched = true;
28483527 topView.object = group;
28493528 frontView.object = group;
28503529 sideView.object = group;
28513530 }
2852
- group.editWindow = this;
3531
+
3532
+// fix "+" issue
3533
+ //group.editWindow = this;
3534
+ group.manipWindow = this;
3535
+
28533536 /*
28543537 currentLayout = radio.layout;
28553538 if (currentLayout == null)
28563539 currentLayout = sevenButton;
28573540 */
28583541 radio.layout.doClick();
3542
+
3543
+ ClearUnpinned();
3544
+ SetPinStates(group.selection.size() > 0);
3545
+ if (group.selection.size() == 1)
3546
+ EditSelection(false);
28593547 keepparent = group.parent;
28603548 // PARENT = NULL or not???
28613549 //group.parent = null; // ROOT
28623550 //group.attributes = -1;
28633551 ResetModel();
3552
+
3553
+ cameraView.requestFocusInWindow();
28643554 refreshContents(true);
2865
- }
3555
+ } else if (event.getSource() == editCameraItem)
3556
+ {
3557
+ cameraView.ProtectCamera();
3558
+ cameraView.repaint();
3559
+ return;
3560
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3561
+ {
3562
+ cameraView.RevertCamera();
3563
+ cameraView.repaint();
3564
+ return;
3565
+ // } else if (event.getSource() == textureButton)
3566
+ // {
3567
+ // return; // true;
3568
+ }
28663569 else
28673570 {
28683571 //return super.action(event, arg);
....@@ -2871,7 +3574,6 @@
28713574 }
28723575
28733576 boolean useclient = false;
2874
- cRadio radio;
28753577
28763578 void ToggleRoot()
28773579 {
....@@ -2880,7 +3582,7 @@
28803582 if (useclient)
28813583 {
28823584 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3585
+ Globals.lighttouched = true;
28843586 //topView.object = client;
28853587 //frontView.object = client;
28863588 //sideView.object = client;
....@@ -2888,7 +3590,7 @@
28883590 else
28893591 {
28903592 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3593
+ Globals.lighttouched = true;
28923594 //topView.object = group;
28933595 //frontView.object = group;
28943596 //sideView.object = group;
....@@ -2923,6 +3625,28 @@
29233625 refreshContents();
29243626 }
29253627
3628
+ void TransformChildren()
3629
+ {
3630
+ Object3D obj;
3631
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3632
+ {
3633
+ obj = (Object3D)e.nextElement();
3634
+ obj.KeepTextureMatrices();
3635
+ obj.TransformChildren();
3636
+ obj.RestoreTextureMatrices();
3637
+
3638
+// if (obj.parent == null)
3639
+// {
3640
+// System.out.println("NULL PARENT!");
3641
+// new Exception().printStackTrace();
3642
+// }
3643
+// else
3644
+// TouchTransform(obj);
3645
+// //obj.parent.Touch();
3646
+ }
3647
+
3648
+ refreshContents();
3649
+ }
29263650
29273651 void ResetTransform()
29283652 {
....@@ -3035,7 +3759,7 @@
30353759 refreshContents();
30363760 }
30373761
3038
- void ResetCentroid()
3762
+ void ResetCentroid(boolean full)
30393763 {
30403764 Object3D obj;
30413765 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3774,16 @@
30503774 LA.matIdentity(Object3D.mat);
30513775 obj.getBounds(minima, maxima, false);
30523776 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3777
+ if (full)
3778
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543779 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553780 obj.TransformMesh(Object3D.mat);
3781
+
30563782 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3783
+ if (full)
3784
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583785 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3786
+
30593787 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603788 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613789 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3812,8 @@
30843812
30853813 int size = obj.MemorySize();
30863814
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3815
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3816
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883817 }
30893818 }
30903819 catch (Exception e)
....@@ -3121,9 +3850,9 @@
31213850 obj = (Object3D)e.nextElement();
31223851
31233852 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3853
+ Grafreed.AnalyzeObject(obj);
31253854 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3855
+ Grafreed.AnalyzeObject(obj.bRep);
31273856
31283857 // System.err.println((size/1024) + " KB is the size of " + obj);
31293858 }
....@@ -3165,6 +3894,20 @@
31653894 void GenNormals(boolean crease)
31663895 {
31673896 group.GenNormalsS(crease);
3897
+
3898
+ refreshContents();
3899
+ }
3900
+
3901
+ void GenNormalsMESH()
3902
+ {
3903
+ group.GenNormalsMeshS();
3904
+
3905
+ refreshContents();
3906
+ }
3907
+
3908
+ void GenNormalsMINE()
3909
+ {
3910
+ group.selection.GenNormalsMINE();
31683911
31693912 refreshContents();
31703913 }
....@@ -3250,7 +3993,7 @@
32503993 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513994 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523995 //
3253
-// g.add(GraphreeD.clipboard);
3996
+// g.add(GrafreeD.clipboard);
32543997 //
32553998 // buffer.add(g);
32563999 // }
....@@ -3269,8 +4012,8 @@
32694012 // nodes = new Object3D();
32704013 // vertices = new Vector<Vertex>();
32714014 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
4015
+// boolean epsequal = GrafreeD.epsequal;
4016
+// GrafreeD.epsequal = true;
32744017 //
32754018 // for (int i=0; i<group.selection.size(); i++)
32764019 // {
....@@ -3311,7 +4054,7 @@
33114054 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124055 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134056 //
3314
-// g.add(GraphreeD.clipboard);
4057
+// g.add(GrafreeD.clipboard);
33154058 //
33164059 // buffer.add(g);
33174060 // }
....@@ -3319,7 +4062,7 @@
33194062 // makeSomething(buffer, i==group.selection.size()-1);
33204063 // }
33214064 //
3322
-// GraphreeD.epsequal = epsequal;
4065
+// GrafreeD.epsequal = epsequal;
33234066 //
33244067 // //buffer = null;
33254068 // temprep = null;
....@@ -3330,8 +4073,8 @@
33304073
33314074 void ParseVertices()
33324075 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4076
+ boolean epsequal = Grafreed.epsequal;
4077
+ Grafreed.epsequal = true;
33354078
33364079 for (int i=0; i<group.selection.size(); i++)
33374080 {
....@@ -3356,7 +4099,7 @@
33564099 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574100 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584101
3359
- g.add(GraphreeD.clipboard);
4102
+ g.add(Grafreed.clipboard);
33604103
33614104 buffer.add(g);
33624105 }
....@@ -3371,7 +4114,7 @@
33714114 makeSomething(buffer, i==group.selection.size()-1);
33724115 }
33734116
3374
- GraphreeD.epsequal = epsequal;
4117
+ Grafreed.epsequal = epsequal;
33754118
33764119 refreshContents();
33774120 }
....@@ -3389,7 +4132,16 @@
33894132 String pigment = Object3D.GetPigment(tex);
33904133 //String bump = Object3D.GetBump(tex);
33914134
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4135
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4136
+
4137
+ try
4138
+ {
4139
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4140
+ }
4141
+ catch (Exception e)
4142
+ {
4143
+ System.err.println("FAIL: " + node);
4144
+ }
33934145
33944146 double s = v.s;
33954147
....@@ -3416,7 +4168,7 @@
34164168 scale /= 3;
34174169
34184170 scale /= 0xFF;
3419
- scale /= 4;
4171
+ // c'est quoi ca? scale /= 4;
34204172
34214173 //v.AO = scale;
34224174
....@@ -3437,12 +4189,26 @@
34374189
34384190 void Align()
34394191 {
4192
+ if (group.selection.size() == 0)
4193
+ return;
4194
+
4195
+ cVector bbmin = new cVector();
4196
+ cVector bbmax = new cVector();
4197
+
4198
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4199
+
4200
+ double dx = bbmax.x - bbmin.x;
4201
+ double dy = bbmax.y - bbmin.y;
4202
+ double dz = bbmax.z - bbmin.z;
4203
+
4204
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4205
+
34404206 for (int i=0; i<group.selection.size(); i++)
34414207 {
34424208 Object3D obj = group.selection.get(i);
34434209
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4210
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4211
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464212 }
34474213
34484214 refreshContents();
....@@ -3455,7 +4221,7 @@
34554221 // ref.SaveSupports();
34564222 // Object3D par = ref.parent;
34574223 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4224
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594225 // ref.parent = par;
34604226 // ref.RestoreSupports();
34614227
....@@ -3463,11 +4229,11 @@
34634229
34644230 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654231
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4232
+ boolean random = CameraPane.SWITCH;
4233
+ CameraPane.SWITCH = false; // parse all random nodes
34684234 lowres.linkVerticesThis(null);
34694235 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4236
+ CameraPane.SWITCH = random;
34714237
34724238 System.err.flush();
34734239
....@@ -3485,7 +4251,7 @@
34854251 // lowres.SaveSupports();
34864252 // par = lowres.parent;
34874253 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4254
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894255 Object3D newlow = CloneObject(lowres, false);
34904256 newlow.name = sn.switchobject.get(i).name;
34914257 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4273,7 @@
35074273 return;
35084274
35094275 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4276
+ Object3D ref = Grafreed.clipboard.get(0);
35114277
35124278 Object3D newgroup = new Object3D("Po:" + poses.name);
35134279
....@@ -3676,7 +4442,7 @@
36764442 group.selection.RelinkToSupport(); // july 2014
36774443 System.out.println("DONE.");
36784444 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4445
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804446 }
36814447
36824448 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4467,20 @@
37014467
37024468 void ClipMesh()
37034469 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4470
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054471 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4472
+ Object3D content = Grafreed.clipboard.get(0);
37074473
37084474 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094475 content = ((cGroup)content).get(0);
37104476
37114477 // for (int i=0; i<group.selection.size(); i++)
37124478 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4479
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144480 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4481
+ group.selection.ClipMesh(Grafreed.clipboard);
37164482 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4483
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184484 System.out.println("DONE.");
37194485 refreshContents();
37204486 }
....@@ -3759,6 +4525,18 @@
37594525 void MarkLeaves(boolean hide)
37604526 {
37614527 group.selection.MarkLeaves(hide);
4528
+ refreshContents();
4529
+ }
4530
+
4531
+ void RewindLeaves(boolean hide)
4532
+ {
4533
+ group.selection.RewindLeaves(hide);
4534
+ refreshContents();
4535
+ }
4536
+
4537
+ void RandomLeaves(boolean hide)
4538
+ {
4539
+ group.selection.RandomLeaves(hide);
37624540 refreshContents();
37634541 }
37644542
....@@ -3833,10 +4611,6 @@
38334611 // }
38344612 // }
38354613
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38404614 void EditSelection(boolean newWindow)
38414615 {
38424616 // aConstraints.gridy = 0;
....@@ -3844,10 +4618,10 @@
38444618 {
38454619 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464620 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4621
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484622
38494623 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4624
+ if(elem != group || !newWindow)
38514625 {
38524626 // if (!(elem instanceof Composite))
38534627 // newWindow = false;
....@@ -3929,7 +4703,8 @@
39294703 //new Exception().printStackTrace();
39304704
39314705 freezemodel = true;
3932
-
4706
+ ClearUnpinned();
4707
+
39334708 /**/
39344709 //switch (event.id)
39354710 {
....@@ -3937,7 +4712,6 @@
39374712 //case 702: // Event.LIST_DESELECT
39384713 group.deselectAll();
39394714 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414715 if (tps != null)
39424716 {
39434717 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +4720,39 @@
39464720
39474721 //if (child.parent != null)
39484722 //child.parent.addSelectee(child);
4723
+ objEditor.SetMaterial(child);
39494724 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534725 }
39544726 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4727
+// else
4728
+// {
4729
+// objEditor.SetMaterial(group); // .GetMaterial());
4730
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4731
+// System.err.println("info : " + group.GetPath());
4732
+// }
39614733
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4734
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654735 CameraPane.flash = true;
39664736
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4737
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684738 // a camera
39694739 {
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;
4740
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4741
+ {
4742
+ CameraPane.camerachangeframe = 0; // don't refuse it
4743
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4744
+ }
4745
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4746
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744747 }
39754748
4749
+ if (tps != null && tps.length == 1)
4750
+ {
4751
+ EditSelection(false);
4752
+ }
4753
+
4754
+ SetPinStates(tps != null && tps.length > 0);
4755
+
39764756 refreshContents();
39774757 //return true;
39784758 }
....@@ -3981,6 +4761,35 @@
39814761
39824762 freezemodel = false;
39834763 }
4764
+
4765
+ void SetPinStates(boolean enabled)
4766
+ {
4767
+ editButton.setEnabled(enabled);
4768
+ uneditButton.setEnabled(enabled);
4769
+ unselectButton.setEnabled(enabled);
4770
+ flashSelectionButton.setEnabled(enabled);
4771
+ }
4772
+
4773
+ void refreshContents(boolean cp)
4774
+ {
4775
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4776
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4777
+ {
4778
+ objEditor.ClearInfo(); // .GetMaterial());
4779
+
4780
+ for (int i=0; i < group.selection.Size(); i++)
4781
+ {
4782
+ Object3D child = (Object3D) group.selection.get(i);
4783
+
4784
+ objEditor.AddInfo(child, this, true);
4785
+ System.err.println("info : " + child.GetPath());
4786
+ }
4787
+
4788
+ objEditor.SetText(); // jan 2014
4789
+ }
4790
+
4791
+ super.refreshContents(cp);
4792
+ }
39844793
39854794 void linkSomething(Object3D thing)
39864795 {
....@@ -4052,16 +4861,19 @@
40524861 {
40534862 if (group.selection.isEmpty())
40544863 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4864
+
4865
+ Grafreed.clipboardIsTempGroup = false;
40564866 Composite tGroup = null;
40574867 if (group.selection.size() > 0) // 1)
40584868 {
40594869 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4870
+ Grafreed.clipboardIsTempGroup = true;
40614871 }
40624872
40634873 if (cut)
40644874 {
4875
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4876
+// Save();
40654877 //int indices[] = jList.getSelectedIndices();
40664878 //for (int i = indices.length - 1; i >= 0; i--)
40674879 //jList.remove(indices[i]);
....@@ -4097,16 +4909,16 @@
40974909 //System.out.println("cut " + child);
40984910 //System.out.println("parent = " + child.parent);
40994911 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4912
+ if (Grafreed.clipboardIsTempGroup)
41014913 tGroup.add/*Child*/(tmp);
41024914 else
4103
- GraphreeD.clipboard = tmp;
4915
+ Grafreed.clipboard = tmp;
41044916 }
41054917 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4918
+ if (Grafreed.clipboardIsTempGroup)
41074919 tGroup.add/*Child*/(child);
41084920 else
4109
- GraphreeD.clipboard = child;
4921
+ Grafreed.clipboard = child;
41104922 }
41114923
41124924 //ResetModel();
....@@ -4138,21 +4950,23 @@
41384950 //System.out.println("cut " + elem);
41394951 //System.out.println("parent = " + elem.parent);
41404952 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
41424954 tGroup.add/*Child*/(tmp);
41434955 else
4144
- GraphreeD.clipboard = tmp;
4956
+ Grafreed.clipboard = tmp;
41454957 }
41464958 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4959
+ if (Grafreed.clipboardIsTempGroup)
41484960 tGroup.add/*Child*/(child);
41494961 else
4150
- GraphreeD.clipboard = child;
4962
+ Grafreed.clipboard = child;
41514963 }
41524964
41534965 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4966
+
4967
+ if (Grafreed.clipboardIsTempGroup)
4968
+ Grafreed.clipboard = tGroup;
4969
+
41564970 if (cut)
41574971 {
41584972 ResetModel();
....@@ -4162,11 +4976,15 @@
41624976
41634977 void paste(boolean expand)
41644978 {
4165
- // if (GraphreeD.clipboard == null)
4979
+ if (Globals.REPLACEONMAKE)
4980
+ Save();
4981
+ boolean keep = Globals.REPLACEONMAKE;
4982
+ Globals.REPLACEONMAKE = false;
4983
+ // if (GrafreeD.clipboard == null)
41664984 // return;
41674985 boolean first = true;
41684986
4169
- if (GraphreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
41704988 {
41714989 Composite temp;
41724990
....@@ -4177,7 +4995,7 @@
41774995 temp = (Composite)Applet3D.clipboard.deepCopy();
41784996 */
41794997 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4998
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814999 {
41825000 Object3D child = (Object3D)e.nextElement();
41835001
....@@ -4191,7 +5009,7 @@
41915009 else
41925010 elem = child.deepCopy(); // ?
41935011 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5012
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41955013 // elem = elem.get(0);
41965014 makeSomething(elem, true); // ?? first);
41975015 //group.addChild(elem);
....@@ -4211,23 +5029,24 @@
42115029 //Object3D cb = Applet3D.clipboard;
42125030 //temp.addChild(cb);
42135031 //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());
5032
+ assert(Grafreed.clipboard.parent == null);
5033
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5034
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5035
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5036
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42195037 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5038
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5039
+ Grafreed.clipboard.get(0).parent = keepparent;
42225040 }
42235041
5042
+ Globals.REPLACEONMAKE = keep;
42245043 ResetModel();
42255044 refreshContents();
42265045 }
42275046
4228
- void pasteInto(boolean copyit)
5047
+ void pasteInto(boolean copyit, boolean clone)
42295048 {
4230
-// if (GraphreeD.clipboard == null)
5049
+// if (GrafreeD.clipboard == null)
42315050 // return;
42325051
42335052 if (group.selection.size() != 1)
....@@ -4254,15 +5073,22 @@
42545073 if (copyit)
42555074 {
42565075 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5076
+ if (clone)
5077
+ {
5078
+ CloneClipboard(false); // sept 2014
5079
+ }
5080
+ else
5081
+ {
5082
+ paste(false);
5083
+ }
42585084 }
42595085 else
42605086 {
42615087 boolean first = true;
42625088
4263
- if (GraphreeD.clipboardIsTempGroup)
5089
+ if (Grafreed.clipboardIsTempGroup)
42645090 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5091
+ Composite temp = (Composite)Grafreed.clipboard;
42665092 Object3D copy;
42675093 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685094 {
....@@ -4272,7 +5098,7 @@
42725098 }
42735099 } else
42745100 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5101
+ linkSomething(Grafreed.clipboard); //.get(0));
42765102 }
42775103 }
42785104 }
....@@ -4349,6 +5175,10 @@
43495175
43505176 void group(Object3D csg, boolean grab)
43515177 {
5178
+ if (Globals.REPLACEONMAKE)
5179
+ Save();
5180
+ boolean keep = Globals.REPLACEONMAKE;
5181
+ Globals.REPLACEONMAKE = false;
43525182 if (//false) // why??
43535183 !group.selection.isEmpty())
43545184 {
....@@ -4462,8 +5292,34 @@
44625292 //node.add(csg);
44635293 //makeSomething(node);
44645294 makeSomething(csg);
5295
+ Globals.REPLACEONMAKE = keep;
44655296 }
44665297
5298
+ void Ungroup(Object3D g)
5299
+ {
5300
+ if (Globals.REPLACEONMAKE)
5301
+ Save();
5302
+ boolean keep = Globals.REPLACEONMAKE;
5303
+ Globals.REPLACEONMAKE = false;
5304
+ if (g instanceof HiddenObject)
5305
+ {
5306
+ HiddenObject h = (HiddenObject) g;
5307
+
5308
+ for (int i=0; i<h.ActualSize(); i++)
5309
+ {
5310
+ objEditor.makeSomething(h.get(i), false);
5311
+ }
5312
+ }
5313
+ else
5314
+ {
5315
+ for (int i=0; i<g.Size(); i++)
5316
+ {
5317
+ objEditor.makeSomething(g.get(i), false);
5318
+ }
5319
+ }
5320
+ Globals.REPLACEONMAKE = keep;
5321
+ }
5322
+
44675323 void ungroup()
44685324 {
44695325 /*
....@@ -4657,21 +5513,6 @@
46575513 }
46585514 */
46595515
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
-
46755516 /*
46765517 public void Callback(Object obj)
46775518 {
....@@ -4695,26 +5536,9 @@
46955536 }
46965537 */
46975538
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
-
47155539 String GetFile(String dialogName)
47165540 {
4717
- if (GraphreeD.standAlone)
5541
+ if (Grafreed.standAlone)
47185542 {
47195543 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205544 browser.show();
....@@ -4778,10 +5602,33 @@
47785602 cButton flashSelectionButton;
47795603 cButton editButton;
47805604 cButton uneditButton;
5605
+ JCheckBox allParamsButton;
47815606 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835607 cButton unselectButton;
47845608
5609
+ cButton restoreCameraButton;
5610
+
5611
+ cButton saveButton;
5612
+ cButton oneStepButton;
5613
+
5614
+ cButton groupButton;
5615
+ cButton ungroupButton;
5616
+ cButton compositeButton;
5617
+ cButton switchButton;
5618
+ cButton loopButton;
5619
+ cButton textureButton;
5620
+
5621
+ cButton gridButton;
5622
+ cButton boxButton;
5623
+ cButton sphereButton;
5624
+ cButton coneButton;
5625
+ cButton torusButton;
5626
+ cButton superButton;
5627
+ cButton kleinButton;
5628
+ cButton particlesButton;
5629
+ cButton overlayButton;
5630
+ cButton lightButton;
5631
+
47855632 cButton screenfitButton;
47865633 cButton screenfitpointButton;
47875634 cButton snapobjectButton;
....@@ -4793,14 +5640,6 @@
47935640
47945641 cButton setsupportButton;
47955642
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
-
48045643 //
48055644 //Composite
48065645 Object3D // to do !!
....@@ -4810,9 +5649,11 @@
48105649 //JTree jTree;
48115650 private MenuItem lookAtItem;
48125651 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
5652
+ private MenuItem switchViewItem;
48145653 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5654
+ private MenuItem undoItem;
5655
+ private MenuItem redoItem;
5656
+ private JMenuItem duplicateItem;
48165657 private MenuItem cloneItem;
48175658 private MenuItem cloneSupportItem;
48185659 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5664,9 @@
48235664 private MenuItem resetsupportItem;
48245665 private MenuItem resetreferencesItem;
48255666 private MenuItem linkverticesItem;
5667
+ private MenuItem relinkverticesItem;
48265668 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5669
+ private MenuItem resetAllItem;
48285670 private MenuItem stepAllItem;
48295671 private MenuItem revertMeshItem;
48305672 private MenuItem poseMeshItem;
....@@ -4835,14 +5677,17 @@
48355677 private MenuItem mergeGeometriesItem;
48365678 private MenuItem copyItem;
48375679 private MenuItem pasteItem;
5680
+ private MenuItem pasteIntoItem;
48385681 private MenuItem pasteLinkItem;
48395682 private MenuItem pasteCloneItem;
48405683 private MenuItem pasteExpandItem;
48415684 private MenuItem clearItem;
48425685 private MenuItem clearAllItem;
48435686 private MenuItem genUVItem;
5687
+ private MenuItem genNormalsMESHItem;
48445688 private MenuItem genNormalsCADItem;
48455689 private MenuItem genNormalsORGANItem;
5690
+ private MenuItem genNormalsMINEItem;
48465691 private MenuItem stripifyItem;
48475692 private MenuItem unstripifyItem;
48485693 private MenuItem trimItem;
....@@ -4871,6 +5716,10 @@
48715716 private MenuItem showleavesItem;
48725717 private MenuItem markleavesItem;
48735718 private MenuItem unmarkleavesItem;
5719
+ private MenuItem rewindleavesItem;
5720
+ private MenuItem unrewindleavesItem;
5721
+ private MenuItem randomleavesItem;
5722
+ private MenuItem unrandomleavesItem;
48745723
48755724 private MenuItem flipVItem;
48765725 private MenuItem unflipVItem;
....@@ -4882,14 +5731,17 @@
48825731 private MenuItem panoTexturesItem;
48835732
48845733 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5734
+ private MenuItem resetCentroidXZItem;
48865735 private MenuItem resetTransformItem;
5736
+ private MenuItem transformGeometryItem;
5737
+ private MenuItem transformChildrenItem;
5738
+ private MenuItem hideItem;
48875739 private MenuItem grabItem;
48885740 private MenuItem backItem;
48895741 private MenuItem frontItem;
48905742 private MenuItem cameraItem;
48915743 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
5744
+ private MenuItem switchItem;
48935745 private MenuItem physicsItem;
48945746 private MenuItem frameselectorItem;
48955747 private MenuItem scriptNodeItem;
....@@ -4904,6 +5756,7 @@
49045756
49055757 private MenuItem resetParentItem;
49065758 private MenuItem repairParentItem;
5759
+ private MenuItem repairShadowItem;
49075760 private MenuItem sortbysizeItem;
49085761 private MenuItem sortbynameItem;
49095762
....@@ -4924,10 +5777,11 @@
49245777 private MenuItem coneItem;
49255778 private MenuItem torusItem;
49265779 private MenuItem superItem;
5780
+ private MenuItem kleinItem;
49275781 private MenuItem blobItem;
49285782 private MenuItem latheItem;
49295783 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5784
+ private MenuItem overlayItem;
49315785 private MenuItem meshItem;
49325786 // private MenuItem meshGroupItem;
49335787 private MenuItem springItem;
....@@ -4936,6 +5790,7 @@
49365790 private MenuItem csgItem;
49375791 private MenuItem templateItem;
49385792 private MenuItem textureItem;
5793
+ private MenuItem billboardItem;
49395794 private MenuItem shadowXItem;
49405795 private MenuItem shadowYItem;
49415796 private MenuItem shadowZItem;
....@@ -4948,11 +5803,6 @@
49485803 private MenuItem doubleItem;
49495804 private MenuItem tripleItem;
49505805
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565806 private MenuItem computeAOItem;
49575807 private MenuItem recompileItem;
49585808 private MenuItem editScriptItem;
....@@ -4962,4 +5812,8 @@
49625812 private MenuItem analyzeItem;
49635813 private MenuItem dumpItem;
49645814 //boolean freezemodel = false;
5815
+
5816
+ Menu cameraMenu;
5817
+ MenuItem editCameraItem;
5818
+ MenuItem restoreCameraItem;
49655819 }