Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
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.REPLACEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.REPLACEONMAKE;
90
+ Globals.REPLACEONMAKE = 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.REPLACEONMAKE = 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,42 @@
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
547
+
458548 void SetupUI2(ObjEditor oe)
459549 {
550
+ // June 2019
551
+ if (oe == null)
552
+ {
553
+ //super.SetupUI2(this);
554
+ //return;
555
+ }
556
+
557
+ if (copy != group)
558
+ {
559
+ //super.SetupUI2(this);
560
+ }
561
+
460562 //new Exception().printStackTrace();
461563
462564 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -485,97 +587,229 @@
485587 oe.radioPanel.add(dummyButton);
486588 oe.buttonGroup.add(dummyButton);
487589 */
590
+ cGridBag copyOptionsPanel = new cGridBag();
591
+
592
+ copyOptionsPanel.preferredHeight = 1;
593
+
488594 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
489595
490
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
- liveCB.setToolTipText("Enabled animation");
596
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ //minButton.setToolTipText("Minimize window");
598
+ //minButton.addActionListener(this);
599
+
600
+ if (Globals.ADVANCED)
601
+ {
602
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ maxButton.setToolTipText("Maximize window");
604
+ maxButton.addActionListener(this);
605
+ }
606
+
607
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ fullButton.setToolTipText("Full-screen window");
609
+ fullButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ screenfitButton.setToolTipText("Screen fit");
613
+ screenfitButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ restoreCameraButton.setToolTipText("Restore viewpoint");
617
+ restoreCameraButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ saveButton.setToolTipText("New version");
621
+ saveButton.addActionListener(this);
622
+
623
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ undoButton.setToolTipText("Previous version");
625
+ undoButton.addActionListener(this);
626
+ undoButton.setEnabled(false);
627
+
628
+ cGridBag updown = new cGridBag().setVertical(true);
629
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ restoreButton.setToolTipText("Restore current");
631
+ restoreButton.addActionListener(this);
632
+ restoreButton.setEnabled(false);
633
+
634
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ replaceButton.setToolTipText("Replace current");
636
+ replaceButton.addActionListener(this);
637
+ replaceButton.setEnabled(false);
638
+
639
+ copyOptionsPanel.add(updown);
640
+
641
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ redoButton.setToolTipText("Next version");
643
+ redoButton.addActionListener(this);
644
+ redoButton.setEnabled(false);
645
+
646
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
647
+ liveCB.setToolTipText("Enable animation");
492648 liveCB.addItemListener(this);
493649
494
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
650
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495651 oneStepButton.setToolTipText("Animate one step forward");
496652 oneStepButton.addActionListener(this);
497653
498
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
654
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
499655 fastCB.setToolTipText("Fast mode");
500656 fastCB.addItemListener(this);
501657
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);
658
+ //oe.toolboxPanel.Return();
659
+
660
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
661
+// trackCB.setToolTipText("Enable tracking");
662
+// trackCB.addItemListener(this);
509663
510664 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
511665 // screenfitpointButton.addActionListener(this);
512666
513667 if (Globals.ADVANCED)
514668 {
515
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
669
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516670 snapobjectButton.addActionListener(this);
517671 snapobjectButton.setToolTipText("Snap Object");
518672 }
519673
520
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
- flashSelectionButton.setToolTipText("Show selection");
522
- flashSelectionButton.addActionListener(this);
674
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
523675
524
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525
-
526
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527677 twoButton.setToolTipText("Show center view only");
528678 twoButton.addActionListener(this);
529
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
679
+ this.fullscreenLayout = twoButton;
680
+
681
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530682 fourButton.addActionListener(this);
531683 fourButton.setToolTipText("Show left panel only");
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
684
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533685 sixButton.setToolTipText("2-column layout left");
534686 sixButton.addActionListener(this);
535
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
687
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536688 threeButton.setToolTipText("2-column layout right");
537689 threeButton.addActionListener(this);
538
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
539691 sevenButton.setToolTipText("3-column layout");
540692 sevenButton.addActionListener(this);
541693 //
542694
543
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
695
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544696 rootButton.setToolTipText("Edit selection in new tab");
545697 rootButton.addActionListener(this);
546698
547
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
699
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548700 closeButton.setToolTipText("Close tab");
549701 closeButton.addActionListener(this);
550702 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
551703 //clearButton.addActionListener(this);
552
-
553
- cGridBag commandsPanel = new cGridBag();
704
+
705
+ // INSERT
706
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
707
+ gridButton.setToolTipText("Create grid");
708
+ gridButton.addActionListener(this);
709
+
710
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ boxButton.setToolTipText("Create box");
712
+ boxButton.addActionListener(this);
713
+
714
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ sphereButton.setToolTipText("Create sphere");
716
+ sphereButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ coneButton.setToolTipText("Create cone");
720
+ coneButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ torusButton.setToolTipText("Create torus");
724
+ torusButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ superButton.setToolTipText("Create superellipsoid");
728
+ superButton.addActionListener(this);
729
+
730
+ if (Globals.ADVANCED)
731
+ {
732
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ kleinButton.setToolTipText("Create Klein bottle");
734
+ kleinButton.addActionListener(this);
735
+ }
554736
555
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
- editButton.setToolTipText("Edit selection");
737
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ particlesButton.setToolTipText("Create particle system");
739
+ particlesButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.Return();
742
+
743
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
744
+ groupButton.setToolTipText("Create group");
745
+ groupButton.addActionListener(this);
746
+
747
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ compositeButton.setToolTipText("Create composite");
749
+ compositeButton.addActionListener(this);
750
+
751
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ switchButton.setToolTipText("Create item switcher");
753
+ switchButton.addActionListener(this);
754
+
755
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
756
+ loopButton.setToolTipText("Create loop");
757
+ loopButton.addActionListener(this);
758
+
759
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ textureButton.setToolTipText("Create texture");
761
+ textureButton.addActionListener(this);
762
+
763
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ overlayButton.setToolTipText("Create overlay");
765
+ overlayButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ lightButton.setToolTipText("Create light");
769
+ lightButton.addActionListener(this);
770
+
771
+ for (int i=6; --i>=0;)
772
+ {
773
+ oe.toolboxPanel.Return();
774
+ oe.toolboxPanel.add(new cGridBag());
775
+ oe.toolboxPanel.add(new cGridBag());
776
+ oe.toolboxPanel.add(new cGridBag());
777
+ oe.toolboxPanel.add(new cGridBag());
778
+ oe.toolboxPanel.add(new cGridBag());
779
+ oe.toolboxPanel.add(new cGridBag());
780
+ oe.toolboxPanel.add(new cGridBag());
781
+ }
782
+
783
+ // EDIT panel
784
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ editButton.setToolTipText("Pin selection controls");
557786 editButton.addActionListener(this);
558787
559
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
- uneditButton.setToolTipText("Unedit selection");
788
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
789
+ uneditButton.setToolTipText("Remove selection controls");
561790 uneditButton.addActionListener(this);
562791
563
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
- allParamsButton.setToolTipText("Edit all params");
792
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
793
+ allParamsButton.setToolTipText("Show all controle");
565794 allParamsButton.addActionListener(this);
566795
567
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
796
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
568797 clearPanelButton.setToolTipText("Clear edit panel");
569798 clearPanelButton.addActionListener(this);
570799
571
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
800
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
572801 unselectButton.setToolTipText("Unselect");
573802 unselectButton.addActionListener(this);
574803
575
- commandsPanel.preferredHeight = 1;
804
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ flashSelectionButton.setToolTipText("Highlight selection");
806
+ flashSelectionButton.addActionListener(this);
576807
577
- oe.treePanel.add(commandsPanel);
578
- oe.treePanel.Return();
808
+ editCommandsPanel.preferredHeight = 1;
809
+
810
+ SetPinStates(false);
811
+// oe.treePanel.add(commandsPanel);
812
+// oe.treePanel.Return();
579813
580814 // oe.aConstraints.gridx += 1;
581815 // oe.aConstraints.weighty = 0;
....@@ -592,29 +826,17 @@
592826
593827 JScrollPane jSP;
594828 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
829
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596830 ResetModel();
597831
598832 oe.treePanel.add(jSPPanel);
599833 oe.treePanel.Return();
600834
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;
616835 oe.treePanel.add(copyOptionsPanel);
617836 oe.treePanel.Return();
837
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0);
838
+ versionField = (cNumberSlider)sliderPane.getComponent(1);
839
+ sliderPane.preferredHeight = 1;
618840
619841 // mainPanel.setDividerLocation(0.5); //1.0);
620842 // mainPanel.setResizeWeight(0.5);
....@@ -643,23 +865,43 @@
643865
644866 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
645867 {
868
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
869
+ colorCB.setToolTipText("Copy color when dropped");
870
+ colorCB.addItemListener(this);
871
+
872
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
873
+ materialCB.setToolTipText("Copy material when dropped");
874
+ materialCB.addItemListener(this);
875
+
876
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
877
+ textureCB.setToolTipText("Copy texture when dropped");
878
+ textureCB.addItemListener(this);
879
+
880
+ panel.Return();
881
+
646882 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
647883 boxCB.setToolTipText("Display bounding boxes");
648884 boxCB.addItemListener(this);
649885
650886 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
887
+ zoomBoxCB.setToolTipText("Display only for wheel");
652888 zoomBoxCB.addItemListener(this);
653889
654
- if (Globals.ADVANCED)
890
+ if (true) // Globals.ADVANCED)
655891 {
656
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
- supportCB.setToolTipText("Enable rigging");
658
- supportCB.addItemListener(this);
892
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
893
+// supportCB.setToolTipText("Enable rigging");
894
+// supportCB.addItemListener(this);
895
+
896
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
897
+ freezeCB.setToolTipText("Fast moving camera");
898
+ freezeCB.addItemListener(this);
659899
660900 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661901 // localCB.addItemListener(this);
662902
903
+ panel.Return();
904
+
663905 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664906 crowdCB.setToolTipText("Used for crowds");
665907 crowdCB.addItemListener(this);
....@@ -676,6 +918,8 @@
676918 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
677919 // speakerMocapCB.addItemListener(this);
678920
921
+ panel.Return();
922
+
679923 if (false)
680924 {
681925 // handled in scripts
....@@ -690,32 +934,72 @@
690934 //constraints.gridy += 1;
691935 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
692936 smoothfocusCB.addItemListener(this);
937
+ panel.Return();
693938 }
694939
695940 //constraints.gridx += 1;
696941 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
697942 // debugCB.addItemListener(this);
698943
944
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
945
+ trackCB.setToolTipText("Enable tracking target");
946
+ trackCB.addItemListener(this);
947
+
699948 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
949
+ oeilCB.setToolTipText("Move camera when tracking");
700950 oeilCB.addItemListener(this);
701951
952
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
953
+ shadowCB.setToolTipText("When live compute shadows");
954
+ shadowCB.addItemListener(this);
955
+
956
+ panel.Return();
957
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
958
+ toggleTextureCB.setToolTipText("Load textures");
959
+ toggleTextureCB.addItemListener(this);
960
+
961
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
962
+ toggleSwitchCB.setToolTipText("Choose a single item");
963
+ toggleSwitchCB.addItemListener(this);
964
+
965
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
966
+ autokeepCB.setToolTipText("On structure change");
967
+ autokeepCB.addItemListener(this);
968
+
969
+ panel.Return();
970
+ if (Globals.ADVANCED)
971
+ {
702972 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
703973 lookAtCB.setToolTipText("Look-at target");
704974 lookAtCB.addItemListener(this);
975
+ }
705976
706977 }
707978
708979 cGridBag fill = new cGridBag();
709
-
710980 fill.preferredHeight = 200;
981
+ cGridBag fill2 = new cGridBag();
982
+ fill2.preferredHeight = 200;
983
+ cGridBag fill3 = new cGridBag();
984
+ fill3.preferredHeight = 200;
711985
712986 panel.add(fill);
987
+ panel.add(fill2);
988
+ panel.add(fill3);
713989
714990 }
715991
716992 void EditObject(Object3D obj)
717993 {
718994 cRadio radioButton = new cRadio(obj.name);
995
+
996
+ // June 2019. Patch to avoid bug with transparency.
997
+ radioButton.hadMaterial = obj.material != null;
998
+ if (!radioButton.hadMaterial)
999
+ {
1000
+ obj.material = new cMaterial();
1001
+ }
1002
+
7191003 radioButton.SetObject(obj);
7201004 radioButton.layout = sevenButton;
7211005 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -724,8 +1008,11 @@
7241008 buttonGroup.add(radioButton);
7251009 radioButton.doClick();
7261010 }
1011
+
7271012 void SetupViews(ObjEditor oe)
7281013 {
1014
+ theFrame = this;
1015
+
7291016 oe.SetupViews();
7301017
7311018 System.out.println("SetupViews");
....@@ -734,23 +1021,28 @@
7341021 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7351022 }
7361023
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;
1024
+ cToggleButton liveCB;
1025
+ cCheckBox supportCB;
1026
+ cCheckBox localCB;
1027
+ cCheckBox crowdCB;
1028
+ cCheckBox smoothCB;
1029
+ cToggleButton fastCB;
1030
+ cCheckBox slowCB;
1031
+ cCheckBox boxCB;
1032
+ cCheckBox zoomBoxCB;
1033
+ cCheckBox freezeCB;
1034
+ //cToggleButton trackCB;
1035
+ cCheckBox trackCB;
1036
+ cCheckBox smoothfocusCB;
7481037 // JCheckBox speakerMocapCB;
749
- JCheckBox speakerCameraCB;
750
- JCheckBox speakerFocusCB;
751
- JCheckBox debugCB;
752
- JCheckBox oeilCB;
753
- JCheckBox lookAtCB;
1038
+ cCheckBox speakerCameraCB;
1039
+ cCheckBox speakerFocusCB;
1040
+ cCheckBox debugCB;
1041
+
1042
+ cCheckBox oeilCB;
1043
+ cCheckBox shadowCB;
1044
+ cCheckBox autokeepCB;
1045
+ cCheckBox lookAtCB;
7541046
7551047 // static int COLOR = 1;
7561048 // static int MATERIAL = 2;
....@@ -758,9 +1050,9 @@
7581050
7591051 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7601052
761
- JCheckBox colorCB;
762
- JCheckBox materialCB;
763
- JCheckBox textureCB;
1053
+ cCheckBox colorCB;
1054
+ cCheckBox materialCB;
1055
+ cCheckBox textureCB;
7641056
7651057 public void itemStateChanged(ItemEvent e)
7661058 {
....@@ -788,6 +1080,7 @@
7881080 } else if(e.getSource() == liveCB)
7891081 {
7901082 cameraView.ToggleLive();
1083
+ refreshContents(false);
7911084 }
7921085 else if(e.getSource() == supportCB)
7931086 {
....@@ -852,6 +1145,18 @@
8521145 {
8531146 cameraView.ToggleOeil();
8541147 }
1148
+ else if(e.getSource() == shadowCB)
1149
+ {
1150
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1151
+ }
1152
+ else if(e.getSource() == freezeCB)
1153
+ {
1154
+ Globals.FREEZEONMOVE ^= true;
1155
+ }
1156
+ else if(e.getSource() == autokeepCB)
1157
+ {
1158
+ Globals.REPLACEONMAKE ^= true;
1159
+ }
8551160 else if(e.getSource() == lookAtCB)
8561161 {
8571162 cameraView.ToggleLookAt();
....@@ -868,7 +1173,8 @@
8681173
8691174 /**/
8701175 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
871
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1176
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1177
+ TreePath path = objEditor.jTree.getSelectionPath();
8721178 if ((path == null) || (path.getPathCount() <= 1)) {
8731179 // We can't move the root node or an empty selection
8741180 return;
....@@ -931,8 +1237,6 @@
9311237 }
9321238 }
9331239
934
- String string = (String) object;
935
-
9361240 System.out.println("Transfer = " + object + "; drop : " + target);
9371241 // if( object instanceof java.io.File[])
9381242 // {
....@@ -940,6 +1244,8 @@
9401244 // objEditor.DropFile((java.io.File[]) object, true);
9411245 // return;
9421246 // }
1247
+
1248
+ String string = object.toString();
9431249
9441250 // File path for Mac and Windows
9451251 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -969,7 +1275,7 @@
9691275
9701276 flashIt = false;
9711277 CameraPane pane = (CameraPane) target;
972
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1278
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9731279 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9741280
9751281 if (group.selection.size() == 1)
....@@ -985,23 +1291,33 @@
9851291
9861292 assert target == objEditor.jTree;
9871293 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1294
+ Object3D destinationLeaf;
9881295 try {
989
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1296
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9901297 } catch (Exception e) {
9911298 System.out.println("destinationPath : " + destinationPath);
9921299 return;
9931300 }
9941301
995
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1302
+ for (int i=group.selection.size(); --i>=0;)
9961303 {
1304
+ Object3D child = (Object3D)group.selection.elementAt(i);
1305
+
1306
+ // Cannot move into itself
1307
+ if (child == destinationLeaf)
1308
+ return;
1309
+ }
1310
+
1311
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1312
+// {
9971313 loadClipboard(true);
9981314 objEditor.jTree.setSelectionPath(destinationPath);
9991315 pasteInto(false, false);
1000
- } else {
1001
- loadClipboard(false);
1002
- objEditor.jTree.setSelectionPath(destinationPath);
1003
- pasteInto(false, false); // true); // ???
1004
- }
1316
+// } else {
1317
+// loadClipboard(false);
1318
+// objEditor.jTree.setSelectionPath(destinationPath);
1319
+// pasteInto(false, false); // true); // ???
1320
+// }
10051321 }
10061322 public void dropActionChanged(DropTargetDragEvent dtde)
10071323 // Called if the user has modified the current drop gesture
....@@ -1106,22 +1422,30 @@
11061422 {
11071423 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11081424 //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);
1425
+// gridItem = menu.add(new MenuItem("Grid"));
1426
+// gridItem.addActionListener(this);
1427
+// rectoidItem = menu.add(new MenuItem("Box"));
1428
+// rectoidItem.addActionListener(this);
1429
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1430
+// ellipsoidItem.addActionListener(this);
1431
+// coneItem = menu.add(new MenuItem("Cone"));
1432
+// coneItem.addActionListener(this);
1433
+// torusItem = menu.add(new MenuItem("Torus"));
1434
+// torusItem.addActionListener(this);
1435
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1436
+// superItem.addActionListener(this);
1437
+
1438
+ cameraItem = menu.add(new MenuItem("Camera"));
1439
+ cameraItem.addActionListener(this);
1440
+
1441
+ if (!Globals.ADVANCED)
1442
+ {
11211443 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11221444 kleinItem.addActionListener(this);
1123
- particleItem = menu.add(new MenuItem("Particle system"));
1124
- particleItem.addActionListener(this);
1445
+ }
1446
+
1447
+// particleItem = menu.add(new MenuItem("Particle system"));
1448
+// particleItem.addActionListener(this);
11251449 if (Globals.ADVANCED)
11261450 {
11271451 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1147,15 +1471,15 @@
11471471 }
11481472 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11491473 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);
1474
+// overlayItem = menu.add(new MenuItem("Overlay"));
1475
+// overlayItem.addActionListener(this);
1476
+// lightItem = menu.add(new MenuItem("Light"));
1477
+// lightItem.addActionListener(this);
11541478 menu.add("-");
11551479 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11561480 //superLoopItem.addActionListener(this);
1157
- loopItem = menu.add(new MenuItem("Loop"));
1158
- loopItem.addActionListener(this);
1481
+// loopItem = menu.add(new MenuItem("Loop"));
1482
+// loopItem.addActionListener(this);
11591483 doubleItem = menu.add(new MenuItem("Fork"));
11601484 doubleItem.addActionListener(this);
11611485 if (Globals.ADVANCED)
....@@ -1171,6 +1495,9 @@
11711495 animationItem.addItemListener(this);
11721496 animationItem.setState(Globals.ANIMATION);
11731497
1498
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1499
+ archiveItem.addActionListener(this);
1500
+
11741501 menu.add("-");
11751502 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11761503 parseverticesItem.addActionListener(this);
....@@ -1183,6 +1510,8 @@
11831510 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11841511 reduce34MorphItem.addActionListener(this);
11851512 menu.add("-");
1513
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1514
+ memoryItem.addActionListener(this);
11861515 menu.add(computeAOItem = new MenuItem("Compute AO"));
11871516 computeAOItem.addActionListener(this);
11881517
....@@ -1191,11 +1520,9 @@
11911520 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11921521 mirrorItem.addActionListener(this);
11931522 menu.add("-");
1194
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1195
- memoryItem.addActionListener(this);
11961523 menu.add(analyzeItem = new MenuItem("Analyze"));
11971524 analyzeItem.addActionListener(this);
1198
- menu.add(dumpItem = new MenuItem("Dump"));
1525
+ menu.add(dumpItem = new MenuItem("Print"));
11991526 dumpItem.addActionListener(this);
12001527 // menu.add(pathItem = new MenuItem("From-to path"));
12011528 // pathItem.addActionListener(this);
....@@ -1336,9 +1663,24 @@
13361663 shadow.material = new cMaterial(obj.material);
13371664 shadow.material.diffuse = 0.0001f;
13381665 shadow.material.specular = 0.0001f;
1666
+ //shadow.projectedVertices[1].x = 300;
13391667
13401668 makeSomething(shadow);
13411669 }
1670
+
1671
+ private void ClearUnpinned()
1672
+ {
1673
+ //for (Object3D obj : listUI)
1674
+ for (int i=listUI.size(); --i>=0;)
1675
+ {
1676
+ Object3D obj = listUI.elementAt(i);
1677
+ if (!obj.pinned)
1678
+ {
1679
+ obj.CloseUI();
1680
+ listUI.remove(i);
1681
+ }
1682
+ }
1683
+ }
13421684
13431685 /**
13441686 * applyExample
....@@ -1542,9 +1884,9 @@
15421884
15431885 void Overwrite(int mask)
15441886 {
1545
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1887
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15461888 {
1547
- Object3D content = GrafreeD.clipboard.get(0);
1889
+ Object3D content = Grafreed.clipboard.get(0);
15481890
15491891 if (content instanceof cGroup && ((cGroup)content).transientlink )
15501892 content = ((cGroup)content).get(0);
....@@ -1583,7 +1925,7 @@
15831925 {
15841926 ScreenFit();
15851927 } else
1586
- if (source == switchItem)
1928
+ if (source == switchViewItem)
15871929 {
15881930 cVector v1 = new cVector();
15891931 cVector v2 = new cVector();
....@@ -1592,11 +1934,11 @@
15921934 objEditor.cameraView.renderCamera.setAim(v2, v1);
15931935 objEditor.cameraView.repaint();
15941936 } else
1595
- if (source == rectoidItem)
1937
+ if (source == rectoidItem || source == boxButton)
15961938 {
15971939 makeSomething(new Box());
15981940 } else
1599
- if (source == particleItem)
1941
+ if (source == particleItem || source == particlesButton)
16001942 {
16011943 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16021944 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1675,27 +2017,27 @@
16752017
16762018 makeSomething(obj);
16772019 } else
1678
- if (source == gridItem)
2020
+ if (source == gridItem || source == gridButton)
16792021 {
16802022 makeSomething(new Grid());
16812023 } else
1682
- if (source == ellipsoidItem)
2024
+ if (source == ellipsoidItem || source == sphereButton)
16832025 {
16842026 makeSomething(new Sphere());
16852027 } else
1686
- if (source == coneItem)
2028
+ if (source == coneItem || source == coneButton)
16872029 {
16882030 makeSomething(new Cone());
16892031 } else
1690
- if (source == torusItem)
2032
+ if (source == torusItem || source == torusButton)
16912033 {
16922034 makeSomething(new Torus());
16932035 } else
1694
- if (source == superItem)
2036
+ if (source == superItem || source == superButton)
16952037 {
16962038 makeSomething(new Superellipsoid());
16972039 } else
1698
- if (source == kleinItem)
2040
+ if (source == kleinItem || source == kleinButton)
16992041 {
17002042 makeSomething(new Klein());
17012043 } else
....@@ -1715,7 +2057,7 @@
17152057 {
17162058 makeSomething(new BezierSurface());
17172059 } else
1718
- if (source == overlayItem)
2060
+ if (source == overlayItem || source == overlayButton)
17192061 {
17202062 /*
17212063 Object3D obj = new BezierSurface(5,8);
....@@ -1763,7 +2105,7 @@
17632105 s.setup();
17642106 makeSomething(s);
17652107 } else
1766
- if (source == lightItem)
2108
+ if (source == lightItem || source == lightButton)
17672109 {
17682110 makeSomething(new Light());
17692111 } else
....@@ -1813,30 +2155,30 @@
18132155
18142156 group(g);
18152157 } else
1816
- if (source == loopItem)
2158
+ if (source == loopItem || source == loopButton)
18172159 {
18182160 Composite csg = new GroupLeaf();
18192161 csg.count = 5;
18202162 group(csg);
1821
- Composite child = new cGroup();
2163
+ Composite child = new cGroup("Branch");
18222164 csg.addChild(child);
18232165 child.addChild(csg);
18242166 } else
18252167 if (source == doubleItem)
18262168 {
1827
- Composite csg = new GroupLeaf();
2169
+ Composite csg = new GroupLeaf("Fork");
18282170 csg.count = 5;
18292171 group(csg);
1830
- Composite child = new cGroup();
2172
+ Composite child = new cGroup("Branch A");
18312173 csg.addChild(child);
18322174 child.addChild(csg);
1833
- child = new cGroup();
2175
+ child = new cGroup("Branch B");
18342176 csg.addChild(child);
18352177 child.addChild(csg);
18362178 } else
18372179 if (source == tripleItem)
18382180 {
1839
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Trident");
18402182 csg.count = 4;
18412183 group(csg);
18422184 Composite child = new cGroup();
....@@ -1848,31 +2190,6 @@
18482190 child = new cGroup();
18492191 csg.addChild(child);
18502192 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
- }
18762193 } else
18772194 if (source == computeAOItem)
18782195 {
....@@ -1892,7 +2209,7 @@
18922209 if (source == invariantsItem)
18932210 {
18942211 System.out.println("Invariants:");
1895
- GrafreeD.grafreeD.universe.invariants();
2212
+ Grafreed.grafreeD.universe.invariants();
18962213 } else
18972214 if (source == memoryItem)
18982215 {
....@@ -1911,6 +2228,46 @@
19112228 {
19122229 DumpObject();
19132230 } else
2231
+ if (source == minButton)
2232
+ {
2233
+ Minimize();
2234
+ } else
2235
+ if (source == maxButton)
2236
+ {
2237
+ Maximize();
2238
+ } else
2239
+ if (source == fullButton)
2240
+ {
2241
+ ToggleFullScreen();
2242
+ } else
2243
+ if (source == undoButton)
2244
+ {
2245
+ // Go to previous version
2246
+ //if (!Undo())
2247
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2248
+ Undo();
2249
+ } else
2250
+ if (source == restoreButton)
2251
+ {
2252
+ // Restore current version
2253
+ Restore();
2254
+ } else
2255
+ if (source == replaceButton)
2256
+ {
2257
+ // Overwrite current version
2258
+ Replace();
2259
+ } else
2260
+ if (source == redoButton)
2261
+ {
2262
+ // Go to next version
2263
+ Redo();
2264
+ } else
2265
+ if (source == saveButton)
2266
+ {
2267
+ // Save a new version
2268
+ if (!Save(true))
2269
+ java.awt.Toolkit.getDefaultToolkit().beep();
2270
+ } else
19142271 if (source == oneStepButton)
19152272 {
19162273 Globals.ONESTEP = true;
....@@ -1918,17 +2275,14 @@
19182275 } else
19192276 if (source == screenfitButton)
19202277 {
1921
- //Reload(lastConverter, lastFilename, true);
19222278 ScreenFit();
19232279 } else
19242280 if (source == screenfitpointButton)
19252281 {
1926
- //Reload(lastConverter, lastFilename, true);
19272282 ScreenFitPoint();
19282283 } else
19292284 if (source == snapobjectButton)
19302285 {
1931
- //Reload(lastConverter, lastFilename, true);
19322286 SnapObject();
19332287 } else
19342288 // if (event.getSource() == recompileButton)
....@@ -1965,12 +2319,20 @@
19652319 {
19662320 loadClipboard(true);
19672321 } else
2322
+ if (source == undoItem)
2323
+ {
2324
+ Undo();
2325
+ } else
2326
+ if (source == redoItem)
2327
+ {
2328
+ Redo();
2329
+ } else
19682330 if (source == duplicateItem)
19692331 {
1970
- Object3D keep = GrafreeD.clipboard;
2332
+ Object3D keep = Grafreed.clipboard;
19712333 loadClipboard(false);
19722334 paste(false);
1973
- GrafreeD.clipboard = keep;
2335
+ Grafreed.clipboard = keep;
19742336 } else
19752337 if (source == cloneItem)
19762338 {
....@@ -2190,9 +2552,9 @@
21902552 // group.selection.get(0).setMasterThis(content); // should be identity
21912553 // refreshContents();
21922554 // }
2193
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2555
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21942556 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2557
+ Object3D content = Grafreed.clipboard.get(0);
21962558
21972559 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982560 content = ((cGroup)content).get(0);
....@@ -2242,9 +2604,9 @@
22422604 } else
22432605 if (source == setMasterItem)
22442606 {
2245
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2607
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22462608 {
2247
- Object3D content = GrafreeD.clipboard.get(0);
2609
+ Object3D content = Grafreed.clipboard.get(0);
22482610
22492611 if (content instanceof cGroup && ((cGroup)content).transientlink )
22502612 content = ((cGroup)content).get(0);
....@@ -2257,9 +2619,9 @@
22572619 {
22582620 if (group.selection.size() == 1)
22592621 {
2260
- if (GrafreeD.clipboard.size() == 1)
2622
+ if (Grafreed.clipboard.size() == 1)
22612623 {
2262
- Object3D content = GrafreeD.clipboard.get(0);
2624
+ Object3D content = Grafreed.clipboard.get(0);
22632625
22642626 if (content instanceof cGroup && ((cGroup)content).transientlink )
22652627 content = ((cGroup)content).get(0);
....@@ -2276,7 +2638,7 @@
22762638 {
22772639 RevertMeshes();
22782640 } else
2279
- if (source == resetMeshItem)
2641
+ if (source == resetAllItem)
22802642 {
22812643 ResetAll();
22822644 } else
....@@ -2296,9 +2658,9 @@
22962658 {
22972659 ClearSelection(true);
22982660 } else
2299
- if (source == grabItem)
2661
+ if (source == grabItem || source == groupButton)
23002662 {
2301
- group(new cGroup(), true);
2663
+ group(new cGroup(), false); // true);
23022664 } else
23032665 if (source == hideItem)
23042666 {
....@@ -2316,11 +2678,11 @@
23162678 {
23172679 makeSomething(new Camera());
23182680 } else
2319
- if (source == compositeItem)
2681
+ if (source == compositeItem || source == compositeButton)
23202682 {
23212683 group(new Composite());
23222684 } else
2323
- if (source == randomItem)
2685
+ if (source == switchItem || source == switchButton)
23242686 {
23252687 RandomNode random = new RandomNode();
23262688 group(random);
....@@ -2422,7 +2784,7 @@
24222784 {
24232785 group(new cLinker());
24242786 } else
2425
- if (source == textureItem)
2787
+ if (source == textureItem || source == textureButton)
24262788 {
24272789 group(new TextureNode());
24282790 } else
....@@ -2442,17 +2804,30 @@
24422804 {
24432805 CastShadow(2);
24442806 } else
2445
- if (source == ungroupItem)
2807
+ if (source == ungroupItem || source == ungroupButton)
24462808 {
2447
- //ungroup();
2809
+ boolean hasRoot = false;
2810
+
24482811 for (int i=0; i<group.selection.size(); i++)
24492812 {
2450
- Ungroup(group.selection.get(i));
2813
+ if (group.selection.get(i) == group)
2814
+ {
2815
+ hasRoot = true;
2816
+ break;
2817
+ }
24512818 }
24522819
2453
- ClearSelection(false);
2454
-
2455
- refreshContents();
2820
+ if (!hasRoot)
2821
+ {
2822
+ for (int i=0; i<group.selection.size(); i++)
2823
+ {
2824
+ Ungroup(group.selection.get(i));
2825
+ }
2826
+
2827
+ ClearSelection(false);
2828
+
2829
+ refreshContents();
2830
+ }
24562831 } else
24572832 if (source == genUVItem)
24582833 {
....@@ -2464,7 +2839,7 @@
24642839 } else
24652840 if (source == genNormalsMESHItem)
24662841 {
2467
- GenNormals(true); // TODO
2842
+ GenNormalsMESH();
24682843 } else
24692844 if (source == genNormalsORGANItem)
24702845 {
....@@ -2529,6 +2904,22 @@
25292904 if (source == unmarkleavesItem)
25302905 {
25312906 MarkLeaves(false);
2907
+ } else
2908
+ if (source == rewindleavesItem)
2909
+ {
2910
+ RewindLeaves(true);
2911
+ } else
2912
+ if (source == unrewindleavesItem)
2913
+ {
2914
+ RewindLeaves(false);
2915
+ } else
2916
+ if (source == randomleavesItem)
2917
+ {
2918
+ RandomLeaves(true);
2919
+ } else
2920
+ if (source == unrandomleavesItem)
2921
+ {
2922
+ RandomLeaves(false);
25322923 } else
25332924 if (source == flipVItem)
25342925 {
....@@ -2614,9 +3005,13 @@
26143005 {
26153006 SmoothMesh();
26163007 } else
2617
- if (source == transformgeometryItem)
3008
+ if (source == transformGeometryItem)
26183009 {
26193010 TransformGeometry();
3011
+ } else
3012
+ if (source == transformChildrenItem)
3013
+ {
3014
+ TransformChildren();
26203015 } else
26213016 if (source == resetTransformItem)
26223017 {
....@@ -2624,7 +3019,11 @@
26243019 } else
26253020 if (source == resetCentroidItem)
26263021 {
2627
- ResetCentroid();
3022
+ ResetCentroid(true);
3023
+ } else
3024
+ if (source == resetCentroidXZItem)
3025
+ {
3026
+ ResetCentroid(false);
26283027 } else
26293028 if (source == resetParentItem)
26303029 {
....@@ -2756,6 +3155,10 @@
27563155 if (source == twoButton)
27573156 {
27583157 radio.layout = twoButton;
3158
+
3159
+ if (CameraPane.FULLSCREEN)
3160
+ fullscreenLayout = radio.layout;
3161
+
27593162 // bug
27603163 //gridPanel.setDividerLocation(1.0);
27613164 //bigPanel.setDividerLocation(0.0);
....@@ -2788,10 +3191,31 @@
27883191 bigThree.ClearUI();
27893192 bigThree.add(centralPanel);
27903193 bigThree.FlushUI();
3194
+
3195
+ cameraView.requestFocusInWindow();
3196
+
3197
+// refreshContents(true);
3198
+//
3199
+// try
3200
+// {
3201
+// java.awt.Robot bot = new java.awt.Robot();
3202
+// int mask = InputEvent.BUTTON1_MASK;
3203
+// bot.mouseMove(100, 100);
3204
+// bot.mousePress(mask);
3205
+// bot.mouseRelease(mask);
3206
+// }
3207
+// catch (Exception e)
3208
+// {
3209
+//
3210
+// }
3211
+
27913212 } else
27923213 if (source == threeButton)
27933214 {
27943215 radio.layout = threeButton;
3216
+
3217
+ if (CameraPane.FULLSCREEN)
3218
+ fullscreenLayout = radio.layout;
27953219
27963220 // bigThree.remove(scenePanel);
27973221 // bigThree.remove(centralPanel);
....@@ -2824,10 +3248,15 @@
28243248 bigThree.add(centralPanel);
28253249 bigThree.add(XYZPanel);
28263250 bigThree.FlushUI();
3251
+
3252
+ cameraView.requestFocusInWindow();
28273253 } else
28283254 if (source == fourButton)
28293255 {
28303256 radio.layout = fourButton;
3257
+
3258
+ if (CameraPane.FULLSCREEN)
3259
+ fullscreenLayout = radio.layout;
28313260
28323261 // bigThree.remove(scenePanel);
28333262 // bigThree.remove(centralPanel);
....@@ -2859,10 +3288,15 @@
28593288 bigThree.ClearUI();
28603289 bigThree.add(scenePanel);
28613290 bigThree.FlushUI();
3291
+
3292
+ cameraView.requestFocusInWindow();
28623293 } else
28633294 if (source == sixButton)
28643295 {
28653296 radio.layout = sixButton;
3297
+
3298
+ if (CameraPane.FULLSCREEN)
3299
+ fullscreenLayout = radio.layout;
28663300
28673301 // bigThree.remove(scenePanel);
28683302 // bigThree.remove(centralPanel);
....@@ -2895,10 +3329,15 @@
28953329 bigThree.add(scenePanel);
28963330 bigThree.add(centralPanel);
28973331 bigThree.FlushUI();
3332
+
3333
+ cameraView.requestFocusInWindow();
28983334 } else
28993335 if (source == sevenButton)
29003336 {
29013337 radio.layout = sevenButton;
3338
+
3339
+ if (CameraPane.FULLSCREEN)
3340
+ fullscreenLayout = radio.layout;
29023341
29033342 // bigThree.remove(scenePanel);
29043343 // bigThree.remove(centralPanel);
....@@ -2932,6 +3371,8 @@
29323371 bigThree.add(centralPanel);
29333372 bigThree.add(XYZPanel);
29343373 bigThree.FlushUI();
3374
+
3375
+ cameraView.requestFocusInWindow();
29353376 } else
29363377 if (source == rootButton)
29373378 {
....@@ -2943,6 +3384,7 @@
29433384 EditObject(obj);
29443385 }
29453386
3387
+ cameraView.requestFocusInWindow();
29463388 refreshContents(true);
29473389 } else
29483390 if (source == closeButton)
....@@ -2952,22 +3394,37 @@
29523394 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29533395 {
29543396 ab = (cRadio)e.nextElement();
2955
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3397
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29563398 {
3399
+ // Patch to avoid bug with transparency.
3400
+ if (!ab.hadMaterial)
3401
+ {
3402
+ ab.object.material = null;
3403
+ }
3404
+
29573405 buttonGroup.remove(ab);
29583406 radioPanel.remove(ab);
29593407
2960
- ab.GetObject().editWindow = null;
3408
+ //ab.GetObject().editWindow = null;
3409
+ ab.GetObject().manipWindow = null;
29613410 // ab.GetObject().objectUI = null; // ?????????
29623411
29633412 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29643413 break;
29653414 }
29663415 }
3416
+
3417
+ cameraView.requestFocusInWindow();
29673418 refreshContents(true);
29683419 } else
29693420 if (source == editItem || source == editButton)
29703421 {
3422
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3423
+ {
3424
+ Object3D child = (Object3D)e.nextElement();
3425
+ child.pinned = true;
3426
+ }
3427
+
29713428 EditSelection(false);
29723429 } else
29733430 if (source == uneditButton)
....@@ -2977,10 +3434,11 @@
29773434 Object3D child = (Object3D)e.nextElement();
29783435 if(child.editWindow != null)
29793436 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3437
+ child.pinned = false;
29803438 child.CloseUI();
29813439 listUI.remove(child);
29823440
2983
- child.editWindow = null; // ???????????
3441
+ //child.editWindow = null; // ???????????
29843442 }
29853443 objEditor.ctrlPanel.FlushUI();
29863444 //objEditor.jTree.clearSelection();
....@@ -2993,6 +3451,7 @@
29933451 //copy.ClearUI();
29943452 for (Object3D obj : listUI)
29953453 {
3454
+ obj.pinned = false;
29963455 obj.CloseUI();
29973456 }
29983457 listUI.clear();
....@@ -3002,7 +3461,7 @@
30023461 {
30033462 assert(copy == group);
30043463
3005
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3464
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30063465
30073466 for (Object3D obj : listUI)
30083467 {
....@@ -3051,6 +3510,9 @@
30513510 }
30523511
30533512 copy = group;
3513
+
3514
+ SetUndoStates();
3515
+
30543516 //Globals.theRenderer.object = group;
30553517 if(!useclient)
30563518 {
....@@ -3066,20 +3528,44 @@
30663528 frontView.object = group;
30673529 sideView.object = group;
30683530 }
3069
- group.editWindow = this;
3531
+
3532
+// fix "+" issue
3533
+ //group.editWindow = this;
3534
+ group.manipWindow = this;
3535
+
30703536 /*
30713537 currentLayout = radio.layout;
30723538 if (currentLayout == null)
30733539 currentLayout = sevenButton;
30743540 */
30753541 radio.layout.doClick();
3542
+
3543
+ ClearUnpinned();
3544
+ SetPinStates(group.selection.size() > 0);
3545
+ if (group.selection.size() == 1)
3546
+ EditSelection(false);
30763547 keepparent = group.parent;
30773548 // PARENT = NULL or not???
30783549 //group.parent = null; // ROOT
30793550 //group.attributes = -1;
30803551 ResetModel();
3552
+
3553
+ cameraView.requestFocusInWindow();
30813554 refreshContents(true);
3082
- }
3555
+ } else if (event.getSource() == editCameraItem)
3556
+ {
3557
+ cameraView.ProtectCamera();
3558
+ cameraView.repaint();
3559
+ return;
3560
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3561
+ {
3562
+ cameraView.RevertCamera();
3563
+ cameraView.repaint();
3564
+ return;
3565
+ // } else if (event.getSource() == textureButton)
3566
+ // {
3567
+ // return; // true;
3568
+ }
30833569 else
30843570 {
30853571 //return super.action(event, arg);
....@@ -3088,7 +3574,6 @@
30883574 }
30893575
30903576 boolean useclient = false;
3091
- cRadio radio;
30923577
30933578 void ToggleRoot()
30943579 {
....@@ -3140,6 +3625,28 @@
31403625 refreshContents();
31413626 }
31423627
3628
+ void TransformChildren()
3629
+ {
3630
+ Object3D obj;
3631
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3632
+ {
3633
+ obj = (Object3D)e.nextElement();
3634
+ obj.KeepTextureMatrices();
3635
+ obj.TransformChildren();
3636
+ obj.RestoreTextureMatrices();
3637
+
3638
+// if (obj.parent == null)
3639
+// {
3640
+// System.out.println("NULL PARENT!");
3641
+// new Exception().printStackTrace();
3642
+// }
3643
+// else
3644
+// TouchTransform(obj);
3645
+// //obj.parent.Touch();
3646
+ }
3647
+
3648
+ refreshContents();
3649
+ }
31433650
31443651 void ResetTransform()
31453652 {
....@@ -3252,7 +3759,7 @@
32523759 refreshContents();
32533760 }
32543761
3255
- void ResetCentroid()
3762
+ void ResetCentroid(boolean full)
32563763 {
32573764 Object3D obj;
32583765 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3267,12 +3774,16 @@
32673774 LA.matIdentity(Object3D.mat);
32683775 obj.getBounds(minima, maxima, false);
32693776 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3270
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3777
+ if (full)
3778
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32713779 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32723780 obj.TransformMesh(Object3D.mat);
3781
+
32733782 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3274
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3783
+ if (full)
3784
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32753785 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3786
+
32763787 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32773788 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32783789 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3301,7 +3812,8 @@
33013812
33023813 int size = obj.MemorySize();
33033814
3304
- System.err.println((size/1024) + " KB is the size of " + obj);
3815
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3816
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33053817 }
33063818 }
33073819 catch (Exception e)
....@@ -3338,9 +3850,9 @@
33383850 obj = (Object3D)e.nextElement();
33393851
33403852 System.out.println("Object is: " + obj);
3341
- GrafreeD.AnalyzeObject(obj);
3853
+ Grafreed.AnalyzeObject(obj);
33423854 System.out.println("Boundary rep: " + obj.bRep);
3343
- GrafreeD.AnalyzeObject(obj.bRep);
3855
+ Grafreed.AnalyzeObject(obj.bRep);
33443856
33453857 // System.err.println((size/1024) + " KB is the size of " + obj);
33463858 }
....@@ -3382,6 +3894,13 @@
33823894 void GenNormals(boolean crease)
33833895 {
33843896 group.GenNormalsS(crease);
3897
+
3898
+ refreshContents();
3899
+ }
3900
+
3901
+ void GenNormalsMESH()
3902
+ {
3903
+ group.GenNormalsMeshS();
33853904
33863905 refreshContents();
33873906 }
....@@ -3554,8 +4073,8 @@
35544073
35554074 void ParseVertices()
35564075 {
3557
- boolean epsequal = GrafreeD.epsequal;
3558
- GrafreeD.epsequal = true;
4076
+ boolean epsequal = Grafreed.epsequal;
4077
+ Grafreed.epsequal = true;
35594078
35604079 for (int i=0; i<group.selection.size(); i++)
35614080 {
....@@ -3580,7 +4099,7 @@
35804099 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35814100 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35824101
3583
- g.add(GrafreeD.clipboard);
4102
+ g.add(Grafreed.clipboard);
35844103
35854104 buffer.add(g);
35864105 }
....@@ -3595,7 +4114,7 @@
35954114 makeSomething(buffer, i==group.selection.size()-1);
35964115 }
35974116
3598
- GrafreeD.epsequal = epsequal;
4117
+ Grafreed.epsequal = epsequal;
35994118
36004119 refreshContents();
36014120 }
....@@ -3613,7 +4132,16 @@
36134132 String pigment = Object3D.GetPigment(tex);
36144133 //String bump = Object3D.GetBump(tex);
36154134
3616
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4135
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4136
+
4137
+ try
4138
+ {
4139
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4140
+ }
4141
+ catch (Exception e)
4142
+ {
4143
+ System.err.println("FAIL: " + node);
4144
+ }
36174145
36184146 double s = v.s;
36194147
....@@ -3745,7 +4273,7 @@
37454273 return;
37464274
37474275 Object3D poses = group.selection.get(0);
3748
- Object3D ref = GrafreeD.clipboard.get(0);
4276
+ Object3D ref = Grafreed.clipboard.get(0);
37494277
37504278 Object3D newgroup = new Object3D("Po:" + poses.name);
37514279
....@@ -3939,9 +4467,9 @@
39394467
39404468 void ClipMesh()
39414469 {
3942
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4470
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39434471 {
3944
- Object3D content = GrafreeD.clipboard.get(0);
4472
+ Object3D content = Grafreed.clipboard.get(0);
39454473
39464474 if (content instanceof cGroup && ((cGroup)content).transientlink )
39474475 content = ((cGroup)content).get(0);
....@@ -3950,7 +4478,7 @@
39504478 // {
39514479 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39524480 // }
3953
- group.selection.ClipMesh(GrafreeD.clipboard);
4481
+ group.selection.ClipMesh(Grafreed.clipboard);
39544482 }
39554483 // group.selection.ClipMesh(GrafreeD.clipboard);
39564484 System.out.println("DONE.");
....@@ -3997,6 +4525,18 @@
39974525 void MarkLeaves(boolean hide)
39984526 {
39994527 group.selection.MarkLeaves(hide);
4528
+ refreshContents();
4529
+ }
4530
+
4531
+ void RewindLeaves(boolean hide)
4532
+ {
4533
+ group.selection.RewindLeaves(hide);
4534
+ refreshContents();
4535
+ }
4536
+
4537
+ void RandomLeaves(boolean hide)
4538
+ {
4539
+ group.selection.RandomLeaves(hide);
40004540 refreshContents();
40014541 }
40024542
....@@ -4071,10 +4611,6 @@
40714611 // }
40724612 // }
40734613
4074
- static boolean allparams = true;
4075
-
4076
- static Vector<Object3D> listUI = new Vector<Object3D>();
4077
-
40784614 void EditSelection(boolean newWindow)
40794615 {
40804616 // aConstraints.gridy = 0;
....@@ -4082,10 +4618,10 @@
40824618 {
40834619 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40844620 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4085
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4621
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40864622
40874623 Object3D elem = (Object3D)group.selection.elementAt(i);
4088
- if(elem != group)
4624
+ if(elem != group || !newWindow)
40894625 {
40904626 // if (!(elem instanceof Composite))
40914627 // newWindow = false;
....@@ -4167,7 +4703,8 @@
41674703 //new Exception().printStackTrace();
41684704
41694705 freezemodel = true;
4170
-
4706
+ ClearUnpinned();
4707
+
41714708 /**/
41724709 //switch (event.id)
41734710 {
....@@ -4175,7 +4712,6 @@
41754712 //case 702: // Event.LIST_DESELECT
41764713 group.deselectAll();
41774714 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4178
- objEditor.ClearInfo(); // .GetMaterial());
41794715 if (tps != null)
41804716 {
41814717 for (int i=0; i < tps.length; i++)
....@@ -4184,10 +4720,8 @@
41844720
41854721 //if (child.parent != null)
41864722 //child.parent.addSelectee(child);
4723
+ objEditor.SetMaterial(child);
41874724 group.addSelectee(child);
4188
- objEditor.SetMaterial(child); // .GetMaterial());
4189
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4190
- System.err.println("info : " + child.GetPath());
41914725 }
41924726 }
41934727 // else
....@@ -4197,20 +4731,28 @@
41974731 // System.err.println("info : " + group.GetPath());
41984732 // }
41994733
4200
- objEditor.SetText(); // jan 2014
4201
-
4202
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4734
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
42034735 CameraPane.flash = true;
42044736
4205
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4737
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42064738 // a camera
42074739 {
4208
- CameraPane.camerachangeframe = 0; // don't refuse it
4209
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4740
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4741
+ {
4742
+ CameraPane.camerachangeframe = 0; // don't refuse it
4743
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4744
+ }
42104745 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42114746 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42124747 }
42134748
4749
+ if (tps != null && tps.length == 1)
4750
+ {
4751
+ EditSelection(false);
4752
+ }
4753
+
4754
+ SetPinStates(tps != null && tps.length > 0);
4755
+
42144756 refreshContents();
42154757 //return true;
42164758 }
....@@ -4219,6 +4761,35 @@
42194761
42204762 freezemodel = false;
42214763 }
4764
+
4765
+ void SetPinStates(boolean enabled)
4766
+ {
4767
+ editButton.setEnabled(enabled);
4768
+ uneditButton.setEnabled(enabled);
4769
+ unselectButton.setEnabled(enabled);
4770
+ flashSelectionButton.setEnabled(enabled);
4771
+ }
4772
+
4773
+ void refreshContents(boolean cp)
4774
+ {
4775
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4776
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4777
+ {
4778
+ objEditor.ClearInfo(); // .GetMaterial());
4779
+
4780
+ for (int i=0; i < group.selection.Size(); i++)
4781
+ {
4782
+ Object3D child = (Object3D) group.selection.get(i);
4783
+
4784
+ objEditor.AddInfo(child, this, true);
4785
+ System.err.println("info : " + child.GetPath());
4786
+ }
4787
+
4788
+ objEditor.SetText(); // jan 2014
4789
+ }
4790
+
4791
+ super.refreshContents(cp);
4792
+ }
42224793
42234794 void linkSomething(Object3D thing)
42244795 {
....@@ -4290,16 +4861,19 @@
42904861 {
42914862 if (group.selection.isEmpty())
42924863 return;
4293
- GrafreeD.clipboardIsTempGroup = false;
4864
+
4865
+ Grafreed.clipboardIsTempGroup = false;
42944866 Composite tGroup = null;
42954867 if (group.selection.size() > 0) // 1)
42964868 {
42974869 tGroup = new cGroup();
4298
- GrafreeD.clipboardIsTempGroup = true;
4870
+ Grafreed.clipboardIsTempGroup = true;
42994871 }
43004872
43014873 if (cut)
43024874 {
4875
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4876
+// Save();
43034877 //int indices[] = jList.getSelectedIndices();
43044878 //for (int i = indices.length - 1; i >= 0; i--)
43054879 //jList.remove(indices[i]);
....@@ -4335,16 +4909,16 @@
43354909 //System.out.println("cut " + child);
43364910 //System.out.println("parent = " + child.parent);
43374911 // tmp.addChild(child);
4338
- if (GrafreeD.clipboardIsTempGroup)
4912
+ if (Grafreed.clipboardIsTempGroup)
43394913 tGroup.add/*Child*/(tmp);
43404914 else
4341
- GrafreeD.clipboard = tmp;
4915
+ Grafreed.clipboard = tmp;
43424916 }
43434917 else
4344
- if (GrafreeD.clipboardIsTempGroup)
4918
+ if (Grafreed.clipboardIsTempGroup)
43454919 tGroup.add/*Child*/(child);
43464920 else
4347
- GrafreeD.clipboard = child;
4921
+ Grafreed.clipboard = child;
43484922 }
43494923
43504924 //ResetModel();
....@@ -4376,21 +4950,23 @@
43764950 //System.out.println("cut " + elem);
43774951 //System.out.println("parent = " + elem.parent);
43784952 // tmp.addChild(elem);
4379
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
43804954 tGroup.add/*Child*/(tmp);
43814955 else
4382
- GrafreeD.clipboard = tmp;
4956
+ Grafreed.clipboard = tmp;
43834957 }
43844958 else
4385
- if (GrafreeD.clipboardIsTempGroup)
4959
+ if (Grafreed.clipboardIsTempGroup)
43864960 tGroup.add/*Child*/(child);
43874961 else
4388
- GrafreeD.clipboard = child;
4962
+ Grafreed.clipboard = child;
43894963 }
43904964
43914965 }
4392
- if (GrafreeD.clipboardIsTempGroup)
4393
- GrafreeD.clipboard = tGroup;
4966
+
4967
+ if (Grafreed.clipboardIsTempGroup)
4968
+ Grafreed.clipboard = tGroup;
4969
+
43944970 if (cut)
43954971 {
43964972 ResetModel();
....@@ -4400,11 +4976,15 @@
44004976
44014977 void paste(boolean expand)
44024978 {
4979
+ if (Globals.REPLACEONMAKE)
4980
+ Save();
4981
+ boolean keep = Globals.REPLACEONMAKE;
4982
+ Globals.REPLACEONMAKE = false;
44034983 // if (GrafreeD.clipboard == null)
44044984 // return;
44054985 boolean first = true;
44064986
4407
- if (GrafreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
44084988 {
44094989 Composite temp;
44104990
....@@ -4415,7 +4995,7 @@
44154995 temp = (Composite)Applet3D.clipboard.deepCopy();
44164996 */
44174997 Object3D elem;
4418
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4998
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44194999 {
44205000 Object3D child = (Object3D)e.nextElement();
44215001
....@@ -4449,16 +5029,17 @@
44495029 //Object3D cb = Applet3D.clipboard;
44505030 //temp.addChild(cb);
44515031 //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());
5032
+ assert(Grafreed.clipboard.parent == null);
5033
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5034
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5035
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5036
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44575037 else
4458
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4459
- GrafreeD.clipboard.get(0).parent = keepparent;
5038
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5039
+ Grafreed.clipboard.get(0).parent = keepparent;
44605040 }
44615041
5042
+ Globals.REPLACEONMAKE = keep;
44625043 ResetModel();
44635044 refreshContents();
44645045 }
....@@ -4505,9 +5086,9 @@
45055086 {
45065087 boolean first = true;
45075088
4508
- if (GrafreeD.clipboardIsTempGroup)
5089
+ if (Grafreed.clipboardIsTempGroup)
45095090 {
4510
- Composite temp = (Composite)GrafreeD.clipboard;
5091
+ Composite temp = (Composite)Grafreed.clipboard;
45115092 Object3D copy;
45125093 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45135094 {
....@@ -4517,7 +5098,7 @@
45175098 }
45185099 } else
45195100 {
4520
- linkSomething(GrafreeD.clipboard); //.get(0));
5101
+ linkSomething(Grafreed.clipboard); //.get(0));
45215102 }
45225103 }
45235104 }
....@@ -4594,6 +5175,10 @@
45945175
45955176 void group(Object3D csg, boolean grab)
45965177 {
5178
+ if (Globals.REPLACEONMAKE)
5179
+ Save();
5180
+ boolean keep = Globals.REPLACEONMAKE;
5181
+ Globals.REPLACEONMAKE = false;
45975182 if (//false) // why??
45985183 !group.selection.isEmpty())
45995184 {
....@@ -4707,10 +5292,15 @@
47075292 //node.add(csg);
47085293 //makeSomething(node);
47095294 makeSomething(csg);
5295
+ Globals.REPLACEONMAKE = keep;
47105296 }
47115297
47125298 void Ungroup(Object3D g)
47135299 {
5300
+ if (Globals.REPLACEONMAKE)
5301
+ Save();
5302
+ boolean keep = Globals.REPLACEONMAKE;
5303
+ Globals.REPLACEONMAKE = false;
47145304 if (g instanceof HiddenObject)
47155305 {
47165306 HiddenObject h = (HiddenObject) g;
....@@ -4727,6 +5317,7 @@
47275317 objEditor.makeSomething(g.get(i), false);
47285318 }
47295319 }
5320
+ Globals.REPLACEONMAKE = keep;
47305321 }
47315322
47325323 void ungroup()
....@@ -4922,21 +5513,6 @@
49225513 }
49235514 */
49245515
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
-
49405516 /*
49415517 public void Callback(Object obj)
49425518 {
....@@ -4960,26 +5536,9 @@
49605536 }
49615537 */
49625538
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
-
49805539 String GetFile(String dialogName)
49815540 {
4982
- if (GrafreeD.standAlone)
5541
+ if (Grafreed.standAlone)
49835542 {
49845543 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49855544 browser.show();
....@@ -5047,7 +5606,28 @@
50475606 cButton clearpanelButton;
50485607 cButton unselectButton;
50495608
5609
+ cButton restoreCameraButton;
5610
+
5611
+ cButton saveButton;
50505612 cButton oneStepButton;
5613
+
5614
+ cButton groupButton;
5615
+ cButton ungroupButton;
5616
+ cButton compositeButton;
5617
+ cButton switchButton;
5618
+ cButton loopButton;
5619
+ cButton textureButton;
5620
+
5621
+ cButton gridButton;
5622
+ cButton boxButton;
5623
+ cButton sphereButton;
5624
+ cButton coneButton;
5625
+ cButton torusButton;
5626
+ cButton superButton;
5627
+ cButton kleinButton;
5628
+ cButton particlesButton;
5629
+ cButton overlayButton;
5630
+ cButton lightButton;
50515631
50525632 cButton screenfitButton;
50535633 cButton screenfitpointButton;
....@@ -5060,14 +5640,6 @@
50605640
50615641 cButton setsupportButton;
50625642
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
-
50715643 //
50725644 //Composite
50735645 Object3D // to do !!
....@@ -5077,9 +5649,11 @@
50775649 //JTree jTree;
50785650 private MenuItem lookAtItem;
50795651 private MenuItem lookFromItem;
5080
- private MenuItem switchItem;
5652
+ private MenuItem switchViewItem;
50815653 private MenuItem cutItem;
5082
- private MenuItem duplicateItem;
5654
+ private MenuItem undoItem;
5655
+ private MenuItem redoItem;
5656
+ private JMenuItem duplicateItem;
50835657 private MenuItem cloneItem;
50845658 private MenuItem cloneSupportItem;
50855659 private MenuItem overwriteGeoItem;
....@@ -5092,7 +5666,7 @@
50925666 private MenuItem linkverticesItem;
50935667 private MenuItem relinkverticesItem;
50945668 private MenuItem setMasterItem;
5095
- private MenuItem resetMeshItem;
5669
+ private MenuItem resetAllItem;
50965670 private MenuItem stepAllItem;
50975671 private MenuItem revertMeshItem;
50985672 private MenuItem poseMeshItem;
....@@ -5142,6 +5716,10 @@
51425716 private MenuItem showleavesItem;
51435717 private MenuItem markleavesItem;
51445718 private MenuItem unmarkleavesItem;
5719
+ private MenuItem rewindleavesItem;
5720
+ private MenuItem unrewindleavesItem;
5721
+ private MenuItem randomleavesItem;
5722
+ private MenuItem unrandomleavesItem;
51455723
51465724 private MenuItem flipVItem;
51475725 private MenuItem unflipVItem;
....@@ -5153,15 +5731,17 @@
51535731 private MenuItem panoTexturesItem;
51545732
51555733 private MenuItem resetCentroidItem;
5156
- private MenuItem transformgeometryItem;
5734
+ private MenuItem resetCentroidXZItem;
51575735 private MenuItem resetTransformItem;
5736
+ private MenuItem transformGeometryItem;
5737
+ private MenuItem transformChildrenItem;
51585738 private MenuItem hideItem;
51595739 private MenuItem grabItem;
51605740 private MenuItem backItem;
51615741 private MenuItem frontItem;
51625742 private MenuItem cameraItem;
51635743 private MenuItem compositeItem;
5164
- private MenuItem randomItem;
5744
+ private MenuItem switchItem;
51655745 private MenuItem physicsItem;
51665746 private MenuItem frameselectorItem;
51675747 private MenuItem scriptNodeItem;
....@@ -5223,11 +5803,6 @@
52235803 private MenuItem doubleItem;
52245804 private MenuItem tripleItem;
52255805
5226
- private MenuItem importGFDItem;
5227
- private MenuItem importVRMLX3DItem;
5228
- private MenuItem import3DSItem;
5229
- private MenuItem importOBJItem;
5230
-
52315806 private MenuItem computeAOItem;
52325807 private MenuItem recompileItem;
52335808 private MenuItem editScriptItem;
....@@ -5237,4 +5812,8 @@
52375812 private MenuItem analyzeItem;
52385813 private MenuItem dumpItem;
52395814 //boolean freezemodel = false;
5815
+
5816
+ Menu cameraMenu;
5817
+ MenuItem editCameraItem;
5818
+ MenuItem restoreCameraItem;
52405819 }