Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
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.SAVEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.SAVEONMAKE;
90
+ Globals.SAVEONMAKE = 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.SAVEONMAKE = 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,40 @@
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
396547 void SetupUI2(ObjEditor oe)
397548 {
549
+ // June 2019
550
+ if (oe == null)
551
+ {
552
+ //super.SetupUI2(this);
553
+ //return;
554
+ }
555
+
556
+ if (copy != group)
557
+ {
558
+ //super.SetupUI2(this);
559
+ }
560
+
398561 //new Exception().printStackTrace();
399562
400563 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +586,217 @@
423586 oe.radioPanel.add(dummyButton);
424587 oe.buttonGroup.add(dummyButton);
425588 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
429592
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
593
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
594
+
595
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ //minButton.setToolTipText("Minimize window");
597
+ //minButton.addActionListener(this);
598
+
599
+ if (Globals.ADVANCED)
600
+ {
601
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ maxButton.setToolTipText("Maximize window");
603
+ maxButton.addActionListener(this);
604
+ }
605
+
606
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
607
+ fullButton.setToolTipText("Full-screen window");
608
+ fullButton.addActionListener(this);
609
+
610
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ screenfitButton.setToolTipText("Screen fit");
612
+ screenfitButton.addActionListener(this);
613
+
614
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ restoreCameraButton.setToolTipText("Restore viewpoint");
616
+ restoreCameraButton.addActionListener(this);
617
+
618
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ undoButton.setToolTipText("Undo changes");
620
+ undoButton.addActionListener(this);
621
+ undoButton.setEnabled(false);
622
+
623
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ redoButton.setToolTipText("Redo changes");
625
+ redoButton.addActionListener(this);
626
+ redoButton.setEnabled(false);
627
+
628
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ saveButton.setToolTipText("Save changes");
630
+ saveButton.addActionListener(this);
631
+
632
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
633
+ liveCB.setToolTipText("Enable animation");
431634 liveCB.addItemListener(this);
432635
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);
636
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ oneStepButton.setToolTipText("Animate one step forward");
638
+ oneStepButton.addActionListener(this);
639
+
640
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
641
+ fastCB.setToolTipText("Fast mode");
451642 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);
643
+
644
+ //oe.toolboxPanel.Return();
645
+
646
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
647
+// trackCB.setToolTipText("Enable tracking");
648
+// trackCB.addItemListener(this);
458649
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;
499650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500651 // 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;
505652
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;
653
+ if (Globals.ADVANCED)
654
+ {
655
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ snapobjectButton.addActionListener(this);
657
+ snapobjectButton.setToolTipText("Snap Object");
658
+ }
659
+
660
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
516661
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
+ twoButton.setToolTipText("Show center view only");
519664 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
665
+ this.fullscreenLayout = twoButton;
666
+
667
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521668 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
669
+ fourButton.setToolTipText("Show left panel only");
670
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ sixButton.setToolTipText("2-column layout left");
523672 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
673
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ threeButton.setToolTipText("2-column layout right");
525675 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
+ sevenButton.setToolTipText("3-column layout");
527678 sevenButton.addActionListener(this);
528679 //
529680
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
681
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ rootButton.setToolTipText("Edit selection in new tab");
531683 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
684
+
685
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ closeButton.setToolTipText("Close tab");
534687 closeButton.addActionListener(this);
535688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536689 //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;
545690
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
691
+ // INSERT
692
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ gridButton.setToolTipText("Create grid");
694
+ gridButton.addActionListener(this);
695
+
696
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
+ boxButton.setToolTipText("Create box");
698
+ boxButton.addActionListener(this);
699
+
700
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+ sphereButton.setToolTipText("Create sphere");
702
+ sphereButton.addActionListener(this);
703
+
704
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ coneButton.setToolTipText("Create cone");
706
+ coneButton.addActionListener(this);
707
+
708
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ torusButton.setToolTipText("Create torus");
710
+ torusButton.addActionListener(this);
711
+
712
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ superButton.setToolTipText("Create superellipsoid");
714
+ superButton.addActionListener(this);
715
+
716
+ if (Globals.ADVANCED)
717
+ {
718
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ kleinButton.setToolTipText("Create Klein bottle");
720
+ kleinButton.addActionListener(this);
721
+ }
722
+
723
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ particlesButton.setToolTipText("Create particle system");
725
+ particlesButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.Return();
728
+
729
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ groupButton.setToolTipText("Create group");
731
+ groupButton.addActionListener(this);
732
+
733
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
734
+ compositeButton.setToolTipText("Create composite");
735
+ compositeButton.addActionListener(this);
736
+
737
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ switchButton.setToolTipText("Create item switcher");
739
+ switchButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ loopButton.setToolTipText("Create loop");
743
+ loopButton.addActionListener(this);
744
+
745
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
746
+ textureButton.setToolTipText("Create texture");
747
+ textureButton.addActionListener(this);
748
+
749
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750
+ overlayButton.setToolTipText("Create overlay");
751
+ overlayButton.addActionListener(this);
752
+
753
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
754
+ lightButton.setToolTipText("Create light");
755
+ lightButton.addActionListener(this);
756
+
757
+ for (int i=6; --i>=0;)
758
+ {
759
+ oe.toolboxPanel.Return();
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ oe.toolboxPanel.add(new cGridBag());
762
+ oe.toolboxPanel.add(new cGridBag());
763
+ oe.toolboxPanel.add(new cGridBag());
764
+ oe.toolboxPanel.add(new cGridBag());
765
+ oe.toolboxPanel.add(new cGridBag());
766
+ oe.toolboxPanel.add(new cGridBag());
767
+ }
768
+
769
+ // EDIT panel
770
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
771
+ editButton.setToolTipText("Pin selection controls");
772
+ editButton.addActionListener(this);
773
+
774
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ uneditButton.setToolTipText("Remove selection controls");
547776 uneditButton.addActionListener(this);
548777
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);
778
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
779
+ allParamsButton.setToolTipText("Show all controle");
561780 allParamsButton.addActionListener(this);
562781
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);
782
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
783
+ clearPanelButton.setToolTipText("Clear edit panel");
784
+ clearPanelButton.addActionListener(this);
785
+
786
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
787
+ unselectButton.setToolTipText("Unselect");
568788 unselectButton.addActionListener(this);
569789
790
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
791
+ flashSelectionButton.setToolTipText("Highlight selection");
792
+ flashSelectionButton.addActionListener(this);
793
+
794
+ editCommandsPanel.preferredHeight = 1;
795
+
796
+ SetPinStates(false);
797
+// oe.treePanel.add(commandsPanel);
798
+// oe.treePanel.Return();
799
+
570800 // oe.aConstraints.gridx += 1;
571801 // oe.aConstraints.weighty = 0;
572802 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +808,22 @@
578808 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579809 // gcButton.addActionListener(this);
580810
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;
811
+ cGridBag jSPPanel = new cGridBag();
812
+
813
+ JScrollPane jSP;
592814 //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);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594816 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;
614817
818
+ oe.treePanel.add(jSPPanel);
819
+ oe.treePanel.Return();
820
+
821
+ oe.treePanel.add(copyOptionsPanel);
822
+ oe.treePanel.Return();
823
+
824
+// mainPanel.setDividerLocation(0.5); //1.0);
825
+// mainPanel.setResizeWeight(0.5);
826
+
615827 //jList.addListSelectionListener(this);
616828 oe.jTree.addTreeSelectionListener(this);
617829 //jTree.setRootVisible(false);
....@@ -633,20 +845,157 @@
633845 radio.layout = sevenButton;
634846 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635847 }
848
+
849
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
850
+ {
851
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
852
+ colorCB.setToolTipText("Copy color when dropped");
853
+ colorCB.addItemListener(this);
854
+
855
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
856
+ materialCB.setToolTipText("Copy material when dropped");
857
+ materialCB.addItemListener(this);
858
+
859
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
860
+ textureCB.setToolTipText("Copy texture when dropped");
861
+ textureCB.addItemListener(this);
862
+
863
+ panel.Return();
864
+
865
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
866
+ boxCB.setToolTipText("Display bounding boxes");
867
+ boxCB.addItemListener(this);
868
+
869
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
870
+ zoomBoxCB.setToolTipText("Display only for wheel");
871
+ zoomBoxCB.addItemListener(this);
872
+
873
+ if (true) // Globals.ADVANCED)
874
+ {
875
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
876
+// supportCB.setToolTipText("Enable rigging");
877
+// supportCB.addItemListener(this);
878
+
879
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
880
+ freezeCB.setToolTipText("Fast moving camera");
881
+ freezeCB.addItemListener(this);
882
+
883
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
884
+ // localCB.addItemListener(this);
885
+
886
+ panel.Return();
887
+
888
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
889
+ crowdCB.setToolTipText("Used for crowds");
890
+ crowdCB.addItemListener(this);
891
+
892
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
893
+ smoothCB.setToolTipText("Snapping delay");
894
+ smoothCB.addItemListener(this);
895
+
896
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
897
+ slowCB.setToolTipText("Smooth interpolation");
898
+ slowCB.addItemListener(this);
899
+
900
+// constraints.gridy += 1;
901
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
902
+// speakerMocapCB.addItemListener(this);
903
+
904
+ panel.Return();
905
+
906
+ if (false)
907
+ {
908
+ // handled in scripts
909
+ //constraints.gridy += 1;
910
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
911
+ speakerCameraCB.addItemListener(this);
912
+
913
+ //constraints.gridy += 1;
914
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
915
+ speakerFocusCB.addItemListener(this);
916
+
917
+ //constraints.gridy += 1;
918
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
919
+ smoothfocusCB.addItemListener(this);
920
+ panel.Return();
921
+ }
922
+
923
+//constraints.gridx += 1;
924
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
925
+// debugCB.addItemListener(this);
926
+
927
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
928
+ trackCB.setToolTipText("Enable tracking target");
929
+ trackCB.addItemListener(this);
930
+
931
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
932
+ oeilCB.setToolTipText("Move camera when tracking");
933
+ oeilCB.addItemListener(this);
934
+
935
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
936
+ shadowCB.setToolTipText("When live compute shadows");
937
+ shadowCB.addItemListener(this);
938
+
939
+ panel.Return();
940
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
941
+ toggleTextureCB.setToolTipText("Load textures");
942
+ toggleTextureCB.addItemListener(this);
943
+
944
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
945
+ toggleSwitchCB.setToolTipText("Choose a single item");
946
+ toggleSwitchCB.addItemListener(this);
947
+
948
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
949
+ autosaveCB.setToolTipText("On structure change");
950
+ autosaveCB.addItemListener(this);
951
+
952
+ panel.Return();
953
+ if (Globals.ADVANCED)
954
+ {
955
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
956
+ lookAtCB.setToolTipText("Look-at target");
957
+ lookAtCB.addItemListener(this);
958
+ }
959
+
960
+ }
961
+
962
+ cGridBag fill = new cGridBag();
963
+ fill.preferredHeight = 200;
964
+ cGridBag fill2 = new cGridBag();
965
+ fill2.preferredHeight = 200;
966
+ cGridBag fill3 = new cGridBag();
967
+ fill3.preferredHeight = 200;
968
+
969
+ panel.add(fill);
970
+ panel.add(fill2);
971
+ panel.add(fill3);
972
+
973
+ }
636974
637975 void EditObject(Object3D obj)
638976 {
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();
977
+ cRadio radioButton = new cRadio(obj.name);
978
+
979
+ // June 2019. Patch to avoid bug with transparency.
980
+ radioButton.hadMaterial = obj.material != null;
981
+ if (!radioButton.hadMaterial)
982
+ {
983
+ obj.material = new cMaterial();
984
+ }
985
+
986
+ radioButton.SetObject(obj);
987
+ radioButton.layout = sevenButton;
988
+ radioButton.SetCamera(cameraView.renderCamera, false);
989
+ radioButton.addActionListener(this);
990
+ radioPanel.add(radioButton);
991
+ buttonGroup.add(radioButton);
992
+ radioButton.doClick();
647993 }
994
+
648995 void SetupViews(ObjEditor oe)
649996 {
997
+ theFrame = this;
998
+
650999 oe.SetupViews();
6511000
6521001 System.out.println("SetupViews");
....@@ -655,22 +1004,28 @@
6551004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561005 }
6571006
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;
1007
+ cToggleButton liveCB;
1008
+ cCheckBox supportCB;
1009
+ cCheckBox localCB;
1010
+ cCheckBox crowdCB;
1011
+ cCheckBox smoothCB;
1012
+ cToggleButton fastCB;
1013
+ cCheckBox slowCB;
1014
+ cCheckBox boxCB;
1015
+ cCheckBox zoomBoxCB;
1016
+ cCheckBox freezeCB;
1017
+ //cToggleButton trackCB;
1018
+ cCheckBox trackCB;
1019
+ cCheckBox smoothfocusCB;
6681020 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1021
+ cCheckBox speakerCameraCB;
1022
+ cCheckBox speakerFocusCB;
1023
+ cCheckBox debugCB;
1024
+
1025
+ cCheckBox oeilCB;
1026
+ cCheckBox shadowCB;
1027
+ cCheckBox autosaveCB;
1028
+ cCheckBox lookAtCB;
6741029
6751030 // static int COLOR = 1;
6761031 // static int MATERIAL = 2;
....@@ -678,9 +1033,9 @@
6781033
6791034 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801035
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1036
+ cCheckBox colorCB;
1037
+ cCheckBox materialCB;
1038
+ cCheckBox textureCB;
6841039
6851040 public void itemStateChanged(ItemEvent e)
6861041 {
....@@ -705,10 +1060,10 @@
7051060 dropAttributes |= Object3D.TEXTURE;
7061061 else
7071062 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1063
+ } else if(e.getSource() == liveCB)
7101064 {
7111065 cameraView.ToggleLive();
1066
+ refreshContents(false);
7121067 }
7131068 else if(e.getSource() == supportCB)
7141069 {
....@@ -744,6 +1099,10 @@
7441099 cameraView.repaint();
7451100 // refreshContents();
7461101 }
1102
+ else if(e.getSource() == zoomBoxCB)
1103
+ {
1104
+ cameraView.ToggleZoomBoxMode();
1105
+ }
7471106 else if(e.getSource() == smoothfocusCB)
7481107 {
7491108 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1128,18 @@
7691128 {
7701129 cameraView.ToggleOeil();
7711130 }
1131
+ else if(e.getSource() == shadowCB)
1132
+ {
1133
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1134
+ }
1135
+ else if(e.getSource() == freezeCB)
1136
+ {
1137
+ Globals.FREEZEONMOVE ^= true;
1138
+ }
1139
+ else if(e.getSource() == autosaveCB)
1140
+ {
1141
+ Globals.SAVEONMAKE ^= true;
1142
+ }
7721143 else if(e.getSource() == lookAtCB)
7731144 {
7741145 cameraView.ToggleLookAt();
....@@ -785,7 +1156,8 @@
7851156
7861157 /**/
7871158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
7891161 if ((path == null) || (path.getPathCount() <= 1)) {
7901162 // We can't move the root node or an empty selection
7911163 return;
....@@ -848,8 +1220,6 @@
8481220 }
8491221 }
8501222
851
- String string = (String) object;
852
-
8531223 System.out.println("Transfer = " + object + "; drop : " + target);
8541224 // if( object instanceof java.io.File[])
8551225 // {
....@@ -857,7 +1227,11 @@
8571227 // objEditor.DropFile((java.io.File[]) object, true);
8581228 // return;
8591229 // }
860
- if (string.charAt(0) == '/')
1230
+
1231
+ String string = object.toString();
1232
+
1233
+ // File path for Mac and Windows
1234
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611235 {
8621236 // file(s)
8631237 String[] names = string.split("\n");
....@@ -884,7 +1258,7 @@
8841258
8851259 flashIt = false;
8861260 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1261
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881262 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891263
8901264 if (group.selection.size() == 1)
....@@ -900,23 +1274,33 @@
9001274
9011275 assert target == objEditor.jTree;
9021276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
9031278 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051280 } catch (Exception e) {
9061281 System.out.println("destinationPath : " + destinationPath);
9071282 return;
9081283 }
9091284
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
9111286 {
1287
+ Object3D child = (Object3D)group.selection.elementAt(i);
1288
+
1289
+ // Cannot move into itself
1290
+ if (child == destinationLeaf)
1291
+ return;
1292
+ }
1293
+
1294
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1295
+// {
9121296 loadClipboard(true);
9131297 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1298
+ pasteInto(false, false);
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
9201304 }
9211305 public void dropActionChanged(DropTargetDragEvent dtde)
9221306 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1405,107 @@
10211405 {
10221406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231407 //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);
1408
+// gridItem = menu.add(new MenuItem("Grid"));
1409
+// gridItem.addActionListener(this);
1410
+// rectoidItem = menu.add(new MenuItem("Box"));
1411
+// rectoidItem.addActionListener(this);
1412
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1413
+// ellipsoidItem.addActionListener(this);
1414
+// coneItem = menu.add(new MenuItem("Cone"));
1415
+// coneItem.addActionListener(this);
1416
+// torusItem = menu.add(new MenuItem("Torus"));
1417
+// torusItem.addActionListener(this);
1418
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1419
+// superItem.addActionListener(this);
1420
+
1421
+ cameraItem = menu.add(new MenuItem("Camera"));
1422
+ cameraItem.addActionListener(this);
1423
+
1424
+ if (!Globals.ADVANCED)
1425
+ {
1426
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1427
+ kleinItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
1432
+ if (Globals.ADVANCED)
1433
+ {
10381434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391435 ragdollItem.addActionListener(this);
10401436 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411437 ragdoll2Item.addActionListener(this);
1438
+ }
10421439 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1440
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441441 meshItem.addActionListener(this);
10451442 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461443 // meshGroupItem.addActionListener(this);
1444
+ if (Globals.ADVANCED)
1445
+ {
10471446 springItem = menu.add(new MenuItem("Spring"));
10481447 springItem.addActionListener(this);
10491448 flagItem = menu.add(new MenuItem("Flag"));
10501449 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);
10551450 blobItem = menu.add(new MenuItem("Blob"));
10561451 blobItem.addActionListener(this);
10571452 latheItem = menu.add(new MenuItem("Lathe"));
10581453 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1454
+ }
1455
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1456
+ bezierItem.addActionListener(this);
1457
+// overlayItem = menu.add(new MenuItem("Overlay"));
1458
+// overlayItem.addActionListener(this);
1459
+// lightItem = menu.add(new MenuItem("Light"));
1460
+// lightItem.addActionListener(this);
10611461 menu.add("-");
10621462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631463 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
10661466 doubleItem = menu.add(new MenuItem("Fork"));
10671467 doubleItem.addActionListener(this);
1468
+ if (Globals.ADVANCED)
1469
+ {
10681470 tripleItem = menu.add(new MenuItem("Trident"));
10691471 tripleItem.addActionListener(this);
1472
+ }
10701473 }
10711474
10721475 void buildToolsMenu(Menu menu)
10731476 {
10741477 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751478 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1479
+ animationItem.setState(Globals.ANIMATION);
1480
+
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
10771483
10781484 menu.add("-");
10791485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801486 parseverticesItem.addActionListener(this);
10811487 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821488 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1489
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841490 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871491 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881492 reduceMorphItem.addActionListener(this);
10891493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901494 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941495 menu.add("-");
1095
-
10961496 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971497 memoryItem.addActionListener(this);
1498
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1499
+ computeAOItem.addActionListener(this);
1500
+
1501
+ if (Globals.ADVANCED)
1502
+ {
1503
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1504
+ mirrorItem.addActionListener(this);
1505
+ menu.add("-");
10981506 menu.add(analyzeItem = new MenuItem("Analyze"));
10991507 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
11011509 dumpItem.addActionListener(this);
11021510 // menu.add(pathItem = new MenuItem("From-to path"));
11031511 // pathItem.addActionListener(this);
....@@ -1106,6 +1514,8 @@
11061514 resetParentItem.addActionListener(this);
11071515 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081516 repairParentItem.addActionListener(this);
1517
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1518
+ repairShadowItem.addActionListener(this);
11091519 menu.add(invariantsItem = new MenuItem("Invariants"));
11101520 invariantsItem.addActionListener(this);
11111521 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1523,7 @@
11131523 menu.add("-");
11141524 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151525 editScriptItem.addActionListener(this);
1526
+ }
11161527 }
11171528
11181529 void ScreenFit()
....@@ -1235,9 +1646,24 @@
12351646 shadow.material = new cMaterial(obj.material);
12361647 shadow.material.diffuse = 0.0001f;
12371648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
12381650
12391651 makeSomething(shadow);
12401652 }
1653
+
1654
+ private void ClearUnpinned()
1655
+ {
1656
+ //for (Object3D obj : listUI)
1657
+ for (int i=listUI.size(); --i>=0;)
1658
+ {
1659
+ Object3D obj = listUI.elementAt(i);
1660
+ if (!obj.pinned)
1661
+ {
1662
+ obj.CloseUI();
1663
+ listUI.remove(i);
1664
+ }
1665
+ }
1666
+ }
12411667
12421668 /**
12431669 * applyExample
....@@ -1441,9 +1867,9 @@
14411867
14421868 void Overwrite(int mask)
14431869 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1870
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451871 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1872
+ Object3D content = Grafreed.clipboard.get(0);
14471873
14481874 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491875 content = ((cGroup)content).get(0);
....@@ -1466,6 +1892,7 @@
14661892 //
14671893 public void actionPerformed(ActionEvent event) // , Object arg)
14681894 {
1895
+ Object source = event.getSource();
14691896 /*
14701897 if (event.getSource() == nameField)
14711898 {
....@@ -1477,11 +1904,11 @@
14771904 }
14781905 else
14791906 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1907
+ if (source == lookAtItem || source == lookFromItem)
14811908 {
14821909 ScreenFit();
14831910 } else
1484
- if (event.getSource() == switchItem)
1911
+ if (source == switchViewItem)
14851912 {
14861913 cVector v1 = new cVector();
14871914 cVector v2 = new cVector();
....@@ -1490,11 +1917,11 @@
14901917 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911918 objEditor.cameraView.repaint();
14921919 } else
1493
- if (event.getSource() == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
14941921 {
14951922 makeSomething(new Box());
14961923 } else
1497
- if (event.getSource() == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
14981925 {
14991926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1942,9 @@
15151942 applyExample(particleGeom, "SMOKE");
15161943 makeSomething(particleGeom);
15171944 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1945
+ if (source == ragdollItem || source == ragdoll2Item)
15191946 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1947
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211948
15221949 ragdoll.toParent = LA.newMatrix();
15231950 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1962,7 @@
15351962 } else
15361963 /*
15371964 */
1538
- if (event.getSource() == heightFieldItem)
1965
+ if (source == heightFieldItem)
15391966 {
15401967 Object3D obj = new Object3D();
15411968
....@@ -1573,27 +2000,31 @@
15732000
15742001 makeSomething(obj);
15752002 } else
1576
- if (event.getSource() == gridItem)
2003
+ if (source == gridItem || source == gridButton)
15772004 {
15782005 makeSomething(new Grid());
15792006 } else
1580
- if (event.getSource() == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
15812008 {
15822009 makeSomething(new Sphere());
15832010 } else
1584
- if (event.getSource() == coneItem)
2011
+ if (source == coneItem || source == coneButton)
15852012 {
15862013 makeSomething(new Cone());
15872014 } else
1588
- if (event.getSource() == torusItem)
2015
+ if (source == torusItem || source == torusButton)
15892016 {
15902017 makeSomething(new Torus());
15912018 } else
1592
- if (event.getSource() == superItem)
2019
+ if (source == superItem || source == superButton)
15932020 {
15942021 makeSomething(new Superellipsoid());
15952022 } else
1596
- if (event.getSource() == blobItem)
2023
+ if (source == kleinItem || source == kleinButton)
2024
+ {
2025
+ makeSomething(new Klein());
2026
+ } else
2027
+ if (source == blobItem)
15972028 {
15982029 Blob blob = new Blob();
15992030 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2032,15 @@
16012032 //blob.retile();
16022033 makeSomething(blob);
16032034 } else
1604
- if (event.getSource() == latheItem)
2035
+ if (source == latheItem)
16052036 {
16062037 makeSomething(new Lathe());
16072038 } else
1608
- if (event.getSource() == bezierItem)
2039
+ if (source == bezierItem)
16092040 {
16102041 makeSomething(new BezierSurface());
16112042 } else
1612
- if (event.getSource() == checkerItem)
2043
+ if (source == overlayItem || source == overlayButton)
16132044 {
16142045 /*
16152046 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2055,7 @@
16242055 */
16252056 makeSomething(new Checker());
16262057 } else
1627
- if (event.getSource() == meshItem)
2058
+ if (source == meshItem)
16282059 {
16292060 Object3D itemtomake = new Object3D();
16302061 Object3D child;
....@@ -1645,35 +2076,35 @@
16452076 makeSomething(child);
16462077 }
16472078 } else
1648
- if (event.getSource() == springItem)
2079
+ if (source == springItem)
16492080 {
16502081 cSpring s = new cSpring();
16512082 s.setup();
16522083 makeSomething(s);
16532084 } else
1654
- if (event.getSource() == flagItem)
2085
+ if (source == flagItem)
16552086 {
16562087 cSpring s = new cFlag();
16572088 s.setup();
16582089 makeSomething(s);
16592090 } else
1660
- if (event.getSource() == lightItem)
2091
+ if (source == lightItem || source == lightButton)
16612092 {
16622093 makeSomething(new Light());
16632094 } else
1664
- if (event.getSource() == csgItem)
2095
+ if (source == csgItem)
16652096 {
16662097 group(new CSG());
16672098 } else
1668
- if (event.getSource() == templateItem)
2099
+ if (source == templateItem)
16692100 {
16702101 group(new cTemplate());
16712102 } else
1672
- if (event.getSource() == attributeItem)
2103
+ if (source == attributeItem)
16732104 {
16742105 makeSomething(new Attribute());
16752106 } else
1676
- if (event.getSource() == pointflowItem)
2107
+ if (source == pointflowItem)
16772108 {
16782109 makeSomething(new PointFlow());
16792110 } else
....@@ -1685,7 +2116,7 @@
16852116 } else
16862117 */
16872118
1688
- if (event.getSource() == superLoopItem)
2119
+ if (source == superLoopItem)
16892120 {
16902121 Composite g = new cGroup();
16912122 for (int i=0; i<15; i++)
....@@ -1707,30 +2138,30 @@
17072138
17082139 group(g);
17092140 } else
1710
- if (event.getSource() == loopItem)
2141
+ if (source == loopItem || source == loopButton)
17112142 {
17122143 Composite csg = new GroupLeaf();
17132144 csg.count = 5;
17142145 group(csg);
1715
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
17162147 csg.addChild(child);
17172148 child.addChild(csg);
17182149 } else
1719
- if (event.getSource() == doubleItem)
2150
+ if (source == doubleItem)
17202151 {
1721
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
17222153 csg.count = 5;
17232154 group(csg);
1724
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
17252156 csg.addChild(child);
17262157 child.addChild(csg);
1727
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
17282159 csg.addChild(child);
17292160 child.addChild(csg);
17302161 } else
1731
- if (event.getSource() == tripleItem)
2162
+ if (source == tripleItem)
17322163 {
1733
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
17342165 csg.count = 4;
17352166 group(csg);
17362167 Composite child = new cGroup();
....@@ -1743,73 +2174,84 @@
17432174 csg.addChild(child);
17442175 child.addChild(csg);
17452176 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2177
+ if (source == computeAOItem)
17482178 {
1749
- ImportGFD();
2179
+ Globals.drawMode = CameraPane.OCCLUSION;
2180
+ Globals.theRenderer.repaint();
17502181 } 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)
2182
+ if (source == recompileItem)
17692183 {
17702184 Recompile();
17712185 refreshContents();
17722186 } else
1773
- if (event.getSource() == editScriptItem)
2187
+ if (source == editScriptItem)
17742188 {
17752189 OpenDialog();
17762190 refreshContents();
17772191 } else
1778
- if (event.getSource() == invariantsItem)
2192
+ if (source == invariantsItem)
17792193 {
17802194 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2195
+ Grafreed.grafreeD.universe.invariants();
17822196 } else
1783
- if (event.getSource() == memoryItem)
2197
+ if (source == memoryItem)
17842198 {
17852199 //System.out.println("Invariants:");
17862200 PrintMemory();
17872201 } else
1788
- if (event.getSource() == pathItem)
2202
+ if (source == pathItem)
17892203 {
17902204 PrintPath();
17912205 } else
1792
- if (event.getSource() == analyzeItem)
2206
+ if (source == analyzeItem)
17932207 {
17942208 AnalyzeObject();
17952209 } else
1796
- if (event.getSource() == dumpItem)
2210
+ if (source == dumpItem)
17972211 {
17982212 DumpObject();
17992213 } else
1800
- if (event.getSource() == screenfitButton)
2214
+ if (source == minButton)
18012215 {
1802
- //Reload(lastConverter, lastFilename, true);
2216
+ Minimize();
2217
+ } else
2218
+ if (source == maxButton)
2219
+ {
2220
+ Maximize();
2221
+ } else
2222
+ if (source == fullButton)
2223
+ {
2224
+ ToggleFullScreen();
2225
+ } else
2226
+ if (source == undoButton)
2227
+ {
2228
+ if (!Undo())
2229
+ java.awt.Toolkit.getDefaultToolkit().beep();
2230
+ } else
2231
+ if (source == redoButton)
2232
+ {
2233
+ Redo();
2234
+ } else
2235
+ if (source == saveButton)
2236
+ {
2237
+ if (!Save(true))
2238
+ java.awt.Toolkit.getDefaultToolkit().beep();
2239
+ } else
2240
+ if (source == oneStepButton)
2241
+ {
2242
+ Globals.ONESTEP = true;
2243
+ cameraView.repaint();
2244
+ } else
2245
+ if (source == screenfitButton)
2246
+ {
18032247 ScreenFit();
18042248 } else
1805
- if (event.getSource() == screenfitpointButton)
2249
+ if (source == screenfitpointButton)
18062250 {
1807
- //Reload(lastConverter, lastFilename, true);
18082251 ScreenFitPoint();
18092252 } else
1810
- if (event.getSource() == snapobjectButton)
2253
+ if (source == snapobjectButton)
18112254 {
1812
- //Reload(lastConverter, lastFilename, true);
18132255 SnapObject();
18142256 } else
18152257 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2260,13 @@
18182260 // Recompile();
18192261 // refreshContents();
18202262 // } else
1821
- if (event.getSource() == gcButton)
2263
+ if (source == gcButton)
18222264 {
18232265 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242266 System.gc();
18252267 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262268 } else
1827
- if (event.getSource() == editLeafItem)
2269
+ if (source == editLeafItem)
18282270 {
18292271 Object3D obj;
18302272 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2280,78 @@
18382280 }
18392281 refreshContents(true);
18402282 } else
1841
- if (event.getSource() == openWindowItem)
2283
+ if (source == openWindowItem)
18422284 {
18432285 EditSelection(true);
18442286 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2287
+ if (source == cutItem || source == clearButton)
18462288 {
18472289 loadClipboard(true);
18482290 } else
1849
- if (event.getSource() == duplicateItem)
2291
+ if (source == undoItem)
18502292 {
1851
- Object3D keep = GraphreeD.clipboard;
2293
+ Undo();
2294
+ } else
2295
+ if (source == redoItem)
2296
+ {
2297
+ Redo();
2298
+ } else
2299
+ if (source == duplicateItem)
2300
+ {
2301
+ Object3D keep = Grafreed.clipboard;
18522302 loadClipboard(false);
18532303 paste(false);
1854
- GraphreeD.clipboard = keep;
2304
+ Grafreed.clipboard = keep;
18552305 } else
1856
- if (event.getSource() == cloneItem)
2306
+ if (source == cloneItem)
18572307 {
18582308 CloneSelection(false);
18592309 } else
1860
- if (event.getSource() == cloneSupportItem)
2310
+ if (source == cloneSupportItem)
18612311 {
18622312 CloneSelection(true);
18632313 } else
1864
- if (event.getSource() == copyItem)
2314
+ if (source == copyItem)
18652315 {
18662316 loadClipboard(false);
18672317 } else
1868
- if (event.getSource() == pasteItem)
2318
+ if (source == pasteItem)
18692319 {
18702320 paste(false);
18712321 } else
1872
- if (event.getSource() == pasteLinkItem)
2322
+ if (source == pasteIntoItem)
18732323 {
1874
- pasteInto(false);
2324
+ pasteInto(true, false);
18752325 } else
1876
- if (event.getSource() == pasteCloneItem)
2326
+ if (source == pasteLinkItem)
18772327 {
1878
- pasteInto(true);
2328
+ pasteInto(false, false);
18792329 } else
1880
- if (event.getSource() == pasteExpandItem)
2330
+ if (source == pasteCloneItem)
2331
+ {
2332
+ pasteInto(true, true);
2333
+ } else
2334
+ if (source == pasteExpandItem)
18812335 {
18822336 paste(true);
18832337 } else
1884
- if (event.getSource() == synchronizeItem)
2338
+ if (source == synchronizeItem)
18852339 {
18862340 Overwrite(Object3D.TRANSFORM);
18872341 } else
1888
- if (event.getSource() == overwriteNameItem)
2342
+ if (source == overwriteNameItem)
18892343 {
18902344 Overwrite(Object3D.NAME);
18912345 } else
1892
- if (event.getSource() == overwriteUVItem)
2346
+ if (source == overwriteUVItem)
18932347 {
18942348 Overwrite(Object3D.UV);
18952349 } else
1896
- if (event.getSource() == overwriteMatItem)
2350
+ if (source == overwriteMatItem)
18972351 {
2352
+ /* july 2015
18982353 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2354
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002355 else
19012356 {
19022357 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2363,16 @@
19082363 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092364 }
19102365 }
2366
+ */
2367
+
2368
+ Overwrite(dropAttributes);
19112369 }
1912
- if (event.getSource() == overwriteGeoItem)
2370
+ if (source == overwriteGeoItem)
19132371 {
19142372 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2373
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162374 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2375
+// Object3D content = GrafreeD.clipboard.get(0);
19182376 //
19192377 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202378 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2384,7 @@
19262384 // refreshContents();
19272385 // }
19282386 } else
1929
- if (event.getSource() == generateMeshItem)
2387
+ if (source == generateMeshItem)
19302388 {
19312389 //if (group.selection.size() == 1)
19322390 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2395,7 @@
19372395 ResetModel();
19382396 refreshContents();
19392397 } else
1940
- if (event.getSource() == extractGeometriesItem)
2398
+ if (source == extractGeometriesItem)
19412399 {
19422400 boolean one = false;
19432401
....@@ -1964,7 +2422,7 @@
19642422 ResetModel();
19652423 refreshContents();
19662424 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2425
+ if (source == cloneGeometriesItem)
19682426 {
19692427 boolean one = false;
19702428
....@@ -1990,32 +2448,37 @@
19902448 ResetModel();
19912449 refreshContents();
19922450 } else
1993
- if (event.getSource() == shareGeometriesItem)
2451
+ if (source == shareGeometriesItem)
19942452 {
19952453 boolean one = false;
19962454
19972455 if (group.selection.size() == 1)
19982456 one = true;
19992457
2458
+ Object3D merge = null;
2459
+
20002460 Object3D content = new cGroup();
20012461
20022462 for (int i=0; i<group.selection.size(); i++)
20032463 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2464
+ merge = new Merge(group.selection.get(i));
20052465
20062466 if (one)
2007
- makeSomething(sel, false);
2467
+ makeSomething(merge, false);
20082468 else
2009
- content.addChild(sel);
2469
+ content.addChild(merge);
20102470 }
20112471
20122472 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2473
+ makeSomething(content, true);
2474
+ else
2475
+ {
2476
+ ResetModel();
2477
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2478
+ refreshContents();
2479
+ }
20172480 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2481
+ if (source == mergeGeometriesItem)
20192482 {
20202483 boolean one = false;
20212484
....@@ -2045,11 +2508,11 @@
20452508 ResetModel();
20462509 refreshContents();
20472510 } else
2048
- if (event.getSource() == linkverticesItem)
2511
+ if (source == linkverticesItem)
20492512 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2513
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512514 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2515
+// Object3D content = GrafreeD.clipboard.get(0);
20532516 //
20542517 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552518 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2521,48 @@
20582521 // group.selection.get(0).setMasterThis(content); // should be identity
20592522 // refreshContents();
20602523 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2524
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622525 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2526
+ Object3D content = Grafreed.clipboard.get(0);
20642527
20652528 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662529 content = ((cGroup)content).get(0);
20672530
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2531
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692532 for (int i=0; i<group.selection.size(); i++)
20702533 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2534
+ boolean random = CameraPane.SWITCH;
2535
+ CameraPane.SWITCH = false; // parse all random nodes
20732536 group.selection.get(i).linkVerticesThis(content);
20742537 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2538
+ CameraPane.SWITCH = random;
20762539 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2540
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782541 refreshContents();
20792542 }
20802543 } else
2081
- if (event.getSource() == resetsupportItem)
2544
+ if (source == resetsupportItem)
20822545 {
20832546 for (int i=0; i<group.selection.size(); i++)
20842547 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2548
+ boolean random = CameraPane.SWITCH;
2549
+ CameraPane.SWITCH = false; // parse all random nodes
20872550 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2551
+ CameraPane.SWITCH = random;
20892552 }
20902553
20912554 refreshContents();
20922555 } else
2093
- if (event.getSource() == resetreferencesItem)
2556
+ if (source == relinkverticesItem)
2557
+ {
2558
+ boolean random = CameraPane.SWITCH;
2559
+ CameraPane.SWITCH = false; // parse all random nodes
2560
+ group.selection.RelinkToSupport();
2561
+ CameraPane.SWITCH = random;
2562
+
2563
+ refreshContents();
2564
+ } else
2565
+ if (source == resetreferencesItem)
20942566 {
20952567 for (int i=0; i<group.selection.size(); i++)
20962568 {
....@@ -2099,11 +2571,11 @@
20992571
21002572 refreshContents();
21012573 } else
2102
- if (event.getSource() == setMasterItem)
2574
+ if (source == setMasterItem)
21032575 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2576
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052577 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2578
+ Object3D content = Grafreed.clipboard.get(0);
21072579
21082580 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092581 content = ((cGroup)content).get(0);
....@@ -2112,13 +2584,13 @@
21122584 refreshContents();
21132585 }
21142586 } else
2115
- if (event.getSource() == poseMeshItem)
2587
+ if (source == poseMeshItem)
21162588 {
21172589 if (group.selection.size() == 1)
21182590 {
2119
- if (GraphreeD.clipboard.size() == 1)
2591
+ if (Grafreed.clipboard.size() == 1)
21202592 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2593
+ Object3D content = Grafreed.clipboard.get(0);
21222594
21232595 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242596 content = ((cGroup)content).get(0);
....@@ -2131,19 +2603,19 @@
21312603 }
21322604
21332605 } else
2134
- if (event.getSource() == revertMeshItem)
2606
+ if (source == revertMeshItem)
21352607 {
21362608 RevertMeshes();
21372609 } else
2138
- if (event.getSource() == resetMeshItem)
2610
+ if (source == resetAllItem)
21392611 {
21402612 ResetAll();
21412613 } else
2142
- if (event.getSource() == stepAllItem)
2614
+ if (source == stepAllItem)
21432615 {
21442616 StepAll();
21452617 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2618
+ if (source == clearItem) // || event.getSource() == clearButton)
21472619 {
21482620 //int indices[] = jList.getSelectedIndices();
21492621 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2623,46 @@
21512623
21522624 ClearSelection(false);
21532625 } else
2154
- if (event.getSource() == clearAllItem)
2626
+ if (source == clearAllItem)
21552627 {
21562628 ClearSelection(true);
21572629 } else
2158
- if (event.getSource() == grabItem)
2630
+ if (source == grabItem || source == groupButton)
21592631 {
2160
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
21612633 } else
2162
- if (event.getSource() == frontItem)
2634
+ if (source == hideItem)
2635
+ {
2636
+ group(new HiddenObject());
2637
+ } else
2638
+ if (source == frontItem)
21632639 {
21642640 front();
21652641 } else
2166
- if (event.getSource() == backItem)
2642
+ if (source == backItem)
21672643 {
21682644 back();
21692645 } else
2170
- if (event.getSource() == cameraItem)
2646
+ if (source == cameraItem)
21712647 {
21722648 makeSomething(new Camera());
21732649 } else
2174
- if (event.getSource() == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
21752651 {
21762652 group(new Composite());
21772653 } else
2178
- if (event.getSource() == randomItem)
2654
+ if (source == switchItem || source == switchButton)
21792655 {
21802656 RandomNode random = new RandomNode();
21812657 group(random);
21822658 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2659
+ random.name = random.get(0).name + "Switch";
21842660 } else
2185
- if (event.getSource() == physicsItem)
2661
+ if (source == physicsItem)
21862662 {
21872663 group(new PhysicsNode());
21882664 } else
2189
- if (event.getSource() == frameselectorItem)
2665
+ if (source == frameselectorItem)
21902666 {
21912667 for (int i=0; i<group.selection.size(); i++)
21922668 {
....@@ -2198,7 +2674,7 @@
21982674 ResetModel();
21992675 refreshContents();
22002676 } else
2201
- if (event.getSource() == switchGeoItem)
2677
+ if (source == switchGeoItem)
22022678 {
22032679 for (int i=0; i<group.selection.size(); i++)
22042680 {
....@@ -2210,7 +2686,7 @@
22102686 ResetModel();
22112687 refreshContents();
22122688 } else
2213
- if (event.getSource() == switchTransfoItem)
2689
+ if (source == switchTransfoItem)
22142690 {
22152691 for (int i=0; i<group.selection.size(); i++)
22162692 {
....@@ -2222,7 +2698,7 @@
22222698 ResetModel();
22232699 refreshContents();
22242700 } else
2225
- if (event.getSource() == morphItem)
2701
+ if (source == morphItem)
22262702 {
22272703 for (int i=0; i<group.selection.size(); i++)
22282704 {
....@@ -2234,7 +2710,7 @@
22342710 ResetModel();
22352711 refreshContents();
22362712 } else
2237
- if (event.getSource() == scriptNodeItem)
2713
+ if (source == scriptNodeItem)
22382714 {
22392715 boolean atleastone = false;
22402716
....@@ -2273,195 +2749,252 @@
22732749 }
22742750 }
22752751 } else
2276
- if (event.getSource() == linkerItem)
2752
+ if (source == linkerItem)
22772753 {
22782754 group(new cLinker());
22792755 } else
2280
- if (event.getSource() == textureItem)
2756
+ if (source == textureItem || source == textureButton)
22812757 {
22822758 group(new TextureNode());
22832759 } else
2284
- if (event.getSource() == shadowXItem)
2760
+ if (source == billboardItem)
2761
+ {
2762
+ group(new BillboardNode());
2763
+ } else
2764
+ if (source == shadowXItem)
22852765 {
22862766 CastShadow(0);
22872767 } else
2288
- if (event.getSource() == shadowYItem)
2768
+ if (source == shadowYItem)
22892769 {
22902770 CastShadow(1);
22912771 } else
2292
- if (event.getSource() == shadowZItem)
2772
+ if (source == shadowZItem)
22932773 {
22942774 CastShadow(2);
22952775 } else
2296
- if (event.getSource() == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
22972777 {
2298
- ungroup();
2778
+ boolean hasRoot = false;
2779
+
2780
+ for (int i=0; i<group.selection.size(); i++)
2781
+ {
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
2787
+ }
2788
+
2789
+ if (!hasRoot)
2790
+ {
2791
+ for (int i=0; i<group.selection.size(); i++)
2792
+ {
2793
+ Ungroup(group.selection.get(i));
2794
+ }
2795
+
2796
+ ClearSelection(false);
2797
+
2798
+ refreshContents();
2799
+ }
22992800 } else
2300
- if (event.getSource() == genUVItem)
2801
+ if (source == genUVItem)
23012802 {
23022803 GenUV();
23032804 } else
2304
- if (event.getSource() == genNormalsCADItem)
2805
+ if (source == genNormalsCADItem)
23052806 {
23062807 GenNormals(true);
23072808 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2809
+ if (source == genNormalsMESHItem)
2810
+ {
2811
+ GenNormalsMESH();
2812
+ } else
2813
+ if (source == genNormalsORGANItem)
23092814 {
23102815 GenNormals(false);
23112816 } else
2312
- if (event.getSource() == stripifyItem)
2817
+ if (source == genNormalsMINEItem)
2818
+ {
2819
+ GenNormalsMINE();
2820
+ } else
2821
+ if (source == stripifyItem)
23132822 {
23142823 Stripify();
23152824 } else
2316
- if (event.getSource() == unstripifyItem)
2825
+ if (source == unstripifyItem)
23172826 {
23182827 Unstripify();
23192828 } else
2320
- if (event.getSource() == trimItem)
2829
+ if (source == trimItem)
23212830 {
23222831 Trim();
23232832 } else
2324
- if (event.getSource() == untrimItem)
2833
+ if (source == untrimItem)
23252834 {
23262835 Untrim();
23272836 } else
2328
- if (event.getSource() == clearColorsItem)
2837
+ if (source == clearColorsItem)
23292838 {
23302839 ClearColors();
23312840 } else
2332
- if (event.getSource() == clearMaterialsItem)
2841
+ if (source == clearMaterialsItem)
23332842 {
23342843 ClearMaterials();
23352844 } else
2336
- if (event.getSource() == liveleavesItem)
2845
+ if (source == liveleavesItem)
23372846 {
23382847 LiveLeaves(true);
23392848 } else
2340
- if (event.getSource() == unliveleavesItem)
2849
+ if (source == unliveleavesItem)
23412850 {
23422851 LiveLeaves(false);
23432852 } else
2344
- if (event.getSource() == supportleavesItem)
2853
+ if (source == supportleavesItem)
23452854 {
23462855 SupportLeaves(true);
23472856 } else
2348
- if (event.getSource() == unsupportleavesItem)
2857
+ if (source == unsupportleavesItem)
23492858 {
23502859 SupportLeaves(false);
23512860 } else
2352
- if (event.getSource() == hideleavesItem)
2861
+ if (source == hideleavesItem)
23532862 {
23542863 HideLeaves(true);
23552864 } else
2356
- if (event.getSource() == showleavesItem)
2865
+ if (source == showleavesItem)
23572866 {
23582867 HideLeaves(false);
23592868 } else
2360
- if (event.getSource() == markleavesItem)
2869
+ if (source == markleavesItem)
23612870 {
23622871 MarkLeaves(true);
23632872 } else
2364
- if (event.getSource() == unmarkleavesItem)
2873
+ if (source == unmarkleavesItem)
23652874 {
23662875 MarkLeaves(false);
23672876 } else
2368
- if (event.getSource() == flipVItem)
2877
+ if (source == rewindleavesItem)
2878
+ {
2879
+ RewindLeaves(true);
2880
+ } else
2881
+ if (source == unrewindleavesItem)
2882
+ {
2883
+ RewindLeaves(false);
2884
+ } else
2885
+ if (source == randomleavesItem)
2886
+ {
2887
+ RandomLeaves(true);
2888
+ } else
2889
+ if (source == unrandomleavesItem)
2890
+ {
2891
+ RandomLeaves(false);
2892
+ } else
2893
+ if (source == flipVItem)
23692894 {
23702895 FlipV(true);
23712896 } else
2372
- if (event.getSource() == unflipVItem)
2897
+ if (source == unflipVItem)
23732898 {
23742899 FlipV(false);
23752900 } else
2376
- if (event.getSource() == lowTexturesItem)
2901
+ if (source == lowTexturesItem)
23772902 {
23782903 SetTexRes(0);
23792904 } else
2380
- if (event.getSource() == normalTexturesItem)
2905
+ if (source == normalTexturesItem)
23812906 {
23822907 SetTexRes(1);
23832908 } else
2384
- if (event.getSource() == highTexturesItem)
2909
+ if (source == highTexturesItem)
23852910 {
23862911 SetTexRes(2);
23872912 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2913
+ if (source == veryhighTexturesItem)
23892914 {
23902915 SetTexRes(3);
23912916 } else
2392
- if (event.getSource() == maxTexturesItem)
2917
+ if (source == maxTexturesItem)
23932918 {
23942919 SetTexRes(4);
23952920 } else
2396
- if (event.getSource() == panoTexturesItem)
2921
+ if (source == panoTexturesItem)
23972922 {
23982923 SetTexRes(5);
23992924 } else
2400
- if (event.getSource() == reverseNormalsItem)
2925
+ if (source == reverseNormalsItem)
24012926 {
24022927 ReverseNormals();
24032928 } else
2404
- if (event.getSource() == parseverticesItem)
2929
+ if (source == parseverticesItem)
24052930 {
24062931 ParseVertices();
24072932 } else
2408
- if (event.getSource() == textureFieldItem)
2933
+ if (source == textureFieldItem)
24092934 {
24102935 TextureVertices();
24112936 } else
2412
- if (event.getSource() == alignItem)
2937
+ if (source == alignItem)
24132938 {
24142939 Align();
24152940 } else
2416
- if (event.getSource() == mirrorItem)
2941
+ if (source == mirrorItem)
24172942 {
24182943 MirrorPoses();
24192944 } else
2420
- if (event.getSource() == reduceMorphItem)
2945
+ if (source == reduceMorphItem)
24212946 {
24222947 MeshReduction(false);
24232948 } else
2424
- if (event.getSource() == reduce34MorphItem)
2949
+ if (source == reduce34MorphItem)
24252950 {
24262951 MeshReduction(true);
24272952 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2953
+ if (source == reverseTrianglesItem)
24292954 {
24302955 ReverseTriangles();
24312956 } else
2432
- if (event.getSource() == reduceMeshItem)
2957
+ if (source == reduceMeshItem)
24332958 {
24342959 ReduceMesh(false);
24352960 } else
2436
- if (event.getSource() == reduce34MeshItem)
2961
+ if (source == reduce34MeshItem)
24372962 {
24382963 ReduceMesh(true);
24392964 } else
2440
- if (event.getSource() == increaseMeshItem)
2965
+ if (source == increaseMeshItem)
24412966 {
24422967 IncreaseMesh();
24432968 } else
2444
- if (event.getSource() == clipMeshItem)
2969
+ if (source == clipMeshItem)
24452970 {
24462971 ClipMesh();
24472972 } else
2448
- if (event.getSource() == smoothMeshItem)
2973
+ if (source == smoothMeshItem)
24492974 {
24502975 SmoothMesh();
24512976 } else
2452
- if (event.getSource() == transformgeometryItem)
2977
+ if (source == transformGeometryItem)
24532978 {
24542979 TransformGeometry();
24552980 } else
2456
- if (event.getSource() == resetTransformItem)
2981
+ if (source == transformChildrenItem)
2982
+ {
2983
+ TransformChildren();
2984
+ } else
2985
+ if (source == resetTransformItem)
24572986 {
24582987 ResetTransform();
24592988 } else
2460
- if (event.getSource() == resetCentroidItem)
2989
+ if (source == resetCentroidItem)
24612990 {
2462
- ResetCentroid();
2991
+ ResetCentroid(true);
24632992 } else
2464
- if (event.getSource() == resetParentItem)
2993
+ if (source == resetCentroidXZItem)
2994
+ {
2995
+ ResetCentroid(false);
2996
+ } else
2997
+ if (source == resetParentItem)
24652998 {
24662999 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673000 {
....@@ -2471,7 +3004,7 @@
24713004
24723005 refreshContents();
24733006 } else
2474
- if (event.getSource() == repairParentItem)
3007
+ if (source == repairParentItem)
24753008 {
24763009 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773010 {
....@@ -2485,7 +3018,21 @@
24853018
24863019 refreshContents();
24873020 } else
2488
- if (event.getSource() == sortbysizeItem)
3021
+ if (source == repairShadowItem)
3022
+ {
3023
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3024
+ {
3025
+ Object3D obj = (Object3D)e.nextElement();
3026
+ obj.RepairShadow();
3027
+// for (int i=0; i<obj.size(); i++)
3028
+// {
3029
+// obj.get(i).parent = obj;
3030
+// }
3031
+ }
3032
+
3033
+ refreshContents();
3034
+ } else
3035
+ if (source == sortbysizeItem)
24893036 {
24903037 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913038 {
....@@ -2497,7 +3044,7 @@
24973044 ResetModel();
24983045 refreshContents();
24993046 } else
2500
- if (event.getSource() == sortbynameItem)
3047
+ if (source == sortbynameItem)
25013048 {
25023049 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033050 {
....@@ -2509,7 +3056,7 @@
25093056 ResetModel();
25103057 refreshContents();
25113058 } else
2512
- if (event.getSource() == attachPigmentItem)
3059
+ if (source == attachPigmentItem)
25133060 {
25143061 String texture = GetFile("Attach pigment");
25153062 Object3D obj;
....@@ -2521,7 +3068,7 @@
25213068
25223069 refreshContents();
25233070 } else
2524
- if (event.getSource() == detachPigmentItem)
3071
+ if (source == detachPigmentItem)
25253072 {
25263073 Object3D obj;
25273074 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3079,7 @@
25323079
25333080 refreshContents();
25343081 } else
2535
- if (event.getSource() == attachBumpItem)
3082
+ if (source == attachBumpItem)
25363083 {
25373084 String texture = GetFile("Attach bump");
25383085 Object3D obj;
....@@ -2544,7 +3091,7 @@
25443091
25453092 refreshContents();
25463093 } else
2547
- if (event.getSource() == detachBumpItem)
3094
+ if (source == detachBumpItem)
25483095 {
25493096 Object3D obj;
25503097 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +3102,7 @@
25553102
25563103 refreshContents();
25573104 } else
2558
- if (event.getSource() == pigmentBumpItem)
3105
+ if (source == pigmentBumpItem)
25593106 {
25603107 Object3D obj;
25613108 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3113,237 @@
25663113
25673114 refreshContents();
25683115 } else
2569
- if (event.getSource() == flashSelectionButton)
3116
+ if (source == flashSelectionButton)
25703117 {
25713118 CameraPane.flash = true;
25723119 refreshContents();
25733120 } else
2574
- if (event.getSource() == oneButton)
3121
+ if (source == oneButton)
25753122 {
25763123 } else
2577
- if (event.getSource() == twoButton)
3124
+ if (source == twoButton)
25783125 {
25793126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
25803131 // bug
25813132 //gridPanel.setDividerLocation(1.0);
25823133 //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();
3134
+// bigThree.remove(scenePanel);
3135
+// bigThree.remove(centralPanel);
3136
+// bigThree.remove(XYZPanel);
3137
+// aWindowConstraints.gridx = 0;
3138
+// aWindowConstraints.gridy = 0;
3139
+// aWindowConstraints.gridwidth = 1;
3140
+// // aConstraints.gridheight = 3;
3141
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3142
+// aWindowConstraints.weightx = 0;
3143
+// aWindowConstraints.weighty = 1;
3144
+// //bigThree.add(jtp, aWindowConstraints);
3145
+// aWindowConstraints.weightx = 1;
3146
+// aWindowConstraints.gridwidth = 3;
3147
+// // aConstraints.gridheight = 3;
3148
+// aWindowConstraints.gridx = 1;
3149
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3150
+// bigThree.add(centralPanel, aWindowConstraints);
3151
+// aWindowConstraints.weightx = 0;
3152
+// aWindowConstraints.gridx = 4;
3153
+// aWindowConstraints.gridwidth = 1;
3154
+// // aConstraints.gridheight = 3;
3155
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3156
+// //bigThree.add(XYZPanel, aWindowConstraints);
3157
+// scenePanel.setVisible(false);
3158
+// centralPanel.setVisible(true);
3159
+// XYZPanel.setVisible(false);
3160
+ bigThree.ClearUI();
3161
+ bigThree.add(centralPanel);
3162
+ bigThree.FlushUI();
3163
+
3164
+ cameraView.requestFocusInWindow();
3165
+
3166
+// refreshContents(true);
3167
+//
3168
+// try
3169
+// {
3170
+// java.awt.Robot bot = new java.awt.Robot();
3171
+// int mask = InputEvent.BUTTON1_MASK;
3172
+// bot.mouseMove(100, 100);
3173
+// bot.mousePress(mask);
3174
+// bot.mouseRelease(mask);
3175
+// }
3176
+// catch (Exception e)
3177
+// {
3178
+//
3179
+// }
3180
+
26073181 } else
2608
- if (event.getSource() == threeButton)
3182
+ if (source == threeButton)
26093183 {
26103184 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();
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
3188
+
3189
+// bigThree.remove(scenePanel);
3190
+// bigThree.remove(centralPanel);
3191
+// bigThree.remove(XYZPanel);
3192
+// aWindowConstraints.gridx = 0;
3193
+// aWindowConstraints.gridy = 0;
3194
+// aWindowConstraints.gridwidth = 1;
3195
+// // aConstraints.gridheight = 3;
3196
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3197
+// aWindowConstraints.weightx = 0;
3198
+// aWindowConstraints.weighty = 1;
3199
+// //bigThree.add(jtp, aWindowConstraints);
3200
+// aWindowConstraints.weightx = 1;
3201
+// aWindowConstraints.gridwidth = 3;
3202
+// // aConstraints.gridheight = 3;
3203
+// aWindowConstraints.gridx = 1;
3204
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3205
+// bigThree.add(centralPanel, aWindowConstraints);
3206
+// aWindowConstraints.weightx = 0;
3207
+// aWindowConstraints.gridx = 4;
3208
+// aWindowConstraints.gridwidth = 1;
3209
+// // aConstraints.gridheight = 3;
3210
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3211
+// bigThree.add(XYZPanel, aWindowConstraints);
3212
+// bigThree.validate();
3213
+// scenePanel.setVisible(false);
3214
+// centralPanel.setVisible(true);
3215
+// XYZPanel.setVisible(true);
3216
+ bigThree.ClearUI();
3217
+ bigThree.add(centralPanel);
3218
+ bigThree.add(XYZPanel);
3219
+ bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
26353222 } else
2636
- if (event.getSource() == fourButton)
3223
+ if (source == fourButton)
26373224 {
26383225 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();
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
3229
+
3230
+// bigThree.remove(scenePanel);
3231
+// bigThree.remove(centralPanel);
3232
+// bigThree.remove(XYZPanel);
3233
+// aWindowConstraints.gridx = 0;
3234
+// aWindowConstraints.gridy = 0;
3235
+// aWindowConstraints.gridwidth = 1;
3236
+// // aWindowConstraints.gridheight = 3;
3237
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3238
+// aWindowConstraints.weightx = 1;
3239
+// aWindowConstraints.weighty = 1;
3240
+// bigThree.add(scenePanel, aWindowConstraints);
3241
+// aWindowConstraints.weightx = 1;
3242
+// aWindowConstraints.gridwidth = 3;
3243
+// // aConstraints.gridheight = 3;
3244
+// aWindowConstraints.gridx = 1;
3245
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3246
+// //bigThree.add(cameraPanel, aWindowConstraints);
3247
+// aWindowConstraints.weightx = 0;
3248
+// aWindowConstraints.gridx = 4;
3249
+// aWindowConstraints.gridwidth = 1;
3250
+// // aWindowConstraints.gridheight = 3;
3251
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3252
+// //bigThree.add(XYZPanel, aWindowConstraints);
3253
+// bigThree.validate();
3254
+// scenePanel.setVisible(true);
3255
+// centralPanel.setVisible(false);
3256
+// XYZPanel.setVisible(false);
3257
+ bigThree.ClearUI();
3258
+ bigThree.add(scenePanel);
3259
+ bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
26633262 } else
2664
- if (event.getSource() == sixButton)
3263
+ if (source == sixButton)
26653264 {
26663265 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();
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
3269
+
3270
+// bigThree.remove(scenePanel);
3271
+// bigThree.remove(centralPanel);
3272
+// bigThree.remove(XYZPanel);
3273
+// aWindowConstraints.gridx = 0;
3274
+// aWindowConstraints.gridy = 0;
3275
+// aWindowConstraints.gridwidth = 1;
3276
+// // aConstraints.gridheight = 3;
3277
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3278
+// aWindowConstraints.weightx = 0;
3279
+// aWindowConstraints.weighty = 1;
3280
+// bigThree.add(scenePanel, aWindowConstraints);
3281
+// aWindowConstraints.weightx = 1;
3282
+// aWindowConstraints.gridwidth = 3;
3283
+// // aWindowConstraints.gridheight = 3;
3284
+// aWindowConstraints.gridx = 1;
3285
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3286
+// bigThree.add(centralPanel, aWindowConstraints);
3287
+// aWindowConstraints.weightx = 0;
3288
+// aWindowConstraints.gridx = 4;
3289
+// aWindowConstraints.gridwidth = 1;
3290
+// // aWindowConstraints.gridheight = 3;
3291
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3292
+// //bigThree.add(XYZPanel, aConstraints);
3293
+// bigThree.validate();
3294
+// scenePanel.setVisible(true);
3295
+// centralPanel.setVisible(true);
3296
+// XYZPanel.setVisible(false);
3297
+ bigThree.ClearUI();
3298
+ bigThree.add(scenePanel);
3299
+ bigThree.add(centralPanel);
3300
+ bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
26913303 } else
2692
- if (event.getSource() == sevenButton)
3304
+ if (source == sevenButton)
26933305 {
26943306 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();
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
3310
+
3311
+// bigThree.remove(scenePanel);
3312
+// bigThree.remove(centralPanel);
3313
+// bigThree.remove(XYZPanel);
3314
+// aWindowConstraints.gridx = 0;
3315
+// aWindowConstraints.gridy = 0;
3316
+// aWindowConstraints.gridwidth = 1;
3317
+// // aWindowConstraints.gridheight = 3;
3318
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3319
+// aWindowConstraints.weightx = 0;
3320
+// aWindowConstraints.weighty = 1;
3321
+// bigThree.add(scenePanel, aWindowConstraints);
3322
+// aWindowConstraints.weightx = 1;
3323
+// aWindowConstraints.gridwidth = 3;
3324
+// // aWindowConstraints.gridheight = 3;
3325
+// aWindowConstraints.gridx = 1;
3326
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3327
+// bigThree.add(centralPanel, aWindowConstraints);
3328
+// aWindowConstraints.weightx = 0;
3329
+// aWindowConstraints.gridx = 4;
3330
+// aWindowConstraints.gridwidth = 1;
3331
+// // aConstraints.gridheight = 3;
3332
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3333
+// bigThree.add(XYZPanel, aWindowConstraints);
3334
+// bigThree.validate();
3335
+// scenePanel.setVisible(true);
3336
+// centralPanel.setVisible(true);
3337
+// XYZPanel.setVisible(true);
3338
+ bigThree.ClearUI();
3339
+ bigThree.add(scenePanel);
3340
+ bigThree.add(centralPanel);
3341
+ bigThree.add(XYZPanel);
3342
+ bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
27193345 } else
2720
- if (event.getSource() == rootButton)
3346
+ if (source == rootButton)
27213347 {
27223348 Object3D obj;
27233349 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3353,84 @@
27273353 EditObject(obj);
27283354 }
27293355
3356
+ cameraView.requestFocusInWindow();
27303357 refreshContents(true);
27313358 } else
2732
- if (event.getSource() == closeButton)
3359
+ if (source == closeButton)
27333360 {
27343361 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353362 cRadio ab;
27363363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373364 {
27383365 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
27413374 buttonGroup.remove(ab);
27423375 radioPanel.remove(ab);
27433376
2744
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
27453379 // ab.GetObject().objectUI = null; // ?????????
27463380
27473381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483382 break;
27493383 }
27503384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
27513387 refreshContents(true);
27523388 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3389
+ if (source == editItem || source == editButton)
27543390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
27553397 EditSelection(false);
27563398 } else
2757
- if (event.getSource() == uneditButton)
3399
+ if (source == uneditButton)
27583400 {
27593401 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603402 {
27613403 Object3D child = (Object3D)e.nextElement();
27623404 if(child.editWindow != null)
27633405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
27643407 child.CloseUI();
27653408 listUI.remove(child);
27663409
2767
- child.editWindow = null; // ???????????
3410
+ //child.editWindow = null; // ???????????
27683411 }
2769
- objEditor.ctrlPanel.revalidate();
3412
+ objEditor.ctrlPanel.FlushUI();
27703413 //objEditor.jTree.clearSelection();
27713414 //objEditor.ResetSliders();
27723415 refreshContents(true);
27733416 } else
2774
- if (event.getSource() == clearPanelButton)
3417
+ if (source == clearPanelButton)
27753418 {
27763419 assert(copy == group);
27773420 //copy.ClearUI();
27783421 for (Object3D obj : listUI)
27793422 {
3423
+ obj.pinned = false;
27803424 obj.CloseUI();
27813425 }
27823426 listUI.clear();
27833427 refreshContents(true);
27843428 } else
2785
- if (event.getSource() == allParamsButton)
3429
+ if (source == allParamsButton)
27863430 {
27873431 assert(copy == group);
27883432
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903434
27913435 for (Object3D obj : listUI)
27923436 {
....@@ -2803,19 +3447,19 @@
28033447
28043448 refreshContents(true);
28053449 } else
2806
- if (event.getSource() == unselectButton)
3450
+ if (source == unselectButton)
28073451 {
28083452 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3453
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103454 objEditor.ResetSliders();
28113455 refreshContents(true);
28123456 } else
2813
- if(event.getSource() instanceof cRadio)
3457
+ if(source instanceof cRadio)
28143458 {
28153459 group.parent = keepparent;
28163460 group.attributes = 0;
28173461 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3462
+ /*cRadio*/ radio = (cRadio)source;
28193463 Object3D obj = radio.GetObject();
28203464 System.out.println("Edit " + obj);
28213465 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3479,7 @@
28353479 }
28363480
28373481 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3482
+ //Globals.theRenderer.object = group;
28393483 if(!useclient)
28403484 {
28413485 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3488,50 @@
28443488 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453489 cameraView.targetLookAt.set(radio.camera.lookAt);
28463490 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3491
+ //cameraView.lighttouched = true;
3492
+ Globals.lighttouched = true;
28483493 topView.object = group;
28493494 frontView.object = group;
28503495 sideView.object = group;
28513496 }
2852
- group.editWindow = this;
3497
+
3498
+// fix "+" issue
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
3501
+
28533502 /*
28543503 currentLayout = radio.layout;
28553504 if (currentLayout == null)
28563505 currentLayout = sevenButton;
28573506 */
28583507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
28593513 keepparent = group.parent;
28603514 // PARENT = NULL or not???
28613515 //group.parent = null; // ROOT
28623516 //group.attributes = -1;
28633517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
28643520 refreshContents(true);
2865
- }
3521
+ } else if (event.getSource() == editCameraItem)
3522
+ {
3523
+ cameraView.ProtectCamera();
3524
+ cameraView.repaint();
3525
+ return;
3526
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3527
+ {
3528
+ cameraView.RevertCamera();
3529
+ cameraView.repaint();
3530
+ return;
3531
+ // } else if (event.getSource() == textureButton)
3532
+ // {
3533
+ // return; // true;
3534
+ }
28663535 else
28673536 {
28683537 //return super.action(event, arg);
....@@ -2871,7 +3540,6 @@
28713540 }
28723541
28733542 boolean useclient = false;
2874
- cRadio radio;
28753543
28763544 void ToggleRoot()
28773545 {
....@@ -2880,7 +3548,7 @@
28803548 if (useclient)
28813549 {
28823550 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3551
+ Globals.lighttouched = true;
28843552 //topView.object = client;
28853553 //frontView.object = client;
28863554 //sideView.object = client;
....@@ -2888,7 +3556,7 @@
28883556 else
28893557 {
28903558 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3559
+ Globals.lighttouched = true;
28923560 //topView.object = group;
28933561 //frontView.object = group;
28943562 //sideView.object = group;
....@@ -2923,6 +3591,28 @@
29233591 refreshContents();
29243592 }
29253593
3594
+ void TransformChildren()
3595
+ {
3596
+ Object3D obj;
3597
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3598
+ {
3599
+ obj = (Object3D)e.nextElement();
3600
+ obj.KeepTextureMatrices();
3601
+ obj.TransformChildren();
3602
+ obj.RestoreTextureMatrices();
3603
+
3604
+// if (obj.parent == null)
3605
+// {
3606
+// System.out.println("NULL PARENT!");
3607
+// new Exception().printStackTrace();
3608
+// }
3609
+// else
3610
+// TouchTransform(obj);
3611
+// //obj.parent.Touch();
3612
+ }
3613
+
3614
+ refreshContents();
3615
+ }
29263616
29273617 void ResetTransform()
29283618 {
....@@ -3035,7 +3725,7 @@
30353725 refreshContents();
30363726 }
30373727
3038
- void ResetCentroid()
3728
+ void ResetCentroid(boolean full)
30393729 {
30403730 Object3D obj;
30413731 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3740,16 @@
30503740 LA.matIdentity(Object3D.mat);
30513741 obj.getBounds(minima, maxima, false);
30523742 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3743
+ if (full)
3744
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543745 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553746 obj.TransformMesh(Object3D.mat);
3747
+
30563748 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3749
+ if (full)
3750
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583751 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3752
+
30593753 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603754 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613755 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3778,8 @@
30843778
30853779 int size = obj.MemorySize();
30863780
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3781
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3782
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883783 }
30893784 }
30903785 catch (Exception e)
....@@ -3121,9 +3816,9 @@
31213816 obj = (Object3D)e.nextElement();
31223817
31233818 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3819
+ Grafreed.AnalyzeObject(obj);
31253820 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3821
+ Grafreed.AnalyzeObject(obj.bRep);
31273822
31283823 // System.err.println((size/1024) + " KB is the size of " + obj);
31293824 }
....@@ -3165,6 +3860,20 @@
31653860 void GenNormals(boolean crease)
31663861 {
31673862 group.GenNormalsS(crease);
3863
+
3864
+ refreshContents();
3865
+ }
3866
+
3867
+ void GenNormalsMESH()
3868
+ {
3869
+ group.GenNormalsMeshS();
3870
+
3871
+ refreshContents();
3872
+ }
3873
+
3874
+ void GenNormalsMINE()
3875
+ {
3876
+ group.selection.GenNormalsMINE();
31683877
31693878 refreshContents();
31703879 }
....@@ -3250,7 +3959,7 @@
32503959 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513960 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523961 //
3253
-// g.add(GraphreeD.clipboard);
3962
+// g.add(GrafreeD.clipboard);
32543963 //
32553964 // buffer.add(g);
32563965 // }
....@@ -3269,8 +3978,8 @@
32693978 // nodes = new Object3D();
32703979 // vertices = new Vector<Vertex>();
32713980 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3981
+// boolean epsequal = GrafreeD.epsequal;
3982
+// GrafreeD.epsequal = true;
32743983 //
32753984 // for (int i=0; i<group.selection.size(); i++)
32763985 // {
....@@ -3311,7 +4020,7 @@
33114020 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124021 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134022 //
3314
-// g.add(GraphreeD.clipboard);
4023
+// g.add(GrafreeD.clipboard);
33154024 //
33164025 // buffer.add(g);
33174026 // }
....@@ -3319,7 +4028,7 @@
33194028 // makeSomething(buffer, i==group.selection.size()-1);
33204029 // }
33214030 //
3322
-// GraphreeD.epsequal = epsequal;
4031
+// GrafreeD.epsequal = epsequal;
33234032 //
33244033 // //buffer = null;
33254034 // temprep = null;
....@@ -3330,8 +4039,8 @@
33304039
33314040 void ParseVertices()
33324041 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4042
+ boolean epsequal = Grafreed.epsequal;
4043
+ Grafreed.epsequal = true;
33354044
33364045 for (int i=0; i<group.selection.size(); i++)
33374046 {
....@@ -3356,7 +4065,7 @@
33564065 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574066 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584067
3359
- g.add(GraphreeD.clipboard);
4068
+ g.add(Grafreed.clipboard);
33604069
33614070 buffer.add(g);
33624071 }
....@@ -3371,7 +4080,7 @@
33714080 makeSomething(buffer, i==group.selection.size()-1);
33724081 }
33734082
3374
- GraphreeD.epsequal = epsequal;
4083
+ Grafreed.epsequal = epsequal;
33754084
33764085 refreshContents();
33774086 }
....@@ -3389,7 +4098,16 @@
33894098 String pigment = Object3D.GetPigment(tex);
33904099 //String bump = Object3D.GetBump(tex);
33914100
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4101
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4102
+
4103
+ try
4104
+ {
4105
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4106
+ }
4107
+ catch (Exception e)
4108
+ {
4109
+ System.err.println("FAIL: " + node);
4110
+ }
33934111
33944112 double s = v.s;
33954113
....@@ -3416,7 +4134,7 @@
34164134 scale /= 3;
34174135
34184136 scale /= 0xFF;
3419
- scale /= 4;
4137
+ // c'est quoi ca? scale /= 4;
34204138
34214139 //v.AO = scale;
34224140
....@@ -3437,12 +4155,26 @@
34374155
34384156 void Align()
34394157 {
4158
+ if (group.selection.size() == 0)
4159
+ return;
4160
+
4161
+ cVector bbmin = new cVector();
4162
+ cVector bbmax = new cVector();
4163
+
4164
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4165
+
4166
+ double dx = bbmax.x - bbmin.x;
4167
+ double dy = bbmax.y - bbmin.y;
4168
+ double dz = bbmax.z - bbmin.z;
4169
+
4170
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4171
+
34404172 for (int i=0; i<group.selection.size(); i++)
34414173 {
34424174 Object3D obj = group.selection.get(i);
34434175
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4176
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4177
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464178 }
34474179
34484180 refreshContents();
....@@ -3455,7 +4187,7 @@
34554187 // ref.SaveSupports();
34564188 // Object3D par = ref.parent;
34574189 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4190
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594191 // ref.parent = par;
34604192 // ref.RestoreSupports();
34614193
....@@ -3463,11 +4195,11 @@
34634195
34644196 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654197
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4198
+ boolean random = CameraPane.SWITCH;
4199
+ CameraPane.SWITCH = false; // parse all random nodes
34684200 lowres.linkVerticesThis(null);
34694201 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4202
+ CameraPane.SWITCH = random;
34714203
34724204 System.err.flush();
34734205
....@@ -3485,7 +4217,7 @@
34854217 // lowres.SaveSupports();
34864218 // par = lowres.parent;
34874219 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4220
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894221 Object3D newlow = CloneObject(lowres, false);
34904222 newlow.name = sn.switchobject.get(i).name;
34914223 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4239,7 @@
35074239 return;
35084240
35094241 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4242
+ Object3D ref = Grafreed.clipboard.get(0);
35114243
35124244 Object3D newgroup = new Object3D("Po:" + poses.name);
35134245
....@@ -3676,7 +4408,7 @@
36764408 group.selection.RelinkToSupport(); // july 2014
36774409 System.out.println("DONE.");
36784410 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4411
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804412 }
36814413
36824414 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4433,20 @@
37014433
37024434 void ClipMesh()
37034435 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4436
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054437 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4438
+ Object3D content = Grafreed.clipboard.get(0);
37074439
37084440 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094441 content = ((cGroup)content).get(0);
37104442
37114443 // for (int i=0; i<group.selection.size(); i++)
37124444 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4445
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144446 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4447
+ group.selection.ClipMesh(Grafreed.clipboard);
37164448 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4449
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184450 System.out.println("DONE.");
37194451 refreshContents();
37204452 }
....@@ -3759,6 +4491,18 @@
37594491 void MarkLeaves(boolean hide)
37604492 {
37614493 group.selection.MarkLeaves(hide);
4494
+ refreshContents();
4495
+ }
4496
+
4497
+ void RewindLeaves(boolean hide)
4498
+ {
4499
+ group.selection.RewindLeaves(hide);
4500
+ refreshContents();
4501
+ }
4502
+
4503
+ void RandomLeaves(boolean hide)
4504
+ {
4505
+ group.selection.RandomLeaves(hide);
37624506 refreshContents();
37634507 }
37644508
....@@ -3833,10 +4577,6 @@
38334577 // }
38344578 // }
38354579
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38404580 void EditSelection(boolean newWindow)
38414581 {
38424582 // aConstraints.gridy = 0;
....@@ -3844,10 +4584,10 @@
38444584 {
38454585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484588
38494589 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4590
+ if(elem != group || !newWindow)
38514591 {
38524592 // if (!(elem instanceof Composite))
38534593 // newWindow = false;
....@@ -3929,7 +4669,8 @@
39294669 //new Exception().printStackTrace();
39304670
39314671 freezemodel = true;
3932
-
4672
+ ClearUnpinned();
4673
+
39334674 /**/
39344675 //switch (event.id)
39354676 {
....@@ -3937,7 +4678,6 @@
39374678 //case 702: // Event.LIST_DESELECT
39384679 group.deselectAll();
39394680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414681 if (tps != null)
39424682 {
39434683 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +4686,39 @@
39464686
39474687 //if (child.parent != null)
39484688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
39494690 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534691 }
39544692 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4693
+// else
4694
+// {
4695
+// objEditor.SetMaterial(group); // .GetMaterial());
4696
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4697
+// System.err.println("info : " + group.GetPath());
4698
+// }
39614699
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4700
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654701 CameraPane.flash = true;
39664702
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4703
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684704 // a camera
39694705 {
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;
4706
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4707
+ {
4708
+ CameraPane.camerachangeframe = 0; // don't refuse it
4709
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4710
+ }
4711
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4712
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744713 }
39754714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
39764722 refreshContents();
39774723 //return true;
39784724 }
....@@ -3981,6 +4727,35 @@
39814727
39824728 freezemodel = false;
39834729 }
4730
+
4731
+ void SetPinStates(boolean enabled)
4732
+ {
4733
+ editButton.setEnabled(enabled);
4734
+ uneditButton.setEnabled(enabled);
4735
+ unselectButton.setEnabled(enabled);
4736
+ flashSelectionButton.setEnabled(enabled);
4737
+ }
4738
+
4739
+ void refreshContents(boolean cp)
4740
+ {
4741
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4742
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4743
+ {
4744
+ objEditor.ClearInfo(); // .GetMaterial());
4745
+
4746
+ for (int i=0; i < group.selection.Size(); i++)
4747
+ {
4748
+ Object3D child = (Object3D) group.selection.get(i);
4749
+
4750
+ objEditor.AddInfo(child, this, true);
4751
+ System.err.println("info : " + child.GetPath());
4752
+ }
4753
+
4754
+ objEditor.SetText(); // jan 2014
4755
+ }
4756
+
4757
+ super.refreshContents(cp);
4758
+ }
39844759
39854760 void linkSomething(Object3D thing)
39864761 {
....@@ -4052,16 +4827,19 @@
40524827 {
40534828 if (group.selection.isEmpty())
40544829 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4830
+
4831
+ Grafreed.clipboardIsTempGroup = false;
40564832 Composite tGroup = null;
40574833 if (group.selection.size() > 0) // 1)
40584834 {
40594835 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4836
+ Grafreed.clipboardIsTempGroup = true;
40614837 }
40624838
40634839 if (cut)
40644840 {
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
40654843 //int indices[] = jList.getSelectedIndices();
40664844 //for (int i = indices.length - 1; i >= 0; i--)
40674845 //jList.remove(indices[i]);
....@@ -4097,16 +4875,16 @@
40974875 //System.out.println("cut " + child);
40984876 //System.out.println("parent = " + child.parent);
40994877 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4878
+ if (Grafreed.clipboardIsTempGroup)
41014879 tGroup.add/*Child*/(tmp);
41024880 else
4103
- GraphreeD.clipboard = tmp;
4881
+ Grafreed.clipboard = tmp;
41044882 }
41054883 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4884
+ if (Grafreed.clipboardIsTempGroup)
41074885 tGroup.add/*Child*/(child);
41084886 else
4109
- GraphreeD.clipboard = child;
4887
+ Grafreed.clipboard = child;
41104888 }
41114889
41124890 //ResetModel();
....@@ -4138,21 +4916,23 @@
41384916 //System.out.println("cut " + elem);
41394917 //System.out.println("parent = " + elem.parent);
41404918 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4919
+ if (Grafreed.clipboardIsTempGroup)
41424920 tGroup.add/*Child*/(tmp);
41434921 else
4144
- GraphreeD.clipboard = tmp;
4922
+ Grafreed.clipboard = tmp;
41454923 }
41464924 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4925
+ if (Grafreed.clipboardIsTempGroup)
41484926 tGroup.add/*Child*/(child);
41494927 else
4150
- GraphreeD.clipboard = child;
4928
+ Grafreed.clipboard = child;
41514929 }
41524930
41534931 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4932
+
4933
+ if (Grafreed.clipboardIsTempGroup)
4934
+ Grafreed.clipboard = tGroup;
4935
+
41564936 if (cut)
41574937 {
41584938 ResetModel();
....@@ -4162,11 +4942,15 @@
41624942
41634943 void paste(boolean expand)
41644944 {
4165
- // if (GraphreeD.clipboard == null)
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
4949
+ // if (GrafreeD.clipboard == null)
41664950 // return;
41674951 boolean first = true;
41684952
4169
- if (GraphreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
41704954 {
41714955 Composite temp;
41724956
....@@ -4177,7 +4961,7 @@
41774961 temp = (Composite)Applet3D.clipboard.deepCopy();
41784962 */
41794963 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4964
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814965 {
41824966 Object3D child = (Object3D)e.nextElement();
41834967
....@@ -4191,7 +4975,7 @@
41914975 else
41924976 elem = child.deepCopy(); // ?
41934977 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4978
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954979 // elem = elem.get(0);
41964980 makeSomething(elem, true); // ?? first);
41974981 //group.addChild(elem);
....@@ -4211,23 +4995,24 @@
42114995 //Object3D cb = Applet3D.clipboard;
42124996 //temp.addChild(cb);
42134997 //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());
4998
+ assert(Grafreed.clipboard.parent == null);
4999
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5000
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5001
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5002
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42195003 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5004
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5005
+ Grafreed.clipboard.get(0).parent = keepparent;
42225006 }
42235007
5008
+ Globals.SAVEONMAKE = keep;
42245009 ResetModel();
42255010 refreshContents();
42265011 }
42275012
4228
- void pasteInto(boolean copyit)
5013
+ void pasteInto(boolean copyit, boolean clone)
42295014 {
4230
-// if (GraphreeD.clipboard == null)
5015
+// if (GrafreeD.clipboard == null)
42315016 // return;
42325017
42335018 if (group.selection.size() != 1)
....@@ -4254,15 +5039,22 @@
42545039 if (copyit)
42555040 {
42565041 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5042
+ if (clone)
5043
+ {
5044
+ CloneClipboard(false); // sept 2014
5045
+ }
5046
+ else
5047
+ {
5048
+ paste(false);
5049
+ }
42585050 }
42595051 else
42605052 {
42615053 boolean first = true;
42625054
4263
- if (GraphreeD.clipboardIsTempGroup)
5055
+ if (Grafreed.clipboardIsTempGroup)
42645056 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5057
+ Composite temp = (Composite)Grafreed.clipboard;
42665058 Object3D copy;
42675059 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685060 {
....@@ -4272,7 +5064,7 @@
42725064 }
42735065 } else
42745066 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5067
+ linkSomething(Grafreed.clipboard); //.get(0));
42765068 }
42775069 }
42785070 }
....@@ -4349,6 +5141,10 @@
43495141
43505142 void group(Object3D csg, boolean grab)
43515143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
43525148 if (//false) // why??
43535149 !group.selection.isEmpty())
43545150 {
....@@ -4462,8 +5258,34 @@
44625258 //node.add(csg);
44635259 //makeSomething(node);
44645260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
44655262 }
44665263
5264
+ void Ungroup(Object3D g)
5265
+ {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
5270
+ if (g instanceof HiddenObject)
5271
+ {
5272
+ HiddenObject h = (HiddenObject) g;
5273
+
5274
+ for (int i=0; i<h.ActualSize(); i++)
5275
+ {
5276
+ objEditor.makeSomething(h.get(i), false);
5277
+ }
5278
+ }
5279
+ else
5280
+ {
5281
+ for (int i=0; i<g.Size(); i++)
5282
+ {
5283
+ objEditor.makeSomething(g.get(i), false);
5284
+ }
5285
+ }
5286
+ Globals.SAVEONMAKE = keep;
5287
+ }
5288
+
44675289 void ungroup()
44685290 {
44695291 /*
....@@ -4657,21 +5479,6 @@
46575479 }
46585480 */
46595481
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
-
46755482 /*
46765483 public void Callback(Object obj)
46775484 {
....@@ -4695,26 +5502,9 @@
46955502 }
46965503 */
46975504
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
-
47155505 String GetFile(String dialogName)
47165506 {
4717
- if (GraphreeD.standAlone)
5507
+ if (Grafreed.standAlone)
47185508 {
47195509 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205510 browser.show();
....@@ -4778,10 +5568,33 @@
47785568 cButton flashSelectionButton;
47795569 cButton editButton;
47805570 cButton uneditButton;
5571
+ JCheckBox allParamsButton;
47815572 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835573 cButton unselectButton;
47845574
5575
+ cButton restoreCameraButton;
5576
+
5577
+ cButton saveButton;
5578
+ cButton oneStepButton;
5579
+
5580
+ cButton groupButton;
5581
+ cButton ungroupButton;
5582
+ cButton compositeButton;
5583
+ cButton switchButton;
5584
+ cButton loopButton;
5585
+ cButton textureButton;
5586
+
5587
+ cButton gridButton;
5588
+ cButton boxButton;
5589
+ cButton sphereButton;
5590
+ cButton coneButton;
5591
+ cButton torusButton;
5592
+ cButton superButton;
5593
+ cButton kleinButton;
5594
+ cButton particlesButton;
5595
+ cButton overlayButton;
5596
+ cButton lightButton;
5597
+
47855598 cButton screenfitButton;
47865599 cButton screenfitpointButton;
47875600 cButton snapobjectButton;
....@@ -4793,14 +5606,6 @@
47935606
47945607 cButton setsupportButton;
47955608
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
-
48045609 //
48055610 //Composite
48065611 Object3D // to do !!
....@@ -4810,9 +5615,11 @@
48105615 //JTree jTree;
48115616 private MenuItem lookAtItem;
48125617 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
48145619 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5620
+ private MenuItem undoItem;
5621
+ private MenuItem redoItem;
5622
+ private JMenuItem duplicateItem;
48165623 private MenuItem cloneItem;
48175624 private MenuItem cloneSupportItem;
48185625 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5630,9 @@
48235630 private MenuItem resetsupportItem;
48245631 private MenuItem resetreferencesItem;
48255632 private MenuItem linkverticesItem;
5633
+ private MenuItem relinkverticesItem;
48265634 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5635
+ private MenuItem resetAllItem;
48285636 private MenuItem stepAllItem;
48295637 private MenuItem revertMeshItem;
48305638 private MenuItem poseMeshItem;
....@@ -4835,14 +5643,17 @@
48355643 private MenuItem mergeGeometriesItem;
48365644 private MenuItem copyItem;
48375645 private MenuItem pasteItem;
5646
+ private MenuItem pasteIntoItem;
48385647 private MenuItem pasteLinkItem;
48395648 private MenuItem pasteCloneItem;
48405649 private MenuItem pasteExpandItem;
48415650 private MenuItem clearItem;
48425651 private MenuItem clearAllItem;
48435652 private MenuItem genUVItem;
5653
+ private MenuItem genNormalsMESHItem;
48445654 private MenuItem genNormalsCADItem;
48455655 private MenuItem genNormalsORGANItem;
5656
+ private MenuItem genNormalsMINEItem;
48465657 private MenuItem stripifyItem;
48475658 private MenuItem unstripifyItem;
48485659 private MenuItem trimItem;
....@@ -4871,6 +5682,10 @@
48715682 private MenuItem showleavesItem;
48725683 private MenuItem markleavesItem;
48735684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
48745689
48755690 private MenuItem flipVItem;
48765691 private MenuItem unflipVItem;
....@@ -4882,14 +5697,17 @@
48825697 private MenuItem panoTexturesItem;
48835698
48845699 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5700
+ private MenuItem resetCentroidXZItem;
48865701 private MenuItem resetTransformItem;
5702
+ private MenuItem transformGeometryItem;
5703
+ private MenuItem transformChildrenItem;
5704
+ private MenuItem hideItem;
48875705 private MenuItem grabItem;
48885706 private MenuItem backItem;
48895707 private MenuItem frontItem;
48905708 private MenuItem cameraItem;
48915709 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
48935711 private MenuItem physicsItem;
48945712 private MenuItem frameselectorItem;
48955713 private MenuItem scriptNodeItem;
....@@ -4904,6 +5722,7 @@
49045722
49055723 private MenuItem resetParentItem;
49065724 private MenuItem repairParentItem;
5725
+ private MenuItem repairShadowItem;
49075726 private MenuItem sortbysizeItem;
49085727 private MenuItem sortbynameItem;
49095728
....@@ -4924,10 +5743,11 @@
49245743 private MenuItem coneItem;
49255744 private MenuItem torusItem;
49265745 private MenuItem superItem;
5746
+ private MenuItem kleinItem;
49275747 private MenuItem blobItem;
49285748 private MenuItem latheItem;
49295749 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5750
+ private MenuItem overlayItem;
49315751 private MenuItem meshItem;
49325752 // private MenuItem meshGroupItem;
49335753 private MenuItem springItem;
....@@ -4936,6 +5756,7 @@
49365756 private MenuItem csgItem;
49375757 private MenuItem templateItem;
49385758 private MenuItem textureItem;
5759
+ private MenuItem billboardItem;
49395760 private MenuItem shadowXItem;
49405761 private MenuItem shadowYItem;
49415762 private MenuItem shadowZItem;
....@@ -4948,11 +5769,6 @@
49485769 private MenuItem doubleItem;
49495770 private MenuItem tripleItem;
49505771
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565772 private MenuItem computeAOItem;
49575773 private MenuItem recompileItem;
49585774 private MenuItem editScriptItem;
....@@ -4962,4 +5778,8 @@
49625778 private MenuItem analyzeItem;
49635779 private MenuItem dumpItem;
49645780 //boolean freezemodel = false;
5781
+
5782
+ Menu cameraMenu;
5783
+ MenuItem editCameraItem;
5784
+ MenuItem restoreCameraItem;
49655785 }