Normand Briere
2019-06-16 372b7fd481a476cd659713a4a01bf28bf6760cbe
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,130 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(CameraPane.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
286
+ }
287
+
192288 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
289
+ if (Globals.ADVANCED)
290
+ {
197291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198292 revertMeshItem.addActionListener(this);
199293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200294 resetreferencesItem.addActionListener(this);
201295 menu.add("-");
296
+ }
202297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203298 overwriteGeoItem.addActionListener(this);
204299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +305,26 @@
210305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211306 overwriteUVItem.addActionListener(this);
212307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
213310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214311 generateMeshItem.addActionListener(this);
215312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216313 poseMeshItem.addActionListener(this);
217314 menu.add("-");
315
+ }
218316 resetsupportItem = menu.add(new MenuItem("Reset support"));
219317 resetsupportItem.addActionListener(this);
220318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
222325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223326 setMasterItem.addActionListener(this);
327
+ }
224328
225329 oe.menuBar.add(menu = new Menu("Group"));
226330 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +335,38 @@
231335 frontItem.addActionListener(this);
232336 compositeItem = menu.add(new MenuItem("Composite"));
233337 compositeItem.addActionListener(this);
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
339
+ hideItem.addActionListener(this);
340
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
341
+ ungroupItem.addActionListener(this);
234342 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
236344 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242346 switchGeoItem.addActionListener(this);
243347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244348 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
246350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
247359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248360 scriptNodeItem.addActionListener(this);
249361 cameraItem = menu.add(new MenuItem("Camera"));
250362 cameraItem.addActionListener(this);
363
+ }
251364
252365 oe.menuBar.add(menu = new Menu("Object"));
253366 textureItem = menu.add(new MenuItem("Texture"));
254367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
255370 csgItem = menu.add(new MenuItem("CSG"));
256371 csgItem.addActionListener(this);
257372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +375,29 @@
260375 shadowYItem.addActionListener(this);
261376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
263381 linkerItem = menu.add(new MenuItem("Linker"));
264382 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267383 attributeItem = menu.add(new MenuItem("Attribute"));
268384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
269387 pointflowItem = menu.add(new MenuItem("Point Flow"));
270388 pointflowItem.addActionListener(this);
389
+ }
271390 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275392 resetTransformItem.addActionListener(this);
276393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277394 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
280401
281402 oe.menuBar.add(menu = new Menu("Geometry"));
282403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +408,11 @@
287408 genNormalsCADItem.addActionListener(this);
288409 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289410 genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
290416 stripifyItem = menu.add(new MenuItem("Stripify"));
291417 stripifyItem.addActionListener(this);
292418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +434,34 @@
308434 reduce34MeshItem.addActionListener(this);
309435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310436 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
315445
316446 oe.menuBar.add(menu = new Menu("Attributes"));
317447 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318448 clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
319453 menu.add("-");
320454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321455 liveleavesItem.addActionListener(this);
322456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
324460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325461 supportleavesItem.addActionListener(this);
326462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327463 unsupportleavesItem.addActionListener(this);
464
+ }
328465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329466 hideleavesItem.addActionListener(this);
330467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -368,29 +505,22 @@
368505 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369506 sortbynameItem.addActionListener(this);
370507 menu.add("-");
508
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
509
+ shareGeometriesItem.addActionListener(this);
510
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
511
+ mergeGeometriesItem.addActionListener(this);
512
+ if (Globals.ADVANCED)
513
+ {
514
+ // Pretty much the same as duplicate and clone.
371515 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372516 extractGeometriesItem.addActionListener(this);
373517 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374518 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
519
+ }
379520
380521 oe.menuBar.add(menu = new Menu("Insert"));
381522 buildCreateMenu(menu);
382523
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394524 oe.menuBar.add(menu = new Menu("Tools"));
395525 buildToolsMenu(menu);
396526 }
....@@ -425,150 +555,110 @@
425555 oe.radioPanel.add(dummyButton);
426556 oe.buttonGroup.add(dummyButton);
427557 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
558
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431559
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
571
+
572
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
573
+ liveCB.setToolTipText("Enable animation");
433574 liveCB.addItemListener(this);
434575
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
576
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ oneStepButton.setToolTipText("Animate one step forward");
578
+ oneStepButton.addActionListener(this);
579
+
580
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
581
+ fastCB.setToolTipText("Fast mode");
453582 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
583
+
584
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
+ trackCB.setToolTipText("Enable tracking");
495586 trackCB.addItemListener(this);
496587
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ screenfitButton.setToolTipText("Screen fit");
499590 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
591
+
501592 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502593 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507594
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
595
+ if (Globals.ADVANCED)
596
+ {
597
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ snapobjectButton.addActionListener(this);
599
+ snapobjectButton.setToolTipText("Snap Object");
600
+ }
601
+
602
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ flashSelectionButton.setToolTipText("Show selection");
514604 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518605
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
606
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607
+
608
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ twoButton.setToolTipText("Show center view only");
521610 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
611
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523612 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
613
+ fourButton.setToolTipText("Show left panel only");
614
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ sixButton.setToolTipText("2-column layout left");
525616 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
617
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618
+ threeButton.setToolTipText("2-column layout right");
527619 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ sevenButton.setToolTipText("3-column layout");
529622 sevenButton.addActionListener(this);
530623 //
531624
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
625
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ rootButton.setToolTipText("Edit selection in new tab");
533627 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
628
+
629
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ closeButton.setToolTipText("Close tab");
536631 closeButton.addActionListener(this);
537632 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538633 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540634
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
635
+ cGridBag commandsPanel = new cGridBag();
636
+
637
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
+ editButton.setToolTipText("Edit selection");
543639 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547640
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
641
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ uneditButton.setToolTipText("Unedit selection");
549643 uneditButton.addActionListener(this);
550644
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
645
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
+ allParamsButton.setToolTipText("Edit all params");
563647 allParamsButton.addActionListener(this);
564648
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
649
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ clearPanelButton.setToolTipText("Clear edit panel");
651
+ clearPanelButton.addActionListener(this);
652
+
653
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ unselectButton.setToolTipText("Unselect");
570655 unselectButton.addActionListener(this);
571656
657
+ commandsPanel.preferredHeight = 1;
658
+
659
+ oe.treePanel.add(commandsPanel);
660
+ oe.treePanel.Return();
661
+
572662 // oe.aConstraints.gridx += 1;
573663 // oe.aConstraints.weighty = 0;
574664 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +670,37 @@
580670 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581671 // gcButton.addActionListener(this);
582672
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
673
+ cGridBag jSPPanel = new cGridBag();
674
+
675
+ JScrollPane jSP;
594676 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
677
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596678 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
679
+
680
+ oe.treePanel.add(jSPPanel);
681
+ oe.treePanel.Return();
601682
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
683
+ cGridBag copyOptionsPanel = new cGridBag();
684
+
685
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
+ colorCB.setToolTipText("Copy color when dropped");
606687 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
688
+
689
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
+ materialCB.setToolTipText("Copy material when dropped");
609691 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
692
+
693
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
+ textureCB.setToolTipText("Copy texture when dropped");
612695 textureCB.addItemListener(this);
613696
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
697
+ copyOptionsPanel.preferredHeight = 1;
698
+ oe.treePanel.add(copyOptionsPanel);
699
+ oe.treePanel.Return();
616700
701
+// mainPanel.setDividerLocation(0.5); //1.0);
702
+// mainPanel.setResizeWeight(0.5);
703
+
617704 //jList.addListSelectionListener(this);
618705 oe.jTree.addTreeSelectionListener(this);
619706 //jTree.setRootVisible(false);
....@@ -635,18 +722,91 @@
635722 radio.layout = sevenButton;
636723 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637724 }
725
+
726
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727
+ {
728
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729
+ boxCB.setToolTipText("Display bounding boxes");
730
+ boxCB.addItemListener(this);
731
+
732
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
734
+ zoomBoxCB.addItemListener(this);
735
+
736
+ if (true) // Globals.ADVANCED)
737
+ {
738
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
+ supportCB.setToolTipText("Enable rigging");
740
+ supportCB.addItemListener(this);
741
+
742
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743
+ // localCB.addItemListener(this);
744
+
745
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746
+ crowdCB.setToolTipText("Used for crowds");
747
+ crowdCB.addItemListener(this);
748
+
749
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
750
+ smoothCB.setToolTipText("Snapping delay");
751
+ smoothCB.addItemListener(this);
752
+
753
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
754
+ slowCB.setToolTipText("Smooth interpolation");
755
+ slowCB.addItemListener(this);
756
+
757
+// constraints.gridy += 1;
758
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759
+// speakerMocapCB.addItemListener(this);
760
+
761
+ if (false)
762
+ {
763
+ // handled in scripts
764
+ //constraints.gridy += 1;
765
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
766
+ speakerCameraCB.addItemListener(this);
767
+
768
+ //constraints.gridy += 1;
769
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
770
+ speakerFocusCB.addItemListener(this);
771
+
772
+ //constraints.gridy += 1;
773
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774
+ smoothfocusCB.addItemListener(this);
775
+ }
776
+
777
+//constraints.gridx += 1;
778
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779
+// debugCB.addItemListener(this);
780
+
781
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
782
+ oeilCB.addItemListener(this);
783
+
784
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785
+ lookAtCB.setToolTipText("Look-at target");
786
+ lookAtCB.addItemListener(this);
787
+
788
+ }
789
+
790
+ cGridBag fill = new cGridBag();
791
+
792
+ fill.preferredHeight = 200;
793
+
794
+ panel.add(fill);
795
+
796
+ }
638797
639798 void EditObject(Object3D obj)
640799 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
800
+ cRadio radioButton = new cRadio(obj.name);
801
+ radioButton.SetObject(obj);
802
+ radioButton.layout = sevenButton;
803
+ radioButton.SetCamera(cameraView.renderCamera, false);
804
+ radioButton.addActionListener(this);
805
+ radioPanel.add(radioButton);
806
+ buttonGroup.add(radioButton);
807
+ radioButton.doClick();
649808 }
809
+
650810 void SetupViews(ObjEditor oe)
651811 {
652812 oe.SetupViews();
....@@ -665,6 +825,7 @@
665825 JCheckBox fastCB;
666826 JCheckBox slowCB;
667827 JCheckBox boxCB;
828
+ JCheckBox zoomBoxCB;
668829 JCheckBox trackCB;
669830 JCheckBox smoothfocusCB;
670831 // JCheckBox speakerMocapCB;
....@@ -707,10 +868,10 @@
707868 dropAttributes |= Object3D.TEXTURE;
708869 else
709870 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
871
+ } else if(e.getSource() == liveCB)
712872 {
713873 cameraView.ToggleLive();
874
+ refreshContents(false);
714875 }
715876 else if(e.getSource() == supportCB)
716877 {
....@@ -745,6 +906,10 @@
745906 Recompile();
746907 cameraView.repaint();
747908 // refreshContents();
909
+ }
910
+ else if(e.getSource() == zoomBoxCB)
911
+ {
912
+ cameraView.ToggleZoomBoxMode();
748913 }
749914 else if(e.getSource() == smoothfocusCB)
750915 {
....@@ -859,7 +1024,9 @@
8591024 // objEditor.DropFile((java.io.File[]) object, true);
8601025 // return;
8611026 // }
862
- if (string.charAt(0) == '/')
1027
+
1028
+ // File path for Mac and Windows
1029
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631030 {
8641031 // file(s)
8651032 String[] names = string.split("\n");
....@@ -886,7 +1053,7 @@
8861053
8871054 flashIt = false;
8881055 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1056
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901057 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911058
8921059 if (group.selection.size() == 1)
....@@ -913,11 +1080,11 @@
9131080 {
9141081 loadClipboard(true);
9151082 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
1083
+ pasteInto(false, false);
9171084 } else {
9181085 loadClipboard(false);
9191086 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
1087
+ pasteInto(false, false); // true); // ???
9211088 }
9221089 }
9231090 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1202,37 @@
10351202 torusItem.addActionListener(this);
10361203 superItem = menu.add(new MenuItem("Superellipsoid"));
10371204 superItem.addActionListener(this);
1205
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1206
+ kleinItem.addActionListener(this);
10381207 particleItem = menu.add(new MenuItem("Particle system"));
10391208 particleItem.addActionListener(this);
1209
+ if (Globals.ADVANCED)
1210
+ {
10401211 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411212 ragdollItem.addActionListener(this);
10421213 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431214 ragdoll2Item.addActionListener(this);
1215
+ }
10441216 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1217
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461218 meshItem.addActionListener(this);
10471219 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481220 // meshGroupItem.addActionListener(this);
1221
+ if (Globals.ADVANCED)
1222
+ {
10491223 springItem = menu.add(new MenuItem("Spring"));
10501224 springItem.addActionListener(this);
10511225 flagItem = menu.add(new MenuItem("Flag"));
10521226 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571227 blobItem = menu.add(new MenuItem("Blob"));
10581228 blobItem.addActionListener(this);
10591229 latheItem = menu.add(new MenuItem("Lathe"));
10601230 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);
10611236 lightItem = menu.add(new MenuItem("Light"));
10621237 lightItem.addActionListener(this);
10631238 menu.add("-");
....@@ -1067,39 +1242,44 @@
10671242 loopItem.addActionListener(this);
10681243 doubleItem = menu.add(new MenuItem("Fork"));
10691244 doubleItem.addActionListener(this);
1245
+ if (Globals.ADVANCED)
1246
+ {
10701247 tripleItem = menu.add(new MenuItem("Trident"));
10711248 tripleItem.addActionListener(this);
1249
+ }
10721250 }
10731251
10741252 void buildToolsMenu(Menu menu)
10751253 {
10761254 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771255 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1256
+ animationItem.setState(Globals.ANIMATION);
10791257
10801258 menu.add("-");
10811259 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821260 parseverticesItem.addActionListener(this);
10831261 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841262 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1263
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861264 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891265 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901266 reduceMorphItem.addActionListener(this);
10911267 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921268 reduce34MorphItem.addActionListener(this);
1093
-
1269
+ menu.add("-");
10941270 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951271 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971272
1273
+ if (Globals.ADVANCED)
1274
+ {
1275
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1276
+ mirrorItem.addActionListener(this);
1277
+ menu.add("-");
10981278 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991279 memoryItem.addActionListener(this);
11001280 menu.add(analyzeItem = new MenuItem("Analyze"));
11011281 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
11031283 dumpItem.addActionListener(this);
11041284 // menu.add(pathItem = new MenuItem("From-to path"));
11051285 // pathItem.addActionListener(this);
....@@ -1108,6 +1288,8 @@
11081288 resetParentItem.addActionListener(this);
11091289 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101290 repairParentItem.addActionListener(this);
1291
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1292
+ repairShadowItem.addActionListener(this);
11111293 menu.add(invariantsItem = new MenuItem("Invariants"));
11121294 invariantsItem.addActionListener(this);
11131295 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1297,7 @@
11151297 menu.add("-");
11161298 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171299 editScriptItem.addActionListener(this);
1300
+ }
11181301 }
11191302
11201303 void ScreenFit()
....@@ -1443,9 +1626,9 @@
14431626
14441627 void Overwrite(int mask)
14451628 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1629
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471630 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1631
+ Object3D content = Grafreed.clipboard.get(0);
14491632
14501633 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511634 content = ((cGroup)content).get(0);
....@@ -1468,6 +1651,7 @@
14681651 //
14691652 public void actionPerformed(ActionEvent event) // , Object arg)
14701653 {
1654
+ Object source = event.getSource();
14711655 /*
14721656 if (event.getSource() == nameField)
14731657 {
....@@ -1479,11 +1663,11 @@
14791663 }
14801664 else
14811665 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1666
+ if (source == lookAtItem || source == lookFromItem)
14831667 {
14841668 ScreenFit();
14851669 } else
1486
- if (event.getSource() == switchItem)
1670
+ if (source == switchItem)
14871671 {
14881672 cVector v1 = new cVector();
14891673 cVector v2 = new cVector();
....@@ -1492,11 +1676,11 @@
14921676 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931677 objEditor.cameraView.repaint();
14941678 } else
1495
- if (event.getSource() == rectoidItem)
1679
+ if (source == rectoidItem)
14961680 {
14971681 makeSomething(new Box());
14981682 } else
1499
- if (event.getSource() == particleItem)
1683
+ if (source == particleItem)
15001684 {
15011685 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021686 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1701,9 @@
15171701 applyExample(particleGeom, "SMOKE");
15181702 makeSomething(particleGeom);
15191703 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1704
+ if (source == ragdollItem || source == ragdoll2Item)
15211705 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1706
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231707
15241708 ragdoll.toParent = LA.newMatrix();
15251709 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1721,7 @@
15371721 } else
15381722 /*
15391723 */
1540
- if (event.getSource() == heightFieldItem)
1724
+ if (source == heightFieldItem)
15411725 {
15421726 Object3D obj = new Object3D();
15431727
....@@ -1575,27 +1759,31 @@
15751759
15761760 makeSomething(obj);
15771761 } else
1578
- if (event.getSource() == gridItem)
1762
+ if (source == gridItem)
15791763 {
15801764 makeSomething(new Grid());
15811765 } else
1582
- if (event.getSource() == ellipsoidItem)
1766
+ if (source == ellipsoidItem)
15831767 {
15841768 makeSomething(new Sphere());
15851769 } else
1586
- if (event.getSource() == coneItem)
1770
+ if (source == coneItem)
15871771 {
15881772 makeSomething(new Cone());
15891773 } else
1590
- if (event.getSource() == torusItem)
1774
+ if (source == torusItem)
15911775 {
15921776 makeSomething(new Torus());
15931777 } else
1594
- if (event.getSource() == superItem)
1778
+ if (source == superItem)
15951779 {
15961780 makeSomething(new Superellipsoid());
15971781 } else
1598
- if (event.getSource() == blobItem)
1782
+ if (source == kleinItem)
1783
+ {
1784
+ makeSomething(new Klein());
1785
+ } else
1786
+ if (source == blobItem)
15991787 {
16001788 Blob blob = new Blob();
16011789 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1791,15 @@
16031791 //blob.retile();
16041792 makeSomething(blob);
16051793 } else
1606
- if (event.getSource() == latheItem)
1794
+ if (source == latheItem)
16071795 {
16081796 makeSomething(new Lathe());
16091797 } else
1610
- if (event.getSource() == bezierItem)
1798
+ if (source == bezierItem)
16111799 {
16121800 makeSomething(new BezierSurface());
16131801 } else
1614
- if (event.getSource() == checkerItem)
1802
+ if (source == overlayItem)
16151803 {
16161804 /*
16171805 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1814,7 @@
16261814 */
16271815 makeSomething(new Checker());
16281816 } else
1629
- if (event.getSource() == meshItem)
1817
+ if (source == meshItem)
16301818 {
16311819 Object3D itemtomake = new Object3D();
16321820 Object3D child;
....@@ -1647,35 +1835,35 @@
16471835 makeSomething(child);
16481836 }
16491837 } else
1650
- if (event.getSource() == springItem)
1838
+ if (source == springItem)
16511839 {
16521840 cSpring s = new cSpring();
16531841 s.setup();
16541842 makeSomething(s);
16551843 } else
1656
- if (event.getSource() == flagItem)
1844
+ if (source == flagItem)
16571845 {
16581846 cSpring s = new cFlag();
16591847 s.setup();
16601848 makeSomething(s);
16611849 } else
1662
- if (event.getSource() == lightItem)
1850
+ if (source == lightItem)
16631851 {
16641852 makeSomething(new Light());
16651853 } else
1666
- if (event.getSource() == csgItem)
1854
+ if (source == csgItem)
16671855 {
16681856 group(new CSG());
16691857 } else
1670
- if (event.getSource() == templateItem)
1858
+ if (source == templateItem)
16711859 {
16721860 group(new cTemplate());
16731861 } else
1674
- if (event.getSource() == attributeItem)
1862
+ if (source == attributeItem)
16751863 {
16761864 makeSomething(new Attribute());
16771865 } else
1678
- if (event.getSource() == pointflowItem)
1866
+ if (source == pointflowItem)
16791867 {
16801868 makeSomething(new PointFlow());
16811869 } else
....@@ -1687,7 +1875,7 @@
16871875 } else
16881876 */
16891877
1690
- if (event.getSource() == superLoopItem)
1878
+ if (source == superLoopItem)
16911879 {
16921880 Composite g = new cGroup();
16931881 for (int i=0; i<15; i++)
....@@ -1709,7 +1897,7 @@
17091897
17101898 group(g);
17111899 } else
1712
- if (event.getSource() == loopItem)
1900
+ if (source == loopItem)
17131901 {
17141902 Composite csg = new GroupLeaf();
17151903 csg.count = 5;
....@@ -1718,7 +1906,7 @@
17181906 csg.addChild(child);
17191907 child.addChild(csg);
17201908 } else
1721
- if (event.getSource() == doubleItem)
1909
+ if (source == doubleItem)
17221910 {
17231911 Composite csg = new GroupLeaf();
17241912 csg.count = 5;
....@@ -1730,7 +1918,7 @@
17301918 csg.addChild(child);
17311919 child.addChild(csg);
17321920 } else
1733
- if (event.getSource() == tripleItem)
1921
+ if (source == tripleItem)
17341922 {
17351923 Composite csg = new GroupLeaf();
17361924 csg.count = 4;
....@@ -1745,71 +1933,71 @@
17451933 csg.addChild(child);
17461934 child.addChild(csg);
17471935 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
1936
+ if (source == computeAOItem)
17501937 {
1751
- ImportGFD();
1938
+ Globals.drawMode = CameraPane.OCCLUSION;
1939
+ Globals.theRenderer.repaint();
17521940 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
1941
+ if (source == recompileItem)
17711942 {
17721943 Recompile();
17731944 refreshContents();
17741945 } else
1775
- if (event.getSource() == editScriptItem)
1946
+ if (source == editScriptItem)
17761947 {
17771948 OpenDialog();
17781949 refreshContents();
17791950 } else
1780
- if (event.getSource() == invariantsItem)
1951
+ if (source == invariantsItem)
17811952 {
17821953 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1954
+ Grafreed.grafreeD.universe.invariants();
17841955 } else
1785
- if (event.getSource() == memoryItem)
1956
+ if (source == memoryItem)
17861957 {
17871958 //System.out.println("Invariants:");
17881959 PrintMemory();
17891960 } else
1790
- if (event.getSource() == pathItem)
1961
+ if (source == pathItem)
17911962 {
17921963 PrintPath();
17931964 } else
1794
- if (event.getSource() == analyzeItem)
1965
+ if (source == analyzeItem)
17951966 {
17961967 AnalyzeObject();
17971968 } else
1798
- if (event.getSource() == dumpItem)
1969
+ if (source == dumpItem)
17991970 {
18001971 DumpObject();
18011972 } else
1802
- 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)
18031991 {
18041992 //Reload(lastConverter, lastFilename, true);
18051993 ScreenFit();
18061994 } else
1807
- if (event.getSource() == screenfitpointButton)
1995
+ if (source == screenfitpointButton)
18081996 {
18091997 //Reload(lastConverter, lastFilename, true);
18101998 ScreenFitPoint();
18111999 } else
1812
- if (event.getSource() == snapobjectButton)
2000
+ if (source == snapobjectButton)
18132001 {
18142002 //Reload(lastConverter, lastFilename, true);
18152003 SnapObject();
....@@ -1820,13 +2008,13 @@
18202008 // Recompile();
18212009 // refreshContents();
18222010 // } else
1823
- if (event.getSource() == gcButton)
2011
+ if (source == gcButton)
18242012 {
18252013 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262014 System.gc();
18272015 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282016 } else
1829
- if (event.getSource() == editLeafItem)
2017
+ if (source == editLeafItem)
18302018 {
18312019 Object3D obj;
18322020 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2028,74 @@
18402028 }
18412029 refreshContents(true);
18422030 } else
1843
- if (event.getSource() == openWindowItem)
2031
+ if (source == openWindowItem)
18442032 {
18452033 EditSelection(true);
18462034 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2035
+ if (source == cutItem || source == clearButton)
18482036 {
18492037 loadClipboard(true);
18502038 } else
1851
- if (event.getSource() == duplicateItem)
2039
+ if (source == undoItem)
18522040 {
1853
- 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;
18542050 loadClipboard(false);
18552051 paste(false);
1856
- GrafreeD.clipboard = keep;
2052
+ Grafreed.clipboard = keep;
18572053 } else
1858
- if (event.getSource() == cloneItem)
2054
+ if (source == cloneItem)
18592055 {
18602056 CloneSelection(false);
18612057 } else
1862
- if (event.getSource() == cloneSupportItem)
2058
+ if (source == cloneSupportItem)
18632059 {
18642060 CloneSelection(true);
18652061 } else
1866
- if (event.getSource() == copyItem)
2062
+ if (source == copyItem)
18672063 {
18682064 loadClipboard(false);
18692065 } else
1870
- if (event.getSource() == pasteItem)
2066
+ if (source == pasteItem)
18712067 {
18722068 paste(false);
18732069 } else
1874
- if (event.getSource() == pasteLinkItem)
2070
+ if (source == pasteIntoItem)
18752071 {
1876
- pasteInto(false);
2072
+ pasteInto(true, false);
18772073 } else
1878
- if (event.getSource() == pasteCloneItem)
2074
+ if (source == pasteLinkItem)
18792075 {
1880
- pasteInto(true);
2076
+ pasteInto(false, false);
18812077 } else
1882
- if (event.getSource() == pasteExpandItem)
2078
+ if (source == pasteCloneItem)
2079
+ {
2080
+ pasteInto(true, true);
2081
+ } else
2082
+ if (source == pasteExpandItem)
18832083 {
18842084 paste(true);
18852085 } else
1886
- if (event.getSource() == synchronizeItem)
2086
+ if (source == synchronizeItem)
18872087 {
18882088 Overwrite(Object3D.TRANSFORM);
18892089 } else
1890
- if (event.getSource() == overwriteNameItem)
2090
+ if (source == overwriteNameItem)
18912091 {
18922092 Overwrite(Object3D.NAME);
18932093 } else
1894
- if (event.getSource() == overwriteUVItem)
2094
+ if (source == overwriteUVItem)
18952095 {
18962096 Overwrite(Object3D.UV);
18972097 } else
1898
- if (event.getSource() == overwriteMatItem)
2098
+ if (source == overwriteMatItem)
18992099 {
19002100 /* july 2015
19012101 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2115,7 @@
19152115
19162116 Overwrite(dropAttributes);
19172117 }
1918
- if (event.getSource() == overwriteGeoItem)
2118
+ if (source == overwriteGeoItem)
19192119 {
19202120 Overwrite(Object3D.GEOMETRY);
19212121 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2132,7 @@
19322132 // refreshContents();
19332133 // }
19342134 } else
1935
- if (event.getSource() == generateMeshItem)
2135
+ if (source == generateMeshItem)
19362136 {
19372137 //if (group.selection.size() == 1)
19382138 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2143,7 @@
19432143 ResetModel();
19442144 refreshContents();
19452145 } else
1946
- if (event.getSource() == extractGeometriesItem)
2146
+ if (source == extractGeometriesItem)
19472147 {
19482148 boolean one = false;
19492149
....@@ -1970,7 +2170,7 @@
19702170 ResetModel();
19712171 refreshContents();
19722172 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2173
+ if (source == cloneGeometriesItem)
19742174 {
19752175 boolean one = false;
19762176
....@@ -1996,32 +2196,37 @@
19962196 ResetModel();
19972197 refreshContents();
19982198 } else
1999
- if (event.getSource() == shareGeometriesItem)
2199
+ if (source == shareGeometriesItem)
20002200 {
20012201 boolean one = false;
20022202
20032203 if (group.selection.size() == 1)
20042204 one = true;
20052205
2206
+ Object3D merge = null;
2207
+
20062208 Object3D content = new cGroup();
20072209
20082210 for (int i=0; i<group.selection.size(); i++)
20092211 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2212
+ merge = new Merge(group.selection.get(i));
20112213
20122214 if (one)
2013
- makeSomething(sel, false);
2215
+ makeSomething(merge, false);
20142216 else
2015
- content.addChild(sel);
2217
+ content.addChild(merge);
20162218 }
20172219
20182220 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2221
+ makeSomething(content, true);
2222
+ else
2223
+ {
2224
+ ResetModel();
2225
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2226
+ refreshContents();
2227
+ }
20232228 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2229
+ if (source == mergeGeometriesItem)
20252230 {
20262231 boolean one = false;
20272232
....@@ -2051,7 +2256,7 @@
20512256 ResetModel();
20522257 refreshContents();
20532258 } else
2054
- if (event.getSource() == linkverticesItem)
2259
+ if (source == linkverticesItem)
20552260 {
20562261 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572262 // {
....@@ -2064,39 +2269,48 @@
20642269 // group.selection.get(0).setMasterThis(content); // should be identity
20652270 // refreshContents();
20662271 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2272
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682273 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2274
+ Object3D content = Grafreed.clipboard.get(0);
20702275
20712276 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722277 content = ((cGroup)content).get(0);
20732278
2074
- 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));
20752280 for (int i=0; i<group.selection.size(); i++)
20762281 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2282
+ boolean random = CameraPane.SWITCH;
2283
+ CameraPane.SWITCH = false; // parse all random nodes
20792284 group.selection.get(i).linkVerticesThis(content);
20802285 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2286
+ CameraPane.SWITCH = random;
20822287 }
2083
- 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));
20842289 refreshContents();
20852290 }
20862291 } else
2087
- if (event.getSource() == resetsupportItem)
2292
+ if (source == resetsupportItem)
20882293 {
20892294 for (int i=0; i<group.selection.size(); i++)
20902295 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2296
+ boolean random = CameraPane.SWITCH;
2297
+ CameraPane.SWITCH = false; // parse all random nodes
20932298 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2299
+ CameraPane.SWITCH = random;
20952300 }
20962301
20972302 refreshContents();
20982303 } else
2099
- 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)
21002314 {
21012315 for (int i=0; i<group.selection.size(); i++)
21022316 {
....@@ -2105,11 +2319,11 @@
21052319
21062320 refreshContents();
21072321 } else
2108
- if (event.getSource() == setMasterItem)
2322
+ if (source == setMasterItem)
21092323 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2324
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112325 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2326
+ Object3D content = Grafreed.clipboard.get(0);
21132327
21142328 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152329 content = ((cGroup)content).get(0);
....@@ -2118,13 +2332,13 @@
21182332 refreshContents();
21192333 }
21202334 } else
2121
- if (event.getSource() == poseMeshItem)
2335
+ if (source == poseMeshItem)
21222336 {
21232337 if (group.selection.size() == 1)
21242338 {
2125
- if (GrafreeD.clipboard.size() == 1)
2339
+ if (Grafreed.clipboard.size() == 1)
21262340 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
21282342
21292343 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302344 content = ((cGroup)content).get(0);
....@@ -2137,19 +2351,19 @@
21372351 }
21382352
21392353 } else
2140
- if (event.getSource() == revertMeshItem)
2354
+ if (source == revertMeshItem)
21412355 {
21422356 RevertMeshes();
21432357 } else
2144
- if (event.getSource() == resetMeshItem)
2358
+ if (source == resetAllItem)
21452359 {
21462360 ResetAll();
21472361 } else
2148
- if (event.getSource() == stepAllItem)
2362
+ if (source == stepAllItem)
21492363 {
21502364 StepAll();
21512365 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2366
+ if (source == clearItem) // || event.getSource() == clearButton)
21532367 {
21542368 //int indices[] = jList.getSelectedIndices();
21552369 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2371,46 @@
21572371
21582372 ClearSelection(false);
21592373 } else
2160
- if (event.getSource() == clearAllItem)
2374
+ if (source == clearAllItem)
21612375 {
21622376 ClearSelection(true);
21632377 } else
2164
- if (event.getSource() == grabItem)
2378
+ if (source == grabItem)
21652379 {
21662380 group(new cGroup(), true);
21672381 } else
2168
- if (event.getSource() == frontItem)
2382
+ if (source == hideItem)
2383
+ {
2384
+ group(new HiddenObject());
2385
+ } else
2386
+ if (source == frontItem)
21692387 {
21702388 front();
21712389 } else
2172
- if (event.getSource() == backItem)
2390
+ if (source == backItem)
21732391 {
21742392 back();
21752393 } else
2176
- if (event.getSource() == cameraItem)
2394
+ if (source == cameraItem)
21772395 {
21782396 makeSomething(new Camera());
21792397 } else
2180
- if (event.getSource() == compositeItem)
2398
+ if (source == compositeItem)
21812399 {
21822400 group(new Composite());
21832401 } else
2184
- if (event.getSource() == randomItem)
2402
+ if (source == randomItem)
21852403 {
21862404 RandomNode random = new RandomNode();
21872405 group(random);
21882406 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2407
+ random.name = random.get(0).name + "Switch";
21902408 } else
2191
- if (event.getSource() == physicsItem)
2409
+ if (source == physicsItem)
21922410 {
21932411 group(new PhysicsNode());
21942412 } else
2195
- if (event.getSource() == frameselectorItem)
2413
+ if (source == frameselectorItem)
21962414 {
21972415 for (int i=0; i<group.selection.size(); i++)
21982416 {
....@@ -2204,7 +2422,7 @@
22042422 ResetModel();
22052423 refreshContents();
22062424 } else
2207
- if (event.getSource() == switchGeoItem)
2425
+ if (source == switchGeoItem)
22082426 {
22092427 for (int i=0; i<group.selection.size(); i++)
22102428 {
....@@ -2216,7 +2434,7 @@
22162434 ResetModel();
22172435 refreshContents();
22182436 } else
2219
- if (event.getSource() == switchTransfoItem)
2437
+ if (source == switchTransfoItem)
22202438 {
22212439 for (int i=0; i<group.selection.size(); i++)
22222440 {
....@@ -2228,7 +2446,7 @@
22282446 ResetModel();
22292447 refreshContents();
22302448 } else
2231
- if (event.getSource() == morphItem)
2449
+ if (source == morphItem)
22322450 {
22332451 for (int i=0; i<group.selection.size(); i++)
22342452 {
....@@ -2240,7 +2458,7 @@
22402458 ResetModel();
22412459 refreshContents();
22422460 } else
2243
- if (event.getSource() == scriptNodeItem)
2461
+ if (source == scriptNodeItem)
22442462 {
22452463 boolean atleastone = false;
22462464
....@@ -2279,199 +2497,223 @@
22792497 }
22802498 }
22812499 } else
2282
- if (event.getSource() == linkerItem)
2500
+ if (source == linkerItem)
22832501 {
22842502 group(new cLinker());
22852503 } else
2286
- if (event.getSource() == textureItem)
2504
+ if (source == textureItem)
22872505 {
22882506 group(new TextureNode());
22892507 } else
2290
- if (event.getSource() == shadowXItem)
2508
+ if (source == billboardItem)
2509
+ {
2510
+ group(new BillboardNode());
2511
+ } else
2512
+ if (source == shadowXItem)
22912513 {
22922514 CastShadow(0);
22932515 } else
2294
- if (event.getSource() == shadowYItem)
2516
+ if (source == shadowYItem)
22952517 {
22962518 CastShadow(1);
22972519 } else
2298
- if (event.getSource() == shadowZItem)
2520
+ if (source == shadowZItem)
22992521 {
23002522 CastShadow(2);
23012523 } else
2302
- if (event.getSource() == ungroupItem)
2524
+ if (source == ungroupItem)
23032525 {
2304
- 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();
23052535 } else
2306
- if (event.getSource() == genUVItem)
2536
+ if (source == genUVItem)
23072537 {
23082538 GenUV();
23092539 } else
2310
- if (event.getSource() == genNormalsCADItem)
2540
+ if (source == genNormalsCADItem)
23112541 {
23122542 GenNormals(true);
23132543 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2544
+ if (source == genNormalsMESHItem)
23152545 {
2316
- GenNormals(true); // TODO
2546
+ GenNormalsMESH();
23172547 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2548
+ if (source == genNormalsORGANItem)
23192549 {
23202550 GenNormals(false);
23212551 } else
2322
- if (event.getSource() == stripifyItem)
2552
+ if (source == genNormalsMINEItem)
2553
+ {
2554
+ GenNormalsMINE();
2555
+ } else
2556
+ if (source == stripifyItem)
23232557 {
23242558 Stripify();
23252559 } else
2326
- if (event.getSource() == unstripifyItem)
2560
+ if (source == unstripifyItem)
23272561 {
23282562 Unstripify();
23292563 } else
2330
- if (event.getSource() == trimItem)
2564
+ if (source == trimItem)
23312565 {
23322566 Trim();
23332567 } else
2334
- if (event.getSource() == untrimItem)
2568
+ if (source == untrimItem)
23352569 {
23362570 Untrim();
23372571 } else
2338
- if (event.getSource() == clearColorsItem)
2572
+ if (source == clearColorsItem)
23392573 {
23402574 ClearColors();
23412575 } else
2342
- if (event.getSource() == clearMaterialsItem)
2576
+ if (source == clearMaterialsItem)
23432577 {
23442578 ClearMaterials();
23452579 } else
2346
- if (event.getSource() == liveleavesItem)
2580
+ if (source == liveleavesItem)
23472581 {
23482582 LiveLeaves(true);
23492583 } else
2350
- if (event.getSource() == unliveleavesItem)
2584
+ if (source == unliveleavesItem)
23512585 {
23522586 LiveLeaves(false);
23532587 } else
2354
- if (event.getSource() == supportleavesItem)
2588
+ if (source == supportleavesItem)
23552589 {
23562590 SupportLeaves(true);
23572591 } else
2358
- if (event.getSource() == unsupportleavesItem)
2592
+ if (source == unsupportleavesItem)
23592593 {
23602594 SupportLeaves(false);
23612595 } else
2362
- if (event.getSource() == hideleavesItem)
2596
+ if (source == hideleavesItem)
23632597 {
23642598 HideLeaves(true);
23652599 } else
2366
- if (event.getSource() == showleavesItem)
2600
+ if (source == showleavesItem)
23672601 {
23682602 HideLeaves(false);
23692603 } else
2370
- if (event.getSource() == markleavesItem)
2604
+ if (source == markleavesItem)
23712605 {
23722606 MarkLeaves(true);
23732607 } else
2374
- if (event.getSource() == unmarkleavesItem)
2608
+ if (source == unmarkleavesItem)
23752609 {
23762610 MarkLeaves(false);
23772611 } else
2378
- if (event.getSource() == flipVItem)
2612
+ if (source == flipVItem)
23792613 {
23802614 FlipV(true);
23812615 } else
2382
- if (event.getSource() == unflipVItem)
2616
+ if (source == unflipVItem)
23832617 {
23842618 FlipV(false);
23852619 } else
2386
- if (event.getSource() == lowTexturesItem)
2620
+ if (source == lowTexturesItem)
23872621 {
23882622 SetTexRes(0);
23892623 } else
2390
- if (event.getSource() == normalTexturesItem)
2624
+ if (source == normalTexturesItem)
23912625 {
23922626 SetTexRes(1);
23932627 } else
2394
- if (event.getSource() == highTexturesItem)
2628
+ if (source == highTexturesItem)
23952629 {
23962630 SetTexRes(2);
23972631 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2632
+ if (source == veryhighTexturesItem)
23992633 {
24002634 SetTexRes(3);
24012635 } else
2402
- if (event.getSource() == maxTexturesItem)
2636
+ if (source == maxTexturesItem)
24032637 {
24042638 SetTexRes(4);
24052639 } else
2406
- if (event.getSource() == panoTexturesItem)
2640
+ if (source == panoTexturesItem)
24072641 {
24082642 SetTexRes(5);
24092643 } else
2410
- if (event.getSource() == reverseNormalsItem)
2644
+ if (source == reverseNormalsItem)
24112645 {
24122646 ReverseNormals();
24132647 } else
2414
- if (event.getSource() == parseverticesItem)
2648
+ if (source == parseverticesItem)
24152649 {
24162650 ParseVertices();
24172651 } else
2418
- if (event.getSource() == textureFieldItem)
2652
+ if (source == textureFieldItem)
24192653 {
24202654 TextureVertices();
24212655 } else
2422
- if (event.getSource() == alignItem)
2656
+ if (source == alignItem)
24232657 {
24242658 Align();
24252659 } else
2426
- if (event.getSource() == mirrorItem)
2660
+ if (source == mirrorItem)
24272661 {
24282662 MirrorPoses();
24292663 } else
2430
- if (event.getSource() == reduceMorphItem)
2664
+ if (source == reduceMorphItem)
24312665 {
24322666 MeshReduction(false);
24332667 } else
2434
- if (event.getSource() == reduce34MorphItem)
2668
+ if (source == reduce34MorphItem)
24352669 {
24362670 MeshReduction(true);
24372671 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2672
+ if (source == reverseTrianglesItem)
24392673 {
24402674 ReverseTriangles();
24412675 } else
2442
- if (event.getSource() == reduceMeshItem)
2676
+ if (source == reduceMeshItem)
24432677 {
24442678 ReduceMesh(false);
24452679 } else
2446
- if (event.getSource() == reduce34MeshItem)
2680
+ if (source == reduce34MeshItem)
24472681 {
24482682 ReduceMesh(true);
24492683 } else
2450
- if (event.getSource() == increaseMeshItem)
2684
+ if (source == increaseMeshItem)
24512685 {
24522686 IncreaseMesh();
24532687 } else
2454
- if (event.getSource() == clipMeshItem)
2688
+ if (source == clipMeshItem)
24552689 {
24562690 ClipMesh();
24572691 } else
2458
- if (event.getSource() == smoothMeshItem)
2692
+ if (source == smoothMeshItem)
24592693 {
24602694 SmoothMesh();
24612695 } else
2462
- if (event.getSource() == transformgeometryItem)
2696
+ if (source == transformGeometryItem)
24632697 {
24642698 TransformGeometry();
24652699 } else
2466
- if (event.getSource() == resetTransformItem)
2700
+ if (source == transformChildrenItem)
2701
+ {
2702
+ TransformChildren();
2703
+ } else
2704
+ if (source == resetTransformItem)
24672705 {
24682706 ResetTransform();
24692707 } else
2470
- if (event.getSource() == resetCentroidItem)
2708
+ if (source == resetCentroidItem)
24712709 {
2472
- ResetCentroid();
2710
+ ResetCentroid(true);
24732711 } else
2474
- if (event.getSource() == resetParentItem)
2712
+ if (source == resetCentroidXZItem)
2713
+ {
2714
+ ResetCentroid(false);
2715
+ } else
2716
+ if (source == resetParentItem)
24752717 {
24762718 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772719 {
....@@ -2481,7 +2723,7 @@
24812723
24822724 refreshContents();
24832725 } else
2484
- if (event.getSource() == repairParentItem)
2726
+ if (source == repairParentItem)
24852727 {
24862728 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872729 {
....@@ -2495,7 +2737,21 @@
24952737
24962738 refreshContents();
24972739 } else
2498
- 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)
24992755 {
25002756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012757 {
....@@ -2507,7 +2763,7 @@
25072763 ResetModel();
25082764 refreshContents();
25092765 } else
2510
- if (event.getSource() == sortbynameItem)
2766
+ if (source == sortbynameItem)
25112767 {
25122768 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132769 {
....@@ -2519,7 +2775,7 @@
25192775 ResetModel();
25202776 refreshContents();
25212777 } else
2522
- if (event.getSource() == attachPigmentItem)
2778
+ if (source == attachPigmentItem)
25232779 {
25242780 String texture = GetFile("Attach pigment");
25252781 Object3D obj;
....@@ -2531,7 +2787,7 @@
25312787
25322788 refreshContents();
25332789 } else
2534
- if (event.getSource() == detachPigmentItem)
2790
+ if (source == detachPigmentItem)
25352791 {
25362792 Object3D obj;
25372793 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2798,7 @@
25422798
25432799 refreshContents();
25442800 } else
2545
- if (event.getSource() == attachBumpItem)
2801
+ if (source == attachBumpItem)
25462802 {
25472803 String texture = GetFile("Attach bump");
25482804 Object3D obj;
....@@ -2554,7 +2810,7 @@
25542810
25552811 refreshContents();
25562812 } else
2557
- if (event.getSource() == detachBumpItem)
2813
+ if (source == detachBumpItem)
25582814 {
25592815 Object3D obj;
25602816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2821,7 @@
25652821
25662822 refreshContents();
25672823 } else
2568
- if (event.getSource() == pigmentBumpItem)
2824
+ if (source == pigmentBumpItem)
25692825 {
25702826 Object3D obj;
25712827 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2832,195 @@
25762832
25772833 refreshContents();
25782834 } else
2579
- if (event.getSource() == flashSelectionButton)
2835
+ if (source == flashSelectionButton)
25802836 {
25812837 CameraPane.flash = true;
25822838 refreshContents();
25832839 } else
2584
- if (event.getSource() == oneButton)
2840
+ if (source == oneButton)
25852841 {
25862842 } else
2587
- if (event.getSource() == twoButton)
2843
+ if (source == twoButton)
25882844 {
25892845 radio.layout = twoButton;
25902846 // bug
25912847 //gridPanel.setDividerLocation(1.0);
25922848 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
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();
26172878 } else
2618
- if (event.getSource() == threeButton)
2879
+ if (source == threeButton)
26192880 {
26202881 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
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();
26452914 } else
2646
- if (event.getSource() == fourButton)
2915
+ if (source == fourButton)
26472916 {
26482917 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
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();
26732949 } else
2674
- if (event.getSource() == sixButton)
2950
+ if (source == sixButton)
26752951 {
26762952 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
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();
27012985 } else
2702
- if (event.getSource() == sevenButton)
2986
+ if (source == sevenButton)
27032987 {
27042988 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
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();
27293022 } else
2730
- if (event.getSource() == rootButton)
3023
+ if (source == rootButton)
27313024 {
27323025 Object3D obj;
27333026 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +3032,7 @@
27393032
27403033 refreshContents(true);
27413034 } else
2742
- if (event.getSource() == closeButton)
3035
+ if (source == closeButton)
27433036 {
27443037 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453038 cRadio ab;
....@@ -2760,11 +3053,11 @@
27603053 }
27613054 refreshContents(true);
27623055 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3056
+ if (source == editItem || source == editButton)
27643057 {
27653058 EditSelection(false);
27663059 } else
2767
- if (event.getSource() == uneditButton)
3060
+ if (source == uneditButton)
27683061 {
27693062 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703063 {
....@@ -2774,14 +3067,14 @@
27743067 child.CloseUI();
27753068 listUI.remove(child);
27763069
2777
- child.editWindow = null; // ???????????
3070
+ //child.editWindow = null; // ???????????
27783071 }
2779
- objEditor.ctrlPanel.revalidate();
3072
+ objEditor.ctrlPanel.FlushUI();
27803073 //objEditor.jTree.clearSelection();
27813074 //objEditor.ResetSliders();
27823075 refreshContents(true);
27833076 } else
2784
- if (event.getSource() == clearPanelButton)
3077
+ if (source == clearPanelButton)
27853078 {
27863079 assert(copy == group);
27873080 //copy.ClearUI();
....@@ -2792,7 +3085,7 @@
27923085 listUI.clear();
27933086 refreshContents(true);
27943087 } else
2795
- if (event.getSource() == allParamsButton)
3088
+ if (source == allParamsButton)
27963089 {
27973090 assert(copy == group);
27983091
....@@ -2813,19 +3106,19 @@
28133106
28143107 refreshContents(true);
28153108 } else
2816
- if (event.getSource() == unselectButton)
3109
+ if (source == unselectButton)
28173110 {
28183111 objEditor.jTree.clearSelection();
28193112 // ?? oct 2012 GrafreeD.clipboard.clear();
28203113 objEditor.ResetSliders();
28213114 refreshContents(true);
28223115 } else
2823
- if(event.getSource() instanceof cRadio)
3116
+ if(source instanceof cRadio)
28243117 {
28253118 group.parent = keepparent;
28263119 group.attributes = 0;
28273120 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3121
+ /*cRadio*/ radio = (cRadio)source;
28293122 Object3D obj = radio.GetObject();
28303123 System.out.println("Edit " + obj);
28313124 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3138,7 @@
28453138 }
28463139
28473140 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3141
+ //Globals.theRenderer.object = group;
28493142 if(!useclient)
28503143 {
28513144 cameraView.renderCamera = radio.camera;
....@@ -2854,12 +3147,16 @@
28543147 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553148 cameraView.targetLookAt.set(radio.camera.lookAt);
28563149 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3150
+ //cameraView.lighttouched = true;
3151
+ Globals.lighttouched = true;
28583152 topView.object = group;
28593153 frontView.object = group;
28603154 sideView.object = group;
28613155 }
3156
+
3157
+// fix "+" issue
28623158 group.editWindow = this;
3159
+
28633160 /*
28643161 currentLayout = radio.layout;
28653162 if (currentLayout == null)
....@@ -2872,7 +3169,20 @@
28723169 //group.attributes = -1;
28733170 ResetModel();
28743171 refreshContents(true);
2875
- }
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
+ }
28763186 else
28773187 {
28783188 //return super.action(event, arg);
....@@ -2890,7 +3200,7 @@
28903200 if (useclient)
28913201 {
28923202 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3203
+ Globals.lighttouched = true;
28943204 //topView.object = client;
28953205 //frontView.object = client;
28963206 //sideView.object = client;
....@@ -2898,7 +3208,7 @@
28983208 else
28993209 {
29003210 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3211
+ Globals.lighttouched = true;
29023212 //topView.object = group;
29033213 //frontView.object = group;
29043214 //sideView.object = group;
....@@ -2933,6 +3243,28 @@
29333243 refreshContents();
29343244 }
29353245
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
+ }
29363268
29373269 void ResetTransform()
29383270 {
....@@ -3045,7 +3377,7 @@
30453377 refreshContents();
30463378 }
30473379
3048
- void ResetCentroid()
3380
+ void ResetCentroid(boolean full)
30493381 {
30503382 Object3D obj;
30513383 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3392,16 @@
30603392 LA.matIdentity(Object3D.mat);
30613393 obj.getBounds(minima, maxima, false);
30623394 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3395
+ if (full)
3396
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643397 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653398 obj.TransformMesh(Object3D.mat);
3399
+
30663400 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3401
+ if (full)
3402
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683403 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3404
+
30693405 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703406 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713407 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3430,8 @@
30943430
30953431 int size = obj.MemorySize();
30963432
3097
- 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)");
30983435 }
30993436 }
31003437 catch (Exception e)
....@@ -3131,9 +3468,9 @@
31313468 obj = (Object3D)e.nextElement();
31323469
31333470 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3471
+ Grafreed.AnalyzeObject(obj);
31353472 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3473
+ Grafreed.AnalyzeObject(obj.bRep);
31373474
31383475 // System.err.println((size/1024) + " KB is the size of " + obj);
31393476 }
....@@ -3175,6 +3512,20 @@
31753512 void GenNormals(boolean crease)
31763513 {
31773514 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();
31783529
31793530 refreshContents();
31803531 }
....@@ -3340,8 +3691,8 @@
33403691
33413692 void ParseVertices()
33423693 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
3694
+ boolean epsequal = Grafreed.epsequal;
3695
+ Grafreed.epsequal = true;
33453696
33463697 for (int i=0; i<group.selection.size(); i++)
33473698 {
....@@ -3366,7 +3717,7 @@
33663717 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33673718 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33683719
3369
- g.add(GrafreeD.clipboard);
3720
+ g.add(Grafreed.clipboard);
33703721
33713722 buffer.add(g);
33723723 }
....@@ -3381,7 +3732,7 @@
33813732 makeSomething(buffer, i==group.selection.size()-1);
33823733 }
33833734
3384
- GrafreeD.epsequal = epsequal;
3735
+ Grafreed.epsequal = epsequal;
33853736
33863737 refreshContents();
33873738 }
....@@ -3399,7 +3750,16 @@
33993750 String pigment = Object3D.GetPigment(tex);
34003751 //String bump = Object3D.GetBump(tex);
34013752
3402
- 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
+ }
34033763
34043764 double s = v.s;
34053765
....@@ -3447,12 +3807,26 @@
34473807
34483808 void Align()
34493809 {
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
+
34503824 for (int i=0; i<group.selection.size(); i++)
34513825 {
34523826 Object3D obj = group.selection.get(i);
34533827
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- 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);
34563830 }
34573831
34583832 refreshContents();
....@@ -3473,11 +3847,11 @@
34733847
34743848 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753849
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3850
+ boolean random = CameraPane.SWITCH;
3851
+ CameraPane.SWITCH = false; // parse all random nodes
34783852 lowres.linkVerticesThis(null);
34793853 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3854
+ CameraPane.SWITCH = random;
34813855
34823856 System.err.flush();
34833857
....@@ -3517,7 +3891,7 @@
35173891 return;
35183892
35193893 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
3894
+ Object3D ref = Grafreed.clipboard.get(0);
35213895
35223896 Object3D newgroup = new Object3D("Po:" + poses.name);
35233897
....@@ -3686,7 +4060,7 @@
36864060 group.selection.RelinkToSupport(); // july 2014
36874061 System.out.println("DONE.");
36884062 refreshContents();
3689
- 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));
36904064 }
36914065
36924066 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4085,9 @@
37114085
37124086 void ClipMesh()
37134087 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4088
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154089 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4090
+ Object3D content = Grafreed.clipboard.get(0);
37174091
37184092 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194093 content = ((cGroup)content).get(0);
....@@ -3722,7 +4096,7 @@
37224096 // {
37234097 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244098 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4099
+ group.selection.ClipMesh(Grafreed.clipboard);
37264100 }
37274101 // group.selection.ClipMesh(GrafreeD.clipboard);
37284102 System.out.println("DONE.");
....@@ -3857,7 +4231,7 @@
38574231 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584232
38594233 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4234
+ if(elem != group || !newWindow)
38614235 {
38624236 // if (!(elem instanceof Composite))
38634237 // newWindow = false;
....@@ -3947,7 +4321,6 @@
39474321 //case 702: // Event.LIST_DESELECT
39484322 group.deselectAll();
39494323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514324 if (tps != null)
39524325 {
39534326 for (int i=0; i < tps.length; i++)
....@@ -3957,30 +4330,28 @@
39574330 //if (child.parent != null)
39584331 //child.parent.addSelectee(child);
39594332 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634333 }
39644334 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4335
+// else
4336
+// {
4337
+// objEditor.SetMaterial(group); // .GetMaterial());
4338
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4339
+// System.err.println("info : " + group.GetPath());
4340
+// }
39714341
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4342
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39754343 CameraPane.flash = true;
39764344
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4345
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784346 // a camera
39794347 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4348
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4349
+ {
4350
+ CameraPane.camerachangeframe = 0; // don't refuse it
4351
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4352
+ }
4353
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4354
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844355 }
39854356
39864357 refreshContents();
....@@ -3991,6 +4362,29 @@
39914362
39924363 freezemodel = false;
39934364 }
4365
+
4366
+ void refreshContents(boolean cp)
4367
+ {
4368
+ if (!Globals.MOUSEDRAGGED)
4369
+ {
4370
+ objEditor.ClearInfo(); // .GetMaterial());
4371
+
4372
+ for (int i=0; i < group.selection.size(); i++)
4373
+ {
4374
+ Object3D child = (Object3D) group.selection.reserve(i);
4375
+
4376
+ objEditor.SetMaterial(child);
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+
4380
+ group.selection.release(i);
4381
+ }
4382
+
4383
+ objEditor.SetText(); // jan 2014
4384
+ }
4385
+
4386
+ super.refreshContents(cp);
4387
+ }
39944388
39954389 void linkSomething(Object3D thing)
39964390 {
....@@ -4062,16 +4456,18 @@
40624456 {
40634457 if (group.selection.isEmpty())
40644458 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4459
+
4460
+ Grafreed.clipboardIsTempGroup = false;
40664461 Composite tGroup = null;
40674462 if (group.selection.size() > 0) // 1)
40684463 {
40694464 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4465
+ Grafreed.clipboardIsTempGroup = true;
40714466 }
40724467
40734468 if (cut)
40744469 {
4470
+ Save();
40754471 //int indices[] = jList.getSelectedIndices();
40764472 //for (int i = indices.length - 1; i >= 0; i--)
40774473 //jList.remove(indices[i]);
....@@ -4107,16 +4503,16 @@
41074503 //System.out.println("cut " + child);
41084504 //System.out.println("parent = " + child.parent);
41094505 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4506
+ if (Grafreed.clipboardIsTempGroup)
41114507 tGroup.add/*Child*/(tmp);
41124508 else
4113
- GrafreeD.clipboard = tmp;
4509
+ Grafreed.clipboard = tmp;
41144510 }
41154511 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4512
+ if (Grafreed.clipboardIsTempGroup)
41174513 tGroup.add/*Child*/(child);
41184514 else
4119
- GrafreeD.clipboard = child;
4515
+ Grafreed.clipboard = child;
41204516 }
41214517
41224518 //ResetModel();
....@@ -4148,21 +4544,23 @@
41484544 //System.out.println("cut " + elem);
41494545 //System.out.println("parent = " + elem.parent);
41504546 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4547
+ if (Grafreed.clipboardIsTempGroup)
41524548 tGroup.add/*Child*/(tmp);
41534549 else
4154
- GrafreeD.clipboard = tmp;
4550
+ Grafreed.clipboard = tmp;
41554551 }
41564552 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4553
+ if (Grafreed.clipboardIsTempGroup)
41584554 tGroup.add/*Child*/(child);
41594555 else
4160
- GrafreeD.clipboard = child;
4556
+ Grafreed.clipboard = child;
41614557 }
41624558
41634559 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4560
+
4561
+ if (Grafreed.clipboardIsTempGroup)
4562
+ Grafreed.clipboard = tGroup;
4563
+
41664564 if (cut)
41674565 {
41684566 ResetModel();
....@@ -4176,7 +4574,7 @@
41764574 // return;
41774575 boolean first = true;
41784576
4179
- if (GrafreeD.clipboardIsTempGroup)
4577
+ if (Grafreed.clipboardIsTempGroup)
41804578 {
41814579 Composite temp;
41824580
....@@ -4187,7 +4585,7 @@
41874585 temp = (Composite)Applet3D.clipboard.deepCopy();
41884586 */
41894587 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4588
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41914589 {
41924590 Object3D child = (Object3D)e.nextElement();
41934591
....@@ -4221,21 +4619,21 @@
42214619 //Object3D cb = Applet3D.clipboard;
42224620 //temp.addChild(cb);
42234621 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4622
+ assert(Grafreed.clipboard.parent == null);
4623
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4624
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4625
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4626
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42294627 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4628
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4629
+ Grafreed.clipboard.get(0).parent = keepparent;
42324630 }
42334631
42344632 ResetModel();
42354633 refreshContents();
42364634 }
42374635
4238
- void pasteInto(boolean copyit)
4636
+ void pasteInto(boolean copyit, boolean clone)
42394637 {
42404638 // if (GrafreeD.clipboard == null)
42414639 // return;
....@@ -4264,15 +4662,22 @@
42644662 if (copyit)
42654663 {
42664664 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4665
+ if (clone)
4666
+ {
4667
+ CloneClipboard(false); // sept 2014
4668
+ }
4669
+ else
4670
+ {
4671
+ paste(false);
4672
+ }
42684673 }
42694674 else
42704675 {
42714676 boolean first = true;
42724677
4273
- if (GrafreeD.clipboardIsTempGroup)
4678
+ if (Grafreed.clipboardIsTempGroup)
42744679 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
4680
+ Composite temp = (Composite)Grafreed.clipboard;
42764681 Object3D copy;
42774682 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42784683 {
....@@ -4282,7 +4687,7 @@
42824687 }
42834688 } else
42844689 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
4690
+ linkSomething(Grafreed.clipboard); //.get(0));
42864691 }
42874692 }
42884693 }
....@@ -4474,6 +4879,26 @@
44744879 makeSomething(csg);
44754880 }
44764881
4882
+ void Ungroup(Object3D g)
4883
+ {
4884
+ if (g instanceof HiddenObject)
4885
+ {
4886
+ HiddenObject h = (HiddenObject) g;
4887
+
4888
+ for (int i=0; i<h.ActualSize(); i++)
4889
+ {
4890
+ objEditor.makeSomething(h.get(i), false);
4891
+ }
4892
+ }
4893
+ else
4894
+ {
4895
+ for (int i=0; i<g.Size(); i++)
4896
+ {
4897
+ objEditor.makeSomething(g.get(i), false);
4898
+ }
4899
+ }
4900
+ }
4901
+
44774902 void ungroup()
44784903 {
44794904 /*
....@@ -4667,21 +5092,6 @@
46675092 }
46685093 */
46695094
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855095 /*
46865096 public void Callback(Object obj)
46875097 {
....@@ -4705,26 +5115,9 @@
47055115 }
47065116 */
47075117
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255118 String GetFile(String dialogName)
47265119 {
4727
- if (GrafreeD.standAlone)
5120
+ if (Grafreed.standAlone)
47285121 {
47295122 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305123 browser.show();
....@@ -4788,10 +5181,15 @@
47885181 cButton flashSelectionButton;
47895182 cButton editButton;
47905183 cButton uneditButton;
5184
+ JCheckBox allParamsButton;
47915185 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935186 cButton unselectButton;
47945187
5188
+ cButton saveButton;
5189
+ cButton undoButton;
5190
+ cButton redoButton;
5191
+ cButton oneStepButton;
5192
+
47955193 cButton screenfitButton;
47965194 cButton screenfitpointButton;
47975195 cButton snapobjectButton;
....@@ -4822,6 +5220,8 @@
48225220 private MenuItem lookFromItem;
48235221 private MenuItem switchItem;
48245222 private MenuItem cutItem;
5223
+ private MenuItem undoItem;
5224
+ private MenuItem redoItem;
48255225 private MenuItem duplicateItem;
48265226 private MenuItem cloneItem;
48275227 private MenuItem cloneSupportItem;
....@@ -4833,8 +5233,9 @@
48335233 private MenuItem resetsupportItem;
48345234 private MenuItem resetreferencesItem;
48355235 private MenuItem linkverticesItem;
5236
+ private MenuItem relinkverticesItem;
48365237 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5238
+ private MenuItem resetAllItem;
48385239 private MenuItem stepAllItem;
48395240 private MenuItem revertMeshItem;
48405241 private MenuItem poseMeshItem;
....@@ -4845,6 +5246,7 @@
48455246 private MenuItem mergeGeometriesItem;
48465247 private MenuItem copyItem;
48475248 private MenuItem pasteItem;
5249
+ private MenuItem pasteIntoItem;
48485250 private MenuItem pasteLinkItem;
48495251 private MenuItem pasteCloneItem;
48505252 private MenuItem pasteExpandItem;
....@@ -4854,6 +5256,7 @@
48545256 private MenuItem genNormalsMESHItem;
48555257 private MenuItem genNormalsCADItem;
48565258 private MenuItem genNormalsORGANItem;
5259
+ private MenuItem genNormalsMINEItem;
48575260 private MenuItem stripifyItem;
48585261 private MenuItem unstripifyItem;
48595262 private MenuItem trimItem;
....@@ -4893,8 +5296,11 @@
48935296 private MenuItem panoTexturesItem;
48945297
48955298 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5299
+ private MenuItem resetCentroidXZItem;
48975300 private MenuItem resetTransformItem;
5301
+ private MenuItem transformGeometryItem;
5302
+ private MenuItem transformChildrenItem;
5303
+ private MenuItem hideItem;
48985304 private MenuItem grabItem;
48995305 private MenuItem backItem;
49005306 private MenuItem frontItem;
....@@ -4915,6 +5321,7 @@
49155321
49165322 private MenuItem resetParentItem;
49175323 private MenuItem repairParentItem;
5324
+ private MenuItem repairShadowItem;
49185325 private MenuItem sortbysizeItem;
49195326 private MenuItem sortbynameItem;
49205327
....@@ -4935,10 +5342,11 @@
49355342 private MenuItem coneItem;
49365343 private MenuItem torusItem;
49375344 private MenuItem superItem;
5345
+ private MenuItem kleinItem;
49385346 private MenuItem blobItem;
49395347 private MenuItem latheItem;
49405348 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5349
+ private MenuItem overlayItem;
49425350 private MenuItem meshItem;
49435351 // private MenuItem meshGroupItem;
49445352 private MenuItem springItem;
....@@ -4947,6 +5355,7 @@
49475355 private MenuItem csgItem;
49485356 private MenuItem templateItem;
49495357 private MenuItem textureItem;
5358
+ private MenuItem billboardItem;
49505359 private MenuItem shadowXItem;
49515360 private MenuItem shadowYItem;
49525361 private MenuItem shadowZItem;
....@@ -4959,11 +5368,6 @@
49595368 private MenuItem doubleItem;
49605369 private MenuItem tripleItem;
49615370
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675371 private MenuItem computeAOItem;
49685372 private MenuItem recompileItem;
49695373 private MenuItem editScriptItem;
....@@ -4973,4 +5377,8 @@
49735377 private MenuItem analyzeItem;
49745378 private MenuItem dumpItem;
49755379 //boolean freezemodel = false;
5380
+
5381
+ Menu cameraMenu;
5382
+ MenuItem editCameraItem;
5383
+ MenuItem revertCameraItem;
49765384 }