Normand Briere
2019-07-21 5a546232b84ce65d8779d29e9171e7e2df013614
GroupEditor.java
....@@ -60,6 +60,12 @@
6060 this.copy = this.group = group;
6161 //selectees = this.group.selectees;
6262
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6369 if(ui)
6470 SetupUI(objEditor);
6571 }
....@@ -74,16 +80,28 @@
7480 this.copy = this.group = copy;
7581 //selectees = this.group.selectees;
7682
77
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7884 SetupUI2(objEditor);
7985 objEditor.SetupUI(true);
8086 SetupViews(objEditor);
8187
8288 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
8397 }
8498
8599 void CloneSelection(boolean supports)
86100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
87105 // Object3D keep = GrafreeD.clipboard;
88106 //Object3D obj;
89107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +112,19 @@
94112
95113 makeSomething(clone, i==group.selection.size()-1);
96114 }
115
+ Globals.REPLACEONMAKE = keep;
97116 }
98117
99118 void CloneClipboard(boolean supports)
100119 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
120
+ assert(Grafreed.clipboard.parent == null);
121
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
122
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
123
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
124
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106125 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
126
+ makeSomething(CloneObject(Grafreed.clipboard, false));
127
+ Grafreed.clipboard.get(0).parent = keepparent;
109128 }
110129
111130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +138,7 @@
119138 // obj.support = null;
120139 if (!supports)
121140 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123142 obj.parent = parent;
124143 // obj.support = support;
125144 // clone.support = support; // aout 2013
....@@ -148,30 +167,29 @@
148167
149168 //JTextField nameField;
150169
151
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
152171 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
172
+ oe.jTree = new cTree();
173
+
164174 Menu menu;
165175 oe.menuBar.add(menu = new Menu("Edit"));
166176 //editItem = menu.add(new MenuItem("Edit"));
167177 //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
178
+
179
+// undoItem = menu.add(new MenuItem("Undo"));
180
+// undoItem.addActionListener(this);
181
+// redoItem = menu.add(new MenuItem("Redo"));
182
+// redoItem.addActionListener(this);
183
+// menu.add("-");
184
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
169185 duplicateItem.addActionListener(this);
170
- menu.add("-");
171186 cloneItem = menu.add(new MenuItem("Clone"));
172187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
173190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174191 cloneSupportItem.addActionListener(this);
192
+ }
175193 menu.add("-");
176194 cutItem = menu.add(new MenuItem("Cut"));
177195 cutItem.addActionListener(this);
....@@ -179,27 +197,123 @@
179197 copyItem.addActionListener(this);
180198 pasteItem = menu.add(new MenuItem("Paste"));
181199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
182204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183205 pasteLinkItem.addActionListener(this);
184206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185207 pasteCloneItem.addActionListener(this);
186208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187209 // pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
210
+ menu.add("-");
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
213
+
214
+ if (Globals.ADVANCED)
215
+ {
216
+ // Deletes the cameras...
190217 clearAllItem = menu.add(new MenuItem("Clear All"));
191218 clearAllItem.addActionListener(this);
219
+ }
220
+
221
+ menuBar.add(cameraMenu = new Menu("View"));
222
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
223
+ //zBufferItem.addActionListener(this);
224
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
225
+ //normalLensItem.addActionListener(this);
226
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
227
+ restoreCameraItem.addActionListener(this);
228
+
229
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
230
+// toggleFullScreenItem.addItemListener(this);
231
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
232
+// cameraMenu.add("-");
233
+//
234
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
235
+// toggleTextureItem.addItemListener(this);
236
+// toggleTextureItem.setState(CameraPane.textureon);
237
+//
238
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
239
+// toggleSwitchItem.addItemListener(this);
240
+// toggleSwitchItem.setState(CameraPane.SWITCH);
241
+
242
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
243
+ toggleHandleItem.addItemListener(this);
244
+ toggleHandleItem.setState(CameraPane.HANDLES);
245
+
246
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
247
+ togglePaintItem.addItemListener(this);
248
+ togglePaintItem.setState(CameraPane.PAINTMODE);
249
+
250
+ if (Globals.ADVANCED)
251
+ {
252
+ cameraMenu.add("-");
253
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
254
+ toggleLiveItem.addItemListener(this);
255
+ toggleLiveItem.setState(Globals.isLIVE());
192256
257
+ cameraMenu.add(stepItem = new MenuItem("Step"));
258
+ stepItem.addActionListener(this);
259
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
260
+ // toggleDLItem.addItemListener(this);
261
+ // toggleDLItem.setState(false);
262
+
263
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
264
+ toggleRenderItem.addItemListener(this);
265
+ toggleRenderItem.setState(!CameraPane.frozen);
266
+
267
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
268
+ toggleDebugItem.addItemListener(this);
269
+ toggleDebugItem.setState(Globals.DEBUG);
270
+
271
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
272
+ toggleFrustumItem.addItemListener(this);
273
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
274
+
275
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
276
+ toggleFootContactItem.addItemListener(this);
277
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
278
+
279
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
280
+ toggleTimelineItem.addItemListener(this);
281
+ }
282
+
283
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
284
+// toggleRootItem.addItemListener(this);
285
+// toggleRootItem.setState(false);
286
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
287
+// animationItem.addItemListener(this);
288
+// animationItem.setState(CameraPane.ANIMATION);
289
+ cameraMenu.add("-");
290
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
291
+ editCameraItem.addActionListener(this);
292
+
293
+ if (Globals.ADVANCED)
294
+ {
295
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
296
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
297
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
298
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
299
+ oe.cameraMenu.add("-");
300
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
301
+ openWindowItem.addActionListener(this);
302
+ editLeafItem.addActionListener(this);
303
+ lookAtItem.addActionListener(this);
304
+ //lookFromItem.addActinoListener(this);
305
+ //switchViewItem.addActionListener(this);
306
+ }
307
+
193308 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
309
+ if (Globals.ADVANCED)
310
+ {
198311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199312 revertMeshItem.addActionListener(this);
200313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201314 resetreferencesItem.addActionListener(this);
202315 menu.add("-");
316
+ }
203317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204318 overwriteGeoItem.addActionListener(this);
205319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +325,104 @@
211325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212326 overwriteUVItem.addActionListener(this);
213327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
214330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215331 generateMeshItem.addActionListener(this);
216332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217333 poseMeshItem.addActionListener(this);
218334 menu.add("-");
335
+ }
219336 resetsupportItem = menu.add(new MenuItem("Reset support"));
220337 resetsupportItem.addActionListener(this);
221338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222339 linkverticesItem.addActionListener(this);
223340 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224341 relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
225345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226346 setMasterItem.addActionListener(this);
347
+ }
227348
228349 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
231352 backItem = menu.add(new MenuItem("Back"));
232353 backItem.addActionListener(this);
233354 frontItem = menu.add(new MenuItem("Front"));
234355 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
361
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238362 hideItem.addActionListener(this);
363
+ }
239364 ungroupItem = menu.add(new MenuItem("Ungroup"));
240365 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
248373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249374 switchGeoItem.addActionListener(this);
250375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251376 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
253378 morphItem.addActionListener(this);
379
+
380
+ menu.add("-");
381
+ physicsItem = menu.add(new MenuItem("Physics"));
382
+ physicsItem.addActionListener(this);
383
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
384
+ frameselectorItem.addActionListener(this);
254385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255386 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
387
+ }
258388
259389 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
262392 billboardItem = menu.add(new MenuItem("Billboard"));
263393 billboardItem.addActionListener(this);
264394 csgItem = menu.add(new MenuItem("CSG"));
265395 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267397 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269399 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
272408 linkerItem = menu.add(new MenuItem("Linker"));
273409 linkerItem.addActionListener(this);
274410 templateItem = menu.add(new MenuItem("Template"));
275411 templateItem.addActionListener(this);
276
- attributeItem = menu.add(new MenuItem("Attribute"));
277
- attributeItem.addActionListener(this);
278412 pointflowItem = menu.add(new MenuItem("Point Flow"));
279413 pointflowItem.addActionListener(this);
414
+ }
280415 menu.add("-");
281416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282417 resetTransformItem.addActionListener(this);
283418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284419 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
420
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
421
+ resetCentroidXZItem.addActionListener(this);
422
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
423
+ transformGeometryItem.addActionListener(this);
424
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
425
+ transformChildrenItem.addActionListener(this);
287426
288427 oe.menuBar.add(menu = new Menu("Geometry"));
289428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +433,11 @@
294433 genNormalsCADItem.addActionListener(this);
295434 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296435 genNormalsMESHItem.addActionListener(this);
297
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
298439 genNormalsMINEItem.addActionListener(this);
440
+ }
299441 stripifyItem = menu.add(new MenuItem("Stripify"));
300442 stripifyItem.addActionListener(this);
301443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +459,34 @@
317459 reduce34MeshItem.addActionListener(this);
318460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319461 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
324470
325471 oe.menuBar.add(menu = new Menu("Attributes"));
326472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327473 clearMaterialsItem.addActionListener(this);
474
+ resetAllItem = menu.add(new MenuItem("Reset All"));
475
+ resetAllItem.addActionListener(this);
476
+ stepAllItem = menu.add(new MenuItem("Step All"));
477
+ stepAllItem.addActionListener(this);
328478 menu.add("-");
329479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330480 liveleavesItem.addActionListener(this);
331481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
333485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334486 supportleavesItem.addActionListener(this);
335487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336488 unsupportleavesItem.addActionListener(this);
489
+ }
337490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338491 hideleavesItem.addActionListener(this);
339492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +495,14 @@
342495 markleavesItem.addActionListener(this);
343496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344497 unmarkleavesItem.addActionListener(this);
498
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
499
+ rewindleavesItem.addActionListener(this);
500
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
501
+ unrewindleavesItem.addActionListener(this);
502
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
503
+ randomleavesItem.addActionListener(this);
504
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
505
+ unrandomleavesItem.addActionListener(this);
345506 menu.add("-");
346507 flipVItem = menu.add(new MenuItem("Flip V"));
347508 flipVItem.addActionListener(this);
....@@ -377,35 +538,41 @@
377538 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378539 sortbynameItem.addActionListener(this);
379540 menu.add("-");
541
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
542
+ shareGeometriesItem.addActionListener(this);
543
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
544
+ mergeGeometriesItem.addActionListener(this);
545
+ if (Globals.ADVANCED)
546
+ {
547
+ // Pretty much the same as duplicate and clone.
380548 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381549 extractGeometriesItem.addActionListener(this);
382550 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383551 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
552
+ }
388553
389554 oe.menuBar.add(menu = new Menu("Insert"));
390555 buildCreateMenu(menu);
391556
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403557 oe.menuBar.add(menu = new Menu("Tools"));
404558 buildToolsMenu(menu);
405559 }
406560
561
+
407562 void SetupUI2(ObjEditor oe)
408563 {
564
+ // June 2019
565
+ if (oe == null)
566
+ {
567
+ //super.SetupUI2(this);
568
+ //return;
569
+ }
570
+
571
+ if (copy != group)
572
+ {
573
+ //super.SetupUI2(this);
574
+ }
575
+
409576 //new Exception().printStackTrace();
410577
411578 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,110 +601,231 @@
434601 oe.radioPanel.add(dummyButton);
435602 oe.buttonGroup.add(dummyButton);
436603 */
437
- aConstraints.gridy += 1;
604
+ cGridBag copyOptionsPanel = new cGridBag();
605
+
606
+ copyOptionsPanel.preferredHeight = 1;
438607
439608 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
440609
441
- oe.aConstraints.gridwidth = 1;
442
- oe.aConstraints.gridx = 0;
610
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ //minButton.setToolTipText("Minimize window");
612
+ //minButton.addActionListener(this);
443613
444
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
445
- liveCB.setToolTipText("Enabled animation");
446
- liveCB.addItemListener(this);
447
-
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
450
- trackCB.setToolTipText("Enable tracking");
451
- trackCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
614
+ if (Globals.ADVANCED)
615
+ {
616
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ maxButton.setToolTipText("Maximize window");
618
+ maxButton.addActionListener(this);
619
+ }
620
+
621
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ fullButton.setToolTipText("Full-screen window");
623
+ fullButton.addActionListener(this);
624
+
625
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
455626 screenfitButton.setToolTipText("Screen fit");
456627 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
628
+
629
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ restoreCameraButton.setToolTipText("Restore viewpoint");
631
+ restoreCameraButton.addActionListener(this);
632
+
633
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ saveButton.setToolTipText("New version");
635
+ saveButton.addActionListener(this);
636
+
637
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ undoButton.setToolTipText("Previous version");
639
+ undoButton.addActionListener(this);
640
+ undoButton.setEnabled(false);
641
+
642
+ cGridBag updown = new cGridBag().setVertical(true);
643
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ restoreButton.setToolTipText("Restore current");
645
+ restoreButton.addActionListener(this);
646
+ restoreButton.setEnabled(false);
647
+
648
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ replaceButton.setToolTipText("Replace current");
650
+ replaceButton.addActionListener(this);
651
+ replaceButton.setEnabled(false);
652
+
653
+ copyOptionsPanel.add(updown);
654
+
655
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ redoButton.setToolTipText("Next version");
657
+ redoButton.addActionListener(this);
658
+ redoButton.setEnabled(false);
659
+
660
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
661
+ liveCB.setToolTipText("Enable animation");
662
+ liveCB.addItemListener(this);
663
+
664
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ oneStepButton.setToolTipText("Animate one step forward");
666
+ oneStepButton.addActionListener(this);
667
+
668
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
669
+ fastCB.setToolTipText("Fast mode");
670
+ fastCB.addItemListener(this);
671
+
672
+ //oe.toolboxPanel.Return();
673
+
674
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
675
+// trackCB.setToolTipText("Enable tracking");
676
+// trackCB.addItemListener(this);
677
+
458678 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
459679 // screenfitpointButton.addActionListener(this);
460
-// oe.aConstraints.gridx += 1;
461
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
462
- snapobjectButton.addActionListener(this);
463
- snapobjectButton.setToolTipText("Snap Object");
464
- oe.aConstraints.gridx += 1;
465680
466
- //aConstraints.gridx = 0;
467
- //aConstraints.gridy += 1;
468
- oe.aConstraints.weighty = 0;
469
- oe.aConstraints.gridwidth = 1;
470
-
471
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
472
- flashSelectionButton.setToolTipText("Show selection");
473
- flashSelectionButton.addActionListener(this);
681
+ if (Globals.ADVANCED)
682
+ {
683
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ snapobjectButton.addActionListener(this);
685
+ snapobjectButton.setToolTipText("Snap Object");
686
+ }
687
+
688
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
474689
475
- oe.toolbarPanel.add(new cButton(" ", false));
476
-
477
- oe.aConstraints.gridx += 1;
478
- oe.aConstraints.weighty = 0;
479
- oe.aConstraints.gridwidth = 1;
480
-
481
- //
482
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
483
- twoButton.setToolTipText("Show center view only");
484
- twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
486691 fourButton.addActionListener(this);
487692 fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
489
- sixButton.setToolTipText("2-column layout left");
693
+
694
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ twoButton.setToolTipText("Show right view only");
696
+ twoButton.addActionListener(this);
697
+ this.fullscreenLayout = twoButton;
698
+
699
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ sixButton.setToolTipText("Show left and right");
490701 sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
492
- threeButton.setToolTipText("2-column layout right");
493
- threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
495
- sevenButton.setToolTipText("3-column layout");
496
- sevenButton.addActionListener(this);
702
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
+// threeButton.setToolTipText("2-column layout right");
704
+// threeButton.addActionListener(this);
705
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
706
+// sevenButton.setToolTipText("3-column layout");
707
+// sevenButton.addActionListener(this);
497708 //
498709
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- rootButton.setToolTipText("Edit object in new tab");
710
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ rootButton.setToolTipText("Open selection in new tab");
501712 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
713
+
714
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504715 closeButton.setToolTipText("Close tab");
505716 closeButton.addActionListener(this);
506717 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
507718 //clearButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509
-
510
- oe.aConstraints.gridx = 1; //
511
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
512
- editButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516719
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
720
+ // INSERT
721
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
722
+ gridButton.setToolTipText("Create grid");
723
+ gridButton.addActionListener(this);
724
+
725
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
+ boxButton.setToolTipText("Create box");
727
+ boxButton.addActionListener(this);
728
+
729
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ sphereButton.setToolTipText("Create sphere");
731
+ sphereButton.addActionListener(this);
732
+
733
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
734
+ coneButton.setToolTipText("Create cone");
735
+ coneButton.addActionListener(this);
736
+
737
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ torusButton.setToolTipText("Create torus");
739
+ torusButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ superButton.setToolTipText("Create superellipsoid");
743
+ superButton.addActionListener(this);
744
+
745
+ if (Globals.ADVANCED)
746
+ {
747
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ kleinButton.setToolTipText("Create Klein bottle");
749
+ kleinButton.addActionListener(this);
750
+ }
751
+
752
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ particlesButton.setToolTipText("Create particle system");
754
+ particlesButton.addActionListener(this);
755
+
756
+ oe.toolboxPanel.Return();
757
+
758
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
759
+ groupButton.setToolTipText("Create group");
760
+ groupButton.addActionListener(this);
761
+
762
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
763
+ compositeButton.setToolTipText("Create composite");
764
+ compositeButton.addActionListener(this);
765
+
766
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
767
+ switchButton.setToolTipText("Create item switcher");
768
+ switchButton.addActionListener(this);
769
+
770
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
771
+ loopButton.setToolTipText("Create loop");
772
+ loopButton.addActionListener(this);
773
+
774
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ textureButton.setToolTipText("Create texture");
776
+ textureButton.addActionListener(this);
777
+
778
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
779
+ overlayButton.setToolTipText("Create overlay");
780
+ overlayButton.addActionListener(this);
781
+
782
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
783
+ lightButton.setToolTipText("Create light");
784
+ lightButton.addActionListener(this);
785
+
786
+ for (int i=6; --i>=0;)
787
+ {
788
+ oe.toolboxPanel.Return();
789
+ oe.toolboxPanel.add(new cGridBag());
790
+ oe.toolboxPanel.add(new cGridBag());
791
+ oe.toolboxPanel.add(new cGridBag());
792
+ oe.toolboxPanel.add(new cGridBag());
793
+ oe.toolboxPanel.add(new cGridBag());
794
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ }
797
+
798
+ // EDIT panel
799
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
800
+ editButton.setToolTipText("Pin selection controls");
801
+ editButton.addActionListener(this);
802
+
803
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
804
+ uneditButton.setToolTipText("Remove selection controls");
518805 uneditButton.addActionListener(this);
519806
520
- oe.aConstraints.gridx += 1;
521
- oe.aConstraints.weighty = 0;
522
- oe.aConstraints.gridwidth = 1;
523
-
524
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
525
- clearPanelButton.addActionListener(this);
526
-
527
- oe.aConstraints.gridx += 1;
528
- oe.aConstraints.weighty = 0;
529
- oe.aConstraints.gridwidth = 1;
530
-
531
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
807
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
808
+ allParamsButton.setToolTipText("Show all controle");
532809 allParamsButton.addActionListener(this);
533810
534
- oe.aConstraints.gridx += 1;
535
- oe.aConstraints.weighty = 0;
536
- oe.aConstraints.gridwidth = 1;
537
-
538
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
811
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
812
+ clearPanelButton.setToolTipText("Clear edit panel");
813
+ clearPanelButton.addActionListener(this);
814
+
815
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
816
+ unselectButton.setToolTipText("Unselect");
539817 unselectButton.addActionListener(this);
540818
819
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
820
+ flashSelectionButton.setToolTipText("Highlight selection");
821
+ flashSelectionButton.addActionListener(this);
822
+
823
+ editCommandsPanel.preferredHeight = 1;
824
+
825
+ SetPinStates(false);
826
+// oe.treePanel.add(commandsPanel);
827
+// oe.treePanel.Return();
828
+
541829 // oe.aConstraints.gridx += 1;
542830 // oe.aConstraints.weighty = 0;
543831 // oe.aConstraints.gridwidth = 1;
....@@ -549,40 +837,25 @@
549837 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
550838 // gcButton.addActionListener(this);
551839
552
- oe.aConstraints.gridx = 0;
553
- oe.aConstraints.gridy += 1;
554
-
555
- //ctrlPanel.add(objList = new List(5, true));
556
- oe.aConstraints.gridwidth = 100;
557
- // oe.aConstraints.gridheight = 100;
558
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
559
- oe.aConstraints.gridheight = 1;
560
- oe.aConstraints.weighty = 0.5;
561
- oe.aConstraints.gridx = 0;
562
- JScrollPane jSP;
840
+ cGridBag jSPPanel = new cGridBag();
841
+
842
+ JScrollPane jSP;
563843 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
564
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
844
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
565845 ResetModel();
566
- oe.aConstraints.weighty = 0.5;
567
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
568
- oe.aConstraints.gridy += 1;
569
- oe.aConstraints.gridwidth = 1;
570
-
571
- oe.aConstraints.weighty = 0;
572
- oe.aConstraints.gridwidth = 2;
573
-
574
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
575
- colorCB.addItemListener(this);
576
- oe.aConstraints.gridx += 2;
577
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
578
- materialCB.addItemListener(this);
579
- oe.aConstraints.gridx += 2;
580
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
581
- textureCB.addItemListener(this);
582
-
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585846
847
+ oe.treePanel.add(jSPPanel);
848
+ oe.treePanel.Return();
849
+
850
+ oe.treePanel.add(copyOptionsPanel);
851
+ oe.treePanel.Return();
852
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
853
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
854
+ sliderPane.preferredHeight = 1;
855
+
856
+// mainPanel.setDividerLocation(0.5); //1.0);
857
+// mainPanel.setResizeWeight(0.5);
858
+
586859 //jList.addListSelectionListener(this);
587860 oe.jTree.addTreeSelectionListener(this);
588861 //jTree.setRootVisible(false);
....@@ -601,53 +874,67 @@
601874 dgr.addDragGestureListener(this);
602875 }catch(Exception e) {}
603876 */
604
- radio.layout = sevenButton;
877
+ radio.layout = sixButton; // sevenButton;
605878 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
606879 }
607880
608881 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609882 {
610
- //constraints.gridx = 0;
611
- //constraints.gridy = 0;
612
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
- fastCB.setToolTipText("Fast mode");
614
- fastCB.addItemListener(this);
615
- //constraints.gridy += 1;
616
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
- supportCB.setToolTipText("Enabled rigging");
618
- supportCB.addItemListener(this);
883
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
884
+ colorCB.setToolTipText("Copy color when dropped");
885
+ colorCB.addItemListener(this);
619886
620
- // constraints.gridy += 1;
887
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
888
+ materialCB.setToolTipText("Copy material when dropped");
889
+ materialCB.addItemListener(this);
890
+
891
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
892
+ textureCB.setToolTipText("Copy texture when dropped");
893
+ textureCB.addItemListener(this);
894
+
895
+ panel.Return();
896
+
897
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
898
+ boxCB.setToolTipText("Display bounding boxes");
899
+ boxCB.addItemListener(this);
900
+
901
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
902
+ zoomBoxCB.setToolTipText("Display only for wheel");
903
+ zoomBoxCB.addItemListener(this);
904
+
905
+ if (true) // Globals.ADVANCED)
906
+ {
907
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
908
+// supportCB.setToolTipText("Enable rigging");
909
+// supportCB.addItemListener(this);
910
+
911
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
912
+ freezeCB.setToolTipText("Fast moving camera");
913
+ freezeCB.addItemListener(this);
914
+
621915 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622916 // localCB.addItemListener(this);
623917
624
- //constraints.gridy += 1;
918
+ panel.Return();
919
+
625920 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
626921 crowdCB.setToolTipText("Used for crowds");
627922 crowdCB.addItemListener(this);
628923
629
- //constraints.gridy += 1;
630924 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
631925 smoothCB.setToolTipText("Snapping delay");
632926 smoothCB.addItemListener(this);
633927
634
- //constraints.gridy += 1;
635928 panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636929 slowCB.setToolTipText("Smooth interpolation");
637930 slowCB.addItemListener(this);
638
- //constraints.gridy += 1;
639
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640
- boxCB.setToolTipText("Display bounding boxes");
641
- boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
643
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645
- zoomBoxCB.addItemListener(this);
646
-
931
+
647932 // constraints.gridy += 1;
648933 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649934 // speakerMocapCB.addItemListener(this);
650935
936
+ panel.Return();
937
+
651938 if (false)
652939 {
653940 // handled in scripts
....@@ -662,36 +949,85 @@
662949 //constraints.gridy += 1;
663950 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
664951 smoothfocusCB.addItemListener(this);
952
+ panel.Return();
665953 }
666954
667955 //constraints.gridx += 1;
668956 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669957 // debugCB.addItemListener(this);
670958
671
- //constraints.gridy += 1;
959
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
960
+ trackCB.setToolTipText("Enable tracking target");
961
+ trackCB.addItemListener(this);
962
+
672963 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
964
+ oeilCB.setToolTipText("Move camera when tracking");
673965 oeilCB.addItemListener(this);
674966
675
- //constraints.gridy += 1;
967
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
968
+ shadowCB.setToolTipText("When live compute shadows");
969
+ shadowCB.addItemListener(this);
970
+
971
+ panel.Return();
972
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
973
+ toggleTextureCB.setToolTipText("Load textures");
974
+ toggleTextureCB.addItemListener(this);
975
+
976
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
977
+ toggleSwitchCB.setToolTipText("Choose a single item");
978
+ toggleSwitchCB.addItemListener(this);
979
+
980
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
981
+ autokeepCB.setToolTipText("On structure change");
982
+ autokeepCB.addItemListener(this);
983
+
984
+ panel.Return();
985
+ if (Globals.ADVANCED)
986
+ {
676987 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677988 lookAtCB.setToolTipText("Look-at target");
678989 lookAtCB.addItemListener(this);
990
+ }
991
+
992
+ }
993
+
994
+ cGridBag fill = new cGridBag();
995
+ fill.preferredHeight = 200;
996
+ cGridBag fill2 = new cGridBag();
997
+ fill2.preferredHeight = 200;
998
+ cGridBag fill3 = new cGridBag();
999
+ fill3.preferredHeight = 200;
1000
+
1001
+ panel.add(fill);
1002
+ panel.add(fill2);
1003
+ panel.add(fill3);
6791004
6801005 }
6811006
6821007 void EditObject(Object3D obj)
6831008 {
6841009 cRadio radioButton = new cRadio(obj.name);
1010
+
1011
+ // June 2019. Patch to avoid bug with transparency.
1012
+ radioButton.hadMaterial = obj.material != null;
1013
+ if (!radioButton.hadMaterial)
1014
+ {
1015
+ obj.material = new cMaterial();
1016
+ }
1017
+
6851018 radioButton.SetObject(obj);
686
- radioButton.layout = sevenButton;
1019
+ radioButton.layout = sixButton; // sevenButton;
6871020 radioButton.SetCamera(cameraView.renderCamera, false);
6881021 radioButton.addActionListener(this);
6891022 radioPanel.add(radioButton);
6901023 buttonGroup.add(radioButton);
6911024 radioButton.doClick();
6921025 }
1026
+
6931027 void SetupViews(ObjEditor oe)
6941028 {
1029
+ theFrame = this;
1030
+
6951031 oe.SetupViews();
6961032
6971033 System.out.println("SetupViews");
....@@ -700,23 +1036,28 @@
7001036 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7011037 }
7021038
703
- JCheckBox liveCB;
704
- JCheckBox supportCB;
705
- JCheckBox localCB;
706
- JCheckBox crowdCB;
707
- JCheckBox smoothCB;
708
- JCheckBox fastCB;
709
- JCheckBox slowCB;
710
- JCheckBox boxCB;
711
- JCheckBox zoomBoxCB;
712
- JCheckBox trackCB;
713
- JCheckBox smoothfocusCB;
1039
+ cToggleButton liveCB;
1040
+ cCheckBox supportCB;
1041
+ cCheckBox localCB;
1042
+ cCheckBox crowdCB;
1043
+ cCheckBox smoothCB;
1044
+ cToggleButton fastCB;
1045
+ cCheckBox slowCB;
1046
+ cCheckBox boxCB;
1047
+ cCheckBox zoomBoxCB;
1048
+ cCheckBox freezeCB;
1049
+ //cToggleButton trackCB;
1050
+ cCheckBox trackCB;
1051
+ cCheckBox smoothfocusCB;
7141052 // JCheckBox speakerMocapCB;
715
- JCheckBox speakerCameraCB;
716
- JCheckBox speakerFocusCB;
717
- JCheckBox debugCB;
718
- JCheckBox oeilCB;
719
- JCheckBox lookAtCB;
1053
+ cCheckBox speakerCameraCB;
1054
+ cCheckBox speakerFocusCB;
1055
+ cCheckBox debugCB;
1056
+
1057
+ cCheckBox oeilCB;
1058
+ cCheckBox shadowCB;
1059
+ cCheckBox autokeepCB;
1060
+ cCheckBox lookAtCB;
7201061
7211062 // static int COLOR = 1;
7221063 // static int MATERIAL = 2;
....@@ -724,9 +1065,9 @@
7241065
7251066 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7261067
727
- JCheckBox colorCB;
728
- JCheckBox materialCB;
729
- JCheckBox textureCB;
1068
+ cCheckBox colorCB;
1069
+ cCheckBox materialCB;
1070
+ cCheckBox textureCB;
7301071
7311072 public void itemStateChanged(ItemEvent e)
7321073 {
....@@ -754,6 +1095,7 @@
7541095 } else if(e.getSource() == liveCB)
7551096 {
7561097 cameraView.ToggleLive();
1098
+ refreshContents(false);
7571099 }
7581100 else if(e.getSource() == supportCB)
7591101 {
....@@ -818,6 +1160,18 @@
8181160 {
8191161 cameraView.ToggleOeil();
8201162 }
1163
+ else if(e.getSource() == shadowCB)
1164
+ {
1165
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1166
+ }
1167
+ else if(e.getSource() == freezeCB)
1168
+ {
1169
+ Globals.FREEZEONMOVE ^= true;
1170
+ }
1171
+ else if(e.getSource() == autokeepCB)
1172
+ {
1173
+ Globals.REPLACEONMAKE ^= true;
1174
+ }
8211175 else if(e.getSource() == lookAtCB)
8221176 {
8231177 cameraView.ToggleLookAt();
....@@ -834,7 +1188,8 @@
8341188
8351189 /**/
8361190 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
837
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1191
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1192
+ TreePath path = objEditor.jTree.getSelectionPath();
8381193 if ((path == null) || (path.getPathCount() <= 1)) {
8391194 // We can't move the root node or an empty selection
8401195 return;
....@@ -897,8 +1252,6 @@
8971252 }
8981253 }
8991254
900
- String string = (String) object;
901
-
9021255 System.out.println("Transfer = " + object + "; drop : " + target);
9031256 // if( object instanceof java.io.File[])
9041257 // {
....@@ -906,7 +1259,11 @@
9061259 // objEditor.DropFile((java.io.File[]) object, true);
9071260 // return;
9081261 // }
909
- if (string.charAt(0) == '/')
1262
+
1263
+ String string = object.toString();
1264
+
1265
+ // File path for Mac and Windows
1266
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9101267 {
9111268 // file(s)
9121269 String[] names = string.split("\n");
....@@ -933,7 +1290,7 @@
9331290
9341291 flashIt = false;
9351292 CameraPane pane = (CameraPane) target;
936
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1293
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9371294 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9381295
9391296 if (group.selection.size() == 1)
....@@ -949,23 +1306,33 @@
9491306
9501307 assert target == objEditor.jTree;
9511308 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1309
+ Object3D destinationLeaf;
9521310 try {
953
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1311
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9541312 } catch (Exception e) {
9551313 System.out.println("destinationPath : " + destinationPath);
9561314 return;
9571315 }
9581316
959
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1317
+ for (int i=group.selection.size(); --i>=0;)
9601318 {
1319
+ Object3D child = (Object3D)group.selection.elementAt(i);
1320
+
1321
+ // Cannot move into itself
1322
+ if (child == destinationLeaf)
1323
+ return;
1324
+ }
1325
+
1326
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1327
+// {
9611328 loadClipboard(true);
9621329 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
964
- } else {
965
- loadClipboard(false);
966
- objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
968
- }
1330
+ pasteInto(false, false);
1331
+// } else {
1332
+// loadClipboard(false);
1333
+// objEditor.jTree.setSelectionPath(destinationPath);
1334
+// pasteInto(false, false); // true); // ???
1335
+// }
9691336 }
9701337 public void dropActionChanged(DropTargetDragEvent dtde)
9711338 // Called if the user has modified the current drop gesture
....@@ -1070,85 +1437,107 @@
10701437 {
10711438 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10721439 //heightFieldItem.addActionListener(this);
1073
- gridItem = menu.add(new MenuItem("Grid"));
1074
- gridItem.addActionListener(this);
1075
- rectoidItem = menu.add(new MenuItem("Box"));
1076
- rectoidItem.addActionListener(this);
1077
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1078
- ellipsoidItem.addActionListener(this);
1079
- coneItem = menu.add(new MenuItem("Cone"));
1080
- coneItem.addActionListener(this);
1081
- torusItem = menu.add(new MenuItem("Torus"));
1082
- torusItem.addActionListener(this);
1083
- superItem = menu.add(new MenuItem("Superellipsoid"));
1084
- superItem.addActionListener(this);
1440
+// gridItem = menu.add(new MenuItem("Grid"));
1441
+// gridItem.addActionListener(this);
1442
+// rectoidItem = menu.add(new MenuItem("Box"));
1443
+// rectoidItem.addActionListener(this);
1444
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1445
+// ellipsoidItem.addActionListener(this);
1446
+// coneItem = menu.add(new MenuItem("Cone"));
1447
+// coneItem.addActionListener(this);
1448
+// torusItem = menu.add(new MenuItem("Torus"));
1449
+// torusItem.addActionListener(this);
1450
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1451
+// superItem.addActionListener(this);
1452
+
1453
+ cameraItem = menu.add(new MenuItem("Camera"));
1454
+ cameraItem.addActionListener(this);
1455
+
1456
+ if (!Globals.ADVANCED)
1457
+ {
10851458 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10861459 kleinItem.addActionListener(this);
1087
- particleItem = menu.add(new MenuItem("Particle system"));
1088
- particleItem.addActionListener(this);
1460
+ }
1461
+
1462
+// particleItem = menu.add(new MenuItem("Particle system"));
1463
+// particleItem.addActionListener(this);
1464
+ if (Globals.ADVANCED)
1465
+ {
10891466 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901467 ragdollItem.addActionListener(this);
10911468 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921469 ragdoll2Item.addActionListener(this);
1470
+ }
10931471 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1472
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951473 meshItem.addActionListener(this);
10961474 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971475 // meshGroupItem.addActionListener(this);
1476
+ if (Globals.ADVANCED)
1477
+ {
10981478 springItem = menu.add(new MenuItem("Spring"));
10991479 springItem.addActionListener(this);
11001480 flagItem = menu.add(new MenuItem("Flag"));
11011481 flagItem.addActionListener(this);
1102
- bezierItem = menu.add(new MenuItem("Patch"));
1103
- bezierItem.addActionListener(this);
1104
- checkerItem = menu.add(new MenuItem("Checker"));
1105
- checkerItem.addActionListener(this);
11061482 blobItem = menu.add(new MenuItem("Blob"));
11071483 blobItem.addActionListener(this);
11081484 latheItem = menu.add(new MenuItem("Lathe"));
11091485 latheItem.addActionListener(this);
1110
- lightItem = menu.add(new MenuItem("Light"));
1111
- lightItem.addActionListener(this);
1486
+ }
1487
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1488
+ bezierItem.addActionListener(this);
1489
+// overlayItem = menu.add(new MenuItem("Overlay"));
1490
+// overlayItem.addActionListener(this);
1491
+// lightItem = menu.add(new MenuItem("Light"));
1492
+// lightItem.addActionListener(this);
11121493 menu.add("-");
11131494 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11141495 //superLoopItem.addActionListener(this);
1115
- loopItem = menu.add(new MenuItem("Loop"));
1116
- loopItem.addActionListener(this);
1496
+// loopItem = menu.add(new MenuItem("Loop"));
1497
+// loopItem.addActionListener(this);
11171498 doubleItem = menu.add(new MenuItem("Fork"));
11181499 doubleItem.addActionListener(this);
1500
+ if (Globals.ADVANCED)
1501
+ {
11191502 tripleItem = menu.add(new MenuItem("Trident"));
11201503 tripleItem.addActionListener(this);
1504
+ }
11211505 }
11221506
11231507 void buildToolsMenu(Menu menu)
11241508 {
11251509 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261510 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1511
+ animationItem.setState(Globals.ANIMATION);
1512
+
1513
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1514
+ archiveItem.addActionListener(this);
11281515
11291516 menu.add("-");
11301517 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311518 parseverticesItem.addActionListener(this);
11321519 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331520 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1521
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351522 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381523 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391524 reduceMorphItem.addActionListener(this);
11401525 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411526 reduce34MorphItem.addActionListener(this);
1142
-
1143
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1144
- computeAOItem.addActionListener(this);
11451527 menu.add("-");
1146
-
11471528 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481529 memoryItem.addActionListener(this);
1530
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1531
+ computeAOItem.addActionListener(this);
1532
+
1533
+ if (Globals.ADVANCED)
1534
+ {
1535
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1536
+ mirrorItem.addActionListener(this);
1537
+ menu.add("-");
11491538 menu.add(analyzeItem = new MenuItem("Analyze"));
11501539 analyzeItem.addActionListener(this);
1151
- menu.add(dumpItem = new MenuItem("Dump"));
1540
+ menu.add(dumpItem = new MenuItem("Print"));
11521541 dumpItem.addActionListener(this);
11531542 // menu.add(pathItem = new MenuItem("From-to path"));
11541543 // pathItem.addActionListener(this);
....@@ -1166,6 +1555,7 @@
11661555 menu.add("-");
11671556 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681557 editScriptItem.addActionListener(this);
1558
+ }
11691559 }
11701560
11711561 void ScreenFit()
....@@ -1288,9 +1678,34 @@
12881678 shadow.material = new cMaterial(obj.material);
12891679 shadow.material.diffuse = 0.0001f;
12901680 shadow.material.specular = 0.0001f;
1681
+ //shadow.projectedVertices[1].x = 300;
12911682
12921683 makeSomething(shadow);
12931684 }
1685
+
1686
+ private void ClearUnpinned()
1687
+ {
1688
+ //for (Object3D obj : listUI)
1689
+ for (int i=listUI.size(); --i>=0;)
1690
+ {
1691
+ Object3D obj = listUI.elementAt(i);
1692
+ if (!obj.pinned)
1693
+ {
1694
+ obj.CloseUI();
1695
+ listUI.remove(i);
1696
+ }
1697
+ }
1698
+ }
1699
+
1700
+ private void EditElement(Object3D elem, boolean newWindow)
1701
+ {
1702
+ // if (!(elem instanceof Composite))
1703
+ // newWindow = false;
1704
+ listUI.add(elem);
1705
+ elem.openEditWindow(this, newWindow); //, false);
1706
+ System.out.println("edit : " + elem);
1707
+ elem.editWindow.refreshContents(true); // ? new
1708
+ }
12941709
12951710 /**
12961711 * applyExample
....@@ -1494,9 +1909,9 @@
14941909
14951910 void Overwrite(int mask)
14961911 {
1497
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1912
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14981913 {
1499
- Object3D content = GrafreeD.clipboard.get(0);
1914
+ Object3D content = Grafreed.clipboard.get(0);
15001915
15011916 if (content instanceof cGroup && ((cGroup)content).transientlink )
15021917 content = ((cGroup)content).get(0);
....@@ -1535,7 +1950,7 @@
15351950 {
15361951 ScreenFit();
15371952 } else
1538
- if (source == switchItem)
1953
+ if (source == switchViewItem)
15391954 {
15401955 cVector v1 = new cVector();
15411956 cVector v2 = new cVector();
....@@ -1544,11 +1959,11 @@
15441959 objEditor.cameraView.renderCamera.setAim(v2, v1);
15451960 objEditor.cameraView.repaint();
15461961 } else
1547
- if (source == rectoidItem)
1962
+ if (source == rectoidItem || source == boxButton)
15481963 {
15491964 makeSomething(new Box());
15501965 } else
1551
- if (source == particleItem)
1966
+ if (source == particleItem || source == particlesButton)
15521967 {
15531968 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15541969 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1627,27 +2042,27 @@
16272042
16282043 makeSomething(obj);
16292044 } else
1630
- if (source == gridItem)
2045
+ if (source == gridItem || source == gridButton)
16312046 {
16322047 makeSomething(new Grid());
16332048 } else
1634
- if (source == ellipsoidItem)
2049
+ if (source == ellipsoidItem || source == sphereButton)
16352050 {
16362051 makeSomething(new Sphere());
16372052 } else
1638
- if (source == coneItem)
2053
+ if (source == coneItem || source == coneButton)
16392054 {
16402055 makeSomething(new Cone());
16412056 } else
1642
- if (source == torusItem)
2057
+ if (source == torusItem || source == torusButton)
16432058 {
16442059 makeSomething(new Torus());
16452060 } else
1646
- if (source == superItem)
2061
+ if (source == superItem || source == superButton)
16472062 {
16482063 makeSomething(new Superellipsoid());
16492064 } else
1650
- if (source == kleinItem)
2065
+ if (source == kleinItem || source == kleinButton)
16512066 {
16522067 makeSomething(new Klein());
16532068 } else
....@@ -1667,7 +2082,7 @@
16672082 {
16682083 makeSomething(new BezierSurface());
16692084 } else
1670
- if (source == checkerItem)
2085
+ if (source == overlayItem || source == overlayButton)
16712086 {
16722087 /*
16732088 Object3D obj = new BezierSurface(5,8);
....@@ -1715,7 +2130,7 @@
17152130 s.setup();
17162131 makeSomething(s);
17172132 } else
1718
- if (source == lightItem)
2133
+ if (source == lightItem || source == lightButton)
17192134 {
17202135 makeSomething(new Light());
17212136 } else
....@@ -1765,30 +2180,30 @@
17652180
17662181 group(g);
17672182 } else
1768
- if (source == loopItem)
2183
+ if (source == loopItem || source == loopButton)
17692184 {
17702185 Composite csg = new GroupLeaf();
17712186 csg.count = 5;
17722187 group(csg);
1773
- Composite child = new cGroup();
2188
+ Composite child = new cGroup("Branch");
17742189 csg.addChild(child);
17752190 child.addChild(csg);
17762191 } else
17772192 if (source == doubleItem)
17782193 {
1779
- Composite csg = new GroupLeaf();
2194
+ Composite csg = new GroupLeaf("Fork");
17802195 csg.count = 5;
17812196 group(csg);
1782
- Composite child = new cGroup();
2197
+ Composite child = new cGroup("Branch A");
17832198 csg.addChild(child);
17842199 child.addChild(csg);
1785
- child = new cGroup();
2200
+ child = new cGroup("Branch B");
17862201 csg.addChild(child);
17872202 child.addChild(csg);
17882203 } else
17892204 if (source == tripleItem)
17902205 {
1791
- Composite csg = new GroupLeaf();
2206
+ Composite csg = new GroupLeaf("Trident");
17922207 csg.count = 4;
17932208 group(csg);
17942209 Composite child = new cGroup();
....@@ -1800,23 +2215,6 @@
18002215 child = new cGroup();
18012216 csg.addChild(child);
18022217 child.addChild(csg);
1803
- } else
1804
-
1805
- if (source == importGFDItem)
1806
- {
1807
- ImportGFD();
1808
- } else
1809
- if (source == importVRMLX3DItem)
1810
- {
1811
- ImportVRMLX3D();
1812
- } else
1813
- if (source == import3DSItem)
1814
- {
1815
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1816
- } else
1817
- if (source == importOBJItem)
1818
- {
1819
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18202218 } else
18212219 if (source == computeAOItem)
18222220 {
....@@ -1836,7 +2234,7 @@
18362234 if (source == invariantsItem)
18372235 {
18382236 System.out.println("Invariants:");
1839
- GrafreeD.grafreeD.universe.invariants();
2237
+ Grafreed.grafreeD.universe.invariants();
18402238 } else
18412239 if (source == memoryItem)
18422240 {
....@@ -1855,19 +2253,61 @@
18552253 {
18562254 DumpObject();
18572255 } else
2256
+ if (source == minButton)
2257
+ {
2258
+ Minimize();
2259
+ } else
2260
+ if (source == maxButton)
2261
+ {
2262
+ Maximize();
2263
+ } else
2264
+ if (source == fullButton)
2265
+ {
2266
+ ToggleFullScreen();
2267
+ } else
2268
+ if (source == undoButton)
2269
+ {
2270
+ // Go to previous version
2271
+ //if (!Undo())
2272
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2273
+ Undo();
2274
+ } else
2275
+ if (source == restoreButton)
2276
+ {
2277
+ // Restore current version
2278
+ Restore();
2279
+ } else
2280
+ if (source == replaceButton)
2281
+ {
2282
+ // Overwrite current version
2283
+ Replace();
2284
+ } else
2285
+ if (source == redoButton)
2286
+ {
2287
+ // Go to next version
2288
+ Redo();
2289
+ } else
2290
+ if (source == saveButton)
2291
+ {
2292
+ // Save a new version
2293
+ if (!Save(true))
2294
+ java.awt.Toolkit.getDefaultToolkit().beep();
2295
+ } else
2296
+ if (source == oneStepButton)
2297
+ {
2298
+ Globals.ONESTEP = true;
2299
+ cameraView.repaint();
2300
+ } else
18582301 if (source == screenfitButton)
18592302 {
1860
- //Reload(lastConverter, lastFilename, true);
18612303 ScreenFit();
18622304 } else
18632305 if (source == screenfitpointButton)
18642306 {
1865
- //Reload(lastConverter, lastFilename, true);
18662307 ScreenFitPoint();
18672308 } else
18682309 if (source == snapobjectButton)
18692310 {
1870
- //Reload(lastConverter, lastFilename, true);
18712311 SnapObject();
18722312 } else
18732313 // if (event.getSource() == recompileButton)
....@@ -1904,12 +2344,20 @@
19042344 {
19052345 loadClipboard(true);
19062346 } else
2347
+ if (source == undoItem)
2348
+ {
2349
+ Undo();
2350
+ } else
2351
+ if (source == redoItem)
2352
+ {
2353
+ Redo();
2354
+ } else
19072355 if (source == duplicateItem)
19082356 {
1909
- Object3D keep = GrafreeD.clipboard;
2357
+ Object3D keep = Grafreed.clipboard;
19102358 loadClipboard(false);
19112359 paste(false);
1912
- GrafreeD.clipboard = keep;
2360
+ Grafreed.clipboard = keep;
19132361 } else
19142362 if (source == cloneItem)
19152363 {
....@@ -1927,13 +2375,17 @@
19272375 {
19282376 paste(false);
19292377 } else
2378
+ if (source == pasteIntoItem)
2379
+ {
2380
+ pasteInto(true, false);
2381
+ } else
19302382 if (source == pasteLinkItem)
19312383 {
1932
- pasteInto(false);
2384
+ pasteInto(false, false);
19332385 } else
19342386 if (source == pasteCloneItem)
19352387 {
1936
- pasteInto(true);
2388
+ pasteInto(true, true);
19372389 } else
19382390 if (source == pasteExpandItem)
19392391 {
....@@ -2125,9 +2577,9 @@
21252577 // group.selection.get(0).setMasterThis(content); // should be identity
21262578 // refreshContents();
21272579 // }
2128
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2580
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21292581 {
2130
- Object3D content = GrafreeD.clipboard.get(0);
2582
+ Object3D content = Grafreed.clipboard.get(0);
21312583
21322584 if (content instanceof cGroup && ((cGroup)content).transientlink )
21332585 content = ((cGroup)content).get(0);
....@@ -2135,11 +2587,11 @@
21352587 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21362588 for (int i=0; i<group.selection.size(); i++)
21372589 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2590
+ boolean random = CameraPane.SWITCH;
2591
+ CameraPane.SWITCH = false; // parse all random nodes
21402592 group.selection.get(i).linkVerticesThis(content);
21412593 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
2594
+ CameraPane.SWITCH = random;
21432595 }
21442596 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21452597 refreshContents();
....@@ -2149,20 +2601,20 @@
21492601 {
21502602 for (int i=0; i<group.selection.size(); i++)
21512603 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2604
+ boolean random = CameraPane.SWITCH;
2605
+ CameraPane.SWITCH = false; // parse all random nodes
21542606 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
2607
+ CameraPane.SWITCH = random;
21562608 }
21572609
21582610 refreshContents();
21592611 } else
21602612 if (source == relinkverticesItem)
21612613 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
2614
+ boolean random = CameraPane.SWITCH;
2615
+ CameraPane.SWITCH = false; // parse all random nodes
21642616 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
2617
+ CameraPane.SWITCH = random;
21662618
21672619 refreshContents();
21682620 } else
....@@ -2177,9 +2629,9 @@
21772629 } else
21782630 if (source == setMasterItem)
21792631 {
2180
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2632
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21812633 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2634
+ Object3D content = Grafreed.clipboard.get(0);
21832635
21842636 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852637 content = ((cGroup)content).get(0);
....@@ -2192,9 +2644,9 @@
21922644 {
21932645 if (group.selection.size() == 1)
21942646 {
2195
- if (GrafreeD.clipboard.size() == 1)
2647
+ if (Grafreed.clipboard.size() == 1)
21962648 {
2197
- Object3D content = GrafreeD.clipboard.get(0);
2649
+ Object3D content = Grafreed.clipboard.get(0);
21982650
21992651 if (content instanceof cGroup && ((cGroup)content).transientlink )
22002652 content = ((cGroup)content).get(0);
....@@ -2211,7 +2663,7 @@
22112663 {
22122664 RevertMeshes();
22132665 } else
2214
- if (source == resetMeshItem)
2666
+ if (source == resetAllItem)
22152667 {
22162668 ResetAll();
22172669 } else
....@@ -2219,7 +2671,7 @@
22192671 {
22202672 StepAll();
22212673 } else
2222
- if (source == clearItem) // || event.getSource() == clearButton)
2674
+ if (source == deleteItem) // || event.getSource() == clearButton)
22232675 {
22242676 //int indices[] = jList.getSelectedIndices();
22252677 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2231,9 +2683,9 @@
22312683 {
22322684 ClearSelection(true);
22332685 } else
2234
- if (source == grabItem)
2686
+ if (source == grabItem || source == groupButton)
22352687 {
2236
- group(new cGroup(), true);
2688
+ group(new cGroup(), false); // true);
22372689 } else
22382690 if (source == hideItem)
22392691 {
....@@ -2251,16 +2703,16 @@
22512703 {
22522704 makeSomething(new Camera());
22532705 } else
2254
- if (source == compositeItem)
2706
+ if (source == compositeItem || source == compositeButton)
22552707 {
22562708 group(new Composite());
22572709 } else
2258
- if (source == randomItem)
2710
+ if (source == switchItem || source == switchButton)
22592711 {
22602712 RandomNode random = new RandomNode();
22612713 group(random);
22622714 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
2715
+ random.name = random.get(0).name + "Switch";
22642716 } else
22652717 if (source == physicsItem)
22662718 {
....@@ -2357,7 +2809,7 @@
23572809 {
23582810 group(new cLinker());
23592811 } else
2360
- if (source == textureItem)
2812
+ if (source == textureItem || source == textureButton)
23612813 {
23622814 group(new TextureNode());
23632815 } else
....@@ -2377,17 +2829,30 @@
23772829 {
23782830 CastShadow(2);
23792831 } else
2380
- if (source == ungroupItem)
2832
+ if (source == ungroupItem || source == ungroupButton)
23812833 {
2382
- //ungroup();
2834
+ boolean hasRoot = false;
2835
+
23832836 for (int i=0; i<group.selection.size(); i++)
23842837 {
2385
- Ungroup(group.selection.get(i));
2838
+ if (group.selection.get(i) == group)
2839
+ {
2840
+ hasRoot = true;
2841
+ break;
2842
+ }
23862843 }
23872844
2388
- ClearSelection(false);
2389
-
2390
- refreshContents();
2845
+ if (!hasRoot)
2846
+ {
2847
+ for (int i=0; i<group.selection.size(); i++)
2848
+ {
2849
+ Ungroup(group.selection.get(i));
2850
+ }
2851
+
2852
+ ClearSelection(false);
2853
+
2854
+ refreshContents();
2855
+ }
23912856 } else
23922857 if (source == genUVItem)
23932858 {
....@@ -2399,7 +2864,7 @@
23992864 } else
24002865 if (source == genNormalsMESHItem)
24012866 {
2402
- GenNormals(true); // TODO
2867
+ GenNormalsMESH();
24032868 } else
24042869 if (source == genNormalsORGANItem)
24052870 {
....@@ -2464,6 +2929,22 @@
24642929 if (source == unmarkleavesItem)
24652930 {
24662931 MarkLeaves(false);
2932
+ } else
2933
+ if (source == rewindleavesItem)
2934
+ {
2935
+ RewindLeaves(true);
2936
+ } else
2937
+ if (source == unrewindleavesItem)
2938
+ {
2939
+ RewindLeaves(false);
2940
+ } else
2941
+ if (source == randomleavesItem)
2942
+ {
2943
+ RandomLeaves(true);
2944
+ } else
2945
+ if (source == unrandomleavesItem)
2946
+ {
2947
+ RandomLeaves(false);
24672948 } else
24682949 if (source == flipVItem)
24692950 {
....@@ -2549,9 +3030,13 @@
25493030 {
25503031 SmoothMesh();
25513032 } else
2552
- if (source == transformgeometryItem)
3033
+ if (source == transformGeometryItem)
25533034 {
25543035 TransformGeometry();
3036
+ } else
3037
+ if (source == transformChildrenItem)
3038
+ {
3039
+ TransformChildren();
25553040 } else
25563041 if (source == resetTransformItem)
25573042 {
....@@ -2559,7 +3044,11 @@
25593044 } else
25603045 if (source == resetCentroidItem)
25613046 {
2562
- ResetCentroid();
3047
+ ResetCentroid(true);
3048
+ } else
3049
+ if (source == resetCentroidXZItem)
3050
+ {
3051
+ ResetCentroid(false);
25633052 } else
25643053 if (source == resetParentItem)
25653054 {
....@@ -2691,6 +3180,10 @@
26913180 if (source == twoButton)
26923181 {
26933182 radio.layout = twoButton;
3183
+
3184
+ if (CameraPane.FULLSCREEN)
3185
+ fullscreenLayout = radio.layout;
3186
+
26943187 // bug
26953188 //gridPanel.setDividerLocation(1.0);
26963189 //bigPanel.setDividerLocation(0.0);
....@@ -2723,10 +3216,31 @@
27233216 bigThree.ClearUI();
27243217 bigThree.add(centralPanel);
27253218 bigThree.FlushUI();
3219
+
3220
+ cameraView.requestFocusInWindow();
3221
+
3222
+// refreshContents(true);
3223
+//
3224
+// try
3225
+// {
3226
+// java.awt.Robot bot = new java.awt.Robot();
3227
+// int mask = InputEvent.BUTTON1_MASK;
3228
+// bot.mouseMove(100, 100);
3229
+// bot.mousePress(mask);
3230
+// bot.mouseRelease(mask);
3231
+// }
3232
+// catch (Exception e)
3233
+// {
3234
+//
3235
+// }
3236
+
27263237 } else
27273238 if (source == threeButton)
27283239 {
27293240 radio.layout = threeButton;
3241
+
3242
+ if (CameraPane.FULLSCREEN)
3243
+ fullscreenLayout = radio.layout;
27303244
27313245 // bigThree.remove(scenePanel);
27323246 // bigThree.remove(centralPanel);
....@@ -2759,10 +3273,15 @@
27593273 bigThree.add(centralPanel);
27603274 bigThree.add(XYZPanel);
27613275 bigThree.FlushUI();
3276
+
3277
+ cameraView.requestFocusInWindow();
27623278 } else
27633279 if (source == fourButton)
27643280 {
27653281 radio.layout = fourButton;
3282
+
3283
+ if (CameraPane.FULLSCREEN)
3284
+ fullscreenLayout = radio.layout;
27663285
27673286 // bigThree.remove(scenePanel);
27683287 // bigThree.remove(centralPanel);
....@@ -2794,10 +3313,15 @@
27943313 bigThree.ClearUI();
27953314 bigThree.add(scenePanel);
27963315 bigThree.FlushUI();
3316
+
3317
+ cameraView.requestFocusInWindow();
27973318 } else
27983319 if (source == sixButton)
27993320 {
28003321 radio.layout = sixButton;
3322
+
3323
+ if (CameraPane.FULLSCREEN)
3324
+ fullscreenLayout = radio.layout;
28013325
28023326 // bigThree.remove(scenePanel);
28033327 // bigThree.remove(centralPanel);
....@@ -2830,10 +3354,15 @@
28303354 bigThree.add(scenePanel);
28313355 bigThree.add(centralPanel);
28323356 bigThree.FlushUI();
3357
+
3358
+ cameraView.requestFocusInWindow();
28333359 } else
28343360 if (source == sevenButton)
28353361 {
28363362 radio.layout = sevenButton;
3363
+
3364
+ if (CameraPane.FULLSCREEN)
3365
+ fullscreenLayout = radio.layout;
28373366
28383367 // bigThree.remove(scenePanel);
28393368 // bigThree.remove(centralPanel);
....@@ -2867,6 +3396,8 @@
28673396 bigThree.add(centralPanel);
28683397 bigThree.add(XYZPanel);
28693398 bigThree.FlushUI();
3399
+
3400
+ cameraView.requestFocusInWindow();
28703401 } else
28713402 if (source == rootButton)
28723403 {
....@@ -2878,6 +3409,7 @@
28783409 EditObject(obj);
28793410 }
28803411
3412
+ cameraView.requestFocusInWindow();
28813413 refreshContents(true);
28823414 } else
28833415 if (source == closeButton)
....@@ -2887,22 +3419,37 @@
28873419 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28883420 {
28893421 ab = (cRadio)e.nextElement();
2890
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3422
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28913423 {
3424
+ // Patch to avoid bug with transparency.
3425
+ if (!ab.hadMaterial)
3426
+ {
3427
+ ab.object.material = null;
3428
+ }
3429
+
28923430 buttonGroup.remove(ab);
28933431 radioPanel.remove(ab);
28943432
2895
- ab.GetObject().editWindow = null;
3433
+ //ab.GetObject().editWindow = null;
3434
+ ab.GetObject().manipWindow = null;
28963435 // ab.GetObject().objectUI = null; // ?????????
28973436
28983437 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28993438 break;
29003439 }
29013440 }
3441
+
3442
+ cameraView.requestFocusInWindow();
29023443 refreshContents(true);
29033444 } else
29043445 if (source == editItem || source == editButton)
29053446 {
3447
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3448
+ {
3449
+ Object3D child = (Object3D)e.nextElement();
3450
+ child.pinned = true;
3451
+ }
3452
+
29063453 EditSelection(false);
29073454 } else
29083455 if (source == uneditButton)
....@@ -2912,12 +3459,13 @@
29123459 Object3D child = (Object3D)e.nextElement();
29133460 if(child.editWindow != null)
29143461 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3462
+ child.pinned = false;
29153463 child.CloseUI();
29163464 listUI.remove(child);
29173465
2918
- child.editWindow = null; // ???????????
3466
+ //child.editWindow = null; // ???????????
29193467 }
2920
- objEditor.ctrlPanel.validate();
3468
+ objEditor.ctrlPanel.FlushUI();
29213469 //objEditor.jTree.clearSelection();
29223470 //objEditor.ResetSliders();
29233471 refreshContents(true);
....@@ -2928,6 +3476,7 @@
29283476 //copy.ClearUI();
29293477 for (Object3D obj : listUI)
29303478 {
3479
+ obj.pinned = false;
29313480 obj.CloseUI();
29323481 }
29333482 listUI.clear();
....@@ -2937,7 +3486,7 @@
29373486 {
29383487 assert(copy == group);
29393488
2940
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3489
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29413490
29423491 for (Object3D obj : listUI)
29433492 {
....@@ -2986,6 +3535,9 @@
29863535 }
29873536
29883537 copy = group;
3538
+
3539
+ SetUndoStates();
3540
+
29893541 //Globals.theRenderer.object = group;
29903542 if(!useclient)
29913543 {
....@@ -3001,20 +3553,46 @@
30013553 frontView.object = group;
30023554 sideView.object = group;
30033555 }
3004
- group.editWindow = this;
3556
+
3557
+// fix "+" issue
3558
+ //group.editWindow = this;
3559
+ group.manipWindow = this;
3560
+
30053561 /*
30063562 currentLayout = radio.layout;
30073563 if (currentLayout == null)
30083564 currentLayout = sevenButton;
30093565 */
30103566 radio.layout.doClick();
3567
+
3568
+ ClearUnpinned();
3569
+ //Grafreed.Assert(group != null);
3570
+ //Grafreed.Assert(group.selection != null);
3571
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3572
+ if (group.selection == null || group.selection.size() == 1)
3573
+ EditSelection(false);
30113574 keepparent = group.parent;
30123575 // PARENT = NULL or not???
30133576 //group.parent = null; // ROOT
30143577 //group.attributes = -1;
30153578 ResetModel();
3579
+
3580
+ cameraView.requestFocusInWindow();
30163581 refreshContents(true);
3017
- }
3582
+ } else if (event.getSource() == editCameraItem)
3583
+ {
3584
+ cameraView.ProtectCamera();
3585
+ cameraView.repaint();
3586
+ return;
3587
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3588
+ {
3589
+ cameraView.RevertCamera();
3590
+ cameraView.repaint();
3591
+ return;
3592
+ // } else if (event.getSource() == textureButton)
3593
+ // {
3594
+ // return; // true;
3595
+ }
30183596 else
30193597 {
30203598 //return super.action(event, arg);
....@@ -3023,7 +3601,6 @@
30233601 }
30243602
30253603 boolean useclient = false;
3026
- cRadio radio;
30273604
30283605 void ToggleRoot()
30293606 {
....@@ -3075,6 +3652,28 @@
30753652 refreshContents();
30763653 }
30773654
3655
+ void TransformChildren()
3656
+ {
3657
+ Object3D obj;
3658
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3659
+ {
3660
+ obj = (Object3D)e.nextElement();
3661
+ obj.KeepTextureMatrices();
3662
+ obj.TransformChildren();
3663
+ obj.RestoreTextureMatrices();
3664
+
3665
+// if (obj.parent == null)
3666
+// {
3667
+// System.out.println("NULL PARENT!");
3668
+// new Exception().printStackTrace();
3669
+// }
3670
+// else
3671
+// TouchTransform(obj);
3672
+// //obj.parent.Touch();
3673
+ }
3674
+
3675
+ refreshContents();
3676
+ }
30783677
30793678 void ResetTransform()
30803679 {
....@@ -3187,7 +3786,7 @@
31873786 refreshContents();
31883787 }
31893788
3190
- void ResetCentroid()
3789
+ void ResetCentroid(boolean full)
31913790 {
31923791 Object3D obj;
31933792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3202,12 +3801,16 @@
32023801 LA.matIdentity(Object3D.mat);
32033802 obj.getBounds(minima, maxima, false);
32043803 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3205
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3804
+ if (full)
3805
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32063806 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32073807 obj.TransformMesh(Object3D.mat);
3808
+
32083809 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3209
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3810
+ if (full)
3811
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32103812 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3813
+
32113814 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32123815 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32133816 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3236,7 +3839,8 @@
32363839
32373840 int size = obj.MemorySize();
32383841
3239
- System.err.println((size/1024) + " KB is the size of " + obj);
3842
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3843
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32403844 }
32413845 }
32423846 catch (Exception e)
....@@ -3273,9 +3877,9 @@
32733877 obj = (Object3D)e.nextElement();
32743878
32753879 System.out.println("Object is: " + obj);
3276
- GrafreeD.AnalyzeObject(obj);
3880
+ Grafreed.AnalyzeObject(obj);
32773881 System.out.println("Boundary rep: " + obj.bRep);
3278
- GrafreeD.AnalyzeObject(obj.bRep);
3882
+ Grafreed.AnalyzeObject(obj.bRep);
32793883
32803884 // System.err.println((size/1024) + " KB is the size of " + obj);
32813885 }
....@@ -3317,6 +3921,13 @@
33173921 void GenNormals(boolean crease)
33183922 {
33193923 group.GenNormalsS(crease);
3924
+
3925
+ refreshContents();
3926
+ }
3927
+
3928
+ void GenNormalsMESH()
3929
+ {
3930
+ group.GenNormalsMeshS();
33203931
33213932 refreshContents();
33223933 }
....@@ -3489,8 +4100,8 @@
34894100
34904101 void ParseVertices()
34914102 {
3492
- boolean epsequal = GrafreeD.epsequal;
3493
- GrafreeD.epsequal = true;
4103
+ boolean epsequal = Grafreed.epsequal;
4104
+ Grafreed.epsequal = true;
34944105
34954106 for (int i=0; i<group.selection.size(); i++)
34964107 {
....@@ -3515,7 +4126,7 @@
35154126 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35164127 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35174128
3518
- g.add(GrafreeD.clipboard);
4129
+ g.add(Grafreed.clipboard);
35194130
35204131 buffer.add(g);
35214132 }
....@@ -3530,7 +4141,7 @@
35304141 makeSomething(buffer, i==group.selection.size()-1);
35314142 }
35324143
3533
- GrafreeD.epsequal = epsequal;
4144
+ Grafreed.epsequal = epsequal;
35344145
35354146 refreshContents();
35364147 }
....@@ -3548,7 +4159,16 @@
35484159 String pigment = Object3D.GetPigment(tex);
35494160 //String bump = Object3D.GetBump(tex);
35504161
3551
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4162
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4163
+
4164
+ try
4165
+ {
4166
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4167
+ }
4168
+ catch (Exception e)
4169
+ {
4170
+ System.err.println("FAIL: " + node);
4171
+ }
35524172
35534173 double s = v.s;
35544174
....@@ -3636,11 +4256,11 @@
36364256
36374257 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36384258
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
4259
+ boolean random = CameraPane.SWITCH;
4260
+ CameraPane.SWITCH = false; // parse all random nodes
36414261 lowres.linkVerticesThis(null);
36424262 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
4263
+ CameraPane.SWITCH = random;
36444264
36454265 System.err.flush();
36464266
....@@ -3680,7 +4300,7 @@
36804300 return;
36814301
36824302 Object3D poses = group.selection.get(0);
3683
- Object3D ref = GrafreeD.clipboard.get(0);
4303
+ Object3D ref = Grafreed.clipboard.get(0);
36844304
36854305 Object3D newgroup = new Object3D("Po:" + poses.name);
36864306
....@@ -3874,9 +4494,9 @@
38744494
38754495 void ClipMesh()
38764496 {
3877
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4497
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38784498 {
3879
- Object3D content = GrafreeD.clipboard.get(0);
4499
+ Object3D content = Grafreed.clipboard.get(0);
38804500
38814501 if (content instanceof cGroup && ((cGroup)content).transientlink )
38824502 content = ((cGroup)content).get(0);
....@@ -3885,7 +4505,7 @@
38854505 // {
38864506 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38874507 // }
3888
- group.selection.ClipMesh(GrafreeD.clipboard);
4508
+ group.selection.ClipMesh(Grafreed.clipboard);
38894509 }
38904510 // group.selection.ClipMesh(GrafreeD.clipboard);
38914511 System.out.println("DONE.");
....@@ -3932,6 +4552,18 @@
39324552 void MarkLeaves(boolean hide)
39334553 {
39344554 group.selection.MarkLeaves(hide);
4555
+ refreshContents();
4556
+ }
4557
+
4558
+ void RewindLeaves(boolean hide)
4559
+ {
4560
+ group.selection.RewindLeaves(hide);
4561
+ refreshContents();
4562
+ }
4563
+
4564
+ void RandomLeaves(boolean hide)
4565
+ {
4566
+ group.selection.RandomLeaves(hide);
39354567 refreshContents();
39364568 }
39374569
....@@ -4006,28 +4638,25 @@
40064638 // }
40074639 // }
40084640
4009
- static boolean allparams = true;
4010
-
4011
- static Vector<Object3D> listUI = new Vector<Object3D>();
4012
-
40134641 void EditSelection(boolean newWindow)
40144642 {
4643
+ if (group.selection == null)
4644
+ {
4645
+ EditElement(group, newWindow); // ? new
4646
+ return;
4647
+ }
4648
+
40154649 // aConstraints.gridy = 0;
40164650 for (int i=0; i<group.selection.size(); i++)
40174651 {
40184652 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40194653 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4020
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4654
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40214655
40224656 Object3D elem = (Object3D)group.selection.elementAt(i);
4023
- if(elem != group)
4657
+ if(elem != group || !newWindow)
40244658 {
4025
- // if (!(elem instanceof Composite))
4026
- // newWindow = false;
4027
- listUI.add(elem);
4028
- elem.openEditWindow(this, newWindow); //, false);
4029
- System.out.println("edit : " + elem);
4030
- elem.editWindow.refreshContents(true); // ? new
4659
+ EditElement(elem, newWindow); // ? new
40314660 }
40324661 }
40334662 }
....@@ -4102,7 +4731,8 @@
41024731 //new Exception().printStackTrace();
41034732
41044733 freezemodel = true;
4105
-
4734
+ ClearUnpinned();
4735
+
41064736 /**/
41074737 //switch (event.id)
41084738 {
....@@ -4110,7 +4740,6 @@
41104740 //case 702: // Event.LIST_DESELECT
41114741 group.deselectAll();
41124742 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4113
- objEditor.ClearInfo(); // .GetMaterial());
41144743 if (tps != null)
41154744 {
41164745 for (int i=0; i < tps.length; i++)
....@@ -4119,33 +4748,39 @@
41194748
41204749 //if (child.parent != null)
41214750 //child.parent.addSelectee(child);
4751
+ objEditor.SetMaterial(child);
41224752 group.addSelectee(child);
4123
- objEditor.SetMaterial(child); // .GetMaterial());
4124
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4125
- System.err.println("info : " + child.GetPath());
41264753 }
41274754 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
4755
+// else
4756
+// {
4757
+// objEditor.SetMaterial(group); // .GetMaterial());
4758
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4759
+// System.err.println("info : " + group.GetPath());
4760
+// }
41344761
4135
- objEditor.SetText(); // jan 2014
4136
-
4137
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4762
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41384763 CameraPane.flash = true;
41394764
4140
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4765
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41414766 // a camera
41424767 {
4143
- CameraPane.camerachangeframe = 0; // don't refuse it
4144
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4768
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4769
+ {
4770
+ CameraPane.camerachangeframe = 0; // don't refuse it
4771
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4772
+ }
41454773 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41464774 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41474775 }
41484776
4777
+ if (tps != null && tps.length == 1)
4778
+ {
4779
+ EditSelection(false);
4780
+ }
4781
+
4782
+ SetPinStates(tps != null && tps.length > 0);
4783
+
41494784 refreshContents();
41504785 //return true;
41514786 }
....@@ -4154,6 +4789,35 @@
41544789
41554790 freezemodel = false;
41564791 }
4792
+
4793
+ void SetPinStates(boolean enabled)
4794
+ {
4795
+ editButton.setEnabled(enabled);
4796
+ uneditButton.setEnabled(enabled);
4797
+ unselectButton.setEnabled(enabled);
4798
+ flashSelectionButton.setEnabled(enabled);
4799
+ }
4800
+
4801
+ void refreshContents(boolean cp)
4802
+ {
4803
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4804
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4805
+ {
4806
+ objEditor.ClearInfo(); // .GetMaterial());
4807
+
4808
+ for (int i=0; i < group.selection.Size(); i++)
4809
+ {
4810
+ Object3D child = (Object3D) group.selection.get(i);
4811
+
4812
+ objEditor.AddInfo(child, this, true);
4813
+ System.err.println("info : " + child.GetPath());
4814
+ }
4815
+
4816
+ objEditor.SetText(); // jan 2014
4817
+ }
4818
+
4819
+ super.refreshContents(cp);
4820
+ }
41574821
41584822 void linkSomething(Object3D thing)
41594823 {
....@@ -4225,16 +4889,19 @@
42254889 {
42264890 if (group.selection.isEmpty())
42274891 return;
4228
- GrafreeD.clipboardIsTempGroup = false;
4892
+
4893
+ Grafreed.clipboardIsTempGroup = false;
42294894 Composite tGroup = null;
42304895 if (group.selection.size() > 0) // 1)
42314896 {
42324897 tGroup = new cGroup();
4233
- GrafreeD.clipboardIsTempGroup = true;
4898
+ Grafreed.clipboardIsTempGroup = true;
42344899 }
42354900
42364901 if (cut)
42374902 {
4903
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4904
+// Save();
42384905 //int indices[] = jList.getSelectedIndices();
42394906 //for (int i = indices.length - 1; i >= 0; i--)
42404907 //jList.remove(indices[i]);
....@@ -4270,16 +4937,16 @@
42704937 //System.out.println("cut " + child);
42714938 //System.out.println("parent = " + child.parent);
42724939 // tmp.addChild(child);
4273
- if (GrafreeD.clipboardIsTempGroup)
4940
+ if (Grafreed.clipboardIsTempGroup)
42744941 tGroup.add/*Child*/(tmp);
42754942 else
4276
- GrafreeD.clipboard = tmp;
4943
+ Grafreed.clipboard = tmp;
42774944 }
42784945 else
4279
- if (GrafreeD.clipboardIsTempGroup)
4946
+ if (Grafreed.clipboardIsTempGroup)
42804947 tGroup.add/*Child*/(child);
42814948 else
4282
- GrafreeD.clipboard = child;
4949
+ Grafreed.clipboard = child;
42834950 }
42844951
42854952 //ResetModel();
....@@ -4311,21 +4978,23 @@
43114978 //System.out.println("cut " + elem);
43124979 //System.out.println("parent = " + elem.parent);
43134980 // tmp.addChild(elem);
4314
- if (GrafreeD.clipboardIsTempGroup)
4981
+ if (Grafreed.clipboardIsTempGroup)
43154982 tGroup.add/*Child*/(tmp);
43164983 else
4317
- GrafreeD.clipboard = tmp;
4984
+ Grafreed.clipboard = tmp;
43184985 }
43194986 else
4320
- if (GrafreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
43214988 tGroup.add/*Child*/(child);
43224989 else
4323
- GrafreeD.clipboard = child;
4990
+ Grafreed.clipboard = child;
43244991 }
43254992
43264993 }
4327
- if (GrafreeD.clipboardIsTempGroup)
4328
- GrafreeD.clipboard = tGroup;
4994
+
4995
+ if (Grafreed.clipboardIsTempGroup)
4996
+ Grafreed.clipboard = tGroup;
4997
+
43294998 if (cut)
43304999 {
43315000 ResetModel();
....@@ -4335,11 +5004,15 @@
43355004
43365005 void paste(boolean expand)
43375006 {
5007
+ if (Globals.REPLACEONMAKE)
5008
+ Save();
5009
+ boolean keep = Globals.REPLACEONMAKE;
5010
+ Globals.REPLACEONMAKE = false;
43385011 // if (GrafreeD.clipboard == null)
43395012 // return;
43405013 boolean first = true;
43415014
4342
- if (GrafreeD.clipboardIsTempGroup)
5015
+ if (Grafreed.clipboardIsTempGroup)
43435016 {
43445017 Composite temp;
43455018
....@@ -4350,7 +5023,7 @@
43505023 temp = (Composite)Applet3D.clipboard.deepCopy();
43515024 */
43525025 Object3D elem;
4353
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5026
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43545027 {
43555028 Object3D child = (Object3D)e.nextElement();
43565029
....@@ -4384,21 +5057,22 @@
43845057 //Object3D cb = Applet3D.clipboard;
43855058 //temp.addChild(cb);
43865059 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4387
- assert(GrafreeD.clipboard.parent == null);
4388
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4389
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4390
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4391
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5060
+ assert(Grafreed.clipboard.parent == null);
5061
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5062
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5063
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5064
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43925065 else
4393
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4394
- GrafreeD.clipboard.get(0).parent = keepparent;
5066
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5067
+ Grafreed.clipboard.get(0).parent = keepparent;
43955068 }
43965069
5070
+ Globals.REPLACEONMAKE = keep;
43975071 ResetModel();
43985072 refreshContents();
43995073 }
44005074
4401
- void pasteInto(boolean copyit)
5075
+ void pasteInto(boolean copyit, boolean clone)
44025076 {
44035077 // if (GrafreeD.clipboard == null)
44045078 // return;
....@@ -4427,15 +5101,22 @@
44275101 if (copyit)
44285102 {
44295103 // paste(false);
4430
- CloneClipboard(false); // sept 2014
5104
+ if (clone)
5105
+ {
5106
+ CloneClipboard(false); // sept 2014
5107
+ }
5108
+ else
5109
+ {
5110
+ paste(false);
5111
+ }
44315112 }
44325113 else
44335114 {
44345115 boolean first = true;
44355116
4436
- if (GrafreeD.clipboardIsTempGroup)
5117
+ if (Grafreed.clipboardIsTempGroup)
44375118 {
4438
- Composite temp = (Composite)GrafreeD.clipboard;
5119
+ Composite temp = (Composite)Grafreed.clipboard;
44395120 Object3D copy;
44405121 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44415122 {
....@@ -4445,7 +5126,7 @@
44455126 }
44465127 } else
44475128 {
4448
- linkSomething(GrafreeD.clipboard); //.get(0));
5129
+ linkSomething(Grafreed.clipboard); //.get(0));
44495130 }
44505131 }
44515132 }
....@@ -4522,6 +5203,10 @@
45225203
45235204 void group(Object3D csg, boolean grab)
45245205 {
5206
+ if (Globals.REPLACEONMAKE)
5207
+ Save();
5208
+ boolean keep = Globals.REPLACEONMAKE;
5209
+ Globals.REPLACEONMAKE = false;
45255210 if (//false) // why??
45265211 !group.selection.isEmpty())
45275212 {
....@@ -4635,10 +5320,15 @@
46355320 //node.add(csg);
46365321 //makeSomething(node);
46375322 makeSomething(csg);
5323
+ Globals.REPLACEONMAKE = keep;
46385324 }
46395325
46405326 void Ungroup(Object3D g)
46415327 {
5328
+ if (Globals.REPLACEONMAKE)
5329
+ Save();
5330
+ boolean keep = Globals.REPLACEONMAKE;
5331
+ Globals.REPLACEONMAKE = false;
46425332 if (g instanceof HiddenObject)
46435333 {
46445334 HiddenObject h = (HiddenObject) g;
....@@ -4655,6 +5345,7 @@
46555345 objEditor.makeSomething(g.get(i), false);
46565346 }
46575347 }
5348
+ Globals.REPLACEONMAKE = keep;
46585349 }
46595350
46605351 void ungroup()
....@@ -4850,21 +5541,6 @@
48505541 }
48515542 */
48525543
4853
- void ImportGFD()
4854
- {
4855
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4856
- browser.show();
4857
- String filename = browser.getFile();
4858
- if (filename != null && filename.length() > 0)
4859
- {
4860
- String fullname = browser.getDirectory() + filename;
4861
-
4862
- //Object3D readobj =
4863
- objEditor.ReadGFD(fullname, objEditor);
4864
- //makeSomething(readobj);
4865
- }
4866
- }
4867
-
48685544 /*
48695545 public void Callback(Object obj)
48705546 {
....@@ -4888,26 +5564,9 @@
48885564 }
48895565 */
48905566
4891
- void ImportVRMLX3D()
4892
- {
4893
- if (GrafreeD.standAlone)
4894
- {
4895
- /**/
4896
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4897
- browser.show();
4898
- String filename = browser.getFile();
4899
- if (filename != null && filename.length() > 0)
4900
- {
4901
- String fullname = browser.getDirectory() + filename;
4902
- LoadVRMLX3D(fullname);
4903
- }
4904
- /**/
4905
- }
4906
- }
4907
-
49085567 String GetFile(String dialogName)
49095568 {
4910
- if (GrafreeD.standAlone)
5569
+ if (Grafreed.standAlone)
49115570 {
49125571 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49135572 browser.show();
....@@ -4971,10 +5630,33 @@
49715630 cButton flashSelectionButton;
49725631 cButton editButton;
49735632 cButton uneditButton;
5633
+ JCheckBox allParamsButton;
49745634 cButton clearpanelButton;
4975
- cButton allParamsButton;
49765635 cButton unselectButton;
49775636
5637
+ cButton restoreCameraButton;
5638
+
5639
+ cButton saveButton;
5640
+ cButton oneStepButton;
5641
+
5642
+ cButton groupButton;
5643
+ cButton ungroupButton;
5644
+ cButton compositeButton;
5645
+ cButton switchButton;
5646
+ cButton loopButton;
5647
+ cButton textureButton;
5648
+
5649
+ cButton gridButton;
5650
+ cButton boxButton;
5651
+ cButton sphereButton;
5652
+ cButton coneButton;
5653
+ cButton torusButton;
5654
+ cButton superButton;
5655
+ cButton kleinButton;
5656
+ cButton particlesButton;
5657
+ cButton overlayButton;
5658
+ cButton lightButton;
5659
+
49785660 cButton screenfitButton;
49795661 cButton screenfitpointButton;
49805662 cButton snapobjectButton;
....@@ -4986,14 +5668,6 @@
49865668
49875669 cButton setsupportButton;
49885670
4989
- cButton twoButton;
4990
- cButton sixButton;
4991
- cButton threeButton;
4992
- cButton sevenButton;
4993
- cButton fourButton; // full panel
4994
- cButton oneButton; // full XYZ
4995
- //cButton currentLayout;
4996
-
49975671 //
49985672 //Composite
49995673 Object3D // to do !!
....@@ -5003,9 +5677,11 @@
50035677 //JTree jTree;
50045678 private MenuItem lookAtItem;
50055679 private MenuItem lookFromItem;
5006
- private MenuItem switchItem;
5680
+ private MenuItem switchViewItem;
50075681 private MenuItem cutItem;
5008
- private MenuItem duplicateItem;
5682
+ private MenuItem undoItem;
5683
+ private MenuItem redoItem;
5684
+ private JMenuItem duplicateItem;
50095685 private MenuItem cloneItem;
50105686 private MenuItem cloneSupportItem;
50115687 private MenuItem overwriteGeoItem;
....@@ -5018,7 +5694,7 @@
50185694 private MenuItem linkverticesItem;
50195695 private MenuItem relinkverticesItem;
50205696 private MenuItem setMasterItem;
5021
- private MenuItem resetMeshItem;
5697
+ private MenuItem resetAllItem;
50225698 private MenuItem stepAllItem;
50235699 private MenuItem revertMeshItem;
50245700 private MenuItem poseMeshItem;
....@@ -5029,10 +5705,11 @@
50295705 private MenuItem mergeGeometriesItem;
50305706 private MenuItem copyItem;
50315707 private MenuItem pasteItem;
5708
+ private MenuItem pasteIntoItem;
50325709 private MenuItem pasteLinkItem;
50335710 private MenuItem pasteCloneItem;
50345711 private MenuItem pasteExpandItem;
5035
- private MenuItem clearItem;
5712
+ private MenuItem deleteItem;
50365713 private MenuItem clearAllItem;
50375714 private MenuItem genUVItem;
50385715 private MenuItem genNormalsMESHItem;
....@@ -5067,6 +5744,10 @@
50675744 private MenuItem showleavesItem;
50685745 private MenuItem markleavesItem;
50695746 private MenuItem unmarkleavesItem;
5747
+ private MenuItem rewindleavesItem;
5748
+ private MenuItem unrewindleavesItem;
5749
+ private MenuItem randomleavesItem;
5750
+ private MenuItem unrandomleavesItem;
50705751
50715752 private MenuItem flipVItem;
50725753 private MenuItem unflipVItem;
....@@ -5078,15 +5759,17 @@
50785759 private MenuItem panoTexturesItem;
50795760
50805761 private MenuItem resetCentroidItem;
5081
- private MenuItem transformgeometryItem;
5762
+ private MenuItem resetCentroidXZItem;
50825763 private MenuItem resetTransformItem;
5764
+ private MenuItem transformGeometryItem;
5765
+ private MenuItem transformChildrenItem;
50835766 private MenuItem hideItem;
50845767 private MenuItem grabItem;
50855768 private MenuItem backItem;
50865769 private MenuItem frontItem;
50875770 private MenuItem cameraItem;
50885771 private MenuItem compositeItem;
5089
- private MenuItem randomItem;
5772
+ private MenuItem switchItem;
50905773 private MenuItem physicsItem;
50915774 private MenuItem frameselectorItem;
50925775 private MenuItem scriptNodeItem;
....@@ -5126,7 +5809,7 @@
51265809 private MenuItem blobItem;
51275810 private MenuItem latheItem;
51285811 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
5812
+ private MenuItem overlayItem;
51305813 private MenuItem meshItem;
51315814 // private MenuItem meshGroupItem;
51325815 private MenuItem springItem;
....@@ -5148,11 +5831,6 @@
51485831 private MenuItem doubleItem;
51495832 private MenuItem tripleItem;
51505833
5151
- private MenuItem importGFDItem;
5152
- private MenuItem importVRMLX3DItem;
5153
- private MenuItem import3DSItem;
5154
- private MenuItem importOBJItem;
5155
-
51565834 private MenuItem computeAOItem;
51575835 private MenuItem recompileItem;
51585836 private MenuItem editScriptItem;
....@@ -5162,4 +5840,8 @@
51625840 private MenuItem analyzeItem;
51635841 private MenuItem dumpItem;
51645842 //boolean freezemodel = false;
5843
+
5844
+ Menu cameraMenu;
5845
+ MenuItem editCameraItem;
5846
+ MenuItem restoreCameraItem;
51655847 }