Normand Briere
2019-06-17 26b49d8e26625491f4a407a05e9bc9d72037f938
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,130 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
286
+ }
287
+
192288 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
222320 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223321 relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
224325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225326 setMasterItem.addActionListener(this);
327
+ }
226328
227329 oe.menuBar.add(menu = new Menu("Group"));
228330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +335,32 @@
233335 frontItem.addActionListener(this);
234336 compositeItem = menu.add(new MenuItem("Composite"));
235337 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237339 hideItem.addActionListener(this);
238340 ungroupItem = menu.add(new MenuItem("Ungroup"));
239341 ungroupItem.addActionListener(this);
240342 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
242344 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248346 switchGeoItem.addActionListener(this);
249347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250348 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
252350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
253359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254360 scriptNodeItem.addActionListener(this);
255361 cameraItem = menu.add(new MenuItem("Camera"));
256362 cameraItem.addActionListener(this);
363
+ }
257364
258365 oe.menuBar.add(menu = new Menu("Object"));
259366 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +375,29 @@
268375 shadowYItem.addActionListener(this);
269376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
271381 linkerItem = menu.add(new MenuItem("Linker"));
272382 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275383 attributeItem = menu.add(new MenuItem("Attribute"));
276384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
277387 pointflowItem = menu.add(new MenuItem("Point Flow"));
278388 pointflowItem.addActionListener(this);
389
+ }
279390 menu.add("-");
280391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281392 resetTransformItem.addActionListener(this);
282393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283394 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
286401
287402 oe.menuBar.add(menu = new Menu("Geometry"));
288403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +408,11 @@
293408 genNormalsCADItem.addActionListener(this);
294409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
296413 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297414 genNormalsMINEItem.addActionListener(this);
415
+ }
298416 stripifyItem = menu.add(new MenuItem("Stripify"));
299417 stripifyItem.addActionListener(this);
300418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +434,34 @@
316434 reduce34MeshItem.addActionListener(this);
317435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318436 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
323445
324446 oe.menuBar.add(menu = new Menu("Attributes"));
325447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
327453 menu.add("-");
328454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329455 liveleavesItem.addActionListener(this);
330456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
332460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333461 supportleavesItem.addActionListener(this);
334462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335463 unsupportleavesItem.addActionListener(this);
464
+ }
336465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337466 hideleavesItem.addActionListener(this);
338467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,29 +505,22 @@
376505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377506 sortbynameItem.addActionListener(this);
378507 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.
379515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380516 extractGeometriesItem.addActionListener(this);
381517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382518 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
519
+ }
387520
388521 oe.menuBar.add(menu = new Menu("Insert"));
389522 buildCreateMenu(menu);
390523
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402524 oe.menuBar.add(menu = new Menu("Tools"));
403525 buildToolsMenu(menu);
404526 }
....@@ -433,150 +555,110 @@
433555 oe.radioPanel.add(dummyButton);
434556 oe.buttonGroup.add(dummyButton);
435557 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439559
440
- 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");
441574 liveCB.addItemListener(this);
442575
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
461582 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
503586 trackCB.addItemListener(this);
504587
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
507590 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
591
+
509592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510593 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515594
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
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");
522604 flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526605
527
- //
528
- 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");
529610 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531612 fourButton.addActionListener(this);
532
- 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");
533616 sixButton.addActionListener(this);
534
- 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");
535619 threeButton.addActionListener(this);
536
- 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");
537622 sevenButton.addActionListener(this);
538623 //
539624
540
- 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");
541627 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- 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");
544631 closeButton.addActionListener(this);
545632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546633 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548634
549
- oe.aConstraints.gridx = 1; //
550
- 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");
551639 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555640
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
557643 uneditButton.addActionListener(this);
558644
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
571647 allParamsButton.addActionListener(this);
572648
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
578655 unselectButton.addActionListener(this);
579656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
580662 // oe.aConstraints.gridx += 1;
581663 // oe.aConstraints.weighty = 0;
582664 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +670,37 @@
588670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589671 // gcButton.addActionListener(this);
590672
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
602676 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
604678 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
609682
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
614687 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- 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");
617691 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620695 textureCB.addItemListener(this);
621696
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
624700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
625704 //jList.addListSelectionListener(this);
626705 oe.jTree.addTreeSelectionListener(this);
627706 //jTree.setRootVisible(false);
....@@ -643,18 +722,91 @@
643722 radio.layout = sevenButton;
644723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645724 }
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
+ }
646797
647798 void EditObject(Object3D obj)
648799 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
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();
657808 }
809
+
658810 void SetupViews(ObjEditor oe)
659811 {
660812 oe.SetupViews();
....@@ -673,6 +825,7 @@
673825 JCheckBox fastCB;
674826 JCheckBox slowCB;
675827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
676829 JCheckBox trackCB;
677830 JCheckBox smoothfocusCB;
678831 // JCheckBox speakerMocapCB;
....@@ -715,10 +868,10 @@
715868 dropAttributes |= Object3D.TEXTURE;
716869 else
717870 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
720872 {
721873 cameraView.ToggleLive();
874
+ refreshContents(false);
722875 }
723876 else if(e.getSource() == supportCB)
724877 {
....@@ -753,6 +906,10 @@
753906 Recompile();
754907 cameraView.repaint();
755908 // refreshContents();
909
+ }
910
+ else if(e.getSource() == zoomBoxCB)
911
+ {
912
+ cameraView.ToggleZoomBoxMode();
756913 }
757914 else if(e.getSource() == smoothfocusCB)
758915 {
....@@ -867,7 +1024,9 @@
8671024 // objEditor.DropFile((java.io.File[]) object, true);
8681025 // return;
8691026 // }
870
- if (string.charAt(0) == '/')
1027
+
1028
+ // File path for Mac and Windows
1029
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711030 {
8721031 // file(s)
8731032 String[] names = string.split("\n");
....@@ -894,7 +1053,7 @@
8941053
8951054 flashIt = false;
8961055 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1056
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981057 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991058
9001059 if (group.selection.size() == 1)
....@@ -921,11 +1080,11 @@
9211080 {
9221081 loadClipboard(true);
9231082 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1083
+ pasteInto(false, false);
9251084 } else {
9261085 loadClipboard(false);
9271086 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1087
+ pasteInto(false, false); // true); // ???
9291088 }
9301089 }
9311090 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1206,33 @@
10471206 kleinItem.addActionListener(this);
10481207 particleItem = menu.add(new MenuItem("Particle system"));
10491208 particleItem.addActionListener(this);
1209
+ if (Globals.ADVANCED)
1210
+ {
10501211 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511212 ragdollItem.addActionListener(this);
10521213 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531214 ragdoll2Item.addActionListener(this);
1215
+ }
10541216 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1217
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561218 meshItem.addActionListener(this);
10571219 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581220 // meshGroupItem.addActionListener(this);
1221
+ if (Globals.ADVANCED)
1222
+ {
10591223 springItem = menu.add(new MenuItem("Spring"));
10601224 springItem.addActionListener(this);
10611225 flagItem = menu.add(new MenuItem("Flag"));
10621226 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671227 blobItem = menu.add(new MenuItem("Blob"));
10681228 blobItem.addActionListener(this);
10691229 latheItem = menu.add(new MenuItem("Lathe"));
10701230 latheItem.addActionListener(this);
1231
+ }
1232
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1233
+ bezierItem.addActionListener(this);
1234
+ overlayItem = menu.add(new MenuItem("Overlay"));
1235
+ overlayItem.addActionListener(this);
10711236 lightItem = menu.add(new MenuItem("Light"));
10721237 lightItem.addActionListener(this);
10731238 menu.add("-");
....@@ -1077,39 +1242,44 @@
10771242 loopItem.addActionListener(this);
10781243 doubleItem = menu.add(new MenuItem("Fork"));
10791244 doubleItem.addActionListener(this);
1245
+ if (Globals.ADVANCED)
1246
+ {
10801247 tripleItem = menu.add(new MenuItem("Trident"));
10811248 tripleItem.addActionListener(this);
1249
+ }
10821250 }
10831251
10841252 void buildToolsMenu(Menu menu)
10851253 {
10861254 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871255 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1256
+ animationItem.setState(Globals.ANIMATION);
10891257
10901258 menu.add("-");
10911259 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921260 parseverticesItem.addActionListener(this);
10931261 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941262 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1263
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961264 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991265 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001266 reduceMorphItem.addActionListener(this);
11011267 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021268 reduce34MorphItem.addActionListener(this);
1103
-
1269
+ menu.add("-");
11041270 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051271 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071272
1273
+ if (Globals.ADVANCED)
1274
+ {
1275
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1276
+ mirrorItem.addActionListener(this);
1277
+ menu.add("-");
11081278 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091279 memoryItem.addActionListener(this);
11101280 menu.add(analyzeItem = new MenuItem("Analyze"));
11111281 analyzeItem.addActionListener(this);
1112
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
11131283 dumpItem.addActionListener(this);
11141284 // menu.add(pathItem = new MenuItem("From-to path"));
11151285 // pathItem.addActionListener(this);
....@@ -1118,6 +1288,8 @@
11181288 resetParentItem.addActionListener(this);
11191289 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201290 repairParentItem.addActionListener(this);
1291
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1292
+ repairShadowItem.addActionListener(this);
11211293 menu.add(invariantsItem = new MenuItem("Invariants"));
11221294 invariantsItem.addActionListener(this);
11231295 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1297,7 @@
11251297 menu.add("-");
11261298 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271299 editScriptItem.addActionListener(this);
1300
+ }
11281301 }
11291302
11301303 void ScreenFit()
....@@ -1453,9 +1626,9 @@
14531626
14541627 void Overwrite(int mask)
14551628 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1629
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571630 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1631
+ Object3D content = Grafreed.clipboard.get(0);
14591632
14601633 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611634 content = ((cGroup)content).get(0);
....@@ -1478,6 +1651,7 @@
14781651 //
14791652 public void actionPerformed(ActionEvent event) // , Object arg)
14801653 {
1654
+ Object source = event.getSource();
14811655 /*
14821656 if (event.getSource() == nameField)
14831657 {
....@@ -1489,11 +1663,11 @@
14891663 }
14901664 else
14911665 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1666
+ if (source == lookAtItem || source == lookFromItem)
14931667 {
14941668 ScreenFit();
14951669 } else
1496
- if (event.getSource() == switchItem)
1670
+ if (source == switchItem)
14971671 {
14981672 cVector v1 = new cVector();
14991673 cVector v2 = new cVector();
....@@ -1502,11 +1676,11 @@
15021676 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031677 objEditor.cameraView.repaint();
15041678 } else
1505
- if (event.getSource() == rectoidItem)
1679
+ if (source == rectoidItem)
15061680 {
15071681 makeSomething(new Box());
15081682 } else
1509
- if (event.getSource() == particleItem)
1683
+ if (source == particleItem)
15101684 {
15111685 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121686 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1701,9 @@
15271701 applyExample(particleGeom, "SMOKE");
15281702 makeSomething(particleGeom);
15291703 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1704
+ if (source == ragdollItem || source == ragdoll2Item)
15311705 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1706
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331707
15341708 ragdoll.toParent = LA.newMatrix();
15351709 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1721,7 @@
15471721 } else
15481722 /*
15491723 */
1550
- if (event.getSource() == heightFieldItem)
1724
+ if (source == heightFieldItem)
15511725 {
15521726 Object3D obj = new Object3D();
15531727
....@@ -1585,31 +1759,31 @@
15851759
15861760 makeSomething(obj);
15871761 } else
1588
- if (event.getSource() == gridItem)
1762
+ if (source == gridItem)
15891763 {
15901764 makeSomething(new Grid());
15911765 } else
1592
- if (event.getSource() == ellipsoidItem)
1766
+ if (source == ellipsoidItem)
15931767 {
15941768 makeSomething(new Sphere());
15951769 } else
1596
- if (event.getSource() == coneItem)
1770
+ if (source == coneItem)
15971771 {
15981772 makeSomething(new Cone());
15991773 } else
1600
- if (event.getSource() == torusItem)
1774
+ if (source == torusItem)
16011775 {
16021776 makeSomething(new Torus());
16031777 } else
1604
- if (event.getSource() == superItem)
1778
+ if (source == superItem)
16051779 {
16061780 makeSomething(new Superellipsoid());
16071781 } else
1608
- if (event.getSource() == kleinItem)
1782
+ if (source == kleinItem)
16091783 {
16101784 makeSomething(new Klein());
16111785 } else
1612
- if (event.getSource() == blobItem)
1786
+ if (source == blobItem)
16131787 {
16141788 Blob blob = new Blob();
16151789 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1791,15 @@
16171791 //blob.retile();
16181792 makeSomething(blob);
16191793 } else
1620
- if (event.getSource() == latheItem)
1794
+ if (source == latheItem)
16211795 {
16221796 makeSomething(new Lathe());
16231797 } else
1624
- if (event.getSource() == bezierItem)
1798
+ if (source == bezierItem)
16251799 {
16261800 makeSomething(new BezierSurface());
16271801 } else
1628
- if (event.getSource() == checkerItem)
1802
+ if (source == overlayItem)
16291803 {
16301804 /*
16311805 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1814,7 @@
16401814 */
16411815 makeSomething(new Checker());
16421816 } else
1643
- if (event.getSource() == meshItem)
1817
+ if (source == meshItem)
16441818 {
16451819 Object3D itemtomake = new Object3D();
16461820 Object3D child;
....@@ -1661,35 +1835,35 @@
16611835 makeSomething(child);
16621836 }
16631837 } else
1664
- if (event.getSource() == springItem)
1838
+ if (source == springItem)
16651839 {
16661840 cSpring s = new cSpring();
16671841 s.setup();
16681842 makeSomething(s);
16691843 } else
1670
- if (event.getSource() == flagItem)
1844
+ if (source == flagItem)
16711845 {
16721846 cSpring s = new cFlag();
16731847 s.setup();
16741848 makeSomething(s);
16751849 } else
1676
- if (event.getSource() == lightItem)
1850
+ if (source == lightItem)
16771851 {
16781852 makeSomething(new Light());
16791853 } else
1680
- if (event.getSource() == csgItem)
1854
+ if (source == csgItem)
16811855 {
16821856 group(new CSG());
16831857 } else
1684
- if (event.getSource() == templateItem)
1858
+ if (source == templateItem)
16851859 {
16861860 group(new cTemplate());
16871861 } else
1688
- if (event.getSource() == attributeItem)
1862
+ if (source == attributeItem)
16891863 {
16901864 makeSomething(new Attribute());
16911865 } else
1692
- if (event.getSource() == pointflowItem)
1866
+ if (source == pointflowItem)
16931867 {
16941868 makeSomething(new PointFlow());
16951869 } else
....@@ -1701,7 +1875,7 @@
17011875 } else
17021876 */
17031877
1704
- if (event.getSource() == superLoopItem)
1878
+ if (source == superLoopItem)
17051879 {
17061880 Composite g = new cGroup();
17071881 for (int i=0; i<15; i++)
....@@ -1723,7 +1897,7 @@
17231897
17241898 group(g);
17251899 } else
1726
- if (event.getSource() == loopItem)
1900
+ if (source == loopItem)
17271901 {
17281902 Composite csg = new GroupLeaf();
17291903 csg.count = 5;
....@@ -1732,7 +1906,7 @@
17321906 csg.addChild(child);
17331907 child.addChild(csg);
17341908 } else
1735
- if (event.getSource() == doubleItem)
1909
+ if (source == doubleItem)
17361910 {
17371911 Composite csg = new GroupLeaf();
17381912 csg.count = 5;
....@@ -1744,7 +1918,7 @@
17441918 csg.addChild(child);
17451919 child.addChild(csg);
17461920 } else
1747
- if (event.getSource() == tripleItem)
1921
+ if (source == tripleItem)
17481922 {
17491923 Composite csg = new GroupLeaf();
17501924 csg.count = 4;
....@@ -1759,71 +1933,71 @@
17591933 csg.addChild(child);
17601934 child.addChild(csg);
17611935 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
1936
+ if (source == computeAOItem)
17641937 {
1765
- ImportGFD();
1938
+ Globals.drawMode = CameraPane.OCCLUSION;
1939
+ Globals.theRenderer.repaint();
17661940 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
1941
+ if (source == recompileItem)
17851942 {
17861943 Recompile();
17871944 refreshContents();
17881945 } else
1789
- if (event.getSource() == editScriptItem)
1946
+ if (source == editScriptItem)
17901947 {
17911948 OpenDialog();
17921949 refreshContents();
17931950 } else
1794
- if (event.getSource() == invariantsItem)
1951
+ if (source == invariantsItem)
17951952 {
17961953 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1954
+ Grafreed.grafreeD.universe.invariants();
17981955 } else
1799
- if (event.getSource() == memoryItem)
1956
+ if (source == memoryItem)
18001957 {
18011958 //System.out.println("Invariants:");
18021959 PrintMemory();
18031960 } else
1804
- if (event.getSource() == pathItem)
1961
+ if (source == pathItem)
18051962 {
18061963 PrintPath();
18071964 } else
1808
- if (event.getSource() == analyzeItem)
1965
+ if (source == analyzeItem)
18091966 {
18101967 AnalyzeObject();
18111968 } else
1812
- if (event.getSource() == dumpItem)
1969
+ if (source == dumpItem)
18131970 {
18141971 DumpObject();
18151972 } else
1816
- if (event.getSource() == screenfitButton)
1973
+ if (source == undoButton)
1974
+ {
1975
+ Undo();
1976
+ } else
1977
+ if (source == redoButton)
1978
+ {
1979
+ Redo();
1980
+ } else
1981
+ if (source == saveButton)
1982
+ {
1983
+ Save();
1984
+ } else
1985
+ if (source == oneStepButton)
1986
+ {
1987
+ Globals.ONESTEP = true;
1988
+ cameraView.repaint();
1989
+ } else
1990
+ if (source == screenfitButton)
18171991 {
18181992 //Reload(lastConverter, lastFilename, true);
18191993 ScreenFit();
18201994 } else
1821
- if (event.getSource() == screenfitpointButton)
1995
+ if (source == screenfitpointButton)
18221996 {
18231997 //Reload(lastConverter, lastFilename, true);
18241998 ScreenFitPoint();
18251999 } else
1826
- if (event.getSource() == snapobjectButton)
2000
+ if (source == snapobjectButton)
18272001 {
18282002 //Reload(lastConverter, lastFilename, true);
18292003 SnapObject();
....@@ -1834,13 +2008,13 @@
18342008 // Recompile();
18352009 // refreshContents();
18362010 // } else
1837
- if (event.getSource() == gcButton)
2011
+ if (source == gcButton)
18382012 {
18392013 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402014 System.gc();
18412015 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422016 } else
1843
- if (event.getSource() == editLeafItem)
2017
+ if (source == editLeafItem)
18442018 {
18452019 Object3D obj;
18462020 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2028,74 @@
18542028 }
18552029 refreshContents(true);
18562030 } else
1857
- if (event.getSource() == openWindowItem)
2031
+ if (source == openWindowItem)
18582032 {
18592033 EditSelection(true);
18602034 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2035
+ if (source == cutItem || source == clearButton)
18622036 {
18632037 loadClipboard(true);
18642038 } else
1865
- if (event.getSource() == duplicateItem)
2039
+ if (source == undoItem)
18662040 {
1867
- Object3D keep = GrafreeD.clipboard;
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoItem)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == duplicateItem)
2048
+ {
2049
+ Object3D keep = Grafreed.clipboard;
18682050 loadClipboard(false);
18692051 paste(false);
1870
- GrafreeD.clipboard = keep;
2052
+ Grafreed.clipboard = keep;
18712053 } else
1872
- if (event.getSource() == cloneItem)
2054
+ if (source == cloneItem)
18732055 {
18742056 CloneSelection(false);
18752057 } else
1876
- if (event.getSource() == cloneSupportItem)
2058
+ if (source == cloneSupportItem)
18772059 {
18782060 CloneSelection(true);
18792061 } else
1880
- if (event.getSource() == copyItem)
2062
+ if (source == copyItem)
18812063 {
18822064 loadClipboard(false);
18832065 } else
1884
- if (event.getSource() == pasteItem)
2066
+ if (source == pasteItem)
18852067 {
18862068 paste(false);
18872069 } else
1888
- if (event.getSource() == pasteLinkItem)
2070
+ if (source == pasteIntoItem)
18892071 {
1890
- pasteInto(false);
2072
+ pasteInto(true, false);
18912073 } else
1892
- if (event.getSource() == pasteCloneItem)
2074
+ if (source == pasteLinkItem)
18932075 {
1894
- pasteInto(true);
2076
+ pasteInto(false, false);
18952077 } else
1896
- if (event.getSource() == pasteExpandItem)
2078
+ if (source == pasteCloneItem)
2079
+ {
2080
+ pasteInto(true, true);
2081
+ } else
2082
+ if (source == pasteExpandItem)
18972083 {
18982084 paste(true);
18992085 } else
1900
- if (event.getSource() == synchronizeItem)
2086
+ if (source == synchronizeItem)
19012087 {
19022088 Overwrite(Object3D.TRANSFORM);
19032089 } else
1904
- if (event.getSource() == overwriteNameItem)
2090
+ if (source == overwriteNameItem)
19052091 {
19062092 Overwrite(Object3D.NAME);
19072093 } else
1908
- if (event.getSource() == overwriteUVItem)
2094
+ if (source == overwriteUVItem)
19092095 {
19102096 Overwrite(Object3D.UV);
19112097 } else
1912
- if (event.getSource() == overwriteMatItem)
2098
+ if (source == overwriteMatItem)
19132099 {
19142100 /* july 2015
19152101 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2115,7 @@
19292115
19302116 Overwrite(dropAttributes);
19312117 }
1932
- if (event.getSource() == overwriteGeoItem)
2118
+ if (source == overwriteGeoItem)
19332119 {
19342120 Overwrite(Object3D.GEOMETRY);
19352121 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2132,7 @@
19462132 // refreshContents();
19472133 // }
19482134 } else
1949
- if (event.getSource() == generateMeshItem)
2135
+ if (source == generateMeshItem)
19502136 {
19512137 //if (group.selection.size() == 1)
19522138 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2143,7 @@
19572143 ResetModel();
19582144 refreshContents();
19592145 } else
1960
- if (event.getSource() == extractGeometriesItem)
2146
+ if (source == extractGeometriesItem)
19612147 {
19622148 boolean one = false;
19632149
....@@ -1984,7 +2170,7 @@
19842170 ResetModel();
19852171 refreshContents();
19862172 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2173
+ if (source == cloneGeometriesItem)
19882174 {
19892175 boolean one = false;
19902176
....@@ -2010,7 +2196,7 @@
20102196 ResetModel();
20112197 refreshContents();
20122198 } else
2013
- if (event.getSource() == shareGeometriesItem)
2199
+ if (source == shareGeometriesItem)
20142200 {
20152201 boolean one = false;
20162202
....@@ -2040,7 +2226,7 @@
20402226 refreshContents();
20412227 }
20422228 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2229
+ if (source == mergeGeometriesItem)
20442230 {
20452231 boolean one = false;
20462232
....@@ -2070,7 +2256,7 @@
20702256 ResetModel();
20712257 refreshContents();
20722258 } else
2073
- if (event.getSource() == linkverticesItem)
2259
+ if (source == linkverticesItem)
20742260 {
20752261 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762262 // {
....@@ -2083,48 +2269,48 @@
20832269 // group.selection.get(0).setMasterThis(content); // should be identity
20842270 // refreshContents();
20852271 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2272
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872273 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2274
+ Object3D content = Grafreed.clipboard.get(0);
20892275
20902276 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912277 content = ((cGroup)content).get(0);
20922278
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2279
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942280 for (int i=0; i<group.selection.size(); i++)
20952281 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2282
+ boolean random = CameraPane.SWITCH;
2283
+ CameraPane.SWITCH = false; // parse all random nodes
20982284 group.selection.get(i).linkVerticesThis(content);
20992285 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2286
+ CameraPane.SWITCH = random;
21012287 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2288
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032289 refreshContents();
21042290 }
21052291 } else
2106
- if (event.getSource() == resetsupportItem)
2292
+ if (source == resetsupportItem)
21072293 {
21082294 for (int i=0; i<group.selection.size(); i++)
21092295 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2296
+ boolean random = CameraPane.SWITCH;
2297
+ CameraPane.SWITCH = false; // parse all random nodes
21122298 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2299
+ CameraPane.SWITCH = random;
21142300 }
21152301
21162302 refreshContents();
21172303 } else
2118
- if (event.getSource() == relinkverticesItem)
2304
+ if (source == relinkverticesItem)
21192305 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2306
+ boolean random = CameraPane.SWITCH;
2307
+ CameraPane.SWITCH = false; // parse all random nodes
21222308 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2309
+ CameraPane.SWITCH = random;
21242310
21252311 refreshContents();
21262312 } else
2127
- if (event.getSource() == resetreferencesItem)
2313
+ if (source == resetreferencesItem)
21282314 {
21292315 for (int i=0; i<group.selection.size(); i++)
21302316 {
....@@ -2133,11 +2319,11 @@
21332319
21342320 refreshContents();
21352321 } else
2136
- if (event.getSource() == setMasterItem)
2322
+ if (source == setMasterItem)
21372323 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2324
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392325 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2326
+ Object3D content = Grafreed.clipboard.get(0);
21412327
21422328 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432329 content = ((cGroup)content).get(0);
....@@ -2146,13 +2332,13 @@
21462332 refreshContents();
21472333 }
21482334 } else
2149
- if (event.getSource() == poseMeshItem)
2335
+ if (source == poseMeshItem)
21502336 {
21512337 if (group.selection.size() == 1)
21522338 {
2153
- if (GrafreeD.clipboard.size() == 1)
2339
+ if (Grafreed.clipboard.size() == 1)
21542340 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
21562342
21572343 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582344 content = ((cGroup)content).get(0);
....@@ -2165,19 +2351,19 @@
21652351 }
21662352
21672353 } else
2168
- if (event.getSource() == revertMeshItem)
2354
+ if (source == revertMeshItem)
21692355 {
21702356 RevertMeshes();
21712357 } else
2172
- if (event.getSource() == resetMeshItem)
2358
+ if (source == resetAllItem)
21732359 {
21742360 ResetAll();
21752361 } else
2176
- if (event.getSource() == stepAllItem)
2362
+ if (source == stepAllItem)
21772363 {
21782364 StepAll();
21792365 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2366
+ if (source == clearItem) // || event.getSource() == clearButton)
21812367 {
21822368 //int indices[] = jList.getSelectedIndices();
21832369 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2371,46 @@
21852371
21862372 ClearSelection(false);
21872373 } else
2188
- if (event.getSource() == clearAllItem)
2374
+ if (source == clearAllItem)
21892375 {
21902376 ClearSelection(true);
21912377 } else
2192
- if (event.getSource() == grabItem)
2378
+ if (source == grabItem)
21932379 {
21942380 group(new cGroup(), true);
21952381 } else
2196
- if (event.getSource() == hideItem)
2382
+ if (source == hideItem)
21972383 {
21982384 group(new HiddenObject());
21992385 } else
2200
- if (event.getSource() == frontItem)
2386
+ if (source == frontItem)
22012387 {
22022388 front();
22032389 } else
2204
- if (event.getSource() == backItem)
2390
+ if (source == backItem)
22052391 {
22062392 back();
22072393 } else
2208
- if (event.getSource() == cameraItem)
2394
+ if (source == cameraItem)
22092395 {
22102396 makeSomething(new Camera());
22112397 } else
2212
- if (event.getSource() == compositeItem)
2398
+ if (source == compositeItem)
22132399 {
22142400 group(new Composite());
22152401 } else
2216
- if (event.getSource() == randomItem)
2402
+ if (source == randomItem)
22172403 {
22182404 RandomNode random = new RandomNode();
22192405 group(random);
22202406 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2407
+ random.name = random.get(0).name + "Switch";
22222408 } else
2223
- if (event.getSource() == physicsItem)
2409
+ if (source == physicsItem)
22242410 {
22252411 group(new PhysicsNode());
22262412 } else
2227
- if (event.getSource() == frameselectorItem)
2413
+ if (source == frameselectorItem)
22282414 {
22292415 for (int i=0; i<group.selection.size(); i++)
22302416 {
....@@ -2236,7 +2422,7 @@
22362422 ResetModel();
22372423 refreshContents();
22382424 } else
2239
- if (event.getSource() == switchGeoItem)
2425
+ if (source == switchGeoItem)
22402426 {
22412427 for (int i=0; i<group.selection.size(); i++)
22422428 {
....@@ -2248,7 +2434,7 @@
22482434 ResetModel();
22492435 refreshContents();
22502436 } else
2251
- if (event.getSource() == switchTransfoItem)
2437
+ if (source == switchTransfoItem)
22522438 {
22532439 for (int i=0; i<group.selection.size(); i++)
22542440 {
....@@ -2260,7 +2446,7 @@
22602446 ResetModel();
22612447 refreshContents();
22622448 } else
2263
- if (event.getSource() == morphItem)
2449
+ if (source == morphItem)
22642450 {
22652451 for (int i=0; i<group.selection.size(); i++)
22662452 {
....@@ -2272,7 +2458,7 @@
22722458 ResetModel();
22732459 refreshContents();
22742460 } else
2275
- if (event.getSource() == scriptNodeItem)
2461
+ if (source == scriptNodeItem)
22762462 {
22772463 boolean atleastone = false;
22782464
....@@ -2311,31 +2497,31 @@
23112497 }
23122498 }
23132499 } else
2314
- if (event.getSource() == linkerItem)
2500
+ if (source == linkerItem)
23152501 {
23162502 group(new cLinker());
23172503 } else
2318
- if (event.getSource() == textureItem)
2504
+ if (source == textureItem)
23192505 {
23202506 group(new TextureNode());
23212507 } else
2322
- if (event.getSource() == billboardItem)
2508
+ if (source == billboardItem)
23232509 {
23242510 group(new BillboardNode());
23252511 } else
2326
- if (event.getSource() == shadowXItem)
2512
+ if (source == shadowXItem)
23272513 {
23282514 CastShadow(0);
23292515 } else
2330
- if (event.getSource() == shadowYItem)
2516
+ if (source == shadowYItem)
23312517 {
23322518 CastShadow(1);
23332519 } else
2334
- if (event.getSource() == shadowZItem)
2520
+ if (source == shadowZItem)
23352521 {
23362522 CastShadow(2);
23372523 } else
2338
- if (event.getSource() == ungroupItem)
2524
+ if (source == ungroupItem)
23392525 {
23402526 //ungroup();
23412527 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2533,187 @@
23472533
23482534 refreshContents();
23492535 } else
2350
- if (event.getSource() == genUVItem)
2536
+ if (source == genUVItem)
23512537 {
23522538 GenUV();
23532539 } else
2354
- if (event.getSource() == genNormalsCADItem)
2540
+ if (source == genNormalsCADItem)
23552541 {
23562542 GenNormals(true);
23572543 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2544
+ if (source == genNormalsMESHItem)
23592545 {
2360
- GenNormals(true); // TODO
2546
+ GenNormalsMESH();
23612547 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2548
+ if (source == genNormalsORGANItem)
23632549 {
23642550 GenNormals(false);
23652551 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2552
+ if (source == genNormalsMINEItem)
23672553 {
23682554 GenNormalsMINE();
23692555 } else
2370
- if (event.getSource() == stripifyItem)
2556
+ if (source == stripifyItem)
23712557 {
23722558 Stripify();
23732559 } else
2374
- if (event.getSource() == unstripifyItem)
2560
+ if (source == unstripifyItem)
23752561 {
23762562 Unstripify();
23772563 } else
2378
- if (event.getSource() == trimItem)
2564
+ if (source == trimItem)
23792565 {
23802566 Trim();
23812567 } else
2382
- if (event.getSource() == untrimItem)
2568
+ if (source == untrimItem)
23832569 {
23842570 Untrim();
23852571 } else
2386
- if (event.getSource() == clearColorsItem)
2572
+ if (source == clearColorsItem)
23872573 {
23882574 ClearColors();
23892575 } else
2390
- if (event.getSource() == clearMaterialsItem)
2576
+ if (source == clearMaterialsItem)
23912577 {
23922578 ClearMaterials();
23932579 } else
2394
- if (event.getSource() == liveleavesItem)
2580
+ if (source == liveleavesItem)
23952581 {
23962582 LiveLeaves(true);
23972583 } else
2398
- if (event.getSource() == unliveleavesItem)
2584
+ if (source == unliveleavesItem)
23992585 {
24002586 LiveLeaves(false);
24012587 } else
2402
- if (event.getSource() == supportleavesItem)
2588
+ if (source == supportleavesItem)
24032589 {
24042590 SupportLeaves(true);
24052591 } else
2406
- if (event.getSource() == unsupportleavesItem)
2592
+ if (source == unsupportleavesItem)
24072593 {
24082594 SupportLeaves(false);
24092595 } else
2410
- if (event.getSource() == hideleavesItem)
2596
+ if (source == hideleavesItem)
24112597 {
24122598 HideLeaves(true);
24132599 } else
2414
- if (event.getSource() == showleavesItem)
2600
+ if (source == showleavesItem)
24152601 {
24162602 HideLeaves(false);
24172603 } else
2418
- if (event.getSource() == markleavesItem)
2604
+ if (source == markleavesItem)
24192605 {
24202606 MarkLeaves(true);
24212607 } else
2422
- if (event.getSource() == unmarkleavesItem)
2608
+ if (source == unmarkleavesItem)
24232609 {
24242610 MarkLeaves(false);
24252611 } else
2426
- if (event.getSource() == flipVItem)
2612
+ if (source == flipVItem)
24272613 {
24282614 FlipV(true);
24292615 } else
2430
- if (event.getSource() == unflipVItem)
2616
+ if (source == unflipVItem)
24312617 {
24322618 FlipV(false);
24332619 } else
2434
- if (event.getSource() == lowTexturesItem)
2620
+ if (source == lowTexturesItem)
24352621 {
24362622 SetTexRes(0);
24372623 } else
2438
- if (event.getSource() == normalTexturesItem)
2624
+ if (source == normalTexturesItem)
24392625 {
24402626 SetTexRes(1);
24412627 } else
2442
- if (event.getSource() == highTexturesItem)
2628
+ if (source == highTexturesItem)
24432629 {
24442630 SetTexRes(2);
24452631 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2632
+ if (source == veryhighTexturesItem)
24472633 {
24482634 SetTexRes(3);
24492635 } else
2450
- if (event.getSource() == maxTexturesItem)
2636
+ if (source == maxTexturesItem)
24512637 {
24522638 SetTexRes(4);
24532639 } else
2454
- if (event.getSource() == panoTexturesItem)
2640
+ if (source == panoTexturesItem)
24552641 {
24562642 SetTexRes(5);
24572643 } else
2458
- if (event.getSource() == reverseNormalsItem)
2644
+ if (source == reverseNormalsItem)
24592645 {
24602646 ReverseNormals();
24612647 } else
2462
- if (event.getSource() == parseverticesItem)
2648
+ if (source == parseverticesItem)
24632649 {
24642650 ParseVertices();
24652651 } else
2466
- if (event.getSource() == textureFieldItem)
2652
+ if (source == textureFieldItem)
24672653 {
24682654 TextureVertices();
24692655 } else
2470
- if (event.getSource() == alignItem)
2656
+ if (source == alignItem)
24712657 {
24722658 Align();
24732659 } else
2474
- if (event.getSource() == mirrorItem)
2660
+ if (source == mirrorItem)
24752661 {
24762662 MirrorPoses();
24772663 } else
2478
- if (event.getSource() == reduceMorphItem)
2664
+ if (source == reduceMorphItem)
24792665 {
24802666 MeshReduction(false);
24812667 } else
2482
- if (event.getSource() == reduce34MorphItem)
2668
+ if (source == reduce34MorphItem)
24832669 {
24842670 MeshReduction(true);
24852671 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2672
+ if (source == reverseTrianglesItem)
24872673 {
24882674 ReverseTriangles();
24892675 } else
2490
- if (event.getSource() == reduceMeshItem)
2676
+ if (source == reduceMeshItem)
24912677 {
24922678 ReduceMesh(false);
24932679 } else
2494
- if (event.getSource() == reduce34MeshItem)
2680
+ if (source == reduce34MeshItem)
24952681 {
24962682 ReduceMesh(true);
24972683 } else
2498
- if (event.getSource() == increaseMeshItem)
2684
+ if (source == increaseMeshItem)
24992685 {
25002686 IncreaseMesh();
25012687 } else
2502
- if (event.getSource() == clipMeshItem)
2688
+ if (source == clipMeshItem)
25032689 {
25042690 ClipMesh();
25052691 } else
2506
- if (event.getSource() == smoothMeshItem)
2692
+ if (source == smoothMeshItem)
25072693 {
25082694 SmoothMesh();
25092695 } else
2510
- if (event.getSource() == transformgeometryItem)
2696
+ if (source == transformGeometryItem)
25112697 {
25122698 TransformGeometry();
25132699 } else
2514
- if (event.getSource() == resetTransformItem)
2700
+ if (source == transformChildrenItem)
2701
+ {
2702
+ TransformChildren();
2703
+ } else
2704
+ if (source == resetTransformItem)
25152705 {
25162706 ResetTransform();
25172707 } else
2518
- if (event.getSource() == resetCentroidItem)
2708
+ if (source == resetCentroidItem)
25192709 {
2520
- ResetCentroid();
2710
+ ResetCentroid(true);
25212711 } else
2522
- if (event.getSource() == resetParentItem)
2712
+ if (source == resetCentroidXZItem)
2713
+ {
2714
+ ResetCentroid(false);
2715
+ } else
2716
+ if (source == resetParentItem)
25232717 {
25242718 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252719 {
....@@ -2529,7 +2723,7 @@
25292723
25302724 refreshContents();
25312725 } else
2532
- if (event.getSource() == repairParentItem)
2726
+ if (source == repairParentItem)
25332727 {
25342728 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352729 {
....@@ -2543,7 +2737,21 @@
25432737
25442738 refreshContents();
25452739 } else
2546
- if (event.getSource() == sortbysizeItem)
2740
+ if (source == repairShadowItem)
2741
+ {
2742
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2743
+ {
2744
+ Object3D obj = (Object3D)e.nextElement();
2745
+ obj.RepairShadow();
2746
+// for (int i=0; i<obj.size(); i++)
2747
+// {
2748
+// obj.get(i).parent = obj;
2749
+// }
2750
+ }
2751
+
2752
+ refreshContents();
2753
+ } else
2754
+ if (source == sortbysizeItem)
25472755 {
25482756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492757 {
....@@ -2555,7 +2763,7 @@
25552763 ResetModel();
25562764 refreshContents();
25572765 } else
2558
- if (event.getSource() == sortbynameItem)
2766
+ if (source == sortbynameItem)
25592767 {
25602768 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612769 {
....@@ -2567,7 +2775,7 @@
25672775 ResetModel();
25682776 refreshContents();
25692777 } else
2570
- if (event.getSource() == attachPigmentItem)
2778
+ if (source == attachPigmentItem)
25712779 {
25722780 String texture = GetFile("Attach pigment");
25732781 Object3D obj;
....@@ -2579,7 +2787,7 @@
25792787
25802788 refreshContents();
25812789 } else
2582
- if (event.getSource() == detachPigmentItem)
2790
+ if (source == detachPigmentItem)
25832791 {
25842792 Object3D obj;
25852793 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2798,7 @@
25902798
25912799 refreshContents();
25922800 } else
2593
- if (event.getSource() == attachBumpItem)
2801
+ if (source == attachBumpItem)
25942802 {
25952803 String texture = GetFile("Attach bump");
25962804 Object3D obj;
....@@ -2602,7 +2810,7 @@
26022810
26032811 refreshContents();
26042812 } else
2605
- if (event.getSource() == detachBumpItem)
2813
+ if (source == detachBumpItem)
26062814 {
26072815 Object3D obj;
26082816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2821,7 @@
26132821
26142822 refreshContents();
26152823 } else
2616
- if (event.getSource() == pigmentBumpItem)
2824
+ if (source == pigmentBumpItem)
26172825 {
26182826 Object3D obj;
26192827 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2832,195 @@
26242832
26252833 refreshContents();
26262834 } else
2627
- if (event.getSource() == flashSelectionButton)
2835
+ if (source == flashSelectionButton)
26282836 {
26292837 CameraPane.flash = true;
26302838 refreshContents();
26312839 } else
2632
- if (event.getSource() == oneButton)
2840
+ if (source == oneButton)
26332841 {
26342842 } else
2635
- if (event.getSource() == twoButton)
2843
+ if (source == twoButton)
26362844 {
26372845 radio.layout = twoButton;
26382846 // bug
26392847 //gridPanel.setDividerLocation(1.0);
26402848 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(jtp);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
2849
+// bigThree.remove(scenePanel);
2850
+// bigThree.remove(centralPanel);
2851
+// bigThree.remove(XYZPanel);
2852
+// aWindowConstraints.gridx = 0;
2853
+// aWindowConstraints.gridy = 0;
2854
+// aWindowConstraints.gridwidth = 1;
2855
+// // aConstraints.gridheight = 3;
2856
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2857
+// aWindowConstraints.weightx = 0;
2858
+// aWindowConstraints.weighty = 1;
2859
+// //bigThree.add(jtp, aWindowConstraints);
2860
+// aWindowConstraints.weightx = 1;
2861
+// aWindowConstraints.gridwidth = 3;
2862
+// // aConstraints.gridheight = 3;
2863
+// aWindowConstraints.gridx = 1;
2864
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2865
+// bigThree.add(centralPanel, aWindowConstraints);
2866
+// aWindowConstraints.weightx = 0;
2867
+// aWindowConstraints.gridx = 4;
2868
+// aWindowConstraints.gridwidth = 1;
2869
+// // aConstraints.gridheight = 3;
2870
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2871
+// //bigThree.add(XYZPanel, aWindowConstraints);
2872
+// scenePanel.setVisible(false);
2873
+// centralPanel.setVisible(true);
2874
+// XYZPanel.setVisible(false);
2875
+ bigThree.ClearUI();
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
26652878 } else
2666
- if (event.getSource() == threeButton)
2879
+ if (source == threeButton)
26672880 {
26682881 radio.layout = threeButton;
2669
- bigThree.remove(jtp);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// //bigThree.add(jtp, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(false);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(centralPanel);
2912
+ bigThree.add(XYZPanel);
2913
+ bigThree.FlushUI();
26932914 } else
2694
- if (event.getSource() == fourButton)
2915
+ if (source == fourButton)
26952916 {
26962917 radio.layout = fourButton;
2697
- bigThree.remove(jtp);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(jtp, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
2918
+
2919
+// bigThree.remove(scenePanel);
2920
+// bigThree.remove(centralPanel);
2921
+// bigThree.remove(XYZPanel);
2922
+// aWindowConstraints.gridx = 0;
2923
+// aWindowConstraints.gridy = 0;
2924
+// aWindowConstraints.gridwidth = 1;
2925
+// // aWindowConstraints.gridheight = 3;
2926
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.weighty = 1;
2929
+// bigThree.add(scenePanel, aWindowConstraints);
2930
+// aWindowConstraints.weightx = 1;
2931
+// aWindowConstraints.gridwidth = 3;
2932
+// // aConstraints.gridheight = 3;
2933
+// aWindowConstraints.gridx = 1;
2934
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2935
+// //bigThree.add(cameraPanel, aWindowConstraints);
2936
+// aWindowConstraints.weightx = 0;
2937
+// aWindowConstraints.gridx = 4;
2938
+// aWindowConstraints.gridwidth = 1;
2939
+// // aWindowConstraints.gridheight = 3;
2940
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2941
+// //bigThree.add(XYZPanel, aWindowConstraints);
2942
+// bigThree.validate();
2943
+// scenePanel.setVisible(true);
2944
+// centralPanel.setVisible(false);
2945
+// XYZPanel.setVisible(false);
2946
+ bigThree.ClearUI();
2947
+ bigThree.add(scenePanel);
2948
+ bigThree.FlushUI();
27212949 } else
2722
- if (event.getSource() == sixButton)
2950
+ if (source == sixButton)
27232951 {
27242952 radio.layout = sixButton;
2725
- bigThree.remove(jtp);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(jtp, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
2953
+
2954
+// bigThree.remove(scenePanel);
2955
+// bigThree.remove(centralPanel);
2956
+// bigThree.remove(XYZPanel);
2957
+// aWindowConstraints.gridx = 0;
2958
+// aWindowConstraints.gridy = 0;
2959
+// aWindowConstraints.gridwidth = 1;
2960
+// // aConstraints.gridheight = 3;
2961
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2962
+// aWindowConstraints.weightx = 0;
2963
+// aWindowConstraints.weighty = 1;
2964
+// bigThree.add(scenePanel, aWindowConstraints);
2965
+// aWindowConstraints.weightx = 1;
2966
+// aWindowConstraints.gridwidth = 3;
2967
+// // aWindowConstraints.gridheight = 3;
2968
+// aWindowConstraints.gridx = 1;
2969
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2970
+// bigThree.add(centralPanel, aWindowConstraints);
2971
+// aWindowConstraints.weightx = 0;
2972
+// aWindowConstraints.gridx = 4;
2973
+// aWindowConstraints.gridwidth = 1;
2974
+// // aWindowConstraints.gridheight = 3;
2975
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2976
+// //bigThree.add(XYZPanel, aConstraints);
2977
+// bigThree.validate();
2978
+// scenePanel.setVisible(true);
2979
+// centralPanel.setVisible(true);
2980
+// XYZPanel.setVisible(false);
2981
+ bigThree.ClearUI();
2982
+ bigThree.add(scenePanel);
2983
+ bigThree.add(centralPanel);
2984
+ bigThree.FlushUI();
27492985 } else
2750
- if (event.getSource() == sevenButton)
2986
+ if (source == sevenButton)
27512987 {
27522988 radio.layout = sevenButton;
2753
- bigThree.remove(jtp);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(jtp, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
2989
+
2990
+// bigThree.remove(scenePanel);
2991
+// bigThree.remove(centralPanel);
2992
+// bigThree.remove(XYZPanel);
2993
+// aWindowConstraints.gridx = 0;
2994
+// aWindowConstraints.gridy = 0;
2995
+// aWindowConstraints.gridwidth = 1;
2996
+// // aWindowConstraints.gridheight = 3;
2997
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2998
+// aWindowConstraints.weightx = 0;
2999
+// aWindowConstraints.weighty = 1;
3000
+// bigThree.add(scenePanel, aWindowConstraints);
3001
+// aWindowConstraints.weightx = 1;
3002
+// aWindowConstraints.gridwidth = 3;
3003
+// // aWindowConstraints.gridheight = 3;
3004
+// aWindowConstraints.gridx = 1;
3005
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3006
+// bigThree.add(centralPanel, aWindowConstraints);
3007
+// aWindowConstraints.weightx = 0;
3008
+// aWindowConstraints.gridx = 4;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// bigThree.add(XYZPanel, aWindowConstraints);
3013
+// bigThree.validate();
3014
+// scenePanel.setVisible(true);
3015
+// centralPanel.setVisible(true);
3016
+// XYZPanel.setVisible(true);
3017
+ bigThree.ClearUI();
3018
+ bigThree.add(scenePanel);
3019
+ bigThree.add(centralPanel);
3020
+ bigThree.add(XYZPanel);
3021
+ bigThree.FlushUI();
27773022 } else
2778
- if (event.getSource() == rootButton)
3023
+ if (source == rootButton)
27793024 {
27803025 Object3D obj;
27813026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +3032,7 @@
27873032
27883033 refreshContents(true);
27893034 } else
2790
- if (event.getSource() == closeButton)
3035
+ if (source == closeButton)
27913036 {
27923037 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933038 cRadio ab;
....@@ -2808,11 +3053,11 @@
28083053 }
28093054 refreshContents(true);
28103055 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3056
+ if (source == editItem || source == editButton)
28123057 {
28133058 EditSelection(false);
28143059 } else
2815
- if (event.getSource() == uneditButton)
3060
+ if (source == uneditButton)
28163061 {
28173062 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183063 {
....@@ -2822,14 +3067,14 @@
28223067 child.CloseUI();
28233068 listUI.remove(child);
28243069
2825
- child.editWindow = null; // ???????????
3070
+ //child.editWindow = null; // ???????????
28263071 }
2827
- objEditor.ctrlPanel.revalidate();
3072
+ objEditor.ctrlPanel.FlushUI();
28283073 //objEditor.jTree.clearSelection();
28293074 //objEditor.ResetSliders();
28303075 refreshContents(true);
28313076 } else
2832
- if (event.getSource() == clearPanelButton)
3077
+ if (source == clearPanelButton)
28333078 {
28343079 assert(copy == group);
28353080 //copy.ClearUI();
....@@ -2840,7 +3085,7 @@
28403085 listUI.clear();
28413086 refreshContents(true);
28423087 } else
2843
- if (event.getSource() == allParamsButton)
3088
+ if (source == allParamsButton)
28443089 {
28453090 assert(copy == group);
28463091
....@@ -2861,19 +3106,19 @@
28613106
28623107 refreshContents(true);
28633108 } else
2864
- if (event.getSource() == unselectButton)
3109
+ if (source == unselectButton)
28653110 {
28663111 objEditor.jTree.clearSelection();
28673112 // ?? oct 2012 GrafreeD.clipboard.clear();
28683113 objEditor.ResetSliders();
28693114 refreshContents(true);
28703115 } else
2871
- if(event.getSource() instanceof cRadio)
3116
+ if(source instanceof cRadio)
28723117 {
28733118 group.parent = keepparent;
28743119 group.attributes = 0;
28753120 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3121
+ /*cRadio*/ radio = (cRadio)source;
28773122 Object3D obj = radio.GetObject();
28783123 System.out.println("Edit " + obj);
28793124 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3138,7 @@
28933138 }
28943139
28953140 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3141
+ //Globals.theRenderer.object = group;
28973142 if(!useclient)
28983143 {
28993144 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3147,16 @@
29023147 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033148 cameraView.targetLookAt.set(radio.camera.lookAt);
29043149 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3150
+ //cameraView.lighttouched = true;
3151
+ Globals.lighttouched = true;
29063152 topView.object = group;
29073153 frontView.object = group;
29083154 sideView.object = group;
29093155 }
3156
+
3157
+// fix "+" issue
29103158 group.editWindow = this;
3159
+
29113160 /*
29123161 currentLayout = radio.layout;
29133162 if (currentLayout == null)
....@@ -2920,7 +3169,20 @@
29203169 //group.attributes = -1;
29213170 ResetModel();
29223171 refreshContents(true);
2923
- }
3172
+ } else if (event.getSource() == editCameraItem)
3173
+ {
3174
+ cameraView.ProtectCamera();
3175
+ cameraView.repaint();
3176
+ return;
3177
+ } else if (event.getSource() == revertCameraItem)
3178
+ {
3179
+ cameraView.RevertCamera();
3180
+ cameraView.repaint();
3181
+ return;
3182
+ // } else if (event.getSource() == textureButton)
3183
+ // {
3184
+ // return; // true;
3185
+ }
29243186 else
29253187 {
29263188 //return super.action(event, arg);
....@@ -2938,7 +3200,7 @@
29383200 if (useclient)
29393201 {
29403202 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3203
+ Globals.lighttouched = true;
29423204 //topView.object = client;
29433205 //frontView.object = client;
29443206 //sideView.object = client;
....@@ -2946,7 +3208,7 @@
29463208 else
29473209 {
29483210 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3211
+ Globals.lighttouched = true;
29503212 //topView.object = group;
29513213 //frontView.object = group;
29523214 //sideView.object = group;
....@@ -2981,6 +3243,28 @@
29813243 refreshContents();
29823244 }
29833245
3246
+ void TransformChildren()
3247
+ {
3248
+ Object3D obj;
3249
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3250
+ {
3251
+ obj = (Object3D)e.nextElement();
3252
+ obj.KeepTextureMatrices();
3253
+ obj.TransformChildren();
3254
+ obj.RestoreTextureMatrices();
3255
+
3256
+// if (obj.parent == null)
3257
+// {
3258
+// System.out.println("NULL PARENT!");
3259
+// new Exception().printStackTrace();
3260
+// }
3261
+// else
3262
+// TouchTransform(obj);
3263
+// //obj.parent.Touch();
3264
+ }
3265
+
3266
+ refreshContents();
3267
+ }
29843268
29853269 void ResetTransform()
29863270 {
....@@ -3093,7 +3377,7 @@
30933377 refreshContents();
30943378 }
30953379
3096
- void ResetCentroid()
3380
+ void ResetCentroid(boolean full)
30973381 {
30983382 Object3D obj;
30993383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3392,16 @@
31083392 LA.matIdentity(Object3D.mat);
31093393 obj.getBounds(minima, maxima, false);
31103394 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3395
+ if (full)
3396
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123397 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133398 obj.TransformMesh(Object3D.mat);
3399
+
31143400 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3401
+ if (full)
3402
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163403 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3404
+
31173405 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183406 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193407 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +3430,8 @@
31423430
31433431 int size = obj.MemorySize();
31443432
3145
- System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3434
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31463435 }
31473436 }
31483437 catch (Exception e)
....@@ -3179,9 +3468,9 @@
31793468 obj = (Object3D)e.nextElement();
31803469
31813470 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3471
+ Grafreed.AnalyzeObject(obj);
31833472 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3473
+ Grafreed.AnalyzeObject(obj.bRep);
31853474
31863475 // System.err.println((size/1024) + " KB is the size of " + obj);
31873476 }
....@@ -3223,6 +3512,13 @@
32233512 void GenNormals(boolean crease)
32243513 {
32253514 group.GenNormalsS(crease);
3515
+
3516
+ refreshContents();
3517
+ }
3518
+
3519
+ void GenNormalsMESH()
3520
+ {
3521
+ group.GenNormalsMeshS();
32263522
32273523 refreshContents();
32283524 }
....@@ -3395,8 +3691,8 @@
33953691
33963692 void ParseVertices()
33973693 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3694
+ boolean epsequal = Grafreed.epsequal;
3695
+ Grafreed.epsequal = true;
34003696
34013697 for (int i=0; i<group.selection.size(); i++)
34023698 {
....@@ -3421,7 +3717,7 @@
34213717 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223718 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233719
3424
- g.add(GrafreeD.clipboard);
3720
+ g.add(Grafreed.clipboard);
34253721
34263722 buffer.add(g);
34273723 }
....@@ -3436,7 +3732,7 @@
34363732 makeSomething(buffer, i==group.selection.size()-1);
34373733 }
34383734
3439
- GrafreeD.epsequal = epsequal;
3735
+ Grafreed.epsequal = epsequal;
34403736
34413737 refreshContents();
34423738 }
....@@ -3454,7 +3750,16 @@
34543750 String pigment = Object3D.GetPigment(tex);
34553751 //String bump = Object3D.GetBump(tex);
34563752
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3753
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3754
+
3755
+ try
3756
+ {
3757
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3758
+ }
3759
+ catch (Exception e)
3760
+ {
3761
+ System.err.println("FAIL: " + node);
3762
+ }
34583763
34593764 double s = v.s;
34603765
....@@ -3542,11 +3847,11 @@
35423847
35433848 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443849
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3850
+ boolean random = CameraPane.SWITCH;
3851
+ CameraPane.SWITCH = false; // parse all random nodes
35473852 lowres.linkVerticesThis(null);
35483853 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3854
+ CameraPane.SWITCH = random;
35503855
35513856 System.err.flush();
35523857
....@@ -3586,7 +3891,7 @@
35863891 return;
35873892
35883893 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
3894
+ Object3D ref = Grafreed.clipboard.get(0);
35903895
35913896 Object3D newgroup = new Object3D("Po:" + poses.name);
35923897
....@@ -3755,7 +4060,7 @@
37554060 group.selection.RelinkToSupport(); // july 2014
37564061 System.out.println("DONE.");
37574062 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4063
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37594064 }
37604065
37614066 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4085,9 @@
37804085
37814086 void ClipMesh()
37824087 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4088
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844089 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4090
+ Object3D content = Grafreed.clipboard.get(0);
37864091
37874092 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884093 content = ((cGroup)content).get(0);
....@@ -3791,7 +4096,7 @@
37914096 // {
37924097 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934098 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4099
+ group.selection.ClipMesh(Grafreed.clipboard);
37954100 }
37964101 // group.selection.ClipMesh(GrafreeD.clipboard);
37974102 System.out.println("DONE.");
....@@ -3926,7 +4231,7 @@
39264231 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274232
39284233 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4234
+ if(elem != group || !newWindow)
39304235 {
39314236 // if (!(elem instanceof Composite))
39324237 // newWindow = false;
....@@ -4016,7 +4321,6 @@
40164321 //case 702: // Event.LIST_DESELECT
40174322 group.deselectAll();
40184323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4019
- objEditor.ClearInfo(); // .GetMaterial());
40204324 if (tps != null)
40214325 {
40224326 for (int i=0; i < tps.length; i++)
....@@ -4025,31 +4329,30 @@
40254329
40264330 //if (child.parent != null)
40274331 //child.parent.addSelectee(child);
4332
+ objEditor.SetMaterial(child);
40284333 group.addSelectee(child);
4029
- objEditor.SetMaterial(child); // .GetMaterial());
4030
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4031
- System.err.println("info : " + child.GetPath());
40324334 }
40334335 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4336
+// else
4337
+// {
4338
+// objEditor.SetMaterial(group); // .GetMaterial());
4339
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4340
+// System.err.println("info : " + group.GetPath());
4341
+// }
40404342
4041
- objEditor.SetText(); // jan 2014
4042
-
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4343
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40444344 CameraPane.flash = true;
40454345
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4346
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474347 // a camera
40484348 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4349
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4350
+ {
4351
+ CameraPane.camerachangeframe = 0; // don't refuse it
4352
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4353
+ }
4354
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4355
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534356 }
40544357
40554358 refreshContents();
....@@ -4060,6 +4363,26 @@
40604363
40614364 freezemodel = false;
40624365 }
4366
+
4367
+ void refreshContents(boolean cp)
4368
+ {
4369
+ if (!Globals.MOUSEDRAGGED)
4370
+ {
4371
+ objEditor.ClearInfo(); // .GetMaterial());
4372
+
4373
+ for (int i=0; i < group.selection.Size(); i++)
4374
+ {
4375
+ Object3D child = (Object3D) group.selection.get(i);
4376
+
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+ }
4380
+
4381
+ objEditor.SetText(); // jan 2014
4382
+ }
4383
+
4384
+ super.refreshContents(cp);
4385
+ }
40634386
40644387 void linkSomething(Object3D thing)
40654388 {
....@@ -4131,16 +4454,18 @@
41314454 {
41324455 if (group.selection.isEmpty())
41334456 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4457
+
4458
+ Grafreed.clipboardIsTempGroup = false;
41354459 Composite tGroup = null;
41364460 if (group.selection.size() > 0) // 1)
41374461 {
41384462 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4463
+ Grafreed.clipboardIsTempGroup = true;
41404464 }
41414465
41424466 if (cut)
41434467 {
4468
+ Save();
41444469 //int indices[] = jList.getSelectedIndices();
41454470 //for (int i = indices.length - 1; i >= 0; i--)
41464471 //jList.remove(indices[i]);
....@@ -4176,16 +4501,16 @@
41764501 //System.out.println("cut " + child);
41774502 //System.out.println("parent = " + child.parent);
41784503 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4504
+ if (Grafreed.clipboardIsTempGroup)
41804505 tGroup.add/*Child*/(tmp);
41814506 else
4182
- GrafreeD.clipboard = tmp;
4507
+ Grafreed.clipboard = tmp;
41834508 }
41844509 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4510
+ if (Grafreed.clipboardIsTempGroup)
41864511 tGroup.add/*Child*/(child);
41874512 else
4188
- GrafreeD.clipboard = child;
4513
+ Grafreed.clipboard = child;
41894514 }
41904515
41914516 //ResetModel();
....@@ -4217,21 +4542,23 @@
42174542 //System.out.println("cut " + elem);
42184543 //System.out.println("parent = " + elem.parent);
42194544 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4545
+ if (Grafreed.clipboardIsTempGroup)
42214546 tGroup.add/*Child*/(tmp);
42224547 else
4223
- GrafreeD.clipboard = tmp;
4548
+ Grafreed.clipboard = tmp;
42244549 }
42254550 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4551
+ if (Grafreed.clipboardIsTempGroup)
42274552 tGroup.add/*Child*/(child);
42284553 else
4229
- GrafreeD.clipboard = child;
4554
+ Grafreed.clipboard = child;
42304555 }
42314556
42324557 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4558
+
4559
+ if (Grafreed.clipboardIsTempGroup)
4560
+ Grafreed.clipboard = tGroup;
4561
+
42354562 if (cut)
42364563 {
42374564 ResetModel();
....@@ -4245,7 +4572,7 @@
42454572 // return;
42464573 boolean first = true;
42474574
4248
- if (GrafreeD.clipboardIsTempGroup)
4575
+ if (Grafreed.clipboardIsTempGroup)
42494576 {
42504577 Composite temp;
42514578
....@@ -4256,7 +4583,7 @@
42564583 temp = (Composite)Applet3D.clipboard.deepCopy();
42574584 */
42584585 Object3D elem;
4259
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4586
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42604587 {
42614588 Object3D child = (Object3D)e.nextElement();
42624589
....@@ -4290,21 +4617,21 @@
42904617 //Object3D cb = Applet3D.clipboard;
42914618 //temp.addChild(cb);
42924619 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4620
+ assert(Grafreed.clipboard.parent == null);
4621
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4622
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4623
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4624
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42984625 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4626
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4627
+ Grafreed.clipboard.get(0).parent = keepparent;
43014628 }
43024629
43034630 ResetModel();
43044631 refreshContents();
43054632 }
43064633
4307
- void pasteInto(boolean copyit)
4634
+ void pasteInto(boolean copyit, boolean clone)
43084635 {
43094636 // if (GrafreeD.clipboard == null)
43104637 // return;
....@@ -4333,15 +4660,22 @@
43334660 if (copyit)
43344661 {
43354662 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4663
+ if (clone)
4664
+ {
4665
+ CloneClipboard(false); // sept 2014
4666
+ }
4667
+ else
4668
+ {
4669
+ paste(false);
4670
+ }
43374671 }
43384672 else
43394673 {
43404674 boolean first = true;
43414675
4342
- if (GrafreeD.clipboardIsTempGroup)
4676
+ if (Grafreed.clipboardIsTempGroup)
43434677 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4678
+ Composite temp = (Composite)Grafreed.clipboard;
43454679 Object3D copy;
43464680 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474681 {
....@@ -4351,7 +4685,7 @@
43514685 }
43524686 } else
43534687 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4688
+ linkSomething(Grafreed.clipboard); //.get(0));
43554689 }
43564690 }
43574691 }
....@@ -4756,21 +5090,6 @@
47565090 }
47575091 */
47585092
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745093 /*
47755094 public void Callback(Object obj)
47765095 {
....@@ -4794,26 +5113,9 @@
47945113 }
47955114 */
47965115
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145116 String GetFile(String dialogName)
48155117 {
4816
- if (GrafreeD.standAlone)
5118
+ if (Grafreed.standAlone)
48175119 {
48185120 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195121 browser.show();
....@@ -4877,10 +5179,15 @@
48775179 cButton flashSelectionButton;
48785180 cButton editButton;
48795181 cButton uneditButton;
5182
+ JCheckBox allParamsButton;
48805183 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825184 cButton unselectButton;
48835185
5186
+ cButton saveButton;
5187
+ cButton undoButton;
5188
+ cButton redoButton;
5189
+ cButton oneStepButton;
5190
+
48845191 cButton screenfitButton;
48855192 cButton screenfitpointButton;
48865193 cButton snapobjectButton;
....@@ -4911,6 +5218,8 @@
49115218 private MenuItem lookFromItem;
49125219 private MenuItem switchItem;
49135220 private MenuItem cutItem;
5221
+ private MenuItem undoItem;
5222
+ private MenuItem redoItem;
49145223 private MenuItem duplicateItem;
49155224 private MenuItem cloneItem;
49165225 private MenuItem cloneSupportItem;
....@@ -4924,7 +5233,7 @@
49245233 private MenuItem linkverticesItem;
49255234 private MenuItem relinkverticesItem;
49265235 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5236
+ private MenuItem resetAllItem;
49285237 private MenuItem stepAllItem;
49295238 private MenuItem revertMeshItem;
49305239 private MenuItem poseMeshItem;
....@@ -4935,6 +5244,7 @@
49355244 private MenuItem mergeGeometriesItem;
49365245 private MenuItem copyItem;
49375246 private MenuItem pasteItem;
5247
+ private MenuItem pasteIntoItem;
49385248 private MenuItem pasteLinkItem;
49395249 private MenuItem pasteCloneItem;
49405250 private MenuItem pasteExpandItem;
....@@ -4984,8 +5294,10 @@
49845294 private MenuItem panoTexturesItem;
49855295
49865296 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5297
+ private MenuItem resetCentroidXZItem;
49885298 private MenuItem resetTransformItem;
5299
+ private MenuItem transformGeometryItem;
5300
+ private MenuItem transformChildrenItem;
49895301 private MenuItem hideItem;
49905302 private MenuItem grabItem;
49915303 private MenuItem backItem;
....@@ -5007,6 +5319,7 @@
50075319
50085320 private MenuItem resetParentItem;
50095321 private MenuItem repairParentItem;
5322
+ private MenuItem repairShadowItem;
50105323 private MenuItem sortbysizeItem;
50115324 private MenuItem sortbynameItem;
50125325
....@@ -5031,7 +5344,7 @@
50315344 private MenuItem blobItem;
50325345 private MenuItem latheItem;
50335346 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5347
+ private MenuItem overlayItem;
50355348 private MenuItem meshItem;
50365349 // private MenuItem meshGroupItem;
50375350 private MenuItem springItem;
....@@ -5053,11 +5366,6 @@
50535366 private MenuItem doubleItem;
50545367 private MenuItem tripleItem;
50555368
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615369 private MenuItem computeAOItem;
50625370 private MenuItem recompileItem;
50635371 private MenuItem editScriptItem;
....@@ -5067,4 +5375,8 @@
50675375 private MenuItem analyzeItem;
50685376 private MenuItem dumpItem;
50695377 //boolean freezemodel = false;
5378
+
5379
+ Menu cameraMenu;
5380
+ MenuItem editCameraItem;
5381
+ MenuItem revertCameraItem;
50705382 }