Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,130 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //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
-
286
+ }
287
+
192288 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);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
222325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223326 setMasterItem.addActionListener(this);
327
+ }
224328
225329 oe.menuBar.add(menu = new Menu("Group"));
226330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +335,38 @@
231335 frontItem.addActionListener(this);
232336 compositeItem = menu.add(new MenuItem("Composite"));
233337 compositeItem.addActionListener(this);
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
339
+ hideItem.addActionListener(this);
340
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
341
+ ungroupItem.addActionListener(this);
234342 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
236344 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);
241345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242346 switchGeoItem.addActionListener(this);
243347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244348 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
246350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
247359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248360 scriptNodeItem.addActionListener(this);
249361 cameraItem = menu.add(new MenuItem("Camera"));
250362 cameraItem.addActionListener(this);
363
+ }
251364
252365 oe.menuBar.add(menu = new Menu("Object"));
253366 textureItem = menu.add(new MenuItem("Texture"));
254367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
255370 csgItem = menu.add(new MenuItem("CSG"));
256371 csgItem.addActionListener(this);
257372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +375,29 @@
260375 shadowYItem.addActionListener(this);
261376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
263381 linkerItem = menu.add(new MenuItem("Linker"));
264382 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267383 attributeItem = menu.add(new MenuItem("Attribute"));
268384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
269387 pointflowItem = menu.add(new MenuItem("Point Flow"));
270388 pointflowItem.addActionListener(this);
389
+ }
271390 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275392 resetTransformItem.addActionListener(this);
276393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277394 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
280401
281402 oe.menuBar.add(menu = new Menu("Geometry"));
282403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +406,13 @@
285406 genNormalsORGANItem.addActionListener(this);
286407 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287408 genNormalsCADItem.addActionListener(this);
409
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
410
+ genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
288416 stripifyItem = menu.add(new MenuItem("Stripify"));
289417 stripifyItem.addActionListener(this);
290418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +434,34 @@
306434 reduce34MeshItem.addActionListener(this);
307435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308436 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
313445
314446 oe.menuBar.add(menu = new Menu("Attributes"));
315447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
317453 menu.add("-");
318454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319455 liveleavesItem.addActionListener(this);
320456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
322460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323461 supportleavesItem.addActionListener(this);
324462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325463 unsupportleavesItem.addActionListener(this);
464
+ }
326465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327466 hideleavesItem.addActionListener(this);
328467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +470,14 @@
331470 markleavesItem.addActionListener(this);
332471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
334481 menu.add("-");
335482 flipVItem = menu.add(new MenuItem("Flip V"));
336483 flipVItem.addActionListener(this);
....@@ -366,29 +513,22 @@
366513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367514 sortbynameItem.addActionListener(this);
368515 menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
520
+ if (Globals.ADVANCED)
521
+ {
522
+ // Pretty much the same as duplicate and clone.
369523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370524 extractGeometriesItem.addActionListener(this);
371525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372526 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);
527
+ }
377528
378529 oe.menuBar.add(menu = new Menu("Insert"));
379530 buildCreateMenu(menu);
380531
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GrafreeD 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
-
392532 oe.menuBar.add(menu = new Menu("Tools"));
393533 buildToolsMenu(menu);
394534 }
....@@ -423,150 +563,110 @@
423563 oe.radioPanel.add(dummyButton);
424564 oe.buttonGroup.add(dummyButton);
425565 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
566
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429567
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
568
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ undoButton.setToolTipText("Undo changes");
570
+ undoButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ redoButton.setToolTipText("Redo changes");
574
+ redoButton.addActionListener(this);
575
+
576
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ saveButton.setToolTipText("Save changes");
578
+ saveButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
581
+ liveCB.setToolTipText("Enable animation");
431582 liveCB.addItemListener(this);
432583
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);
584
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ oneStepButton.setToolTipText("Animate one step forward");
586
+ oneStepButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
589
+ fastCB.setToolTipText("Fast mode");
451590 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);
591
+
592
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
593
+ trackCB.setToolTipText("Enable tracking");
493594 trackCB.addItemListener(this);
494595
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ screenfitButton.setToolTipText("Screen fit");
497598 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
599
+
499600 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500601 // 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;
505602
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);
603
+ if (Globals.ADVANCED)
604
+ {
605
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ snapobjectButton.addActionListener(this);
607
+ snapobjectButton.setToolTipText("Snap Object");
608
+ }
609
+
610
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ flashSelectionButton.setToolTipText("Show selection");
512612 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516613
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
614
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
615
+
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ twoButton.setToolTipText("Show center view only");
519618 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521620 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
621
+ fourButton.setToolTipText("Show left panel only");
622
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623
+ sixButton.setToolTipText("2-column layout left");
523624 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ threeButton.setToolTipText("2-column layout right");
525627 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
628
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ sevenButton.setToolTipText("3-column layout");
527630 sevenButton.addActionListener(this);
528631 //
529632
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
633
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ rootButton.setToolTipText("Edit selection in new tab");
531635 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
636
+
637
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ closeButton.setToolTipText("Close tab");
534639 closeButton.addActionListener(this);
535640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536641 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538642
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
643
+ cGridBag commandsPanel = new cGridBag();
644
+
645
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ editButton.setToolTipText("Edit selection");
541647 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545648
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
547651 uneditButton.addActionListener(this);
548652
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);
653
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654
+ allParamsButton.setToolTipText("Edit all params");
561655 allParamsButton.addActionListener(this);
562656
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);
657
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ clearPanelButton.setToolTipText("Clear edit panel");
659
+ clearPanelButton.addActionListener(this);
660
+
661
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ unselectButton.setToolTipText("Unselect");
568663 unselectButton.addActionListener(this);
569664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
570670 // oe.aConstraints.gridx += 1;
571671 // oe.aConstraints.weighty = 0;
572672 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +678,37 @@
578678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579679 // gcButton.addActionListener(this);
580680
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;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
592684 //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);
685
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594686 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
599690
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);
691
+ cGridBag copyOptionsPanel = new cGridBag();
692
+
693
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
694
+ colorCB.setToolTipText("Copy color when dropped");
604695 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
696
+
697
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
698
+ materialCB.setToolTipText("Copy material when dropped");
607699 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
700
+
701
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
702
+ textureCB.setToolTipText("Copy texture when dropped");
610703 textureCB.addItemListener(this);
611704
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
614708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
615712 //jList.addListSelectionListener(this);
616713 oe.jTree.addTreeSelectionListener(this);
617714 //jTree.setRootVisible(false);
....@@ -633,18 +730,91 @@
633730 radio.layout = sevenButton;
634731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635732 }
733
+
734
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
735
+ {
736
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
737
+ boxCB.setToolTipText("Display bounding boxes");
738
+ boxCB.addItemListener(this);
739
+
740
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
741
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
742
+ zoomBoxCB.addItemListener(this);
743
+
744
+ if (true) // Globals.ADVANCED)
745
+ {
746
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
747
+ supportCB.setToolTipText("Enable rigging");
748
+ supportCB.addItemListener(this);
749
+
750
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
751
+ // localCB.addItemListener(this);
752
+
753
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
754
+ crowdCB.setToolTipText("Used for crowds");
755
+ crowdCB.addItemListener(this);
756
+
757
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
758
+ smoothCB.setToolTipText("Snapping delay");
759
+ smoothCB.addItemListener(this);
760
+
761
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
762
+ slowCB.setToolTipText("Smooth interpolation");
763
+ slowCB.addItemListener(this);
764
+
765
+// constraints.gridy += 1;
766
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
767
+// speakerMocapCB.addItemListener(this);
768
+
769
+ if (false)
770
+ {
771
+ // handled in scripts
772
+ //constraints.gridy += 1;
773
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
774
+ speakerCameraCB.addItemListener(this);
775
+
776
+ //constraints.gridy += 1;
777
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
778
+ speakerFocusCB.addItemListener(this);
779
+
780
+ //constraints.gridy += 1;
781
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
782
+ smoothfocusCB.addItemListener(this);
783
+ }
784
+
785
+//constraints.gridx += 1;
786
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
787
+// debugCB.addItemListener(this);
788
+
789
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
790
+ oeilCB.addItemListener(this);
791
+
792
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
793
+ lookAtCB.setToolTipText("Look-at target");
794
+ lookAtCB.addItemListener(this);
795
+
796
+ }
797
+
798
+ cGridBag fill = new cGridBag();
799
+
800
+ fill.preferredHeight = 200;
801
+
802
+ panel.add(fill);
803
+
804
+ }
636805
637806 void EditObject(Object3D obj)
638807 {
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();
808
+ cRadio radioButton = new cRadio(obj.name);
809
+ radioButton.SetObject(obj);
810
+ radioButton.layout = sevenButton;
811
+ radioButton.SetCamera(cameraView.renderCamera, false);
812
+ radioButton.addActionListener(this);
813
+ radioPanel.add(radioButton);
814
+ buttonGroup.add(radioButton);
815
+ radioButton.doClick();
647816 }
817
+
648818 void SetupViews(ObjEditor oe)
649819 {
650820 oe.SetupViews();
....@@ -663,6 +833,7 @@
663833 JCheckBox fastCB;
664834 JCheckBox slowCB;
665835 JCheckBox boxCB;
836
+ JCheckBox zoomBoxCB;
666837 JCheckBox trackCB;
667838 JCheckBox smoothfocusCB;
668839 // JCheckBox speakerMocapCB;
....@@ -705,10 +876,10 @@
705876 dropAttributes |= Object3D.TEXTURE;
706877 else
707878 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
879
+ } else if(e.getSource() == liveCB)
710880 {
711881 cameraView.ToggleLive();
882
+ refreshContents(false);
712883 }
713884 else if(e.getSource() == supportCB)
714885 {
....@@ -743,6 +914,10 @@
743914 Recompile();
744915 cameraView.repaint();
745916 // refreshContents();
917
+ }
918
+ else if(e.getSource() == zoomBoxCB)
919
+ {
920
+ cameraView.ToggleZoomBoxMode();
746921 }
747922 else if(e.getSource() == smoothfocusCB)
748923 {
....@@ -857,7 +1032,9 @@
8571032 // objEditor.DropFile((java.io.File[]) object, true);
8581033 // return;
8591034 // }
860
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611038 {
8621039 // file(s)
8631040 String[] names = string.split("\n");
....@@ -884,7 +1061,7 @@
8841061
8851062 flashIt = false;
8861063 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891066
8901067 if (group.selection.size() == 1)
....@@ -911,11 +1088,11 @@
9111088 {
9121089 loadClipboard(true);
9131090 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1091
+ pasteInto(false, false);
9151092 } else {
9161093 loadClipboard(false);
9171094 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9191096 }
9201097 }
9211098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1210,37 @@
10331210 torusItem.addActionListener(this);
10341211 superItem = menu.add(new MenuItem("Superellipsoid"));
10351212 superItem.addActionListener(this);
1213
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1214
+ kleinItem.addActionListener(this);
10361215 particleItem = menu.add(new MenuItem("Particle system"));
10371216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10381219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391220 ragdollItem.addActionListener(this);
10401221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411222 ragdoll2Item.addActionListener(this);
1223
+ }
10421224 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441226 meshItem.addActionListener(this);
10451227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10471231 springItem = menu.add(new MenuItem("Spring"));
10481232 springItem.addActionListener(this);
10491233 flagItem = menu.add(new MenuItem("Flag"));
10501234 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);
10551235 blobItem = menu.add(new MenuItem("Blob"));
10561236 blobItem.addActionListener(this);
10571237 latheItem = menu.add(new MenuItem("Lathe"));
10581238 latheItem.addActionListener(this);
1239
+ }
1240
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1241
+ bezierItem.addActionListener(this);
1242
+ overlayItem = menu.add(new MenuItem("Overlay"));
1243
+ overlayItem.addActionListener(this);
10591244 lightItem = menu.add(new MenuItem("Light"));
10601245 lightItem.addActionListener(this);
10611246 menu.add("-");
....@@ -1065,39 +1250,44 @@
10651250 loopItem.addActionListener(this);
10661251 doubleItem = menu.add(new MenuItem("Fork"));
10671252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
10681255 tripleItem = menu.add(new MenuItem("Trident"));
10691256 tripleItem.addActionListener(this);
1257
+ }
10701258 }
10711259
10721260 void buildToolsMenu(Menu menu)
10731261 {
10741262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751263 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
10771265
10781266 menu.add("-");
10791267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801268 parseverticesItem.addActionListener(this);
10811269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821270 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841272 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881274 reduceMorphItem.addActionListener(this);
10891275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901276 reduce34MorphItem.addActionListener(this);
1091
-
1277
+ menu.add("-");
10921278 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931279 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
10961286 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971287 memoryItem.addActionListener(this);
10981288 menu.add(analyzeItem = new MenuItem("Analyze"));
10991289 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11011291 dumpItem.addActionListener(this);
11021292 // menu.add(pathItem = new MenuItem("From-to path"));
11031293 // pathItem.addActionListener(this);
....@@ -1106,6 +1296,8 @@
11061296 resetParentItem.addActionListener(this);
11071297 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081298 repairParentItem.addActionListener(this);
1299
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1300
+ repairShadowItem.addActionListener(this);
11091301 menu.add(invariantsItem = new MenuItem("Invariants"));
11101302 invariantsItem.addActionListener(this);
11111303 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1305,7 @@
11131305 menu.add("-");
11141306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151307 editScriptItem.addActionListener(this);
1308
+ }
11161309 }
11171310
11181311 void ScreenFit()
....@@ -1441,9 +1634,9 @@
14411634
14421635 void Overwrite(int mask)
14431636 {
1444
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451638 {
1446
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14471640
14481641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491642 content = ((cGroup)content).get(0);
....@@ -1466,6 +1659,7 @@
14661659 //
14671660 public void actionPerformed(ActionEvent event) // , Object arg)
14681661 {
1662
+ Object source = event.getSource();
14691663 /*
14701664 if (event.getSource() == nameField)
14711665 {
....@@ -1477,11 +1671,11 @@
14771671 }
14781672 else
14791673 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
14811675 {
14821676 ScreenFit();
14831677 } else
1484
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
14851679 {
14861680 cVector v1 = new cVector();
14871681 cVector v2 = new cVector();
....@@ -1490,11 +1684,11 @@
14901684 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911685 objEditor.cameraView.repaint();
14921686 } else
1493
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
14941688 {
14951689 makeSomething(new Box());
14961690 } else
1497
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
14981692 {
14991693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1709,9 @@
15151709 applyExample(particleGeom, "SMOKE");
15161710 makeSomething(particleGeom);
15171711 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15191713 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211715
15221716 ragdoll.toParent = LA.newMatrix();
15231717 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1729,7 @@
15351729 } else
15361730 /*
15371731 */
1538
- if (event.getSource() == heightFieldItem)
1732
+ if (source == heightFieldItem)
15391733 {
15401734 Object3D obj = new Object3D();
15411735
....@@ -1573,27 +1767,31 @@
15731767
15741768 makeSomething(obj);
15751769 } else
1576
- if (event.getSource() == gridItem)
1770
+ if (source == gridItem)
15771771 {
15781772 makeSomething(new Grid());
15791773 } else
1580
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
15811775 {
15821776 makeSomething(new Sphere());
15831777 } else
1584
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
15851779 {
15861780 makeSomething(new Cone());
15871781 } else
1588
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
15891783 {
15901784 makeSomething(new Torus());
15911785 } else
1592
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
15931787 {
15941788 makeSomething(new Superellipsoid());
15951789 } else
1596
- if (event.getSource() == blobItem)
1790
+ if (source == kleinItem)
1791
+ {
1792
+ makeSomething(new Klein());
1793
+ } else
1794
+ if (source == blobItem)
15971795 {
15981796 Blob blob = new Blob();
15991797 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1799,15 @@
16011799 //blob.retile();
16021800 makeSomething(blob);
16031801 } else
1604
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
16051803 {
16061804 makeSomething(new Lathe());
16071805 } else
1608
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
16091807 {
16101808 makeSomething(new BezierSurface());
16111809 } else
1612
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
16131811 {
16141812 /*
16151813 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1822,7 @@
16241822 */
16251823 makeSomething(new Checker());
16261824 } else
1627
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
16281826 {
16291827 Object3D itemtomake = new Object3D();
16301828 Object3D child;
....@@ -1645,35 +1843,35 @@
16451843 makeSomething(child);
16461844 }
16471845 } else
1648
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
16491847 {
16501848 cSpring s = new cSpring();
16511849 s.setup();
16521850 makeSomething(s);
16531851 } else
1654
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
16551853 {
16561854 cSpring s = new cFlag();
16571855 s.setup();
16581856 makeSomething(s);
16591857 } else
1660
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
16611859 {
16621860 makeSomething(new Light());
16631861 } else
1664
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
16651863 {
16661864 group(new CSG());
16671865 } else
1668
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
16691867 {
16701868 group(new cTemplate());
16711869 } else
1672
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
16731871 {
16741872 makeSomething(new Attribute());
16751873 } else
1676
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
16771875 {
16781876 makeSomething(new PointFlow());
16791877 } else
....@@ -1685,7 +1883,7 @@
16851883 } else
16861884 */
16871885
1688
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
16891887 {
16901888 Composite g = new cGroup();
16911889 for (int i=0; i<15; i++)
....@@ -1707,7 +1905,7 @@
17071905
17081906 group(g);
17091907 } else
1710
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
17111909 {
17121910 Composite csg = new GroupLeaf();
17131911 csg.count = 5;
....@@ -1716,7 +1914,7 @@
17161914 csg.addChild(child);
17171915 child.addChild(csg);
17181916 } else
1719
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
17201918 {
17211919 Composite csg = new GroupLeaf();
17221920 csg.count = 5;
....@@ -1728,7 +1926,7 @@
17281926 csg.addChild(child);
17291927 child.addChild(csg);
17301928 } else
1731
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
17321930 {
17331931 Composite csg = new GroupLeaf();
17341932 csg.count = 4;
....@@ -1743,71 +1941,71 @@
17431941 csg.addChild(child);
17441942 child.addChild(csg);
17451943 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1944
+ if (source == computeAOItem)
17481945 {
1749
- ImportGFD();
1946
+ Globals.drawMode = CameraPane.OCCLUSION;
1947
+ Globals.theRenderer.repaint();
17501948 } 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)
1949
+ if (source == recompileItem)
17691950 {
17701951 Recompile();
17711952 refreshContents();
17721953 } else
1773
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
17741955 {
17751956 OpenDialog();
17761957 refreshContents();
17771958 } else
1778
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
17791960 {
17801961 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
17821963 } else
1783
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
17841965 {
17851966 //System.out.println("Invariants:");
17861967 PrintMemory();
17871968 } else
1788
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
17891970 {
17901971 PrintPath();
17911972 } else
1792
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
17931974 {
17941975 AnalyzeObject();
17951976 } else
1796
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
17971978 {
17981979 DumpObject();
17991980 } else
1800
- if (event.getSource() == screenfitButton)
1981
+ if (source == undoButton)
1982
+ {
1983
+ Undo();
1984
+ } else
1985
+ if (source == redoButton)
1986
+ {
1987
+ Redo();
1988
+ } else
1989
+ if (source == saveButton)
1990
+ {
1991
+ Save();
1992
+ } else
1993
+ if (source == oneStepButton)
1994
+ {
1995
+ Globals.ONESTEP = true;
1996
+ cameraView.repaint();
1997
+ } else
1998
+ if (source == screenfitButton)
18011999 {
18022000 //Reload(lastConverter, lastFilename, true);
18032001 ScreenFit();
18042002 } else
1805
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
18062004 {
18072005 //Reload(lastConverter, lastFilename, true);
18082006 ScreenFitPoint();
18092007 } else
1810
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
18112009 {
18122010 //Reload(lastConverter, lastFilename, true);
18132011 SnapObject();
....@@ -1818,13 +2016,13 @@
18182016 // Recompile();
18192017 // refreshContents();
18202018 // } else
1821
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
18222020 {
18232021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242022 System.gc();
18252023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262024 } else
1827
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
18282026 {
18292027 Object3D obj;
18302028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +2036,74 @@
18382036 }
18392037 refreshContents(true);
18402038 } else
1841
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
18422040 {
18432041 EditSelection(true);
18442042 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
18462044 {
18472045 loadClipboard(true);
18482046 } else
1849
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
18502048 {
1851
- Object3D keep = GrafreeD.clipboard;
2049
+ Undo();
2050
+ } else
2051
+ if (source == redoItem)
2052
+ {
2053
+ Redo();
2054
+ } else
2055
+ if (source == duplicateItem)
2056
+ {
2057
+ Object3D keep = Grafreed.clipboard;
18522058 loadClipboard(false);
18532059 paste(false);
1854
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
18552061 } else
1856
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
18572063 {
18582064 CloneSelection(false);
18592065 } else
1860
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
18612067 {
18622068 CloneSelection(true);
18632069 } else
1864
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
18652071 {
18662072 loadClipboard(false);
18672073 } else
1868
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
18692075 {
18702076 paste(false);
18712077 } else
1872
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
18732079 {
1874
- pasteInto(false);
2080
+ pasteInto(true, false);
18752081 } else
1876
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
18772083 {
1878
- pasteInto(true);
2084
+ pasteInto(false, false);
18792085 } else
1880
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
18812091 {
18822092 paste(true);
18832093 } else
1884
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
18852095 {
18862096 Overwrite(Object3D.TRANSFORM);
18872097 } else
1888
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
18892099 {
18902100 Overwrite(Object3D.NAME);
18912101 } else
1892
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
18932103 {
18942104 Overwrite(Object3D.UV);
18952105 } else
1896
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
18972107 {
18982108 /* july 2015
18992109 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2123,7 @@
19132123
19142124 Overwrite(dropAttributes);
19152125 }
1916
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
19172127 {
19182128 Overwrite(Object3D.GEOMETRY);
19192129 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2140,7 @@
19302140 // refreshContents();
19312141 // }
19322142 } else
1933
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
19342144 {
19352145 //if (group.selection.size() == 1)
19362146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2151,7 @@
19412151 ResetModel();
19422152 refreshContents();
19432153 } else
1944
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
19452155 {
19462156 boolean one = false;
19472157
....@@ -1968,7 +2178,7 @@
19682178 ResetModel();
19692179 refreshContents();
19702180 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
19722182 {
19732183 boolean one = false;
19742184
....@@ -1994,32 +2204,37 @@
19942204 ResetModel();
19952205 refreshContents();
19962206 } else
1997
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
19982208 {
19992209 boolean one = false;
20002210
20012211 if (group.selection.size() == 1)
20022212 one = true;
20032213
2214
+ Object3D merge = null;
2215
+
20042216 Object3D content = new cGroup();
20052217
20062218 for (int i=0; i<group.selection.size(); i++)
20072219 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2220
+ merge = new Merge(group.selection.get(i));
20092221
20102222 if (one)
2011
- makeSomething(sel, false);
2223
+ makeSomething(merge, false);
20122224 else
2013
- content.addChild(sel);
2225
+ content.addChild(merge);
20142226 }
20152227
20162228 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2229
+ makeSomething(content, true);
2230
+ else
2231
+ {
2232
+ ResetModel();
2233
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2234
+ refreshContents();
2235
+ }
20212236 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
20232238 {
20242239 boolean one = false;
20252240
....@@ -2049,7 +2264,7 @@
20492264 ResetModel();
20502265 refreshContents();
20512266 } else
2052
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
20532268 {
20542269 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552270 // {
....@@ -2062,39 +2277,48 @@
20622277 // group.selection.get(0).setMasterThis(content); // should be identity
20632278 // refreshContents();
20642279 // }
2065
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20662281 {
2067
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
20682283
20692284 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702285 content = ((cGroup)content).get(0);
20712286
2072
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2287
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20732288 for (int i=0; i<group.selection.size(); i++)
20742289 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
20772292 group.selection.get(i).linkVerticesThis(content);
20782293 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
20802295 }
2081
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2296
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20822297 refreshContents();
20832298 }
20842299 } else
2085
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
20862301 {
20872302 for (int i=0; i<group.selection.size(); i++)
20882303 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
20912306 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
20932308 }
20942309
20952310 refreshContents();
20962311 } else
2097
- if (event.getSource() == resetreferencesItem)
2312
+ if (source == relinkverticesItem)
2313
+ {
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
2316
+ group.selection.RelinkToSupport();
2317
+ CameraPane.SWITCH = random;
2318
+
2319
+ refreshContents();
2320
+ } else
2321
+ if (source == resetreferencesItem)
20982322 {
20992323 for (int i=0; i<group.selection.size(); i++)
21002324 {
....@@ -2103,11 +2327,11 @@
21032327
21042328 refreshContents();
21052329 } else
2106
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
21072331 {
2108
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21092333 {
2110
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21112335
21122336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21132337 content = ((cGroup)content).get(0);
....@@ -2116,13 +2340,13 @@
21162340 refreshContents();
21172341 }
21182342 } else
2119
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
21202344 {
21212345 if (group.selection.size() == 1)
21222346 {
2123
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21242348 {
2125
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21262350
21272351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21282352 content = ((cGroup)content).get(0);
....@@ -2135,19 +2359,19 @@
21352359 }
21362360
21372361 } else
2138
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
21392363 {
21402364 RevertMeshes();
21412365 } else
2142
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
21432367 {
21442368 ResetAll();
21452369 } else
2146
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
21472371 {
21482372 StepAll();
21492373 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
21512375 {
21522376 //int indices[] = jList.getSelectedIndices();
21532377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2379,46 @@
21552379
21562380 ClearSelection(false);
21572381 } else
2158
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
21592383 {
21602384 ClearSelection(true);
21612385 } else
2162
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
21632387 {
21642388 group(new cGroup(), true);
21652389 } else
2166
- if (event.getSource() == frontItem)
2390
+ if (source == hideItem)
2391
+ {
2392
+ group(new HiddenObject());
2393
+ } else
2394
+ if (source == frontItem)
21672395 {
21682396 front();
21692397 } else
2170
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
21712399 {
21722400 back();
21732401 } else
2174
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
21752403 {
21762404 makeSomething(new Camera());
21772405 } else
2178
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
21792407 {
21802408 group(new Composite());
21812409 } else
2182
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
21832411 {
21842412 RandomNode random = new RandomNode();
21852413 group(random);
21862414 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
21882416 } else
2189
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
21902418 {
21912419 group(new PhysicsNode());
21922420 } else
2193
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
21942422 {
21952423 for (int i=0; i<group.selection.size(); i++)
21962424 {
....@@ -2202,7 +2430,7 @@
22022430 ResetModel();
22032431 refreshContents();
22042432 } else
2205
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
22062434 {
22072435 for (int i=0; i<group.selection.size(); i++)
22082436 {
....@@ -2214,7 +2442,7 @@
22142442 ResetModel();
22152443 refreshContents();
22162444 } else
2217
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
22182446 {
22192447 for (int i=0; i<group.selection.size(); i++)
22202448 {
....@@ -2226,7 +2454,7 @@
22262454 ResetModel();
22272455 refreshContents();
22282456 } else
2229
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
22302458 {
22312459 for (int i=0; i<group.selection.size(); i++)
22322460 {
....@@ -2238,7 +2466,7 @@
22382466 ResetModel();
22392467 refreshContents();
22402468 } else
2241
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
22422470 {
22432471 boolean atleastone = false;
22442472
....@@ -2277,195 +2505,239 @@
22772505 }
22782506 }
22792507 } else
2280
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
22812509 {
22822510 group(new cLinker());
22832511 } else
2284
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
22852513 {
22862514 group(new TextureNode());
22872515 } else
2288
- if (event.getSource() == shadowXItem)
2516
+ if (source == billboardItem)
2517
+ {
2518
+ group(new BillboardNode());
2519
+ } else
2520
+ if (source == shadowXItem)
22892521 {
22902522 CastShadow(0);
22912523 } else
2292
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
22932525 {
22942526 CastShadow(1);
22952527 } else
2296
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
22972529 {
22982530 CastShadow(2);
22992531 } else
2300
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
23012533 {
2302
- ungroup();
2534
+ //ungroup();
2535
+ for (int i=0; i<group.selection.size(); i++)
2536
+ {
2537
+ Ungroup(group.selection.get(i));
2538
+ }
2539
+
2540
+ ClearSelection(false);
2541
+
2542
+ refreshContents();
23032543 } else
2304
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
23052545 {
23062546 GenUV();
23072547 } else
2308
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
23092549 {
23102550 GenNormals(true);
23112551 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2552
+ if (source == genNormalsMESHItem)
2553
+ {
2554
+ GenNormalsMESH();
2555
+ } else
2556
+ if (source == genNormalsORGANItem)
23132557 {
23142558 GenNormals(false);
23152559 } else
2316
- if (event.getSource() == stripifyItem)
2560
+ if (source == genNormalsMINEItem)
2561
+ {
2562
+ GenNormalsMINE();
2563
+ } else
2564
+ if (source == stripifyItem)
23172565 {
23182566 Stripify();
23192567 } else
2320
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
23212569 {
23222570 Unstripify();
23232571 } else
2324
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
23252573 {
23262574 Trim();
23272575 } else
2328
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
23292577 {
23302578 Untrim();
23312579 } else
2332
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
23332581 {
23342582 ClearColors();
23352583 } else
2336
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
23372585 {
23382586 ClearMaterials();
23392587 } else
2340
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
23412589 {
23422590 LiveLeaves(true);
23432591 } else
2344
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
23452593 {
23462594 LiveLeaves(false);
23472595 } else
2348
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
23492597 {
23502598 SupportLeaves(true);
23512599 } else
2352
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
23532601 {
23542602 SupportLeaves(false);
23552603 } else
2356
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
23572605 {
23582606 HideLeaves(true);
23592607 } else
2360
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
23612609 {
23622610 HideLeaves(false);
23632611 } else
2364
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
23652613 {
23662614 MarkLeaves(true);
23672615 } else
2368
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
23692617 {
23702618 MarkLeaves(false);
23712619 } else
2372
- if (event.getSource() == flipVItem)
2620
+ if (source == rewindleavesItem)
2621
+ {
2622
+ RewindLeaves(true);
2623
+ } else
2624
+ if (source == unrewindleavesItem)
2625
+ {
2626
+ RewindLeaves(false);
2627
+ } else
2628
+ if (source == randomleavesItem)
2629
+ {
2630
+ RandomLeaves(true);
2631
+ } else
2632
+ if (source == unrandomleavesItem)
2633
+ {
2634
+ RandomLeaves(false);
2635
+ } else
2636
+ if (source == flipVItem)
23732637 {
23742638 FlipV(true);
23752639 } else
2376
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
23772641 {
23782642 FlipV(false);
23792643 } else
2380
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
23812645 {
23822646 SetTexRes(0);
23832647 } else
2384
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
23852649 {
23862650 SetTexRes(1);
23872651 } else
2388
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
23892653 {
23902654 SetTexRes(2);
23912655 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
23932657 {
23942658 SetTexRes(3);
23952659 } else
2396
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
23972661 {
23982662 SetTexRes(4);
23992663 } else
2400
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
24012665 {
24022666 SetTexRes(5);
24032667 } else
2404
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
24052669 {
24062670 ReverseNormals();
24072671 } else
2408
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
24092673 {
24102674 ParseVertices();
24112675 } else
2412
- if (event.getSource() == textureFieldItem)
2676
+ if (source == textureFieldItem)
24132677 {
24142678 TextureVertices();
24152679 } else
2416
- if (event.getSource() == alignItem)
2680
+ if (source == alignItem)
24172681 {
24182682 Align();
24192683 } else
2420
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
24212685 {
24222686 MirrorPoses();
24232687 } else
2424
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
24252689 {
24262690 MeshReduction(false);
24272691 } else
2428
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
24292693 {
24302694 MeshReduction(true);
24312695 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
24332697 {
24342698 ReverseTriangles();
24352699 } else
2436
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
24372701 {
24382702 ReduceMesh(false);
24392703 } else
2440
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
24412705 {
24422706 ReduceMesh(true);
24432707 } else
2444
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
24452709 {
24462710 IncreaseMesh();
24472711 } else
2448
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
24492713 {
24502714 ClipMesh();
24512715 } else
2452
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
24532717 {
24542718 SmoothMesh();
24552719 } else
2456
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
24572721 {
24582722 TransformGeometry();
24592723 } else
2460
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
24612729 {
24622730 ResetTransform();
24632731 } else
2464
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
24652733 {
2466
- ResetCentroid();
2734
+ ResetCentroid(true);
24672735 } else
2468
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
24692741 {
24702742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712743 {
....@@ -2475,7 +2747,7 @@
24752747
24762748 refreshContents();
24772749 } else
2478
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
24792751 {
24802752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812753 {
....@@ -2489,7 +2761,21 @@
24892761
24902762 refreshContents();
24912763 } else
2492
- if (event.getSource() == sortbysizeItem)
2764
+ if (source == repairShadowItem)
2765
+ {
2766
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2767
+ {
2768
+ Object3D obj = (Object3D)e.nextElement();
2769
+ obj.RepairShadow();
2770
+// for (int i=0; i<obj.size(); i++)
2771
+// {
2772
+// obj.get(i).parent = obj;
2773
+// }
2774
+ }
2775
+
2776
+ refreshContents();
2777
+ } else
2778
+ if (source == sortbysizeItem)
24932779 {
24942780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952781 {
....@@ -2501,7 +2787,7 @@
25012787 ResetModel();
25022788 refreshContents();
25032789 } else
2504
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
25052791 {
25062792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072793 {
....@@ -2513,7 +2799,7 @@
25132799 ResetModel();
25142800 refreshContents();
25152801 } else
2516
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
25172803 {
25182804 String texture = GetFile("Attach pigment");
25192805 Object3D obj;
....@@ -2525,7 +2811,7 @@
25252811
25262812 refreshContents();
25272813 } else
2528
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
25292815 {
25302816 Object3D obj;
25312817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2822,7 @@
25362822
25372823 refreshContents();
25382824 } else
2539
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
25402826 {
25412827 String texture = GetFile("Attach bump");
25422828 Object3D obj;
....@@ -2548,7 +2834,7 @@
25482834
25492835 refreshContents();
25502836 } else
2551
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
25522838 {
25532839 Object3D obj;
25542840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2845,7 @@
25592845
25602846 refreshContents();
25612847 } else
2562
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
25632849 {
25642850 Object3D obj;
25652851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2856,195 @@
25702856
25712857 refreshContents();
25722858 } else
2573
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
25742860 {
25752861 CameraPane.flash = true;
25762862 refreshContents();
25772863 } else
2578
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
25792865 {
25802866 } else
2581
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
25822868 {
25832869 radio.layout = twoButton;
25842870 // bug
25852871 //gridPanel.setDividerLocation(1.0);
25862872 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- bigThree.revalidate();
2873
+// bigThree.remove(scenePanel);
2874
+// bigThree.remove(centralPanel);
2875
+// bigThree.remove(XYZPanel);
2876
+// aWindowConstraints.gridx = 0;
2877
+// aWindowConstraints.gridy = 0;
2878
+// aWindowConstraints.gridwidth = 1;
2879
+// // aConstraints.gridheight = 3;
2880
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2881
+// aWindowConstraints.weightx = 0;
2882
+// aWindowConstraints.weighty = 1;
2883
+// //bigThree.add(jtp, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 1;
2885
+// aWindowConstraints.gridwidth = 3;
2886
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.gridx = 1;
2888
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2889
+// bigThree.add(centralPanel, aWindowConstraints);
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.gridx = 4;
2892
+// aWindowConstraints.gridwidth = 1;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2895
+// //bigThree.add(XYZPanel, aWindowConstraints);
2896
+// scenePanel.setVisible(false);
2897
+// centralPanel.setVisible(true);
2898
+// XYZPanel.setVisible(false);
2899
+ bigThree.ClearUI();
2900
+ bigThree.add(centralPanel);
2901
+ bigThree.FlushUI();
26112902 } else
2612
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
26132904 {
26142905 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- bigThree.revalidate();
2906
+
2907
+// bigThree.remove(scenePanel);
2908
+// bigThree.remove(centralPanel);
2909
+// bigThree.remove(XYZPanel);
2910
+// aWindowConstraints.gridx = 0;
2911
+// aWindowConstraints.gridy = 0;
2912
+// aWindowConstraints.gridwidth = 1;
2913
+// // aConstraints.gridheight = 3;
2914
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2915
+// aWindowConstraints.weightx = 0;
2916
+// aWindowConstraints.weighty = 1;
2917
+// //bigThree.add(jtp, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 1;
2919
+// aWindowConstraints.gridwidth = 3;
2920
+// // aConstraints.gridheight = 3;
2921
+// aWindowConstraints.gridx = 1;
2922
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2923
+// bigThree.add(centralPanel, aWindowConstraints);
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.gridx = 4;
2926
+// aWindowConstraints.gridwidth = 1;
2927
+// // aConstraints.gridheight = 3;
2928
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2929
+// bigThree.add(XYZPanel, aWindowConstraints);
2930
+// bigThree.validate();
2931
+// scenePanel.setVisible(false);
2932
+// centralPanel.setVisible(true);
2933
+// XYZPanel.setVisible(true);
2934
+ bigThree.ClearUI();
2935
+ bigThree.add(centralPanel);
2936
+ bigThree.add(XYZPanel);
2937
+ bigThree.FlushUI();
26392938 } else
2640
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
26412940 {
26422941 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
2942
+
2943
+// bigThree.remove(scenePanel);
2944
+// bigThree.remove(centralPanel);
2945
+// bigThree.remove(XYZPanel);
2946
+// aWindowConstraints.gridx = 0;
2947
+// aWindowConstraints.gridy = 0;
2948
+// aWindowConstraints.gridwidth = 1;
2949
+// // aWindowConstraints.gridheight = 3;
2950
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2951
+// aWindowConstraints.weightx = 1;
2952
+// aWindowConstraints.weighty = 1;
2953
+// bigThree.add(scenePanel, aWindowConstraints);
2954
+// aWindowConstraints.weightx = 1;
2955
+// aWindowConstraints.gridwidth = 3;
2956
+// // aConstraints.gridheight = 3;
2957
+// aWindowConstraints.gridx = 1;
2958
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2959
+// //bigThree.add(cameraPanel, aWindowConstraints);
2960
+// aWindowConstraints.weightx = 0;
2961
+// aWindowConstraints.gridx = 4;
2962
+// aWindowConstraints.gridwidth = 1;
2963
+// // aWindowConstraints.gridheight = 3;
2964
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2965
+// //bigThree.add(XYZPanel, aWindowConstraints);
2966
+// bigThree.validate();
2967
+// scenePanel.setVisible(true);
2968
+// centralPanel.setVisible(false);
2969
+// XYZPanel.setVisible(false);
2970
+ bigThree.ClearUI();
2971
+ bigThree.add(scenePanel);
2972
+ bigThree.FlushUI();
26672973 } else
2668
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
26692975 {
26702976 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- bigThree.revalidate();
2977
+
2978
+// bigThree.remove(scenePanel);
2979
+// bigThree.remove(centralPanel);
2980
+// bigThree.remove(XYZPanel);
2981
+// aWindowConstraints.gridx = 0;
2982
+// aWindowConstraints.gridy = 0;
2983
+// aWindowConstraints.gridwidth = 1;
2984
+// // aConstraints.gridheight = 3;
2985
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2986
+// aWindowConstraints.weightx = 0;
2987
+// aWindowConstraints.weighty = 1;
2988
+// bigThree.add(scenePanel, aWindowConstraints);
2989
+// aWindowConstraints.weightx = 1;
2990
+// aWindowConstraints.gridwidth = 3;
2991
+// // aWindowConstraints.gridheight = 3;
2992
+// aWindowConstraints.gridx = 1;
2993
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2994
+// bigThree.add(centralPanel, aWindowConstraints);
2995
+// aWindowConstraints.weightx = 0;
2996
+// aWindowConstraints.gridx = 4;
2997
+// aWindowConstraints.gridwidth = 1;
2998
+// // aWindowConstraints.gridheight = 3;
2999
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3000
+// //bigThree.add(XYZPanel, aConstraints);
3001
+// bigThree.validate();
3002
+// scenePanel.setVisible(true);
3003
+// centralPanel.setVisible(true);
3004
+// XYZPanel.setVisible(false);
3005
+ bigThree.ClearUI();
3006
+ bigThree.add(scenePanel);
3007
+ bigThree.add(centralPanel);
3008
+ bigThree.FlushUI();
26953009 } else
2696
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
26973011 {
26983012 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
3013
+
3014
+// bigThree.remove(scenePanel);
3015
+// bigThree.remove(centralPanel);
3016
+// bigThree.remove(XYZPanel);
3017
+// aWindowConstraints.gridx = 0;
3018
+// aWindowConstraints.gridy = 0;
3019
+// aWindowConstraints.gridwidth = 1;
3020
+// // aWindowConstraints.gridheight = 3;
3021
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3022
+// aWindowConstraints.weightx = 0;
3023
+// aWindowConstraints.weighty = 1;
3024
+// bigThree.add(scenePanel, aWindowConstraints);
3025
+// aWindowConstraints.weightx = 1;
3026
+// aWindowConstraints.gridwidth = 3;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.gridx = 1;
3029
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3030
+// bigThree.add(centralPanel, aWindowConstraints);
3031
+// aWindowConstraints.weightx = 0;
3032
+// aWindowConstraints.gridx = 4;
3033
+// aWindowConstraints.gridwidth = 1;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3036
+// bigThree.add(XYZPanel, aWindowConstraints);
3037
+// bigThree.validate();
3038
+// scenePanel.setVisible(true);
3039
+// centralPanel.setVisible(true);
3040
+// XYZPanel.setVisible(true);
3041
+ bigThree.ClearUI();
3042
+ bigThree.add(scenePanel);
3043
+ bigThree.add(centralPanel);
3044
+ bigThree.add(XYZPanel);
3045
+ bigThree.FlushUI();
27233046 } else
2724
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
27253048 {
27263049 Object3D obj;
27273050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +3056,7 @@
27333056
27343057 refreshContents(true);
27353058 } else
2736
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
27373060 {
27383061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27393062 cRadio ab;
....@@ -2754,11 +3077,11 @@
27543077 }
27553078 refreshContents(true);
27563079 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
27583081 {
27593082 EditSelection(false);
27603083 } else
2761
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
27623085 {
27633086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27643087 {
....@@ -2768,14 +3091,14 @@
27683091 child.CloseUI();
27693092 listUI.remove(child);
27703093
2771
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
27723095 }
2773
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
27743097 //objEditor.jTree.clearSelection();
27753098 //objEditor.ResetSliders();
27763099 refreshContents(true);
27773100 } else
2778
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
27793102 {
27803103 assert(copy == group);
27813104 //copy.ClearUI();
....@@ -2786,7 +3109,7 @@
27863109 listUI.clear();
27873110 refreshContents(true);
27883111 } else
2789
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
27903113 {
27913114 assert(copy == group);
27923115
....@@ -2807,19 +3130,19 @@
28073130
28083131 refreshContents(true);
28093132 } else
2810
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
28113134 {
28123135 objEditor.jTree.clearSelection();
28133136 // ?? oct 2012 GrafreeD.clipboard.clear();
28143137 objEditor.ResetSliders();
28153138 refreshContents(true);
28163139 } else
2817
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
28183141 {
28193142 group.parent = keepparent;
28203143 group.attributes = 0;
28213144 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
28233146 Object3D obj = radio.GetObject();
28243147 System.out.println("Edit " + obj);
28253148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3162,7 @@
28393162 }
28403163
28413164 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3165
+ //Globals.theRenderer.object = group;
28433166 if(!useclient)
28443167 {
28453168 cameraView.renderCamera = radio.camera;
....@@ -2848,12 +3171,16 @@
28483171 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493172 cameraView.targetLookAt.set(radio.camera.lookAt);
28503173 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3174
+ //cameraView.lighttouched = true;
3175
+ Globals.lighttouched = true;
28523176 topView.object = group;
28533177 frontView.object = group;
28543178 sideView.object = group;
28553179 }
3180
+
3181
+// fix "+" issue
28563182 group.editWindow = this;
3183
+
28573184 /*
28583185 currentLayout = radio.layout;
28593186 if (currentLayout == null)
....@@ -2866,7 +3193,20 @@
28663193 //group.attributes = -1;
28673194 ResetModel();
28683195 refreshContents(true);
2869
- }
3196
+ } else if (event.getSource() == editCameraItem)
3197
+ {
3198
+ cameraView.ProtectCamera();
3199
+ cameraView.repaint();
3200
+ return;
3201
+ } else if (event.getSource() == revertCameraItem)
3202
+ {
3203
+ cameraView.RevertCamera();
3204
+ cameraView.repaint();
3205
+ return;
3206
+ // } else if (event.getSource() == textureButton)
3207
+ // {
3208
+ // return; // true;
3209
+ }
28703210 else
28713211 {
28723212 //return super.action(event, arg);
....@@ -2884,7 +3224,7 @@
28843224 if (useclient)
28853225 {
28863226 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3227
+ Globals.lighttouched = true;
28883228 //topView.object = client;
28893229 //frontView.object = client;
28903230 //sideView.object = client;
....@@ -2892,7 +3232,7 @@
28923232 else
28933233 {
28943234 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3235
+ Globals.lighttouched = true;
28963236 //topView.object = group;
28973237 //frontView.object = group;
28983238 //sideView.object = group;
....@@ -2927,6 +3267,28 @@
29273267 refreshContents();
29283268 }
29293269
3270
+ void TransformChildren()
3271
+ {
3272
+ Object3D obj;
3273
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3274
+ {
3275
+ obj = (Object3D)e.nextElement();
3276
+ obj.KeepTextureMatrices();
3277
+ obj.TransformChildren();
3278
+ obj.RestoreTextureMatrices();
3279
+
3280
+// if (obj.parent == null)
3281
+// {
3282
+// System.out.println("NULL PARENT!");
3283
+// new Exception().printStackTrace();
3284
+// }
3285
+// else
3286
+// TouchTransform(obj);
3287
+// //obj.parent.Touch();
3288
+ }
3289
+
3290
+ refreshContents();
3291
+ }
29303292
29313293 void ResetTransform()
29323294 {
....@@ -3039,7 +3401,7 @@
30393401 refreshContents();
30403402 }
30413403
3042
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
30433405 {
30443406 Object3D obj;
30453407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3054,12 +3416,16 @@
30543416 LA.matIdentity(Object3D.mat);
30553417 obj.getBounds(minima, maxima, false);
30563418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30583421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30593422 obj.TransformMesh(Object3D.mat);
3423
+
30603424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3061
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30623427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
30633429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30643430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30653431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3088,7 +3454,8 @@
30883454
30893455 int size = obj.MemorySize();
30903456
3091
- System.err.println((size/1024) + " KB is the size of " + obj);
3457
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3458
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30923459 }
30933460 }
30943461 catch (Exception e)
....@@ -3125,9 +3492,9 @@
31253492 obj = (Object3D)e.nextElement();
31263493
31273494 System.out.println("Object is: " + obj);
3128
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
31293496 System.out.println("Boundary rep: " + obj.bRep);
3130
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
31313498
31323499 // System.err.println((size/1024) + " KB is the size of " + obj);
31333500 }
....@@ -3169,6 +3536,20 @@
31693536 void GenNormals(boolean crease)
31703537 {
31713538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
3546
+
3547
+ refreshContents();
3548
+ }
3549
+
3550
+ void GenNormalsMINE()
3551
+ {
3552
+ group.selection.GenNormalsMINE();
31723553
31733554 refreshContents();
31743555 }
....@@ -3334,8 +3715,8 @@
33343715
33353716 void ParseVertices()
33363717 {
3337
- boolean epsequal = GrafreeD.epsequal;
3338
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
33393720
33403721 for (int i=0; i<group.selection.size(); i++)
33413722 {
....@@ -3360,7 +3741,7 @@
33603741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33613742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33623743
3363
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
33643745
33653746 buffer.add(g);
33663747 }
....@@ -3375,7 +3756,7 @@
33753756 makeSomething(buffer, i==group.selection.size()-1);
33763757 }
33773758
3378
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
33793760
33803761 refreshContents();
33813762 }
....@@ -3393,7 +3774,16 @@
33933774 String pigment = Object3D.GetPigment(tex);
33943775 //String bump = Object3D.GetBump(tex);
33953776
3396
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3777
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3778
+
3779
+ try
3780
+ {
3781
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3782
+ }
3783
+ catch (Exception e)
3784
+ {
3785
+ System.err.println("FAIL: " + node);
3786
+ }
33973787
33983788 double s = v.s;
33993789
....@@ -3441,12 +3831,26 @@
34413831
34423832 void Align()
34433833 {
3834
+ if (group.selection.size() == 0)
3835
+ return;
3836
+
3837
+ cVector bbmin = new cVector();
3838
+ cVector bbmax = new cVector();
3839
+
3840
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3841
+
3842
+ double dx = bbmax.x - bbmin.x;
3843
+ double dy = bbmax.y - bbmin.y;
3844
+ double dz = bbmax.z - bbmin.z;
3845
+
3846
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3847
+
34443848 for (int i=0; i<group.selection.size(); i++)
34453849 {
34463850 Object3D obj = group.selection.get(i);
34473851
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3852
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3853
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503854 }
34513855
34523856 refreshContents();
....@@ -3467,11 +3871,11 @@
34673871
34683872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693873
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
34723876 lowres.linkVerticesThis(null);
34733877 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
34753879
34763880 System.err.flush();
34773881
....@@ -3511,7 +3915,7 @@
35113915 return;
35123916
35133917 Object3D poses = group.selection.get(0);
3514
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
35153919
35163920 Object3D newgroup = new Object3D("Po:" + poses.name);
35173921
....@@ -3680,7 +4084,7 @@
36804084 group.selection.RelinkToSupport(); // july 2014
36814085 System.out.println("DONE.");
36824086 refreshContents();
3683
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4087
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36844088 }
36854089
36864090 void ReduceMesh(boolean reduction34)
....@@ -3705,9 +4109,9 @@
37054109
37064110 void ClipMesh()
37074111 {
3708
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37094113 {
3710
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
37114115
37124116 if (content instanceof cGroup && ((cGroup)content).transientlink )
37134117 content = ((cGroup)content).get(0);
....@@ -3716,7 +4120,7 @@
37164120 // {
37174121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37184122 // }
3719
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
37204124 }
37214125 // group.selection.ClipMesh(GrafreeD.clipboard);
37224126 System.out.println("DONE.");
....@@ -3763,6 +4167,18 @@
37634167 void MarkLeaves(boolean hide)
37644168 {
37654169 group.selection.MarkLeaves(hide);
4170
+ refreshContents();
4171
+ }
4172
+
4173
+ void RewindLeaves(boolean hide)
4174
+ {
4175
+ group.selection.RewindLeaves(hide);
4176
+ refreshContents();
4177
+ }
4178
+
4179
+ void RandomLeaves(boolean hide)
4180
+ {
4181
+ group.selection.RandomLeaves(hide);
37664182 refreshContents();
37674183 }
37684184
....@@ -3851,7 +4267,7 @@
38514267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38524268
38534269 Object3D elem = (Object3D)group.selection.elementAt(i);
3854
- if(elem != group)
4270
+ if(elem != group || !newWindow)
38554271 {
38564272 // if (!(elem instanceof Composite))
38574273 // newWindow = false;
....@@ -3941,7 +4357,6 @@
39414357 //case 702: // Event.LIST_DESELECT
39424358 group.deselectAll();
39434359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3944
- objEditor.ClearInfo(); // .GetMaterial());
39454360 if (tps != null)
39464361 {
39474362 for (int i=0; i < tps.length; i++)
....@@ -3950,31 +4365,30 @@
39504365
39514366 //if (child.parent != null)
39524367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
39534369 group.addSelectee(child);
3954
- objEditor.SetMaterial(child); // .GetMaterial());
3955
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3956
- System.err.println("info : " + child.GetPath());
39574370 }
39584371 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
39654378
3966
- objEditor.SetText(); // jan 2014
3967
-
3968
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4379
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39694380 CameraPane.flash = true;
39704381
3971
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39724383 // a camera
39734384 {
3974
- CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4385
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4386
+ {
4387
+ CameraPane.camerachangeframe = 0; // don't refuse it
4388
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4389
+ }
4390
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4391
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784392 }
39794393
39804394 refreshContents();
....@@ -3985,6 +4399,26 @@
39854399
39864400 freezemodel = false;
39874401 }
4402
+
4403
+ void refreshContents(boolean cp)
4404
+ {
4405
+ if (!Globals.MOUSEDRAGGED)
4406
+ {
4407
+ objEditor.ClearInfo(); // .GetMaterial());
4408
+
4409
+ for (int i=0; i < group.selection.Size(); i++)
4410
+ {
4411
+ Object3D child = (Object3D) group.selection.get(i);
4412
+
4413
+ objEditor.AddInfo(child, this, true);
4414
+ System.err.println("info : " + child.GetPath());
4415
+ }
4416
+
4417
+ objEditor.SetText(); // jan 2014
4418
+ }
4419
+
4420
+ super.refreshContents(cp);
4421
+ }
39884422
39894423 void linkSomething(Object3D thing)
39904424 {
....@@ -4056,16 +4490,18 @@
40564490 {
40574491 if (group.selection.isEmpty())
40584492 return;
4059
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
40604495 Composite tGroup = null;
40614496 if (group.selection.size() > 0) // 1)
40624497 {
40634498 tGroup = new cGroup();
4064
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
40654500 }
40664501
40674502 if (cut)
40684503 {
4504
+ Save();
40694505 //int indices[] = jList.getSelectedIndices();
40704506 //for (int i = indices.length - 1; i >= 0; i--)
40714507 //jList.remove(indices[i]);
....@@ -4101,16 +4537,16 @@
41014537 //System.out.println("cut " + child);
41024538 //System.out.println("parent = " + child.parent);
41034539 // tmp.addChild(child);
4104
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
41054541 tGroup.add/*Child*/(tmp);
41064542 else
4107
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
41084544 }
41094545 else
4110
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
41114547 tGroup.add/*Child*/(child);
41124548 else
4113
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
41144550 }
41154551
41164552 //ResetModel();
....@@ -4142,21 +4578,23 @@
41424578 //System.out.println("cut " + elem);
41434579 //System.out.println("parent = " + elem.parent);
41444580 // tmp.addChild(elem);
4145
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
41464582 tGroup.add/*Child*/(tmp);
41474583 else
4148
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
41494585 }
41504586 else
4151
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
41524588 tGroup.add/*Child*/(child);
41534589 else
4154
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
41554591 }
41564592
41574593 }
4158
- if (GrafreeD.clipboardIsTempGroup)
4159
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
41604598 if (cut)
41614599 {
41624600 ResetModel();
....@@ -4170,7 +4608,7 @@
41704608 // return;
41714609 boolean first = true;
41724610
4173
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
41744612 {
41754613 Composite temp;
41764614
....@@ -4181,7 +4619,7 @@
41814619 temp = (Composite)Applet3D.clipboard.deepCopy();
41824620 */
41834621 Object3D elem;
4184
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4622
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41854623 {
41864624 Object3D child = (Object3D)e.nextElement();
41874625
....@@ -4215,21 +4653,21 @@
42154653 //Object3D cb = Applet3D.clipboard;
42164654 //temp.addChild(cb);
42174655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4218
- assert(GrafreeD.clipboard.parent == null);
4219
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4656
+ assert(Grafreed.clipboard.parent == null);
4657
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4658
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4659
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4660
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42234661 else
4224
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
42264664 }
42274665
42284666 ResetModel();
42294667 refreshContents();
42304668 }
42314669
4232
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
42334671 {
42344672 // if (GrafreeD.clipboard == null)
42354673 // return;
....@@ -4258,15 +4696,22 @@
42584696 if (copyit)
42594697 {
42604698 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
42624707 }
42634708 else
42644709 {
42654710 boolean first = true;
42664711
4267
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
42684713 {
4269
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
42704715 Object3D copy;
42714716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42724717 {
....@@ -4276,7 +4721,7 @@
42764721 }
42774722 } else
42784723 {
4279
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
42804725 }
42814726 }
42824727 }
....@@ -4468,6 +4913,26 @@
44684913 makeSomething(csg);
44694914 }
44704915
4916
+ void Ungroup(Object3D g)
4917
+ {
4918
+ if (g instanceof HiddenObject)
4919
+ {
4920
+ HiddenObject h = (HiddenObject) g;
4921
+
4922
+ for (int i=0; i<h.ActualSize(); i++)
4923
+ {
4924
+ objEditor.makeSomething(h.get(i), false);
4925
+ }
4926
+ }
4927
+ else
4928
+ {
4929
+ for (int i=0; i<g.Size(); i++)
4930
+ {
4931
+ objEditor.makeSomething(g.get(i), false);
4932
+ }
4933
+ }
4934
+ }
4935
+
44714936 void ungroup()
44724937 {
44734938 /*
....@@ -4661,21 +5126,6 @@
46615126 }
46625127 */
46635128
4664
- void ImportGFD()
4665
- {
4666
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4667
- browser.show();
4668
- String filename = browser.getFile();
4669
- if (filename != null && filename.length() > 0)
4670
- {
4671
- String fullname = browser.getDirectory() + filename;
4672
-
4673
- //Object3D readobj =
4674
- objEditor.ReadGFD(fullname, objEditor);
4675
- //makeSomething(readobj);
4676
- }
4677
- }
4678
-
46795129 /*
46805130 public void Callback(Object obj)
46815131 {
....@@ -4699,26 +5149,9 @@
46995149 }
47005150 */
47015151
4702
- void ImportVRMLX3D()
4703
- {
4704
- if (GrafreeD.standAlone)
4705
- {
4706
- /**/
4707
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4708
- browser.show();
4709
- String filename = browser.getFile();
4710
- if (filename != null && filename.length() > 0)
4711
- {
4712
- String fullname = browser.getDirectory() + filename;
4713
- LoadVRMLX3D(fullname);
4714
- }
4715
- /**/
4716
- }
4717
- }
4718
-
47195152 String GetFile(String dialogName)
47205153 {
4721
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
47225155 {
47235156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47245157 browser.show();
....@@ -4782,10 +5215,15 @@
47825215 cButton flashSelectionButton;
47835216 cButton editButton;
47845217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
47855219 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875220 cButton unselectButton;
47885221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
47895227 cButton screenfitButton;
47905228 cButton screenfitpointButton;
47915229 cButton snapobjectButton;
....@@ -4816,6 +5254,8 @@
48165254 private MenuItem lookFromItem;
48175255 private MenuItem switchItem;
48185256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
48195259 private MenuItem duplicateItem;
48205260 private MenuItem cloneItem;
48215261 private MenuItem cloneSupportItem;
....@@ -4827,8 +5267,9 @@
48275267 private MenuItem resetsupportItem;
48285268 private MenuItem resetreferencesItem;
48295269 private MenuItem linkverticesItem;
5270
+ private MenuItem relinkverticesItem;
48305271 private MenuItem setMasterItem;
4831
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
48325273 private MenuItem stepAllItem;
48335274 private MenuItem revertMeshItem;
48345275 private MenuItem poseMeshItem;
....@@ -4839,14 +5280,17 @@
48395280 private MenuItem mergeGeometriesItem;
48405281 private MenuItem copyItem;
48415282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
48425284 private MenuItem pasteLinkItem;
48435285 private MenuItem pasteCloneItem;
48445286 private MenuItem pasteExpandItem;
48455287 private MenuItem clearItem;
48465288 private MenuItem clearAllItem;
48475289 private MenuItem genUVItem;
5290
+ private MenuItem genNormalsMESHItem;
48485291 private MenuItem genNormalsCADItem;
48495292 private MenuItem genNormalsORGANItem;
5293
+ private MenuItem genNormalsMINEItem;
48505294 private MenuItem stripifyItem;
48515295 private MenuItem unstripifyItem;
48525296 private MenuItem trimItem;
....@@ -4875,6 +5319,10 @@
48755319 private MenuItem showleavesItem;
48765320 private MenuItem markleavesItem;
48775321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
48785326
48795327 private MenuItem flipVItem;
48805328 private MenuItem unflipVItem;
....@@ -4886,8 +5334,11 @@
48865334 private MenuItem panoTexturesItem;
48875335
48885336 private MenuItem resetCentroidItem;
4889
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
48905338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
5341
+ private MenuItem hideItem;
48915342 private MenuItem grabItem;
48925343 private MenuItem backItem;
48935344 private MenuItem frontItem;
....@@ -4908,6 +5359,7 @@
49085359
49095360 private MenuItem resetParentItem;
49105361 private MenuItem repairParentItem;
5362
+ private MenuItem repairShadowItem;
49115363 private MenuItem sortbysizeItem;
49125364 private MenuItem sortbynameItem;
49135365
....@@ -4928,10 +5380,11 @@
49285380 private MenuItem coneItem;
49295381 private MenuItem torusItem;
49305382 private MenuItem superItem;
5383
+ private MenuItem kleinItem;
49315384 private MenuItem blobItem;
49325385 private MenuItem latheItem;
49335386 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
49355388 private MenuItem meshItem;
49365389 // private MenuItem meshGroupItem;
49375390 private MenuItem springItem;
....@@ -4940,6 +5393,7 @@
49405393 private MenuItem csgItem;
49415394 private MenuItem templateItem;
49425395 private MenuItem textureItem;
5396
+ private MenuItem billboardItem;
49435397 private MenuItem shadowXItem;
49445398 private MenuItem shadowYItem;
49455399 private MenuItem shadowZItem;
....@@ -4952,11 +5406,6 @@
49525406 private MenuItem doubleItem;
49535407 private MenuItem tripleItem;
49545408
4955
- private MenuItem importGFDItem;
4956
- private MenuItem importVRMLX3DItem;
4957
- private MenuItem import3DSItem;
4958
- private MenuItem importOBJItem;
4959
-
49605409 private MenuItem computeAOItem;
49615410 private MenuItem recompileItem;
49625411 private MenuItem editScriptItem;
....@@ -4966,4 +5415,8 @@
49665415 private MenuItem analyzeItem;
49675416 private MenuItem dumpItem;
49685417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
49695422 }