Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,130 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
286
+ }
287
+
192288 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
222325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223326 setMasterItem.addActionListener(this);
327
+ }
224328
225329 oe.menuBar.add(menu = new Menu("Group"));
226330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +335,38 @@
231335 frontItem.addActionListener(this);
232336 compositeItem = menu.add(new MenuItem("Composite"));
233337 compositeItem.addActionListener(this);
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
339
+ hideItem.addActionListener(this);
340
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
341
+ ungroupItem.addActionListener(this);
234342 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
236344 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242346 switchGeoItem.addActionListener(this);
243347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244348 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
246350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
247359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248360 scriptNodeItem.addActionListener(this);
249361 cameraItem = menu.add(new MenuItem("Camera"));
250362 cameraItem.addActionListener(this);
363
+ }
251364
252365 oe.menuBar.add(menu = new Menu("Object"));
253366 textureItem = menu.add(new MenuItem("Texture"));
254367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
255370 csgItem = menu.add(new MenuItem("CSG"));
256371 csgItem.addActionListener(this);
257372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +375,29 @@
260375 shadowYItem.addActionListener(this);
261376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
263381 linkerItem = menu.add(new MenuItem("Linker"));
264382 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267383 attributeItem = menu.add(new MenuItem("Attribute"));
268384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
269387 pointflowItem = menu.add(new MenuItem("Point Flow"));
270388 pointflowItem.addActionListener(this);
389
+ }
271390 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275392 resetTransformItem.addActionListener(this);
276393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277394 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
280401
281402 oe.menuBar.add(menu = new Menu("Geometry"));
282403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +408,11 @@
287408 genNormalsCADItem.addActionListener(this);
288409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
290416 stripifyItem = menu.add(new MenuItem("Stripify"));
291417 stripifyItem.addActionListener(this);
292418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +434,34 @@
308434 reduce34MeshItem.addActionListener(this);
309435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310436 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
315445
316446 oe.menuBar.add(menu = new Menu("Attributes"));
317447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318448 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);
319453 menu.add("-");
320454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321455 liveleavesItem.addActionListener(this);
322456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
324460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325461 supportleavesItem.addActionListener(this);
326462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327463 unsupportleavesItem.addActionListener(this);
464
+ }
328465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329466 hideleavesItem.addActionListener(this);
330467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +470,14 @@
333470 markleavesItem.addActionListener(this);
334471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335472 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);
336481 menu.add("-");
337482 flipVItem = menu.add(new MenuItem("Flip V"));
338483 flipVItem.addActionListener(this);
....@@ -368,29 +513,22 @@
368513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369514 sortbynameItem.addActionListener(this);
370515 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.
371523 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372524 extractGeometriesItem.addActionListener(this);
373525 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374526 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
527
+ }
379528
380529 oe.menuBar.add(menu = new Menu("Insert"));
381530 buildCreateMenu(menu);
382531
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394532 oe.menuBar.add(menu = new Menu("Tools"));
395533 buildToolsMenu(menu);
396534 }
....@@ -425,150 +563,110 @@
425563 oe.radioPanel.add(dummyButton);
426564 oe.buttonGroup.add(dummyButton);
427565 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
566
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431567
432
- 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");
433582 liveCB.addItemListener(this);
434583
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- 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");
453590 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- 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");
495594 trackCB.addItemListener(this);
496595
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ screenfitButton.setToolTipText("Screen fit");
499598 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
599
+
501600 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502601 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507602
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- 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");
514612 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518613
519
- //
520
- 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");
521618 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523620 fourButton.addActionListener(this);
524
- 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");
525624 sixButton.addActionListener(this);
526
- 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");
527627 threeButton.addActionListener(this);
528
- 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");
529630 sevenButton.addActionListener(this);
530631 //
531632
532
- 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");
533635 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- 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");
536639 closeButton.addActionListener(this);
537640 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538641 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540642
541
- oe.aConstraints.gridx = 1; //
542
- 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");
543647 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547648
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
649
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ uneditButton.setToolTipText("Unedit selection");
549651 uneditButton.addActionListener(this);
550652
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- 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");
563655 allParamsButton.addActionListener(this);
564656
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- 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");
570663 unselectButton.addActionListener(this);
571664
665
+ commandsPanel.preferredHeight = 1;
666
+
667
+ oe.treePanel.add(commandsPanel);
668
+ oe.treePanel.Return();
669
+
572670 // oe.aConstraints.gridx += 1;
573671 // oe.aConstraints.weighty = 0;
574672 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +678,37 @@
580678 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581679 // gcButton.addActionListener(this);
582680
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
681
+ cGridBag jSPPanel = new cGridBag();
682
+
683
+ JScrollPane jSP;
594684 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- 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);
596686 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
687
+
688
+ oe.treePanel.add(jSPPanel);
689
+ oe.treePanel.Return();
601690
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- 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");
606695 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- 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");
609699 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- 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");
612703 textureCB.addItemListener(this);
613704
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
705
+ copyOptionsPanel.preferredHeight = 1;
706
+ oe.treePanel.add(copyOptionsPanel);
707
+ oe.treePanel.Return();
616708
709
+// mainPanel.setDividerLocation(0.5); //1.0);
710
+// mainPanel.setResizeWeight(0.5);
711
+
617712 //jList.addListSelectionListener(this);
618713 oe.jTree.addTreeSelectionListener(this);
619714 //jTree.setRootVisible(false);
....@@ -635,18 +730,91 @@
635730 radio.layout = sevenButton;
636731 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637732 }
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
+ }
638805
639806 void EditObject(Object3D obj)
640807 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- 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();
649816 }
817
+
650818 void SetupViews(ObjEditor oe)
651819 {
652820 oe.SetupViews();
....@@ -665,6 +833,7 @@
665833 JCheckBox fastCB;
666834 JCheckBox slowCB;
667835 JCheckBox boxCB;
836
+ JCheckBox zoomBoxCB;
668837 JCheckBox trackCB;
669838 JCheckBox smoothfocusCB;
670839 // JCheckBox speakerMocapCB;
....@@ -707,10 +876,10 @@
707876 dropAttributes |= Object3D.TEXTURE;
708877 else
709878 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
879
+ } else if(e.getSource() == liveCB)
712880 {
713881 cameraView.ToggleLive();
882
+ refreshContents(false);
714883 }
715884 else if(e.getSource() == supportCB)
716885 {
....@@ -745,6 +914,10 @@
745914 Recompile();
746915 cameraView.repaint();
747916 // refreshContents();
917
+ }
918
+ else if(e.getSource() == zoomBoxCB)
919
+ {
920
+ cameraView.ToggleZoomBoxMode();
748921 }
749922 else if(e.getSource() == smoothfocusCB)
750923 {
....@@ -859,7 +1032,9 @@
8591032 // objEditor.DropFile((java.io.File[]) object, true);
8601033 // return;
8611034 // }
862
- if (string.charAt(0) == '/')
1035
+
1036
+ // File path for Mac and Windows
1037
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631038 {
8641039 // file(s)
8651040 String[] names = string.split("\n");
....@@ -886,7 +1061,7 @@
8861061
8871062 flashIt = false;
8881063 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1064
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901065 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911066
8921067 if (group.selection.size() == 1)
....@@ -913,11 +1088,11 @@
9131088 {
9141089 loadClipboard(true);
9151090 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
1091
+ pasteInto(false, false);
9171092 } else {
9181093 loadClipboard(false);
9191094 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
1095
+ pasteInto(false, false); // true); // ???
9211096 }
9221097 }
9231098 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1210,37 @@
10351210 torusItem.addActionListener(this);
10361211 superItem = menu.add(new MenuItem("Superellipsoid"));
10371212 superItem.addActionListener(this);
1213
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1214
+ kleinItem.addActionListener(this);
10381215 particleItem = menu.add(new MenuItem("Particle system"));
10391216 particleItem.addActionListener(this);
1217
+ if (Globals.ADVANCED)
1218
+ {
10401219 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411220 ragdollItem.addActionListener(this);
10421221 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431222 ragdoll2Item.addActionListener(this);
1223
+ }
10441224 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1225
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461226 meshItem.addActionListener(this);
10471227 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481228 // meshGroupItem.addActionListener(this);
1229
+ if (Globals.ADVANCED)
1230
+ {
10491231 springItem = menu.add(new MenuItem("Spring"));
10501232 springItem.addActionListener(this);
10511233 flagItem = menu.add(new MenuItem("Flag"));
10521234 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571235 blobItem = menu.add(new MenuItem("Blob"));
10581236 blobItem.addActionListener(this);
10591237 latheItem = menu.add(new MenuItem("Lathe"));
10601238 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);
10611244 lightItem = menu.add(new MenuItem("Light"));
10621245 lightItem.addActionListener(this);
10631246 menu.add("-");
....@@ -1067,39 +1250,44 @@
10671250 loopItem.addActionListener(this);
10681251 doubleItem = menu.add(new MenuItem("Fork"));
10691252 doubleItem.addActionListener(this);
1253
+ if (Globals.ADVANCED)
1254
+ {
10701255 tripleItem = menu.add(new MenuItem("Trident"));
10711256 tripleItem.addActionListener(this);
1257
+ }
10721258 }
10731259
10741260 void buildToolsMenu(Menu menu)
10751261 {
10761262 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771263 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1264
+ animationItem.setState(Globals.ANIMATION);
10791265
10801266 menu.add("-");
10811267 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821268 parseverticesItem.addActionListener(this);
10831269 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841270 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1271
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861272 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891273 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901274 reduceMorphItem.addActionListener(this);
10911275 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921276 reduce34MorphItem.addActionListener(this);
1093
-
1277
+ menu.add("-");
10941278 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951279 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971280
1281
+ if (Globals.ADVANCED)
1282
+ {
1283
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1284
+ mirrorItem.addActionListener(this);
1285
+ menu.add("-");
10981286 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991287 memoryItem.addActionListener(this);
11001288 menu.add(analyzeItem = new MenuItem("Analyze"));
11011289 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1290
+ menu.add(dumpItem = new MenuItem("Print"));
11031291 dumpItem.addActionListener(this);
11041292 // menu.add(pathItem = new MenuItem("From-to path"));
11051293 // pathItem.addActionListener(this);
....@@ -1108,6 +1296,8 @@
11081296 resetParentItem.addActionListener(this);
11091297 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101298 repairParentItem.addActionListener(this);
1299
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1300
+ repairShadowItem.addActionListener(this);
11111301 menu.add(invariantsItem = new MenuItem("Invariants"));
11121302 invariantsItem.addActionListener(this);
11131303 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1305,7 @@
11151305 menu.add("-");
11161306 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171307 editScriptItem.addActionListener(this);
1308
+ }
11181309 }
11191310
11201311 void ScreenFit()
....@@ -1443,9 +1634,9 @@
14431634
14441635 void Overwrite(int mask)
14451636 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1637
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471638 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1639
+ Object3D content = Grafreed.clipboard.get(0);
14491640
14501641 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511642 content = ((cGroup)content).get(0);
....@@ -1468,6 +1659,7 @@
14681659 //
14691660 public void actionPerformed(ActionEvent event) // , Object arg)
14701661 {
1662
+ Object source = event.getSource();
14711663 /*
14721664 if (event.getSource() == nameField)
14731665 {
....@@ -1479,11 +1671,11 @@
14791671 }
14801672 else
14811673 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1674
+ if (source == lookAtItem || source == lookFromItem)
14831675 {
14841676 ScreenFit();
14851677 } else
1486
- if (event.getSource() == switchItem)
1678
+ if (source == switchItem)
14871679 {
14881680 cVector v1 = new cVector();
14891681 cVector v2 = new cVector();
....@@ -1492,11 +1684,11 @@
14921684 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931685 objEditor.cameraView.repaint();
14941686 } else
1495
- if (event.getSource() == rectoidItem)
1687
+ if (source == rectoidItem)
14961688 {
14971689 makeSomething(new Box());
14981690 } else
1499
- if (event.getSource() == particleItem)
1691
+ if (source == particleItem)
15001692 {
15011693 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021694 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1709,9 @@
15171709 applyExample(particleGeom, "SMOKE");
15181710 makeSomething(particleGeom);
15191711 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1712
+ if (source == ragdollItem || source == ragdoll2Item)
15211713 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1714
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231715
15241716 ragdoll.toParent = LA.newMatrix();
15251717 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1729,7 @@
15371729 } else
15381730 /*
15391731 */
1540
- if (event.getSource() == heightFieldItem)
1732
+ if (source == heightFieldItem)
15411733 {
15421734 Object3D obj = new Object3D();
15431735
....@@ -1575,27 +1767,31 @@
15751767
15761768 makeSomething(obj);
15771769 } else
1578
- if (event.getSource() == gridItem)
1770
+ if (source == gridItem)
15791771 {
15801772 makeSomething(new Grid());
15811773 } else
1582
- if (event.getSource() == ellipsoidItem)
1774
+ if (source == ellipsoidItem)
15831775 {
15841776 makeSomething(new Sphere());
15851777 } else
1586
- if (event.getSource() == coneItem)
1778
+ if (source == coneItem)
15871779 {
15881780 makeSomething(new Cone());
15891781 } else
1590
- if (event.getSource() == torusItem)
1782
+ if (source == torusItem)
15911783 {
15921784 makeSomething(new Torus());
15931785 } else
1594
- if (event.getSource() == superItem)
1786
+ if (source == superItem)
15951787 {
15961788 makeSomething(new Superellipsoid());
15971789 } else
1598
- if (event.getSource() == blobItem)
1790
+ if (source == kleinItem)
1791
+ {
1792
+ makeSomething(new Klein());
1793
+ } else
1794
+ if (source == blobItem)
15991795 {
16001796 Blob blob = new Blob();
16011797 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1799,15 @@
16031799 //blob.retile();
16041800 makeSomething(blob);
16051801 } else
1606
- if (event.getSource() == latheItem)
1802
+ if (source == latheItem)
16071803 {
16081804 makeSomething(new Lathe());
16091805 } else
1610
- if (event.getSource() == bezierItem)
1806
+ if (source == bezierItem)
16111807 {
16121808 makeSomething(new BezierSurface());
16131809 } else
1614
- if (event.getSource() == checkerItem)
1810
+ if (source == overlayItem)
16151811 {
16161812 /*
16171813 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1822,7 @@
16261822 */
16271823 makeSomething(new Checker());
16281824 } else
1629
- if (event.getSource() == meshItem)
1825
+ if (source == meshItem)
16301826 {
16311827 Object3D itemtomake = new Object3D();
16321828 Object3D child;
....@@ -1647,35 +1843,35 @@
16471843 makeSomething(child);
16481844 }
16491845 } else
1650
- if (event.getSource() == springItem)
1846
+ if (source == springItem)
16511847 {
16521848 cSpring s = new cSpring();
16531849 s.setup();
16541850 makeSomething(s);
16551851 } else
1656
- if (event.getSource() == flagItem)
1852
+ if (source == flagItem)
16571853 {
16581854 cSpring s = new cFlag();
16591855 s.setup();
16601856 makeSomething(s);
16611857 } else
1662
- if (event.getSource() == lightItem)
1858
+ if (source == lightItem)
16631859 {
16641860 makeSomething(new Light());
16651861 } else
1666
- if (event.getSource() == csgItem)
1862
+ if (source == csgItem)
16671863 {
16681864 group(new CSG());
16691865 } else
1670
- if (event.getSource() == templateItem)
1866
+ if (source == templateItem)
16711867 {
16721868 group(new cTemplate());
16731869 } else
1674
- if (event.getSource() == attributeItem)
1870
+ if (source == attributeItem)
16751871 {
16761872 makeSomething(new Attribute());
16771873 } else
1678
- if (event.getSource() == pointflowItem)
1874
+ if (source == pointflowItem)
16791875 {
16801876 makeSomething(new PointFlow());
16811877 } else
....@@ -1687,7 +1883,7 @@
16871883 } else
16881884 */
16891885
1690
- if (event.getSource() == superLoopItem)
1886
+ if (source == superLoopItem)
16911887 {
16921888 Composite g = new cGroup();
16931889 for (int i=0; i<15; i++)
....@@ -1709,7 +1905,7 @@
17091905
17101906 group(g);
17111907 } else
1712
- if (event.getSource() == loopItem)
1908
+ if (source == loopItem)
17131909 {
17141910 Composite csg = new GroupLeaf();
17151911 csg.count = 5;
....@@ -1718,7 +1914,7 @@
17181914 csg.addChild(child);
17191915 child.addChild(csg);
17201916 } else
1721
- if (event.getSource() == doubleItem)
1917
+ if (source == doubleItem)
17221918 {
17231919 Composite csg = new GroupLeaf();
17241920 csg.count = 5;
....@@ -1730,7 +1926,7 @@
17301926 csg.addChild(child);
17311927 child.addChild(csg);
17321928 } else
1733
- if (event.getSource() == tripleItem)
1929
+ if (source == tripleItem)
17341930 {
17351931 Composite csg = new GroupLeaf();
17361932 csg.count = 4;
....@@ -1745,71 +1941,71 @@
17451941 csg.addChild(child);
17461942 child.addChild(csg);
17471943 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
1944
+ if (source == computeAOItem)
17501945 {
1751
- ImportGFD();
1946
+ Globals.drawMode = CameraPane.OCCLUSION;
1947
+ Globals.theRenderer.repaint();
17521948 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
1949
+ if (source == recompileItem)
17711950 {
17721951 Recompile();
17731952 refreshContents();
17741953 } else
1775
- if (event.getSource() == editScriptItem)
1954
+ if (source == editScriptItem)
17761955 {
17771956 OpenDialog();
17781957 refreshContents();
17791958 } else
1780
- if (event.getSource() == invariantsItem)
1959
+ if (source == invariantsItem)
17811960 {
17821961 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1962
+ Grafreed.grafreeD.universe.invariants();
17841963 } else
1785
- if (event.getSource() == memoryItem)
1964
+ if (source == memoryItem)
17861965 {
17871966 //System.out.println("Invariants:");
17881967 PrintMemory();
17891968 } else
1790
- if (event.getSource() == pathItem)
1969
+ if (source == pathItem)
17911970 {
17921971 PrintPath();
17931972 } else
1794
- if (event.getSource() == analyzeItem)
1973
+ if (source == analyzeItem)
17951974 {
17961975 AnalyzeObject();
17971976 } else
1798
- if (event.getSource() == dumpItem)
1977
+ if (source == dumpItem)
17991978 {
18001979 DumpObject();
18011980 } else
1802
- 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)
18031999 {
18042000 //Reload(lastConverter, lastFilename, true);
18052001 ScreenFit();
18062002 } else
1807
- if (event.getSource() == screenfitpointButton)
2003
+ if (source == screenfitpointButton)
18082004 {
18092005 //Reload(lastConverter, lastFilename, true);
18102006 ScreenFitPoint();
18112007 } else
1812
- if (event.getSource() == snapobjectButton)
2008
+ if (source == snapobjectButton)
18132009 {
18142010 //Reload(lastConverter, lastFilename, true);
18152011 SnapObject();
....@@ -1820,13 +2016,13 @@
18202016 // Recompile();
18212017 // refreshContents();
18222018 // } else
1823
- if (event.getSource() == gcButton)
2019
+ if (source == gcButton)
18242020 {
18252021 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262022 System.gc();
18272023 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282024 } else
1829
- if (event.getSource() == editLeafItem)
2025
+ if (source == editLeafItem)
18302026 {
18312027 Object3D obj;
18322028 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2036,74 @@
18402036 }
18412037 refreshContents(true);
18422038 } else
1843
- if (event.getSource() == openWindowItem)
2039
+ if (source == openWindowItem)
18442040 {
18452041 EditSelection(true);
18462042 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2043
+ if (source == cutItem || source == clearButton)
18482044 {
18492045 loadClipboard(true);
18502046 } else
1851
- if (event.getSource() == duplicateItem)
2047
+ if (source == undoItem)
18522048 {
1853
- 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;
18542058 loadClipboard(false);
18552059 paste(false);
1856
- GrafreeD.clipboard = keep;
2060
+ Grafreed.clipboard = keep;
18572061 } else
1858
- if (event.getSource() == cloneItem)
2062
+ if (source == cloneItem)
18592063 {
18602064 CloneSelection(false);
18612065 } else
1862
- if (event.getSource() == cloneSupportItem)
2066
+ if (source == cloneSupportItem)
18632067 {
18642068 CloneSelection(true);
18652069 } else
1866
- if (event.getSource() == copyItem)
2070
+ if (source == copyItem)
18672071 {
18682072 loadClipboard(false);
18692073 } else
1870
- if (event.getSource() == pasteItem)
2074
+ if (source == pasteItem)
18712075 {
18722076 paste(false);
18732077 } else
1874
- if (event.getSource() == pasteLinkItem)
2078
+ if (source == pasteIntoItem)
18752079 {
1876
- pasteInto(false);
2080
+ pasteInto(true, false);
18772081 } else
1878
- if (event.getSource() == pasteCloneItem)
2082
+ if (source == pasteLinkItem)
18792083 {
1880
- pasteInto(true);
2084
+ pasteInto(false, false);
18812085 } else
1882
- if (event.getSource() == pasteExpandItem)
2086
+ if (source == pasteCloneItem)
2087
+ {
2088
+ pasteInto(true, true);
2089
+ } else
2090
+ if (source == pasteExpandItem)
18832091 {
18842092 paste(true);
18852093 } else
1886
- if (event.getSource() == synchronizeItem)
2094
+ if (source == synchronizeItem)
18872095 {
18882096 Overwrite(Object3D.TRANSFORM);
18892097 } else
1890
- if (event.getSource() == overwriteNameItem)
2098
+ if (source == overwriteNameItem)
18912099 {
18922100 Overwrite(Object3D.NAME);
18932101 } else
1894
- if (event.getSource() == overwriteUVItem)
2102
+ if (source == overwriteUVItem)
18952103 {
18962104 Overwrite(Object3D.UV);
18972105 } else
1898
- if (event.getSource() == overwriteMatItem)
2106
+ if (source == overwriteMatItem)
18992107 {
19002108 /* july 2015
19012109 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2123,7 @@
19152123
19162124 Overwrite(dropAttributes);
19172125 }
1918
- if (event.getSource() == overwriteGeoItem)
2126
+ if (source == overwriteGeoItem)
19192127 {
19202128 Overwrite(Object3D.GEOMETRY);
19212129 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2140,7 @@
19322140 // refreshContents();
19332141 // }
19342142 } else
1935
- if (event.getSource() == generateMeshItem)
2143
+ if (source == generateMeshItem)
19362144 {
19372145 //if (group.selection.size() == 1)
19382146 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2151,7 @@
19432151 ResetModel();
19442152 refreshContents();
19452153 } else
1946
- if (event.getSource() == extractGeometriesItem)
2154
+ if (source == extractGeometriesItem)
19472155 {
19482156 boolean one = false;
19492157
....@@ -1970,7 +2178,7 @@
19702178 ResetModel();
19712179 refreshContents();
19722180 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2181
+ if (source == cloneGeometriesItem)
19742182 {
19752183 boolean one = false;
19762184
....@@ -1996,32 +2204,37 @@
19962204 ResetModel();
19972205 refreshContents();
19982206 } else
1999
- if (event.getSource() == shareGeometriesItem)
2207
+ if (source == shareGeometriesItem)
20002208 {
20012209 boolean one = false;
20022210
20032211 if (group.selection.size() == 1)
20042212 one = true;
20052213
2214
+ Object3D merge = null;
2215
+
20062216 Object3D content = new cGroup();
20072217
20082218 for (int i=0; i<group.selection.size(); i++)
20092219 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2220
+ merge = new Merge(group.selection.get(i));
20112221
20122222 if (one)
2013
- makeSomething(sel, false);
2223
+ makeSomething(merge, false);
20142224 else
2015
- content.addChild(sel);
2225
+ content.addChild(merge);
20162226 }
20172227
20182228 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2229
+ makeSomething(content, true);
2230
+ else
2231
+ {
2232
+ ResetModel();
2233
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2234
+ refreshContents();
2235
+ }
20232236 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2237
+ if (source == mergeGeometriesItem)
20252238 {
20262239 boolean one = false;
20272240
....@@ -2051,7 +2264,7 @@
20512264 ResetModel();
20522265 refreshContents();
20532266 } else
2054
- if (event.getSource() == linkverticesItem)
2267
+ if (source == linkverticesItem)
20552268 {
20562269 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572270 // {
....@@ -2064,39 +2277,48 @@
20642277 // group.selection.get(0).setMasterThis(content); // should be identity
20652278 // refreshContents();
20662279 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2280
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682281 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2282
+ Object3D content = Grafreed.clipboard.get(0);
20702283
20712284 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722285 content = ((cGroup)content).get(0);
20732286
2074
- 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));
20752288 for (int i=0; i<group.selection.size(); i++)
20762289 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2290
+ boolean random = CameraPane.SWITCH;
2291
+ CameraPane.SWITCH = false; // parse all random nodes
20792292 group.selection.get(i).linkVerticesThis(content);
20802293 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2294
+ CameraPane.SWITCH = random;
20822295 }
2083
- 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));
20842297 refreshContents();
20852298 }
20862299 } else
2087
- if (event.getSource() == resetsupportItem)
2300
+ if (source == resetsupportItem)
20882301 {
20892302 for (int i=0; i<group.selection.size(); i++)
20902303 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2304
+ boolean random = CameraPane.SWITCH;
2305
+ CameraPane.SWITCH = false; // parse all random nodes
20932306 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2307
+ CameraPane.SWITCH = random;
20952308 }
20962309
20972310 refreshContents();
20982311 } else
2099
- if (event.getSource() == resetreferencesItem)
2312
+ if (source == relinkverticesItem)
2313
+ {
2314
+ boolean random = CameraPane.SWITCH;
2315
+ CameraPane.SWITCH = false; // parse all random nodes
2316
+ group.selection.RelinkToSupport();
2317
+ CameraPane.SWITCH = random;
2318
+
2319
+ refreshContents();
2320
+ } else
2321
+ if (source == resetreferencesItem)
21002322 {
21012323 for (int i=0; i<group.selection.size(); i++)
21022324 {
....@@ -2105,11 +2327,11 @@
21052327
21062328 refreshContents();
21072329 } else
2108
- if (event.getSource() == setMasterItem)
2330
+ if (source == setMasterItem)
21092331 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2332
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112333 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2334
+ Object3D content = Grafreed.clipboard.get(0);
21132335
21142336 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152337 content = ((cGroup)content).get(0);
....@@ -2118,13 +2340,13 @@
21182340 refreshContents();
21192341 }
21202342 } else
2121
- if (event.getSource() == poseMeshItem)
2343
+ if (source == poseMeshItem)
21222344 {
21232345 if (group.selection.size() == 1)
21242346 {
2125
- if (GrafreeD.clipboard.size() == 1)
2347
+ if (Grafreed.clipboard.size() == 1)
21262348 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21282350
21292351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302352 content = ((cGroup)content).get(0);
....@@ -2137,19 +2359,19 @@
21372359 }
21382360
21392361 } else
2140
- if (event.getSource() == revertMeshItem)
2362
+ if (source == revertMeshItem)
21412363 {
21422364 RevertMeshes();
21432365 } else
2144
- if (event.getSource() == resetMeshItem)
2366
+ if (source == resetAllItem)
21452367 {
21462368 ResetAll();
21472369 } else
2148
- if (event.getSource() == stepAllItem)
2370
+ if (source == stepAllItem)
21492371 {
21502372 StepAll();
21512373 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2374
+ if (source == clearItem) // || event.getSource() == clearButton)
21532375 {
21542376 //int indices[] = jList.getSelectedIndices();
21552377 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2379,46 @@
21572379
21582380 ClearSelection(false);
21592381 } else
2160
- if (event.getSource() == clearAllItem)
2382
+ if (source == clearAllItem)
21612383 {
21622384 ClearSelection(true);
21632385 } else
2164
- if (event.getSource() == grabItem)
2386
+ if (source == grabItem)
21652387 {
21662388 group(new cGroup(), true);
21672389 } else
2168
- if (event.getSource() == frontItem)
2390
+ if (source == hideItem)
2391
+ {
2392
+ group(new HiddenObject());
2393
+ } else
2394
+ if (source == frontItem)
21692395 {
21702396 front();
21712397 } else
2172
- if (event.getSource() == backItem)
2398
+ if (source == backItem)
21732399 {
21742400 back();
21752401 } else
2176
- if (event.getSource() == cameraItem)
2402
+ if (source == cameraItem)
21772403 {
21782404 makeSomething(new Camera());
21792405 } else
2180
- if (event.getSource() == compositeItem)
2406
+ if (source == compositeItem)
21812407 {
21822408 group(new Composite());
21832409 } else
2184
- if (event.getSource() == randomItem)
2410
+ if (source == randomItem)
21852411 {
21862412 RandomNode random = new RandomNode();
21872413 group(random);
21882414 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2415
+ random.name = random.get(0).name + "Switch";
21902416 } else
2191
- if (event.getSource() == physicsItem)
2417
+ if (source == physicsItem)
21922418 {
21932419 group(new PhysicsNode());
21942420 } else
2195
- if (event.getSource() == frameselectorItem)
2421
+ if (source == frameselectorItem)
21962422 {
21972423 for (int i=0; i<group.selection.size(); i++)
21982424 {
....@@ -2204,7 +2430,7 @@
22042430 ResetModel();
22052431 refreshContents();
22062432 } else
2207
- if (event.getSource() == switchGeoItem)
2433
+ if (source == switchGeoItem)
22082434 {
22092435 for (int i=0; i<group.selection.size(); i++)
22102436 {
....@@ -2216,7 +2442,7 @@
22162442 ResetModel();
22172443 refreshContents();
22182444 } else
2219
- if (event.getSource() == switchTransfoItem)
2445
+ if (source == switchTransfoItem)
22202446 {
22212447 for (int i=0; i<group.selection.size(); i++)
22222448 {
....@@ -2228,7 +2454,7 @@
22282454 ResetModel();
22292455 refreshContents();
22302456 } else
2231
- if (event.getSource() == morphItem)
2457
+ if (source == morphItem)
22322458 {
22332459 for (int i=0; i<group.selection.size(); i++)
22342460 {
....@@ -2240,7 +2466,7 @@
22402466 ResetModel();
22412467 refreshContents();
22422468 } else
2243
- if (event.getSource() == scriptNodeItem)
2469
+ if (source == scriptNodeItem)
22442470 {
22452471 boolean atleastone = false;
22462472
....@@ -2279,199 +2505,239 @@
22792505 }
22802506 }
22812507 } else
2282
- if (event.getSource() == linkerItem)
2508
+ if (source == linkerItem)
22832509 {
22842510 group(new cLinker());
22852511 } else
2286
- if (event.getSource() == textureItem)
2512
+ if (source == textureItem)
22872513 {
22882514 group(new TextureNode());
22892515 } else
2290
- if (event.getSource() == shadowXItem)
2516
+ if (source == billboardItem)
2517
+ {
2518
+ group(new BillboardNode());
2519
+ } else
2520
+ if (source == shadowXItem)
22912521 {
22922522 CastShadow(0);
22932523 } else
2294
- if (event.getSource() == shadowYItem)
2524
+ if (source == shadowYItem)
22952525 {
22962526 CastShadow(1);
22972527 } else
2298
- if (event.getSource() == shadowZItem)
2528
+ if (source == shadowZItem)
22992529 {
23002530 CastShadow(2);
23012531 } else
2302
- if (event.getSource() == ungroupItem)
2532
+ if (source == ungroupItem)
23032533 {
2304
- ungroup();
2534
+ //ungroup();
2535
+ for (int i=0; i<group.selection.size(); i++)
2536
+ {
2537
+ Ungroup(group.selection.get(i));
2538
+ }
2539
+
2540
+ ClearSelection(false);
2541
+
2542
+ refreshContents();
23052543 } else
2306
- if (event.getSource() == genUVItem)
2544
+ if (source == genUVItem)
23072545 {
23082546 GenUV();
23092547 } else
2310
- if (event.getSource() == genNormalsCADItem)
2548
+ if (source == genNormalsCADItem)
23112549 {
23122550 GenNormals(true);
23132551 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2552
+ if (source == genNormalsMESHItem)
23152553 {
2316
- GenNormals(true); // TODO
2554
+ GenNormalsMESH();
23172555 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2556
+ if (source == genNormalsORGANItem)
23192557 {
23202558 GenNormals(false);
23212559 } else
2322
- if (event.getSource() == stripifyItem)
2560
+ if (source == genNormalsMINEItem)
2561
+ {
2562
+ GenNormalsMINE();
2563
+ } else
2564
+ if (source == stripifyItem)
23232565 {
23242566 Stripify();
23252567 } else
2326
- if (event.getSource() == unstripifyItem)
2568
+ if (source == unstripifyItem)
23272569 {
23282570 Unstripify();
23292571 } else
2330
- if (event.getSource() == trimItem)
2572
+ if (source == trimItem)
23312573 {
23322574 Trim();
23332575 } else
2334
- if (event.getSource() == untrimItem)
2576
+ if (source == untrimItem)
23352577 {
23362578 Untrim();
23372579 } else
2338
- if (event.getSource() == clearColorsItem)
2580
+ if (source == clearColorsItem)
23392581 {
23402582 ClearColors();
23412583 } else
2342
- if (event.getSource() == clearMaterialsItem)
2584
+ if (source == clearMaterialsItem)
23432585 {
23442586 ClearMaterials();
23452587 } else
2346
- if (event.getSource() == liveleavesItem)
2588
+ if (source == liveleavesItem)
23472589 {
23482590 LiveLeaves(true);
23492591 } else
2350
- if (event.getSource() == unliveleavesItem)
2592
+ if (source == unliveleavesItem)
23512593 {
23522594 LiveLeaves(false);
23532595 } else
2354
- if (event.getSource() == supportleavesItem)
2596
+ if (source == supportleavesItem)
23552597 {
23562598 SupportLeaves(true);
23572599 } else
2358
- if (event.getSource() == unsupportleavesItem)
2600
+ if (source == unsupportleavesItem)
23592601 {
23602602 SupportLeaves(false);
23612603 } else
2362
- if (event.getSource() == hideleavesItem)
2604
+ if (source == hideleavesItem)
23632605 {
23642606 HideLeaves(true);
23652607 } else
2366
- if (event.getSource() == showleavesItem)
2608
+ if (source == showleavesItem)
23672609 {
23682610 HideLeaves(false);
23692611 } else
2370
- if (event.getSource() == markleavesItem)
2612
+ if (source == markleavesItem)
23712613 {
23722614 MarkLeaves(true);
23732615 } else
2374
- if (event.getSource() == unmarkleavesItem)
2616
+ if (source == unmarkleavesItem)
23752617 {
23762618 MarkLeaves(false);
23772619 } else
2378
- 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)
23792637 {
23802638 FlipV(true);
23812639 } else
2382
- if (event.getSource() == unflipVItem)
2640
+ if (source == unflipVItem)
23832641 {
23842642 FlipV(false);
23852643 } else
2386
- if (event.getSource() == lowTexturesItem)
2644
+ if (source == lowTexturesItem)
23872645 {
23882646 SetTexRes(0);
23892647 } else
2390
- if (event.getSource() == normalTexturesItem)
2648
+ if (source == normalTexturesItem)
23912649 {
23922650 SetTexRes(1);
23932651 } else
2394
- if (event.getSource() == highTexturesItem)
2652
+ if (source == highTexturesItem)
23952653 {
23962654 SetTexRes(2);
23972655 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2656
+ if (source == veryhighTexturesItem)
23992657 {
24002658 SetTexRes(3);
24012659 } else
2402
- if (event.getSource() == maxTexturesItem)
2660
+ if (source == maxTexturesItem)
24032661 {
24042662 SetTexRes(4);
24052663 } else
2406
- if (event.getSource() == panoTexturesItem)
2664
+ if (source == panoTexturesItem)
24072665 {
24082666 SetTexRes(5);
24092667 } else
2410
- if (event.getSource() == reverseNormalsItem)
2668
+ if (source == reverseNormalsItem)
24112669 {
24122670 ReverseNormals();
24132671 } else
2414
- if (event.getSource() == parseverticesItem)
2672
+ if (source == parseverticesItem)
24152673 {
24162674 ParseVertices();
24172675 } else
2418
- if (event.getSource() == textureFieldItem)
2676
+ if (source == textureFieldItem)
24192677 {
24202678 TextureVertices();
24212679 } else
2422
- if (event.getSource() == alignItem)
2680
+ if (source == alignItem)
24232681 {
24242682 Align();
24252683 } else
2426
- if (event.getSource() == mirrorItem)
2684
+ if (source == mirrorItem)
24272685 {
24282686 MirrorPoses();
24292687 } else
2430
- if (event.getSource() == reduceMorphItem)
2688
+ if (source == reduceMorphItem)
24312689 {
24322690 MeshReduction(false);
24332691 } else
2434
- if (event.getSource() == reduce34MorphItem)
2692
+ if (source == reduce34MorphItem)
24352693 {
24362694 MeshReduction(true);
24372695 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2696
+ if (source == reverseTrianglesItem)
24392697 {
24402698 ReverseTriangles();
24412699 } else
2442
- if (event.getSource() == reduceMeshItem)
2700
+ if (source == reduceMeshItem)
24432701 {
24442702 ReduceMesh(false);
24452703 } else
2446
- if (event.getSource() == reduce34MeshItem)
2704
+ if (source == reduce34MeshItem)
24472705 {
24482706 ReduceMesh(true);
24492707 } else
2450
- if (event.getSource() == increaseMeshItem)
2708
+ if (source == increaseMeshItem)
24512709 {
24522710 IncreaseMesh();
24532711 } else
2454
- if (event.getSource() == clipMeshItem)
2712
+ if (source == clipMeshItem)
24552713 {
24562714 ClipMesh();
24572715 } else
2458
- if (event.getSource() == smoothMeshItem)
2716
+ if (source == smoothMeshItem)
24592717 {
24602718 SmoothMesh();
24612719 } else
2462
- if (event.getSource() == transformgeometryItem)
2720
+ if (source == transformGeometryItem)
24632721 {
24642722 TransformGeometry();
24652723 } else
2466
- if (event.getSource() == resetTransformItem)
2724
+ if (source == transformChildrenItem)
2725
+ {
2726
+ TransformChildren();
2727
+ } else
2728
+ if (source == resetTransformItem)
24672729 {
24682730 ResetTransform();
24692731 } else
2470
- if (event.getSource() == resetCentroidItem)
2732
+ if (source == resetCentroidItem)
24712733 {
2472
- ResetCentroid();
2734
+ ResetCentroid(true);
24732735 } else
2474
- if (event.getSource() == resetParentItem)
2736
+ if (source == resetCentroidXZItem)
2737
+ {
2738
+ ResetCentroid(false);
2739
+ } else
2740
+ if (source == resetParentItem)
24752741 {
24762742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772743 {
....@@ -2481,7 +2747,7 @@
24812747
24822748 refreshContents();
24832749 } else
2484
- if (event.getSource() == repairParentItem)
2750
+ if (source == repairParentItem)
24852751 {
24862752 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872753 {
....@@ -2495,7 +2761,21 @@
24952761
24962762 refreshContents();
24972763 } else
2498
- 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)
24992779 {
25002780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012781 {
....@@ -2507,7 +2787,7 @@
25072787 ResetModel();
25082788 refreshContents();
25092789 } else
2510
- if (event.getSource() == sortbynameItem)
2790
+ if (source == sortbynameItem)
25112791 {
25122792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132793 {
....@@ -2519,7 +2799,7 @@
25192799 ResetModel();
25202800 refreshContents();
25212801 } else
2522
- if (event.getSource() == attachPigmentItem)
2802
+ if (source == attachPigmentItem)
25232803 {
25242804 String texture = GetFile("Attach pigment");
25252805 Object3D obj;
....@@ -2531,7 +2811,7 @@
25312811
25322812 refreshContents();
25332813 } else
2534
- if (event.getSource() == detachPigmentItem)
2814
+ if (source == detachPigmentItem)
25352815 {
25362816 Object3D obj;
25372817 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2822,7 @@
25422822
25432823 refreshContents();
25442824 } else
2545
- if (event.getSource() == attachBumpItem)
2825
+ if (source == attachBumpItem)
25462826 {
25472827 String texture = GetFile("Attach bump");
25482828 Object3D obj;
....@@ -2554,7 +2834,7 @@
25542834
25552835 refreshContents();
25562836 } else
2557
- if (event.getSource() == detachBumpItem)
2837
+ if (source == detachBumpItem)
25582838 {
25592839 Object3D obj;
25602840 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2845,7 @@
25652845
25662846 refreshContents();
25672847 } else
2568
- if (event.getSource() == pigmentBumpItem)
2848
+ if (source == pigmentBumpItem)
25692849 {
25702850 Object3D obj;
25712851 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2856,195 @@
25762856
25772857 refreshContents();
25782858 } else
2579
- if (event.getSource() == flashSelectionButton)
2859
+ if (source == flashSelectionButton)
25802860 {
25812861 CameraPane.flash = true;
25822862 refreshContents();
25832863 } else
2584
- if (event.getSource() == oneButton)
2864
+ if (source == oneButton)
25852865 {
25862866 } else
2587
- if (event.getSource() == twoButton)
2867
+ if (source == twoButton)
25882868 {
25892869 radio.layout = twoButton;
25902870 // bug
25912871 //gridPanel.setDividerLocation(1.0);
25922872 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- 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();
26172902 } else
2618
- if (event.getSource() == threeButton)
2903
+ if (source == threeButton)
26192904 {
26202905 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- 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();
26452938 } else
2646
- if (event.getSource() == fourButton)
2939
+ if (source == fourButton)
26472940 {
26482941 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- 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();
26732973 } else
2674
- if (event.getSource() == sixButton)
2974
+ if (source == sixButton)
26752975 {
26762976 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- 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();
27013009 } else
2702
- if (event.getSource() == sevenButton)
3010
+ if (source == sevenButton)
27033011 {
27043012 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- 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();
27293046 } else
2730
- if (event.getSource() == rootButton)
3047
+ if (source == rootButton)
27313048 {
27323049 Object3D obj;
27333050 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +3056,7 @@
27393056
27403057 refreshContents(true);
27413058 } else
2742
- if (event.getSource() == closeButton)
3059
+ if (source == closeButton)
27433060 {
27443061 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453062 cRadio ab;
....@@ -2760,11 +3077,11 @@
27603077 }
27613078 refreshContents(true);
27623079 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3080
+ if (source == editItem || source == editButton)
27643081 {
27653082 EditSelection(false);
27663083 } else
2767
- if (event.getSource() == uneditButton)
3084
+ if (source == uneditButton)
27683085 {
27693086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703087 {
....@@ -2774,14 +3091,14 @@
27743091 child.CloseUI();
27753092 listUI.remove(child);
27763093
2777
- child.editWindow = null; // ???????????
3094
+ //child.editWindow = null; // ???????????
27783095 }
2779
- objEditor.ctrlPanel.revalidate();
3096
+ objEditor.ctrlPanel.FlushUI();
27803097 //objEditor.jTree.clearSelection();
27813098 //objEditor.ResetSliders();
27823099 refreshContents(true);
27833100 } else
2784
- if (event.getSource() == clearPanelButton)
3101
+ if (source == clearPanelButton)
27853102 {
27863103 assert(copy == group);
27873104 //copy.ClearUI();
....@@ -2792,7 +3109,7 @@
27923109 listUI.clear();
27933110 refreshContents(true);
27943111 } else
2795
- if (event.getSource() == allParamsButton)
3112
+ if (source == allParamsButton)
27963113 {
27973114 assert(copy == group);
27983115
....@@ -2813,19 +3130,19 @@
28133130
28143131 refreshContents(true);
28153132 } else
2816
- if (event.getSource() == unselectButton)
3133
+ if (source == unselectButton)
28173134 {
28183135 objEditor.jTree.clearSelection();
28193136 // ?? oct 2012 GrafreeD.clipboard.clear();
28203137 objEditor.ResetSliders();
28213138 refreshContents(true);
28223139 } else
2823
- if(event.getSource() instanceof cRadio)
3140
+ if(source instanceof cRadio)
28243141 {
28253142 group.parent = keepparent;
28263143 group.attributes = 0;
28273144 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3145
+ /*cRadio*/ radio = (cRadio)source;
28293146 Object3D obj = radio.GetObject();
28303147 System.out.println("Edit " + obj);
28313148 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3162,7 @@
28453162 }
28463163
28473164 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3165
+ //Globals.theRenderer.object = group;
28493166 if(!useclient)
28503167 {
28513168 cameraView.renderCamera = radio.camera;
....@@ -2854,12 +3171,16 @@
28543171 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553172 cameraView.targetLookAt.set(radio.camera.lookAt);
28563173 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3174
+ //cameraView.lighttouched = true;
3175
+ Globals.lighttouched = true;
28583176 topView.object = group;
28593177 frontView.object = group;
28603178 sideView.object = group;
28613179 }
3180
+
3181
+// fix "+" issue
28623182 group.editWindow = this;
3183
+
28633184 /*
28643185 currentLayout = radio.layout;
28653186 if (currentLayout == null)
....@@ -2872,7 +3193,20 @@
28723193 //group.attributes = -1;
28733194 ResetModel();
28743195 refreshContents(true);
2875
- }
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
+ }
28763210 else
28773211 {
28783212 //return super.action(event, arg);
....@@ -2890,7 +3224,7 @@
28903224 if (useclient)
28913225 {
28923226 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3227
+ Globals.lighttouched = true;
28943228 //topView.object = client;
28953229 //frontView.object = client;
28963230 //sideView.object = client;
....@@ -2898,7 +3232,7 @@
28983232 else
28993233 {
29003234 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3235
+ Globals.lighttouched = true;
29023236 //topView.object = group;
29033237 //frontView.object = group;
29043238 //sideView.object = group;
....@@ -2933,6 +3267,28 @@
29333267 refreshContents();
29343268 }
29353269
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
+ }
29363292
29373293 void ResetTransform()
29383294 {
....@@ -3045,7 +3401,7 @@
30453401 refreshContents();
30463402 }
30473403
3048
- void ResetCentroid()
3404
+ void ResetCentroid(boolean full)
30493405 {
30503406 Object3D obj;
30513407 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3416,16 @@
30603416 LA.matIdentity(Object3D.mat);
30613417 obj.getBounds(minima, maxima, false);
30623418 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3419
+ if (full)
3420
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643421 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653422 obj.TransformMesh(Object3D.mat);
3423
+
30663424 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3425
+ if (full)
3426
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683427 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3428
+
30693429 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703430 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713431 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3454,8 @@
30943454
30953455 int size = obj.MemorySize();
30963456
3097
- 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)");
30983459 }
30993460 }
31003461 catch (Exception e)
....@@ -3131,9 +3492,9 @@
31313492 obj = (Object3D)e.nextElement();
31323493
31333494 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3495
+ Grafreed.AnalyzeObject(obj);
31353496 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3497
+ Grafreed.AnalyzeObject(obj.bRep);
31373498
31383499 // System.err.println((size/1024) + " KB is the size of " + obj);
31393500 }
....@@ -3175,6 +3536,20 @@
31753536 void GenNormals(boolean crease)
31763537 {
31773538 group.GenNormalsS(crease);
3539
+
3540
+ refreshContents();
3541
+ }
3542
+
3543
+ void GenNormalsMESH()
3544
+ {
3545
+ group.GenNormalsMeshS();
3546
+
3547
+ refreshContents();
3548
+ }
3549
+
3550
+ void GenNormalsMINE()
3551
+ {
3552
+ group.selection.GenNormalsMINE();
31783553
31793554 refreshContents();
31803555 }
....@@ -3340,8 +3715,8 @@
33403715
33413716 void ParseVertices()
33423717 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
3718
+ boolean epsequal = Grafreed.epsequal;
3719
+ Grafreed.epsequal = true;
33453720
33463721 for (int i=0; i<group.selection.size(); i++)
33473722 {
....@@ -3366,7 +3741,7 @@
33663741 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33673742 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33683743
3369
- g.add(GrafreeD.clipboard);
3744
+ g.add(Grafreed.clipboard);
33703745
33713746 buffer.add(g);
33723747 }
....@@ -3381,7 +3756,7 @@
33813756 makeSomething(buffer, i==group.selection.size()-1);
33823757 }
33833758
3384
- GrafreeD.epsequal = epsequal;
3759
+ Grafreed.epsequal = epsequal;
33853760
33863761 refreshContents();
33873762 }
....@@ -3399,7 +3774,16 @@
33993774 String pigment = Object3D.GetPigment(tex);
34003775 //String bump = Object3D.GetBump(tex);
34013776
3402
- 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
+ }
34033787
34043788 double s = v.s;
34053789
....@@ -3447,12 +3831,26 @@
34473831
34483832 void Align()
34493833 {
3834
+ if (group.selection.size() == 0)
3835
+ return;
3836
+
3837
+ cVector bbmin = new cVector();
3838
+ cVector bbmax = new cVector();
3839
+
3840
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3841
+
3842
+ double dx = bbmax.x - bbmin.x;
3843
+ double dy = bbmax.y - bbmin.y;
3844
+ double dz = bbmax.z - bbmin.z;
3845
+
3846
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3847
+
34503848 for (int i=0; i<group.selection.size(); i++)
34513849 {
34523850 Object3D obj = group.selection.get(i);
34533851
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3852
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3853
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563854 }
34573855
34583856 refreshContents();
....@@ -3473,11 +3871,11 @@
34733871
34743872 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753873
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3874
+ boolean random = CameraPane.SWITCH;
3875
+ CameraPane.SWITCH = false; // parse all random nodes
34783876 lowres.linkVerticesThis(null);
34793877 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3878
+ CameraPane.SWITCH = random;
34813879
34823880 System.err.flush();
34833881
....@@ -3517,7 +3915,7 @@
35173915 return;
35183916
35193917 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
3918
+ Object3D ref = Grafreed.clipboard.get(0);
35213919
35223920 Object3D newgroup = new Object3D("Po:" + poses.name);
35233921
....@@ -3686,7 +4084,7 @@
36864084 group.selection.RelinkToSupport(); // july 2014
36874085 System.out.println("DONE.");
36884086 refreshContents();
3689
- 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));
36904088 }
36914089
36924090 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4109,9 @@
37114109
37124110 void ClipMesh()
37134111 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4112
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154113 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4114
+ Object3D content = Grafreed.clipboard.get(0);
37174115
37184116 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194117 content = ((cGroup)content).get(0);
....@@ -3722,7 +4120,7 @@
37224120 // {
37234121 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244122 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4123
+ group.selection.ClipMesh(Grafreed.clipboard);
37264124 }
37274125 // group.selection.ClipMesh(GrafreeD.clipboard);
37284126 System.out.println("DONE.");
....@@ -3769,6 +4167,18 @@
37694167 void MarkLeaves(boolean hide)
37704168 {
37714169 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);
37724182 refreshContents();
37734183 }
37744184
....@@ -3857,7 +4267,7 @@
38574267 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584268
38594269 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4270
+ if(elem != group || !newWindow)
38614271 {
38624272 // if (!(elem instanceof Composite))
38634273 // newWindow = false;
....@@ -3947,7 +4357,6 @@
39474357 //case 702: // Event.LIST_DESELECT
39484358 group.deselectAll();
39494359 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514360 if (tps != null)
39524361 {
39534362 for (int i=0; i < tps.length; i++)
....@@ -3956,31 +4365,30 @@
39564365
39574366 //if (child.parent != null)
39584367 //child.parent.addSelectee(child);
4368
+ objEditor.SetMaterial(child);
39594369 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634370 }
39644371 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4372
+// else
4373
+// {
4374
+// objEditor.SetMaterial(group); // .GetMaterial());
4375
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4376
+// System.err.println("info : " + group.GetPath());
4377
+// }
39714378
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- 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))
39754380 CameraPane.flash = true;
39764381
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4382
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784383 // a camera
39794384 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // 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;
39844392 }
39854393
39864394 refreshContents();
....@@ -3991,6 +4399,26 @@
39914399
39924400 freezemodel = false;
39934401 }
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
+ }
39944422
39954423 void linkSomething(Object3D thing)
39964424 {
....@@ -4062,16 +4490,18 @@
40624490 {
40634491 if (group.selection.isEmpty())
40644492 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4493
+
4494
+ Grafreed.clipboardIsTempGroup = false;
40664495 Composite tGroup = null;
40674496 if (group.selection.size() > 0) // 1)
40684497 {
40694498 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4499
+ Grafreed.clipboardIsTempGroup = true;
40714500 }
40724501
40734502 if (cut)
40744503 {
4504
+ Save();
40754505 //int indices[] = jList.getSelectedIndices();
40764506 //for (int i = indices.length - 1; i >= 0; i--)
40774507 //jList.remove(indices[i]);
....@@ -4107,16 +4537,16 @@
41074537 //System.out.println("cut " + child);
41084538 //System.out.println("parent = " + child.parent);
41094539 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4540
+ if (Grafreed.clipboardIsTempGroup)
41114541 tGroup.add/*Child*/(tmp);
41124542 else
4113
- GrafreeD.clipboard = tmp;
4543
+ Grafreed.clipboard = tmp;
41144544 }
41154545 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4546
+ if (Grafreed.clipboardIsTempGroup)
41174547 tGroup.add/*Child*/(child);
41184548 else
4119
- GrafreeD.clipboard = child;
4549
+ Grafreed.clipboard = child;
41204550 }
41214551
41224552 //ResetModel();
....@@ -4148,21 +4578,23 @@
41484578 //System.out.println("cut " + elem);
41494579 //System.out.println("parent = " + elem.parent);
41504580 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4581
+ if (Grafreed.clipboardIsTempGroup)
41524582 tGroup.add/*Child*/(tmp);
41534583 else
4154
- GrafreeD.clipboard = tmp;
4584
+ Grafreed.clipboard = tmp;
41554585 }
41564586 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4587
+ if (Grafreed.clipboardIsTempGroup)
41584588 tGroup.add/*Child*/(child);
41594589 else
4160
- GrafreeD.clipboard = child;
4590
+ Grafreed.clipboard = child;
41614591 }
41624592
41634593 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4594
+
4595
+ if (Grafreed.clipboardIsTempGroup)
4596
+ Grafreed.clipboard = tGroup;
4597
+
41664598 if (cut)
41674599 {
41684600 ResetModel();
....@@ -4176,7 +4608,7 @@
41764608 // return;
41774609 boolean first = true;
41784610
4179
- if (GrafreeD.clipboardIsTempGroup)
4611
+ if (Grafreed.clipboardIsTempGroup)
41804612 {
41814613 Composite temp;
41824614
....@@ -4187,7 +4619,7 @@
41874619 temp = (Composite)Applet3D.clipboard.deepCopy();
41884620 */
41894621 Object3D elem;
4190
- 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))
41914623 {
41924624 Object3D child = (Object3D)e.nextElement();
41934625
....@@ -4221,21 +4653,21 @@
42214653 //Object3D cb = Applet3D.clipboard;
42224654 //temp.addChild(cb);
42234655 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- 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());
42294661 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4662
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4663
+ Grafreed.clipboard.get(0).parent = keepparent;
42324664 }
42334665
42344666 ResetModel();
42354667 refreshContents();
42364668 }
42374669
4238
- void pasteInto(boolean copyit)
4670
+ void pasteInto(boolean copyit, boolean clone)
42394671 {
42404672 // if (GrafreeD.clipboard == null)
42414673 // return;
....@@ -4264,15 +4696,22 @@
42644696 if (copyit)
42654697 {
42664698 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4699
+ if (clone)
4700
+ {
4701
+ CloneClipboard(false); // sept 2014
4702
+ }
4703
+ else
4704
+ {
4705
+ paste(false);
4706
+ }
42684707 }
42694708 else
42704709 {
42714710 boolean first = true;
42724711
4273
- if (GrafreeD.clipboardIsTempGroup)
4712
+ if (Grafreed.clipboardIsTempGroup)
42744713 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
4714
+ Composite temp = (Composite)Grafreed.clipboard;
42764715 Object3D copy;
42774716 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42784717 {
....@@ -4282,7 +4721,7 @@
42824721 }
42834722 } else
42844723 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
4724
+ linkSomething(Grafreed.clipboard); //.get(0));
42864725 }
42874726 }
42884727 }
....@@ -4474,6 +4913,26 @@
44744913 makeSomething(csg);
44754914 }
44764915
4916
+ void Ungroup(Object3D g)
4917
+ {
4918
+ if (g instanceof HiddenObject)
4919
+ {
4920
+ HiddenObject h = (HiddenObject) g;
4921
+
4922
+ for (int i=0; i<h.ActualSize(); i++)
4923
+ {
4924
+ objEditor.makeSomething(h.get(i), false);
4925
+ }
4926
+ }
4927
+ else
4928
+ {
4929
+ for (int i=0; i<g.Size(); i++)
4930
+ {
4931
+ objEditor.makeSomething(g.get(i), false);
4932
+ }
4933
+ }
4934
+ }
4935
+
44774936 void ungroup()
44784937 {
44794938 /*
....@@ -4667,21 +5126,6 @@
46675126 }
46685127 */
46695128
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855129 /*
46865130 public void Callback(Object obj)
46875131 {
....@@ -4705,26 +5149,9 @@
47055149 }
47065150 */
47075151
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255152 String GetFile(String dialogName)
47265153 {
4727
- if (GrafreeD.standAlone)
5154
+ if (Grafreed.standAlone)
47285155 {
47295156 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305157 browser.show();
....@@ -4788,10 +5215,15 @@
47885215 cButton flashSelectionButton;
47895216 cButton editButton;
47905217 cButton uneditButton;
5218
+ JCheckBox allParamsButton;
47915219 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935220 cButton unselectButton;
47945221
5222
+ cButton saveButton;
5223
+ cButton undoButton;
5224
+ cButton redoButton;
5225
+ cButton oneStepButton;
5226
+
47955227 cButton screenfitButton;
47965228 cButton screenfitpointButton;
47975229 cButton snapobjectButton;
....@@ -4822,6 +5254,8 @@
48225254 private MenuItem lookFromItem;
48235255 private MenuItem switchItem;
48245256 private MenuItem cutItem;
5257
+ private MenuItem undoItem;
5258
+ private MenuItem redoItem;
48255259 private MenuItem duplicateItem;
48265260 private MenuItem cloneItem;
48275261 private MenuItem cloneSupportItem;
....@@ -4833,8 +5267,9 @@
48335267 private MenuItem resetsupportItem;
48345268 private MenuItem resetreferencesItem;
48355269 private MenuItem linkverticesItem;
5270
+ private MenuItem relinkverticesItem;
48365271 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5272
+ private MenuItem resetAllItem;
48385273 private MenuItem stepAllItem;
48395274 private MenuItem revertMeshItem;
48405275 private MenuItem poseMeshItem;
....@@ -4845,6 +5280,7 @@
48455280 private MenuItem mergeGeometriesItem;
48465281 private MenuItem copyItem;
48475282 private MenuItem pasteItem;
5283
+ private MenuItem pasteIntoItem;
48485284 private MenuItem pasteLinkItem;
48495285 private MenuItem pasteCloneItem;
48505286 private MenuItem pasteExpandItem;
....@@ -4854,6 +5290,7 @@
48545290 private MenuItem genNormalsMESHItem;
48555291 private MenuItem genNormalsCADItem;
48565292 private MenuItem genNormalsORGANItem;
5293
+ private MenuItem genNormalsMINEItem;
48575294 private MenuItem stripifyItem;
48585295 private MenuItem unstripifyItem;
48595296 private MenuItem trimItem;
....@@ -4882,6 +5319,10 @@
48825319 private MenuItem showleavesItem;
48835320 private MenuItem markleavesItem;
48845321 private MenuItem unmarkleavesItem;
5322
+ private MenuItem rewindleavesItem;
5323
+ private MenuItem unrewindleavesItem;
5324
+ private MenuItem randomleavesItem;
5325
+ private MenuItem unrandomleavesItem;
48855326
48865327 private MenuItem flipVItem;
48875328 private MenuItem unflipVItem;
....@@ -4893,8 +5334,11 @@
48935334 private MenuItem panoTexturesItem;
48945335
48955336 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5337
+ private MenuItem resetCentroidXZItem;
48975338 private MenuItem resetTransformItem;
5339
+ private MenuItem transformGeometryItem;
5340
+ private MenuItem transformChildrenItem;
5341
+ private MenuItem hideItem;
48985342 private MenuItem grabItem;
48995343 private MenuItem backItem;
49005344 private MenuItem frontItem;
....@@ -4915,6 +5359,7 @@
49155359
49165360 private MenuItem resetParentItem;
49175361 private MenuItem repairParentItem;
5362
+ private MenuItem repairShadowItem;
49185363 private MenuItem sortbysizeItem;
49195364 private MenuItem sortbynameItem;
49205365
....@@ -4935,10 +5380,11 @@
49355380 private MenuItem coneItem;
49365381 private MenuItem torusItem;
49375382 private MenuItem superItem;
5383
+ private MenuItem kleinItem;
49385384 private MenuItem blobItem;
49395385 private MenuItem latheItem;
49405386 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5387
+ private MenuItem overlayItem;
49425388 private MenuItem meshItem;
49435389 // private MenuItem meshGroupItem;
49445390 private MenuItem springItem;
....@@ -4947,6 +5393,7 @@
49475393 private MenuItem csgItem;
49485394 private MenuItem templateItem;
49495395 private MenuItem textureItem;
5396
+ private MenuItem billboardItem;
49505397 private MenuItem shadowXItem;
49515398 private MenuItem shadowYItem;
49525399 private MenuItem shadowZItem;
....@@ -4959,11 +5406,6 @@
49595406 private MenuItem doubleItem;
49605407 private MenuItem tripleItem;
49615408
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675409 private MenuItem computeAOItem;
49685410 private MenuItem recompileItem;
49695411 private MenuItem editScriptItem;
....@@ -4973,4 +5415,8 @@
49735415 private MenuItem analyzeItem;
49745416 private MenuItem dumpItem;
49755417 //boolean freezemodel = false;
5418
+
5419
+ Menu cameraMenu;
5420
+ MenuItem editCameraItem;
5421
+ MenuItem revertCameraItem;
49765422 }