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,19 +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);
222320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
224325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225326 setMasterItem.addActionListener(this);
327
+ }
226328
227329 oe.menuBar.add(menu = new Menu("Group"));
228330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +335,32 @@
233335 frontItem.addActionListener(this);
234336 compositeItem = menu.add(new MenuItem("Composite"));
235337 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237339 hideItem.addActionListener(this);
238340 ungroupItem = menu.add(new MenuItem("Ungroup"));
239341 ungroupItem.addActionListener(this);
240342 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
242344 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248346 switchGeoItem.addActionListener(this);
249347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250348 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
252350 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);
253359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254360 scriptNodeItem.addActionListener(this);
255361 cameraItem = menu.add(new MenuItem("Camera"));
256362 cameraItem.addActionListener(this);
363
+ }
257364
258365 oe.menuBar.add(menu = new Menu("Object"));
259366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +375,29 @@
268375 shadowYItem.addActionListener(this);
269376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
271381 linkerItem = menu.add(new MenuItem("Linker"));
272382 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275383 attributeItem = menu.add(new MenuItem("Attribute"));
276384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
277387 pointflowItem = menu.add(new MenuItem("Point Flow"));
278388 pointflowItem.addActionListener(this);
389
+ }
279390 menu.add("-");
280391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281392 resetTransformItem.addActionListener(this);
282393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283394 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.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);
286401
287402 oe.menuBar.add(menu = new Menu("Geometry"));
288403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +408,11 @@
293408 genNormalsCADItem.addActionListener(this);
294409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
296413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297414 genNormalsMINEItem.addActionListener(this);
415
+ }
298416 stripifyItem = menu.add(new MenuItem("Stripify"));
299417 stripifyItem.addActionListener(this);
300418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +434,34 @@
316434 reduce34MeshItem.addActionListener(this);
317435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318436 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
323445
324446 oe.menuBar.add(menu = new Menu("Attributes"));
325447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326448 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);
327453 menu.add("-");
328454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329455 liveleavesItem.addActionListener(this);
330456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
332460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333461 supportleavesItem.addActionListener(this);
334462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335463 unsupportleavesItem.addActionListener(this);
464
+ }
336465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337466 hideleavesItem.addActionListener(this);
338467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +470,14 @@
341470 markleavesItem.addActionListener(this);
342471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343472 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);
344481 menu.add("-");
345482 flipVItem = menu.add(new MenuItem("Flip V"));
346483 flipVItem.addActionListener(this);
....@@ -376,29 +513,22 @@
376513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377514 sortbynameItem.addActionListener(this);
378515 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.
379523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380524 extractGeometriesItem.addActionListener(this);
381525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382526 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
527
+ }
387528
388529 oe.menuBar.add(menu = new Menu("Insert"));
389530 buildCreateMenu(menu);
390531
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402532 oe.menuBar.add(menu = new Menu("Tools"));
403533 buildToolsMenu(menu);
404534 }
....@@ -433,153 +563,110 @@
433563 oe.radioPanel.add(dummyButton);
434564 oe.buttonGroup.add(dummyButton);
435565 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
566
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439567
440
- 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");
441582 liveCB.addItemListener(this);
442583
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- 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");
461590 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- 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");
503594 trackCB.addItemListener(this);
504595
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ screenfitButton.setToolTipText("Screen fit");
507598 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
599
+
509600 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510601 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515602
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- 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");
522612 flashSelectionButton.addActionListener(this);
523613
524
- oe.toolbarPanel.add(new cButton(" ", false));
614
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525615
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ twoButton.setToolTipText("Show center view only");
532618 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534620 fourButton.addActionListener(this);
535
- 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");
536624 sixButton.addActionListener(this);
537
- 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");
538627 threeButton.addActionListener(this);
539
- 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");
540630 sevenButton.addActionListener(this);
541631 //
542632
543
- 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");
544635 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- 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");
547639 closeButton.addActionListener(this);
548640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549641 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551642
552
- oe.aConstraints.gridx = 1; //
553
- 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");
554647 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558648
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
560651 uneditButton.addActionListener(this);
561652
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- 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");
574655 allParamsButton.addActionListener(this);
575656
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- 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");
581663 unselectButton.addActionListener(this);
582664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
583670 // oe.aConstraints.gridx += 1;
584671 // oe.aConstraints.weighty = 0;
585672 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +678,37 @@
591678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592679 // gcButton.addActionListener(this);
593680
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
605684 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- 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);
607686 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
612690
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- 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");
617695 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620699 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- 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");
623703 textureCB.addItemListener(this);
624704
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
627708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
628712 //jList.addListSelectionListener(this);
629713 oe.jTree.addTreeSelectionListener(this);
630714 //jTree.setRootVisible(false);
....@@ -646,18 +730,91 @@
646730 radio.layout = sevenButton;
647731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648732 }
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
+ }
649805
650806 void EditObject(Object3D obj)
651807 {
652
- cRadio dummyButton = new cRadio(obj.name);
653
- dummyButton.SetObject(obj);
654
- dummyButton.layout = sevenButton;
655
- dummyButton.SetCamera(cameraView.renderCamera, false);
656
- dummyButton.addActionListener(this);
657
- radioPanel.add(dummyButton);
658
- buttonGroup.add(dummyButton);
659
- 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();
660816 }
817
+
661818 void SetupViews(ObjEditor oe)
662819 {
663820 oe.SetupViews();
....@@ -676,6 +833,7 @@
676833 JCheckBox fastCB;
677834 JCheckBox slowCB;
678835 JCheckBox boxCB;
836
+ JCheckBox zoomBoxCB;
679837 JCheckBox trackCB;
680838 JCheckBox smoothfocusCB;
681839 // JCheckBox speakerMocapCB;
....@@ -721,6 +879,7 @@
721879 } else if(e.getSource() == liveCB)
722880 {
723881 cameraView.ToggleLive();
882
+ refreshContents(false);
724883 }
725884 else if(e.getSource() == supportCB)
726885 {
....@@ -755,6 +914,10 @@
755914 Recompile();
756915 cameraView.repaint();
757916 // refreshContents();
917
+ }
918
+ else if(e.getSource() == zoomBoxCB)
919
+ {
920
+ cameraView.ToggleZoomBoxMode();
758921 }
759922 else if(e.getSource() == smoothfocusCB)
760923 {
....@@ -869,7 +1032,9 @@
8691032 // objEditor.DropFile((java.io.File[]) object, true);
8701033 // return;
8711034 // }
872
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731038 {
8741039 // file(s)
8751040 String[] names = string.split("\n");
....@@ -896,7 +1061,7 @@
8961061
8971062 flashIt = false;
8981063 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011066
9021067 if (group.selection.size() == 1)
....@@ -923,11 +1088,11 @@
9231088 {
9241089 loadClipboard(true);
9251090 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1091
+ pasteInto(false, false);
9271092 } else {
9281093 loadClipboard(false);
9291094 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9311096 }
9321097 }
9331098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1214,33 @@
10491214 kleinItem.addActionListener(this);
10501215 particleItem = menu.add(new MenuItem("Particle system"));
10511216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10521219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531220 ragdollItem.addActionListener(this);
10541221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551222 ragdoll2Item.addActionListener(this);
1223
+ }
10561224 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581226 meshItem.addActionListener(this);
10591227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10611231 springItem = menu.add(new MenuItem("Spring"));
10621232 springItem.addActionListener(this);
10631233 flagItem = menu.add(new MenuItem("Flag"));
10641234 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691235 blobItem = menu.add(new MenuItem("Blob"));
10701236 blobItem.addActionListener(this);
10711237 latheItem = menu.add(new MenuItem("Lathe"));
10721238 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);
10731244 lightItem = menu.add(new MenuItem("Light"));
10741245 lightItem.addActionListener(this);
10751246 menu.add("-");
....@@ -1079,39 +1250,44 @@
10791250 loopItem.addActionListener(this);
10801251 doubleItem = menu.add(new MenuItem("Fork"));
10811252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
10821255 tripleItem = menu.add(new MenuItem("Trident"));
10831256 tripleItem.addActionListener(this);
1257
+ }
10841258 }
10851259
10861260 void buildToolsMenu(Menu menu)
10871261 {
10881262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891263 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
10911265
10921266 menu.add("-");
10931267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941268 parseverticesItem.addActionListener(this);
10951269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961270 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981272 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021274 reduceMorphItem.addActionListener(this);
11031275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041276 reduce34MorphItem.addActionListener(this);
1105
-
1277
+ menu.add("-");
11061278 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071279 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
11101286 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111287 memoryItem.addActionListener(this);
11121288 menu.add(analyzeItem = new MenuItem("Analyze"));
11131289 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11151291 dumpItem.addActionListener(this);
11161292 // menu.add(pathItem = new MenuItem("From-to path"));
11171293 // pathItem.addActionListener(this);
....@@ -1120,6 +1296,8 @@
11201296 resetParentItem.addActionListener(this);
11211297 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221298 repairParentItem.addActionListener(this);
1299
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1300
+ repairShadowItem.addActionListener(this);
11231301 menu.add(invariantsItem = new MenuItem("Invariants"));
11241302 invariantsItem.addActionListener(this);
11251303 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1305,7 @@
11271305 menu.add("-");
11281306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291307 editScriptItem.addActionListener(this);
1308
+ }
11301309 }
11311310
11321311 void ScreenFit()
....@@ -1455,9 +1634,9 @@
14551634
14561635 void Overwrite(int mask)
14571636 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591638 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14611640
14621641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631642 content = ((cGroup)content).get(0);
....@@ -1480,6 +1659,7 @@
14801659 //
14811660 public void actionPerformed(ActionEvent event) // , Object arg)
14821661 {
1662
+ Object source = event.getSource();
14831663 /*
14841664 if (event.getSource() == nameField)
14851665 {
....@@ -1491,11 +1671,11 @@
14911671 }
14921672 else
14931673 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
14951675 {
14961676 ScreenFit();
14971677 } else
1498
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
14991679 {
15001680 cVector v1 = new cVector();
15011681 cVector v2 = new cVector();
....@@ -1504,11 +1684,11 @@
15041684 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051685 objEditor.cameraView.repaint();
15061686 } else
1507
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
15081688 {
15091689 makeSomething(new Box());
15101690 } else
1511
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
15121692 {
15131693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1709,9 @@
15291709 applyExample(particleGeom, "SMOKE");
15301710 makeSomething(particleGeom);
15311711 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15331713 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351715
15361716 ragdoll.toParent = LA.newMatrix();
15371717 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1729,7 @@
15491729 } else
15501730 /*
15511731 */
1552
- if (event.getSource() == heightFieldItem)
1732
+ if (source == heightFieldItem)
15531733 {
15541734 Object3D obj = new Object3D();
15551735
....@@ -1587,31 +1767,31 @@
15871767
15881768 makeSomething(obj);
15891769 } else
1590
- if (event.getSource() == gridItem)
1770
+ if (source == gridItem)
15911771 {
15921772 makeSomething(new Grid());
15931773 } else
1594
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
15951775 {
15961776 makeSomething(new Sphere());
15971777 } else
1598
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
15991779 {
16001780 makeSomething(new Cone());
16011781 } else
1602
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
16031783 {
16041784 makeSomething(new Torus());
16051785 } else
1606
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
16071787 {
16081788 makeSomething(new Superellipsoid());
16091789 } else
1610
- if (event.getSource() == kleinItem)
1790
+ if (source == kleinItem)
16111791 {
16121792 makeSomething(new Klein());
16131793 } else
1614
- if (event.getSource() == blobItem)
1794
+ if (source == blobItem)
16151795 {
16161796 Blob blob = new Blob();
16171797 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1799,15 @@
16191799 //blob.retile();
16201800 makeSomething(blob);
16211801 } else
1622
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
16231803 {
16241804 makeSomething(new Lathe());
16251805 } else
1626
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
16271807 {
16281808 makeSomething(new BezierSurface());
16291809 } else
1630
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
16311811 {
16321812 /*
16331813 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1822,7 @@
16421822 */
16431823 makeSomething(new Checker());
16441824 } else
1645
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
16461826 {
16471827 Object3D itemtomake = new Object3D();
16481828 Object3D child;
....@@ -1663,35 +1843,35 @@
16631843 makeSomething(child);
16641844 }
16651845 } else
1666
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
16671847 {
16681848 cSpring s = new cSpring();
16691849 s.setup();
16701850 makeSomething(s);
16711851 } else
1672
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
16731853 {
16741854 cSpring s = new cFlag();
16751855 s.setup();
16761856 makeSomething(s);
16771857 } else
1678
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
16791859 {
16801860 makeSomething(new Light());
16811861 } else
1682
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
16831863 {
16841864 group(new CSG());
16851865 } else
1686
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
16871867 {
16881868 group(new cTemplate());
16891869 } else
1690
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
16911871 {
16921872 makeSomething(new Attribute());
16931873 } else
1694
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
16951875 {
16961876 makeSomething(new PointFlow());
16971877 } else
....@@ -1703,7 +1883,7 @@
17031883 } else
17041884 */
17051885
1706
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
17071887 {
17081888 Composite g = new cGroup();
17091889 for (int i=0; i<15; i++)
....@@ -1725,7 +1905,7 @@
17251905
17261906 group(g);
17271907 } else
1728
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
17291909 {
17301910 Composite csg = new GroupLeaf();
17311911 csg.count = 5;
....@@ -1734,7 +1914,7 @@
17341914 csg.addChild(child);
17351915 child.addChild(csg);
17361916 } else
1737
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
17381918 {
17391919 Composite csg = new GroupLeaf();
17401920 csg.count = 5;
....@@ -1746,7 +1926,7 @@
17461926 csg.addChild(child);
17471927 child.addChild(csg);
17481928 } else
1749
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
17501930 {
17511931 Composite csg = new GroupLeaf();
17521932 csg.count = 4;
....@@ -1761,71 +1941,71 @@
17611941 csg.addChild(child);
17621942 child.addChild(csg);
17631943 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
1944
+ if (source == computeAOItem)
17661945 {
1767
- ImportGFD();
1946
+ Globals.drawMode = CameraPane.OCCLUSION;
1947
+ Globals.theRenderer.repaint();
17681948 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1770
- {
1771
- ImportVRMLX3D();
1772
- } else
1773
- if (event.getSource() == import3DSItem)
1774
- {
1775
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1776
- } else
1777
- if (event.getSource() == importOBJItem)
1778
- {
1779
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1780
- } else
1781
- if (event.getSource() == computeAOItem)
1782
- {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1785
- } else
1786
- if (event.getSource() == recompileItem)
1949
+ if (source == recompileItem)
17871950 {
17881951 Recompile();
17891952 refreshContents();
17901953 } else
1791
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
17921955 {
17931956 OpenDialog();
17941957 refreshContents();
17951958 } else
1796
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
17971960 {
17981961 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
18001963 } else
1801
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
18021965 {
18031966 //System.out.println("Invariants:");
18041967 PrintMemory();
18051968 } else
1806
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
18071970 {
18081971 PrintPath();
18091972 } else
1810
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
18111974 {
18121975 AnalyzeObject();
18131976 } else
1814
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
18151978 {
18161979 DumpObject();
18171980 } else
1818
- 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)
18191999 {
18202000 //Reload(lastConverter, lastFilename, true);
18212001 ScreenFit();
18222002 } else
1823
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
18242004 {
18252005 //Reload(lastConverter, lastFilename, true);
18262006 ScreenFitPoint();
18272007 } else
1828
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
18292009 {
18302010 //Reload(lastConverter, lastFilename, true);
18312011 SnapObject();
....@@ -1836,13 +2016,13 @@
18362016 // Recompile();
18372017 // refreshContents();
18382018 // } else
1839
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
18402020 {
18412021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422022 System.gc();
18432023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442024 } else
1845
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
18462026 {
18472027 Object3D obj;
18482028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +2036,74 @@
18562036 }
18572037 refreshContents(true);
18582038 } else
1859
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
18602040 {
18612041 EditSelection(true);
18622042 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
18642044 {
18652045 loadClipboard(true);
18662046 } else
1867
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
18682048 {
1869
- 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;
18702058 loadClipboard(false);
18712059 paste(false);
1872
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
18732061 } else
1874
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
18752063 {
18762064 CloneSelection(false);
18772065 } else
1878
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
18792067 {
18802068 CloneSelection(true);
18812069 } else
1882
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
18832071 {
18842072 loadClipboard(false);
18852073 } else
1886
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
18872075 {
18882076 paste(false);
18892077 } else
1890
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
18912079 {
1892
- pasteInto(false);
2080
+ pasteInto(true, false);
18932081 } else
1894
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
18952083 {
1896
- pasteInto(true);
2084
+ pasteInto(false, false);
18972085 } else
1898
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
18992091 {
19002092 paste(true);
19012093 } else
1902
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
19032095 {
19042096 Overwrite(Object3D.TRANSFORM);
19052097 } else
1906
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
19072099 {
19082100 Overwrite(Object3D.NAME);
19092101 } else
1910
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
19112103 {
19122104 Overwrite(Object3D.UV);
19132105 } else
1914
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
19152107 {
19162108 /* july 2015
19172109 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2123,7 @@
19312123
19322124 Overwrite(dropAttributes);
19332125 }
1934
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
19352127 {
19362128 Overwrite(Object3D.GEOMETRY);
19372129 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2140,7 @@
19482140 // refreshContents();
19492141 // }
19502142 } else
1951
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
19522144 {
19532145 //if (group.selection.size() == 1)
19542146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2151,7 @@
19592151 ResetModel();
19602152 refreshContents();
19612153 } else
1962
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
19632155 {
19642156 boolean one = false;
19652157
....@@ -1986,7 +2178,7 @@
19862178 ResetModel();
19872179 refreshContents();
19882180 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
19902182 {
19912183 boolean one = false;
19922184
....@@ -2012,7 +2204,7 @@
20122204 ResetModel();
20132205 refreshContents();
20142206 } else
2015
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
20162208 {
20172209 boolean one = false;
20182210
....@@ -2042,7 +2234,7 @@
20422234 refreshContents();
20432235 }
20442236 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
20462238 {
20472239 boolean one = false;
20482240
....@@ -2072,7 +2264,7 @@
20722264 ResetModel();
20732265 refreshContents();
20742266 } else
2075
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
20762268 {
20772269 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782270 // {
....@@ -2085,48 +2277,48 @@
20852277 // group.selection.get(0).setMasterThis(content); // should be identity
20862278 // refreshContents();
20872279 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892281 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
20912283
20922284 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932285 content = ((cGroup)content).get(0);
20942286
2095
- 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));
20962288 for (int i=0; i<group.selection.size(); i++)
20972289 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
21002292 group.selection.get(i).linkVerticesThis(content);
21012293 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
21032295 }
2104
- 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));
21052297 refreshContents();
21062298 }
21072299 } else
2108
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
21092301 {
21102302 for (int i=0; i<group.selection.size(); i++)
21112303 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
21142306 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
21162308 }
21172309
21182310 refreshContents();
21192311 } else
2120
- if (event.getSource() == relinkverticesItem)
2312
+ if (source == relinkverticesItem)
21212313 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
21242316 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2317
+ CameraPane.SWITCH = random;
21262318
21272319 refreshContents();
21282320 } else
2129
- if (event.getSource() == resetreferencesItem)
2321
+ if (source == resetreferencesItem)
21302322 {
21312323 for (int i=0; i<group.selection.size(); i++)
21322324 {
....@@ -2135,11 +2327,11 @@
21352327
21362328 refreshContents();
21372329 } else
2138
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
21392331 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412333 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21432335
21442336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452337 content = ((cGroup)content).get(0);
....@@ -2148,13 +2340,13 @@
21482340 refreshContents();
21492341 }
21502342 } else
2151
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
21522344 {
21532345 if (group.selection.size() == 1)
21542346 {
2155
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21562348 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21582350
21592351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602352 content = ((cGroup)content).get(0);
....@@ -2167,19 +2359,19 @@
21672359 }
21682360
21692361 } else
2170
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
21712363 {
21722364 RevertMeshes();
21732365 } else
2174
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
21752367 {
21762368 ResetAll();
21772369 } else
2178
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
21792371 {
21802372 StepAll();
21812373 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
21832375 {
21842376 //int indices[] = jList.getSelectedIndices();
21852377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2379,46 @@
21872379
21882380 ClearSelection(false);
21892381 } else
2190
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
21912383 {
21922384 ClearSelection(true);
21932385 } else
2194
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
21952387 {
21962388 group(new cGroup(), true);
21972389 } else
2198
- if (event.getSource() == hideItem)
2390
+ if (source == hideItem)
21992391 {
22002392 group(new HiddenObject());
22012393 } else
2202
- if (event.getSource() == frontItem)
2394
+ if (source == frontItem)
22032395 {
22042396 front();
22052397 } else
2206
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
22072399 {
22082400 back();
22092401 } else
2210
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
22112403 {
22122404 makeSomething(new Camera());
22132405 } else
2214
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
22152407 {
22162408 group(new Composite());
22172409 } else
2218
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
22192411 {
22202412 RandomNode random = new RandomNode();
22212413 group(random);
22222414 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
22242416 } else
2225
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
22262418 {
22272419 group(new PhysicsNode());
22282420 } else
2229
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
22302422 {
22312423 for (int i=0; i<group.selection.size(); i++)
22322424 {
....@@ -2238,7 +2430,7 @@
22382430 ResetModel();
22392431 refreshContents();
22402432 } else
2241
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
22422434 {
22432435 for (int i=0; i<group.selection.size(); i++)
22442436 {
....@@ -2250,7 +2442,7 @@
22502442 ResetModel();
22512443 refreshContents();
22522444 } else
2253
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
22542446 {
22552447 for (int i=0; i<group.selection.size(); i++)
22562448 {
....@@ -2262,7 +2454,7 @@
22622454 ResetModel();
22632455 refreshContents();
22642456 } else
2265
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
22662458 {
22672459 for (int i=0; i<group.selection.size(); i++)
22682460 {
....@@ -2274,7 +2466,7 @@
22742466 ResetModel();
22752467 refreshContents();
22762468 } else
2277
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
22782470 {
22792471 boolean atleastone = false;
22802472
....@@ -2313,31 +2505,31 @@
23132505 }
23142506 }
23152507 } else
2316
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
23172509 {
23182510 group(new cLinker());
23192511 } else
2320
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
23212513 {
23222514 group(new TextureNode());
23232515 } else
2324
- if (event.getSource() == billboardItem)
2516
+ if (source == billboardItem)
23252517 {
23262518 group(new BillboardNode());
23272519 } else
2328
- if (event.getSource() == shadowXItem)
2520
+ if (source == shadowXItem)
23292521 {
23302522 CastShadow(0);
23312523 } else
2332
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
23332525 {
23342526 CastShadow(1);
23352527 } else
2336
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
23372529 {
23382530 CastShadow(2);
23392531 } else
2340
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
23412533 {
23422534 //ungroup();
23432535 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2541,203 @@
23492541
23502542 refreshContents();
23512543 } else
2352
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
23532545 {
23542546 GenUV();
23552547 } else
2356
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
23572549 {
23582550 GenNormals(true);
23592551 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2552
+ if (source == genNormalsMESHItem)
23612553 {
2362
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
23632555 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2556
+ if (source == genNormalsORGANItem)
23652557 {
23662558 GenNormals(false);
23672559 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2560
+ if (source == genNormalsMINEItem)
23692561 {
23702562 GenNormalsMINE();
23712563 } else
2372
- if (event.getSource() == stripifyItem)
2564
+ if (source == stripifyItem)
23732565 {
23742566 Stripify();
23752567 } else
2376
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
23772569 {
23782570 Unstripify();
23792571 } else
2380
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
23812573 {
23822574 Trim();
23832575 } else
2384
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
23852577 {
23862578 Untrim();
23872579 } else
2388
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
23892581 {
23902582 ClearColors();
23912583 } else
2392
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
23932585 {
23942586 ClearMaterials();
23952587 } else
2396
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
23972589 {
23982590 LiveLeaves(true);
23992591 } else
2400
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
24012593 {
24022594 LiveLeaves(false);
24032595 } else
2404
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
24052597 {
24062598 SupportLeaves(true);
24072599 } else
2408
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
24092601 {
24102602 SupportLeaves(false);
24112603 } else
2412
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
24132605 {
24142606 HideLeaves(true);
24152607 } else
2416
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
24172609 {
24182610 HideLeaves(false);
24192611 } else
2420
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
24212613 {
24222614 MarkLeaves(true);
24232615 } else
2424
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
24252617 {
24262618 MarkLeaves(false);
24272619 } else
2428
- 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)
24292637 {
24302638 FlipV(true);
24312639 } else
2432
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
24332641 {
24342642 FlipV(false);
24352643 } else
2436
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
24372645 {
24382646 SetTexRes(0);
24392647 } else
2440
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
24412649 {
24422650 SetTexRes(1);
24432651 } else
2444
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
24452653 {
24462654 SetTexRes(2);
24472655 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
24492657 {
24502658 SetTexRes(3);
24512659 } else
2452
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
24532661 {
24542662 SetTexRes(4);
24552663 } else
2456
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
24572665 {
24582666 SetTexRes(5);
24592667 } else
2460
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
24612669 {
24622670 ReverseNormals();
24632671 } else
2464
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
24652673 {
24662674 ParseVertices();
24672675 } else
2468
- if (event.getSource() == textureFieldItem)
2676
+ if (source == textureFieldItem)
24692677 {
24702678 TextureVertices();
24712679 } else
2472
- if (event.getSource() == alignItem)
2680
+ if (source == alignItem)
24732681 {
24742682 Align();
24752683 } else
2476
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
24772685 {
24782686 MirrorPoses();
24792687 } else
2480
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
24812689 {
24822690 MeshReduction(false);
24832691 } else
2484
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
24852693 {
24862694 MeshReduction(true);
24872695 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
24892697 {
24902698 ReverseTriangles();
24912699 } else
2492
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
24932701 {
24942702 ReduceMesh(false);
24952703 } else
2496
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
24972705 {
24982706 ReduceMesh(true);
24992707 } else
2500
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
25012709 {
25022710 IncreaseMesh();
25032711 } else
2504
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
25052713 {
25062714 ClipMesh();
25072715 } else
2508
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
25092717 {
25102718 SmoothMesh();
25112719 } else
2512
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
25132721 {
25142722 TransformGeometry();
25152723 } else
2516
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
25172729 {
25182730 ResetTransform();
25192731 } else
2520
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
25212733 {
2522
- ResetCentroid();
2734
+ ResetCentroid(true);
25232735 } else
2524
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
25252741 {
25262742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272743 {
....@@ -2531,7 +2747,7 @@
25312747
25322748 refreshContents();
25332749 } else
2534
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
25352751 {
25362752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372753 {
....@@ -2545,7 +2761,21 @@
25452761
25462762 refreshContents();
25472763 } else
2548
- 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)
25492779 {
25502780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512781 {
....@@ -2557,7 +2787,7 @@
25572787 ResetModel();
25582788 refreshContents();
25592789 } else
2560
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
25612791 {
25622792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632793 {
....@@ -2569,7 +2799,7 @@
25692799 ResetModel();
25702800 refreshContents();
25712801 } else
2572
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
25732803 {
25742804 String texture = GetFile("Attach pigment");
25752805 Object3D obj;
....@@ -2581,7 +2811,7 @@
25812811
25822812 refreshContents();
25832813 } else
2584
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
25852815 {
25862816 Object3D obj;
25872817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2822,7 @@
25922822
25932823 refreshContents();
25942824 } else
2595
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
25962826 {
25972827 String texture = GetFile("Attach bump");
25982828 Object3D obj;
....@@ -2604,7 +2834,7 @@
26042834
26052835 refreshContents();
26062836 } else
2607
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
26082838 {
26092839 Object3D obj;
26102840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2845,7 @@
26152845
26162846 refreshContents();
26172847 } else
2618
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
26192849 {
26202850 Object3D obj;
26212851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2856,195 @@
26262856
26272857 refreshContents();
26282858 } else
2629
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
26302860 {
26312861 CameraPane.flash = true;
26322862 refreshContents();
26332863 } else
2634
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
26352865 {
26362866 } else
2637
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
26382868 {
26392869 radio.layout = twoButton;
26402870 // bug
26412871 //gridPanel.setDividerLocation(1.0);
26422872 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
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(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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();
26672902 } else
2668
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
26692904 {
26702905 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
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
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- 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();
26952938 } else
2696
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
26972940 {
26982941 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.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
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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();
27232973 } else
2724
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
27252975 {
27262976 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- 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();
27513009 } else
2752
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
27533011 {
27543012 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- 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();
27793046 } else
2780
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
27813048 {
27823049 Object3D obj;
27833050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +3056,7 @@
27893056
27903057 refreshContents(true);
27913058 } else
2792
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
27933060 {
27943061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27953062 cRadio ab;
....@@ -2810,11 +3077,11 @@
28103077 }
28113078 refreshContents(true);
28123079 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
28143081 {
28153082 EditSelection(false);
28163083 } else
2817
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
28183085 {
28193086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203087 {
....@@ -2824,14 +3091,14 @@
28243091 child.CloseUI();
28253092 listUI.remove(child);
28263093
2827
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
28283095 }
2829
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
28303097 //objEditor.jTree.clearSelection();
28313098 //objEditor.ResetSliders();
28323099 refreshContents(true);
28333100 } else
2834
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
28353102 {
28363103 assert(copy == group);
28373104 //copy.ClearUI();
....@@ -2842,7 +3109,7 @@
28423109 listUI.clear();
28433110 refreshContents(true);
28443111 } else
2845
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
28463113 {
28473114 assert(copy == group);
28483115
....@@ -2863,19 +3130,19 @@
28633130
28643131 refreshContents(true);
28653132 } else
2866
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
28673134 {
28683135 objEditor.jTree.clearSelection();
28693136 // ?? oct 2012 GrafreeD.clipboard.clear();
28703137 objEditor.ResetSliders();
28713138 refreshContents(true);
28723139 } else
2873
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
28743141 {
28753142 group.parent = keepparent;
28763143 group.attributes = 0;
28773144 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
28793146 Object3D obj = radio.GetObject();
28803147 System.out.println("Edit " + obj);
28813148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3162,7 @@
28953162 }
28963163
28973164 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3165
+ //Globals.theRenderer.object = group;
28993166 if(!useclient)
29003167 {
29013168 cameraView.renderCamera = radio.camera;
....@@ -2904,12 +3171,16 @@
29043171 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053172 cameraView.targetLookAt.set(radio.camera.lookAt);
29063173 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3174
+ //cameraView.lighttouched = true;
3175
+ Globals.lighttouched = true;
29083176 topView.object = group;
29093177 frontView.object = group;
29103178 sideView.object = group;
29113179 }
3180
+
3181
+// fix "+" issue
29123182 group.editWindow = this;
3183
+
29133184 /*
29143185 currentLayout = radio.layout;
29153186 if (currentLayout == null)
....@@ -2922,7 +3193,20 @@
29223193 //group.attributes = -1;
29233194 ResetModel();
29243195 refreshContents(true);
2925
- }
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
+ }
29263210 else
29273211 {
29283212 //return super.action(event, arg);
....@@ -2940,7 +3224,7 @@
29403224 if (useclient)
29413225 {
29423226 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3227
+ Globals.lighttouched = true;
29443228 //topView.object = client;
29453229 //frontView.object = client;
29463230 //sideView.object = client;
....@@ -2948,7 +3232,7 @@
29483232 else
29493233 {
29503234 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3235
+ Globals.lighttouched = true;
29523236 //topView.object = group;
29533237 //frontView.object = group;
29543238 //sideView.object = group;
....@@ -2983,6 +3267,28 @@
29833267 refreshContents();
29843268 }
29853269
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
+ }
29863292
29873293 void ResetTransform()
29883294 {
....@@ -3095,7 +3401,7 @@
30953401 refreshContents();
30963402 }
30973403
3098
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
30993405 {
31003406 Object3D obj;
31013407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3416,16 @@
31103416 LA.matIdentity(Object3D.mat);
31113417 obj.getBounds(minima, maxima, false);
31123418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153422 obj.TransformMesh(Object3D.mat);
3423
+
31163424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
31193429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3144,7 +3454,8 @@
31443454
31453455 int size = obj.MemorySize();
31463456
3147
- 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)");
31483459 }
31493460 }
31503461 catch (Exception e)
....@@ -3181,9 +3492,9 @@
31813492 obj = (Object3D)e.nextElement();
31823493
31833494 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
31853496 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
31873498
31883499 // System.err.println((size/1024) + " KB is the size of " + obj);
31893500 }
....@@ -3225,6 +3536,13 @@
32253536 void GenNormals(boolean crease)
32263537 {
32273538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
32283546
32293547 refreshContents();
32303548 }
....@@ -3397,8 +3715,8 @@
33973715
33983716 void ParseVertices()
33993717 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
34023720
34033721 for (int i=0; i<group.selection.size(); i++)
34043722 {
....@@ -3423,7 +3741,7 @@
34233741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34243742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34253743
3426
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
34273745
34283746 buffer.add(g);
34293747 }
....@@ -3438,7 +3756,7 @@
34383756 makeSomething(buffer, i==group.selection.size()-1);
34393757 }
34403758
3441
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
34423760
34433761 refreshContents();
34443762 }
....@@ -3456,7 +3774,16 @@
34563774 String pigment = Object3D.GetPigment(tex);
34573775 //String bump = Object3D.GetBump(tex);
34583776
3459
- 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
+ }
34603787
34613788 double s = v.s;
34623789
....@@ -3544,11 +3871,11 @@
35443871
35453872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35463873
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
35493876 lowres.linkVerticesThis(null);
35503877 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
35523879
35533880 System.err.flush();
35543881
....@@ -3588,7 +3915,7 @@
35883915 return;
35893916
35903917 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
35923919
35933920 Object3D newgroup = new Object3D("Po:" + poses.name);
35943921
....@@ -3757,7 +4084,7 @@
37574084 group.selection.RelinkToSupport(); // july 2014
37584085 System.out.println("DONE.");
37594086 refreshContents();
3760
- 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));
37614088 }
37624089
37634090 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4109,9 @@
37824109
37834110 void ClipMesh()
37844111 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864113 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
37884115
37894116 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904117 content = ((cGroup)content).get(0);
....@@ -3793,7 +4120,7 @@
37934120 // {
37944121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954122 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
37974124 }
37984125 // group.selection.ClipMesh(GrafreeD.clipboard);
37994126 System.out.println("DONE.");
....@@ -3840,6 +4167,18 @@
38404167 void MarkLeaves(boolean hide)
38414168 {
38424169 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);
38434182 refreshContents();
38444183 }
38454184
....@@ -3928,7 +4267,7 @@
39284267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294268
39304269 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4270
+ if(elem != group || !newWindow)
39324271 {
39334272 // if (!(elem instanceof Composite))
39344273 // newWindow = false;
....@@ -4018,7 +4357,6 @@
40184357 //case 702: // Event.LIST_DESELECT
40194358 group.deselectAll();
40204359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4021
- objEditor.ClearInfo(); // .GetMaterial());
40224360 if (tps != null)
40234361 {
40244362 for (int i=0; i < tps.length; i++)
....@@ -4027,31 +4365,30 @@
40274365
40284366 //if (child.parent != null)
40294367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
40304369 group.addSelectee(child);
4031
- objEditor.SetMaterial(child); // .GetMaterial());
4032
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4033
- System.err.println("info : " + child.GetPath());
40344370 }
40354371 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
40424378
4043
- objEditor.SetText(); // jan 2014
4044
-
4045
- 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))
40464380 CameraPane.flash = true;
40474381
4048
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40494383 // a camera
40504384 {
4051
- CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // 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;
40554392 }
40564393
40574394 refreshContents();
....@@ -4062,6 +4399,26 @@
40624399
40634400 freezemodel = false;
40644401 }
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
+ }
40654422
40664423 void linkSomething(Object3D thing)
40674424 {
....@@ -4133,16 +4490,18 @@
41334490 {
41344491 if (group.selection.isEmpty())
41354492 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
41374495 Composite tGroup = null;
41384496 if (group.selection.size() > 0) // 1)
41394497 {
41404498 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
41424500 }
41434501
41444502 if (cut)
41454503 {
4504
+ Save();
41464505 //int indices[] = jList.getSelectedIndices();
41474506 //for (int i = indices.length - 1; i >= 0; i--)
41484507 //jList.remove(indices[i]);
....@@ -4178,16 +4537,16 @@
41784537 //System.out.println("cut " + child);
41794538 //System.out.println("parent = " + child.parent);
41804539 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
41824541 tGroup.add/*Child*/(tmp);
41834542 else
4184
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
41854544 }
41864545 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
41884547 tGroup.add/*Child*/(child);
41894548 else
4190
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
41914550 }
41924551
41934552 //ResetModel();
....@@ -4219,21 +4578,23 @@
42194578 //System.out.println("cut " + elem);
42204579 //System.out.println("parent = " + elem.parent);
42214580 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
42234582 tGroup.add/*Child*/(tmp);
42244583 else
4225
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
42264585 }
42274586 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
42294588 tGroup.add/*Child*/(child);
42304589 else
4231
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
42324591 }
42334592
42344593 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
42374598 if (cut)
42384599 {
42394600 ResetModel();
....@@ -4247,7 +4608,7 @@
42474608 // return;
42484609 boolean first = true;
42494610
4250
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
42514612 {
42524613 Composite temp;
42534614
....@@ -4258,7 +4619,7 @@
42584619 temp = (Composite)Applet3D.clipboard.deepCopy();
42594620 */
42604621 Object3D elem;
4261
- 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))
42624623 {
42634624 Object3D child = (Object3D)e.nextElement();
42644625
....@@ -4292,21 +4653,21 @@
42924653 //Object3D cb = Applet3D.clipboard;
42934654 //temp.addChild(cb);
42944655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- 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());
43004661 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
43034664 }
43044665
43054666 ResetModel();
43064667 refreshContents();
43074668 }
43084669
4309
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
43104671 {
43114672 // if (GrafreeD.clipboard == null)
43124673 // return;
....@@ -4335,15 +4696,22 @@
43354696 if (copyit)
43364697 {
43374698 // paste(false);
4338
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
43394707 }
43404708 else
43414709 {
43424710 boolean first = true;
43434711
4344
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
43454713 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
43474715 Object3D copy;
43484716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43494717 {
....@@ -4353,7 +4721,7 @@
43534721 }
43544722 } else
43554723 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
43574725 }
43584726 }
43594727 }
....@@ -4758,21 +5126,6 @@
47585126 }
47595127 */
47605128
4761
- void ImportGFD()
4762
- {
4763
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4764
- browser.show();
4765
- String filename = browser.getFile();
4766
- if (filename != null && filename.length() > 0)
4767
- {
4768
- String fullname = browser.getDirectory() + filename;
4769
-
4770
- //Object3D readobj =
4771
- objEditor.ReadGFD(fullname, objEditor);
4772
- //makeSomething(readobj);
4773
- }
4774
- }
4775
-
47765129 /*
47775130 public void Callback(Object obj)
47785131 {
....@@ -4796,26 +5149,9 @@
47965149 }
47975150 */
47985151
4799
- void ImportVRMLX3D()
4800
- {
4801
- if (GrafreeD.standAlone)
4802
- {
4803
- /**/
4804
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4805
- browser.show();
4806
- String filename = browser.getFile();
4807
- if (filename != null && filename.length() > 0)
4808
- {
4809
- String fullname = browser.getDirectory() + filename;
4810
- LoadVRMLX3D(fullname);
4811
- }
4812
- /**/
4813
- }
4814
- }
4815
-
48165152 String GetFile(String dialogName)
48175153 {
4818
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
48195155 {
48205156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215157 browser.show();
....@@ -4879,10 +5215,15 @@
48795215 cButton flashSelectionButton;
48805216 cButton editButton;
48815217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
48825219 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845220 cButton unselectButton;
48855221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
48865227 cButton screenfitButton;
48875228 cButton screenfitpointButton;
48885229 cButton snapobjectButton;
....@@ -4913,6 +5254,8 @@
49135254 private MenuItem lookFromItem;
49145255 private MenuItem switchItem;
49155256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
49165259 private MenuItem duplicateItem;
49175260 private MenuItem cloneItem;
49185261 private MenuItem cloneSupportItem;
....@@ -4926,7 +5269,7 @@
49265269 private MenuItem linkverticesItem;
49275270 private MenuItem relinkverticesItem;
49285271 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
49305273 private MenuItem stepAllItem;
49315274 private MenuItem revertMeshItem;
49325275 private MenuItem poseMeshItem;
....@@ -4937,6 +5280,7 @@
49375280 private MenuItem mergeGeometriesItem;
49385281 private MenuItem copyItem;
49395282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
49405284 private MenuItem pasteLinkItem;
49415285 private MenuItem pasteCloneItem;
49425286 private MenuItem pasteExpandItem;
....@@ -4975,6 +5319,10 @@
49755319 private MenuItem showleavesItem;
49765320 private MenuItem markleavesItem;
49775321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
49785326
49795327 private MenuItem flipVItem;
49805328 private MenuItem unflipVItem;
....@@ -4986,8 +5334,10 @@
49865334 private MenuItem panoTexturesItem;
49875335
49885336 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
49905338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
49915341 private MenuItem hideItem;
49925342 private MenuItem grabItem;
49935343 private MenuItem backItem;
....@@ -5009,6 +5359,7 @@
50095359
50105360 private MenuItem resetParentItem;
50115361 private MenuItem repairParentItem;
5362
+ private MenuItem repairShadowItem;
50125363 private MenuItem sortbysizeItem;
50135364 private MenuItem sortbynameItem;
50145365
....@@ -5033,7 +5384,7 @@
50335384 private MenuItem blobItem;
50345385 private MenuItem latheItem;
50355386 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
50375388 private MenuItem meshItem;
50385389 // private MenuItem meshGroupItem;
50395390 private MenuItem springItem;
....@@ -5055,11 +5406,6 @@
50555406 private MenuItem doubleItem;
50565407 private MenuItem tripleItem;
50575408
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50635409 private MenuItem computeAOItem;
50645410 private MenuItem recompileItem;
50655411 private MenuItem editScriptItem;
....@@ -5069,4 +5415,8 @@
50695415 private MenuItem analyzeItem;
50705416 private MenuItem dumpItem;
50715417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
50725422 }