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,6 +1227,8 @@
9401227 // objEditor.DropFile((java.io.File[]) object, true);
9411228 // return;
9421229 // }
1230
+
1231
+ String string = object.toString();
9431232
9441233 // File path for Mac and Windows
9451234 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -985,23 +1274,33 @@
9851274
9861275 assert target == objEditor.jTree;
9871276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
9881278 try {
989
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9901280 } catch (Exception e) {
9911281 System.out.println("destinationPath : " + destinationPath);
9921282 return;
9931283 }
9941284
995
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
9961286 {
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
+// {
9971296 loadClipboard(true);
9981297 objEditor.jTree.setSelectionPath(destinationPath);
9991298 pasteInto(false, false);
1000
- } else {
1001
- loadClipboard(false);
1002
- objEditor.jTree.setSelectionPath(destinationPath);
1003
- pasteInto(false, false); // true); // ???
1004
- }
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
10051304 }
10061305 public void dropActionChanged(DropTargetDragEvent dtde)
10071306 // Called if the user has modified the current drop gesture
....@@ -1106,22 +1405,30 @@
11061405 {
11071406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11081407 //heightFieldItem.addActionListener(this);
1109
- gridItem = menu.add(new MenuItem("Grid"));
1110
- gridItem.addActionListener(this);
1111
- rectoidItem = menu.add(new MenuItem("Box"));
1112
- rectoidItem.addActionListener(this);
1113
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1114
- ellipsoidItem.addActionListener(this);
1115
- coneItem = menu.add(new MenuItem("Cone"));
1116
- coneItem.addActionListener(this);
1117
- torusItem = menu.add(new MenuItem("Torus"));
1118
- torusItem.addActionListener(this);
1119
- superItem = menu.add(new MenuItem("Superellipsoid"));
1120
- 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
+ {
11211426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11221427 kleinItem.addActionListener(this);
1123
- particleItem = menu.add(new MenuItem("Particle system"));
1124
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
11251432 if (Globals.ADVANCED)
11261433 {
11271434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1147,15 +1454,15 @@
11471454 }
11481455 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11491456 bezierItem.addActionListener(this);
1150
- overlayItem = menu.add(new MenuItem("Overlay"));
1151
- overlayItem.addActionListener(this);
1152
- lightItem = menu.add(new MenuItem("Light"));
1153
- 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);
11541461 menu.add("-");
11551462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11561463 //superLoopItem.addActionListener(this);
1157
- loopItem = menu.add(new MenuItem("Loop"));
1158
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
11591466 doubleItem = menu.add(new MenuItem("Fork"));
11601467 doubleItem.addActionListener(this);
11611468 if (Globals.ADVANCED)
....@@ -1171,6 +1478,9 @@
11711478 animationItem.addItemListener(this);
11721479 animationItem.setState(Globals.ANIMATION);
11731480
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
1483
+
11741484 menu.add("-");
11751485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11761486 parseverticesItem.addActionListener(this);
....@@ -1183,6 +1493,8 @@
11831493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11841494 reduce34MorphItem.addActionListener(this);
11851495 menu.add("-");
1496
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1497
+ memoryItem.addActionListener(this);
11861498 menu.add(computeAOItem = new MenuItem("Compute AO"));
11871499 computeAOItem.addActionListener(this);
11881500
....@@ -1191,11 +1503,9 @@
11911503 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11921504 mirrorItem.addActionListener(this);
11931505 menu.add("-");
1194
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1195
- memoryItem.addActionListener(this);
11961506 menu.add(analyzeItem = new MenuItem("Analyze"));
11971507 analyzeItem.addActionListener(this);
1198
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
11991509 dumpItem.addActionListener(this);
12001510 // menu.add(pathItem = new MenuItem("From-to path"));
12011511 // pathItem.addActionListener(this);
....@@ -1336,9 +1646,24 @@
13361646 shadow.material = new cMaterial(obj.material);
13371647 shadow.material.diffuse = 0.0001f;
13381648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
13391650
13401651 makeSomething(shadow);
13411652 }
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
+ }
13421667
13431668 /**
13441669 * applyExample
....@@ -1542,9 +1867,9 @@
15421867
15431868 void Overwrite(int mask)
15441869 {
1545
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1870
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15461871 {
1547
- Object3D content = GrafreeD.clipboard.get(0);
1872
+ Object3D content = Grafreed.clipboard.get(0);
15481873
15491874 if (content instanceof cGroup && ((cGroup)content).transientlink )
15501875 content = ((cGroup)content).get(0);
....@@ -1583,7 +1908,7 @@
15831908 {
15841909 ScreenFit();
15851910 } else
1586
- if (source == switchItem)
1911
+ if (source == switchViewItem)
15871912 {
15881913 cVector v1 = new cVector();
15891914 cVector v2 = new cVector();
....@@ -1592,11 +1917,11 @@
15921917 objEditor.cameraView.renderCamera.setAim(v2, v1);
15931918 objEditor.cameraView.repaint();
15941919 } else
1595
- if (source == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
15961921 {
15971922 makeSomething(new Box());
15981923 } else
1599
- if (source == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
16001925 {
16011926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16021927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1675,27 +2000,27 @@
16752000
16762001 makeSomething(obj);
16772002 } else
1678
- if (source == gridItem)
2003
+ if (source == gridItem || source == gridButton)
16792004 {
16802005 makeSomething(new Grid());
16812006 } else
1682
- if (source == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
16832008 {
16842009 makeSomething(new Sphere());
16852010 } else
1686
- if (source == coneItem)
2011
+ if (source == coneItem || source == coneButton)
16872012 {
16882013 makeSomething(new Cone());
16892014 } else
1690
- if (source == torusItem)
2015
+ if (source == torusItem || source == torusButton)
16912016 {
16922017 makeSomething(new Torus());
16932018 } else
1694
- if (source == superItem)
2019
+ if (source == superItem || source == superButton)
16952020 {
16962021 makeSomething(new Superellipsoid());
16972022 } else
1698
- if (source == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
16992024 {
17002025 makeSomething(new Klein());
17012026 } else
....@@ -1715,7 +2040,7 @@
17152040 {
17162041 makeSomething(new BezierSurface());
17172042 } else
1718
- if (source == overlayItem)
2043
+ if (source == overlayItem || source == overlayButton)
17192044 {
17202045 /*
17212046 Object3D obj = new BezierSurface(5,8);
....@@ -1763,7 +2088,7 @@
17632088 s.setup();
17642089 makeSomething(s);
17652090 } else
1766
- if (source == lightItem)
2091
+ if (source == lightItem || source == lightButton)
17672092 {
17682093 makeSomething(new Light());
17692094 } else
....@@ -1813,30 +2138,30 @@
18132138
18142139 group(g);
18152140 } else
1816
- if (source == loopItem)
2141
+ if (source == loopItem || source == loopButton)
18172142 {
18182143 Composite csg = new GroupLeaf();
18192144 csg.count = 5;
18202145 group(csg);
1821
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
18222147 csg.addChild(child);
18232148 child.addChild(csg);
18242149 } else
18252150 if (source == doubleItem)
18262151 {
1827
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
18282153 csg.count = 5;
18292154 group(csg);
1830
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
18312156 csg.addChild(child);
18322157 child.addChild(csg);
1833
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
18342159 csg.addChild(child);
18352160 child.addChild(csg);
18362161 } else
18372162 if (source == tripleItem)
18382163 {
1839
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
18402165 csg.count = 4;
18412166 group(csg);
18422167 Composite child = new cGroup();
....@@ -1848,31 +2173,6 @@
18482173 child = new cGroup();
18492174 csg.addChild(child);
18502175 child.addChild(csg);
1851
- } else
1852
-
1853
- if (source == importGFDItem)
1854
- {
1855
- ImportGFD();
1856
- } else
1857
- if (source == importVRMLX3DItem)
1858
- {
1859
- ImportVRMLX3D();
1860
- } else
1861
- if (source == import3DSItem)
1862
- {
1863
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1864
- } else
1865
- if (source == importOBJItem)
1866
- {
1867
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
- browser.setVisible(true);
1870
- String filename = browser.getFile();
1871
- if (filename != null && filename.length() > 0)
1872
- {
1873
- String fullname = browser.getDirectory() + filename;
1874
- makeSomething(ReadOBJ(fullname), true);
1875
- }
18762176 } else
18772177 if (source == computeAOItem)
18782178 {
....@@ -1892,7 +2192,7 @@
18922192 if (source == invariantsItem)
18932193 {
18942194 System.out.println("Invariants:");
1895
- GrafreeD.grafreeD.universe.invariants();
2195
+ Grafreed.grafreeD.universe.invariants();
18962196 } else
18972197 if (source == memoryItem)
18982198 {
....@@ -1911,6 +2211,32 @@
19112211 {
19122212 DumpObject();
19132213 } 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
19142240 if (source == oneStepButton)
19152241 {
19162242 Globals.ONESTEP = true;
....@@ -1918,17 +2244,14 @@
19182244 } else
19192245 if (source == screenfitButton)
19202246 {
1921
- //Reload(lastConverter, lastFilename, true);
19222247 ScreenFit();
19232248 } else
19242249 if (source == screenfitpointButton)
19252250 {
1926
- //Reload(lastConverter, lastFilename, true);
19272251 ScreenFitPoint();
19282252 } else
19292253 if (source == snapobjectButton)
19302254 {
1931
- //Reload(lastConverter, lastFilename, true);
19322255 SnapObject();
19332256 } else
19342257 // if (event.getSource() == recompileButton)
....@@ -1965,12 +2288,20 @@
19652288 {
19662289 loadClipboard(true);
19672290 } else
2291
+ if (source == undoItem)
2292
+ {
2293
+ Undo();
2294
+ } else
2295
+ if (source == redoItem)
2296
+ {
2297
+ Redo();
2298
+ } else
19682299 if (source == duplicateItem)
19692300 {
1970
- Object3D keep = GrafreeD.clipboard;
2301
+ Object3D keep = Grafreed.clipboard;
19712302 loadClipboard(false);
19722303 paste(false);
1973
- GrafreeD.clipboard = keep;
2304
+ Grafreed.clipboard = keep;
19742305 } else
19752306 if (source == cloneItem)
19762307 {
....@@ -2190,9 +2521,9 @@
21902521 // group.selection.get(0).setMasterThis(content); // should be identity
21912522 // refreshContents();
21922523 // }
2193
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2524
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21942525 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2526
+ Object3D content = Grafreed.clipboard.get(0);
21962527
21972528 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982529 content = ((cGroup)content).get(0);
....@@ -2242,9 +2573,9 @@
22422573 } else
22432574 if (source == setMasterItem)
22442575 {
2245
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2576
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22462577 {
2247
- Object3D content = GrafreeD.clipboard.get(0);
2578
+ Object3D content = Grafreed.clipboard.get(0);
22482579
22492580 if (content instanceof cGroup && ((cGroup)content).transientlink )
22502581 content = ((cGroup)content).get(0);
....@@ -2257,9 +2588,9 @@
22572588 {
22582589 if (group.selection.size() == 1)
22592590 {
2260
- if (GrafreeD.clipboard.size() == 1)
2591
+ if (Grafreed.clipboard.size() == 1)
22612592 {
2262
- Object3D content = GrafreeD.clipboard.get(0);
2593
+ Object3D content = Grafreed.clipboard.get(0);
22632594
22642595 if (content instanceof cGroup && ((cGroup)content).transientlink )
22652596 content = ((cGroup)content).get(0);
....@@ -2276,7 +2607,7 @@
22762607 {
22772608 RevertMeshes();
22782609 } else
2279
- if (source == resetMeshItem)
2610
+ if (source == resetAllItem)
22802611 {
22812612 ResetAll();
22822613 } else
....@@ -2296,9 +2627,9 @@
22962627 {
22972628 ClearSelection(true);
22982629 } else
2299
- if (source == grabItem)
2630
+ if (source == grabItem || source == groupButton)
23002631 {
2301
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
23022633 } else
23032634 if (source == hideItem)
23042635 {
....@@ -2316,11 +2647,11 @@
23162647 {
23172648 makeSomething(new Camera());
23182649 } else
2319
- if (source == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
23202651 {
23212652 group(new Composite());
23222653 } else
2323
- if (source == randomItem)
2654
+ if (source == switchItem || source == switchButton)
23242655 {
23252656 RandomNode random = new RandomNode();
23262657 group(random);
....@@ -2422,7 +2753,7 @@
24222753 {
24232754 group(new cLinker());
24242755 } else
2425
- if (source == textureItem)
2756
+ if (source == textureItem || source == textureButton)
24262757 {
24272758 group(new TextureNode());
24282759 } else
....@@ -2442,17 +2773,30 @@
24422773 {
24432774 CastShadow(2);
24442775 } else
2445
- if (source == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
24462777 {
2447
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
24482780 for (int i=0; i<group.selection.size(); i++)
24492781 {
2450
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
24512787 }
24522788
2453
- ClearSelection(false);
2454
-
2455
- 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
+ }
24562800 } else
24572801 if (source == genUVItem)
24582802 {
....@@ -2464,7 +2808,7 @@
24642808 } else
24652809 if (source == genNormalsMESHItem)
24662810 {
2467
- GenNormals(true); // TODO
2811
+ GenNormalsMESH();
24682812 } else
24692813 if (source == genNormalsORGANItem)
24702814 {
....@@ -2529,6 +2873,22 @@
25292873 if (source == unmarkleavesItem)
25302874 {
25312875 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);
25322892 } else
25332893 if (source == flipVItem)
25342894 {
....@@ -2614,9 +2974,13 @@
26142974 {
26152975 SmoothMesh();
26162976 } else
2617
- if (source == transformgeometryItem)
2977
+ if (source == transformGeometryItem)
26182978 {
26192979 TransformGeometry();
2980
+ } else
2981
+ if (source == transformChildrenItem)
2982
+ {
2983
+ TransformChildren();
26202984 } else
26212985 if (source == resetTransformItem)
26222986 {
....@@ -2624,7 +2988,11 @@
26242988 } else
26252989 if (source == resetCentroidItem)
26262990 {
2627
- ResetCentroid();
2991
+ ResetCentroid(true);
2992
+ } else
2993
+ if (source == resetCentroidXZItem)
2994
+ {
2995
+ ResetCentroid(false);
26282996 } else
26292997 if (source == resetParentItem)
26302998 {
....@@ -2756,6 +3124,10 @@
27563124 if (source == twoButton)
27573125 {
27583126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
27593131 // bug
27603132 //gridPanel.setDividerLocation(1.0);
27613133 //bigPanel.setDividerLocation(0.0);
....@@ -2788,10 +3160,31 @@
27883160 bigThree.ClearUI();
27893161 bigThree.add(centralPanel);
27903162 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
+
27913181 } else
27923182 if (source == threeButton)
27933183 {
27943184 radio.layout = threeButton;
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
27953188
27963189 // bigThree.remove(scenePanel);
27973190 // bigThree.remove(centralPanel);
....@@ -2824,10 +3217,15 @@
28243217 bigThree.add(centralPanel);
28253218 bigThree.add(XYZPanel);
28263219 bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
28273222 } else
28283223 if (source == fourButton)
28293224 {
28303225 radio.layout = fourButton;
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
28313229
28323230 // bigThree.remove(scenePanel);
28333231 // bigThree.remove(centralPanel);
....@@ -2859,10 +3257,15 @@
28593257 bigThree.ClearUI();
28603258 bigThree.add(scenePanel);
28613259 bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
28623262 } else
28633263 if (source == sixButton)
28643264 {
28653265 radio.layout = sixButton;
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
28663269
28673270 // bigThree.remove(scenePanel);
28683271 // bigThree.remove(centralPanel);
....@@ -2895,10 +3298,15 @@
28953298 bigThree.add(scenePanel);
28963299 bigThree.add(centralPanel);
28973300 bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
28983303 } else
28993304 if (source == sevenButton)
29003305 {
29013306 radio.layout = sevenButton;
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
29023310
29033311 // bigThree.remove(scenePanel);
29043312 // bigThree.remove(centralPanel);
....@@ -2932,6 +3340,8 @@
29323340 bigThree.add(centralPanel);
29333341 bigThree.add(XYZPanel);
29343342 bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
29353345 } else
29363346 if (source == rootButton)
29373347 {
....@@ -2943,6 +3353,7 @@
29433353 EditObject(obj);
29443354 }
29453355
3356
+ cameraView.requestFocusInWindow();
29463357 refreshContents(true);
29473358 } else
29483359 if (source == closeButton)
....@@ -2952,22 +3363,37 @@
29523363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29533364 {
29543365 ab = (cRadio)e.nextElement();
2955
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29563367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
29573374 buttonGroup.remove(ab);
29583375 radioPanel.remove(ab);
29593376
2960
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
29613379 // ab.GetObject().objectUI = null; // ?????????
29623380
29633381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29643382 break;
29653383 }
29663384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
29673387 refreshContents(true);
29683388 } else
29693389 if (source == editItem || source == editButton)
29703390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
29713397 EditSelection(false);
29723398 } else
29733399 if (source == uneditButton)
....@@ -2977,10 +3403,11 @@
29773403 Object3D child = (Object3D)e.nextElement();
29783404 if(child.editWindow != null)
29793405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
29803407 child.CloseUI();
29813408 listUI.remove(child);
29823409
2983
- child.editWindow = null; // ???????????
3410
+ //child.editWindow = null; // ???????????
29843411 }
29853412 objEditor.ctrlPanel.FlushUI();
29863413 //objEditor.jTree.clearSelection();
....@@ -2993,6 +3420,7 @@
29933420 //copy.ClearUI();
29943421 for (Object3D obj : listUI)
29953422 {
3423
+ obj.pinned = false;
29963424 obj.CloseUI();
29973425 }
29983426 listUI.clear();
....@@ -3002,7 +3430,7 @@
30023430 {
30033431 assert(copy == group);
30043432
3005
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30063434
30073435 for (Object3D obj : listUI)
30083436 {
....@@ -3066,20 +3494,44 @@
30663494 frontView.object = group;
30673495 sideView.object = group;
30683496 }
3069
- group.editWindow = this;
3497
+
3498
+// fix "+" issue
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
3501
+
30703502 /*
30713503 currentLayout = radio.layout;
30723504 if (currentLayout == null)
30733505 currentLayout = sevenButton;
30743506 */
30753507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
30763513 keepparent = group.parent;
30773514 // PARENT = NULL or not???
30783515 //group.parent = null; // ROOT
30793516 //group.attributes = -1;
30803517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
30813520 refreshContents(true);
3082
- }
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
+ }
30833535 else
30843536 {
30853537 //return super.action(event, arg);
....@@ -3088,7 +3540,6 @@
30883540 }
30893541
30903542 boolean useclient = false;
3091
- cRadio radio;
30923543
30933544 void ToggleRoot()
30943545 {
....@@ -3140,6 +3591,28 @@
31403591 refreshContents();
31413592 }
31423593
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
+ }
31433616
31443617 void ResetTransform()
31453618 {
....@@ -3252,7 +3725,7 @@
32523725 refreshContents();
32533726 }
32543727
3255
- void ResetCentroid()
3728
+ void ResetCentroid(boolean full)
32563729 {
32573730 Object3D obj;
32583731 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3267,12 +3740,16 @@
32673740 LA.matIdentity(Object3D.mat);
32683741 obj.getBounds(minima, maxima, false);
32693742 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3270
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3743
+ if (full)
3744
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32713745 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32723746 obj.TransformMesh(Object3D.mat);
3747
+
32733748 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3274
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3749
+ if (full)
3750
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32753751 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3752
+
32763753 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32773754 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32783755 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3301,7 +3778,8 @@
33013778
33023779 int size = obj.MemorySize();
33033780
3304
- 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)");
33053783 }
33063784 }
33073785 catch (Exception e)
....@@ -3338,9 +3816,9 @@
33383816 obj = (Object3D)e.nextElement();
33393817
33403818 System.out.println("Object is: " + obj);
3341
- GrafreeD.AnalyzeObject(obj);
3819
+ Grafreed.AnalyzeObject(obj);
33423820 System.out.println("Boundary rep: " + obj.bRep);
3343
- GrafreeD.AnalyzeObject(obj.bRep);
3821
+ Grafreed.AnalyzeObject(obj.bRep);
33443822
33453823 // System.err.println((size/1024) + " KB is the size of " + obj);
33463824 }
....@@ -3382,6 +3860,13 @@
33823860 void GenNormals(boolean crease)
33833861 {
33843862 group.GenNormalsS(crease);
3863
+
3864
+ refreshContents();
3865
+ }
3866
+
3867
+ void GenNormalsMESH()
3868
+ {
3869
+ group.GenNormalsMeshS();
33853870
33863871 refreshContents();
33873872 }
....@@ -3554,8 +4039,8 @@
35544039
35554040 void ParseVertices()
35564041 {
3557
- boolean epsequal = GrafreeD.epsequal;
3558
- GrafreeD.epsequal = true;
4042
+ boolean epsequal = Grafreed.epsequal;
4043
+ Grafreed.epsequal = true;
35594044
35604045 for (int i=0; i<group.selection.size(); i++)
35614046 {
....@@ -3580,7 +4065,7 @@
35804065 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35814066 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35824067
3583
- g.add(GrafreeD.clipboard);
4068
+ g.add(Grafreed.clipboard);
35844069
35854070 buffer.add(g);
35864071 }
....@@ -3595,7 +4080,7 @@
35954080 makeSomething(buffer, i==group.selection.size()-1);
35964081 }
35974082
3598
- GrafreeD.epsequal = epsequal;
4083
+ Grafreed.epsequal = epsequal;
35994084
36004085 refreshContents();
36014086 }
....@@ -3613,7 +4098,16 @@
36134098 String pigment = Object3D.GetPigment(tex);
36144099 //String bump = Object3D.GetBump(tex);
36154100
3616
- 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
+ }
36174111
36184112 double s = v.s;
36194113
....@@ -3745,7 +4239,7 @@
37454239 return;
37464240
37474241 Object3D poses = group.selection.get(0);
3748
- Object3D ref = GrafreeD.clipboard.get(0);
4242
+ Object3D ref = Grafreed.clipboard.get(0);
37494243
37504244 Object3D newgroup = new Object3D("Po:" + poses.name);
37514245
....@@ -3939,9 +4433,9 @@
39394433
39404434 void ClipMesh()
39414435 {
3942
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4436
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39434437 {
3944
- Object3D content = GrafreeD.clipboard.get(0);
4438
+ Object3D content = Grafreed.clipboard.get(0);
39454439
39464440 if (content instanceof cGroup && ((cGroup)content).transientlink )
39474441 content = ((cGroup)content).get(0);
....@@ -3950,7 +4444,7 @@
39504444 // {
39514445 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39524446 // }
3953
- group.selection.ClipMesh(GrafreeD.clipboard);
4447
+ group.selection.ClipMesh(Grafreed.clipboard);
39544448 }
39554449 // group.selection.ClipMesh(GrafreeD.clipboard);
39564450 System.out.println("DONE.");
....@@ -3997,6 +4491,18 @@
39974491 void MarkLeaves(boolean hide)
39984492 {
39994493 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);
40004506 refreshContents();
40014507 }
40024508
....@@ -4071,10 +4577,6 @@
40714577 // }
40724578 // }
40734579
4074
- static boolean allparams = true;
4075
-
4076
- static Vector<Object3D> listUI = new Vector<Object3D>();
4077
-
40784580 void EditSelection(boolean newWindow)
40794581 {
40804582 // aConstraints.gridy = 0;
....@@ -4082,10 +4584,10 @@
40824584 {
40834585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40844586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4085
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40864588
40874589 Object3D elem = (Object3D)group.selection.elementAt(i);
4088
- if(elem != group)
4590
+ if(elem != group || !newWindow)
40894591 {
40904592 // if (!(elem instanceof Composite))
40914593 // newWindow = false;
....@@ -4167,7 +4669,8 @@
41674669 //new Exception().printStackTrace();
41684670
41694671 freezemodel = true;
4170
-
4672
+ ClearUnpinned();
4673
+
41714674 /**/
41724675 //switch (event.id)
41734676 {
....@@ -4175,7 +4678,6 @@
41754678 //case 702: // Event.LIST_DESELECT
41764679 group.deselectAll();
41774680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4178
- objEditor.ClearInfo(); // .GetMaterial());
41794681 if (tps != null)
41804682 {
41814683 for (int i=0; i < tps.length; i++)
....@@ -4184,10 +4686,8 @@
41844686
41854687 //if (child.parent != null)
41864688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
41874690 group.addSelectee(child);
4188
- objEditor.SetMaterial(child); // .GetMaterial());
4189
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4190
- System.err.println("info : " + child.GetPath());
41914691 }
41924692 }
41934693 // else
....@@ -4197,20 +4697,28 @@
41974697 // System.err.println("info : " + group.GetPath());
41984698 // }
41994699
4200
- objEditor.SetText(); // jan 2014
4201
-
4202
- 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))
42034701 CameraPane.flash = true;
42044702
4205
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4703
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42064704 // a camera
42074705 {
4208
- CameraPane.camerachangeframe = 0; // don't refuse it
4209
- 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
+ }
42104711 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42114712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42124713 }
42134714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
42144722 refreshContents();
42154723 //return true;
42164724 }
....@@ -4219,6 +4727,35 @@
42194727
42204728 freezemodel = false;
42214729 }
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
+ }
42224759
42234760 void linkSomething(Object3D thing)
42244761 {
....@@ -4290,16 +4827,19 @@
42904827 {
42914828 if (group.selection.isEmpty())
42924829 return;
4293
- GrafreeD.clipboardIsTempGroup = false;
4830
+
4831
+ Grafreed.clipboardIsTempGroup = false;
42944832 Composite tGroup = null;
42954833 if (group.selection.size() > 0) // 1)
42964834 {
42974835 tGroup = new cGroup();
4298
- GrafreeD.clipboardIsTempGroup = true;
4836
+ Grafreed.clipboardIsTempGroup = true;
42994837 }
43004838
43014839 if (cut)
43024840 {
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
43034843 //int indices[] = jList.getSelectedIndices();
43044844 //for (int i = indices.length - 1; i >= 0; i--)
43054845 //jList.remove(indices[i]);
....@@ -4335,16 +4875,16 @@
43354875 //System.out.println("cut " + child);
43364876 //System.out.println("parent = " + child.parent);
43374877 // tmp.addChild(child);
4338
- if (GrafreeD.clipboardIsTempGroup)
4878
+ if (Grafreed.clipboardIsTempGroup)
43394879 tGroup.add/*Child*/(tmp);
43404880 else
4341
- GrafreeD.clipboard = tmp;
4881
+ Grafreed.clipboard = tmp;
43424882 }
43434883 else
4344
- if (GrafreeD.clipboardIsTempGroup)
4884
+ if (Grafreed.clipboardIsTempGroup)
43454885 tGroup.add/*Child*/(child);
43464886 else
4347
- GrafreeD.clipboard = child;
4887
+ Grafreed.clipboard = child;
43484888 }
43494889
43504890 //ResetModel();
....@@ -4376,21 +4916,23 @@
43764916 //System.out.println("cut " + elem);
43774917 //System.out.println("parent = " + elem.parent);
43784918 // tmp.addChild(elem);
4379
- if (GrafreeD.clipboardIsTempGroup)
4919
+ if (Grafreed.clipboardIsTempGroup)
43804920 tGroup.add/*Child*/(tmp);
43814921 else
4382
- GrafreeD.clipboard = tmp;
4922
+ Grafreed.clipboard = tmp;
43834923 }
43844924 else
4385
- if (GrafreeD.clipboardIsTempGroup)
4925
+ if (Grafreed.clipboardIsTempGroup)
43864926 tGroup.add/*Child*/(child);
43874927 else
4388
- GrafreeD.clipboard = child;
4928
+ Grafreed.clipboard = child;
43894929 }
43904930
43914931 }
4392
- if (GrafreeD.clipboardIsTempGroup)
4393
- GrafreeD.clipboard = tGroup;
4932
+
4933
+ if (Grafreed.clipboardIsTempGroup)
4934
+ Grafreed.clipboard = tGroup;
4935
+
43944936 if (cut)
43954937 {
43964938 ResetModel();
....@@ -4400,11 +4942,15 @@
44004942
44014943 void paste(boolean expand)
44024944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
44034949 // if (GrafreeD.clipboard == null)
44044950 // return;
44054951 boolean first = true;
44064952
4407
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
44084954 {
44094955 Composite temp;
44104956
....@@ -4415,7 +4961,7 @@
44154961 temp = (Composite)Applet3D.clipboard.deepCopy();
44164962 */
44174963 Object3D elem;
4418
- 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))
44194965 {
44204966 Object3D child = (Object3D)e.nextElement();
44214967
....@@ -4449,16 +4995,17 @@
44494995 //Object3D cb = Applet3D.clipboard;
44504996 //temp.addChild(cb);
44514997 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4452
- assert(GrafreeD.clipboard.parent == null);
4453
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4454
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4455
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4456
- 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());
44575003 else
4458
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4459
- GrafreeD.clipboard.get(0).parent = keepparent;
5004
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5005
+ Grafreed.clipboard.get(0).parent = keepparent;
44605006 }
44615007
5008
+ Globals.SAVEONMAKE = keep;
44625009 ResetModel();
44635010 refreshContents();
44645011 }
....@@ -4505,9 +5052,9 @@
45055052 {
45065053 boolean first = true;
45075054
4508
- if (GrafreeD.clipboardIsTempGroup)
5055
+ if (Grafreed.clipboardIsTempGroup)
45095056 {
4510
- Composite temp = (Composite)GrafreeD.clipboard;
5057
+ Composite temp = (Composite)Grafreed.clipboard;
45115058 Object3D copy;
45125059 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45135060 {
....@@ -4517,7 +5064,7 @@
45175064 }
45185065 } else
45195066 {
4520
- linkSomething(GrafreeD.clipboard); //.get(0));
5067
+ linkSomething(Grafreed.clipboard); //.get(0));
45215068 }
45225069 }
45235070 }
....@@ -4594,6 +5141,10 @@
45945141
45955142 void group(Object3D csg, boolean grab)
45965143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
45975148 if (//false) // why??
45985149 !group.selection.isEmpty())
45995150 {
....@@ -4707,10 +5258,15 @@
47075258 //node.add(csg);
47085259 //makeSomething(node);
47095260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
47105262 }
47115263
47125264 void Ungroup(Object3D g)
47135265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
47145270 if (g instanceof HiddenObject)
47155271 {
47165272 HiddenObject h = (HiddenObject) g;
....@@ -4727,6 +5283,7 @@
47275283 objEditor.makeSomething(g.get(i), false);
47285284 }
47295285 }
5286
+ Globals.SAVEONMAKE = keep;
47305287 }
47315288
47325289 void ungroup()
....@@ -4922,21 +5479,6 @@
49225479 }
49235480 */
49245481
4925
- void ImportGFD()
4926
- {
4927
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4928
- browser.show();
4929
- String filename = browser.getFile();
4930
- if (filename != null && filename.length() > 0)
4931
- {
4932
- String fullname = browser.getDirectory() + filename;
4933
-
4934
- //Object3D readobj =
4935
- objEditor.ReadGFD(fullname, objEditor);
4936
- //makeSomething(readobj);
4937
- }
4938
- }
4939
-
49405482 /*
49415483 public void Callback(Object obj)
49425484 {
....@@ -4960,26 +5502,9 @@
49605502 }
49615503 */
49625504
4963
- void ImportVRMLX3D()
4964
- {
4965
- if (GrafreeD.standAlone)
4966
- {
4967
- /**/
4968
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4969
- browser.show();
4970
- String filename = browser.getFile();
4971
- if (filename != null && filename.length() > 0)
4972
- {
4973
- String fullname = browser.getDirectory() + filename;
4974
- LoadVRMLX3D(fullname);
4975
- }
4976
- /**/
4977
- }
4978
- }
4979
-
49805505 String GetFile(String dialogName)
49815506 {
4982
- if (GrafreeD.standAlone)
5507
+ if (Grafreed.standAlone)
49835508 {
49845509 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49855510 browser.show();
....@@ -5047,7 +5572,28 @@
50475572 cButton clearpanelButton;
50485573 cButton unselectButton;
50495574
5575
+ cButton restoreCameraButton;
5576
+
5577
+ cButton saveButton;
50505578 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;
50515597
50525598 cButton screenfitButton;
50535599 cButton screenfitpointButton;
....@@ -5060,14 +5606,6 @@
50605606
50615607 cButton setsupportButton;
50625608
5063
- cButton twoButton;
5064
- cButton sixButton;
5065
- cButton threeButton;
5066
- cButton sevenButton;
5067
- cButton fourButton; // full panel
5068
- cButton oneButton; // full XYZ
5069
- //cButton currentLayout;
5070
-
50715609 //
50725610 //Composite
50735611 Object3D // to do !!
....@@ -5077,9 +5615,11 @@
50775615 //JTree jTree;
50785616 private MenuItem lookAtItem;
50795617 private MenuItem lookFromItem;
5080
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
50815619 private MenuItem cutItem;
5082
- private MenuItem duplicateItem;
5620
+ private MenuItem undoItem;
5621
+ private MenuItem redoItem;
5622
+ private JMenuItem duplicateItem;
50835623 private MenuItem cloneItem;
50845624 private MenuItem cloneSupportItem;
50855625 private MenuItem overwriteGeoItem;
....@@ -5092,7 +5632,7 @@
50925632 private MenuItem linkverticesItem;
50935633 private MenuItem relinkverticesItem;
50945634 private MenuItem setMasterItem;
5095
- private MenuItem resetMeshItem;
5635
+ private MenuItem resetAllItem;
50965636 private MenuItem stepAllItem;
50975637 private MenuItem revertMeshItem;
50985638 private MenuItem poseMeshItem;
....@@ -5142,6 +5682,10 @@
51425682 private MenuItem showleavesItem;
51435683 private MenuItem markleavesItem;
51445684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
51455689
51465690 private MenuItem flipVItem;
51475691 private MenuItem unflipVItem;
....@@ -5153,15 +5697,17 @@
51535697 private MenuItem panoTexturesItem;
51545698
51555699 private MenuItem resetCentroidItem;
5156
- private MenuItem transformgeometryItem;
5700
+ private MenuItem resetCentroidXZItem;
51575701 private MenuItem resetTransformItem;
5702
+ private MenuItem transformGeometryItem;
5703
+ private MenuItem transformChildrenItem;
51585704 private MenuItem hideItem;
51595705 private MenuItem grabItem;
51605706 private MenuItem backItem;
51615707 private MenuItem frontItem;
51625708 private MenuItem cameraItem;
51635709 private MenuItem compositeItem;
5164
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
51655711 private MenuItem physicsItem;
51665712 private MenuItem frameselectorItem;
51675713 private MenuItem scriptNodeItem;
....@@ -5223,11 +5769,6 @@
52235769 private MenuItem doubleItem;
52245770 private MenuItem tripleItem;
52255771
5226
- private MenuItem importGFDItem;
5227
- private MenuItem importVRMLX3DItem;
5228
- private MenuItem import3DSItem;
5229
- private MenuItem importOBJItem;
5230
-
52315772 private MenuItem computeAOItem;
52325773 private MenuItem recompileItem;
52335774 private MenuItem editScriptItem;
....@@ -5237,4 +5778,8 @@
52375778 private MenuItem analyzeItem;
52385779 private MenuItem dumpItem;
52395780 //boolean freezemodel = false;
5781
+
5782
+ Menu cameraMenu;
5783
+ MenuItem editCameraItem;
5784
+ MenuItem restoreCameraItem;
52405785 }