Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -84,6 +84,10 @@
8484
8585 void CloneSelection(boolean supports)
8686 {
87
+ if (Globals.SAVEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.SAVEONMAKE;
90
+ Globals.SAVEONMAKE = false;
8791 // Object3D keep = GrafreeD.clipboard;
8892 //Object3D obj;
8993 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +98,19 @@
9498
9599 makeSomething(clone, i==group.selection.size()-1);
96100 }
101
+ Globals.SAVEONMAKE = keep;
97102 }
98103
99104 void CloneClipboard(boolean supports)
100105 {
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));
106
+ assert(Grafreed.clipboard.parent == null);
107
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
108
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
109
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
110
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106111 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
112
+ makeSomething(CloneObject(Grafreed.clipboard, false));
113
+ Grafreed.clipboard.get(0).parent = keepparent;
109114 }
110115
111116 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +124,7 @@
119124 // obj.support = null;
120125 if (!supports)
121126 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
127
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123128 obj.parent = parent;
124129 // obj.support = support;
125130 // clone.support = support; // aout 2013
....@@ -148,28 +153,21 @@
148153
149154 //JTextField nameField;
150155
151
- void SetupMenu2(ObjEditor oe)
156
+ void SetupMenu2(GroupEditor oe)
152157 {
153
- if (Globals.ADVANCED)
154
- {
155
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
156
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
157
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
158
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
159
- oe.cameraMenu.add("-");
160
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
161
- openWindowItem.addActionListener(this);
162
- editLeafItem.addActionListener(this);
163
- lookAtItem.addActionListener(this);
164
- //lookFromItem.addActinoListener(this);
165
- //switchItem.addActionListener(this);
166
- }
167
-
158
+ oe.jTree = new cTree();
159
+
168160 Menu menu;
169161 oe.menuBar.add(menu = new Menu("Edit"));
170162 //editItem = menu.add(new MenuItem("Edit"));
171163 //editItem.addActionListener(this);
172
- duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+
165
+// undoItem = menu.add(new MenuItem("Undo"));
166
+// undoItem.addActionListener(this);
167
+// redoItem = menu.add(new MenuItem("Redo"));
168
+// redoItem.addActionListener(this);
169
+// menu.add("-");
170
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
173171 duplicateItem.addActionListener(this);
174172 cloneItem = menu.add(new MenuItem("Clone"));
175173 cloneItem.addActionListener(this);
....@@ -185,7 +183,6 @@
185183 copyItem.addActionListener(this);
186184 pasteItem = menu.add(new MenuItem("Paste"));
187185 pasteItem.addActionListener(this);
188
- menu.add("-");
189186
190187 menu.add("-");
191188 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -206,14 +203,97 @@
206203 clearAllItem = menu.add(new MenuItem("Clear All"));
207204 clearAllItem.addActionListener(this);
208205 }
206
+
207
+ menuBar.add(cameraMenu = new Menu("View"));
208
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
209
+ //zBufferItem.addActionListener(this);
210
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
211
+ //normalLensItem.addActionListener(this);
212
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
213
+ restoreCameraItem.addActionListener(this);
214
+
215
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
216
+// toggleFullScreenItem.addItemListener(this);
217
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
218
+// cameraMenu.add("-");
219
+//
220
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
221
+// toggleTextureItem.addItemListener(this);
222
+// toggleTextureItem.setState(CameraPane.textureon);
223
+//
224
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
225
+// toggleSwitchItem.addItemListener(this);
226
+// toggleSwitchItem.setState(CameraPane.SWITCH);
227
+
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
229
+ toggleHandleItem.addItemListener(this);
230
+ toggleHandleItem.setState(CameraPane.HANDLES);
231
+
232
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
233
+ togglePaintItem.addItemListener(this);
234
+ togglePaintItem.setState(CameraPane.PAINTMODE);
235
+
236
+ if (Globals.ADVANCED)
237
+ {
238
+ cameraMenu.add("-");
239
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
240
+ toggleLiveItem.addItemListener(this);
241
+ toggleLiveItem.setState(Globals.isLIVE());
209242
243
+ cameraMenu.add(stepItem = new MenuItem("Step"));
244
+ stepItem.addActionListener(this);
245
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
246
+ // toggleDLItem.addItemListener(this);
247
+ // toggleDLItem.setState(false);
248
+
249
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
250
+ toggleRenderItem.addItemListener(this);
251
+ toggleRenderItem.setState(!CameraPane.frozen);
252
+
253
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
254
+ toggleDebugItem.addItemListener(this);
255
+ toggleDebugItem.setState(Globals.DEBUG);
256
+
257
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
258
+ toggleFrustumItem.addItemListener(this);
259
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
260
+
261
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
262
+ toggleFootContactItem.addItemListener(this);
263
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
264
+
265
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
266
+ toggleTimelineItem.addItemListener(this);
267
+ }
268
+
269
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
270
+// toggleRootItem.addItemListener(this);
271
+// toggleRootItem.setState(false);
272
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
273
+// animationItem.addItemListener(this);
274
+// animationItem.setState(CameraPane.ANIMATION);
275
+ cameraMenu.add("-");
276
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
277
+ editCameraItem.addActionListener(this);
278
+
279
+ if (Globals.ADVANCED)
280
+ {
281
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
282
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
283
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
284
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
285
+ oe.cameraMenu.add("-");
286
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
287
+ openWindowItem.addActionListener(this);
288
+ editLeafItem.addActionListener(this);
289
+ lookAtItem.addActionListener(this);
290
+ //lookFromItem.addActinoListener(this);
291
+ //switchViewItem.addActionListener(this);
292
+ }
293
+
210294 oe.menuBar.add(menu = new Menu("Setting"));
211295 if (Globals.ADVANCED)
212296 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217297 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218298 revertMeshItem.addActionListener(this);
219299 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -253,21 +333,29 @@
253333 }
254334
255335 oe.menuBar.add(menu = new Menu("Group"));
256
- grabItem = menu.add(new MenuItem("Grab"));
257
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
258338 backItem = menu.add(new MenuItem("Back"));
259339 backItem.addActionListener(this);
260340 frontItem = menu.add(new MenuItem("Front"));
261341 frontItem.addActionListener(this);
262
- compositeItem = menu.add(new MenuItem("Composite"));
263
- compositeItem.addActionListener(this);
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
264347 hideItem = menu.add(new MenuItem("Hidden Group"));
265348 hideItem.addActionListener(this);
349
+ }
266350 ungroupItem = menu.add(new MenuItem("Ungroup"));
267351 ungroupItem.addActionListener(this);
268
- menu.add("-");
269
- randomItem = menu.add(new MenuItem("Switch node"));
270
- randomItem.addActionListener(this);
352
+
353
+// menu.add("-");
354
+//
355
+// switchItem = menu.add(new MenuItem("Switch node"));
356
+// switchItem.addActionListener(this);
357
+ if (Globals.ADVANCED)
358
+ {
271359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
272360 switchGeoItem.addActionListener(this);
273361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -275,8 +363,6 @@
275363 morphItem = menu.add(new MenuItem("Morph Group"));
276364 morphItem.addActionListener(this);
277365
278
- if (Globals.ADVANCED)
279
- {
280366 menu.add("-");
281367 physicsItem = menu.add(new MenuItem("Physics"));
282368 physicsItem.addActionListener(this);
....@@ -284,30 +370,29 @@
284370 frameselectorItem.addActionListener(this);
285371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
286372 scriptNodeItem.addActionListener(this);
287
- cameraItem = menu.add(new MenuItem("Camera"));
288
- cameraItem.addActionListener(this);
289373 }
290374
291375 oe.menuBar.add(menu = new Menu("Object"));
292
- textureItem = menu.add(new MenuItem("Texture"));
293
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
294378 billboardItem = menu.add(new MenuItem("Billboard"));
295379 billboardItem.addActionListener(this);
296380 csgItem = menu.add(new MenuItem("CSG"));
297381 csgItem.addActionListener(this);
298
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
299383 shadowXItem.addActionListener(this);
300
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
301385 shadowYItem.addActionListener(this);
302
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
303387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
304391 if (Globals.ADVANCED)
305392 {
306393 menu.add("-");
307394 linkerItem = menu.add(new MenuItem("Linker"));
308395 linkerItem.addActionListener(this);
309
- attributeItem = menu.add(new MenuItem("Attribute"));
310
- attributeItem.addActionListener(this);
311396 templateItem = menu.add(new MenuItem("Template"));
312397 templateItem.addActionListener(this);
313398 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -318,8 +403,12 @@
318403 resetTransformItem.addActionListener(this);
319404 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320405 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- transformgeometryItem.addActionListener(this);
406
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
407
+ resetCentroidXZItem.addActionListener(this);
408
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
409
+ transformGeometryItem.addActionListener(this);
410
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
411
+ transformChildrenItem.addActionListener(this);
323412
324413 oe.menuBar.add(menu = new Menu("Geometry"));
325414 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -368,6 +457,10 @@
368457 oe.menuBar.add(menu = new Menu("Attributes"));
369458 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370459 clearMaterialsItem.addActionListener(this);
460
+ resetAllItem = menu.add(new MenuItem("Reset All"));
461
+ resetAllItem.addActionListener(this);
462
+ stepAllItem = menu.add(new MenuItem("Step All"));
463
+ stepAllItem.addActionListener(this);
371464 menu.add("-");
372465 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
373466 liveleavesItem.addActionListener(this);
....@@ -388,6 +481,14 @@
388481 markleavesItem.addActionListener(this);
389482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
390483 unmarkleavesItem.addActionListener(this);
484
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
485
+ rewindleavesItem.addActionListener(this);
486
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
487
+ unrewindleavesItem.addActionListener(this);
488
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
489
+ randomleavesItem.addActionListener(this);
490
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
491
+ unrandomleavesItem.addActionListener(this);
391492 menu.add("-");
392493 flipVItem = menu.add(new MenuItem("Flip V"));
393494 flipVItem.addActionListener(this);
....@@ -422,38 +523,41 @@
422523 sortbysizeItem.addActionListener(this);
423524 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424525 sortbynameItem.addActionListener(this);
526
+ menu.add("-");
527
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
528
+ shareGeometriesItem.addActionListener(this);
529
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
530
+ mergeGeometriesItem.addActionListener(this);
425531 if (Globals.ADVANCED)
426532 {
427
- menu.add("-");
533
+ // Pretty much the same as duplicate and clone.
428534 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429535 extractGeometriesItem.addActionListener(this);
430536 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431537 cloneGeometriesItem.addActionListener(this);
432
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
- shareGeometriesItem.addActionListener(this);
434
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
- mergeGeometriesItem.addActionListener(this);
436538 }
437539
438540 oe.menuBar.add(menu = new Menu("Insert"));
439541 buildCreateMenu(menu);
440542
441
- oe.menuBar.add(menu = new Menu("Include"));
442
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
443
- importGFDItem.addActionListener(this);
444
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
445
- importVRMLX3DItem.addActionListener(this);
446
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
- importOBJItem.addActionListener(this);
448
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
- import3DSItem.addActionListener(this);
450
-
451543 oe.menuBar.add(menu = new Menu("Tools"));
452544 buildToolsMenu(menu);
453545 }
454546
455547 void SetupUI2(ObjEditor oe)
456548 {
549
+ // June 2019
550
+ if (oe == null)
551
+ {
552
+ //super.SetupUI2(this);
553
+ //return;
554
+ }
555
+
556
+ if (copy != group)
557
+ {
558
+ //super.SetupUI2(this);
559
+ }
560
+
457561 //new Exception().printStackTrace();
458562
459563 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -482,97 +586,216 @@
482586 oe.radioPanel.add(dummyButton);
483587 oe.buttonGroup.add(dummyButton);
484588 */
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
592
+
485593 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
486594
487
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
- liveCB.setToolTipText("Enabled animation");
595
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ //minButton.setToolTipText("Minimize window");
597
+ //minButton.addActionListener(this);
598
+
599
+ if (Globals.ADVANCED)
600
+ {
601
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ maxButton.setToolTipText("Maximize window");
603
+ maxButton.addActionListener(this);
604
+ }
605
+
606
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
607
+ fullButton.setToolTipText("Full-screen window");
608
+ fullButton.addActionListener(this);
609
+
610
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ screenfitButton.setToolTipText("Screen fit");
612
+ screenfitButton.addActionListener(this);
613
+
614
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ restoreCameraButton.setToolTipText("Restore viewpoint");
616
+ restoreCameraButton.addActionListener(this);
617
+
618
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ undoButton.setToolTipText("Undo changes");
620
+ undoButton.addActionListener(this);
621
+ undoButton.setEnabled(false);
622
+
623
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ redoButton.setToolTipText("Redo changes");
625
+ redoButton.addActionListener(this);
626
+ redoButton.setEnabled(false);
627
+
628
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ saveButton.setToolTipText("Save changes");
630
+ saveButton.addActionListener(this);
631
+
632
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
633
+ liveCB.setToolTipText("Enable animation");
489634 liveCB.addItemListener(this);
490635
491
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
636
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492637 oneStepButton.setToolTipText("Animate one step forward");
493638 oneStepButton.addActionListener(this);
494639
495
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
640
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
496641 fastCB.setToolTipText("Fast mode");
497642 fastCB.addItemListener(this);
498643
499
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
500
- trackCB.setToolTipText("Enable tracking");
501
- trackCB.addItemListener(this);
502
-
503
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
- screenfitButton.setToolTipText("Screen fit");
505
- screenfitButton.addActionListener(this);
644
+ //oe.toolboxPanel.Return();
645
+
646
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
647
+// trackCB.setToolTipText("Enable tracking");
648
+// trackCB.addItemListener(this);
506649
507650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
508651 // screenfitpointButton.addActionListener(this);
509652
510653 if (Globals.ADVANCED)
511654 {
512
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
655
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
513656 snapobjectButton.addActionListener(this);
514657 snapobjectButton.setToolTipText("Snap Object");
515658 }
516659
517
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
518
- flashSelectionButton.setToolTipText("Show selection");
519
- flashSelectionButton.addActionListener(this);
660
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
520661
521
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522
-
523
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
524663 twoButton.setToolTipText("Show center view only");
525664 twoButton.addActionListener(this);
526
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
665
+ this.fullscreenLayout = twoButton;
666
+
667
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527668 fourButton.addActionListener(this);
528669 fourButton.setToolTipText("Show left panel only");
529
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530671 sixButton.setToolTipText("2-column layout left");
531672 sixButton.addActionListener(this);
532
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
673
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533674 threeButton.setToolTipText("2-column layout right");
534675 threeButton.addActionListener(this);
535
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536677 sevenButton.setToolTipText("3-column layout");
537678 sevenButton.addActionListener(this);
538679 //
539680
540
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
681
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541682 rootButton.setToolTipText("Edit selection in new tab");
542683 rootButton.addActionListener(this);
543684
544
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
685
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
545686 closeButton.setToolTipText("Close tab");
546687 closeButton.addActionListener(this);
547688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
548689 //clearButton.addActionListener(this);
549
-
550
- cGridBag commandsPanel = new cGridBag();
690
+
691
+ // INSERT
692
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ gridButton.setToolTipText("Create grid");
694
+ gridButton.addActionListener(this);
695
+
696
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
+ boxButton.setToolTipText("Create box");
698
+ boxButton.addActionListener(this);
699
+
700
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+ sphereButton.setToolTipText("Create sphere");
702
+ sphereButton.addActionListener(this);
703
+
704
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ coneButton.setToolTipText("Create cone");
706
+ coneButton.addActionListener(this);
707
+
708
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ torusButton.setToolTipText("Create torus");
710
+ torusButton.addActionListener(this);
711
+
712
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ superButton.setToolTipText("Create superellipsoid");
714
+ superButton.addActionListener(this);
715
+
716
+ if (Globals.ADVANCED)
717
+ {
718
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ kleinButton.setToolTipText("Create Klein bottle");
720
+ kleinButton.addActionListener(this);
721
+ }
551722
552
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
553
- editButton.setToolTipText("Edit selection");
723
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ particlesButton.setToolTipText("Create particle system");
725
+ particlesButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.Return();
728
+
729
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ groupButton.setToolTipText("Create group");
731
+ groupButton.addActionListener(this);
732
+
733
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
734
+ compositeButton.setToolTipText("Create composite");
735
+ compositeButton.addActionListener(this);
736
+
737
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ switchButton.setToolTipText("Create item switcher");
739
+ switchButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ loopButton.setToolTipText("Create loop");
743
+ loopButton.addActionListener(this);
744
+
745
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
746
+ textureButton.setToolTipText("Create texture");
747
+ textureButton.addActionListener(this);
748
+
749
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750
+ overlayButton.setToolTipText("Create overlay");
751
+ overlayButton.addActionListener(this);
752
+
753
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
754
+ lightButton.setToolTipText("Create light");
755
+ lightButton.addActionListener(this);
756
+
757
+ for (int i=6; --i>=0;)
758
+ {
759
+ oe.toolboxPanel.Return();
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ oe.toolboxPanel.add(new cGridBag());
762
+ oe.toolboxPanel.add(new cGridBag());
763
+ oe.toolboxPanel.add(new cGridBag());
764
+ oe.toolboxPanel.add(new cGridBag());
765
+ oe.toolboxPanel.add(new cGridBag());
766
+ oe.toolboxPanel.add(new cGridBag());
767
+ }
768
+
769
+ // EDIT panel
770
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
771
+ editButton.setToolTipText("Pin selection controls");
554772 editButton.addActionListener(this);
555773
556
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
- uneditButton.setToolTipText("Unedit selection");
774
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ uneditButton.setToolTipText("Remove selection controls");
558776 uneditButton.addActionListener(this);
559777
560
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561
- allParamsButton.setToolTipText("Edit all params");
778
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
779
+ allParamsButton.setToolTipText("Show all controle");
562780 allParamsButton.addActionListener(this);
563781
564
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
782
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565783 clearPanelButton.setToolTipText("Clear edit panel");
566784 clearPanelButton.addActionListener(this);
567785
568
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
786
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569787 unselectButton.setToolTipText("Unselect");
570788 unselectButton.addActionListener(this);
571789
572
- commandsPanel.preferredHeight = 1;
790
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
791
+ flashSelectionButton.setToolTipText("Highlight selection");
792
+ flashSelectionButton.addActionListener(this);
573793
574
- oe.treePanel.add(commandsPanel);
575
- oe.treePanel.Return();
794
+ editCommandsPanel.preferredHeight = 1;
795
+
796
+ SetPinStates(false);
797
+// oe.treePanel.add(commandsPanel);
798
+// oe.treePanel.Return();
576799
577800 // oe.aConstraints.gridx += 1;
578801 // oe.aConstraints.weighty = 0;
....@@ -589,27 +812,12 @@
589812
590813 JScrollPane jSP;
591814 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
592
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
593816 ResetModel();
594817
595818 oe.treePanel.add(jSPPanel);
596819 oe.treePanel.Return();
597820
598
- cGridBag copyOptionsPanel = new cGridBag();
599
-
600
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
601
- colorCB.setToolTipText("Copy color when dropped");
602
- colorCB.addItemListener(this);
603
-
604
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
605
- materialCB.setToolTipText("Copy material when dropped");
606
- materialCB.addItemListener(this);
607
-
608
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
609
- textureCB.setToolTipText("Copy texture when dropped");
610
- textureCB.addItemListener(this);
611
-
612
- copyOptionsPanel.preferredHeight = 1;
613821 oe.treePanel.add(copyOptionsPanel);
614822 oe.treePanel.Return();
615823
....@@ -640,23 +848,43 @@
640848
641849 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
642850 {
851
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
852
+ colorCB.setToolTipText("Copy color when dropped");
853
+ colorCB.addItemListener(this);
854
+
855
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
856
+ materialCB.setToolTipText("Copy material when dropped");
857
+ materialCB.addItemListener(this);
858
+
859
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
860
+ textureCB.setToolTipText("Copy texture when dropped");
861
+ textureCB.addItemListener(this);
862
+
863
+ panel.Return();
864
+
643865 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
644866 boxCB.setToolTipText("Display bounding boxes");
645867 boxCB.addItemListener(this);
646868
647869 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
648
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
870
+ zoomBoxCB.setToolTipText("Display only for wheel");
649871 zoomBoxCB.addItemListener(this);
650872
651
- if (Globals.ADVANCED)
873
+ if (true) // Globals.ADVANCED)
652874 {
653
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654
- supportCB.setToolTipText("Enable rigging");
655
- supportCB.addItemListener(this);
875
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
876
+// supportCB.setToolTipText("Enable rigging");
877
+// supportCB.addItemListener(this);
878
+
879
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
880
+ freezeCB.setToolTipText("Fast moving camera");
881
+ freezeCB.addItemListener(this);
656882
657883 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
658884 // localCB.addItemListener(this);
659885
886
+ panel.Return();
887
+
660888 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
661889 crowdCB.setToolTipText("Used for crowds");
662890 crowdCB.addItemListener(this);
....@@ -673,6 +901,8 @@
673901 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
674902 // speakerMocapCB.addItemListener(this);
675903
904
+ panel.Return();
905
+
676906 if (false)
677907 {
678908 // handled in scripts
....@@ -687,32 +917,72 @@
687917 //constraints.gridy += 1;
688918 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
689919 smoothfocusCB.addItemListener(this);
920
+ panel.Return();
690921 }
691922
692923 //constraints.gridx += 1;
693924 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
694925 // debugCB.addItemListener(this);
695926
927
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
928
+ trackCB.setToolTipText("Enable tracking target");
929
+ trackCB.addItemListener(this);
930
+
696931 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
932
+ oeilCB.setToolTipText("Move camera when tracking");
697933 oeilCB.addItemListener(this);
698934
935
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
936
+ shadowCB.setToolTipText("When live compute shadows");
937
+ shadowCB.addItemListener(this);
938
+
939
+ panel.Return();
940
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
941
+ toggleTextureCB.setToolTipText("Load textures");
942
+ toggleTextureCB.addItemListener(this);
943
+
944
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
945
+ toggleSwitchCB.setToolTipText("Choose a single item");
946
+ toggleSwitchCB.addItemListener(this);
947
+
948
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
949
+ autosaveCB.setToolTipText("On structure change");
950
+ autosaveCB.addItemListener(this);
951
+
952
+ panel.Return();
953
+ if (Globals.ADVANCED)
954
+ {
699955 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
700956 lookAtCB.setToolTipText("Look-at target");
701957 lookAtCB.addItemListener(this);
958
+ }
702959
703960 }
704961
705962 cGridBag fill = new cGridBag();
706
-
707963 fill.preferredHeight = 200;
964
+ cGridBag fill2 = new cGridBag();
965
+ fill2.preferredHeight = 200;
966
+ cGridBag fill3 = new cGridBag();
967
+ fill3.preferredHeight = 200;
708968
709969 panel.add(fill);
970
+ panel.add(fill2);
971
+ panel.add(fill3);
710972
711973 }
712974
713975 void EditObject(Object3D obj)
714976 {
715977 cRadio radioButton = new cRadio(obj.name);
978
+
979
+ // June 2019. Patch to avoid bug with transparency.
980
+ radioButton.hadMaterial = obj.material != null;
981
+ if (!radioButton.hadMaterial)
982
+ {
983
+ obj.material = new cMaterial();
984
+ }
985
+
716986 radioButton.SetObject(obj);
717987 radioButton.layout = sevenButton;
718988 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -721,8 +991,11 @@
721991 buttonGroup.add(radioButton);
722992 radioButton.doClick();
723993 }
994
+
724995 void SetupViews(ObjEditor oe)
725996 {
997
+ theFrame = this;
998
+
726999 oe.SetupViews();
7271000
7281001 System.out.println("SetupViews");
....@@ -731,23 +1004,28 @@
7311004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7321005 }
7331006
734
- JCheckBox liveCB;
735
- JCheckBox supportCB;
736
- JCheckBox localCB;
737
- JCheckBox crowdCB;
738
- JCheckBox smoothCB;
739
- JCheckBox fastCB;
740
- JCheckBox slowCB;
741
- JCheckBox boxCB;
742
- JCheckBox zoomBoxCB;
743
- JCheckBox trackCB;
744
- JCheckBox smoothfocusCB;
1007
+ cToggleButton liveCB;
1008
+ cCheckBox supportCB;
1009
+ cCheckBox localCB;
1010
+ cCheckBox crowdCB;
1011
+ cCheckBox smoothCB;
1012
+ cToggleButton fastCB;
1013
+ cCheckBox slowCB;
1014
+ cCheckBox boxCB;
1015
+ cCheckBox zoomBoxCB;
1016
+ cCheckBox freezeCB;
1017
+ //cToggleButton trackCB;
1018
+ cCheckBox trackCB;
1019
+ cCheckBox smoothfocusCB;
7451020 // JCheckBox speakerMocapCB;
746
- JCheckBox speakerCameraCB;
747
- JCheckBox speakerFocusCB;
748
- JCheckBox debugCB;
749
- JCheckBox oeilCB;
750
- JCheckBox lookAtCB;
1021
+ cCheckBox speakerCameraCB;
1022
+ cCheckBox speakerFocusCB;
1023
+ cCheckBox debugCB;
1024
+
1025
+ cCheckBox oeilCB;
1026
+ cCheckBox shadowCB;
1027
+ cCheckBox autosaveCB;
1028
+ cCheckBox lookAtCB;
7511029
7521030 // static int COLOR = 1;
7531031 // static int MATERIAL = 2;
....@@ -755,9 +1033,9 @@
7551033
7561034 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7571035
758
- JCheckBox colorCB;
759
- JCheckBox materialCB;
760
- JCheckBox textureCB;
1036
+ cCheckBox colorCB;
1037
+ cCheckBox materialCB;
1038
+ cCheckBox textureCB;
7611039
7621040 public void itemStateChanged(ItemEvent e)
7631041 {
....@@ -785,6 +1063,7 @@
7851063 } else if(e.getSource() == liveCB)
7861064 {
7871065 cameraView.ToggleLive();
1066
+ refreshContents(false);
7881067 }
7891068 else if(e.getSource() == supportCB)
7901069 {
....@@ -849,6 +1128,18 @@
8491128 {
8501129 cameraView.ToggleOeil();
8511130 }
1131
+ else if(e.getSource() == shadowCB)
1132
+ {
1133
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1134
+ }
1135
+ else if(e.getSource() == freezeCB)
1136
+ {
1137
+ Globals.FREEZEONMOVE ^= true;
1138
+ }
1139
+ else if(e.getSource() == autosaveCB)
1140
+ {
1141
+ Globals.SAVEONMAKE ^= true;
1142
+ }
8521143 else if(e.getSource() == lookAtCB)
8531144 {
8541145 cameraView.ToggleLookAt();
....@@ -865,7 +1156,8 @@
8651156
8661157 /**/
8671158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
868
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
8691161 if ((path == null) || (path.getPathCount() <= 1)) {
8701162 // We can't move the root node or an empty selection
8711163 return;
....@@ -928,8 +1220,6 @@
9281220 }
9291221 }
9301222
931
- String string = (String) object;
932
-
9331223 System.out.println("Transfer = " + object + "; drop : " + target);
9341224 // if( object instanceof java.io.File[])
9351225 // {
....@@ -937,7 +1227,11 @@
9371227 // objEditor.DropFile((java.io.File[]) object, true);
9381228 // return;
9391229 // }
940
- if (string.charAt(0) == '/')
1230
+
1231
+ String string = object.toString();
1232
+
1233
+ // File path for Mac and Windows
1234
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9411235 {
9421236 // file(s)
9431237 String[] names = string.split("\n");
....@@ -964,7 +1258,7 @@
9641258
9651259 flashIt = false;
9661260 CameraPane pane = (CameraPane) target;
967
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1261
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9681262 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9691263
9701264 if (group.selection.size() == 1)
....@@ -980,23 +1274,33 @@
9801274
9811275 assert target == objEditor.jTree;
9821276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
9831278 try {
984
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9851280 } catch (Exception e) {
9861281 System.out.println("destinationPath : " + destinationPath);
9871282 return;
9881283 }
9891284
990
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
9911286 {
1287
+ Object3D child = (Object3D)group.selection.elementAt(i);
1288
+
1289
+ // Cannot move into itself
1290
+ if (child == destinationLeaf)
1291
+ return;
1292
+ }
1293
+
1294
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1295
+// {
9921296 loadClipboard(true);
9931297 objEditor.jTree.setSelectionPath(destinationPath);
9941298 pasteInto(false, false);
995
- } else {
996
- loadClipboard(false);
997
- objEditor.jTree.setSelectionPath(destinationPath);
998
- pasteInto(false, false); // true); // ???
999
- }
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
10001304 }
10011305 public void dropActionChanged(DropTargetDragEvent dtde)
10021306 // Called if the user has modified the current drop gesture
....@@ -1101,22 +1405,30 @@
11011405 {
11021406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11031407 //heightFieldItem.addActionListener(this);
1104
- gridItem = menu.add(new MenuItem("Grid"));
1105
- gridItem.addActionListener(this);
1106
- rectoidItem = menu.add(new MenuItem("Box"));
1107
- rectoidItem.addActionListener(this);
1108
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1109
- ellipsoidItem.addActionListener(this);
1110
- coneItem = menu.add(new MenuItem("Cone"));
1111
- coneItem.addActionListener(this);
1112
- torusItem = menu.add(new MenuItem("Torus"));
1113
- torusItem.addActionListener(this);
1114
- superItem = menu.add(new MenuItem("Superellipsoid"));
1115
- superItem.addActionListener(this);
1408
+// gridItem = menu.add(new MenuItem("Grid"));
1409
+// gridItem.addActionListener(this);
1410
+// rectoidItem = menu.add(new MenuItem("Box"));
1411
+// rectoidItem.addActionListener(this);
1412
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1413
+// ellipsoidItem.addActionListener(this);
1414
+// coneItem = menu.add(new MenuItem("Cone"));
1415
+// coneItem.addActionListener(this);
1416
+// torusItem = menu.add(new MenuItem("Torus"));
1417
+// torusItem.addActionListener(this);
1418
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1419
+// superItem.addActionListener(this);
1420
+
1421
+ cameraItem = menu.add(new MenuItem("Camera"));
1422
+ cameraItem.addActionListener(this);
1423
+
1424
+ if (!Globals.ADVANCED)
1425
+ {
11161426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11171427 kleinItem.addActionListener(this);
1118
- particleItem = menu.add(new MenuItem("Particle system"));
1119
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
11201432 if (Globals.ADVANCED)
11211433 {
11221434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1142,15 +1454,15 @@
11421454 }
11431455 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11441456 bezierItem.addActionListener(this);
1145
- overlayItem = menu.add(new MenuItem("Overlay"));
1146
- overlayItem.addActionListener(this);
1147
- lightItem = menu.add(new MenuItem("Light"));
1148
- lightItem.addActionListener(this);
1457
+// overlayItem = menu.add(new MenuItem("Overlay"));
1458
+// overlayItem.addActionListener(this);
1459
+// lightItem = menu.add(new MenuItem("Light"));
1460
+// lightItem.addActionListener(this);
11491461 menu.add("-");
11501462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11511463 //superLoopItem.addActionListener(this);
1152
- loopItem = menu.add(new MenuItem("Loop"));
1153
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
11541466 doubleItem = menu.add(new MenuItem("Fork"));
11551467 doubleItem.addActionListener(this);
11561468 if (Globals.ADVANCED)
....@@ -1166,6 +1478,9 @@
11661478 animationItem.addItemListener(this);
11671479 animationItem.setState(Globals.ANIMATION);
11681480
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
1483
+
11691484 menu.add("-");
11701485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11711486 parseverticesItem.addActionListener(this);
....@@ -1178,6 +1493,8 @@
11781493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11791494 reduce34MorphItem.addActionListener(this);
11801495 menu.add("-");
1496
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1497
+ memoryItem.addActionListener(this);
11811498 menu.add(computeAOItem = new MenuItem("Compute AO"));
11821499 computeAOItem.addActionListener(this);
11831500
....@@ -1186,11 +1503,9 @@
11861503 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11871504 mirrorItem.addActionListener(this);
11881505 menu.add("-");
1189
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1190
- memoryItem.addActionListener(this);
11911506 menu.add(analyzeItem = new MenuItem("Analyze"));
11921507 analyzeItem.addActionListener(this);
1193
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
11941509 dumpItem.addActionListener(this);
11951510 // menu.add(pathItem = new MenuItem("From-to path"));
11961511 // pathItem.addActionListener(this);
....@@ -1331,9 +1646,24 @@
13311646 shadow.material = new cMaterial(obj.material);
13321647 shadow.material.diffuse = 0.0001f;
13331648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
13341650
13351651 makeSomething(shadow);
13361652 }
1653
+
1654
+ private void ClearUnpinned()
1655
+ {
1656
+ //for (Object3D obj : listUI)
1657
+ for (int i=listUI.size(); --i>=0;)
1658
+ {
1659
+ Object3D obj = listUI.elementAt(i);
1660
+ if (!obj.pinned)
1661
+ {
1662
+ obj.CloseUI();
1663
+ listUI.remove(i);
1664
+ }
1665
+ }
1666
+ }
13371667
13381668 /**
13391669 * applyExample
....@@ -1537,9 +1867,9 @@
15371867
15381868 void Overwrite(int mask)
15391869 {
1540
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1870
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15411871 {
1542
- Object3D content = GrafreeD.clipboard.get(0);
1872
+ Object3D content = Grafreed.clipboard.get(0);
15431873
15441874 if (content instanceof cGroup && ((cGroup)content).transientlink )
15451875 content = ((cGroup)content).get(0);
....@@ -1578,7 +1908,7 @@
15781908 {
15791909 ScreenFit();
15801910 } else
1581
- if (source == switchItem)
1911
+ if (source == switchViewItem)
15821912 {
15831913 cVector v1 = new cVector();
15841914 cVector v2 = new cVector();
....@@ -1587,11 +1917,11 @@
15871917 objEditor.cameraView.renderCamera.setAim(v2, v1);
15881918 objEditor.cameraView.repaint();
15891919 } else
1590
- if (source == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
15911921 {
15921922 makeSomething(new Box());
15931923 } else
1594
- if (source == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
15951925 {
15961926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15971927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1670,27 +2000,27 @@
16702000
16712001 makeSomething(obj);
16722002 } else
1673
- if (source == gridItem)
2003
+ if (source == gridItem || source == gridButton)
16742004 {
16752005 makeSomething(new Grid());
16762006 } else
1677
- if (source == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
16782008 {
16792009 makeSomething(new Sphere());
16802010 } else
1681
- if (source == coneItem)
2011
+ if (source == coneItem || source == coneButton)
16822012 {
16832013 makeSomething(new Cone());
16842014 } else
1685
- if (source == torusItem)
2015
+ if (source == torusItem || source == torusButton)
16862016 {
16872017 makeSomething(new Torus());
16882018 } else
1689
- if (source == superItem)
2019
+ if (source == superItem || source == superButton)
16902020 {
16912021 makeSomething(new Superellipsoid());
16922022 } else
1693
- if (source == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
16942024 {
16952025 makeSomething(new Klein());
16962026 } else
....@@ -1710,7 +2040,7 @@
17102040 {
17112041 makeSomething(new BezierSurface());
17122042 } else
1713
- if (source == overlayItem)
2043
+ if (source == overlayItem || source == overlayButton)
17142044 {
17152045 /*
17162046 Object3D obj = new BezierSurface(5,8);
....@@ -1758,7 +2088,7 @@
17582088 s.setup();
17592089 makeSomething(s);
17602090 } else
1761
- if (source == lightItem)
2091
+ if (source == lightItem || source == lightButton)
17622092 {
17632093 makeSomething(new Light());
17642094 } else
....@@ -1808,30 +2138,30 @@
18082138
18092139 group(g);
18102140 } else
1811
- if (source == loopItem)
2141
+ if (source == loopItem || source == loopButton)
18122142 {
18132143 Composite csg = new GroupLeaf();
18142144 csg.count = 5;
18152145 group(csg);
1816
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
18172147 csg.addChild(child);
18182148 child.addChild(csg);
18192149 } else
18202150 if (source == doubleItem)
18212151 {
1822
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
18232153 csg.count = 5;
18242154 group(csg);
1825
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
18262156 csg.addChild(child);
18272157 child.addChild(csg);
1828
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
18292159 csg.addChild(child);
18302160 child.addChild(csg);
18312161 } else
18322162 if (source == tripleItem)
18332163 {
1834
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
18352165 csg.count = 4;
18362166 group(csg);
18372167 Composite child = new cGroup();
....@@ -1843,23 +2173,6 @@
18432173 child = new cGroup();
18442174 csg.addChild(child);
18452175 child.addChild(csg);
1846
- } else
1847
-
1848
- if (source == importGFDItem)
1849
- {
1850
- ImportGFD();
1851
- } else
1852
- if (source == importVRMLX3DItem)
1853
- {
1854
- ImportVRMLX3D();
1855
- } else
1856
- if (source == import3DSItem)
1857
- {
1858
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1859
- } else
1860
- if (source == importOBJItem)
1861
- {
1862
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18632176 } else
18642177 if (source == computeAOItem)
18652178 {
....@@ -1879,7 +2192,7 @@
18792192 if (source == invariantsItem)
18802193 {
18812194 System.out.println("Invariants:");
1882
- GrafreeD.grafreeD.universe.invariants();
2195
+ Grafreed.grafreeD.universe.invariants();
18832196 } else
18842197 if (source == memoryItem)
18852198 {
....@@ -1898,6 +2211,32 @@
18982211 {
18992212 DumpObject();
19002213 } else
2214
+ if (source == minButton)
2215
+ {
2216
+ Minimize();
2217
+ } else
2218
+ if (source == maxButton)
2219
+ {
2220
+ Maximize();
2221
+ } else
2222
+ if (source == fullButton)
2223
+ {
2224
+ ToggleFullScreen();
2225
+ } else
2226
+ if (source == undoButton)
2227
+ {
2228
+ if (!Undo())
2229
+ java.awt.Toolkit.getDefaultToolkit().beep();
2230
+ } else
2231
+ if (source == redoButton)
2232
+ {
2233
+ Redo();
2234
+ } else
2235
+ if (source == saveButton)
2236
+ {
2237
+ if (!Save(true))
2238
+ java.awt.Toolkit.getDefaultToolkit().beep();
2239
+ } else
19012240 if (source == oneStepButton)
19022241 {
19032242 Globals.ONESTEP = true;
....@@ -1905,17 +2244,14 @@
19052244 } else
19062245 if (source == screenfitButton)
19072246 {
1908
- //Reload(lastConverter, lastFilename, true);
19092247 ScreenFit();
19102248 } else
19112249 if (source == screenfitpointButton)
19122250 {
1913
- //Reload(lastConverter, lastFilename, true);
19142251 ScreenFitPoint();
19152252 } else
19162253 if (source == snapobjectButton)
19172254 {
1918
- //Reload(lastConverter, lastFilename, true);
19192255 SnapObject();
19202256 } else
19212257 // if (event.getSource() == recompileButton)
....@@ -1952,12 +2288,20 @@
19522288 {
19532289 loadClipboard(true);
19542290 } else
2291
+ if (source == undoItem)
2292
+ {
2293
+ Undo();
2294
+ } else
2295
+ if (source == redoItem)
2296
+ {
2297
+ Redo();
2298
+ } else
19552299 if (source == duplicateItem)
19562300 {
1957
- Object3D keep = GrafreeD.clipboard;
2301
+ Object3D keep = Grafreed.clipboard;
19582302 loadClipboard(false);
19592303 paste(false);
1960
- GrafreeD.clipboard = keep;
2304
+ Grafreed.clipboard = keep;
19612305 } else
19622306 if (source == cloneItem)
19632307 {
....@@ -2177,9 +2521,9 @@
21772521 // group.selection.get(0).setMasterThis(content); // should be identity
21782522 // refreshContents();
21792523 // }
2180
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2524
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21812525 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2526
+ Object3D content = Grafreed.clipboard.get(0);
21832527
21842528 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852529 content = ((cGroup)content).get(0);
....@@ -2229,9 +2573,9 @@
22292573 } else
22302574 if (source == setMasterItem)
22312575 {
2232
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2576
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22332577 {
2234
- Object3D content = GrafreeD.clipboard.get(0);
2578
+ Object3D content = Grafreed.clipboard.get(0);
22352579
22362580 if (content instanceof cGroup && ((cGroup)content).transientlink )
22372581 content = ((cGroup)content).get(0);
....@@ -2244,9 +2588,9 @@
22442588 {
22452589 if (group.selection.size() == 1)
22462590 {
2247
- if (GrafreeD.clipboard.size() == 1)
2591
+ if (Grafreed.clipboard.size() == 1)
22482592 {
2249
- Object3D content = GrafreeD.clipboard.get(0);
2593
+ Object3D content = Grafreed.clipboard.get(0);
22502594
22512595 if (content instanceof cGroup && ((cGroup)content).transientlink )
22522596 content = ((cGroup)content).get(0);
....@@ -2263,7 +2607,7 @@
22632607 {
22642608 RevertMeshes();
22652609 } else
2266
- if (source == resetMeshItem)
2610
+ if (source == resetAllItem)
22672611 {
22682612 ResetAll();
22692613 } else
....@@ -2283,9 +2627,9 @@
22832627 {
22842628 ClearSelection(true);
22852629 } else
2286
- if (source == grabItem)
2630
+ if (source == grabItem || source == groupButton)
22872631 {
2288
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
22892633 } else
22902634 if (source == hideItem)
22912635 {
....@@ -2303,11 +2647,11 @@
23032647 {
23042648 makeSomething(new Camera());
23052649 } else
2306
- if (source == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
23072651 {
23082652 group(new Composite());
23092653 } else
2310
- if (source == randomItem)
2654
+ if (source == switchItem || source == switchButton)
23112655 {
23122656 RandomNode random = new RandomNode();
23132657 group(random);
....@@ -2409,7 +2753,7 @@
24092753 {
24102754 group(new cLinker());
24112755 } else
2412
- if (source == textureItem)
2756
+ if (source == textureItem || source == textureButton)
24132757 {
24142758 group(new TextureNode());
24152759 } else
....@@ -2429,17 +2773,30 @@
24292773 {
24302774 CastShadow(2);
24312775 } else
2432
- if (source == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
24332777 {
2434
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
24352780 for (int i=0; i<group.selection.size(); i++)
24362781 {
2437
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
24382787 }
24392788
2440
- ClearSelection(false);
2441
-
2442
- refreshContents();
2789
+ if (!hasRoot)
2790
+ {
2791
+ for (int i=0; i<group.selection.size(); i++)
2792
+ {
2793
+ Ungroup(group.selection.get(i));
2794
+ }
2795
+
2796
+ ClearSelection(false);
2797
+
2798
+ refreshContents();
2799
+ }
24432800 } else
24442801 if (source == genUVItem)
24452802 {
....@@ -2451,7 +2808,7 @@
24512808 } else
24522809 if (source == genNormalsMESHItem)
24532810 {
2454
- GenNormals(true); // TODO
2811
+ GenNormalsMESH();
24552812 } else
24562813 if (source == genNormalsORGANItem)
24572814 {
....@@ -2516,6 +2873,22 @@
25162873 if (source == unmarkleavesItem)
25172874 {
25182875 MarkLeaves(false);
2876
+ } else
2877
+ if (source == rewindleavesItem)
2878
+ {
2879
+ RewindLeaves(true);
2880
+ } else
2881
+ if (source == unrewindleavesItem)
2882
+ {
2883
+ RewindLeaves(false);
2884
+ } else
2885
+ if (source == randomleavesItem)
2886
+ {
2887
+ RandomLeaves(true);
2888
+ } else
2889
+ if (source == unrandomleavesItem)
2890
+ {
2891
+ RandomLeaves(false);
25192892 } else
25202893 if (source == flipVItem)
25212894 {
....@@ -2601,9 +2974,13 @@
26012974 {
26022975 SmoothMesh();
26032976 } else
2604
- if (source == transformgeometryItem)
2977
+ if (source == transformGeometryItem)
26052978 {
26062979 TransformGeometry();
2980
+ } else
2981
+ if (source == transformChildrenItem)
2982
+ {
2983
+ TransformChildren();
26072984 } else
26082985 if (source == resetTransformItem)
26092986 {
....@@ -2611,7 +2988,11 @@
26112988 } else
26122989 if (source == resetCentroidItem)
26132990 {
2614
- ResetCentroid();
2991
+ ResetCentroid(true);
2992
+ } else
2993
+ if (source == resetCentroidXZItem)
2994
+ {
2995
+ ResetCentroid(false);
26152996 } else
26162997 if (source == resetParentItem)
26172998 {
....@@ -2743,6 +3124,10 @@
27433124 if (source == twoButton)
27443125 {
27453126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
27463131 // bug
27473132 //gridPanel.setDividerLocation(1.0);
27483133 //bigPanel.setDividerLocation(0.0);
....@@ -2775,10 +3160,31 @@
27753160 bigThree.ClearUI();
27763161 bigThree.add(centralPanel);
27773162 bigThree.FlushUI();
3163
+
3164
+ cameraView.requestFocusInWindow();
3165
+
3166
+// refreshContents(true);
3167
+//
3168
+// try
3169
+// {
3170
+// java.awt.Robot bot = new java.awt.Robot();
3171
+// int mask = InputEvent.BUTTON1_MASK;
3172
+// bot.mouseMove(100, 100);
3173
+// bot.mousePress(mask);
3174
+// bot.mouseRelease(mask);
3175
+// }
3176
+// catch (Exception e)
3177
+// {
3178
+//
3179
+// }
3180
+
27783181 } else
27793182 if (source == threeButton)
27803183 {
27813184 radio.layout = threeButton;
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
27823188
27833189 // bigThree.remove(scenePanel);
27843190 // bigThree.remove(centralPanel);
....@@ -2811,10 +3217,15 @@
28113217 bigThree.add(centralPanel);
28123218 bigThree.add(XYZPanel);
28133219 bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
28143222 } else
28153223 if (source == fourButton)
28163224 {
28173225 radio.layout = fourButton;
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
28183229
28193230 // bigThree.remove(scenePanel);
28203231 // bigThree.remove(centralPanel);
....@@ -2846,10 +3257,15 @@
28463257 bigThree.ClearUI();
28473258 bigThree.add(scenePanel);
28483259 bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
28493262 } else
28503263 if (source == sixButton)
28513264 {
28523265 radio.layout = sixButton;
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
28533269
28543270 // bigThree.remove(scenePanel);
28553271 // bigThree.remove(centralPanel);
....@@ -2882,10 +3298,15 @@
28823298 bigThree.add(scenePanel);
28833299 bigThree.add(centralPanel);
28843300 bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
28853303 } else
28863304 if (source == sevenButton)
28873305 {
28883306 radio.layout = sevenButton;
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
28893310
28903311 // bigThree.remove(scenePanel);
28913312 // bigThree.remove(centralPanel);
....@@ -2919,6 +3340,8 @@
29193340 bigThree.add(centralPanel);
29203341 bigThree.add(XYZPanel);
29213342 bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
29223345 } else
29233346 if (source == rootButton)
29243347 {
....@@ -2930,6 +3353,7 @@
29303353 EditObject(obj);
29313354 }
29323355
3356
+ cameraView.requestFocusInWindow();
29333357 refreshContents(true);
29343358 } else
29353359 if (source == closeButton)
....@@ -2939,22 +3363,37 @@
29393363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29403364 {
29413365 ab = (cRadio)e.nextElement();
2942
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29433367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
29443374 buttonGroup.remove(ab);
29453375 radioPanel.remove(ab);
29463376
2947
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
29483379 // ab.GetObject().objectUI = null; // ?????????
29493380
29503381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29513382 break;
29523383 }
29533384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
29543387 refreshContents(true);
29553388 } else
29563389 if (source == editItem || source == editButton)
29573390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
29583397 EditSelection(false);
29593398 } else
29603399 if (source == uneditButton)
....@@ -2964,10 +3403,11 @@
29643403 Object3D child = (Object3D)e.nextElement();
29653404 if(child.editWindow != null)
29663405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
29673407 child.CloseUI();
29683408 listUI.remove(child);
29693409
2970
- child.editWindow = null; // ???????????
3410
+ //child.editWindow = null; // ???????????
29713411 }
29723412 objEditor.ctrlPanel.FlushUI();
29733413 //objEditor.jTree.clearSelection();
....@@ -2980,6 +3420,7 @@
29803420 //copy.ClearUI();
29813421 for (Object3D obj : listUI)
29823422 {
3423
+ obj.pinned = false;
29833424 obj.CloseUI();
29843425 }
29853426 listUI.clear();
....@@ -2989,7 +3430,7 @@
29893430 {
29903431 assert(copy == group);
29913432
2992
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29933434
29943435 for (Object3D obj : listUI)
29953436 {
....@@ -3053,20 +3494,44 @@
30533494 frontView.object = group;
30543495 sideView.object = group;
30553496 }
3056
- group.editWindow = this;
3497
+
3498
+// fix "+" issue
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
3501
+
30573502 /*
30583503 currentLayout = radio.layout;
30593504 if (currentLayout == null)
30603505 currentLayout = sevenButton;
30613506 */
30623507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
30633513 keepparent = group.parent;
30643514 // PARENT = NULL or not???
30653515 //group.parent = null; // ROOT
30663516 //group.attributes = -1;
30673517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
30683520 refreshContents(true);
3069
- }
3521
+ } else if (event.getSource() == editCameraItem)
3522
+ {
3523
+ cameraView.ProtectCamera();
3524
+ cameraView.repaint();
3525
+ return;
3526
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3527
+ {
3528
+ cameraView.RevertCamera();
3529
+ cameraView.repaint();
3530
+ return;
3531
+ // } else if (event.getSource() == textureButton)
3532
+ // {
3533
+ // return; // true;
3534
+ }
30703535 else
30713536 {
30723537 //return super.action(event, arg);
....@@ -3075,7 +3540,6 @@
30753540 }
30763541
30773542 boolean useclient = false;
3078
- cRadio radio;
30793543
30803544 void ToggleRoot()
30813545 {
....@@ -3127,6 +3591,28 @@
31273591 refreshContents();
31283592 }
31293593
3594
+ void TransformChildren()
3595
+ {
3596
+ Object3D obj;
3597
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3598
+ {
3599
+ obj = (Object3D)e.nextElement();
3600
+ obj.KeepTextureMatrices();
3601
+ obj.TransformChildren();
3602
+ obj.RestoreTextureMatrices();
3603
+
3604
+// if (obj.parent == null)
3605
+// {
3606
+// System.out.println("NULL PARENT!");
3607
+// new Exception().printStackTrace();
3608
+// }
3609
+// else
3610
+// TouchTransform(obj);
3611
+// //obj.parent.Touch();
3612
+ }
3613
+
3614
+ refreshContents();
3615
+ }
31303616
31313617 void ResetTransform()
31323618 {
....@@ -3239,7 +3725,7 @@
32393725 refreshContents();
32403726 }
32413727
3242
- void ResetCentroid()
3728
+ void ResetCentroid(boolean full)
32433729 {
32443730 Object3D obj;
32453731 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3254,12 +3740,16 @@
32543740 LA.matIdentity(Object3D.mat);
32553741 obj.getBounds(minima, maxima, false);
32563742 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3257
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3743
+ if (full)
3744
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32583745 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32593746 obj.TransformMesh(Object3D.mat);
3747
+
32603748 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3261
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3749
+ if (full)
3750
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32623751 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3752
+
32633753 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32643754 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32653755 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3288,7 +3778,8 @@
32883778
32893779 int size = obj.MemorySize();
32903780
3291
- System.err.println((size/1024) + " KB is the size of " + obj);
3781
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3782
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32923783 }
32933784 }
32943785 catch (Exception e)
....@@ -3325,9 +3816,9 @@
33253816 obj = (Object3D)e.nextElement();
33263817
33273818 System.out.println("Object is: " + obj);
3328
- GrafreeD.AnalyzeObject(obj);
3819
+ Grafreed.AnalyzeObject(obj);
33293820 System.out.println("Boundary rep: " + obj.bRep);
3330
- GrafreeD.AnalyzeObject(obj.bRep);
3821
+ Grafreed.AnalyzeObject(obj.bRep);
33313822
33323823 // System.err.println((size/1024) + " KB is the size of " + obj);
33333824 }
....@@ -3369,6 +3860,13 @@
33693860 void GenNormals(boolean crease)
33703861 {
33713862 group.GenNormalsS(crease);
3863
+
3864
+ refreshContents();
3865
+ }
3866
+
3867
+ void GenNormalsMESH()
3868
+ {
3869
+ group.GenNormalsMeshS();
33723870
33733871 refreshContents();
33743872 }
....@@ -3541,8 +4039,8 @@
35414039
35424040 void ParseVertices()
35434041 {
3544
- boolean epsequal = GrafreeD.epsequal;
3545
- GrafreeD.epsequal = true;
4042
+ boolean epsequal = Grafreed.epsequal;
4043
+ Grafreed.epsequal = true;
35464044
35474045 for (int i=0; i<group.selection.size(); i++)
35484046 {
....@@ -3567,7 +4065,7 @@
35674065 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35684066 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35694067
3570
- g.add(GrafreeD.clipboard);
4068
+ g.add(Grafreed.clipboard);
35714069
35724070 buffer.add(g);
35734071 }
....@@ -3582,7 +4080,7 @@
35824080 makeSomething(buffer, i==group.selection.size()-1);
35834081 }
35844082
3585
- GrafreeD.epsequal = epsequal;
4083
+ Grafreed.epsequal = epsequal;
35864084
35874085 refreshContents();
35884086 }
....@@ -3600,7 +4098,16 @@
36004098 String pigment = Object3D.GetPigment(tex);
36014099 //String bump = Object3D.GetBump(tex);
36024100
3603
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4101
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4102
+
4103
+ try
4104
+ {
4105
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4106
+ }
4107
+ catch (Exception e)
4108
+ {
4109
+ System.err.println("FAIL: " + node);
4110
+ }
36044111
36054112 double s = v.s;
36064113
....@@ -3732,7 +4239,7 @@
37324239 return;
37334240
37344241 Object3D poses = group.selection.get(0);
3735
- Object3D ref = GrafreeD.clipboard.get(0);
4242
+ Object3D ref = Grafreed.clipboard.get(0);
37364243
37374244 Object3D newgroup = new Object3D("Po:" + poses.name);
37384245
....@@ -3926,9 +4433,9 @@
39264433
39274434 void ClipMesh()
39284435 {
3929
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4436
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39304437 {
3931
- Object3D content = GrafreeD.clipboard.get(0);
4438
+ Object3D content = Grafreed.clipboard.get(0);
39324439
39334440 if (content instanceof cGroup && ((cGroup)content).transientlink )
39344441 content = ((cGroup)content).get(0);
....@@ -3937,7 +4444,7 @@
39374444 // {
39384445 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39394446 // }
3940
- group.selection.ClipMesh(GrafreeD.clipboard);
4447
+ group.selection.ClipMesh(Grafreed.clipboard);
39414448 }
39424449 // group.selection.ClipMesh(GrafreeD.clipboard);
39434450 System.out.println("DONE.");
....@@ -3984,6 +4491,18 @@
39844491 void MarkLeaves(boolean hide)
39854492 {
39864493 group.selection.MarkLeaves(hide);
4494
+ refreshContents();
4495
+ }
4496
+
4497
+ void RewindLeaves(boolean hide)
4498
+ {
4499
+ group.selection.RewindLeaves(hide);
4500
+ refreshContents();
4501
+ }
4502
+
4503
+ void RandomLeaves(boolean hide)
4504
+ {
4505
+ group.selection.RandomLeaves(hide);
39874506 refreshContents();
39884507 }
39894508
....@@ -4058,10 +4577,6 @@
40584577 // }
40594578 // }
40604579
4061
- static boolean allparams = true;
4062
-
4063
- static Vector<Object3D> listUI = new Vector<Object3D>();
4064
-
40654580 void EditSelection(boolean newWindow)
40664581 {
40674582 // aConstraints.gridy = 0;
....@@ -4069,10 +4584,10 @@
40694584 {
40704585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40714586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4072
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40734588
40744589 Object3D elem = (Object3D)group.selection.elementAt(i);
4075
- if(elem != group)
4590
+ if(elem != group || !newWindow)
40764591 {
40774592 // if (!(elem instanceof Composite))
40784593 // newWindow = false;
....@@ -4154,7 +4669,8 @@
41544669 //new Exception().printStackTrace();
41554670
41564671 freezemodel = true;
4157
-
4672
+ ClearUnpinned();
4673
+
41584674 /**/
41594675 //switch (event.id)
41604676 {
....@@ -4162,7 +4678,6 @@
41624678 //case 702: // Event.LIST_DESELECT
41634679 group.deselectAll();
41644680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4165
- objEditor.ClearInfo(); // .GetMaterial());
41664681 if (tps != null)
41674682 {
41684683 for (int i=0; i < tps.length; i++)
....@@ -4171,10 +4686,8 @@
41714686
41724687 //if (child.parent != null)
41734688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
41744690 group.addSelectee(child);
4175
- objEditor.SetMaterial(child); // .GetMaterial());
4176
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4177
- System.err.println("info : " + child.GetPath());
41784691 }
41794692 }
41804693 // else
....@@ -4184,20 +4697,28 @@
41844697 // System.err.println("info : " + group.GetPath());
41854698 // }
41864699
4187
- objEditor.SetText(); // jan 2014
4188
-
4189
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4700
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41904701 CameraPane.flash = true;
41914702
4192
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4703
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41934704 // a camera
41944705 {
4195
- CameraPane.camerachangeframe = 0; // don't refuse it
4196
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4706
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4707
+ {
4708
+ CameraPane.camerachangeframe = 0; // don't refuse it
4709
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4710
+ }
41974711 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41984712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41994713 }
42004714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
42014722 refreshContents();
42024723 //return true;
42034724 }
....@@ -4206,6 +4727,35 @@
42064727
42074728 freezemodel = false;
42084729 }
4730
+
4731
+ void SetPinStates(boolean enabled)
4732
+ {
4733
+ editButton.setEnabled(enabled);
4734
+ uneditButton.setEnabled(enabled);
4735
+ unselectButton.setEnabled(enabled);
4736
+ flashSelectionButton.setEnabled(enabled);
4737
+ }
4738
+
4739
+ void refreshContents(boolean cp)
4740
+ {
4741
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4742
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4743
+ {
4744
+ objEditor.ClearInfo(); // .GetMaterial());
4745
+
4746
+ for (int i=0; i < group.selection.Size(); i++)
4747
+ {
4748
+ Object3D child = (Object3D) group.selection.get(i);
4749
+
4750
+ objEditor.AddInfo(child, this, true);
4751
+ System.err.println("info : " + child.GetPath());
4752
+ }
4753
+
4754
+ objEditor.SetText(); // jan 2014
4755
+ }
4756
+
4757
+ super.refreshContents(cp);
4758
+ }
42094759
42104760 void linkSomething(Object3D thing)
42114761 {
....@@ -4277,16 +4827,19 @@
42774827 {
42784828 if (group.selection.isEmpty())
42794829 return;
4280
- GrafreeD.clipboardIsTempGroup = false;
4830
+
4831
+ Grafreed.clipboardIsTempGroup = false;
42814832 Composite tGroup = null;
42824833 if (group.selection.size() > 0) // 1)
42834834 {
42844835 tGroup = new cGroup();
4285
- GrafreeD.clipboardIsTempGroup = true;
4836
+ Grafreed.clipboardIsTempGroup = true;
42864837 }
42874838
42884839 if (cut)
42894840 {
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
42904843 //int indices[] = jList.getSelectedIndices();
42914844 //for (int i = indices.length - 1; i >= 0; i--)
42924845 //jList.remove(indices[i]);
....@@ -4322,16 +4875,16 @@
43224875 //System.out.println("cut " + child);
43234876 //System.out.println("parent = " + child.parent);
43244877 // tmp.addChild(child);
4325
- if (GrafreeD.clipboardIsTempGroup)
4878
+ if (Grafreed.clipboardIsTempGroup)
43264879 tGroup.add/*Child*/(tmp);
43274880 else
4328
- GrafreeD.clipboard = tmp;
4881
+ Grafreed.clipboard = tmp;
43294882 }
43304883 else
4331
- if (GrafreeD.clipboardIsTempGroup)
4884
+ if (Grafreed.clipboardIsTempGroup)
43324885 tGroup.add/*Child*/(child);
43334886 else
4334
- GrafreeD.clipboard = child;
4887
+ Grafreed.clipboard = child;
43354888 }
43364889
43374890 //ResetModel();
....@@ -4363,21 +4916,23 @@
43634916 //System.out.println("cut " + elem);
43644917 //System.out.println("parent = " + elem.parent);
43654918 // tmp.addChild(elem);
4366
- if (GrafreeD.clipboardIsTempGroup)
4919
+ if (Grafreed.clipboardIsTempGroup)
43674920 tGroup.add/*Child*/(tmp);
43684921 else
4369
- GrafreeD.clipboard = tmp;
4922
+ Grafreed.clipboard = tmp;
43704923 }
43714924 else
4372
- if (GrafreeD.clipboardIsTempGroup)
4925
+ if (Grafreed.clipboardIsTempGroup)
43734926 tGroup.add/*Child*/(child);
43744927 else
4375
- GrafreeD.clipboard = child;
4928
+ Grafreed.clipboard = child;
43764929 }
43774930
43784931 }
4379
- if (GrafreeD.clipboardIsTempGroup)
4380
- GrafreeD.clipboard = tGroup;
4932
+
4933
+ if (Grafreed.clipboardIsTempGroup)
4934
+ Grafreed.clipboard = tGroup;
4935
+
43814936 if (cut)
43824937 {
43834938 ResetModel();
....@@ -4387,11 +4942,15 @@
43874942
43884943 void paste(boolean expand)
43894944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
43904949 // if (GrafreeD.clipboard == null)
43914950 // return;
43924951 boolean first = true;
43934952
4394
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
43954954 {
43964955 Composite temp;
43974956
....@@ -4402,7 +4961,7 @@
44024961 temp = (Composite)Applet3D.clipboard.deepCopy();
44034962 */
44044963 Object3D elem;
4405
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4964
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44064965 {
44074966 Object3D child = (Object3D)e.nextElement();
44084967
....@@ -4436,16 +4995,17 @@
44364995 //Object3D cb = Applet3D.clipboard;
44374996 //temp.addChild(cb);
44384997 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4439
- assert(GrafreeD.clipboard.parent == null);
4440
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4441
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4442
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4443
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4998
+ assert(Grafreed.clipboard.parent == null);
4999
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5000
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5001
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5002
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44445003 else
4445
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4446
- GrafreeD.clipboard.get(0).parent = keepparent;
5004
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5005
+ Grafreed.clipboard.get(0).parent = keepparent;
44475006 }
44485007
5008
+ Globals.SAVEONMAKE = keep;
44495009 ResetModel();
44505010 refreshContents();
44515011 }
....@@ -4492,9 +5052,9 @@
44925052 {
44935053 boolean first = true;
44945054
4495
- if (GrafreeD.clipboardIsTempGroup)
5055
+ if (Grafreed.clipboardIsTempGroup)
44965056 {
4497
- Composite temp = (Composite)GrafreeD.clipboard;
5057
+ Composite temp = (Composite)Grafreed.clipboard;
44985058 Object3D copy;
44995059 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45005060 {
....@@ -4504,7 +5064,7 @@
45045064 }
45055065 } else
45065066 {
4507
- linkSomething(GrafreeD.clipboard); //.get(0));
5067
+ linkSomething(Grafreed.clipboard); //.get(0));
45085068 }
45095069 }
45105070 }
....@@ -4581,6 +5141,10 @@
45815141
45825142 void group(Object3D csg, boolean grab)
45835143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
45845148 if (//false) // why??
45855149 !group.selection.isEmpty())
45865150 {
....@@ -4694,10 +5258,15 @@
46945258 //node.add(csg);
46955259 //makeSomething(node);
46965260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
46975262 }
46985263
46995264 void Ungroup(Object3D g)
47005265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
47015270 if (g instanceof HiddenObject)
47025271 {
47035272 HiddenObject h = (HiddenObject) g;
....@@ -4714,6 +5283,7 @@
47145283 objEditor.makeSomething(g.get(i), false);
47155284 }
47165285 }
5286
+ Globals.SAVEONMAKE = keep;
47175287 }
47185288
47195289 void ungroup()
....@@ -4909,21 +5479,6 @@
49095479 }
49105480 */
49115481
4912
- void ImportGFD()
4913
- {
4914
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4915
- browser.show();
4916
- String filename = browser.getFile();
4917
- if (filename != null && filename.length() > 0)
4918
- {
4919
- String fullname = browser.getDirectory() + filename;
4920
-
4921
- //Object3D readobj =
4922
- objEditor.ReadGFD(fullname, objEditor);
4923
- //makeSomething(readobj);
4924
- }
4925
- }
4926
-
49275482 /*
49285483 public void Callback(Object obj)
49295484 {
....@@ -4947,26 +5502,9 @@
49475502 }
49485503 */
49495504
4950
- void ImportVRMLX3D()
4951
- {
4952
- if (GrafreeD.standAlone)
4953
- {
4954
- /**/
4955
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4956
- browser.show();
4957
- String filename = browser.getFile();
4958
- if (filename != null && filename.length() > 0)
4959
- {
4960
- String fullname = browser.getDirectory() + filename;
4961
- LoadVRMLX3D(fullname);
4962
- }
4963
- /**/
4964
- }
4965
- }
4966
-
49675505 String GetFile(String dialogName)
49685506 {
4969
- if (GrafreeD.standAlone)
5507
+ if (Grafreed.standAlone)
49705508 {
49715509 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49725510 browser.show();
....@@ -5034,7 +5572,28 @@
50345572 cButton clearpanelButton;
50355573 cButton unselectButton;
50365574
5575
+ cButton restoreCameraButton;
5576
+
5577
+ cButton saveButton;
50375578 cButton oneStepButton;
5579
+
5580
+ cButton groupButton;
5581
+ cButton ungroupButton;
5582
+ cButton compositeButton;
5583
+ cButton switchButton;
5584
+ cButton loopButton;
5585
+ cButton textureButton;
5586
+
5587
+ cButton gridButton;
5588
+ cButton boxButton;
5589
+ cButton sphereButton;
5590
+ cButton coneButton;
5591
+ cButton torusButton;
5592
+ cButton superButton;
5593
+ cButton kleinButton;
5594
+ cButton particlesButton;
5595
+ cButton overlayButton;
5596
+ cButton lightButton;
50385597
50395598 cButton screenfitButton;
50405599 cButton screenfitpointButton;
....@@ -5047,14 +5606,6 @@
50475606
50485607 cButton setsupportButton;
50495608
5050
- cButton twoButton;
5051
- cButton sixButton;
5052
- cButton threeButton;
5053
- cButton sevenButton;
5054
- cButton fourButton; // full panel
5055
- cButton oneButton; // full XYZ
5056
- //cButton currentLayout;
5057
-
50585609 //
50595610 //Composite
50605611 Object3D // to do !!
....@@ -5064,9 +5615,11 @@
50645615 //JTree jTree;
50655616 private MenuItem lookAtItem;
50665617 private MenuItem lookFromItem;
5067
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
50685619 private MenuItem cutItem;
5069
- private MenuItem duplicateItem;
5620
+ private MenuItem undoItem;
5621
+ private MenuItem redoItem;
5622
+ private JMenuItem duplicateItem;
50705623 private MenuItem cloneItem;
50715624 private MenuItem cloneSupportItem;
50725625 private MenuItem overwriteGeoItem;
....@@ -5079,7 +5632,7 @@
50795632 private MenuItem linkverticesItem;
50805633 private MenuItem relinkverticesItem;
50815634 private MenuItem setMasterItem;
5082
- private MenuItem resetMeshItem;
5635
+ private MenuItem resetAllItem;
50835636 private MenuItem stepAllItem;
50845637 private MenuItem revertMeshItem;
50855638 private MenuItem poseMeshItem;
....@@ -5129,6 +5682,10 @@
51295682 private MenuItem showleavesItem;
51305683 private MenuItem markleavesItem;
51315684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
51325689
51335690 private MenuItem flipVItem;
51345691 private MenuItem unflipVItem;
....@@ -5140,15 +5697,17 @@
51405697 private MenuItem panoTexturesItem;
51415698
51425699 private MenuItem resetCentroidItem;
5143
- private MenuItem transformgeometryItem;
5700
+ private MenuItem resetCentroidXZItem;
51445701 private MenuItem resetTransformItem;
5702
+ private MenuItem transformGeometryItem;
5703
+ private MenuItem transformChildrenItem;
51455704 private MenuItem hideItem;
51465705 private MenuItem grabItem;
51475706 private MenuItem backItem;
51485707 private MenuItem frontItem;
51495708 private MenuItem cameraItem;
51505709 private MenuItem compositeItem;
5151
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
51525711 private MenuItem physicsItem;
51535712 private MenuItem frameselectorItem;
51545713 private MenuItem scriptNodeItem;
....@@ -5210,11 +5769,6 @@
52105769 private MenuItem doubleItem;
52115770 private MenuItem tripleItem;
52125771
5213
- private MenuItem importGFDItem;
5214
- private MenuItem importVRMLX3DItem;
5215
- private MenuItem import3DSItem;
5216
- private MenuItem importOBJItem;
5217
-
52185772 private MenuItem computeAOItem;
52195773 private MenuItem recompileItem;
52205774 private MenuItem editScriptItem;
....@@ -5224,4 +5778,8 @@
52245778 private MenuItem analyzeItem;
52255779 private MenuItem dumpItem;
52265780 //boolean freezemodel = false;
5781
+
5782
+ Menu cameraMenu;
5783
+ MenuItem editCameraItem;
5784
+ MenuItem restoreCameraItem;
52275785 }