Normand Briere
2019-06-09 c5b599b48b333b34e554b464aefbca0b9bc66275
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);
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.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(GraphreeD.clipboard, false));
107
- GraphreeD.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)GraphreeD.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,124 @@
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
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
158
+ duplicateItem.addActionListener(this);
159
+ cloneItem = menu.add(new MenuItem("Clone"));
160
+ cloneItem.addActionListener(this);
161
+ if (Globals.ADVANCED)
162
+ {
163
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
164
+ cloneSupportItem.addActionListener(this);
165
+ }
166
+ menu.add("-");
167
+ cutItem = menu.add(new MenuItem("Cut"));
168
+ cutItem.addActionListener(this);
169
+ copyItem = menu.add(new MenuItem("Copy"));
170
+ copyItem.addActionListener(this);
171
+ pasteItem = menu.add(new MenuItem("Paste"));
172
+ pasteItem.addActionListener(this);
173
+ menu.add("-");
174
+
175
+ menu.add("-");
176
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
177
+ pasteIntoItem.addActionListener(this);
178
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
179
+ pasteLinkItem.addActionListener(this);
180
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
181
+ pasteCloneItem.addActionListener(this);
182
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
183
+// pasteExpandItem.addActionListener(this);
184
+ menu.add("-");
185
+ clearItem = menu.add(new MenuItem("Clear"));
186
+ clearItem.addActionListener(this);
187
+
188
+ if (Globals.ADVANCED)
189
+ {
190
+ // Deletes the cameras...
191
+ clearAllItem = menu.add(new MenuItem("Clear All"));
192
+ clearAllItem.addActionListener(this);
193
+ }
194
+
195
+ menuBar.add(cameraMenu = new Menu("View"));
196
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
197
+ //zBufferItem.addActionListener(this);
198
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199
+ //normalLensItem.addActionListener(this);
200
+ cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
+ revertCameraItem.addActionListener(this);
202
+
203
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
+ toggleFullScreenItem.addItemListener(this);
205
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
+ cameraMenu.add("-");
207
+
208
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
+ toggleTextureItem.addItemListener(this);
210
+ toggleTextureItem.setState(CameraPane.textureon);
211
+
212
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
+ toggleSwitchItem.addItemListener(this);
214
+ toggleSwitchItem.setState(CameraPane.SWITCH);
215
+
216
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
217
+ toggleHandleItem.addItemListener(this);
218
+ toggleHandleItem.setState(CameraPane.HANDLES);
219
+
220
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
221
+ togglePaintItem.addItemListener(this);
222
+ togglePaintItem.setState(CameraPane.PAINTMODE);
223
+
224
+ if (Globals.ADVANCED)
225
+ {
226
+ cameraMenu.add("-");
227
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
228
+ toggleLiveItem.addItemListener(this);
229
+ toggleLiveItem.setState(Globals.isLIVE());
230
+
231
+ cameraMenu.add(stepItem = new MenuItem("Step"));
232
+ stepItem.addActionListener(this);
233
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
234
+ // toggleDLItem.addItemListener(this);
235
+ // toggleDLItem.setState(false);
236
+
237
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
238
+ toggleRenderItem.addItemListener(this);
239
+ toggleRenderItem.setState(!CameraPane.frozen);
240
+
241
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242
+ toggleDebugItem.addItemListener(this);
243
+ toggleDebugItem.setState(CameraPane.DEBUG);
244
+
245
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246
+ toggleFrustumItem.addItemListener(this);
247
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
248
+
249
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
250
+ toggleFootContactItem.addItemListener(this);
251
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
252
+
253
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
254
+ toggleTimelineItem.addItemListener(this);
255
+ }
256
+
257
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
258
+// toggleRootItem.addItemListener(this);
259
+// toggleRootItem.setState(false);
260
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
261
+// animationItem.addItemListener(this);
262
+// animationItem.setState(CameraPane.ANIMATION);
263
+ cameraMenu.add("-");
264
+ cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
265
+ editCameraItem.addActionListener(this);
266
+
267
+ if (Globals.ADVANCED)
268
+ {
152269 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153270 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154271 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +277,17 @@
160277 lookAtItem.addActionListener(this);
161278 //lookFromItem.addActinoListener(this);
162279 //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
-
280
+ }
281
+
192282 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);
283
+ if (Globals.ADVANCED)
284
+ {
197285 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198286 revertMeshItem.addActionListener(this);
199287 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200288 resetreferencesItem.addActionListener(this);
201289 menu.add("-");
290
+ }
202291 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203292 overwriteGeoItem.addActionListener(this);
204293 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,48 +299,68 @@
210299 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211300 overwriteUVItem.addActionListener(this);
212301 menu.add("-");
302
+ if (Globals.ADVANCED)
303
+ {
213304 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214305 generateMeshItem.addActionListener(this);
215306 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216307 poseMeshItem.addActionListener(this);
217308 menu.add("-");
309
+ }
218310 resetsupportItem = menu.add(new MenuItem("Reset support"));
219311 resetsupportItem.addActionListener(this);
220312 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221313 linkverticesItem.addActionListener(this);
314
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
315
+ relinkverticesItem.addActionListener(this);
316
+
317
+ if (Globals.ADVANCED)
318
+ {
222319 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223320 setMasterItem.addActionListener(this);
321
+ }
224322
225323 oe.menuBar.add(menu = new Menu("Group"));
226324 grabItem = menu.add(new MenuItem("Grab"));
227325 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230326 backItem = menu.add(new MenuItem("Back"));
231327 backItem.addActionListener(this);
328
+ frontItem = menu.add(new MenuItem("Front"));
329
+ frontItem.addActionListener(this);
232330 compositeItem = menu.add(new MenuItem("Composite"));
233331 compositeItem.addActionListener(this);
332
+ hideItem = menu.add(new MenuItem("Hidden Group"));
333
+ hideItem.addActionListener(this);
334
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
335
+ ungroupItem.addActionListener(this);
234336 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
337
+ randomItem = menu.add(new MenuItem("Switch node"));
236338 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);
241339 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242340 switchGeoItem.addActionListener(this);
243341 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244342 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
343
+ morphItem = menu.add(new MenuItem("Morph Group"));
246344 morphItem.addActionListener(this);
345
+
346
+ if (Globals.ADVANCED)
347
+ {
348
+ menu.add("-");
349
+ physicsItem = menu.add(new MenuItem("Physics"));
350
+ physicsItem.addActionListener(this);
351
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
352
+ frameselectorItem.addActionListener(this);
247353 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248354 scriptNodeItem.addActionListener(this);
249355 cameraItem = menu.add(new MenuItem("Camera"));
250356 cameraItem.addActionListener(this);
357
+ }
251358
252359 oe.menuBar.add(menu = new Menu("Object"));
253360 textureItem = menu.add(new MenuItem("Texture"));
254361 textureItem.addActionListener(this);
362
+ billboardItem = menu.add(new MenuItem("Billboard"));
363
+ billboardItem.addActionListener(this);
255364 csgItem = menu.add(new MenuItem("CSG"));
256365 csgItem.addActionListener(this);
257366 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +369,29 @@
260369 shadowYItem.addActionListener(this);
261370 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262371 shadowZItem.addActionListener(this);
372
+ if (Globals.ADVANCED)
373
+ {
374
+ menu.add("-");
263375 linkerItem = menu.add(new MenuItem("Linker"));
264376 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267377 attributeItem = menu.add(new MenuItem("Attribute"));
268378 attributeItem.addActionListener(this);
379
+ templateItem = menu.add(new MenuItem("Template"));
380
+ templateItem.addActionListener(this);
269381 pointflowItem = menu.add(new MenuItem("Point Flow"));
270382 pointflowItem.addActionListener(this);
383
+ }
271384 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274385 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275386 resetTransformItem.addActionListener(this);
276387 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277388 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
389
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
390
+ resetCentroidXZItem.addActionListener(this);
391
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
392
+ transformGeometryItem.addActionListener(this);
393
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
394
+ transformChildrenItem.addActionListener(this);
280395
281396 oe.menuBar.add(menu = new Menu("Geometry"));
282397 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +400,13 @@
285400 genNormalsORGANItem.addActionListener(this);
286401 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287402 genNormalsCADItem.addActionListener(this);
403
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
404
+ genNormalsMESHItem.addActionListener(this);
405
+ if (Globals.ADVANCED)
406
+ {
407
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
408
+ genNormalsMINEItem.addActionListener(this);
409
+ }
288410 stripifyItem = menu.add(new MenuItem("Stripify"));
289411 stripifyItem.addActionListener(this);
290412 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +428,34 @@
306428 reduce34MeshItem.addActionListener(this);
307429 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308430 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311431 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312432 clipMeshItem.addActionListener(this);
433
+
434
+ if (Globals.ADVANCED)
435
+ {
436
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
437
+ smoothMeshItem.addActionListener(this);
438
+ }
313439
314440 oe.menuBar.add(menu = new Menu("Attributes"));
315441 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316442 clearMaterialsItem.addActionListener(this);
443
+ resetAllItem = menu.add(new MenuItem("Reset All"));
444
+ resetAllItem.addActionListener(this);
445
+ stepAllItem = menu.add(new MenuItem("Step All"));
446
+ stepAllItem.addActionListener(this);
317447 menu.add("-");
318448 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319449 liveleavesItem.addActionListener(this);
320450 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321451 unliveleavesItem.addActionListener(this);
452
+ if (Globals.ADVANCED)
453
+ {
322454 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323455 supportleavesItem.addActionListener(this);
324456 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325457 unsupportleavesItem.addActionListener(this);
458
+ }
326459 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327460 hideleavesItem.addActionListener(this);
328461 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -366,29 +499,22 @@
366499 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367500 sortbynameItem.addActionListener(this);
368501 menu.add("-");
502
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
503
+ shareGeometriesItem.addActionListener(this);
504
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
505
+ mergeGeometriesItem.addActionListener(this);
506
+ if (Globals.ADVANCED)
507
+ {
508
+ // Pretty much the same as duplicate and clone.
369509 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370510 extractGeometriesItem.addActionListener(this);
371511 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372512 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
513
+ }
377514
378515 oe.menuBar.add(menu = new Menu("Insert"));
379516 buildCreateMenu(menu);
380517
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392518 oe.menuBar.add(menu = new Menu("Tools"));
393519 buildToolsMenu(menu);
394520 }
....@@ -423,150 +549,98 @@
423549 oe.radioPanel.add(dummyButton);
424550 oe.buttonGroup.add(dummyButton);
425551 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
552
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429553
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
554
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
555
+ liveCB.setToolTipText("Enable animation");
431556 liveCB.addItemListener(this);
432557
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
558
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559
+ oneStepButton.setToolTipText("Animate one step forward");
560
+ oneStepButton.addActionListener(this);
561
+
562
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
563
+ fastCB.setToolTipText("Fast mode");
451564 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
565
+
566
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
567
+ trackCB.setToolTipText("Enable tracking");
493568 trackCB.addItemListener(this);
494569
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
+ screenfitButton.setToolTipText("Screen fit");
497572 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
573
+
499574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500575 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505576
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
577
+ if (Globals.ADVANCED)
578
+ {
579
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ snapobjectButton.addActionListener(this);
581
+ snapobjectButton.setToolTipText("Snap Object");
582
+ }
583
+
584
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ flashSelectionButton.setToolTipText("Show selection");
512586 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516587
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
589
+
590
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ twoButton.setToolTipText("Show center view only");
519592 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521594 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
595
+ fourButton.setToolTipText("Show left panel only");
596
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ sixButton.setToolTipText("2-column layout left");
523598 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ threeButton.setToolTipText("2-column layout right");
525601 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
602
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ sevenButton.setToolTipText("3-column layout");
527604 sevenButton.addActionListener(this);
528605 //
529606
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ rootButton.setToolTipText("Edit selection in new tab");
531609 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
610
+
611
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ closeButton.setToolTipText("Close tab");
534613 closeButton.addActionListener(this);
535614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536615 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538616
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
617
+ cGridBag commandsPanel = new cGridBag();
618
+
619
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ editButton.setToolTipText("Edit selection");
541621 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545622
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ uneditButton.setToolTipText("Unedit selection");
547625 uneditButton.addActionListener(this);
548626
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
627
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
+ allParamsButton.setToolTipText("Edit all params");
561629 allParamsButton.addActionListener(this);
562630
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
631
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ clearPanelButton.setToolTipText("Clear edit panel");
633
+ clearPanelButton.addActionListener(this);
634
+
635
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ unselectButton.setToolTipText("Unselect");
568637 unselectButton.addActionListener(this);
569638
639
+ commandsPanel.preferredHeight = 1;
640
+
641
+ oe.treePanel.add(commandsPanel);
642
+ oe.treePanel.Return();
643
+
570644 // oe.aConstraints.gridx += 1;
571645 // oe.aConstraints.weighty = 0;
572646 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +652,37 @@
578652 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579653 // gcButton.addActionListener(this);
580654
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
655
+ cGridBag jSPPanel = new cGridBag();
656
+
657
+ JScrollPane jSP;
592658 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
659
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594660 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
661
+
662
+ oe.treePanel.add(jSPPanel);
663
+ oe.treePanel.Return();
599664
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
665
+ cGridBag copyOptionsPanel = new cGridBag();
666
+
667
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
668
+ colorCB.setToolTipText("Copy color when dropped");
604669 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
670
+
671
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
672
+ materialCB.setToolTipText("Copy material when dropped");
607673 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
674
+
675
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
676
+ textureCB.setToolTipText("Copy texture when dropped");
610677 textureCB.addItemListener(this);
611678
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
679
+ copyOptionsPanel.preferredHeight = 1;
680
+ oe.treePanel.add(copyOptionsPanel);
681
+ oe.treePanel.Return();
614682
683
+// mainPanel.setDividerLocation(0.5); //1.0);
684
+// mainPanel.setResizeWeight(0.5);
685
+
615686 //jList.addListSelectionListener(this);
616687 oe.jTree.addTreeSelectionListener(this);
617688 //jTree.setRootVisible(false);
....@@ -633,18 +704,91 @@
633704 radio.layout = sevenButton;
634705 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635706 }
707
+
708
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
709
+ {
710
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
711
+ boxCB.setToolTipText("Display bounding boxes");
712
+ boxCB.addItemListener(this);
713
+
714
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
716
+ zoomBoxCB.addItemListener(this);
717
+
718
+ if (true) // Globals.ADVANCED)
719
+ {
720
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
+ supportCB.setToolTipText("Enable rigging");
722
+ supportCB.addItemListener(this);
723
+
724
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
725
+ // localCB.addItemListener(this);
726
+
727
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
728
+ crowdCB.setToolTipText("Used for crowds");
729
+ crowdCB.addItemListener(this);
730
+
731
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
732
+ smoothCB.setToolTipText("Snapping delay");
733
+ smoothCB.addItemListener(this);
734
+
735
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
736
+ slowCB.setToolTipText("Smooth interpolation");
737
+ slowCB.addItemListener(this);
738
+
739
+// constraints.gridy += 1;
740
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
741
+// speakerMocapCB.addItemListener(this);
742
+
743
+ if (false)
744
+ {
745
+ // handled in scripts
746
+ //constraints.gridy += 1;
747
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
748
+ speakerCameraCB.addItemListener(this);
749
+
750
+ //constraints.gridy += 1;
751
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
752
+ speakerFocusCB.addItemListener(this);
753
+
754
+ //constraints.gridy += 1;
755
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
756
+ smoothfocusCB.addItemListener(this);
757
+ }
758
+
759
+//constraints.gridx += 1;
760
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
761
+// debugCB.addItemListener(this);
762
+
763
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
764
+ oeilCB.addItemListener(this);
765
+
766
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
767
+ lookAtCB.setToolTipText("Look-at target");
768
+ lookAtCB.addItemListener(this);
769
+
770
+ }
771
+
772
+ cGridBag fill = new cGridBag();
773
+
774
+ fill.preferredHeight = 200;
775
+
776
+ panel.add(fill);
777
+
778
+ }
636779
637780 void EditObject(Object3D obj)
638781 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
782
+ cRadio radioButton = new cRadio(obj.name);
783
+ radioButton.SetObject(obj);
784
+ radioButton.layout = sevenButton;
785
+ radioButton.SetCamera(cameraView.renderCamera, false);
786
+ radioButton.addActionListener(this);
787
+ radioPanel.add(radioButton);
788
+ buttonGroup.add(radioButton);
789
+ radioButton.doClick();
647790 }
791
+
648792 void SetupViews(ObjEditor oe)
649793 {
650794 oe.SetupViews();
....@@ -663,6 +807,7 @@
663807 JCheckBox fastCB;
664808 JCheckBox slowCB;
665809 JCheckBox boxCB;
810
+ JCheckBox zoomBoxCB;
666811 JCheckBox trackCB;
667812 JCheckBox smoothfocusCB;
668813 // JCheckBox speakerMocapCB;
....@@ -705,8 +850,7 @@
705850 dropAttributes |= Object3D.TEXTURE;
706851 else
707852 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
853
+ } else if(e.getSource() == liveCB)
710854 {
711855 cameraView.ToggleLive();
712856 }
....@@ -743,6 +887,10 @@
743887 Recompile();
744888 cameraView.repaint();
745889 // refreshContents();
890
+ }
891
+ else if(e.getSource() == zoomBoxCB)
892
+ {
893
+ cameraView.ToggleZoomBoxMode();
746894 }
747895 else if(e.getSource() == smoothfocusCB)
748896 {
....@@ -857,7 +1005,9 @@
8571005 // objEditor.DropFile((java.io.File[]) object, true);
8581006 // return;
8591007 // }
860
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611011 {
8621012 // file(s)
8631013 String[] names = string.split("\n");
....@@ -884,7 +1034,7 @@
8841034
8851035 flashIt = false;
8861036 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891039
8901040 if (group.selection.size() == 1)
....@@ -911,11 +1061,11 @@
9111061 {
9121062 loadClipboard(true);
9131063 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1064
+ pasteInto(false, false);
9151065 } else {
9161066 loadClipboard(false);
9171067 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9191069 }
9201070 }
9211071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1183,37 @@
10331183 torusItem.addActionListener(this);
10341184 superItem = menu.add(new MenuItem("Superellipsoid"));
10351185 superItem.addActionListener(this);
1186
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1187
+ kleinItem.addActionListener(this);
10361188 particleItem = menu.add(new MenuItem("Particle system"));
10371189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10381192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391193 ragdollItem.addActionListener(this);
10401194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411195 ragdoll2Item.addActionListener(this);
1196
+ }
10421197 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441199 meshItem.addActionListener(this);
10451200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10471204 springItem = menu.add(new MenuItem("Spring"));
10481205 springItem.addActionListener(this);
10491206 flagItem = menu.add(new MenuItem("Flag"));
10501207 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551208 blobItem = menu.add(new MenuItem("Blob"));
10561209 blobItem.addActionListener(this);
10571210 latheItem = menu.add(new MenuItem("Lathe"));
10581211 latheItem.addActionListener(this);
1212
+ }
1213
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1214
+ bezierItem.addActionListener(this);
1215
+ overlayItem = menu.add(new MenuItem("Overlay"));
1216
+ overlayItem.addActionListener(this);
10591217 lightItem = menu.add(new MenuItem("Light"));
10601218 lightItem.addActionListener(this);
10611219 menu.add("-");
....@@ -1065,34 +1223,39 @@
10651223 loopItem.addActionListener(this);
10661224 doubleItem = menu.add(new MenuItem("Fork"));
10671225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
10681228 tripleItem = menu.add(new MenuItem("Trident"));
10691229 tripleItem.addActionListener(this);
1230
+ }
10701231 }
10711232
10721233 void buildToolsMenu(Menu menu)
10731234 {
10741235 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751236 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1237
+ animationItem.setState(Globals.ANIMATION);
10771238
10781239 menu.add("-");
10791240 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801241 parseverticesItem.addActionListener(this);
10811242 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821243 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841245 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881247 reduceMorphItem.addActionListener(this);
10891248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901249 reduce34MorphItem.addActionListener(this);
1091
-
1250
+ menu.add("-");
10921251 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931252 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
10961259 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971260 memoryItem.addActionListener(this);
10981261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1269,8 @@
11061269 resetParentItem.addActionListener(this);
11071270 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081271 repairParentItem.addActionListener(this);
1272
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1273
+ repairShadowItem.addActionListener(this);
11091274 menu.add(invariantsItem = new MenuItem("Invariants"));
11101275 invariantsItem.addActionListener(this);
11111276 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1278,7 @@
11131278 menu.add("-");
11141279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151280 editScriptItem.addActionListener(this);
1281
+ }
11161282 }
11171283
11181284 void ScreenFit()
....@@ -1441,9 +1607,9 @@
14411607
14421608 void Overwrite(int mask)
14431609 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451611 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14471613
14481614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491615 content = ((cGroup)content).get(0);
....@@ -1466,6 +1632,7 @@
14661632 //
14671633 public void actionPerformed(ActionEvent event) // , Object arg)
14681634 {
1635
+ Object source = event.getSource();
14691636 /*
14701637 if (event.getSource() == nameField)
14711638 {
....@@ -1477,11 +1644,11 @@
14771644 }
14781645 else
14791646 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1647
+ if (source == lookAtItem || source == lookFromItem)
14811648 {
14821649 ScreenFit();
14831650 } else
1484
- if (event.getSource() == switchItem)
1651
+ if (source == switchItem)
14851652 {
14861653 cVector v1 = new cVector();
14871654 cVector v2 = new cVector();
....@@ -1490,11 +1657,11 @@
14901657 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911658 objEditor.cameraView.repaint();
14921659 } else
1493
- if (event.getSource() == rectoidItem)
1660
+ if (source == rectoidItem)
14941661 {
14951662 makeSomething(new Box());
14961663 } else
1497
- if (event.getSource() == particleItem)
1664
+ if (source == particleItem)
14981665 {
14991666 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001667 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1682,9 @@
15151682 applyExample(particleGeom, "SMOKE");
15161683 makeSomething(particleGeom);
15171684 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1685
+ if (source == ragdollItem || source == ragdoll2Item)
15191686 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1687
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211688
15221689 ragdoll.toParent = LA.newMatrix();
15231690 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1702,7 @@
15351702 } else
15361703 /*
15371704 */
1538
- if (event.getSource() == heightFieldItem)
1705
+ if (source == heightFieldItem)
15391706 {
15401707 Object3D obj = new Object3D();
15411708
....@@ -1573,27 +1740,31 @@
15731740
15741741 makeSomething(obj);
15751742 } else
1576
- if (event.getSource() == gridItem)
1743
+ if (source == gridItem)
15771744 {
15781745 makeSomething(new Grid());
15791746 } else
1580
- if (event.getSource() == ellipsoidItem)
1747
+ if (source == ellipsoidItem)
15811748 {
15821749 makeSomething(new Sphere());
15831750 } else
1584
- if (event.getSource() == coneItem)
1751
+ if (source == coneItem)
15851752 {
15861753 makeSomething(new Cone());
15871754 } else
1588
- if (event.getSource() == torusItem)
1755
+ if (source == torusItem)
15891756 {
15901757 makeSomething(new Torus());
15911758 } else
1592
- if (event.getSource() == superItem)
1759
+ if (source == superItem)
15931760 {
15941761 makeSomething(new Superellipsoid());
15951762 } else
1596
- if (event.getSource() == blobItem)
1763
+ if (source == kleinItem)
1764
+ {
1765
+ makeSomething(new Klein());
1766
+ } else
1767
+ if (source == blobItem)
15971768 {
15981769 Blob blob = new Blob();
15991770 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1772,15 @@
16011772 //blob.retile();
16021773 makeSomething(blob);
16031774 } else
1604
- if (event.getSource() == latheItem)
1775
+ if (source == latheItem)
16051776 {
16061777 makeSomething(new Lathe());
16071778 } else
1608
- if (event.getSource() == bezierItem)
1779
+ if (source == bezierItem)
16091780 {
16101781 makeSomething(new BezierSurface());
16111782 } else
1612
- if (event.getSource() == checkerItem)
1783
+ if (source == overlayItem)
16131784 {
16141785 /*
16151786 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1795,7 @@
16241795 */
16251796 makeSomething(new Checker());
16261797 } else
1627
- if (event.getSource() == meshItem)
1798
+ if (source == meshItem)
16281799 {
16291800 Object3D itemtomake = new Object3D();
16301801 Object3D child;
....@@ -1645,35 +1816,35 @@
16451816 makeSomething(child);
16461817 }
16471818 } else
1648
- if (event.getSource() == springItem)
1819
+ if (source == springItem)
16491820 {
16501821 cSpring s = new cSpring();
16511822 s.setup();
16521823 makeSomething(s);
16531824 } else
1654
- if (event.getSource() == flagItem)
1825
+ if (source == flagItem)
16551826 {
16561827 cSpring s = new cFlag();
16571828 s.setup();
16581829 makeSomething(s);
16591830 } else
1660
- if (event.getSource() == lightItem)
1831
+ if (source == lightItem)
16611832 {
16621833 makeSomething(new Light());
16631834 } else
1664
- if (event.getSource() == csgItem)
1835
+ if (source == csgItem)
16651836 {
16661837 group(new CSG());
16671838 } else
1668
- if (event.getSource() == templateItem)
1839
+ if (source == templateItem)
16691840 {
16701841 group(new cTemplate());
16711842 } else
1672
- if (event.getSource() == attributeItem)
1843
+ if (source == attributeItem)
16731844 {
16741845 makeSomething(new Attribute());
16751846 } else
1676
- if (event.getSource() == pointflowItem)
1847
+ if (source == pointflowItem)
16771848 {
16781849 makeSomething(new PointFlow());
16791850 } else
....@@ -1685,7 +1856,7 @@
16851856 } else
16861857 */
16871858
1688
- if (event.getSource() == superLoopItem)
1859
+ if (source == superLoopItem)
16891860 {
16901861 Composite g = new cGroup();
16911862 for (int i=0; i<15; i++)
....@@ -1707,7 +1878,7 @@
17071878
17081879 group(g);
17091880 } else
1710
- if (event.getSource() == loopItem)
1881
+ if (source == loopItem)
17111882 {
17121883 Composite csg = new GroupLeaf();
17131884 csg.count = 5;
....@@ -1716,7 +1887,7 @@
17161887 csg.addChild(child);
17171888 child.addChild(csg);
17181889 } else
1719
- if (event.getSource() == doubleItem)
1890
+ if (source == doubleItem)
17201891 {
17211892 Composite csg = new GroupLeaf();
17221893 csg.count = 5;
....@@ -1728,7 +1899,7 @@
17281899 csg.addChild(child);
17291900 child.addChild(csg);
17301901 } else
1731
- if (event.getSource() == tripleItem)
1902
+ if (source == tripleItem)
17321903 {
17331904 Composite csg = new GroupLeaf();
17341905 csg.count = 4;
....@@ -1743,71 +1914,59 @@
17431914 csg.addChild(child);
17441915 child.addChild(csg);
17451916 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1917
+ if (source == computeAOItem)
17481918 {
1749
- ImportGFD();
1919
+ Globals.drawMode = CameraPane.OCCLUSION;
1920
+ Globals.theRenderer.repaint();
17501921 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
1922
+ if (source == recompileItem)
17691923 {
17701924 Recompile();
17711925 refreshContents();
17721926 } else
1773
- if (event.getSource() == editScriptItem)
1927
+ if (source == editScriptItem)
17741928 {
17751929 OpenDialog();
17761930 refreshContents();
17771931 } else
1778
- if (event.getSource() == invariantsItem)
1932
+ if (source == invariantsItem)
17791933 {
17801934 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
17821936 } else
1783
- if (event.getSource() == memoryItem)
1937
+ if (source == memoryItem)
17841938 {
17851939 //System.out.println("Invariants:");
17861940 PrintMemory();
17871941 } else
1788
- if (event.getSource() == pathItem)
1942
+ if (source == pathItem)
17891943 {
17901944 PrintPath();
17911945 } else
1792
- if (event.getSource() == analyzeItem)
1946
+ if (source == analyzeItem)
17931947 {
17941948 AnalyzeObject();
17951949 } else
1796
- if (event.getSource() == dumpItem)
1950
+ if (source == dumpItem)
17971951 {
17981952 DumpObject();
17991953 } else
1800
- if (event.getSource() == screenfitButton)
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
1958
+ } else
1959
+ if (source == screenfitButton)
18011960 {
18021961 //Reload(lastConverter, lastFilename, true);
18031962 ScreenFit();
18041963 } else
1805
- if (event.getSource() == screenfitpointButton)
1964
+ if (source == screenfitpointButton)
18061965 {
18071966 //Reload(lastConverter, lastFilename, true);
18081967 ScreenFitPoint();
18091968 } else
1810
- if (event.getSource() == snapobjectButton)
1969
+ if (source == snapobjectButton)
18111970 {
18121971 //Reload(lastConverter, lastFilename, true);
18131972 SnapObject();
....@@ -1818,13 +1977,13 @@
18181977 // Recompile();
18191978 // refreshContents();
18201979 // } else
1821
- if (event.getSource() == gcButton)
1980
+ if (source == gcButton)
18221981 {
18231982 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241983 System.gc();
18251984 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261985 } else
1827
- if (event.getSource() == editLeafItem)
1986
+ if (source == editLeafItem)
18281987 {
18291988 Object3D obj;
18301989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +1997,70 @@
18381997 }
18391998 refreshContents(true);
18401999 } else
1841
- if (event.getSource() == openWindowItem)
2000
+ if (source == openWindowItem)
18422001 {
18432002 EditSelection(true);
18442003 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2004
+ if (source == cutItem || source == clearButton)
18462005 {
18472006 loadClipboard(true);
18482007 } else
1849
- if (event.getSource() == duplicateItem)
2008
+ if (source == duplicateItem)
18502009 {
1851
- Object3D keep = GraphreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18522011 loadClipboard(false);
18532012 paste(false);
1854
- GraphreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18552014 } else
1856
- if (event.getSource() == cloneItem)
2015
+ if (source == cloneItem)
18572016 {
18582017 CloneSelection(false);
18592018 } else
1860
- if (event.getSource() == cloneSupportItem)
2019
+ if (source == cloneSupportItem)
18612020 {
18622021 CloneSelection(true);
18632022 } else
1864
- if (event.getSource() == copyItem)
2023
+ if (source == copyItem)
18652024 {
18662025 loadClipboard(false);
18672026 } else
1868
- if (event.getSource() == pasteItem)
2027
+ if (source == pasteItem)
18692028 {
18702029 paste(false);
18712030 } else
1872
- if (event.getSource() == pasteLinkItem)
2031
+ if (source == pasteIntoItem)
18732032 {
1874
- pasteInto(false);
2033
+ pasteInto(true, false);
18752034 } else
1876
- if (event.getSource() == pasteCloneItem)
2035
+ if (source == pasteLinkItem)
18772036 {
1878
- pasteInto(true);
2037
+ pasteInto(false, false);
18792038 } else
1880
- if (event.getSource() == pasteExpandItem)
2039
+ if (source == pasteCloneItem)
2040
+ {
2041
+ pasteInto(true, true);
2042
+ } else
2043
+ if (source == pasteExpandItem)
18812044 {
18822045 paste(true);
18832046 } else
1884
- if (event.getSource() == synchronizeItem)
2047
+ if (source == synchronizeItem)
18852048 {
18862049 Overwrite(Object3D.TRANSFORM);
18872050 } else
1888
- if (event.getSource() == overwriteNameItem)
2051
+ if (source == overwriteNameItem)
18892052 {
18902053 Overwrite(Object3D.NAME);
18912054 } else
1892
- if (event.getSource() == overwriteUVItem)
2055
+ if (source == overwriteUVItem)
18932056 {
18942057 Overwrite(Object3D.UV);
18952058 } else
1896
- if (event.getSource() == overwriteMatItem)
2059
+ if (source == overwriteMatItem)
18972060 {
2061
+ /* july 2015
18982062 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2063
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002064 else
19012065 {
19022066 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2072,16 @@
19082072 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092073 }
19102074 }
2075
+ */
2076
+
2077
+ Overwrite(dropAttributes);
19112078 }
1912
- if (event.getSource() == overwriteGeoItem)
2079
+ if (source == overwriteGeoItem)
19132080 {
19142081 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2082
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162083 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2084
+// Object3D content = GrafreeD.clipboard.get(0);
19182085 //
19192086 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202087 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2093,7 @@
19262093 // refreshContents();
19272094 // }
19282095 } else
1929
- if (event.getSource() == generateMeshItem)
2096
+ if (source == generateMeshItem)
19302097 {
19312098 //if (group.selection.size() == 1)
19322099 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2104,7 @@
19372104 ResetModel();
19382105 refreshContents();
19392106 } else
1940
- if (event.getSource() == extractGeometriesItem)
2107
+ if (source == extractGeometriesItem)
19412108 {
19422109 boolean one = false;
19432110
....@@ -1964,7 +2131,7 @@
19642131 ResetModel();
19652132 refreshContents();
19662133 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2134
+ if (source == cloneGeometriesItem)
19682135 {
19692136 boolean one = false;
19702137
....@@ -1990,32 +2157,37 @@
19902157 ResetModel();
19912158 refreshContents();
19922159 } else
1993
- if (event.getSource() == shareGeometriesItem)
2160
+ if (source == shareGeometriesItem)
19942161 {
19952162 boolean one = false;
19962163
19972164 if (group.selection.size() == 1)
19982165 one = true;
19992166
2167
+ Object3D merge = null;
2168
+
20002169 Object3D content = new cGroup();
20012170
20022171 for (int i=0; i<group.selection.size(); i++)
20032172 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2173
+ merge = new Merge(group.selection.get(i));
20052174
20062175 if (one)
2007
- makeSomething(sel, false);
2176
+ makeSomething(merge, false);
20082177 else
2009
- content.addChild(sel);
2178
+ content.addChild(merge);
20102179 }
20112180
20122181 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2182
+ makeSomething(content, true);
2183
+ else
2184
+ {
2185
+ ResetModel();
2186
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2187
+ refreshContents();
2188
+ }
20172189 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2190
+ if (source == mergeGeometriesItem)
20192191 {
20202192 boolean one = false;
20212193
....@@ -2045,11 +2217,11 @@
20452217 ResetModel();
20462218 refreshContents();
20472219 } else
2048
- if (event.getSource() == linkverticesItem)
2220
+ if (source == linkverticesItem)
20492221 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2222
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512223 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2224
+// Object3D content = GrafreeD.clipboard.get(0);
20532225 //
20542226 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552227 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2230,48 @@
20582230 // group.selection.get(0).setMasterThis(content); // should be identity
20592231 // refreshContents();
20602232 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622234 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
20642236
20652237 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662238 content = ((cGroup)content).get(0);
20672239
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2240
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692241 for (int i=0; i<group.selection.size(); i++)
20702242 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
20732245 group.selection.get(i).linkVerticesThis(content);
20742246 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
20762248 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2249
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782250 refreshContents();
20792251 }
20802252 } else
2081
- if (event.getSource() == resetsupportItem)
2253
+ if (source == resetsupportItem)
20822254 {
20832255 for (int i=0; i<group.selection.size(); i++)
20842256 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
20872259 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
20892261 }
20902262
20912263 refreshContents();
20922264 } else
2093
- if (event.getSource() == resetreferencesItem)
2265
+ if (source == relinkverticesItem)
2266
+ {
2267
+ boolean random = CameraPane.SWITCH;
2268
+ CameraPane.SWITCH = false; // parse all random nodes
2269
+ group.selection.RelinkToSupport();
2270
+ CameraPane.SWITCH = random;
2271
+
2272
+ refreshContents();
2273
+ } else
2274
+ if (source == resetreferencesItem)
20942275 {
20952276 for (int i=0; i<group.selection.size(); i++)
20962277 {
....@@ -2099,11 +2280,11 @@
20992280
21002281 refreshContents();
21012282 } else
2102
- if (event.getSource() == setMasterItem)
2283
+ if (source == setMasterItem)
21032284 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052286 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
21072288
21082289 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092290 content = ((cGroup)content).get(0);
....@@ -2112,13 +2293,13 @@
21122293 refreshContents();
21132294 }
21142295 } else
2115
- if (event.getSource() == poseMeshItem)
2296
+ if (source == poseMeshItem)
21162297 {
21172298 if (group.selection.size() == 1)
21182299 {
2119
- if (GraphreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
21202301 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
21222303
21232304 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242305 content = ((cGroup)content).get(0);
....@@ -2131,19 +2312,19 @@
21312312 }
21322313
21332314 } else
2134
- if (event.getSource() == revertMeshItem)
2315
+ if (source == revertMeshItem)
21352316 {
21362317 RevertMeshes();
21372318 } else
2138
- if (event.getSource() == resetMeshItem)
2319
+ if (source == resetAllItem)
21392320 {
21402321 ResetAll();
21412322 } else
2142
- if (event.getSource() == stepAllItem)
2323
+ if (source == stepAllItem)
21432324 {
21442325 StepAll();
21452326 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2327
+ if (source == clearItem) // || event.getSource() == clearButton)
21472328 {
21482329 //int indices[] = jList.getSelectedIndices();
21492330 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2332,46 @@
21512332
21522333 ClearSelection(false);
21532334 } else
2154
- if (event.getSource() == clearAllItem)
2335
+ if (source == clearAllItem)
21552336 {
21562337 ClearSelection(true);
21572338 } else
2158
- if (event.getSource() == grabItem)
2339
+ if (source == grabItem)
21592340 {
21602341 group(new cGroup(), true);
21612342 } else
2162
- if (event.getSource() == frontItem)
2343
+ if (source == hideItem)
2344
+ {
2345
+ group(new HiddenObject());
2346
+ } else
2347
+ if (source == frontItem)
21632348 {
21642349 front();
21652350 } else
2166
- if (event.getSource() == backItem)
2351
+ if (source == backItem)
21672352 {
21682353 back();
21692354 } else
2170
- if (event.getSource() == cameraItem)
2355
+ if (source == cameraItem)
21712356 {
21722357 makeSomething(new Camera());
21732358 } else
2174
- if (event.getSource() == compositeItem)
2359
+ if (source == compositeItem)
21752360 {
21762361 group(new Composite());
21772362 } else
2178
- if (event.getSource() == randomItem)
2363
+ if (source == randomItem)
21792364 {
21802365 RandomNode random = new RandomNode();
21812366 group(random);
21822367 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
21842369 } else
2185
- if (event.getSource() == physicsItem)
2370
+ if (source == physicsItem)
21862371 {
21872372 group(new PhysicsNode());
21882373 } else
2189
- if (event.getSource() == frameselectorItem)
2374
+ if (source == frameselectorItem)
21902375 {
21912376 for (int i=0; i<group.selection.size(); i++)
21922377 {
....@@ -2198,7 +2383,7 @@
21982383 ResetModel();
21992384 refreshContents();
22002385 } else
2201
- if (event.getSource() == switchGeoItem)
2386
+ if (source == switchGeoItem)
22022387 {
22032388 for (int i=0; i<group.selection.size(); i++)
22042389 {
....@@ -2210,7 +2395,7 @@
22102395 ResetModel();
22112396 refreshContents();
22122397 } else
2213
- if (event.getSource() == switchTransfoItem)
2398
+ if (source == switchTransfoItem)
22142399 {
22152400 for (int i=0; i<group.selection.size(); i++)
22162401 {
....@@ -2222,7 +2407,7 @@
22222407 ResetModel();
22232408 refreshContents();
22242409 } else
2225
- if (event.getSource() == morphItem)
2410
+ if (source == morphItem)
22262411 {
22272412 for (int i=0; i<group.selection.size(); i++)
22282413 {
....@@ -2234,7 +2419,7 @@
22342419 ResetModel();
22352420 refreshContents();
22362421 } else
2237
- if (event.getSource() == scriptNodeItem)
2422
+ if (source == scriptNodeItem)
22382423 {
22392424 boolean atleastone = false;
22402425
....@@ -2273,195 +2458,223 @@
22732458 }
22742459 }
22752460 } else
2276
- if (event.getSource() == linkerItem)
2461
+ if (source == linkerItem)
22772462 {
22782463 group(new cLinker());
22792464 } else
2280
- if (event.getSource() == textureItem)
2465
+ if (source == textureItem)
22812466 {
22822467 group(new TextureNode());
22832468 } else
2284
- if (event.getSource() == shadowXItem)
2469
+ if (source == billboardItem)
2470
+ {
2471
+ group(new BillboardNode());
2472
+ } else
2473
+ if (source == shadowXItem)
22852474 {
22862475 CastShadow(0);
22872476 } else
2288
- if (event.getSource() == shadowYItem)
2477
+ if (source == shadowYItem)
22892478 {
22902479 CastShadow(1);
22912480 } else
2292
- if (event.getSource() == shadowZItem)
2481
+ if (source == shadowZItem)
22932482 {
22942483 CastShadow(2);
22952484 } else
2296
- if (event.getSource() == ungroupItem)
2485
+ if (source == ungroupItem)
22972486 {
2298
- ungroup();
2487
+ //ungroup();
2488
+ for (int i=0; i<group.selection.size(); i++)
2489
+ {
2490
+ Ungroup(group.selection.get(i));
2491
+ }
2492
+
2493
+ ClearSelection(false);
2494
+
2495
+ refreshContents();
22992496 } else
2300
- if (event.getSource() == genUVItem)
2497
+ if (source == genUVItem)
23012498 {
23022499 GenUV();
23032500 } else
2304
- if (event.getSource() == genNormalsCADItem)
2501
+ if (source == genNormalsCADItem)
23052502 {
23062503 GenNormals(true);
23072504 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2505
+ if (source == genNormalsMESHItem)
2506
+ {
2507
+ GenNormals(true); // TODO
2508
+ } else
2509
+ if (source == genNormalsORGANItem)
23092510 {
23102511 GenNormals(false);
23112512 } else
2312
- if (event.getSource() == stripifyItem)
2513
+ if (source == genNormalsMINEItem)
2514
+ {
2515
+ GenNormalsMINE();
2516
+ } else
2517
+ if (source == stripifyItem)
23132518 {
23142519 Stripify();
23152520 } else
2316
- if (event.getSource() == unstripifyItem)
2521
+ if (source == unstripifyItem)
23172522 {
23182523 Unstripify();
23192524 } else
2320
- if (event.getSource() == trimItem)
2525
+ if (source == trimItem)
23212526 {
23222527 Trim();
23232528 } else
2324
- if (event.getSource() == untrimItem)
2529
+ if (source == untrimItem)
23252530 {
23262531 Untrim();
23272532 } else
2328
- if (event.getSource() == clearColorsItem)
2533
+ if (source == clearColorsItem)
23292534 {
23302535 ClearColors();
23312536 } else
2332
- if (event.getSource() == clearMaterialsItem)
2537
+ if (source == clearMaterialsItem)
23332538 {
23342539 ClearMaterials();
23352540 } else
2336
- if (event.getSource() == liveleavesItem)
2541
+ if (source == liveleavesItem)
23372542 {
23382543 LiveLeaves(true);
23392544 } else
2340
- if (event.getSource() == unliveleavesItem)
2545
+ if (source == unliveleavesItem)
23412546 {
23422547 LiveLeaves(false);
23432548 } else
2344
- if (event.getSource() == supportleavesItem)
2549
+ if (source == supportleavesItem)
23452550 {
23462551 SupportLeaves(true);
23472552 } else
2348
- if (event.getSource() == unsupportleavesItem)
2553
+ if (source == unsupportleavesItem)
23492554 {
23502555 SupportLeaves(false);
23512556 } else
2352
- if (event.getSource() == hideleavesItem)
2557
+ if (source == hideleavesItem)
23532558 {
23542559 HideLeaves(true);
23552560 } else
2356
- if (event.getSource() == showleavesItem)
2561
+ if (source == showleavesItem)
23572562 {
23582563 HideLeaves(false);
23592564 } else
2360
- if (event.getSource() == markleavesItem)
2565
+ if (source == markleavesItem)
23612566 {
23622567 MarkLeaves(true);
23632568 } else
2364
- if (event.getSource() == unmarkleavesItem)
2569
+ if (source == unmarkleavesItem)
23652570 {
23662571 MarkLeaves(false);
23672572 } else
2368
- if (event.getSource() == flipVItem)
2573
+ if (source == flipVItem)
23692574 {
23702575 FlipV(true);
23712576 } else
2372
- if (event.getSource() == unflipVItem)
2577
+ if (source == unflipVItem)
23732578 {
23742579 FlipV(false);
23752580 } else
2376
- if (event.getSource() == lowTexturesItem)
2581
+ if (source == lowTexturesItem)
23772582 {
23782583 SetTexRes(0);
23792584 } else
2380
- if (event.getSource() == normalTexturesItem)
2585
+ if (source == normalTexturesItem)
23812586 {
23822587 SetTexRes(1);
23832588 } else
2384
- if (event.getSource() == highTexturesItem)
2589
+ if (source == highTexturesItem)
23852590 {
23862591 SetTexRes(2);
23872592 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2593
+ if (source == veryhighTexturesItem)
23892594 {
23902595 SetTexRes(3);
23912596 } else
2392
- if (event.getSource() == maxTexturesItem)
2597
+ if (source == maxTexturesItem)
23932598 {
23942599 SetTexRes(4);
23952600 } else
2396
- if (event.getSource() == panoTexturesItem)
2601
+ if (source == panoTexturesItem)
23972602 {
23982603 SetTexRes(5);
23992604 } else
2400
- if (event.getSource() == reverseNormalsItem)
2605
+ if (source == reverseNormalsItem)
24012606 {
24022607 ReverseNormals();
24032608 } else
2404
- if (event.getSource() == parseverticesItem)
2609
+ if (source == parseverticesItem)
24052610 {
24062611 ParseVertices();
24072612 } else
2408
- if (event.getSource() == textureFieldItem)
2613
+ if (source == textureFieldItem)
24092614 {
24102615 TextureVertices();
24112616 } else
2412
- if (event.getSource() == alignItem)
2617
+ if (source == alignItem)
24132618 {
24142619 Align();
24152620 } else
2416
- if (event.getSource() == mirrorItem)
2621
+ if (source == mirrorItem)
24172622 {
24182623 MirrorPoses();
24192624 } else
2420
- if (event.getSource() == reduceMorphItem)
2625
+ if (source == reduceMorphItem)
24212626 {
24222627 MeshReduction(false);
24232628 } else
2424
- if (event.getSource() == reduce34MorphItem)
2629
+ if (source == reduce34MorphItem)
24252630 {
24262631 MeshReduction(true);
24272632 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2633
+ if (source == reverseTrianglesItem)
24292634 {
24302635 ReverseTriangles();
24312636 } else
2432
- if (event.getSource() == reduceMeshItem)
2637
+ if (source == reduceMeshItem)
24332638 {
24342639 ReduceMesh(false);
24352640 } else
2436
- if (event.getSource() == reduce34MeshItem)
2641
+ if (source == reduce34MeshItem)
24372642 {
24382643 ReduceMesh(true);
24392644 } else
2440
- if (event.getSource() == increaseMeshItem)
2645
+ if (source == increaseMeshItem)
24412646 {
24422647 IncreaseMesh();
24432648 } else
2444
- if (event.getSource() == clipMeshItem)
2649
+ if (source == clipMeshItem)
24452650 {
24462651 ClipMesh();
24472652 } else
2448
- if (event.getSource() == smoothMeshItem)
2653
+ if (source == smoothMeshItem)
24492654 {
24502655 SmoothMesh();
24512656 } else
2452
- if (event.getSource() == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
24532658 {
24542659 TransformGeometry();
24552660 } else
2456
- if (event.getSource() == resetTransformItem)
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
2664
+ } else
2665
+ if (source == resetTransformItem)
24572666 {
24582667 ResetTransform();
24592668 } else
2460
- if (event.getSource() == resetCentroidItem)
2669
+ if (source == resetCentroidItem)
24612670 {
2462
- ResetCentroid();
2671
+ ResetCentroid(true);
24632672 } else
2464
- if (event.getSource() == resetParentItem)
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
2676
+ } else
2677
+ if (source == resetParentItem)
24652678 {
24662679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672680 {
....@@ -2471,7 +2684,7 @@
24712684
24722685 refreshContents();
24732686 } else
2474
- if (event.getSource() == repairParentItem)
2687
+ if (source == repairParentItem)
24752688 {
24762689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772690 {
....@@ -2485,7 +2698,21 @@
24852698
24862699 refreshContents();
24872700 } else
2488
- if (event.getSource() == sortbysizeItem)
2701
+ if (source == repairShadowItem)
2702
+ {
2703
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2704
+ {
2705
+ Object3D obj = (Object3D)e.nextElement();
2706
+ obj.RepairShadow();
2707
+// for (int i=0; i<obj.size(); i++)
2708
+// {
2709
+// obj.get(i).parent = obj;
2710
+// }
2711
+ }
2712
+
2713
+ refreshContents();
2714
+ } else
2715
+ if (source == sortbysizeItem)
24892716 {
24902717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912718 {
....@@ -2497,7 +2724,7 @@
24972724 ResetModel();
24982725 refreshContents();
24992726 } else
2500
- if (event.getSource() == sortbynameItem)
2727
+ if (source == sortbynameItem)
25012728 {
25022729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032730 {
....@@ -2509,7 +2736,7 @@
25092736 ResetModel();
25102737 refreshContents();
25112738 } else
2512
- if (event.getSource() == attachPigmentItem)
2739
+ if (source == attachPigmentItem)
25132740 {
25142741 String texture = GetFile("Attach pigment");
25152742 Object3D obj;
....@@ -2521,7 +2748,7 @@
25212748
25222749 refreshContents();
25232750 } else
2524
- if (event.getSource() == detachPigmentItem)
2751
+ if (source == detachPigmentItem)
25252752 {
25262753 Object3D obj;
25272754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2759,7 @@
25322759
25332760 refreshContents();
25342761 } else
2535
- if (event.getSource() == attachBumpItem)
2762
+ if (source == attachBumpItem)
25362763 {
25372764 String texture = GetFile("Attach bump");
25382765 Object3D obj;
....@@ -2544,7 +2771,7 @@
25442771
25452772 refreshContents();
25462773 } else
2547
- if (event.getSource() == detachBumpItem)
2774
+ if (source == detachBumpItem)
25482775 {
25492776 Object3D obj;
25502777 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2782,7 @@
25552782
25562783 refreshContents();
25572784 } else
2558
- if (event.getSource() == pigmentBumpItem)
2785
+ if (source == pigmentBumpItem)
25592786 {
25602787 Object3D obj;
25612788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2793,195 @@
25662793
25672794 refreshContents();
25682795 } else
2569
- if (event.getSource() == flashSelectionButton)
2796
+ if (source == flashSelectionButton)
25702797 {
25712798 CameraPane.flash = true;
25722799 refreshContents();
25732800 } else
2574
- if (event.getSource() == oneButton)
2801
+ if (source == oneButton)
25752802 {
25762803 } else
2577
- if (event.getSource() == twoButton)
2804
+ if (source == twoButton)
25782805 {
25792806 radio.layout = twoButton;
25802807 // bug
25812808 //gridPanel.setDividerLocation(1.0);
25822809 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// //bigThree.add(XYZPanel, aWindowConstraints);
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(false);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.FlushUI();
26072839 } else
2608
- if (event.getSource() == threeButton)
2840
+ if (source == threeButton)
26092841 {
26102842 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
2843
+
2844
+// bigThree.remove(scenePanel);
2845
+// bigThree.remove(centralPanel);
2846
+// bigThree.remove(XYZPanel);
2847
+// aWindowConstraints.gridx = 0;
2848
+// aWindowConstraints.gridy = 0;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// aWindowConstraints.weightx = 0;
2853
+// aWindowConstraints.weighty = 1;
2854
+// //bigThree.add(jtp, aWindowConstraints);
2855
+// aWindowConstraints.weightx = 1;
2856
+// aWindowConstraints.gridwidth = 3;
2857
+// // aConstraints.gridheight = 3;
2858
+// aWindowConstraints.gridx = 1;
2859
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2860
+// bigThree.add(centralPanel, aWindowConstraints);
2861
+// aWindowConstraints.weightx = 0;
2862
+// aWindowConstraints.gridx = 4;
2863
+// aWindowConstraints.gridwidth = 1;
2864
+// // aConstraints.gridheight = 3;
2865
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2866
+// bigThree.add(XYZPanel, aWindowConstraints);
2867
+// bigThree.validate();
2868
+// scenePanel.setVisible(false);
2869
+// centralPanel.setVisible(true);
2870
+// XYZPanel.setVisible(true);
2871
+ bigThree.ClearUI();
2872
+ bigThree.add(centralPanel);
2873
+ bigThree.add(XYZPanel);
2874
+ bigThree.FlushUI();
26352875 } else
2636
- if (event.getSource() == fourButton)
2876
+ if (source == fourButton)
26372877 {
26382878 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aWindowConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2888
+// aWindowConstraints.weightx = 1;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// //bigThree.add(cameraPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aWindowConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(false);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.FlushUI();
26632910 } else
2664
- if (event.getSource() == sixButton)
2911
+ if (source == sixButton)
26652912 {
26662913 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
2914
+
2915
+// bigThree.remove(scenePanel);
2916
+// bigThree.remove(centralPanel);
2917
+// bigThree.remove(XYZPanel);
2918
+// aWindowConstraints.gridx = 0;
2919
+// aWindowConstraints.gridy = 0;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// aWindowConstraints.weightx = 0;
2924
+// aWindowConstraints.weighty = 1;
2925
+// bigThree.add(scenePanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.gridwidth = 3;
2928
+// // aWindowConstraints.gridheight = 3;
2929
+// aWindowConstraints.gridx = 1;
2930
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2931
+// bigThree.add(centralPanel, aWindowConstraints);
2932
+// aWindowConstraints.weightx = 0;
2933
+// aWindowConstraints.gridx = 4;
2934
+// aWindowConstraints.gridwidth = 1;
2935
+// // aWindowConstraints.gridheight = 3;
2936
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2937
+// //bigThree.add(XYZPanel, aConstraints);
2938
+// bigThree.validate();
2939
+// scenePanel.setVisible(true);
2940
+// centralPanel.setVisible(true);
2941
+// XYZPanel.setVisible(false);
2942
+ bigThree.ClearUI();
2943
+ bigThree.add(scenePanel);
2944
+ bigThree.add(centralPanel);
2945
+ bigThree.FlushUI();
26912946 } else
2692
- if (event.getSource() == sevenButton)
2947
+ if (source == sevenButton)
26932948 {
26942949 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
2950
+
2951
+// bigThree.remove(scenePanel);
2952
+// bigThree.remove(centralPanel);
2953
+// bigThree.remove(XYZPanel);
2954
+// aWindowConstraints.gridx = 0;
2955
+// aWindowConstraints.gridy = 0;
2956
+// aWindowConstraints.gridwidth = 1;
2957
+// // aWindowConstraints.gridheight = 3;
2958
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2959
+// aWindowConstraints.weightx = 0;
2960
+// aWindowConstraints.weighty = 1;
2961
+// bigThree.add(scenePanel, aWindowConstraints);
2962
+// aWindowConstraints.weightx = 1;
2963
+// aWindowConstraints.gridwidth = 3;
2964
+// // aWindowConstraints.gridheight = 3;
2965
+// aWindowConstraints.gridx = 1;
2966
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2967
+// bigThree.add(centralPanel, aWindowConstraints);
2968
+// aWindowConstraints.weightx = 0;
2969
+// aWindowConstraints.gridx = 4;
2970
+// aWindowConstraints.gridwidth = 1;
2971
+// // aConstraints.gridheight = 3;
2972
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2973
+// bigThree.add(XYZPanel, aWindowConstraints);
2974
+// bigThree.validate();
2975
+// scenePanel.setVisible(true);
2976
+// centralPanel.setVisible(true);
2977
+// XYZPanel.setVisible(true);
2978
+ bigThree.ClearUI();
2979
+ bigThree.add(scenePanel);
2980
+ bigThree.add(centralPanel);
2981
+ bigThree.add(XYZPanel);
2982
+ bigThree.FlushUI();
27192983 } else
2720
- if (event.getSource() == rootButton)
2984
+ if (source == rootButton)
27212985 {
27222986 Object3D obj;
27232987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +2993,7 @@
27292993
27302994 refreshContents(true);
27312995 } else
2732
- if (event.getSource() == closeButton)
2996
+ if (source == closeButton)
27332997 {
27342998 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27352999 cRadio ab;
....@@ -2750,11 +3014,11 @@
27503014 }
27513015 refreshContents(true);
27523016 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3017
+ if (source == editItem || source == editButton)
27543018 {
27553019 EditSelection(false);
27563020 } else
2757
- if (event.getSource() == uneditButton)
3021
+ if (source == uneditButton)
27583022 {
27593023 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603024 {
....@@ -2766,12 +3030,12 @@
27663030
27673031 child.editWindow = null; // ???????????
27683032 }
2769
- objEditor.ctrlPanel.revalidate();
3033
+ objEditor.ctrlPanel.FlushUI();
27703034 //objEditor.jTree.clearSelection();
27713035 //objEditor.ResetSliders();
27723036 refreshContents(true);
27733037 } else
2774
- if (event.getSource() == clearPanelButton)
3038
+ if (source == clearPanelButton)
27753039 {
27763040 assert(copy == group);
27773041 //copy.ClearUI();
....@@ -2782,7 +3046,7 @@
27823046 listUI.clear();
27833047 refreshContents(true);
27843048 } else
2785
- if (event.getSource() == allParamsButton)
3049
+ if (source == allParamsButton)
27863050 {
27873051 assert(copy == group);
27883052
....@@ -2803,19 +3067,19 @@
28033067
28043068 refreshContents(true);
28053069 } else
2806
- if (event.getSource() == unselectButton)
3070
+ if (source == unselectButton)
28073071 {
28083072 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3073
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103074 objEditor.ResetSliders();
28113075 refreshContents(true);
28123076 } else
2813
- if(event.getSource() instanceof cRadio)
3077
+ if(source instanceof cRadio)
28143078 {
28153079 group.parent = keepparent;
28163080 group.attributes = 0;
28173081 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3082
+ /*cRadio*/ radio = (cRadio)source;
28193083 Object3D obj = radio.GetObject();
28203084 System.out.println("Edit " + obj);
28213085 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3099,7 @@
28353099 }
28363100
28373101 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3102
+ //Globals.theRenderer.object = group;
28393103 if(!useclient)
28403104 {
28413105 cameraView.renderCamera = radio.camera;
....@@ -2844,12 +3108,15 @@
28443108 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453109 cameraView.targetLookAt.set(radio.camera.lookAt);
28463110 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3111
+ //cameraView.lighttouched = true;
3112
+ Globals.lighttouched = true;
28483113 topView.object = group;
28493114 frontView.object = group;
28503115 sideView.object = group;
28513116 }
2852
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
28533120 /*
28543121 currentLayout = radio.layout;
28553122 if (currentLayout == null)
....@@ -2862,7 +3129,20 @@
28623129 //group.attributes = -1;
28633130 ResetModel();
28643131 refreshContents(true);
2865
- }
3132
+ } else if (event.getSource() == editCameraItem)
3133
+ {
3134
+ cameraView.ProtectCamera();
3135
+ cameraView.repaint();
3136
+ return;
3137
+ } else if (event.getSource() == revertCameraItem)
3138
+ {
3139
+ cameraView.RevertCamera();
3140
+ cameraView.repaint();
3141
+ return;
3142
+ // } else if (event.getSource() == textureButton)
3143
+ // {
3144
+ // return; // true;
3145
+ }
28663146 else
28673147 {
28683148 //return super.action(event, arg);
....@@ -2880,7 +3160,7 @@
28803160 if (useclient)
28813161 {
28823162 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3163
+ Globals.lighttouched = true;
28843164 //topView.object = client;
28853165 //frontView.object = client;
28863166 //sideView.object = client;
....@@ -2888,7 +3168,7 @@
28883168 else
28893169 {
28903170 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3171
+ Globals.lighttouched = true;
28923172 //topView.object = group;
28933173 //frontView.object = group;
28943174 //sideView.object = group;
....@@ -2923,6 +3203,28 @@
29233203 refreshContents();
29243204 }
29253205
3206
+ void TransformChildren()
3207
+ {
3208
+ Object3D obj;
3209
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3210
+ {
3211
+ obj = (Object3D)e.nextElement();
3212
+ obj.KeepTextureMatrices();
3213
+ obj.TransformChildren();
3214
+ obj.RestoreTextureMatrices();
3215
+
3216
+// if (obj.parent == null)
3217
+// {
3218
+// System.out.println("NULL PARENT!");
3219
+// new Exception().printStackTrace();
3220
+// }
3221
+// else
3222
+// TouchTransform(obj);
3223
+// //obj.parent.Touch();
3224
+ }
3225
+
3226
+ refreshContents();
3227
+ }
29263228
29273229 void ResetTransform()
29283230 {
....@@ -3035,7 +3337,7 @@
30353337 refreshContents();
30363338 }
30373339
3038
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
30393341 {
30403342 Object3D obj;
30413343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3352,16 @@
30503352 LA.matIdentity(Object3D.mat);
30513353 obj.getBounds(minima, maxima, false);
30523354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553358 obj.TransformMesh(Object3D.mat);
3359
+
30563360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
30593365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3121,9 +3427,9 @@
31213427 obj = (Object3D)e.nextElement();
31223428
31233429 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
31253431 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
31273433
31283434 // System.err.println((size/1024) + " KB is the size of " + obj);
31293435 }
....@@ -3165,6 +3471,13 @@
31653471 void GenNormals(boolean crease)
31663472 {
31673473 group.GenNormalsS(crease);
3474
+
3475
+ refreshContents();
3476
+ }
3477
+
3478
+ void GenNormalsMINE()
3479
+ {
3480
+ group.selection.GenNormalsMINE();
31683481
31693482 refreshContents();
31703483 }
....@@ -3250,7 +3563,7 @@
32503563 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513564 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523565 //
3253
-// g.add(GraphreeD.clipboard);
3566
+// g.add(GrafreeD.clipboard);
32543567 //
32553568 // buffer.add(g);
32563569 // }
....@@ -3269,8 +3582,8 @@
32693582 // nodes = new Object3D();
32703583 // vertices = new Vector<Vertex>();
32713584 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3585
+// boolean epsequal = GrafreeD.epsequal;
3586
+// GrafreeD.epsequal = true;
32743587 //
32753588 // for (int i=0; i<group.selection.size(); i++)
32763589 // {
....@@ -3311,7 +3624,7 @@
33113624 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123625 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133626 //
3314
-// g.add(GraphreeD.clipboard);
3627
+// g.add(GrafreeD.clipboard);
33153628 //
33163629 // buffer.add(g);
33173630 // }
....@@ -3319,7 +3632,7 @@
33193632 // makeSomething(buffer, i==group.selection.size()-1);
33203633 // }
33213634 //
3322
-// GraphreeD.epsequal = epsequal;
3635
+// GrafreeD.epsequal = epsequal;
33233636 //
33243637 // //buffer = null;
33253638 // temprep = null;
....@@ -3330,8 +3643,8 @@
33303643
33313644 void ParseVertices()
33323645 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
33353648
33363649 for (int i=0; i<group.selection.size(); i++)
33373650 {
....@@ -3356,7 +3669,7 @@
33563669 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573670 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583671
3359
- g.add(GraphreeD.clipboard);
3672
+ g.add(Grafreed.clipboard);
33603673
33613674 buffer.add(g);
33623675 }
....@@ -3371,7 +3684,7 @@
33713684 makeSomething(buffer, i==group.selection.size()-1);
33723685 }
33733686
3374
- GraphreeD.epsequal = epsequal;
3687
+ Grafreed.epsequal = epsequal;
33753688
33763689 refreshContents();
33773690 }
....@@ -3389,7 +3702,16 @@
33893702 String pigment = Object3D.GetPigment(tex);
33903703 //String bump = Object3D.GetBump(tex);
33913704
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3705
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3706
+
3707
+ try
3708
+ {
3709
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3710
+ }
3711
+ catch (Exception e)
3712
+ {
3713
+ System.err.println("FAIL: " + node);
3714
+ }
33933715
33943716 double s = v.s;
33953717
....@@ -3416,7 +3738,7 @@
34163738 scale /= 3;
34173739
34183740 scale /= 0xFF;
3419
- scale /= 4;
3741
+ // c'est quoi ca? scale /= 4;
34203742
34213743 //v.AO = scale;
34223744
....@@ -3437,12 +3759,26 @@
34373759
34383760 void Align()
34393761 {
3762
+ if (group.selection.size() == 0)
3763
+ return;
3764
+
3765
+ cVector bbmin = new cVector();
3766
+ cVector bbmax = new cVector();
3767
+
3768
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3769
+
3770
+ double dx = bbmax.x - bbmin.x;
3771
+ double dy = bbmax.y - bbmin.y;
3772
+ double dz = bbmax.z - bbmin.z;
3773
+
3774
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3775
+
34403776 for (int i=0; i<group.selection.size(); i++)
34413777 {
34423778 Object3D obj = group.selection.get(i);
34433779
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3780
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3781
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463782 }
34473783
34483784 refreshContents();
....@@ -3455,7 +3791,7 @@
34553791 // ref.SaveSupports();
34563792 // Object3D par = ref.parent;
34573793 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3794
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593795 // ref.parent = par;
34603796 // ref.RestoreSupports();
34613797
....@@ -3463,11 +3799,11 @@
34633799
34643800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34653801
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
34683804 lowres.linkVerticesThis(null);
34693805 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
34713807
34723808 System.err.flush();
34733809
....@@ -3485,7 +3821,7 @@
34853821 // lowres.SaveSupports();
34863822 // par = lowres.parent;
34873823 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3824
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893825 Object3D newlow = CloneObject(lowres, false);
34903826 newlow.name = sn.switchobject.get(i).name;
34913827 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3843,7 @@
35073843 return;
35083844
35093845 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
35113847
35123848 Object3D newgroup = new Object3D("Po:" + poses.name);
35133849
....@@ -3676,7 +4012,7 @@
36764012 group.selection.RelinkToSupport(); // july 2014
36774013 System.out.println("DONE.");
36784014 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4015
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804016 }
36814017
36824018 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4037,20 @@
37014037
37024038 void ClipMesh()
37034039 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054041 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
37074043
37084044 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094045 content = ((cGroup)content).get(0);
37104046
37114047 // for (int i=0; i<group.selection.size(); i++)
37124048 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4049
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144050 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
37164052 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4053
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184054 System.out.println("DONE.");
37194055 refreshContents();
37204056 }
....@@ -3847,7 +4183,7 @@
38474183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484184
38494185 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4186
+ if(elem != group || !newWindow)
38514187 {
38524188 // if (!(elem instanceof Composite))
38534189 // newWindow = false;
....@@ -3952,25 +4288,25 @@
39524288 System.err.println("info : " + child.GetPath());
39534289 }
39544290 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4291
+// else
4292
+// {
4293
+// objEditor.SetMaterial(group); // .GetMaterial());
4294
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4295
+// System.err.println("info : " + group.GetPath());
4296
+// }
39614297
39624298 objEditor.SetText(); // jan 2014
39634299
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4300
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39654301 CameraPane.flash = true;
39664302
39674303 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39684304 // a camera
39694305 {
39704306 CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4307
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4308
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4309
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744310 }
39754311
39764312 refreshContents();
....@@ -4052,12 +4388,12 @@
40524388 {
40534389 if (group.selection.isEmpty())
40544390 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
40564392 Composite tGroup = null;
40574393 if (group.selection.size() > 0) // 1)
40584394 {
40594395 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
40614397 }
40624398
40634399 if (cut)
....@@ -4097,16 +4433,16 @@
40974433 //System.out.println("cut " + child);
40984434 //System.out.println("parent = " + child.parent);
40994435 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
41014437 tGroup.add/*Child*/(tmp);
41024438 else
4103
- GraphreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
41044440 }
41054441 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
41074443 tGroup.add/*Child*/(child);
41084444 else
4109
- GraphreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
41104446 }
41114447
41124448 //ResetModel();
....@@ -4138,21 +4474,21 @@
41384474 //System.out.println("cut " + elem);
41394475 //System.out.println("parent = " + elem.parent);
41404476 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
41424478 tGroup.add/*Child*/(tmp);
41434479 else
4144
- GraphreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
41454481 }
41464482 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
41484484 tGroup.add/*Child*/(child);
41494485 else
4150
- GraphreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
41514487 }
41524488
41534489 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
41564492 if (cut)
41574493 {
41584494 ResetModel();
....@@ -4162,11 +4498,11 @@
41624498
41634499 void paste(boolean expand)
41644500 {
4165
- // if (GraphreeD.clipboard == null)
4501
+ // if (GrafreeD.clipboard == null)
41664502 // return;
41674503 boolean first = true;
41684504
4169
- if (GraphreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
41704506 {
41714507 Composite temp;
41724508
....@@ -4177,7 +4513,7 @@
41774513 temp = (Composite)Applet3D.clipboard.deepCopy();
41784514 */
41794515 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4516
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814517 {
41824518 Object3D child = (Object3D)e.nextElement();
41834519
....@@ -4191,7 +4527,7 @@
41914527 else
41924528 elem = child.deepCopy(); // ?
41934529 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4530
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954531 // elem = elem.get(0);
41964532 makeSomething(elem, true); // ?? first);
41974533 //group.addChild(elem);
....@@ -4211,23 +4547,23 @@
42114547 //Object3D cb = Applet3D.clipboard;
42124548 //temp.addChild(cb);
42134549 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4550
+ assert(Grafreed.clipboard.parent == null);
4551
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4552
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4553
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4554
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194555 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
42224558 }
42234559
42244560 ResetModel();
42254561 refreshContents();
42264562 }
42274563
4228
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
42294565 {
4230
-// if (GraphreeD.clipboard == null)
4566
+// if (GrafreeD.clipboard == null)
42314567 // return;
42324568
42334569 if (group.selection.size() != 1)
....@@ -4254,15 +4590,22 @@
42544590 if (copyit)
42554591 {
42564592 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
42584601 }
42594602 else
42604603 {
42614604 boolean first = true;
42624605
4263
- if (GraphreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
42644607 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
42664609 Object3D copy;
42674610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684611 {
....@@ -4272,7 +4615,7 @@
42724615 }
42734616 } else
42744617 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
42764619 }
42774620 }
42784621 }
....@@ -4464,6 +4807,26 @@
44644807 makeSomething(csg);
44654808 }
44664809
4810
+ void Ungroup(Object3D g)
4811
+ {
4812
+ if (g instanceof HiddenObject)
4813
+ {
4814
+ HiddenObject h = (HiddenObject) g;
4815
+
4816
+ for (int i=0; i<h.ActualSize(); i++)
4817
+ {
4818
+ objEditor.makeSomething(h.get(i), false);
4819
+ }
4820
+ }
4821
+ else
4822
+ {
4823
+ for (int i=0; i<g.Size(); i++)
4824
+ {
4825
+ objEditor.makeSomething(g.get(i), false);
4826
+ }
4827
+ }
4828
+ }
4829
+
44674830 void ungroup()
44684831 {
44694832 /*
....@@ -4657,21 +5020,6 @@
46575020 }
46585021 */
46595022
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755023 /*
46765024 public void Callback(Object obj)
46775025 {
....@@ -4695,26 +5043,9 @@
46955043 }
46965044 */
46975045
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155046 String GetFile(String dialogName)
47165047 {
4717
- if (GraphreeD.standAlone)
5048
+ if (Grafreed.standAlone)
47185049 {
47195050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205051 browser.show();
....@@ -4778,10 +5109,12 @@
47785109 cButton flashSelectionButton;
47795110 cButton editButton;
47805111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
47815113 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835114 cButton unselectButton;
47845115
5116
+ cButton oneStepButton;
5117
+
47855118 cButton screenfitButton;
47865119 cButton screenfitpointButton;
47875120 cButton snapobjectButton;
....@@ -4823,8 +5156,9 @@
48235156 private MenuItem resetsupportItem;
48245157 private MenuItem resetreferencesItem;
48255158 private MenuItem linkverticesItem;
5159
+ private MenuItem relinkverticesItem;
48265160 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
48285162 private MenuItem stepAllItem;
48295163 private MenuItem revertMeshItem;
48305164 private MenuItem poseMeshItem;
....@@ -4835,14 +5169,17 @@
48355169 private MenuItem mergeGeometriesItem;
48365170 private MenuItem copyItem;
48375171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
48385173 private MenuItem pasteLinkItem;
48395174 private MenuItem pasteCloneItem;
48405175 private MenuItem pasteExpandItem;
48415176 private MenuItem clearItem;
48425177 private MenuItem clearAllItem;
48435178 private MenuItem genUVItem;
5179
+ private MenuItem genNormalsMESHItem;
48445180 private MenuItem genNormalsCADItem;
48455181 private MenuItem genNormalsORGANItem;
5182
+ private MenuItem genNormalsMINEItem;
48465183 private MenuItem stripifyItem;
48475184 private MenuItem unstripifyItem;
48485185 private MenuItem trimItem;
....@@ -4882,8 +5219,11 @@
48825219 private MenuItem panoTexturesItem;
48835220
48845221 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
48865223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
5226
+ private MenuItem hideItem;
48875227 private MenuItem grabItem;
48885228 private MenuItem backItem;
48895229 private MenuItem frontItem;
....@@ -4904,6 +5244,7 @@
49045244
49055245 private MenuItem resetParentItem;
49065246 private MenuItem repairParentItem;
5247
+ private MenuItem repairShadowItem;
49075248 private MenuItem sortbysizeItem;
49085249 private MenuItem sortbynameItem;
49095250
....@@ -4924,10 +5265,11 @@
49245265 private MenuItem coneItem;
49255266 private MenuItem torusItem;
49265267 private MenuItem superItem;
5268
+ private MenuItem kleinItem;
49275269 private MenuItem blobItem;
49285270 private MenuItem latheItem;
49295271 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
49315273 private MenuItem meshItem;
49325274 // private MenuItem meshGroupItem;
49335275 private MenuItem springItem;
....@@ -4936,6 +5278,7 @@
49365278 private MenuItem csgItem;
49375279 private MenuItem templateItem;
49385280 private MenuItem textureItem;
5281
+ private MenuItem billboardItem;
49395282 private MenuItem shadowXItem;
49405283 private MenuItem shadowYItem;
49415284 private MenuItem shadowZItem;
....@@ -4948,11 +5291,6 @@
49485291 private MenuItem doubleItem;
49495292 private MenuItem tripleItem;
49505293
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49565294 private MenuItem computeAOItem;
49575295 private MenuItem recompileItem;
49585296 private MenuItem editScriptItem;
....@@ -4962,4 +5300,8 @@
49625300 private MenuItem analyzeItem;
49635301 private MenuItem dumpItem;
49645302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
49655307 }