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,98 +580,213 @@
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(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
444
- trackCB.setToolTipText("Enable tracking");
445
- trackCB.addItemListener(this);
446
-
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
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);
628
+ fastCB.setToolTipText("Fast mode");
629
+ fastCB.addItemListener(this);
630
+
631
+ //oe.toolboxPanel.Return();
632
+
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
448634 screenfitButton.setToolTipText("Screen fit");
449635 screenfitButton.addActionListener(this);
450636
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
640
+
451641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452642 // screenfitpointButton.addActionListener(this);
453
-// oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455
- snapobjectButton.addActionListener(this);
456
- snapobjectButton.setToolTipText("Snap Object");
457
- oe.aConstraints.gridx += 1;
458643
459
- //aConstraints.gridx = 0;
460
- //aConstraints.gridy += 1;
461
- oe.aConstraints.weighty = 0;
462
- oe.aConstraints.gridwidth = 1;
463
-
464
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
- flashSelectionButton.setToolTipText("Show selection");
466
- 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));
467652
468
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
-
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471654 twoButton.setToolTipText("Show center view only");
472655 twoButton.addActionListener(this);
473
- 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);
474659 fourButton.addActionListener(this);
475660 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
477662 sixButton.setToolTipText("2-column layout left");
478663 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
480665 threeButton.setToolTipText("2-column layout right");
481666 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483668 sevenButton.setToolTipText("3-column layout");
484669 sevenButton.addActionListener(this);
485670 //
486671
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- rootButton.setToolTipText("Edit object in new tab");
672
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ rootButton.setToolTipText("Edit selection in new tab");
489674 rootButton.addActionListener(this);
490
- oe.aConstraints.gridx += 1;
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
675
+
676
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492677 closeButton.setToolTipText("Close tab");
493678 closeButton.addActionListener(this);
494679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495680 //clearButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
-
498
- oe.aConstraints.gridx = 1; //
499
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
500
- editButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.aConstraints.weighty = 0;
503
- oe.aConstraints.gridwidth = 1;
504681
505
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
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
+ }
713
+
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);
762
+ editButton.setToolTipText("Edit selection");
763
+ editButton.addActionListener(this);
764
+
765
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Unedit selection");
506767 uneditButton.addActionListener(this);
507768
508
- oe.aConstraints.gridx += 1;
509
- oe.aConstraints.weighty = 0;
510
- oe.aConstraints.gridwidth = 1;
511
-
512
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
513
- clearPanelButton.addActionListener(this);
514
-
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518
-
519
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
769
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
+ allParamsButton.setToolTipText("Edit all params");
520771 allParamsButton.addActionListener(this);
521772
522
- oe.aConstraints.gridx += 1;
523
- oe.aConstraints.weighty = 0;
524
- oe.aConstraints.gridwidth = 1;
525
-
526
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
773
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
774
+ clearPanelButton.setToolTipText("Clear edit panel");
775
+ clearPanelButton.addActionListener(this);
776
+
777
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
778
+ unselectButton.setToolTipText("Unselect");
527779 unselectButton.addActionListener(this);
528780
781
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ flashSelectionButton.setToolTipText("Highlight selection");
783
+ flashSelectionButton.addActionListener(this);
784
+
785
+ editCommandsPanel.preferredHeight = 1;
786
+
787
+// oe.treePanel.add(commandsPanel);
788
+// oe.treePanel.Return();
789
+
529790 // oe.aConstraints.gridx += 1;
530791 // oe.aConstraints.weighty = 0;
531792 // oe.aConstraints.gridwidth = 1;
....@@ -537,40 +798,22 @@
537798 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
538799 // gcButton.addActionListener(this);
539800
540
- oe.aConstraints.gridx = 0;
541
- oe.aConstraints.gridy += 1;
542
-
543
- //ctrlPanel.add(objList = new List(5, true));
544
- oe.aConstraints.gridwidth = 100;
545
- // oe.aConstraints.gridheight = 100;
546
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
547
- oe.aConstraints.gridheight = 1;
548
- oe.aConstraints.weighty = 0.5;
549
- oe.aConstraints.gridx = 0;
550
- JScrollPane jSP;
801
+ cGridBag jSPPanel = new cGridBag();
802
+
803
+ JScrollPane jSP;
551804 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
552
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
553806 ResetModel();
554
- oe.aConstraints.weighty = 0.5;
555
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
556
- oe.aConstraints.gridy += 1;
557
- oe.aConstraints.gridwidth = 1;
558
-
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 2;
561
-
562
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
563
- colorCB.addItemListener(this);
564
- oe.aConstraints.gridx += 2;
565
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
566
- materialCB.addItemListener(this);
567
- oe.aConstraints.gridx += 2;
568
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
569
- textureCB.addItemListener(this);
570
-
571
- oe.aConstraints.gridx = 0;
572
- oe.aConstraints.gridy += 1;
573807
808
+ oe.treePanel.add(jSPPanel);
809
+ oe.treePanel.Return();
810
+
811
+ oe.treePanel.add(copyOptionsPanel);
812
+ oe.treePanel.Return();
813
+
814
+// mainPanel.setDividerLocation(0.5); //1.0);
815
+// mainPanel.setResizeWeight(0.5);
816
+
574817 //jList.addListSelectionListener(this);
575818 oe.jTree.addTreeSelectionListener(this);
576819 //jTree.setRootVisible(false);
....@@ -595,47 +838,57 @@
595838
596839 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
597840 {
598
- //constraints.gridx = 0;
599
- //constraints.gridy = 0;
600
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
- fastCB.setToolTipText("Fast mode");
602
- fastCB.addItemListener(this);
603
- //constraints.gridy += 1;
604
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
- supportCB.setToolTipText("Enabled rigging");
606
- supportCB.addItemListener(this);
841
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
842
+ colorCB.setToolTipText("Copy color when dropped");
843
+ colorCB.addItemListener(this);
607844
608
- // constraints.gridy += 1;
609
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
610
- // localCB.addItemListener(this);
845
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
846
+ materialCB.setToolTipText("Copy material when dropped");
847
+ materialCB.addItemListener(this);
611848
612
- //constraints.gridy += 1;
613
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
614
- crowdCB.setToolTipText("Used for crowds");
615
- crowdCB.addItemListener(this);
616
-
617
- //constraints.gridy += 1;
618
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
619
- smoothCB.setToolTipText("Snapping delay");
620
- smoothCB.addItemListener(this);
621
-
622
- //constraints.gridy += 1;
623
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624
- slowCB.setToolTipText("Smooth interpolation");
625
- slowCB.addItemListener(this);
626
- //constraints.gridy += 1;
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
+
627855 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628856 boxCB.setToolTipText("Display bounding boxes");
629857 boxCB.addItemListener(this);
630
- //constraints.gridy += 1;
858
+
631859 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632860 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633861 zoomBoxCB.addItemListener(this);
634862
863
+ if (true) // Globals.ADVANCED)
864
+ {
865
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
+ supportCB.setToolTipText("Enable rigging");
867
+ supportCB.addItemListener(this);
868
+
869
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870
+ // localCB.addItemListener(this);
871
+
872
+ panel.Return();
873
+
874
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
875
+ crowdCB.setToolTipText("Used for crowds");
876
+ crowdCB.addItemListener(this);
877
+
878
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
879
+ smoothCB.setToolTipText("Snapping delay");
880
+ smoothCB.addItemListener(this);
881
+
882
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
883
+ slowCB.setToolTipText("Smooth interpolation");
884
+ slowCB.addItemListener(this);
885
+
635886 // constraints.gridy += 1;
636887 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
637888 // speakerMocapCB.addItemListener(this);
638889
890
+ panel.Return();
891
+
639892 if (false)
640893 {
641894 // handled in scripts
....@@ -650,26 +903,72 @@
650903 //constraints.gridy += 1;
651904 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
652905 smoothfocusCB.addItemListener(this);
906
+ panel.Return();
653907 }
654908
655909 //constraints.gridx += 1;
656910 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
657911 // debugCB.addItemListener(this);
658912
659
- //constraints.gridy += 1;
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
660917 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
661919 oeilCB.addItemListener(this);
662920
663
- //constraints.gridy += 1;
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
+ {
664941 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665942 lookAtCB.setToolTipText("Look-at target");
666943 lookAtCB.addItemListener(this);
944
+ }
945
+
946
+ }
947
+
948
+ cGridBag fill = new cGridBag();
949
+ fill.preferredHeight = 200;
950
+ cGridBag fill2 = new cGridBag();
951
+ fill2.preferredHeight = 200;
952
+ cGridBag fill3 = new cGridBag();
953
+ fill3.preferredHeight = 200;
954
+
955
+ panel.add(fill);
956
+ panel.add(fill2);
957
+ panel.add(fill3);
667958
668959 }
669960
670961 void EditObject(Object3D obj)
671962 {
672963 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
+
673972 radioButton.SetObject(obj);
674973 radioButton.layout = sevenButton;
675974 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -678,8 +977,11 @@
678977 buttonGroup.add(radioButton);
679978 radioButton.doClick();
680979 }
980
+
681981 void SetupViews(ObjEditor oe)
682982 {
983
+ theFrame = this;
984
+
683985 oe.SetupViews();
684986
685987 System.out.println("SetupViews");
....@@ -688,23 +990,27 @@
688990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
689991 }
690992
691
- JCheckBox liveCB;
692
- JCheckBox supportCB;
693
- JCheckBox localCB;
694
- JCheckBox crowdCB;
695
- JCheckBox smoothCB;
696
- JCheckBox fastCB;
697
- JCheckBox slowCB;
698
- JCheckBox boxCB;
699
- JCheckBox zoomBoxCB;
700
- JCheckBox trackCB;
701
- 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;
7021005 // JCheckBox speakerMocapCB;
703
- JCheckBox speakerCameraCB;
704
- JCheckBox speakerFocusCB;
705
- JCheckBox debugCB;
706
- JCheckBox oeilCB;
707
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
7081014
7091015 // static int COLOR = 1;
7101016 // static int MATERIAL = 2;
....@@ -712,9 +1018,9 @@
7121018
7131019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7141020
715
- JCheckBox colorCB;
716
- JCheckBox materialCB;
717
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
7181024
7191025 public void itemStateChanged(ItemEvent e)
7201026 {
....@@ -742,6 +1048,7 @@
7421048 } else if(e.getSource() == liveCB)
7431049 {
7441050 cameraView.ToggleLive();
1051
+ refreshContents(false);
7451052 }
7461053 else if(e.getSource() == supportCB)
7471054 {
....@@ -806,6 +1113,14 @@
8061113 {
8071114 cameraView.ToggleOeil();
8081115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
8091124 else if(e.getSource() == lookAtCB)
8101125 {
8111126 cameraView.ToggleLookAt();
....@@ -822,7 +1137,8 @@
8221137
8231138 /**/
8241139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
825
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
8261142 if ((path == null) || (path.getPathCount() <= 1)) {
8271143 // We can't move the root node or an empty selection
8281144 return;
....@@ -894,7 +1210,9 @@
8941210 // objEditor.DropFile((java.io.File[]) object, true);
8951211 // return;
8961212 // }
897
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8981216 {
8991217 // file(s)
9001218 String[] names = string.split("\n");
....@@ -921,7 +1239,7 @@
9211239
9221240 flashIt = false;
9231241 CameraPane pane = (CameraPane) target;
924
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9251243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9261244
9271245 if (group.selection.size() == 1)
....@@ -937,23 +1255,33 @@
9371255
9381256 assert target == objEditor.jTree;
9391257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
9401259 try {
941
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9421261 } catch (Exception e) {
9431262 System.out.println("destinationPath : " + destinationPath);
9441263 return;
9451264 }
9461265
947
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
9481267 {
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
+// {
9491277 loadClipboard(true);
9501278 objEditor.jTree.setSelectionPath(destinationPath);
951
- pasteInto(false);
952
- } else {
953
- loadClipboard(false);
954
- objEditor.jTree.setSelectionPath(destinationPath);
955
- pasteInto(false); // true); // ???
956
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9571285 }
9581286 public void dropActionChanged(DropTargetDragEvent dtde)
9591287 // Called if the user has modified the current drop gesture
....@@ -1058,85 +1386,104 @@
10581386 {
10591387 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10601388 //heightFieldItem.addActionListener(this);
1061
- gridItem = menu.add(new MenuItem("Grid"));
1062
- gridItem.addActionListener(this);
1063
- rectoidItem = menu.add(new MenuItem("Box"));
1064
- rectoidItem.addActionListener(this);
1065
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1066
- ellipsoidItem.addActionListener(this);
1067
- coneItem = menu.add(new MenuItem("Cone"));
1068
- coneItem.addActionListener(this);
1069
- torusItem = menu.add(new MenuItem("Torus"));
1070
- torusItem.addActionListener(this);
1071
- superItem = menu.add(new MenuItem("Superellipsoid"));
1072
- 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
+ {
10731407 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10741408 kleinItem.addActionListener(this);
1075
- particleItem = menu.add(new MenuItem("Particle system"));
1076
- particleItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10771415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10781416 ragdollItem.addActionListener(this);
10791417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10801418 ragdoll2Item.addActionListener(this);
1419
+ }
10811420 menu.add("-");
1082
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10831422 meshItem.addActionListener(this);
10841423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10851424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10861427 springItem = menu.add(new MenuItem("Spring"));
10871428 springItem.addActionListener(this);
10881429 flagItem = menu.add(new MenuItem("Flag"));
10891430 flagItem.addActionListener(this);
1090
- bezierItem = menu.add(new MenuItem("Patch"));
1091
- bezierItem.addActionListener(this);
1092
- checkerItem = menu.add(new MenuItem("Checker"));
1093
- checkerItem.addActionListener(this);
10941431 blobItem = menu.add(new MenuItem("Blob"));
10951432 blobItem.addActionListener(this);
10961433 latheItem = menu.add(new MenuItem("Lathe"));
10971434 latheItem.addActionListener(this);
1098
- lightItem = menu.add(new MenuItem("Light"));
1099
- 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);
11001442 menu.add("-");
11011443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11021444 //superLoopItem.addActionListener(this);
1103
- loopItem = menu.add(new MenuItem("Loop"));
1104
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
11051447 doubleItem = menu.add(new MenuItem("Fork"));
11061448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
11071451 tripleItem = menu.add(new MenuItem("Trident"));
11081452 tripleItem.addActionListener(this);
1453
+ }
11091454 }
11101455
11111456 void buildToolsMenu(Menu menu)
11121457 {
11131458 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11141459 animationItem.addItemListener(this);
1115
- animationItem.setState(CameraPane.ANIMATION);
1460
+ animationItem.setState(Globals.ANIMATION);
11161461
11171462 menu.add("-");
11181463 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11191464 parseverticesItem.addActionListener(this);
11201465 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11211466 textureFieldItem.addActionListener(this);
1122
- alignItem = menu.add(new MenuItem("Align"));
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
11231468 alignItem.addActionListener(this);
1124
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1125
- mirrorItem.addActionListener(this);
11261469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11271470 reduceMorphItem.addActionListener(this);
11281471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11291472 reduce34MorphItem.addActionListener(this);
1130
-
1473
+ menu.add("-");
11311474 menu.add(computeAOItem = new MenuItem("Compute AO"));
11321475 computeAOItem.addActionListener(this);
1133
- menu.add("-");
11341476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
11351482 menu.add(memoryItem = new MenuItem("Memory Usage"));
11361483 memoryItem.addActionListener(this);
11371484 menu.add(analyzeItem = new MenuItem("Analyze"));
11381485 analyzeItem.addActionListener(this);
1139
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
11401487 dumpItem.addActionListener(this);
11411488 // menu.add(pathItem = new MenuItem("From-to path"));
11421489 // pathItem.addActionListener(this);
....@@ -1154,6 +1501,7 @@
11541501 menu.add("-");
11551502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11561503 editScriptItem.addActionListener(this);
1504
+ }
11571505 }
11581506
11591507 void ScreenFit()
....@@ -1276,6 +1624,7 @@
12761624 shadow.material = new cMaterial(obj.material);
12771625 shadow.material.diffuse = 0.0001f;
12781626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12791628
12801629 makeSomething(shadow);
12811630 }
....@@ -1482,9 +1831,9 @@
14821831
14831832 void Overwrite(int mask)
14841833 {
1485
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14861835 {
1487
- Object3D content = GrafreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
14881837
14891838 if (content instanceof cGroup && ((cGroup)content).transientlink )
14901839 content = ((cGroup)content).get(0);
....@@ -1523,7 +1872,7 @@
15231872 {
15241873 ScreenFit();
15251874 } else
1526
- if (source == switchItem)
1875
+ if (source == switchViewItem)
15271876 {
15281877 cVector v1 = new cVector();
15291878 cVector v2 = new cVector();
....@@ -1532,11 +1881,11 @@
15321881 objEditor.cameraView.renderCamera.setAim(v2, v1);
15331882 objEditor.cameraView.repaint();
15341883 } else
1535
- if (source == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
15361885 {
15371886 makeSomething(new Box());
15381887 } else
1539
- if (source == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
15401889 {
15411890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15421891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1615,27 +1964,27 @@
16151964
16161965 makeSomething(obj);
16171966 } else
1618
- if (source == gridItem)
1967
+ if (source == gridItem || source == gridButton)
16191968 {
16201969 makeSomething(new Grid());
16211970 } else
1622
- if (source == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
16231972 {
16241973 makeSomething(new Sphere());
16251974 } else
1626
- if (source == coneItem)
1975
+ if (source == coneItem || source == coneButton)
16271976 {
16281977 makeSomething(new Cone());
16291978 } else
1630
- if (source == torusItem)
1979
+ if (source == torusItem || source == torusButton)
16311980 {
16321981 makeSomething(new Torus());
16331982 } else
1634
- if (source == superItem)
1983
+ if (source == superItem || source == superButton)
16351984 {
16361985 makeSomething(new Superellipsoid());
16371986 } else
1638
- if (source == kleinItem)
1987
+ if (source == kleinItem || source == kleinButton)
16391988 {
16401989 makeSomething(new Klein());
16411990 } else
....@@ -1655,7 +2004,7 @@
16552004 {
16562005 makeSomething(new BezierSurface());
16572006 } else
1658
- if (source == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
16592008 {
16602009 /*
16612010 Object3D obj = new BezierSurface(5,8);
....@@ -1703,7 +2052,7 @@
17032052 s.setup();
17042053 makeSomething(s);
17052054 } else
1706
- if (source == lightItem)
2055
+ if (source == lightItem || source == lightButton)
17072056 {
17082057 makeSomething(new Light());
17092058 } else
....@@ -1753,7 +2102,7 @@
17532102
17542103 group(g);
17552104 } else
1756
- if (source == loopItem)
2105
+ if (source == loopItem || source == loopButton)
17572106 {
17582107 Composite csg = new GroupLeaf();
17592108 csg.count = 5;
....@@ -1789,23 +2138,6 @@
17892138 csg.addChild(child);
17902139 child.addChild(csg);
17912140 } else
1792
-
1793
- if (source == importGFDItem)
1794
- {
1795
- ImportGFD();
1796
- } else
1797
- if (source == importVRMLX3DItem)
1798
- {
1799
- ImportVRMLX3D();
1800
- } else
1801
- if (source == import3DSItem)
1802
- {
1803
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1804
- } else
1805
- if (source == importOBJItem)
1806
- {
1807
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1808
- } else
18092141 if (source == computeAOItem)
18102142 {
18112143 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1824,7 +2156,7 @@
18242156 if (source == invariantsItem)
18252157 {
18262158 System.out.println("Invariants:");
1827
- GrafreeD.grafreeD.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
18282160 } else
18292161 if (source == memoryItem)
18302162 {
....@@ -1842,6 +2174,35 @@
18422174 if (source == dumpItem)
18432175 {
18442176 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();
18452206 } else
18462207 if (source == screenfitButton)
18472208 {
....@@ -1892,12 +2253,20 @@
18922253 {
18932254 loadClipboard(true);
18942255 } else
2256
+ if (source == undoItem)
2257
+ {
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
18952264 if (source == duplicateItem)
18962265 {
1897
- Object3D keep = GrafreeD.clipboard;
2266
+ Object3D keep = Grafreed.clipboard;
18982267 loadClipboard(false);
18992268 paste(false);
1900
- GrafreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
19012270 } else
19022271 if (source == cloneItem)
19032272 {
....@@ -1915,13 +2284,17 @@
19152284 {
19162285 paste(false);
19172286 } else
2287
+ if (source == pasteIntoItem)
2288
+ {
2289
+ pasteInto(true, false);
2290
+ } else
19182291 if (source == pasteLinkItem)
19192292 {
1920
- pasteInto(false);
2293
+ pasteInto(false, false);
19212294 } else
19222295 if (source == pasteCloneItem)
19232296 {
1924
- pasteInto(true);
2297
+ pasteInto(true, true);
19252298 } else
19262299 if (source == pasteExpandItem)
19272300 {
....@@ -2113,9 +2486,9 @@
21132486 // group.selection.get(0).setMasterThis(content); // should be identity
21142487 // refreshContents();
21152488 // }
2116
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21172490 {
2118
- Object3D content = GrafreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
21192492
21202493 if (content instanceof cGroup && ((cGroup)content).transientlink )
21212494 content = ((cGroup)content).get(0);
....@@ -2123,11 +2496,11 @@
21232496 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21242497 for (int i=0; i<group.selection.size(); i++)
21252498 {
2126
- boolean random = CameraPane.RANDOM;
2127
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21282501 group.selection.get(i).linkVerticesThis(content);
21292502 // group.selection.get(i).setMasterThis(content); // should be identity
2130
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
21312504 }
21322505 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21332506 refreshContents();
....@@ -2137,20 +2510,20 @@
21372510 {
21382511 for (int i=0; i<group.selection.size(); i++)
21392512 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
21422515 group.selection.get(i).linkVerticesThis(null);
2143
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
21442517 }
21452518
21462519 refreshContents();
21472520 } else
21482521 if (source == relinkverticesItem)
21492522 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
21522525 group.selection.RelinkToSupport();
2153
- CameraPane.RANDOM = random;
2526
+ CameraPane.SWITCH = random;
21542527
21552528 refreshContents();
21562529 } else
....@@ -2165,9 +2538,9 @@
21652538 } else
21662539 if (source == setMasterItem)
21672540 {
2168
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21692542 {
2170
- Object3D content = GrafreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
21712544
21722545 if (content instanceof cGroup && ((cGroup)content).transientlink )
21732546 content = ((cGroup)content).get(0);
....@@ -2180,9 +2553,9 @@
21802553 {
21812554 if (group.selection.size() == 1)
21822555 {
2183
- if (GrafreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
21842557 {
2185
- Object3D content = GrafreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
21862559
21872560 if (content instanceof cGroup && ((cGroup)content).transientlink )
21882561 content = ((cGroup)content).get(0);
....@@ -2199,7 +2572,7 @@
21992572 {
22002573 RevertMeshes();
22012574 } else
2202
- if (source == resetMeshItem)
2575
+ if (source == resetAllItem)
22032576 {
22042577 ResetAll();
22052578 } else
....@@ -2219,9 +2592,9 @@
22192592 {
22202593 ClearSelection(true);
22212594 } else
2222
- if (source == grabItem)
2595
+ if (source == grabItem || source == groupButton)
22232596 {
2224
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
22252598 } else
22262599 if (source == hideItem)
22272600 {
....@@ -2239,16 +2612,16 @@
22392612 {
22402613 makeSomething(new Camera());
22412614 } else
2242
- if (source == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
22432616 {
22442617 group(new Composite());
22452618 } else
2246
- if (source == randomItem)
2619
+ if (source == switchItem || source == switchButton)
22472620 {
22482621 RandomNode random = new RandomNode();
22492622 group(random);
22502623 if (random.size() > 0)
2251
- random.name = random.get(0).name + "Rnd";
2624
+ random.name = random.get(0).name + "Switch";
22522625 } else
22532626 if (source == physicsItem)
22542627 {
....@@ -2345,7 +2718,7 @@
23452718 {
23462719 group(new cLinker());
23472720 } else
2348
- if (source == textureItem)
2721
+ if (source == textureItem || source == textureButton)
23492722 {
23502723 group(new TextureNode());
23512724 } else
....@@ -2365,7 +2738,7 @@
23652738 {
23662739 CastShadow(2);
23672740 } else
2368
- if (source == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
23692742 {
23702743 //ungroup();
23712744 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,7 +2760,7 @@
23872760 } else
23882761 if (source == genNormalsMESHItem)
23892762 {
2390
- GenNormals(true); // TODO
2763
+ GenNormalsMESH();
23912764 } else
23922765 if (source == genNormalsORGANItem)
23932766 {
....@@ -2452,6 +2825,22 @@
24522825 if (source == unmarkleavesItem)
24532826 {
24542827 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);
24552844 } else
24562845 if (source == flipVItem)
24572846 {
....@@ -2537,9 +2926,13 @@
25372926 {
25382927 SmoothMesh();
25392928 } else
2540
- if (source == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
25412930 {
25422931 TransformGeometry();
2932
+ } else
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
25432936 } else
25442937 if (source == resetTransformItem)
25452938 {
....@@ -2547,7 +2940,11 @@
25472940 } else
25482941 if (source == resetCentroidItem)
25492942 {
2550
- ResetCentroid();
2943
+ ResetCentroid(true);
2944
+ } else
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
25512948 } else
25522949 if (source == resetParentItem)
25532950 {
....@@ -2679,6 +3076,10 @@
26793076 if (source == twoButton)
26803077 {
26813078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
26823083 // bug
26833084 //gridPanel.setDividerLocation(1.0);
26843085 //bigPanel.setDividerLocation(0.0);
....@@ -2711,10 +3112,31 @@
27113112 bigThree.ClearUI();
27123113 bigThree.add(centralPanel);
27133114 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
+
27143133 } else
27153134 if (source == threeButton)
27163135 {
27173136 radio.layout = threeButton;
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
27183140
27193141 // bigThree.remove(scenePanel);
27203142 // bigThree.remove(centralPanel);
....@@ -2747,10 +3169,15 @@
27473169 bigThree.add(centralPanel);
27483170 bigThree.add(XYZPanel);
27493171 bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
27503174 } else
27513175 if (source == fourButton)
27523176 {
27533177 radio.layout = fourButton;
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
27543181
27553182 // bigThree.remove(scenePanel);
27563183 // bigThree.remove(centralPanel);
....@@ -2782,10 +3209,15 @@
27823209 bigThree.ClearUI();
27833210 bigThree.add(scenePanel);
27843211 bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
27853214 } else
27863215 if (source == sixButton)
27873216 {
27883217 radio.layout = sixButton;
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
27893221
27903222 // bigThree.remove(scenePanel);
27913223 // bigThree.remove(centralPanel);
....@@ -2818,10 +3250,15 @@
28183250 bigThree.add(scenePanel);
28193251 bigThree.add(centralPanel);
28203252 bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
28213255 } else
28223256 if (source == sevenButton)
28233257 {
28243258 radio.layout = sevenButton;
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
28253262
28263263 // bigThree.remove(scenePanel);
28273264 // bigThree.remove(centralPanel);
....@@ -2855,6 +3292,8 @@
28553292 bigThree.add(centralPanel);
28563293 bigThree.add(XYZPanel);
28573294 bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
28583297 } else
28593298 if (source == rootButton)
28603299 {
....@@ -2866,6 +3305,7 @@
28663305 EditObject(obj);
28673306 }
28683307
3308
+ cameraView.requestFocusInWindow();
28693309 refreshContents(true);
28703310 } else
28713311 if (source == closeButton)
....@@ -2875,22 +3315,37 @@
28753315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28763316 {
28773317 ab = (cRadio)e.nextElement();
2878
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28793319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
28803326 buttonGroup.remove(ab);
28813327 radioPanel.remove(ab);
28823328
2883
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
28843331 // ab.GetObject().objectUI = null; // ?????????
28853332
28863333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28873334 break;
28883335 }
28893336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
28903339 refreshContents(true);
28913340 } else
28923341 if (source == editItem || source == editButton)
28933342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
28943349 EditSelection(false);
28953350 } else
28963351 if (source == uneditButton)
....@@ -2900,12 +3355,13 @@
29003355 Object3D child = (Object3D)e.nextElement();
29013356 if(child.editWindow != null)
29023357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
29033359 child.CloseUI();
29043360 listUI.remove(child);
29053361
2906
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
29073363 }
2908
- objEditor.ctrlPanel.validate();
3364
+ objEditor.ctrlPanel.FlushUI();
29093365 //objEditor.jTree.clearSelection();
29103366 //objEditor.ResetSliders();
29113367 refreshContents(true);
....@@ -2916,6 +3372,7 @@
29163372 //copy.ClearUI();
29173373 for (Object3D obj : listUI)
29183374 {
3375
+ obj.pinned = true;
29193376 obj.CloseUI();
29203377 }
29213378 listUI.clear();
....@@ -2925,7 +3382,7 @@
29253382 {
29263383 assert(copy == group);
29273384
2928
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29293386
29303387 for (Object3D obj : listUI)
29313388 {
....@@ -2989,7 +3446,11 @@
29893446 frontView.object = group;
29903447 sideView.object = group;
29913448 }
2992
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
29933454 /*
29943455 currentLayout = radio.layout;
29953456 if (currentLayout == null)
....@@ -3001,8 +3462,23 @@
30013462 //group.parent = null; // ROOT
30023463 //group.attributes = -1;
30033464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
30043467 refreshContents(true);
3005
- }
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
+ }
30063482 else
30073483 {
30083484 //return super.action(event, arg);
....@@ -3011,7 +3487,6 @@
30113487 }
30123488
30133489 boolean useclient = false;
3014
- cRadio radio;
30153490
30163491 void ToggleRoot()
30173492 {
....@@ -3063,6 +3538,28 @@
30633538 refreshContents();
30643539 }
30653540
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
+ }
30663563
30673564 void ResetTransform()
30683565 {
....@@ -3175,7 +3672,7 @@
31753672 refreshContents();
31763673 }
31773674
3178
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
31793676 {
31803677 Object3D obj;
31813678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3190,12 +3687,16 @@
31903687 LA.matIdentity(Object3D.mat);
31913688 obj.getBounds(minima, maxima, false);
31923689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3193
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31943692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31953693 obj.TransformMesh(Object3D.mat);
3694
+
31963695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3197
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31983698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
31993700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32003701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32013702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3224,7 +3725,8 @@
32243725
32253726 int size = obj.MemorySize();
32263727
3227
- 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)");
32283730 }
32293731 }
32303732 catch (Exception e)
....@@ -3261,9 +3763,9 @@
32613763 obj = (Object3D)e.nextElement();
32623764
32633765 System.out.println("Object is: " + obj);
3264
- GrafreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
32653767 System.out.println("Boundary rep: " + obj.bRep);
3266
- GrafreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
32673769
32683770 // System.err.println((size/1024) + " KB is the size of " + obj);
32693771 }
....@@ -3305,6 +3807,13 @@
33053807 void GenNormals(boolean crease)
33063808 {
33073809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
33083817
33093818 refreshContents();
33103819 }
....@@ -3477,8 +3986,8 @@
34773986
34783987 void ParseVertices()
34793988 {
3480
- boolean epsequal = GrafreeD.epsequal;
3481
- GrafreeD.epsequal = true;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
34823991
34833992 for (int i=0; i<group.selection.size(); i++)
34843993 {
....@@ -3503,7 +4012,7 @@
35034012 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35044013 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35054014
3506
- g.add(GrafreeD.clipboard);
4015
+ g.add(Grafreed.clipboard);
35074016
35084017 buffer.add(g);
35094018 }
....@@ -3518,7 +4027,7 @@
35184027 makeSomething(buffer, i==group.selection.size()-1);
35194028 }
35204029
3521
- GrafreeD.epsequal = epsequal;
4030
+ Grafreed.epsequal = epsequal;
35224031
35234032 refreshContents();
35244033 }
....@@ -3536,7 +4045,16 @@
35364045 String pigment = Object3D.GetPigment(tex);
35374046 //String bump = Object3D.GetBump(tex);
35384047
3539
- 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
+ }
35404058
35414059 double s = v.s;
35424060
....@@ -3624,11 +4142,11 @@
36244142
36254143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36264144
3627
- boolean random = CameraPane.RANDOM;
3628
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
36294147 lowres.linkVerticesThis(null);
36304148 lowres.linkVerticesThis(sn);
3631
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
36324150
36334151 System.err.flush();
36344152
....@@ -3668,7 +4186,7 @@
36684186 return;
36694187
36704188 Object3D poses = group.selection.get(0);
3671
- Object3D ref = GrafreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
36724190
36734191 Object3D newgroup = new Object3D("Po:" + poses.name);
36744192
....@@ -3862,9 +4380,9 @@
38624380
38634381 void ClipMesh()
38644382 {
3865
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38664384 {
3867
- Object3D content = GrafreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
38684386
38694387 if (content instanceof cGroup && ((cGroup)content).transientlink )
38704388 content = ((cGroup)content).get(0);
....@@ -3873,7 +4391,7 @@
38734391 // {
38744392 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38754393 // }
3876
- group.selection.ClipMesh(GrafreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
38774395 }
38784396 // group.selection.ClipMesh(GrafreeD.clipboard);
38794397 System.out.println("DONE.");
....@@ -3920,6 +4438,18 @@
39204438 void MarkLeaves(boolean hide)
39214439 {
39224440 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);
39234453 refreshContents();
39244454 }
39254455
....@@ -3994,10 +4524,6 @@
39944524 // }
39954525 // }
39964526
3997
- static boolean allparams = true;
3998
-
3999
- static Vector<Object3D> listUI = new Vector<Object3D>();
4000
-
40014527 void EditSelection(boolean newWindow)
40024528 {
40034529 // aConstraints.gridy = 0;
....@@ -4005,10 +4531,10 @@
40054531 {
40064532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40074533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4008
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40094535
40104536 Object3D elem = (Object3D)group.selection.elementAt(i);
4011
- if(elem != group)
4537
+ if(elem != group || !newWindow)
40124538 {
40134539 // if (!(elem instanceof Composite))
40144540 // newWindow = false;
....@@ -4091,6 +4617,17 @@
40914617
40924618 freezemodel = true;
40934619
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
+
40944631 /**/
40954632 //switch (event.id)
40964633 {
....@@ -4098,7 +4635,6 @@
40984635 //case 702: // Event.LIST_DESELECT
40994636 group.deselectAll();
41004637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4101
- objEditor.ClearInfo(); // .GetMaterial());
41024638 if (tps != null)
41034639 {
41044640 for (int i=0; i < tps.length; i++)
....@@ -4107,33 +4643,39 @@
41074643
41084644 //if (child.parent != null)
41094645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
41104647 group.addSelectee(child);
4111
- objEditor.SetMaterial(child); // .GetMaterial());
4112
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4113
- System.err.println("info : " + child.GetPath());
41144648 }
41154649 }
4116
- else
4117
- {
4118
- objEditor.SetMaterial(group); // .GetMaterial());
4119
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4120
- System.err.println("info : " + group.GetPath());
4121
- }
4650
+// else
4651
+// {
4652
+// objEditor.SetMaterial(group); // .GetMaterial());
4653
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4654
+// System.err.println("info : " + group.GetPath());
4655
+// }
41224656
4123
- objEditor.SetText(); // jan 2014
4124
-
4125
- 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))
41264658 CameraPane.flash = true;
41274659
4128
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41294661 // a camera
41304662 {
4131
- CameraPane.camerachangeframe = 0; // don't refuse it
4132
- 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
+ }
41334668 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41344669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41354670 }
41364671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
41374679 refreshContents();
41384680 //return true;
41394681 }
....@@ -4142,6 +4684,33 @@
41424684
41434685 freezemodel = false;
41444686 }
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
+ }
41454714
41464715 void linkSomething(Object3D thing)
41474716 {
....@@ -4213,16 +4782,19 @@
42134782 {
42144783 if (group.selection.isEmpty())
42154784 return;
4216
- GrafreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
42174787 Composite tGroup = null;
42184788 if (group.selection.size() > 0) // 1)
42194789 {
42204790 tGroup = new cGroup();
4221
- GrafreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
42224792 }
42234793
42244794 if (cut)
42254795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
42264798 //int indices[] = jList.getSelectedIndices();
42274799 //for (int i = indices.length - 1; i >= 0; i--)
42284800 //jList.remove(indices[i]);
....@@ -4258,16 +4830,16 @@
42584830 //System.out.println("cut " + child);
42594831 //System.out.println("parent = " + child.parent);
42604832 // tmp.addChild(child);
4261
- if (GrafreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
42624834 tGroup.add/*Child*/(tmp);
42634835 else
4264
- GrafreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
42654837 }
42664838 else
4267
- if (GrafreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
42684840 tGroup.add/*Child*/(child);
42694841 else
4270
- GrafreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
42714843 }
42724844
42734845 //ResetModel();
....@@ -4299,21 +4871,23 @@
42994871 //System.out.println("cut " + elem);
43004872 //System.out.println("parent = " + elem.parent);
43014873 // tmp.addChild(elem);
4302
- if (GrafreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
43034875 tGroup.add/*Child*/(tmp);
43044876 else
4305
- GrafreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
43064878 }
43074879 else
4308
- if (GrafreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
43094881 tGroup.add/*Child*/(child);
43104882 else
4311
- GrafreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
43124884 }
43134885
43144886 }
4315
- if (GrafreeD.clipboardIsTempGroup)
4316
- GrafreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
43174891 if (cut)
43184892 {
43194893 ResetModel();
....@@ -4327,7 +4901,7 @@
43274901 // return;
43284902 boolean first = true;
43294903
4330
- if (GrafreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
43314905 {
43324906 Composite temp;
43334907
....@@ -4338,7 +4912,7 @@
43384912 temp = (Composite)Applet3D.clipboard.deepCopy();
43394913 */
43404914 Object3D elem;
4341
- 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))
43424916 {
43434917 Object3D child = (Object3D)e.nextElement();
43444918
....@@ -4372,21 +4946,21 @@
43724946 //Object3D cb = Applet3D.clipboard;
43734947 //temp.addChild(cb);
43744948 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4375
- assert(GrafreeD.clipboard.parent == null);
4376
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4377
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4378
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4379
- 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());
43804954 else
4381
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4382
- GrafreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
43834957 }
43844958
43854959 ResetModel();
43864960 refreshContents();
43874961 }
43884962
4389
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
43904964 {
43914965 // if (GrafreeD.clipboard == null)
43924966 // return;
....@@ -4415,15 +4989,22 @@
44154989 if (copyit)
44164990 {
44174991 // paste(false);
4418
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
44195000 }
44205001 else
44215002 {
44225003 boolean first = true;
44235004
4424
- if (GrafreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
44255006 {
4426
- Composite temp = (Composite)GrafreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
44275008 Object3D copy;
44285009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44295010 {
....@@ -4433,7 +5014,7 @@
44335014 }
44345015 } else
44355016 {
4436
- linkSomething(GrafreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
44375018 }
44385019 }
44395020 }
....@@ -4838,21 +5419,6 @@
48385419 }
48395420 */
48405421
4841
- void ImportGFD()
4842
- {
4843
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4844
- browser.show();
4845
- String filename = browser.getFile();
4846
- if (filename != null && filename.length() > 0)
4847
- {
4848
- String fullname = browser.getDirectory() + filename;
4849
-
4850
- //Object3D readobj =
4851
- objEditor.ReadGFD(fullname, objEditor);
4852
- //makeSomething(readobj);
4853
- }
4854
- }
4855
-
48565422 /*
48575423 public void Callback(Object obj)
48585424 {
....@@ -4876,26 +5442,9 @@
48765442 }
48775443 */
48785444
4879
- void ImportVRMLX3D()
4880
- {
4881
- if (GrafreeD.standAlone)
4882
- {
4883
- /**/
4884
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4885
- browser.show();
4886
- String filename = browser.getFile();
4887
- if (filename != null && filename.length() > 0)
4888
- {
4889
- String fullname = browser.getDirectory() + filename;
4890
- LoadVRMLX3D(fullname);
4891
- }
4892
- /**/
4893
- }
4894
- }
4895
-
48965445 String GetFile(String dialogName)
48975446 {
4898
- if (GrafreeD.standAlone)
5447
+ if (Grafreed.standAlone)
48995448 {
49005449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49015450 browser.show();
....@@ -4959,10 +5508,36 @@
49595508 cButton flashSelectionButton;
49605509 cButton editButton;
49615510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
49625512 cButton clearpanelButton;
4963
- cButton allParamsButton;
49645513 cButton unselectButton;
49655514
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
+
49665541 cButton screenfitButton;
49675542 cButton screenfitpointButton;
49685543 cButton snapobjectButton;
....@@ -4974,14 +5549,6 @@
49745549
49755550 cButton setsupportButton;
49765551
4977
- cButton twoButton;
4978
- cButton sixButton;
4979
- cButton threeButton;
4980
- cButton sevenButton;
4981
- cButton fourButton; // full panel
4982
- cButton oneButton; // full XYZ
4983
- //cButton currentLayout;
4984
-
49855552 //
49865553 //Composite
49875554 Object3D // to do !!
....@@ -4991,9 +5558,11 @@
49915558 //JTree jTree;
49925559 private MenuItem lookAtItem;
49935560 private MenuItem lookFromItem;
4994
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
49955562 private MenuItem cutItem;
4996
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
49975566 private MenuItem cloneItem;
49985567 private MenuItem cloneSupportItem;
49995568 private MenuItem overwriteGeoItem;
....@@ -5006,7 +5575,7 @@
50065575 private MenuItem linkverticesItem;
50075576 private MenuItem relinkverticesItem;
50085577 private MenuItem setMasterItem;
5009
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
50105579 private MenuItem stepAllItem;
50115580 private MenuItem revertMeshItem;
50125581 private MenuItem poseMeshItem;
....@@ -5017,6 +5586,7 @@
50175586 private MenuItem mergeGeometriesItem;
50185587 private MenuItem copyItem;
50195588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
50205590 private MenuItem pasteLinkItem;
50215591 private MenuItem pasteCloneItem;
50225592 private MenuItem pasteExpandItem;
....@@ -5055,6 +5625,10 @@
50555625 private MenuItem showleavesItem;
50565626 private MenuItem markleavesItem;
50575627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
50585632
50595633 private MenuItem flipVItem;
50605634 private MenuItem unflipVItem;
....@@ -5066,15 +5640,17 @@
50665640 private MenuItem panoTexturesItem;
50675641
50685642 private MenuItem resetCentroidItem;
5069
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
50705644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
50715647 private MenuItem hideItem;
50725648 private MenuItem grabItem;
50735649 private MenuItem backItem;
50745650 private MenuItem frontItem;
50755651 private MenuItem cameraItem;
50765652 private MenuItem compositeItem;
5077
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
50785654 private MenuItem physicsItem;
50795655 private MenuItem frameselectorItem;
50805656 private MenuItem scriptNodeItem;
....@@ -5114,7 +5690,7 @@
51145690 private MenuItem blobItem;
51155691 private MenuItem latheItem;
51165692 private MenuItem bezierItem;
5117
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
51185694 private MenuItem meshItem;
51195695 // private MenuItem meshGroupItem;
51205696 private MenuItem springItem;
....@@ -5136,11 +5712,6 @@
51365712 private MenuItem doubleItem;
51375713 private MenuItem tripleItem;
51385714
5139
- private MenuItem importGFDItem;
5140
- private MenuItem importVRMLX3DItem;
5141
- private MenuItem import3DSItem;
5142
- private MenuItem importOBJItem;
5143
-
51445715 private MenuItem computeAOItem;
51455716 private MenuItem recompileItem;
51465717 private MenuItem editScriptItem;
....@@ -5150,4 +5721,8 @@
51505721 private MenuItem analyzeItem;
51515722 private MenuItem dumpItem;
51525723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
51535728 }