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,17 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
222325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223326 setMasterItem.addActionListener(this);
327
+ }
224328
225329 oe.menuBar.add(menu = new Menu("Group"));
226330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +335,38 @@
231335 frontItem.addActionListener(this);
232336 compositeItem = menu.add(new MenuItem("Composite"));
233337 compositeItem.addActionListener(this);
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
339
+ hideItem.addActionListener(this);
340
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
341
+ ungroupItem.addActionListener(this);
234342 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
236344 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242346 switchGeoItem.addActionListener(this);
243347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244348 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
246350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
247359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248360 scriptNodeItem.addActionListener(this);
249361 cameraItem = menu.add(new MenuItem("Camera"));
250362 cameraItem.addActionListener(this);
363
+ }
251364
252365 oe.menuBar.add(menu = new Menu("Object"));
253366 textureItem = menu.add(new MenuItem("Texture"));
254367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
255370 csgItem = menu.add(new MenuItem("CSG"));
256371 csgItem.addActionListener(this);
257372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +375,29 @@
260375 shadowYItem.addActionListener(this);
261376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
263381 linkerItem = menu.add(new MenuItem("Linker"));
264382 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267383 attributeItem = menu.add(new MenuItem("Attribute"));
268384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
269387 pointflowItem = menu.add(new MenuItem("Point Flow"));
270388 pointflowItem.addActionListener(this);
389
+ }
271390 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275392 resetTransformItem.addActionListener(this);
276393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277394 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
280401
281402 oe.menuBar.add(menu = new Menu("Geometry"));
282403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +406,13 @@
285406 genNormalsORGANItem.addActionListener(this);
286407 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287408 genNormalsCADItem.addActionListener(this);
409
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
410
+ genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
288416 stripifyItem = menu.add(new MenuItem("Stripify"));
289417 stripifyItem.addActionListener(this);
290418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +434,34 @@
306434 reduce34MeshItem.addActionListener(this);
307435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308436 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
313445
314446 oe.menuBar.add(menu = new Menu("Attributes"));
315447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
317453 menu.add("-");
318454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319455 liveleavesItem.addActionListener(this);
320456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
322460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323461 supportleavesItem.addActionListener(this);
324462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325463 unsupportleavesItem.addActionListener(this);
464
+ }
326465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327466 hideleavesItem.addActionListener(this);
328467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -366,29 +505,22 @@
366505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367506 sortbynameItem.addActionListener(this);
368507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
369515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370516 extractGeometriesItem.addActionListener(this);
371517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372518 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
519
+ }
377520
378521 oe.menuBar.add(menu = new Menu("Insert"));
379522 buildCreateMenu(menu);
380523
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392524 oe.menuBar.add(menu = new Menu("Tools"));
393525 buildToolsMenu(menu);
394526 }
....@@ -423,150 +555,110 @@
423555 oe.radioPanel.add(dummyButton);
424556 oe.buttonGroup.add(dummyButton);
425557 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429559
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
431574 liveCB.addItemListener(this);
432575
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
451582 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
493586 trackCB.addItemListener(this);
494587
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
497590 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
591
+
499592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500593 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505594
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ flashSelectionButton.setToolTipText("Show selection");
512604 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516605
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607
+
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ twoButton.setToolTipText("Show center view only");
519610 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521612 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
613
+ fourButton.setToolTipText("Show left panel only");
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ sixButton.setToolTipText("2-column layout left");
523616 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618
+ threeButton.setToolTipText("2-column layout right");
525619 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ sevenButton.setToolTipText("3-column layout");
527622 sevenButton.addActionListener(this);
528623 //
529624
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
531627 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ closeButton.setToolTipText("Close tab");
534631 closeButton.addActionListener(this);
535632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536633 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538634
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
541639 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545640
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
547643 uneditButton.addActionListener(this);
548644
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
561647 allParamsButton.addActionListener(this);
562648
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
568655 unselectButton.addActionListener(this);
569656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
570662 // oe.aConstraints.gridx += 1;
571663 // oe.aConstraints.weighty = 0;
572664 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +670,37 @@
578670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579671 // gcButton.addActionListener(this);
580672
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
592676 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594678 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
599682
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
604687 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
607691 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
610695 textureCB.addItemListener(this);
611696
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
614700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
615704 //jList.addListSelectionListener(this);
616705 oe.jTree.addTreeSelectionListener(this);
617706 //jTree.setRootVisible(false);
....@@ -633,18 +722,91 @@
633722 radio.layout = sevenButton;
634723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635724 }
725
+
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727
+ {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
757
+// constraints.gridy += 1;
758
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759
+// speakerMocapCB.addItemListener(this);
760
+
761
+ if (false)
762
+ {
763
+ // handled in scripts
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
766
+ speakerCameraCB.addItemListener(this);
767
+
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
770
+ speakerFocusCB.addItemListener(this);
771
+
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774
+ smoothfocusCB.addItemListener(this);
775
+ }
776
+
777
+//constraints.gridx += 1;
778
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779
+// debugCB.addItemListener(this);
780
+
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
782
+ oeilCB.addItemListener(this);
783
+
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785
+ lookAtCB.setToolTipText("Look-at target");
786
+ lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
795
+
796
+ }
636797
637798 void EditObject(Object3D obj)
638799 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
800
+ cRadio radioButton = new cRadio(obj.name);
801
+ radioButton.SetObject(obj);
802
+ radioButton.layout = sevenButton;
803
+ radioButton.SetCamera(cameraView.renderCamera, false);
804
+ radioButton.addActionListener(this);
805
+ radioPanel.add(radioButton);
806
+ buttonGroup.add(radioButton);
807
+ radioButton.doClick();
647808 }
809
+
648810 void SetupViews(ObjEditor oe)
649811 {
650812 oe.SetupViews();
....@@ -663,6 +825,7 @@
663825 JCheckBox fastCB;
664826 JCheckBox slowCB;
665827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
666829 JCheckBox trackCB;
667830 JCheckBox smoothfocusCB;
668831 // JCheckBox speakerMocapCB;
....@@ -705,10 +868,10 @@
705868 dropAttributes |= Object3D.TEXTURE;
706869 else
707870 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
710872 {
711873 cameraView.ToggleLive();
874
+ refreshContents(false);
712875 }
713876 else if(e.getSource() == supportCB)
714877 {
....@@ -743,6 +906,10 @@
743906 Recompile();
744907 cameraView.repaint();
745908 // refreshContents();
909
+ }
910
+ else if(e.getSource() == zoomBoxCB)
911
+ {
912
+ cameraView.ToggleZoomBoxMode();
746913 }
747914 else if(e.getSource() == smoothfocusCB)
748915 {
....@@ -857,7 +1024,9 @@
8571024 // objEditor.DropFile((java.io.File[]) object, true);
8581025 // return;
8591026 // }
860
- if (string.charAt(0) == '/')
1027
+
1028
+ // File path for Mac and Windows
1029
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611030 {
8621031 // file(s)
8631032 String[] names = string.split("\n");
....@@ -884,7 +1053,7 @@
8841053
8851054 flashIt = false;
8861055 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1056
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881057 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891058
8901059 if (group.selection.size() == 1)
....@@ -911,11 +1080,11 @@
9111080 {
9121081 loadClipboard(true);
9131082 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1083
+ pasteInto(false, false);
9151084 } else {
9161085 loadClipboard(false);
9171086 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1087
+ pasteInto(false, false); // true); // ???
9191088 }
9201089 }
9211090 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1202,37 @@
10331202 torusItem.addActionListener(this);
10341203 superItem = menu.add(new MenuItem("Superellipsoid"));
10351204 superItem.addActionListener(this);
1205
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1206
+ kleinItem.addActionListener(this);
10361207 particleItem = menu.add(new MenuItem("Particle system"));
10371208 particleItem.addActionListener(this);
1209
+ if (Globals.ADVANCED)
1210
+ {
10381211 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391212 ragdollItem.addActionListener(this);
10401213 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411214 ragdoll2Item.addActionListener(this);
1215
+ }
10421216 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1217
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441218 meshItem.addActionListener(this);
10451219 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461220 // meshGroupItem.addActionListener(this);
1221
+ if (Globals.ADVANCED)
1222
+ {
10471223 springItem = menu.add(new MenuItem("Spring"));
10481224 springItem.addActionListener(this);
10491225 flagItem = menu.add(new MenuItem("Flag"));
10501226 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551227 blobItem = menu.add(new MenuItem("Blob"));
10561228 blobItem.addActionListener(this);
10571229 latheItem = menu.add(new MenuItem("Lathe"));
10581230 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);
10591236 lightItem = menu.add(new MenuItem("Light"));
10601237 lightItem.addActionListener(this);
10611238 menu.add("-");
....@@ -1065,39 +1242,44 @@
10651242 loopItem.addActionListener(this);
10661243 doubleItem = menu.add(new MenuItem("Fork"));
10671244 doubleItem.addActionListener(this);
1245
+ if (Globals.ADVANCED)
1246
+ {
10681247 tripleItem = menu.add(new MenuItem("Trident"));
10691248 tripleItem.addActionListener(this);
1249
+ }
10701250 }
10711251
10721252 void buildToolsMenu(Menu menu)
10731253 {
10741254 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751255 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1256
+ animationItem.setState(Globals.ANIMATION);
10771257
10781258 menu.add("-");
10791259 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801260 parseverticesItem.addActionListener(this);
10811261 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821262 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1263
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841264 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871265 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881266 reduceMorphItem.addActionListener(this);
10891267 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901268 reduce34MorphItem.addActionListener(this);
1091
-
1269
+ menu.add("-");
10921270 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931271 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951272
1273
+ if (Globals.ADVANCED)
1274
+ {
1275
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1276
+ mirrorItem.addActionListener(this);
1277
+ menu.add("-");
10961278 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971279 memoryItem.addActionListener(this);
10981280 menu.add(analyzeItem = new MenuItem("Analyze"));
10991281 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
11011283 dumpItem.addActionListener(this);
11021284 // menu.add(pathItem = new MenuItem("From-to path"));
11031285 // pathItem.addActionListener(this);
....@@ -1106,6 +1288,8 @@
11061288 resetParentItem.addActionListener(this);
11071289 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081290 repairParentItem.addActionListener(this);
1291
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1292
+ repairShadowItem.addActionListener(this);
11091293 menu.add(invariantsItem = new MenuItem("Invariants"));
11101294 invariantsItem.addActionListener(this);
11111295 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1297,7 @@
11131297 menu.add("-");
11141298 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151299 editScriptItem.addActionListener(this);
1300
+ }
11161301 }
11171302
11181303 void ScreenFit()
....@@ -1441,9 +1626,9 @@
14411626
14421627 void Overwrite(int mask)
14431628 {
1444
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1629
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451630 {
1446
- Object3D content = GrafreeD.clipboard.get(0);
1631
+ Object3D content = Grafreed.clipboard.get(0);
14471632
14481633 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491634 content = ((cGroup)content).get(0);
....@@ -1466,6 +1651,7 @@
14661651 //
14671652 public void actionPerformed(ActionEvent event) // , Object arg)
14681653 {
1654
+ Object source = event.getSource();
14691655 /*
14701656 if (event.getSource() == nameField)
14711657 {
....@@ -1477,11 +1663,11 @@
14771663 }
14781664 else
14791665 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1666
+ if (source == lookAtItem || source == lookFromItem)
14811667 {
14821668 ScreenFit();
14831669 } else
1484
- if (event.getSource() == switchItem)
1670
+ if (source == switchItem)
14851671 {
14861672 cVector v1 = new cVector();
14871673 cVector v2 = new cVector();
....@@ -1490,11 +1676,11 @@
14901676 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911677 objEditor.cameraView.repaint();
14921678 } else
1493
- if (event.getSource() == rectoidItem)
1679
+ if (source == rectoidItem)
14941680 {
14951681 makeSomething(new Box());
14961682 } else
1497
- if (event.getSource() == particleItem)
1683
+ if (source == particleItem)
14981684 {
14991685 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001686 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1701,9 @@
15151701 applyExample(particleGeom, "SMOKE");
15161702 makeSomething(particleGeom);
15171703 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1704
+ if (source == ragdollItem || source == ragdoll2Item)
15191705 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1706
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211707
15221708 ragdoll.toParent = LA.newMatrix();
15231709 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1721,7 @@
15351721 } else
15361722 /*
15371723 */
1538
- if (event.getSource() == heightFieldItem)
1724
+ if (source == heightFieldItem)
15391725 {
15401726 Object3D obj = new Object3D();
15411727
....@@ -1573,27 +1759,31 @@
15731759
15741760 makeSomething(obj);
15751761 } else
1576
- if (event.getSource() == gridItem)
1762
+ if (source == gridItem)
15771763 {
15781764 makeSomething(new Grid());
15791765 } else
1580
- if (event.getSource() == ellipsoidItem)
1766
+ if (source == ellipsoidItem)
15811767 {
15821768 makeSomething(new Sphere());
15831769 } else
1584
- if (event.getSource() == coneItem)
1770
+ if (source == coneItem)
15851771 {
15861772 makeSomething(new Cone());
15871773 } else
1588
- if (event.getSource() == torusItem)
1774
+ if (source == torusItem)
15891775 {
15901776 makeSomething(new Torus());
15911777 } else
1592
- if (event.getSource() == superItem)
1778
+ if (source == superItem)
15931779 {
15941780 makeSomething(new Superellipsoid());
15951781 } else
1596
- if (event.getSource() == blobItem)
1782
+ if (source == kleinItem)
1783
+ {
1784
+ makeSomething(new Klein());
1785
+ } else
1786
+ if (source == blobItem)
15971787 {
15981788 Blob blob = new Blob();
15991789 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1791,15 @@
16011791 //blob.retile();
16021792 makeSomething(blob);
16031793 } else
1604
- if (event.getSource() == latheItem)
1794
+ if (source == latheItem)
16051795 {
16061796 makeSomething(new Lathe());
16071797 } else
1608
- if (event.getSource() == bezierItem)
1798
+ if (source == bezierItem)
16091799 {
16101800 makeSomething(new BezierSurface());
16111801 } else
1612
- if (event.getSource() == checkerItem)
1802
+ if (source == overlayItem)
16131803 {
16141804 /*
16151805 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1814,7 @@
16241814 */
16251815 makeSomething(new Checker());
16261816 } else
1627
- if (event.getSource() == meshItem)
1817
+ if (source == meshItem)
16281818 {
16291819 Object3D itemtomake = new Object3D();
16301820 Object3D child;
....@@ -1645,35 +1835,35 @@
16451835 makeSomething(child);
16461836 }
16471837 } else
1648
- if (event.getSource() == springItem)
1838
+ if (source == springItem)
16491839 {
16501840 cSpring s = new cSpring();
16511841 s.setup();
16521842 makeSomething(s);
16531843 } else
1654
- if (event.getSource() == flagItem)
1844
+ if (source == flagItem)
16551845 {
16561846 cSpring s = new cFlag();
16571847 s.setup();
16581848 makeSomething(s);
16591849 } else
1660
- if (event.getSource() == lightItem)
1850
+ if (source == lightItem)
16611851 {
16621852 makeSomething(new Light());
16631853 } else
1664
- if (event.getSource() == csgItem)
1854
+ if (source == csgItem)
16651855 {
16661856 group(new CSG());
16671857 } else
1668
- if (event.getSource() == templateItem)
1858
+ if (source == templateItem)
16691859 {
16701860 group(new cTemplate());
16711861 } else
1672
- if (event.getSource() == attributeItem)
1862
+ if (source == attributeItem)
16731863 {
16741864 makeSomething(new Attribute());
16751865 } else
1676
- if (event.getSource() == pointflowItem)
1866
+ if (source == pointflowItem)
16771867 {
16781868 makeSomething(new PointFlow());
16791869 } else
....@@ -1685,7 +1875,7 @@
16851875 } else
16861876 */
16871877
1688
- if (event.getSource() == superLoopItem)
1878
+ if (source == superLoopItem)
16891879 {
16901880 Composite g = new cGroup();
16911881 for (int i=0; i<15; i++)
....@@ -1707,7 +1897,7 @@
17071897
17081898 group(g);
17091899 } else
1710
- if (event.getSource() == loopItem)
1900
+ if (source == loopItem)
17111901 {
17121902 Composite csg = new GroupLeaf();
17131903 csg.count = 5;
....@@ -1716,7 +1906,7 @@
17161906 csg.addChild(child);
17171907 child.addChild(csg);
17181908 } else
1719
- if (event.getSource() == doubleItem)
1909
+ if (source == doubleItem)
17201910 {
17211911 Composite csg = new GroupLeaf();
17221912 csg.count = 5;
....@@ -1728,7 +1918,7 @@
17281918 csg.addChild(child);
17291919 child.addChild(csg);
17301920 } else
1731
- if (event.getSource() == tripleItem)
1921
+ if (source == tripleItem)
17321922 {
17331923 Composite csg = new GroupLeaf();
17341924 csg.count = 4;
....@@ -1743,71 +1933,71 @@
17431933 csg.addChild(child);
17441934 child.addChild(csg);
17451935 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1936
+ if (source == computeAOItem)
17481937 {
1749
- ImportGFD();
1938
+ Globals.drawMode = CameraPane.OCCLUSION;
1939
+ Globals.theRenderer.repaint();
17501940 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
1941
+ if (source == recompileItem)
17691942 {
17701943 Recompile();
17711944 refreshContents();
17721945 } else
1773
- if (event.getSource() == editScriptItem)
1946
+ if (source == editScriptItem)
17741947 {
17751948 OpenDialog();
17761949 refreshContents();
17771950 } else
1778
- if (event.getSource() == invariantsItem)
1951
+ if (source == invariantsItem)
17791952 {
17801953 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1954
+ Grafreed.grafreeD.universe.invariants();
17821955 } else
1783
- if (event.getSource() == memoryItem)
1956
+ if (source == memoryItem)
17841957 {
17851958 //System.out.println("Invariants:");
17861959 PrintMemory();
17871960 } else
1788
- if (event.getSource() == pathItem)
1961
+ if (source == pathItem)
17891962 {
17901963 PrintPath();
17911964 } else
1792
- if (event.getSource() == analyzeItem)
1965
+ if (source == analyzeItem)
17931966 {
17941967 AnalyzeObject();
17951968 } else
1796
- if (event.getSource() == dumpItem)
1969
+ if (source == dumpItem)
17971970 {
17981971 DumpObject();
17991972 } else
1800
- 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)
18011991 {
18021992 //Reload(lastConverter, lastFilename, true);
18031993 ScreenFit();
18041994 } else
1805
- if (event.getSource() == screenfitpointButton)
1995
+ if (source == screenfitpointButton)
18061996 {
18071997 //Reload(lastConverter, lastFilename, true);
18081998 ScreenFitPoint();
18091999 } else
1810
- if (event.getSource() == snapobjectButton)
2000
+ if (source == snapobjectButton)
18112001 {
18122002 //Reload(lastConverter, lastFilename, true);
18132003 SnapObject();
....@@ -1818,13 +2008,13 @@
18182008 // Recompile();
18192009 // refreshContents();
18202010 // } else
1821
- if (event.getSource() == gcButton)
2011
+ if (source == gcButton)
18222012 {
18232013 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242014 System.gc();
18252015 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262016 } else
1827
- if (event.getSource() == editLeafItem)
2017
+ if (source == editLeafItem)
18282018 {
18292019 Object3D obj;
18302020 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +2028,74 @@
18382028 }
18392029 refreshContents(true);
18402030 } else
1841
- if (event.getSource() == openWindowItem)
2031
+ if (source == openWindowItem)
18422032 {
18432033 EditSelection(true);
18442034 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2035
+ if (source == cutItem || source == clearButton)
18462036 {
18472037 loadClipboard(true);
18482038 } else
1849
- if (event.getSource() == duplicateItem)
2039
+ if (source == undoItem)
18502040 {
1851
- 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;
18522050 loadClipboard(false);
18532051 paste(false);
1854
- GrafreeD.clipboard = keep;
2052
+ Grafreed.clipboard = keep;
18552053 } else
1856
- if (event.getSource() == cloneItem)
2054
+ if (source == cloneItem)
18572055 {
18582056 CloneSelection(false);
18592057 } else
1860
- if (event.getSource() == cloneSupportItem)
2058
+ if (source == cloneSupportItem)
18612059 {
18622060 CloneSelection(true);
18632061 } else
1864
- if (event.getSource() == copyItem)
2062
+ if (source == copyItem)
18652063 {
18662064 loadClipboard(false);
18672065 } else
1868
- if (event.getSource() == pasteItem)
2066
+ if (source == pasteItem)
18692067 {
18702068 paste(false);
18712069 } else
1872
- if (event.getSource() == pasteLinkItem)
2070
+ if (source == pasteIntoItem)
18732071 {
1874
- pasteInto(false);
2072
+ pasteInto(true, false);
18752073 } else
1876
- if (event.getSource() == pasteCloneItem)
2074
+ if (source == pasteLinkItem)
18772075 {
1878
- pasteInto(true);
2076
+ pasteInto(false, false);
18792077 } else
1880
- if (event.getSource() == pasteExpandItem)
2078
+ if (source == pasteCloneItem)
2079
+ {
2080
+ pasteInto(true, true);
2081
+ } else
2082
+ if (source == pasteExpandItem)
18812083 {
18822084 paste(true);
18832085 } else
1884
- if (event.getSource() == synchronizeItem)
2086
+ if (source == synchronizeItem)
18852087 {
18862088 Overwrite(Object3D.TRANSFORM);
18872089 } else
1888
- if (event.getSource() == overwriteNameItem)
2090
+ if (source == overwriteNameItem)
18892091 {
18902092 Overwrite(Object3D.NAME);
18912093 } else
1892
- if (event.getSource() == overwriteUVItem)
2094
+ if (source == overwriteUVItem)
18932095 {
18942096 Overwrite(Object3D.UV);
18952097 } else
1896
- if (event.getSource() == overwriteMatItem)
2098
+ if (source == overwriteMatItem)
18972099 {
18982100 /* july 2015
18992101 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2115,7 @@
19132115
19142116 Overwrite(dropAttributes);
19152117 }
1916
- if (event.getSource() == overwriteGeoItem)
2118
+ if (source == overwriteGeoItem)
19172119 {
19182120 Overwrite(Object3D.GEOMETRY);
19192121 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2132,7 @@
19302132 // refreshContents();
19312133 // }
19322134 } else
1933
- if (event.getSource() == generateMeshItem)
2135
+ if (source == generateMeshItem)
19342136 {
19352137 //if (group.selection.size() == 1)
19362138 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2143,7 @@
19412143 ResetModel();
19422144 refreshContents();
19432145 } else
1944
- if (event.getSource() == extractGeometriesItem)
2146
+ if (source == extractGeometriesItem)
19452147 {
19462148 boolean one = false;
19472149
....@@ -1968,7 +2170,7 @@
19682170 ResetModel();
19692171 refreshContents();
19702172 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2173
+ if (source == cloneGeometriesItem)
19722174 {
19732175 boolean one = false;
19742176
....@@ -1994,32 +2196,37 @@
19942196 ResetModel();
19952197 refreshContents();
19962198 } else
1997
- if (event.getSource() == shareGeometriesItem)
2199
+ if (source == shareGeometriesItem)
19982200 {
19992201 boolean one = false;
20002202
20012203 if (group.selection.size() == 1)
20022204 one = true;
20032205
2206
+ Object3D merge = null;
2207
+
20042208 Object3D content = new cGroup();
20052209
20062210 for (int i=0; i<group.selection.size(); i++)
20072211 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2212
+ merge = new Merge(group.selection.get(i));
20092213
20102214 if (one)
2011
- makeSomething(sel, false);
2215
+ makeSomething(merge, false);
20122216 else
2013
- content.addChild(sel);
2217
+ content.addChild(merge);
20142218 }
20152219
20162220 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2221
+ makeSomething(content, true);
2222
+ else
2223
+ {
2224
+ ResetModel();
2225
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2226
+ refreshContents();
2227
+ }
20212228 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2229
+ if (source == mergeGeometriesItem)
20232230 {
20242231 boolean one = false;
20252232
....@@ -2049,7 +2256,7 @@
20492256 ResetModel();
20502257 refreshContents();
20512258 } else
2052
- if (event.getSource() == linkverticesItem)
2259
+ if (source == linkverticesItem)
20532260 {
20542261 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552262 // {
....@@ -2062,39 +2269,48 @@
20622269 // group.selection.get(0).setMasterThis(content); // should be identity
20632270 // refreshContents();
20642271 // }
2065
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2272
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20662273 {
2067
- Object3D content = GrafreeD.clipboard.get(0);
2274
+ Object3D content = Grafreed.clipboard.get(0);
20682275
20692276 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702277 content = ((cGroup)content).get(0);
20712278
2072
- 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));
20732280 for (int i=0; i<group.selection.size(); i++)
20742281 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2282
+ boolean random = CameraPane.SWITCH;
2283
+ CameraPane.SWITCH = false; // parse all random nodes
20772284 group.selection.get(i).linkVerticesThis(content);
20782285 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2286
+ CameraPane.SWITCH = random;
20802287 }
2081
- 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));
20822289 refreshContents();
20832290 }
20842291 } else
2085
- if (event.getSource() == resetsupportItem)
2292
+ if (source == resetsupportItem)
20862293 {
20872294 for (int i=0; i<group.selection.size(); i++)
20882295 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2296
+ boolean random = CameraPane.SWITCH;
2297
+ CameraPane.SWITCH = false; // parse all random nodes
20912298 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2299
+ CameraPane.SWITCH = random;
20932300 }
20942301
20952302 refreshContents();
20962303 } else
2097
- if (event.getSource() == resetreferencesItem)
2304
+ if (source == relinkverticesItem)
2305
+ {
2306
+ boolean random = CameraPane.SWITCH;
2307
+ CameraPane.SWITCH = false; // parse all random nodes
2308
+ group.selection.RelinkToSupport();
2309
+ CameraPane.SWITCH = random;
2310
+
2311
+ refreshContents();
2312
+ } else
2313
+ if (source == resetreferencesItem)
20982314 {
20992315 for (int i=0; i<group.selection.size(); i++)
21002316 {
....@@ -2103,11 +2319,11 @@
21032319
21042320 refreshContents();
21052321 } else
2106
- if (event.getSource() == setMasterItem)
2322
+ if (source == setMasterItem)
21072323 {
2108
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2324
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21092325 {
2110
- Object3D content = GrafreeD.clipboard.get(0);
2326
+ Object3D content = Grafreed.clipboard.get(0);
21112327
21122328 if (content instanceof cGroup && ((cGroup)content).transientlink )
21132329 content = ((cGroup)content).get(0);
....@@ -2116,13 +2332,13 @@
21162332 refreshContents();
21172333 }
21182334 } else
2119
- if (event.getSource() == poseMeshItem)
2335
+ if (source == poseMeshItem)
21202336 {
21212337 if (group.selection.size() == 1)
21222338 {
2123
- if (GrafreeD.clipboard.size() == 1)
2339
+ if (Grafreed.clipboard.size() == 1)
21242340 {
2125
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
21262342
21272343 if (content instanceof cGroup && ((cGroup)content).transientlink )
21282344 content = ((cGroup)content).get(0);
....@@ -2135,19 +2351,19 @@
21352351 }
21362352
21372353 } else
2138
- if (event.getSource() == revertMeshItem)
2354
+ if (source == revertMeshItem)
21392355 {
21402356 RevertMeshes();
21412357 } else
2142
- if (event.getSource() == resetMeshItem)
2358
+ if (source == resetAllItem)
21432359 {
21442360 ResetAll();
21452361 } else
2146
- if (event.getSource() == stepAllItem)
2362
+ if (source == stepAllItem)
21472363 {
21482364 StepAll();
21492365 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2366
+ if (source == clearItem) // || event.getSource() == clearButton)
21512367 {
21522368 //int indices[] = jList.getSelectedIndices();
21532369 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2371,46 @@
21552371
21562372 ClearSelection(false);
21572373 } else
2158
- if (event.getSource() == clearAllItem)
2374
+ if (source == clearAllItem)
21592375 {
21602376 ClearSelection(true);
21612377 } else
2162
- if (event.getSource() == grabItem)
2378
+ if (source == grabItem)
21632379 {
21642380 group(new cGroup(), true);
21652381 } else
2166
- if (event.getSource() == frontItem)
2382
+ if (source == hideItem)
2383
+ {
2384
+ group(new HiddenObject());
2385
+ } else
2386
+ if (source == frontItem)
21672387 {
21682388 front();
21692389 } else
2170
- if (event.getSource() == backItem)
2390
+ if (source == backItem)
21712391 {
21722392 back();
21732393 } else
2174
- if (event.getSource() == cameraItem)
2394
+ if (source == cameraItem)
21752395 {
21762396 makeSomething(new Camera());
21772397 } else
2178
- if (event.getSource() == compositeItem)
2398
+ if (source == compositeItem)
21792399 {
21802400 group(new Composite());
21812401 } else
2182
- if (event.getSource() == randomItem)
2402
+ if (source == randomItem)
21832403 {
21842404 RandomNode random = new RandomNode();
21852405 group(random);
21862406 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2407
+ random.name = random.get(0).name + "Switch";
21882408 } else
2189
- if (event.getSource() == physicsItem)
2409
+ if (source == physicsItem)
21902410 {
21912411 group(new PhysicsNode());
21922412 } else
2193
- if (event.getSource() == frameselectorItem)
2413
+ if (source == frameselectorItem)
21942414 {
21952415 for (int i=0; i<group.selection.size(); i++)
21962416 {
....@@ -2202,7 +2422,7 @@
22022422 ResetModel();
22032423 refreshContents();
22042424 } else
2205
- if (event.getSource() == switchGeoItem)
2425
+ if (source == switchGeoItem)
22062426 {
22072427 for (int i=0; i<group.selection.size(); i++)
22082428 {
....@@ -2214,7 +2434,7 @@
22142434 ResetModel();
22152435 refreshContents();
22162436 } else
2217
- if (event.getSource() == switchTransfoItem)
2437
+ if (source == switchTransfoItem)
22182438 {
22192439 for (int i=0; i<group.selection.size(); i++)
22202440 {
....@@ -2226,7 +2446,7 @@
22262446 ResetModel();
22272447 refreshContents();
22282448 } else
2229
- if (event.getSource() == morphItem)
2449
+ if (source == morphItem)
22302450 {
22312451 for (int i=0; i<group.selection.size(); i++)
22322452 {
....@@ -2238,7 +2458,7 @@
22382458 ResetModel();
22392459 refreshContents();
22402460 } else
2241
- if (event.getSource() == scriptNodeItem)
2461
+ if (source == scriptNodeItem)
22422462 {
22432463 boolean atleastone = false;
22442464
....@@ -2277,195 +2497,223 @@
22772497 }
22782498 }
22792499 } else
2280
- if (event.getSource() == linkerItem)
2500
+ if (source == linkerItem)
22812501 {
22822502 group(new cLinker());
22832503 } else
2284
- if (event.getSource() == textureItem)
2504
+ if (source == textureItem)
22852505 {
22862506 group(new TextureNode());
22872507 } else
2288
- if (event.getSource() == shadowXItem)
2508
+ if (source == billboardItem)
2509
+ {
2510
+ group(new BillboardNode());
2511
+ } else
2512
+ if (source == shadowXItem)
22892513 {
22902514 CastShadow(0);
22912515 } else
2292
- if (event.getSource() == shadowYItem)
2516
+ if (source == shadowYItem)
22932517 {
22942518 CastShadow(1);
22952519 } else
2296
- if (event.getSource() == shadowZItem)
2520
+ if (source == shadowZItem)
22972521 {
22982522 CastShadow(2);
22992523 } else
2300
- if (event.getSource() == ungroupItem)
2524
+ if (source == ungroupItem)
23012525 {
2302
- ungroup();
2526
+ //ungroup();
2527
+ for (int i=0; i<group.selection.size(); i++)
2528
+ {
2529
+ Ungroup(group.selection.get(i));
2530
+ }
2531
+
2532
+ ClearSelection(false);
2533
+
2534
+ refreshContents();
23032535 } else
2304
- if (event.getSource() == genUVItem)
2536
+ if (source == genUVItem)
23052537 {
23062538 GenUV();
23072539 } else
2308
- if (event.getSource() == genNormalsCADItem)
2540
+ if (source == genNormalsCADItem)
23092541 {
23102542 GenNormals(true);
23112543 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2544
+ if (source == genNormalsMESHItem)
2545
+ {
2546
+ GenNormalsMESH();
2547
+ } else
2548
+ if (source == genNormalsORGANItem)
23132549 {
23142550 GenNormals(false);
23152551 } else
2316
- if (event.getSource() == stripifyItem)
2552
+ if (source == genNormalsMINEItem)
2553
+ {
2554
+ GenNormalsMINE();
2555
+ } else
2556
+ if (source == stripifyItem)
23172557 {
23182558 Stripify();
23192559 } else
2320
- if (event.getSource() == unstripifyItem)
2560
+ if (source == unstripifyItem)
23212561 {
23222562 Unstripify();
23232563 } else
2324
- if (event.getSource() == trimItem)
2564
+ if (source == trimItem)
23252565 {
23262566 Trim();
23272567 } else
2328
- if (event.getSource() == untrimItem)
2568
+ if (source == untrimItem)
23292569 {
23302570 Untrim();
23312571 } else
2332
- if (event.getSource() == clearColorsItem)
2572
+ if (source == clearColorsItem)
23332573 {
23342574 ClearColors();
23352575 } else
2336
- if (event.getSource() == clearMaterialsItem)
2576
+ if (source == clearMaterialsItem)
23372577 {
23382578 ClearMaterials();
23392579 } else
2340
- if (event.getSource() == liveleavesItem)
2580
+ if (source == liveleavesItem)
23412581 {
23422582 LiveLeaves(true);
23432583 } else
2344
- if (event.getSource() == unliveleavesItem)
2584
+ if (source == unliveleavesItem)
23452585 {
23462586 LiveLeaves(false);
23472587 } else
2348
- if (event.getSource() == supportleavesItem)
2588
+ if (source == supportleavesItem)
23492589 {
23502590 SupportLeaves(true);
23512591 } else
2352
- if (event.getSource() == unsupportleavesItem)
2592
+ if (source == unsupportleavesItem)
23532593 {
23542594 SupportLeaves(false);
23552595 } else
2356
- if (event.getSource() == hideleavesItem)
2596
+ if (source == hideleavesItem)
23572597 {
23582598 HideLeaves(true);
23592599 } else
2360
- if (event.getSource() == showleavesItem)
2600
+ if (source == showleavesItem)
23612601 {
23622602 HideLeaves(false);
23632603 } else
2364
- if (event.getSource() == markleavesItem)
2604
+ if (source == markleavesItem)
23652605 {
23662606 MarkLeaves(true);
23672607 } else
2368
- if (event.getSource() == unmarkleavesItem)
2608
+ if (source == unmarkleavesItem)
23692609 {
23702610 MarkLeaves(false);
23712611 } else
2372
- if (event.getSource() == flipVItem)
2612
+ if (source == flipVItem)
23732613 {
23742614 FlipV(true);
23752615 } else
2376
- if (event.getSource() == unflipVItem)
2616
+ if (source == unflipVItem)
23772617 {
23782618 FlipV(false);
23792619 } else
2380
- if (event.getSource() == lowTexturesItem)
2620
+ if (source == lowTexturesItem)
23812621 {
23822622 SetTexRes(0);
23832623 } else
2384
- if (event.getSource() == normalTexturesItem)
2624
+ if (source == normalTexturesItem)
23852625 {
23862626 SetTexRes(1);
23872627 } else
2388
- if (event.getSource() == highTexturesItem)
2628
+ if (source == highTexturesItem)
23892629 {
23902630 SetTexRes(2);
23912631 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2632
+ if (source == veryhighTexturesItem)
23932633 {
23942634 SetTexRes(3);
23952635 } else
2396
- if (event.getSource() == maxTexturesItem)
2636
+ if (source == maxTexturesItem)
23972637 {
23982638 SetTexRes(4);
23992639 } else
2400
- if (event.getSource() == panoTexturesItem)
2640
+ if (source == panoTexturesItem)
24012641 {
24022642 SetTexRes(5);
24032643 } else
2404
- if (event.getSource() == reverseNormalsItem)
2644
+ if (source == reverseNormalsItem)
24052645 {
24062646 ReverseNormals();
24072647 } else
2408
- if (event.getSource() == parseverticesItem)
2648
+ if (source == parseverticesItem)
24092649 {
24102650 ParseVertices();
24112651 } else
2412
- if (event.getSource() == textureFieldItem)
2652
+ if (source == textureFieldItem)
24132653 {
24142654 TextureVertices();
24152655 } else
2416
- if (event.getSource() == alignItem)
2656
+ if (source == alignItem)
24172657 {
24182658 Align();
24192659 } else
2420
- if (event.getSource() == mirrorItem)
2660
+ if (source == mirrorItem)
24212661 {
24222662 MirrorPoses();
24232663 } else
2424
- if (event.getSource() == reduceMorphItem)
2664
+ if (source == reduceMorphItem)
24252665 {
24262666 MeshReduction(false);
24272667 } else
2428
- if (event.getSource() == reduce34MorphItem)
2668
+ if (source == reduce34MorphItem)
24292669 {
24302670 MeshReduction(true);
24312671 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2672
+ if (source == reverseTrianglesItem)
24332673 {
24342674 ReverseTriangles();
24352675 } else
2436
- if (event.getSource() == reduceMeshItem)
2676
+ if (source == reduceMeshItem)
24372677 {
24382678 ReduceMesh(false);
24392679 } else
2440
- if (event.getSource() == reduce34MeshItem)
2680
+ if (source == reduce34MeshItem)
24412681 {
24422682 ReduceMesh(true);
24432683 } else
2444
- if (event.getSource() == increaseMeshItem)
2684
+ if (source == increaseMeshItem)
24452685 {
24462686 IncreaseMesh();
24472687 } else
2448
- if (event.getSource() == clipMeshItem)
2688
+ if (source == clipMeshItem)
24492689 {
24502690 ClipMesh();
24512691 } else
2452
- if (event.getSource() == smoothMeshItem)
2692
+ if (source == smoothMeshItem)
24532693 {
24542694 SmoothMesh();
24552695 } else
2456
- if (event.getSource() == transformgeometryItem)
2696
+ if (source == transformGeometryItem)
24572697 {
24582698 TransformGeometry();
24592699 } else
2460
- if (event.getSource() == resetTransformItem)
2700
+ if (source == transformChildrenItem)
2701
+ {
2702
+ TransformChildren();
2703
+ } else
2704
+ if (source == resetTransformItem)
24612705 {
24622706 ResetTransform();
24632707 } else
2464
- if (event.getSource() == resetCentroidItem)
2708
+ if (source == resetCentroidItem)
24652709 {
2466
- ResetCentroid();
2710
+ ResetCentroid(true);
24672711 } else
2468
- if (event.getSource() == resetParentItem)
2712
+ if (source == resetCentroidXZItem)
2713
+ {
2714
+ ResetCentroid(false);
2715
+ } else
2716
+ if (source == resetParentItem)
24692717 {
24702718 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712719 {
....@@ -2475,7 +2723,7 @@
24752723
24762724 refreshContents();
24772725 } else
2478
- if (event.getSource() == repairParentItem)
2726
+ if (source == repairParentItem)
24792727 {
24802728 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812729 {
....@@ -2489,7 +2737,21 @@
24892737
24902738 refreshContents();
24912739 } else
2492
- 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)
24932755 {
24942756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952757 {
....@@ -2501,7 +2763,7 @@
25012763 ResetModel();
25022764 refreshContents();
25032765 } else
2504
- if (event.getSource() == sortbynameItem)
2766
+ if (source == sortbynameItem)
25052767 {
25062768 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072769 {
....@@ -2513,7 +2775,7 @@
25132775 ResetModel();
25142776 refreshContents();
25152777 } else
2516
- if (event.getSource() == attachPigmentItem)
2778
+ if (source == attachPigmentItem)
25172779 {
25182780 String texture = GetFile("Attach pigment");
25192781 Object3D obj;
....@@ -2525,7 +2787,7 @@
25252787
25262788 refreshContents();
25272789 } else
2528
- if (event.getSource() == detachPigmentItem)
2790
+ if (source == detachPigmentItem)
25292791 {
25302792 Object3D obj;
25312793 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2798,7 @@
25362798
25372799 refreshContents();
25382800 } else
2539
- if (event.getSource() == attachBumpItem)
2801
+ if (source == attachBumpItem)
25402802 {
25412803 String texture = GetFile("Attach bump");
25422804 Object3D obj;
....@@ -2548,7 +2810,7 @@
25482810
25492811 refreshContents();
25502812 } else
2551
- if (event.getSource() == detachBumpItem)
2813
+ if (source == detachBumpItem)
25522814 {
25532815 Object3D obj;
25542816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2821,7 @@
25592821
25602822 refreshContents();
25612823 } else
2562
- if (event.getSource() == pigmentBumpItem)
2824
+ if (source == pigmentBumpItem)
25632825 {
25642826 Object3D obj;
25652827 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2832,195 @@
25702832
25712833 refreshContents();
25722834 } else
2573
- if (event.getSource() == flashSelectionButton)
2835
+ if (source == flashSelectionButton)
25742836 {
25752837 CameraPane.flash = true;
25762838 refreshContents();
25772839 } else
2578
- if (event.getSource() == oneButton)
2840
+ if (source == oneButton)
25792841 {
25802842 } else
2581
- if (event.getSource() == twoButton)
2843
+ if (source == twoButton)
25822844 {
25832845 radio.layout = twoButton;
25842846 // bug
25852847 //gridPanel.setDividerLocation(1.0);
25862848 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- bigThree.revalidate();
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();
26112878 } else
2612
- if (event.getSource() == threeButton)
2879
+ if (source == threeButton)
26132880 {
26142881 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- bigThree.revalidate();
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();
26392914 } else
2640
- if (event.getSource() == fourButton)
2915
+ if (source == fourButton)
26412916 {
26422917 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
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();
26672949 } else
2668
- if (event.getSource() == sixButton)
2950
+ if (source == sixButton)
26692951 {
26702952 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- bigThree.revalidate();
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();
26952985 } else
2696
- if (event.getSource() == sevenButton)
2986
+ if (source == sevenButton)
26972987 {
26982988 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
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();
27233022 } else
2724
- if (event.getSource() == rootButton)
3023
+ if (source == rootButton)
27253024 {
27263025 Object3D obj;
27273026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +3032,7 @@
27333032
27343033 refreshContents(true);
27353034 } else
2736
- if (event.getSource() == closeButton)
3035
+ if (source == closeButton)
27373036 {
27383037 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27393038 cRadio ab;
....@@ -2754,11 +3053,11 @@
27543053 }
27553054 refreshContents(true);
27563055 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
3056
+ if (source == editItem || source == editButton)
27583057 {
27593058 EditSelection(false);
27603059 } else
2761
- if (event.getSource() == uneditButton)
3060
+ if (source == uneditButton)
27623061 {
27633062 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27643063 {
....@@ -2768,14 +3067,14 @@
27683067 child.CloseUI();
27693068 listUI.remove(child);
27703069
2771
- child.editWindow = null; // ???????????
3070
+ //child.editWindow = null; // ???????????
27723071 }
2773
- objEditor.ctrlPanel.revalidate();
3072
+ objEditor.ctrlPanel.FlushUI();
27743073 //objEditor.jTree.clearSelection();
27753074 //objEditor.ResetSliders();
27763075 refreshContents(true);
27773076 } else
2778
- if (event.getSource() == clearPanelButton)
3077
+ if (source == clearPanelButton)
27793078 {
27803079 assert(copy == group);
27813080 //copy.ClearUI();
....@@ -2786,7 +3085,7 @@
27863085 listUI.clear();
27873086 refreshContents(true);
27883087 } else
2789
- if (event.getSource() == allParamsButton)
3088
+ if (source == allParamsButton)
27903089 {
27913090 assert(copy == group);
27923091
....@@ -2807,19 +3106,19 @@
28073106
28083107 refreshContents(true);
28093108 } else
2810
- if (event.getSource() == unselectButton)
3109
+ if (source == unselectButton)
28113110 {
28123111 objEditor.jTree.clearSelection();
28133112 // ?? oct 2012 GrafreeD.clipboard.clear();
28143113 objEditor.ResetSliders();
28153114 refreshContents(true);
28163115 } else
2817
- if(event.getSource() instanceof cRadio)
3116
+ if(source instanceof cRadio)
28183117 {
28193118 group.parent = keepparent;
28203119 group.attributes = 0;
28213120 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3121
+ /*cRadio*/ radio = (cRadio)source;
28233122 Object3D obj = radio.GetObject();
28243123 System.out.println("Edit " + obj);
28253124 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3138,7 @@
28393138 }
28403139
28413140 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3141
+ //Globals.theRenderer.object = group;
28433142 if(!useclient)
28443143 {
28453144 cameraView.renderCamera = radio.camera;
....@@ -2848,12 +3147,16 @@
28483147 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493148 cameraView.targetLookAt.set(radio.camera.lookAt);
28503149 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3150
+ //cameraView.lighttouched = true;
3151
+ Globals.lighttouched = true;
28523152 topView.object = group;
28533153 frontView.object = group;
28543154 sideView.object = group;
28553155 }
3156
+
3157
+// fix "+" issue
28563158 group.editWindow = this;
3159
+
28573160 /*
28583161 currentLayout = radio.layout;
28593162 if (currentLayout == null)
....@@ -2866,7 +3169,20 @@
28663169 //group.attributes = -1;
28673170 ResetModel();
28683171 refreshContents(true);
2869
- }
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
+ }
28703186 else
28713187 {
28723188 //return super.action(event, arg);
....@@ -2884,7 +3200,7 @@
28843200 if (useclient)
28853201 {
28863202 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3203
+ Globals.lighttouched = true;
28883204 //topView.object = client;
28893205 //frontView.object = client;
28903206 //sideView.object = client;
....@@ -2892,7 +3208,7 @@
28923208 else
28933209 {
28943210 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3211
+ Globals.lighttouched = true;
28963212 //topView.object = group;
28973213 //frontView.object = group;
28983214 //sideView.object = group;
....@@ -2927,6 +3243,28 @@
29273243 refreshContents();
29283244 }
29293245
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
+ }
29303268
29313269 void ResetTransform()
29323270 {
....@@ -3039,7 +3377,7 @@
30393377 refreshContents();
30403378 }
30413379
3042
- void ResetCentroid()
3380
+ void ResetCentroid(boolean full)
30433381 {
30443382 Object3D obj;
30453383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3054,12 +3392,16 @@
30543392 LA.matIdentity(Object3D.mat);
30553393 obj.getBounds(minima, maxima, false);
30563394 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3395
+ if (full)
3396
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30583397 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30593398 obj.TransformMesh(Object3D.mat);
3399
+
30603400 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3061
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3401
+ if (full)
3402
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30623403 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3404
+
30633405 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30643406 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30653407 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3088,7 +3430,8 @@
30883430
30893431 int size = obj.MemorySize();
30903432
3091
- 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)");
30923435 }
30933436 }
30943437 catch (Exception e)
....@@ -3125,9 +3468,9 @@
31253468 obj = (Object3D)e.nextElement();
31263469
31273470 System.out.println("Object is: " + obj);
3128
- GrafreeD.AnalyzeObject(obj);
3471
+ Grafreed.AnalyzeObject(obj);
31293472 System.out.println("Boundary rep: " + obj.bRep);
3130
- GrafreeD.AnalyzeObject(obj.bRep);
3473
+ Grafreed.AnalyzeObject(obj.bRep);
31313474
31323475 // System.err.println((size/1024) + " KB is the size of " + obj);
31333476 }
....@@ -3169,6 +3512,20 @@
31693512 void GenNormals(boolean crease)
31703513 {
31713514 group.GenNormalsS(crease);
3515
+
3516
+ refreshContents();
3517
+ }
3518
+
3519
+ void GenNormalsMESH()
3520
+ {
3521
+ group.GenNormalsMeshS();
3522
+
3523
+ refreshContents();
3524
+ }
3525
+
3526
+ void GenNormalsMINE()
3527
+ {
3528
+ group.selection.GenNormalsMINE();
31723529
31733530 refreshContents();
31743531 }
....@@ -3334,8 +3691,8 @@
33343691
33353692 void ParseVertices()
33363693 {
3337
- boolean epsequal = GrafreeD.epsequal;
3338
- GrafreeD.epsequal = true;
3694
+ boolean epsequal = Grafreed.epsequal;
3695
+ Grafreed.epsequal = true;
33393696
33403697 for (int i=0; i<group.selection.size(); i++)
33413698 {
....@@ -3360,7 +3717,7 @@
33603717 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33613718 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33623719
3363
- g.add(GrafreeD.clipboard);
3720
+ g.add(Grafreed.clipboard);
33643721
33653722 buffer.add(g);
33663723 }
....@@ -3375,7 +3732,7 @@
33753732 makeSomething(buffer, i==group.selection.size()-1);
33763733 }
33773734
3378
- GrafreeD.epsequal = epsequal;
3735
+ Grafreed.epsequal = epsequal;
33793736
33803737 refreshContents();
33813738 }
....@@ -3393,7 +3750,16 @@
33933750 String pigment = Object3D.GetPigment(tex);
33943751 //String bump = Object3D.GetBump(tex);
33953752
3396
- 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
+ }
33973763
33983764 double s = v.s;
33993765
....@@ -3441,12 +3807,26 @@
34413807
34423808 void Align()
34433809 {
3810
+ if (group.selection.size() == 0)
3811
+ return;
3812
+
3813
+ cVector bbmin = new cVector();
3814
+ cVector bbmax = new cVector();
3815
+
3816
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3817
+
3818
+ double dx = bbmax.x - bbmin.x;
3819
+ double dy = bbmax.y - bbmin.y;
3820
+ double dz = bbmax.z - bbmin.z;
3821
+
3822
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3823
+
34443824 for (int i=0; i<group.selection.size(); i++)
34453825 {
34463826 Object3D obj = group.selection.get(i);
34473827
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3828
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3829
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503830 }
34513831
34523832 refreshContents();
....@@ -3467,11 +3847,11 @@
34673847
34683848 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693849
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3850
+ boolean random = CameraPane.SWITCH;
3851
+ CameraPane.SWITCH = false; // parse all random nodes
34723852 lowres.linkVerticesThis(null);
34733853 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3854
+ CameraPane.SWITCH = random;
34753855
34763856 System.err.flush();
34773857
....@@ -3511,7 +3891,7 @@
35113891 return;
35123892
35133893 Object3D poses = group.selection.get(0);
3514
- Object3D ref = GrafreeD.clipboard.get(0);
3894
+ Object3D ref = Grafreed.clipboard.get(0);
35153895
35163896 Object3D newgroup = new Object3D("Po:" + poses.name);
35173897
....@@ -3680,7 +4060,7 @@
36804060 group.selection.RelinkToSupport(); // july 2014
36814061 System.out.println("DONE.");
36824062 refreshContents();
3683
- 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));
36844064 }
36854065
36864066 void ReduceMesh(boolean reduction34)
....@@ -3705,9 +4085,9 @@
37054085
37064086 void ClipMesh()
37074087 {
3708
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4088
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37094089 {
3710
- Object3D content = GrafreeD.clipboard.get(0);
4090
+ Object3D content = Grafreed.clipboard.get(0);
37114091
37124092 if (content instanceof cGroup && ((cGroup)content).transientlink )
37134093 content = ((cGroup)content).get(0);
....@@ -3716,7 +4096,7 @@
37164096 // {
37174097 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37184098 // }
3719
- group.selection.ClipMesh(GrafreeD.clipboard);
4099
+ group.selection.ClipMesh(Grafreed.clipboard);
37204100 }
37214101 // group.selection.ClipMesh(GrafreeD.clipboard);
37224102 System.out.println("DONE.");
....@@ -3851,7 +4231,7 @@
38514231 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38524232
38534233 Object3D elem = (Object3D)group.selection.elementAt(i);
3854
- if(elem != group)
4234
+ if(elem != group || !newWindow)
38554235 {
38564236 // if (!(elem instanceof Composite))
38574237 // newWindow = false;
....@@ -3941,7 +4321,6 @@
39414321 //case 702: // Event.LIST_DESELECT
39424322 group.deselectAll();
39434323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3944
- objEditor.ClearInfo(); // .GetMaterial());
39454324 if (tps != null)
39464325 {
39474326 for (int i=0; i < tps.length; i++)
....@@ -3950,31 +4329,30 @@
39504329
39514330 //if (child.parent != null)
39524331 //child.parent.addSelectee(child);
4332
+ objEditor.SetMaterial(child);
39534333 group.addSelectee(child);
3954
- objEditor.SetMaterial(child); // .GetMaterial());
3955
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3956
- System.err.println("info : " + child.GetPath());
39574334 }
39584335 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4336
+// else
4337
+// {
4338
+// objEditor.SetMaterial(group); // .GetMaterial());
4339
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4340
+// System.err.println("info : " + group.GetPath());
4341
+// }
39654342
3966
- objEditor.SetText(); // jan 2014
3967
-
3968
- 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))
39694344 CameraPane.flash = true;
39704345
3971
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4346
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39724347 // a camera
39734348 {
3974
- CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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;
39784356 }
39794357
39804358 refreshContents();
....@@ -3985,6 +4363,26 @@
39854363
39864364 freezemodel = false;
39874365 }
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
+ }
39884386
39894387 void linkSomething(Object3D thing)
39904388 {
....@@ -4056,16 +4454,18 @@
40564454 {
40574455 if (group.selection.isEmpty())
40584456 return;
4059
- GrafreeD.clipboardIsTempGroup = false;
4457
+
4458
+ Grafreed.clipboardIsTempGroup = false;
40604459 Composite tGroup = null;
40614460 if (group.selection.size() > 0) // 1)
40624461 {
40634462 tGroup = new cGroup();
4064
- GrafreeD.clipboardIsTempGroup = true;
4463
+ Grafreed.clipboardIsTempGroup = true;
40654464 }
40664465
40674466 if (cut)
40684467 {
4468
+ Save();
40694469 //int indices[] = jList.getSelectedIndices();
40704470 //for (int i = indices.length - 1; i >= 0; i--)
40714471 //jList.remove(indices[i]);
....@@ -4101,16 +4501,16 @@
41014501 //System.out.println("cut " + child);
41024502 //System.out.println("parent = " + child.parent);
41034503 // tmp.addChild(child);
4104
- if (GrafreeD.clipboardIsTempGroup)
4504
+ if (Grafreed.clipboardIsTempGroup)
41054505 tGroup.add/*Child*/(tmp);
41064506 else
4107
- GrafreeD.clipboard = tmp;
4507
+ Grafreed.clipboard = tmp;
41084508 }
41094509 else
4110
- if (GrafreeD.clipboardIsTempGroup)
4510
+ if (Grafreed.clipboardIsTempGroup)
41114511 tGroup.add/*Child*/(child);
41124512 else
4113
- GrafreeD.clipboard = child;
4513
+ Grafreed.clipboard = child;
41144514 }
41154515
41164516 //ResetModel();
....@@ -4142,21 +4542,23 @@
41424542 //System.out.println("cut " + elem);
41434543 //System.out.println("parent = " + elem.parent);
41444544 // tmp.addChild(elem);
4145
- if (GrafreeD.clipboardIsTempGroup)
4545
+ if (Grafreed.clipboardIsTempGroup)
41464546 tGroup.add/*Child*/(tmp);
41474547 else
4148
- GrafreeD.clipboard = tmp;
4548
+ Grafreed.clipboard = tmp;
41494549 }
41504550 else
4151
- if (GrafreeD.clipboardIsTempGroup)
4551
+ if (Grafreed.clipboardIsTempGroup)
41524552 tGroup.add/*Child*/(child);
41534553 else
4154
- GrafreeD.clipboard = child;
4554
+ Grafreed.clipboard = child;
41554555 }
41564556
41574557 }
4158
- if (GrafreeD.clipboardIsTempGroup)
4159
- GrafreeD.clipboard = tGroup;
4558
+
4559
+ if (Grafreed.clipboardIsTempGroup)
4560
+ Grafreed.clipboard = tGroup;
4561
+
41604562 if (cut)
41614563 {
41624564 ResetModel();
....@@ -4170,7 +4572,7 @@
41704572 // return;
41714573 boolean first = true;
41724574
4173
- if (GrafreeD.clipboardIsTempGroup)
4575
+ if (Grafreed.clipboardIsTempGroup)
41744576 {
41754577 Composite temp;
41764578
....@@ -4181,7 +4583,7 @@
41814583 temp = (Composite)Applet3D.clipboard.deepCopy();
41824584 */
41834585 Object3D elem;
4184
- 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))
41854587 {
41864588 Object3D child = (Object3D)e.nextElement();
41874589
....@@ -4215,21 +4617,21 @@
42154617 //Object3D cb = Applet3D.clipboard;
42164618 //temp.addChild(cb);
42174619 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4218
- assert(GrafreeD.clipboard.parent == null);
4219
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
42234625 else
4224
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
- GrafreeD.clipboard.get(0).parent = keepparent;
4626
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4627
+ Grafreed.clipboard.get(0).parent = keepparent;
42264628 }
42274629
42284630 ResetModel();
42294631 refreshContents();
42304632 }
42314633
4232
- void pasteInto(boolean copyit)
4634
+ void pasteInto(boolean copyit, boolean clone)
42334635 {
42344636 // if (GrafreeD.clipboard == null)
42354637 // return;
....@@ -4258,15 +4660,22 @@
42584660 if (copyit)
42594661 {
42604662 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4663
+ if (clone)
4664
+ {
4665
+ CloneClipboard(false); // sept 2014
4666
+ }
4667
+ else
4668
+ {
4669
+ paste(false);
4670
+ }
42624671 }
42634672 else
42644673 {
42654674 boolean first = true;
42664675
4267
- if (GrafreeD.clipboardIsTempGroup)
4676
+ if (Grafreed.clipboardIsTempGroup)
42684677 {
4269
- Composite temp = (Composite)GrafreeD.clipboard;
4678
+ Composite temp = (Composite)Grafreed.clipboard;
42704679 Object3D copy;
42714680 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42724681 {
....@@ -4276,7 +4685,7 @@
42764685 }
42774686 } else
42784687 {
4279
- linkSomething(GrafreeD.clipboard); //.get(0));
4688
+ linkSomething(Grafreed.clipboard); //.get(0));
42804689 }
42814690 }
42824691 }
....@@ -4468,6 +4877,26 @@
44684877 makeSomething(csg);
44694878 }
44704879
4880
+ void Ungroup(Object3D g)
4881
+ {
4882
+ if (g instanceof HiddenObject)
4883
+ {
4884
+ HiddenObject h = (HiddenObject) g;
4885
+
4886
+ for (int i=0; i<h.ActualSize(); i++)
4887
+ {
4888
+ objEditor.makeSomething(h.get(i), false);
4889
+ }
4890
+ }
4891
+ else
4892
+ {
4893
+ for (int i=0; i<g.Size(); i++)
4894
+ {
4895
+ objEditor.makeSomething(g.get(i), false);
4896
+ }
4897
+ }
4898
+ }
4899
+
44714900 void ungroup()
44724901 {
44734902 /*
....@@ -4661,21 +5090,6 @@
46615090 }
46625091 */
46635092
4664
- void ImportGFD()
4665
- {
4666
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4667
- browser.show();
4668
- String filename = browser.getFile();
4669
- if (filename != null && filename.length() > 0)
4670
- {
4671
- String fullname = browser.getDirectory() + filename;
4672
-
4673
- //Object3D readobj =
4674
- objEditor.ReadGFD(fullname, objEditor);
4675
- //makeSomething(readobj);
4676
- }
4677
- }
4678
-
46795093 /*
46805094 public void Callback(Object obj)
46815095 {
....@@ -4699,26 +5113,9 @@
46995113 }
47005114 */
47015115
4702
- void ImportVRMLX3D()
4703
- {
4704
- if (GrafreeD.standAlone)
4705
- {
4706
- /**/
4707
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4708
- browser.show();
4709
- String filename = browser.getFile();
4710
- if (filename != null && filename.length() > 0)
4711
- {
4712
- String fullname = browser.getDirectory() + filename;
4713
- LoadVRMLX3D(fullname);
4714
- }
4715
- /**/
4716
- }
4717
- }
4718
-
47195116 String GetFile(String dialogName)
47205117 {
4721
- if (GrafreeD.standAlone)
5118
+ if (Grafreed.standAlone)
47225119 {
47235120 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47245121 browser.show();
....@@ -4782,10 +5179,15 @@
47825179 cButton flashSelectionButton;
47835180 cButton editButton;
47845181 cButton uneditButton;
5182
+ JCheckBox allParamsButton;
47855183 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875184 cButton unselectButton;
47885185
5186
+ cButton saveButton;
5187
+ cButton undoButton;
5188
+ cButton redoButton;
5189
+ cButton oneStepButton;
5190
+
47895191 cButton screenfitButton;
47905192 cButton screenfitpointButton;
47915193 cButton snapobjectButton;
....@@ -4816,6 +5218,8 @@
48165218 private MenuItem lookFromItem;
48175219 private MenuItem switchItem;
48185220 private MenuItem cutItem;
5221
+ private MenuItem undoItem;
5222
+ private MenuItem redoItem;
48195223 private MenuItem duplicateItem;
48205224 private MenuItem cloneItem;
48215225 private MenuItem cloneSupportItem;
....@@ -4827,8 +5231,9 @@
48275231 private MenuItem resetsupportItem;
48285232 private MenuItem resetreferencesItem;
48295233 private MenuItem linkverticesItem;
5234
+ private MenuItem relinkverticesItem;
48305235 private MenuItem setMasterItem;
4831
- private MenuItem resetMeshItem;
5236
+ private MenuItem resetAllItem;
48325237 private MenuItem stepAllItem;
48335238 private MenuItem revertMeshItem;
48345239 private MenuItem poseMeshItem;
....@@ -4839,14 +5244,17 @@
48395244 private MenuItem mergeGeometriesItem;
48405245 private MenuItem copyItem;
48415246 private MenuItem pasteItem;
5247
+ private MenuItem pasteIntoItem;
48425248 private MenuItem pasteLinkItem;
48435249 private MenuItem pasteCloneItem;
48445250 private MenuItem pasteExpandItem;
48455251 private MenuItem clearItem;
48465252 private MenuItem clearAllItem;
48475253 private MenuItem genUVItem;
5254
+ private MenuItem genNormalsMESHItem;
48485255 private MenuItem genNormalsCADItem;
48495256 private MenuItem genNormalsORGANItem;
5257
+ private MenuItem genNormalsMINEItem;
48505258 private MenuItem stripifyItem;
48515259 private MenuItem unstripifyItem;
48525260 private MenuItem trimItem;
....@@ -4886,8 +5294,11 @@
48865294 private MenuItem panoTexturesItem;
48875295
48885296 private MenuItem resetCentroidItem;
4889
- private MenuItem transformgeometryItem;
5297
+ private MenuItem resetCentroidXZItem;
48905298 private MenuItem resetTransformItem;
5299
+ private MenuItem transformGeometryItem;
5300
+ private MenuItem transformChildrenItem;
5301
+ private MenuItem hideItem;
48915302 private MenuItem grabItem;
48925303 private MenuItem backItem;
48935304 private MenuItem frontItem;
....@@ -4908,6 +5319,7 @@
49085319
49095320 private MenuItem resetParentItem;
49105321 private MenuItem repairParentItem;
5322
+ private MenuItem repairShadowItem;
49115323 private MenuItem sortbysizeItem;
49125324 private MenuItem sortbynameItem;
49135325
....@@ -4928,10 +5340,11 @@
49285340 private MenuItem coneItem;
49295341 private MenuItem torusItem;
49305342 private MenuItem superItem;
5343
+ private MenuItem kleinItem;
49315344 private MenuItem blobItem;
49325345 private MenuItem latheItem;
49335346 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5347
+ private MenuItem overlayItem;
49355348 private MenuItem meshItem;
49365349 // private MenuItem meshGroupItem;
49375350 private MenuItem springItem;
....@@ -4940,6 +5353,7 @@
49405353 private MenuItem csgItem;
49415354 private MenuItem templateItem;
49425355 private MenuItem textureItem;
5356
+ private MenuItem billboardItem;
49435357 private MenuItem shadowXItem;
49445358 private MenuItem shadowYItem;
49455359 private MenuItem shadowZItem;
....@@ -4952,11 +5366,6 @@
49525366 private MenuItem doubleItem;
49535367 private MenuItem tripleItem;
49545368
4955
- private MenuItem importGFDItem;
4956
- private MenuItem importVRMLX3DItem;
4957
- private MenuItem import3DSItem;
4958
- private MenuItem importOBJItem;
4959
-
49605369 private MenuItem computeAOItem;
49615370 private MenuItem recompileItem;
49625371 private MenuItem editScriptItem;
....@@ -4966,4 +5375,8 @@
49665375 private MenuItem analyzeItem;
49675376 private MenuItem dumpItem;
49685377 //boolean freezemodel = false;
5378
+
5379
+ Menu cameraMenu;
5380
+ MenuItem editCameraItem;
5381
+ MenuItem revertCameraItem;
49695382 }