Normand Briere
2019-06-11 4113164b3be1e50251ac40d6fd65660f0a6c2e63
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"));
....@@ -368,29 +505,22 @@
368505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369506 sortbynameItem.addActionListener(this);
370507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
371515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372516 extractGeometriesItem.addActionListener(this);
373517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374518 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);
519
+ }
379520
380521 oe.menuBar.add(menu = new Menu("Insert"));
381522 buildCreateMenu(menu);
382523
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
-
394524 oe.menuBar.add(menu = new Menu("Tools"));
395525 buildToolsMenu(menu);
396526 }
....@@ -425,150 +555,110 @@
425555 oe.radioPanel.add(dummyButton);
426556 oe.buttonGroup.add(dummyButton);
427557 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431559
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
433574 liveCB.addItemListener(this);
434575
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);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
453582 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);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
495586 trackCB.addItemListener(this);
496587
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
499590 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
591
+
501592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502593 // 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;
507594
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);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ flashSelectionButton.setToolTipText("Show selection");
514604 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518605
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607
+
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ twoButton.setToolTipText("Show center view only");
521610 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523612 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
613
+ fourButton.setToolTipText("Show left panel only");
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ sixButton.setToolTipText("2-column layout left");
525616 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618
+ threeButton.setToolTipText("2-column layout right");
527619 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ sevenButton.setToolTipText("3-column layout");
529622 sevenButton.addActionListener(this);
530623 //
531624
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
533627 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ closeButton.setToolTipText("Close tab");
536631 closeButton.addActionListener(this);
537632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538633 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540634
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
543639 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547640
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
549643 uneditButton.addActionListener(this);
550644
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);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
563647 allParamsButton.addActionListener(this);
564648
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);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
570655 unselectButton.addActionListener(this);
571656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
572662 // oe.aConstraints.gridx += 1;
573663 // oe.aConstraints.weighty = 0;
574664 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +670,37 @@
580670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581671 // gcButton.addActionListener(this);
582672
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;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
594676 //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);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596678 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
601682
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);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
606687 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
609691 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
612695 textureCB.addItemListener(this);
613696
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
616700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
617704 //jList.addListSelectionListener(this);
618705 oe.jTree.addTreeSelectionListener(this);
619706 //jTree.setRootVisible(false);
....@@ -635,18 +722,91 @@
635722 radio.layout = sevenButton;
636723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637724 }
725
+
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727
+ {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
757
+// constraints.gridy += 1;
758
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759
+// speakerMocapCB.addItemListener(this);
760
+
761
+ if (false)
762
+ {
763
+ // handled in scripts
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
766
+ speakerCameraCB.addItemListener(this);
767
+
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
770
+ speakerFocusCB.addItemListener(this);
771
+
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774
+ smoothfocusCB.addItemListener(this);
775
+ }
776
+
777
+//constraints.gridx += 1;
778
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779
+// debugCB.addItemListener(this);
780
+
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
782
+ oeilCB.addItemListener(this);
783
+
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785
+ lookAtCB.setToolTipText("Look-at target");
786
+ lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
795
+
796
+ }
638797
639798 void EditObject(Object3D obj)
640799 {
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();
800
+ cRadio radioButton = new cRadio(obj.name);
801
+ radioButton.SetObject(obj);
802
+ radioButton.layout = sevenButton;
803
+ radioButton.SetCamera(cameraView.renderCamera, false);
804
+ radioButton.addActionListener(this);
805
+ radioPanel.add(radioButton);
806
+ buttonGroup.add(radioButton);
807
+ radioButton.doClick();
649808 }
809
+
650810 void SetupViews(ObjEditor oe)
651811 {
652812 oe.SetupViews();
....@@ -665,6 +825,7 @@
665825 JCheckBox fastCB;
666826 JCheckBox slowCB;
667827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
668829 JCheckBox trackCB;
669830 JCheckBox smoothfocusCB;
670831 // JCheckBox speakerMocapCB;
....@@ -707,8 +868,7 @@
707868 dropAttributes |= Object3D.TEXTURE;
708869 else
709870 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
712872 {
713873 cameraView.ToggleLive();
714874 }
....@@ -745,6 +905,10 @@
745905 Recompile();
746906 cameraView.repaint();
747907 // refreshContents();
908
+ }
909
+ else if(e.getSource() == zoomBoxCB)
910
+ {
911
+ cameraView.ToggleZoomBoxMode();
748912 }
749913 else if(e.getSource() == smoothfocusCB)
750914 {
....@@ -859,7 +1023,9 @@
8591023 // objEditor.DropFile((java.io.File[]) object, true);
8601024 // return;
8611025 // }
862
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631029 {
8641030 // file(s)
8651031 String[] names = string.split("\n");
....@@ -886,7 +1052,7 @@
8861052
8871053 flashIt = false;
8881054 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911057
8921058 if (group.selection.size() == 1)
....@@ -913,11 +1079,11 @@
9131079 {
9141080 loadClipboard(true);
9151081 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
1082
+ pasteInto(false, false);
9171083 } else {
9181084 loadClipboard(false);
9191085 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9211087 }
9221088 }
9231089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1201,37 @@
10351201 torusItem.addActionListener(this);
10361202 superItem = menu.add(new MenuItem("Superellipsoid"));
10371203 superItem.addActionListener(this);
1204
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1205
+ kleinItem.addActionListener(this);
10381206 particleItem = menu.add(new MenuItem("Particle system"));
10391207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10401210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411211 ragdollItem.addActionListener(this);
10421212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431213 ragdoll2Item.addActionListener(this);
1214
+ }
10441215 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461217 meshItem.addActionListener(this);
10471218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10491222 springItem = menu.add(new MenuItem("Spring"));
10501223 springItem.addActionListener(this);
10511224 flagItem = menu.add(new MenuItem("Flag"));
10521225 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);
10571226 blobItem = menu.add(new MenuItem("Blob"));
10581227 blobItem.addActionListener(this);
10591228 latheItem = menu.add(new MenuItem("Lathe"));
10601229 latheItem.addActionListener(this);
1230
+ }
1231
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1232
+ bezierItem.addActionListener(this);
1233
+ overlayItem = menu.add(new MenuItem("Overlay"));
1234
+ overlayItem.addActionListener(this);
10611235 lightItem = menu.add(new MenuItem("Light"));
10621236 lightItem.addActionListener(this);
10631237 menu.add("-");
....@@ -1067,34 +1241,39 @@
10671241 loopItem.addActionListener(this);
10681242 doubleItem = menu.add(new MenuItem("Fork"));
10691243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
10701246 tripleItem = menu.add(new MenuItem("Trident"));
10711247 tripleItem.addActionListener(this);
1248
+ }
10721249 }
10731250
10741251 void buildToolsMenu(Menu menu)
10751252 {
10761253 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771254 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1255
+ animationItem.setState(Globals.ANIMATION);
10791256
10801257 menu.add("-");
10811258 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821259 parseverticesItem.addActionListener(this);
10831260 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841261 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861263 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901265 reduceMorphItem.addActionListener(this);
10911266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921267 reduce34MorphItem.addActionListener(this);
1093
-
1268
+ menu.add("-");
10941269 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951270 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
10981277 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991278 memoryItem.addActionListener(this);
11001279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1108,6 +1287,8 @@
11081287 resetParentItem.addActionListener(this);
11091288 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101289 repairParentItem.addActionListener(this);
1290
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1291
+ repairShadowItem.addActionListener(this);
11111292 menu.add(invariantsItem = new MenuItem("Invariants"));
11121293 invariantsItem.addActionListener(this);
11131294 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1296,7 @@
11151296 menu.add("-");
11161297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171298 editScriptItem.addActionListener(this);
1299
+ }
11181300 }
11191301
11201302 void ScreenFit()
....@@ -1443,9 +1625,9 @@
14431625
14441626 void Overwrite(int mask)
14451627 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471629 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14491631
14501632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511633 content = ((cGroup)content).get(0);
....@@ -1468,6 +1650,7 @@
14681650 //
14691651 public void actionPerformed(ActionEvent event) // , Object arg)
14701652 {
1653
+ Object source = event.getSource();
14711654 /*
14721655 if (event.getSource() == nameField)
14731656 {
....@@ -1479,11 +1662,11 @@
14791662 }
14801663 else
14811664 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1665
+ if (source == lookAtItem || source == lookFromItem)
14831666 {
14841667 ScreenFit();
14851668 } else
1486
- if (event.getSource() == switchItem)
1669
+ if (source == switchItem)
14871670 {
14881671 cVector v1 = new cVector();
14891672 cVector v2 = new cVector();
....@@ -1492,11 +1675,11 @@
14921675 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931676 objEditor.cameraView.repaint();
14941677 } else
1495
- if (event.getSource() == rectoidItem)
1678
+ if (source == rectoidItem)
14961679 {
14971680 makeSomething(new Box());
14981681 } else
1499
- if (event.getSource() == particleItem)
1682
+ if (source == particleItem)
15001683 {
15011684 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021685 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1700,9 @@
15171700 applyExample(particleGeom, "SMOKE");
15181701 makeSomething(particleGeom);
15191702 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1703
+ if (source == ragdollItem || source == ragdoll2Item)
15211704 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1705
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231706
15241707 ragdoll.toParent = LA.newMatrix();
15251708 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1720,7 @@
15371720 } else
15381721 /*
15391722 */
1540
- if (event.getSource() == heightFieldItem)
1723
+ if (source == heightFieldItem)
15411724 {
15421725 Object3D obj = new Object3D();
15431726
....@@ -1575,27 +1758,31 @@
15751758
15761759 makeSomething(obj);
15771760 } else
1578
- if (event.getSource() == gridItem)
1761
+ if (source == gridItem)
15791762 {
15801763 makeSomething(new Grid());
15811764 } else
1582
- if (event.getSource() == ellipsoidItem)
1765
+ if (source == ellipsoidItem)
15831766 {
15841767 makeSomething(new Sphere());
15851768 } else
1586
- if (event.getSource() == coneItem)
1769
+ if (source == coneItem)
15871770 {
15881771 makeSomething(new Cone());
15891772 } else
1590
- if (event.getSource() == torusItem)
1773
+ if (source == torusItem)
15911774 {
15921775 makeSomething(new Torus());
15931776 } else
1594
- if (event.getSource() == superItem)
1777
+ if (source == superItem)
15951778 {
15961779 makeSomething(new Superellipsoid());
15971780 } else
1598
- if (event.getSource() == blobItem)
1781
+ if (source == kleinItem)
1782
+ {
1783
+ makeSomething(new Klein());
1784
+ } else
1785
+ if (source == blobItem)
15991786 {
16001787 Blob blob = new Blob();
16011788 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1790,15 @@
16031790 //blob.retile();
16041791 makeSomething(blob);
16051792 } else
1606
- if (event.getSource() == latheItem)
1793
+ if (source == latheItem)
16071794 {
16081795 makeSomething(new Lathe());
16091796 } else
1610
- if (event.getSource() == bezierItem)
1797
+ if (source == bezierItem)
16111798 {
16121799 makeSomething(new BezierSurface());
16131800 } else
1614
- if (event.getSource() == checkerItem)
1801
+ if (source == overlayItem)
16151802 {
16161803 /*
16171804 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1813,7 @@
16261813 */
16271814 makeSomething(new Checker());
16281815 } else
1629
- if (event.getSource() == meshItem)
1816
+ if (source == meshItem)
16301817 {
16311818 Object3D itemtomake = new Object3D();
16321819 Object3D child;
....@@ -1647,35 +1834,35 @@
16471834 makeSomething(child);
16481835 }
16491836 } else
1650
- if (event.getSource() == springItem)
1837
+ if (source == springItem)
16511838 {
16521839 cSpring s = new cSpring();
16531840 s.setup();
16541841 makeSomething(s);
16551842 } else
1656
- if (event.getSource() == flagItem)
1843
+ if (source == flagItem)
16571844 {
16581845 cSpring s = new cFlag();
16591846 s.setup();
16601847 makeSomething(s);
16611848 } else
1662
- if (event.getSource() == lightItem)
1849
+ if (source == lightItem)
16631850 {
16641851 makeSomething(new Light());
16651852 } else
1666
- if (event.getSource() == csgItem)
1853
+ if (source == csgItem)
16671854 {
16681855 group(new CSG());
16691856 } else
1670
- if (event.getSource() == templateItem)
1857
+ if (source == templateItem)
16711858 {
16721859 group(new cTemplate());
16731860 } else
1674
- if (event.getSource() == attributeItem)
1861
+ if (source == attributeItem)
16751862 {
16761863 makeSomething(new Attribute());
16771864 } else
1678
- if (event.getSource() == pointflowItem)
1865
+ if (source == pointflowItem)
16791866 {
16801867 makeSomething(new PointFlow());
16811868 } else
....@@ -1687,7 +1874,7 @@
16871874 } else
16881875 */
16891876
1690
- if (event.getSource() == superLoopItem)
1877
+ if (source == superLoopItem)
16911878 {
16921879 Composite g = new cGroup();
16931880 for (int i=0; i<15; i++)
....@@ -1709,7 +1896,7 @@
17091896
17101897 group(g);
17111898 } else
1712
- if (event.getSource() == loopItem)
1899
+ if (source == loopItem)
17131900 {
17141901 Composite csg = new GroupLeaf();
17151902 csg.count = 5;
....@@ -1718,7 +1905,7 @@
17181905 csg.addChild(child);
17191906 child.addChild(csg);
17201907 } else
1721
- if (event.getSource() == doubleItem)
1908
+ if (source == doubleItem)
17221909 {
17231910 Composite csg = new GroupLeaf();
17241911 csg.count = 5;
....@@ -1730,7 +1917,7 @@
17301917 csg.addChild(child);
17311918 child.addChild(csg);
17321919 } else
1733
- if (event.getSource() == tripleItem)
1920
+ if (source == tripleItem)
17341921 {
17351922 Composite csg = new GroupLeaf();
17361923 csg.count = 4;
....@@ -1745,71 +1932,71 @@
17451932 csg.addChild(child);
17461933 child.addChild(csg);
17471934 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
1935
+ if (source == computeAOItem)
17501936 {
1751
- ImportGFD();
1937
+ Globals.drawMode = CameraPane.OCCLUSION;
1938
+ Globals.theRenderer.repaint();
17521939 } 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)
1940
+ if (source == recompileItem)
17711941 {
17721942 Recompile();
17731943 refreshContents();
17741944 } else
1775
- if (event.getSource() == editScriptItem)
1945
+ if (source == editScriptItem)
17761946 {
17771947 OpenDialog();
17781948 refreshContents();
17791949 } else
1780
- if (event.getSource() == invariantsItem)
1950
+ if (source == invariantsItem)
17811951 {
17821952 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
17841954 } else
1785
- if (event.getSource() == memoryItem)
1955
+ if (source == memoryItem)
17861956 {
17871957 //System.out.println("Invariants:");
17881958 PrintMemory();
17891959 } else
1790
- if (event.getSource() == pathItem)
1960
+ if (source == pathItem)
17911961 {
17921962 PrintPath();
17931963 } else
1794
- if (event.getSource() == analyzeItem)
1964
+ if (source == analyzeItem)
17951965 {
17961966 AnalyzeObject();
17971967 } else
1798
- if (event.getSource() == dumpItem)
1968
+ if (source == dumpItem)
17991969 {
18001970 DumpObject();
18011971 } else
1802
- if (event.getSource() == screenfitButton)
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
1984
+ if (source == oneStepButton)
1985
+ {
1986
+ Globals.ONESTEP = true;
1987
+ cameraView.repaint();
1988
+ } else
1989
+ if (source == screenfitButton)
18031990 {
18041991 //Reload(lastConverter, lastFilename, true);
18051992 ScreenFit();
18061993 } else
1807
- if (event.getSource() == screenfitpointButton)
1994
+ if (source == screenfitpointButton)
18081995 {
18091996 //Reload(lastConverter, lastFilename, true);
18101997 ScreenFitPoint();
18111998 } else
1812
- if (event.getSource() == snapobjectButton)
1999
+ if (source == snapobjectButton)
18132000 {
18142001 //Reload(lastConverter, lastFilename, true);
18152002 SnapObject();
....@@ -1820,13 +2007,13 @@
18202007 // Recompile();
18212008 // refreshContents();
18222009 // } else
1823
- if (event.getSource() == gcButton)
2010
+ if (source == gcButton)
18242011 {
18252012 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262013 System.gc();
18272014 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282015 } else
1829
- if (event.getSource() == editLeafItem)
2016
+ if (source == editLeafItem)
18302017 {
18312018 Object3D obj;
18322019 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2027,74 @@
18402027 }
18412028 refreshContents(true);
18422029 } else
1843
- if (event.getSource() == openWindowItem)
2030
+ if (source == openWindowItem)
18442031 {
18452032 EditSelection(true);
18462033 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2034
+ if (source == cutItem || source == clearButton)
18482035 {
18492036 loadClipboard(true);
18502037 } else
1851
- if (event.getSource() == duplicateItem)
2038
+ if (source == undoItem)
18522039 {
1853
- Object3D keep = GrafreeD.clipboard;
2040
+ Undo();
2041
+ } else
2042
+ if (source == redoItem)
2043
+ {
2044
+ Redo();
2045
+ } else
2046
+ if (source == duplicateItem)
2047
+ {
2048
+ Object3D keep = Grafreed.clipboard;
18542049 loadClipboard(false);
18552050 paste(false);
1856
- GrafreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
18572052 } else
1858
- if (event.getSource() == cloneItem)
2053
+ if (source == cloneItem)
18592054 {
18602055 CloneSelection(false);
18612056 } else
1862
- if (event.getSource() == cloneSupportItem)
2057
+ if (source == cloneSupportItem)
18632058 {
18642059 CloneSelection(true);
18652060 } else
1866
- if (event.getSource() == copyItem)
2061
+ if (source == copyItem)
18672062 {
18682063 loadClipboard(false);
18692064 } else
1870
- if (event.getSource() == pasteItem)
2065
+ if (source == pasteItem)
18712066 {
18722067 paste(false);
18732068 } else
1874
- if (event.getSource() == pasteLinkItem)
2069
+ if (source == pasteIntoItem)
18752070 {
1876
- pasteInto(false);
2071
+ pasteInto(true, false);
18772072 } else
1878
- if (event.getSource() == pasteCloneItem)
2073
+ if (source == pasteLinkItem)
18792074 {
1880
- pasteInto(true);
2075
+ pasteInto(false, false);
18812076 } else
1882
- if (event.getSource() == pasteExpandItem)
2077
+ if (source == pasteCloneItem)
2078
+ {
2079
+ pasteInto(true, true);
2080
+ } else
2081
+ if (source == pasteExpandItem)
18832082 {
18842083 paste(true);
18852084 } else
1886
- if (event.getSource() == synchronizeItem)
2085
+ if (source == synchronizeItem)
18872086 {
18882087 Overwrite(Object3D.TRANSFORM);
18892088 } else
1890
- if (event.getSource() == overwriteNameItem)
2089
+ if (source == overwriteNameItem)
18912090 {
18922091 Overwrite(Object3D.NAME);
18932092 } else
1894
- if (event.getSource() == overwriteUVItem)
2093
+ if (source == overwriteUVItem)
18952094 {
18962095 Overwrite(Object3D.UV);
18972096 } else
1898
- if (event.getSource() == overwriteMatItem)
2097
+ if (source == overwriteMatItem)
18992098 {
19002099 /* july 2015
19012100 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2114,7 @@
19152114
19162115 Overwrite(dropAttributes);
19172116 }
1918
- if (event.getSource() == overwriteGeoItem)
2117
+ if (source == overwriteGeoItem)
19192118 {
19202119 Overwrite(Object3D.GEOMETRY);
19212120 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2131,7 @@
19322131 // refreshContents();
19332132 // }
19342133 } else
1935
- if (event.getSource() == generateMeshItem)
2134
+ if (source == generateMeshItem)
19362135 {
19372136 //if (group.selection.size() == 1)
19382137 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2142,7 @@
19432142 ResetModel();
19442143 refreshContents();
19452144 } else
1946
- if (event.getSource() == extractGeometriesItem)
2145
+ if (source == extractGeometriesItem)
19472146 {
19482147 boolean one = false;
19492148
....@@ -1970,7 +2169,7 @@
19702169 ResetModel();
19712170 refreshContents();
19722171 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2172
+ if (source == cloneGeometriesItem)
19742173 {
19752174 boolean one = false;
19762175
....@@ -1996,32 +2195,37 @@
19962195 ResetModel();
19972196 refreshContents();
19982197 } else
1999
- if (event.getSource() == shareGeometriesItem)
2198
+ if (source == shareGeometriesItem)
20002199 {
20012200 boolean one = false;
20022201
20032202 if (group.selection.size() == 1)
20042203 one = true;
20052204
2205
+ Object3D merge = null;
2206
+
20062207 Object3D content = new cGroup();
20072208
20082209 for (int i=0; i<group.selection.size(); i++)
20092210 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2211
+ merge = new Merge(group.selection.get(i));
20112212
20122213 if (one)
2013
- makeSomething(sel, false);
2214
+ makeSomething(merge, false);
20142215 else
2015
- content.addChild(sel);
2216
+ content.addChild(merge);
20162217 }
20172218
20182219 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2220
+ makeSomething(content, true);
2221
+ else
2222
+ {
2223
+ ResetModel();
2224
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2225
+ refreshContents();
2226
+ }
20232227 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2228
+ if (source == mergeGeometriesItem)
20252229 {
20262230 boolean one = false;
20272231
....@@ -2051,7 +2255,7 @@
20512255 ResetModel();
20522256 refreshContents();
20532257 } else
2054
- if (event.getSource() == linkverticesItem)
2258
+ if (source == linkverticesItem)
20552259 {
20562260 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572261 // {
....@@ -2064,39 +2268,48 @@
20642268 // group.selection.get(0).setMasterThis(content); // should be identity
20652269 // refreshContents();
20662270 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682272 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
20702274
20712275 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722276 content = ((cGroup)content).get(0);
20732277
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2278
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752279 for (int i=0; i<group.selection.size(); i++)
20762280 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
20792283 group.selection.get(i).linkVerticesThis(content);
20802284 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
20822286 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2287
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842288 refreshContents();
20852289 }
20862290 } else
2087
- if (event.getSource() == resetsupportItem)
2291
+ if (source == resetsupportItem)
20882292 {
20892293 for (int i=0; i<group.selection.size(); i++)
20902294 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
20932297 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
20952299 }
20962300
20972301 refreshContents();
20982302 } else
2099
- if (event.getSource() == resetreferencesItem)
2303
+ if (source == relinkverticesItem)
2304
+ {
2305
+ boolean random = CameraPane.SWITCH;
2306
+ CameraPane.SWITCH = false; // parse all random nodes
2307
+ group.selection.RelinkToSupport();
2308
+ CameraPane.SWITCH = random;
2309
+
2310
+ refreshContents();
2311
+ } else
2312
+ if (source == resetreferencesItem)
21002313 {
21012314 for (int i=0; i<group.selection.size(); i++)
21022315 {
....@@ -2105,11 +2318,11 @@
21052318
21062319 refreshContents();
21072320 } else
2108
- if (event.getSource() == setMasterItem)
2321
+ if (source == setMasterItem)
21092322 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112324 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
21132326
21142327 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152328 content = ((cGroup)content).get(0);
....@@ -2118,13 +2331,13 @@
21182331 refreshContents();
21192332 }
21202333 } else
2121
- if (event.getSource() == poseMeshItem)
2334
+ if (source == poseMeshItem)
21222335 {
21232336 if (group.selection.size() == 1)
21242337 {
2125
- if (GrafreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
21262339 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21282341
21292342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302343 content = ((cGroup)content).get(0);
....@@ -2137,19 +2350,19 @@
21372350 }
21382351
21392352 } else
2140
- if (event.getSource() == revertMeshItem)
2353
+ if (source == revertMeshItem)
21412354 {
21422355 RevertMeshes();
21432356 } else
2144
- if (event.getSource() == resetMeshItem)
2357
+ if (source == resetAllItem)
21452358 {
21462359 ResetAll();
21472360 } else
2148
- if (event.getSource() == stepAllItem)
2361
+ if (source == stepAllItem)
21492362 {
21502363 StepAll();
21512364 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2365
+ if (source == clearItem) // || event.getSource() == clearButton)
21532366 {
21542367 //int indices[] = jList.getSelectedIndices();
21552368 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2370,46 @@
21572370
21582371 ClearSelection(false);
21592372 } else
2160
- if (event.getSource() == clearAllItem)
2373
+ if (source == clearAllItem)
21612374 {
21622375 ClearSelection(true);
21632376 } else
2164
- if (event.getSource() == grabItem)
2377
+ if (source == grabItem)
21652378 {
21662379 group(new cGroup(), true);
21672380 } else
2168
- if (event.getSource() == frontItem)
2381
+ if (source == hideItem)
2382
+ {
2383
+ group(new HiddenObject());
2384
+ } else
2385
+ if (source == frontItem)
21692386 {
21702387 front();
21712388 } else
2172
- if (event.getSource() == backItem)
2389
+ if (source == backItem)
21732390 {
21742391 back();
21752392 } else
2176
- if (event.getSource() == cameraItem)
2393
+ if (source == cameraItem)
21772394 {
21782395 makeSomething(new Camera());
21792396 } else
2180
- if (event.getSource() == compositeItem)
2397
+ if (source == compositeItem)
21812398 {
21822399 group(new Composite());
21832400 } else
2184
- if (event.getSource() == randomItem)
2401
+ if (source == randomItem)
21852402 {
21862403 RandomNode random = new RandomNode();
21872404 group(random);
21882405 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
21902407 } else
2191
- if (event.getSource() == physicsItem)
2408
+ if (source == physicsItem)
21922409 {
21932410 group(new PhysicsNode());
21942411 } else
2195
- if (event.getSource() == frameselectorItem)
2412
+ if (source == frameselectorItem)
21962413 {
21972414 for (int i=0; i<group.selection.size(); i++)
21982415 {
....@@ -2204,7 +2421,7 @@
22042421 ResetModel();
22052422 refreshContents();
22062423 } else
2207
- if (event.getSource() == switchGeoItem)
2424
+ if (source == switchGeoItem)
22082425 {
22092426 for (int i=0; i<group.selection.size(); i++)
22102427 {
....@@ -2216,7 +2433,7 @@
22162433 ResetModel();
22172434 refreshContents();
22182435 } else
2219
- if (event.getSource() == switchTransfoItem)
2436
+ if (source == switchTransfoItem)
22202437 {
22212438 for (int i=0; i<group.selection.size(); i++)
22222439 {
....@@ -2228,7 +2445,7 @@
22282445 ResetModel();
22292446 refreshContents();
22302447 } else
2231
- if (event.getSource() == morphItem)
2448
+ if (source == morphItem)
22322449 {
22332450 for (int i=0; i<group.selection.size(); i++)
22342451 {
....@@ -2240,7 +2457,7 @@
22402457 ResetModel();
22412458 refreshContents();
22422459 } else
2243
- if (event.getSource() == scriptNodeItem)
2460
+ if (source == scriptNodeItem)
22442461 {
22452462 boolean atleastone = false;
22462463
....@@ -2279,199 +2496,223 @@
22792496 }
22802497 }
22812498 } else
2282
- if (event.getSource() == linkerItem)
2499
+ if (source == linkerItem)
22832500 {
22842501 group(new cLinker());
22852502 } else
2286
- if (event.getSource() == textureItem)
2503
+ if (source == textureItem)
22872504 {
22882505 group(new TextureNode());
22892506 } else
2290
- if (event.getSource() == shadowXItem)
2507
+ if (source == billboardItem)
2508
+ {
2509
+ group(new BillboardNode());
2510
+ } else
2511
+ if (source == shadowXItem)
22912512 {
22922513 CastShadow(0);
22932514 } else
2294
- if (event.getSource() == shadowYItem)
2515
+ if (source == shadowYItem)
22952516 {
22962517 CastShadow(1);
22972518 } else
2298
- if (event.getSource() == shadowZItem)
2519
+ if (source == shadowZItem)
22992520 {
23002521 CastShadow(2);
23012522 } else
2302
- if (event.getSource() == ungroupItem)
2523
+ if (source == ungroupItem)
23032524 {
2304
- ungroup();
2525
+ //ungroup();
2526
+ for (int i=0; i<group.selection.size(); i++)
2527
+ {
2528
+ Ungroup(group.selection.get(i));
2529
+ }
2530
+
2531
+ ClearSelection(false);
2532
+
2533
+ refreshContents();
23052534 } else
2306
- if (event.getSource() == genUVItem)
2535
+ if (source == genUVItem)
23072536 {
23082537 GenUV();
23092538 } else
2310
- if (event.getSource() == genNormalsCADItem)
2539
+ if (source == genNormalsCADItem)
23112540 {
23122541 GenNormals(true);
23132542 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2543
+ if (source == genNormalsMESHItem)
23152544 {
23162545 GenNormals(true); // TODO
23172546 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2547
+ if (source == genNormalsORGANItem)
23192548 {
23202549 GenNormals(false);
23212550 } else
2322
- if (event.getSource() == stripifyItem)
2551
+ if (source == genNormalsMINEItem)
2552
+ {
2553
+ GenNormalsMINE();
2554
+ } else
2555
+ if (source == stripifyItem)
23232556 {
23242557 Stripify();
23252558 } else
2326
- if (event.getSource() == unstripifyItem)
2559
+ if (source == unstripifyItem)
23272560 {
23282561 Unstripify();
23292562 } else
2330
- if (event.getSource() == trimItem)
2563
+ if (source == trimItem)
23312564 {
23322565 Trim();
23332566 } else
2334
- if (event.getSource() == untrimItem)
2567
+ if (source == untrimItem)
23352568 {
23362569 Untrim();
23372570 } else
2338
- if (event.getSource() == clearColorsItem)
2571
+ if (source == clearColorsItem)
23392572 {
23402573 ClearColors();
23412574 } else
2342
- if (event.getSource() == clearMaterialsItem)
2575
+ if (source == clearMaterialsItem)
23432576 {
23442577 ClearMaterials();
23452578 } else
2346
- if (event.getSource() == liveleavesItem)
2579
+ if (source == liveleavesItem)
23472580 {
23482581 LiveLeaves(true);
23492582 } else
2350
- if (event.getSource() == unliveleavesItem)
2583
+ if (source == unliveleavesItem)
23512584 {
23522585 LiveLeaves(false);
23532586 } else
2354
- if (event.getSource() == supportleavesItem)
2587
+ if (source == supportleavesItem)
23552588 {
23562589 SupportLeaves(true);
23572590 } else
2358
- if (event.getSource() == unsupportleavesItem)
2591
+ if (source == unsupportleavesItem)
23592592 {
23602593 SupportLeaves(false);
23612594 } else
2362
- if (event.getSource() == hideleavesItem)
2595
+ if (source == hideleavesItem)
23632596 {
23642597 HideLeaves(true);
23652598 } else
2366
- if (event.getSource() == showleavesItem)
2599
+ if (source == showleavesItem)
23672600 {
23682601 HideLeaves(false);
23692602 } else
2370
- if (event.getSource() == markleavesItem)
2603
+ if (source == markleavesItem)
23712604 {
23722605 MarkLeaves(true);
23732606 } else
2374
- if (event.getSource() == unmarkleavesItem)
2607
+ if (source == unmarkleavesItem)
23752608 {
23762609 MarkLeaves(false);
23772610 } else
2378
- if (event.getSource() == flipVItem)
2611
+ if (source == flipVItem)
23792612 {
23802613 FlipV(true);
23812614 } else
2382
- if (event.getSource() == unflipVItem)
2615
+ if (source == unflipVItem)
23832616 {
23842617 FlipV(false);
23852618 } else
2386
- if (event.getSource() == lowTexturesItem)
2619
+ if (source == lowTexturesItem)
23872620 {
23882621 SetTexRes(0);
23892622 } else
2390
- if (event.getSource() == normalTexturesItem)
2623
+ if (source == normalTexturesItem)
23912624 {
23922625 SetTexRes(1);
23932626 } else
2394
- if (event.getSource() == highTexturesItem)
2627
+ if (source == highTexturesItem)
23952628 {
23962629 SetTexRes(2);
23972630 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2631
+ if (source == veryhighTexturesItem)
23992632 {
24002633 SetTexRes(3);
24012634 } else
2402
- if (event.getSource() == maxTexturesItem)
2635
+ if (source == maxTexturesItem)
24032636 {
24042637 SetTexRes(4);
24052638 } else
2406
- if (event.getSource() == panoTexturesItem)
2639
+ if (source == panoTexturesItem)
24072640 {
24082641 SetTexRes(5);
24092642 } else
2410
- if (event.getSource() == reverseNormalsItem)
2643
+ if (source == reverseNormalsItem)
24112644 {
24122645 ReverseNormals();
24132646 } else
2414
- if (event.getSource() == parseverticesItem)
2647
+ if (source == parseverticesItem)
24152648 {
24162649 ParseVertices();
24172650 } else
2418
- if (event.getSource() == textureFieldItem)
2651
+ if (source == textureFieldItem)
24192652 {
24202653 TextureVertices();
24212654 } else
2422
- if (event.getSource() == alignItem)
2655
+ if (source == alignItem)
24232656 {
24242657 Align();
24252658 } else
2426
- if (event.getSource() == mirrorItem)
2659
+ if (source == mirrorItem)
24272660 {
24282661 MirrorPoses();
24292662 } else
2430
- if (event.getSource() == reduceMorphItem)
2663
+ if (source == reduceMorphItem)
24312664 {
24322665 MeshReduction(false);
24332666 } else
2434
- if (event.getSource() == reduce34MorphItem)
2667
+ if (source == reduce34MorphItem)
24352668 {
24362669 MeshReduction(true);
24372670 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2671
+ if (source == reverseTrianglesItem)
24392672 {
24402673 ReverseTriangles();
24412674 } else
2442
- if (event.getSource() == reduceMeshItem)
2675
+ if (source == reduceMeshItem)
24432676 {
24442677 ReduceMesh(false);
24452678 } else
2446
- if (event.getSource() == reduce34MeshItem)
2679
+ if (source == reduce34MeshItem)
24472680 {
24482681 ReduceMesh(true);
24492682 } else
2450
- if (event.getSource() == increaseMeshItem)
2683
+ if (source == increaseMeshItem)
24512684 {
24522685 IncreaseMesh();
24532686 } else
2454
- if (event.getSource() == clipMeshItem)
2687
+ if (source == clipMeshItem)
24552688 {
24562689 ClipMesh();
24572690 } else
2458
- if (event.getSource() == smoothMeshItem)
2691
+ if (source == smoothMeshItem)
24592692 {
24602693 SmoothMesh();
24612694 } else
2462
- if (event.getSource() == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
24632696 {
24642697 TransformGeometry();
24652698 } else
2466
- if (event.getSource() == resetTransformItem)
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
2702
+ } else
2703
+ if (source == resetTransformItem)
24672704 {
24682705 ResetTransform();
24692706 } else
2470
- if (event.getSource() == resetCentroidItem)
2707
+ if (source == resetCentroidItem)
24712708 {
2472
- ResetCentroid();
2709
+ ResetCentroid(true);
24732710 } else
2474
- if (event.getSource() == resetParentItem)
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
2714
+ } else
2715
+ if (source == resetParentItem)
24752716 {
24762717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772718 {
....@@ -2481,7 +2722,7 @@
24812722
24822723 refreshContents();
24832724 } else
2484
- if (event.getSource() == repairParentItem)
2725
+ if (source == repairParentItem)
24852726 {
24862727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872728 {
....@@ -2495,7 +2736,21 @@
24952736
24962737 refreshContents();
24972738 } else
2498
- if (event.getSource() == sortbysizeItem)
2739
+ if (source == repairShadowItem)
2740
+ {
2741
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2742
+ {
2743
+ Object3D obj = (Object3D)e.nextElement();
2744
+ obj.RepairShadow();
2745
+// for (int i=0; i<obj.size(); i++)
2746
+// {
2747
+// obj.get(i).parent = obj;
2748
+// }
2749
+ }
2750
+
2751
+ refreshContents();
2752
+ } else
2753
+ if (source == sortbysizeItem)
24992754 {
25002755 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012756 {
....@@ -2507,7 +2762,7 @@
25072762 ResetModel();
25082763 refreshContents();
25092764 } else
2510
- if (event.getSource() == sortbynameItem)
2765
+ if (source == sortbynameItem)
25112766 {
25122767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132768 {
....@@ -2519,7 +2774,7 @@
25192774 ResetModel();
25202775 refreshContents();
25212776 } else
2522
- if (event.getSource() == attachPigmentItem)
2777
+ if (source == attachPigmentItem)
25232778 {
25242779 String texture = GetFile("Attach pigment");
25252780 Object3D obj;
....@@ -2531,7 +2786,7 @@
25312786
25322787 refreshContents();
25332788 } else
2534
- if (event.getSource() == detachPigmentItem)
2789
+ if (source == detachPigmentItem)
25352790 {
25362791 Object3D obj;
25372792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2797,7 @@
25422797
25432798 refreshContents();
25442799 } else
2545
- if (event.getSource() == attachBumpItem)
2800
+ if (source == attachBumpItem)
25462801 {
25472802 String texture = GetFile("Attach bump");
25482803 Object3D obj;
....@@ -2554,7 +2809,7 @@
25542809
25552810 refreshContents();
25562811 } else
2557
- if (event.getSource() == detachBumpItem)
2812
+ if (source == detachBumpItem)
25582813 {
25592814 Object3D obj;
25602815 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2820,7 @@
25652820
25662821 refreshContents();
25672822 } else
2568
- if (event.getSource() == pigmentBumpItem)
2823
+ if (source == pigmentBumpItem)
25692824 {
25702825 Object3D obj;
25712826 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2831,195 @@
25762831
25772832 refreshContents();
25782833 } else
2579
- if (event.getSource() == flashSelectionButton)
2834
+ if (source == flashSelectionButton)
25802835 {
25812836 CameraPane.flash = true;
25822837 refreshContents();
25832838 } else
2584
- if (event.getSource() == oneButton)
2839
+ if (source == oneButton)
25852840 {
25862841 } else
2587
- if (event.getSource() == twoButton)
2842
+ if (source == twoButton)
25882843 {
25892844 radio.layout = twoButton;
25902845 // bug
25912846 //gridPanel.setDividerLocation(1.0);
25922847 //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();
2848
+// bigThree.remove(scenePanel);
2849
+// bigThree.remove(centralPanel);
2850
+// bigThree.remove(XYZPanel);
2851
+// aWindowConstraints.gridx = 0;
2852
+// aWindowConstraints.gridy = 0;
2853
+// aWindowConstraints.gridwidth = 1;
2854
+// // aConstraints.gridheight = 3;
2855
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2856
+// aWindowConstraints.weightx = 0;
2857
+// aWindowConstraints.weighty = 1;
2858
+// //bigThree.add(jtp, aWindowConstraints);
2859
+// aWindowConstraints.weightx = 1;
2860
+// aWindowConstraints.gridwidth = 3;
2861
+// // aConstraints.gridheight = 3;
2862
+// aWindowConstraints.gridx = 1;
2863
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2864
+// bigThree.add(centralPanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 0;
2866
+// aWindowConstraints.gridx = 4;
2867
+// aWindowConstraints.gridwidth = 1;
2868
+// // aConstraints.gridheight = 3;
2869
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2870
+// //bigThree.add(XYZPanel, aWindowConstraints);
2871
+// scenePanel.setVisible(false);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(centralPanel);
2876
+ bigThree.FlushUI();
26172877 } else
2618
- if (event.getSource() == threeButton)
2878
+ if (source == threeButton)
26192879 {
26202880 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();
2881
+
2882
+// bigThree.remove(scenePanel);
2883
+// bigThree.remove(centralPanel);
2884
+// bigThree.remove(XYZPanel);
2885
+// aWindowConstraints.gridx = 0;
2886
+// aWindowConstraints.gridy = 0;
2887
+// aWindowConstraints.gridwidth = 1;
2888
+// // aConstraints.gridheight = 3;
2889
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2890
+// aWindowConstraints.weightx = 0;
2891
+// aWindowConstraints.weighty = 1;
2892
+// //bigThree.add(jtp, aWindowConstraints);
2893
+// aWindowConstraints.weightx = 1;
2894
+// aWindowConstraints.gridwidth = 3;
2895
+// // aConstraints.gridheight = 3;
2896
+// aWindowConstraints.gridx = 1;
2897
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2898
+// bigThree.add(centralPanel, aWindowConstraints);
2899
+// aWindowConstraints.weightx = 0;
2900
+// aWindowConstraints.gridx = 4;
2901
+// aWindowConstraints.gridwidth = 1;
2902
+// // aConstraints.gridheight = 3;
2903
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2904
+// bigThree.add(XYZPanel, aWindowConstraints);
2905
+// bigThree.validate();
2906
+// scenePanel.setVisible(false);
2907
+// centralPanel.setVisible(true);
2908
+// XYZPanel.setVisible(true);
2909
+ bigThree.ClearUI();
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.add(XYZPanel);
2912
+ bigThree.FlushUI();
26452913 } else
2646
- if (event.getSource() == fourButton)
2914
+ if (source == fourButton)
26472915 {
26482916 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();
2917
+
2918
+// bigThree.remove(scenePanel);
2919
+// bigThree.remove(centralPanel);
2920
+// bigThree.remove(XYZPanel);
2921
+// aWindowConstraints.gridx = 0;
2922
+// aWindowConstraints.gridy = 0;
2923
+// aWindowConstraints.gridwidth = 1;
2924
+// // aWindowConstraints.gridheight = 3;
2925
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.weighty = 1;
2928
+// bigThree.add(scenePanel, aWindowConstraints);
2929
+// aWindowConstraints.weightx = 1;
2930
+// aWindowConstraints.gridwidth = 3;
2931
+// // aConstraints.gridheight = 3;
2932
+// aWindowConstraints.gridx = 1;
2933
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2934
+// //bigThree.add(cameraPanel, aWindowConstraints);
2935
+// aWindowConstraints.weightx = 0;
2936
+// aWindowConstraints.gridx = 4;
2937
+// aWindowConstraints.gridwidth = 1;
2938
+// // aWindowConstraints.gridheight = 3;
2939
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2940
+// //bigThree.add(XYZPanel, aWindowConstraints);
2941
+// bigThree.validate();
2942
+// scenePanel.setVisible(true);
2943
+// centralPanel.setVisible(false);
2944
+// XYZPanel.setVisible(false);
2945
+ bigThree.ClearUI();
2946
+ bigThree.add(scenePanel);
2947
+ bigThree.FlushUI();
26732948 } else
2674
- if (event.getSource() == sixButton)
2949
+ if (source == sixButton)
26752950 {
26762951 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();
2952
+
2953
+// bigThree.remove(scenePanel);
2954
+// bigThree.remove(centralPanel);
2955
+// bigThree.remove(XYZPanel);
2956
+// aWindowConstraints.gridx = 0;
2957
+// aWindowConstraints.gridy = 0;
2958
+// aWindowConstraints.gridwidth = 1;
2959
+// // aConstraints.gridheight = 3;
2960
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2961
+// aWindowConstraints.weightx = 0;
2962
+// aWindowConstraints.weighty = 1;
2963
+// bigThree.add(scenePanel, aWindowConstraints);
2964
+// aWindowConstraints.weightx = 1;
2965
+// aWindowConstraints.gridwidth = 3;
2966
+// // aWindowConstraints.gridheight = 3;
2967
+// aWindowConstraints.gridx = 1;
2968
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2969
+// bigThree.add(centralPanel, aWindowConstraints);
2970
+// aWindowConstraints.weightx = 0;
2971
+// aWindowConstraints.gridx = 4;
2972
+// aWindowConstraints.gridwidth = 1;
2973
+// // aWindowConstraints.gridheight = 3;
2974
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2975
+// //bigThree.add(XYZPanel, aConstraints);
2976
+// bigThree.validate();
2977
+// scenePanel.setVisible(true);
2978
+// centralPanel.setVisible(true);
2979
+// XYZPanel.setVisible(false);
2980
+ bigThree.ClearUI();
2981
+ bigThree.add(scenePanel);
2982
+ bigThree.add(centralPanel);
2983
+ bigThree.FlushUI();
27012984 } else
2702
- if (event.getSource() == sevenButton)
2985
+ if (source == sevenButton)
27032986 {
27042987 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();
2988
+
2989
+// bigThree.remove(scenePanel);
2990
+// bigThree.remove(centralPanel);
2991
+// bigThree.remove(XYZPanel);
2992
+// aWindowConstraints.gridx = 0;
2993
+// aWindowConstraints.gridy = 0;
2994
+// aWindowConstraints.gridwidth = 1;
2995
+// // aWindowConstraints.gridheight = 3;
2996
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2997
+// aWindowConstraints.weightx = 0;
2998
+// aWindowConstraints.weighty = 1;
2999
+// bigThree.add(scenePanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 1;
3001
+// aWindowConstraints.gridwidth = 3;
3002
+// // aWindowConstraints.gridheight = 3;
3003
+// aWindowConstraints.gridx = 1;
3004
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3005
+// bigThree.add(centralPanel, aWindowConstraints);
3006
+// aWindowConstraints.weightx = 0;
3007
+// aWindowConstraints.gridx = 4;
3008
+// aWindowConstraints.gridwidth = 1;
3009
+// // aConstraints.gridheight = 3;
3010
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3011
+// bigThree.add(XYZPanel, aWindowConstraints);
3012
+// bigThree.validate();
3013
+// scenePanel.setVisible(true);
3014
+// centralPanel.setVisible(true);
3015
+// XYZPanel.setVisible(true);
3016
+ bigThree.ClearUI();
3017
+ bigThree.add(scenePanel);
3018
+ bigThree.add(centralPanel);
3019
+ bigThree.add(XYZPanel);
3020
+ bigThree.FlushUI();
27293021 } else
2730
- if (event.getSource() == rootButton)
3022
+ if (source == rootButton)
27313023 {
27323024 Object3D obj;
27333025 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +3031,7 @@
27393031
27403032 refreshContents(true);
27413033 } else
2742
- if (event.getSource() == closeButton)
3034
+ if (source == closeButton)
27433035 {
27443036 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453037 cRadio ab;
....@@ -2760,11 +3052,11 @@
27603052 }
27613053 refreshContents(true);
27623054 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3055
+ if (source == editItem || source == editButton)
27643056 {
27653057 EditSelection(false);
27663058 } else
2767
- if (event.getSource() == uneditButton)
3059
+ if (source == uneditButton)
27683060 {
27693061 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703062 {
....@@ -2774,14 +3066,14 @@
27743066 child.CloseUI();
27753067 listUI.remove(child);
27763068
2777
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
27783070 }
2779
- objEditor.ctrlPanel.revalidate();
3071
+ objEditor.ctrlPanel.FlushUI();
27803072 //objEditor.jTree.clearSelection();
27813073 //objEditor.ResetSliders();
27823074 refreshContents(true);
27833075 } else
2784
- if (event.getSource() == clearPanelButton)
3076
+ if (source == clearPanelButton)
27853077 {
27863078 assert(copy == group);
27873079 //copy.ClearUI();
....@@ -2792,7 +3084,7 @@
27923084 listUI.clear();
27933085 refreshContents(true);
27943086 } else
2795
- if (event.getSource() == allParamsButton)
3087
+ if (source == allParamsButton)
27963088 {
27973089 assert(copy == group);
27983090
....@@ -2813,19 +3105,19 @@
28133105
28143106 refreshContents(true);
28153107 } else
2816
- if (event.getSource() == unselectButton)
3108
+ if (source == unselectButton)
28173109 {
28183110 objEditor.jTree.clearSelection();
28193111 // ?? oct 2012 GrafreeD.clipboard.clear();
28203112 objEditor.ResetSliders();
28213113 refreshContents(true);
28223114 } else
2823
- if(event.getSource() instanceof cRadio)
3115
+ if(source instanceof cRadio)
28243116 {
28253117 group.parent = keepparent;
28263118 group.attributes = 0;
28273119 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3120
+ /*cRadio*/ radio = (cRadio)source;
28293121 Object3D obj = radio.GetObject();
28303122 System.out.println("Edit " + obj);
28313123 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3137,7 @@
28453137 }
28463138
28473139 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3140
+ //Globals.theRenderer.object = group;
28493141 if(!useclient)
28503142 {
28513143 cameraView.renderCamera = radio.camera;
....@@ -2854,12 +3146,16 @@
28543146 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553147 cameraView.targetLookAt.set(radio.camera.lookAt);
28563148 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3149
+ //cameraView.lighttouched = true;
3150
+ Globals.lighttouched = true;
28583151 topView.object = group;
28593152 frontView.object = group;
28603153 sideView.object = group;
28613154 }
3155
+
3156
+// fix "+" issue
28623157 group.editWindow = this;
3158
+
28633159 /*
28643160 currentLayout = radio.layout;
28653161 if (currentLayout == null)
....@@ -2872,7 +3168,20 @@
28723168 //group.attributes = -1;
28733169 ResetModel();
28743170 refreshContents(true);
2875
- }
3171
+ } else if (event.getSource() == editCameraItem)
3172
+ {
3173
+ cameraView.ProtectCamera();
3174
+ cameraView.repaint();
3175
+ return;
3176
+ } else if (event.getSource() == revertCameraItem)
3177
+ {
3178
+ cameraView.RevertCamera();
3179
+ cameraView.repaint();
3180
+ return;
3181
+ // } else if (event.getSource() == textureButton)
3182
+ // {
3183
+ // return; // true;
3184
+ }
28763185 else
28773186 {
28783187 //return super.action(event, arg);
....@@ -2890,7 +3199,7 @@
28903199 if (useclient)
28913200 {
28923201 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3202
+ Globals.lighttouched = true;
28943203 //topView.object = client;
28953204 //frontView.object = client;
28963205 //sideView.object = client;
....@@ -2898,7 +3207,7 @@
28983207 else
28993208 {
29003209 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3210
+ Globals.lighttouched = true;
29023211 //topView.object = group;
29033212 //frontView.object = group;
29043213 //sideView.object = group;
....@@ -2933,6 +3242,28 @@
29333242 refreshContents();
29343243 }
29353244
3245
+ void TransformChildren()
3246
+ {
3247
+ Object3D obj;
3248
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3249
+ {
3250
+ obj = (Object3D)e.nextElement();
3251
+ obj.KeepTextureMatrices();
3252
+ obj.TransformChildren();
3253
+ obj.RestoreTextureMatrices();
3254
+
3255
+// if (obj.parent == null)
3256
+// {
3257
+// System.out.println("NULL PARENT!");
3258
+// new Exception().printStackTrace();
3259
+// }
3260
+// else
3261
+// TouchTransform(obj);
3262
+// //obj.parent.Touch();
3263
+ }
3264
+
3265
+ refreshContents();
3266
+ }
29363267
29373268 void ResetTransform()
29383269 {
....@@ -3045,7 +3376,7 @@
30453376 refreshContents();
30463377 }
30473378
3048
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
30493380 {
30503381 Object3D obj;
30513382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3391,16 @@
30603391 LA.matIdentity(Object3D.mat);
30613392 obj.getBounds(minima, maxima, false);
30623393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653397 obj.TransformMesh(Object3D.mat);
3398
+
30663399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
30693404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3429,8 @@
30943429
30953430 int size = obj.MemorySize();
30963431
3097
- System.err.println((size/1024) + " KB is the size of " + obj);
3432
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30983434 }
30993435 }
31003436 catch (Exception e)
....@@ -3131,9 +3467,9 @@
31313467 obj = (Object3D)e.nextElement();
31323468
31333469 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3470
+ Grafreed.AnalyzeObject(obj);
31353471 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3472
+ Grafreed.AnalyzeObject(obj.bRep);
31373473
31383474 // System.err.println((size/1024) + " KB is the size of " + obj);
31393475 }
....@@ -3175,6 +3511,13 @@
31753511 void GenNormals(boolean crease)
31763512 {
31773513 group.GenNormalsS(crease);
3514
+
3515
+ refreshContents();
3516
+ }
3517
+
3518
+ void GenNormalsMINE()
3519
+ {
3520
+ group.selection.GenNormalsMINE();
31783521
31793522 refreshContents();
31803523 }
....@@ -3340,8 +3683,8 @@
33403683
33413684 void ParseVertices()
33423685 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
3686
+ boolean epsequal = Grafreed.epsequal;
3687
+ Grafreed.epsequal = true;
33453688
33463689 for (int i=0; i<group.selection.size(); i++)
33473690 {
....@@ -3366,7 +3709,7 @@
33663709 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33673710 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33683711
3369
- g.add(GrafreeD.clipboard);
3712
+ g.add(Grafreed.clipboard);
33703713
33713714 buffer.add(g);
33723715 }
....@@ -3381,7 +3724,7 @@
33813724 makeSomething(buffer, i==group.selection.size()-1);
33823725 }
33833726
3384
- GrafreeD.epsequal = epsequal;
3727
+ Grafreed.epsequal = epsequal;
33853728
33863729 refreshContents();
33873730 }
....@@ -3399,7 +3742,16 @@
33993742 String pigment = Object3D.GetPigment(tex);
34003743 //String bump = Object3D.GetBump(tex);
34013744
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3745
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3746
+
3747
+ try
3748
+ {
3749
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3750
+ }
3751
+ catch (Exception e)
3752
+ {
3753
+ System.err.println("FAIL: " + node);
3754
+ }
34033755
34043756 double s = v.s;
34053757
....@@ -3447,12 +3799,26 @@
34473799
34483800 void Align()
34493801 {
3802
+ if (group.selection.size() == 0)
3803
+ return;
3804
+
3805
+ cVector bbmin = new cVector();
3806
+ cVector bbmax = new cVector();
3807
+
3808
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3809
+
3810
+ double dx = bbmax.x - bbmin.x;
3811
+ double dy = bbmax.y - bbmin.y;
3812
+ double dz = bbmax.z - bbmin.z;
3813
+
3814
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3815
+
34503816 for (int i=0; i<group.selection.size(); i++)
34513817 {
34523818 Object3D obj = group.selection.get(i);
34533819
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3820
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3821
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563822 }
34573823
34583824 refreshContents();
....@@ -3473,11 +3839,11 @@
34733839
34743840 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753841
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3842
+ boolean random = CameraPane.SWITCH;
3843
+ CameraPane.SWITCH = false; // parse all random nodes
34783844 lowres.linkVerticesThis(null);
34793845 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3846
+ CameraPane.SWITCH = random;
34813847
34823848 System.err.flush();
34833849
....@@ -3517,7 +3883,7 @@
35173883 return;
35183884
35193885 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
3886
+ Object3D ref = Grafreed.clipboard.get(0);
35213887
35223888 Object3D newgroup = new Object3D("Po:" + poses.name);
35233889
....@@ -3686,7 +4052,7 @@
36864052 group.selection.RelinkToSupport(); // july 2014
36874053 System.out.println("DONE.");
36884054 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4055
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904056 }
36914057
36924058 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4077,9 @@
37114077
37124078 void ClipMesh()
37134079 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4080
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154081 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4082
+ Object3D content = Grafreed.clipboard.get(0);
37174083
37184084 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194085 content = ((cGroup)content).get(0);
....@@ -3722,7 +4088,7 @@
37224088 // {
37234089 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244090 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4091
+ group.selection.ClipMesh(Grafreed.clipboard);
37264092 }
37274093 // group.selection.ClipMesh(GrafreeD.clipboard);
37284094 System.out.println("DONE.");
....@@ -3857,7 +4223,7 @@
38574223 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584224
38594225 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4226
+ if(elem != group || !newWindow)
38614227 {
38624228 // if (!(elem instanceof Composite))
38634229 // newWindow = false;
....@@ -3962,25 +4328,28 @@
39624328 System.err.println("info : " + child.GetPath());
39634329 }
39644330 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4331
+// else
4332
+// {
4333
+// objEditor.SetMaterial(group); // .GetMaterial());
4334
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4335
+// System.err.println("info : " + group.GetPath());
4336
+// }
39714337
39724338 objEditor.SetText(); // jan 2014
39734339
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4340
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39754341 CameraPane.flash = true;
39764342
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4343
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784344 // a camera
39794345 {
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;
4346
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4347
+ {
4348
+ CameraPane.camerachangeframe = 0; // don't refuse it
4349
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4350
+ }
4351
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4352
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844353 }
39854354
39864355 refreshContents();
....@@ -4062,16 +4431,18 @@
40624431 {
40634432 if (group.selection.isEmpty())
40644433 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4434
+
4435
+ Grafreed.clipboardIsTempGroup = false;
40664436 Composite tGroup = null;
40674437 if (group.selection.size() > 0) // 1)
40684438 {
40694439 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4440
+ Grafreed.clipboardIsTempGroup = true;
40714441 }
40724442
40734443 if (cut)
40744444 {
4445
+ Save();
40754446 //int indices[] = jList.getSelectedIndices();
40764447 //for (int i = indices.length - 1; i >= 0; i--)
40774448 //jList.remove(indices[i]);
....@@ -4107,16 +4478,16 @@
41074478 //System.out.println("cut " + child);
41084479 //System.out.println("parent = " + child.parent);
41094480 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4481
+ if (Grafreed.clipboardIsTempGroup)
41114482 tGroup.add/*Child*/(tmp);
41124483 else
4113
- GrafreeD.clipboard = tmp;
4484
+ Grafreed.clipboard = tmp;
41144485 }
41154486 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4487
+ if (Grafreed.clipboardIsTempGroup)
41174488 tGroup.add/*Child*/(child);
41184489 else
4119
- GrafreeD.clipboard = child;
4490
+ Grafreed.clipboard = child;
41204491 }
41214492
41224493 //ResetModel();
....@@ -4148,21 +4519,23 @@
41484519 //System.out.println("cut " + elem);
41494520 //System.out.println("parent = " + elem.parent);
41504521 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4522
+ if (Grafreed.clipboardIsTempGroup)
41524523 tGroup.add/*Child*/(tmp);
41534524 else
4154
- GrafreeD.clipboard = tmp;
4525
+ Grafreed.clipboard = tmp;
41554526 }
41564527 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4528
+ if (Grafreed.clipboardIsTempGroup)
41584529 tGroup.add/*Child*/(child);
41594530 else
4160
- GrafreeD.clipboard = child;
4531
+ Grafreed.clipboard = child;
41614532 }
41624533
41634534 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4535
+
4536
+ if (Grafreed.clipboardIsTempGroup)
4537
+ Grafreed.clipboard = tGroup;
4538
+
41664539 if (cut)
41674540 {
41684541 ResetModel();
....@@ -4176,7 +4549,7 @@
41764549 // return;
41774550 boolean first = true;
41784551
4179
- if (GrafreeD.clipboardIsTempGroup)
4552
+ if (Grafreed.clipboardIsTempGroup)
41804553 {
41814554 Composite temp;
41824555
....@@ -4187,7 +4560,7 @@
41874560 temp = (Composite)Applet3D.clipboard.deepCopy();
41884561 */
41894562 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4563
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41914564 {
41924565 Object3D child = (Object3D)e.nextElement();
41934566
....@@ -4221,21 +4594,21 @@
42214594 //Object3D cb = Applet3D.clipboard;
42224595 //temp.addChild(cb);
42234596 //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());
4597
+ assert(Grafreed.clipboard.parent == null);
4598
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4599
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4600
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4601
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42294602 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4603
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4604
+ Grafreed.clipboard.get(0).parent = keepparent;
42324605 }
42334606
42344607 ResetModel();
42354608 refreshContents();
42364609 }
42374610
4238
- void pasteInto(boolean copyit)
4611
+ void pasteInto(boolean copyit, boolean clone)
42394612 {
42404613 // if (GrafreeD.clipboard == null)
42414614 // return;
....@@ -4264,15 +4637,22 @@
42644637 if (copyit)
42654638 {
42664639 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4640
+ if (clone)
4641
+ {
4642
+ CloneClipboard(false); // sept 2014
4643
+ }
4644
+ else
4645
+ {
4646
+ paste(false);
4647
+ }
42684648 }
42694649 else
42704650 {
42714651 boolean first = true;
42724652
4273
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42744654 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
4655
+ Composite temp = (Composite)Grafreed.clipboard;
42764656 Object3D copy;
42774657 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42784658 {
....@@ -4282,7 +4662,7 @@
42824662 }
42834663 } else
42844664 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
4665
+ linkSomething(Grafreed.clipboard); //.get(0));
42864666 }
42874667 }
42884668 }
....@@ -4474,6 +4854,26 @@
44744854 makeSomething(csg);
44754855 }
44764856
4857
+ void Ungroup(Object3D g)
4858
+ {
4859
+ if (g instanceof HiddenObject)
4860
+ {
4861
+ HiddenObject h = (HiddenObject) g;
4862
+
4863
+ for (int i=0; i<h.ActualSize(); i++)
4864
+ {
4865
+ objEditor.makeSomething(h.get(i), false);
4866
+ }
4867
+ }
4868
+ else
4869
+ {
4870
+ for (int i=0; i<g.Size(); i++)
4871
+ {
4872
+ objEditor.makeSomething(g.get(i), false);
4873
+ }
4874
+ }
4875
+ }
4876
+
44774877 void ungroup()
44784878 {
44794879 /*
....@@ -4667,21 +5067,6 @@
46675067 }
46685068 */
46695069
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
-
46855070 /*
46865071 public void Callback(Object obj)
46875072 {
....@@ -4705,26 +5090,9 @@
47055090 }
47065091 */
47075092
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
-
47255093 String GetFile(String dialogName)
47265094 {
4727
- if (GrafreeD.standAlone)
5095
+ if (Grafreed.standAlone)
47285096 {
47295097 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305098 browser.show();
....@@ -4788,10 +5156,15 @@
47885156 cButton flashSelectionButton;
47895157 cButton editButton;
47905158 cButton uneditButton;
5159
+ JCheckBox allParamsButton;
47915160 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935161 cButton unselectButton;
47945162
5163
+ cButton saveButton;
5164
+ cButton undoButton;
5165
+ cButton redoButton;
5166
+ cButton oneStepButton;
5167
+
47955168 cButton screenfitButton;
47965169 cButton screenfitpointButton;
47975170 cButton snapobjectButton;
....@@ -4822,6 +5195,8 @@
48225195 private MenuItem lookFromItem;
48235196 private MenuItem switchItem;
48245197 private MenuItem cutItem;
5198
+ private MenuItem undoItem;
5199
+ private MenuItem redoItem;
48255200 private MenuItem duplicateItem;
48265201 private MenuItem cloneItem;
48275202 private MenuItem cloneSupportItem;
....@@ -4833,8 +5208,9 @@
48335208 private MenuItem resetsupportItem;
48345209 private MenuItem resetreferencesItem;
48355210 private MenuItem linkverticesItem;
5211
+ private MenuItem relinkverticesItem;
48365212 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5213
+ private MenuItem resetAllItem;
48385214 private MenuItem stepAllItem;
48395215 private MenuItem revertMeshItem;
48405216 private MenuItem poseMeshItem;
....@@ -4845,6 +5221,7 @@
48455221 private MenuItem mergeGeometriesItem;
48465222 private MenuItem copyItem;
48475223 private MenuItem pasteItem;
5224
+ private MenuItem pasteIntoItem;
48485225 private MenuItem pasteLinkItem;
48495226 private MenuItem pasteCloneItem;
48505227 private MenuItem pasteExpandItem;
....@@ -4854,6 +5231,7 @@
48545231 private MenuItem genNormalsMESHItem;
48555232 private MenuItem genNormalsCADItem;
48565233 private MenuItem genNormalsORGANItem;
5234
+ private MenuItem genNormalsMINEItem;
48575235 private MenuItem stripifyItem;
48585236 private MenuItem unstripifyItem;
48595237 private MenuItem trimItem;
....@@ -4893,8 +5271,11 @@
48935271 private MenuItem panoTexturesItem;
48945272
48955273 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5274
+ private MenuItem resetCentroidXZItem;
48975275 private MenuItem resetTransformItem;
5276
+ private MenuItem transformGeometryItem;
5277
+ private MenuItem transformChildrenItem;
5278
+ private MenuItem hideItem;
48985279 private MenuItem grabItem;
48995280 private MenuItem backItem;
49005281 private MenuItem frontItem;
....@@ -4915,6 +5296,7 @@
49155296
49165297 private MenuItem resetParentItem;
49175298 private MenuItem repairParentItem;
5299
+ private MenuItem repairShadowItem;
49185300 private MenuItem sortbysizeItem;
49195301 private MenuItem sortbynameItem;
49205302
....@@ -4935,10 +5317,11 @@
49355317 private MenuItem coneItem;
49365318 private MenuItem torusItem;
49375319 private MenuItem superItem;
5320
+ private MenuItem kleinItem;
49385321 private MenuItem blobItem;
49395322 private MenuItem latheItem;
49405323 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5324
+ private MenuItem overlayItem;
49425325 private MenuItem meshItem;
49435326 // private MenuItem meshGroupItem;
49445327 private MenuItem springItem;
....@@ -4947,6 +5330,7 @@
49475330 private MenuItem csgItem;
49485331 private MenuItem templateItem;
49495332 private MenuItem textureItem;
5333
+ private MenuItem billboardItem;
49505334 private MenuItem shadowXItem;
49515335 private MenuItem shadowYItem;
49525336 private MenuItem shadowZItem;
....@@ -4959,11 +5343,6 @@
49595343 private MenuItem doubleItem;
49605344 private MenuItem tripleItem;
49615345
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675346 private MenuItem computeAOItem;
49685347 private MenuItem recompileItem;
49695348 private MenuItem editScriptItem;
....@@ -4973,4 +5352,8 @@
49735352 private MenuItem analyzeItem;
49745353 private MenuItem dumpItem;
49755354 //boolean freezemodel = false;
5355
+
5356
+ Menu cameraMenu;
5357
+ MenuItem editCameraItem;
5358
+ MenuItem revertCameraItem;
49765359 }