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,40 +153,37 @@
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);
172
+ cloneItem = menu.add(new MenuItem("Clone"));
173
+ cloneItem.addActionListener(this);
174
+ if (Globals.ADVANCED)
175
+ {
176
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
177
+ cloneSupportItem.addActionListener(this);
178
+ }
179
+ menu.add("-");
174180 cutItem = menu.add(new MenuItem("Cut"));
175181 cutItem.addActionListener(this);
176182 copyItem = menu.add(new MenuItem("Copy"));
177183 copyItem.addActionListener(this);
178184 pasteItem = menu.add(new MenuItem("Paste"));
179185 pasteItem.addActionListener(this);
180
- menu.add("-");
181
- cloneItem = menu.add(new MenuItem("Clone"));
182
- cloneItem.addActionListener(this);
183
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
- cloneSupportItem.addActionListener(this);
186
+
185187 menu.add("-");
186188 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187189 pasteIntoItem.addActionListener(this);
....@@ -201,14 +203,97 @@
201203 clearAllItem = menu.add(new MenuItem("Clear All"));
202204 clearAllItem.addActionListener(this);
203205 }
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());
204242
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
+
205294 oe.menuBar.add(menu = new Menu("Setting"));
206295 if (Globals.ADVANCED)
207296 {
208
- resetMeshItem = menu.add(new MenuItem("Reset All"));
209
- resetMeshItem.addActionListener(this);
210
- stepAllItem = menu.add(new MenuItem("Step All"));
211
- stepAllItem.addActionListener(this);
212297 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
213298 revertMeshItem.addActionListener(this);
214299 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -248,21 +333,29 @@
248333 }
249334
250335 oe.menuBar.add(menu = new Menu("Group"));
251
- grabItem = menu.add(new MenuItem("Grab"));
252
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
253338 backItem = menu.add(new MenuItem("Back"));
254339 backItem.addActionListener(this);
255340 frontItem = menu.add(new MenuItem("Front"));
256341 frontItem.addActionListener(this);
257
- compositeItem = menu.add(new MenuItem("Composite"));
258
- compositeItem.addActionListener(this);
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
259347 hideItem = menu.add(new MenuItem("Hidden Group"));
260348 hideItem.addActionListener(this);
349
+ }
261350 ungroupItem = menu.add(new MenuItem("Ungroup"));
262351 ungroupItem.addActionListener(this);
263
- menu.add("-");
264
- randomItem = menu.add(new MenuItem("Switch node"));
265
- 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
+ {
266359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
267360 switchGeoItem.addActionListener(this);
268361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -270,49 +363,52 @@
270363 morphItem = menu.add(new MenuItem("Morph Group"));
271364 morphItem.addActionListener(this);
272365
273
- if (Globals.ADVANCED)
274
- {
366
+ menu.add("-");
275367 physicsItem = menu.add(new MenuItem("Physics"));
276368 physicsItem.addActionListener(this);
277369 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278370 frameselectorItem.addActionListener(this);
279371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
280372 scriptNodeItem.addActionListener(this);
281
- cameraItem = menu.add(new MenuItem("Camera"));
282
- cameraItem.addActionListener(this);
283373 }
284374
285375 oe.menuBar.add(menu = new Menu("Object"));
286
- textureItem = menu.add(new MenuItem("Texture"));
287
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
288378 billboardItem = menu.add(new MenuItem("Billboard"));
289379 billboardItem.addActionListener(this);
290380 csgItem = menu.add(new MenuItem("CSG"));
291381 csgItem.addActionListener(this);
292
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
293383 shadowXItem.addActionListener(this);
294
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
295385 shadowYItem.addActionListener(this);
296
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
297387 shadowZItem.addActionListener(this);
298
- if (Globals.ADVANCED)
299
- {
300
- linkerItem = menu.add(new MenuItem("Linker"));
301
- linkerItem.addActionListener(this);
302388 attributeItem = menu.add(new MenuItem("Attribute"));
303389 attributeItem.addActionListener(this);
390
+
391
+ if (Globals.ADVANCED)
392
+ {
393
+ menu.add("-");
394
+ linkerItem = menu.add(new MenuItem("Linker"));
395
+ linkerItem.addActionListener(this);
304396 templateItem = menu.add(new MenuItem("Template"));
305397 templateItem.addActionListener(this);
306398 pointflowItem = menu.add(new MenuItem("Point Flow"));
307399 pointflowItem.addActionListener(this);
308
- menu.add("-");
309400 }
401
+ menu.add("-");
310402 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311403 resetTransformItem.addActionListener(this);
312404 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
313405 resetCentroidItem.addActionListener(this);
314
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
- 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);
316412
317413 oe.menuBar.add(menu = new Menu("Geometry"));
318414 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -361,6 +457,10 @@
361457 oe.menuBar.add(menu = new Menu("Attributes"));
362458 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
363459 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);
364464 menu.add("-");
365465 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
366466 liveleavesItem.addActionListener(this);
....@@ -381,6 +481,14 @@
381481 markleavesItem.addActionListener(this);
382482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
383483 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);
384492 menu.add("-");
385493 flipVItem = menu.add(new MenuItem("Flip V"));
386494 flipVItem.addActionListener(this);
....@@ -415,38 +523,41 @@
415523 sortbysizeItem.addActionListener(this);
416524 sortbynameItem = menu.add(new MenuItem("Sort by name"));
417525 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);
418531 if (Globals.ADVANCED)
419532 {
420
- menu.add("-");
533
+ // Pretty much the same as duplicate and clone.
421534 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422535 extractGeometriesItem.addActionListener(this);
423536 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424537 cloneGeometriesItem.addActionListener(this);
425
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
426
- shareGeometriesItem.addActionListener(this);
427
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
428
- mergeGeometriesItem.addActionListener(this);
429538 }
430539
431540 oe.menuBar.add(menu = new Menu("Insert"));
432541 buildCreateMenu(menu);
433542
434
- oe.menuBar.add(menu = new Menu("Include"));
435
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
- importGFDItem.addActionListener(this);
437
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
- importVRMLX3DItem.addActionListener(this);
439
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
440
- importOBJItem.addActionListener(this);
441
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
442
- import3DSItem.addActionListener(this);
443
-
444543 oe.menuBar.add(menu = new Menu("Tools"));
445544 buildToolsMenu(menu);
446545 }
447546
448547 void SetupUI2(ObjEditor oe)
449548 {
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
+
450561 //new Exception().printStackTrace();
451562
452563 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -475,97 +586,216 @@
475586 oe.radioPanel.add(dummyButton);
476587 oe.buttonGroup.add(dummyButton);
477588 */
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
592
+
478593 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
479594
480
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
- 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");
482634 liveCB.addItemListener(this);
483635
484
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
636
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485637 oneStepButton.setToolTipText("Animate one step forward");
486638 oneStepButton.addActionListener(this);
487639
488
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
640
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
489641 fastCB.setToolTipText("Fast mode");
490642 fastCB.addItemListener(this);
491643
492
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
493
- trackCB.setToolTipText("Enable tracking");
494
- trackCB.addItemListener(this);
495
-
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
497
- screenfitButton.setToolTipText("Screen fit");
498
- 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);
499649
500650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
501651 // screenfitpointButton.addActionListener(this);
502652
503653 if (Globals.ADVANCED)
504654 {
505
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
655
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
506656 snapobjectButton.addActionListener(this);
507657 snapobjectButton.setToolTipText("Snap Object");
508658 }
509659
510
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
- flashSelectionButton.setToolTipText("Show selection");
512
- flashSelectionButton.addActionListener(this);
660
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
513661
514
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515
-
516
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517663 twoButton.setToolTipText("Show center view only");
518664 twoButton.addActionListener(this);
519
- 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);
520668 fourButton.addActionListener(this);
521669 fourButton.setToolTipText("Show left panel only");
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523671 sixButton.setToolTipText("2-column layout left");
524672 sixButton.addActionListener(this);
525
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
673
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526674 threeButton.setToolTipText("2-column layout right");
527675 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
529677 sevenButton.setToolTipText("3-column layout");
530678 sevenButton.addActionListener(this);
531679 //
532680
533
- 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);
534682 rootButton.setToolTipText("Edit selection in new tab");
535683 rootButton.addActionListener(this);
536684
537
- 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);
538686 closeButton.setToolTipText("Close tab");
539687 closeButton.addActionListener(this);
540688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
541689 //clearButton.addActionListener(this);
542
-
543
- 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
+ }
544722
545
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
- 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");
547772 editButton.addActionListener(this);
548773
549
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
- uneditButton.setToolTipText("Unedit selection");
774
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ uneditButton.setToolTipText("Remove selection controls");
551776 uneditButton.addActionListener(this);
552777
553
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
- allParamsButton.setToolTipText("Edit all params");
778
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
779
+ allParamsButton.setToolTipText("Show all controle");
555780 allParamsButton.addActionListener(this);
556781
557
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
782
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
558783 clearPanelButton.setToolTipText("Clear edit panel");
559784 clearPanelButton.addActionListener(this);
560785
561
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
786
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
562787 unselectButton.setToolTipText("Unselect");
563788 unselectButton.addActionListener(this);
564789
565
- 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);
566793
567
- oe.treePanel.add(commandsPanel);
568
- oe.treePanel.Return();
794
+ editCommandsPanel.preferredHeight = 1;
795
+
796
+ SetPinStates(false);
797
+// oe.treePanel.add(commandsPanel);
798
+// oe.treePanel.Return();
569799
570800 // oe.aConstraints.gridx += 1;
571801 // oe.aConstraints.weighty = 0;
....@@ -582,27 +812,12 @@
582812
583813 JScrollPane jSP;
584814 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
585
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
586816 ResetModel();
587817
588818 oe.treePanel.add(jSPPanel);
589819 oe.treePanel.Return();
590820
591
- cGridBag copyOptionsPanel = new cGridBag();
592
-
593
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
- colorCB.setToolTipText("Copy color when dropped");
595
- colorCB.addItemListener(this);
596
-
597
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
- materialCB.setToolTipText("Copy material when dropped");
599
- materialCB.addItemListener(this);
600
-
601
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
- textureCB.setToolTipText("Copy texture when dropped");
603
- textureCB.addItemListener(this);
604
-
605
- copyOptionsPanel.preferredHeight = 1;
606821 oe.treePanel.add(copyOptionsPanel);
607822 oe.treePanel.Return();
608823
....@@ -633,23 +848,43 @@
633848
634849 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
635850 {
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
+
636865 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
637866 boxCB.setToolTipText("Display bounding boxes");
638867 boxCB.addItemListener(this);
639868
640869 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
641
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
870
+ zoomBoxCB.setToolTipText("Display only for wheel");
642871 zoomBoxCB.addItemListener(this);
643872
644
- if (Globals.ADVANCED)
873
+ if (true) // Globals.ADVANCED)
645874 {
646
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
- supportCB.setToolTipText("Enable rigging");
648
- 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);
649882
650883 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
651884 // localCB.addItemListener(this);
652885
886
+ panel.Return();
887
+
653888 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
654889 crowdCB.setToolTipText("Used for crowds");
655890 crowdCB.addItemListener(this);
....@@ -666,6 +901,8 @@
666901 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
667902 // speakerMocapCB.addItemListener(this);
668903
904
+ panel.Return();
905
+
669906 if (false)
670907 {
671908 // handled in scripts
....@@ -680,32 +917,72 @@
680917 //constraints.gridy += 1;
681918 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
682919 smoothfocusCB.addItemListener(this);
920
+ panel.Return();
683921 }
684922
685923 //constraints.gridx += 1;
686924 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
687925 // debugCB.addItemListener(this);
688926
927
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
928
+ trackCB.setToolTipText("Enable tracking target");
929
+ trackCB.addItemListener(this);
930
+
689931 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
932
+ oeilCB.setToolTipText("Move camera when tracking");
690933 oeilCB.addItemListener(this);
691934
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
+ {
692955 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
693956 lookAtCB.setToolTipText("Look-at target");
694957 lookAtCB.addItemListener(this);
958
+ }
695959
696960 }
697961
698962 cGridBag fill = new cGridBag();
699
-
700963 fill.preferredHeight = 200;
964
+ cGridBag fill2 = new cGridBag();
965
+ fill2.preferredHeight = 200;
966
+ cGridBag fill3 = new cGridBag();
967
+ fill3.preferredHeight = 200;
701968
702969 panel.add(fill);
970
+ panel.add(fill2);
971
+ panel.add(fill3);
703972
704973 }
705974
706975 void EditObject(Object3D obj)
707976 {
708977 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
+
709986 radioButton.SetObject(obj);
710987 radioButton.layout = sevenButton;
711988 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -714,8 +991,11 @@
714991 buttonGroup.add(radioButton);
715992 radioButton.doClick();
716993 }
994
+
717995 void SetupViews(ObjEditor oe)
718996 {
997
+ theFrame = this;
998
+
719999 oe.SetupViews();
7201000
7211001 System.out.println("SetupViews");
....@@ -724,23 +1004,28 @@
7241004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7251005 }
7261006
727
- JCheckBox liveCB;
728
- JCheckBox supportCB;
729
- JCheckBox localCB;
730
- JCheckBox crowdCB;
731
- JCheckBox smoothCB;
732
- JCheckBox fastCB;
733
- JCheckBox slowCB;
734
- JCheckBox boxCB;
735
- JCheckBox zoomBoxCB;
736
- JCheckBox trackCB;
737
- 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;
7381020 // JCheckBox speakerMocapCB;
739
- JCheckBox speakerCameraCB;
740
- JCheckBox speakerFocusCB;
741
- JCheckBox debugCB;
742
- JCheckBox oeilCB;
743
- JCheckBox lookAtCB;
1021
+ cCheckBox speakerCameraCB;
1022
+ cCheckBox speakerFocusCB;
1023
+ cCheckBox debugCB;
1024
+
1025
+ cCheckBox oeilCB;
1026
+ cCheckBox shadowCB;
1027
+ cCheckBox autosaveCB;
1028
+ cCheckBox lookAtCB;
7441029
7451030 // static int COLOR = 1;
7461031 // static int MATERIAL = 2;
....@@ -748,9 +1033,9 @@
7481033
7491034 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7501035
751
- JCheckBox colorCB;
752
- JCheckBox materialCB;
753
- JCheckBox textureCB;
1036
+ cCheckBox colorCB;
1037
+ cCheckBox materialCB;
1038
+ cCheckBox textureCB;
7541039
7551040 public void itemStateChanged(ItemEvent e)
7561041 {
....@@ -778,6 +1063,7 @@
7781063 } else if(e.getSource() == liveCB)
7791064 {
7801065 cameraView.ToggleLive();
1066
+ refreshContents(false);
7811067 }
7821068 else if(e.getSource() == supportCB)
7831069 {
....@@ -842,6 +1128,18 @@
8421128 {
8431129 cameraView.ToggleOeil();
8441130 }
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
+ }
8451143 else if(e.getSource() == lookAtCB)
8461144 {
8471145 cameraView.ToggleLookAt();
....@@ -858,7 +1156,8 @@
8581156
8591157 /**/
8601158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
861
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
8621161 if ((path == null) || (path.getPathCount() <= 1)) {
8631162 // We can't move the root node or an empty selection
8641163 return;
....@@ -921,8 +1220,6 @@
9211220 }
9221221 }
9231222
924
- String string = (String) object;
925
-
9261223 System.out.println("Transfer = " + object + "; drop : " + target);
9271224 // if( object instanceof java.io.File[])
9281225 // {
....@@ -930,7 +1227,11 @@
9301227 // objEditor.DropFile((java.io.File[]) object, true);
9311228 // return;
9321229 // }
933
- 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) == ':')
9341235 {
9351236 // file(s)
9361237 String[] names = string.split("\n");
....@@ -957,7 +1258,7 @@
9571258
9581259 flashIt = false;
9591260 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1261
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9611262 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9621263
9631264 if (group.selection.size() == 1)
....@@ -973,23 +1274,33 @@
9731274
9741275 assert target == objEditor.jTree;
9751276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
9761278 try {
977
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9781280 } catch (Exception e) {
9791281 System.out.println("destinationPath : " + destinationPath);
9801282 return;
9811283 }
9821284
983
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
9841286 {
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
+// {
9851296 loadClipboard(true);
9861297 objEditor.jTree.setSelectionPath(destinationPath);
9871298 pasteInto(false, false);
988
- } else {
989
- loadClipboard(false);
990
- objEditor.jTree.setSelectionPath(destinationPath);
991
- pasteInto(false, false); // true); // ???
992
- }
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
9931304 }
9941305 public void dropActionChanged(DropTargetDragEvent dtde)
9951306 // Called if the user has modified the current drop gesture
....@@ -1094,22 +1405,30 @@
10941405 {
10951406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10961407 //heightFieldItem.addActionListener(this);
1097
- gridItem = menu.add(new MenuItem("Grid"));
1098
- gridItem.addActionListener(this);
1099
- rectoidItem = menu.add(new MenuItem("Box"));
1100
- rectoidItem.addActionListener(this);
1101
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1102
- ellipsoidItem.addActionListener(this);
1103
- coneItem = menu.add(new MenuItem("Cone"));
1104
- coneItem.addActionListener(this);
1105
- torusItem = menu.add(new MenuItem("Torus"));
1106
- torusItem.addActionListener(this);
1107
- superItem = menu.add(new MenuItem("Superellipsoid"));
1108
- 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
+ {
11091426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11101427 kleinItem.addActionListener(this);
1111
- particleItem = menu.add(new MenuItem("Particle system"));
1112
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
11131432 if (Globals.ADVANCED)
11141433 {
11151434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1135,15 +1454,15 @@
11351454 }
11361455 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11371456 bezierItem.addActionListener(this);
1138
- overlayItem = menu.add(new MenuItem("Overlay"));
1139
- overlayItem.addActionListener(this);
1140
- lightItem = menu.add(new MenuItem("Light"));
1141
- 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);
11421461 menu.add("-");
11431462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11441463 //superLoopItem.addActionListener(this);
1145
- loopItem = menu.add(new MenuItem("Loop"));
1146
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
11471466 doubleItem = menu.add(new MenuItem("Fork"));
11481467 doubleItem.addActionListener(this);
11491468 if (Globals.ADVANCED)
....@@ -1159,18 +1478,23 @@
11591478 animationItem.addItemListener(this);
11601479 animationItem.setState(Globals.ANIMATION);
11611480
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
1483
+
11621484 menu.add("-");
11631485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11641486 parseverticesItem.addActionListener(this);
11651487 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661488 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1489
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681490 alignItem.addActionListener(this);
11691491 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701492 reduceMorphItem.addActionListener(this);
11711493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721494 reduce34MorphItem.addActionListener(this);
1173
-
1495
+ menu.add("-");
1496
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1497
+ memoryItem.addActionListener(this);
11741498 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751499 computeAOItem.addActionListener(this);
11761500
....@@ -1179,11 +1503,9 @@
11791503 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11801504 mirrorItem.addActionListener(this);
11811505 menu.add("-");
1182
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1183
- memoryItem.addActionListener(this);
11841506 menu.add(analyzeItem = new MenuItem("Analyze"));
11851507 analyzeItem.addActionListener(this);
1186
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
11871509 dumpItem.addActionListener(this);
11881510 // menu.add(pathItem = new MenuItem("From-to path"));
11891511 // pathItem.addActionListener(this);
....@@ -1324,9 +1646,24 @@
13241646 shadow.material = new cMaterial(obj.material);
13251647 shadow.material.diffuse = 0.0001f;
13261648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
13271650
13281651 makeSomething(shadow);
13291652 }
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
+ }
13301667
13311668 /**
13321669 * applyExample
....@@ -1530,9 +1867,9 @@
15301867
15311868 void Overwrite(int mask)
15321869 {
1533
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1870
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15341871 {
1535
- Object3D content = GrafreeD.clipboard.get(0);
1872
+ Object3D content = Grafreed.clipboard.get(0);
15361873
15371874 if (content instanceof cGroup && ((cGroup)content).transientlink )
15381875 content = ((cGroup)content).get(0);
....@@ -1571,7 +1908,7 @@
15711908 {
15721909 ScreenFit();
15731910 } else
1574
- if (source == switchItem)
1911
+ if (source == switchViewItem)
15751912 {
15761913 cVector v1 = new cVector();
15771914 cVector v2 = new cVector();
....@@ -1580,11 +1917,11 @@
15801917 objEditor.cameraView.renderCamera.setAim(v2, v1);
15811918 objEditor.cameraView.repaint();
15821919 } else
1583
- if (source == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
15841921 {
15851922 makeSomething(new Box());
15861923 } else
1587
- if (source == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
15881925 {
15891926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15901927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1663,27 +2000,27 @@
16632000
16642001 makeSomething(obj);
16652002 } else
1666
- if (source == gridItem)
2003
+ if (source == gridItem || source == gridButton)
16672004 {
16682005 makeSomething(new Grid());
16692006 } else
1670
- if (source == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
16712008 {
16722009 makeSomething(new Sphere());
16732010 } else
1674
- if (source == coneItem)
2011
+ if (source == coneItem || source == coneButton)
16752012 {
16762013 makeSomething(new Cone());
16772014 } else
1678
- if (source == torusItem)
2015
+ if (source == torusItem || source == torusButton)
16792016 {
16802017 makeSomething(new Torus());
16812018 } else
1682
- if (source == superItem)
2019
+ if (source == superItem || source == superButton)
16832020 {
16842021 makeSomething(new Superellipsoid());
16852022 } else
1686
- if (source == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
16872024 {
16882025 makeSomething(new Klein());
16892026 } else
....@@ -1703,7 +2040,7 @@
17032040 {
17042041 makeSomething(new BezierSurface());
17052042 } else
1706
- if (source == overlayItem)
2043
+ if (source == overlayItem || source == overlayButton)
17072044 {
17082045 /*
17092046 Object3D obj = new BezierSurface(5,8);
....@@ -1751,7 +2088,7 @@
17512088 s.setup();
17522089 makeSomething(s);
17532090 } else
1754
- if (source == lightItem)
2091
+ if (source == lightItem || source == lightButton)
17552092 {
17562093 makeSomething(new Light());
17572094 } else
....@@ -1801,30 +2138,30 @@
18012138
18022139 group(g);
18032140 } else
1804
- if (source == loopItem)
2141
+ if (source == loopItem || source == loopButton)
18052142 {
18062143 Composite csg = new GroupLeaf();
18072144 csg.count = 5;
18082145 group(csg);
1809
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
18102147 csg.addChild(child);
18112148 child.addChild(csg);
18122149 } else
18132150 if (source == doubleItem)
18142151 {
1815
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
18162153 csg.count = 5;
18172154 group(csg);
1818
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
18192156 csg.addChild(child);
18202157 child.addChild(csg);
1821
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
18222159 csg.addChild(child);
18232160 child.addChild(csg);
18242161 } else
18252162 if (source == tripleItem)
18262163 {
1827
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
18282165 csg.count = 4;
18292166 group(csg);
18302167 Composite child = new cGroup();
....@@ -1836,23 +2173,6 @@
18362173 child = new cGroup();
18372174 csg.addChild(child);
18382175 child.addChild(csg);
1839
- } else
1840
-
1841
- if (source == importGFDItem)
1842
- {
1843
- ImportGFD();
1844
- } else
1845
- if (source == importVRMLX3DItem)
1846
- {
1847
- ImportVRMLX3D();
1848
- } else
1849
- if (source == import3DSItem)
1850
- {
1851
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1852
- } else
1853
- if (source == importOBJItem)
1854
- {
1855
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18562176 } else
18572177 if (source == computeAOItem)
18582178 {
....@@ -1872,7 +2192,7 @@
18722192 if (source == invariantsItem)
18732193 {
18742194 System.out.println("Invariants:");
1875
- GrafreeD.grafreeD.universe.invariants();
2195
+ Grafreed.grafreeD.universe.invariants();
18762196 } else
18772197 if (source == memoryItem)
18782198 {
....@@ -1891,6 +2211,32 @@
18912211 {
18922212 DumpObject();
18932213 } 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
18942240 if (source == oneStepButton)
18952241 {
18962242 Globals.ONESTEP = true;
....@@ -1898,17 +2244,14 @@
18982244 } else
18992245 if (source == screenfitButton)
19002246 {
1901
- //Reload(lastConverter, lastFilename, true);
19022247 ScreenFit();
19032248 } else
19042249 if (source == screenfitpointButton)
19052250 {
1906
- //Reload(lastConverter, lastFilename, true);
19072251 ScreenFitPoint();
19082252 } else
19092253 if (source == snapobjectButton)
19102254 {
1911
- //Reload(lastConverter, lastFilename, true);
19122255 SnapObject();
19132256 } else
19142257 // if (event.getSource() == recompileButton)
....@@ -1945,12 +2288,20 @@
19452288 {
19462289 loadClipboard(true);
19472290 } else
2291
+ if (source == undoItem)
2292
+ {
2293
+ Undo();
2294
+ } else
2295
+ if (source == redoItem)
2296
+ {
2297
+ Redo();
2298
+ } else
19482299 if (source == duplicateItem)
19492300 {
1950
- Object3D keep = GrafreeD.clipboard;
2301
+ Object3D keep = Grafreed.clipboard;
19512302 loadClipboard(false);
19522303 paste(false);
1953
- GrafreeD.clipboard = keep;
2304
+ Grafreed.clipboard = keep;
19542305 } else
19552306 if (source == cloneItem)
19562307 {
....@@ -2170,9 +2521,9 @@
21702521 // group.selection.get(0).setMasterThis(content); // should be identity
21712522 // refreshContents();
21722523 // }
2173
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2524
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21742525 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2526
+ Object3D content = Grafreed.clipboard.get(0);
21762527
21772528 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782529 content = ((cGroup)content).get(0);
....@@ -2222,9 +2573,9 @@
22222573 } else
22232574 if (source == setMasterItem)
22242575 {
2225
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2576
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22262577 {
2227
- Object3D content = GrafreeD.clipboard.get(0);
2578
+ Object3D content = Grafreed.clipboard.get(0);
22282579
22292580 if (content instanceof cGroup && ((cGroup)content).transientlink )
22302581 content = ((cGroup)content).get(0);
....@@ -2237,9 +2588,9 @@
22372588 {
22382589 if (group.selection.size() == 1)
22392590 {
2240
- if (GrafreeD.clipboard.size() == 1)
2591
+ if (Grafreed.clipboard.size() == 1)
22412592 {
2242
- Object3D content = GrafreeD.clipboard.get(0);
2593
+ Object3D content = Grafreed.clipboard.get(0);
22432594
22442595 if (content instanceof cGroup && ((cGroup)content).transientlink )
22452596 content = ((cGroup)content).get(0);
....@@ -2256,7 +2607,7 @@
22562607 {
22572608 RevertMeshes();
22582609 } else
2259
- if (source == resetMeshItem)
2610
+ if (source == resetAllItem)
22602611 {
22612612 ResetAll();
22622613 } else
....@@ -2276,9 +2627,9 @@
22762627 {
22772628 ClearSelection(true);
22782629 } else
2279
- if (source == grabItem)
2630
+ if (source == grabItem || source == groupButton)
22802631 {
2281
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
22822633 } else
22832634 if (source == hideItem)
22842635 {
....@@ -2296,11 +2647,11 @@
22962647 {
22972648 makeSomething(new Camera());
22982649 } else
2299
- if (source == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
23002651 {
23012652 group(new Composite());
23022653 } else
2303
- if (source == randomItem)
2654
+ if (source == switchItem || source == switchButton)
23042655 {
23052656 RandomNode random = new RandomNode();
23062657 group(random);
....@@ -2402,7 +2753,7 @@
24022753 {
24032754 group(new cLinker());
24042755 } else
2405
- if (source == textureItem)
2756
+ if (source == textureItem || source == textureButton)
24062757 {
24072758 group(new TextureNode());
24082759 } else
....@@ -2422,17 +2773,30 @@
24222773 {
24232774 CastShadow(2);
24242775 } else
2425
- if (source == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
24262777 {
2427
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
24282780 for (int i=0; i<group.selection.size(); i++)
24292781 {
2430
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
24312787 }
24322788
2433
- ClearSelection(false);
2434
-
2435
- 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
+ }
24362800 } else
24372801 if (source == genUVItem)
24382802 {
....@@ -2444,7 +2808,7 @@
24442808 } else
24452809 if (source == genNormalsMESHItem)
24462810 {
2447
- GenNormals(true); // TODO
2811
+ GenNormalsMESH();
24482812 } else
24492813 if (source == genNormalsORGANItem)
24502814 {
....@@ -2509,6 +2873,22 @@
25092873 if (source == unmarkleavesItem)
25102874 {
25112875 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);
25122892 } else
25132893 if (source == flipVItem)
25142894 {
....@@ -2594,9 +2974,13 @@
25942974 {
25952975 SmoothMesh();
25962976 } else
2597
- if (source == transformgeometryItem)
2977
+ if (source == transformGeometryItem)
25982978 {
25992979 TransformGeometry();
2980
+ } else
2981
+ if (source == transformChildrenItem)
2982
+ {
2983
+ TransformChildren();
26002984 } else
26012985 if (source == resetTransformItem)
26022986 {
....@@ -2604,7 +2988,11 @@
26042988 } else
26052989 if (source == resetCentroidItem)
26062990 {
2607
- ResetCentroid();
2991
+ ResetCentroid(true);
2992
+ } else
2993
+ if (source == resetCentroidXZItem)
2994
+ {
2995
+ ResetCentroid(false);
26082996 } else
26092997 if (source == resetParentItem)
26102998 {
....@@ -2736,6 +3124,10 @@
27363124 if (source == twoButton)
27373125 {
27383126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
27393131 // bug
27403132 //gridPanel.setDividerLocation(1.0);
27413133 //bigPanel.setDividerLocation(0.0);
....@@ -2768,10 +3160,31 @@
27683160 bigThree.ClearUI();
27693161 bigThree.add(centralPanel);
27703162 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
+
27713181 } else
27723182 if (source == threeButton)
27733183 {
27743184 radio.layout = threeButton;
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
27753188
27763189 // bigThree.remove(scenePanel);
27773190 // bigThree.remove(centralPanel);
....@@ -2804,10 +3217,15 @@
28043217 bigThree.add(centralPanel);
28053218 bigThree.add(XYZPanel);
28063219 bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
28073222 } else
28083223 if (source == fourButton)
28093224 {
28103225 radio.layout = fourButton;
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
28113229
28123230 // bigThree.remove(scenePanel);
28133231 // bigThree.remove(centralPanel);
....@@ -2839,10 +3257,15 @@
28393257 bigThree.ClearUI();
28403258 bigThree.add(scenePanel);
28413259 bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
28423262 } else
28433263 if (source == sixButton)
28443264 {
28453265 radio.layout = sixButton;
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
28463269
28473270 // bigThree.remove(scenePanel);
28483271 // bigThree.remove(centralPanel);
....@@ -2875,10 +3298,15 @@
28753298 bigThree.add(scenePanel);
28763299 bigThree.add(centralPanel);
28773300 bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
28783303 } else
28793304 if (source == sevenButton)
28803305 {
28813306 radio.layout = sevenButton;
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
28823310
28833311 // bigThree.remove(scenePanel);
28843312 // bigThree.remove(centralPanel);
....@@ -2912,6 +3340,8 @@
29123340 bigThree.add(centralPanel);
29133341 bigThree.add(XYZPanel);
29143342 bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
29153345 } else
29163346 if (source == rootButton)
29173347 {
....@@ -2923,6 +3353,7 @@
29233353 EditObject(obj);
29243354 }
29253355
3356
+ cameraView.requestFocusInWindow();
29263357 refreshContents(true);
29273358 } else
29283359 if (source == closeButton)
....@@ -2932,22 +3363,37 @@
29323363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29333364 {
29343365 ab = (cRadio)e.nextElement();
2935
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29363367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
29373374 buttonGroup.remove(ab);
29383375 radioPanel.remove(ab);
29393376
2940
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
29413379 // ab.GetObject().objectUI = null; // ?????????
29423380
29433381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29443382 break;
29453383 }
29463384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
29473387 refreshContents(true);
29483388 } else
29493389 if (source == editItem || source == editButton)
29503390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
29513397 EditSelection(false);
29523398 } else
29533399 if (source == uneditButton)
....@@ -2957,10 +3403,11 @@
29573403 Object3D child = (Object3D)e.nextElement();
29583404 if(child.editWindow != null)
29593405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
29603407 child.CloseUI();
29613408 listUI.remove(child);
29623409
2963
- child.editWindow = null; // ???????????
3410
+ //child.editWindow = null; // ???????????
29643411 }
29653412 objEditor.ctrlPanel.FlushUI();
29663413 //objEditor.jTree.clearSelection();
....@@ -2973,6 +3420,7 @@
29733420 //copy.ClearUI();
29743421 for (Object3D obj : listUI)
29753422 {
3423
+ obj.pinned = false;
29763424 obj.CloseUI();
29773425 }
29783426 listUI.clear();
....@@ -2982,7 +3430,7 @@
29823430 {
29833431 assert(copy == group);
29843432
2985
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29863434
29873435 for (Object3D obj : listUI)
29883436 {
....@@ -3046,20 +3494,44 @@
30463494 frontView.object = group;
30473495 sideView.object = group;
30483496 }
3049
- group.editWindow = this;
3497
+
3498
+// fix "+" issue
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
3501
+
30503502 /*
30513503 currentLayout = radio.layout;
30523504 if (currentLayout == null)
30533505 currentLayout = sevenButton;
30543506 */
30553507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
30563513 keepparent = group.parent;
30573514 // PARENT = NULL or not???
30583515 //group.parent = null; // ROOT
30593516 //group.attributes = -1;
30603517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
30613520 refreshContents(true);
3062
- }
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
+ }
30633535 else
30643536 {
30653537 //return super.action(event, arg);
....@@ -3068,7 +3540,6 @@
30683540 }
30693541
30703542 boolean useclient = false;
3071
- cRadio radio;
30723543
30733544 void ToggleRoot()
30743545 {
....@@ -3120,6 +3591,28 @@
31203591 refreshContents();
31213592 }
31223593
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
+ }
31233616
31243617 void ResetTransform()
31253618 {
....@@ -3232,7 +3725,7 @@
32323725 refreshContents();
32333726 }
32343727
3235
- void ResetCentroid()
3728
+ void ResetCentroid(boolean full)
32363729 {
32373730 Object3D obj;
32383731 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3247,12 +3740,16 @@
32473740 LA.matIdentity(Object3D.mat);
32483741 obj.getBounds(minima, maxima, false);
32493742 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3250
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3743
+ if (full)
3744
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32513745 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32523746 obj.TransformMesh(Object3D.mat);
3747
+
32533748 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3254
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3749
+ if (full)
3750
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32553751 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3752
+
32563753 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32573754 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32583755 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3281,7 +3778,8 @@
32813778
32823779 int size = obj.MemorySize();
32833780
3284
- 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)");
32853783 }
32863784 }
32873785 catch (Exception e)
....@@ -3318,9 +3816,9 @@
33183816 obj = (Object3D)e.nextElement();
33193817
33203818 System.out.println("Object is: " + obj);
3321
- GrafreeD.AnalyzeObject(obj);
3819
+ Grafreed.AnalyzeObject(obj);
33223820 System.out.println("Boundary rep: " + obj.bRep);
3323
- GrafreeD.AnalyzeObject(obj.bRep);
3821
+ Grafreed.AnalyzeObject(obj.bRep);
33243822
33253823 // System.err.println((size/1024) + " KB is the size of " + obj);
33263824 }
....@@ -3362,6 +3860,13 @@
33623860 void GenNormals(boolean crease)
33633861 {
33643862 group.GenNormalsS(crease);
3863
+
3864
+ refreshContents();
3865
+ }
3866
+
3867
+ void GenNormalsMESH()
3868
+ {
3869
+ group.GenNormalsMeshS();
33653870
33663871 refreshContents();
33673872 }
....@@ -3534,8 +4039,8 @@
35344039
35354040 void ParseVertices()
35364041 {
3537
- boolean epsequal = GrafreeD.epsequal;
3538
- GrafreeD.epsequal = true;
4042
+ boolean epsequal = Grafreed.epsequal;
4043
+ Grafreed.epsequal = true;
35394044
35404045 for (int i=0; i<group.selection.size(); i++)
35414046 {
....@@ -3560,7 +4065,7 @@
35604065 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35614066 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35624067
3563
- g.add(GrafreeD.clipboard);
4068
+ g.add(Grafreed.clipboard);
35644069
35654070 buffer.add(g);
35664071 }
....@@ -3575,7 +4080,7 @@
35754080 makeSomething(buffer, i==group.selection.size()-1);
35764081 }
35774082
3578
- GrafreeD.epsequal = epsequal;
4083
+ Grafreed.epsequal = epsequal;
35794084
35804085 refreshContents();
35814086 }
....@@ -3593,7 +4098,16 @@
35934098 String pigment = Object3D.GetPigment(tex);
35944099 //String bump = Object3D.GetBump(tex);
35954100
3596
- 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
+ }
35974111
35984112 double s = v.s;
35994113
....@@ -3725,7 +4239,7 @@
37254239 return;
37264240
37274241 Object3D poses = group.selection.get(0);
3728
- Object3D ref = GrafreeD.clipboard.get(0);
4242
+ Object3D ref = Grafreed.clipboard.get(0);
37294243
37304244 Object3D newgroup = new Object3D("Po:" + poses.name);
37314245
....@@ -3919,9 +4433,9 @@
39194433
39204434 void ClipMesh()
39214435 {
3922
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4436
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39234437 {
3924
- Object3D content = GrafreeD.clipboard.get(0);
4438
+ Object3D content = Grafreed.clipboard.get(0);
39254439
39264440 if (content instanceof cGroup && ((cGroup)content).transientlink )
39274441 content = ((cGroup)content).get(0);
....@@ -3930,7 +4444,7 @@
39304444 // {
39314445 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39324446 // }
3933
- group.selection.ClipMesh(GrafreeD.clipboard);
4447
+ group.selection.ClipMesh(Grafreed.clipboard);
39344448 }
39354449 // group.selection.ClipMesh(GrafreeD.clipboard);
39364450 System.out.println("DONE.");
....@@ -3977,6 +4491,18 @@
39774491 void MarkLeaves(boolean hide)
39784492 {
39794493 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);
39804506 refreshContents();
39814507 }
39824508
....@@ -4051,10 +4577,6 @@
40514577 // }
40524578 // }
40534579
4054
- static boolean allparams = true;
4055
-
4056
- static Vector<Object3D> listUI = new Vector<Object3D>();
4057
-
40584580 void EditSelection(boolean newWindow)
40594581 {
40604582 // aConstraints.gridy = 0;
....@@ -4062,10 +4584,10 @@
40624584 {
40634585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40644586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4065
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40664588
40674589 Object3D elem = (Object3D)group.selection.elementAt(i);
4068
- if(elem != group)
4590
+ if(elem != group || !newWindow)
40694591 {
40704592 // if (!(elem instanceof Composite))
40714593 // newWindow = false;
....@@ -4147,7 +4669,8 @@
41474669 //new Exception().printStackTrace();
41484670
41494671 freezemodel = true;
4150
-
4672
+ ClearUnpinned();
4673
+
41514674 /**/
41524675 //switch (event.id)
41534676 {
....@@ -4155,7 +4678,6 @@
41554678 //case 702: // Event.LIST_DESELECT
41564679 group.deselectAll();
41574680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4158
- objEditor.ClearInfo(); // .GetMaterial());
41594681 if (tps != null)
41604682 {
41614683 for (int i=0; i < tps.length; i++)
....@@ -4164,10 +4686,8 @@
41644686
41654687 //if (child.parent != null)
41664688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
41674690 group.addSelectee(child);
4168
- objEditor.SetMaterial(child); // .GetMaterial());
4169
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4170
- System.err.println("info : " + child.GetPath());
41714691 }
41724692 }
41734693 // else
....@@ -4177,20 +4697,28 @@
41774697 // System.err.println("info : " + group.GetPath());
41784698 // }
41794699
4180
- objEditor.SetText(); // jan 2014
4181
-
4182
- 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))
41834701 CameraPane.flash = true;
41844702
4185
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4703
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41864704 // a camera
41874705 {
4188
- CameraPane.camerachangeframe = 0; // don't refuse it
4189
- 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
+ }
41904711 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41914712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41924713 }
41934714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
41944722 refreshContents();
41954723 //return true;
41964724 }
....@@ -4199,6 +4727,35 @@
41994727
42004728 freezemodel = false;
42014729 }
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
+ }
42024759
42034760 void linkSomething(Object3D thing)
42044761 {
....@@ -4270,16 +4827,19 @@
42704827 {
42714828 if (group.selection.isEmpty())
42724829 return;
4273
- GrafreeD.clipboardIsTempGroup = false;
4830
+
4831
+ Grafreed.clipboardIsTempGroup = false;
42744832 Composite tGroup = null;
42754833 if (group.selection.size() > 0) // 1)
42764834 {
42774835 tGroup = new cGroup();
4278
- GrafreeD.clipboardIsTempGroup = true;
4836
+ Grafreed.clipboardIsTempGroup = true;
42794837 }
42804838
42814839 if (cut)
42824840 {
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
42834843 //int indices[] = jList.getSelectedIndices();
42844844 //for (int i = indices.length - 1; i >= 0; i--)
42854845 //jList.remove(indices[i]);
....@@ -4315,16 +4875,16 @@
43154875 //System.out.println("cut " + child);
43164876 //System.out.println("parent = " + child.parent);
43174877 // tmp.addChild(child);
4318
- if (GrafreeD.clipboardIsTempGroup)
4878
+ if (Grafreed.clipboardIsTempGroup)
43194879 tGroup.add/*Child*/(tmp);
43204880 else
4321
- GrafreeD.clipboard = tmp;
4881
+ Grafreed.clipboard = tmp;
43224882 }
43234883 else
4324
- if (GrafreeD.clipboardIsTempGroup)
4884
+ if (Grafreed.clipboardIsTempGroup)
43254885 tGroup.add/*Child*/(child);
43264886 else
4327
- GrafreeD.clipboard = child;
4887
+ Grafreed.clipboard = child;
43284888 }
43294889
43304890 //ResetModel();
....@@ -4356,21 +4916,23 @@
43564916 //System.out.println("cut " + elem);
43574917 //System.out.println("parent = " + elem.parent);
43584918 // tmp.addChild(elem);
4359
- if (GrafreeD.clipboardIsTempGroup)
4919
+ if (Grafreed.clipboardIsTempGroup)
43604920 tGroup.add/*Child*/(tmp);
43614921 else
4362
- GrafreeD.clipboard = tmp;
4922
+ Grafreed.clipboard = tmp;
43634923 }
43644924 else
4365
- if (GrafreeD.clipboardIsTempGroup)
4925
+ if (Grafreed.clipboardIsTempGroup)
43664926 tGroup.add/*Child*/(child);
43674927 else
4368
- GrafreeD.clipboard = child;
4928
+ Grafreed.clipboard = child;
43694929 }
43704930
43714931 }
4372
- if (GrafreeD.clipboardIsTempGroup)
4373
- GrafreeD.clipboard = tGroup;
4932
+
4933
+ if (Grafreed.clipboardIsTempGroup)
4934
+ Grafreed.clipboard = tGroup;
4935
+
43744936 if (cut)
43754937 {
43764938 ResetModel();
....@@ -4380,11 +4942,15 @@
43804942
43814943 void paste(boolean expand)
43824944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
43834949 // if (GrafreeD.clipboard == null)
43844950 // return;
43854951 boolean first = true;
43864952
4387
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
43884954 {
43894955 Composite temp;
43904956
....@@ -4395,7 +4961,7 @@
43954961 temp = (Composite)Applet3D.clipboard.deepCopy();
43964962 */
43974963 Object3D elem;
4398
- 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))
43994965 {
44004966 Object3D child = (Object3D)e.nextElement();
44014967
....@@ -4429,16 +4995,17 @@
44294995 //Object3D cb = Applet3D.clipboard;
44304996 //temp.addChild(cb);
44314997 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4432
- assert(GrafreeD.clipboard.parent == null);
4433
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4434
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4435
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4436
- 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());
44375003 else
4438
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
- GrafreeD.clipboard.get(0).parent = keepparent;
5004
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5005
+ Grafreed.clipboard.get(0).parent = keepparent;
44405006 }
44415007
5008
+ Globals.SAVEONMAKE = keep;
44425009 ResetModel();
44435010 refreshContents();
44445011 }
....@@ -4485,9 +5052,9 @@
44855052 {
44865053 boolean first = true;
44875054
4488
- if (GrafreeD.clipboardIsTempGroup)
5055
+ if (Grafreed.clipboardIsTempGroup)
44895056 {
4490
- Composite temp = (Composite)GrafreeD.clipboard;
5057
+ Composite temp = (Composite)Grafreed.clipboard;
44915058 Object3D copy;
44925059 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44935060 {
....@@ -4497,7 +5064,7 @@
44975064 }
44985065 } else
44995066 {
4500
- linkSomething(GrafreeD.clipboard); //.get(0));
5067
+ linkSomething(Grafreed.clipboard); //.get(0));
45015068 }
45025069 }
45035070 }
....@@ -4574,6 +5141,10 @@
45745141
45755142 void group(Object3D csg, boolean grab)
45765143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
45775148 if (//false) // why??
45785149 !group.selection.isEmpty())
45795150 {
....@@ -4687,10 +5258,15 @@
46875258 //node.add(csg);
46885259 //makeSomething(node);
46895260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
46905262 }
46915263
46925264 void Ungroup(Object3D g)
46935265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
46945270 if (g instanceof HiddenObject)
46955271 {
46965272 HiddenObject h = (HiddenObject) g;
....@@ -4707,6 +5283,7 @@
47075283 objEditor.makeSomething(g.get(i), false);
47085284 }
47095285 }
5286
+ Globals.SAVEONMAKE = keep;
47105287 }
47115288
47125289 void ungroup()
....@@ -4902,21 +5479,6 @@
49025479 }
49035480 */
49045481
4905
- void ImportGFD()
4906
- {
4907
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4908
- browser.show();
4909
- String filename = browser.getFile();
4910
- if (filename != null && filename.length() > 0)
4911
- {
4912
- String fullname = browser.getDirectory() + filename;
4913
-
4914
- //Object3D readobj =
4915
- objEditor.ReadGFD(fullname, objEditor);
4916
- //makeSomething(readobj);
4917
- }
4918
- }
4919
-
49205482 /*
49215483 public void Callback(Object obj)
49225484 {
....@@ -4940,26 +5502,9 @@
49405502 }
49415503 */
49425504
4943
- void ImportVRMLX3D()
4944
- {
4945
- if (GrafreeD.standAlone)
4946
- {
4947
- /**/
4948
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4949
- browser.show();
4950
- String filename = browser.getFile();
4951
- if (filename != null && filename.length() > 0)
4952
- {
4953
- String fullname = browser.getDirectory() + filename;
4954
- LoadVRMLX3D(fullname);
4955
- }
4956
- /**/
4957
- }
4958
- }
4959
-
49605505 String GetFile(String dialogName)
49615506 {
4962
- if (GrafreeD.standAlone)
5507
+ if (Grafreed.standAlone)
49635508 {
49645509 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49655510 browser.show();
....@@ -5027,7 +5572,28 @@
50275572 cButton clearpanelButton;
50285573 cButton unselectButton;
50295574
5575
+ cButton restoreCameraButton;
5576
+
5577
+ cButton saveButton;
50305578 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;
50315597
50325598 cButton screenfitButton;
50335599 cButton screenfitpointButton;
....@@ -5040,14 +5606,6 @@
50405606
50415607 cButton setsupportButton;
50425608
5043
- cButton twoButton;
5044
- cButton sixButton;
5045
- cButton threeButton;
5046
- cButton sevenButton;
5047
- cButton fourButton; // full panel
5048
- cButton oneButton; // full XYZ
5049
- //cButton currentLayout;
5050
-
50515609 //
50525610 //Composite
50535611 Object3D // to do !!
....@@ -5057,9 +5615,11 @@
50575615 //JTree jTree;
50585616 private MenuItem lookAtItem;
50595617 private MenuItem lookFromItem;
5060
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
50615619 private MenuItem cutItem;
5062
- private MenuItem duplicateItem;
5620
+ private MenuItem undoItem;
5621
+ private MenuItem redoItem;
5622
+ private JMenuItem duplicateItem;
50635623 private MenuItem cloneItem;
50645624 private MenuItem cloneSupportItem;
50655625 private MenuItem overwriteGeoItem;
....@@ -5072,7 +5632,7 @@
50725632 private MenuItem linkverticesItem;
50735633 private MenuItem relinkverticesItem;
50745634 private MenuItem setMasterItem;
5075
- private MenuItem resetMeshItem;
5635
+ private MenuItem resetAllItem;
50765636 private MenuItem stepAllItem;
50775637 private MenuItem revertMeshItem;
50785638 private MenuItem poseMeshItem;
....@@ -5122,6 +5682,10 @@
51225682 private MenuItem showleavesItem;
51235683 private MenuItem markleavesItem;
51245684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
51255689
51265690 private MenuItem flipVItem;
51275691 private MenuItem unflipVItem;
....@@ -5133,15 +5697,17 @@
51335697 private MenuItem panoTexturesItem;
51345698
51355699 private MenuItem resetCentroidItem;
5136
- private MenuItem transformgeometryItem;
5700
+ private MenuItem resetCentroidXZItem;
51375701 private MenuItem resetTransformItem;
5702
+ private MenuItem transformGeometryItem;
5703
+ private MenuItem transformChildrenItem;
51385704 private MenuItem hideItem;
51395705 private MenuItem grabItem;
51405706 private MenuItem backItem;
51415707 private MenuItem frontItem;
51425708 private MenuItem cameraItem;
51435709 private MenuItem compositeItem;
5144
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
51455711 private MenuItem physicsItem;
51465712 private MenuItem frameselectorItem;
51475713 private MenuItem scriptNodeItem;
....@@ -5203,11 +5769,6 @@
52035769 private MenuItem doubleItem;
52045770 private MenuItem tripleItem;
52055771
5206
- private MenuItem importGFDItem;
5207
- private MenuItem importVRMLX3DItem;
5208
- private MenuItem import3DSItem;
5209
- private MenuItem importOBJItem;
5210
-
52115772 private MenuItem computeAOItem;
52125773 private MenuItem recompileItem;
52135774 private MenuItem editScriptItem;
....@@ -5217,4 +5778,8 @@
52175778 private MenuItem analyzeItem;
52185779 private MenuItem dumpItem;
52195780 //boolean freezemodel = false;
5781
+
5782
+ Menu cameraMenu;
5783
+ MenuItem editCameraItem;
5784
+ MenuItem restoreCameraItem;
52205785 }