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("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
248354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249355 switchGeoItem.addActionListener(this);
250356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251357 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
253359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.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,96 +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);
454636
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
640
+
455641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
456642 // screenfitpointButton.addActionListener(this);
457
-// oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
459
- snapobjectButton.addActionListener(this);
460
- snapobjectButton.setToolTipText("Snap Object");
461
- oe.aConstraints.gridx += 1;
462643
463
- //aConstraints.gridx = 0;
464
- //aConstraints.gridy += 1;
465
- oe.aConstraints.weighty = 0;
466
- oe.aConstraints.gridwidth = 1;
467
-
468
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
469
- flashSelectionButton.setToolTipText("Show selection");
470
- flashSelectionButton.addActionListener(this);
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ snapobjectButton.addActionListener(this);
648
+ snapobjectButton.setToolTipText("Snap Object");
649
+ }
650
+
651
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
471652
472
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473
-
474
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
475654 twoButton.setToolTipText("Show center view only");
476655 twoButton.addActionListener(this);
477
- 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);
478659 fourButton.addActionListener(this);
479660 fourButton.setToolTipText("Show left panel only");
480
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
481662 sixButton.setToolTipText("2-column layout left");
482663 sixButton.addActionListener(this);
483
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
484665 threeButton.setToolTipText("2-column layout right");
485666 threeButton.addActionListener(this);
486
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
487668 sevenButton.setToolTipText("3-column layout");
488669 sevenButton.addActionListener(this);
489670 //
490671
491
- 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);
492673 rootButton.setToolTipText("Edit selection in new tab");
493674 rootButton.addActionListener(this);
494675
495
- 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);
496677 closeButton.setToolTipText("Close tab");
497678 closeButton.addActionListener(this);
498679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
499680 //clearButton.addActionListener(this);
500
-
501
- 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
+ }
502713
503
- 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);
504762 editButton.setToolTipText("Edit selection");
505763 editButton.addActionListener(this);
506764
507
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
765
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
508766 uneditButton.setToolTipText("Unedit selection");
509767 uneditButton.addActionListener(this);
510768
511
- 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);
512774 clearPanelButton.setToolTipText("Clear edit panel");
513775 clearPanelButton.addActionListener(this);
514776
515
- commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
- allParamsButton.setToolTipText("All params??");
517
- allParamsButton.addActionListener(this);
518
-
519
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
777
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520778 unselectButton.setToolTipText("Unselect");
521779 unselectButton.addActionListener(this);
522780
523
- 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);
524784
525
- oe.treePanel.add(commandsPanel);
526
- oe.treePanel.Return();
785
+ editCommandsPanel.preferredHeight = 1;
786
+
787
+// oe.treePanel.add(commandsPanel);
788
+// oe.treePanel.Return();
527789
528790 // oe.aConstraints.gridx += 1;
529791 // oe.aConstraints.weighty = 0;
....@@ -540,27 +802,12 @@
540802
541803 JScrollPane jSP;
542804 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
543
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
544806 ResetModel();
545807
546808 oe.treePanel.add(jSPPanel);
547809 oe.treePanel.Return();
548810
549
- cGridBag copyOptionsPanel = new cGridBag();
550
-
551
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
552
- colorCB.setToolTipText("Copy color when dropped");
553
- colorCB.addItemListener(this);
554
-
555
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
556
- materialCB.setToolTipText("Copy material when dropped");
557
- materialCB.addItemListener(this);
558
-
559
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
560
- textureCB.setToolTipText("Copy texture when dropped");
561
- textureCB.addItemListener(this);
562
-
563
- copyOptionsPanel.preferredHeight = 1;
564811 oe.treePanel.add(copyOptionsPanel);
565812 oe.treePanel.Return();
566813
....@@ -591,13 +838,39 @@
591838
592839 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593840 {
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
+ {
594865 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
- supportCB.setToolTipText("Enabled rigging");
866
+ supportCB.setToolTipText("Enable rigging");
596867 supportCB.addItemListener(this);
597868
598869 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
599870 // localCB.addItemListener(this);
600871
872
+ panel.Return();
873
+
601874 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
602875 crowdCB.setToolTipText("Used for crowds");
603876 crowdCB.addItemListener(this);
....@@ -610,18 +883,12 @@
610883 slowCB.setToolTipText("Smooth interpolation");
611884 slowCB.addItemListener(this);
612885
613
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
614
- boxCB.setToolTipText("Display bounding boxes");
615
- boxCB.addItemListener(this);
616
-
617
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
618
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
619
- zoomBoxCB.addItemListener(this);
620
-
621886 // constraints.gridy += 1;
622887 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623888 // speakerMocapCB.addItemListener(this);
624889
890
+ panel.Return();
891
+
625892 if (false)
626893 {
627894 // handled in scripts
....@@ -636,30 +903,72 @@
636903 //constraints.gridy += 1;
637904 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
638905 smoothfocusCB.addItemListener(this);
906
+ panel.Return();
639907 }
640908
641909 //constraints.gridx += 1;
642910 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
643911 // debugCB.addItemListener(this);
644912
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
645917 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
646919 oeilCB.addItemListener(this);
647920
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
+ {
648941 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649942 lookAtCB.setToolTipText("Look-at target");
650943 lookAtCB.addItemListener(this);
944
+ }
945
+
946
+ }
651947
652948 cGridBag fill = new cGridBag();
653
-
654949 fill.preferredHeight = 200;
950
+ cGridBag fill2 = new cGridBag();
951
+ fill2.preferredHeight = 200;
952
+ cGridBag fill3 = new cGridBag();
953
+ fill3.preferredHeight = 200;
655954
656955 panel.add(fill);
956
+ panel.add(fill2);
957
+ panel.add(fill3);
657958
658959 }
659960
660961 void EditObject(Object3D obj)
661962 {
662963 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
+
663972 radioButton.SetObject(obj);
664973 radioButton.layout = sevenButton;
665974 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -668,8 +977,11 @@
668977 buttonGroup.add(radioButton);
669978 radioButton.doClick();
670979 }
980
+
671981 void SetupViews(ObjEditor oe)
672982 {
983
+ theFrame = this;
984
+
673985 oe.SetupViews();
674986
675987 System.out.println("SetupViews");
....@@ -678,23 +990,27 @@
678990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
679991 }
680992
681
- JCheckBox liveCB;
682
- JCheckBox supportCB;
683
- JCheckBox localCB;
684
- JCheckBox crowdCB;
685
- JCheckBox smoothCB;
686
- JCheckBox fastCB;
687
- JCheckBox slowCB;
688
- JCheckBox boxCB;
689
- JCheckBox zoomBoxCB;
690
- JCheckBox trackCB;
691
- 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;
6921005 // JCheckBox speakerMocapCB;
693
- JCheckBox speakerCameraCB;
694
- JCheckBox speakerFocusCB;
695
- JCheckBox debugCB;
696
- JCheckBox oeilCB;
697
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
6981014
6991015 // static int COLOR = 1;
7001016 // static int MATERIAL = 2;
....@@ -702,9 +1018,9 @@
7021018
7031019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7041020
705
- JCheckBox colorCB;
706
- JCheckBox materialCB;
707
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
7081024
7091025 public void itemStateChanged(ItemEvent e)
7101026 {
....@@ -732,6 +1048,7 @@
7321048 } else if(e.getSource() == liveCB)
7331049 {
7341050 cameraView.ToggleLive();
1051
+ refreshContents(false);
7351052 }
7361053 else if(e.getSource() == supportCB)
7371054 {
....@@ -796,6 +1113,14 @@
7961113 {
7971114 cameraView.ToggleOeil();
7981115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
7991124 else if(e.getSource() == lookAtCB)
8001125 {
8011126 cameraView.ToggleLookAt();
....@@ -812,7 +1137,8 @@
8121137
8131138 /**/
8141139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
815
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
8161142 if ((path == null) || (path.getPathCount() <= 1)) {
8171143 // We can't move the root node or an empty selection
8181144 return;
....@@ -884,7 +1210,9 @@
8841210 // objEditor.DropFile((java.io.File[]) object, true);
8851211 // return;
8861212 // }
887
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8881216 {
8891217 // file(s)
8901218 String[] names = string.split("\n");
....@@ -911,7 +1239,7 @@
9111239
9121240 flashIt = false;
9131241 CameraPane pane = (CameraPane) target;
914
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9151243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9161244
9171245 if (group.selection.size() == 1)
....@@ -927,23 +1255,33 @@
9271255
9281256 assert target == objEditor.jTree;
9291257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
9301259 try {
931
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9321261 } catch (Exception e) {
9331262 System.out.println("destinationPath : " + destinationPath);
9341263 return;
9351264 }
9361265
937
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
9381267 {
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
+// {
9391277 loadClipboard(true);
9401278 objEditor.jTree.setSelectionPath(destinationPath);
941
- pasteInto(false);
942
- } else {
943
- loadClipboard(false);
944
- objEditor.jTree.setSelectionPath(destinationPath);
945
- pasteInto(false); // true); // ???
946
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9471285 }
9481286 public void dropActionChanged(DropTargetDragEvent dtde)
9491287 // Called if the user has modified the current drop gesture
....@@ -1048,54 +1386,71 @@
10481386 {
10491387 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10501388 //heightFieldItem.addActionListener(this);
1051
- gridItem = menu.add(new MenuItem("Grid"));
1052
- gridItem.addActionListener(this);
1053
- rectoidItem = menu.add(new MenuItem("Box"));
1054
- rectoidItem.addActionListener(this);
1055
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1056
- ellipsoidItem.addActionListener(this);
1057
- coneItem = menu.add(new MenuItem("Cone"));
1058
- coneItem.addActionListener(this);
1059
- torusItem = menu.add(new MenuItem("Torus"));
1060
- torusItem.addActionListener(this);
1061
- superItem = menu.add(new MenuItem("Superellipsoid"));
1062
- 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
+ {
10631407 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10641408 kleinItem.addActionListener(this);
1065
- particleItem = menu.add(new MenuItem("Particle system"));
1066
- particleItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10671415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10681416 ragdollItem.addActionListener(this);
10691417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10701418 ragdoll2Item.addActionListener(this);
1419
+ }
10711420 menu.add("-");
1072
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10731422 meshItem.addActionListener(this);
10741423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10751424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10761427 springItem = menu.add(new MenuItem("Spring"));
10771428 springItem.addActionListener(this);
10781429 flagItem = menu.add(new MenuItem("Flag"));
10791430 flagItem.addActionListener(this);
1080
- bezierItem = menu.add(new MenuItem("Patch"));
1081
- bezierItem.addActionListener(this);
1082
- checkerItem = menu.add(new MenuItem("Checker"));
1083
- checkerItem.addActionListener(this);
10841431 blobItem = menu.add(new MenuItem("Blob"));
10851432 blobItem.addActionListener(this);
10861433 latheItem = menu.add(new MenuItem("Lathe"));
10871434 latheItem.addActionListener(this);
1088
- lightItem = menu.add(new MenuItem("Light"));
1089
- 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);
10901442 menu.add("-");
10911443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10921444 //superLoopItem.addActionListener(this);
1093
- loopItem = menu.add(new MenuItem("Loop"));
1094
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
10951447 doubleItem = menu.add(new MenuItem("Fork"));
10961448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
10971451 tripleItem = menu.add(new MenuItem("Trident"));
10981452 tripleItem.addActionListener(this);
1453
+ }
10991454 }
11001455
11011456 void buildToolsMenu(Menu menu)
....@@ -1109,24 +1464,26 @@
11091464 parseverticesItem.addActionListener(this);
11101465 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11111466 textureFieldItem.addActionListener(this);
1112
- alignItem = menu.add(new MenuItem("Align"));
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
11131468 alignItem.addActionListener(this);
1114
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1115
- mirrorItem.addActionListener(this);
11161469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11171470 reduceMorphItem.addActionListener(this);
11181471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11191472 reduce34MorphItem.addActionListener(this);
1120
-
1473
+ menu.add("-");
11211474 menu.add(computeAOItem = new MenuItem("Compute AO"));
11221475 computeAOItem.addActionListener(this);
1123
- menu.add("-");
11241476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
11251482 menu.add(memoryItem = new MenuItem("Memory Usage"));
11261483 memoryItem.addActionListener(this);
11271484 menu.add(analyzeItem = new MenuItem("Analyze"));
11281485 analyzeItem.addActionListener(this);
1129
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
11301487 dumpItem.addActionListener(this);
11311488 // menu.add(pathItem = new MenuItem("From-to path"));
11321489 // pathItem.addActionListener(this);
....@@ -1144,6 +1501,7 @@
11441501 menu.add("-");
11451502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11461503 editScriptItem.addActionListener(this);
1504
+ }
11471505 }
11481506
11491507 void ScreenFit()
....@@ -1266,6 +1624,7 @@
12661624 shadow.material = new cMaterial(obj.material);
12671625 shadow.material.diffuse = 0.0001f;
12681626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12691628
12701629 makeSomething(shadow);
12711630 }
....@@ -1472,9 +1831,9 @@
14721831
14731832 void Overwrite(int mask)
14741833 {
1475
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14761835 {
1477
- Object3D content = GrafreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
14781837
14791838 if (content instanceof cGroup && ((cGroup)content).transientlink )
14801839 content = ((cGroup)content).get(0);
....@@ -1513,7 +1872,7 @@
15131872 {
15141873 ScreenFit();
15151874 } else
1516
- if (source == switchItem)
1875
+ if (source == switchViewItem)
15171876 {
15181877 cVector v1 = new cVector();
15191878 cVector v2 = new cVector();
....@@ -1522,11 +1881,11 @@
15221881 objEditor.cameraView.renderCamera.setAim(v2, v1);
15231882 objEditor.cameraView.repaint();
15241883 } else
1525
- if (source == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
15261885 {
15271886 makeSomething(new Box());
15281887 } else
1529
- if (source == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
15301889 {
15311890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15321891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1605,27 +1964,27 @@
16051964
16061965 makeSomething(obj);
16071966 } else
1608
- if (source == gridItem)
1967
+ if (source == gridItem || source == gridButton)
16091968 {
16101969 makeSomething(new Grid());
16111970 } else
1612
- if (source == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
16131972 {
16141973 makeSomething(new Sphere());
16151974 } else
1616
- if (source == coneItem)
1975
+ if (source == coneItem || source == coneButton)
16171976 {
16181977 makeSomething(new Cone());
16191978 } else
1620
- if (source == torusItem)
1979
+ if (source == torusItem || source == torusButton)
16211980 {
16221981 makeSomething(new Torus());
16231982 } else
1624
- if (source == superItem)
1983
+ if (source == superItem || source == superButton)
16251984 {
16261985 makeSomething(new Superellipsoid());
16271986 } else
1628
- if (source == kleinItem)
1987
+ if (source == kleinItem || source == kleinButton)
16291988 {
16301989 makeSomething(new Klein());
16311990 } else
....@@ -1645,7 +2004,7 @@
16452004 {
16462005 makeSomething(new BezierSurface());
16472006 } else
1648
- if (source == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
16492008 {
16502009 /*
16512010 Object3D obj = new BezierSurface(5,8);
....@@ -1693,7 +2052,7 @@
16932052 s.setup();
16942053 makeSomething(s);
16952054 } else
1696
- if (source == lightItem)
2055
+ if (source == lightItem || source == lightButton)
16972056 {
16982057 makeSomething(new Light());
16992058 } else
....@@ -1743,7 +2102,7 @@
17432102
17442103 group(g);
17452104 } else
1746
- if (source == loopItem)
2105
+ if (source == loopItem || source == loopButton)
17472106 {
17482107 Composite csg = new GroupLeaf();
17492108 csg.count = 5;
....@@ -1779,23 +2138,6 @@
17792138 csg.addChild(child);
17802139 child.addChild(csg);
17812140 } else
1782
-
1783
- if (source == importGFDItem)
1784
- {
1785
- ImportGFD();
1786
- } else
1787
- if (source == importVRMLX3DItem)
1788
- {
1789
- ImportVRMLX3D();
1790
- } else
1791
- if (source == import3DSItem)
1792
- {
1793
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1794
- } else
1795
- if (source == importOBJItem)
1796
- {
1797
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1798
- } else
17992141 if (source == computeAOItem)
18002142 {
18012143 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1814,7 +2156,7 @@
18142156 if (source == invariantsItem)
18152157 {
18162158 System.out.println("Invariants:");
1817
- GrafreeD.grafreeD.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
18182160 } else
18192161 if (source == memoryItem)
18202162 {
....@@ -1832,6 +2174,35 @@
18322174 if (source == dumpItem)
18332175 {
18342176 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();
18352206 } else
18362207 if (source == screenfitButton)
18372208 {
....@@ -1882,12 +2253,20 @@
18822253 {
18832254 loadClipboard(true);
18842255 } else
2256
+ if (source == undoItem)
2257
+ {
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
18852264 if (source == duplicateItem)
18862265 {
1887
- Object3D keep = GrafreeD.clipboard;
2266
+ Object3D keep = Grafreed.clipboard;
18882267 loadClipboard(false);
18892268 paste(false);
1890
- GrafreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
18912270 } else
18922271 if (source == cloneItem)
18932272 {
....@@ -1905,13 +2284,17 @@
19052284 {
19062285 paste(false);
19072286 } else
2287
+ if (source == pasteIntoItem)
2288
+ {
2289
+ pasteInto(true, false);
2290
+ } else
19082291 if (source == pasteLinkItem)
19092292 {
1910
- pasteInto(false);
2293
+ pasteInto(false, false);
19112294 } else
19122295 if (source == pasteCloneItem)
19132296 {
1914
- pasteInto(true);
2297
+ pasteInto(true, true);
19152298 } else
19162299 if (source == pasteExpandItem)
19172300 {
....@@ -2103,9 +2486,9 @@
21032486 // group.selection.get(0).setMasterThis(content); // should be identity
21042487 // refreshContents();
21052488 // }
2106
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21072490 {
2108
- Object3D content = GrafreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
21092492
21102493 if (content instanceof cGroup && ((cGroup)content).transientlink )
21112494 content = ((cGroup)content).get(0);
....@@ -2113,11 +2496,11 @@
21132496 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21142497 for (int i=0; i<group.selection.size(); i++)
21152498 {
2116
- boolean random = CameraPane.RANDOM;
2117
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21182501 group.selection.get(i).linkVerticesThis(content);
21192502 // group.selection.get(i).setMasterThis(content); // should be identity
2120
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
21212504 }
21222505 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21232506 refreshContents();
....@@ -2127,20 +2510,20 @@
21272510 {
21282511 for (int i=0; i<group.selection.size(); i++)
21292512 {
2130
- boolean random = CameraPane.RANDOM;
2131
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
21322515 group.selection.get(i).linkVerticesThis(null);
2133
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
21342517 }
21352518
21362519 refreshContents();
21372520 } else
21382521 if (source == relinkverticesItem)
21392522 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
21422525 group.selection.RelinkToSupport();
2143
- CameraPane.RANDOM = random;
2526
+ CameraPane.SWITCH = random;
21442527
21452528 refreshContents();
21462529 } else
....@@ -2155,9 +2538,9 @@
21552538 } else
21562539 if (source == setMasterItem)
21572540 {
2158
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21592542 {
2160
- Object3D content = GrafreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
21612544
21622545 if (content instanceof cGroup && ((cGroup)content).transientlink )
21632546 content = ((cGroup)content).get(0);
....@@ -2170,9 +2553,9 @@
21702553 {
21712554 if (group.selection.size() == 1)
21722555 {
2173
- if (GrafreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
21742557 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
21762559
21772560 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782561 content = ((cGroup)content).get(0);
....@@ -2189,7 +2572,7 @@
21892572 {
21902573 RevertMeshes();
21912574 } else
2192
- if (source == resetMeshItem)
2575
+ if (source == resetAllItem)
21932576 {
21942577 ResetAll();
21952578 } else
....@@ -2209,9 +2592,9 @@
22092592 {
22102593 ClearSelection(true);
22112594 } else
2212
- if (source == grabItem)
2595
+ if (source == grabItem || source == groupButton)
22132596 {
2214
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
22152598 } else
22162599 if (source == hideItem)
22172600 {
....@@ -2229,16 +2612,16 @@
22292612 {
22302613 makeSomething(new Camera());
22312614 } else
2232
- if (source == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
22332616 {
22342617 group(new Composite());
22352618 } else
2236
- if (source == randomItem)
2619
+ if (source == switchItem || source == switchButton)
22372620 {
22382621 RandomNode random = new RandomNode();
22392622 group(random);
22402623 if (random.size() > 0)
2241
- random.name = random.get(0).name + "Rnd";
2624
+ random.name = random.get(0).name + "Switch";
22422625 } else
22432626 if (source == physicsItem)
22442627 {
....@@ -2335,7 +2718,7 @@
23352718 {
23362719 group(new cLinker());
23372720 } else
2338
- if (source == textureItem)
2721
+ if (source == textureItem || source == textureButton)
23392722 {
23402723 group(new TextureNode());
23412724 } else
....@@ -2355,7 +2738,7 @@
23552738 {
23562739 CastShadow(2);
23572740 } else
2358
- if (source == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
23592742 {
23602743 //ungroup();
23612744 for (int i=0; i<group.selection.size(); i++)
....@@ -2377,7 +2760,7 @@
23772760 } else
23782761 if (source == genNormalsMESHItem)
23792762 {
2380
- GenNormals(true); // TODO
2763
+ GenNormalsMESH();
23812764 } else
23822765 if (source == genNormalsORGANItem)
23832766 {
....@@ -2442,6 +2825,22 @@
24422825 if (source == unmarkleavesItem)
24432826 {
24442827 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);
24452844 } else
24462845 if (source == flipVItem)
24472846 {
....@@ -2527,9 +2926,13 @@
25272926 {
25282927 SmoothMesh();
25292928 } else
2530
- if (source == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
25312930 {
25322931 TransformGeometry();
2932
+ } else
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
25332936 } else
25342937 if (source == resetTransformItem)
25352938 {
....@@ -2537,7 +2940,11 @@
25372940 } else
25382941 if (source == resetCentroidItem)
25392942 {
2540
- ResetCentroid();
2943
+ ResetCentroid(true);
2944
+ } else
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
25412948 } else
25422949 if (source == resetParentItem)
25432950 {
....@@ -2669,6 +3076,10 @@
26693076 if (source == twoButton)
26703077 {
26713078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
26723083 // bug
26733084 //gridPanel.setDividerLocation(1.0);
26743085 //bigPanel.setDividerLocation(0.0);
....@@ -2701,10 +3112,31 @@
27013112 bigThree.ClearUI();
27023113 bigThree.add(centralPanel);
27033114 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
+
27043133 } else
27053134 if (source == threeButton)
27063135 {
27073136 radio.layout = threeButton;
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
27083140
27093141 // bigThree.remove(scenePanel);
27103142 // bigThree.remove(centralPanel);
....@@ -2737,10 +3169,15 @@
27373169 bigThree.add(centralPanel);
27383170 bigThree.add(XYZPanel);
27393171 bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
27403174 } else
27413175 if (source == fourButton)
27423176 {
27433177 radio.layout = fourButton;
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
27443181
27453182 // bigThree.remove(scenePanel);
27463183 // bigThree.remove(centralPanel);
....@@ -2772,10 +3209,15 @@
27723209 bigThree.ClearUI();
27733210 bigThree.add(scenePanel);
27743211 bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
27753214 } else
27763215 if (source == sixButton)
27773216 {
27783217 radio.layout = sixButton;
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
27793221
27803222 // bigThree.remove(scenePanel);
27813223 // bigThree.remove(centralPanel);
....@@ -2808,10 +3250,15 @@
28083250 bigThree.add(scenePanel);
28093251 bigThree.add(centralPanel);
28103252 bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
28113255 } else
28123256 if (source == sevenButton)
28133257 {
28143258 radio.layout = sevenButton;
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
28153262
28163263 // bigThree.remove(scenePanel);
28173264 // bigThree.remove(centralPanel);
....@@ -2845,6 +3292,8 @@
28453292 bigThree.add(centralPanel);
28463293 bigThree.add(XYZPanel);
28473294 bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
28483297 } else
28493298 if (source == rootButton)
28503299 {
....@@ -2856,6 +3305,7 @@
28563305 EditObject(obj);
28573306 }
28583307
3308
+ cameraView.requestFocusInWindow();
28593309 refreshContents(true);
28603310 } else
28613311 if (source == closeButton)
....@@ -2865,22 +3315,37 @@
28653315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28663316 {
28673317 ab = (cRadio)e.nextElement();
2868
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28693319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
28703326 buttonGroup.remove(ab);
28713327 radioPanel.remove(ab);
28723328
2873
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
28743331 // ab.GetObject().objectUI = null; // ?????????
28753332
28763333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28773334 break;
28783335 }
28793336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
28803339 refreshContents(true);
28813340 } else
28823341 if (source == editItem || source == editButton)
28833342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
28843349 EditSelection(false);
28853350 } else
28863351 if (source == uneditButton)
....@@ -2890,12 +3355,13 @@
28903355 Object3D child = (Object3D)e.nextElement();
28913356 if(child.editWindow != null)
28923357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
28933359 child.CloseUI();
28943360 listUI.remove(child);
28953361
2896
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
28973363 }
2898
- objEditor.ctrlPanel.validate();
3364
+ objEditor.ctrlPanel.FlushUI();
28993365 //objEditor.jTree.clearSelection();
29003366 //objEditor.ResetSliders();
29013367 refreshContents(true);
....@@ -2906,6 +3372,7 @@
29063372 //copy.ClearUI();
29073373 for (Object3D obj : listUI)
29083374 {
3375
+ obj.pinned = true;
29093376 obj.CloseUI();
29103377 }
29113378 listUI.clear();
....@@ -2915,7 +3382,7 @@
29153382 {
29163383 assert(copy == group);
29173384
2918
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29193386
29203387 for (Object3D obj : listUI)
29213388 {
....@@ -2979,7 +3446,11 @@
29793446 frontView.object = group;
29803447 sideView.object = group;
29813448 }
2982
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
29833454 /*
29843455 currentLayout = radio.layout;
29853456 if (currentLayout == null)
....@@ -2991,8 +3462,23 @@
29913462 //group.parent = null; // ROOT
29923463 //group.attributes = -1;
29933464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
29943467 refreshContents(true);
2995
- }
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
+ }
29963482 else
29973483 {
29983484 //return super.action(event, arg);
....@@ -3001,7 +3487,6 @@
30013487 }
30023488
30033489 boolean useclient = false;
3004
- cRadio radio;
30053490
30063491 void ToggleRoot()
30073492 {
....@@ -3053,6 +3538,28 @@
30533538 refreshContents();
30543539 }
30553540
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
+ }
30563563
30573564 void ResetTransform()
30583565 {
....@@ -3165,7 +3672,7 @@
31653672 refreshContents();
31663673 }
31673674
3168
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
31693676 {
31703677 Object3D obj;
31713678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3180,12 +3687,16 @@
31803687 LA.matIdentity(Object3D.mat);
31813688 obj.getBounds(minima, maxima, false);
31823689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3183
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31843692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31853693 obj.TransformMesh(Object3D.mat);
3694
+
31863695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3187
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31883698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
31893700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31903701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31913702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3214,7 +3725,8 @@
32143725
32153726 int size = obj.MemorySize();
32163727
3217
- 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)");
32183730 }
32193731 }
32203732 catch (Exception e)
....@@ -3251,9 +3763,9 @@
32513763 obj = (Object3D)e.nextElement();
32523764
32533765 System.out.println("Object is: " + obj);
3254
- GrafreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
32553767 System.out.println("Boundary rep: " + obj.bRep);
3256
- GrafreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
32573769
32583770 // System.err.println((size/1024) + " KB is the size of " + obj);
32593771 }
....@@ -3295,6 +3807,13 @@
32953807 void GenNormals(boolean crease)
32963808 {
32973809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
32983817
32993818 refreshContents();
33003819 }
....@@ -3467,8 +3986,8 @@
34673986
34683987 void ParseVertices()
34693988 {
3470
- boolean epsequal = GrafreeD.epsequal;
3471
- GrafreeD.epsequal = true;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
34723991
34733992 for (int i=0; i<group.selection.size(); i++)
34743993 {
....@@ -3493,7 +4012,7 @@
34934012 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34944013 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34954014
3496
- g.add(GrafreeD.clipboard);
4015
+ g.add(Grafreed.clipboard);
34974016
34984017 buffer.add(g);
34994018 }
....@@ -3508,7 +4027,7 @@
35084027 makeSomething(buffer, i==group.selection.size()-1);
35094028 }
35104029
3511
- GrafreeD.epsequal = epsequal;
4030
+ Grafreed.epsequal = epsequal;
35124031
35134032 refreshContents();
35144033 }
....@@ -3526,7 +4045,16 @@
35264045 String pigment = Object3D.GetPigment(tex);
35274046 //String bump = Object3D.GetBump(tex);
35284047
3529
- 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
+ }
35304058
35314059 double s = v.s;
35324060
....@@ -3614,11 +4142,11 @@
36144142
36154143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36164144
3617
- boolean random = CameraPane.RANDOM;
3618
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
36194147 lowres.linkVerticesThis(null);
36204148 lowres.linkVerticesThis(sn);
3621
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
36224150
36234151 System.err.flush();
36244152
....@@ -3658,7 +4186,7 @@
36584186 return;
36594187
36604188 Object3D poses = group.selection.get(0);
3661
- Object3D ref = GrafreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
36624190
36634191 Object3D newgroup = new Object3D("Po:" + poses.name);
36644192
....@@ -3852,9 +4380,9 @@
38524380
38534381 void ClipMesh()
38544382 {
3855
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38564384 {
3857
- Object3D content = GrafreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
38584386
38594387 if (content instanceof cGroup && ((cGroup)content).transientlink )
38604388 content = ((cGroup)content).get(0);
....@@ -3863,7 +4391,7 @@
38634391 // {
38644392 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38654393 // }
3866
- group.selection.ClipMesh(GrafreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
38674395 }
38684396 // group.selection.ClipMesh(GrafreeD.clipboard);
38694397 System.out.println("DONE.");
....@@ -3910,6 +4438,18 @@
39104438 void MarkLeaves(boolean hide)
39114439 {
39124440 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);
39134453 refreshContents();
39144454 }
39154455
....@@ -3984,10 +4524,6 @@
39844524 // }
39854525 // }
39864526
3987
- static boolean allparams = true;
3988
-
3989
- static Vector<Object3D> listUI = new Vector<Object3D>();
3990
-
39914527 void EditSelection(boolean newWindow)
39924528 {
39934529 // aConstraints.gridy = 0;
....@@ -3995,10 +4531,10 @@
39954531 {
39964532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39974533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3998
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39994535
40004536 Object3D elem = (Object3D)group.selection.elementAt(i);
4001
- if(elem != group)
4537
+ if(elem != group || !newWindow)
40024538 {
40034539 // if (!(elem instanceof Composite))
40044540 // newWindow = false;
....@@ -4081,6 +4617,17 @@
40814617
40824618 freezemodel = true;
40834619
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
+
40844631 /**/
40854632 //switch (event.id)
40864633 {
....@@ -4088,7 +4635,6 @@
40884635 //case 702: // Event.LIST_DESELECT
40894636 group.deselectAll();
40904637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4091
- objEditor.ClearInfo(); // .GetMaterial());
40924638 if (tps != null)
40934639 {
40944640 for (int i=0; i < tps.length; i++)
....@@ -4097,10 +4643,8 @@
40974643
40984644 //if (child.parent != null)
40994645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
41004647 group.addSelectee(child);
4101
- objEditor.SetMaterial(child); // .GetMaterial());
4102
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4103
- System.err.println("info : " + child.GetPath());
41044648 }
41054649 }
41064650 // else
....@@ -4110,20 +4654,28 @@
41104654 // System.err.println("info : " + group.GetPath());
41114655 // }
41124656
4113
- objEditor.SetText(); // jan 2014
4114
-
4115
- 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))
41164658 CameraPane.flash = true;
41174659
4118
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41194661 // a camera
41204662 {
4121
- CameraPane.camerachangeframe = 0; // don't refuse it
4122
- 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
+ }
41234668 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41244669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41254670 }
41264671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
41274679 refreshContents();
41284680 //return true;
41294681 }
....@@ -4132,6 +4684,33 @@
41324684
41334685 freezemodel = false;
41344686 }
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
+ }
41354714
41364715 void linkSomething(Object3D thing)
41374716 {
....@@ -4203,16 +4782,19 @@
42034782 {
42044783 if (group.selection.isEmpty())
42054784 return;
4206
- GrafreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
42074787 Composite tGroup = null;
42084788 if (group.selection.size() > 0) // 1)
42094789 {
42104790 tGroup = new cGroup();
4211
- GrafreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
42124792 }
42134793
42144794 if (cut)
42154795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
42164798 //int indices[] = jList.getSelectedIndices();
42174799 //for (int i = indices.length - 1; i >= 0; i--)
42184800 //jList.remove(indices[i]);
....@@ -4248,16 +4830,16 @@
42484830 //System.out.println("cut " + child);
42494831 //System.out.println("parent = " + child.parent);
42504832 // tmp.addChild(child);
4251
- if (GrafreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
42524834 tGroup.add/*Child*/(tmp);
42534835 else
4254
- GrafreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
42554837 }
42564838 else
4257
- if (GrafreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
42584840 tGroup.add/*Child*/(child);
42594841 else
4260
- GrafreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
42614843 }
42624844
42634845 //ResetModel();
....@@ -4289,21 +4871,23 @@
42894871 //System.out.println("cut " + elem);
42904872 //System.out.println("parent = " + elem.parent);
42914873 // tmp.addChild(elem);
4292
- if (GrafreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
42934875 tGroup.add/*Child*/(tmp);
42944876 else
4295
- GrafreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
42964878 }
42974879 else
4298
- if (GrafreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
42994881 tGroup.add/*Child*/(child);
43004882 else
4301
- GrafreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
43024884 }
43034885
43044886 }
4305
- if (GrafreeD.clipboardIsTempGroup)
4306
- GrafreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
43074891 if (cut)
43084892 {
43094893 ResetModel();
....@@ -4317,7 +4901,7 @@
43174901 // return;
43184902 boolean first = true;
43194903
4320
- if (GrafreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
43214905 {
43224906 Composite temp;
43234907
....@@ -4328,7 +4912,7 @@
43284912 temp = (Composite)Applet3D.clipboard.deepCopy();
43294913 */
43304914 Object3D elem;
4331
- 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))
43324916 {
43334917 Object3D child = (Object3D)e.nextElement();
43344918
....@@ -4362,21 +4946,21 @@
43624946 //Object3D cb = Applet3D.clipboard;
43634947 //temp.addChild(cb);
43644948 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4365
- assert(GrafreeD.clipboard.parent == null);
4366
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4367
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4368
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4369
- 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());
43704954 else
4371
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4372
- GrafreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
43734957 }
43744958
43754959 ResetModel();
43764960 refreshContents();
43774961 }
43784962
4379
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
43804964 {
43814965 // if (GrafreeD.clipboard == null)
43824966 // return;
....@@ -4405,15 +4989,22 @@
44054989 if (copyit)
44064990 {
44074991 // paste(false);
4408
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
44095000 }
44105001 else
44115002 {
44125003 boolean first = true;
44135004
4414
- if (GrafreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
44155006 {
4416
- Composite temp = (Composite)GrafreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
44175008 Object3D copy;
44185009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44195010 {
....@@ -4423,7 +5014,7 @@
44235014 }
44245015 } else
44255016 {
4426
- linkSomething(GrafreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
44275018 }
44285019 }
44295020 }
....@@ -4828,21 +5419,6 @@
48285419 }
48295420 */
48305421
4831
- void ImportGFD()
4832
- {
4833
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4834
- browser.show();
4835
- String filename = browser.getFile();
4836
- if (filename != null && filename.length() > 0)
4837
- {
4838
- String fullname = browser.getDirectory() + filename;
4839
-
4840
- //Object3D readobj =
4841
- objEditor.ReadGFD(fullname, objEditor);
4842
- //makeSomething(readobj);
4843
- }
4844
- }
4845
-
48465422 /*
48475423 public void Callback(Object obj)
48485424 {
....@@ -4866,26 +5442,9 @@
48665442 }
48675443 */
48685444
4869
- void ImportVRMLX3D()
4870
- {
4871
- if (GrafreeD.standAlone)
4872
- {
4873
- /**/
4874
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4875
- browser.show();
4876
- String filename = browser.getFile();
4877
- if (filename != null && filename.length() > 0)
4878
- {
4879
- String fullname = browser.getDirectory() + filename;
4880
- LoadVRMLX3D(fullname);
4881
- }
4882
- /**/
4883
- }
4884
- }
4885
-
48865445 String GetFile(String dialogName)
48875446 {
4888
- if (GrafreeD.standAlone)
5447
+ if (Grafreed.standAlone)
48895448 {
48905449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48915450 browser.show();
....@@ -4949,10 +5508,36 @@
49495508 cButton flashSelectionButton;
49505509 cButton editButton;
49515510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
49525512 cButton clearpanelButton;
4953
- cButton allParamsButton;
49545513 cButton unselectButton;
49555514
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
+
49565541 cButton screenfitButton;
49575542 cButton screenfitpointButton;
49585543 cButton snapobjectButton;
....@@ -4964,14 +5549,6 @@
49645549
49655550 cButton setsupportButton;
49665551
4967
- cButton twoButton;
4968
- cButton sixButton;
4969
- cButton threeButton;
4970
- cButton sevenButton;
4971
- cButton fourButton; // full panel
4972
- cButton oneButton; // full XYZ
4973
- //cButton currentLayout;
4974
-
49755552 //
49765553 //Composite
49775554 Object3D // to do !!
....@@ -4981,9 +5558,11 @@
49815558 //JTree jTree;
49825559 private MenuItem lookAtItem;
49835560 private MenuItem lookFromItem;
4984
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
49855562 private MenuItem cutItem;
4986
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
49875566 private MenuItem cloneItem;
49885567 private MenuItem cloneSupportItem;
49895568 private MenuItem overwriteGeoItem;
....@@ -4996,7 +5575,7 @@
49965575 private MenuItem linkverticesItem;
49975576 private MenuItem relinkverticesItem;
49985577 private MenuItem setMasterItem;
4999
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
50005579 private MenuItem stepAllItem;
50015580 private MenuItem revertMeshItem;
50025581 private MenuItem poseMeshItem;
....@@ -5007,6 +5586,7 @@
50075586 private MenuItem mergeGeometriesItem;
50085587 private MenuItem copyItem;
50095588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
50105590 private MenuItem pasteLinkItem;
50115591 private MenuItem pasteCloneItem;
50125592 private MenuItem pasteExpandItem;
....@@ -5045,6 +5625,10 @@
50455625 private MenuItem showleavesItem;
50465626 private MenuItem markleavesItem;
50475627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
50485632
50495633 private MenuItem flipVItem;
50505634 private MenuItem unflipVItem;
....@@ -5056,15 +5640,17 @@
50565640 private MenuItem panoTexturesItem;
50575641
50585642 private MenuItem resetCentroidItem;
5059
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
50605644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
50615647 private MenuItem hideItem;
50625648 private MenuItem grabItem;
50635649 private MenuItem backItem;
50645650 private MenuItem frontItem;
50655651 private MenuItem cameraItem;
50665652 private MenuItem compositeItem;
5067
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
50685654 private MenuItem physicsItem;
50695655 private MenuItem frameselectorItem;
50705656 private MenuItem scriptNodeItem;
....@@ -5104,7 +5690,7 @@
51045690 private MenuItem blobItem;
51055691 private MenuItem latheItem;
51065692 private MenuItem bezierItem;
5107
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
51085694 private MenuItem meshItem;
51095695 // private MenuItem meshGroupItem;
51105696 private MenuItem springItem;
....@@ -5126,11 +5712,6 @@
51265712 private MenuItem doubleItem;
51275713 private MenuItem tripleItem;
51285714
5129
- private MenuItem importGFDItem;
5130
- private MenuItem importVRMLX3DItem;
5131
- private MenuItem import3DSItem;
5132
- private MenuItem importOBJItem;
5133
-
51345715 private MenuItem computeAOItem;
51355716 private MenuItem recompileItem;
51365717 private MenuItem editScriptItem;
....@@ -5140,4 +5721,8 @@
51405721 private MenuItem analyzeItem;
51415722 private MenuItem dumpItem;
51425723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
51435728 }