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"));
....@@ -285,6 +406,13 @@
285406 genNormalsORGANItem.addActionListener(this);
286407 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287408 genNormalsCADItem.addActionListener(this);
409
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
410
+ genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
288416 stripifyItem = menu.add(new MenuItem("Stripify"));
289417 stripifyItem.addActionListener(this);
290418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +434,34 @@
306434 reduce34MeshItem.addActionListener(this);
307435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308436 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
313445
314446 oe.menuBar.add(menu = new Menu("Attributes"));
315447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
317453 menu.add("-");
318454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319455 liveleavesItem.addActionListener(this);
320456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
322460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323461 supportleavesItem.addActionListener(this);
324462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325463 unsupportleavesItem.addActionListener(this);
464
+ }
326465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327466 hideleavesItem.addActionListener(this);
328467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -366,29 +505,22 @@
366505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367506 sortbynameItem.addActionListener(this);
368507 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.
369515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370516 extractGeometriesItem.addActionListener(this);
371517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372518 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
519
+ }
377520
378521 oe.menuBar.add(menu = new Menu("Insert"));
379522 buildCreateMenu(menu);
380523
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392524 oe.menuBar.add(menu = new Menu("Tools"));
393525 buildToolsMenu(menu);
394526 }
....@@ -423,150 +555,110 @@
423555 oe.radioPanel.add(dummyButton);
424556 oe.buttonGroup.add(dummyButton);
425557 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429559
430
- 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");
431574 liveCB.addItemListener(this);
432575
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
451582 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
493586 trackCB.addItemListener(this);
494587
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
497590 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
591
+
499592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500593 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505594
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
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");
512604 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516605
517
- //
518
- 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");
519610 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521612 fourButton.addActionListener(this);
522
- 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");
523616 sixButton.addActionListener(this);
524
- 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");
525619 threeButton.addActionListener(this);
526
- 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");
527622 sevenButton.addActionListener(this);
528623 //
529624
530
- 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");
531627 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- 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");
534631 closeButton.addActionListener(this);
535632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536633 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538634
539
- oe.aConstraints.gridx = 1; //
540
- 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");
541639 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545640
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
547643 uneditButton.addActionListener(this);
548644
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
561647 allParamsButton.addActionListener(this);
562648
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
568655 unselectButton.addActionListener(this);
569656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
570662 // oe.aConstraints.gridx += 1;
571663 // oe.aConstraints.weighty = 0;
572664 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +670,37 @@
578670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579671 // gcButton.addActionListener(this);
580672
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
592676 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594678 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
599682
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
604687 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- 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");
607691 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- 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");
610695 textureCB.addItemListener(this);
611696
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
614700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
615704 //jList.addListSelectionListener(this);
616705 oe.jTree.addTreeSelectionListener(this);
617706 //jTree.setRootVisible(false);
....@@ -633,18 +722,91 @@
633722 radio.layout = sevenButton;
634723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635724 }
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
+ }
636797
637798 void EditObject(Object3D obj)
638799 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
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();
647808 }
809
+
648810 void SetupViews(ObjEditor oe)
649811 {
650812 oe.SetupViews();
....@@ -663,6 +825,7 @@
663825 JCheckBox fastCB;
664826 JCheckBox slowCB;
665827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
666829 JCheckBox trackCB;
667830 JCheckBox smoothfocusCB;
668831 // JCheckBox speakerMocapCB;
....@@ -705,8 +868,7 @@
705868 dropAttributes |= Object3D.TEXTURE;
706869 else
707870 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
710872 {
711873 cameraView.ToggleLive();
712874 }
....@@ -743,6 +905,10 @@
743905 Recompile();
744906 cameraView.repaint();
745907 // refreshContents();
908
+ }
909
+ else if(e.getSource() == zoomBoxCB)
910
+ {
911
+ cameraView.ToggleZoomBoxMode();
746912 }
747913 else if(e.getSource() == smoothfocusCB)
748914 {
....@@ -857,7 +1023,9 @@
8571023 // objEditor.DropFile((java.io.File[]) object, true);
8581024 // return;
8591025 // }
860
- if (string.charAt(0) == '/')
1026
+
1027
+ // File path for Mac and Windows
1028
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611029 {
8621030 // file(s)
8631031 String[] names = string.split("\n");
....@@ -884,7 +1052,7 @@
8841052
8851053 flashIt = false;
8861054 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1055
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881056 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891057
8901058 if (group.selection.size() == 1)
....@@ -911,11 +1079,11 @@
9111079 {
9121080 loadClipboard(true);
9131081 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1082
+ pasteInto(false, false);
9151083 } else {
9161084 loadClipboard(false);
9171085 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1086
+ pasteInto(false, false); // true); // ???
9191087 }
9201088 }
9211089 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1201,37 @@
10331201 torusItem.addActionListener(this);
10341202 superItem = menu.add(new MenuItem("Superellipsoid"));
10351203 superItem.addActionListener(this);
1204
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1205
+ kleinItem.addActionListener(this);
10361206 particleItem = menu.add(new MenuItem("Particle system"));
10371207 particleItem.addActionListener(this);
1208
+ if (Globals.ADVANCED)
1209
+ {
10381210 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391211 ragdollItem.addActionListener(this);
10401212 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411213 ragdoll2Item.addActionListener(this);
1214
+ }
10421215 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1216
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441217 meshItem.addActionListener(this);
10451218 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461219 // meshGroupItem.addActionListener(this);
1220
+ if (Globals.ADVANCED)
1221
+ {
10471222 springItem = menu.add(new MenuItem("Spring"));
10481223 springItem.addActionListener(this);
10491224 flagItem = menu.add(new MenuItem("Flag"));
10501225 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551226 blobItem = menu.add(new MenuItem("Blob"));
10561227 blobItem.addActionListener(this);
10571228 latheItem = menu.add(new MenuItem("Lathe"));
10581229 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);
10591235 lightItem = menu.add(new MenuItem("Light"));
10601236 lightItem.addActionListener(this);
10611237 menu.add("-");
....@@ -1065,34 +1241,39 @@
10651241 loopItem.addActionListener(this);
10661242 doubleItem = menu.add(new MenuItem("Fork"));
10671243 doubleItem.addActionListener(this);
1244
+ if (Globals.ADVANCED)
1245
+ {
10681246 tripleItem = menu.add(new MenuItem("Trident"));
10691247 tripleItem.addActionListener(this);
1248
+ }
10701249 }
10711250
10721251 void buildToolsMenu(Menu menu)
10731252 {
10741253 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751254 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1255
+ animationItem.setState(Globals.ANIMATION);
10771256
10781257 menu.add("-");
10791258 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801259 parseverticesItem.addActionListener(this);
10811260 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821261 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1262
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841263 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871264 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881265 reduceMorphItem.addActionListener(this);
10891266 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901267 reduce34MorphItem.addActionListener(this);
1091
-
1268
+ menu.add("-");
10921269 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931270 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951271
1272
+ if (Globals.ADVANCED)
1273
+ {
1274
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1275
+ mirrorItem.addActionListener(this);
1276
+ menu.add("-");
10961277 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971278 memoryItem.addActionListener(this);
10981279 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1287,8 @@
11061287 resetParentItem.addActionListener(this);
11071288 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081289 repairParentItem.addActionListener(this);
1290
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1291
+ repairShadowItem.addActionListener(this);
11091292 menu.add(invariantsItem = new MenuItem("Invariants"));
11101293 invariantsItem.addActionListener(this);
11111294 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1296,7 @@
11131296 menu.add("-");
11141297 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151298 editScriptItem.addActionListener(this);
1299
+ }
11161300 }
11171301
11181302 void ScreenFit()
....@@ -1441,9 +1625,9 @@
14411625
14421626 void Overwrite(int mask)
14431627 {
1444
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1628
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451629 {
1446
- Object3D content = GrafreeD.clipboard.get(0);
1630
+ Object3D content = Grafreed.clipboard.get(0);
14471631
14481632 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491633 content = ((cGroup)content).get(0);
....@@ -1466,6 +1650,7 @@
14661650 //
14671651 public void actionPerformed(ActionEvent event) // , Object arg)
14681652 {
1653
+ Object source = event.getSource();
14691654 /*
14701655 if (event.getSource() == nameField)
14711656 {
....@@ -1477,11 +1662,11 @@
14771662 }
14781663 else
14791664 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1665
+ if (source == lookAtItem || source == lookFromItem)
14811666 {
14821667 ScreenFit();
14831668 } else
1484
- if (event.getSource() == switchItem)
1669
+ if (source == switchItem)
14851670 {
14861671 cVector v1 = new cVector();
14871672 cVector v2 = new cVector();
....@@ -1490,11 +1675,11 @@
14901675 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911676 objEditor.cameraView.repaint();
14921677 } else
1493
- if (event.getSource() == rectoidItem)
1678
+ if (source == rectoidItem)
14941679 {
14951680 makeSomething(new Box());
14961681 } else
1497
- if (event.getSource() == particleItem)
1682
+ if (source == particleItem)
14981683 {
14991684 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001685 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1700,9 @@
15151700 applyExample(particleGeom, "SMOKE");
15161701 makeSomething(particleGeom);
15171702 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1703
+ if (source == ragdollItem || source == ragdoll2Item)
15191704 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1705
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211706
15221707 ragdoll.toParent = LA.newMatrix();
15231708 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1720,7 @@
15351720 } else
15361721 /*
15371722 */
1538
- if (event.getSource() == heightFieldItem)
1723
+ if (source == heightFieldItem)
15391724 {
15401725 Object3D obj = new Object3D();
15411726
....@@ -1573,27 +1758,31 @@
15731758
15741759 makeSomething(obj);
15751760 } else
1576
- if (event.getSource() == gridItem)
1761
+ if (source == gridItem)
15771762 {
15781763 makeSomething(new Grid());
15791764 } else
1580
- if (event.getSource() == ellipsoidItem)
1765
+ if (source == ellipsoidItem)
15811766 {
15821767 makeSomething(new Sphere());
15831768 } else
1584
- if (event.getSource() == coneItem)
1769
+ if (source == coneItem)
15851770 {
15861771 makeSomething(new Cone());
15871772 } else
1588
- if (event.getSource() == torusItem)
1773
+ if (source == torusItem)
15891774 {
15901775 makeSomething(new Torus());
15911776 } else
1592
- if (event.getSource() == superItem)
1777
+ if (source == superItem)
15931778 {
15941779 makeSomething(new Superellipsoid());
15951780 } else
1596
- if (event.getSource() == blobItem)
1781
+ if (source == kleinItem)
1782
+ {
1783
+ makeSomething(new Klein());
1784
+ } else
1785
+ if (source == blobItem)
15971786 {
15981787 Blob blob = new Blob();
15991788 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1790,15 @@
16011790 //blob.retile();
16021791 makeSomething(blob);
16031792 } else
1604
- if (event.getSource() == latheItem)
1793
+ if (source == latheItem)
16051794 {
16061795 makeSomething(new Lathe());
16071796 } else
1608
- if (event.getSource() == bezierItem)
1797
+ if (source == bezierItem)
16091798 {
16101799 makeSomething(new BezierSurface());
16111800 } else
1612
- if (event.getSource() == checkerItem)
1801
+ if (source == overlayItem)
16131802 {
16141803 /*
16151804 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1813,7 @@
16241813 */
16251814 makeSomething(new Checker());
16261815 } else
1627
- if (event.getSource() == meshItem)
1816
+ if (source == meshItem)
16281817 {
16291818 Object3D itemtomake = new Object3D();
16301819 Object3D child;
....@@ -1645,35 +1834,35 @@
16451834 makeSomething(child);
16461835 }
16471836 } else
1648
- if (event.getSource() == springItem)
1837
+ if (source == springItem)
16491838 {
16501839 cSpring s = new cSpring();
16511840 s.setup();
16521841 makeSomething(s);
16531842 } else
1654
- if (event.getSource() == flagItem)
1843
+ if (source == flagItem)
16551844 {
16561845 cSpring s = new cFlag();
16571846 s.setup();
16581847 makeSomething(s);
16591848 } else
1660
- if (event.getSource() == lightItem)
1849
+ if (source == lightItem)
16611850 {
16621851 makeSomething(new Light());
16631852 } else
1664
- if (event.getSource() == csgItem)
1853
+ if (source == csgItem)
16651854 {
16661855 group(new CSG());
16671856 } else
1668
- if (event.getSource() == templateItem)
1857
+ if (source == templateItem)
16691858 {
16701859 group(new cTemplate());
16711860 } else
1672
- if (event.getSource() == attributeItem)
1861
+ if (source == attributeItem)
16731862 {
16741863 makeSomething(new Attribute());
16751864 } else
1676
- if (event.getSource() == pointflowItem)
1865
+ if (source == pointflowItem)
16771866 {
16781867 makeSomething(new PointFlow());
16791868 } else
....@@ -1685,7 +1874,7 @@
16851874 } else
16861875 */
16871876
1688
- if (event.getSource() == superLoopItem)
1877
+ if (source == superLoopItem)
16891878 {
16901879 Composite g = new cGroup();
16911880 for (int i=0; i<15; i++)
....@@ -1707,7 +1896,7 @@
17071896
17081897 group(g);
17091898 } else
1710
- if (event.getSource() == loopItem)
1899
+ if (source == loopItem)
17111900 {
17121901 Composite csg = new GroupLeaf();
17131902 csg.count = 5;
....@@ -1716,7 +1905,7 @@
17161905 csg.addChild(child);
17171906 child.addChild(csg);
17181907 } else
1719
- if (event.getSource() == doubleItem)
1908
+ if (source == doubleItem)
17201909 {
17211910 Composite csg = new GroupLeaf();
17221911 csg.count = 5;
....@@ -1728,7 +1917,7 @@
17281917 csg.addChild(child);
17291918 child.addChild(csg);
17301919 } else
1731
- if (event.getSource() == tripleItem)
1920
+ if (source == tripleItem)
17321921 {
17331922 Composite csg = new GroupLeaf();
17341923 csg.count = 4;
....@@ -1743,71 +1932,71 @@
17431932 csg.addChild(child);
17441933 child.addChild(csg);
17451934 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1935
+ if (source == computeAOItem)
17481936 {
1749
- ImportGFD();
1937
+ Globals.drawMode = CameraPane.OCCLUSION;
1938
+ Globals.theRenderer.repaint();
17501939 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
1940
+ if (source == recompileItem)
17691941 {
17701942 Recompile();
17711943 refreshContents();
17721944 } else
1773
- if (event.getSource() == editScriptItem)
1945
+ if (source == editScriptItem)
17741946 {
17751947 OpenDialog();
17761948 refreshContents();
17771949 } else
1778
- if (event.getSource() == invariantsItem)
1950
+ if (source == invariantsItem)
17791951 {
17801952 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1953
+ Grafreed.grafreeD.universe.invariants();
17821954 } else
1783
- if (event.getSource() == memoryItem)
1955
+ if (source == memoryItem)
17841956 {
17851957 //System.out.println("Invariants:");
17861958 PrintMemory();
17871959 } else
1788
- if (event.getSource() == pathItem)
1960
+ if (source == pathItem)
17891961 {
17901962 PrintPath();
17911963 } else
1792
- if (event.getSource() == analyzeItem)
1964
+ if (source == analyzeItem)
17931965 {
17941966 AnalyzeObject();
17951967 } else
1796
- if (event.getSource() == dumpItem)
1968
+ if (source == dumpItem)
17971969 {
17981970 DumpObject();
17991971 } else
1800
- 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)
18011990 {
18021991 //Reload(lastConverter, lastFilename, true);
18031992 ScreenFit();
18041993 } else
1805
- if (event.getSource() == screenfitpointButton)
1994
+ if (source == screenfitpointButton)
18061995 {
18071996 //Reload(lastConverter, lastFilename, true);
18081997 ScreenFitPoint();
18091998 } else
1810
- if (event.getSource() == snapobjectButton)
1999
+ if (source == snapobjectButton)
18112000 {
18122001 //Reload(lastConverter, lastFilename, true);
18132002 SnapObject();
....@@ -1818,13 +2007,13 @@
18182007 // Recompile();
18192008 // refreshContents();
18202009 // } else
1821
- if (event.getSource() == gcButton)
2010
+ if (source == gcButton)
18222011 {
18232012 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242013 System.gc();
18252014 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262015 } else
1827
- if (event.getSource() == editLeafItem)
2016
+ if (source == editLeafItem)
18282017 {
18292018 Object3D obj;
18302019 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +2027,74 @@
18382027 }
18392028 refreshContents(true);
18402029 } else
1841
- if (event.getSource() == openWindowItem)
2030
+ if (source == openWindowItem)
18422031 {
18432032 EditSelection(true);
18442033 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2034
+ if (source == cutItem || source == clearButton)
18462035 {
18472036 loadClipboard(true);
18482037 } else
1849
- if (event.getSource() == duplicateItem)
2038
+ if (source == undoItem)
18502039 {
1851
- 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;
18522049 loadClipboard(false);
18532050 paste(false);
1854
- GrafreeD.clipboard = keep;
2051
+ Grafreed.clipboard = keep;
18552052 } else
1856
- if (event.getSource() == cloneItem)
2053
+ if (source == cloneItem)
18572054 {
18582055 CloneSelection(false);
18592056 } else
1860
- if (event.getSource() == cloneSupportItem)
2057
+ if (source == cloneSupportItem)
18612058 {
18622059 CloneSelection(true);
18632060 } else
1864
- if (event.getSource() == copyItem)
2061
+ if (source == copyItem)
18652062 {
18662063 loadClipboard(false);
18672064 } else
1868
- if (event.getSource() == pasteItem)
2065
+ if (source == pasteItem)
18692066 {
18702067 paste(false);
18712068 } else
1872
- if (event.getSource() == pasteLinkItem)
2069
+ if (source == pasteIntoItem)
18732070 {
1874
- pasteInto(false);
2071
+ pasteInto(true, false);
18752072 } else
1876
- if (event.getSource() == pasteCloneItem)
2073
+ if (source == pasteLinkItem)
18772074 {
1878
- pasteInto(true);
2075
+ pasteInto(false, false);
18792076 } else
1880
- if (event.getSource() == pasteExpandItem)
2077
+ if (source == pasteCloneItem)
2078
+ {
2079
+ pasteInto(true, true);
2080
+ } else
2081
+ if (source == pasteExpandItem)
18812082 {
18822083 paste(true);
18832084 } else
1884
- if (event.getSource() == synchronizeItem)
2085
+ if (source == synchronizeItem)
18852086 {
18862087 Overwrite(Object3D.TRANSFORM);
18872088 } else
1888
- if (event.getSource() == overwriteNameItem)
2089
+ if (source == overwriteNameItem)
18892090 {
18902091 Overwrite(Object3D.NAME);
18912092 } else
1892
- if (event.getSource() == overwriteUVItem)
2093
+ if (source == overwriteUVItem)
18932094 {
18942095 Overwrite(Object3D.UV);
18952096 } else
1896
- if (event.getSource() == overwriteMatItem)
2097
+ if (source == overwriteMatItem)
18972098 {
18982099 /* july 2015
18992100 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2114,7 @@
19132114
19142115 Overwrite(dropAttributes);
19152116 }
1916
- if (event.getSource() == overwriteGeoItem)
2117
+ if (source == overwriteGeoItem)
19172118 {
19182119 Overwrite(Object3D.GEOMETRY);
19192120 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2131,7 @@
19302131 // refreshContents();
19312132 // }
19322133 } else
1933
- if (event.getSource() == generateMeshItem)
2134
+ if (source == generateMeshItem)
19342135 {
19352136 //if (group.selection.size() == 1)
19362137 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2142,7 @@
19412142 ResetModel();
19422143 refreshContents();
19432144 } else
1944
- if (event.getSource() == extractGeometriesItem)
2145
+ if (source == extractGeometriesItem)
19452146 {
19462147 boolean one = false;
19472148
....@@ -1968,7 +2169,7 @@
19682169 ResetModel();
19692170 refreshContents();
19702171 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2172
+ if (source == cloneGeometriesItem)
19722173 {
19732174 boolean one = false;
19742175
....@@ -1994,32 +2195,37 @@
19942195 ResetModel();
19952196 refreshContents();
19962197 } else
1997
- if (event.getSource() == shareGeometriesItem)
2198
+ if (source == shareGeometriesItem)
19982199 {
19992200 boolean one = false;
20002201
20012202 if (group.selection.size() == 1)
20022203 one = true;
20032204
2205
+ Object3D merge = null;
2206
+
20042207 Object3D content = new cGroup();
20052208
20062209 for (int i=0; i<group.selection.size(); i++)
20072210 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2211
+ merge = new Merge(group.selection.get(i));
20092212
20102213 if (one)
2011
- makeSomething(sel, false);
2214
+ makeSomething(merge, false);
20122215 else
2013
- content.addChild(sel);
2216
+ content.addChild(merge);
20142217 }
20152218
20162219 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2220
+ makeSomething(content, true);
2221
+ else
2222
+ {
2223
+ ResetModel();
2224
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2225
+ refreshContents();
2226
+ }
20212227 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2228
+ if (source == mergeGeometriesItem)
20232229 {
20242230 boolean one = false;
20252231
....@@ -2049,7 +2255,7 @@
20492255 ResetModel();
20502256 refreshContents();
20512257 } else
2052
- if (event.getSource() == linkverticesItem)
2258
+ if (source == linkverticesItem)
20532259 {
20542260 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552261 // {
....@@ -2062,39 +2268,48 @@
20622268 // group.selection.get(0).setMasterThis(content); // should be identity
20632269 // refreshContents();
20642270 // }
2065
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2271
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20662272 {
2067
- Object3D content = GrafreeD.clipboard.get(0);
2273
+ Object3D content = Grafreed.clipboard.get(0);
20682274
20692275 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702276 content = ((cGroup)content).get(0);
20712277
2072
- 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));
20732279 for (int i=0; i<group.selection.size(); i++)
20742280 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2281
+ boolean random = CameraPane.SWITCH;
2282
+ CameraPane.SWITCH = false; // parse all random nodes
20772283 group.selection.get(i).linkVerticesThis(content);
20782284 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2285
+ CameraPane.SWITCH = random;
20802286 }
2081
- 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));
20822288 refreshContents();
20832289 }
20842290 } else
2085
- if (event.getSource() == resetsupportItem)
2291
+ if (source == resetsupportItem)
20862292 {
20872293 for (int i=0; i<group.selection.size(); i++)
20882294 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2295
+ boolean random = CameraPane.SWITCH;
2296
+ CameraPane.SWITCH = false; // parse all random nodes
20912297 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2298
+ CameraPane.SWITCH = random;
20932299 }
20942300
20952301 refreshContents();
20962302 } else
2097
- 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)
20982313 {
20992314 for (int i=0; i<group.selection.size(); i++)
21002315 {
....@@ -2103,11 +2318,11 @@
21032318
21042319 refreshContents();
21052320 } else
2106
- if (event.getSource() == setMasterItem)
2321
+ if (source == setMasterItem)
21072322 {
2108
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2323
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21092324 {
2110
- Object3D content = GrafreeD.clipboard.get(0);
2325
+ Object3D content = Grafreed.clipboard.get(0);
21112326
21122327 if (content instanceof cGroup && ((cGroup)content).transientlink )
21132328 content = ((cGroup)content).get(0);
....@@ -2116,13 +2331,13 @@
21162331 refreshContents();
21172332 }
21182333 } else
2119
- if (event.getSource() == poseMeshItem)
2334
+ if (source == poseMeshItem)
21202335 {
21212336 if (group.selection.size() == 1)
21222337 {
2123
- if (GrafreeD.clipboard.size() == 1)
2338
+ if (Grafreed.clipboard.size() == 1)
21242339 {
2125
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21262341
21272342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21282343 content = ((cGroup)content).get(0);
....@@ -2135,19 +2350,19 @@
21352350 }
21362351
21372352 } else
2138
- if (event.getSource() == revertMeshItem)
2353
+ if (source == revertMeshItem)
21392354 {
21402355 RevertMeshes();
21412356 } else
2142
- if (event.getSource() == resetMeshItem)
2357
+ if (source == resetAllItem)
21432358 {
21442359 ResetAll();
21452360 } else
2146
- if (event.getSource() == stepAllItem)
2361
+ if (source == stepAllItem)
21472362 {
21482363 StepAll();
21492364 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2365
+ if (source == clearItem) // || event.getSource() == clearButton)
21512366 {
21522367 //int indices[] = jList.getSelectedIndices();
21532368 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2370,46 @@
21552370
21562371 ClearSelection(false);
21572372 } else
2158
- if (event.getSource() == clearAllItem)
2373
+ if (source == clearAllItem)
21592374 {
21602375 ClearSelection(true);
21612376 } else
2162
- if (event.getSource() == grabItem)
2377
+ if (source == grabItem)
21632378 {
21642379 group(new cGroup(), true);
21652380 } else
2166
- if (event.getSource() == frontItem)
2381
+ if (source == hideItem)
2382
+ {
2383
+ group(new HiddenObject());
2384
+ } else
2385
+ if (source == frontItem)
21672386 {
21682387 front();
21692388 } else
2170
- if (event.getSource() == backItem)
2389
+ if (source == backItem)
21712390 {
21722391 back();
21732392 } else
2174
- if (event.getSource() == cameraItem)
2393
+ if (source == cameraItem)
21752394 {
21762395 makeSomething(new Camera());
21772396 } else
2178
- if (event.getSource() == compositeItem)
2397
+ if (source == compositeItem)
21792398 {
21802399 group(new Composite());
21812400 } else
2182
- if (event.getSource() == randomItem)
2401
+ if (source == randomItem)
21832402 {
21842403 RandomNode random = new RandomNode();
21852404 group(random);
21862405 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2406
+ random.name = random.get(0).name + "Switch";
21882407 } else
2189
- if (event.getSource() == physicsItem)
2408
+ if (source == physicsItem)
21902409 {
21912410 group(new PhysicsNode());
21922411 } else
2193
- if (event.getSource() == frameselectorItem)
2412
+ if (source == frameselectorItem)
21942413 {
21952414 for (int i=0; i<group.selection.size(); i++)
21962415 {
....@@ -2202,7 +2421,7 @@
22022421 ResetModel();
22032422 refreshContents();
22042423 } else
2205
- if (event.getSource() == switchGeoItem)
2424
+ if (source == switchGeoItem)
22062425 {
22072426 for (int i=0; i<group.selection.size(); i++)
22082427 {
....@@ -2214,7 +2433,7 @@
22142433 ResetModel();
22152434 refreshContents();
22162435 } else
2217
- if (event.getSource() == switchTransfoItem)
2436
+ if (source == switchTransfoItem)
22182437 {
22192438 for (int i=0; i<group.selection.size(); i++)
22202439 {
....@@ -2226,7 +2445,7 @@
22262445 ResetModel();
22272446 refreshContents();
22282447 } else
2229
- if (event.getSource() == morphItem)
2448
+ if (source == morphItem)
22302449 {
22312450 for (int i=0; i<group.selection.size(); i++)
22322451 {
....@@ -2238,7 +2457,7 @@
22382457 ResetModel();
22392458 refreshContents();
22402459 } else
2241
- if (event.getSource() == scriptNodeItem)
2460
+ if (source == scriptNodeItem)
22422461 {
22432462 boolean atleastone = false;
22442463
....@@ -2277,195 +2496,223 @@
22772496 }
22782497 }
22792498 } else
2280
- if (event.getSource() == linkerItem)
2499
+ if (source == linkerItem)
22812500 {
22822501 group(new cLinker());
22832502 } else
2284
- if (event.getSource() == textureItem)
2503
+ if (source == textureItem)
22852504 {
22862505 group(new TextureNode());
22872506 } else
2288
- if (event.getSource() == shadowXItem)
2507
+ if (source == billboardItem)
2508
+ {
2509
+ group(new BillboardNode());
2510
+ } else
2511
+ if (source == shadowXItem)
22892512 {
22902513 CastShadow(0);
22912514 } else
2292
- if (event.getSource() == shadowYItem)
2515
+ if (source == shadowYItem)
22932516 {
22942517 CastShadow(1);
22952518 } else
2296
- if (event.getSource() == shadowZItem)
2519
+ if (source == shadowZItem)
22972520 {
22982521 CastShadow(2);
22992522 } else
2300
- if (event.getSource() == ungroupItem)
2523
+ if (source == ungroupItem)
23012524 {
2302
- 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();
23032534 } else
2304
- if (event.getSource() == genUVItem)
2535
+ if (source == genUVItem)
23052536 {
23062537 GenUV();
23072538 } else
2308
- if (event.getSource() == genNormalsCADItem)
2539
+ if (source == genNormalsCADItem)
23092540 {
23102541 GenNormals(true);
23112542 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2543
+ if (source == genNormalsMESHItem)
2544
+ {
2545
+ GenNormals(true); // TODO
2546
+ } else
2547
+ if (source == genNormalsORGANItem)
23132548 {
23142549 GenNormals(false);
23152550 } else
2316
- if (event.getSource() == stripifyItem)
2551
+ if (source == genNormalsMINEItem)
2552
+ {
2553
+ GenNormalsMINE();
2554
+ } else
2555
+ if (source == stripifyItem)
23172556 {
23182557 Stripify();
23192558 } else
2320
- if (event.getSource() == unstripifyItem)
2559
+ if (source == unstripifyItem)
23212560 {
23222561 Unstripify();
23232562 } else
2324
- if (event.getSource() == trimItem)
2563
+ if (source == trimItem)
23252564 {
23262565 Trim();
23272566 } else
2328
- if (event.getSource() == untrimItem)
2567
+ if (source == untrimItem)
23292568 {
23302569 Untrim();
23312570 } else
2332
- if (event.getSource() == clearColorsItem)
2571
+ if (source == clearColorsItem)
23332572 {
23342573 ClearColors();
23352574 } else
2336
- if (event.getSource() == clearMaterialsItem)
2575
+ if (source == clearMaterialsItem)
23372576 {
23382577 ClearMaterials();
23392578 } else
2340
- if (event.getSource() == liveleavesItem)
2579
+ if (source == liveleavesItem)
23412580 {
23422581 LiveLeaves(true);
23432582 } else
2344
- if (event.getSource() == unliveleavesItem)
2583
+ if (source == unliveleavesItem)
23452584 {
23462585 LiveLeaves(false);
23472586 } else
2348
- if (event.getSource() == supportleavesItem)
2587
+ if (source == supportleavesItem)
23492588 {
23502589 SupportLeaves(true);
23512590 } else
2352
- if (event.getSource() == unsupportleavesItem)
2591
+ if (source == unsupportleavesItem)
23532592 {
23542593 SupportLeaves(false);
23552594 } else
2356
- if (event.getSource() == hideleavesItem)
2595
+ if (source == hideleavesItem)
23572596 {
23582597 HideLeaves(true);
23592598 } else
2360
- if (event.getSource() == showleavesItem)
2599
+ if (source == showleavesItem)
23612600 {
23622601 HideLeaves(false);
23632602 } else
2364
- if (event.getSource() == markleavesItem)
2603
+ if (source == markleavesItem)
23652604 {
23662605 MarkLeaves(true);
23672606 } else
2368
- if (event.getSource() == unmarkleavesItem)
2607
+ if (source == unmarkleavesItem)
23692608 {
23702609 MarkLeaves(false);
23712610 } else
2372
- if (event.getSource() == flipVItem)
2611
+ if (source == flipVItem)
23732612 {
23742613 FlipV(true);
23752614 } else
2376
- if (event.getSource() == unflipVItem)
2615
+ if (source == unflipVItem)
23772616 {
23782617 FlipV(false);
23792618 } else
2380
- if (event.getSource() == lowTexturesItem)
2619
+ if (source == lowTexturesItem)
23812620 {
23822621 SetTexRes(0);
23832622 } else
2384
- if (event.getSource() == normalTexturesItem)
2623
+ if (source == normalTexturesItem)
23852624 {
23862625 SetTexRes(1);
23872626 } else
2388
- if (event.getSource() == highTexturesItem)
2627
+ if (source == highTexturesItem)
23892628 {
23902629 SetTexRes(2);
23912630 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2631
+ if (source == veryhighTexturesItem)
23932632 {
23942633 SetTexRes(3);
23952634 } else
2396
- if (event.getSource() == maxTexturesItem)
2635
+ if (source == maxTexturesItem)
23972636 {
23982637 SetTexRes(4);
23992638 } else
2400
- if (event.getSource() == panoTexturesItem)
2639
+ if (source == panoTexturesItem)
24012640 {
24022641 SetTexRes(5);
24032642 } else
2404
- if (event.getSource() == reverseNormalsItem)
2643
+ if (source == reverseNormalsItem)
24052644 {
24062645 ReverseNormals();
24072646 } else
2408
- if (event.getSource() == parseverticesItem)
2647
+ if (source == parseverticesItem)
24092648 {
24102649 ParseVertices();
24112650 } else
2412
- if (event.getSource() == textureFieldItem)
2651
+ if (source == textureFieldItem)
24132652 {
24142653 TextureVertices();
24152654 } else
2416
- if (event.getSource() == alignItem)
2655
+ if (source == alignItem)
24172656 {
24182657 Align();
24192658 } else
2420
- if (event.getSource() == mirrorItem)
2659
+ if (source == mirrorItem)
24212660 {
24222661 MirrorPoses();
24232662 } else
2424
- if (event.getSource() == reduceMorphItem)
2663
+ if (source == reduceMorphItem)
24252664 {
24262665 MeshReduction(false);
24272666 } else
2428
- if (event.getSource() == reduce34MorphItem)
2667
+ if (source == reduce34MorphItem)
24292668 {
24302669 MeshReduction(true);
24312670 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2671
+ if (source == reverseTrianglesItem)
24332672 {
24342673 ReverseTriangles();
24352674 } else
2436
- if (event.getSource() == reduceMeshItem)
2675
+ if (source == reduceMeshItem)
24372676 {
24382677 ReduceMesh(false);
24392678 } else
2440
- if (event.getSource() == reduce34MeshItem)
2679
+ if (source == reduce34MeshItem)
24412680 {
24422681 ReduceMesh(true);
24432682 } else
2444
- if (event.getSource() == increaseMeshItem)
2683
+ if (source == increaseMeshItem)
24452684 {
24462685 IncreaseMesh();
24472686 } else
2448
- if (event.getSource() == clipMeshItem)
2687
+ if (source == clipMeshItem)
24492688 {
24502689 ClipMesh();
24512690 } else
2452
- if (event.getSource() == smoothMeshItem)
2691
+ if (source == smoothMeshItem)
24532692 {
24542693 SmoothMesh();
24552694 } else
2456
- if (event.getSource() == transformgeometryItem)
2695
+ if (source == transformGeometryItem)
24572696 {
24582697 TransformGeometry();
24592698 } else
2460
- if (event.getSource() == resetTransformItem)
2699
+ if (source == transformChildrenItem)
2700
+ {
2701
+ TransformChildren();
2702
+ } else
2703
+ if (source == resetTransformItem)
24612704 {
24622705 ResetTransform();
24632706 } else
2464
- if (event.getSource() == resetCentroidItem)
2707
+ if (source == resetCentroidItem)
24652708 {
2466
- ResetCentroid();
2709
+ ResetCentroid(true);
24672710 } else
2468
- if (event.getSource() == resetParentItem)
2711
+ if (source == resetCentroidXZItem)
2712
+ {
2713
+ ResetCentroid(false);
2714
+ } else
2715
+ if (source == resetParentItem)
24692716 {
24702717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712718 {
....@@ -2475,7 +2722,7 @@
24752722
24762723 refreshContents();
24772724 } else
2478
- if (event.getSource() == repairParentItem)
2725
+ if (source == repairParentItem)
24792726 {
24802727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812728 {
....@@ -2489,7 +2736,21 @@
24892736
24902737 refreshContents();
24912738 } else
2492
- 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)
24932754 {
24942755 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952756 {
....@@ -2501,7 +2762,7 @@
25012762 ResetModel();
25022763 refreshContents();
25032764 } else
2504
- if (event.getSource() == sortbynameItem)
2765
+ if (source == sortbynameItem)
25052766 {
25062767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072768 {
....@@ -2513,7 +2774,7 @@
25132774 ResetModel();
25142775 refreshContents();
25152776 } else
2516
- if (event.getSource() == attachPigmentItem)
2777
+ if (source == attachPigmentItem)
25172778 {
25182779 String texture = GetFile("Attach pigment");
25192780 Object3D obj;
....@@ -2525,7 +2786,7 @@
25252786
25262787 refreshContents();
25272788 } else
2528
- if (event.getSource() == detachPigmentItem)
2789
+ if (source == detachPigmentItem)
25292790 {
25302791 Object3D obj;
25312792 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2797,7 @@
25362797
25372798 refreshContents();
25382799 } else
2539
- if (event.getSource() == attachBumpItem)
2800
+ if (source == attachBumpItem)
25402801 {
25412802 String texture = GetFile("Attach bump");
25422803 Object3D obj;
....@@ -2548,7 +2809,7 @@
25482809
25492810 refreshContents();
25502811 } else
2551
- if (event.getSource() == detachBumpItem)
2812
+ if (source == detachBumpItem)
25522813 {
25532814 Object3D obj;
25542815 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2820,7 @@
25592820
25602821 refreshContents();
25612822 } else
2562
- if (event.getSource() == pigmentBumpItem)
2823
+ if (source == pigmentBumpItem)
25632824 {
25642825 Object3D obj;
25652826 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2831,195 @@
25702831
25712832 refreshContents();
25722833 } else
2573
- if (event.getSource() == flashSelectionButton)
2834
+ if (source == flashSelectionButton)
25742835 {
25752836 CameraPane.flash = true;
25762837 refreshContents();
25772838 } else
2578
- if (event.getSource() == oneButton)
2839
+ if (source == oneButton)
25792840 {
25802841 } else
2581
- if (event.getSource() == twoButton)
2842
+ if (source == twoButton)
25822843 {
25832844 radio.layout = twoButton;
25842845 // bug
25852846 //gridPanel.setDividerLocation(1.0);
25862847 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- bigThree.revalidate();
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();
26112877 } else
2612
- if (event.getSource() == threeButton)
2878
+ if (source == threeButton)
26132879 {
26142880 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- bigThree.revalidate();
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();
26392913 } else
2640
- if (event.getSource() == fourButton)
2914
+ if (source == fourButton)
26412915 {
26422916 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
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();
26672948 } else
2668
- if (event.getSource() == sixButton)
2949
+ if (source == sixButton)
26692950 {
26702951 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- bigThree.revalidate();
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();
26952984 } else
2696
- if (event.getSource() == sevenButton)
2985
+ if (source == sevenButton)
26972986 {
26982987 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
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();
27233021 } else
2724
- if (event.getSource() == rootButton)
3022
+ if (source == rootButton)
27253023 {
27263024 Object3D obj;
27273025 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +3031,7 @@
27333031
27343032 refreshContents(true);
27353033 } else
2736
- if (event.getSource() == closeButton)
3034
+ if (source == closeButton)
27373035 {
27383036 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27393037 cRadio ab;
....@@ -2754,11 +3052,11 @@
27543052 }
27553053 refreshContents(true);
27563054 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
3055
+ if (source == editItem || source == editButton)
27583056 {
27593057 EditSelection(false);
27603058 } else
2761
- if (event.getSource() == uneditButton)
3059
+ if (source == uneditButton)
27623060 {
27633061 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27643062 {
....@@ -2768,14 +3066,14 @@
27683066 child.CloseUI();
27693067 listUI.remove(child);
27703068
2771
- child.editWindow = null; // ???????????
3069
+ //child.editWindow = null; // ???????????
27723070 }
2773
- objEditor.ctrlPanel.revalidate();
3071
+ objEditor.ctrlPanel.FlushUI();
27743072 //objEditor.jTree.clearSelection();
27753073 //objEditor.ResetSliders();
27763074 refreshContents(true);
27773075 } else
2778
- if (event.getSource() == clearPanelButton)
3076
+ if (source == clearPanelButton)
27793077 {
27803078 assert(copy == group);
27813079 //copy.ClearUI();
....@@ -2786,7 +3084,7 @@
27863084 listUI.clear();
27873085 refreshContents(true);
27883086 } else
2789
- if (event.getSource() == allParamsButton)
3087
+ if (source == allParamsButton)
27903088 {
27913089 assert(copy == group);
27923090
....@@ -2807,19 +3105,19 @@
28073105
28083106 refreshContents(true);
28093107 } else
2810
- if (event.getSource() == unselectButton)
3108
+ if (source == unselectButton)
28113109 {
28123110 objEditor.jTree.clearSelection();
28133111 // ?? oct 2012 GrafreeD.clipboard.clear();
28143112 objEditor.ResetSliders();
28153113 refreshContents(true);
28163114 } else
2817
- if(event.getSource() instanceof cRadio)
3115
+ if(source instanceof cRadio)
28183116 {
28193117 group.parent = keepparent;
28203118 group.attributes = 0;
28213119 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3120
+ /*cRadio*/ radio = (cRadio)source;
28233121 Object3D obj = radio.GetObject();
28243122 System.out.println("Edit " + obj);
28253123 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3137,7 @@
28393137 }
28403138
28413139 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3140
+ //Globals.theRenderer.object = group;
28433141 if(!useclient)
28443142 {
28453143 cameraView.renderCamera = radio.camera;
....@@ -2848,12 +3146,16 @@
28483146 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493147 cameraView.targetLookAt.set(radio.camera.lookAt);
28503148 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3149
+ //cameraView.lighttouched = true;
3150
+ Globals.lighttouched = true;
28523151 topView.object = group;
28533152 frontView.object = group;
28543153 sideView.object = group;
28553154 }
3155
+
3156
+// fix "+" issue
28563157 group.editWindow = this;
3158
+
28573159 /*
28583160 currentLayout = radio.layout;
28593161 if (currentLayout == null)
....@@ -2866,7 +3168,20 @@
28663168 //group.attributes = -1;
28673169 ResetModel();
28683170 refreshContents(true);
2869
- }
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
+ }
28703185 else
28713186 {
28723187 //return super.action(event, arg);
....@@ -2884,7 +3199,7 @@
28843199 if (useclient)
28853200 {
28863201 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3202
+ Globals.lighttouched = true;
28883203 //topView.object = client;
28893204 //frontView.object = client;
28903205 //sideView.object = client;
....@@ -2892,7 +3207,7 @@
28923207 else
28933208 {
28943209 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3210
+ Globals.lighttouched = true;
28963211 //topView.object = group;
28973212 //frontView.object = group;
28983213 //sideView.object = group;
....@@ -2927,6 +3242,28 @@
29273242 refreshContents();
29283243 }
29293244
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
+ }
29303267
29313268 void ResetTransform()
29323269 {
....@@ -3039,7 +3376,7 @@
30393376 refreshContents();
30403377 }
30413378
3042
- void ResetCentroid()
3379
+ void ResetCentroid(boolean full)
30433380 {
30443381 Object3D obj;
30453382 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3054,12 +3391,16 @@
30543391 LA.matIdentity(Object3D.mat);
30553392 obj.getBounds(minima, maxima, false);
30563393 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3394
+ if (full)
3395
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30583396 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30593397 obj.TransformMesh(Object3D.mat);
3398
+
30603399 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3061
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3400
+ if (full)
3401
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30623402 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3403
+
30633404 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30643405 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30653406 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3088,7 +3429,8 @@
30883429
30893430 int size = obj.MemorySize();
30903431
3091
- 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)");
30923434 }
30933435 }
30943436 catch (Exception e)
....@@ -3125,9 +3467,9 @@
31253467 obj = (Object3D)e.nextElement();
31263468
31273469 System.out.println("Object is: " + obj);
3128
- GrafreeD.AnalyzeObject(obj);
3470
+ Grafreed.AnalyzeObject(obj);
31293471 System.out.println("Boundary rep: " + obj.bRep);
3130
- GrafreeD.AnalyzeObject(obj.bRep);
3472
+ Grafreed.AnalyzeObject(obj.bRep);
31313473
31323474 // System.err.println((size/1024) + " KB is the size of " + obj);
31333475 }
....@@ -3169,6 +3511,13 @@
31693511 void GenNormals(boolean crease)
31703512 {
31713513 group.GenNormalsS(crease);
3514
+
3515
+ refreshContents();
3516
+ }
3517
+
3518
+ void GenNormalsMINE()
3519
+ {
3520
+ group.selection.GenNormalsMINE();
31723521
31733522 refreshContents();
31743523 }
....@@ -3334,8 +3683,8 @@
33343683
33353684 void ParseVertices()
33363685 {
3337
- boolean epsequal = GrafreeD.epsequal;
3338
- GrafreeD.epsequal = true;
3686
+ boolean epsequal = Grafreed.epsequal;
3687
+ Grafreed.epsequal = true;
33393688
33403689 for (int i=0; i<group.selection.size(); i++)
33413690 {
....@@ -3360,7 +3709,7 @@
33603709 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33613710 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33623711
3363
- g.add(GrafreeD.clipboard);
3712
+ g.add(Grafreed.clipboard);
33643713
33653714 buffer.add(g);
33663715 }
....@@ -3375,7 +3724,7 @@
33753724 makeSomething(buffer, i==group.selection.size()-1);
33763725 }
33773726
3378
- GrafreeD.epsequal = epsequal;
3727
+ Grafreed.epsequal = epsequal;
33793728
33803729 refreshContents();
33813730 }
....@@ -3393,7 +3742,16 @@
33933742 String pigment = Object3D.GetPigment(tex);
33943743 //String bump = Object3D.GetBump(tex);
33953744
3396
- 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
+ }
33973755
33983756 double s = v.s;
33993757
....@@ -3441,12 +3799,26 @@
34413799
34423800 void Align()
34433801 {
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
+
34443816 for (int i=0; i<group.selection.size(); i++)
34453817 {
34463818 Object3D obj = group.selection.get(i);
34473819
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- 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);
34503822 }
34513823
34523824 refreshContents();
....@@ -3467,11 +3839,11 @@
34673839
34683840 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693841
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3842
+ boolean random = CameraPane.SWITCH;
3843
+ CameraPane.SWITCH = false; // parse all random nodes
34723844 lowres.linkVerticesThis(null);
34733845 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3846
+ CameraPane.SWITCH = random;
34753847
34763848 System.err.flush();
34773849
....@@ -3511,7 +3883,7 @@
35113883 return;
35123884
35133885 Object3D poses = group.selection.get(0);
3514
- Object3D ref = GrafreeD.clipboard.get(0);
3886
+ Object3D ref = Grafreed.clipboard.get(0);
35153887
35163888 Object3D newgroup = new Object3D("Po:" + poses.name);
35173889
....@@ -3680,7 +4052,7 @@
36804052 group.selection.RelinkToSupport(); // july 2014
36814053 System.out.println("DONE.");
36824054 refreshContents();
3683
- 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));
36844056 }
36854057
36864058 void ReduceMesh(boolean reduction34)
....@@ -3705,9 +4077,9 @@
37054077
37064078 void ClipMesh()
37074079 {
3708
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4080
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37094081 {
3710
- Object3D content = GrafreeD.clipboard.get(0);
4082
+ Object3D content = Grafreed.clipboard.get(0);
37114083
37124084 if (content instanceof cGroup && ((cGroup)content).transientlink )
37134085 content = ((cGroup)content).get(0);
....@@ -3716,7 +4088,7 @@
37164088 // {
37174089 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37184090 // }
3719
- group.selection.ClipMesh(GrafreeD.clipboard);
4091
+ group.selection.ClipMesh(Grafreed.clipboard);
37204092 }
37214093 // group.selection.ClipMesh(GrafreeD.clipboard);
37224094 System.out.println("DONE.");
....@@ -3851,7 +4223,7 @@
38514223 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38524224
38534225 Object3D elem = (Object3D)group.selection.elementAt(i);
3854
- if(elem != group)
4226
+ if(elem != group || !newWindow)
38554227 {
38564228 // if (!(elem instanceof Composite))
38574229 // newWindow = false;
....@@ -3956,25 +4328,28 @@
39564328 System.err.println("info : " + child.GetPath());
39574329 }
39584330 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4331
+// else
4332
+// {
4333
+// objEditor.SetMaterial(group); // .GetMaterial());
4334
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4335
+// System.err.println("info : " + group.GetPath());
4336
+// }
39654337
39664338 objEditor.SetText(); // jan 2014
39674339
3968
- 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))
39694341 CameraPane.flash = true;
39704342
3971
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4343
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39724344 // a camera
39734345 {
3974
- CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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;
39784353 }
39794354
39804355 refreshContents();
....@@ -4056,16 +4431,18 @@
40564431 {
40574432 if (group.selection.isEmpty())
40584433 return;
4059
- GrafreeD.clipboardIsTempGroup = false;
4434
+
4435
+ Grafreed.clipboardIsTempGroup = false;
40604436 Composite tGroup = null;
40614437 if (group.selection.size() > 0) // 1)
40624438 {
40634439 tGroup = new cGroup();
4064
- GrafreeD.clipboardIsTempGroup = true;
4440
+ Grafreed.clipboardIsTempGroup = true;
40654441 }
40664442
40674443 if (cut)
40684444 {
4445
+ Save();
40694446 //int indices[] = jList.getSelectedIndices();
40704447 //for (int i = indices.length - 1; i >= 0; i--)
40714448 //jList.remove(indices[i]);
....@@ -4101,16 +4478,16 @@
41014478 //System.out.println("cut " + child);
41024479 //System.out.println("parent = " + child.parent);
41034480 // tmp.addChild(child);
4104
- if (GrafreeD.clipboardIsTempGroup)
4481
+ if (Grafreed.clipboardIsTempGroup)
41054482 tGroup.add/*Child*/(tmp);
41064483 else
4107
- GrafreeD.clipboard = tmp;
4484
+ Grafreed.clipboard = tmp;
41084485 }
41094486 else
4110
- if (GrafreeD.clipboardIsTempGroup)
4487
+ if (Grafreed.clipboardIsTempGroup)
41114488 tGroup.add/*Child*/(child);
41124489 else
4113
- GrafreeD.clipboard = child;
4490
+ Grafreed.clipboard = child;
41144491 }
41154492
41164493 //ResetModel();
....@@ -4142,21 +4519,23 @@
41424519 //System.out.println("cut " + elem);
41434520 //System.out.println("parent = " + elem.parent);
41444521 // tmp.addChild(elem);
4145
- if (GrafreeD.clipboardIsTempGroup)
4522
+ if (Grafreed.clipboardIsTempGroup)
41464523 tGroup.add/*Child*/(tmp);
41474524 else
4148
- GrafreeD.clipboard = tmp;
4525
+ Grafreed.clipboard = tmp;
41494526 }
41504527 else
4151
- if (GrafreeD.clipboardIsTempGroup)
4528
+ if (Grafreed.clipboardIsTempGroup)
41524529 tGroup.add/*Child*/(child);
41534530 else
4154
- GrafreeD.clipboard = child;
4531
+ Grafreed.clipboard = child;
41554532 }
41564533
41574534 }
4158
- if (GrafreeD.clipboardIsTempGroup)
4159
- GrafreeD.clipboard = tGroup;
4535
+
4536
+ if (Grafreed.clipboardIsTempGroup)
4537
+ Grafreed.clipboard = tGroup;
4538
+
41604539 if (cut)
41614540 {
41624541 ResetModel();
....@@ -4170,7 +4549,7 @@
41704549 // return;
41714550 boolean first = true;
41724551
4173
- if (GrafreeD.clipboardIsTempGroup)
4552
+ if (Grafreed.clipboardIsTempGroup)
41744553 {
41754554 Composite temp;
41764555
....@@ -4181,7 +4560,7 @@
41814560 temp = (Composite)Applet3D.clipboard.deepCopy();
41824561 */
41834562 Object3D elem;
4184
- 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))
41854564 {
41864565 Object3D child = (Object3D)e.nextElement();
41874566
....@@ -4215,21 +4594,21 @@
42154594 //Object3D cb = Applet3D.clipboard;
42164595 //temp.addChild(cb);
42174596 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4218
- assert(GrafreeD.clipboard.parent == null);
4219
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
42234602 else
4224
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
- GrafreeD.clipboard.get(0).parent = keepparent;
4603
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4604
+ Grafreed.clipboard.get(0).parent = keepparent;
42264605 }
42274606
42284607 ResetModel();
42294608 refreshContents();
42304609 }
42314610
4232
- void pasteInto(boolean copyit)
4611
+ void pasteInto(boolean copyit, boolean clone)
42334612 {
42344613 // if (GrafreeD.clipboard == null)
42354614 // return;
....@@ -4258,15 +4637,22 @@
42584637 if (copyit)
42594638 {
42604639 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4640
+ if (clone)
4641
+ {
4642
+ CloneClipboard(false); // sept 2014
4643
+ }
4644
+ else
4645
+ {
4646
+ paste(false);
4647
+ }
42624648 }
42634649 else
42644650 {
42654651 boolean first = true;
42664652
4267
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42684654 {
4269
- Composite temp = (Composite)GrafreeD.clipboard;
4655
+ Composite temp = (Composite)Grafreed.clipboard;
42704656 Object3D copy;
42714657 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42724658 {
....@@ -4276,7 +4662,7 @@
42764662 }
42774663 } else
42784664 {
4279
- linkSomething(GrafreeD.clipboard); //.get(0));
4665
+ linkSomething(Grafreed.clipboard); //.get(0));
42804666 }
42814667 }
42824668 }
....@@ -4468,6 +4854,26 @@
44684854 makeSomething(csg);
44694855 }
44704856
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
+
44714877 void ungroup()
44724878 {
44734879 /*
....@@ -4661,21 +5067,6 @@
46615067 }
46625068 */
46635069
4664
- void ImportGFD()
4665
- {
4666
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4667
- browser.show();
4668
- String filename = browser.getFile();
4669
- if (filename != null && filename.length() > 0)
4670
- {
4671
- String fullname = browser.getDirectory() + filename;
4672
-
4673
- //Object3D readobj =
4674
- objEditor.ReadGFD(fullname, objEditor);
4675
- //makeSomething(readobj);
4676
- }
4677
- }
4678
-
46795070 /*
46805071 public void Callback(Object obj)
46815072 {
....@@ -4699,26 +5090,9 @@
46995090 }
47005091 */
47015092
4702
- void ImportVRMLX3D()
4703
- {
4704
- if (GrafreeD.standAlone)
4705
- {
4706
- /**/
4707
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4708
- browser.show();
4709
- String filename = browser.getFile();
4710
- if (filename != null && filename.length() > 0)
4711
- {
4712
- String fullname = browser.getDirectory() + filename;
4713
- LoadVRMLX3D(fullname);
4714
- }
4715
- /**/
4716
- }
4717
- }
4718
-
47195093 String GetFile(String dialogName)
47205094 {
4721
- if (GrafreeD.standAlone)
5095
+ if (Grafreed.standAlone)
47225096 {
47235097 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47245098 browser.show();
....@@ -4782,10 +5156,15 @@
47825156 cButton flashSelectionButton;
47835157 cButton editButton;
47845158 cButton uneditButton;
5159
+ JCheckBox allParamsButton;
47855160 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875161 cButton unselectButton;
47885162
5163
+ cButton saveButton;
5164
+ cButton undoButton;
5165
+ cButton redoButton;
5166
+ cButton oneStepButton;
5167
+
47895168 cButton screenfitButton;
47905169 cButton screenfitpointButton;
47915170 cButton snapobjectButton;
....@@ -4816,6 +5195,8 @@
48165195 private MenuItem lookFromItem;
48175196 private MenuItem switchItem;
48185197 private MenuItem cutItem;
5198
+ private MenuItem undoItem;
5199
+ private MenuItem redoItem;
48195200 private MenuItem duplicateItem;
48205201 private MenuItem cloneItem;
48215202 private MenuItem cloneSupportItem;
....@@ -4827,8 +5208,9 @@
48275208 private MenuItem resetsupportItem;
48285209 private MenuItem resetreferencesItem;
48295210 private MenuItem linkverticesItem;
5211
+ private MenuItem relinkverticesItem;
48305212 private MenuItem setMasterItem;
4831
- private MenuItem resetMeshItem;
5213
+ private MenuItem resetAllItem;
48325214 private MenuItem stepAllItem;
48335215 private MenuItem revertMeshItem;
48345216 private MenuItem poseMeshItem;
....@@ -4839,14 +5221,17 @@
48395221 private MenuItem mergeGeometriesItem;
48405222 private MenuItem copyItem;
48415223 private MenuItem pasteItem;
5224
+ private MenuItem pasteIntoItem;
48425225 private MenuItem pasteLinkItem;
48435226 private MenuItem pasteCloneItem;
48445227 private MenuItem pasteExpandItem;
48455228 private MenuItem clearItem;
48465229 private MenuItem clearAllItem;
48475230 private MenuItem genUVItem;
5231
+ private MenuItem genNormalsMESHItem;
48485232 private MenuItem genNormalsCADItem;
48495233 private MenuItem genNormalsORGANItem;
5234
+ private MenuItem genNormalsMINEItem;
48505235 private MenuItem stripifyItem;
48515236 private MenuItem unstripifyItem;
48525237 private MenuItem trimItem;
....@@ -4886,8 +5271,11 @@
48865271 private MenuItem panoTexturesItem;
48875272
48885273 private MenuItem resetCentroidItem;
4889
- private MenuItem transformgeometryItem;
5274
+ private MenuItem resetCentroidXZItem;
48905275 private MenuItem resetTransformItem;
5276
+ private MenuItem transformGeometryItem;
5277
+ private MenuItem transformChildrenItem;
5278
+ private MenuItem hideItem;
48915279 private MenuItem grabItem;
48925280 private MenuItem backItem;
48935281 private MenuItem frontItem;
....@@ -4908,6 +5296,7 @@
49085296
49095297 private MenuItem resetParentItem;
49105298 private MenuItem repairParentItem;
5299
+ private MenuItem repairShadowItem;
49115300 private MenuItem sortbysizeItem;
49125301 private MenuItem sortbynameItem;
49135302
....@@ -4928,10 +5317,11 @@
49285317 private MenuItem coneItem;
49295318 private MenuItem torusItem;
49305319 private MenuItem superItem;
5320
+ private MenuItem kleinItem;
49315321 private MenuItem blobItem;
49325322 private MenuItem latheItem;
49335323 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5324
+ private MenuItem overlayItem;
49355325 private MenuItem meshItem;
49365326 // private MenuItem meshGroupItem;
49375327 private MenuItem springItem;
....@@ -4940,6 +5330,7 @@
49405330 private MenuItem csgItem;
49415331 private MenuItem templateItem;
49425332 private MenuItem textureItem;
5333
+ private MenuItem billboardItem;
49435334 private MenuItem shadowXItem;
49445335 private MenuItem shadowYItem;
49455336 private MenuItem shadowZItem;
....@@ -4952,11 +5343,6 @@
49525343 private MenuItem doubleItem;
49535344 private MenuItem tripleItem;
49545345
4955
- private MenuItem importGFDItem;
4956
- private MenuItem importVRMLX3DItem;
4957
- private MenuItem import3DSItem;
4958
- private MenuItem importOBJItem;
4959
-
49605346 private MenuItem computeAOItem;
49615347 private MenuItem recompileItem;
49625348 private MenuItem editScriptItem;
....@@ -4966,4 +5352,8 @@
49665352 private MenuItem analyzeItem;
49675353 private MenuItem dumpItem;
49685354 //boolean freezemodel = false;
5355
+
5356
+ Menu cameraMenu;
5357
+ MenuItem editCameraItem;
5358
+ MenuItem revertCameraItem;
49695359 }