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,150 +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);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526613
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
614
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
615
+
616
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617
+ twoButton.setToolTipText("Show center view only");
529618 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531620 fourButton.addActionListener(this);
532
- 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");
533624 sixButton.addActionListener(this);
534
- 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");
535627 threeButton.addActionListener(this);
536
- 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");
537630 sevenButton.addActionListener(this);
538631 //
539632
540
- 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");
541635 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- 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");
544639 closeButton.addActionListener(this);
545640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546641 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548642
549
- oe.aConstraints.gridx = 1; //
550
- 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");
551647 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555648
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
557651 uneditButton.addActionListener(this);
558652
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- 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");
571655 allParamsButton.addActionListener(this);
572656
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- 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");
578663 unselectButton.addActionListener(this);
579664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
580670 // oe.aConstraints.gridx += 1;
581671 // oe.aConstraints.weighty = 0;
582672 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +678,37 @@
588678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589679 // gcButton.addActionListener(this);
590680
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
602684 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- 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);
604686 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
609690
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- 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");
614695 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- 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");
617699 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620703 textureCB.addItemListener(this);
621704
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
624708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
625712 //jList.addListSelectionListener(this);
626713 oe.jTree.addTreeSelectionListener(this);
627714 //jTree.setRootVisible(false);
....@@ -643,18 +730,91 @@
643730 radio.layout = sevenButton;
644731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645732 }
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
+ }
646805
647806 void EditObject(Object3D obj)
648807 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- 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();
657816 }
817
+
658818 void SetupViews(ObjEditor oe)
659819 {
660820 oe.SetupViews();
....@@ -673,6 +833,7 @@
673833 JCheckBox fastCB;
674834 JCheckBox slowCB;
675835 JCheckBox boxCB;
836
+ JCheckBox zoomBoxCB;
676837 JCheckBox trackCB;
677838 JCheckBox smoothfocusCB;
678839 // JCheckBox speakerMocapCB;
....@@ -715,10 +876,10 @@
715876 dropAttributes |= Object3D.TEXTURE;
716877 else
717878 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
879
+ } else if(e.getSource() == liveCB)
720880 {
721881 cameraView.ToggleLive();
882
+ refreshContents(false);
722883 }
723884 else if(e.getSource() == supportCB)
724885 {
....@@ -753,6 +914,10 @@
753914 Recompile();
754915 cameraView.repaint();
755916 // refreshContents();
917
+ }
918
+ else if(e.getSource() == zoomBoxCB)
919
+ {
920
+ cameraView.ToggleZoomBoxMode();
756921 }
757922 else if(e.getSource() == smoothfocusCB)
758923 {
....@@ -867,7 +1032,9 @@
8671032 // objEditor.DropFile((java.io.File[]) object, true);
8681033 // return;
8691034 // }
870
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711038 {
8721039 // file(s)
8731040 String[] names = string.split("\n");
....@@ -894,7 +1061,7 @@
8941061
8951062 flashIt = false;
8961063 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991066
9001067 if (group.selection.size() == 1)
....@@ -921,11 +1088,11 @@
9211088 {
9221089 loadClipboard(true);
9231090 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1091
+ pasteInto(false, false);
9251092 } else {
9261093 loadClipboard(false);
9271094 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9291096 }
9301097 }
9311098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1214,33 @@
10471214 kleinItem.addActionListener(this);
10481215 particleItem = menu.add(new MenuItem("Particle system"));
10491216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10501219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511220 ragdollItem.addActionListener(this);
10521221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531222 ragdoll2Item.addActionListener(this);
1223
+ }
10541224 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561226 meshItem.addActionListener(this);
10571227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10591231 springItem = menu.add(new MenuItem("Spring"));
10601232 springItem.addActionListener(this);
10611233 flagItem = menu.add(new MenuItem("Flag"));
10621234 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671235 blobItem = menu.add(new MenuItem("Blob"));
10681236 blobItem.addActionListener(this);
10691237 latheItem = menu.add(new MenuItem("Lathe"));
10701238 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);
10711244 lightItem = menu.add(new MenuItem("Light"));
10721245 lightItem.addActionListener(this);
10731246 menu.add("-");
....@@ -1077,39 +1250,44 @@
10771250 loopItem.addActionListener(this);
10781251 doubleItem = menu.add(new MenuItem("Fork"));
10791252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
10801255 tripleItem = menu.add(new MenuItem("Trident"));
10811256 tripleItem.addActionListener(this);
1257
+ }
10821258 }
10831259
10841260 void buildToolsMenu(Menu menu)
10851261 {
10861262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871263 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
10891265
10901266 menu.add("-");
10911267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921268 parseverticesItem.addActionListener(this);
10931269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941270 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961272 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001274 reduceMorphItem.addActionListener(this);
11011275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021276 reduce34MorphItem.addActionListener(this);
1103
-
1277
+ menu.add("-");
11041278 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051279 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
11081286 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091287 memoryItem.addActionListener(this);
11101288 menu.add(analyzeItem = new MenuItem("Analyze"));
11111289 analyzeItem.addActionListener(this);
1112
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11131291 dumpItem.addActionListener(this);
11141292 // menu.add(pathItem = new MenuItem("From-to path"));
11151293 // pathItem.addActionListener(this);
....@@ -1118,6 +1296,8 @@
11181296 resetParentItem.addActionListener(this);
11191297 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201298 repairParentItem.addActionListener(this);
1299
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1300
+ repairShadowItem.addActionListener(this);
11211301 menu.add(invariantsItem = new MenuItem("Invariants"));
11221302 invariantsItem.addActionListener(this);
11231303 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1305,7 @@
11251305 menu.add("-");
11261306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271307 editScriptItem.addActionListener(this);
1308
+ }
11281309 }
11291310
11301311 void ScreenFit()
....@@ -1453,9 +1634,9 @@
14531634
14541635 void Overwrite(int mask)
14551636 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571638 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14591640
14601641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611642 content = ((cGroup)content).get(0);
....@@ -1478,6 +1659,7 @@
14781659 //
14791660 public void actionPerformed(ActionEvent event) // , Object arg)
14801661 {
1662
+ Object source = event.getSource();
14811663 /*
14821664 if (event.getSource() == nameField)
14831665 {
....@@ -1489,11 +1671,11 @@
14891671 }
14901672 else
14911673 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
14931675 {
14941676 ScreenFit();
14951677 } else
1496
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
14971679 {
14981680 cVector v1 = new cVector();
14991681 cVector v2 = new cVector();
....@@ -1502,11 +1684,11 @@
15021684 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031685 objEditor.cameraView.repaint();
15041686 } else
1505
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
15061688 {
15071689 makeSomething(new Box());
15081690 } else
1509
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
15101692 {
15111693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1709,9 @@
15271709 applyExample(particleGeom, "SMOKE");
15281710 makeSomething(particleGeom);
15291711 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15311713 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331715
15341716 ragdoll.toParent = LA.newMatrix();
15351717 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1729,7 @@
15471729 } else
15481730 /*
15491731 */
1550
- if (event.getSource() == heightFieldItem)
1732
+ if (source == heightFieldItem)
15511733 {
15521734 Object3D obj = new Object3D();
15531735
....@@ -1585,31 +1767,31 @@
15851767
15861768 makeSomething(obj);
15871769 } else
1588
- if (event.getSource() == gridItem)
1770
+ if (source == gridItem)
15891771 {
15901772 makeSomething(new Grid());
15911773 } else
1592
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
15931775 {
15941776 makeSomething(new Sphere());
15951777 } else
1596
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
15971779 {
15981780 makeSomething(new Cone());
15991781 } else
1600
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
16011783 {
16021784 makeSomething(new Torus());
16031785 } else
1604
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
16051787 {
16061788 makeSomething(new Superellipsoid());
16071789 } else
1608
- if (event.getSource() == kleinItem)
1790
+ if (source == kleinItem)
16091791 {
16101792 makeSomething(new Klein());
16111793 } else
1612
- if (event.getSource() == blobItem)
1794
+ if (source == blobItem)
16131795 {
16141796 Blob blob = new Blob();
16151797 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1799,15 @@
16171799 //blob.retile();
16181800 makeSomething(blob);
16191801 } else
1620
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
16211803 {
16221804 makeSomething(new Lathe());
16231805 } else
1624
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
16251807 {
16261808 makeSomething(new BezierSurface());
16271809 } else
1628
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
16291811 {
16301812 /*
16311813 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1822,7 @@
16401822 */
16411823 makeSomething(new Checker());
16421824 } else
1643
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
16441826 {
16451827 Object3D itemtomake = new Object3D();
16461828 Object3D child;
....@@ -1661,35 +1843,35 @@
16611843 makeSomething(child);
16621844 }
16631845 } else
1664
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
16651847 {
16661848 cSpring s = new cSpring();
16671849 s.setup();
16681850 makeSomething(s);
16691851 } else
1670
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
16711853 {
16721854 cSpring s = new cFlag();
16731855 s.setup();
16741856 makeSomething(s);
16751857 } else
1676
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
16771859 {
16781860 makeSomething(new Light());
16791861 } else
1680
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
16811863 {
16821864 group(new CSG());
16831865 } else
1684
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
16851867 {
16861868 group(new cTemplate());
16871869 } else
1688
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
16891871 {
16901872 makeSomething(new Attribute());
16911873 } else
1692
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
16931875 {
16941876 makeSomething(new PointFlow());
16951877 } else
....@@ -1701,7 +1883,7 @@
17011883 } else
17021884 */
17031885
1704
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
17051887 {
17061888 Composite g = new cGroup();
17071889 for (int i=0; i<15; i++)
....@@ -1723,7 +1905,7 @@
17231905
17241906 group(g);
17251907 } else
1726
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
17271909 {
17281910 Composite csg = new GroupLeaf();
17291911 csg.count = 5;
....@@ -1732,7 +1914,7 @@
17321914 csg.addChild(child);
17331915 child.addChild(csg);
17341916 } else
1735
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
17361918 {
17371919 Composite csg = new GroupLeaf();
17381920 csg.count = 5;
....@@ -1744,7 +1926,7 @@
17441926 csg.addChild(child);
17451927 child.addChild(csg);
17461928 } else
1747
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
17481930 {
17491931 Composite csg = new GroupLeaf();
17501932 csg.count = 4;
....@@ -1759,71 +1941,71 @@
17591941 csg.addChild(child);
17601942 child.addChild(csg);
17611943 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
1944
+ if (source == computeAOItem)
17641945 {
1765
- ImportGFD();
1946
+ Globals.drawMode = CameraPane.OCCLUSION;
1947
+ Globals.theRenderer.repaint();
17661948 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
1949
+ if (source == recompileItem)
17851950 {
17861951 Recompile();
17871952 refreshContents();
17881953 } else
1789
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
17901955 {
17911956 OpenDialog();
17921957 refreshContents();
17931958 } else
1794
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
17951960 {
17961961 System.out.println("Invariants:");
1797
- GrafreeD.grafreeD.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
17981963 } else
1799
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
18001965 {
18011966 //System.out.println("Invariants:");
18021967 PrintMemory();
18031968 } else
1804
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
18051970 {
18061971 PrintPath();
18071972 } else
1808
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
18091974 {
18101975 AnalyzeObject();
18111976 } else
1812
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
18131978 {
18141979 DumpObject();
18151980 } else
1816
- 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)
18171999 {
18182000 //Reload(lastConverter, lastFilename, true);
18192001 ScreenFit();
18202002 } else
1821
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
18222004 {
18232005 //Reload(lastConverter, lastFilename, true);
18242006 ScreenFitPoint();
18252007 } else
1826
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
18272009 {
18282010 //Reload(lastConverter, lastFilename, true);
18292011 SnapObject();
....@@ -1834,13 +2016,13 @@
18342016 // Recompile();
18352017 // refreshContents();
18362018 // } else
1837
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
18382020 {
18392021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402022 System.gc();
18412023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422024 } else
1843
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
18442026 {
18452027 Object3D obj;
18462028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2036,74 @@
18542036 }
18552037 refreshContents(true);
18562038 } else
1857
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
18582040 {
18592041 EditSelection(true);
18602042 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
18622044 {
18632045 loadClipboard(true);
18642046 } else
1865
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
18662048 {
1867
- 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;
18682058 loadClipboard(false);
18692059 paste(false);
1870
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
18712061 } else
1872
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
18732063 {
18742064 CloneSelection(false);
18752065 } else
1876
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
18772067 {
18782068 CloneSelection(true);
18792069 } else
1880
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
18812071 {
18822072 loadClipboard(false);
18832073 } else
1884
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
18852075 {
18862076 paste(false);
18872077 } else
1888
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
18892079 {
1890
- pasteInto(false);
2080
+ pasteInto(true, false);
18912081 } else
1892
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
18932083 {
1894
- pasteInto(true);
2084
+ pasteInto(false, false);
18952085 } else
1896
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
18972091 {
18982092 paste(true);
18992093 } else
1900
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
19012095 {
19022096 Overwrite(Object3D.TRANSFORM);
19032097 } else
1904
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
19052099 {
19062100 Overwrite(Object3D.NAME);
19072101 } else
1908
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
19092103 {
19102104 Overwrite(Object3D.UV);
19112105 } else
1912
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
19132107 {
19142108 /* july 2015
19152109 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2123,7 @@
19292123
19302124 Overwrite(dropAttributes);
19312125 }
1932
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
19332127 {
19342128 Overwrite(Object3D.GEOMETRY);
19352129 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2140,7 @@
19462140 // refreshContents();
19472141 // }
19482142 } else
1949
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
19502144 {
19512145 //if (group.selection.size() == 1)
19522146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2151,7 @@
19572151 ResetModel();
19582152 refreshContents();
19592153 } else
1960
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
19612155 {
19622156 boolean one = false;
19632157
....@@ -1984,7 +2178,7 @@
19842178 ResetModel();
19852179 refreshContents();
19862180 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
19882182 {
19892183 boolean one = false;
19902184
....@@ -2010,7 +2204,7 @@
20102204 ResetModel();
20112205 refreshContents();
20122206 } else
2013
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
20142208 {
20152209 boolean one = false;
20162210
....@@ -2040,7 +2234,7 @@
20402234 refreshContents();
20412235 }
20422236 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
20442238 {
20452239 boolean one = false;
20462240
....@@ -2070,7 +2264,7 @@
20702264 ResetModel();
20712265 refreshContents();
20722266 } else
2073
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
20742268 {
20752269 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762270 // {
....@@ -2083,48 +2277,48 @@
20832277 // group.selection.get(0).setMasterThis(content); // should be identity
20842278 // refreshContents();
20852279 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872281 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
20892283
20902284 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912285 content = ((cGroup)content).get(0);
20922286
2093
- 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));
20942288 for (int i=0; i<group.selection.size(); i++)
20952289 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
20982292 group.selection.get(i).linkVerticesThis(content);
20992293 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
21012295 }
2102
- 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));
21032297 refreshContents();
21042298 }
21052299 } else
2106
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
21072301 {
21082302 for (int i=0; i<group.selection.size(); i++)
21092303 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
21122306 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
21142308 }
21152309
21162310 refreshContents();
21172311 } else
2118
- if (event.getSource() == relinkverticesItem)
2312
+ if (source == relinkverticesItem)
21192313 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
21222316 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2317
+ CameraPane.SWITCH = random;
21242318
21252319 refreshContents();
21262320 } else
2127
- if (event.getSource() == resetreferencesItem)
2321
+ if (source == resetreferencesItem)
21282322 {
21292323 for (int i=0; i<group.selection.size(); i++)
21302324 {
....@@ -2133,11 +2327,11 @@
21332327
21342328 refreshContents();
21352329 } else
2136
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
21372331 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392333 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21412335
21422336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432337 content = ((cGroup)content).get(0);
....@@ -2146,13 +2340,13 @@
21462340 refreshContents();
21472341 }
21482342 } else
2149
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
21502344 {
21512345 if (group.selection.size() == 1)
21522346 {
2153
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21542348 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21562350
21572351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582352 content = ((cGroup)content).get(0);
....@@ -2165,19 +2359,19 @@
21652359 }
21662360
21672361 } else
2168
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
21692363 {
21702364 RevertMeshes();
21712365 } else
2172
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
21732367 {
21742368 ResetAll();
21752369 } else
2176
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
21772371 {
21782372 StepAll();
21792373 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
21812375 {
21822376 //int indices[] = jList.getSelectedIndices();
21832377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2379,46 @@
21852379
21862380 ClearSelection(false);
21872381 } else
2188
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
21892383 {
21902384 ClearSelection(true);
21912385 } else
2192
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
21932387 {
21942388 group(new cGroup(), true);
21952389 } else
2196
- if (event.getSource() == hideItem)
2390
+ if (source == hideItem)
21972391 {
21982392 group(new HiddenObject());
21992393 } else
2200
- if (event.getSource() == frontItem)
2394
+ if (source == frontItem)
22012395 {
22022396 front();
22032397 } else
2204
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
22052399 {
22062400 back();
22072401 } else
2208
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
22092403 {
22102404 makeSomething(new Camera());
22112405 } else
2212
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
22132407 {
22142408 group(new Composite());
22152409 } else
2216
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
22172411 {
22182412 RandomNode random = new RandomNode();
22192413 group(random);
22202414 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
22222416 } else
2223
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
22242418 {
22252419 group(new PhysicsNode());
22262420 } else
2227
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
22282422 {
22292423 for (int i=0; i<group.selection.size(); i++)
22302424 {
....@@ -2236,7 +2430,7 @@
22362430 ResetModel();
22372431 refreshContents();
22382432 } else
2239
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
22402434 {
22412435 for (int i=0; i<group.selection.size(); i++)
22422436 {
....@@ -2248,7 +2442,7 @@
22482442 ResetModel();
22492443 refreshContents();
22502444 } else
2251
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
22522446 {
22532447 for (int i=0; i<group.selection.size(); i++)
22542448 {
....@@ -2260,7 +2454,7 @@
22602454 ResetModel();
22612455 refreshContents();
22622456 } else
2263
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
22642458 {
22652459 for (int i=0; i<group.selection.size(); i++)
22662460 {
....@@ -2272,7 +2466,7 @@
22722466 ResetModel();
22732467 refreshContents();
22742468 } else
2275
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
22762470 {
22772471 boolean atleastone = false;
22782472
....@@ -2311,31 +2505,31 @@
23112505 }
23122506 }
23132507 } else
2314
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
23152509 {
23162510 group(new cLinker());
23172511 } else
2318
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
23192513 {
23202514 group(new TextureNode());
23212515 } else
2322
- if (event.getSource() == billboardItem)
2516
+ if (source == billboardItem)
23232517 {
23242518 group(new BillboardNode());
23252519 } else
2326
- if (event.getSource() == shadowXItem)
2520
+ if (source == shadowXItem)
23272521 {
23282522 CastShadow(0);
23292523 } else
2330
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
23312525 {
23322526 CastShadow(1);
23332527 } else
2334
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
23352529 {
23362530 CastShadow(2);
23372531 } else
2338
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
23392533 {
23402534 //ungroup();
23412535 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2541,203 @@
23472541
23482542 refreshContents();
23492543 } else
2350
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
23512545 {
23522546 GenUV();
23532547 } else
2354
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
23552549 {
23562550 GenNormals(true);
23572551 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2552
+ if (source == genNormalsMESHItem)
23592553 {
2360
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
23612555 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2556
+ if (source == genNormalsORGANItem)
23632557 {
23642558 GenNormals(false);
23652559 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2560
+ if (source == genNormalsMINEItem)
23672561 {
23682562 GenNormalsMINE();
23692563 } else
2370
- if (event.getSource() == stripifyItem)
2564
+ if (source == stripifyItem)
23712565 {
23722566 Stripify();
23732567 } else
2374
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
23752569 {
23762570 Unstripify();
23772571 } else
2378
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
23792573 {
23802574 Trim();
23812575 } else
2382
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
23832577 {
23842578 Untrim();
23852579 } else
2386
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
23872581 {
23882582 ClearColors();
23892583 } else
2390
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
23912585 {
23922586 ClearMaterials();
23932587 } else
2394
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
23952589 {
23962590 LiveLeaves(true);
23972591 } else
2398
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
23992593 {
24002594 LiveLeaves(false);
24012595 } else
2402
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
24032597 {
24042598 SupportLeaves(true);
24052599 } else
2406
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
24072601 {
24082602 SupportLeaves(false);
24092603 } else
2410
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
24112605 {
24122606 HideLeaves(true);
24132607 } else
2414
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
24152609 {
24162610 HideLeaves(false);
24172611 } else
2418
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
24192613 {
24202614 MarkLeaves(true);
24212615 } else
2422
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
24232617 {
24242618 MarkLeaves(false);
24252619 } else
2426
- 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)
24272637 {
24282638 FlipV(true);
24292639 } else
2430
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
24312641 {
24322642 FlipV(false);
24332643 } else
2434
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
24352645 {
24362646 SetTexRes(0);
24372647 } else
2438
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
24392649 {
24402650 SetTexRes(1);
24412651 } else
2442
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
24432653 {
24442654 SetTexRes(2);
24452655 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
24472657 {
24482658 SetTexRes(3);
24492659 } else
2450
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
24512661 {
24522662 SetTexRes(4);
24532663 } else
2454
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
24552665 {
24562666 SetTexRes(5);
24572667 } else
2458
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
24592669 {
24602670 ReverseNormals();
24612671 } else
2462
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
24632673 {
24642674 ParseVertices();
24652675 } else
2466
- if (event.getSource() == textureFieldItem)
2676
+ if (source == textureFieldItem)
24672677 {
24682678 TextureVertices();
24692679 } else
2470
- if (event.getSource() == alignItem)
2680
+ if (source == alignItem)
24712681 {
24722682 Align();
24732683 } else
2474
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
24752685 {
24762686 MirrorPoses();
24772687 } else
2478
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
24792689 {
24802690 MeshReduction(false);
24812691 } else
2482
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
24832693 {
24842694 MeshReduction(true);
24852695 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
24872697 {
24882698 ReverseTriangles();
24892699 } else
2490
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
24912701 {
24922702 ReduceMesh(false);
24932703 } else
2494
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
24952705 {
24962706 ReduceMesh(true);
24972707 } else
2498
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
24992709 {
25002710 IncreaseMesh();
25012711 } else
2502
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
25032713 {
25042714 ClipMesh();
25052715 } else
2506
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
25072717 {
25082718 SmoothMesh();
25092719 } else
2510
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
25112721 {
25122722 TransformGeometry();
25132723 } else
2514
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
25152729 {
25162730 ResetTransform();
25172731 } else
2518
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
25192733 {
2520
- ResetCentroid();
2734
+ ResetCentroid(true);
25212735 } else
2522
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
25232741 {
25242742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252743 {
....@@ -2529,7 +2747,7 @@
25292747
25302748 refreshContents();
25312749 } else
2532
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
25332751 {
25342752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352753 {
....@@ -2543,7 +2761,21 @@
25432761
25442762 refreshContents();
25452763 } else
2546
- 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)
25472779 {
25482780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492781 {
....@@ -2555,7 +2787,7 @@
25552787 ResetModel();
25562788 refreshContents();
25572789 } else
2558
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
25592791 {
25602792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612793 {
....@@ -2567,7 +2799,7 @@
25672799 ResetModel();
25682800 refreshContents();
25692801 } else
2570
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
25712803 {
25722804 String texture = GetFile("Attach pigment");
25732805 Object3D obj;
....@@ -2579,7 +2811,7 @@
25792811
25802812 refreshContents();
25812813 } else
2582
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
25832815 {
25842816 Object3D obj;
25852817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2822,7 @@
25902822
25912823 refreshContents();
25922824 } else
2593
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
25942826 {
25952827 String texture = GetFile("Attach bump");
25962828 Object3D obj;
....@@ -2602,7 +2834,7 @@
26022834
26032835 refreshContents();
26042836 } else
2605
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
26062838 {
26072839 Object3D obj;
26082840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2845,7 @@
26132845
26142846 refreshContents();
26152847 } else
2616
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
26172849 {
26182850 Object3D obj;
26192851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2856,195 @@
26242856
26252857 refreshContents();
26262858 } else
2627
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
26282860 {
26292861 CameraPane.flash = true;
26302862 refreshContents();
26312863 } else
2632
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
26332865 {
26342866 } else
2635
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
26362868 {
26372869 radio.layout = twoButton;
26382870 // bug
26392871 //gridPanel.setDividerLocation(1.0);
26402872 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- 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();
26652902 } else
2666
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
26672904 {
26682905 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- 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();
26932938 } else
2694
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
26952940 {
26962941 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- 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();
27212973 } else
2722
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
27232975 {
27242976 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- 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();
27493009 } else
2750
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
27513011 {
27523012 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- 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();
27773046 } else
2778
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
27793048 {
27803049 Object3D obj;
27813050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +3056,7 @@
27873056
27883057 refreshContents(true);
27893058 } else
2790
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
27913060 {
27923061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933062 cRadio ab;
....@@ -2808,11 +3077,11 @@
28083077 }
28093078 refreshContents(true);
28103079 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
28123081 {
28133082 EditSelection(false);
28143083 } else
2815
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
28163085 {
28173086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183087 {
....@@ -2822,14 +3091,14 @@
28223091 child.CloseUI();
28233092 listUI.remove(child);
28243093
2825
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
28263095 }
2827
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
28283097 //objEditor.jTree.clearSelection();
28293098 //objEditor.ResetSliders();
28303099 refreshContents(true);
28313100 } else
2832
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
28333102 {
28343103 assert(copy == group);
28353104 //copy.ClearUI();
....@@ -2840,7 +3109,7 @@
28403109 listUI.clear();
28413110 refreshContents(true);
28423111 } else
2843
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
28443113 {
28453114 assert(copy == group);
28463115
....@@ -2861,19 +3130,19 @@
28613130
28623131 refreshContents(true);
28633132 } else
2864
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
28653134 {
28663135 objEditor.jTree.clearSelection();
28673136 // ?? oct 2012 GrafreeD.clipboard.clear();
28683137 objEditor.ResetSliders();
28693138 refreshContents(true);
28703139 } else
2871
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
28723141 {
28733142 group.parent = keepparent;
28743143 group.attributes = 0;
28753144 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
28773146 Object3D obj = radio.GetObject();
28783147 System.out.println("Edit " + obj);
28793148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3162,7 @@
28933162 }
28943163
28953164 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3165
+ //Globals.theRenderer.object = group;
28973166 if(!useclient)
28983167 {
28993168 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3171,16 @@
29023171 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033172 cameraView.targetLookAt.set(radio.camera.lookAt);
29043173 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3174
+ //cameraView.lighttouched = true;
3175
+ Globals.lighttouched = true;
29063176 topView.object = group;
29073177 frontView.object = group;
29083178 sideView.object = group;
29093179 }
3180
+
3181
+// fix "+" issue
29103182 group.editWindow = this;
3183
+
29113184 /*
29123185 currentLayout = radio.layout;
29133186 if (currentLayout == null)
....@@ -2920,7 +3193,20 @@
29203193 //group.attributes = -1;
29213194 ResetModel();
29223195 refreshContents(true);
2923
- }
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
+ }
29243210 else
29253211 {
29263212 //return super.action(event, arg);
....@@ -2938,7 +3224,7 @@
29383224 if (useclient)
29393225 {
29403226 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3227
+ Globals.lighttouched = true;
29423228 //topView.object = client;
29433229 //frontView.object = client;
29443230 //sideView.object = client;
....@@ -2946,7 +3232,7 @@
29463232 else
29473233 {
29483234 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3235
+ Globals.lighttouched = true;
29503236 //topView.object = group;
29513237 //frontView.object = group;
29523238 //sideView.object = group;
....@@ -2981,6 +3267,28 @@
29813267 refreshContents();
29823268 }
29833269
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
+ }
29843292
29853293 void ResetTransform()
29863294 {
....@@ -3093,7 +3401,7 @@
30933401 refreshContents();
30943402 }
30953403
3096
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
30973405 {
30983406 Object3D obj;
30993407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3416,16 @@
31083416 LA.matIdentity(Object3D.mat);
31093417 obj.getBounds(minima, maxima, false);
31103418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133422 obj.TransformMesh(Object3D.mat);
3423
+
31143424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
31173429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +3454,8 @@
31423454
31433455 int size = obj.MemorySize();
31443456
3145
- 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)");
31463459 }
31473460 }
31483461 catch (Exception e)
....@@ -3179,9 +3492,9 @@
31793492 obj = (Object3D)e.nextElement();
31803493
31813494 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
31833496 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
31853498
31863499 // System.err.println((size/1024) + " KB is the size of " + obj);
31873500 }
....@@ -3223,6 +3536,13 @@
32233536 void GenNormals(boolean crease)
32243537 {
32253538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
32263546
32273547 refreshContents();
32283548 }
....@@ -3395,8 +3715,8 @@
33953715
33963716 void ParseVertices()
33973717 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
34003720
34013721 for (int i=0; i<group.selection.size(); i++)
34023722 {
....@@ -3421,7 +3741,7 @@
34213741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233743
3424
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
34253745
34263746 buffer.add(g);
34273747 }
....@@ -3436,7 +3756,7 @@
34363756 makeSomething(buffer, i==group.selection.size()-1);
34373757 }
34383758
3439
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
34403760
34413761 refreshContents();
34423762 }
....@@ -3454,7 +3774,16 @@
34543774 String pigment = Object3D.GetPigment(tex);
34553775 //String bump = Object3D.GetBump(tex);
34563776
3457
- 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
+ }
34583787
34593788 double s = v.s;
34603789
....@@ -3542,11 +3871,11 @@
35423871
35433872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443873
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
35473876 lowres.linkVerticesThis(null);
35483877 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
35503879
35513880 System.err.flush();
35523881
....@@ -3586,7 +3915,7 @@
35863915 return;
35873916
35883917 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
35903919
35913920 Object3D newgroup = new Object3D("Po:" + poses.name);
35923921
....@@ -3755,7 +4084,7 @@
37554084 group.selection.RelinkToSupport(); // july 2014
37564085 System.out.println("DONE.");
37574086 refreshContents();
3758
- 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));
37594088 }
37604089
37614090 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4109,9 @@
37804109
37814110 void ClipMesh()
37824111 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844113 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
37864115
37874116 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884117 content = ((cGroup)content).get(0);
....@@ -3791,7 +4120,7 @@
37914120 // {
37924121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934122 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
37954124 }
37964125 // group.selection.ClipMesh(GrafreeD.clipboard);
37974126 System.out.println("DONE.");
....@@ -3838,6 +4167,18 @@
38384167 void MarkLeaves(boolean hide)
38394168 {
38404169 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);
38414182 refreshContents();
38424183 }
38434184
....@@ -3926,7 +4267,7 @@
39264267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274268
39284269 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4270
+ if(elem != group || !newWindow)
39304271 {
39314272 // if (!(elem instanceof Composite))
39324273 // newWindow = false;
....@@ -4016,7 +4357,6 @@
40164357 //case 702: // Event.LIST_DESELECT
40174358 group.deselectAll();
40184359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4019
- objEditor.ClearInfo(); // .GetMaterial());
40204360 if (tps != null)
40214361 {
40224362 for (int i=0; i < tps.length; i++)
....@@ -4025,31 +4365,30 @@
40254365
40264366 //if (child.parent != null)
40274367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
40284369 group.addSelectee(child);
4029
- objEditor.SetMaterial(child); // .GetMaterial());
4030
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4031
- System.err.println("info : " + child.GetPath());
40324370 }
40334371 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
40404378
4041
- objEditor.SetText(); // jan 2014
4042
-
4043
- 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))
40444380 CameraPane.flash = true;
40454381
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474383 // a camera
40484384 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // 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;
40534392 }
40544393
40554394 refreshContents();
....@@ -4060,6 +4399,26 @@
40604399
40614400 freezemodel = false;
40624401 }
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
+ }
40634422
40644423 void linkSomething(Object3D thing)
40654424 {
....@@ -4131,16 +4490,18 @@
41314490 {
41324491 if (group.selection.isEmpty())
41334492 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
41354495 Composite tGroup = null;
41364496 if (group.selection.size() > 0) // 1)
41374497 {
41384498 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
41404500 }
41414501
41424502 if (cut)
41434503 {
4504
+ Save();
41444505 //int indices[] = jList.getSelectedIndices();
41454506 //for (int i = indices.length - 1; i >= 0; i--)
41464507 //jList.remove(indices[i]);
....@@ -4176,16 +4537,16 @@
41764537 //System.out.println("cut " + child);
41774538 //System.out.println("parent = " + child.parent);
41784539 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
41804541 tGroup.add/*Child*/(tmp);
41814542 else
4182
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
41834544 }
41844545 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
41864547 tGroup.add/*Child*/(child);
41874548 else
4188
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
41894550 }
41904551
41914552 //ResetModel();
....@@ -4217,21 +4578,23 @@
42174578 //System.out.println("cut " + elem);
42184579 //System.out.println("parent = " + elem.parent);
42194580 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
42214582 tGroup.add/*Child*/(tmp);
42224583 else
4223
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
42244585 }
42254586 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
42274588 tGroup.add/*Child*/(child);
42284589 else
4229
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
42304591 }
42314592
42324593 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
42354598 if (cut)
42364599 {
42374600 ResetModel();
....@@ -4245,7 +4608,7 @@
42454608 // return;
42464609 boolean first = true;
42474610
4248
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
42494612 {
42504613 Composite temp;
42514614
....@@ -4256,7 +4619,7 @@
42564619 temp = (Composite)Applet3D.clipboard.deepCopy();
42574620 */
42584621 Object3D elem;
4259
- 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))
42604623 {
42614624 Object3D child = (Object3D)e.nextElement();
42624625
....@@ -4290,21 +4653,21 @@
42904653 //Object3D cb = Applet3D.clipboard;
42914654 //temp.addChild(cb);
42924655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- 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());
42984661 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
43014664 }
43024665
43034666 ResetModel();
43044667 refreshContents();
43054668 }
43064669
4307
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
43084671 {
43094672 // if (GrafreeD.clipboard == null)
43104673 // return;
....@@ -4333,15 +4696,22 @@
43334696 if (copyit)
43344697 {
43354698 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
43374707 }
43384708 else
43394709 {
43404710 boolean first = true;
43414711
4342
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
43434713 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
43454715 Object3D copy;
43464716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474717 {
....@@ -4351,7 +4721,7 @@
43514721 }
43524722 } else
43534723 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
43554725 }
43564726 }
43574727 }
....@@ -4756,21 +5126,6 @@
47565126 }
47575127 */
47585128
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745129 /*
47755130 public void Callback(Object obj)
47765131 {
....@@ -4794,26 +5149,9 @@
47945149 }
47955150 */
47965151
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145152 String GetFile(String dialogName)
48155153 {
4816
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
48175155 {
48185156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195157 browser.show();
....@@ -4877,10 +5215,15 @@
48775215 cButton flashSelectionButton;
48785216 cButton editButton;
48795217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
48805219 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825220 cButton unselectButton;
48835221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
48845227 cButton screenfitButton;
48855228 cButton screenfitpointButton;
48865229 cButton snapobjectButton;
....@@ -4911,6 +5254,8 @@
49115254 private MenuItem lookFromItem;
49125255 private MenuItem switchItem;
49135256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
49145259 private MenuItem duplicateItem;
49155260 private MenuItem cloneItem;
49165261 private MenuItem cloneSupportItem;
....@@ -4924,7 +5269,7 @@
49245269 private MenuItem linkverticesItem;
49255270 private MenuItem relinkverticesItem;
49265271 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
49285273 private MenuItem stepAllItem;
49295274 private MenuItem revertMeshItem;
49305275 private MenuItem poseMeshItem;
....@@ -4935,6 +5280,7 @@
49355280 private MenuItem mergeGeometriesItem;
49365281 private MenuItem copyItem;
49375282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
49385284 private MenuItem pasteLinkItem;
49395285 private MenuItem pasteCloneItem;
49405286 private MenuItem pasteExpandItem;
....@@ -4973,6 +5319,10 @@
49735319 private MenuItem showleavesItem;
49745320 private MenuItem markleavesItem;
49755321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
49765326
49775327 private MenuItem flipVItem;
49785328 private MenuItem unflipVItem;
....@@ -4984,8 +5334,10 @@
49845334 private MenuItem panoTexturesItem;
49855335
49865336 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
49885338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
49895341 private MenuItem hideItem;
49905342 private MenuItem grabItem;
49915343 private MenuItem backItem;
....@@ -5007,6 +5359,7 @@
50075359
50085360 private MenuItem resetParentItem;
50095361 private MenuItem repairParentItem;
5362
+ private MenuItem repairShadowItem;
50105363 private MenuItem sortbysizeItem;
50115364 private MenuItem sortbynameItem;
50125365
....@@ -5031,7 +5384,7 @@
50315384 private MenuItem blobItem;
50325385 private MenuItem latheItem;
50335386 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
50355388 private MenuItem meshItem;
50365389 // private MenuItem meshGroupItem;
50375390 private MenuItem springItem;
....@@ -5053,11 +5406,6 @@
50535406 private MenuItem doubleItem;
50545407 private MenuItem tripleItem;
50555408
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615409 private MenuItem computeAOItem;
50625410 private MenuItem recompileItem;
50635411 private MenuItem editScriptItem;
....@@ -5067,4 +5415,8 @@
50675415 private MenuItem analyzeItem;
50685416 private MenuItem dumpItem;
50695417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
50705422 }