Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
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,30 +148,29 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
164155 Menu menu;
165156 oe.menuBar.add(menu = new Menu("Edit"));
166157 //editItem = menu.add(new MenuItem("Edit"));
167158 //editItem.addActionListener(this);
168
- 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"));
169166 duplicateItem.addActionListener(this);
170
- menu.add("-");
171167 cloneItem = menu.add(new MenuItem("Clone"));
172168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
173171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174172 cloneSupportItem.addActionListener(this);
173
+ }
175174 menu.add("-");
176175 cutItem = menu.add(new MenuItem("Cut"));
177176 cutItem.addActionListener(this);
....@@ -179,27 +178,123 @@
179178 copyItem.addActionListener(this);
180179 pasteItem = menu.add(new MenuItem("Paste"));
181180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
182185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183186 pasteLinkItem.addActionListener(this);
184187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185188 pasteCloneItem.addActionListener(this);
186189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
188192 clearItem = menu.add(new MenuItem("Clear"));
189193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
190198 clearAllItem = menu.add(new MenuItem("Clear All"));
191199 clearAllItem.addActionListener(this);
200
+ }
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(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.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());
192237
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(switchViewItem = 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
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
193289 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
290
+ if (Globals.ADVANCED)
291
+ {
198292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199293 revertMeshItem.addActionListener(this);
200294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201295 resetreferencesItem.addActionListener(this);
202296 menu.add("-");
297
+ }
203298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204299 overwriteGeoItem.addActionListener(this);
205300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +306,103 @@
211306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212307 overwriteUVItem.addActionListener(this);
213308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
214311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215312 generateMeshItem.addActionListener(this);
216313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217314 poseMeshItem.addActionListener(this);
218315 menu.add("-");
316
+ }
219317 resetsupportItem = menu.add(new MenuItem("Reset support"));
220318 resetsupportItem.addActionListener(this);
221319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222320 linkverticesItem.addActionListener(this);
223321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
225326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226327 setMasterItem.addActionListener(this);
328
+ }
227329
228330 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
231333 backItem = menu.add(new MenuItem("Back"));
232334 backItem.addActionListener(this);
233335 frontItem = menu.add(new MenuItem("Front"));
234336 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238343 hideItem.addActionListener(this);
344
+ }
239345 ungroupItem = menu.add(new MenuItem("Ungroup"));
240346 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Switch node"));
243
- randomItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
244354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
245355 switchGeoItem.addActionListener(this);
246356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
247357 switchTransfoItem.addActionListener(this);
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
359
+ morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
248362 physicsItem = menu.add(new MenuItem("Physics"));
249363 physicsItem.addActionListener(this);
250364 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251365 frameselectorItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
253
- morphItem.addActionListener(this);
254366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255367 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
368
+ }
258369
259370 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
262373 billboardItem = menu.add(new MenuItem("Billboard"));
263374 billboardItem.addActionListener(this);
264375 csgItem = menu.add(new MenuItem("CSG"));
265376 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267378 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269380 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
272386 linkerItem = menu.add(new MenuItem("Linker"));
273387 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276388 attributeItem = menu.add(new MenuItem("Attribute"));
277389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
278392 pointflowItem = menu.add(new MenuItem("Point Flow"));
279393 pointflowItem.addActionListener(this);
394
+ }
280395 menu.add("-");
281396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282397 resetTransformItem.addActionListener(this);
283398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284399 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
287406
288407 oe.menuBar.add(menu = new Menu("Geometry"));
289408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +413,11 @@
294413 genNormalsCADItem.addActionListener(this);
295414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
297418 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298419 genNormalsMINEItem.addActionListener(this);
420
+ }
299421 stripifyItem = menu.add(new MenuItem("Stripify"));
300422 stripifyItem.addActionListener(this);
301423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +439,34 @@
317439 reduce34MeshItem.addActionListener(this);
318440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319441 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
324450
325451 oe.menuBar.add(menu = new Menu("Attributes"));
326452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327453 clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
328458 menu.add("-");
329459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330460 liveleavesItem.addActionListener(this);
331461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
333465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334466 supportleavesItem.addActionListener(this);
335467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336468 unsupportleavesItem.addActionListener(this);
469
+ }
337470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338471 hideleavesItem.addActionListener(this);
339472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +475,14 @@
342475 markleavesItem.addActionListener(this);
343476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
345486 menu.add("-");
346487 flipVItem = menu.add(new MenuItem("Flip V"));
347488 flipVItem.addActionListener(this);
....@@ -377,35 +518,40 @@
377518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378519 sortbynameItem.addActionListener(this);
379520 menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
380528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381529 extractGeometriesItem.addActionListener(this);
382530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383531 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
532
+ }
388533
389534 oe.menuBar.add(menu = new Menu("Insert"));
390535 buildCreateMenu(menu);
391536
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403537 oe.menuBar.add(menu = new Menu("Tools"));
404538 buildToolsMenu(menu);
405539 }
406540
407541 void SetupUI2(ObjEditor oe)
408542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
409555 //new Exception().printStackTrace();
410556
411557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,93 +580,212 @@
434580 oe.radioPanel.add(dummyButton);
435581 oe.buttonGroup.add(dummyButton);
436582 */
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
586
+
437587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438588
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+ undoButton.setEnabled(false);
609
+
610
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ redoButton.setToolTipText("Redo changes");
612
+ redoButton.addActionListener(this);
613
+ redoButton.setEnabled(false);
614
+
615
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ saveButton.setToolTipText("Save changes");
617
+ saveButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
620
+ liveCB.setToolTipText("Enable animation");
441621 liveCB.addItemListener(this);
442622
443
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
623
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ oneStepButton.setToolTipText("Animate one step forward");
625
+ oneStepButton.addActionListener(this);
626
+
627
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
444628 fastCB.setToolTipText("Fast mode");
445629 fastCB.addItemListener(this);
446630
447
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
448
- trackCB.setToolTipText("Enable tracking");
449
- trackCB.addItemListener(this);
450
-
451
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
631
+ //oe.toolboxPanel.Return();
632
+
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
452634 screenfitButton.setToolTipText("Screen fit");
453635 screenfitButton.addActionListener(this);
636
+
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
454640
455641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
456642 // screenfitpointButton.addActionListener(this);
457643
458644 if (Globals.ADVANCED)
459645 {
460
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
646
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
461647 snapobjectButton.addActionListener(this);
462648 snapobjectButton.setToolTipText("Snap Object");
463649 }
464650
465
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
466
- flashSelectionButton.setToolTipText("Show selection");
467
- flashSelectionButton.addActionListener(this);
651
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
468652
469
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
470
-
471
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
472654 twoButton.setToolTipText("Show center view only");
473655 twoButton.addActionListener(this);
474
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
656
+ this.fullscreenLayout = twoButton;
657
+
658
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
475659 fourButton.addActionListener(this);
476660 fourButton.setToolTipText("Show left panel only");
477
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
478662 sixButton.setToolTipText("2-column layout left");
479663 sixButton.addActionListener(this);
480
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
481665 threeButton.setToolTipText("2-column layout right");
482666 threeButton.addActionListener(this);
483
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
484668 sevenButton.setToolTipText("3-column layout");
485669 sevenButton.addActionListener(this);
486670 //
487671
488
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
672
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
489673 rootButton.setToolTipText("Edit selection in new tab");
490674 rootButton.addActionListener(this);
491675
492
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
493677 closeButton.setToolTipText("Close tab");
494678 closeButton.addActionListener(this);
495679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
496680 //clearButton.addActionListener(this);
497
-
498
- cGridBag commandsPanel = new cGridBag();
681
+
682
+ // INSERT
683
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ gridButton.setToolTipText("Create grid");
685
+ gridButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ boxButton.setToolTipText("Create box");
689
+ boxButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
692
+ sphereButton.setToolTipText("Create sphere");
693
+ sphereButton.addActionListener(this);
694
+
695
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ coneButton.setToolTipText("Create cone");
697
+ coneButton.addActionListener(this);
698
+
699
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ torusButton.setToolTipText("Create torus");
701
+ torusButton.addActionListener(this);
702
+
703
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+ superButton.setToolTipText("Create superellipsoid");
705
+ superButton.addActionListener(this);
706
+
707
+ if (Globals.ADVANCED)
708
+ {
709
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
710
+ kleinButton.setToolTipText("Create Klein bottle");
711
+ kleinButton.addActionListener(this);
712
+ }
499713
500
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
714
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ particlesButton.setToolTipText("Create particle system");
716
+ particlesButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.Return();
719
+
720
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ groupButton.setToolTipText("Create group");
722
+ groupButton.addActionListener(this);
723
+
724
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ compositeButton.setToolTipText("Create composite");
726
+ compositeButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ switchButton.setToolTipText("Create switch");
730
+ switchButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ loopButton.setToolTipText("Create loop");
734
+ loopButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ textureButton.setToolTipText("Create texture");
738
+ textureButton.addActionListener(this);
739
+
740
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ overlayButton.setToolTipText("Create overlay");
742
+ overlayButton.addActionListener(this);
743
+
744
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ lightButton.setToolTipText("Create light");
746
+ lightButton.addActionListener(this);
747
+
748
+ for (int i=6; --i>=0;)
749
+ {
750
+ oe.toolboxPanel.Return();
751
+ oe.toolboxPanel.add(new cGridBag());
752
+ oe.toolboxPanel.add(new cGridBag());
753
+ oe.toolboxPanel.add(new cGridBag());
754
+ oe.toolboxPanel.add(new cGridBag());
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ }
759
+
760
+ // EDIT panel
761
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
501762 editButton.setToolTipText("Edit selection");
502763 editButton.addActionListener(this);
503764
504
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
765
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
505766 uneditButton.setToolTipText("Unedit selection");
506767 uneditButton.addActionListener(this);
507768
508
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
769
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
+ allParamsButton.setToolTipText("Edit all params");
771
+ allParamsButton.addActionListener(this);
772
+
773
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
509774 clearPanelButton.setToolTipText("Clear edit panel");
510775 clearPanelButton.addActionListener(this);
511776
512
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
- allParamsButton.setToolTipText("All params??");
514
- allParamsButton.addActionListener(this);
515
-
516
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
777
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517778 unselectButton.setToolTipText("Unselect");
518779 unselectButton.addActionListener(this);
519780
520
- commandsPanel.preferredHeight = 1;
781
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ flashSelectionButton.setToolTipText("Highlight selection");
783
+ flashSelectionButton.addActionListener(this);
521784
522
- oe.treePanel.add(commandsPanel);
523
- oe.treePanel.Return();
785
+ editCommandsPanel.preferredHeight = 1;
786
+
787
+// oe.treePanel.add(commandsPanel);
788
+// oe.treePanel.Return();
524789
525790 // oe.aConstraints.gridx += 1;
526791 // oe.aConstraints.weighty = 0;
....@@ -537,27 +802,12 @@
537802
538803 JScrollPane jSP;
539804 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
540
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
541806 ResetModel();
542807
543808 oe.treePanel.add(jSPPanel);
544809 oe.treePanel.Return();
545810
546
- cGridBag copyOptionsPanel = new cGridBag();
547
-
548
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
549
- colorCB.setToolTipText("Copy color when dropped");
550
- colorCB.addItemListener(this);
551
-
552
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
553
- materialCB.setToolTipText("Copy material when dropped");
554
- materialCB.addItemListener(this);
555
-
556
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
557
- textureCB.setToolTipText("Copy texture when dropped");
558
- textureCB.addItemListener(this);
559
-
560
- copyOptionsPanel.preferredHeight = 1;
561811 oe.treePanel.add(copyOptionsPanel);
562812 oe.treePanel.Return();
563813
....@@ -588,13 +838,39 @@
588838
589839 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
590840 {
841
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
842
+ colorCB.setToolTipText("Copy color when dropped");
843
+ colorCB.addItemListener(this);
844
+
845
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
846
+ materialCB.setToolTipText("Copy material when dropped");
847
+ materialCB.addItemListener(this);
848
+
849
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
850
+ textureCB.setToolTipText("Copy texture when dropped");
851
+ textureCB.addItemListener(this);
852
+
853
+ panel.Return();
854
+
855
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
856
+ boxCB.setToolTipText("Display bounding boxes");
857
+ boxCB.addItemListener(this);
858
+
859
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
861
+ zoomBoxCB.addItemListener(this);
862
+
863
+ if (true) // Globals.ADVANCED)
864
+ {
591865 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
592
- supportCB.setToolTipText("Enabled rigging");
866
+ supportCB.setToolTipText("Enable rigging");
593867 supportCB.addItemListener(this);
594868
595869 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
596870 // localCB.addItemListener(this);
597871
872
+ panel.Return();
873
+
598874 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
599875 crowdCB.setToolTipText("Used for crowds");
600876 crowdCB.addItemListener(this);
....@@ -607,18 +883,12 @@
607883 slowCB.setToolTipText("Smooth interpolation");
608884 slowCB.addItemListener(this);
609885
610
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
611
- boxCB.setToolTipText("Display bounding boxes");
612
- boxCB.addItemListener(this);
613
-
614
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
615
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
616
- zoomBoxCB.addItemListener(this);
617
-
618886 // constraints.gridy += 1;
619887 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
620888 // speakerMocapCB.addItemListener(this);
621889
890
+ panel.Return();
891
+
622892 if (false)
623893 {
624894 // handled in scripts
....@@ -633,30 +903,72 @@
633903 //constraints.gridy += 1;
634904 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
635905 smoothfocusCB.addItemListener(this);
906
+ panel.Return();
636907 }
637908
638909 //constraints.gridx += 1;
639910 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
640911 // debugCB.addItemListener(this);
641912
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
642917 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
643919 oeilCB.addItemListener(this);
644920
921
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
+ shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.addItemListener(this);
924
+
925
+ panel.Return();
926
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
927
+ toggleTextureCB.setToolTipText("Load textures");
928
+ toggleTextureCB.addItemListener(this);
929
+
930
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
+ toggleSwitchCB.setToolTipText("Use switch");
932
+ toggleSwitchCB.addItemListener(this);
933
+
934
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
+ autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.addItemListener(this);
937
+
938
+ panel.Return();
939
+ if (Globals.ADVANCED)
940
+ {
645941 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
646942 lookAtCB.setToolTipText("Look-at target");
647943 lookAtCB.addItemListener(this);
944
+ }
945
+
946
+ }
648947
649948 cGridBag fill = new cGridBag();
650
-
651949 fill.preferredHeight = 200;
950
+ cGridBag fill2 = new cGridBag();
951
+ fill2.preferredHeight = 200;
952
+ cGridBag fill3 = new cGridBag();
953
+ fill3.preferredHeight = 200;
652954
653955 panel.add(fill);
956
+ panel.add(fill2);
957
+ panel.add(fill3);
654958
655959 }
656960
657961 void EditObject(Object3D obj)
658962 {
659963 cRadio radioButton = new cRadio(obj.name);
964
+
965
+ // Patch to avoid bug with transparency.
966
+ radioButton.hadMaterial = obj.material != null;
967
+ if (!radioButton.hadMaterial)
968
+ {
969
+ obj.material = new cMaterial();
970
+ }
971
+
660972 radioButton.SetObject(obj);
661973 radioButton.layout = sevenButton;
662974 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -665,8 +977,11 @@
665977 buttonGroup.add(radioButton);
666978 radioButton.doClick();
667979 }
980
+
668981 void SetupViews(ObjEditor oe)
669982 {
983
+ theFrame = this;
984
+
670985 oe.SetupViews();
671986
672987 System.out.println("SetupViews");
....@@ -675,23 +990,27 @@
675990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
676991 }
677992
678
- JCheckBox liveCB;
679
- JCheckBox supportCB;
680
- JCheckBox localCB;
681
- JCheckBox crowdCB;
682
- JCheckBox smoothCB;
683
- JCheckBox fastCB;
684
- JCheckBox slowCB;
685
- JCheckBox boxCB;
686
- JCheckBox zoomBoxCB;
687
- JCheckBox trackCB;
688
- JCheckBox smoothfocusCB;
993
+ cToggleButton liveCB;
994
+ cCheckBox supportCB;
995
+ cCheckBox localCB;
996
+ cCheckBox crowdCB;
997
+ cCheckBox smoothCB;
998
+ cToggleButton fastCB;
999
+ cCheckBox slowCB;
1000
+ cCheckBox boxCB;
1001
+ cCheckBox zoomBoxCB;
1002
+ //cToggleButton trackCB;
1003
+ cCheckBox trackCB;
1004
+ cCheckBox smoothfocusCB;
6891005 // JCheckBox speakerMocapCB;
690
- JCheckBox speakerCameraCB;
691
- JCheckBox speakerFocusCB;
692
- JCheckBox debugCB;
693
- JCheckBox oeilCB;
694
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
6951014
6961015 // static int COLOR = 1;
6971016 // static int MATERIAL = 2;
....@@ -699,9 +1018,9 @@
6991018
7001019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7011020
702
- JCheckBox colorCB;
703
- JCheckBox materialCB;
704
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
7051024
7061025 public void itemStateChanged(ItemEvent e)
7071026 {
....@@ -729,6 +1048,7 @@
7291048 } else if(e.getSource() == liveCB)
7301049 {
7311050 cameraView.ToggleLive();
1051
+ refreshContents(false);
7321052 }
7331053 else if(e.getSource() == supportCB)
7341054 {
....@@ -793,6 +1113,14 @@
7931113 {
7941114 cameraView.ToggleOeil();
7951115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
7961124 else if(e.getSource() == lookAtCB)
7971125 {
7981126 cameraView.ToggleLookAt();
....@@ -809,7 +1137,8 @@
8091137
8101138 /**/
8111139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
812
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
8131142 if ((path == null) || (path.getPathCount() <= 1)) {
8141143 // We can't move the root node or an empty selection
8151144 return;
....@@ -881,7 +1210,9 @@
8811210 // objEditor.DropFile((java.io.File[]) object, true);
8821211 // return;
8831212 // }
884
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8851216 {
8861217 // file(s)
8871218 String[] names = string.split("\n");
....@@ -908,7 +1239,7 @@
9081239
9091240 flashIt = false;
9101241 CameraPane pane = (CameraPane) target;
911
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9121243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9131244
9141245 if (group.selection.size() == 1)
....@@ -924,23 +1255,33 @@
9241255
9251256 assert target == objEditor.jTree;
9261257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
9271259 try {
928
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9291261 } catch (Exception e) {
9301262 System.out.println("destinationPath : " + destinationPath);
9311263 return;
9321264 }
9331265
934
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
9351267 {
1268
+ Object3D child = (Object3D)group.selection.elementAt(i);
1269
+
1270
+ // Cannot move into itself
1271
+ if (child == destinationLeaf)
1272
+ return;
1273
+ }
1274
+
1275
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1276
+// {
9361277 loadClipboard(true);
9371278 objEditor.jTree.setSelectionPath(destinationPath);
938
- pasteInto(false);
939
- } else {
940
- loadClipboard(false);
941
- objEditor.jTree.setSelectionPath(destinationPath);
942
- pasteInto(false); // true); // ???
943
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9441285 }
9451286 public void dropActionChanged(DropTargetDragEvent dtde)
9461287 // Called if the user has modified the current drop gesture
....@@ -1045,54 +1386,71 @@
10451386 {
10461387 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10471388 //heightFieldItem.addActionListener(this);
1048
- gridItem = menu.add(new MenuItem("Grid"));
1049
- gridItem.addActionListener(this);
1050
- rectoidItem = menu.add(new MenuItem("Box"));
1051
- rectoidItem.addActionListener(this);
1052
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1053
- ellipsoidItem.addActionListener(this);
1054
- coneItem = menu.add(new MenuItem("Cone"));
1055
- coneItem.addActionListener(this);
1056
- torusItem = menu.add(new MenuItem("Torus"));
1057
- torusItem.addActionListener(this);
1058
- superItem = menu.add(new MenuItem("Superellipsoid"));
1059
- superItem.addActionListener(this);
1389
+// gridItem = menu.add(new MenuItem("Grid"));
1390
+// gridItem.addActionListener(this);
1391
+// rectoidItem = menu.add(new MenuItem("Box"));
1392
+// rectoidItem.addActionListener(this);
1393
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1394
+// ellipsoidItem.addActionListener(this);
1395
+// coneItem = menu.add(new MenuItem("Cone"));
1396
+// coneItem.addActionListener(this);
1397
+// torusItem = menu.add(new MenuItem("Torus"));
1398
+// torusItem.addActionListener(this);
1399
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1400
+// superItem.addActionListener(this);
1401
+
1402
+ cameraItem = menu.add(new MenuItem("Camera"));
1403
+ cameraItem.addActionListener(this);
1404
+
1405
+ if (!Globals.ADVANCED)
1406
+ {
10601407 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10611408 kleinItem.addActionListener(this);
1062
- particleItem = menu.add(new MenuItem("Particle system"));
1063
- particleItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10641415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10651416 ragdollItem.addActionListener(this);
10661417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10671418 ragdoll2Item.addActionListener(this);
1419
+ }
10681420 menu.add("-");
1069
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10701422 meshItem.addActionListener(this);
10711423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10721424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10731427 springItem = menu.add(new MenuItem("Spring"));
10741428 springItem.addActionListener(this);
10751429 flagItem = menu.add(new MenuItem("Flag"));
10761430 flagItem.addActionListener(this);
1077
- bezierItem = menu.add(new MenuItem("Patch"));
1078
- bezierItem.addActionListener(this);
1079
- checkerItem = menu.add(new MenuItem("Checker"));
1080
- checkerItem.addActionListener(this);
10811431 blobItem = menu.add(new MenuItem("Blob"));
10821432 blobItem.addActionListener(this);
10831433 latheItem = menu.add(new MenuItem("Lathe"));
10841434 latheItem.addActionListener(this);
1085
- lightItem = menu.add(new MenuItem("Light"));
1086
- lightItem.addActionListener(this);
1435
+ }
1436
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1437
+ bezierItem.addActionListener(this);
1438
+// overlayItem = menu.add(new MenuItem("Overlay"));
1439
+// overlayItem.addActionListener(this);
1440
+// lightItem = menu.add(new MenuItem("Light"));
1441
+// lightItem.addActionListener(this);
10871442 menu.add("-");
10881443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10891444 //superLoopItem.addActionListener(this);
1090
- loopItem = menu.add(new MenuItem("Loop"));
1091
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
10921447 doubleItem = menu.add(new MenuItem("Fork"));
10931448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
10941451 tripleItem = menu.add(new MenuItem("Trident"));
10951452 tripleItem.addActionListener(this);
1453
+ }
10961454 }
10971455
10981456 void buildToolsMenu(Menu menu)
....@@ -1106,24 +1464,26 @@
11061464 parseverticesItem.addActionListener(this);
11071465 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11081466 textureFieldItem.addActionListener(this);
1109
- alignItem = menu.add(new MenuItem("Align"));
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
11101468 alignItem.addActionListener(this);
1111
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1112
- mirrorItem.addActionListener(this);
11131469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11141470 reduceMorphItem.addActionListener(this);
11151471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11161472 reduce34MorphItem.addActionListener(this);
1117
-
1473
+ menu.add("-");
11181474 menu.add(computeAOItem = new MenuItem("Compute AO"));
11191475 computeAOItem.addActionListener(this);
1120
- menu.add("-");
11211476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
11221482 menu.add(memoryItem = new MenuItem("Memory Usage"));
11231483 memoryItem.addActionListener(this);
11241484 menu.add(analyzeItem = new MenuItem("Analyze"));
11251485 analyzeItem.addActionListener(this);
1126
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
11271487 dumpItem.addActionListener(this);
11281488 // menu.add(pathItem = new MenuItem("From-to path"));
11291489 // pathItem.addActionListener(this);
....@@ -1141,6 +1501,7 @@
11411501 menu.add("-");
11421502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11431503 editScriptItem.addActionListener(this);
1504
+ }
11441505 }
11451506
11461507 void ScreenFit()
....@@ -1263,6 +1624,7 @@
12631624 shadow.material = new cMaterial(obj.material);
12641625 shadow.material.diffuse = 0.0001f;
12651626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12661628
12671629 makeSomething(shadow);
12681630 }
....@@ -1469,9 +1831,9 @@
14691831
14701832 void Overwrite(int mask)
14711833 {
1472
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14731835 {
1474
- Object3D content = GrafreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
14751837
14761838 if (content instanceof cGroup && ((cGroup)content).transientlink )
14771839 content = ((cGroup)content).get(0);
....@@ -1510,7 +1872,7 @@
15101872 {
15111873 ScreenFit();
15121874 } else
1513
- if (source == switchItem)
1875
+ if (source == switchViewItem)
15141876 {
15151877 cVector v1 = new cVector();
15161878 cVector v2 = new cVector();
....@@ -1519,11 +1881,11 @@
15191881 objEditor.cameraView.renderCamera.setAim(v2, v1);
15201882 objEditor.cameraView.repaint();
15211883 } else
1522
- if (source == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
15231885 {
15241886 makeSomething(new Box());
15251887 } else
1526
- if (source == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
15271889 {
15281890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15291891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1602,27 +1964,27 @@
16021964
16031965 makeSomething(obj);
16041966 } else
1605
- if (source == gridItem)
1967
+ if (source == gridItem || source == gridButton)
16061968 {
16071969 makeSomething(new Grid());
16081970 } else
1609
- if (source == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
16101972 {
16111973 makeSomething(new Sphere());
16121974 } else
1613
- if (source == coneItem)
1975
+ if (source == coneItem || source == coneButton)
16141976 {
16151977 makeSomething(new Cone());
16161978 } else
1617
- if (source == torusItem)
1979
+ if (source == torusItem || source == torusButton)
16181980 {
16191981 makeSomething(new Torus());
16201982 } else
1621
- if (source == superItem)
1983
+ if (source == superItem || source == superButton)
16221984 {
16231985 makeSomething(new Superellipsoid());
16241986 } else
1625
- if (source == kleinItem)
1987
+ if (source == kleinItem || source == kleinButton)
16261988 {
16271989 makeSomething(new Klein());
16281990 } else
....@@ -1642,7 +2004,7 @@
16422004 {
16432005 makeSomething(new BezierSurface());
16442006 } else
1645
- if (source == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
16462008 {
16472009 /*
16482010 Object3D obj = new BezierSurface(5,8);
....@@ -1690,7 +2052,7 @@
16902052 s.setup();
16912053 makeSomething(s);
16922054 } else
1693
- if (source == lightItem)
2055
+ if (source == lightItem || source == lightButton)
16942056 {
16952057 makeSomething(new Light());
16962058 } else
....@@ -1740,7 +2102,7 @@
17402102
17412103 group(g);
17422104 } else
1743
- if (source == loopItem)
2105
+ if (source == loopItem || source == loopButton)
17442106 {
17452107 Composite csg = new GroupLeaf();
17462108 csg.count = 5;
....@@ -1776,23 +2138,6 @@
17762138 csg.addChild(child);
17772139 child.addChild(csg);
17782140 } else
1779
-
1780
- if (source == importGFDItem)
1781
- {
1782
- ImportGFD();
1783
- } else
1784
- if (source == importVRMLX3DItem)
1785
- {
1786
- ImportVRMLX3D();
1787
- } else
1788
- if (source == import3DSItem)
1789
- {
1790
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1791
- } else
1792
- if (source == importOBJItem)
1793
- {
1794
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1795
- } else
17962141 if (source == computeAOItem)
17972142 {
17982143 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1811,7 +2156,7 @@
18112156 if (source == invariantsItem)
18122157 {
18132158 System.out.println("Invariants:");
1814
- GrafreeD.grafreeD.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
18152160 } else
18162161 if (source == memoryItem)
18172162 {
....@@ -1829,6 +2174,35 @@
18292174 if (source == dumpItem)
18302175 {
18312176 DumpObject();
2177
+ } else
2178
+ if (source == minButton)
2179
+ {
2180
+ Minimize();
2181
+ } else
2182
+ if (source == maxButton)
2183
+ {
2184
+ Maximize();
2185
+ } else
2186
+ if (source == fullButton)
2187
+ {
2188
+ ToggleFullScreen();
2189
+ } else
2190
+ if (source == undoButton)
2191
+ {
2192
+ Undo();
2193
+ } else
2194
+ if (source == redoButton)
2195
+ {
2196
+ Redo();
2197
+ } else
2198
+ if (source == saveButton)
2199
+ {
2200
+ Save();
2201
+ } else
2202
+ if (source == oneStepButton)
2203
+ {
2204
+ Globals.ONESTEP = true;
2205
+ cameraView.repaint();
18322206 } else
18332207 if (source == screenfitButton)
18342208 {
....@@ -1879,12 +2253,20 @@
18792253 {
18802254 loadClipboard(true);
18812255 } else
2256
+ if (source == undoItem)
2257
+ {
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
18822264 if (source == duplicateItem)
18832265 {
1884
- Object3D keep = GrafreeD.clipboard;
2266
+ Object3D keep = Grafreed.clipboard;
18852267 loadClipboard(false);
18862268 paste(false);
1887
- GrafreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
18882270 } else
18892271 if (source == cloneItem)
18902272 {
....@@ -1902,13 +2284,17 @@
19022284 {
19032285 paste(false);
19042286 } else
2287
+ if (source == pasteIntoItem)
2288
+ {
2289
+ pasteInto(true, false);
2290
+ } else
19052291 if (source == pasteLinkItem)
19062292 {
1907
- pasteInto(false);
2293
+ pasteInto(false, false);
19082294 } else
19092295 if (source == pasteCloneItem)
19102296 {
1911
- pasteInto(true);
2297
+ pasteInto(true, true);
19122298 } else
19132299 if (source == pasteExpandItem)
19142300 {
....@@ -2100,9 +2486,9 @@
21002486 // group.selection.get(0).setMasterThis(content); // should be identity
21012487 // refreshContents();
21022488 // }
2103
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21042490 {
2105
- Object3D content = GrafreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
21062492
21072493 if (content instanceof cGroup && ((cGroup)content).transientlink )
21082494 content = ((cGroup)content).get(0);
....@@ -2110,11 +2496,11 @@
21102496 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21112497 for (int i=0; i<group.selection.size(); i++)
21122498 {
2113
- boolean random = CameraPane.RANDOM;
2114
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21152501 group.selection.get(i).linkVerticesThis(content);
21162502 // group.selection.get(i).setMasterThis(content); // should be identity
2117
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
21182504 }
21192505 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21202506 refreshContents();
....@@ -2124,20 +2510,20 @@
21242510 {
21252511 for (int i=0; i<group.selection.size(); i++)
21262512 {
2127
- boolean random = CameraPane.RANDOM;
2128
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
21292515 group.selection.get(i).linkVerticesThis(null);
2130
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
21312517 }
21322518
21332519 refreshContents();
21342520 } else
21352521 if (source == relinkverticesItem)
21362522 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
21392525 group.selection.RelinkToSupport();
2140
- CameraPane.RANDOM = random;
2526
+ CameraPane.SWITCH = random;
21412527
21422528 refreshContents();
21432529 } else
....@@ -2152,9 +2538,9 @@
21522538 } else
21532539 if (source == setMasterItem)
21542540 {
2155
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21562542 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
21582544
21592545 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602546 content = ((cGroup)content).get(0);
....@@ -2167,9 +2553,9 @@
21672553 {
21682554 if (group.selection.size() == 1)
21692555 {
2170
- if (GrafreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
21712557 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
21732559
21742560 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752561 content = ((cGroup)content).get(0);
....@@ -2186,7 +2572,7 @@
21862572 {
21872573 RevertMeshes();
21882574 } else
2189
- if (source == resetMeshItem)
2575
+ if (source == resetAllItem)
21902576 {
21912577 ResetAll();
21922578 } else
....@@ -2206,9 +2592,9 @@
22062592 {
22072593 ClearSelection(true);
22082594 } else
2209
- if (source == grabItem)
2595
+ if (source == grabItem || source == groupButton)
22102596 {
2211
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
22122598 } else
22132599 if (source == hideItem)
22142600 {
....@@ -2226,11 +2612,11 @@
22262612 {
22272613 makeSomething(new Camera());
22282614 } else
2229
- if (source == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
22302616 {
22312617 group(new Composite());
22322618 } else
2233
- if (source == randomItem)
2619
+ if (source == switchItem || source == switchButton)
22342620 {
22352621 RandomNode random = new RandomNode();
22362622 group(random);
....@@ -2332,7 +2718,7 @@
23322718 {
23332719 group(new cLinker());
23342720 } else
2335
- if (source == textureItem)
2721
+ if (source == textureItem || source == textureButton)
23362722 {
23372723 group(new TextureNode());
23382724 } else
....@@ -2352,7 +2738,7 @@
23522738 {
23532739 CastShadow(2);
23542740 } else
2355
- if (source == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
23562742 {
23572743 //ungroup();
23582744 for (int i=0; i<group.selection.size(); i++)
....@@ -2374,7 +2760,7 @@
23742760 } else
23752761 if (source == genNormalsMESHItem)
23762762 {
2377
- GenNormals(true); // TODO
2763
+ GenNormalsMESH();
23782764 } else
23792765 if (source == genNormalsORGANItem)
23802766 {
....@@ -2439,6 +2825,22 @@
24392825 if (source == unmarkleavesItem)
24402826 {
24412827 MarkLeaves(false);
2828
+ } else
2829
+ if (source == rewindleavesItem)
2830
+ {
2831
+ RewindLeaves(true);
2832
+ } else
2833
+ if (source == unrewindleavesItem)
2834
+ {
2835
+ RewindLeaves(false);
2836
+ } else
2837
+ if (source == randomleavesItem)
2838
+ {
2839
+ RandomLeaves(true);
2840
+ } else
2841
+ if (source == unrandomleavesItem)
2842
+ {
2843
+ RandomLeaves(false);
24422844 } else
24432845 if (source == flipVItem)
24442846 {
....@@ -2524,9 +2926,13 @@
25242926 {
25252927 SmoothMesh();
25262928 } else
2527
- if (source == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
25282930 {
25292931 TransformGeometry();
2932
+ } else
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
25302936 } else
25312937 if (source == resetTransformItem)
25322938 {
....@@ -2534,7 +2940,11 @@
25342940 } else
25352941 if (source == resetCentroidItem)
25362942 {
2537
- ResetCentroid();
2943
+ ResetCentroid(true);
2944
+ } else
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
25382948 } else
25392949 if (source == resetParentItem)
25402950 {
....@@ -2666,6 +3076,10 @@
26663076 if (source == twoButton)
26673077 {
26683078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
26693083 // bug
26703084 //gridPanel.setDividerLocation(1.0);
26713085 //bigPanel.setDividerLocation(0.0);
....@@ -2698,10 +3112,31 @@
26983112 bigThree.ClearUI();
26993113 bigThree.add(centralPanel);
27003114 bigThree.FlushUI();
3115
+
3116
+ cameraView.requestFocusInWindow();
3117
+
3118
+// refreshContents(true);
3119
+//
3120
+// try
3121
+// {
3122
+// java.awt.Robot bot = new java.awt.Robot();
3123
+// int mask = InputEvent.BUTTON1_MASK;
3124
+// bot.mouseMove(100, 100);
3125
+// bot.mousePress(mask);
3126
+// bot.mouseRelease(mask);
3127
+// }
3128
+// catch (Exception e)
3129
+// {
3130
+//
3131
+// }
3132
+
27013133 } else
27023134 if (source == threeButton)
27033135 {
27043136 radio.layout = threeButton;
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
27053140
27063141 // bigThree.remove(scenePanel);
27073142 // bigThree.remove(centralPanel);
....@@ -2734,10 +3169,15 @@
27343169 bigThree.add(centralPanel);
27353170 bigThree.add(XYZPanel);
27363171 bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
27373174 } else
27383175 if (source == fourButton)
27393176 {
27403177 radio.layout = fourButton;
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
27413181
27423182 // bigThree.remove(scenePanel);
27433183 // bigThree.remove(centralPanel);
....@@ -2769,10 +3209,15 @@
27693209 bigThree.ClearUI();
27703210 bigThree.add(scenePanel);
27713211 bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
27723214 } else
27733215 if (source == sixButton)
27743216 {
27753217 radio.layout = sixButton;
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
27763221
27773222 // bigThree.remove(scenePanel);
27783223 // bigThree.remove(centralPanel);
....@@ -2805,10 +3250,15 @@
28053250 bigThree.add(scenePanel);
28063251 bigThree.add(centralPanel);
28073252 bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
28083255 } else
28093256 if (source == sevenButton)
28103257 {
28113258 radio.layout = sevenButton;
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
28123262
28133263 // bigThree.remove(scenePanel);
28143264 // bigThree.remove(centralPanel);
....@@ -2842,6 +3292,8 @@
28423292 bigThree.add(centralPanel);
28433293 bigThree.add(XYZPanel);
28443294 bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
28453297 } else
28463298 if (source == rootButton)
28473299 {
....@@ -2853,6 +3305,7 @@
28533305 EditObject(obj);
28543306 }
28553307
3308
+ cameraView.requestFocusInWindow();
28563309 refreshContents(true);
28573310 } else
28583311 if (source == closeButton)
....@@ -2862,22 +3315,37 @@
28623315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28633316 {
28643317 ab = (cRadio)e.nextElement();
2865
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28663319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
28673326 buttonGroup.remove(ab);
28683327 radioPanel.remove(ab);
28693328
2870
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
28713331 // ab.GetObject().objectUI = null; // ?????????
28723332
28733333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28743334 break;
28753335 }
28763336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
28773339 refreshContents(true);
28783340 } else
28793341 if (source == editItem || source == editButton)
28803342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
28813349 EditSelection(false);
28823350 } else
28833351 if (source == uneditButton)
....@@ -2887,12 +3355,13 @@
28873355 Object3D child = (Object3D)e.nextElement();
28883356 if(child.editWindow != null)
28893357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
28903359 child.CloseUI();
28913360 listUI.remove(child);
28923361
2893
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
28943363 }
2895
- objEditor.ctrlPanel.validate();
3364
+ objEditor.ctrlPanel.FlushUI();
28963365 //objEditor.jTree.clearSelection();
28973366 //objEditor.ResetSliders();
28983367 refreshContents(true);
....@@ -2903,6 +3372,7 @@
29033372 //copy.ClearUI();
29043373 for (Object3D obj : listUI)
29053374 {
3375
+ obj.pinned = true;
29063376 obj.CloseUI();
29073377 }
29083378 listUI.clear();
....@@ -2912,7 +3382,7 @@
29123382 {
29133383 assert(copy == group);
29143384
2915
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29163386
29173387 for (Object3D obj : listUI)
29183388 {
....@@ -2976,7 +3446,11 @@
29763446 frontView.object = group;
29773447 sideView.object = group;
29783448 }
2979
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
29803454 /*
29813455 currentLayout = radio.layout;
29823456 if (currentLayout == null)
....@@ -2988,8 +3462,23 @@
29883462 //group.parent = null; // ROOT
29893463 //group.attributes = -1;
29903464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
29913467 refreshContents(true);
2992
- }
3468
+ } else if (event.getSource() == editCameraItem)
3469
+ {
3470
+ cameraView.ProtectCamera();
3471
+ cameraView.repaint();
3472
+ return;
3473
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3474
+ {
3475
+ cameraView.RevertCamera();
3476
+ cameraView.repaint();
3477
+ return;
3478
+ // } else if (event.getSource() == textureButton)
3479
+ // {
3480
+ // return; // true;
3481
+ }
29933482 else
29943483 {
29953484 //return super.action(event, arg);
....@@ -2998,7 +3487,6 @@
29983487 }
29993488
30003489 boolean useclient = false;
3001
- cRadio radio;
30023490
30033491 void ToggleRoot()
30043492 {
....@@ -3050,6 +3538,28 @@
30503538 refreshContents();
30513539 }
30523540
3541
+ void TransformChildren()
3542
+ {
3543
+ Object3D obj;
3544
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3545
+ {
3546
+ obj = (Object3D)e.nextElement();
3547
+ obj.KeepTextureMatrices();
3548
+ obj.TransformChildren();
3549
+ obj.RestoreTextureMatrices();
3550
+
3551
+// if (obj.parent == null)
3552
+// {
3553
+// System.out.println("NULL PARENT!");
3554
+// new Exception().printStackTrace();
3555
+// }
3556
+// else
3557
+// TouchTransform(obj);
3558
+// //obj.parent.Touch();
3559
+ }
3560
+
3561
+ refreshContents();
3562
+ }
30533563
30543564 void ResetTransform()
30553565 {
....@@ -3162,7 +3672,7 @@
31623672 refreshContents();
31633673 }
31643674
3165
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
31663676 {
31673677 Object3D obj;
31683678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3177,12 +3687,16 @@
31773687 LA.matIdentity(Object3D.mat);
31783688 obj.getBounds(minima, maxima, false);
31793689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3180
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31813692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31823693 obj.TransformMesh(Object3D.mat);
3694
+
31833695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3184
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31853698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
31863700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31873701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31883702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3211,7 +3725,8 @@
32113725
32123726 int size = obj.MemorySize();
32133727
3214
- System.err.println((size/1024) + " KB is the size of " + obj);
3728
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3729
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32153730 }
32163731 }
32173732 catch (Exception e)
....@@ -3248,9 +3763,9 @@
32483763 obj = (Object3D)e.nextElement();
32493764
32503765 System.out.println("Object is: " + obj);
3251
- GrafreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
32523767 System.out.println("Boundary rep: " + obj.bRep);
3253
- GrafreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
32543769
32553770 // System.err.println((size/1024) + " KB is the size of " + obj);
32563771 }
....@@ -3292,6 +3807,13 @@
32923807 void GenNormals(boolean crease)
32933808 {
32943809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
32953817
32963818 refreshContents();
32973819 }
....@@ -3464,8 +3986,8 @@
34643986
34653987 void ParseVertices()
34663988 {
3467
- boolean epsequal = GrafreeD.epsequal;
3468
- GrafreeD.epsequal = true;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
34693991
34703992 for (int i=0; i<group.selection.size(); i++)
34713993 {
....@@ -3490,7 +4012,7 @@
34904012 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34914013 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34924014
3493
- g.add(GrafreeD.clipboard);
4015
+ g.add(Grafreed.clipboard);
34944016
34954017 buffer.add(g);
34964018 }
....@@ -3505,7 +4027,7 @@
35054027 makeSomething(buffer, i==group.selection.size()-1);
35064028 }
35074029
3508
- GrafreeD.epsequal = epsequal;
4030
+ Grafreed.epsequal = epsequal;
35094031
35104032 refreshContents();
35114033 }
....@@ -3523,7 +4045,16 @@
35234045 String pigment = Object3D.GetPigment(tex);
35244046 //String bump = Object3D.GetBump(tex);
35254047
3526
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4048
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4049
+
4050
+ try
4051
+ {
4052
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4053
+ }
4054
+ catch (Exception e)
4055
+ {
4056
+ System.err.println("FAIL: " + node);
4057
+ }
35274058
35284059 double s = v.s;
35294060
....@@ -3611,11 +4142,11 @@
36114142
36124143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36134144
3614
- boolean random = CameraPane.RANDOM;
3615
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
36164147 lowres.linkVerticesThis(null);
36174148 lowres.linkVerticesThis(sn);
3618
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
36194150
36204151 System.err.flush();
36214152
....@@ -3655,7 +4186,7 @@
36554186 return;
36564187
36574188 Object3D poses = group.selection.get(0);
3658
- Object3D ref = GrafreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
36594190
36604191 Object3D newgroup = new Object3D("Po:" + poses.name);
36614192
....@@ -3849,9 +4380,9 @@
38494380
38504381 void ClipMesh()
38514382 {
3852
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38534384 {
3854
- Object3D content = GrafreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
38554386
38564387 if (content instanceof cGroup && ((cGroup)content).transientlink )
38574388 content = ((cGroup)content).get(0);
....@@ -3860,7 +4391,7 @@
38604391 // {
38614392 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38624393 // }
3863
- group.selection.ClipMesh(GrafreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
38644395 }
38654396 // group.selection.ClipMesh(GrafreeD.clipboard);
38664397 System.out.println("DONE.");
....@@ -3907,6 +4438,18 @@
39074438 void MarkLeaves(boolean hide)
39084439 {
39094440 group.selection.MarkLeaves(hide);
4441
+ refreshContents();
4442
+ }
4443
+
4444
+ void RewindLeaves(boolean hide)
4445
+ {
4446
+ group.selection.RewindLeaves(hide);
4447
+ refreshContents();
4448
+ }
4449
+
4450
+ void RandomLeaves(boolean hide)
4451
+ {
4452
+ group.selection.RandomLeaves(hide);
39104453 refreshContents();
39114454 }
39124455
....@@ -3981,10 +4524,6 @@
39814524 // }
39824525 // }
39834526
3984
- static boolean allparams = true;
3985
-
3986
- static Vector<Object3D> listUI = new Vector<Object3D>();
3987
-
39884527 void EditSelection(boolean newWindow)
39894528 {
39904529 // aConstraints.gridy = 0;
....@@ -3992,10 +4531,10 @@
39924531 {
39934532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39944533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3995
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39964535
39974536 Object3D elem = (Object3D)group.selection.elementAt(i);
3998
- if(elem != group)
4537
+ if(elem != group || !newWindow)
39994538 {
40004539 // if (!(elem instanceof Composite))
40014540 // newWindow = false;
....@@ -4078,6 +4617,17 @@
40784617
40794618 freezemodel = true;
40804619
4620
+ //for (Object3D obj : listUI)
4621
+ for (int i=listUI.size(); --i>=0;)
4622
+ {
4623
+ Object3D obj = listUI.elementAt(i);
4624
+ if (!obj.pinned)
4625
+ {
4626
+ obj.CloseUI();
4627
+ listUI.remove(i);
4628
+ }
4629
+ }
4630
+
40814631 /**/
40824632 //switch (event.id)
40834633 {
....@@ -4085,7 +4635,6 @@
40854635 //case 702: // Event.LIST_DESELECT
40864636 group.deselectAll();
40874637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4088
- objEditor.ClearInfo(); // .GetMaterial());
40894638 if (tps != null)
40904639 {
40914640 for (int i=0; i < tps.length; i++)
....@@ -4094,10 +4643,8 @@
40944643
40954644 //if (child.parent != null)
40964645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
40974647 group.addSelectee(child);
4098
- objEditor.SetMaterial(child); // .GetMaterial());
4099
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4100
- System.err.println("info : " + child.GetPath());
41014648 }
41024649 }
41034650 // else
....@@ -4107,20 +4654,28 @@
41074654 // System.err.println("info : " + group.GetPath());
41084655 // }
41094656
4110
- objEditor.SetText(); // jan 2014
4111
-
4112
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4657
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41134658 CameraPane.flash = true;
41144659
4115
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41164661 // a camera
41174662 {
4118
- CameraPane.camerachangeframe = 0; // don't refuse it
4119
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4663
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4664
+ {
4665
+ CameraPane.camerachangeframe = 0; // don't refuse it
4666
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4667
+ }
41204668 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41214669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41224670 }
41234671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
41244679 refreshContents();
41254680 //return true;
41264681 }
....@@ -4129,6 +4684,33 @@
41294684
41304685 freezemodel = false;
41314686 }
4687
+
4688
+ void SetPinStates(boolean enabled)
4689
+ {
4690
+ editButton.setEnabled(enabled);
4691
+ uneditButton.setEnabled(enabled);
4692
+ }
4693
+
4694
+ void refreshContents(boolean cp)
4695
+ {
4696
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4698
+ {
4699
+ objEditor.ClearInfo(); // .GetMaterial());
4700
+
4701
+ for (int i=0; i < group.selection.Size(); i++)
4702
+ {
4703
+ Object3D child = (Object3D) group.selection.get(i);
4704
+
4705
+ objEditor.AddInfo(child, this, true);
4706
+ System.err.println("info : " + child.GetPath());
4707
+ }
4708
+
4709
+ objEditor.SetText(); // jan 2014
4710
+ }
4711
+
4712
+ super.refreshContents(cp);
4713
+ }
41324714
41334715 void linkSomething(Object3D thing)
41344716 {
....@@ -4200,16 +4782,19 @@
42004782 {
42014783 if (group.selection.isEmpty())
42024784 return;
4203
- GrafreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
42044787 Composite tGroup = null;
42054788 if (group.selection.size() > 0) // 1)
42064789 {
42074790 tGroup = new cGroup();
4208
- GrafreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
42094792 }
42104793
42114794 if (cut)
42124795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
42134798 //int indices[] = jList.getSelectedIndices();
42144799 //for (int i = indices.length - 1; i >= 0; i--)
42154800 //jList.remove(indices[i]);
....@@ -4245,16 +4830,16 @@
42454830 //System.out.println("cut " + child);
42464831 //System.out.println("parent = " + child.parent);
42474832 // tmp.addChild(child);
4248
- if (GrafreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
42494834 tGroup.add/*Child*/(tmp);
42504835 else
4251
- GrafreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
42524837 }
42534838 else
4254
- if (GrafreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
42554840 tGroup.add/*Child*/(child);
42564841 else
4257
- GrafreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
42584843 }
42594844
42604845 //ResetModel();
....@@ -4286,21 +4871,23 @@
42864871 //System.out.println("cut " + elem);
42874872 //System.out.println("parent = " + elem.parent);
42884873 // tmp.addChild(elem);
4289
- if (GrafreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
42904875 tGroup.add/*Child*/(tmp);
42914876 else
4292
- GrafreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
42934878 }
42944879 else
4295
- if (GrafreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
42964881 tGroup.add/*Child*/(child);
42974882 else
4298
- GrafreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
42994884 }
43004885
43014886 }
4302
- if (GrafreeD.clipboardIsTempGroup)
4303
- GrafreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
43044891 if (cut)
43054892 {
43064893 ResetModel();
....@@ -4314,7 +4901,7 @@
43144901 // return;
43154902 boolean first = true;
43164903
4317
- if (GrafreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
43184905 {
43194906 Composite temp;
43204907
....@@ -4325,7 +4912,7 @@
43254912 temp = (Composite)Applet3D.clipboard.deepCopy();
43264913 */
43274914 Object3D elem;
4328
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4915
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43294916 {
43304917 Object3D child = (Object3D)e.nextElement();
43314918
....@@ -4359,21 +4946,21 @@
43594946 //Object3D cb = Applet3D.clipboard;
43604947 //temp.addChild(cb);
43614948 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4362
- assert(GrafreeD.clipboard.parent == null);
4363
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4364
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4365
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4366
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4949
+ assert(Grafreed.clipboard.parent == null);
4950
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4951
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4952
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4953
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43674954 else
4368
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4369
- GrafreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
43704957 }
43714958
43724959 ResetModel();
43734960 refreshContents();
43744961 }
43754962
4376
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
43774964 {
43784965 // if (GrafreeD.clipboard == null)
43794966 // return;
....@@ -4402,15 +4989,22 @@
44024989 if (copyit)
44034990 {
44044991 // paste(false);
4405
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
44065000 }
44075001 else
44085002 {
44095003 boolean first = true;
44105004
4411
- if (GrafreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
44125006 {
4413
- Composite temp = (Composite)GrafreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
44145008 Object3D copy;
44155009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44165010 {
....@@ -4420,7 +5014,7 @@
44205014 }
44215015 } else
44225016 {
4423
- linkSomething(GrafreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
44245018 }
44255019 }
44265020 }
....@@ -4825,21 +5419,6 @@
48255419 }
48265420 */
48275421
4828
- void ImportGFD()
4829
- {
4830
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4831
- browser.show();
4832
- String filename = browser.getFile();
4833
- if (filename != null && filename.length() > 0)
4834
- {
4835
- String fullname = browser.getDirectory() + filename;
4836
-
4837
- //Object3D readobj =
4838
- objEditor.ReadGFD(fullname, objEditor);
4839
- //makeSomething(readobj);
4840
- }
4841
- }
4842
-
48435422 /*
48445423 public void Callback(Object obj)
48455424 {
....@@ -4863,26 +5442,9 @@
48635442 }
48645443 */
48655444
4866
- void ImportVRMLX3D()
4867
- {
4868
- if (GrafreeD.standAlone)
4869
- {
4870
- /**/
4871
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4872
- browser.show();
4873
- String filename = browser.getFile();
4874
- if (filename != null && filename.length() > 0)
4875
- {
4876
- String fullname = browser.getDirectory() + filename;
4877
- LoadVRMLX3D(fullname);
4878
- }
4879
- /**/
4880
- }
4881
- }
4882
-
48835445 String GetFile(String dialogName)
48845446 {
4885
- if (GrafreeD.standAlone)
5447
+ if (Grafreed.standAlone)
48865448 {
48875449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48885450 browser.show();
....@@ -4946,10 +5508,36 @@
49465508 cButton flashSelectionButton;
49475509 cButton editButton;
49485510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
49495512 cButton clearpanelButton;
4950
- cButton allParamsButton;
49515513 cButton unselectButton;
49525514
5515
+ cButton restoreCameraButton;
5516
+
5517
+ cButton minButton;
5518
+ cButton maxButton;
5519
+ cButton fullButton;
5520
+ cButton saveButton;
5521
+ cButton oneStepButton;
5522
+
5523
+ cButton groupButton;
5524
+ cButton ungroupButton;
5525
+ cButton compositeButton;
5526
+ cButton switchButton;
5527
+ cButton loopButton;
5528
+ cButton textureButton;
5529
+
5530
+ cButton gridButton;
5531
+ cButton boxButton;
5532
+ cButton sphereButton;
5533
+ cButton coneButton;
5534
+ cButton torusButton;
5535
+ cButton superButton;
5536
+ cButton kleinButton;
5537
+ cButton particlesButton;
5538
+ cButton overlayButton;
5539
+ cButton lightButton;
5540
+
49535541 cButton screenfitButton;
49545542 cButton screenfitpointButton;
49555543 cButton snapobjectButton;
....@@ -4961,14 +5549,6 @@
49615549
49625550 cButton setsupportButton;
49635551
4964
- cButton twoButton;
4965
- cButton sixButton;
4966
- cButton threeButton;
4967
- cButton sevenButton;
4968
- cButton fourButton; // full panel
4969
- cButton oneButton; // full XYZ
4970
- //cButton currentLayout;
4971
-
49725552 //
49735553 //Composite
49745554 Object3D // to do !!
....@@ -4978,9 +5558,11 @@
49785558 //JTree jTree;
49795559 private MenuItem lookAtItem;
49805560 private MenuItem lookFromItem;
4981
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
49825562 private MenuItem cutItem;
4983
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
49845566 private MenuItem cloneItem;
49855567 private MenuItem cloneSupportItem;
49865568 private MenuItem overwriteGeoItem;
....@@ -4993,7 +5575,7 @@
49935575 private MenuItem linkverticesItem;
49945576 private MenuItem relinkverticesItem;
49955577 private MenuItem setMasterItem;
4996
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
49975579 private MenuItem stepAllItem;
49985580 private MenuItem revertMeshItem;
49995581 private MenuItem poseMeshItem;
....@@ -5004,6 +5586,7 @@
50045586 private MenuItem mergeGeometriesItem;
50055587 private MenuItem copyItem;
50065588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
50075590 private MenuItem pasteLinkItem;
50085591 private MenuItem pasteCloneItem;
50095592 private MenuItem pasteExpandItem;
....@@ -5042,6 +5625,10 @@
50425625 private MenuItem showleavesItem;
50435626 private MenuItem markleavesItem;
50445627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
50455632
50465633 private MenuItem flipVItem;
50475634 private MenuItem unflipVItem;
....@@ -5053,15 +5640,17 @@
50535640 private MenuItem panoTexturesItem;
50545641
50555642 private MenuItem resetCentroidItem;
5056
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
50575644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
50585647 private MenuItem hideItem;
50595648 private MenuItem grabItem;
50605649 private MenuItem backItem;
50615650 private MenuItem frontItem;
50625651 private MenuItem cameraItem;
50635652 private MenuItem compositeItem;
5064
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
50655654 private MenuItem physicsItem;
50665655 private MenuItem frameselectorItem;
50675656 private MenuItem scriptNodeItem;
....@@ -5101,7 +5690,7 @@
51015690 private MenuItem blobItem;
51025691 private MenuItem latheItem;
51035692 private MenuItem bezierItem;
5104
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
51055694 private MenuItem meshItem;
51065695 // private MenuItem meshGroupItem;
51075696 private MenuItem springItem;
....@@ -5123,11 +5712,6 @@
51235712 private MenuItem doubleItem;
51245713 private MenuItem tripleItem;
51255714
5126
- private MenuItem importGFDItem;
5127
- private MenuItem importVRMLX3DItem;
5128
- private MenuItem import3DSItem;
5129
- private MenuItem importOBJItem;
5130
-
51315715 private MenuItem computeAOItem;
51325716 private MenuItem recompileItem;
51335717 private MenuItem editScriptItem;
....@@ -5137,4 +5721,8 @@
51375721 private MenuItem analyzeItem;
51385722 private MenuItem dumpItem;
51395723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
51405728 }