Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
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);
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
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));
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));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -148,40 +148,37 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
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
-
153
+ oe.jTree = new cTree();
154
+
168155 Menu menu;
169156 oe.menuBar.add(menu = new Menu("Edit"));
170157 //editItem = menu.add(new MenuItem("Edit"));
171158 //editItem.addActionListener(this);
172
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
173166 duplicateItem.addActionListener(this);
167
+ cloneItem = menu.add(new MenuItem("Clone"));
168
+ cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
171
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
172
+ cloneSupportItem.addActionListener(this);
173
+ }
174
+ menu.add("-");
174175 cutItem = menu.add(new MenuItem("Cut"));
175176 cutItem.addActionListener(this);
176177 copyItem = menu.add(new MenuItem("Copy"));
177178 copyItem.addActionListener(this);
178179 pasteItem = menu.add(new MenuItem("Paste"));
179180 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);
181
+
185182 menu.add("-");
186183 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187184 pasteIntoItem.addActionListener(this);
....@@ -201,14 +198,97 @@
201198 clearAllItem = menu.add(new MenuItem("Clear All"));
202199 clearAllItem.addActionListener(this);
203200 }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
+ revertCameraItem.addActionListener(this);
209
+
210
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+ toggleFullScreenItem.addItemListener(this);
212
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+ cameraMenu.add("-");
214
+
215
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+ toggleTextureItem.addItemListener(this);
217
+ toggleTextureItem.setState(CameraPane.textureon);
218
+
219
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+ toggleSwitchItem.addItemListener(this);
221
+ toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
204237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchItem.addActionListener(this);
287
+ }
288
+
205289 oe.menuBar.add(menu = new Menu("Setting"));
206290 if (Globals.ADVANCED)
207291 {
208
- resetMeshItem = menu.add(new MenuItem("Reset All"));
209
- resetMeshItem.addActionListener(this);
210
- stepAllItem = menu.add(new MenuItem("Step All"));
211
- stepAllItem.addActionListener(this);
212292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
213293 revertMeshItem.addActionListener(this);
214294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -256,13 +336,21 @@
256336 frontItem.addActionListener(this);
257337 compositeItem = menu.add(new MenuItem("Composite"));
258338 compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
259342 hideItem = menu.add(new MenuItem("Hidden Group"));
260343 hideItem.addActionListener(this);
344
+ }
261345 ungroupItem = menu.add(new MenuItem("Ungroup"));
262346 ungroupItem.addActionListener(this);
347
+
263348 menu.add("-");
349
+
264350 randomItem = menu.add(new MenuItem("Switch node"));
265351 randomItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
266354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
267355 switchGeoItem.addActionListener(this);
268356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -270,8 +358,7 @@
270358 morphItem = menu.add(new MenuItem("Morph Group"));
271359 morphItem.addActionListener(this);
272360
273
- if (Globals.ADVANCED)
274
- {
361
+ menu.add("-");
275362 physicsItem = menu.add(new MenuItem("Physics"));
276363 physicsItem.addActionListener(this);
277364 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
....@@ -289,14 +376,15 @@
289376 billboardItem.addActionListener(this);
290377 csgItem = menu.add(new MenuItem("CSG"));
291378 csgItem.addActionListener(this);
292
- shadowXItem = menu.add(new MenuItem("Shadow X"));
379
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
293380 shadowXItem.addActionListener(this);
294
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
381
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
295382 shadowYItem.addActionListener(this);
296
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
383
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
297384 shadowZItem.addActionListener(this);
298385 if (Globals.ADVANCED)
299386 {
387
+ menu.add("-");
300388 linkerItem = menu.add(new MenuItem("Linker"));
301389 linkerItem.addActionListener(this);
302390 attributeItem = menu.add(new MenuItem("Attribute"));
....@@ -305,14 +393,18 @@
305393 templateItem.addActionListener(this);
306394 pointflowItem = menu.add(new MenuItem("Point Flow"));
307395 pointflowItem.addActionListener(this);
308
- menu.add("-");
309396 }
397
+ menu.add("-");
310398 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311399 resetTransformItem.addActionListener(this);
312400 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
313401 resetCentroidItem.addActionListener(this);
314
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
- transformgeometryItem.addActionListener(this);
402
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
403
+ resetCentroidXZItem.addActionListener(this);
404
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
405
+ transformGeometryItem.addActionListener(this);
406
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
407
+ transformChildrenItem.addActionListener(this);
316408
317409 oe.menuBar.add(menu = new Menu("Geometry"));
318410 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -361,6 +453,10 @@
361453 oe.menuBar.add(menu = new Menu("Attributes"));
362454 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
363455 clearMaterialsItem.addActionListener(this);
456
+ resetAllItem = menu.add(new MenuItem("Reset All"));
457
+ resetAllItem.addActionListener(this);
458
+ stepAllItem = menu.add(new MenuItem("Step All"));
459
+ stepAllItem.addActionListener(this);
364460 menu.add("-");
365461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
366462 liveleavesItem.addActionListener(this);
....@@ -381,6 +477,14 @@
381477 markleavesItem.addActionListener(this);
382478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
383479 unmarkleavesItem.addActionListener(this);
480
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
481
+ rewindleavesItem.addActionListener(this);
482
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
483
+ unrewindleavesItem.addActionListener(this);
484
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
485
+ randomleavesItem.addActionListener(this);
486
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
487
+ unrandomleavesItem.addActionListener(this);
384488 menu.add("-");
385489 flipVItem = menu.add(new MenuItem("Flip V"));
386490 flipVItem.addActionListener(this);
....@@ -415,38 +519,41 @@
415519 sortbysizeItem.addActionListener(this);
416520 sortbynameItem = menu.add(new MenuItem("Sort by name"));
417521 sortbynameItem.addActionListener(this);
522
+ menu.add("-");
523
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
524
+ shareGeometriesItem.addActionListener(this);
525
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
526
+ mergeGeometriesItem.addActionListener(this);
418527 if (Globals.ADVANCED)
419528 {
420
- menu.add("-");
529
+ // Pretty much the same as duplicate and clone.
421530 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422531 extractGeometriesItem.addActionListener(this);
423532 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424533 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);
429534 }
430535
431536 oe.menuBar.add(menu = new Menu("Insert"));
432537 buildCreateMenu(menu);
433538
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
-
444539 oe.menuBar.add(menu = new Menu("Tools"));
445540 buildToolsMenu(menu);
446541 }
447542
448543 void SetupUI2(ObjEditor oe)
449544 {
545
+ // June 2019
546
+ if (oe == null)
547
+ {
548
+ //super.SetupUI2(this);
549
+ //return;
550
+ }
551
+
552
+ if (copy != group)
553
+ {
554
+ //super.SetupUI2(this);
555
+ }
556
+
450557 //new Exception().printStackTrace();
451558
452559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -477,23 +584,49 @@
477584 */
478585 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
479586
480
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
- liveCB.setToolTipText("Enabled animation");
587
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ //minButton.setToolTipText("Minimize window");
589
+ //minButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ maxButton.setToolTipText("Maximize window");
593
+ maxButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ fullButton.setToolTipText("Full-screen window");
597
+ fullButton.addActionListener(this);
598
+
599
+ oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ undoButton.setToolTipText("Undo changes");
601
+ undoButton.addActionListener(this);
602
+
603
+ oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604
+ redoButton.setToolTipText("Redo changes");
605
+ redoButton.addActionListener(this);
606
+
607
+ oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ saveButton.setToolTipText("Save changes");
609
+ saveButton.addActionListener(this);
610
+
611
+ oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612
+ liveCB.setToolTipText("Enable animation");
482613 liveCB.addItemListener(this);
483614
484
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485616 oneStepButton.setToolTipText("Animate one step forward");
486617 oneStepButton.addActionListener(this);
487618
488
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
489620 fastCB.setToolTipText("Fast mode");
490621 fastCB.addItemListener(this);
491622
492
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
493626 trackCB.setToolTipText("Enable tracking");
494627 trackCB.addItemListener(this);
495628
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
497630 screenfitButton.setToolTipText("Screen fit");
498631 screenfitButton.addActionListener(this);
499632
....@@ -502,70 +635,117 @@
502635
503636 if (Globals.ADVANCED)
504637 {
505
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
638
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
506639 snapobjectButton.addActionListener(this);
507640 snapobjectButton.setToolTipText("Snap Object");
508641 }
509642
510
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
- flashSelectionButton.setToolTipText("Show selection");
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ flashSelectionButton.setToolTipText("Highlight selection");
512645 flashSelectionButton.addActionListener(this);
513646
514
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515648
516
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517650 twoButton.setToolTipText("Show center view only");
518651 twoButton.addActionListener(this);
519
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
652
+ this.fullscreenLayout = twoButton;
653
+
654
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520655 fourButton.addActionListener(this);
521656 fourButton.setToolTipText("Show left panel only");
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523658 sixButton.setToolTipText("2-column layout left");
524659 sixButton.addActionListener(this);
525
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526661 threeButton.setToolTipText("2-column layout right");
527662 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
529664 sevenButton.setToolTipText("3-column layout");
530665 sevenButton.addActionListener(this);
531666 //
532667
533
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534669 rootButton.setToolTipText("Edit selection in new tab");
535670 rootButton.addActionListener(this);
536671
537
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538673 closeButton.setToolTipText("Close tab");
539674 closeButton.addActionListener(this);
540675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
541676 //clearButton.addActionListener(this);
542
-
543
- cGridBag commandsPanel = new cGridBag();
677
+
678
+ // INSERT
679
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
680
+ gridButton.setToolTipText("Create grid");
681
+ gridButton.addActionListener(this);
682
+
683
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ boxButton.setToolTipText("Create box");
685
+ boxButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ sphereButton.setToolTipText("Create sphere");
689
+ sphereButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.Return();
544692
545
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
717
+ overlayButton.setToolTipText("Create overlay");
718
+ overlayButton.addActionListener(this);
719
+
720
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ lightButton.setToolTipText("Create light");
722
+ lightButton.addActionListener(this);
723
+
724
+ // EDIT panel
725
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
546726 editButton.setToolTipText("Edit selection");
547727 editButton.addActionListener(this);
548728
549
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
729
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
550730 uneditButton.setToolTipText("Unedit selection");
551731 uneditButton.addActionListener(this);
552732
553
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
733
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554734 allParamsButton.setToolTipText("Edit all params");
555735 allParamsButton.addActionListener(this);
556736
557
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
737
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
558738 clearPanelButton.setToolTipText("Clear edit panel");
559739 clearPanelButton.addActionListener(this);
560740
561
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
741
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
562742 unselectButton.setToolTipText("Unselect");
563743 unselectButton.addActionListener(this);
564744
565
- commandsPanel.preferredHeight = 1;
745
+ editCommandsPanel.preferredHeight = 1;
566746
567
- oe.treePanel.add(commandsPanel);
568
- oe.treePanel.Return();
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
569749
570750 // oe.aConstraints.gridx += 1;
571751 // oe.aConstraints.weighty = 0;
....@@ -582,7 +762,7 @@
582762
583763 JScrollPane jSP;
584764 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
585
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
586766 ResetModel();
587767
588768 oe.treePanel.add(jSPPanel);
....@@ -641,7 +821,7 @@
641821 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642822 zoomBoxCB.addItemListener(this);
643823
644
- if (Globals.ADVANCED)
824
+ if (true) // Globals.ADVANCED)
645825 {
646826 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647827 supportCB.setToolTipText("Enable rigging");
....@@ -687,11 +867,23 @@
687867 // debugCB.addItemListener(this);
688868
689869 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
690871 oeilCB.addItemListener(this);
691872
873
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
+ shadowCB.setToolTipText("Compute shadows when live");
875
+ shadowCB.addItemListener(this);
876
+
877
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
+ autosaveCB.setToolTipText("Auto-save on structure change");
879
+ autosaveCB.addItemListener(this);
880
+
881
+ if (Globals.ADVANCED)
882
+ {
692883 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
693884 lookAtCB.setToolTipText("Look-at target");
694885 lookAtCB.addItemListener(this);
886
+ }
695887
696888 }
697889
....@@ -706,6 +898,14 @@
706898 void EditObject(Object3D obj)
707899 {
708900 cRadio radioButton = new cRadio(obj.name);
901
+
902
+ // Patch to avoid bug with transparency.
903
+ radioButton.hadMaterial = obj.material != null;
904
+ if (!radioButton.hadMaterial)
905
+ {
906
+ obj.material = new cMaterial();
907
+ }
908
+
709909 radioButton.SetObject(obj);
710910 radioButton.layout = sevenButton;
711911 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -714,8 +914,11 @@
714914 buttonGroup.add(radioButton);
715915 radioButton.doClick();
716916 }
917
+
717918 void SetupViews(ObjEditor oe)
718919 {
920
+ theFrame = this;
921
+
719922 oe.SetupViews();
720923
721924 System.out.println("SetupViews");
....@@ -724,23 +927,26 @@
724927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
725928 }
726929
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;
930
+ cToggleButton liveCB;
931
+ cCheckBox supportCB;
932
+ cCheckBox localCB;
933
+ cCheckBox crowdCB;
934
+ cCheckBox smoothCB;
935
+ cToggleButton fastCB;
936
+ cCheckBox slowCB;
937
+ cCheckBox boxCB;
938
+ cCheckBox zoomBoxCB;
939
+ cToggleButton trackCB;
940
+ cCheckBox smoothfocusCB;
738941 // JCheckBox speakerMocapCB;
739
- JCheckBox speakerCameraCB;
740
- JCheckBox speakerFocusCB;
741
- JCheckBox debugCB;
742
- JCheckBox oeilCB;
743
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
744950
745951 // static int COLOR = 1;
746952 // static int MATERIAL = 2;
....@@ -748,9 +954,9 @@
748954
749955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
750956
751
- JCheckBox colorCB;
752
- JCheckBox materialCB;
753
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
754960
755961 public void itemStateChanged(ItemEvent e)
756962 {
....@@ -778,6 +984,7 @@
778984 } else if(e.getSource() == liveCB)
779985 {
780986 cameraView.ToggleLive();
987
+ refreshContents(false);
781988 }
782989 else if(e.getSource() == supportCB)
783990 {
....@@ -842,6 +1049,14 @@
8421049 {
8431050 cameraView.ToggleOeil();
8441051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
8451060 else if(e.getSource() == lookAtCB)
8461061 {
8471062 cameraView.ToggleLookAt();
....@@ -858,7 +1073,8 @@
8581073
8591074 /**/
8601075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
861
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
8621078 if ((path == null) || (path.getPathCount() <= 1)) {
8631079 // We can't move the root node or an empty selection
8641080 return;
....@@ -930,7 +1146,9 @@
9301146 // objEditor.DropFile((java.io.File[]) object, true);
9311147 // return;
9321148 // }
933
- if (string.charAt(0) == '/')
1149
+
1150
+ // File path for Mac and Windows
1151
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9341152 {
9351153 // file(s)
9361154 String[] names = string.split("\n");
....@@ -957,7 +1175,7 @@
9571175
9581176 flashIt = false;
9591177 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1178
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9611179 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9621180
9631181 if (group.selection.size() == 1)
....@@ -980,16 +1198,16 @@
9801198 return;
9811199 }
9821200
983
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
984
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
9851203 loadClipboard(true);
9861204 objEditor.jTree.setSelectionPath(destinationPath);
9871205 pasteInto(false, false);
988
- } else {
989
- loadClipboard(false);
990
- objEditor.jTree.setSelectionPath(destinationPath);
991
- pasteInto(false, false); // true); // ???
992
- }
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
9931211 }
9941212 public void dropActionChanged(DropTargetDragEvent dtde)
9951213 // Called if the user has modified the current drop gesture
....@@ -1164,13 +1382,13 @@
11641382 parseverticesItem.addActionListener(this);
11651383 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661384 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1385
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681386 alignItem.addActionListener(this);
11691387 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701388 reduceMorphItem.addActionListener(this);
11711389 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721390 reduce34MorphItem.addActionListener(this);
1173
-
1391
+ menu.add("-");
11741392 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751393 computeAOItem.addActionListener(this);
11761394
....@@ -1183,7 +1401,7 @@
11831401 memoryItem.addActionListener(this);
11841402 menu.add(analyzeItem = new MenuItem("Analyze"));
11851403 analyzeItem.addActionListener(this);
1186
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
11871405 dumpItem.addActionListener(this);
11881406 // menu.add(pathItem = new MenuItem("From-to path"));
11891407 // pathItem.addActionListener(this);
....@@ -1324,6 +1542,7 @@
13241542 shadow.material = new cMaterial(obj.material);
13251543 shadow.material.diffuse = 0.0001f;
13261544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
13271546
13281547 makeSomething(shadow);
13291548 }
....@@ -1530,9 +1749,9 @@
15301749
15311750 void Overwrite(int mask)
15321751 {
1533
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1752
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15341753 {
1535
- Object3D content = GrafreeD.clipboard.get(0);
1754
+ Object3D content = Grafreed.clipboard.get(0);
15361755
15371756 if (content instanceof cGroup && ((cGroup)content).transientlink )
15381757 content = ((cGroup)content).get(0);
....@@ -1580,11 +1799,11 @@
15801799 objEditor.cameraView.renderCamera.setAim(v2, v1);
15811800 objEditor.cameraView.repaint();
15821801 } else
1583
- if (source == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
15841803 {
15851804 makeSomething(new Box());
15861805 } else
1587
- if (source == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
15881807 {
15891808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15901809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1663,27 +1882,27 @@
16631882
16641883 makeSomething(obj);
16651884 } else
1666
- if (source == gridItem)
1885
+ if (source == gridItem || source == gridButton)
16671886 {
16681887 makeSomething(new Grid());
16691888 } else
1670
- if (source == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
16711890 {
16721891 makeSomething(new Sphere());
16731892 } else
1674
- if (source == coneItem)
1893
+ if (source == coneItem || source == coneButton)
16751894 {
16761895 makeSomething(new Cone());
16771896 } else
1678
- if (source == torusItem)
1897
+ if (source == torusItem || source == torusButton)
16791898 {
16801899 makeSomething(new Torus());
16811900 } else
1682
- if (source == superItem)
1901
+ if (source == superItem || source == superButton)
16831902 {
16841903 makeSomething(new Superellipsoid());
16851904 } else
1686
- if (source == kleinItem)
1905
+ if (source == kleinItem || source == kleinButton)
16871906 {
16881907 makeSomething(new Klein());
16891908 } else
....@@ -1703,7 +1922,7 @@
17031922 {
17041923 makeSomething(new BezierSurface());
17051924 } else
1706
- if (source == overlayItem)
1925
+ if (source == overlayItem || source == overlayButton)
17071926 {
17081927 /*
17091928 Object3D obj = new BezierSurface(5,8);
....@@ -1751,7 +1970,7 @@
17511970 s.setup();
17521971 makeSomething(s);
17531972 } else
1754
- if (source == lightItem)
1973
+ if (source == lightItem || source == lightButton)
17551974 {
17561975 makeSomething(new Light());
17571976 } else
....@@ -1837,23 +2056,6 @@
18372056 csg.addChild(child);
18382057 child.addChild(csg);
18392058 } 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");
1856
- } else
18572059 if (source == computeAOItem)
18582060 {
18592061 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1872,7 +2074,7 @@
18722074 if (source == invariantsItem)
18732075 {
18742076 System.out.println("Invariants:");
1875
- GrafreeD.grafreeD.universe.invariants();
2077
+ Grafreed.grafreeD.universe.invariants();
18762078 } else
18772079 if (source == memoryItem)
18782080 {
....@@ -1890,6 +2092,30 @@
18902092 if (source == dumpItem)
18912093 {
18922094 DumpObject();
2095
+ } else
2096
+ if (source == minButton)
2097
+ {
2098
+ Minimize();
2099
+ } else
2100
+ if (source == maxButton)
2101
+ {
2102
+ Maximize();
2103
+ } else
2104
+ if (source == fullButton)
2105
+ {
2106
+ ToggleFullScreen();
2107
+ } else
2108
+ if (source == undoButton)
2109
+ {
2110
+ Undo();
2111
+ } else
2112
+ if (source == redoButton)
2113
+ {
2114
+ Redo();
2115
+ } else
2116
+ if (source == saveButton)
2117
+ {
2118
+ Save();
18932119 } else
18942120 if (source == oneStepButton)
18952121 {
....@@ -1945,12 +2171,20 @@
19452171 {
19462172 loadClipboard(true);
19472173 } else
2174
+ if (source == undoItem)
2175
+ {
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
2181
+ } else
19482182 if (source == duplicateItem)
19492183 {
1950
- Object3D keep = GrafreeD.clipboard;
2184
+ Object3D keep = Grafreed.clipboard;
19512185 loadClipboard(false);
19522186 paste(false);
1953
- GrafreeD.clipboard = keep;
2187
+ Grafreed.clipboard = keep;
19542188 } else
19552189 if (source == cloneItem)
19562190 {
....@@ -2170,9 +2404,9 @@
21702404 // group.selection.get(0).setMasterThis(content); // should be identity
21712405 // refreshContents();
21722406 // }
2173
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2407
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21742408 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2409
+ Object3D content = Grafreed.clipboard.get(0);
21762410
21772411 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782412 content = ((cGroup)content).get(0);
....@@ -2222,9 +2456,9 @@
22222456 } else
22232457 if (source == setMasterItem)
22242458 {
2225
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2459
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22262460 {
2227
- Object3D content = GrafreeD.clipboard.get(0);
2461
+ Object3D content = Grafreed.clipboard.get(0);
22282462
22292463 if (content instanceof cGroup && ((cGroup)content).transientlink )
22302464 content = ((cGroup)content).get(0);
....@@ -2237,9 +2471,9 @@
22372471 {
22382472 if (group.selection.size() == 1)
22392473 {
2240
- if (GrafreeD.clipboard.size() == 1)
2474
+ if (Grafreed.clipboard.size() == 1)
22412475 {
2242
- Object3D content = GrafreeD.clipboard.get(0);
2476
+ Object3D content = Grafreed.clipboard.get(0);
22432477
22442478 if (content instanceof cGroup && ((cGroup)content).transientlink )
22452479 content = ((cGroup)content).get(0);
....@@ -2256,7 +2490,7 @@
22562490 {
22572491 RevertMeshes();
22582492 } else
2259
- if (source == resetMeshItem)
2493
+ if (source == resetAllItem)
22602494 {
22612495 ResetAll();
22622496 } else
....@@ -2422,7 +2656,7 @@
24222656 {
24232657 CastShadow(2);
24242658 } else
2425
- if (source == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
24262660 {
24272661 //ungroup();
24282662 for (int i=0; i<group.selection.size(); i++)
....@@ -2444,7 +2678,7 @@
24442678 } else
24452679 if (source == genNormalsMESHItem)
24462680 {
2447
- GenNormals(true); // TODO
2681
+ GenNormalsMESH();
24482682 } else
24492683 if (source == genNormalsORGANItem)
24502684 {
....@@ -2509,6 +2743,22 @@
25092743 if (source == unmarkleavesItem)
25102744 {
25112745 MarkLeaves(false);
2746
+ } else
2747
+ if (source == rewindleavesItem)
2748
+ {
2749
+ RewindLeaves(true);
2750
+ } else
2751
+ if (source == unrewindleavesItem)
2752
+ {
2753
+ RewindLeaves(false);
2754
+ } else
2755
+ if (source == randomleavesItem)
2756
+ {
2757
+ RandomLeaves(true);
2758
+ } else
2759
+ if (source == unrandomleavesItem)
2760
+ {
2761
+ RandomLeaves(false);
25122762 } else
25132763 if (source == flipVItem)
25142764 {
....@@ -2594,9 +2844,13 @@
25942844 {
25952845 SmoothMesh();
25962846 } else
2597
- if (source == transformgeometryItem)
2847
+ if (source == transformGeometryItem)
25982848 {
25992849 TransformGeometry();
2850
+ } else
2851
+ if (source == transformChildrenItem)
2852
+ {
2853
+ TransformChildren();
26002854 } else
26012855 if (source == resetTransformItem)
26022856 {
....@@ -2604,7 +2858,11 @@
26042858 } else
26052859 if (source == resetCentroidItem)
26062860 {
2607
- ResetCentroid();
2861
+ ResetCentroid(true);
2862
+ } else
2863
+ if (source == resetCentroidXZItem)
2864
+ {
2865
+ ResetCentroid(false);
26082866 } else
26092867 if (source == resetParentItem)
26102868 {
....@@ -2736,6 +2994,10 @@
27362994 if (source == twoButton)
27372995 {
27382996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
27393001 // bug
27403002 //gridPanel.setDividerLocation(1.0);
27413003 //bigPanel.setDividerLocation(0.0);
....@@ -2768,10 +3030,31 @@
27683030 bigThree.ClearUI();
27693031 bigThree.add(centralPanel);
27703032 bigThree.FlushUI();
3033
+
3034
+ cameraView.requestFocusInWindow();
3035
+
3036
+// refreshContents(true);
3037
+//
3038
+// try
3039
+// {
3040
+// java.awt.Robot bot = new java.awt.Robot();
3041
+// int mask = InputEvent.BUTTON1_MASK;
3042
+// bot.mouseMove(100, 100);
3043
+// bot.mousePress(mask);
3044
+// bot.mouseRelease(mask);
3045
+// }
3046
+// catch (Exception e)
3047
+// {
3048
+//
3049
+// }
3050
+
27713051 } else
27723052 if (source == threeButton)
27733053 {
27743054 radio.layout = threeButton;
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
27753058
27763059 // bigThree.remove(scenePanel);
27773060 // bigThree.remove(centralPanel);
....@@ -2804,10 +3087,15 @@
28043087 bigThree.add(centralPanel);
28053088 bigThree.add(XYZPanel);
28063089 bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
28073092 } else
28083093 if (source == fourButton)
28093094 {
28103095 radio.layout = fourButton;
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
28113099
28123100 // bigThree.remove(scenePanel);
28133101 // bigThree.remove(centralPanel);
....@@ -2839,10 +3127,15 @@
28393127 bigThree.ClearUI();
28403128 bigThree.add(scenePanel);
28413129 bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
28423132 } else
28433133 if (source == sixButton)
28443134 {
28453135 radio.layout = sixButton;
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
28463139
28473140 // bigThree.remove(scenePanel);
28483141 // bigThree.remove(centralPanel);
....@@ -2875,10 +3168,15 @@
28753168 bigThree.add(scenePanel);
28763169 bigThree.add(centralPanel);
28773170 bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
28783173 } else
28793174 if (source == sevenButton)
28803175 {
28813176 radio.layout = sevenButton;
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
28823180
28833181 // bigThree.remove(scenePanel);
28843182 // bigThree.remove(centralPanel);
....@@ -2912,6 +3210,8 @@
29123210 bigThree.add(centralPanel);
29133211 bigThree.add(XYZPanel);
29143212 bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
29153215 } else
29163216 if (source == rootButton)
29173217 {
....@@ -2923,6 +3223,7 @@
29233223 EditObject(obj);
29243224 }
29253225
3226
+ cameraView.requestFocusInWindow();
29263227 refreshContents(true);
29273228 } else
29283229 if (source == closeButton)
....@@ -2932,18 +3233,27 @@
29323233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29333234 {
29343235 ab = (cRadio)e.nextElement();
2935
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29363237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
29373244 buttonGroup.remove(ab);
29383245 radioPanel.remove(ab);
29393246
2940
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
29413249 // ab.GetObject().objectUI = null; // ?????????
29423250
29433251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29443252 break;
29453253 }
29463254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
29473257 refreshContents(true);
29483258 } else
29493259 if (source == editItem || source == editButton)
....@@ -2960,7 +3270,7 @@
29603270 child.CloseUI();
29613271 listUI.remove(child);
29623272
2963
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
29643274 }
29653275 objEditor.ctrlPanel.FlushUI();
29663276 //objEditor.jTree.clearSelection();
....@@ -3046,7 +3356,11 @@
30463356 frontView.object = group;
30473357 sideView.object = group;
30483358 }
3049
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
30503364 /*
30513365 currentLayout = radio.layout;
30523366 if (currentLayout == null)
....@@ -3058,8 +3372,23 @@
30583372 //group.parent = null; // ROOT
30593373 //group.attributes = -1;
30603374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
30613377 refreshContents(true);
3062
- }
3378
+ } else if (event.getSource() == editCameraItem)
3379
+ {
3380
+ cameraView.ProtectCamera();
3381
+ cameraView.repaint();
3382
+ return;
3383
+ } else if (event.getSource() == revertCameraItem)
3384
+ {
3385
+ cameraView.RevertCamera();
3386
+ cameraView.repaint();
3387
+ return;
3388
+ // } else if (event.getSource() == textureButton)
3389
+ // {
3390
+ // return; // true;
3391
+ }
30633392 else
30643393 {
30653394 //return super.action(event, arg);
....@@ -3068,7 +3397,6 @@
30683397 }
30693398
30703399 boolean useclient = false;
3071
- cRadio radio;
30723400
30733401 void ToggleRoot()
30743402 {
....@@ -3120,6 +3448,28 @@
31203448 refreshContents();
31213449 }
31223450
3451
+ void TransformChildren()
3452
+ {
3453
+ Object3D obj;
3454
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3455
+ {
3456
+ obj = (Object3D)e.nextElement();
3457
+ obj.KeepTextureMatrices();
3458
+ obj.TransformChildren();
3459
+ obj.RestoreTextureMatrices();
3460
+
3461
+// if (obj.parent == null)
3462
+// {
3463
+// System.out.println("NULL PARENT!");
3464
+// new Exception().printStackTrace();
3465
+// }
3466
+// else
3467
+// TouchTransform(obj);
3468
+// //obj.parent.Touch();
3469
+ }
3470
+
3471
+ refreshContents();
3472
+ }
31233473
31243474 void ResetTransform()
31253475 {
....@@ -3232,7 +3582,7 @@
32323582 refreshContents();
32333583 }
32343584
3235
- void ResetCentroid()
3585
+ void ResetCentroid(boolean full)
32363586 {
32373587 Object3D obj;
32383588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3247,12 +3597,16 @@
32473597 LA.matIdentity(Object3D.mat);
32483598 obj.getBounds(minima, maxima, false);
32493599 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3250
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3600
+ if (full)
3601
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32513602 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32523603 obj.TransformMesh(Object3D.mat);
3604
+
32533605 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3254
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3606
+ if (full)
3607
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32553608 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3609
+
32563610 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32573611 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32583612 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3281,7 +3635,8 @@
32813635
32823636 int size = obj.MemorySize();
32833637
3284
- System.err.println((size/1024) + " KB is the size of " + obj);
3638
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3639
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32853640 }
32863641 }
32873642 catch (Exception e)
....@@ -3318,9 +3673,9 @@
33183673 obj = (Object3D)e.nextElement();
33193674
33203675 System.out.println("Object is: " + obj);
3321
- GrafreeD.AnalyzeObject(obj);
3676
+ Grafreed.AnalyzeObject(obj);
33223677 System.out.println("Boundary rep: " + obj.bRep);
3323
- GrafreeD.AnalyzeObject(obj.bRep);
3678
+ Grafreed.AnalyzeObject(obj.bRep);
33243679
33253680 // System.err.println((size/1024) + " KB is the size of " + obj);
33263681 }
....@@ -3362,6 +3717,13 @@
33623717 void GenNormals(boolean crease)
33633718 {
33643719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
33653727
33663728 refreshContents();
33673729 }
....@@ -3534,8 +3896,8 @@
35343896
35353897 void ParseVertices()
35363898 {
3537
- boolean epsequal = GrafreeD.epsequal;
3538
- GrafreeD.epsequal = true;
3899
+ boolean epsequal = Grafreed.epsequal;
3900
+ Grafreed.epsequal = true;
35393901
35403902 for (int i=0; i<group.selection.size(); i++)
35413903 {
....@@ -3560,7 +3922,7 @@
35603922 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35613923 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35623924
3563
- g.add(GrafreeD.clipboard);
3925
+ g.add(Grafreed.clipboard);
35643926
35653927 buffer.add(g);
35663928 }
....@@ -3575,7 +3937,7 @@
35753937 makeSomething(buffer, i==group.selection.size()-1);
35763938 }
35773939
3578
- GrafreeD.epsequal = epsequal;
3940
+ Grafreed.epsequal = epsequal;
35793941
35803942 refreshContents();
35813943 }
....@@ -3593,7 +3955,16 @@
35933955 String pigment = Object3D.GetPigment(tex);
35943956 //String bump = Object3D.GetBump(tex);
35953957
3596
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3958
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3959
+
3960
+ try
3961
+ {
3962
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3963
+ }
3964
+ catch (Exception e)
3965
+ {
3966
+ System.err.println("FAIL: " + node);
3967
+ }
35973968
35983969 double s = v.s;
35993970
....@@ -3725,7 +4096,7 @@
37254096 return;
37264097
37274098 Object3D poses = group.selection.get(0);
3728
- Object3D ref = GrafreeD.clipboard.get(0);
4099
+ Object3D ref = Grafreed.clipboard.get(0);
37294100
37304101 Object3D newgroup = new Object3D("Po:" + poses.name);
37314102
....@@ -3919,9 +4290,9 @@
39194290
39204291 void ClipMesh()
39214292 {
3922
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4293
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39234294 {
3924
- Object3D content = GrafreeD.clipboard.get(0);
4295
+ Object3D content = Grafreed.clipboard.get(0);
39254296
39264297 if (content instanceof cGroup && ((cGroup)content).transientlink )
39274298 content = ((cGroup)content).get(0);
....@@ -3930,7 +4301,7 @@
39304301 // {
39314302 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39324303 // }
3933
- group.selection.ClipMesh(GrafreeD.clipboard);
4304
+ group.selection.ClipMesh(Grafreed.clipboard);
39344305 }
39354306 // group.selection.ClipMesh(GrafreeD.clipboard);
39364307 System.out.println("DONE.");
....@@ -3977,6 +4348,18 @@
39774348 void MarkLeaves(boolean hide)
39784349 {
39794350 group.selection.MarkLeaves(hide);
4351
+ refreshContents();
4352
+ }
4353
+
4354
+ void RewindLeaves(boolean hide)
4355
+ {
4356
+ group.selection.RewindLeaves(hide);
4357
+ refreshContents();
4358
+ }
4359
+
4360
+ void RandomLeaves(boolean hide)
4361
+ {
4362
+ group.selection.RandomLeaves(hide);
39804363 refreshContents();
39814364 }
39824365
....@@ -4062,10 +4445,10 @@
40624445 {
40634446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40644447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4065
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40664449
40674450 Object3D elem = (Object3D)group.selection.elementAt(i);
4068
- if(elem != group)
4451
+ if(elem != group || !newWindow)
40694452 {
40704453 // if (!(elem instanceof Composite))
40714454 // newWindow = false;
....@@ -4155,7 +4538,6 @@
41554538 //case 702: // Event.LIST_DESELECT
41564539 group.deselectAll();
41574540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4158
- objEditor.ClearInfo(); // .GetMaterial());
41594541 if (tps != null)
41604542 {
41614543 for (int i=0; i < tps.length; i++)
....@@ -4164,10 +4546,8 @@
41644546
41654547 //if (child.parent != null)
41664548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
41674550 group.addSelectee(child);
4168
- objEditor.SetMaterial(child); // .GetMaterial());
4169
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4170
- System.err.println("info : " + child.GetPath());
41714551 }
41724552 }
41734553 // else
....@@ -4177,16 +4557,17 @@
41774557 // System.err.println("info : " + group.GetPath());
41784558 // }
41794559
4180
- objEditor.SetText(); // jan 2014
4181
-
4182
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4560
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41834561 CameraPane.flash = true;
41844562
4185
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41864564 // a camera
41874565 {
4188
- CameraPane.camerachangeframe = 0; // don't refuse it
4189
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4566
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4567
+ {
4568
+ CameraPane.camerachangeframe = 0; // don't refuse it
4569
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4570
+ }
41904571 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41914572 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41924573 }
....@@ -4199,6 +4580,26 @@
41994580
42004581 freezemodel = false;
42014582 }
4583
+
4584
+ void refreshContents(boolean cp)
4585
+ {
4586
+ if (!Globals.MOUSEDRAGGED)
4587
+ {
4588
+ objEditor.ClearInfo(); // .GetMaterial());
4589
+
4590
+ for (int i=0; i < group.selection.Size(); i++)
4591
+ {
4592
+ Object3D child = (Object3D) group.selection.get(i);
4593
+
4594
+ objEditor.AddInfo(child, this, true);
4595
+ System.err.println("info : " + child.GetPath());
4596
+ }
4597
+
4598
+ objEditor.SetText(); // jan 2014
4599
+ }
4600
+
4601
+ super.refreshContents(cp);
4602
+ }
42024603
42034604 void linkSomething(Object3D thing)
42044605 {
....@@ -4270,16 +4671,19 @@
42704671 {
42714672 if (group.selection.isEmpty())
42724673 return;
4273
- GrafreeD.clipboardIsTempGroup = false;
4674
+
4675
+ Grafreed.clipboardIsTempGroup = false;
42744676 Composite tGroup = null;
42754677 if (group.selection.size() > 0) // 1)
42764678 {
42774679 tGroup = new cGroup();
4278
- GrafreeD.clipboardIsTempGroup = true;
4680
+ Grafreed.clipboardIsTempGroup = true;
42794681 }
42804682
42814683 if (cut)
42824684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
42834687 //int indices[] = jList.getSelectedIndices();
42844688 //for (int i = indices.length - 1; i >= 0; i--)
42854689 //jList.remove(indices[i]);
....@@ -4315,16 +4719,16 @@
43154719 //System.out.println("cut " + child);
43164720 //System.out.println("parent = " + child.parent);
43174721 // tmp.addChild(child);
4318
- if (GrafreeD.clipboardIsTempGroup)
4722
+ if (Grafreed.clipboardIsTempGroup)
43194723 tGroup.add/*Child*/(tmp);
43204724 else
4321
- GrafreeD.clipboard = tmp;
4725
+ Grafreed.clipboard = tmp;
43224726 }
43234727 else
4324
- if (GrafreeD.clipboardIsTempGroup)
4728
+ if (Grafreed.clipboardIsTempGroup)
43254729 tGroup.add/*Child*/(child);
43264730 else
4327
- GrafreeD.clipboard = child;
4731
+ Grafreed.clipboard = child;
43284732 }
43294733
43304734 //ResetModel();
....@@ -4356,21 +4760,23 @@
43564760 //System.out.println("cut " + elem);
43574761 //System.out.println("parent = " + elem.parent);
43584762 // tmp.addChild(elem);
4359
- if (GrafreeD.clipboardIsTempGroup)
4763
+ if (Grafreed.clipboardIsTempGroup)
43604764 tGroup.add/*Child*/(tmp);
43614765 else
4362
- GrafreeD.clipboard = tmp;
4766
+ Grafreed.clipboard = tmp;
43634767 }
43644768 else
4365
- if (GrafreeD.clipboardIsTempGroup)
4769
+ if (Grafreed.clipboardIsTempGroup)
43664770 tGroup.add/*Child*/(child);
43674771 else
4368
- GrafreeD.clipboard = child;
4772
+ Grafreed.clipboard = child;
43694773 }
43704774
43714775 }
4372
- if (GrafreeD.clipboardIsTempGroup)
4373
- GrafreeD.clipboard = tGroup;
4776
+
4777
+ if (Grafreed.clipboardIsTempGroup)
4778
+ Grafreed.clipboard = tGroup;
4779
+
43744780 if (cut)
43754781 {
43764782 ResetModel();
....@@ -4384,7 +4790,7 @@
43844790 // return;
43854791 boolean first = true;
43864792
4387
- if (GrafreeD.clipboardIsTempGroup)
4793
+ if (Grafreed.clipboardIsTempGroup)
43884794 {
43894795 Composite temp;
43904796
....@@ -4395,7 +4801,7 @@
43954801 temp = (Composite)Applet3D.clipboard.deepCopy();
43964802 */
43974803 Object3D elem;
4398
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4804
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43994805 {
44004806 Object3D child = (Object3D)e.nextElement();
44014807
....@@ -4429,14 +4835,14 @@
44294835 //Object3D cb = Applet3D.clipboard;
44304836 //temp.addChild(cb);
44314837 //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());
4838
+ assert(Grafreed.clipboard.parent == null);
4839
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4840
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4841
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4842
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44374843 else
4438
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
- GrafreeD.clipboard.get(0).parent = keepparent;
4844
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4845
+ Grafreed.clipboard.get(0).parent = keepparent;
44404846 }
44414847
44424848 ResetModel();
....@@ -4485,9 +4891,9 @@
44854891 {
44864892 boolean first = true;
44874893
4488
- if (GrafreeD.clipboardIsTempGroup)
4894
+ if (Grafreed.clipboardIsTempGroup)
44894895 {
4490
- Composite temp = (Composite)GrafreeD.clipboard;
4896
+ Composite temp = (Composite)Grafreed.clipboard;
44914897 Object3D copy;
44924898 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44934899 {
....@@ -4497,7 +4903,7 @@
44974903 }
44984904 } else
44994905 {
4500
- linkSomething(GrafreeD.clipboard); //.get(0));
4906
+ linkSomething(Grafreed.clipboard); //.get(0));
45014907 }
45024908 }
45034909 }
....@@ -4902,21 +5308,6 @@
49025308 }
49035309 */
49045310
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
-
49205311 /*
49215312 public void Callback(Object obj)
49225313 {
....@@ -4940,26 +5331,9 @@
49405331 }
49415332 */
49425333
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
-
49605334 String GetFile(String dialogName)
49615335 {
4962
- if (GrafreeD.standAlone)
5336
+ if (Grafreed.standAlone)
49635337 {
49645338 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49655339 browser.show();
....@@ -5027,7 +5401,28 @@
50275401 cButton clearpanelButton;
50285402 cButton unselectButton;
50295403
5404
+ cButton minButton;
5405
+ cButton maxButton;
5406
+ cButton fullButton;
5407
+ cButton undoButton;
5408
+ cButton redoButton;
5409
+ cButton saveButton;
50305410 cButton oneStepButton;
5411
+
5412
+ cButton groupButton;
5413
+ cButton ungroupButton;
5414
+ cButton compositeButton;
5415
+
5416
+ cButton gridButton;
5417
+ cButton boxButton;
5418
+ cButton sphereButton;
5419
+ cButton coneButton;
5420
+ cButton torusButton;
5421
+ cButton superButton;
5422
+ cButton kleinButton;
5423
+ cButton particlesButton;
5424
+ cButton overlayButton;
5425
+ cButton lightButton;
50315426
50325427 cButton screenfitButton;
50335428 cButton screenfitpointButton;
....@@ -5040,14 +5435,6 @@
50405435
50415436 cButton setsupportButton;
50425437
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
-
50515438 //
50525439 //Composite
50535440 Object3D // to do !!
....@@ -5059,7 +5446,9 @@
50595446 private MenuItem lookFromItem;
50605447 private MenuItem switchItem;
50615448 private MenuItem cutItem;
5062
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
50635452 private MenuItem cloneItem;
50645453 private MenuItem cloneSupportItem;
50655454 private MenuItem overwriteGeoItem;
....@@ -5072,7 +5461,7 @@
50725461 private MenuItem linkverticesItem;
50735462 private MenuItem relinkverticesItem;
50745463 private MenuItem setMasterItem;
5075
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
50765465 private MenuItem stepAllItem;
50775466 private MenuItem revertMeshItem;
50785467 private MenuItem poseMeshItem;
....@@ -5122,6 +5511,10 @@
51225511 private MenuItem showleavesItem;
51235512 private MenuItem markleavesItem;
51245513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
51255518
51265519 private MenuItem flipVItem;
51275520 private MenuItem unflipVItem;
....@@ -5133,8 +5526,10 @@
51335526 private MenuItem panoTexturesItem;
51345527
51355528 private MenuItem resetCentroidItem;
5136
- private MenuItem transformgeometryItem;
5529
+ private MenuItem resetCentroidXZItem;
51375530 private MenuItem resetTransformItem;
5531
+ private MenuItem transformGeometryItem;
5532
+ private MenuItem transformChildrenItem;
51385533 private MenuItem hideItem;
51395534 private MenuItem grabItem;
51405535 private MenuItem backItem;
....@@ -5203,11 +5598,6 @@
52035598 private MenuItem doubleItem;
52045599 private MenuItem tripleItem;
52055600
5206
- private MenuItem importGFDItem;
5207
- private MenuItem importVRMLX3DItem;
5208
- private MenuItem import3DSItem;
5209
- private MenuItem importOBJItem;
5210
-
52115601 private MenuItem computeAOItem;
52125602 private MenuItem recompileItem;
52135603 private MenuItem editScriptItem;
....@@ -5217,4 +5607,8 @@
52175607 private MenuItem analyzeItem;
52185608 private MenuItem dumpItem;
52195609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
52205614 }