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,41 +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
- importOBJItem = menu.add(new MenuItem("OBJ file..."));
443
- importOBJItem.addActionListener(this);
444
- menu.add("-");
445
- import3DSItem = menu.add(new MenuItem("3DS file..."));
446
- import3DSItem.addActionListener(this);
447
- menu.add("-");
448
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
- importVRMLX3DItem.addActionListener(this);
450
- menu.add("-");
451
- importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
- importGFDItem.addActionListener(this);
453
-
454543 oe.menuBar.add(menu = new Menu("Tools"));
455544 buildToolsMenu(menu);
456545 }
457546
458547 void SetupUI2(ObjEditor oe)
459548 {
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
+
460561 //new Exception().printStackTrace();
461562
462563 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -485,97 +586,216 @@
485586 oe.radioPanel.add(dummyButton);
486587 oe.buttonGroup.add(dummyButton);
487588 */
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
592
+
488593 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
489594
490
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
- 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");
492634 liveCB.addItemListener(this);
493635
494
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
636
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495637 oneStepButton.setToolTipText("Animate one step forward");
496638 oneStepButton.addActionListener(this);
497639
498
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
640
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
499641 fastCB.setToolTipText("Fast mode");
500642 fastCB.addItemListener(this);
501643
502
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
503
- trackCB.setToolTipText("Enable tracking");
504
- trackCB.addItemListener(this);
505
-
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
507
- screenfitButton.setToolTipText("Screen fit");
508
- 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);
509649
510650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
511651 // screenfitpointButton.addActionListener(this);
512652
513653 if (Globals.ADVANCED)
514654 {
515
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
655
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516656 snapobjectButton.addActionListener(this);
517657 snapobjectButton.setToolTipText("Snap Object");
518658 }
519659
520
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
- flashSelectionButton.setToolTipText("Show selection");
522
- flashSelectionButton.addActionListener(this);
660
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
523661
524
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525
-
526
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527663 twoButton.setToolTipText("Show center view only");
528664 twoButton.addActionListener(this);
529
- 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);
530668 fourButton.addActionListener(this);
531669 fourButton.setToolTipText("Show left panel only");
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533671 sixButton.setToolTipText("2-column layout left");
534672 sixButton.addActionListener(this);
535
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
673
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536674 threeButton.setToolTipText("2-column layout right");
537675 threeButton.addActionListener(this);
538
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
539677 sevenButton.setToolTipText("3-column layout");
540678 sevenButton.addActionListener(this);
541679 //
542680
543
- 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);
544682 rootButton.setToolTipText("Edit selection in new tab");
545683 rootButton.addActionListener(this);
546684
547
- 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);
548686 closeButton.setToolTipText("Close tab");
549687 closeButton.addActionListener(this);
550688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
551689 //clearButton.addActionListener(this);
552
-
553
- 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
+ }
554722
555
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
- 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");
557772 editButton.addActionListener(this);
558773
559
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
- uneditButton.setToolTipText("Unedit selection");
774
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ uneditButton.setToolTipText("Remove selection controls");
561776 uneditButton.addActionListener(this);
562777
563
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
- allParamsButton.setToolTipText("Edit all params");
778
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
779
+ allParamsButton.setToolTipText("Show all controle");
565780 allParamsButton.addActionListener(this);
566781
567
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
782
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
568783 clearPanelButton.setToolTipText("Clear edit panel");
569784 clearPanelButton.addActionListener(this);
570785
571
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
786
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
572787 unselectButton.setToolTipText("Unselect");
573788 unselectButton.addActionListener(this);
574789
575
- 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);
576793
577
- oe.treePanel.add(commandsPanel);
578
- oe.treePanel.Return();
794
+ editCommandsPanel.preferredHeight = 1;
795
+
796
+ SetPinStates(false);
797
+// oe.treePanel.add(commandsPanel);
798
+// oe.treePanel.Return();
579799
580800 // oe.aConstraints.gridx += 1;
581801 // oe.aConstraints.weighty = 0;
....@@ -592,27 +812,12 @@
592812
593813 JScrollPane jSP;
594814 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596816 ResetModel();
597817
598818 oe.treePanel.add(jSPPanel);
599819 oe.treePanel.Return();
600820
601
- cGridBag copyOptionsPanel = new cGridBag();
602
-
603
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
- colorCB.setToolTipText("Copy color when dropped");
605
- colorCB.addItemListener(this);
606
-
607
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
- materialCB.setToolTipText("Copy material when dropped");
609
- materialCB.addItemListener(this);
610
-
611
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
- textureCB.setToolTipText("Copy texture when dropped");
613
- textureCB.addItemListener(this);
614
-
615
- copyOptionsPanel.preferredHeight = 1;
616821 oe.treePanel.add(copyOptionsPanel);
617822 oe.treePanel.Return();
618823
....@@ -643,23 +848,43 @@
643848
644849 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
645850 {
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
+
646865 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
647866 boxCB.setToolTipText("Display bounding boxes");
648867 boxCB.addItemListener(this);
649868
650869 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
870
+ zoomBoxCB.setToolTipText("Display only for wheel");
652871 zoomBoxCB.addItemListener(this);
653872
654
- if (Globals.ADVANCED)
873
+ if (true) // Globals.ADVANCED)
655874 {
656
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
- supportCB.setToolTipText("Enable rigging");
658
- 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);
659882
660883 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661884 // localCB.addItemListener(this);
662885
886
+ panel.Return();
887
+
663888 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664889 crowdCB.setToolTipText("Used for crowds");
665890 crowdCB.addItemListener(this);
....@@ -676,6 +901,8 @@
676901 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
677902 // speakerMocapCB.addItemListener(this);
678903
904
+ panel.Return();
905
+
679906 if (false)
680907 {
681908 // handled in scripts
....@@ -690,32 +917,72 @@
690917 //constraints.gridy += 1;
691918 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
692919 smoothfocusCB.addItemListener(this);
920
+ panel.Return();
693921 }
694922
695923 //constraints.gridx += 1;
696924 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
697925 // debugCB.addItemListener(this);
698926
927
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
928
+ trackCB.setToolTipText("Enable tracking target");
929
+ trackCB.addItemListener(this);
930
+
699931 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
932
+ oeilCB.setToolTipText("Move camera when tracking");
700933 oeilCB.addItemListener(this);
701934
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
+ {
702955 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
703956 lookAtCB.setToolTipText("Look-at target");
704957 lookAtCB.addItemListener(this);
958
+ }
705959
706960 }
707961
708962 cGridBag fill = new cGridBag();
709
-
710963 fill.preferredHeight = 200;
964
+ cGridBag fill2 = new cGridBag();
965
+ fill2.preferredHeight = 200;
966
+ cGridBag fill3 = new cGridBag();
967
+ fill3.preferredHeight = 200;
711968
712969 panel.add(fill);
970
+ panel.add(fill2);
971
+ panel.add(fill3);
713972
714973 }
715974
716975 void EditObject(Object3D obj)
717976 {
718977 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
+
719986 radioButton.SetObject(obj);
720987 radioButton.layout = sevenButton;
721988 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -724,8 +991,11 @@
724991 buttonGroup.add(radioButton);
725992 radioButton.doClick();
726993 }
994
+
727995 void SetupViews(ObjEditor oe)
728996 {
997
+ theFrame = this;
998
+
729999 oe.SetupViews();
7301000
7311001 System.out.println("SetupViews");
....@@ -734,23 +1004,28 @@
7341004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7351005 }
7361006
737
- JCheckBox liveCB;
738
- JCheckBox supportCB;
739
- JCheckBox localCB;
740
- JCheckBox crowdCB;
741
- JCheckBox smoothCB;
742
- JCheckBox fastCB;
743
- JCheckBox slowCB;
744
- JCheckBox boxCB;
745
- JCheckBox zoomBoxCB;
746
- JCheckBox trackCB;
747
- 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;
7481020 // JCheckBox speakerMocapCB;
749
- JCheckBox speakerCameraCB;
750
- JCheckBox speakerFocusCB;
751
- JCheckBox debugCB;
752
- JCheckBox oeilCB;
753
- JCheckBox lookAtCB;
1021
+ cCheckBox speakerCameraCB;
1022
+ cCheckBox speakerFocusCB;
1023
+ cCheckBox debugCB;
1024
+
1025
+ cCheckBox oeilCB;
1026
+ cCheckBox shadowCB;
1027
+ cCheckBox autosaveCB;
1028
+ cCheckBox lookAtCB;
7541029
7551030 // static int COLOR = 1;
7561031 // static int MATERIAL = 2;
....@@ -758,9 +1033,9 @@
7581033
7591034 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7601035
761
- JCheckBox colorCB;
762
- JCheckBox materialCB;
763
- JCheckBox textureCB;
1036
+ cCheckBox colorCB;
1037
+ cCheckBox materialCB;
1038
+ cCheckBox textureCB;
7641039
7651040 public void itemStateChanged(ItemEvent e)
7661041 {
....@@ -788,6 +1063,7 @@
7881063 } else if(e.getSource() == liveCB)
7891064 {
7901065 cameraView.ToggleLive();
1066
+ refreshContents(false);
7911067 }
7921068 else if(e.getSource() == supportCB)
7931069 {
....@@ -852,6 +1128,18 @@
8521128 {
8531129 cameraView.ToggleOeil();
8541130 }
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
+ }
8551143 else if(e.getSource() == lookAtCB)
8561144 {
8571145 cameraView.ToggleLookAt();
....@@ -868,7 +1156,8 @@
8681156
8691157 /**/
8701158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
871
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
8721161 if ((path == null) || (path.getPathCount() <= 1)) {
8731162 // We can't move the root node or an empty selection
8741163 return;
....@@ -931,8 +1220,6 @@
9311220 }
9321221 }
9331222
934
- String string = (String) object;
935
-
9361223 System.out.println("Transfer = " + object + "; drop : " + target);
9371224 // if( object instanceof java.io.File[])
9381225 // {
....@@ -940,7 +1227,11 @@
9401227 // objEditor.DropFile((java.io.File[]) object, true);
9411228 // return;
9421229 // }
943
- 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) == ':')
9441235 {
9451236 // file(s)
9461237 String[] names = string.split("\n");
....@@ -967,7 +1258,7 @@
9671258
9681259 flashIt = false;
9691260 CameraPane pane = (CameraPane) target;
970
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1261
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9711262 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9721263
9731264 if (group.selection.size() == 1)
....@@ -983,23 +1274,33 @@
9831274
9841275 assert target == objEditor.jTree;
9851276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
9861278 try {
987
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9881280 } catch (Exception e) {
9891281 System.out.println("destinationPath : " + destinationPath);
9901282 return;
9911283 }
9921284
993
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
9941286 {
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
+// {
9951296 loadClipboard(true);
9961297 objEditor.jTree.setSelectionPath(destinationPath);
9971298 pasteInto(false, false);
998
- } else {
999
- loadClipboard(false);
1000
- objEditor.jTree.setSelectionPath(destinationPath);
1001
- pasteInto(false, false); // true); // ???
1002
- }
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
10031304 }
10041305 public void dropActionChanged(DropTargetDragEvent dtde)
10051306 // Called if the user has modified the current drop gesture
....@@ -1104,22 +1405,30 @@
11041405 {
11051406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11061407 //heightFieldItem.addActionListener(this);
1107
- gridItem = menu.add(new MenuItem("Grid"));
1108
- gridItem.addActionListener(this);
1109
- rectoidItem = menu.add(new MenuItem("Box"));
1110
- rectoidItem.addActionListener(this);
1111
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1112
- ellipsoidItem.addActionListener(this);
1113
- coneItem = menu.add(new MenuItem("Cone"));
1114
- coneItem.addActionListener(this);
1115
- torusItem = menu.add(new MenuItem("Torus"));
1116
- torusItem.addActionListener(this);
1117
- superItem = menu.add(new MenuItem("Superellipsoid"));
1118
- 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
+ {
11191426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11201427 kleinItem.addActionListener(this);
1121
- particleItem = menu.add(new MenuItem("Particle system"));
1122
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
11231432 if (Globals.ADVANCED)
11241433 {
11251434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1145,15 +1454,15 @@
11451454 }
11461455 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11471456 bezierItem.addActionListener(this);
1148
- overlayItem = menu.add(new MenuItem("Overlay"));
1149
- overlayItem.addActionListener(this);
1150
- lightItem = menu.add(new MenuItem("Light"));
1151
- 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);
11521461 menu.add("-");
11531462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11541463 //superLoopItem.addActionListener(this);
1155
- loopItem = menu.add(new MenuItem("Loop"));
1156
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
11571466 doubleItem = menu.add(new MenuItem("Fork"));
11581467 doubleItem.addActionListener(this);
11591468 if (Globals.ADVANCED)
....@@ -1169,6 +1478,9 @@
11691478 animationItem.addItemListener(this);
11701479 animationItem.setState(Globals.ANIMATION);
11711480
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
1483
+
11721484 menu.add("-");
11731485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11741486 parseverticesItem.addActionListener(this);
....@@ -1181,6 +1493,8 @@
11811493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11821494 reduce34MorphItem.addActionListener(this);
11831495 menu.add("-");
1496
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1497
+ memoryItem.addActionListener(this);
11841498 menu.add(computeAOItem = new MenuItem("Compute AO"));
11851499 computeAOItem.addActionListener(this);
11861500
....@@ -1189,11 +1503,9 @@
11891503 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11901504 mirrorItem.addActionListener(this);
11911505 menu.add("-");
1192
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1193
- memoryItem.addActionListener(this);
11941506 menu.add(analyzeItem = new MenuItem("Analyze"));
11951507 analyzeItem.addActionListener(this);
1196
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
11971509 dumpItem.addActionListener(this);
11981510 // menu.add(pathItem = new MenuItem("From-to path"));
11991511 // pathItem.addActionListener(this);
....@@ -1334,9 +1646,24 @@
13341646 shadow.material = new cMaterial(obj.material);
13351647 shadow.material.diffuse = 0.0001f;
13361648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
13371650
13381651 makeSomething(shadow);
13391652 }
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
+ }
13401667
13411668 /**
13421669 * applyExample
....@@ -1540,9 +1867,9 @@
15401867
15411868 void Overwrite(int mask)
15421869 {
1543
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1870
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15441871 {
1545
- Object3D content = GrafreeD.clipboard.get(0);
1872
+ Object3D content = Grafreed.clipboard.get(0);
15461873
15471874 if (content instanceof cGroup && ((cGroup)content).transientlink )
15481875 content = ((cGroup)content).get(0);
....@@ -1581,7 +1908,7 @@
15811908 {
15821909 ScreenFit();
15831910 } else
1584
- if (source == switchItem)
1911
+ if (source == switchViewItem)
15851912 {
15861913 cVector v1 = new cVector();
15871914 cVector v2 = new cVector();
....@@ -1590,11 +1917,11 @@
15901917 objEditor.cameraView.renderCamera.setAim(v2, v1);
15911918 objEditor.cameraView.repaint();
15921919 } else
1593
- if (source == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
15941921 {
15951922 makeSomething(new Box());
15961923 } else
1597
- if (source == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
15981925 {
15991926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16001927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1673,27 +2000,27 @@
16732000
16742001 makeSomething(obj);
16752002 } else
1676
- if (source == gridItem)
2003
+ if (source == gridItem || source == gridButton)
16772004 {
16782005 makeSomething(new Grid());
16792006 } else
1680
- if (source == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
16812008 {
16822009 makeSomething(new Sphere());
16832010 } else
1684
- if (source == coneItem)
2011
+ if (source == coneItem || source == coneButton)
16852012 {
16862013 makeSomething(new Cone());
16872014 } else
1688
- if (source == torusItem)
2015
+ if (source == torusItem || source == torusButton)
16892016 {
16902017 makeSomething(new Torus());
16912018 } else
1692
- if (source == superItem)
2019
+ if (source == superItem || source == superButton)
16932020 {
16942021 makeSomething(new Superellipsoid());
16952022 } else
1696
- if (source == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
16972024 {
16982025 makeSomething(new Klein());
16992026 } else
....@@ -1713,7 +2040,7 @@
17132040 {
17142041 makeSomething(new BezierSurface());
17152042 } else
1716
- if (source == overlayItem)
2043
+ if (source == overlayItem || source == overlayButton)
17172044 {
17182045 /*
17192046 Object3D obj = new BezierSurface(5,8);
....@@ -1761,7 +2088,7 @@
17612088 s.setup();
17622089 makeSomething(s);
17632090 } else
1764
- if (source == lightItem)
2091
+ if (source == lightItem || source == lightButton)
17652092 {
17662093 makeSomething(new Light());
17672094 } else
....@@ -1811,30 +2138,30 @@
18112138
18122139 group(g);
18132140 } else
1814
- if (source == loopItem)
2141
+ if (source == loopItem || source == loopButton)
18152142 {
18162143 Composite csg = new GroupLeaf();
18172144 csg.count = 5;
18182145 group(csg);
1819
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
18202147 csg.addChild(child);
18212148 child.addChild(csg);
18222149 } else
18232150 if (source == doubleItem)
18242151 {
1825
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
18262153 csg.count = 5;
18272154 group(csg);
1828
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
18292156 csg.addChild(child);
18302157 child.addChild(csg);
1831
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
18322159 csg.addChild(child);
18332160 child.addChild(csg);
18342161 } else
18352162 if (source == tripleItem)
18362163 {
1837
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
18382165 csg.count = 4;
18392166 group(csg);
18402167 Composite child = new cGroup();
....@@ -1846,31 +2173,6 @@
18462173 child = new cGroup();
18472174 csg.addChild(child);
18482175 child.addChild(csg);
1849
- } else
1850
-
1851
- if (source == importGFDItem)
1852
- {
1853
- ImportGFD();
1854
- } else
1855
- if (source == importVRMLX3DItem)
1856
- {
1857
- ImportVRMLX3D();
1858
- } else
1859
- if (source == import3DSItem)
1860
- {
1861
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1862
- } else
1863
- if (source == importOBJItem)
1864
- {
1865
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
- browser.setVisible(true);
1868
- String filename = browser.getFile();
1869
- if (filename != null && filename.length() > 0)
1870
- {
1871
- String fullname = browser.getDirectory() + filename;
1872
- makeSomething(ReadOBJ(fullname), true);
1873
- }
18742176 } else
18752177 if (source == computeAOItem)
18762178 {
....@@ -1890,7 +2192,7 @@
18902192 if (source == invariantsItem)
18912193 {
18922194 System.out.println("Invariants:");
1893
- GrafreeD.grafreeD.universe.invariants();
2195
+ Grafreed.grafreeD.universe.invariants();
18942196 } else
18952197 if (source == memoryItem)
18962198 {
....@@ -1909,6 +2211,32 @@
19092211 {
19102212 DumpObject();
19112213 } 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
19122240 if (source == oneStepButton)
19132241 {
19142242 Globals.ONESTEP = true;
....@@ -1916,17 +2244,14 @@
19162244 } else
19172245 if (source == screenfitButton)
19182246 {
1919
- //Reload(lastConverter, lastFilename, true);
19202247 ScreenFit();
19212248 } else
19222249 if (source == screenfitpointButton)
19232250 {
1924
- //Reload(lastConverter, lastFilename, true);
19252251 ScreenFitPoint();
19262252 } else
19272253 if (source == snapobjectButton)
19282254 {
1929
- //Reload(lastConverter, lastFilename, true);
19302255 SnapObject();
19312256 } else
19322257 // if (event.getSource() == recompileButton)
....@@ -1963,12 +2288,20 @@
19632288 {
19642289 loadClipboard(true);
19652290 } else
2291
+ if (source == undoItem)
2292
+ {
2293
+ Undo();
2294
+ } else
2295
+ if (source == redoItem)
2296
+ {
2297
+ Redo();
2298
+ } else
19662299 if (source == duplicateItem)
19672300 {
1968
- Object3D keep = GrafreeD.clipboard;
2301
+ Object3D keep = Grafreed.clipboard;
19692302 loadClipboard(false);
19702303 paste(false);
1971
- GrafreeD.clipboard = keep;
2304
+ Grafreed.clipboard = keep;
19722305 } else
19732306 if (source == cloneItem)
19742307 {
....@@ -2188,9 +2521,9 @@
21882521 // group.selection.get(0).setMasterThis(content); // should be identity
21892522 // refreshContents();
21902523 // }
2191
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2524
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21922525 {
2193
- Object3D content = GrafreeD.clipboard.get(0);
2526
+ Object3D content = Grafreed.clipboard.get(0);
21942527
21952528 if (content instanceof cGroup && ((cGroup)content).transientlink )
21962529 content = ((cGroup)content).get(0);
....@@ -2240,9 +2573,9 @@
22402573 } else
22412574 if (source == setMasterItem)
22422575 {
2243
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2576
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22442577 {
2245
- Object3D content = GrafreeD.clipboard.get(0);
2578
+ Object3D content = Grafreed.clipboard.get(0);
22462579
22472580 if (content instanceof cGroup && ((cGroup)content).transientlink )
22482581 content = ((cGroup)content).get(0);
....@@ -2255,9 +2588,9 @@
22552588 {
22562589 if (group.selection.size() == 1)
22572590 {
2258
- if (GrafreeD.clipboard.size() == 1)
2591
+ if (Grafreed.clipboard.size() == 1)
22592592 {
2260
- Object3D content = GrafreeD.clipboard.get(0);
2593
+ Object3D content = Grafreed.clipboard.get(0);
22612594
22622595 if (content instanceof cGroup && ((cGroup)content).transientlink )
22632596 content = ((cGroup)content).get(0);
....@@ -2274,7 +2607,7 @@
22742607 {
22752608 RevertMeshes();
22762609 } else
2277
- if (source == resetMeshItem)
2610
+ if (source == resetAllItem)
22782611 {
22792612 ResetAll();
22802613 } else
....@@ -2294,9 +2627,9 @@
22942627 {
22952628 ClearSelection(true);
22962629 } else
2297
- if (source == grabItem)
2630
+ if (source == grabItem || source == groupButton)
22982631 {
2299
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
23002633 } else
23012634 if (source == hideItem)
23022635 {
....@@ -2314,11 +2647,11 @@
23142647 {
23152648 makeSomething(new Camera());
23162649 } else
2317
- if (source == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
23182651 {
23192652 group(new Composite());
23202653 } else
2321
- if (source == randomItem)
2654
+ if (source == switchItem || source == switchButton)
23222655 {
23232656 RandomNode random = new RandomNode();
23242657 group(random);
....@@ -2420,7 +2753,7 @@
24202753 {
24212754 group(new cLinker());
24222755 } else
2423
- if (source == textureItem)
2756
+ if (source == textureItem || source == textureButton)
24242757 {
24252758 group(new TextureNode());
24262759 } else
....@@ -2440,17 +2773,30 @@
24402773 {
24412774 CastShadow(2);
24422775 } else
2443
- if (source == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
24442777 {
2445
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
24462780 for (int i=0; i<group.selection.size(); i++)
24472781 {
2448
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
24492787 }
24502788
2451
- ClearSelection(false);
2452
-
2453
- 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
+ }
24542800 } else
24552801 if (source == genUVItem)
24562802 {
....@@ -2462,7 +2808,7 @@
24622808 } else
24632809 if (source == genNormalsMESHItem)
24642810 {
2465
- GenNormals(true); // TODO
2811
+ GenNormalsMESH();
24662812 } else
24672813 if (source == genNormalsORGANItem)
24682814 {
....@@ -2527,6 +2873,22 @@
25272873 if (source == unmarkleavesItem)
25282874 {
25292875 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);
25302892 } else
25312893 if (source == flipVItem)
25322894 {
....@@ -2612,9 +2974,13 @@
26122974 {
26132975 SmoothMesh();
26142976 } else
2615
- if (source == transformgeometryItem)
2977
+ if (source == transformGeometryItem)
26162978 {
26172979 TransformGeometry();
2980
+ } else
2981
+ if (source == transformChildrenItem)
2982
+ {
2983
+ TransformChildren();
26182984 } else
26192985 if (source == resetTransformItem)
26202986 {
....@@ -2622,7 +2988,11 @@
26222988 } else
26232989 if (source == resetCentroidItem)
26242990 {
2625
- ResetCentroid();
2991
+ ResetCentroid(true);
2992
+ } else
2993
+ if (source == resetCentroidXZItem)
2994
+ {
2995
+ ResetCentroid(false);
26262996 } else
26272997 if (source == resetParentItem)
26282998 {
....@@ -2754,6 +3124,10 @@
27543124 if (source == twoButton)
27553125 {
27563126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
27573131 // bug
27583132 //gridPanel.setDividerLocation(1.0);
27593133 //bigPanel.setDividerLocation(0.0);
....@@ -2786,10 +3160,31 @@
27863160 bigThree.ClearUI();
27873161 bigThree.add(centralPanel);
27883162 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
+
27893181 } else
27903182 if (source == threeButton)
27913183 {
27923184 radio.layout = threeButton;
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
27933188
27943189 // bigThree.remove(scenePanel);
27953190 // bigThree.remove(centralPanel);
....@@ -2822,10 +3217,15 @@
28223217 bigThree.add(centralPanel);
28233218 bigThree.add(XYZPanel);
28243219 bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
28253222 } else
28263223 if (source == fourButton)
28273224 {
28283225 radio.layout = fourButton;
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
28293229
28303230 // bigThree.remove(scenePanel);
28313231 // bigThree.remove(centralPanel);
....@@ -2857,10 +3257,15 @@
28573257 bigThree.ClearUI();
28583258 bigThree.add(scenePanel);
28593259 bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
28603262 } else
28613263 if (source == sixButton)
28623264 {
28633265 radio.layout = sixButton;
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
28643269
28653270 // bigThree.remove(scenePanel);
28663271 // bigThree.remove(centralPanel);
....@@ -2893,10 +3298,15 @@
28933298 bigThree.add(scenePanel);
28943299 bigThree.add(centralPanel);
28953300 bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
28963303 } else
28973304 if (source == sevenButton)
28983305 {
28993306 radio.layout = sevenButton;
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
29003310
29013311 // bigThree.remove(scenePanel);
29023312 // bigThree.remove(centralPanel);
....@@ -2930,6 +3340,8 @@
29303340 bigThree.add(centralPanel);
29313341 bigThree.add(XYZPanel);
29323342 bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
29333345 } else
29343346 if (source == rootButton)
29353347 {
....@@ -2941,6 +3353,7 @@
29413353 EditObject(obj);
29423354 }
29433355
3356
+ cameraView.requestFocusInWindow();
29443357 refreshContents(true);
29453358 } else
29463359 if (source == closeButton)
....@@ -2950,22 +3363,37 @@
29503363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29513364 {
29523365 ab = (cRadio)e.nextElement();
2953
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29543367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
29553374 buttonGroup.remove(ab);
29563375 radioPanel.remove(ab);
29573376
2958
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
29593379 // ab.GetObject().objectUI = null; // ?????????
29603380
29613381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29623382 break;
29633383 }
29643384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
29653387 refreshContents(true);
29663388 } else
29673389 if (source == editItem || source == editButton)
29683390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
29693397 EditSelection(false);
29703398 } else
29713399 if (source == uneditButton)
....@@ -2975,10 +3403,11 @@
29753403 Object3D child = (Object3D)e.nextElement();
29763404 if(child.editWindow != null)
29773405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
29783407 child.CloseUI();
29793408 listUI.remove(child);
29803409
2981
- child.editWindow = null; // ???????????
3410
+ //child.editWindow = null; // ???????????
29823411 }
29833412 objEditor.ctrlPanel.FlushUI();
29843413 //objEditor.jTree.clearSelection();
....@@ -2991,6 +3420,7 @@
29913420 //copy.ClearUI();
29923421 for (Object3D obj : listUI)
29933422 {
3423
+ obj.pinned = false;
29943424 obj.CloseUI();
29953425 }
29963426 listUI.clear();
....@@ -3000,7 +3430,7 @@
30003430 {
30013431 assert(copy == group);
30023432
3003
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30043434
30053435 for (Object3D obj : listUI)
30063436 {
....@@ -3064,20 +3494,44 @@
30643494 frontView.object = group;
30653495 sideView.object = group;
30663496 }
3067
- group.editWindow = this;
3497
+
3498
+// fix "+" issue
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
3501
+
30683502 /*
30693503 currentLayout = radio.layout;
30703504 if (currentLayout == null)
30713505 currentLayout = sevenButton;
30723506 */
30733507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
30743513 keepparent = group.parent;
30753514 // PARENT = NULL or not???
30763515 //group.parent = null; // ROOT
30773516 //group.attributes = -1;
30783517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
30793520 refreshContents(true);
3080
- }
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
+ }
30813535 else
30823536 {
30833537 //return super.action(event, arg);
....@@ -3086,7 +3540,6 @@
30863540 }
30873541
30883542 boolean useclient = false;
3089
- cRadio radio;
30903543
30913544 void ToggleRoot()
30923545 {
....@@ -3138,6 +3591,28 @@
31383591 refreshContents();
31393592 }
31403593
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
+ }
31413616
31423617 void ResetTransform()
31433618 {
....@@ -3250,7 +3725,7 @@
32503725 refreshContents();
32513726 }
32523727
3253
- void ResetCentroid()
3728
+ void ResetCentroid(boolean full)
32543729 {
32553730 Object3D obj;
32563731 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3265,12 +3740,16 @@
32653740 LA.matIdentity(Object3D.mat);
32663741 obj.getBounds(minima, maxima, false);
32673742 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3268
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3743
+ if (full)
3744
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32693745 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32703746 obj.TransformMesh(Object3D.mat);
3747
+
32713748 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3272
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3749
+ if (full)
3750
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32733751 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3752
+
32743753 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32753754 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32763755 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3299,7 +3778,8 @@
32993778
33003779 int size = obj.MemorySize();
33013780
3302
- 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)");
33033783 }
33043784 }
33053785 catch (Exception e)
....@@ -3336,9 +3816,9 @@
33363816 obj = (Object3D)e.nextElement();
33373817
33383818 System.out.println("Object is: " + obj);
3339
- GrafreeD.AnalyzeObject(obj);
3819
+ Grafreed.AnalyzeObject(obj);
33403820 System.out.println("Boundary rep: " + obj.bRep);
3341
- GrafreeD.AnalyzeObject(obj.bRep);
3821
+ Grafreed.AnalyzeObject(obj.bRep);
33423822
33433823 // System.err.println((size/1024) + " KB is the size of " + obj);
33443824 }
....@@ -3380,6 +3860,13 @@
33803860 void GenNormals(boolean crease)
33813861 {
33823862 group.GenNormalsS(crease);
3863
+
3864
+ refreshContents();
3865
+ }
3866
+
3867
+ void GenNormalsMESH()
3868
+ {
3869
+ group.GenNormalsMeshS();
33833870
33843871 refreshContents();
33853872 }
....@@ -3552,8 +4039,8 @@
35524039
35534040 void ParseVertices()
35544041 {
3555
- boolean epsequal = GrafreeD.epsequal;
3556
- GrafreeD.epsequal = true;
4042
+ boolean epsequal = Grafreed.epsequal;
4043
+ Grafreed.epsequal = true;
35574044
35584045 for (int i=0; i<group.selection.size(); i++)
35594046 {
....@@ -3578,7 +4065,7 @@
35784065 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35794066 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35804067
3581
- g.add(GrafreeD.clipboard);
4068
+ g.add(Grafreed.clipboard);
35824069
35834070 buffer.add(g);
35844071 }
....@@ -3593,7 +4080,7 @@
35934080 makeSomething(buffer, i==group.selection.size()-1);
35944081 }
35954082
3596
- GrafreeD.epsequal = epsequal;
4083
+ Grafreed.epsequal = epsequal;
35974084
35984085 refreshContents();
35994086 }
....@@ -3611,7 +4098,16 @@
36114098 String pigment = Object3D.GetPigment(tex);
36124099 //String bump = Object3D.GetBump(tex);
36134100
3614
- 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
+ }
36154111
36164112 double s = v.s;
36174113
....@@ -3743,7 +4239,7 @@
37434239 return;
37444240
37454241 Object3D poses = group.selection.get(0);
3746
- Object3D ref = GrafreeD.clipboard.get(0);
4242
+ Object3D ref = Grafreed.clipboard.get(0);
37474243
37484244 Object3D newgroup = new Object3D("Po:" + poses.name);
37494245
....@@ -3937,9 +4433,9 @@
39374433
39384434 void ClipMesh()
39394435 {
3940
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4436
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39414437 {
3942
- Object3D content = GrafreeD.clipboard.get(0);
4438
+ Object3D content = Grafreed.clipboard.get(0);
39434439
39444440 if (content instanceof cGroup && ((cGroup)content).transientlink )
39454441 content = ((cGroup)content).get(0);
....@@ -3948,7 +4444,7 @@
39484444 // {
39494445 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39504446 // }
3951
- group.selection.ClipMesh(GrafreeD.clipboard);
4447
+ group.selection.ClipMesh(Grafreed.clipboard);
39524448 }
39534449 // group.selection.ClipMesh(GrafreeD.clipboard);
39544450 System.out.println("DONE.");
....@@ -3995,6 +4491,18 @@
39954491 void MarkLeaves(boolean hide)
39964492 {
39974493 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);
39984506 refreshContents();
39994507 }
40004508
....@@ -4069,10 +4577,6 @@
40694577 // }
40704578 // }
40714579
4072
- static boolean allparams = true;
4073
-
4074
- static Vector<Object3D> listUI = new Vector<Object3D>();
4075
-
40764580 void EditSelection(boolean newWindow)
40774581 {
40784582 // aConstraints.gridy = 0;
....@@ -4080,10 +4584,10 @@
40804584 {
40814585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40824586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4083
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40844588
40854589 Object3D elem = (Object3D)group.selection.elementAt(i);
4086
- if(elem != group)
4590
+ if(elem != group || !newWindow)
40874591 {
40884592 // if (!(elem instanceof Composite))
40894593 // newWindow = false;
....@@ -4165,7 +4669,8 @@
41654669 //new Exception().printStackTrace();
41664670
41674671 freezemodel = true;
4168
-
4672
+ ClearUnpinned();
4673
+
41694674 /**/
41704675 //switch (event.id)
41714676 {
....@@ -4173,7 +4678,6 @@
41734678 //case 702: // Event.LIST_DESELECT
41744679 group.deselectAll();
41754680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4176
- objEditor.ClearInfo(); // .GetMaterial());
41774681 if (tps != null)
41784682 {
41794683 for (int i=0; i < tps.length; i++)
....@@ -4182,10 +4686,8 @@
41824686
41834687 //if (child.parent != null)
41844688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
41854690 group.addSelectee(child);
4186
- objEditor.SetMaterial(child); // .GetMaterial());
4187
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4188
- System.err.println("info : " + child.GetPath());
41894691 }
41904692 }
41914693 // else
....@@ -4195,20 +4697,28 @@
41954697 // System.err.println("info : " + group.GetPath());
41964698 // }
41974699
4198
- objEditor.SetText(); // jan 2014
4199
-
4200
- 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))
42014701 CameraPane.flash = true;
42024702
4203
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4703
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42044704 // a camera
42054705 {
4206
- CameraPane.camerachangeframe = 0; // don't refuse it
4207
- 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
+ }
42084711 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42094712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42104713 }
42114714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
42124722 refreshContents();
42134723 //return true;
42144724 }
....@@ -4217,6 +4727,35 @@
42174727
42184728 freezemodel = false;
42194729 }
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
+ }
42204759
42214760 void linkSomething(Object3D thing)
42224761 {
....@@ -4288,16 +4827,19 @@
42884827 {
42894828 if (group.selection.isEmpty())
42904829 return;
4291
- GrafreeD.clipboardIsTempGroup = false;
4830
+
4831
+ Grafreed.clipboardIsTempGroup = false;
42924832 Composite tGroup = null;
42934833 if (group.selection.size() > 0) // 1)
42944834 {
42954835 tGroup = new cGroup();
4296
- GrafreeD.clipboardIsTempGroup = true;
4836
+ Grafreed.clipboardIsTempGroup = true;
42974837 }
42984838
42994839 if (cut)
43004840 {
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
43014843 //int indices[] = jList.getSelectedIndices();
43024844 //for (int i = indices.length - 1; i >= 0; i--)
43034845 //jList.remove(indices[i]);
....@@ -4333,16 +4875,16 @@
43334875 //System.out.println("cut " + child);
43344876 //System.out.println("parent = " + child.parent);
43354877 // tmp.addChild(child);
4336
- if (GrafreeD.clipboardIsTempGroup)
4878
+ if (Grafreed.clipboardIsTempGroup)
43374879 tGroup.add/*Child*/(tmp);
43384880 else
4339
- GrafreeD.clipboard = tmp;
4881
+ Grafreed.clipboard = tmp;
43404882 }
43414883 else
4342
- if (GrafreeD.clipboardIsTempGroup)
4884
+ if (Grafreed.clipboardIsTempGroup)
43434885 tGroup.add/*Child*/(child);
43444886 else
4345
- GrafreeD.clipboard = child;
4887
+ Grafreed.clipboard = child;
43464888 }
43474889
43484890 //ResetModel();
....@@ -4374,21 +4916,23 @@
43744916 //System.out.println("cut " + elem);
43754917 //System.out.println("parent = " + elem.parent);
43764918 // tmp.addChild(elem);
4377
- if (GrafreeD.clipboardIsTempGroup)
4919
+ if (Grafreed.clipboardIsTempGroup)
43784920 tGroup.add/*Child*/(tmp);
43794921 else
4380
- GrafreeD.clipboard = tmp;
4922
+ Grafreed.clipboard = tmp;
43814923 }
43824924 else
4383
- if (GrafreeD.clipboardIsTempGroup)
4925
+ if (Grafreed.clipboardIsTempGroup)
43844926 tGroup.add/*Child*/(child);
43854927 else
4386
- GrafreeD.clipboard = child;
4928
+ Grafreed.clipboard = child;
43874929 }
43884930
43894931 }
4390
- if (GrafreeD.clipboardIsTempGroup)
4391
- GrafreeD.clipboard = tGroup;
4932
+
4933
+ if (Grafreed.clipboardIsTempGroup)
4934
+ Grafreed.clipboard = tGroup;
4935
+
43924936 if (cut)
43934937 {
43944938 ResetModel();
....@@ -4398,11 +4942,15 @@
43984942
43994943 void paste(boolean expand)
44004944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
44014949 // if (GrafreeD.clipboard == null)
44024950 // return;
44034951 boolean first = true;
44044952
4405
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
44064954 {
44074955 Composite temp;
44084956
....@@ -4413,7 +4961,7 @@
44134961 temp = (Composite)Applet3D.clipboard.deepCopy();
44144962 */
44154963 Object3D elem;
4416
- 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))
44174965 {
44184966 Object3D child = (Object3D)e.nextElement();
44194967
....@@ -4447,16 +4995,17 @@
44474995 //Object3D cb = Applet3D.clipboard;
44484996 //temp.addChild(cb);
44494997 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4450
- assert(GrafreeD.clipboard.parent == null);
4451
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4452
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4453
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4454
- 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());
44555003 else
4456
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4457
- GrafreeD.clipboard.get(0).parent = keepparent;
5004
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5005
+ Grafreed.clipboard.get(0).parent = keepparent;
44585006 }
44595007
5008
+ Globals.SAVEONMAKE = keep;
44605009 ResetModel();
44615010 refreshContents();
44625011 }
....@@ -4503,9 +5052,9 @@
45035052 {
45045053 boolean first = true;
45055054
4506
- if (GrafreeD.clipboardIsTempGroup)
5055
+ if (Grafreed.clipboardIsTempGroup)
45075056 {
4508
- Composite temp = (Composite)GrafreeD.clipboard;
5057
+ Composite temp = (Composite)Grafreed.clipboard;
45095058 Object3D copy;
45105059 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45115060 {
....@@ -4515,7 +5064,7 @@
45155064 }
45165065 } else
45175066 {
4518
- linkSomething(GrafreeD.clipboard); //.get(0));
5067
+ linkSomething(Grafreed.clipboard); //.get(0));
45195068 }
45205069 }
45215070 }
....@@ -4592,6 +5141,10 @@
45925141
45935142 void group(Object3D csg, boolean grab)
45945143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
45955148 if (//false) // why??
45965149 !group.selection.isEmpty())
45975150 {
....@@ -4705,10 +5258,15 @@
47055258 //node.add(csg);
47065259 //makeSomething(node);
47075260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
47085262 }
47095263
47105264 void Ungroup(Object3D g)
47115265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
47125270 if (g instanceof HiddenObject)
47135271 {
47145272 HiddenObject h = (HiddenObject) g;
....@@ -4725,6 +5283,7 @@
47255283 objEditor.makeSomething(g.get(i), false);
47265284 }
47275285 }
5286
+ Globals.SAVEONMAKE = keep;
47285287 }
47295288
47305289 void ungroup()
....@@ -4920,21 +5479,6 @@
49205479 }
49215480 */
49225481
4923
- void ImportGFD()
4924
- {
4925
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4926
- browser.show();
4927
- String filename = browser.getFile();
4928
- if (filename != null && filename.length() > 0)
4929
- {
4930
- String fullname = browser.getDirectory() + filename;
4931
-
4932
- //Object3D readobj =
4933
- objEditor.ReadGFD(fullname, objEditor);
4934
- //makeSomething(readobj);
4935
- }
4936
- }
4937
-
49385482 /*
49395483 public void Callback(Object obj)
49405484 {
....@@ -4958,26 +5502,9 @@
49585502 }
49595503 */
49605504
4961
- void ImportVRMLX3D()
4962
- {
4963
- if (GrafreeD.standAlone)
4964
- {
4965
- /**/
4966
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4967
- browser.show();
4968
- String filename = browser.getFile();
4969
- if (filename != null && filename.length() > 0)
4970
- {
4971
- String fullname = browser.getDirectory() + filename;
4972
- LoadVRMLX3D(fullname);
4973
- }
4974
- /**/
4975
- }
4976
- }
4977
-
49785505 String GetFile(String dialogName)
49795506 {
4980
- if (GrafreeD.standAlone)
5507
+ if (Grafreed.standAlone)
49815508 {
49825509 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49835510 browser.show();
....@@ -5045,7 +5572,28 @@
50455572 cButton clearpanelButton;
50465573 cButton unselectButton;
50475574
5575
+ cButton restoreCameraButton;
5576
+
5577
+ cButton saveButton;
50485578 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;
50495597
50505598 cButton screenfitButton;
50515599 cButton screenfitpointButton;
....@@ -5058,14 +5606,6 @@
50585606
50595607 cButton setsupportButton;
50605608
5061
- cButton twoButton;
5062
- cButton sixButton;
5063
- cButton threeButton;
5064
- cButton sevenButton;
5065
- cButton fourButton; // full panel
5066
- cButton oneButton; // full XYZ
5067
- //cButton currentLayout;
5068
-
50695609 //
50705610 //Composite
50715611 Object3D // to do !!
....@@ -5075,9 +5615,11 @@
50755615 //JTree jTree;
50765616 private MenuItem lookAtItem;
50775617 private MenuItem lookFromItem;
5078
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
50795619 private MenuItem cutItem;
5080
- private MenuItem duplicateItem;
5620
+ private MenuItem undoItem;
5621
+ private MenuItem redoItem;
5622
+ private JMenuItem duplicateItem;
50815623 private MenuItem cloneItem;
50825624 private MenuItem cloneSupportItem;
50835625 private MenuItem overwriteGeoItem;
....@@ -5090,7 +5632,7 @@
50905632 private MenuItem linkverticesItem;
50915633 private MenuItem relinkverticesItem;
50925634 private MenuItem setMasterItem;
5093
- private MenuItem resetMeshItem;
5635
+ private MenuItem resetAllItem;
50945636 private MenuItem stepAllItem;
50955637 private MenuItem revertMeshItem;
50965638 private MenuItem poseMeshItem;
....@@ -5140,6 +5682,10 @@
51405682 private MenuItem showleavesItem;
51415683 private MenuItem markleavesItem;
51425684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
51435689
51445690 private MenuItem flipVItem;
51455691 private MenuItem unflipVItem;
....@@ -5151,15 +5697,17 @@
51515697 private MenuItem panoTexturesItem;
51525698
51535699 private MenuItem resetCentroidItem;
5154
- private MenuItem transformgeometryItem;
5700
+ private MenuItem resetCentroidXZItem;
51555701 private MenuItem resetTransformItem;
5702
+ private MenuItem transformGeometryItem;
5703
+ private MenuItem transformChildrenItem;
51565704 private MenuItem hideItem;
51575705 private MenuItem grabItem;
51585706 private MenuItem backItem;
51595707 private MenuItem frontItem;
51605708 private MenuItem cameraItem;
51615709 private MenuItem compositeItem;
5162
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
51635711 private MenuItem physicsItem;
51645712 private MenuItem frameselectorItem;
51655713 private MenuItem scriptNodeItem;
....@@ -5221,11 +5769,6 @@
52215769 private MenuItem doubleItem;
52225770 private MenuItem tripleItem;
52235771
5224
- private MenuItem importGFDItem;
5225
- private MenuItem importVRMLX3DItem;
5226
- private MenuItem import3DSItem;
5227
- private MenuItem importOBJItem;
5228
-
52295772 private MenuItem computeAOItem;
52305773 private MenuItem recompileItem;
52315774 private MenuItem editScriptItem;
....@@ -5235,4 +5778,8 @@
52355778 private MenuItem analyzeItem;
52365779 private MenuItem dumpItem;
52375780 //boolean freezemodel = false;
5781
+
5782
+ Menu cameraMenu;
5783
+ MenuItem editCameraItem;
5784
+ MenuItem restoreCameraItem;
52385785 }