Normand Briere
2019-06-30 cfd7a643cb5a445016ddb15595158ecc59b184fd
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);
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.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(GraphreeD.clipboard, false));
107
- GraphreeD.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)GraphreeD.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("Show 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,73 +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);
321
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
322
+ relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
222326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223327 setMasterItem.addActionListener(this);
328
+ }
224329
225330 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
230333 backItem = menu.add(new MenuItem("Back"));
231334 backItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
335
+ frontItem = menu.add(new MenuItem("Front"));
336
+ frontItem.addActionListener(this);
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"));
343
+ hideItem.addActionListener(this);
344
+ }
345
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
346
+ ungroupItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
241354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242355 switchGeoItem.addActionListener(this);
243356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244357 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
246359 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);
247366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248367 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
368
+ }
251369
252370 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
373
+ billboardItem = menu.add(new MenuItem("Billboard"));
374
+ billboardItem.addActionListener(this);
255375 csgItem = menu.add(new MenuItem("CSG"));
256376 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258378 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260380 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
263386 linkerItem = menu.add(new MenuItem("Linker"));
264387 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267388 attributeItem = menu.add(new MenuItem("Attribute"));
268389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
269392 pointflowItem = menu.add(new MenuItem("Point Flow"));
270393 pointflowItem.addActionListener(this);
394
+ }
271395 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275397 resetTransformItem.addActionListener(this);
276398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277399 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.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);
280406
281407 oe.menuBar.add(menu = new Menu("Geometry"));
282408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +411,13 @@
285411 genNormalsORGANItem.addActionListener(this);
286412 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287413 genNormalsCADItem.addActionListener(this);
414
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
415
+ genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
418
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
419
+ genNormalsMINEItem.addActionListener(this);
420
+ }
288421 stripifyItem = menu.add(new MenuItem("Stripify"));
289422 stripifyItem.addActionListener(this);
290423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +439,34 @@
306439 reduce34MeshItem.addActionListener(this);
307440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308441 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
313450
314451 oe.menuBar.add(menu = new Menu("Attributes"));
315452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316453 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);
317458 menu.add("-");
318459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319460 liveleavesItem.addActionListener(this);
320461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
322465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323466 supportleavesItem.addActionListener(this);
324467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325468 unsupportleavesItem.addActionListener(this);
469
+ }
326470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327471 hideleavesItem.addActionListener(this);
328472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +475,14 @@
331475 markleavesItem.addActionListener(this);
332476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333477 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);
334486 menu.add("-");
335487 flipVItem = menu.add(new MenuItem("Flip V"));
336488 flipVItem.addActionListener(this);
....@@ -366,35 +518,40 @@
366518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367519 sortbynameItem.addActionListener(this);
368520 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.
369528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370529 extractGeometriesItem.addActionListener(this);
371530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372531 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
532
+ }
377533
378534 oe.menuBar.add(menu = new Menu("Insert"));
379535 buildCreateMenu(menu);
380536
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392537 oe.menuBar.add(menu = new Menu("Tools"));
393538 buildToolsMenu(menu);
394539 }
395540
396541 void SetupUI2(ObjEditor oe)
397542 {
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
+
398555 //new Exception().printStackTrace();
399556
400557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +580,217 @@
423580 oe.radioPanel.add(dummyButton);
424581 oe.buttonGroup.add(dummyButton);
425582 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 1;
429586
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588
+
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ if (Globals.ADVANCED)
594
+ {
595
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ maxButton.setToolTipText("Maximize window");
597
+ maxButton.addActionListener(this);
598
+ }
599
+
600
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
601
+ fullButton.setToolTipText("Full-screen window");
602
+ fullButton.addActionListener(this);
603
+
604
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
+ restoreCameraButton.setToolTipText("Restore viewpoint");
606
+ restoreCameraButton.addActionListener(this);
607
+
608
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ undoButton.setToolTipText("Undo changes");
610
+ undoButton.addActionListener(this);
611
+ undoButton.setEnabled(false);
612
+
613
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ redoButton.setToolTipText("Redo changes");
615
+ redoButton.addActionListener(this);
616
+ redoButton.setEnabled(false);
617
+
618
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ saveButton.setToolTipText("Save changes");
620
+ saveButton.addActionListener(this);
621
+
622
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
623
+ liveCB.setToolTipText("Enable animation");
431624 liveCB.addItemListener(this);
432625
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
626
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
627
+ oneStepButton.setToolTipText("Animate one step forward");
628
+ oneStepButton.addActionListener(this);
629
+
630
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
631
+ fastCB.setToolTipText("Fast mode");
451632 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
493
- trackCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
633
+
634
+ //oe.toolboxPanel.Return();
635
+
636
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ screenfitButton.setToolTipText("Screen fit");
497638 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
639
+
640
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
641
+// trackCB.setToolTipText("Enable tracking");
642
+// trackCB.addItemListener(this);
643
+
499644 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500645 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505646
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
512
- flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
647
+ if (Globals.ADVANCED)
648
+ {
649
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ snapobjectButton.addActionListener(this);
651
+ snapobjectButton.setToolTipText("Snap Object");
652
+ }
653
+
654
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
516655
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ twoButton.setToolTipText("Show center view only");
519658 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
659
+ this.fullscreenLayout = twoButton;
660
+
661
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521662 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
663
+ fourButton.setToolTipText("Show left panel only");
664
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ sixButton.setToolTipText("2-column layout left");
523666 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
+ threeButton.setToolTipText("2-column layout right");
525669 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ sevenButton.setToolTipText("3-column layout");
527672 sevenButton.addActionListener(this);
528673 //
529674
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
675
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
676
+ rootButton.setToolTipText("Edit selection in new tab");
531677 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
678
+
679
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
680
+ closeButton.setToolTipText("Close tab");
534681 closeButton.addActionListener(this);
535682 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536683 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538
-
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
541
- editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545684
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
685
+ // INSERT
686
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
687
+ gridButton.setToolTipText("Create grid");
688
+ gridButton.addActionListener(this);
689
+
690
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
691
+ boxButton.setToolTipText("Create box");
692
+ boxButton.addActionListener(this);
693
+
694
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ sphereButton.setToolTipText("Create sphere");
696
+ sphereButton.addActionListener(this);
697
+
698
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
699
+ coneButton.setToolTipText("Create cone");
700
+ coneButton.addActionListener(this);
701
+
702
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
+ torusButton.setToolTipText("Create torus");
704
+ torusButton.addActionListener(this);
705
+
706
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
707
+ superButton.setToolTipText("Create superellipsoid");
708
+ superButton.addActionListener(this);
709
+
710
+ if (Globals.ADVANCED)
711
+ {
712
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ kleinButton.setToolTipText("Create Klein bottle");
714
+ kleinButton.addActionListener(this);
715
+ }
716
+
717
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
718
+ particlesButton.setToolTipText("Create particle system");
719
+ particlesButton.addActionListener(this);
720
+
721
+ oe.toolboxPanel.Return();
722
+
723
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ groupButton.setToolTipText("Create group");
725
+ groupButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
728
+ compositeButton.setToolTipText("Create composite");
729
+ compositeButton.addActionListener(this);
730
+
731
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
732
+ switchButton.setToolTipText("Create item switcher");
733
+ switchButton.addActionListener(this);
734
+
735
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+ loopButton.setToolTipText("Create loop");
737
+ loopButton.addActionListener(this);
738
+
739
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
740
+ textureButton.setToolTipText("Create texture");
741
+ textureButton.addActionListener(this);
742
+
743
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
744
+ overlayButton.setToolTipText("Create overlay");
745
+ overlayButton.addActionListener(this);
746
+
747
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ lightButton.setToolTipText("Create light");
749
+ lightButton.addActionListener(this);
750
+
751
+ for (int i=6; --i>=0;)
752
+ {
753
+ oe.toolboxPanel.Return();
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
+ oe.toolboxPanel.add(new cGridBag());
759
+ oe.toolboxPanel.add(new cGridBag());
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ }
762
+
763
+ // EDIT panel
764
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
765
+ editButton.setToolTipText("Pin selection controls");
766
+ editButton.addActionListener(this);
767
+
768
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
769
+ uneditButton.setToolTipText("Remove selection controls");
547770 uneditButton.addActionListener(this);
548771
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
772
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
773
+ allParamsButton.setToolTipText("Show all controle");
561774 allParamsButton.addActionListener(this);
562775
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
776
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
777
+ clearPanelButton.setToolTipText("Clear edit panel");
778
+ clearPanelButton.addActionListener(this);
779
+
780
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
781
+ unselectButton.setToolTipText("Unselect");
568782 unselectButton.addActionListener(this);
569783
784
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ flashSelectionButton.setToolTipText("Highlight selection");
786
+ flashSelectionButton.addActionListener(this);
787
+
788
+ editCommandsPanel.preferredHeight = 1;
789
+
790
+ SetPinStates(false);
791
+// oe.treePanel.add(commandsPanel);
792
+// oe.treePanel.Return();
793
+
570794 // oe.aConstraints.gridx += 1;
571795 // oe.aConstraints.weighty = 0;
572796 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +802,22 @@
578802 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579803 // gcButton.addActionListener(this);
580804
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
805
+ cGridBag jSPPanel = new cGridBag();
806
+
807
+ JScrollPane jSP;
592808 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
809
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594810 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
599
-
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
604
- colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
607
- materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
- textureCB.addItemListener(this);
611
-
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
614811
812
+ oe.treePanel.add(jSPPanel);
813
+ oe.treePanel.Return();
814
+
815
+ oe.treePanel.add(copyOptionsPanel);
816
+ oe.treePanel.Return();
817
+
818
+// mainPanel.setDividerLocation(0.5); //1.0);
819
+// mainPanel.setResizeWeight(0.5);
820
+
615821 //jList.addListSelectionListener(this);
616822 oe.jTree.addTreeSelectionListener(this);
617823 //jTree.setRootVisible(false);
....@@ -633,20 +839,157 @@
633839 radio.layout = sevenButton;
634840 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635841 }
842
+
843
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
844
+ {
845
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
846
+ colorCB.setToolTipText("Copy color when dropped");
847
+ colorCB.addItemListener(this);
848
+
849
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
850
+ materialCB.setToolTipText("Copy material when dropped");
851
+ materialCB.addItemListener(this);
852
+
853
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
854
+ textureCB.setToolTipText("Copy texture when dropped");
855
+ textureCB.addItemListener(this);
856
+
857
+ panel.Return();
858
+
859
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
860
+ boxCB.setToolTipText("Display bounding boxes");
861
+ boxCB.addItemListener(this);
862
+
863
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
864
+ zoomBoxCB.setToolTipText("Display only for wheel");
865
+ zoomBoxCB.addItemListener(this);
866
+
867
+ if (true) // Globals.ADVANCED)
868
+ {
869
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
870
+// supportCB.setToolTipText("Enable rigging");
871
+// supportCB.addItemListener(this);
872
+
873
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
874
+ freezeCB.setToolTipText("Fast moving camera");
875
+ freezeCB.addItemListener(this);
876
+
877
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
878
+ // localCB.addItemListener(this);
879
+
880
+ panel.Return();
881
+
882
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
883
+ crowdCB.setToolTipText("Used for crowds");
884
+ crowdCB.addItemListener(this);
885
+
886
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
887
+ smoothCB.setToolTipText("Snapping delay");
888
+ smoothCB.addItemListener(this);
889
+
890
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
891
+ slowCB.setToolTipText("Smooth interpolation");
892
+ slowCB.addItemListener(this);
893
+
894
+// constraints.gridy += 1;
895
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
896
+// speakerMocapCB.addItemListener(this);
897
+
898
+ panel.Return();
899
+
900
+ if (false)
901
+ {
902
+ // handled in scripts
903
+ //constraints.gridy += 1;
904
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
905
+ speakerCameraCB.addItemListener(this);
906
+
907
+ //constraints.gridy += 1;
908
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
909
+ speakerFocusCB.addItemListener(this);
910
+
911
+ //constraints.gridy += 1;
912
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
913
+ smoothfocusCB.addItemListener(this);
914
+ panel.Return();
915
+ }
916
+
917
+//constraints.gridx += 1;
918
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
919
+// debugCB.addItemListener(this);
920
+
921
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
922
+ trackCB.setToolTipText("Enable tracking target");
923
+ trackCB.addItemListener(this);
924
+
925
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
926
+ oeilCB.setToolTipText("Move camera when tracking");
927
+ oeilCB.addItemListener(this);
928
+
929
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
930
+ shadowCB.setToolTipText("When live compute shadows");
931
+ shadowCB.addItemListener(this);
932
+
933
+ panel.Return();
934
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
935
+ toggleTextureCB.setToolTipText("Load textures");
936
+ toggleTextureCB.addItemListener(this);
937
+
938
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
939
+ toggleSwitchCB.setToolTipText("Choose a single item");
940
+ toggleSwitchCB.addItemListener(this);
941
+
942
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
943
+ autosaveCB.setToolTipText("On structure change");
944
+ autosaveCB.addItemListener(this);
945
+
946
+ panel.Return();
947
+ if (Globals.ADVANCED)
948
+ {
949
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
950
+ lookAtCB.setToolTipText("Look-at target");
951
+ lookAtCB.addItemListener(this);
952
+ }
953
+
954
+ }
955
+
956
+ cGridBag fill = new cGridBag();
957
+ fill.preferredHeight = 200;
958
+ cGridBag fill2 = new cGridBag();
959
+ fill2.preferredHeight = 200;
960
+ cGridBag fill3 = new cGridBag();
961
+ fill3.preferredHeight = 200;
962
+
963
+ panel.add(fill);
964
+ panel.add(fill2);
965
+ panel.add(fill3);
966
+
967
+ }
636968
637969 void EditObject(Object3D obj)
638970 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
971
+ cRadio radioButton = new cRadio(obj.name);
972
+
973
+ // Patch to avoid bug with transparency.
974
+ radioButton.hadMaterial = obj.material != null;
975
+ if (!radioButton.hadMaterial)
976
+ {
977
+ obj.material = new cMaterial();
978
+ }
979
+
980
+ radioButton.SetObject(obj);
981
+ radioButton.layout = sevenButton;
982
+ radioButton.SetCamera(cameraView.renderCamera, false);
983
+ radioButton.addActionListener(this);
984
+ radioPanel.add(radioButton);
985
+ buttonGroup.add(radioButton);
986
+ radioButton.doClick();
647987 }
988
+
648989 void SetupViews(ObjEditor oe)
649990 {
991
+ theFrame = this;
992
+
650993 oe.SetupViews();
651994
652995 System.out.println("SetupViews");
....@@ -655,22 +998,28 @@
655998 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
656999 }
6571000
658
- JCheckBox liveCB;
659
- JCheckBox supportCB;
660
- JCheckBox localCB;
661
- JCheckBox crowdCB;
662
- JCheckBox smoothCB;
663
- JCheckBox fastCB;
664
- JCheckBox slowCB;
665
- JCheckBox boxCB;
666
- JCheckBox trackCB;
667
- JCheckBox smoothfocusCB;
1001
+ cToggleButton liveCB;
1002
+ cCheckBox supportCB;
1003
+ cCheckBox localCB;
1004
+ cCheckBox crowdCB;
1005
+ cCheckBox smoothCB;
1006
+ cToggleButton fastCB;
1007
+ cCheckBox slowCB;
1008
+ cCheckBox boxCB;
1009
+ cCheckBox zoomBoxCB;
1010
+ cCheckBox freezeCB;
1011
+ //cToggleButton trackCB;
1012
+ cCheckBox trackCB;
1013
+ cCheckBox smoothfocusCB;
6681014 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1015
+ cCheckBox speakerCameraCB;
1016
+ cCheckBox speakerFocusCB;
1017
+ cCheckBox debugCB;
1018
+
1019
+ cCheckBox oeilCB;
1020
+ cCheckBox shadowCB;
1021
+ cCheckBox autosaveCB;
1022
+ cCheckBox lookAtCB;
6741023
6751024 // static int COLOR = 1;
6761025 // static int MATERIAL = 2;
....@@ -678,9 +1027,9 @@
6781027
6791028 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801029
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1030
+ cCheckBox colorCB;
1031
+ cCheckBox materialCB;
1032
+ cCheckBox textureCB;
6841033
6851034 public void itemStateChanged(ItemEvent e)
6861035 {
....@@ -705,10 +1054,10 @@
7051054 dropAttributes |= Object3D.TEXTURE;
7061055 else
7071056 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1057
+ } else if(e.getSource() == liveCB)
7101058 {
7111059 cameraView.ToggleLive();
1060
+ refreshContents(false);
7121061 }
7131062 else if(e.getSource() == supportCB)
7141063 {
....@@ -744,6 +1093,10 @@
7441093 cameraView.repaint();
7451094 // refreshContents();
7461095 }
1096
+ else if(e.getSource() == zoomBoxCB)
1097
+ {
1098
+ cameraView.ToggleZoomBoxMode();
1099
+ }
7471100 else if(e.getSource() == smoothfocusCB)
7481101 {
7491102 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1122,18 @@
7691122 {
7701123 cameraView.ToggleOeil();
7711124 }
1125
+ else if(e.getSource() == shadowCB)
1126
+ {
1127
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1128
+ }
1129
+ else if(e.getSource() == freezeCB)
1130
+ {
1131
+ Globals.FREEZEONMOVE ^= true;
1132
+ }
1133
+ else if(e.getSource() == autosaveCB)
1134
+ {
1135
+ Globals.SAVEONMAKE ^= true;
1136
+ }
7721137 else if(e.getSource() == lookAtCB)
7731138 {
7741139 cameraView.ToggleLookAt();
....@@ -785,7 +1150,8 @@
7851150
7861151 /**/
7871152 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1153
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1154
+ TreePath path = objEditor.jTree.getSelectionPath();
7891155 if ((path == null) || (path.getPathCount() <= 1)) {
7901156 // We can't move the root node or an empty selection
7911157 return;
....@@ -857,7 +1223,9 @@
8571223 // objEditor.DropFile((java.io.File[]) object, true);
8581224 // return;
8591225 // }
860
- if (string.charAt(0) == '/')
1226
+
1227
+ // File path for Mac and Windows
1228
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611229 {
8621230 // file(s)
8631231 String[] names = string.split("\n");
....@@ -884,7 +1252,7 @@
8841252
8851253 flashIt = false;
8861254 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1255
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881256 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891257
8901258 if (group.selection.size() == 1)
....@@ -900,23 +1268,33 @@
9001268
9011269 assert target == objEditor.jTree;
9021270 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1271
+ Object3D destinationLeaf;
9031272 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1273
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051274 } catch (Exception e) {
9061275 System.out.println("destinationPath : " + destinationPath);
9071276 return;
9081277 }
9091278
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1279
+ for (int i=group.selection.size(); --i>=0;)
9111280 {
1281
+ Object3D child = (Object3D)group.selection.elementAt(i);
1282
+
1283
+ // Cannot move into itself
1284
+ if (child == destinationLeaf)
1285
+ return;
1286
+ }
1287
+
1288
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1289
+// {
9121290 loadClipboard(true);
9131291 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1292
+ pasteInto(false, false);
1293
+// } else {
1294
+// loadClipboard(false);
1295
+// objEditor.jTree.setSelectionPath(destinationPath);
1296
+// pasteInto(false, false); // true); // ???
1297
+// }
9201298 }
9211299 public void dropActionChanged(DropTargetDragEvent dtde)
9221300 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1399,104 @@
10211399 {
10221400 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231401 //heightFieldItem.addActionListener(this);
1024
- gridItem = menu.add(new MenuItem("Grid"));
1025
- gridItem.addActionListener(this);
1026
- rectoidItem = menu.add(new MenuItem("Box"));
1027
- rectoidItem.addActionListener(this);
1028
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1029
- ellipsoidItem.addActionListener(this);
1030
- coneItem = menu.add(new MenuItem("Cone"));
1031
- coneItem.addActionListener(this);
1032
- torusItem = menu.add(new MenuItem("Torus"));
1033
- torusItem.addActionListener(this);
1034
- superItem = menu.add(new MenuItem("Superellipsoid"));
1035
- superItem.addActionListener(this);
1036
- particleItem = menu.add(new MenuItem("Particle system"));
1037
- particleItem.addActionListener(this);
1402
+// gridItem = menu.add(new MenuItem("Grid"));
1403
+// gridItem.addActionListener(this);
1404
+// rectoidItem = menu.add(new MenuItem("Box"));
1405
+// rectoidItem.addActionListener(this);
1406
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1407
+// ellipsoidItem.addActionListener(this);
1408
+// coneItem = menu.add(new MenuItem("Cone"));
1409
+// coneItem.addActionListener(this);
1410
+// torusItem = menu.add(new MenuItem("Torus"));
1411
+// torusItem.addActionListener(this);
1412
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1413
+// superItem.addActionListener(this);
1414
+
1415
+ cameraItem = menu.add(new MenuItem("Camera"));
1416
+ cameraItem.addActionListener(this);
1417
+
1418
+ if (!Globals.ADVANCED)
1419
+ {
1420
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1421
+ kleinItem.addActionListener(this);
1422
+ }
1423
+
1424
+// particleItem = menu.add(new MenuItem("Particle system"));
1425
+// particleItem.addActionListener(this);
1426
+ if (Globals.ADVANCED)
1427
+ {
10381428 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391429 ragdollItem.addActionListener(this);
10401430 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411431 ragdoll2Item.addActionListener(this);
1432
+ }
10421433 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1434
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441435 meshItem.addActionListener(this);
10451436 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461437 // meshGroupItem.addActionListener(this);
1438
+ if (Globals.ADVANCED)
1439
+ {
10471440 springItem = menu.add(new MenuItem("Spring"));
10481441 springItem.addActionListener(this);
10491442 flagItem = menu.add(new MenuItem("Flag"));
10501443 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551444 blobItem = menu.add(new MenuItem("Blob"));
10561445 blobItem.addActionListener(this);
10571446 latheItem = menu.add(new MenuItem("Lathe"));
10581447 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1448
+ }
1449
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1450
+ bezierItem.addActionListener(this);
1451
+// overlayItem = menu.add(new MenuItem("Overlay"));
1452
+// overlayItem.addActionListener(this);
1453
+// lightItem = menu.add(new MenuItem("Light"));
1454
+// lightItem.addActionListener(this);
10611455 menu.add("-");
10621456 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631457 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1458
+// loopItem = menu.add(new MenuItem("Loop"));
1459
+// loopItem.addActionListener(this);
10661460 doubleItem = menu.add(new MenuItem("Fork"));
10671461 doubleItem.addActionListener(this);
1462
+ if (Globals.ADVANCED)
1463
+ {
10681464 tripleItem = menu.add(new MenuItem("Trident"));
10691465 tripleItem.addActionListener(this);
1466
+ }
10701467 }
10711468
10721469 void buildToolsMenu(Menu menu)
10731470 {
10741471 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751472 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1473
+ animationItem.setState(Globals.ANIMATION);
10771474
10781475 menu.add("-");
10791476 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801477 parseverticesItem.addActionListener(this);
10811478 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821479 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1480
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841481 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871482 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881483 reduceMorphItem.addActionListener(this);
10891484 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901485 reduce34MorphItem.addActionListener(this);
1091
-
1486
+ menu.add("-");
10921487 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931488 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951489
1490
+ if (Globals.ADVANCED)
1491
+ {
1492
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1493
+ mirrorItem.addActionListener(this);
1494
+ menu.add("-");
10961495 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971496 memoryItem.addActionListener(this);
10981497 menu.add(analyzeItem = new MenuItem("Analyze"));
10991498 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1499
+ menu.add(dumpItem = new MenuItem("Print"));
11011500 dumpItem.addActionListener(this);
11021501 // menu.add(pathItem = new MenuItem("From-to path"));
11031502 // pathItem.addActionListener(this);
....@@ -1106,6 +1505,8 @@
11061505 resetParentItem.addActionListener(this);
11071506 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081507 repairParentItem.addActionListener(this);
1508
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1509
+ repairShadowItem.addActionListener(this);
11091510 menu.add(invariantsItem = new MenuItem("Invariants"));
11101511 invariantsItem.addActionListener(this);
11111512 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1514,7 @@
11131514 menu.add("-");
11141515 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151516 editScriptItem.addActionListener(this);
1517
+ }
11161518 }
11171519
11181520 void ScreenFit()
....@@ -1235,9 +1637,24 @@
12351637 shadow.material = new cMaterial(obj.material);
12361638 shadow.material.diffuse = 0.0001f;
12371639 shadow.material.specular = 0.0001f;
1640
+ //shadow.projectedVertices[1].x = 300;
12381641
12391642 makeSomething(shadow);
12401643 }
1644
+
1645
+ private void ClearUnpinned()
1646
+ {
1647
+ //for (Object3D obj : listUI)
1648
+ for (int i=listUI.size(); --i>=0;)
1649
+ {
1650
+ Object3D obj = listUI.elementAt(i);
1651
+ if (!obj.pinned)
1652
+ {
1653
+ obj.CloseUI();
1654
+ listUI.remove(i);
1655
+ }
1656
+ }
1657
+ }
12411658
12421659 /**
12431660 * applyExample
....@@ -1441,9 +1858,9 @@
14411858
14421859 void Overwrite(int mask)
14431860 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1861
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451862 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1863
+ Object3D content = Grafreed.clipboard.get(0);
14471864
14481865 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491866 content = ((cGroup)content).get(0);
....@@ -1466,6 +1883,7 @@
14661883 //
14671884 public void actionPerformed(ActionEvent event) // , Object arg)
14681885 {
1886
+ Object source = event.getSource();
14691887 /*
14701888 if (event.getSource() == nameField)
14711889 {
....@@ -1477,11 +1895,11 @@
14771895 }
14781896 else
14791897 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1898
+ if (source == lookAtItem || source == lookFromItem)
14811899 {
14821900 ScreenFit();
14831901 } else
1484
- if (event.getSource() == switchItem)
1902
+ if (source == switchViewItem)
14851903 {
14861904 cVector v1 = new cVector();
14871905 cVector v2 = new cVector();
....@@ -1490,11 +1908,11 @@
14901908 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911909 objEditor.cameraView.repaint();
14921910 } else
1493
- if (event.getSource() == rectoidItem)
1911
+ if (source == rectoidItem || source == boxButton)
14941912 {
14951913 makeSomething(new Box());
14961914 } else
1497
- if (event.getSource() == particleItem)
1915
+ if (source == particleItem || source == particlesButton)
14981916 {
14991917 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001918 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1933,9 @@
15151933 applyExample(particleGeom, "SMOKE");
15161934 makeSomething(particleGeom);
15171935 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1936
+ if (source == ragdollItem || source == ragdoll2Item)
15191937 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1938
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211939
15221940 ragdoll.toParent = LA.newMatrix();
15231941 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1953,7 @@
15351953 } else
15361954 /*
15371955 */
1538
- if (event.getSource() == heightFieldItem)
1956
+ if (source == heightFieldItem)
15391957 {
15401958 Object3D obj = new Object3D();
15411959
....@@ -1573,27 +1991,31 @@
15731991
15741992 makeSomething(obj);
15751993 } else
1576
- if (event.getSource() == gridItem)
1994
+ if (source == gridItem || source == gridButton)
15771995 {
15781996 makeSomething(new Grid());
15791997 } else
1580
- if (event.getSource() == ellipsoidItem)
1998
+ if (source == ellipsoidItem || source == sphereButton)
15811999 {
15822000 makeSomething(new Sphere());
15832001 } else
1584
- if (event.getSource() == coneItem)
2002
+ if (source == coneItem || source == coneButton)
15852003 {
15862004 makeSomething(new Cone());
15872005 } else
1588
- if (event.getSource() == torusItem)
2006
+ if (source == torusItem || source == torusButton)
15892007 {
15902008 makeSomething(new Torus());
15912009 } else
1592
- if (event.getSource() == superItem)
2010
+ if (source == superItem || source == superButton)
15932011 {
15942012 makeSomething(new Superellipsoid());
15952013 } else
1596
- if (event.getSource() == blobItem)
2014
+ if (source == kleinItem || source == kleinButton)
2015
+ {
2016
+ makeSomething(new Klein());
2017
+ } else
2018
+ if (source == blobItem)
15972019 {
15982020 Blob blob = new Blob();
15992021 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2023,15 @@
16012023 //blob.retile();
16022024 makeSomething(blob);
16032025 } else
1604
- if (event.getSource() == latheItem)
2026
+ if (source == latheItem)
16052027 {
16062028 makeSomething(new Lathe());
16072029 } else
1608
- if (event.getSource() == bezierItem)
2030
+ if (source == bezierItem)
16092031 {
16102032 makeSomething(new BezierSurface());
16112033 } else
1612
- if (event.getSource() == checkerItem)
2034
+ if (source == overlayItem || source == overlayButton)
16132035 {
16142036 /*
16152037 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2046,7 @@
16242046 */
16252047 makeSomething(new Checker());
16262048 } else
1627
- if (event.getSource() == meshItem)
2049
+ if (source == meshItem)
16282050 {
16292051 Object3D itemtomake = new Object3D();
16302052 Object3D child;
....@@ -1645,35 +2067,35 @@
16452067 makeSomething(child);
16462068 }
16472069 } else
1648
- if (event.getSource() == springItem)
2070
+ if (source == springItem)
16492071 {
16502072 cSpring s = new cSpring();
16512073 s.setup();
16522074 makeSomething(s);
16532075 } else
1654
- if (event.getSource() == flagItem)
2076
+ if (source == flagItem)
16552077 {
16562078 cSpring s = new cFlag();
16572079 s.setup();
16582080 makeSomething(s);
16592081 } else
1660
- if (event.getSource() == lightItem)
2082
+ if (source == lightItem || source == lightButton)
16612083 {
16622084 makeSomething(new Light());
16632085 } else
1664
- if (event.getSource() == csgItem)
2086
+ if (source == csgItem)
16652087 {
16662088 group(new CSG());
16672089 } else
1668
- if (event.getSource() == templateItem)
2090
+ if (source == templateItem)
16692091 {
16702092 group(new cTemplate());
16712093 } else
1672
- if (event.getSource() == attributeItem)
2094
+ if (source == attributeItem)
16732095 {
16742096 makeSomething(new Attribute());
16752097 } else
1676
- if (event.getSource() == pointflowItem)
2098
+ if (source == pointflowItem)
16772099 {
16782100 makeSomething(new PointFlow());
16792101 } else
....@@ -1685,7 +2107,7 @@
16852107 } else
16862108 */
16872109
1688
- if (event.getSource() == superLoopItem)
2110
+ if (source == superLoopItem)
16892111 {
16902112 Composite g = new cGroup();
16912113 for (int i=0; i<15; i++)
....@@ -1707,30 +2129,30 @@
17072129
17082130 group(g);
17092131 } else
1710
- if (event.getSource() == loopItem)
2132
+ if (source == loopItem || source == loopButton)
17112133 {
17122134 Composite csg = new GroupLeaf();
17132135 csg.count = 5;
17142136 group(csg);
1715
- Composite child = new cGroup();
2137
+ Composite child = new cGroup("Branch");
17162138 csg.addChild(child);
17172139 child.addChild(csg);
17182140 } else
1719
- if (event.getSource() == doubleItem)
2141
+ if (source == doubleItem)
17202142 {
1721
- Composite csg = new GroupLeaf();
2143
+ Composite csg = new GroupLeaf("Fork");
17222144 csg.count = 5;
17232145 group(csg);
1724
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch A");
17252147 csg.addChild(child);
17262148 child.addChild(csg);
1727
- child = new cGroup();
2149
+ child = new cGroup("Branch B");
17282150 csg.addChild(child);
17292151 child.addChild(csg);
17302152 } else
1731
- if (event.getSource() == tripleItem)
2153
+ if (source == tripleItem)
17322154 {
1733
- Composite csg = new GroupLeaf();
2155
+ Composite csg = new GroupLeaf("Trident");
17342156 csg.count = 4;
17352157 group(csg);
17362158 Composite child = new cGroup();
....@@ -1743,71 +2165,83 @@
17432165 csg.addChild(child);
17442166 child.addChild(csg);
17452167 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2168
+ if (source == computeAOItem)
17482169 {
1749
- ImportGFD();
2170
+ Globals.drawMode = CameraPane.OCCLUSION;
2171
+ Globals.theRenderer.repaint();
17502172 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
2173
+ if (source == recompileItem)
17692174 {
17702175 Recompile();
17712176 refreshContents();
17722177 } else
1773
- if (event.getSource() == editScriptItem)
2178
+ if (source == editScriptItem)
17742179 {
17752180 OpenDialog();
17762181 refreshContents();
17772182 } else
1778
- if (event.getSource() == invariantsItem)
2183
+ if (source == invariantsItem)
17792184 {
17802185 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2186
+ Grafreed.grafreeD.universe.invariants();
17822187 } else
1783
- if (event.getSource() == memoryItem)
2188
+ if (source == memoryItem)
17842189 {
17852190 //System.out.println("Invariants:");
17862191 PrintMemory();
17872192 } else
1788
- if (event.getSource() == pathItem)
2193
+ if (source == pathItem)
17892194 {
17902195 PrintPath();
17912196 } else
1792
- if (event.getSource() == analyzeItem)
2197
+ if (source == analyzeItem)
17932198 {
17942199 AnalyzeObject();
17952200 } else
1796
- if (event.getSource() == dumpItem)
2201
+ if (source == dumpItem)
17972202 {
17982203 DumpObject();
17992204 } else
1800
- if (event.getSource() == screenfitButton)
2205
+ if (source == minButton)
2206
+ {
2207
+ Minimize();
2208
+ } else
2209
+ if (source == maxButton)
2210
+ {
2211
+ Maximize();
2212
+ } else
2213
+ if (source == fullButton)
2214
+ {
2215
+ ToggleFullScreen();
2216
+ } else
2217
+ if (source == undoButton)
2218
+ {
2219
+ Undo();
2220
+ } else
2221
+ if (source == redoButton)
2222
+ {
2223
+ Redo();
2224
+ } else
2225
+ if (source == saveButton)
2226
+ {
2227
+ Save();
2228
+ } else
2229
+ if (source == oneStepButton)
2230
+ {
2231
+ Globals.ONESTEP = true;
2232
+ cameraView.repaint();
2233
+ } else
2234
+ if (source == screenfitButton)
18012235 {
18022236 //Reload(lastConverter, lastFilename, true);
18032237 ScreenFit();
18042238 } else
1805
- if (event.getSource() == screenfitpointButton)
2239
+ if (source == screenfitpointButton)
18062240 {
18072241 //Reload(lastConverter, lastFilename, true);
18082242 ScreenFitPoint();
18092243 } else
1810
- if (event.getSource() == snapobjectButton)
2244
+ if (source == snapobjectButton)
18112245 {
18122246 //Reload(lastConverter, lastFilename, true);
18132247 SnapObject();
....@@ -1818,13 +2252,13 @@
18182252 // Recompile();
18192253 // refreshContents();
18202254 // } else
1821
- if (event.getSource() == gcButton)
2255
+ if (source == gcButton)
18222256 {
18232257 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242258 System.gc();
18252259 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262260 } else
1827
- if (event.getSource() == editLeafItem)
2261
+ if (source == editLeafItem)
18282262 {
18292263 Object3D obj;
18302264 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2272,78 @@
18382272 }
18392273 refreshContents(true);
18402274 } else
1841
- if (event.getSource() == openWindowItem)
2275
+ if (source == openWindowItem)
18422276 {
18432277 EditSelection(true);
18442278 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2279
+ if (source == cutItem || source == clearButton)
18462280 {
18472281 loadClipboard(true);
18482282 } else
1849
- if (event.getSource() == duplicateItem)
2283
+ if (source == undoItem)
18502284 {
1851
- Object3D keep = GraphreeD.clipboard;
2285
+ Undo();
2286
+ } else
2287
+ if (source == redoItem)
2288
+ {
2289
+ Redo();
2290
+ } else
2291
+ if (source == duplicateItem)
2292
+ {
2293
+ Object3D keep = Grafreed.clipboard;
18522294 loadClipboard(false);
18532295 paste(false);
1854
- GraphreeD.clipboard = keep;
2296
+ Grafreed.clipboard = keep;
18552297 } else
1856
- if (event.getSource() == cloneItem)
2298
+ if (source == cloneItem)
18572299 {
18582300 CloneSelection(false);
18592301 } else
1860
- if (event.getSource() == cloneSupportItem)
2302
+ if (source == cloneSupportItem)
18612303 {
18622304 CloneSelection(true);
18632305 } else
1864
- if (event.getSource() == copyItem)
2306
+ if (source == copyItem)
18652307 {
18662308 loadClipboard(false);
18672309 } else
1868
- if (event.getSource() == pasteItem)
2310
+ if (source == pasteItem)
18692311 {
18702312 paste(false);
18712313 } else
1872
- if (event.getSource() == pasteLinkItem)
2314
+ if (source == pasteIntoItem)
18732315 {
1874
- pasteInto(false);
2316
+ pasteInto(true, false);
18752317 } else
1876
- if (event.getSource() == pasteCloneItem)
2318
+ if (source == pasteLinkItem)
18772319 {
1878
- pasteInto(true);
2320
+ pasteInto(false, false);
18792321 } else
1880
- if (event.getSource() == pasteExpandItem)
2322
+ if (source == pasteCloneItem)
2323
+ {
2324
+ pasteInto(true, true);
2325
+ } else
2326
+ if (source == pasteExpandItem)
18812327 {
18822328 paste(true);
18832329 } else
1884
- if (event.getSource() == synchronizeItem)
2330
+ if (source == synchronizeItem)
18852331 {
18862332 Overwrite(Object3D.TRANSFORM);
18872333 } else
1888
- if (event.getSource() == overwriteNameItem)
2334
+ if (source == overwriteNameItem)
18892335 {
18902336 Overwrite(Object3D.NAME);
18912337 } else
1892
- if (event.getSource() == overwriteUVItem)
2338
+ if (source == overwriteUVItem)
18932339 {
18942340 Overwrite(Object3D.UV);
18952341 } else
1896
- if (event.getSource() == overwriteMatItem)
2342
+ if (source == overwriteMatItem)
18972343 {
2344
+ /* july 2015
18982345 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2346
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002347 else
19012348 {
19022349 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2355,16 @@
19082355 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092356 }
19102357 }
2358
+ */
2359
+
2360
+ Overwrite(dropAttributes);
19112361 }
1912
- if (event.getSource() == overwriteGeoItem)
2362
+ if (source == overwriteGeoItem)
19132363 {
19142364 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2365
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162366 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2367
+// Object3D content = GrafreeD.clipboard.get(0);
19182368 //
19192369 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202370 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2376,7 @@
19262376 // refreshContents();
19272377 // }
19282378 } else
1929
- if (event.getSource() == generateMeshItem)
2379
+ if (source == generateMeshItem)
19302380 {
19312381 //if (group.selection.size() == 1)
19322382 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2387,7 @@
19372387 ResetModel();
19382388 refreshContents();
19392389 } else
1940
- if (event.getSource() == extractGeometriesItem)
2390
+ if (source == extractGeometriesItem)
19412391 {
19422392 boolean one = false;
19432393
....@@ -1964,7 +2414,7 @@
19642414 ResetModel();
19652415 refreshContents();
19662416 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2417
+ if (source == cloneGeometriesItem)
19682418 {
19692419 boolean one = false;
19702420
....@@ -1990,32 +2440,37 @@
19902440 ResetModel();
19912441 refreshContents();
19922442 } else
1993
- if (event.getSource() == shareGeometriesItem)
2443
+ if (source == shareGeometriesItem)
19942444 {
19952445 boolean one = false;
19962446
19972447 if (group.selection.size() == 1)
19982448 one = true;
19992449
2450
+ Object3D merge = null;
2451
+
20002452 Object3D content = new cGroup();
20012453
20022454 for (int i=0; i<group.selection.size(); i++)
20032455 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2456
+ merge = new Merge(group.selection.get(i));
20052457
20062458 if (one)
2007
- makeSomething(sel, false);
2459
+ makeSomething(merge, false);
20082460 else
2009
- content.addChild(sel);
2461
+ content.addChild(merge);
20102462 }
20112463
20122464 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2465
+ makeSomething(content, true);
2466
+ else
2467
+ {
2468
+ ResetModel();
2469
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2470
+ refreshContents();
2471
+ }
20172472 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2473
+ if (source == mergeGeometriesItem)
20192474 {
20202475 boolean one = false;
20212476
....@@ -2045,11 +2500,11 @@
20452500 ResetModel();
20462501 refreshContents();
20472502 } else
2048
- if (event.getSource() == linkverticesItem)
2503
+ if (source == linkverticesItem)
20492504 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2505
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512506 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2507
+// Object3D content = GrafreeD.clipboard.get(0);
20532508 //
20542509 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552510 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2513,48 @@
20582513 // group.selection.get(0).setMasterThis(content); // should be identity
20592514 // refreshContents();
20602515 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2516
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622517 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2518
+ Object3D content = Grafreed.clipboard.get(0);
20642519
20652520 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662521 content = ((cGroup)content).get(0);
20672522
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2523
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692524 for (int i=0; i<group.selection.size(); i++)
20702525 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2526
+ boolean random = CameraPane.SWITCH;
2527
+ CameraPane.SWITCH = false; // parse all random nodes
20732528 group.selection.get(i).linkVerticesThis(content);
20742529 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2530
+ CameraPane.SWITCH = random;
20762531 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2532
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782533 refreshContents();
20792534 }
20802535 } else
2081
- if (event.getSource() == resetsupportItem)
2536
+ if (source == resetsupportItem)
20822537 {
20832538 for (int i=0; i<group.selection.size(); i++)
20842539 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2540
+ boolean random = CameraPane.SWITCH;
2541
+ CameraPane.SWITCH = false; // parse all random nodes
20872542 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2543
+ CameraPane.SWITCH = random;
20892544 }
20902545
20912546 refreshContents();
20922547 } else
2093
- if (event.getSource() == resetreferencesItem)
2548
+ if (source == relinkverticesItem)
2549
+ {
2550
+ boolean random = CameraPane.SWITCH;
2551
+ CameraPane.SWITCH = false; // parse all random nodes
2552
+ group.selection.RelinkToSupport();
2553
+ CameraPane.SWITCH = random;
2554
+
2555
+ refreshContents();
2556
+ } else
2557
+ if (source == resetreferencesItem)
20942558 {
20952559 for (int i=0; i<group.selection.size(); i++)
20962560 {
....@@ -2099,11 +2563,11 @@
20992563
21002564 refreshContents();
21012565 } else
2102
- if (event.getSource() == setMasterItem)
2566
+ if (source == setMasterItem)
21032567 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2568
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052569 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2570
+ Object3D content = Grafreed.clipboard.get(0);
21072571
21082572 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092573 content = ((cGroup)content).get(0);
....@@ -2112,13 +2576,13 @@
21122576 refreshContents();
21132577 }
21142578 } else
2115
- if (event.getSource() == poseMeshItem)
2579
+ if (source == poseMeshItem)
21162580 {
21172581 if (group.selection.size() == 1)
21182582 {
2119
- if (GraphreeD.clipboard.size() == 1)
2583
+ if (Grafreed.clipboard.size() == 1)
21202584 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2585
+ Object3D content = Grafreed.clipboard.get(0);
21222586
21232587 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242588 content = ((cGroup)content).get(0);
....@@ -2131,19 +2595,19 @@
21312595 }
21322596
21332597 } else
2134
- if (event.getSource() == revertMeshItem)
2598
+ if (source == revertMeshItem)
21352599 {
21362600 RevertMeshes();
21372601 } else
2138
- if (event.getSource() == resetMeshItem)
2602
+ if (source == resetAllItem)
21392603 {
21402604 ResetAll();
21412605 } else
2142
- if (event.getSource() == stepAllItem)
2606
+ if (source == stepAllItem)
21432607 {
21442608 StepAll();
21452609 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2610
+ if (source == clearItem) // || event.getSource() == clearButton)
21472611 {
21482612 //int indices[] = jList.getSelectedIndices();
21492613 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2615,46 @@
21512615
21522616 ClearSelection(false);
21532617 } else
2154
- if (event.getSource() == clearAllItem)
2618
+ if (source == clearAllItem)
21552619 {
21562620 ClearSelection(true);
21572621 } else
2158
- if (event.getSource() == grabItem)
2622
+ if (source == grabItem || source == groupButton)
21592623 {
2160
- group(new cGroup(), true);
2624
+ group(new cGroup(), false); // true);
21612625 } else
2162
- if (event.getSource() == frontItem)
2626
+ if (source == hideItem)
2627
+ {
2628
+ group(new HiddenObject());
2629
+ } else
2630
+ if (source == frontItem)
21632631 {
21642632 front();
21652633 } else
2166
- if (event.getSource() == backItem)
2634
+ if (source == backItem)
21672635 {
21682636 back();
21692637 } else
2170
- if (event.getSource() == cameraItem)
2638
+ if (source == cameraItem)
21712639 {
21722640 makeSomething(new Camera());
21732641 } else
2174
- if (event.getSource() == compositeItem)
2642
+ if (source == compositeItem || source == compositeButton)
21752643 {
21762644 group(new Composite());
21772645 } else
2178
- if (event.getSource() == randomItem)
2646
+ if (source == switchItem || source == switchButton)
21792647 {
21802648 RandomNode random = new RandomNode();
21812649 group(random);
21822650 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2651
+ random.name = random.get(0).name + "Switch";
21842652 } else
2185
- if (event.getSource() == physicsItem)
2653
+ if (source == physicsItem)
21862654 {
21872655 group(new PhysicsNode());
21882656 } else
2189
- if (event.getSource() == frameselectorItem)
2657
+ if (source == frameselectorItem)
21902658 {
21912659 for (int i=0; i<group.selection.size(); i++)
21922660 {
....@@ -2198,7 +2666,7 @@
21982666 ResetModel();
21992667 refreshContents();
22002668 } else
2201
- if (event.getSource() == switchGeoItem)
2669
+ if (source == switchGeoItem)
22022670 {
22032671 for (int i=0; i<group.selection.size(); i++)
22042672 {
....@@ -2210,7 +2678,7 @@
22102678 ResetModel();
22112679 refreshContents();
22122680 } else
2213
- if (event.getSource() == switchTransfoItem)
2681
+ if (source == switchTransfoItem)
22142682 {
22152683 for (int i=0; i<group.selection.size(); i++)
22162684 {
....@@ -2222,7 +2690,7 @@
22222690 ResetModel();
22232691 refreshContents();
22242692 } else
2225
- if (event.getSource() == morphItem)
2693
+ if (source == morphItem)
22262694 {
22272695 for (int i=0; i<group.selection.size(); i++)
22282696 {
....@@ -2234,7 +2702,7 @@
22342702 ResetModel();
22352703 refreshContents();
22362704 } else
2237
- if (event.getSource() == scriptNodeItem)
2705
+ if (source == scriptNodeItem)
22382706 {
22392707 boolean atleastone = false;
22402708
....@@ -2273,195 +2741,252 @@
22732741 }
22742742 }
22752743 } else
2276
- if (event.getSource() == linkerItem)
2744
+ if (source == linkerItem)
22772745 {
22782746 group(new cLinker());
22792747 } else
2280
- if (event.getSource() == textureItem)
2748
+ if (source == textureItem || source == textureButton)
22812749 {
22822750 group(new TextureNode());
22832751 } else
2284
- if (event.getSource() == shadowXItem)
2752
+ if (source == billboardItem)
2753
+ {
2754
+ group(new BillboardNode());
2755
+ } else
2756
+ if (source == shadowXItem)
22852757 {
22862758 CastShadow(0);
22872759 } else
2288
- if (event.getSource() == shadowYItem)
2760
+ if (source == shadowYItem)
22892761 {
22902762 CastShadow(1);
22912763 } else
2292
- if (event.getSource() == shadowZItem)
2764
+ if (source == shadowZItem)
22932765 {
22942766 CastShadow(2);
22952767 } else
2296
- if (event.getSource() == ungroupItem)
2768
+ if (source == ungroupItem || source == ungroupButton)
22972769 {
2298
- ungroup();
2770
+ boolean hasRoot = false;
2771
+
2772
+ for (int i=0; i<group.selection.size(); i++)
2773
+ {
2774
+ if (group.selection.get(i) == group)
2775
+ {
2776
+ hasRoot = true;
2777
+ break;
2778
+ }
2779
+ }
2780
+
2781
+ if (!hasRoot)
2782
+ {
2783
+ for (int i=0; i<group.selection.size(); i++)
2784
+ {
2785
+ Ungroup(group.selection.get(i));
2786
+ }
2787
+
2788
+ ClearSelection(false);
2789
+
2790
+ refreshContents();
2791
+ }
22992792 } else
2300
- if (event.getSource() == genUVItem)
2793
+ if (source == genUVItem)
23012794 {
23022795 GenUV();
23032796 } else
2304
- if (event.getSource() == genNormalsCADItem)
2797
+ if (source == genNormalsCADItem)
23052798 {
23062799 GenNormals(true);
23072800 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2801
+ if (source == genNormalsMESHItem)
2802
+ {
2803
+ GenNormalsMESH();
2804
+ } else
2805
+ if (source == genNormalsORGANItem)
23092806 {
23102807 GenNormals(false);
23112808 } else
2312
- if (event.getSource() == stripifyItem)
2809
+ if (source == genNormalsMINEItem)
2810
+ {
2811
+ GenNormalsMINE();
2812
+ } else
2813
+ if (source == stripifyItem)
23132814 {
23142815 Stripify();
23152816 } else
2316
- if (event.getSource() == unstripifyItem)
2817
+ if (source == unstripifyItem)
23172818 {
23182819 Unstripify();
23192820 } else
2320
- if (event.getSource() == trimItem)
2821
+ if (source == trimItem)
23212822 {
23222823 Trim();
23232824 } else
2324
- if (event.getSource() == untrimItem)
2825
+ if (source == untrimItem)
23252826 {
23262827 Untrim();
23272828 } else
2328
- if (event.getSource() == clearColorsItem)
2829
+ if (source == clearColorsItem)
23292830 {
23302831 ClearColors();
23312832 } else
2332
- if (event.getSource() == clearMaterialsItem)
2833
+ if (source == clearMaterialsItem)
23332834 {
23342835 ClearMaterials();
23352836 } else
2336
- if (event.getSource() == liveleavesItem)
2837
+ if (source == liveleavesItem)
23372838 {
23382839 LiveLeaves(true);
23392840 } else
2340
- if (event.getSource() == unliveleavesItem)
2841
+ if (source == unliveleavesItem)
23412842 {
23422843 LiveLeaves(false);
23432844 } else
2344
- if (event.getSource() == supportleavesItem)
2845
+ if (source == supportleavesItem)
23452846 {
23462847 SupportLeaves(true);
23472848 } else
2348
- if (event.getSource() == unsupportleavesItem)
2849
+ if (source == unsupportleavesItem)
23492850 {
23502851 SupportLeaves(false);
23512852 } else
2352
- if (event.getSource() == hideleavesItem)
2853
+ if (source == hideleavesItem)
23532854 {
23542855 HideLeaves(true);
23552856 } else
2356
- if (event.getSource() == showleavesItem)
2857
+ if (source == showleavesItem)
23572858 {
23582859 HideLeaves(false);
23592860 } else
2360
- if (event.getSource() == markleavesItem)
2861
+ if (source == markleavesItem)
23612862 {
23622863 MarkLeaves(true);
23632864 } else
2364
- if (event.getSource() == unmarkleavesItem)
2865
+ if (source == unmarkleavesItem)
23652866 {
23662867 MarkLeaves(false);
23672868 } else
2368
- if (event.getSource() == flipVItem)
2869
+ if (source == rewindleavesItem)
2870
+ {
2871
+ RewindLeaves(true);
2872
+ } else
2873
+ if (source == unrewindleavesItem)
2874
+ {
2875
+ RewindLeaves(false);
2876
+ } else
2877
+ if (source == randomleavesItem)
2878
+ {
2879
+ RandomLeaves(true);
2880
+ } else
2881
+ if (source == unrandomleavesItem)
2882
+ {
2883
+ RandomLeaves(false);
2884
+ } else
2885
+ if (source == flipVItem)
23692886 {
23702887 FlipV(true);
23712888 } else
2372
- if (event.getSource() == unflipVItem)
2889
+ if (source == unflipVItem)
23732890 {
23742891 FlipV(false);
23752892 } else
2376
- if (event.getSource() == lowTexturesItem)
2893
+ if (source == lowTexturesItem)
23772894 {
23782895 SetTexRes(0);
23792896 } else
2380
- if (event.getSource() == normalTexturesItem)
2897
+ if (source == normalTexturesItem)
23812898 {
23822899 SetTexRes(1);
23832900 } else
2384
- if (event.getSource() == highTexturesItem)
2901
+ if (source == highTexturesItem)
23852902 {
23862903 SetTexRes(2);
23872904 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2905
+ if (source == veryhighTexturesItem)
23892906 {
23902907 SetTexRes(3);
23912908 } else
2392
- if (event.getSource() == maxTexturesItem)
2909
+ if (source == maxTexturesItem)
23932910 {
23942911 SetTexRes(4);
23952912 } else
2396
- if (event.getSource() == panoTexturesItem)
2913
+ if (source == panoTexturesItem)
23972914 {
23982915 SetTexRes(5);
23992916 } else
2400
- if (event.getSource() == reverseNormalsItem)
2917
+ if (source == reverseNormalsItem)
24012918 {
24022919 ReverseNormals();
24032920 } else
2404
- if (event.getSource() == parseverticesItem)
2921
+ if (source == parseverticesItem)
24052922 {
24062923 ParseVertices();
24072924 } else
2408
- if (event.getSource() == textureFieldItem)
2925
+ if (source == textureFieldItem)
24092926 {
24102927 TextureVertices();
24112928 } else
2412
- if (event.getSource() == alignItem)
2929
+ if (source == alignItem)
24132930 {
24142931 Align();
24152932 } else
2416
- if (event.getSource() == mirrorItem)
2933
+ if (source == mirrorItem)
24172934 {
24182935 MirrorPoses();
24192936 } else
2420
- if (event.getSource() == reduceMorphItem)
2937
+ if (source == reduceMorphItem)
24212938 {
24222939 MeshReduction(false);
24232940 } else
2424
- if (event.getSource() == reduce34MorphItem)
2941
+ if (source == reduce34MorphItem)
24252942 {
24262943 MeshReduction(true);
24272944 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2945
+ if (source == reverseTrianglesItem)
24292946 {
24302947 ReverseTriangles();
24312948 } else
2432
- if (event.getSource() == reduceMeshItem)
2949
+ if (source == reduceMeshItem)
24332950 {
24342951 ReduceMesh(false);
24352952 } else
2436
- if (event.getSource() == reduce34MeshItem)
2953
+ if (source == reduce34MeshItem)
24372954 {
24382955 ReduceMesh(true);
24392956 } else
2440
- if (event.getSource() == increaseMeshItem)
2957
+ if (source == increaseMeshItem)
24412958 {
24422959 IncreaseMesh();
24432960 } else
2444
- if (event.getSource() == clipMeshItem)
2961
+ if (source == clipMeshItem)
24452962 {
24462963 ClipMesh();
24472964 } else
2448
- if (event.getSource() == smoothMeshItem)
2965
+ if (source == smoothMeshItem)
24492966 {
24502967 SmoothMesh();
24512968 } else
2452
- if (event.getSource() == transformgeometryItem)
2969
+ if (source == transformGeometryItem)
24532970 {
24542971 TransformGeometry();
24552972 } else
2456
- if (event.getSource() == resetTransformItem)
2973
+ if (source == transformChildrenItem)
2974
+ {
2975
+ TransformChildren();
2976
+ } else
2977
+ if (source == resetTransformItem)
24572978 {
24582979 ResetTransform();
24592980 } else
2460
- if (event.getSource() == resetCentroidItem)
2981
+ if (source == resetCentroidItem)
24612982 {
2462
- ResetCentroid();
2983
+ ResetCentroid(true);
24632984 } else
2464
- if (event.getSource() == resetParentItem)
2985
+ if (source == resetCentroidXZItem)
2986
+ {
2987
+ ResetCentroid(false);
2988
+ } else
2989
+ if (source == resetParentItem)
24652990 {
24662991 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672992 {
....@@ -2471,7 +2996,7 @@
24712996
24722997 refreshContents();
24732998 } else
2474
- if (event.getSource() == repairParentItem)
2999
+ if (source == repairParentItem)
24753000 {
24763001 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773002 {
....@@ -2485,7 +3010,21 @@
24853010
24863011 refreshContents();
24873012 } else
2488
- if (event.getSource() == sortbysizeItem)
3013
+ if (source == repairShadowItem)
3014
+ {
3015
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3016
+ {
3017
+ Object3D obj = (Object3D)e.nextElement();
3018
+ obj.RepairShadow();
3019
+// for (int i=0; i<obj.size(); i++)
3020
+// {
3021
+// obj.get(i).parent = obj;
3022
+// }
3023
+ }
3024
+
3025
+ refreshContents();
3026
+ } else
3027
+ if (source == sortbysizeItem)
24893028 {
24903029 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913030 {
....@@ -2497,7 +3036,7 @@
24973036 ResetModel();
24983037 refreshContents();
24993038 } else
2500
- if (event.getSource() == sortbynameItem)
3039
+ if (source == sortbynameItem)
25013040 {
25023041 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033042 {
....@@ -2509,7 +3048,7 @@
25093048 ResetModel();
25103049 refreshContents();
25113050 } else
2512
- if (event.getSource() == attachPigmentItem)
3051
+ if (source == attachPigmentItem)
25133052 {
25143053 String texture = GetFile("Attach pigment");
25153054 Object3D obj;
....@@ -2521,7 +3060,7 @@
25213060
25223061 refreshContents();
25233062 } else
2524
- if (event.getSource() == detachPigmentItem)
3063
+ if (source == detachPigmentItem)
25253064 {
25263065 Object3D obj;
25273066 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3071,7 @@
25323071
25333072 refreshContents();
25343073 } else
2535
- if (event.getSource() == attachBumpItem)
3074
+ if (source == attachBumpItem)
25363075 {
25373076 String texture = GetFile("Attach bump");
25383077 Object3D obj;
....@@ -2544,7 +3083,7 @@
25443083
25453084 refreshContents();
25463085 } else
2547
- if (event.getSource() == detachBumpItem)
3086
+ if (source == detachBumpItem)
25483087 {
25493088 Object3D obj;
25503089 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +3094,7 @@
25553094
25563095 refreshContents();
25573096 } else
2558
- if (event.getSource() == pigmentBumpItem)
3097
+ if (source == pigmentBumpItem)
25593098 {
25603099 Object3D obj;
25613100 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3105,237 @@
25663105
25673106 refreshContents();
25683107 } else
2569
- if (event.getSource() == flashSelectionButton)
3108
+ if (source == flashSelectionButton)
25703109 {
25713110 CameraPane.flash = true;
25723111 refreshContents();
25733112 } else
2574
- if (event.getSource() == oneButton)
3113
+ if (source == oneButton)
25753114 {
25763115 } else
2577
- if (event.getSource() == twoButton)
3116
+ if (source == twoButton)
25783117 {
25793118 radio.layout = twoButton;
3119
+
3120
+ if (CameraPane.FULLSCREEN)
3121
+ fullscreenLayout = radio.layout;
3122
+
25803123 // bug
25813124 //gridPanel.setDividerLocation(1.0);
25823125 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3126
+// bigThree.remove(scenePanel);
3127
+// bigThree.remove(centralPanel);
3128
+// bigThree.remove(XYZPanel);
3129
+// aWindowConstraints.gridx = 0;
3130
+// aWindowConstraints.gridy = 0;
3131
+// aWindowConstraints.gridwidth = 1;
3132
+// // aConstraints.gridheight = 3;
3133
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3134
+// aWindowConstraints.weightx = 0;
3135
+// aWindowConstraints.weighty = 1;
3136
+// //bigThree.add(jtp, aWindowConstraints);
3137
+// aWindowConstraints.weightx = 1;
3138
+// aWindowConstraints.gridwidth = 3;
3139
+// // aConstraints.gridheight = 3;
3140
+// aWindowConstraints.gridx = 1;
3141
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3142
+// bigThree.add(centralPanel, aWindowConstraints);
3143
+// aWindowConstraints.weightx = 0;
3144
+// aWindowConstraints.gridx = 4;
3145
+// aWindowConstraints.gridwidth = 1;
3146
+// // aConstraints.gridheight = 3;
3147
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3148
+// //bigThree.add(XYZPanel, aWindowConstraints);
3149
+// scenePanel.setVisible(false);
3150
+// centralPanel.setVisible(true);
3151
+// XYZPanel.setVisible(false);
3152
+ bigThree.ClearUI();
3153
+ bigThree.add(centralPanel);
3154
+ bigThree.FlushUI();
3155
+
3156
+ cameraView.requestFocusInWindow();
3157
+
3158
+// refreshContents(true);
3159
+//
3160
+// try
3161
+// {
3162
+// java.awt.Robot bot = new java.awt.Robot();
3163
+// int mask = InputEvent.BUTTON1_MASK;
3164
+// bot.mouseMove(100, 100);
3165
+// bot.mousePress(mask);
3166
+// bot.mouseRelease(mask);
3167
+// }
3168
+// catch (Exception e)
3169
+// {
3170
+//
3171
+// }
3172
+
26073173 } else
2608
- if (event.getSource() == threeButton)
3174
+ if (source == threeButton)
26093175 {
26103176 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
3180
+
3181
+// bigThree.remove(scenePanel);
3182
+// bigThree.remove(centralPanel);
3183
+// bigThree.remove(XYZPanel);
3184
+// aWindowConstraints.gridx = 0;
3185
+// aWindowConstraints.gridy = 0;
3186
+// aWindowConstraints.gridwidth = 1;
3187
+// // aConstraints.gridheight = 3;
3188
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3189
+// aWindowConstraints.weightx = 0;
3190
+// aWindowConstraints.weighty = 1;
3191
+// //bigThree.add(jtp, aWindowConstraints);
3192
+// aWindowConstraints.weightx = 1;
3193
+// aWindowConstraints.gridwidth = 3;
3194
+// // aConstraints.gridheight = 3;
3195
+// aWindowConstraints.gridx = 1;
3196
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3197
+// bigThree.add(centralPanel, aWindowConstraints);
3198
+// aWindowConstraints.weightx = 0;
3199
+// aWindowConstraints.gridx = 4;
3200
+// aWindowConstraints.gridwidth = 1;
3201
+// // aConstraints.gridheight = 3;
3202
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3203
+// bigThree.add(XYZPanel, aWindowConstraints);
3204
+// bigThree.validate();
3205
+// scenePanel.setVisible(false);
3206
+// centralPanel.setVisible(true);
3207
+// XYZPanel.setVisible(true);
3208
+ bigThree.ClearUI();
3209
+ bigThree.add(centralPanel);
3210
+ bigThree.add(XYZPanel);
3211
+ bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
26353214 } else
2636
- if (event.getSource() == fourButton)
3215
+ if (source == fourButton)
26373216 {
26383217 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
3221
+
3222
+// bigThree.remove(scenePanel);
3223
+// bigThree.remove(centralPanel);
3224
+// bigThree.remove(XYZPanel);
3225
+// aWindowConstraints.gridx = 0;
3226
+// aWindowConstraints.gridy = 0;
3227
+// aWindowConstraints.gridwidth = 1;
3228
+// // aWindowConstraints.gridheight = 3;
3229
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3230
+// aWindowConstraints.weightx = 1;
3231
+// aWindowConstraints.weighty = 1;
3232
+// bigThree.add(scenePanel, aWindowConstraints);
3233
+// aWindowConstraints.weightx = 1;
3234
+// aWindowConstraints.gridwidth = 3;
3235
+// // aConstraints.gridheight = 3;
3236
+// aWindowConstraints.gridx = 1;
3237
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3238
+// //bigThree.add(cameraPanel, aWindowConstraints);
3239
+// aWindowConstraints.weightx = 0;
3240
+// aWindowConstraints.gridx = 4;
3241
+// aWindowConstraints.gridwidth = 1;
3242
+// // aWindowConstraints.gridheight = 3;
3243
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3244
+// //bigThree.add(XYZPanel, aWindowConstraints);
3245
+// bigThree.validate();
3246
+// scenePanel.setVisible(true);
3247
+// centralPanel.setVisible(false);
3248
+// XYZPanel.setVisible(false);
3249
+ bigThree.ClearUI();
3250
+ bigThree.add(scenePanel);
3251
+ bigThree.FlushUI();
3252
+
3253
+ cameraView.requestFocusInWindow();
26633254 } else
2664
- if (event.getSource() == sixButton)
3255
+ if (source == sixButton)
26653256 {
26663257 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
3258
+
3259
+ if (CameraPane.FULLSCREEN)
3260
+ fullscreenLayout = radio.layout;
3261
+
3262
+// bigThree.remove(scenePanel);
3263
+// bigThree.remove(centralPanel);
3264
+// bigThree.remove(XYZPanel);
3265
+// aWindowConstraints.gridx = 0;
3266
+// aWindowConstraints.gridy = 0;
3267
+// aWindowConstraints.gridwidth = 1;
3268
+// // aConstraints.gridheight = 3;
3269
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3270
+// aWindowConstraints.weightx = 0;
3271
+// aWindowConstraints.weighty = 1;
3272
+// bigThree.add(scenePanel, aWindowConstraints);
3273
+// aWindowConstraints.weightx = 1;
3274
+// aWindowConstraints.gridwidth = 3;
3275
+// // aWindowConstraints.gridheight = 3;
3276
+// aWindowConstraints.gridx = 1;
3277
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3278
+// bigThree.add(centralPanel, aWindowConstraints);
3279
+// aWindowConstraints.weightx = 0;
3280
+// aWindowConstraints.gridx = 4;
3281
+// aWindowConstraints.gridwidth = 1;
3282
+// // aWindowConstraints.gridheight = 3;
3283
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3284
+// //bigThree.add(XYZPanel, aConstraints);
3285
+// bigThree.validate();
3286
+// scenePanel.setVisible(true);
3287
+// centralPanel.setVisible(true);
3288
+// XYZPanel.setVisible(false);
3289
+ bigThree.ClearUI();
3290
+ bigThree.add(scenePanel);
3291
+ bigThree.add(centralPanel);
3292
+ bigThree.FlushUI();
3293
+
3294
+ cameraView.requestFocusInWindow();
26913295 } else
2692
- if (event.getSource() == sevenButton)
3296
+ if (source == sevenButton)
26933297 {
26943298 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3299
+
3300
+ if (CameraPane.FULLSCREEN)
3301
+ fullscreenLayout = radio.layout;
3302
+
3303
+// bigThree.remove(scenePanel);
3304
+// bigThree.remove(centralPanel);
3305
+// bigThree.remove(XYZPanel);
3306
+// aWindowConstraints.gridx = 0;
3307
+// aWindowConstraints.gridy = 0;
3308
+// aWindowConstraints.gridwidth = 1;
3309
+// // aWindowConstraints.gridheight = 3;
3310
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3311
+// aWindowConstraints.weightx = 0;
3312
+// aWindowConstraints.weighty = 1;
3313
+// bigThree.add(scenePanel, aWindowConstraints);
3314
+// aWindowConstraints.weightx = 1;
3315
+// aWindowConstraints.gridwidth = 3;
3316
+// // aWindowConstraints.gridheight = 3;
3317
+// aWindowConstraints.gridx = 1;
3318
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3319
+// bigThree.add(centralPanel, aWindowConstraints);
3320
+// aWindowConstraints.weightx = 0;
3321
+// aWindowConstraints.gridx = 4;
3322
+// aWindowConstraints.gridwidth = 1;
3323
+// // aConstraints.gridheight = 3;
3324
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3325
+// bigThree.add(XYZPanel, aWindowConstraints);
3326
+// bigThree.validate();
3327
+// scenePanel.setVisible(true);
3328
+// centralPanel.setVisible(true);
3329
+// XYZPanel.setVisible(true);
3330
+ bigThree.ClearUI();
3331
+ bigThree.add(scenePanel);
3332
+ bigThree.add(centralPanel);
3333
+ bigThree.add(XYZPanel);
3334
+ bigThree.FlushUI();
3335
+
3336
+ cameraView.requestFocusInWindow();
27193337 } else
2720
- if (event.getSource() == rootButton)
3338
+ if (source == rootButton)
27213339 {
27223340 Object3D obj;
27233341 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3345,84 @@
27273345 EditObject(obj);
27283346 }
27293347
3348
+ cameraView.requestFocusInWindow();
27303349 refreshContents(true);
27313350 } else
2732
- if (event.getSource() == closeButton)
3351
+ if (source == closeButton)
27333352 {
27343353 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353354 cRadio ab;
27363355 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373356 {
27383357 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3358
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403359 {
3360
+ // Patch to avoid bug with transparency.
3361
+ if (!ab.hadMaterial)
3362
+ {
3363
+ ab.object.material = null;
3364
+ }
3365
+
27413366 buttonGroup.remove(ab);
27423367 radioPanel.remove(ab);
27433368
2744
- ab.GetObject().editWindow = null;
3369
+ //ab.GetObject().editWindow = null;
3370
+ ab.GetObject().manipWindow = null;
27453371 // ab.GetObject().objectUI = null; // ?????????
27463372
27473373 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483374 break;
27493375 }
27503376 }
3377
+
3378
+ cameraView.requestFocusInWindow();
27513379 refreshContents(true);
27523380 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3381
+ if (source == editItem || source == editButton)
27543382 {
3383
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3384
+ {
3385
+ Object3D child = (Object3D)e.nextElement();
3386
+ child.pinned = true;
3387
+ }
3388
+
27553389 EditSelection(false);
27563390 } else
2757
- if (event.getSource() == uneditButton)
3391
+ if (source == uneditButton)
27583392 {
27593393 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603394 {
27613395 Object3D child = (Object3D)e.nextElement();
27623396 if(child.editWindow != null)
27633397 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3398
+ child.pinned = false;
27643399 child.CloseUI();
27653400 listUI.remove(child);
27663401
2767
- child.editWindow = null; // ???????????
3402
+ //child.editWindow = null; // ???????????
27683403 }
2769
- objEditor.ctrlPanel.revalidate();
3404
+ objEditor.ctrlPanel.FlushUI();
27703405 //objEditor.jTree.clearSelection();
27713406 //objEditor.ResetSliders();
27723407 refreshContents(true);
27733408 } else
2774
- if (event.getSource() == clearPanelButton)
3409
+ if (source == clearPanelButton)
27753410 {
27763411 assert(copy == group);
27773412 //copy.ClearUI();
27783413 for (Object3D obj : listUI)
27793414 {
3415
+ obj.pinned = false;
27803416 obj.CloseUI();
27813417 }
27823418 listUI.clear();
27833419 refreshContents(true);
27843420 } else
2785
- if (event.getSource() == allParamsButton)
3421
+ if (source == allParamsButton)
27863422 {
27873423 assert(copy == group);
27883424
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3425
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903426
27913427 for (Object3D obj : listUI)
27923428 {
....@@ -2803,19 +3439,19 @@
28033439
28043440 refreshContents(true);
28053441 } else
2806
- if (event.getSource() == unselectButton)
3442
+ if (source == unselectButton)
28073443 {
28083444 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3445
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103446 objEditor.ResetSliders();
28113447 refreshContents(true);
28123448 } else
2813
- if(event.getSource() instanceof cRadio)
3449
+ if(source instanceof cRadio)
28143450 {
28153451 group.parent = keepparent;
28163452 group.attributes = 0;
28173453 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3454
+ /*cRadio*/ radio = (cRadio)source;
28193455 Object3D obj = radio.GetObject();
28203456 System.out.println("Edit " + obj);
28213457 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3471,7 @@
28353471 }
28363472
28373473 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3474
+ //Globals.theRenderer.object = group;
28393475 if(!useclient)
28403476 {
28413477 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3480,50 @@
28443480 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453481 cameraView.targetLookAt.set(radio.camera.lookAt);
28463482 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3483
+ //cameraView.lighttouched = true;
3484
+ Globals.lighttouched = true;
28483485 topView.object = group;
28493486 frontView.object = group;
28503487 sideView.object = group;
28513488 }
2852
- group.editWindow = this;
3489
+
3490
+// fix "+" issue
3491
+ //group.editWindow = this;
3492
+ group.manipWindow = this;
3493
+
28533494 /*
28543495 currentLayout = radio.layout;
28553496 if (currentLayout == null)
28563497 currentLayout = sevenButton;
28573498 */
28583499 radio.layout.doClick();
3500
+
3501
+ ClearUnpinned();
3502
+ SetPinStates(group.selection.size() > 0);
3503
+ if (group.selection.size() == 1)
3504
+ EditSelection(false);
28593505 keepparent = group.parent;
28603506 // PARENT = NULL or not???
28613507 //group.parent = null; // ROOT
28623508 //group.attributes = -1;
28633509 ResetModel();
3510
+
3511
+ cameraView.requestFocusInWindow();
28643512 refreshContents(true);
2865
- }
3513
+ } else if (event.getSource() == editCameraItem)
3514
+ {
3515
+ cameraView.ProtectCamera();
3516
+ cameraView.repaint();
3517
+ return;
3518
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3519
+ {
3520
+ cameraView.RevertCamera();
3521
+ cameraView.repaint();
3522
+ return;
3523
+ // } else if (event.getSource() == textureButton)
3524
+ // {
3525
+ // return; // true;
3526
+ }
28663527 else
28673528 {
28683529 //return super.action(event, arg);
....@@ -2871,7 +3532,6 @@
28713532 }
28723533
28733534 boolean useclient = false;
2874
- cRadio radio;
28753535
28763536 void ToggleRoot()
28773537 {
....@@ -2880,7 +3540,7 @@
28803540 if (useclient)
28813541 {
28823542 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3543
+ Globals.lighttouched = true;
28843544 //topView.object = client;
28853545 //frontView.object = client;
28863546 //sideView.object = client;
....@@ -2888,7 +3548,7 @@
28883548 else
28893549 {
28903550 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3551
+ Globals.lighttouched = true;
28923552 //topView.object = group;
28933553 //frontView.object = group;
28943554 //sideView.object = group;
....@@ -2923,6 +3583,28 @@
29233583 refreshContents();
29243584 }
29253585
3586
+ void TransformChildren()
3587
+ {
3588
+ Object3D obj;
3589
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3590
+ {
3591
+ obj = (Object3D)e.nextElement();
3592
+ obj.KeepTextureMatrices();
3593
+ obj.TransformChildren();
3594
+ obj.RestoreTextureMatrices();
3595
+
3596
+// if (obj.parent == null)
3597
+// {
3598
+// System.out.println("NULL PARENT!");
3599
+// new Exception().printStackTrace();
3600
+// }
3601
+// else
3602
+// TouchTransform(obj);
3603
+// //obj.parent.Touch();
3604
+ }
3605
+
3606
+ refreshContents();
3607
+ }
29263608
29273609 void ResetTransform()
29283610 {
....@@ -3035,7 +3717,7 @@
30353717 refreshContents();
30363718 }
30373719
3038
- void ResetCentroid()
3720
+ void ResetCentroid(boolean full)
30393721 {
30403722 Object3D obj;
30413723 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3732,16 @@
30503732 LA.matIdentity(Object3D.mat);
30513733 obj.getBounds(minima, maxima, false);
30523734 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3735
+ if (full)
3736
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543737 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553738 obj.TransformMesh(Object3D.mat);
3739
+
30563740 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3741
+ if (full)
3742
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583743 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3744
+
30593745 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603746 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613747 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3770,8 @@
30843770
30853771 int size = obj.MemorySize();
30863772
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3773
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3774
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883775 }
30893776 }
30903777 catch (Exception e)
....@@ -3121,9 +3808,9 @@
31213808 obj = (Object3D)e.nextElement();
31223809
31233810 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3811
+ Grafreed.AnalyzeObject(obj);
31253812 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3813
+ Grafreed.AnalyzeObject(obj.bRep);
31273814
31283815 // System.err.println((size/1024) + " KB is the size of " + obj);
31293816 }
....@@ -3165,6 +3852,20 @@
31653852 void GenNormals(boolean crease)
31663853 {
31673854 group.GenNormalsS(crease);
3855
+
3856
+ refreshContents();
3857
+ }
3858
+
3859
+ void GenNormalsMESH()
3860
+ {
3861
+ group.GenNormalsMeshS();
3862
+
3863
+ refreshContents();
3864
+ }
3865
+
3866
+ void GenNormalsMINE()
3867
+ {
3868
+ group.selection.GenNormalsMINE();
31683869
31693870 refreshContents();
31703871 }
....@@ -3250,7 +3951,7 @@
32503951 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513952 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523953 //
3253
-// g.add(GraphreeD.clipboard);
3954
+// g.add(GrafreeD.clipboard);
32543955 //
32553956 // buffer.add(g);
32563957 // }
....@@ -3269,8 +3970,8 @@
32693970 // nodes = new Object3D();
32703971 // vertices = new Vector<Vertex>();
32713972 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3973
+// boolean epsequal = GrafreeD.epsequal;
3974
+// GrafreeD.epsequal = true;
32743975 //
32753976 // for (int i=0; i<group.selection.size(); i++)
32763977 // {
....@@ -3311,7 +4012,7 @@
33114012 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124013 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134014 //
3314
-// g.add(GraphreeD.clipboard);
4015
+// g.add(GrafreeD.clipboard);
33154016 //
33164017 // buffer.add(g);
33174018 // }
....@@ -3319,7 +4020,7 @@
33194020 // makeSomething(buffer, i==group.selection.size()-1);
33204021 // }
33214022 //
3322
-// GraphreeD.epsequal = epsequal;
4023
+// GrafreeD.epsequal = epsequal;
33234024 //
33244025 // //buffer = null;
33254026 // temprep = null;
....@@ -3330,8 +4031,8 @@
33304031
33314032 void ParseVertices()
33324033 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4034
+ boolean epsequal = Grafreed.epsequal;
4035
+ Grafreed.epsequal = true;
33354036
33364037 for (int i=0; i<group.selection.size(); i++)
33374038 {
....@@ -3356,7 +4057,7 @@
33564057 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574058 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584059
3359
- g.add(GraphreeD.clipboard);
4060
+ g.add(Grafreed.clipboard);
33604061
33614062 buffer.add(g);
33624063 }
....@@ -3371,7 +4072,7 @@
33714072 makeSomething(buffer, i==group.selection.size()-1);
33724073 }
33734074
3374
- GraphreeD.epsequal = epsequal;
4075
+ Grafreed.epsequal = epsequal;
33754076
33764077 refreshContents();
33774078 }
....@@ -3389,7 +4090,16 @@
33894090 String pigment = Object3D.GetPigment(tex);
33904091 //String bump = Object3D.GetBump(tex);
33914092
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4093
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4094
+
4095
+ try
4096
+ {
4097
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4098
+ }
4099
+ catch (Exception e)
4100
+ {
4101
+ System.err.println("FAIL: " + node);
4102
+ }
33934103
33944104 double s = v.s;
33954105
....@@ -3416,7 +4126,7 @@
34164126 scale /= 3;
34174127
34184128 scale /= 0xFF;
3419
- scale /= 4;
4129
+ // c'est quoi ca? scale /= 4;
34204130
34214131 //v.AO = scale;
34224132
....@@ -3437,12 +4147,26 @@
34374147
34384148 void Align()
34394149 {
4150
+ if (group.selection.size() == 0)
4151
+ return;
4152
+
4153
+ cVector bbmin = new cVector();
4154
+ cVector bbmax = new cVector();
4155
+
4156
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4157
+
4158
+ double dx = bbmax.x - bbmin.x;
4159
+ double dy = bbmax.y - bbmin.y;
4160
+ double dz = bbmax.z - bbmin.z;
4161
+
4162
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4163
+
34404164 for (int i=0; i<group.selection.size(); i++)
34414165 {
34424166 Object3D obj = group.selection.get(i);
34434167
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4168
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4169
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464170 }
34474171
34484172 refreshContents();
....@@ -3455,7 +4179,7 @@
34554179 // ref.SaveSupports();
34564180 // Object3D par = ref.parent;
34574181 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4182
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594183 // ref.parent = par;
34604184 // ref.RestoreSupports();
34614185
....@@ -3463,11 +4187,11 @@
34634187
34644188 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654189
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4190
+ boolean random = CameraPane.SWITCH;
4191
+ CameraPane.SWITCH = false; // parse all random nodes
34684192 lowres.linkVerticesThis(null);
34694193 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4194
+ CameraPane.SWITCH = random;
34714195
34724196 System.err.flush();
34734197
....@@ -3485,7 +4209,7 @@
34854209 // lowres.SaveSupports();
34864210 // par = lowres.parent;
34874211 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4212
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894213 Object3D newlow = CloneObject(lowres, false);
34904214 newlow.name = sn.switchobject.get(i).name;
34914215 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4231,7 @@
35074231 return;
35084232
35094233 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4234
+ Object3D ref = Grafreed.clipboard.get(0);
35114235
35124236 Object3D newgroup = new Object3D("Po:" + poses.name);
35134237
....@@ -3676,7 +4400,7 @@
36764400 group.selection.RelinkToSupport(); // july 2014
36774401 System.out.println("DONE.");
36784402 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4403
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804404 }
36814405
36824406 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4425,20 @@
37014425
37024426 void ClipMesh()
37034427 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4428
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054429 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4430
+ Object3D content = Grafreed.clipboard.get(0);
37074431
37084432 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094433 content = ((cGroup)content).get(0);
37104434
37114435 // for (int i=0; i<group.selection.size(); i++)
37124436 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4437
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144438 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4439
+ group.selection.ClipMesh(Grafreed.clipboard);
37164440 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4441
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184442 System.out.println("DONE.");
37194443 refreshContents();
37204444 }
....@@ -3759,6 +4483,18 @@
37594483 void MarkLeaves(boolean hide)
37604484 {
37614485 group.selection.MarkLeaves(hide);
4486
+ refreshContents();
4487
+ }
4488
+
4489
+ void RewindLeaves(boolean hide)
4490
+ {
4491
+ group.selection.RewindLeaves(hide);
4492
+ refreshContents();
4493
+ }
4494
+
4495
+ void RandomLeaves(boolean hide)
4496
+ {
4497
+ group.selection.RandomLeaves(hide);
37624498 refreshContents();
37634499 }
37644500
....@@ -3833,10 +4569,6 @@
38334569 // }
38344570 // }
38354571
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38404572 void EditSelection(boolean newWindow)
38414573 {
38424574 // aConstraints.gridy = 0;
....@@ -3844,10 +4576,10 @@
38444576 {
38454577 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464578 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4579
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484580
38494581 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4582
+ if(elem != group || !newWindow)
38514583 {
38524584 // if (!(elem instanceof Composite))
38534585 // newWindow = false;
....@@ -3929,7 +4661,8 @@
39294661 //new Exception().printStackTrace();
39304662
39314663 freezemodel = true;
3932
-
4664
+ ClearUnpinned();
4665
+
39334666 /**/
39344667 //switch (event.id)
39354668 {
....@@ -3937,7 +4670,6 @@
39374670 //case 702: // Event.LIST_DESELECT
39384671 group.deselectAll();
39394672 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414673 if (tps != null)
39424674 {
39434675 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +4678,39 @@
39464678
39474679 //if (child.parent != null)
39484680 //child.parent.addSelectee(child);
4681
+ objEditor.SetMaterial(child);
39494682 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534683 }
39544684 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4685
+// else
4686
+// {
4687
+// objEditor.SetMaterial(group); // .GetMaterial());
4688
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4689
+// System.err.println("info : " + group.GetPath());
4690
+// }
39614691
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4692
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654693 CameraPane.flash = true;
39664694
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4695
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684696 // a camera
39694697 {
3970
- CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4698
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4699
+ {
4700
+ CameraPane.camerachangeframe = 0; // don't refuse it
4701
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4702
+ }
4703
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4704
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744705 }
39754706
4707
+ if (tps != null && tps.length == 1)
4708
+ {
4709
+ EditSelection(false);
4710
+ }
4711
+
4712
+ SetPinStates(tps != null && tps.length > 0);
4713
+
39764714 refreshContents();
39774715 //return true;
39784716 }
....@@ -3981,6 +4719,35 @@
39814719
39824720 freezemodel = false;
39834721 }
4722
+
4723
+ void SetPinStates(boolean enabled)
4724
+ {
4725
+ editButton.setEnabled(enabled);
4726
+ uneditButton.setEnabled(enabled);
4727
+ unselectButton.setEnabled(enabled);
4728
+ flashSelectionButton.setEnabled(enabled);
4729
+ }
4730
+
4731
+ void refreshContents(boolean cp)
4732
+ {
4733
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4734
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4735
+ {
4736
+ objEditor.ClearInfo(); // .GetMaterial());
4737
+
4738
+ for (int i=0; i < group.selection.Size(); i++)
4739
+ {
4740
+ Object3D child = (Object3D) group.selection.get(i);
4741
+
4742
+ objEditor.AddInfo(child, this, true);
4743
+ System.err.println("info : " + child.GetPath());
4744
+ }
4745
+
4746
+ objEditor.SetText(); // jan 2014
4747
+ }
4748
+
4749
+ super.refreshContents(cp);
4750
+ }
39844751
39854752 void linkSomething(Object3D thing)
39864753 {
....@@ -4052,16 +4819,19 @@
40524819 {
40534820 if (group.selection.isEmpty())
40544821 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4822
+
4823
+ Grafreed.clipboardIsTempGroup = false;
40564824 Composite tGroup = null;
40574825 if (group.selection.size() > 0) // 1)
40584826 {
40594827 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4828
+ Grafreed.clipboardIsTempGroup = true;
40614829 }
40624830
40634831 if (cut)
40644832 {
4833
+ if (Globals.SAVEONMAKE)
4834
+ Save();
40654835 //int indices[] = jList.getSelectedIndices();
40664836 //for (int i = indices.length - 1; i >= 0; i--)
40674837 //jList.remove(indices[i]);
....@@ -4097,16 +4867,16 @@
40974867 //System.out.println("cut " + child);
40984868 //System.out.println("parent = " + child.parent);
40994869 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4870
+ if (Grafreed.clipboardIsTempGroup)
41014871 tGroup.add/*Child*/(tmp);
41024872 else
4103
- GraphreeD.clipboard = tmp;
4873
+ Grafreed.clipboard = tmp;
41044874 }
41054875 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4876
+ if (Grafreed.clipboardIsTempGroup)
41074877 tGroup.add/*Child*/(child);
41084878 else
4109
- GraphreeD.clipboard = child;
4879
+ Grafreed.clipboard = child;
41104880 }
41114881
41124882 //ResetModel();
....@@ -4138,21 +4908,23 @@
41384908 //System.out.println("cut " + elem);
41394909 //System.out.println("parent = " + elem.parent);
41404910 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4911
+ if (Grafreed.clipboardIsTempGroup)
41424912 tGroup.add/*Child*/(tmp);
41434913 else
4144
- GraphreeD.clipboard = tmp;
4914
+ Grafreed.clipboard = tmp;
41454915 }
41464916 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4917
+ if (Grafreed.clipboardIsTempGroup)
41484918 tGroup.add/*Child*/(child);
41494919 else
4150
- GraphreeD.clipboard = child;
4920
+ Grafreed.clipboard = child;
41514921 }
41524922
41534923 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4924
+
4925
+ if (Grafreed.clipboardIsTempGroup)
4926
+ Grafreed.clipboard = tGroup;
4927
+
41564928 if (cut)
41574929 {
41584930 ResetModel();
....@@ -4162,11 +4934,11 @@
41624934
41634935 void paste(boolean expand)
41644936 {
4165
- // if (GraphreeD.clipboard == null)
4937
+ // if (GrafreeD.clipboard == null)
41664938 // return;
41674939 boolean first = true;
41684940
4169
- if (GraphreeD.clipboardIsTempGroup)
4941
+ if (Grafreed.clipboardIsTempGroup)
41704942 {
41714943 Composite temp;
41724944
....@@ -4177,7 +4949,7 @@
41774949 temp = (Composite)Applet3D.clipboard.deepCopy();
41784950 */
41794951 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4952
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814953 {
41824954 Object3D child = (Object3D)e.nextElement();
41834955
....@@ -4191,7 +4963,7 @@
41914963 else
41924964 elem = child.deepCopy(); // ?
41934965 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4966
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954967 // elem = elem.get(0);
41964968 makeSomething(elem, true); // ?? first);
41974969 //group.addChild(elem);
....@@ -4211,23 +4983,23 @@
42114983 //Object3D cb = Applet3D.clipboard;
42124984 //temp.addChild(cb);
42134985 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4986
+ assert(Grafreed.clipboard.parent == null);
4987
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4988
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4989
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4990
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194991 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4992
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4993
+ Grafreed.clipboard.get(0).parent = keepparent;
42224994 }
42234995
42244996 ResetModel();
42254997 refreshContents();
42264998 }
42274999
4228
- void pasteInto(boolean copyit)
5000
+ void pasteInto(boolean copyit, boolean clone)
42295001 {
4230
-// if (GraphreeD.clipboard == null)
5002
+// if (GrafreeD.clipboard == null)
42315003 // return;
42325004
42335005 if (group.selection.size() != 1)
....@@ -4254,15 +5026,22 @@
42545026 if (copyit)
42555027 {
42565028 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5029
+ if (clone)
5030
+ {
5031
+ CloneClipboard(false); // sept 2014
5032
+ }
5033
+ else
5034
+ {
5035
+ paste(false);
5036
+ }
42585037 }
42595038 else
42605039 {
42615040 boolean first = true;
42625041
4263
- if (GraphreeD.clipboardIsTempGroup)
5042
+ if (Grafreed.clipboardIsTempGroup)
42645043 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5044
+ Composite temp = (Composite)Grafreed.clipboard;
42665045 Object3D copy;
42675046 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685047 {
....@@ -4272,7 +5051,7 @@
42725051 }
42735052 } else
42745053 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5054
+ linkSomething(Grafreed.clipboard); //.get(0));
42765055 }
42775056 }
42785057 }
....@@ -4464,6 +5243,26 @@
44645243 makeSomething(csg);
44655244 }
44665245
5246
+ void Ungroup(Object3D g)
5247
+ {
5248
+ if (g instanceof HiddenObject)
5249
+ {
5250
+ HiddenObject h = (HiddenObject) g;
5251
+
5252
+ for (int i=0; i<h.ActualSize(); i++)
5253
+ {
5254
+ objEditor.makeSomething(h.get(i), false);
5255
+ }
5256
+ }
5257
+ else
5258
+ {
5259
+ for (int i=0; i<g.Size(); i++)
5260
+ {
5261
+ objEditor.makeSomething(g.get(i), false);
5262
+ }
5263
+ }
5264
+ }
5265
+
44675266 void ungroup()
44685267 {
44695268 /*
....@@ -4657,21 +5456,6 @@
46575456 }
46585457 */
46595458
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755459 /*
46765460 public void Callback(Object obj)
46775461 {
....@@ -4695,26 +5479,9 @@
46955479 }
46965480 */
46975481
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155482 String GetFile(String dialogName)
47165483 {
4717
- if (GraphreeD.standAlone)
5484
+ if (Grafreed.standAlone)
47185485 {
47195486 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205487 browser.show();
....@@ -4778,10 +5545,33 @@
47785545 cButton flashSelectionButton;
47795546 cButton editButton;
47805547 cButton uneditButton;
5548
+ JCheckBox allParamsButton;
47815549 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835550 cButton unselectButton;
47845551
5552
+ cButton restoreCameraButton;
5553
+
5554
+ cButton saveButton;
5555
+ cButton oneStepButton;
5556
+
5557
+ cButton groupButton;
5558
+ cButton ungroupButton;
5559
+ cButton compositeButton;
5560
+ cButton switchButton;
5561
+ cButton loopButton;
5562
+ cButton textureButton;
5563
+
5564
+ cButton gridButton;
5565
+ cButton boxButton;
5566
+ cButton sphereButton;
5567
+ cButton coneButton;
5568
+ cButton torusButton;
5569
+ cButton superButton;
5570
+ cButton kleinButton;
5571
+ cButton particlesButton;
5572
+ cButton overlayButton;
5573
+ cButton lightButton;
5574
+
47855575 cButton screenfitButton;
47865576 cButton screenfitpointButton;
47875577 cButton snapobjectButton;
....@@ -4793,14 +5583,6 @@
47935583
47945584 cButton setsupportButton;
47955585
4796
- cButton twoButton;
4797
- cButton sixButton;
4798
- cButton threeButton;
4799
- cButton sevenButton;
4800
- cButton fourButton; // full panel
4801
- cButton oneButton; // full XYZ
4802
- //cButton currentLayout;
4803
-
48045586 //
48055587 //Composite
48065588 Object3D // to do !!
....@@ -4810,9 +5592,11 @@
48105592 //JTree jTree;
48115593 private MenuItem lookAtItem;
48125594 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
5595
+ private MenuItem switchViewItem;
48145596 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5597
+ private MenuItem undoItem;
5598
+ private MenuItem redoItem;
5599
+ private JMenuItem duplicateItem;
48165600 private MenuItem cloneItem;
48175601 private MenuItem cloneSupportItem;
48185602 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5607,9 @@
48235607 private MenuItem resetsupportItem;
48245608 private MenuItem resetreferencesItem;
48255609 private MenuItem linkverticesItem;
5610
+ private MenuItem relinkverticesItem;
48265611 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5612
+ private MenuItem resetAllItem;
48285613 private MenuItem stepAllItem;
48295614 private MenuItem revertMeshItem;
48305615 private MenuItem poseMeshItem;
....@@ -4835,14 +5620,17 @@
48355620 private MenuItem mergeGeometriesItem;
48365621 private MenuItem copyItem;
48375622 private MenuItem pasteItem;
5623
+ private MenuItem pasteIntoItem;
48385624 private MenuItem pasteLinkItem;
48395625 private MenuItem pasteCloneItem;
48405626 private MenuItem pasteExpandItem;
48415627 private MenuItem clearItem;
48425628 private MenuItem clearAllItem;
48435629 private MenuItem genUVItem;
5630
+ private MenuItem genNormalsMESHItem;
48445631 private MenuItem genNormalsCADItem;
48455632 private MenuItem genNormalsORGANItem;
5633
+ private MenuItem genNormalsMINEItem;
48465634 private MenuItem stripifyItem;
48475635 private MenuItem unstripifyItem;
48485636 private MenuItem trimItem;
....@@ -4871,6 +5659,10 @@
48715659 private MenuItem showleavesItem;
48725660 private MenuItem markleavesItem;
48735661 private MenuItem unmarkleavesItem;
5662
+ private MenuItem rewindleavesItem;
5663
+ private MenuItem unrewindleavesItem;
5664
+ private MenuItem randomleavesItem;
5665
+ private MenuItem unrandomleavesItem;
48745666
48755667 private MenuItem flipVItem;
48765668 private MenuItem unflipVItem;
....@@ -4882,14 +5674,17 @@
48825674 private MenuItem panoTexturesItem;
48835675
48845676 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5677
+ private MenuItem resetCentroidXZItem;
48865678 private MenuItem resetTransformItem;
5679
+ private MenuItem transformGeometryItem;
5680
+ private MenuItem transformChildrenItem;
5681
+ private MenuItem hideItem;
48875682 private MenuItem grabItem;
48885683 private MenuItem backItem;
48895684 private MenuItem frontItem;
48905685 private MenuItem cameraItem;
48915686 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
5687
+ private MenuItem switchItem;
48935688 private MenuItem physicsItem;
48945689 private MenuItem frameselectorItem;
48955690 private MenuItem scriptNodeItem;
....@@ -4904,6 +5699,7 @@
49045699
49055700 private MenuItem resetParentItem;
49065701 private MenuItem repairParentItem;
5702
+ private MenuItem repairShadowItem;
49075703 private MenuItem sortbysizeItem;
49085704 private MenuItem sortbynameItem;
49095705
....@@ -4924,10 +5720,11 @@
49245720 private MenuItem coneItem;
49255721 private MenuItem torusItem;
49265722 private MenuItem superItem;
5723
+ private MenuItem kleinItem;
49275724 private MenuItem blobItem;
49285725 private MenuItem latheItem;
49295726 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5727
+ private MenuItem overlayItem;
49315728 private MenuItem meshItem;
49325729 // private MenuItem meshGroupItem;
49335730 private MenuItem springItem;
....@@ -4936,6 +5733,7 @@
49365733 private MenuItem csgItem;
49375734 private MenuItem templateItem;
49385735 private MenuItem textureItem;
5736
+ private MenuItem billboardItem;
49395737 private MenuItem shadowXItem;
49405738 private MenuItem shadowYItem;
49415739 private MenuItem shadowZItem;
....@@ -4948,11 +5746,6 @@
49485746 private MenuItem doubleItem;
49495747 private MenuItem tripleItem;
49505748
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565749 private MenuItem computeAOItem;
49575750 private MenuItem recompileItem;
49585751 private MenuItem editScriptItem;
....@@ -4962,4 +5755,8 @@
49625755 private MenuItem analyzeItem;
49635756 private MenuItem dumpItem;
49645757 //boolean freezemodel = false;
5758
+
5759
+ Menu cameraMenu;
5760
+ MenuItem editCameraItem;
5761
+ MenuItem restoreCameraItem;
49655762 }