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,6 +84,10 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
87
+ if (Globals.SAVEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.SAVEONMAKE;
90
+ Globals.SAVEONMAKE = false;
8691 // Object3D keep = GrafreeD.clipboard;
8792 //Object3D obj;
8893 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -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(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
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(GrafreeD.clipboard, false));
107
- GrafreeD.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)GrafreeD.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,79 +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);
222326 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223327 relinkverticesItem.addActionListener(this);
328
+
329
+ if (Globals.ADVANCED)
330
+ {
224331 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225332 setMasterItem.addActionListener(this);
333
+ }
226334
227335 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
230338 backItem = menu.add(new MenuItem("Back"));
231339 backItem.addActionListener(this);
232340 frontItem = menu.add(new MenuItem("Front"));
233341 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
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"));
237348 hideItem.addActionListener(this);
349
+ }
238350 ungroupItem = menu.add(new MenuItem("Ungroup"));
239351 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
352
+
353
+// menu.add("-");
354
+//
355
+// switchItem = menu.add(new MenuItem("Switch node"));
356
+// switchItem.addActionListener(this);
357
+ if (Globals.ADVANCED)
358
+ {
247359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248360 switchGeoItem.addActionListener(this);
249361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250362 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
363
+ morphItem = menu.add(new MenuItem("Morph Group"));
252364 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);
253371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254372 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
373
+ }
257374
258375 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
261378 billboardItem = menu.add(new MenuItem("Billboard"));
262379 billboardItem.addActionListener(this);
263380 csgItem = menu.add(new MenuItem("CSG"));
264381 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266383 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268385 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
391
+ if (Globals.ADVANCED)
392
+ {
393
+ menu.add("-");
271394 linkerItem = menu.add(new MenuItem("Linker"));
272395 linkerItem.addActionListener(this);
273396 templateItem = menu.add(new MenuItem("Template"));
274397 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277398 pointflowItem = menu.add(new MenuItem("Point Flow"));
278399 pointflowItem.addActionListener(this);
400
+ }
279401 menu.add("-");
280402 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281403 resetTransformItem.addActionListener(this);
282404 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283405 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.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);
286412
287413 oe.menuBar.add(menu = new Menu("Geometry"));
288414 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +419,11 @@
293419 genNormalsCADItem.addActionListener(this);
294420 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295421 genNormalsMESHItem.addActionListener(this);
422
+ if (Globals.ADVANCED)
423
+ {
296424 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297425 genNormalsMINEItem.addActionListener(this);
426
+ }
298427 stripifyItem = menu.add(new MenuItem("Stripify"));
299428 stripifyItem.addActionListener(this);
300429 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +445,34 @@
316445 reduce34MeshItem.addActionListener(this);
317446 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318447 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321448 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322449 clipMeshItem.addActionListener(this);
450
+
451
+ if (Globals.ADVANCED)
452
+ {
453
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
454
+ smoothMeshItem.addActionListener(this);
455
+ }
323456
324457 oe.menuBar.add(menu = new Menu("Attributes"));
325458 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326459 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);
327464 menu.add("-");
328465 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329466 liveleavesItem.addActionListener(this);
330467 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331468 unliveleavesItem.addActionListener(this);
469
+ if (Globals.ADVANCED)
470
+ {
332471 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333472 supportleavesItem.addActionListener(this);
334473 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335474 unsupportleavesItem.addActionListener(this);
475
+ }
336476 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337477 hideleavesItem.addActionListener(this);
338478 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +481,14 @@
341481 markleavesItem.addActionListener(this);
342482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343483 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);
344492 menu.add("-");
345493 flipVItem = menu.add(new MenuItem("Flip V"));
346494 flipVItem.addActionListener(this);
....@@ -376,35 +524,40 @@
376524 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377525 sortbynameItem.addActionListener(this);
378526 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.
379534 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380535 extractGeometriesItem.addActionListener(this);
381536 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382537 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
538
+ }
387539
388540 oe.menuBar.add(menu = new Menu("Insert"));
389541 buildCreateMenu(menu);
390542
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402543 oe.menuBar.add(menu = new Menu("Tools"));
403544 buildToolsMenu(menu);
404545 }
405546
406547 void SetupUI2(ObjEditor oe)
407548 {
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
+
408561 //new Exception().printStackTrace();
409562
410563 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +586,217 @@
433586 oe.radioPanel.add(dummyButton);
434587 oe.buttonGroup.add(dummyButton);
435588 */
436
- aConstraints.gridy += 1;
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
437592
438593 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439594
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
595
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ //minButton.setToolTipText("Minimize window");
597
+ //minButton.addActionListener(this);
442598
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
445
- liveCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
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);
454611 screenfitButton.setToolTipText("Screen fit");
455612 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
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");
634
+ liveCB.addItemListener(this);
635
+
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");
642
+ fastCB.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);
649
+
457650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458651 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464652
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- flashSelectionButton.addActionListener(this);
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));
473661
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482663 twoButton.setToolTipText("Show center view only");
483664 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
665
+ this.fullscreenLayout = twoButton;
666
+
667
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485668 fourButton.addActionListener(this);
486669 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488671 sixButton.setToolTipText("2-column layout left");
489672 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
673
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491674 threeButton.setToolTipText("2-column layout right");
492675 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494677 sevenButton.setToolTipText("3-column layout");
495678 sevenButton.addActionListener(this);
496679 //
497680
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
681
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ rootButton.setToolTipText("Edit selection in new tab");
500683 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
684
+
685
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503686 closeButton.setToolTipText("Close tab");
504687 closeButton.addActionListener(this);
505688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506689 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515690
516
- 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");
517776 uneditButton.addActionListener(this);
518777
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- 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");
531780 allParamsButton.addActionListener(this);
532781
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- 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");
538788 unselectButton.addActionListener(this);
539789
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
+
540800 // oe.aConstraints.gridx += 1;
541801 // oe.aConstraints.weighty = 0;
542802 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +808,22 @@
548808 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549809 // gcButton.addActionListener(this);
550810
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
811
+ cGridBag jSPPanel = new cGridBag();
812
+
813
+ JScrollPane jSP;
562814 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564816 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
584817
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
+
585827 //jList.addListSelectionListener(this);
586828 oe.jTree.addTreeSelectionListener(this);
587829 //jTree.setRootVisible(false);
....@@ -604,83 +846,143 @@
604846 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605847 }
606848
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
849
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608850 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
851
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
852
+ colorCB.setToolTipText("Copy color when dropped");
853
+ colorCB.addItemListener(this);
618854
619
- // constraints.gridy += 1;
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
+
620883 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621884 // localCB.addItemListener(this);
622885
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
886
+ panel.Return();
887
+
888
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625889 crowdCB.setToolTipText("Used for crowds");
626890 crowdCB.addItemListener(this);
627891
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
892
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630893 smoothCB.setToolTipText("Snapping delay");
631894 smoothCB.addItemListener(this);
632895
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
896
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635897 slowCB.setToolTipText("Smooth interpolation");
636898 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
639
- boxCB.setToolTipText("Display bounding boxes");
640
- boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
- zoomBoxCB.addItemListener(this);
645
-
899
+
646900 // constraints.gridy += 1;
647901 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648902 // speakerMocapCB.addItemListener(this);
649903
904
+ panel.Return();
905
+
650906 if (false)
651907 {
652908 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
909
+ //constraints.gridy += 1;
910
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655911 speakerCameraCB.addItemListener(this);
656912
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
913
+ //constraints.gridy += 1;
914
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659915 speakerFocusCB.addItemListener(this);
660916
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
917
+ //constraints.gridy += 1;
918
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663919 smoothfocusCB.addItemListener(this);
920
+ panel.Return();
664921 }
665922
666923 //constraints.gridx += 1;
667924 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668925 // debugCB.addItemListener(this);
669926
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
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");
672933 oeilCB.addItemListener(this);
673934
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
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);
676956 lookAtCB.setToolTipText("Look-at target");
677957 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);
678972
679973 }
680974
681975 void EditObject(Object3D obj)
682976 {
683977 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
+
684986 radioButton.SetObject(obj);
685987 radioButton.layout = sevenButton;
686988 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +991,11 @@
689991 buttonGroup.add(radioButton);
690992 radioButton.doClick();
691993 }
994
+
692995 void SetupViews(ObjEditor oe)
693996 {
997
+ theFrame = this;
998
+
694999 oe.SetupViews();
6951000
6961001 System.out.println("SetupViews");
....@@ -699,23 +1004,28 @@
6991004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7001005 }
7011006
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- 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;
7131020 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1021
+ cCheckBox speakerCameraCB;
1022
+ cCheckBox speakerFocusCB;
1023
+ cCheckBox debugCB;
1024
+
1025
+ cCheckBox oeilCB;
1026
+ cCheckBox shadowCB;
1027
+ cCheckBox autosaveCB;
1028
+ cCheckBox lookAtCB;
7191029
7201030 // static int COLOR = 1;
7211031 // static int MATERIAL = 2;
....@@ -723,9 +1033,9 @@
7231033
7241034 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251035
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1036
+ cCheckBox colorCB;
1037
+ cCheckBox materialCB;
1038
+ cCheckBox textureCB;
7291039
7301040 public void itemStateChanged(ItemEvent e)
7311041 {
....@@ -753,6 +1063,7 @@
7531063 } else if(e.getSource() == liveCB)
7541064 {
7551065 cameraView.ToggleLive();
1066
+ refreshContents(false);
7561067 }
7571068 else if(e.getSource() == supportCB)
7581069 {
....@@ -817,6 +1128,18 @@
8171128 {
8181129 cameraView.ToggleOeil();
8191130 }
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
+ }
8201143 else if(e.getSource() == lookAtCB)
8211144 {
8221145 cameraView.ToggleLookAt();
....@@ -833,7 +1156,8 @@
8331156
8341157 /**/
8351158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
8371161 if ((path == null) || (path.getPathCount() <= 1)) {
8381162 // We can't move the root node or an empty selection
8391163 return;
....@@ -896,8 +1220,6 @@
8961220 }
8971221 }
8981222
899
- String string = (String) object;
900
-
9011223 System.out.println("Transfer = " + object + "; drop : " + target);
9021224 // if( object instanceof java.io.File[])
9031225 // {
....@@ -905,7 +1227,11 @@
9051227 // objEditor.DropFile((java.io.File[]) object, true);
9061228 // return;
9071229 // }
908
- 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) == ':')
9091235 {
9101236 // file(s)
9111237 String[] names = string.split("\n");
....@@ -932,7 +1258,7 @@
9321258
9331259 flashIt = false;
9341260 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1261
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361262 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371263
9381264 if (group.selection.size() == 1)
....@@ -948,23 +1274,33 @@
9481274
9491275 assert target == objEditor.jTree;
9501276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
9511278 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531280 } catch (Exception e) {
9541281 System.out.println("destinationPath : " + destinationPath);
9551282 return;
9561283 }
9571284
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
9591286 {
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
+// {
9601296 loadClipboard(true);
9611297 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1298
+ pasteInto(false, false);
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
9681304 }
9691305 public void dropActionChanged(DropTargetDragEvent dtde)
9701306 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1405,107 @@
10691405 {
10701406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711407 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.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
+ {
10841426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851427 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
1432
+ if (Globals.ADVANCED)
1433
+ {
10881434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891435 ragdollItem.addActionListener(this);
10901436 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911437 ragdoll2Item.addActionListener(this);
1438
+ }
10921439 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1440
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941441 meshItem.addActionListener(this);
10951442 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961443 // meshGroupItem.addActionListener(this);
1444
+ if (Globals.ADVANCED)
1445
+ {
10971446 springItem = menu.add(new MenuItem("Spring"));
10981447 springItem.addActionListener(this);
10991448 flagItem = menu.add(new MenuItem("Flag"));
11001449 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051450 blobItem = menu.add(new MenuItem("Blob"));
11061451 blobItem.addActionListener(this);
11071452 latheItem = menu.add(new MenuItem("Lathe"));
11081453 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- 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);
11111461 menu.add("-");
11121462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131463 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
11161466 doubleItem = menu.add(new MenuItem("Fork"));
11171467 doubleItem.addActionListener(this);
1468
+ if (Globals.ADVANCED)
1469
+ {
11181470 tripleItem = menu.add(new MenuItem("Trident"));
11191471 tripleItem.addActionListener(this);
1472
+ }
11201473 }
11211474
11221475 void buildToolsMenu(Menu menu)
11231476 {
11241477 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251478 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1479
+ animationItem.setState(Globals.ANIMATION);
1480
+
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
11271483
11281484 menu.add("-");
11291485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301486 parseverticesItem.addActionListener(this);
11311487 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321488 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1489
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341490 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371491 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381492 reduceMorphItem.addActionListener(this);
11391493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401494 reduce34MorphItem.addActionListener(this);
1141
-
1142
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1143
- computeAOItem.addActionListener(this);
11441495 menu.add("-");
1145
-
11461496 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471497 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("-");
11481506 menu.add(analyzeItem = new MenuItem("Analyze"));
11491507 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
11511509 dumpItem.addActionListener(this);
11521510 // menu.add(pathItem = new MenuItem("From-to path"));
11531511 // pathItem.addActionListener(this);
....@@ -1165,6 +1523,7 @@
11651523 menu.add("-");
11661524 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671525 editScriptItem.addActionListener(this);
1526
+ }
11681527 }
11691528
11701529 void ScreenFit()
....@@ -1287,9 +1646,24 @@
12871646 shadow.material = new cMaterial(obj.material);
12881647 shadow.material.diffuse = 0.0001f;
12891648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
12901650
12911651 makeSomething(shadow);
12921652 }
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
+ }
12931667
12941668 /**
12951669 * applyExample
....@@ -1493,9 +1867,9 @@
14931867
14941868 void Overwrite(int mask)
14951869 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1870
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971871 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1872
+ Object3D content = Grafreed.clipboard.get(0);
14991873
15001874 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011875 content = ((cGroup)content).get(0);
....@@ -1534,7 +1908,7 @@
15341908 {
15351909 ScreenFit();
15361910 } else
1537
- if (source == switchItem)
1911
+ if (source == switchViewItem)
15381912 {
15391913 cVector v1 = new cVector();
15401914 cVector v2 = new cVector();
....@@ -1543,11 +1917,11 @@
15431917 objEditor.cameraView.renderCamera.setAim(v2, v1);
15441918 objEditor.cameraView.repaint();
15451919 } else
1546
- if (source == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
15471921 {
15481922 makeSomething(new Box());
15491923 } else
1550
- if (source == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
15511925 {
15521926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15531927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1626,27 +2000,27 @@
16262000
16272001 makeSomething(obj);
16282002 } else
1629
- if (source == gridItem)
2003
+ if (source == gridItem || source == gridButton)
16302004 {
16312005 makeSomething(new Grid());
16322006 } else
1633
- if (source == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
16342008 {
16352009 makeSomething(new Sphere());
16362010 } else
1637
- if (source == coneItem)
2011
+ if (source == coneItem || source == coneButton)
16382012 {
16392013 makeSomething(new Cone());
16402014 } else
1641
- if (source == torusItem)
2015
+ if (source == torusItem || source == torusButton)
16422016 {
16432017 makeSomething(new Torus());
16442018 } else
1645
- if (source == superItem)
2019
+ if (source == superItem || source == superButton)
16462020 {
16472021 makeSomething(new Superellipsoid());
16482022 } else
1649
- if (source == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
16502024 {
16512025 makeSomething(new Klein());
16522026 } else
....@@ -1666,7 +2040,7 @@
16662040 {
16672041 makeSomething(new BezierSurface());
16682042 } else
1669
- if (source == checkerItem)
2043
+ if (source == overlayItem || source == overlayButton)
16702044 {
16712045 /*
16722046 Object3D obj = new BezierSurface(5,8);
....@@ -1714,7 +2088,7 @@
17142088 s.setup();
17152089 makeSomething(s);
17162090 } else
1717
- if (source == lightItem)
2091
+ if (source == lightItem || source == lightButton)
17182092 {
17192093 makeSomething(new Light());
17202094 } else
....@@ -1764,30 +2138,30 @@
17642138
17652139 group(g);
17662140 } else
1767
- if (source == loopItem)
2141
+ if (source == loopItem || source == loopButton)
17682142 {
17692143 Composite csg = new GroupLeaf();
17702144 csg.count = 5;
17712145 group(csg);
1772
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
17732147 csg.addChild(child);
17742148 child.addChild(csg);
17752149 } else
17762150 if (source == doubleItem)
17772151 {
1778
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
17792153 csg.count = 5;
17802154 group(csg);
1781
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
17822156 csg.addChild(child);
17832157 child.addChild(csg);
1784
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
17852159 csg.addChild(child);
17862160 child.addChild(csg);
17872161 } else
17882162 if (source == tripleItem)
17892163 {
1790
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
17912165 csg.count = 4;
17922166 group(csg);
17932167 Composite child = new cGroup();
....@@ -1799,23 +2173,6 @@
17992173 child = new cGroup();
18002174 csg.addChild(child);
18012175 child.addChild(csg);
1802
- } else
1803
-
1804
- if (source == importGFDItem)
1805
- {
1806
- ImportGFD();
1807
- } else
1808
- if (source == importVRMLX3DItem)
1809
- {
1810
- ImportVRMLX3D();
1811
- } else
1812
- if (source == import3DSItem)
1813
- {
1814
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1815
- } else
1816
- if (source == importOBJItem)
1817
- {
1818
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18192176 } else
18202177 if (source == computeAOItem)
18212178 {
....@@ -1835,7 +2192,7 @@
18352192 if (source == invariantsItem)
18362193 {
18372194 System.out.println("Invariants:");
1838
- GrafreeD.grafreeD.universe.invariants();
2195
+ Grafreed.grafreeD.universe.invariants();
18392196 } else
18402197 if (source == memoryItem)
18412198 {
....@@ -1854,19 +2211,47 @@
18542211 {
18552212 DumpObject();
18562213 } else
2214
+ if (source == minButton)
2215
+ {
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
18572245 if (source == screenfitButton)
18582246 {
1859
- //Reload(lastConverter, lastFilename, true);
18602247 ScreenFit();
18612248 } else
18622249 if (source == screenfitpointButton)
18632250 {
1864
- //Reload(lastConverter, lastFilename, true);
18652251 ScreenFitPoint();
18662252 } else
18672253 if (source == snapobjectButton)
18682254 {
1869
- //Reload(lastConverter, lastFilename, true);
18702255 SnapObject();
18712256 } else
18722257 // if (event.getSource() == recompileButton)
....@@ -1903,12 +2288,20 @@
19032288 {
19042289 loadClipboard(true);
19052290 } else
2291
+ if (source == undoItem)
2292
+ {
2293
+ Undo();
2294
+ } else
2295
+ if (source == redoItem)
2296
+ {
2297
+ Redo();
2298
+ } else
19062299 if (source == duplicateItem)
19072300 {
1908
- Object3D keep = GrafreeD.clipboard;
2301
+ Object3D keep = Grafreed.clipboard;
19092302 loadClipboard(false);
19102303 paste(false);
1911
- GrafreeD.clipboard = keep;
2304
+ Grafreed.clipboard = keep;
19122305 } else
19132306 if (source == cloneItem)
19142307 {
....@@ -1926,13 +2319,17 @@
19262319 {
19272320 paste(false);
19282321 } else
2322
+ if (source == pasteIntoItem)
2323
+ {
2324
+ pasteInto(true, false);
2325
+ } else
19292326 if (source == pasteLinkItem)
19302327 {
1931
- pasteInto(false);
2328
+ pasteInto(false, false);
19322329 } else
19332330 if (source == pasteCloneItem)
19342331 {
1935
- pasteInto(true);
2332
+ pasteInto(true, true);
19362333 } else
19372334 if (source == pasteExpandItem)
19382335 {
....@@ -2124,9 +2521,9 @@
21242521 // group.selection.get(0).setMasterThis(content); // should be identity
21252522 // refreshContents();
21262523 // }
2127
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2524
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21282525 {
2129
- Object3D content = GrafreeD.clipboard.get(0);
2526
+ Object3D content = Grafreed.clipboard.get(0);
21302527
21312528 if (content instanceof cGroup && ((cGroup)content).transientlink )
21322529 content = ((cGroup)content).get(0);
....@@ -2134,11 +2531,11 @@
21342531 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352532 for (int i=0; i<group.selection.size(); i++)
21362533 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2534
+ boolean random = CameraPane.SWITCH;
2535
+ CameraPane.SWITCH = false; // parse all random nodes
21392536 group.selection.get(i).linkVerticesThis(content);
21402537 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2538
+ CameraPane.SWITCH = random;
21422539 }
21432540 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442541 refreshContents();
....@@ -2148,20 +2545,20 @@
21482545 {
21492546 for (int i=0; i<group.selection.size(); i++)
21502547 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2548
+ boolean random = CameraPane.SWITCH;
2549
+ CameraPane.SWITCH = false; // parse all random nodes
21532550 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2551
+ CameraPane.SWITCH = random;
21552552 }
21562553
21572554 refreshContents();
21582555 } else
21592556 if (source == relinkverticesItem)
21602557 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2558
+ boolean random = CameraPane.SWITCH;
2559
+ CameraPane.SWITCH = false; // parse all random nodes
21632560 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2561
+ CameraPane.SWITCH = random;
21652562
21662563 refreshContents();
21672564 } else
....@@ -2176,9 +2573,9 @@
21762573 } else
21772574 if (source == setMasterItem)
21782575 {
2179
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2576
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21802577 {
2181
- Object3D content = GrafreeD.clipboard.get(0);
2578
+ Object3D content = Grafreed.clipboard.get(0);
21822579
21832580 if (content instanceof cGroup && ((cGroup)content).transientlink )
21842581 content = ((cGroup)content).get(0);
....@@ -2191,9 +2588,9 @@
21912588 {
21922589 if (group.selection.size() == 1)
21932590 {
2194
- if (GrafreeD.clipboard.size() == 1)
2591
+ if (Grafreed.clipboard.size() == 1)
21952592 {
2196
- Object3D content = GrafreeD.clipboard.get(0);
2593
+ Object3D content = Grafreed.clipboard.get(0);
21972594
21982595 if (content instanceof cGroup && ((cGroup)content).transientlink )
21992596 content = ((cGroup)content).get(0);
....@@ -2210,7 +2607,7 @@
22102607 {
22112608 RevertMeshes();
22122609 } else
2213
- if (source == resetMeshItem)
2610
+ if (source == resetAllItem)
22142611 {
22152612 ResetAll();
22162613 } else
....@@ -2230,9 +2627,9 @@
22302627 {
22312628 ClearSelection(true);
22322629 } else
2233
- if (source == grabItem)
2630
+ if (source == grabItem || source == groupButton)
22342631 {
2235
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
22362633 } else
22372634 if (source == hideItem)
22382635 {
....@@ -2250,16 +2647,16 @@
22502647 {
22512648 makeSomething(new Camera());
22522649 } else
2253
- if (source == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
22542651 {
22552652 group(new Composite());
22562653 } else
2257
- if (source == randomItem)
2654
+ if (source == switchItem || source == switchButton)
22582655 {
22592656 RandomNode random = new RandomNode();
22602657 group(random);
22612658 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2659
+ random.name = random.get(0).name + "Switch";
22632660 } else
22642661 if (source == physicsItem)
22652662 {
....@@ -2356,7 +2753,7 @@
23562753 {
23572754 group(new cLinker());
23582755 } else
2359
- if (source == textureItem)
2756
+ if (source == textureItem || source == textureButton)
23602757 {
23612758 group(new TextureNode());
23622759 } else
....@@ -2376,17 +2773,30 @@
23762773 {
23772774 CastShadow(2);
23782775 } else
2379
- if (source == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
23802777 {
2381
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
23822780 for (int i=0; i<group.selection.size(); i++)
23832781 {
2384
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
23852787 }
23862788
2387
- ClearSelection(false);
2388
-
2389
- refreshContents();
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
+ }
23902800 } else
23912801 if (source == genUVItem)
23922802 {
....@@ -2398,7 +2808,7 @@
23982808 } else
23992809 if (source == genNormalsMESHItem)
24002810 {
2401
- GenNormals(true); // TODO
2811
+ GenNormalsMESH();
24022812 } else
24032813 if (source == genNormalsORGANItem)
24042814 {
....@@ -2463,6 +2873,22 @@
24632873 if (source == unmarkleavesItem)
24642874 {
24652875 MarkLeaves(false);
2876
+ } else
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);
24662892 } else
24672893 if (source == flipVItem)
24682894 {
....@@ -2548,9 +2974,13 @@
25482974 {
25492975 SmoothMesh();
25502976 } else
2551
- if (source == transformgeometryItem)
2977
+ if (source == transformGeometryItem)
25522978 {
25532979 TransformGeometry();
2980
+ } else
2981
+ if (source == transformChildrenItem)
2982
+ {
2983
+ TransformChildren();
25542984 } else
25552985 if (source == resetTransformItem)
25562986 {
....@@ -2558,7 +2988,11 @@
25582988 } else
25592989 if (source == resetCentroidItem)
25602990 {
2561
- ResetCentroid();
2991
+ ResetCentroid(true);
2992
+ } else
2993
+ if (source == resetCentroidXZItem)
2994
+ {
2995
+ ResetCentroid(false);
25622996 } else
25632997 if (source == resetParentItem)
25642998 {
....@@ -2690,6 +3124,10 @@
26903124 if (source == twoButton)
26913125 {
26923126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
26933131 // bug
26943132 //gridPanel.setDividerLocation(1.0);
26953133 //bigPanel.setDividerLocation(0.0);
....@@ -2720,12 +3158,33 @@
27203158 // centralPanel.setVisible(true);
27213159 // XYZPanel.setVisible(false);
27223160 bigThree.ClearUI();
2723
- bigThree.addComponent(centralPanel);
3161
+ bigThree.add(centralPanel);
27243162 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
+
27253181 } else
27263182 if (source == threeButton)
27273183 {
27283184 radio.layout = threeButton;
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
27293188
27303189 // bigThree.remove(scenePanel);
27313190 // bigThree.remove(centralPanel);
....@@ -2755,13 +3214,18 @@
27553214 // centralPanel.setVisible(true);
27563215 // XYZPanel.setVisible(true);
27573216 bigThree.ClearUI();
2758
- bigThree.addComponent(centralPanel);
2759
- bigThree.addComponent(XYZPanel);
3217
+ bigThree.add(centralPanel);
3218
+ bigThree.add(XYZPanel);
27603219 bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
27613222 } else
27623223 if (source == fourButton)
27633224 {
27643225 radio.layout = fourButton;
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
27653229
27663230 // bigThree.remove(scenePanel);
27673231 // bigThree.remove(centralPanel);
....@@ -2791,12 +3255,17 @@
27913255 // centralPanel.setVisible(false);
27923256 // XYZPanel.setVisible(false);
27933257 bigThree.ClearUI();
2794
- bigThree.addComponent(scenePanel);
3258
+ bigThree.add(scenePanel);
27953259 bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
27963262 } else
27973263 if (source == sixButton)
27983264 {
27993265 radio.layout = sixButton;
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
28003269
28013270 // bigThree.remove(scenePanel);
28023271 // bigThree.remove(centralPanel);
....@@ -2826,13 +3295,18 @@
28263295 // centralPanel.setVisible(true);
28273296 // XYZPanel.setVisible(false);
28283297 bigThree.ClearUI();
2829
- bigThree.addComponent(scenePanel);
2830
- bigThree.addComponent(centralPanel);
3298
+ bigThree.add(scenePanel);
3299
+ bigThree.add(centralPanel);
28313300 bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
28323303 } else
28333304 if (source == sevenButton)
28343305 {
28353306 radio.layout = sevenButton;
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
28363310
28373311 // bigThree.remove(scenePanel);
28383312 // bigThree.remove(centralPanel);
....@@ -2862,10 +3336,12 @@
28623336 // centralPanel.setVisible(true);
28633337 // XYZPanel.setVisible(true);
28643338 bigThree.ClearUI();
2865
- bigThree.addComponent(scenePanel);
2866
- bigThree.addComponent(centralPanel);
2867
- bigThree.addComponent(XYZPanel);
3339
+ bigThree.add(scenePanel);
3340
+ bigThree.add(centralPanel);
3341
+ bigThree.add(XYZPanel);
28683342 bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
28693345 } else
28703346 if (source == rootButton)
28713347 {
....@@ -2877,6 +3353,7 @@
28773353 EditObject(obj);
28783354 }
28793355
3356
+ cameraView.requestFocusInWindow();
28803357 refreshContents(true);
28813358 } else
28823359 if (source == closeButton)
....@@ -2886,22 +3363,37 @@
28863363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28873364 {
28883365 ab = (cRadio)e.nextElement();
2889
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28903367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
28913374 buttonGroup.remove(ab);
28923375 radioPanel.remove(ab);
28933376
2894
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
28953379 // ab.GetObject().objectUI = null; // ?????????
28963380
28973381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28983382 break;
28993383 }
29003384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
29013387 refreshContents(true);
29023388 } else
29033389 if (source == editItem || source == editButton)
29043390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
29053397 EditSelection(false);
29063398 } else
29073399 if (source == uneditButton)
....@@ -2911,12 +3403,13 @@
29113403 Object3D child = (Object3D)e.nextElement();
29123404 if(child.editWindow != null)
29133405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
29143407 child.CloseUI();
29153408 listUI.remove(child);
29163409
2917
- child.editWindow = null; // ???????????
3410
+ //child.editWindow = null; // ???????????
29183411 }
2919
- objEditor.ctrlPanel.revalidate();
3412
+ objEditor.ctrlPanel.FlushUI();
29203413 //objEditor.jTree.clearSelection();
29213414 //objEditor.ResetSliders();
29223415 refreshContents(true);
....@@ -2927,6 +3420,7 @@
29273420 //copy.ClearUI();
29283421 for (Object3D obj : listUI)
29293422 {
3423
+ obj.pinned = false;
29303424 obj.CloseUI();
29313425 }
29323426 listUI.clear();
....@@ -2936,7 +3430,7 @@
29363430 {
29373431 assert(copy == group);
29383432
2939
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29403434
29413435 for (Object3D obj : listUI)
29423436 {
....@@ -3000,20 +3494,44 @@
30003494 frontView.object = group;
30013495 sideView.object = group;
30023496 }
3003
- group.editWindow = this;
3497
+
3498
+// fix "+" issue
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
3501
+
30043502 /*
30053503 currentLayout = radio.layout;
30063504 if (currentLayout == null)
30073505 currentLayout = sevenButton;
30083506 */
30093507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
30103513 keepparent = group.parent;
30113514 // PARENT = NULL or not???
30123515 //group.parent = null; // ROOT
30133516 //group.attributes = -1;
30143517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
30153520 refreshContents(true);
3016
- }
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
+ }
30173535 else
30183536 {
30193537 //return super.action(event, arg);
....@@ -3022,7 +3540,6 @@
30223540 }
30233541
30243542 boolean useclient = false;
3025
- cRadio radio;
30263543
30273544 void ToggleRoot()
30283545 {
....@@ -3074,6 +3591,28 @@
30743591 refreshContents();
30753592 }
30763593
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
+ }
30773616
30783617 void ResetTransform()
30793618 {
....@@ -3186,7 +3725,7 @@
31863725 refreshContents();
31873726 }
31883727
3189
- void ResetCentroid()
3728
+ void ResetCentroid(boolean full)
31903729 {
31913730 Object3D obj;
31923731 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3201,12 +3740,16 @@
32013740 LA.matIdentity(Object3D.mat);
32023741 obj.getBounds(minima, maxima, false);
32033742 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3204
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3743
+ if (full)
3744
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32053745 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32063746 obj.TransformMesh(Object3D.mat);
3747
+
32073748 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3208
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3749
+ if (full)
3750
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32093751 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3752
+
32103753 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32113754 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32123755 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3235,7 +3778,8 @@
32353778
32363779 int size = obj.MemorySize();
32373780
3238
- 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)");
32393783 }
32403784 }
32413785 catch (Exception e)
....@@ -3272,9 +3816,9 @@
32723816 obj = (Object3D)e.nextElement();
32733817
32743818 System.out.println("Object is: " + obj);
3275
- GrafreeD.AnalyzeObject(obj);
3819
+ Grafreed.AnalyzeObject(obj);
32763820 System.out.println("Boundary rep: " + obj.bRep);
3277
- GrafreeD.AnalyzeObject(obj.bRep);
3821
+ Grafreed.AnalyzeObject(obj.bRep);
32783822
32793823 // System.err.println((size/1024) + " KB is the size of " + obj);
32803824 }
....@@ -3316,6 +3860,13 @@
33163860 void GenNormals(boolean crease)
33173861 {
33183862 group.GenNormalsS(crease);
3863
+
3864
+ refreshContents();
3865
+ }
3866
+
3867
+ void GenNormalsMESH()
3868
+ {
3869
+ group.GenNormalsMeshS();
33193870
33203871 refreshContents();
33213872 }
....@@ -3488,8 +4039,8 @@
34884039
34894040 void ParseVertices()
34904041 {
3491
- boolean epsequal = GrafreeD.epsequal;
3492
- GrafreeD.epsequal = true;
4042
+ boolean epsequal = Grafreed.epsequal;
4043
+ Grafreed.epsequal = true;
34934044
34944045 for (int i=0; i<group.selection.size(); i++)
34954046 {
....@@ -3514,7 +4065,7 @@
35144065 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35154066 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35164067
3517
- g.add(GrafreeD.clipboard);
4068
+ g.add(Grafreed.clipboard);
35184069
35194070 buffer.add(g);
35204071 }
....@@ -3529,7 +4080,7 @@
35294080 makeSomething(buffer, i==group.selection.size()-1);
35304081 }
35314082
3532
- GrafreeD.epsequal = epsequal;
4083
+ Grafreed.epsequal = epsequal;
35334084
35344085 refreshContents();
35354086 }
....@@ -3547,7 +4098,16 @@
35474098 String pigment = Object3D.GetPigment(tex);
35484099 //String bump = Object3D.GetBump(tex);
35494100
3550
- com.sun.opengl.util.texture.TextureData texturedata = Globals.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
+ }
35514111
35524112 double s = v.s;
35534113
....@@ -3635,11 +4195,11 @@
36354195
36364196 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36374197
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
4198
+ boolean random = CameraPane.SWITCH;
4199
+ CameraPane.SWITCH = false; // parse all random nodes
36404200 lowres.linkVerticesThis(null);
36414201 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
4202
+ CameraPane.SWITCH = random;
36434203
36444204 System.err.flush();
36454205
....@@ -3679,7 +4239,7 @@
36794239 return;
36804240
36814241 Object3D poses = group.selection.get(0);
3682
- Object3D ref = GrafreeD.clipboard.get(0);
4242
+ Object3D ref = Grafreed.clipboard.get(0);
36834243
36844244 Object3D newgroup = new Object3D("Po:" + poses.name);
36854245
....@@ -3873,9 +4433,9 @@
38734433
38744434 void ClipMesh()
38754435 {
3876
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4436
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38774437 {
3878
- Object3D content = GrafreeD.clipboard.get(0);
4438
+ Object3D content = Grafreed.clipboard.get(0);
38794439
38804440 if (content instanceof cGroup && ((cGroup)content).transientlink )
38814441 content = ((cGroup)content).get(0);
....@@ -3884,7 +4444,7 @@
38844444 // {
38854445 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38864446 // }
3887
- group.selection.ClipMesh(GrafreeD.clipboard);
4447
+ group.selection.ClipMesh(Grafreed.clipboard);
38884448 }
38894449 // group.selection.ClipMesh(GrafreeD.clipboard);
38904450 System.out.println("DONE.");
....@@ -3931,6 +4491,18 @@
39314491 void MarkLeaves(boolean hide)
39324492 {
39334493 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);
39344506 refreshContents();
39354507 }
39364508
....@@ -4005,10 +4577,6 @@
40054577 // }
40064578 // }
40074579
4008
- static boolean allparams = true;
4009
-
4010
- static Vector<Object3D> listUI = new Vector<Object3D>();
4011
-
40124580 void EditSelection(boolean newWindow)
40134581 {
40144582 // aConstraints.gridy = 0;
....@@ -4016,10 +4584,10 @@
40164584 {
40174585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40184586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4019
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40204588
40214589 Object3D elem = (Object3D)group.selection.elementAt(i);
4022
- if(elem != group)
4590
+ if(elem != group || !newWindow)
40234591 {
40244592 // if (!(elem instanceof Composite))
40254593 // newWindow = false;
....@@ -4101,7 +4669,8 @@
41014669 //new Exception().printStackTrace();
41024670
41034671 freezemodel = true;
4104
-
4672
+ ClearUnpinned();
4673
+
41054674 /**/
41064675 //switch (event.id)
41074676 {
....@@ -4109,7 +4678,6 @@
41094678 //case 702: // Event.LIST_DESELECT
41104679 group.deselectAll();
41114680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4112
- objEditor.ClearInfo(); // .GetMaterial());
41134681 if (tps != null)
41144682 {
41154683 for (int i=0; i < tps.length; i++)
....@@ -4118,33 +4686,39 @@
41184686
41194687 //if (child.parent != null)
41204688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
41214690 group.addSelectee(child);
4122
- objEditor.SetMaterial(child); // .GetMaterial());
4123
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4124
- System.err.println("info : " + child.GetPath());
41254691 }
41264692 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4693
+// else
4694
+// {
4695
+// objEditor.SetMaterial(group); // .GetMaterial());
4696
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4697
+// System.err.println("info : " + group.GetPath());
4698
+// }
41334699
4134
- objEditor.SetText(); // jan 2014
4135
-
4136
- if (flashIt && !Globals.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))
41374701 CameraPane.flash = true;
41384702
4139
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4703
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41404704 // a camera
41414705 {
4142
- CameraPane.camerachangeframe = 0; // don't refuse it
4143
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
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
+ }
41444711 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41454712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41464713 }
41474714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
41484722 refreshContents();
41494723 //return true;
41504724 }
....@@ -4153,6 +4727,35 @@
41534727
41544728 freezemodel = false;
41554729 }
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
+ }
41564759
41574760 void linkSomething(Object3D thing)
41584761 {
....@@ -4224,16 +4827,19 @@
42244827 {
42254828 if (group.selection.isEmpty())
42264829 return;
4227
- GrafreeD.clipboardIsTempGroup = false;
4830
+
4831
+ Grafreed.clipboardIsTempGroup = false;
42284832 Composite tGroup = null;
42294833 if (group.selection.size() > 0) // 1)
42304834 {
42314835 tGroup = new cGroup();
4232
- GrafreeD.clipboardIsTempGroup = true;
4836
+ Grafreed.clipboardIsTempGroup = true;
42334837 }
42344838
42354839 if (cut)
42364840 {
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
42374843 //int indices[] = jList.getSelectedIndices();
42384844 //for (int i = indices.length - 1; i >= 0; i--)
42394845 //jList.remove(indices[i]);
....@@ -4269,16 +4875,16 @@
42694875 //System.out.println("cut " + child);
42704876 //System.out.println("parent = " + child.parent);
42714877 // tmp.addChild(child);
4272
- if (GrafreeD.clipboardIsTempGroup)
4878
+ if (Grafreed.clipboardIsTempGroup)
42734879 tGroup.add/*Child*/(tmp);
42744880 else
4275
- GrafreeD.clipboard = tmp;
4881
+ Grafreed.clipboard = tmp;
42764882 }
42774883 else
4278
- if (GrafreeD.clipboardIsTempGroup)
4884
+ if (Grafreed.clipboardIsTempGroup)
42794885 tGroup.add/*Child*/(child);
42804886 else
4281
- GrafreeD.clipboard = child;
4887
+ Grafreed.clipboard = child;
42824888 }
42834889
42844890 //ResetModel();
....@@ -4310,21 +4916,23 @@
43104916 //System.out.println("cut " + elem);
43114917 //System.out.println("parent = " + elem.parent);
43124918 // tmp.addChild(elem);
4313
- if (GrafreeD.clipboardIsTempGroup)
4919
+ if (Grafreed.clipboardIsTempGroup)
43144920 tGroup.add/*Child*/(tmp);
43154921 else
4316
- GrafreeD.clipboard = tmp;
4922
+ Grafreed.clipboard = tmp;
43174923 }
43184924 else
4319
- if (GrafreeD.clipboardIsTempGroup)
4925
+ if (Grafreed.clipboardIsTempGroup)
43204926 tGroup.add/*Child*/(child);
43214927 else
4322
- GrafreeD.clipboard = child;
4928
+ Grafreed.clipboard = child;
43234929 }
43244930
43254931 }
4326
- if (GrafreeD.clipboardIsTempGroup)
4327
- GrafreeD.clipboard = tGroup;
4932
+
4933
+ if (Grafreed.clipboardIsTempGroup)
4934
+ Grafreed.clipboard = tGroup;
4935
+
43284936 if (cut)
43294937 {
43304938 ResetModel();
....@@ -4334,11 +4942,15 @@
43344942
43354943 void paste(boolean expand)
43364944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
43374949 // if (GrafreeD.clipboard == null)
43384950 // return;
43394951 boolean first = true;
43404952
4341
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
43424954 {
43434955 Composite temp;
43444956
....@@ -4349,7 +4961,7 @@
43494961 temp = (Composite)Applet3D.clipboard.deepCopy();
43504962 */
43514963 Object3D elem;
4352
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4964
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43534965 {
43544966 Object3D child = (Object3D)e.nextElement();
43554967
....@@ -4383,21 +4995,22 @@
43834995 //Object3D cb = Applet3D.clipboard;
43844996 //temp.addChild(cb);
43854997 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4386
- assert(GrafreeD.clipboard.parent == null);
4387
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4388
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4389
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4390
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.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());
43915003 else
4392
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4393
- GrafreeD.clipboard.get(0).parent = keepparent;
5004
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5005
+ Grafreed.clipboard.get(0).parent = keepparent;
43945006 }
43955007
5008
+ Globals.SAVEONMAKE = keep;
43965009 ResetModel();
43975010 refreshContents();
43985011 }
43995012
4400
- void pasteInto(boolean copyit)
5013
+ void pasteInto(boolean copyit, boolean clone)
44015014 {
44025015 // if (GrafreeD.clipboard == null)
44035016 // return;
....@@ -4426,15 +5039,22 @@
44265039 if (copyit)
44275040 {
44285041 // paste(false);
4429
- CloneClipboard(false); // sept 2014
5042
+ if (clone)
5043
+ {
5044
+ CloneClipboard(false); // sept 2014
5045
+ }
5046
+ else
5047
+ {
5048
+ paste(false);
5049
+ }
44305050 }
44315051 else
44325052 {
44335053 boolean first = true;
44345054
4435
- if (GrafreeD.clipboardIsTempGroup)
5055
+ if (Grafreed.clipboardIsTempGroup)
44365056 {
4437
- Composite temp = (Composite)GrafreeD.clipboard;
5057
+ Composite temp = (Composite)Grafreed.clipboard;
44385058 Object3D copy;
44395059 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44405060 {
....@@ -4444,7 +5064,7 @@
44445064 }
44455065 } else
44465066 {
4447
- linkSomething(GrafreeD.clipboard); //.get(0));
5067
+ linkSomething(Grafreed.clipboard); //.get(0));
44485068 }
44495069 }
44505070 }
....@@ -4521,6 +5141,10 @@
45215141
45225142 void group(Object3D csg, boolean grab)
45235143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
45245148 if (//false) // why??
45255149 !group.selection.isEmpty())
45265150 {
....@@ -4634,10 +5258,15 @@
46345258 //node.add(csg);
46355259 //makeSomething(node);
46365260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
46375262 }
46385263
46395264 void Ungroup(Object3D g)
46405265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
46415270 if (g instanceof HiddenObject)
46425271 {
46435272 HiddenObject h = (HiddenObject) g;
....@@ -4654,6 +5283,7 @@
46545283 objEditor.makeSomething(g.get(i), false);
46555284 }
46565285 }
5286
+ Globals.SAVEONMAKE = keep;
46575287 }
46585288
46595289 void ungroup()
....@@ -4849,21 +5479,6 @@
48495479 }
48505480 */
48515481
4852
- void ImportGFD()
4853
- {
4854
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4855
- browser.show();
4856
- String filename = browser.getFile();
4857
- if (filename != null && filename.length() > 0)
4858
- {
4859
- String fullname = browser.getDirectory() + filename;
4860
-
4861
- //Object3D readobj =
4862
- objEditor.ReadGFD(fullname, objEditor);
4863
- //makeSomething(readobj);
4864
- }
4865
- }
4866
-
48675482 /*
48685483 public void Callback(Object obj)
48695484 {
....@@ -4887,26 +5502,9 @@
48875502 }
48885503 */
48895504
4890
- void ImportVRMLX3D()
4891
- {
4892
- if (GrafreeD.standAlone)
4893
- {
4894
- /**/
4895
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4896
- browser.show();
4897
- String filename = browser.getFile();
4898
- if (filename != null && filename.length() > 0)
4899
- {
4900
- String fullname = browser.getDirectory() + filename;
4901
- LoadVRMLX3D(fullname);
4902
- }
4903
- /**/
4904
- }
4905
- }
4906
-
49075505 String GetFile(String dialogName)
49085506 {
4909
- if (GrafreeD.standAlone)
5507
+ if (Grafreed.standAlone)
49105508 {
49115509 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49125510 browser.show();
....@@ -4970,10 +5568,33 @@
49705568 cButton flashSelectionButton;
49715569 cButton editButton;
49725570 cButton uneditButton;
5571
+ JCheckBox allParamsButton;
49735572 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755573 cButton unselectButton;
49765574
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
+
49775598 cButton screenfitButton;
49785599 cButton screenfitpointButton;
49795600 cButton snapobjectButton;
....@@ -4985,14 +5606,6 @@
49855606
49865607 cButton setsupportButton;
49875608
4988
- cButton twoButton;
4989
- cButton sixButton;
4990
- cButton threeButton;
4991
- cButton sevenButton;
4992
- cButton fourButton; // full panel
4993
- cButton oneButton; // full XYZ
4994
- //cButton currentLayout;
4995
-
49965609 //
49975610 //Composite
49985611 Object3D // to do !!
....@@ -5002,9 +5615,11 @@
50025615 //JTree jTree;
50035616 private MenuItem lookAtItem;
50045617 private MenuItem lookFromItem;
5005
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
50065619 private MenuItem cutItem;
5007
- private MenuItem duplicateItem;
5620
+ private MenuItem undoItem;
5621
+ private MenuItem redoItem;
5622
+ private JMenuItem duplicateItem;
50085623 private MenuItem cloneItem;
50095624 private MenuItem cloneSupportItem;
50105625 private MenuItem overwriteGeoItem;
....@@ -5017,7 +5632,7 @@
50175632 private MenuItem linkverticesItem;
50185633 private MenuItem relinkverticesItem;
50195634 private MenuItem setMasterItem;
5020
- private MenuItem resetMeshItem;
5635
+ private MenuItem resetAllItem;
50215636 private MenuItem stepAllItem;
50225637 private MenuItem revertMeshItem;
50235638 private MenuItem poseMeshItem;
....@@ -5028,6 +5643,7 @@
50285643 private MenuItem mergeGeometriesItem;
50295644 private MenuItem copyItem;
50305645 private MenuItem pasteItem;
5646
+ private MenuItem pasteIntoItem;
50315647 private MenuItem pasteLinkItem;
50325648 private MenuItem pasteCloneItem;
50335649 private MenuItem pasteExpandItem;
....@@ -5066,6 +5682,10 @@
50665682 private MenuItem showleavesItem;
50675683 private MenuItem markleavesItem;
50685684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
50695689
50705690 private MenuItem flipVItem;
50715691 private MenuItem unflipVItem;
....@@ -5077,15 +5697,17 @@
50775697 private MenuItem panoTexturesItem;
50785698
50795699 private MenuItem resetCentroidItem;
5080
- private MenuItem transformgeometryItem;
5700
+ private MenuItem resetCentroidXZItem;
50815701 private MenuItem resetTransformItem;
5702
+ private MenuItem transformGeometryItem;
5703
+ private MenuItem transformChildrenItem;
50825704 private MenuItem hideItem;
50835705 private MenuItem grabItem;
50845706 private MenuItem backItem;
50855707 private MenuItem frontItem;
50865708 private MenuItem cameraItem;
50875709 private MenuItem compositeItem;
5088
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
50895711 private MenuItem physicsItem;
50905712 private MenuItem frameselectorItem;
50915713 private MenuItem scriptNodeItem;
....@@ -5125,7 +5747,7 @@
51255747 private MenuItem blobItem;
51265748 private MenuItem latheItem;
51275749 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5750
+ private MenuItem overlayItem;
51295751 private MenuItem meshItem;
51305752 // private MenuItem meshGroupItem;
51315753 private MenuItem springItem;
....@@ -5147,11 +5769,6 @@
51475769 private MenuItem doubleItem;
51485770 private MenuItem tripleItem;
51495771
5150
- private MenuItem importGFDItem;
5151
- private MenuItem importVRMLX3DItem;
5152
- private MenuItem import3DSItem;
5153
- private MenuItem importOBJItem;
5154
-
51555772 private MenuItem computeAOItem;
51565773 private MenuItem recompileItem;
51575774 private MenuItem editScriptItem;
....@@ -5161,4 +5778,8 @@
51615778 private MenuItem analyzeItem;
51625779 private MenuItem dumpItem;
51635780 //boolean freezemodel = false;
5781
+
5782
+ Menu cameraMenu;
5783
+ MenuItem editCameraItem;
5784
+ MenuItem restoreCameraItem;
51645785 }