Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
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,8 +148,131 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ oe.jTree = new cTree();
154
+
155
+ Menu menu;
156
+ oe.menuBar.add(menu = new Menu("Edit"));
157
+ //editItem = menu.add(new MenuItem("Edit"));
158
+ //editItem.addActionListener(this);
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"));
166
+ duplicateItem.addActionListener(this);
167
+ cloneItem = menu.add(new MenuItem("Clone"));
168
+ cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
171
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
172
+ cloneSupportItem.addActionListener(this);
173
+ }
174
+ menu.add("-");
175
+ cutItem = menu.add(new MenuItem("Cut"));
176
+ cutItem.addActionListener(this);
177
+ copyItem = menu.add(new MenuItem("Copy"));
178
+ copyItem.addActionListener(this);
179
+ pasteItem = menu.add(new MenuItem("Paste"));
180
+ pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
185
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
186
+ pasteLinkItem.addActionListener(this);
187
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
188
+ pasteCloneItem.addActionListener(this);
189
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190
+// pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
192
+ clearItem = menu.add(new MenuItem("Clear"));
193
+ clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
198
+ clearAllItem = menu.add(new MenuItem("Clear All"));
199
+ 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(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
+ revertCameraItem.addActionListener(this);
209
+
210
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+ toggleFullScreenItem.addItemListener(this);
212
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+ cameraMenu.add("-");
214
+
215
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+ toggleTextureItem.addItemListener(this);
217
+ toggleTextureItem.setState(CameraPane.textureon);
218
+
219
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+ toggleSwitchItem.addItemListener(this);
221
+ toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
237
+
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
+ {
152276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154278 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +284,17 @@
160284 lookAtItem.addActionListener(this);
161285 //lookFromItem.addActinoListener(this);
162286 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
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,105 @@
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"));
226331 grabItem = menu.add(new MenuItem("Grab"));
227332 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230333 backItem = menu.add(new MenuItem("Back"));
231334 backItem.addActionListener(this);
335
+ frontItem = menu.add(new MenuItem("Front"));
336
+ frontItem.addActionListener(this);
232337 compositeItem = menu.add(new MenuItem("Composite"));
233338 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
+
234348 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
349
+
350
+ randomItem = menu.add(new MenuItem("Switch node"));
236351 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);
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);
249368 cameraItem = menu.add(new MenuItem("Camera"));
250369 cameraItem.addActionListener(this);
370
+ }
251371
252372 oe.menuBar.add(menu = new Menu("Object"));
253373 textureItem = menu.add(new MenuItem("Texture"));
254374 textureItem.addActionListener(this);
375
+ billboardItem = menu.add(new MenuItem("Billboard"));
376
+ billboardItem.addActionListener(this);
255377 csgItem = menu.add(new MenuItem("CSG"));
256378 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
379
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258380 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
381
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260382 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
383
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262384 shadowZItem.addActionListener(this);
385
+ if (Globals.ADVANCED)
386
+ {
387
+ menu.add("-");
263388 linkerItem = menu.add(new MenuItem("Linker"));
264389 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267390 attributeItem = menu.add(new MenuItem("Attribute"));
268391 attributeItem.addActionListener(this);
392
+ templateItem = menu.add(new MenuItem("Template"));
393
+ templateItem.addActionListener(this);
269394 pointflowItem = menu.add(new MenuItem("Point Flow"));
270395 pointflowItem.addActionListener(this);
396
+ }
271397 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274398 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275399 resetTransformItem.addActionListener(this);
276400 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277401 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
402
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
403
+ resetCentroidXZItem.addActionListener(this);
404
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
405
+ transformGeometryItem.addActionListener(this);
406
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
407
+ transformChildrenItem.addActionListener(this);
280408
281409 oe.menuBar.add(menu = new Menu("Geometry"));
282410 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +413,13 @@
285413 genNormalsORGANItem.addActionListener(this);
286414 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287415 genNormalsCADItem.addActionListener(this);
416
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
417
+ genNormalsMESHItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
420
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
421
+ genNormalsMINEItem.addActionListener(this);
422
+ }
288423 stripifyItem = menu.add(new MenuItem("Stripify"));
289424 stripifyItem.addActionListener(this);
290425 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +441,34 @@
306441 reduce34MeshItem.addActionListener(this);
307442 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308443 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311444 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312445 clipMeshItem.addActionListener(this);
446
+
447
+ if (Globals.ADVANCED)
448
+ {
449
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
450
+ smoothMeshItem.addActionListener(this);
451
+ }
313452
314453 oe.menuBar.add(menu = new Menu("Attributes"));
315454 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316455 clearMaterialsItem.addActionListener(this);
456
+ resetAllItem = menu.add(new MenuItem("Reset All"));
457
+ resetAllItem.addActionListener(this);
458
+ stepAllItem = menu.add(new MenuItem("Step All"));
459
+ stepAllItem.addActionListener(this);
317460 menu.add("-");
318461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319462 liveleavesItem.addActionListener(this);
320463 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321464 unliveleavesItem.addActionListener(this);
465
+ if (Globals.ADVANCED)
466
+ {
322467 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323468 supportleavesItem.addActionListener(this);
324469 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325470 unsupportleavesItem.addActionListener(this);
471
+ }
326472 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327473 hideleavesItem.addActionListener(this);
328474 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +477,14 @@
331477 markleavesItem.addActionListener(this);
332478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333479 unmarkleavesItem.addActionListener(this);
480
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
481
+ rewindleavesItem.addActionListener(this);
482
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
483
+ unrewindleavesItem.addActionListener(this);
484
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
485
+ randomleavesItem.addActionListener(this);
486
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
487
+ unrandomleavesItem.addActionListener(this);
334488 menu.add("-");
335489 flipVItem = menu.add(new MenuItem("Flip V"));
336490 flipVItem.addActionListener(this);
....@@ -366,35 +520,40 @@
366520 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367521 sortbynameItem.addActionListener(this);
368522 menu.add("-");
523
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
524
+ shareGeometriesItem.addActionListener(this);
525
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
526
+ mergeGeometriesItem.addActionListener(this);
527
+ if (Globals.ADVANCED)
528
+ {
529
+ // Pretty much the same as duplicate and clone.
369530 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370531 extractGeometriesItem.addActionListener(this);
371532 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372533 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);
534
+ }
377535
378536 oe.menuBar.add(menu = new Menu("Insert"));
379537 buildCreateMenu(menu);
380538
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
-
392539 oe.menuBar.add(menu = new Menu("Tools"));
393540 buildToolsMenu(menu);
394541 }
395542
396543 void SetupUI2(ObjEditor oe)
397544 {
545
+ // June 2019
546
+ if (oe == null)
547
+ {
548
+ //super.SetupUI2(this);
549
+ //return;
550
+ }
551
+
552
+ if (copy != group)
553
+ {
554
+ //super.SetupUI2(this);
555
+ }
556
+
398557 //new Exception().printStackTrace();
399558
400559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +582,171 @@
423582 oe.radioPanel.add(dummyButton);
424583 oe.buttonGroup.add(dummyButton);
425584 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
585
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429586
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
587
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ //minButton.setToolTipText("Minimize window");
589
+ //minButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ maxButton.setToolTipText("Maximize window");
593
+ maxButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ fullButton.setToolTipText("Full-screen window");
597
+ fullButton.addActionListener(this);
598
+
599
+ oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ undoButton.setToolTipText("Undo changes");
601
+ undoButton.addActionListener(this);
602
+
603
+ oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604
+ redoButton.setToolTipText("Redo changes");
605
+ redoButton.addActionListener(this);
606
+
607
+ oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ saveButton.setToolTipText("Save changes");
609
+ saveButton.addActionListener(this);
610
+
611
+ oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612
+ liveCB.setToolTipText("Enable animation");
431613 liveCB.addItemListener(this);
432614
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);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ oneStepButton.setToolTipText("Animate one step forward");
617
+ oneStepButton.addActionListener(this);
618
+
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620
+ fastCB.setToolTipText("Fast mode");
451621 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);
622
+
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
626
+ trackCB.setToolTipText("Enable tracking");
493627 trackCB.addItemListener(this);
494628
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ screenfitButton.setToolTipText("Screen fit");
497631 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
632
+
499633 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500634 // 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;
505635
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);
636
+ if (Globals.ADVANCED)
637
+ {
638
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ snapobjectButton.addActionListener(this);
640
+ snapobjectButton.setToolTipText("Snap Object");
641
+ }
642
+
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ flashSelectionButton.setToolTipText("Highlight selection");
512645 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516646
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
648
+
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ twoButton.setToolTipText("Show center view only");
519651 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
652
+ this.fullscreenLayout = twoButton;
653
+
654
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521655 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
656
+ fourButton.setToolTipText("Show left panel only");
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ sixButton.setToolTipText("2-column layout left");
523659 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ threeButton.setToolTipText("2-column layout right");
525662 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ sevenButton.setToolTipText("3-column layout");
527665 sevenButton.addActionListener(this);
528666 //
529667
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ rootButton.setToolTipText("Edit selection in new tab");
531670 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
671
+
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ closeButton.setToolTipText("Close tab");
534674 closeButton.addActionListener(this);
535675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536676 //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;
545677
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
678
+ // INSERT
679
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
680
+ gridButton.setToolTipText("Create grid");
681
+ gridButton.addActionListener(this);
682
+
683
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ boxButton.setToolTipText("Create box");
685
+ boxButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ sphereButton.setToolTipText("Create sphere");
689
+ sphereButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.Return();
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
717
+ overlayButton.setToolTipText("Create overlay");
718
+ overlayButton.addActionListener(this);
719
+
720
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ lightButton.setToolTipText("Create light");
722
+ lightButton.addActionListener(this);
723
+
724
+ // EDIT panel
725
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
+ editButton.setToolTipText("Edit selection");
727
+ editButton.addActionListener(this);
728
+
729
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ uneditButton.setToolTipText("Unedit selection");
547731 uneditButton.addActionListener(this);
548732
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);
733
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
+ allParamsButton.setToolTipText("Edit all params");
561735 allParamsButton.addActionListener(this);
562736
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);
737
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ clearPanelButton.setToolTipText("Clear edit panel");
739
+ clearPanelButton.addActionListener(this);
740
+
741
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ unselectButton.setToolTipText("Unselect");
568743 unselectButton.addActionListener(this);
569744
745
+ editCommandsPanel.preferredHeight = 1;
746
+
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
749
+
570750 // oe.aConstraints.gridx += 1;
571751 // oe.aConstraints.weighty = 0;
572752 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +758,37 @@
578758 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579759 // gcButton.addActionListener(this);
580760
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;
761
+ cGridBag jSPPanel = new cGridBag();
762
+
763
+ JScrollPane jSP;
592764 //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);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
594766 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
767
+
768
+ oe.treePanel.add(jSPPanel);
769
+ oe.treePanel.Return();
599770
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);
771
+ cGridBag copyOptionsPanel = new cGridBag();
772
+
773
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
774
+ colorCB.setToolTipText("Copy color when dropped");
604775 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
776
+
777
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
778
+ materialCB.setToolTipText("Copy material when dropped");
607779 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
780
+
781
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
782
+ textureCB.setToolTipText("Copy texture when dropped");
610783 textureCB.addItemListener(this);
611784
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
785
+ copyOptionsPanel.preferredHeight = 1;
786
+ oe.treePanel.add(copyOptionsPanel);
787
+ oe.treePanel.Return();
614788
789
+// mainPanel.setDividerLocation(0.5); //1.0);
790
+// mainPanel.setResizeWeight(0.5);
791
+
615792 //jList.addListSelectionListener(this);
616793 oe.jTree.addTreeSelectionListener(this);
617794 //jTree.setRootVisible(false);
....@@ -633,20 +810,115 @@
633810 radio.layout = sevenButton;
634811 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635812 }
813
+
814
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
815
+ {
816
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
817
+ boxCB.setToolTipText("Display bounding boxes");
818
+ boxCB.addItemListener(this);
819
+
820
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
821
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
822
+ zoomBoxCB.addItemListener(this);
823
+
824
+ if (true) // Globals.ADVANCED)
825
+ {
826
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
827
+ supportCB.setToolTipText("Enable rigging");
828
+ supportCB.addItemListener(this);
829
+
830
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
831
+ // localCB.addItemListener(this);
832
+
833
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
834
+ crowdCB.setToolTipText("Used for crowds");
835
+ crowdCB.addItemListener(this);
836
+
837
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
838
+ smoothCB.setToolTipText("Snapping delay");
839
+ smoothCB.addItemListener(this);
840
+
841
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
842
+ slowCB.setToolTipText("Smooth interpolation");
843
+ slowCB.addItemListener(this);
844
+
845
+// constraints.gridy += 1;
846
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
847
+// speakerMocapCB.addItemListener(this);
848
+
849
+ if (false)
850
+ {
851
+ // handled in scripts
852
+ //constraints.gridy += 1;
853
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
854
+ speakerCameraCB.addItemListener(this);
855
+
856
+ //constraints.gridy += 1;
857
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
858
+ speakerFocusCB.addItemListener(this);
859
+
860
+ //constraints.gridy += 1;
861
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
862
+ smoothfocusCB.addItemListener(this);
863
+ }
864
+
865
+//constraints.gridx += 1;
866
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
867
+// debugCB.addItemListener(this);
868
+
869
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
871
+ oeilCB.addItemListener(this);
872
+
873
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
+ shadowCB.setToolTipText("Compute shadows when live");
875
+ shadowCB.addItemListener(this);
876
+
877
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
+ autosaveCB.setToolTipText("Auto-save on structure change");
879
+ autosaveCB.addItemListener(this);
880
+
881
+ if (Globals.ADVANCED)
882
+ {
883
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
884
+ lookAtCB.setToolTipText("Look-at target");
885
+ lookAtCB.addItemListener(this);
886
+ }
887
+
888
+ }
889
+
890
+ cGridBag fill = new cGridBag();
891
+
892
+ fill.preferredHeight = 200;
893
+
894
+ panel.add(fill);
895
+
896
+ }
636897
637898 void EditObject(Object3D obj)
638899 {
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();
900
+ cRadio radioButton = new cRadio(obj.name);
901
+
902
+ // Patch to avoid bug with transparency.
903
+ radioButton.hadMaterial = obj.material != null;
904
+ if (!radioButton.hadMaterial)
905
+ {
906
+ obj.material = new cMaterial();
907
+ }
908
+
909
+ radioButton.SetObject(obj);
910
+ radioButton.layout = sevenButton;
911
+ radioButton.SetCamera(cameraView.renderCamera, false);
912
+ radioButton.addActionListener(this);
913
+ radioPanel.add(radioButton);
914
+ buttonGroup.add(radioButton);
915
+ radioButton.doClick();
647916 }
917
+
648918 void SetupViews(ObjEditor oe)
649919 {
920
+ theFrame = this;
921
+
650922 oe.SetupViews();
651923
652924 System.out.println("SetupViews");
....@@ -655,22 +927,26 @@
655927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
656928 }
657929
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;
930
+ cToggleButton liveCB;
931
+ cCheckBox supportCB;
932
+ cCheckBox localCB;
933
+ cCheckBox crowdCB;
934
+ cCheckBox smoothCB;
935
+ cToggleButton fastCB;
936
+ cCheckBox slowCB;
937
+ cCheckBox boxCB;
938
+ cCheckBox zoomBoxCB;
939
+ cToggleButton trackCB;
940
+ cCheckBox smoothfocusCB;
668941 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
674950
675951 // static int COLOR = 1;
676952 // static int MATERIAL = 2;
....@@ -678,9 +954,9 @@
678954
679955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
680956
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
684960
685961 public void itemStateChanged(ItemEvent e)
686962 {
....@@ -705,10 +981,10 @@
705981 dropAttributes |= Object3D.TEXTURE;
706982 else
707983 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
984
+ } else if(e.getSource() == liveCB)
710985 {
711986 cameraView.ToggleLive();
987
+ refreshContents(false);
712988 }
713989 else if(e.getSource() == supportCB)
714990 {
....@@ -744,6 +1020,10 @@
7441020 cameraView.repaint();
7451021 // refreshContents();
7461022 }
1023
+ else if(e.getSource() == zoomBoxCB)
1024
+ {
1025
+ cameraView.ToggleZoomBoxMode();
1026
+ }
7471027 else if(e.getSource() == smoothfocusCB)
7481028 {
7491029 cameraView.ToggleSmoothFocus();
....@@ -769,6 +1049,14 @@
7691049 {
7701050 cameraView.ToggleOeil();
7711051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
7721060 else if(e.getSource() == lookAtCB)
7731061 {
7741062 cameraView.ToggleLookAt();
....@@ -785,7 +1073,8 @@
7851073
7861074 /**/
7871075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
7891078 if ((path == null) || (path.getPathCount() <= 1)) {
7901079 // We can't move the root node or an empty selection
7911080 return;
....@@ -857,7 +1146,9 @@
8571146 // objEditor.DropFile((java.io.File[]) object, true);
8581147 // return;
8591148 // }
860
- if (string.charAt(0) == '/')
1149
+
1150
+ // File path for Mac and Windows
1151
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611152 {
8621153 // file(s)
8631154 String[] names = string.split("\n");
....@@ -884,7 +1175,7 @@
8841175
8851176 flashIt = false;
8861177 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1178
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881179 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891180
8901181 if (group.selection.size() == 1)
....@@ -907,16 +1198,16 @@
9071198 return;
9081199 }
9091200
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
911
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
9121203 loadClipboard(true);
9131204 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1205
+ pasteInto(false, false);
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
9201211 }
9211212 public void dropActionChanged(DropTargetDragEvent dtde)
9221213 // Called if the user has modified the current drop gesture
....@@ -1033,29 +1324,37 @@
10331324 torusItem.addActionListener(this);
10341325 superItem = menu.add(new MenuItem("Superellipsoid"));
10351326 superItem.addActionListener(this);
1327
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1328
+ kleinItem.addActionListener(this);
10361329 particleItem = menu.add(new MenuItem("Particle system"));
10371330 particleItem.addActionListener(this);
1331
+ if (Globals.ADVANCED)
1332
+ {
10381333 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391334 ragdollItem.addActionListener(this);
10401335 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411336 ragdoll2Item.addActionListener(this);
1337
+ }
10421338 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1339
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441340 meshItem.addActionListener(this);
10451341 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461342 // meshGroupItem.addActionListener(this);
1343
+ if (Globals.ADVANCED)
1344
+ {
10471345 springItem = menu.add(new MenuItem("Spring"));
10481346 springItem.addActionListener(this);
10491347 flagItem = menu.add(new MenuItem("Flag"));
10501348 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);
10551349 blobItem = menu.add(new MenuItem("Blob"));
10561350 blobItem.addActionListener(this);
10571351 latheItem = menu.add(new MenuItem("Lathe"));
10581352 latheItem.addActionListener(this);
1353
+ }
1354
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1355
+ bezierItem.addActionListener(this);
1356
+ overlayItem = menu.add(new MenuItem("Overlay"));
1357
+ overlayItem.addActionListener(this);
10591358 lightItem = menu.add(new MenuItem("Light"));
10601359 lightItem.addActionListener(this);
10611360 menu.add("-");
....@@ -1065,39 +1364,44 @@
10651364 loopItem.addActionListener(this);
10661365 doubleItem = menu.add(new MenuItem("Fork"));
10671366 doubleItem.addActionListener(this);
1367
+ if (Globals.ADVANCED)
1368
+ {
10681369 tripleItem = menu.add(new MenuItem("Trident"));
10691370 tripleItem.addActionListener(this);
1371
+ }
10701372 }
10711373
10721374 void buildToolsMenu(Menu menu)
10731375 {
10741376 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751377 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1378
+ animationItem.setState(Globals.ANIMATION);
10771379
10781380 menu.add("-");
10791381 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801382 parseverticesItem.addActionListener(this);
10811383 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821384 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1385
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841386 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871387 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881388 reduceMorphItem.addActionListener(this);
10891389 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901390 reduce34MorphItem.addActionListener(this);
1091
-
1391
+ menu.add("-");
10921392 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931393 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951394
1395
+ if (Globals.ADVANCED)
1396
+ {
1397
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1398
+ mirrorItem.addActionListener(this);
1399
+ menu.add("-");
10961400 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971401 memoryItem.addActionListener(this);
10981402 menu.add(analyzeItem = new MenuItem("Analyze"));
10991403 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
11011405 dumpItem.addActionListener(this);
11021406 // menu.add(pathItem = new MenuItem("From-to path"));
11031407 // pathItem.addActionListener(this);
....@@ -1106,6 +1410,8 @@
11061410 resetParentItem.addActionListener(this);
11071411 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081412 repairParentItem.addActionListener(this);
1413
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1414
+ repairShadowItem.addActionListener(this);
11091415 menu.add(invariantsItem = new MenuItem("Invariants"));
11101416 invariantsItem.addActionListener(this);
11111417 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1419,7 @@
11131419 menu.add("-");
11141420 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151421 editScriptItem.addActionListener(this);
1422
+ }
11161423 }
11171424
11181425 void ScreenFit()
....@@ -1235,6 +1542,7 @@
12351542 shadow.material = new cMaterial(obj.material);
12361543 shadow.material.diffuse = 0.0001f;
12371544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
12381546
12391547 makeSomething(shadow);
12401548 }
....@@ -1441,9 +1749,9 @@
14411749
14421750 void Overwrite(int mask)
14431751 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1752
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451753 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1754
+ Object3D content = Grafreed.clipboard.get(0);
14471755
14481756 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491757 content = ((cGroup)content).get(0);
....@@ -1466,6 +1774,7 @@
14661774 //
14671775 public void actionPerformed(ActionEvent event) // , Object arg)
14681776 {
1777
+ Object source = event.getSource();
14691778 /*
14701779 if (event.getSource() == nameField)
14711780 {
....@@ -1477,11 +1786,11 @@
14771786 }
14781787 else
14791788 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1789
+ if (source == lookAtItem || source == lookFromItem)
14811790 {
14821791 ScreenFit();
14831792 } else
1484
- if (event.getSource() == switchItem)
1793
+ if (source == switchItem)
14851794 {
14861795 cVector v1 = new cVector();
14871796 cVector v2 = new cVector();
....@@ -1490,11 +1799,11 @@
14901799 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911800 objEditor.cameraView.repaint();
14921801 } else
1493
- if (event.getSource() == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
14941803 {
14951804 makeSomething(new Box());
14961805 } else
1497
- if (event.getSource() == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
14981807 {
14991808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1824,9 @@
15151824 applyExample(particleGeom, "SMOKE");
15161825 makeSomething(particleGeom);
15171826 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1827
+ if (source == ragdollItem || source == ragdoll2Item)
15191828 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1829
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211830
15221831 ragdoll.toParent = LA.newMatrix();
15231832 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1844,7 @@
15351844 } else
15361845 /*
15371846 */
1538
- if (event.getSource() == heightFieldItem)
1847
+ if (source == heightFieldItem)
15391848 {
15401849 Object3D obj = new Object3D();
15411850
....@@ -1573,27 +1882,31 @@
15731882
15741883 makeSomething(obj);
15751884 } else
1576
- if (event.getSource() == gridItem)
1885
+ if (source == gridItem || source == gridButton)
15771886 {
15781887 makeSomething(new Grid());
15791888 } else
1580
- if (event.getSource() == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
15811890 {
15821891 makeSomething(new Sphere());
15831892 } else
1584
- if (event.getSource() == coneItem)
1893
+ if (source == coneItem || source == coneButton)
15851894 {
15861895 makeSomething(new Cone());
15871896 } else
1588
- if (event.getSource() == torusItem)
1897
+ if (source == torusItem || source == torusButton)
15891898 {
15901899 makeSomething(new Torus());
15911900 } else
1592
- if (event.getSource() == superItem)
1901
+ if (source == superItem || source == superButton)
15931902 {
15941903 makeSomething(new Superellipsoid());
15951904 } else
1596
- if (event.getSource() == blobItem)
1905
+ if (source == kleinItem || source == kleinButton)
1906
+ {
1907
+ makeSomething(new Klein());
1908
+ } else
1909
+ if (source == blobItem)
15971910 {
15981911 Blob blob = new Blob();
15991912 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1914,15 @@
16011914 //blob.retile();
16021915 makeSomething(blob);
16031916 } else
1604
- if (event.getSource() == latheItem)
1917
+ if (source == latheItem)
16051918 {
16061919 makeSomething(new Lathe());
16071920 } else
1608
- if (event.getSource() == bezierItem)
1921
+ if (source == bezierItem)
16091922 {
16101923 makeSomething(new BezierSurface());
16111924 } else
1612
- if (event.getSource() == checkerItem)
1925
+ if (source == overlayItem || source == overlayButton)
16131926 {
16141927 /*
16151928 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1937,7 @@
16241937 */
16251938 makeSomething(new Checker());
16261939 } else
1627
- if (event.getSource() == meshItem)
1940
+ if (source == meshItem)
16281941 {
16291942 Object3D itemtomake = new Object3D();
16301943 Object3D child;
....@@ -1645,35 +1958,35 @@
16451958 makeSomething(child);
16461959 }
16471960 } else
1648
- if (event.getSource() == springItem)
1961
+ if (source == springItem)
16491962 {
16501963 cSpring s = new cSpring();
16511964 s.setup();
16521965 makeSomething(s);
16531966 } else
1654
- if (event.getSource() == flagItem)
1967
+ if (source == flagItem)
16551968 {
16561969 cSpring s = new cFlag();
16571970 s.setup();
16581971 makeSomething(s);
16591972 } else
1660
- if (event.getSource() == lightItem)
1973
+ if (source == lightItem || source == lightButton)
16611974 {
16621975 makeSomething(new Light());
16631976 } else
1664
- if (event.getSource() == csgItem)
1977
+ if (source == csgItem)
16651978 {
16661979 group(new CSG());
16671980 } else
1668
- if (event.getSource() == templateItem)
1981
+ if (source == templateItem)
16691982 {
16701983 group(new cTemplate());
16711984 } else
1672
- if (event.getSource() == attributeItem)
1985
+ if (source == attributeItem)
16731986 {
16741987 makeSomething(new Attribute());
16751988 } else
1676
- if (event.getSource() == pointflowItem)
1989
+ if (source == pointflowItem)
16771990 {
16781991 makeSomething(new PointFlow());
16791992 } else
....@@ -1685,7 +1998,7 @@
16851998 } else
16861999 */
16872000
1688
- if (event.getSource() == superLoopItem)
2001
+ if (source == superLoopItem)
16892002 {
16902003 Composite g = new cGroup();
16912004 for (int i=0; i<15; i++)
....@@ -1707,7 +2020,7 @@
17072020
17082021 group(g);
17092022 } else
1710
- if (event.getSource() == loopItem)
2023
+ if (source == loopItem)
17112024 {
17122025 Composite csg = new GroupLeaf();
17132026 csg.count = 5;
....@@ -1716,7 +2029,7 @@
17162029 csg.addChild(child);
17172030 child.addChild(csg);
17182031 } else
1719
- if (event.getSource() == doubleItem)
2032
+ if (source == doubleItem)
17202033 {
17212034 Composite csg = new GroupLeaf();
17222035 csg.count = 5;
....@@ -1728,7 +2041,7 @@
17282041 csg.addChild(child);
17292042 child.addChild(csg);
17302043 } else
1731
- if (event.getSource() == tripleItem)
2044
+ if (source == tripleItem)
17322045 {
17332046 Composite csg = new GroupLeaf();
17342047 csg.count = 4;
....@@ -1743,71 +2056,83 @@
17432056 csg.addChild(child);
17442057 child.addChild(csg);
17452058 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2059
+ if (source == computeAOItem)
17482060 {
1749
- ImportGFD();
2061
+ Globals.drawMode = CameraPane.OCCLUSION;
2062
+ Globals.theRenderer.repaint();
17502063 } 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)
2064
+ if (source == recompileItem)
17692065 {
17702066 Recompile();
17712067 refreshContents();
17722068 } else
1773
- if (event.getSource() == editScriptItem)
2069
+ if (source == editScriptItem)
17742070 {
17752071 OpenDialog();
17762072 refreshContents();
17772073 } else
1778
- if (event.getSource() == invariantsItem)
2074
+ if (source == invariantsItem)
17792075 {
17802076 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2077
+ Grafreed.grafreeD.universe.invariants();
17822078 } else
1783
- if (event.getSource() == memoryItem)
2079
+ if (source == memoryItem)
17842080 {
17852081 //System.out.println("Invariants:");
17862082 PrintMemory();
17872083 } else
1788
- if (event.getSource() == pathItem)
2084
+ if (source == pathItem)
17892085 {
17902086 PrintPath();
17912087 } else
1792
- if (event.getSource() == analyzeItem)
2088
+ if (source == analyzeItem)
17932089 {
17942090 AnalyzeObject();
17952091 } else
1796
- if (event.getSource() == dumpItem)
2092
+ if (source == dumpItem)
17972093 {
17982094 DumpObject();
17992095 } else
1800
- if (event.getSource() == screenfitButton)
2096
+ if (source == minButton)
2097
+ {
2098
+ Minimize();
2099
+ } else
2100
+ if (source == maxButton)
2101
+ {
2102
+ Maximize();
2103
+ } else
2104
+ if (source == fullButton)
2105
+ {
2106
+ ToggleFullScreen();
2107
+ } else
2108
+ if (source == undoButton)
2109
+ {
2110
+ Undo();
2111
+ } else
2112
+ if (source == redoButton)
2113
+ {
2114
+ Redo();
2115
+ } else
2116
+ if (source == saveButton)
2117
+ {
2118
+ Save();
2119
+ } else
2120
+ if (source == oneStepButton)
2121
+ {
2122
+ Globals.ONESTEP = true;
2123
+ cameraView.repaint();
2124
+ } else
2125
+ if (source == screenfitButton)
18012126 {
18022127 //Reload(lastConverter, lastFilename, true);
18032128 ScreenFit();
18042129 } else
1805
- if (event.getSource() == screenfitpointButton)
2130
+ if (source == screenfitpointButton)
18062131 {
18072132 //Reload(lastConverter, lastFilename, true);
18082133 ScreenFitPoint();
18092134 } else
1810
- if (event.getSource() == snapobjectButton)
2135
+ if (source == snapobjectButton)
18112136 {
18122137 //Reload(lastConverter, lastFilename, true);
18132138 SnapObject();
....@@ -1818,13 +2143,13 @@
18182143 // Recompile();
18192144 // refreshContents();
18202145 // } else
1821
- if (event.getSource() == gcButton)
2146
+ if (source == gcButton)
18222147 {
18232148 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242149 System.gc();
18252150 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262151 } else
1827
- if (event.getSource() == editLeafItem)
2152
+ if (source == editLeafItem)
18282153 {
18292154 Object3D obj;
18302155 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2163,78 @@
18382163 }
18392164 refreshContents(true);
18402165 } else
1841
- if (event.getSource() == openWindowItem)
2166
+ if (source == openWindowItem)
18422167 {
18432168 EditSelection(true);
18442169 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2170
+ if (source == cutItem || source == clearButton)
18462171 {
18472172 loadClipboard(true);
18482173 } else
1849
- if (event.getSource() == duplicateItem)
2174
+ if (source == undoItem)
18502175 {
1851
- Object3D keep = GraphreeD.clipboard;
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
2181
+ } else
2182
+ if (source == duplicateItem)
2183
+ {
2184
+ Object3D keep = Grafreed.clipboard;
18522185 loadClipboard(false);
18532186 paste(false);
1854
- GraphreeD.clipboard = keep;
2187
+ Grafreed.clipboard = keep;
18552188 } else
1856
- if (event.getSource() == cloneItem)
2189
+ if (source == cloneItem)
18572190 {
18582191 CloneSelection(false);
18592192 } else
1860
- if (event.getSource() == cloneSupportItem)
2193
+ if (source == cloneSupportItem)
18612194 {
18622195 CloneSelection(true);
18632196 } else
1864
- if (event.getSource() == copyItem)
2197
+ if (source == copyItem)
18652198 {
18662199 loadClipboard(false);
18672200 } else
1868
- if (event.getSource() == pasteItem)
2201
+ if (source == pasteItem)
18692202 {
18702203 paste(false);
18712204 } else
1872
- if (event.getSource() == pasteLinkItem)
2205
+ if (source == pasteIntoItem)
18732206 {
1874
- pasteInto(false);
2207
+ pasteInto(true, false);
18752208 } else
1876
- if (event.getSource() == pasteCloneItem)
2209
+ if (source == pasteLinkItem)
18772210 {
1878
- pasteInto(true);
2211
+ pasteInto(false, false);
18792212 } else
1880
- if (event.getSource() == pasteExpandItem)
2213
+ if (source == pasteCloneItem)
2214
+ {
2215
+ pasteInto(true, true);
2216
+ } else
2217
+ if (source == pasteExpandItem)
18812218 {
18822219 paste(true);
18832220 } else
1884
- if (event.getSource() == synchronizeItem)
2221
+ if (source == synchronizeItem)
18852222 {
18862223 Overwrite(Object3D.TRANSFORM);
18872224 } else
1888
- if (event.getSource() == overwriteNameItem)
2225
+ if (source == overwriteNameItem)
18892226 {
18902227 Overwrite(Object3D.NAME);
18912228 } else
1892
- if (event.getSource() == overwriteUVItem)
2229
+ if (source == overwriteUVItem)
18932230 {
18942231 Overwrite(Object3D.UV);
18952232 } else
1896
- if (event.getSource() == overwriteMatItem)
2233
+ if (source == overwriteMatItem)
18972234 {
2235
+ /* july 2015
18982236 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2237
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002238 else
19012239 {
19022240 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2246,16 @@
19082246 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092247 }
19102248 }
2249
+ */
2250
+
2251
+ Overwrite(dropAttributes);
19112252 }
1912
- if (event.getSource() == overwriteGeoItem)
2253
+ if (source == overwriteGeoItem)
19132254 {
19142255 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2256
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162257 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2258
+// Object3D content = GrafreeD.clipboard.get(0);
19182259 //
19192260 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202261 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2267,7 @@
19262267 // refreshContents();
19272268 // }
19282269 } else
1929
- if (event.getSource() == generateMeshItem)
2270
+ if (source == generateMeshItem)
19302271 {
19312272 //if (group.selection.size() == 1)
19322273 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2278,7 @@
19372278 ResetModel();
19382279 refreshContents();
19392280 } else
1940
- if (event.getSource() == extractGeometriesItem)
2281
+ if (source == extractGeometriesItem)
19412282 {
19422283 boolean one = false;
19432284
....@@ -1964,7 +2305,7 @@
19642305 ResetModel();
19652306 refreshContents();
19662307 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2308
+ if (source == cloneGeometriesItem)
19682309 {
19692310 boolean one = false;
19702311
....@@ -1990,32 +2331,37 @@
19902331 ResetModel();
19912332 refreshContents();
19922333 } else
1993
- if (event.getSource() == shareGeometriesItem)
2334
+ if (source == shareGeometriesItem)
19942335 {
19952336 boolean one = false;
19962337
19972338 if (group.selection.size() == 1)
19982339 one = true;
19992340
2341
+ Object3D merge = null;
2342
+
20002343 Object3D content = new cGroup();
20012344
20022345 for (int i=0; i<group.selection.size(); i++)
20032346 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2347
+ merge = new Merge(group.selection.get(i));
20052348
20062349 if (one)
2007
- makeSomething(sel, false);
2350
+ makeSomething(merge, false);
20082351 else
2009
- content.addChild(sel);
2352
+ content.addChild(merge);
20102353 }
20112354
20122355 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2356
+ makeSomething(content, true);
2357
+ else
2358
+ {
2359
+ ResetModel();
2360
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2361
+ refreshContents();
2362
+ }
20172363 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2364
+ if (source == mergeGeometriesItem)
20192365 {
20202366 boolean one = false;
20212367
....@@ -2045,11 +2391,11 @@
20452391 ResetModel();
20462392 refreshContents();
20472393 } else
2048
- if (event.getSource() == linkverticesItem)
2394
+ if (source == linkverticesItem)
20492395 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2396
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512397 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2398
+// Object3D content = GrafreeD.clipboard.get(0);
20532399 //
20542400 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552401 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2404,48 @@
20582404 // group.selection.get(0).setMasterThis(content); // should be identity
20592405 // refreshContents();
20602406 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2407
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622408 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2409
+ Object3D content = Grafreed.clipboard.get(0);
20642410
20652411 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662412 content = ((cGroup)content).get(0);
20672413
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2414
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692415 for (int i=0; i<group.selection.size(); i++)
20702416 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2417
+ boolean random = CameraPane.SWITCH;
2418
+ CameraPane.SWITCH = false; // parse all random nodes
20732419 group.selection.get(i).linkVerticesThis(content);
20742420 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2421
+ CameraPane.SWITCH = random;
20762422 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2423
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782424 refreshContents();
20792425 }
20802426 } else
2081
- if (event.getSource() == resetsupportItem)
2427
+ if (source == resetsupportItem)
20822428 {
20832429 for (int i=0; i<group.selection.size(); i++)
20842430 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2431
+ boolean random = CameraPane.SWITCH;
2432
+ CameraPane.SWITCH = false; // parse all random nodes
20872433 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2434
+ CameraPane.SWITCH = random;
20892435 }
20902436
20912437 refreshContents();
20922438 } else
2093
- if (event.getSource() == resetreferencesItem)
2439
+ if (source == relinkverticesItem)
2440
+ {
2441
+ boolean random = CameraPane.SWITCH;
2442
+ CameraPane.SWITCH = false; // parse all random nodes
2443
+ group.selection.RelinkToSupport();
2444
+ CameraPane.SWITCH = random;
2445
+
2446
+ refreshContents();
2447
+ } else
2448
+ if (source == resetreferencesItem)
20942449 {
20952450 for (int i=0; i<group.selection.size(); i++)
20962451 {
....@@ -2099,11 +2454,11 @@
20992454
21002455 refreshContents();
21012456 } else
2102
- if (event.getSource() == setMasterItem)
2457
+ if (source == setMasterItem)
21032458 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2459
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052460 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2461
+ Object3D content = Grafreed.clipboard.get(0);
21072462
21082463 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092464 content = ((cGroup)content).get(0);
....@@ -2112,13 +2467,13 @@
21122467 refreshContents();
21132468 }
21142469 } else
2115
- if (event.getSource() == poseMeshItem)
2470
+ if (source == poseMeshItem)
21162471 {
21172472 if (group.selection.size() == 1)
21182473 {
2119
- if (GraphreeD.clipboard.size() == 1)
2474
+ if (Grafreed.clipboard.size() == 1)
21202475 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2476
+ Object3D content = Grafreed.clipboard.get(0);
21222477
21232478 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242479 content = ((cGroup)content).get(0);
....@@ -2131,19 +2486,19 @@
21312486 }
21322487
21332488 } else
2134
- if (event.getSource() == revertMeshItem)
2489
+ if (source == revertMeshItem)
21352490 {
21362491 RevertMeshes();
21372492 } else
2138
- if (event.getSource() == resetMeshItem)
2493
+ if (source == resetAllItem)
21392494 {
21402495 ResetAll();
21412496 } else
2142
- if (event.getSource() == stepAllItem)
2497
+ if (source == stepAllItem)
21432498 {
21442499 StepAll();
21452500 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2501
+ if (source == clearItem) // || event.getSource() == clearButton)
21472502 {
21482503 //int indices[] = jList.getSelectedIndices();
21492504 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2506,46 @@
21512506
21522507 ClearSelection(false);
21532508 } else
2154
- if (event.getSource() == clearAllItem)
2509
+ if (source == clearAllItem)
21552510 {
21562511 ClearSelection(true);
21572512 } else
2158
- if (event.getSource() == grabItem)
2513
+ if (source == grabItem)
21592514 {
21602515 group(new cGroup(), true);
21612516 } else
2162
- if (event.getSource() == frontItem)
2517
+ if (source == hideItem)
2518
+ {
2519
+ group(new HiddenObject());
2520
+ } else
2521
+ if (source == frontItem)
21632522 {
21642523 front();
21652524 } else
2166
- if (event.getSource() == backItem)
2525
+ if (source == backItem)
21672526 {
21682527 back();
21692528 } else
2170
- if (event.getSource() == cameraItem)
2529
+ if (source == cameraItem)
21712530 {
21722531 makeSomething(new Camera());
21732532 } else
2174
- if (event.getSource() == compositeItem)
2533
+ if (source == compositeItem)
21752534 {
21762535 group(new Composite());
21772536 } else
2178
- if (event.getSource() == randomItem)
2537
+ if (source == randomItem)
21792538 {
21802539 RandomNode random = new RandomNode();
21812540 group(random);
21822541 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2542
+ random.name = random.get(0).name + "Switch";
21842543 } else
2185
- if (event.getSource() == physicsItem)
2544
+ if (source == physicsItem)
21862545 {
21872546 group(new PhysicsNode());
21882547 } else
2189
- if (event.getSource() == frameselectorItem)
2548
+ if (source == frameselectorItem)
21902549 {
21912550 for (int i=0; i<group.selection.size(); i++)
21922551 {
....@@ -2198,7 +2557,7 @@
21982557 ResetModel();
21992558 refreshContents();
22002559 } else
2201
- if (event.getSource() == switchGeoItem)
2560
+ if (source == switchGeoItem)
22022561 {
22032562 for (int i=0; i<group.selection.size(); i++)
22042563 {
....@@ -2210,7 +2569,7 @@
22102569 ResetModel();
22112570 refreshContents();
22122571 } else
2213
- if (event.getSource() == switchTransfoItem)
2572
+ if (source == switchTransfoItem)
22142573 {
22152574 for (int i=0; i<group.selection.size(); i++)
22162575 {
....@@ -2222,7 +2581,7 @@
22222581 ResetModel();
22232582 refreshContents();
22242583 } else
2225
- if (event.getSource() == morphItem)
2584
+ if (source == morphItem)
22262585 {
22272586 for (int i=0; i<group.selection.size(); i++)
22282587 {
....@@ -2234,7 +2593,7 @@
22342593 ResetModel();
22352594 refreshContents();
22362595 } else
2237
- if (event.getSource() == scriptNodeItem)
2596
+ if (source == scriptNodeItem)
22382597 {
22392598 boolean atleastone = false;
22402599
....@@ -2273,195 +2632,239 @@
22732632 }
22742633 }
22752634 } else
2276
- if (event.getSource() == linkerItem)
2635
+ if (source == linkerItem)
22772636 {
22782637 group(new cLinker());
22792638 } else
2280
- if (event.getSource() == textureItem)
2639
+ if (source == textureItem)
22812640 {
22822641 group(new TextureNode());
22832642 } else
2284
- if (event.getSource() == shadowXItem)
2643
+ if (source == billboardItem)
2644
+ {
2645
+ group(new BillboardNode());
2646
+ } else
2647
+ if (source == shadowXItem)
22852648 {
22862649 CastShadow(0);
22872650 } else
2288
- if (event.getSource() == shadowYItem)
2651
+ if (source == shadowYItem)
22892652 {
22902653 CastShadow(1);
22912654 } else
2292
- if (event.getSource() == shadowZItem)
2655
+ if (source == shadowZItem)
22932656 {
22942657 CastShadow(2);
22952658 } else
2296
- if (event.getSource() == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
22972660 {
2298
- ungroup();
2661
+ //ungroup();
2662
+ for (int i=0; i<group.selection.size(); i++)
2663
+ {
2664
+ Ungroup(group.selection.get(i));
2665
+ }
2666
+
2667
+ ClearSelection(false);
2668
+
2669
+ refreshContents();
22992670 } else
2300
- if (event.getSource() == genUVItem)
2671
+ if (source == genUVItem)
23012672 {
23022673 GenUV();
23032674 } else
2304
- if (event.getSource() == genNormalsCADItem)
2675
+ if (source == genNormalsCADItem)
23052676 {
23062677 GenNormals(true);
23072678 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2679
+ if (source == genNormalsMESHItem)
2680
+ {
2681
+ GenNormalsMESH();
2682
+ } else
2683
+ if (source == genNormalsORGANItem)
23092684 {
23102685 GenNormals(false);
23112686 } else
2312
- if (event.getSource() == stripifyItem)
2687
+ if (source == genNormalsMINEItem)
2688
+ {
2689
+ GenNormalsMINE();
2690
+ } else
2691
+ if (source == stripifyItem)
23132692 {
23142693 Stripify();
23152694 } else
2316
- if (event.getSource() == unstripifyItem)
2695
+ if (source == unstripifyItem)
23172696 {
23182697 Unstripify();
23192698 } else
2320
- if (event.getSource() == trimItem)
2699
+ if (source == trimItem)
23212700 {
23222701 Trim();
23232702 } else
2324
- if (event.getSource() == untrimItem)
2703
+ if (source == untrimItem)
23252704 {
23262705 Untrim();
23272706 } else
2328
- if (event.getSource() == clearColorsItem)
2707
+ if (source == clearColorsItem)
23292708 {
23302709 ClearColors();
23312710 } else
2332
- if (event.getSource() == clearMaterialsItem)
2711
+ if (source == clearMaterialsItem)
23332712 {
23342713 ClearMaterials();
23352714 } else
2336
- if (event.getSource() == liveleavesItem)
2715
+ if (source == liveleavesItem)
23372716 {
23382717 LiveLeaves(true);
23392718 } else
2340
- if (event.getSource() == unliveleavesItem)
2719
+ if (source == unliveleavesItem)
23412720 {
23422721 LiveLeaves(false);
23432722 } else
2344
- if (event.getSource() == supportleavesItem)
2723
+ if (source == supportleavesItem)
23452724 {
23462725 SupportLeaves(true);
23472726 } else
2348
- if (event.getSource() == unsupportleavesItem)
2727
+ if (source == unsupportleavesItem)
23492728 {
23502729 SupportLeaves(false);
23512730 } else
2352
- if (event.getSource() == hideleavesItem)
2731
+ if (source == hideleavesItem)
23532732 {
23542733 HideLeaves(true);
23552734 } else
2356
- if (event.getSource() == showleavesItem)
2735
+ if (source == showleavesItem)
23572736 {
23582737 HideLeaves(false);
23592738 } else
2360
- if (event.getSource() == markleavesItem)
2739
+ if (source == markleavesItem)
23612740 {
23622741 MarkLeaves(true);
23632742 } else
2364
- if (event.getSource() == unmarkleavesItem)
2743
+ if (source == unmarkleavesItem)
23652744 {
23662745 MarkLeaves(false);
23672746 } else
2368
- if (event.getSource() == flipVItem)
2747
+ if (source == rewindleavesItem)
2748
+ {
2749
+ RewindLeaves(true);
2750
+ } else
2751
+ if (source == unrewindleavesItem)
2752
+ {
2753
+ RewindLeaves(false);
2754
+ } else
2755
+ if (source == randomleavesItem)
2756
+ {
2757
+ RandomLeaves(true);
2758
+ } else
2759
+ if (source == unrandomleavesItem)
2760
+ {
2761
+ RandomLeaves(false);
2762
+ } else
2763
+ if (source == flipVItem)
23692764 {
23702765 FlipV(true);
23712766 } else
2372
- if (event.getSource() == unflipVItem)
2767
+ if (source == unflipVItem)
23732768 {
23742769 FlipV(false);
23752770 } else
2376
- if (event.getSource() == lowTexturesItem)
2771
+ if (source == lowTexturesItem)
23772772 {
23782773 SetTexRes(0);
23792774 } else
2380
- if (event.getSource() == normalTexturesItem)
2775
+ if (source == normalTexturesItem)
23812776 {
23822777 SetTexRes(1);
23832778 } else
2384
- if (event.getSource() == highTexturesItem)
2779
+ if (source == highTexturesItem)
23852780 {
23862781 SetTexRes(2);
23872782 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2783
+ if (source == veryhighTexturesItem)
23892784 {
23902785 SetTexRes(3);
23912786 } else
2392
- if (event.getSource() == maxTexturesItem)
2787
+ if (source == maxTexturesItem)
23932788 {
23942789 SetTexRes(4);
23952790 } else
2396
- if (event.getSource() == panoTexturesItem)
2791
+ if (source == panoTexturesItem)
23972792 {
23982793 SetTexRes(5);
23992794 } else
2400
- if (event.getSource() == reverseNormalsItem)
2795
+ if (source == reverseNormalsItem)
24012796 {
24022797 ReverseNormals();
24032798 } else
2404
- if (event.getSource() == parseverticesItem)
2799
+ if (source == parseverticesItem)
24052800 {
24062801 ParseVertices();
24072802 } else
2408
- if (event.getSource() == textureFieldItem)
2803
+ if (source == textureFieldItem)
24092804 {
24102805 TextureVertices();
24112806 } else
2412
- if (event.getSource() == alignItem)
2807
+ if (source == alignItem)
24132808 {
24142809 Align();
24152810 } else
2416
- if (event.getSource() == mirrorItem)
2811
+ if (source == mirrorItem)
24172812 {
24182813 MirrorPoses();
24192814 } else
2420
- if (event.getSource() == reduceMorphItem)
2815
+ if (source == reduceMorphItem)
24212816 {
24222817 MeshReduction(false);
24232818 } else
2424
- if (event.getSource() == reduce34MorphItem)
2819
+ if (source == reduce34MorphItem)
24252820 {
24262821 MeshReduction(true);
24272822 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2823
+ if (source == reverseTrianglesItem)
24292824 {
24302825 ReverseTriangles();
24312826 } else
2432
- if (event.getSource() == reduceMeshItem)
2827
+ if (source == reduceMeshItem)
24332828 {
24342829 ReduceMesh(false);
24352830 } else
2436
- if (event.getSource() == reduce34MeshItem)
2831
+ if (source == reduce34MeshItem)
24372832 {
24382833 ReduceMesh(true);
24392834 } else
2440
- if (event.getSource() == increaseMeshItem)
2835
+ if (source == increaseMeshItem)
24412836 {
24422837 IncreaseMesh();
24432838 } else
2444
- if (event.getSource() == clipMeshItem)
2839
+ if (source == clipMeshItem)
24452840 {
24462841 ClipMesh();
24472842 } else
2448
- if (event.getSource() == smoothMeshItem)
2843
+ if (source == smoothMeshItem)
24492844 {
24502845 SmoothMesh();
24512846 } else
2452
- if (event.getSource() == transformgeometryItem)
2847
+ if (source == transformGeometryItem)
24532848 {
24542849 TransformGeometry();
24552850 } else
2456
- if (event.getSource() == resetTransformItem)
2851
+ if (source == transformChildrenItem)
2852
+ {
2853
+ TransformChildren();
2854
+ } else
2855
+ if (source == resetTransformItem)
24572856 {
24582857 ResetTransform();
24592858 } else
2460
- if (event.getSource() == resetCentroidItem)
2859
+ if (source == resetCentroidItem)
24612860 {
2462
- ResetCentroid();
2861
+ ResetCentroid(true);
24632862 } else
2464
- if (event.getSource() == resetParentItem)
2863
+ if (source == resetCentroidXZItem)
2864
+ {
2865
+ ResetCentroid(false);
2866
+ } else
2867
+ if (source == resetParentItem)
24652868 {
24662869 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672870 {
....@@ -2471,7 +2874,7 @@
24712874
24722875 refreshContents();
24732876 } else
2474
- if (event.getSource() == repairParentItem)
2877
+ if (source == repairParentItem)
24752878 {
24762879 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772880 {
....@@ -2485,7 +2888,21 @@
24852888
24862889 refreshContents();
24872890 } else
2488
- if (event.getSource() == sortbysizeItem)
2891
+ if (source == repairShadowItem)
2892
+ {
2893
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2894
+ {
2895
+ Object3D obj = (Object3D)e.nextElement();
2896
+ obj.RepairShadow();
2897
+// for (int i=0; i<obj.size(); i++)
2898
+// {
2899
+// obj.get(i).parent = obj;
2900
+// }
2901
+ }
2902
+
2903
+ refreshContents();
2904
+ } else
2905
+ if (source == sortbysizeItem)
24892906 {
24902907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912908 {
....@@ -2497,7 +2914,7 @@
24972914 ResetModel();
24982915 refreshContents();
24992916 } else
2500
- if (event.getSource() == sortbynameItem)
2917
+ if (source == sortbynameItem)
25012918 {
25022919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032920 {
....@@ -2509,7 +2926,7 @@
25092926 ResetModel();
25102927 refreshContents();
25112928 } else
2512
- if (event.getSource() == attachPigmentItem)
2929
+ if (source == attachPigmentItem)
25132930 {
25142931 String texture = GetFile("Attach pigment");
25152932 Object3D obj;
....@@ -2521,7 +2938,7 @@
25212938
25222939 refreshContents();
25232940 } else
2524
- if (event.getSource() == detachPigmentItem)
2941
+ if (source == detachPigmentItem)
25252942 {
25262943 Object3D obj;
25272944 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2949,7 @@
25322949
25332950 refreshContents();
25342951 } else
2535
- if (event.getSource() == attachBumpItem)
2952
+ if (source == attachBumpItem)
25362953 {
25372954 String texture = GetFile("Attach bump");
25382955 Object3D obj;
....@@ -2544,7 +2961,7 @@
25442961
25452962 refreshContents();
25462963 } else
2547
- if (event.getSource() == detachBumpItem)
2964
+ if (source == detachBumpItem)
25482965 {
25492966 Object3D obj;
25502967 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2972,7 @@
25552972
25562973 refreshContents();
25572974 } else
2558
- if (event.getSource() == pigmentBumpItem)
2975
+ if (source == pigmentBumpItem)
25592976 {
25602977 Object3D obj;
25612978 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2983,237 @@
25662983
25672984 refreshContents();
25682985 } else
2569
- if (event.getSource() == flashSelectionButton)
2986
+ if (source == flashSelectionButton)
25702987 {
25712988 CameraPane.flash = true;
25722989 refreshContents();
25732990 } else
2574
- if (event.getSource() == oneButton)
2991
+ if (source == oneButton)
25752992 {
25762993 } else
2577
- if (event.getSource() == twoButton)
2994
+ if (source == twoButton)
25782995 {
25792996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
25803001 // bug
25813002 //gridPanel.setDividerLocation(1.0);
25823003 //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();
3004
+// bigThree.remove(scenePanel);
3005
+// bigThree.remove(centralPanel);
3006
+// bigThree.remove(XYZPanel);
3007
+// aWindowConstraints.gridx = 0;
3008
+// aWindowConstraints.gridy = 0;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// aWindowConstraints.weightx = 0;
3013
+// aWindowConstraints.weighty = 1;
3014
+// //bigThree.add(jtp, aWindowConstraints);
3015
+// aWindowConstraints.weightx = 1;
3016
+// aWindowConstraints.gridwidth = 3;
3017
+// // aConstraints.gridheight = 3;
3018
+// aWindowConstraints.gridx = 1;
3019
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3020
+// bigThree.add(centralPanel, aWindowConstraints);
3021
+// aWindowConstraints.weightx = 0;
3022
+// aWindowConstraints.gridx = 4;
3023
+// aWindowConstraints.gridwidth = 1;
3024
+// // aConstraints.gridheight = 3;
3025
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3026
+// //bigThree.add(XYZPanel, aWindowConstraints);
3027
+// scenePanel.setVisible(false);
3028
+// centralPanel.setVisible(true);
3029
+// XYZPanel.setVisible(false);
3030
+ bigThree.ClearUI();
3031
+ bigThree.add(centralPanel);
3032
+ bigThree.FlushUI();
3033
+
3034
+ cameraView.requestFocusInWindow();
3035
+
3036
+// refreshContents(true);
3037
+//
3038
+// try
3039
+// {
3040
+// java.awt.Robot bot = new java.awt.Robot();
3041
+// int mask = InputEvent.BUTTON1_MASK;
3042
+// bot.mouseMove(100, 100);
3043
+// bot.mousePress(mask);
3044
+// bot.mouseRelease(mask);
3045
+// }
3046
+// catch (Exception e)
3047
+// {
3048
+//
3049
+// }
3050
+
26073051 } else
2608
- if (event.getSource() == threeButton)
3052
+ if (source == threeButton)
26093053 {
26103054 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();
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
3058
+
3059
+// bigThree.remove(scenePanel);
3060
+// bigThree.remove(centralPanel);
3061
+// bigThree.remove(XYZPanel);
3062
+// aWindowConstraints.gridx = 0;
3063
+// aWindowConstraints.gridy = 0;
3064
+// aWindowConstraints.gridwidth = 1;
3065
+// // aConstraints.gridheight = 3;
3066
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3067
+// aWindowConstraints.weightx = 0;
3068
+// aWindowConstraints.weighty = 1;
3069
+// //bigThree.add(jtp, aWindowConstraints);
3070
+// aWindowConstraints.weightx = 1;
3071
+// aWindowConstraints.gridwidth = 3;
3072
+// // aConstraints.gridheight = 3;
3073
+// aWindowConstraints.gridx = 1;
3074
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3075
+// bigThree.add(centralPanel, aWindowConstraints);
3076
+// aWindowConstraints.weightx = 0;
3077
+// aWindowConstraints.gridx = 4;
3078
+// aWindowConstraints.gridwidth = 1;
3079
+// // aConstraints.gridheight = 3;
3080
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3081
+// bigThree.add(XYZPanel, aWindowConstraints);
3082
+// bigThree.validate();
3083
+// scenePanel.setVisible(false);
3084
+// centralPanel.setVisible(true);
3085
+// XYZPanel.setVisible(true);
3086
+ bigThree.ClearUI();
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.add(XYZPanel);
3089
+ bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
26353092 } else
2636
- if (event.getSource() == fourButton)
3093
+ if (source == fourButton)
26373094 {
26383095 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();
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
3099
+
3100
+// bigThree.remove(scenePanel);
3101
+// bigThree.remove(centralPanel);
3102
+// bigThree.remove(XYZPanel);
3103
+// aWindowConstraints.gridx = 0;
3104
+// aWindowConstraints.gridy = 0;
3105
+// aWindowConstraints.gridwidth = 1;
3106
+// // aWindowConstraints.gridheight = 3;
3107
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3108
+// aWindowConstraints.weightx = 1;
3109
+// aWindowConstraints.weighty = 1;
3110
+// bigThree.add(scenePanel, aWindowConstraints);
3111
+// aWindowConstraints.weightx = 1;
3112
+// aWindowConstraints.gridwidth = 3;
3113
+// // aConstraints.gridheight = 3;
3114
+// aWindowConstraints.gridx = 1;
3115
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3116
+// //bigThree.add(cameraPanel, aWindowConstraints);
3117
+// aWindowConstraints.weightx = 0;
3118
+// aWindowConstraints.gridx = 4;
3119
+// aWindowConstraints.gridwidth = 1;
3120
+// // aWindowConstraints.gridheight = 3;
3121
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3122
+// //bigThree.add(XYZPanel, aWindowConstraints);
3123
+// bigThree.validate();
3124
+// scenePanel.setVisible(true);
3125
+// centralPanel.setVisible(false);
3126
+// XYZPanel.setVisible(false);
3127
+ bigThree.ClearUI();
3128
+ bigThree.add(scenePanel);
3129
+ bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
26633132 } else
2664
- if (event.getSource() == sixButton)
3133
+ if (source == sixButton)
26653134 {
26663135 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();
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
3139
+
3140
+// bigThree.remove(scenePanel);
3141
+// bigThree.remove(centralPanel);
3142
+// bigThree.remove(XYZPanel);
3143
+// aWindowConstraints.gridx = 0;
3144
+// aWindowConstraints.gridy = 0;
3145
+// aWindowConstraints.gridwidth = 1;
3146
+// // aConstraints.gridheight = 3;
3147
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3148
+// aWindowConstraints.weightx = 0;
3149
+// aWindowConstraints.weighty = 1;
3150
+// bigThree.add(scenePanel, aWindowConstraints);
3151
+// aWindowConstraints.weightx = 1;
3152
+// aWindowConstraints.gridwidth = 3;
3153
+// // aWindowConstraints.gridheight = 3;
3154
+// aWindowConstraints.gridx = 1;
3155
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3156
+// bigThree.add(centralPanel, aWindowConstraints);
3157
+// aWindowConstraints.weightx = 0;
3158
+// aWindowConstraints.gridx = 4;
3159
+// aWindowConstraints.gridwidth = 1;
3160
+// // aWindowConstraints.gridheight = 3;
3161
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3162
+// //bigThree.add(XYZPanel, aConstraints);
3163
+// bigThree.validate();
3164
+// scenePanel.setVisible(true);
3165
+// centralPanel.setVisible(true);
3166
+// XYZPanel.setVisible(false);
3167
+ bigThree.ClearUI();
3168
+ bigThree.add(scenePanel);
3169
+ bigThree.add(centralPanel);
3170
+ bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
26913173 } else
2692
- if (event.getSource() == sevenButton)
3174
+ if (source == sevenButton)
26933175 {
26943176 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();
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
+// // aWindowConstraints.gridheight = 3;
3188
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3189
+// aWindowConstraints.weightx = 0;
3190
+// aWindowConstraints.weighty = 1;
3191
+// bigThree.add(scenePanel, aWindowConstraints);
3192
+// aWindowConstraints.weightx = 1;
3193
+// aWindowConstraints.gridwidth = 3;
3194
+// // aWindowConstraints.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
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3203
+// bigThree.add(XYZPanel, aWindowConstraints);
3204
+// bigThree.validate();
3205
+// scenePanel.setVisible(true);
3206
+// centralPanel.setVisible(true);
3207
+// XYZPanel.setVisible(true);
3208
+ bigThree.ClearUI();
3209
+ bigThree.add(scenePanel);
3210
+ bigThree.add(centralPanel);
3211
+ bigThree.add(XYZPanel);
3212
+ bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
27193215 } else
2720
- if (event.getSource() == rootButton)
3216
+ if (source == rootButton)
27213217 {
27223218 Object3D obj;
27233219 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,34 +3223,44 @@
27273223 EditObject(obj);
27283224 }
27293225
3226
+ cameraView.requestFocusInWindow();
27303227 refreshContents(true);
27313228 } else
2732
- if (event.getSource() == closeButton)
3229
+ if (source == closeButton)
27333230 {
27343231 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353232 cRadio ab;
27363233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373234 {
27383235 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
27413244 buttonGroup.remove(ab);
27423245 radioPanel.remove(ab);
27433246
2744
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
27453249 // ab.GetObject().objectUI = null; // ?????????
27463250
27473251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483252 break;
27493253 }
27503254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
27513257 refreshContents(true);
27523258 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3259
+ if (source == editItem || source == editButton)
27543260 {
27553261 EditSelection(false);
27563262 } else
2757
- if (event.getSource() == uneditButton)
3263
+ if (source == uneditButton)
27583264 {
27593265 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603266 {
....@@ -2764,14 +3270,14 @@
27643270 child.CloseUI();
27653271 listUI.remove(child);
27663272
2767
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
27683274 }
2769
- objEditor.ctrlPanel.revalidate();
3275
+ objEditor.ctrlPanel.FlushUI();
27703276 //objEditor.jTree.clearSelection();
27713277 //objEditor.ResetSliders();
27723278 refreshContents(true);
27733279 } else
2774
- if (event.getSource() == clearPanelButton)
3280
+ if (source == clearPanelButton)
27753281 {
27763282 assert(copy == group);
27773283 //copy.ClearUI();
....@@ -2782,7 +3288,7 @@
27823288 listUI.clear();
27833289 refreshContents(true);
27843290 } else
2785
- if (event.getSource() == allParamsButton)
3291
+ if (source == allParamsButton)
27863292 {
27873293 assert(copy == group);
27883294
....@@ -2803,19 +3309,19 @@
28033309
28043310 refreshContents(true);
28053311 } else
2806
- if (event.getSource() == unselectButton)
3312
+ if (source == unselectButton)
28073313 {
28083314 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3315
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103316 objEditor.ResetSliders();
28113317 refreshContents(true);
28123318 } else
2813
- if(event.getSource() instanceof cRadio)
3319
+ if(source instanceof cRadio)
28143320 {
28153321 group.parent = keepparent;
28163322 group.attributes = 0;
28173323 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3324
+ /*cRadio*/ radio = (cRadio)source;
28193325 Object3D obj = radio.GetObject();
28203326 System.out.println("Edit " + obj);
28213327 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3341,7 @@
28353341 }
28363342
28373343 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3344
+ //Globals.theRenderer.object = group;
28393345 if(!useclient)
28403346 {
28413347 cameraView.renderCamera = radio.camera;
....@@ -2844,12 +3350,17 @@
28443350 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453351 cameraView.targetLookAt.set(radio.camera.lookAt);
28463352 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3353
+ //cameraView.lighttouched = true;
3354
+ Globals.lighttouched = true;
28483355 topView.object = group;
28493356 frontView.object = group;
28503357 sideView.object = group;
28513358 }
2852
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
28533364 /*
28543365 currentLayout = radio.layout;
28553366 if (currentLayout == null)
....@@ -2861,8 +3372,23 @@
28613372 //group.parent = null; // ROOT
28623373 //group.attributes = -1;
28633374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
28643377 refreshContents(true);
2865
- }
3378
+ } else if (event.getSource() == editCameraItem)
3379
+ {
3380
+ cameraView.ProtectCamera();
3381
+ cameraView.repaint();
3382
+ return;
3383
+ } else if (event.getSource() == revertCameraItem)
3384
+ {
3385
+ cameraView.RevertCamera();
3386
+ cameraView.repaint();
3387
+ return;
3388
+ // } else if (event.getSource() == textureButton)
3389
+ // {
3390
+ // return; // true;
3391
+ }
28663392 else
28673393 {
28683394 //return super.action(event, arg);
....@@ -2871,7 +3397,6 @@
28713397 }
28723398
28733399 boolean useclient = false;
2874
- cRadio radio;
28753400
28763401 void ToggleRoot()
28773402 {
....@@ -2880,7 +3405,7 @@
28803405 if (useclient)
28813406 {
28823407 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3408
+ Globals.lighttouched = true;
28843409 //topView.object = client;
28853410 //frontView.object = client;
28863411 //sideView.object = client;
....@@ -2888,7 +3413,7 @@
28883413 else
28893414 {
28903415 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3416
+ Globals.lighttouched = true;
28923417 //topView.object = group;
28933418 //frontView.object = group;
28943419 //sideView.object = group;
....@@ -2923,6 +3448,28 @@
29233448 refreshContents();
29243449 }
29253450
3451
+ void TransformChildren()
3452
+ {
3453
+ Object3D obj;
3454
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3455
+ {
3456
+ obj = (Object3D)e.nextElement();
3457
+ obj.KeepTextureMatrices();
3458
+ obj.TransformChildren();
3459
+ obj.RestoreTextureMatrices();
3460
+
3461
+// if (obj.parent == null)
3462
+// {
3463
+// System.out.println("NULL PARENT!");
3464
+// new Exception().printStackTrace();
3465
+// }
3466
+// else
3467
+// TouchTransform(obj);
3468
+// //obj.parent.Touch();
3469
+ }
3470
+
3471
+ refreshContents();
3472
+ }
29263473
29273474 void ResetTransform()
29283475 {
....@@ -3035,7 +3582,7 @@
30353582 refreshContents();
30363583 }
30373584
3038
- void ResetCentroid()
3585
+ void ResetCentroid(boolean full)
30393586 {
30403587 Object3D obj;
30413588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3597,16 @@
30503597 LA.matIdentity(Object3D.mat);
30513598 obj.getBounds(minima, maxima, false);
30523599 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3600
+ if (full)
3601
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543602 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553603 obj.TransformMesh(Object3D.mat);
3604
+
30563605 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3606
+ if (full)
3607
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583608 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3609
+
30593610 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603611 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613612 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +3635,8 @@
30843635
30853636 int size = obj.MemorySize();
30863637
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
3638
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3639
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30883640 }
30893641 }
30903642 catch (Exception e)
....@@ -3121,9 +3673,9 @@
31213673 obj = (Object3D)e.nextElement();
31223674
31233675 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3676
+ Grafreed.AnalyzeObject(obj);
31253677 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3678
+ Grafreed.AnalyzeObject(obj.bRep);
31273679
31283680 // System.err.println((size/1024) + " KB is the size of " + obj);
31293681 }
....@@ -3165,6 +3717,20 @@
31653717 void GenNormals(boolean crease)
31663718 {
31673719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
3727
+
3728
+ refreshContents();
3729
+ }
3730
+
3731
+ void GenNormalsMINE()
3732
+ {
3733
+ group.selection.GenNormalsMINE();
31683734
31693735 refreshContents();
31703736 }
....@@ -3250,7 +3816,7 @@
32503816 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513817 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523818 //
3253
-// g.add(GraphreeD.clipboard);
3819
+// g.add(GrafreeD.clipboard);
32543820 //
32553821 // buffer.add(g);
32563822 // }
....@@ -3269,8 +3835,8 @@
32693835 // nodes = new Object3D();
32703836 // vertices = new Vector<Vertex>();
32713837 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3838
+// boolean epsequal = GrafreeD.epsequal;
3839
+// GrafreeD.epsequal = true;
32743840 //
32753841 // for (int i=0; i<group.selection.size(); i++)
32763842 // {
....@@ -3311,7 +3877,7 @@
33113877 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123878 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133879 //
3314
-// g.add(GraphreeD.clipboard);
3880
+// g.add(GrafreeD.clipboard);
33153881 //
33163882 // buffer.add(g);
33173883 // }
....@@ -3319,7 +3885,7 @@
33193885 // makeSomething(buffer, i==group.selection.size()-1);
33203886 // }
33213887 //
3322
-// GraphreeD.epsequal = epsequal;
3888
+// GrafreeD.epsequal = epsequal;
33233889 //
33243890 // //buffer = null;
33253891 // temprep = null;
....@@ -3330,8 +3896,8 @@
33303896
33313897 void ParseVertices()
33323898 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3899
+ boolean epsequal = Grafreed.epsequal;
3900
+ Grafreed.epsequal = true;
33353901
33363902 for (int i=0; i<group.selection.size(); i++)
33373903 {
....@@ -3356,7 +3922,7 @@
33563922 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573923 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583924
3359
- g.add(GraphreeD.clipboard);
3925
+ g.add(Grafreed.clipboard);
33603926
33613927 buffer.add(g);
33623928 }
....@@ -3371,7 +3937,7 @@
33713937 makeSomething(buffer, i==group.selection.size()-1);
33723938 }
33733939
3374
- GraphreeD.epsequal = epsequal;
3940
+ Grafreed.epsequal = epsequal;
33753941
33763942 refreshContents();
33773943 }
....@@ -3389,7 +3955,16 @@
33893955 String pigment = Object3D.GetPigment(tex);
33903956 //String bump = Object3D.GetBump(tex);
33913957
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3958
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3959
+
3960
+ try
3961
+ {
3962
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3963
+ }
3964
+ catch (Exception e)
3965
+ {
3966
+ System.err.println("FAIL: " + node);
3967
+ }
33933968
33943969 double s = v.s;
33953970
....@@ -3416,7 +3991,7 @@
34163991 scale /= 3;
34173992
34183993 scale /= 0xFF;
3419
- scale /= 4;
3994
+ // c'est quoi ca? scale /= 4;
34203995
34213996 //v.AO = scale;
34223997
....@@ -3437,12 +4012,26 @@
34374012
34384013 void Align()
34394014 {
4015
+ if (group.selection.size() == 0)
4016
+ return;
4017
+
4018
+ cVector bbmin = new cVector();
4019
+ cVector bbmax = new cVector();
4020
+
4021
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4022
+
4023
+ double dx = bbmax.x - bbmin.x;
4024
+ double dy = bbmax.y - bbmin.y;
4025
+ double dz = bbmax.z - bbmin.z;
4026
+
4027
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4028
+
34404029 for (int i=0; i<group.selection.size(); i++)
34414030 {
34424031 Object3D obj = group.selection.get(i);
34434032
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4033
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4034
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464035 }
34474036
34484037 refreshContents();
....@@ -3455,7 +4044,7 @@
34554044 // ref.SaveSupports();
34564045 // Object3D par = ref.parent;
34574046 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4047
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594048 // ref.parent = par;
34604049 // ref.RestoreSupports();
34614050
....@@ -3463,11 +4052,11 @@
34634052
34644053 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654054
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4055
+ boolean random = CameraPane.SWITCH;
4056
+ CameraPane.SWITCH = false; // parse all random nodes
34684057 lowres.linkVerticesThis(null);
34694058 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4059
+ CameraPane.SWITCH = random;
34714060
34724061 System.err.flush();
34734062
....@@ -3485,7 +4074,7 @@
34854074 // lowres.SaveSupports();
34864075 // par = lowres.parent;
34874076 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4077
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894078 Object3D newlow = CloneObject(lowres, false);
34904079 newlow.name = sn.switchobject.get(i).name;
34914080 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4096,7 @@
35074096 return;
35084097
35094098 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4099
+ Object3D ref = Grafreed.clipboard.get(0);
35114100
35124101 Object3D newgroup = new Object3D("Po:" + poses.name);
35134102
....@@ -3676,7 +4265,7 @@
36764265 group.selection.RelinkToSupport(); // july 2014
36774266 System.out.println("DONE.");
36784267 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4268
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804269 }
36814270
36824271 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4290,20 @@
37014290
37024291 void ClipMesh()
37034292 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4293
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054294 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4295
+ Object3D content = Grafreed.clipboard.get(0);
37074296
37084297 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094298 content = ((cGroup)content).get(0);
37104299
37114300 // for (int i=0; i<group.selection.size(); i++)
37124301 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4302
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144303 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4304
+ group.selection.ClipMesh(Grafreed.clipboard);
37164305 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4306
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184307 System.out.println("DONE.");
37194308 refreshContents();
37204309 }
....@@ -3759,6 +4348,18 @@
37594348 void MarkLeaves(boolean hide)
37604349 {
37614350 group.selection.MarkLeaves(hide);
4351
+ refreshContents();
4352
+ }
4353
+
4354
+ void RewindLeaves(boolean hide)
4355
+ {
4356
+ group.selection.RewindLeaves(hide);
4357
+ refreshContents();
4358
+ }
4359
+
4360
+ void RandomLeaves(boolean hide)
4361
+ {
4362
+ group.selection.RandomLeaves(hide);
37624363 refreshContents();
37634364 }
37644365
....@@ -3844,10 +4445,10 @@
38444445 {
38454446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38464447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484449
38494450 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4451
+ if(elem != group || !newWindow)
38514452 {
38524453 // if (!(elem instanceof Composite))
38534454 // newWindow = false;
....@@ -3937,7 +4538,6 @@
39374538 //case 702: // Event.LIST_DESELECT
39384539 group.deselectAll();
39394540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39414541 if (tps != null)
39424542 {
39434543 for (int i=0; i < tps.length; i++)
....@@ -3946,31 +4546,30 @@
39464546
39474547 //if (child.parent != null)
39484548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
39494550 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39534551 }
39544552 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4553
+// else
4554
+// {
4555
+// objEditor.SetMaterial(group); // .GetMaterial());
4556
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4557
+// System.err.println("info : " + group.GetPath());
4558
+// }
39614559
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4560
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39654561 CameraPane.flash = true;
39664562
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39684564 // a camera
39694565 {
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;
4566
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4567
+ {
4568
+ CameraPane.camerachangeframe = 0; // don't refuse it
4569
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4570
+ }
4571
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4572
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744573 }
39754574
39764575 refreshContents();
....@@ -3981,6 +4580,26 @@
39814580
39824581 freezemodel = false;
39834582 }
4583
+
4584
+ void refreshContents(boolean cp)
4585
+ {
4586
+ if (!Globals.MOUSEDRAGGED)
4587
+ {
4588
+ objEditor.ClearInfo(); // .GetMaterial());
4589
+
4590
+ for (int i=0; i < group.selection.Size(); i++)
4591
+ {
4592
+ Object3D child = (Object3D) group.selection.get(i);
4593
+
4594
+ objEditor.AddInfo(child, this, true);
4595
+ System.err.println("info : " + child.GetPath());
4596
+ }
4597
+
4598
+ objEditor.SetText(); // jan 2014
4599
+ }
4600
+
4601
+ super.refreshContents(cp);
4602
+ }
39844603
39854604 void linkSomething(Object3D thing)
39864605 {
....@@ -4052,16 +4671,19 @@
40524671 {
40534672 if (group.selection.isEmpty())
40544673 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4674
+
4675
+ Grafreed.clipboardIsTempGroup = false;
40564676 Composite tGroup = null;
40574677 if (group.selection.size() > 0) // 1)
40584678 {
40594679 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4680
+ Grafreed.clipboardIsTempGroup = true;
40614681 }
40624682
40634683 if (cut)
40644684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
40654687 //int indices[] = jList.getSelectedIndices();
40664688 //for (int i = indices.length - 1; i >= 0; i--)
40674689 //jList.remove(indices[i]);
....@@ -4097,16 +4719,16 @@
40974719 //System.out.println("cut " + child);
40984720 //System.out.println("parent = " + child.parent);
40994721 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4722
+ if (Grafreed.clipboardIsTempGroup)
41014723 tGroup.add/*Child*/(tmp);
41024724 else
4103
- GraphreeD.clipboard = tmp;
4725
+ Grafreed.clipboard = tmp;
41044726 }
41054727 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4728
+ if (Grafreed.clipboardIsTempGroup)
41074729 tGroup.add/*Child*/(child);
41084730 else
4109
- GraphreeD.clipboard = child;
4731
+ Grafreed.clipboard = child;
41104732 }
41114733
41124734 //ResetModel();
....@@ -4138,21 +4760,23 @@
41384760 //System.out.println("cut " + elem);
41394761 //System.out.println("parent = " + elem.parent);
41404762 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4763
+ if (Grafreed.clipboardIsTempGroup)
41424764 tGroup.add/*Child*/(tmp);
41434765 else
4144
- GraphreeD.clipboard = tmp;
4766
+ Grafreed.clipboard = tmp;
41454767 }
41464768 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4769
+ if (Grafreed.clipboardIsTempGroup)
41484770 tGroup.add/*Child*/(child);
41494771 else
4150
- GraphreeD.clipboard = child;
4772
+ Grafreed.clipboard = child;
41514773 }
41524774
41534775 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4776
+
4777
+ if (Grafreed.clipboardIsTempGroup)
4778
+ Grafreed.clipboard = tGroup;
4779
+
41564780 if (cut)
41574781 {
41584782 ResetModel();
....@@ -4162,11 +4786,11 @@
41624786
41634787 void paste(boolean expand)
41644788 {
4165
- // if (GraphreeD.clipboard == null)
4789
+ // if (GrafreeD.clipboard == null)
41664790 // return;
41674791 boolean first = true;
41684792
4169
- if (GraphreeD.clipboardIsTempGroup)
4793
+ if (Grafreed.clipboardIsTempGroup)
41704794 {
41714795 Composite temp;
41724796
....@@ -4177,7 +4801,7 @@
41774801 temp = (Composite)Applet3D.clipboard.deepCopy();
41784802 */
41794803 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4804
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814805 {
41824806 Object3D child = (Object3D)e.nextElement();
41834807
....@@ -4191,7 +4815,7 @@
41914815 else
41924816 elem = child.deepCopy(); // ?
41934817 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4818
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954819 // elem = elem.get(0);
41964820 makeSomething(elem, true); // ?? first);
41974821 //group.addChild(elem);
....@@ -4211,23 +4835,23 @@
42114835 //Object3D cb = Applet3D.clipboard;
42124836 //temp.addChild(cb);
42134837 //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());
4838
+ assert(Grafreed.clipboard.parent == null);
4839
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4840
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4841
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4842
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194843 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4844
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4845
+ Grafreed.clipboard.get(0).parent = keepparent;
42224846 }
42234847
42244848 ResetModel();
42254849 refreshContents();
42264850 }
42274851
4228
- void pasteInto(boolean copyit)
4852
+ void pasteInto(boolean copyit, boolean clone)
42294853 {
4230
-// if (GraphreeD.clipboard == null)
4854
+// if (GrafreeD.clipboard == null)
42314855 // return;
42324856
42334857 if (group.selection.size() != 1)
....@@ -4254,15 +4878,22 @@
42544878 if (copyit)
42554879 {
42564880 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4881
+ if (clone)
4882
+ {
4883
+ CloneClipboard(false); // sept 2014
4884
+ }
4885
+ else
4886
+ {
4887
+ paste(false);
4888
+ }
42584889 }
42594890 else
42604891 {
42614892 boolean first = true;
42624893
4263
- if (GraphreeD.clipboardIsTempGroup)
4894
+ if (Grafreed.clipboardIsTempGroup)
42644895 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4896
+ Composite temp = (Composite)Grafreed.clipboard;
42664897 Object3D copy;
42674898 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684899 {
....@@ -4272,7 +4903,7 @@
42724903 }
42734904 } else
42744905 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4906
+ linkSomething(Grafreed.clipboard); //.get(0));
42764907 }
42774908 }
42784909 }
....@@ -4464,6 +5095,26 @@
44645095 makeSomething(csg);
44655096 }
44665097
5098
+ void Ungroup(Object3D g)
5099
+ {
5100
+ if (g instanceof HiddenObject)
5101
+ {
5102
+ HiddenObject h = (HiddenObject) g;
5103
+
5104
+ for (int i=0; i<h.ActualSize(); i++)
5105
+ {
5106
+ objEditor.makeSomething(h.get(i), false);
5107
+ }
5108
+ }
5109
+ else
5110
+ {
5111
+ for (int i=0; i<g.Size(); i++)
5112
+ {
5113
+ objEditor.makeSomething(g.get(i), false);
5114
+ }
5115
+ }
5116
+ }
5117
+
44675118 void ungroup()
44685119 {
44695120 /*
....@@ -4657,21 +5308,6 @@
46575308 }
46585309 */
46595310
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
-
46755311 /*
46765312 public void Callback(Object obj)
46775313 {
....@@ -4695,26 +5331,9 @@
46955331 }
46965332 */
46975333
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
-
47155334 String GetFile(String dialogName)
47165335 {
4717
- if (GraphreeD.standAlone)
5336
+ if (Grafreed.standAlone)
47185337 {
47195338 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205339 browser.show();
....@@ -4778,10 +5397,33 @@
47785397 cButton flashSelectionButton;
47795398 cButton editButton;
47805399 cButton uneditButton;
5400
+ JCheckBox allParamsButton;
47815401 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835402 cButton unselectButton;
47845403
5404
+ cButton minButton;
5405
+ cButton maxButton;
5406
+ cButton fullButton;
5407
+ cButton undoButton;
5408
+ cButton redoButton;
5409
+ cButton saveButton;
5410
+ cButton oneStepButton;
5411
+
5412
+ cButton groupButton;
5413
+ cButton ungroupButton;
5414
+ cButton compositeButton;
5415
+
5416
+ cButton gridButton;
5417
+ cButton boxButton;
5418
+ cButton sphereButton;
5419
+ cButton coneButton;
5420
+ cButton torusButton;
5421
+ cButton superButton;
5422
+ cButton kleinButton;
5423
+ cButton particlesButton;
5424
+ cButton overlayButton;
5425
+ cButton lightButton;
5426
+
47855427 cButton screenfitButton;
47865428 cButton screenfitpointButton;
47875429 cButton snapobjectButton;
....@@ -4792,14 +5434,6 @@
47925434 cButton closeButton;
47935435
47945436 cButton setsupportButton;
4795
-
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;
48035437
48045438 //
48055439 //Composite
....@@ -4812,7 +5446,9 @@
48125446 private MenuItem lookFromItem;
48135447 private MenuItem switchItem;
48145448 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
48165452 private MenuItem cloneItem;
48175453 private MenuItem cloneSupportItem;
48185454 private MenuItem overwriteGeoItem;
....@@ -4823,8 +5459,9 @@
48235459 private MenuItem resetsupportItem;
48245460 private MenuItem resetreferencesItem;
48255461 private MenuItem linkverticesItem;
5462
+ private MenuItem relinkverticesItem;
48265463 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
48285465 private MenuItem stepAllItem;
48295466 private MenuItem revertMeshItem;
48305467 private MenuItem poseMeshItem;
....@@ -4835,14 +5472,17 @@
48355472 private MenuItem mergeGeometriesItem;
48365473 private MenuItem copyItem;
48375474 private MenuItem pasteItem;
5475
+ private MenuItem pasteIntoItem;
48385476 private MenuItem pasteLinkItem;
48395477 private MenuItem pasteCloneItem;
48405478 private MenuItem pasteExpandItem;
48415479 private MenuItem clearItem;
48425480 private MenuItem clearAllItem;
48435481 private MenuItem genUVItem;
5482
+ private MenuItem genNormalsMESHItem;
48445483 private MenuItem genNormalsCADItem;
48455484 private MenuItem genNormalsORGANItem;
5485
+ private MenuItem genNormalsMINEItem;
48465486 private MenuItem stripifyItem;
48475487 private MenuItem unstripifyItem;
48485488 private MenuItem trimItem;
....@@ -4871,6 +5511,10 @@
48715511 private MenuItem showleavesItem;
48725512 private MenuItem markleavesItem;
48735513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
48745518
48755519 private MenuItem flipVItem;
48765520 private MenuItem unflipVItem;
....@@ -4882,8 +5526,11 @@
48825526 private MenuItem panoTexturesItem;
48835527
48845528 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5529
+ private MenuItem resetCentroidXZItem;
48865530 private MenuItem resetTransformItem;
5531
+ private MenuItem transformGeometryItem;
5532
+ private MenuItem transformChildrenItem;
5533
+ private MenuItem hideItem;
48875534 private MenuItem grabItem;
48885535 private MenuItem backItem;
48895536 private MenuItem frontItem;
....@@ -4904,6 +5551,7 @@
49045551
49055552 private MenuItem resetParentItem;
49065553 private MenuItem repairParentItem;
5554
+ private MenuItem repairShadowItem;
49075555 private MenuItem sortbysizeItem;
49085556 private MenuItem sortbynameItem;
49095557
....@@ -4924,10 +5572,11 @@
49245572 private MenuItem coneItem;
49255573 private MenuItem torusItem;
49265574 private MenuItem superItem;
5575
+ private MenuItem kleinItem;
49275576 private MenuItem blobItem;
49285577 private MenuItem latheItem;
49295578 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5579
+ private MenuItem overlayItem;
49315580 private MenuItem meshItem;
49325581 // private MenuItem meshGroupItem;
49335582 private MenuItem springItem;
....@@ -4936,6 +5585,7 @@
49365585 private MenuItem csgItem;
49375586 private MenuItem templateItem;
49385587 private MenuItem textureItem;
5588
+ private MenuItem billboardItem;
49395589 private MenuItem shadowXItem;
49405590 private MenuItem shadowYItem;
49415591 private MenuItem shadowZItem;
....@@ -4948,11 +5598,6 @@
49485598 private MenuItem doubleItem;
49495599 private MenuItem tripleItem;
49505600
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565601 private MenuItem computeAOItem;
49575602 private MenuItem recompileItem;
49585603 private MenuItem editScriptItem;
....@@ -4962,4 +5607,8 @@
49625607 private MenuItem analyzeItem;
49635608 private MenuItem dumpItem;
49645609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
49655614 }