Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- 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));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,30 +148,29 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
163155 Menu menu;
164156 oe.menuBar.add(menu = new Menu("Edit"));
165157 //editItem = menu.add(new MenuItem("Edit"));
166158 //editItem.addActionListener(this);
167
- 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"));
168166 duplicateItem.addActionListener(this);
169
- menu.add("-");
170167 cloneItem = menu.add(new MenuItem("Clone"));
171168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
172171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173172 cloneSupportItem.addActionListener(this);
173
+ }
174174 menu.add("-");
175175 cutItem = menu.add(new MenuItem("Cut"));
176176 cutItem.addActionListener(this);
....@@ -178,27 +178,123 @@
178178 copyItem.addActionListener(this);
179179 pasteItem = menu.add(new MenuItem("Paste"));
180180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
181185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182186 pasteLinkItem.addActionListener(this);
183187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184188 pasteCloneItem.addActionListener(this);
185189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
187192 clearItem = menu.add(new MenuItem("Clear"));
188193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
189198 clearAllItem = menu.add(new MenuItem("Clear All"));
190199 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());
191237
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
+
192289 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
290
+ if (Globals.ADVANCED)
291
+ {
197292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198293 revertMeshItem.addActionListener(this);
199294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200295 resetreferencesItem.addActionListener(this);
201296 menu.add("-");
297
+ }
202298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203299 overwriteGeoItem.addActionListener(this);
204300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +306,103 @@
210306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211307 overwriteUVItem.addActionListener(this);
212308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
213311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214312 generateMeshItem.addActionListener(this);
215313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216314 poseMeshItem.addActionListener(this);
217315 menu.add("-");
316
+ }
218317 resetsupportItem = menu.add(new MenuItem("Reset support"));
219318 resetsupportItem.addActionListener(this);
220319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221320 linkverticesItem.addActionListener(this);
222321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
224326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225327 setMasterItem.addActionListener(this);
328
+ }
226329
227330 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
230333 backItem = menu.add(new MenuItem("Back"));
231334 backItem.addActionListener(this);
232335 frontItem = menu.add(new MenuItem("Front"));
233336 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- 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"));
237343 hideItem.addActionListener(this);
344
+ }
238345 ungroupItem = menu.add(new MenuItem("Ungroup"));
239346 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- 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
+ {
247354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248355 switchGeoItem.addActionListener(this);
249356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250357 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
252359 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);
253366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254367 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
368
+ }
257369
258370 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
261373 billboardItem = menu.add(new MenuItem("Billboard"));
262374 billboardItem.addActionListener(this);
263375 csgItem = menu.add(new MenuItem("CSG"));
264376 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266378 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268380 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
271386 linkerItem = menu.add(new MenuItem("Linker"));
272387 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275388 attributeItem = menu.add(new MenuItem("Attribute"));
276389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
277392 pointflowItem = menu.add(new MenuItem("Point Flow"));
278393 pointflowItem.addActionListener(this);
394
+ }
279395 menu.add("-");
280396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281397 resetTransformItem.addActionListener(this);
282398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283399 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- 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);
286406
287407 oe.menuBar.add(menu = new Menu("Geometry"));
288408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +413,11 @@
293413 genNormalsCADItem.addActionListener(this);
294414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
296418 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297419 genNormalsMINEItem.addActionListener(this);
420
+ }
298421 stripifyItem = menu.add(new MenuItem("Stripify"));
299422 stripifyItem.addActionListener(this);
300423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +439,34 @@
316439 reduce34MeshItem.addActionListener(this);
317440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318441 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
323450
324451 oe.menuBar.add(menu = new Menu("Attributes"));
325452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326453 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);
327458 menu.add("-");
328459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329460 liveleavesItem.addActionListener(this);
330461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
332465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333466 supportleavesItem.addActionListener(this);
334467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335468 unsupportleavesItem.addActionListener(this);
469
+ }
336470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337471 hideleavesItem.addActionListener(this);
338472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +475,14 @@
341475 markleavesItem.addActionListener(this);
342476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343477 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);
344486 menu.add("-");
345487 flipVItem = menu.add(new MenuItem("Flip V"));
346488 flipVItem.addActionListener(this);
....@@ -376,35 +518,40 @@
376518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377519 sortbynameItem.addActionListener(this);
378520 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.
379528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380529 extractGeometriesItem.addActionListener(this);
381530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382531 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
532
+ }
387533
388534 oe.menuBar.add(menu = new Menu("Insert"));
389535 buildCreateMenu(menu);
390536
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402537 oe.menuBar.add(menu = new Menu("Tools"));
403538 buildToolsMenu(menu);
404539 }
405540
406541 void SetupUI2(ObjEditor oe)
407542 {
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
+
408555 //new Exception().printStackTrace();
409556
410557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +580,213 @@
433580 oe.radioPanel.add(dummyButton);
434581 oe.buttonGroup.add(dummyButton);
435582 */
436
- aConstraints.gridy += 1;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
437586
438587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439588
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
442592
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
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");
445621 liveCB.addItemListener(this);
446622
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, 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);
454634 screenfitButton.setToolTipText("Screen fit");
455635 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
636
+
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
640
+
457641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458642 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464643
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- 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));
473652
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482654 twoButton.setToolTipText("Show center view only");
483655 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
656
+ this.fullscreenLayout = twoButton;
657
+
658
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485659 fourButton.addActionListener(this);
486660 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488662 sixButton.setToolTipText("2-column layout left");
489663 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491665 threeButton.setToolTipText("2-column layout right");
492666 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494668 sevenButton.setToolTipText("3-column layout");
495669 sevenButton.addActionListener(this);
496670 //
497671
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- 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");
500674 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
675
+
676
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503677 closeButton.setToolTipText("Close tab");
504678 closeButton.addActionListener(this);
505679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506680 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515681
516
- 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");
517767 uneditButton.addActionListener(this);
518768
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- 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");
531771 allParamsButton.addActionListener(this);
532772
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- 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");
538779 unselectButton.addActionListener(this);
539780
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
+
540790 // oe.aConstraints.gridx += 1;
541791 // oe.aConstraints.weighty = 0;
542792 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +798,22 @@
548798 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549799 // gcButton.addActionListener(this);
550800
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
801
+ cGridBag jSPPanel = new cGridBag();
802
+
803
+ JScrollPane jSP;
562804 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564806 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
584807
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
+
585817 //jList.addListSelectionListener(this);
586818 oe.jTree.addTreeSelectionListener(this);
587819 //jTree.setRootVisible(false);
....@@ -604,83 +836,139 @@
604836 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605837 }
606838
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
839
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608840 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- 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);
618844
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // 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);
622848
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
849
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
850
+ textureCB.setToolTipText("Copy texture when dropped");
851
+ textureCB.addItemListener(this);
852
+
853
+ panel.Return();
854
+
855
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639856 boxCB.setToolTipText("Display bounding boxes");
640857 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
858
+
859
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643860 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644861 zoomBoxCB.addItemListener(this);
645862
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
+
646886 // constraints.gridy += 1;
647887 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648888 // speakerMocapCB.addItemListener(this);
649889
890
+ panel.Return();
891
+
650892 if (false)
651893 {
652894 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
895
+ //constraints.gridy += 1;
896
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655897 speakerCameraCB.addItemListener(this);
656898
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
899
+ //constraints.gridy += 1;
900
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659901 speakerFocusCB.addItemListener(this);
660902
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
903
+ //constraints.gridy += 1;
904
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663905 smoothfocusCB.addItemListener(this);
906
+ panel.Return();
664907 }
665908
666909 //constraints.gridx += 1;
667910 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668911 // debugCB.addItemListener(this);
669912
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
917
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
672919 oeilCB.addItemListener(this);
673920
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
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
+ {
941
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676942 lookAtCB.setToolTipText("Look-at target");
677943 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);
678958
679959 }
680960
681961 void EditObject(Object3D obj)
682962 {
683963 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
+
684972 radioButton.SetObject(obj);
685973 radioButton.layout = sevenButton;
686974 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +977,11 @@
689977 buttonGroup.add(radioButton);
690978 radioButton.doClick();
691979 }
980
+
692981 void SetupViews(ObjEditor oe)
693982 {
983
+ theFrame = this;
984
+
694985 oe.SetupViews();
695986
696987 System.out.println("SetupViews");
....@@ -699,23 +990,27 @@
699990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
700991 }
701992
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- 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;
7131005 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
7191014
7201015 // static int COLOR = 1;
7211016 // static int MATERIAL = 2;
....@@ -723,9 +1018,9 @@
7231018
7241019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251020
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
7291024
7301025 public void itemStateChanged(ItemEvent e)
7311026 {
....@@ -753,6 +1048,7 @@
7531048 } else if(e.getSource() == liveCB)
7541049 {
7551050 cameraView.ToggleLive();
1051
+ refreshContents(false);
7561052 }
7571053 else if(e.getSource() == supportCB)
7581054 {
....@@ -817,6 +1113,14 @@
8171113 {
8181114 cameraView.ToggleOeil();
8191115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
8201124 else if(e.getSource() == lookAtCB)
8211125 {
8221126 cameraView.ToggleLookAt();
....@@ -833,7 +1137,8 @@
8331137
8341138 /**/
8351139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
8371142 if ((path == null) || (path.getPathCount() <= 1)) {
8381143 // We can't move the root node or an empty selection
8391144 return;
....@@ -905,7 +1210,9 @@
9051210 // objEditor.DropFile((java.io.File[]) object, true);
9061211 // return;
9071212 // }
908
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091216 {
9101217 // file(s)
9111218 String[] names = string.split("\n");
....@@ -932,7 +1239,7 @@
9321239
9331240 flashIt = false;
9341241 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371244
9381245 if (group.selection.size() == 1)
....@@ -948,23 +1255,33 @@
9481255
9491256 assert target == objEditor.jTree;
9501257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
9511259 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531261 } catch (Exception e) {
9541262 System.out.println("destinationPath : " + destinationPath);
9551263 return;
9561264 }
9571265
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
9591267 {
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
+// {
9601277 loadClipboard(true);
9611278 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9681285 }
9691286 public void dropActionChanged(DropTargetDragEvent dtde)
9701287 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1386,104 @@
10691386 {
10701387 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711388 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- 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
+ {
10841407 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851408 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10881415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891416 ragdollItem.addActionListener(this);
10901417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911418 ragdoll2Item.addActionListener(this);
1419
+ }
10921420 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941422 meshItem.addActionListener(this);
10951423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10971427 springItem = menu.add(new MenuItem("Spring"));
10981428 springItem.addActionListener(this);
10991429 flagItem = menu.add(new MenuItem("Flag"));
11001430 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051431 blobItem = menu.add(new MenuItem("Blob"));
11061432 blobItem.addActionListener(this);
11071433 latheItem = menu.add(new MenuItem("Lathe"));
11081434 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- 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);
11111442 menu.add("-");
11121443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131444 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
11161447 doubleItem = menu.add(new MenuItem("Fork"));
11171448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
11181451 tripleItem = menu.add(new MenuItem("Trident"));
11191452 tripleItem.addActionListener(this);
1453
+ }
11201454 }
11211455
11221456 void buildToolsMenu(Menu menu)
11231457 {
11241458 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251459 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1460
+ animationItem.setState(Globals.ANIMATION);
11271461
11281462 menu.add("-");
11291463 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301464 parseverticesItem.addActionListener(this);
11311465 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321466 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341468 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381470 reduceMorphItem.addActionListener(this);
11391471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401472 reduce34MorphItem.addActionListener(this);
1141
-
1473
+ menu.add("-");
11421474 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431475 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
11461482 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471483 memoryItem.addActionListener(this);
11481484 menu.add(analyzeItem = new MenuItem("Analyze"));
11491485 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
11511487 dumpItem.addActionListener(this);
11521488 // menu.add(pathItem = new MenuItem("From-to path"));
11531489 // pathItem.addActionListener(this);
....@@ -1165,6 +1501,7 @@
11651501 menu.add("-");
11661502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671503 editScriptItem.addActionListener(this);
1504
+ }
11681505 }
11691506
11701507 void ScreenFit()
....@@ -1287,6 +1624,7 @@
12871624 shadow.material = new cMaterial(obj.material);
12881625 shadow.material.diffuse = 0.0001f;
12891626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12901628
12911629 makeSomething(shadow);
12921630 }
....@@ -1493,9 +1831,9 @@
14931831
14941832 void Overwrite(int mask)
14951833 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971835 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
14991837
15001838 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011839 content = ((cGroup)content).get(0);
....@@ -1534,7 +1872,7 @@
15341872 {
15351873 ScreenFit();
15361874 } else
1537
- if (source == switchItem)
1875
+ if (source == switchViewItem)
15381876 {
15391877 cVector v1 = new cVector();
15401878 cVector v2 = new cVector();
....@@ -1543,11 +1881,11 @@
15431881 objEditor.cameraView.renderCamera.setAim(v2, v1);
15441882 objEditor.cameraView.repaint();
15451883 } else
1546
- if (source == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
15471885 {
15481886 makeSomething(new Box());
15491887 } else
1550
- if (source == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
15511889 {
15521890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15531891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1626,27 +1964,27 @@
16261964
16271965 makeSomething(obj);
16281966 } else
1629
- if (source == gridItem)
1967
+ if (source == gridItem || source == gridButton)
16301968 {
16311969 makeSomething(new Grid());
16321970 } else
1633
- if (source == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
16341972 {
16351973 makeSomething(new Sphere());
16361974 } else
1637
- if (source == coneItem)
1975
+ if (source == coneItem || source == coneButton)
16381976 {
16391977 makeSomething(new Cone());
16401978 } else
1641
- if (source == torusItem)
1979
+ if (source == torusItem || source == torusButton)
16421980 {
16431981 makeSomething(new Torus());
16441982 } else
1645
- if (source == superItem)
1983
+ if (source == superItem || source == superButton)
16461984 {
16471985 makeSomething(new Superellipsoid());
16481986 } else
1649
- if (source == kleinItem)
1987
+ if (source == kleinItem || source == kleinButton)
16501988 {
16511989 makeSomething(new Klein());
16521990 } else
....@@ -1666,7 +2004,7 @@
16662004 {
16672005 makeSomething(new BezierSurface());
16682006 } else
1669
- if (source == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
16702008 {
16712009 /*
16722010 Object3D obj = new BezierSurface(5,8);
....@@ -1714,7 +2052,7 @@
17142052 s.setup();
17152053 makeSomething(s);
17162054 } else
1717
- if (source == lightItem)
2055
+ if (source == lightItem || source == lightButton)
17182056 {
17192057 makeSomething(new Light());
17202058 } else
....@@ -1764,7 +2102,7 @@
17642102
17652103 group(g);
17662104 } else
1767
- if (source == loopItem)
2105
+ if (source == loopItem || source == loopButton)
17682106 {
17692107 Composite csg = new GroupLeaf();
17702108 csg.count = 5;
....@@ -1800,23 +2138,6 @@
18002138 csg.addChild(child);
18012139 child.addChild(csg);
18022140 } else
1803
-
1804
- if (source == importGFDItem)
1805
- {
1806
- ImportGFD();
1807
- } else
1808
- if (source == importVRMLX3DItem)
1809
- {
1810
- ImportVRMLX3D();
1811
- } else
1812
- if (source == import3DSItem)
1813
- {
1814
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1815
- } else
1816
- if (source == importOBJItem)
1817
- {
1818
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1819
- } else
18202141 if (source == computeAOItem)
18212142 {
18222143 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1835,7 +2156,7 @@
18352156 if (source == invariantsItem)
18362157 {
18372158 System.out.println("Invariants:");
1838
- GrafreeD.grafreeD.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
18392160 } else
18402161 if (source == memoryItem)
18412162 {
....@@ -1853,6 +2174,35 @@
18532174 if (source == dumpItem)
18542175 {
18552176 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();
18562206 } else
18572207 if (source == screenfitButton)
18582208 {
....@@ -1903,12 +2253,20 @@
19032253 {
19042254 loadClipboard(true);
19052255 } else
2256
+ if (source == undoItem)
2257
+ {
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
19062264 if (source == duplicateItem)
19072265 {
1908
- Object3D keep = GrafreeD.clipboard;
2266
+ Object3D keep = Grafreed.clipboard;
19092267 loadClipboard(false);
19102268 paste(false);
1911
- GrafreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
19122270 } else
19132271 if (source == cloneItem)
19142272 {
....@@ -1926,13 +2284,17 @@
19262284 {
19272285 paste(false);
19282286 } else
2287
+ if (source == pasteIntoItem)
2288
+ {
2289
+ pasteInto(true, false);
2290
+ } else
19292291 if (source == pasteLinkItem)
19302292 {
1931
- pasteInto(false);
2293
+ pasteInto(false, false);
19322294 } else
19332295 if (source == pasteCloneItem)
19342296 {
1935
- pasteInto(true);
2297
+ pasteInto(true, true);
19362298 } else
19372299 if (source == pasteExpandItem)
19382300 {
....@@ -2124,9 +2486,9 @@
21242486 // group.selection.get(0).setMasterThis(content); // should be identity
21252487 // refreshContents();
21262488 // }
2127
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21282490 {
2129
- Object3D content = GrafreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
21302492
21312493 if (content instanceof cGroup && ((cGroup)content).transientlink )
21322494 content = ((cGroup)content).get(0);
....@@ -2134,11 +2496,11 @@
21342496 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352497 for (int i=0; i<group.selection.size(); i++)
21362498 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21392501 group.selection.get(i).linkVerticesThis(content);
21402502 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
21422504 }
21432505 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442506 refreshContents();
....@@ -2148,20 +2510,20 @@
21482510 {
21492511 for (int i=0; i<group.selection.size(); i++)
21502512 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
21532515 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
21552517 }
21562518
21572519 refreshContents();
21582520 } else
21592521 if (source == relinkverticesItem)
21602522 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
21632525 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2526
+ CameraPane.SWITCH = random;
21652527
21662528 refreshContents();
21672529 } else
....@@ -2176,9 +2538,9 @@
21762538 } else
21772539 if (source == setMasterItem)
21782540 {
2179
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21802542 {
2181
- Object3D content = GrafreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
21822544
21832545 if (content instanceof cGroup && ((cGroup)content).transientlink )
21842546 content = ((cGroup)content).get(0);
....@@ -2191,9 +2553,9 @@
21912553 {
21922554 if (group.selection.size() == 1)
21932555 {
2194
- if (GrafreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
21952557 {
2196
- Object3D content = GrafreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
21972559
21982560 if (content instanceof cGroup && ((cGroup)content).transientlink )
21992561 content = ((cGroup)content).get(0);
....@@ -2210,7 +2572,7 @@
22102572 {
22112573 RevertMeshes();
22122574 } else
2213
- if (source == resetMeshItem)
2575
+ if (source == resetAllItem)
22142576 {
22152577 ResetAll();
22162578 } else
....@@ -2230,9 +2592,9 @@
22302592 {
22312593 ClearSelection(true);
22322594 } else
2233
- if (source == grabItem)
2595
+ if (source == grabItem || source == groupButton)
22342596 {
2235
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
22362598 } else
22372599 if (source == hideItem)
22382600 {
....@@ -2250,16 +2612,16 @@
22502612 {
22512613 makeSomething(new Camera());
22522614 } else
2253
- if (source == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
22542616 {
22552617 group(new Composite());
22562618 } else
2257
- if (source == randomItem)
2619
+ if (source == switchItem || source == switchButton)
22582620 {
22592621 RandomNode random = new RandomNode();
22602622 group(random);
22612623 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2624
+ random.name = random.get(0).name + "Switch";
22632625 } else
22642626 if (source == physicsItem)
22652627 {
....@@ -2356,7 +2718,7 @@
23562718 {
23572719 group(new cLinker());
23582720 } else
2359
- if (source == textureItem)
2721
+ if (source == textureItem || source == textureButton)
23602722 {
23612723 group(new TextureNode());
23622724 } else
....@@ -2376,7 +2738,7 @@
23762738 {
23772739 CastShadow(2);
23782740 } else
2379
- if (source == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
23802742 {
23812743 //ungroup();
23822744 for (int i=0; i<group.selection.size(); i++)
....@@ -2398,7 +2760,7 @@
23982760 } else
23992761 if (source == genNormalsMESHItem)
24002762 {
2401
- GenNormals(true); // TODO
2763
+ GenNormalsMESH();
24022764 } else
24032765 if (source == genNormalsORGANItem)
24042766 {
....@@ -2463,6 +2825,22 @@
24632825 if (source == unmarkleavesItem)
24642826 {
24652827 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);
24662844 } else
24672845 if (source == flipVItem)
24682846 {
....@@ -2548,9 +2926,13 @@
25482926 {
25492927 SmoothMesh();
25502928 } else
2551
- if (source == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
25522930 {
25532931 TransformGeometry();
2932
+ } else
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
25542936 } else
25552937 if (source == resetTransformItem)
25562938 {
....@@ -2558,7 +2940,11 @@
25582940 } else
25592941 if (source == resetCentroidItem)
25602942 {
2561
- ResetCentroid();
2943
+ ResetCentroid(true);
2944
+ } else
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
25622948 } else
25632949 if (source == resetParentItem)
25642950 {
....@@ -2690,6 +3076,10 @@
26903076 if (source == twoButton)
26913077 {
26923078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
26933083 // bug
26943084 //gridPanel.setDividerLocation(1.0);
26953085 //bigPanel.setDividerLocation(0.0);
....@@ -2722,10 +3112,31 @@
27223112 bigThree.ClearUI();
27233113 bigThree.add(centralPanel);
27243114 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
+
27253133 } else
27263134 if (source == threeButton)
27273135 {
27283136 radio.layout = threeButton;
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
27293140
27303141 // bigThree.remove(scenePanel);
27313142 // bigThree.remove(centralPanel);
....@@ -2758,10 +3169,15 @@
27583169 bigThree.add(centralPanel);
27593170 bigThree.add(XYZPanel);
27603171 bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
27613174 } else
27623175 if (source == fourButton)
27633176 {
27643177 radio.layout = fourButton;
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
27653181
27663182 // bigThree.remove(scenePanel);
27673183 // bigThree.remove(centralPanel);
....@@ -2793,10 +3209,15 @@
27933209 bigThree.ClearUI();
27943210 bigThree.add(scenePanel);
27953211 bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
27963214 } else
27973215 if (source == sixButton)
27983216 {
27993217 radio.layout = sixButton;
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
28003221
28013222 // bigThree.remove(scenePanel);
28023223 // bigThree.remove(centralPanel);
....@@ -2829,10 +3250,15 @@
28293250 bigThree.add(scenePanel);
28303251 bigThree.add(centralPanel);
28313252 bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
28323255 } else
28333256 if (source == sevenButton)
28343257 {
28353258 radio.layout = sevenButton;
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
28363262
28373263 // bigThree.remove(scenePanel);
28383264 // bigThree.remove(centralPanel);
....@@ -2866,6 +3292,8 @@
28663292 bigThree.add(centralPanel);
28673293 bigThree.add(XYZPanel);
28683294 bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
28693297 } else
28703298 if (source == rootButton)
28713299 {
....@@ -2877,6 +3305,7 @@
28773305 EditObject(obj);
28783306 }
28793307
3308
+ cameraView.requestFocusInWindow();
28803309 refreshContents(true);
28813310 } else
28823311 if (source == closeButton)
....@@ -2886,22 +3315,37 @@
28863315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28873316 {
28883317 ab = (cRadio)e.nextElement();
2889
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28903319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
28913326 buttonGroup.remove(ab);
28923327 radioPanel.remove(ab);
28933328
2894
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
28953331 // ab.GetObject().objectUI = null; // ?????????
28963332
28973333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28983334 break;
28993335 }
29003336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
29013339 refreshContents(true);
29023340 } else
29033341 if (source == editItem || source == editButton)
29043342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
29053349 EditSelection(false);
29063350 } else
29073351 if (source == uneditButton)
....@@ -2911,12 +3355,13 @@
29113355 Object3D child = (Object3D)e.nextElement();
29123356 if(child.editWindow != null)
29133357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
29143359 child.CloseUI();
29153360 listUI.remove(child);
29163361
2917
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
29183363 }
2919
- objEditor.ctrlPanel.revalidate();
3364
+ objEditor.ctrlPanel.FlushUI();
29203365 //objEditor.jTree.clearSelection();
29213366 //objEditor.ResetSliders();
29223367 refreshContents(true);
....@@ -2927,6 +3372,7 @@
29273372 //copy.ClearUI();
29283373 for (Object3D obj : listUI)
29293374 {
3375
+ obj.pinned = true;
29303376 obj.CloseUI();
29313377 }
29323378 listUI.clear();
....@@ -2936,7 +3382,7 @@
29363382 {
29373383 assert(copy == group);
29383384
2939
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29403386
29413387 for (Object3D obj : listUI)
29423388 {
....@@ -3000,7 +3446,11 @@
30003446 frontView.object = group;
30013447 sideView.object = group;
30023448 }
3003
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
30043454 /*
30053455 currentLayout = radio.layout;
30063456 if (currentLayout == null)
....@@ -3012,8 +3462,23 @@
30123462 //group.parent = null; // ROOT
30133463 //group.attributes = -1;
30143464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
30153467 refreshContents(true);
3016
- }
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
+ }
30173482 else
30183483 {
30193484 //return super.action(event, arg);
....@@ -3022,7 +3487,6 @@
30223487 }
30233488
30243489 boolean useclient = false;
3025
- cRadio radio;
30263490
30273491 void ToggleRoot()
30283492 {
....@@ -3074,6 +3538,28 @@
30743538 refreshContents();
30753539 }
30763540
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
+ }
30773563
30783564 void ResetTransform()
30793565 {
....@@ -3186,7 +3672,7 @@
31863672 refreshContents();
31873673 }
31883674
3189
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
31903676 {
31913677 Object3D obj;
31923678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3201,12 +3687,16 @@
32013687 LA.matIdentity(Object3D.mat);
32023688 obj.getBounds(minima, maxima, false);
32033689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3204
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32053692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32063693 obj.TransformMesh(Object3D.mat);
3694
+
32073695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3208
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32093698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
32103700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32113701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32123702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3235,7 +3725,8 @@
32353725
32363726 int size = obj.MemorySize();
32373727
3238
- 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)");
32393730 }
32403731 }
32413732 catch (Exception e)
....@@ -3272,9 +3763,9 @@
32723763 obj = (Object3D)e.nextElement();
32733764
32743765 System.out.println("Object is: " + obj);
3275
- GrafreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
32763767 System.out.println("Boundary rep: " + obj.bRep);
3277
- GrafreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
32783769
32793770 // System.err.println((size/1024) + " KB is the size of " + obj);
32803771 }
....@@ -3316,6 +3807,13 @@
33163807 void GenNormals(boolean crease)
33173808 {
33183809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
33193817
33203818 refreshContents();
33213819 }
....@@ -3488,8 +3986,8 @@
34883986
34893987 void ParseVertices()
34903988 {
3491
- boolean epsequal = GrafreeD.epsequal;
3492
- GrafreeD.epsequal = true;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
34933991
34943992 for (int i=0; i<group.selection.size(); i++)
34953993 {
....@@ -3514,7 +4012,7 @@
35144012 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35154013 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35164014
3517
- g.add(GrafreeD.clipboard);
4015
+ g.add(Grafreed.clipboard);
35184016
35194017 buffer.add(g);
35204018 }
....@@ -3529,7 +4027,7 @@
35294027 makeSomething(buffer, i==group.selection.size()-1);
35304028 }
35314029
3532
- GrafreeD.epsequal = epsequal;
4030
+ Grafreed.epsequal = epsequal;
35334031
35344032 refreshContents();
35354033 }
....@@ -3547,7 +4045,16 @@
35474045 String pigment = Object3D.GetPigment(tex);
35484046 //String bump = Object3D.GetBump(tex);
35494047
3550
- 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
+ }
35514058
35524059 double s = v.s;
35534060
....@@ -3635,11 +4142,11 @@
36354142
36364143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36374144
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
36404147 lowres.linkVerticesThis(null);
36414148 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
36434150
36444151 System.err.flush();
36454152
....@@ -3679,7 +4186,7 @@
36794186 return;
36804187
36814188 Object3D poses = group.selection.get(0);
3682
- Object3D ref = GrafreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
36834190
36844191 Object3D newgroup = new Object3D("Po:" + poses.name);
36854192
....@@ -3873,9 +4380,9 @@
38734380
38744381 void ClipMesh()
38754382 {
3876
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38774384 {
3878
- Object3D content = GrafreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
38794386
38804387 if (content instanceof cGroup && ((cGroup)content).transientlink )
38814388 content = ((cGroup)content).get(0);
....@@ -3884,7 +4391,7 @@
38844391 // {
38854392 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38864393 // }
3887
- group.selection.ClipMesh(GrafreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
38884395 }
38894396 // group.selection.ClipMesh(GrafreeD.clipboard);
38904397 System.out.println("DONE.");
....@@ -3931,6 +4438,18 @@
39314438 void MarkLeaves(boolean hide)
39324439 {
39334440 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);
39344453 refreshContents();
39354454 }
39364455
....@@ -4005,10 +4524,6 @@
40054524 // }
40064525 // }
40074526
4008
- static boolean allparams = true;
4009
-
4010
- static Vector<Object3D> listUI = new Vector<Object3D>();
4011
-
40124527 void EditSelection(boolean newWindow)
40134528 {
40144529 // aConstraints.gridy = 0;
....@@ -4016,10 +4531,10 @@
40164531 {
40174532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40184533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4019
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40204535
40214536 Object3D elem = (Object3D)group.selection.elementAt(i);
4022
- if(elem != group)
4537
+ if(elem != group || !newWindow)
40234538 {
40244539 // if (!(elem instanceof Composite))
40254540 // newWindow = false;
....@@ -4102,6 +4617,17 @@
41024617
41034618 freezemodel = true;
41044619
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
+
41054631 /**/
41064632 //switch (event.id)
41074633 {
....@@ -4109,7 +4635,6 @@
41094635 //case 702: // Event.LIST_DESELECT
41104636 group.deselectAll();
41114637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4112
- objEditor.ClearInfo(); // .GetMaterial());
41134638 if (tps != null)
41144639 {
41154640 for (int i=0; i < tps.length; i++)
....@@ -4118,33 +4643,39 @@
41184643
41194644 //if (child.parent != null)
41204645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
41214647 group.addSelectee(child);
4122
- objEditor.SetMaterial(child); // .GetMaterial());
4123
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4124
- System.err.println("info : " + child.GetPath());
41254648 }
41264649 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4650
+// else
4651
+// {
4652
+// objEditor.SetMaterial(group); // .GetMaterial());
4653
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4654
+// System.err.println("info : " + group.GetPath());
4655
+// }
41334656
4134
- objEditor.SetText(); // jan 2014
4135
-
4136
- 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))
41374658 CameraPane.flash = true;
41384659
4139
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41404661 // a camera
41414662 {
4142
- CameraPane.camerachangeframe = 0; // don't refuse it
4143
- 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
+ }
41444668 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41454669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41464670 }
41474671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
41484679 refreshContents();
41494680 //return true;
41504681 }
....@@ -4153,6 +4684,33 @@
41534684
41544685 freezemodel = false;
41554686 }
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
+ }
41564714
41574715 void linkSomething(Object3D thing)
41584716 {
....@@ -4224,16 +4782,19 @@
42244782 {
42254783 if (group.selection.isEmpty())
42264784 return;
4227
- GrafreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
42284787 Composite tGroup = null;
42294788 if (group.selection.size() > 0) // 1)
42304789 {
42314790 tGroup = new cGroup();
4232
- GrafreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
42334792 }
42344793
42354794 if (cut)
42364795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
42374798 //int indices[] = jList.getSelectedIndices();
42384799 //for (int i = indices.length - 1; i >= 0; i--)
42394800 //jList.remove(indices[i]);
....@@ -4269,16 +4830,16 @@
42694830 //System.out.println("cut " + child);
42704831 //System.out.println("parent = " + child.parent);
42714832 // tmp.addChild(child);
4272
- if (GrafreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
42734834 tGroup.add/*Child*/(tmp);
42744835 else
4275
- GrafreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
42764837 }
42774838 else
4278
- if (GrafreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
42794840 tGroup.add/*Child*/(child);
42804841 else
4281
- GrafreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
42824843 }
42834844
42844845 //ResetModel();
....@@ -4310,21 +4871,23 @@
43104871 //System.out.println("cut " + elem);
43114872 //System.out.println("parent = " + elem.parent);
43124873 // tmp.addChild(elem);
4313
- if (GrafreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
43144875 tGroup.add/*Child*/(tmp);
43154876 else
4316
- GrafreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
43174878 }
43184879 else
4319
- if (GrafreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
43204881 tGroup.add/*Child*/(child);
43214882 else
4322
- GrafreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
43234884 }
43244885
43254886 }
4326
- if (GrafreeD.clipboardIsTempGroup)
4327
- GrafreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
43284891 if (cut)
43294892 {
43304893 ResetModel();
....@@ -4338,7 +4901,7 @@
43384901 // return;
43394902 boolean first = true;
43404903
4341
- if (GrafreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
43424905 {
43434906 Composite temp;
43444907
....@@ -4349,7 +4912,7 @@
43494912 temp = (Composite)Applet3D.clipboard.deepCopy();
43504913 */
43514914 Object3D elem;
4352
- 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))
43534916 {
43544917 Object3D child = (Object3D)e.nextElement();
43554918
....@@ -4383,21 +4946,21 @@
43834946 //Object3D cb = Applet3D.clipboard;
43844947 //temp.addChild(cb);
43854948 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4386
- assert(GrafreeD.clipboard.parent == null);
4387
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4388
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4389
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4390
- 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());
43914954 else
4392
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4393
- GrafreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
43944957 }
43954958
43964959 ResetModel();
43974960 refreshContents();
43984961 }
43994962
4400
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
44014964 {
44024965 // if (GrafreeD.clipboard == null)
44034966 // return;
....@@ -4426,15 +4989,22 @@
44264989 if (copyit)
44274990 {
44284991 // paste(false);
4429
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
44305000 }
44315001 else
44325002 {
44335003 boolean first = true;
44345004
4435
- if (GrafreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
44365006 {
4437
- Composite temp = (Composite)GrafreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
44385008 Object3D copy;
44395009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44405010 {
....@@ -4444,7 +5014,7 @@
44445014 }
44455015 } else
44465016 {
4447
- linkSomething(GrafreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
44485018 }
44495019 }
44505020 }
....@@ -4849,21 +5419,6 @@
48495419 }
48505420 */
48515421
4852
- void ImportGFD()
4853
- {
4854
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4855
- browser.show();
4856
- String filename = browser.getFile();
4857
- if (filename != null && filename.length() > 0)
4858
- {
4859
- String fullname = browser.getDirectory() + filename;
4860
-
4861
- //Object3D readobj =
4862
- objEditor.ReadGFD(fullname, objEditor);
4863
- //makeSomething(readobj);
4864
- }
4865
- }
4866
-
48675422 /*
48685423 public void Callback(Object obj)
48695424 {
....@@ -4887,26 +5442,9 @@
48875442 }
48885443 */
48895444
4890
- void ImportVRMLX3D()
4891
- {
4892
- if (GrafreeD.standAlone)
4893
- {
4894
- /**/
4895
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4896
- browser.show();
4897
- String filename = browser.getFile();
4898
- if (filename != null && filename.length() > 0)
4899
- {
4900
- String fullname = browser.getDirectory() + filename;
4901
- LoadVRMLX3D(fullname);
4902
- }
4903
- /**/
4904
- }
4905
- }
4906
-
49075445 String GetFile(String dialogName)
49085446 {
4909
- if (GrafreeD.standAlone)
5447
+ if (Grafreed.standAlone)
49105448 {
49115449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49125450 browser.show();
....@@ -4970,10 +5508,36 @@
49705508 cButton flashSelectionButton;
49715509 cButton editButton;
49725510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
49735512 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755513 cButton unselectButton;
49765514
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
+
49775541 cButton screenfitButton;
49785542 cButton screenfitpointButton;
49795543 cButton snapobjectButton;
....@@ -4985,14 +5549,6 @@
49855549
49865550 cButton setsupportButton;
49875551
4988
- cButton twoButton;
4989
- cButton sixButton;
4990
- cButton threeButton;
4991
- cButton sevenButton;
4992
- cButton fourButton; // full panel
4993
- cButton oneButton; // full XYZ
4994
- //cButton currentLayout;
4995
-
49965552 //
49975553 //Composite
49985554 Object3D // to do !!
....@@ -5002,9 +5558,11 @@
50025558 //JTree jTree;
50035559 private MenuItem lookAtItem;
50045560 private MenuItem lookFromItem;
5005
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
50065562 private MenuItem cutItem;
5007
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
50085566 private MenuItem cloneItem;
50095567 private MenuItem cloneSupportItem;
50105568 private MenuItem overwriteGeoItem;
....@@ -5017,7 +5575,7 @@
50175575 private MenuItem linkverticesItem;
50185576 private MenuItem relinkverticesItem;
50195577 private MenuItem setMasterItem;
5020
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
50215579 private MenuItem stepAllItem;
50225580 private MenuItem revertMeshItem;
50235581 private MenuItem poseMeshItem;
....@@ -5028,6 +5586,7 @@
50285586 private MenuItem mergeGeometriesItem;
50295587 private MenuItem copyItem;
50305588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
50315590 private MenuItem pasteLinkItem;
50325591 private MenuItem pasteCloneItem;
50335592 private MenuItem pasteExpandItem;
....@@ -5066,6 +5625,10 @@
50665625 private MenuItem showleavesItem;
50675626 private MenuItem markleavesItem;
50685627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
50695632
50705633 private MenuItem flipVItem;
50715634 private MenuItem unflipVItem;
....@@ -5077,15 +5640,17 @@
50775640 private MenuItem panoTexturesItem;
50785641
50795642 private MenuItem resetCentroidItem;
5080
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
50815644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
50825647 private MenuItem hideItem;
50835648 private MenuItem grabItem;
50845649 private MenuItem backItem;
50855650 private MenuItem frontItem;
50865651 private MenuItem cameraItem;
50875652 private MenuItem compositeItem;
5088
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
50895654 private MenuItem physicsItem;
50905655 private MenuItem frameselectorItem;
50915656 private MenuItem scriptNodeItem;
....@@ -5125,7 +5690,7 @@
51255690 private MenuItem blobItem;
51265691 private MenuItem latheItem;
51275692 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
51295694 private MenuItem meshItem;
51305695 // private MenuItem meshGroupItem;
51315696 private MenuItem springItem;
....@@ -5147,11 +5712,6 @@
51475712 private MenuItem doubleItem;
51485713 private MenuItem tripleItem;
51495714
5150
- private MenuItem importGFDItem;
5151
- private MenuItem importVRMLX3DItem;
5152
- private MenuItem import3DSItem;
5153
- private MenuItem importOBJItem;
5154
-
51555715 private MenuItem computeAOItem;
51565716 private MenuItem recompileItem;
51575717 private MenuItem editScriptItem;
....@@ -5161,4 +5721,8 @@
51615721 private MenuItem analyzeItem;
51625722 private MenuItem dumpItem;
51635723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
51645728 }