Normand Briere
2019-06-03 e24558ddeacfc945b9e9ba0a32b552d04e2ed4dd
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,
....@@ -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
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,27 +185,37 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 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);
211
+ if (Globals.ADVANCED)
212
+ {
197213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198214 revertMeshItem.addActionListener(this);
199215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200216 resetreferencesItem.addActionListener(this);
201217 menu.add("-");
218
+ }
202219 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203220 overwriteGeoItem.addActionListener(this);
204221 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,48 +227,68 @@
210227 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211228 overwriteUVItem.addActionListener(this);
212229 menu.add("-");
230
+ if (Globals.ADVANCED)
231
+ {
213232 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214233 generateMeshItem.addActionListener(this);
215234 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216235 poseMeshItem.addActionListener(this);
217236 menu.add("-");
237
+ }
218238 resetsupportItem = menu.add(new MenuItem("Reset support"));
219239 resetsupportItem.addActionListener(this);
220240 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221241 linkverticesItem.addActionListener(this);
242
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
243
+ relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
222247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223248 setMasterItem.addActionListener(this);
249
+ }
224250
225251 oe.menuBar.add(menu = new Menu("Group"));
226252 grabItem = menu.add(new MenuItem("Grab"));
227253 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230254 backItem = menu.add(new MenuItem("Back"));
231255 backItem.addActionListener(this);
256
+ frontItem = menu.add(new MenuItem("Front"));
257
+ frontItem.addActionListener(this);
232258 compositeItem = menu.add(new MenuItem("Composite"));
233259 compositeItem.addActionListener(this);
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
261
+ hideItem.addActionListener(this);
262
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
263
+ ungroupItem.addActionListener(this);
234264 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
236266 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);
241267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242268 switchGeoItem.addActionListener(this);
243269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244270 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
246272 morphItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ menu.add("-");
277
+ physicsItem = menu.add(new MenuItem("Physics"));
278
+ physicsItem.addActionListener(this);
279
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
280
+ frameselectorItem.addActionListener(this);
247281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248282 scriptNodeItem.addActionListener(this);
249283 cameraItem = menu.add(new MenuItem("Camera"));
250284 cameraItem.addActionListener(this);
285
+ }
251286
252287 oe.menuBar.add(menu = new Menu("Object"));
253288 textureItem = menu.add(new MenuItem("Texture"));
254289 textureItem.addActionListener(this);
290
+ billboardItem = menu.add(new MenuItem("Billboard"));
291
+ billboardItem.addActionListener(this);
255292 csgItem = menu.add(new MenuItem("CSG"));
256293 csgItem.addActionListener(this);
257294 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +297,29 @@
260297 shadowYItem.addActionListener(this);
261298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
263303 linkerItem = menu.add(new MenuItem("Linker"));
264304 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267305 attributeItem = menu.add(new MenuItem("Attribute"));
268306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
269309 pointflowItem = menu.add(new MenuItem("Point Flow"));
270310 pointflowItem.addActionListener(this);
311
+ }
271312 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275314 resetTransformItem.addActionListener(this);
276315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277316 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
317
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
318
+ resetCentroidXZItem.addActionListener(this);
319
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
320
+ transformGeometryItem.addActionListener(this);
321
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
322
+ transformChildrenItem.addActionListener(this);
280323
281324 oe.menuBar.add(menu = new Menu("Geometry"));
282325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +328,13 @@
285328 genNormalsORGANItem.addActionListener(this);
286329 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287330 genNormalsCADItem.addActionListener(this);
331
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
332
+ genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
335
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
336
+ genNormalsMINEItem.addActionListener(this);
337
+ }
288338 stripifyItem = menu.add(new MenuItem("Stripify"));
289339 stripifyItem.addActionListener(this);
290340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +356,34 @@
306356 reduce34MeshItem.addActionListener(this);
307357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308358 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
313367
314368 oe.menuBar.add(menu = new Menu("Attributes"));
315369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316370 clearMaterialsItem.addActionListener(this);
371
+ resetAllItem = menu.add(new MenuItem("Reset All"));
372
+ resetAllItem.addActionListener(this);
373
+ stepAllItem = menu.add(new MenuItem("Step All"));
374
+ stepAllItem.addActionListener(this);
317375 menu.add("-");
318376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319377 liveleavesItem.addActionListener(this);
320378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
322382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323383 supportleavesItem.addActionListener(this);
324384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325385 unsupportleavesItem.addActionListener(this);
386
+ }
326387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327388 hideleavesItem.addActionListener(this);
328389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -366,28 +427,34 @@
366427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367428 sortbynameItem.addActionListener(this);
368429 menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ // Pretty much the same as duplicate and clone.
369437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370438 extractGeometriesItem.addActionListener(this);
371439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372440 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);
441
+ }
377442
378443 oe.menuBar.add(menu = new Menu("Insert"));
379444 buildCreateMenu(menu);
380445
381
-
382446 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..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
388448 importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
390451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
391458
392459 oe.menuBar.add(menu = new Menu("Tools"));
393460 buildToolsMenu(menu);
....@@ -423,150 +490,98 @@
423490 oe.radioPanel.add(dummyButton);
424491 oe.buttonGroup.add(dummyButton);
425492 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
493
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429494
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
431497 liveCB.addItemListener(this);
432498
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);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500
+ oneStepButton.setToolTipText("Animate one step forward");
501
+ oneStepButton.addActionListener(this);
502
+
503
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
504
+ fastCB.setToolTipText("Fast mode");
451505 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);
506
+
507
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
508
+ trackCB.setToolTipText("Enable tracking");
493509 trackCB.addItemListener(this);
494510
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512
+ screenfitButton.setToolTipText("Screen fit");
497513 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
514
+
499515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500516 // 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;
505517
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);
518
+ if (Globals.ADVANCED)
519
+ {
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521
+ snapobjectButton.addActionListener(this);
522
+ snapobjectButton.setToolTipText("Snap Object");
523
+ }
524
+
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526
+ flashSelectionButton.setToolTipText("Show selection");
512527 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516528
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
530
+
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532
+ twoButton.setToolTipText("Show center view only");
519533 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521535 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
536
+ fourButton.setToolTipText("Show left panel only");
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538
+ sixButton.setToolTipText("2-column layout left");
523539 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541
+ threeButton.setToolTipText("2-column layout right");
525542 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544
+ sevenButton.setToolTipText("3-column layout");
527545 sevenButton.addActionListener(this);
528546 //
529547
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
+ rootButton.setToolTipText("Edit selection in new tab");
531550 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553
+ closeButton.setToolTipText("Close tab");
534554 closeButton.addActionListener(this);
535555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536556 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538557
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
558
+ cGridBag commandsPanel = new cGridBag();
559
+
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ editButton.setToolTipText("Edit selection");
541562 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545563
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
547566 uneditButton.addActionListener(this);
548567
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);
568
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
+ allParamsButton.setToolTipText("Edit all params");
561570 allParamsButton.addActionListener(this);
562571
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);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ clearPanelButton.setToolTipText("Clear edit panel");
574
+ clearPanelButton.addActionListener(this);
575
+
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ unselectButton.setToolTipText("Unselect");
568578 unselectButton.addActionListener(this);
569579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
570585 // oe.aConstraints.gridx += 1;
571586 // oe.aConstraints.weighty = 0;
572587 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +593,37 @@
578593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579594 // gcButton.addActionListener(this);
580595
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;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
592599 //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);
600
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594601 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
599605
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);
606
+ cGridBag copyOptionsPanel = new cGridBag();
607
+
608
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
+ colorCB.setToolTipText("Copy color when dropped");
604610 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
611
+
612
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
+ materialCB.setToolTipText("Copy material when dropped");
607614 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
615
+
616
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
+ textureCB.setToolTipText("Copy texture when dropped");
610618 textureCB.addItemListener(this);
611619
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
614623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
615627 //jList.addListSelectionListener(this);
616628 oe.jTree.addTreeSelectionListener(this);
617629 //jTree.setRootVisible(false);
....@@ -633,17 +645,89 @@
633645 radio.layout = sevenButton;
634646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635647 }
648
+
649
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
650
+ {
651
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
652
+ boxCB.setToolTipText("Display bounding boxes");
653
+ boxCB.addItemListener(this);
654
+
655
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
656
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
657
+ zoomBoxCB.addItemListener(this);
658
+
659
+ if (true) // Globals.ADVANCED)
660
+ {
661
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
+ supportCB.setToolTipText("Enable rigging");
663
+ supportCB.addItemListener(this);
664
+
665
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
666
+ // localCB.addItemListener(this);
667
+
668
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
669
+ crowdCB.setToolTipText("Used for crowds");
670
+ crowdCB.addItemListener(this);
671
+
672
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
673
+ smoothCB.setToolTipText("Snapping delay");
674
+ smoothCB.addItemListener(this);
675
+
676
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
677
+ slowCB.setToolTipText("Smooth interpolation");
678
+ slowCB.addItemListener(this);
679
+
680
+// constraints.gridy += 1;
681
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
682
+// speakerMocapCB.addItemListener(this);
683
+
684
+ if (false)
685
+ {
686
+ // handled in scripts
687
+ //constraints.gridy += 1;
688
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
689
+ speakerCameraCB.addItemListener(this);
690
+
691
+ //constraints.gridy += 1;
692
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
693
+ speakerFocusCB.addItemListener(this);
694
+
695
+ //constraints.gridy += 1;
696
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
697
+ smoothfocusCB.addItemListener(this);
698
+ }
699
+
700
+//constraints.gridx += 1;
701
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
702
+// debugCB.addItemListener(this);
703
+
704
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
705
+ oeilCB.addItemListener(this);
706
+
707
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
708
+ lookAtCB.setToolTipText("Look-at target");
709
+ lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
718
+
719
+ }
636720
637721 void EditObject(Object3D obj)
638722 {
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();
723
+ cRadio radioButton = new cRadio(obj.name);
724
+ radioButton.SetObject(obj);
725
+ radioButton.layout = sevenButton;
726
+ radioButton.SetCamera(cameraView.renderCamera, false);
727
+ radioButton.addActionListener(this);
728
+ radioPanel.add(radioButton);
729
+ buttonGroup.add(radioButton);
730
+ radioButton.doClick();
647731 }
648732 void SetupViews(ObjEditor oe)
649733 {
....@@ -663,6 +747,7 @@
663747 JCheckBox fastCB;
664748 JCheckBox slowCB;
665749 JCheckBox boxCB;
750
+ JCheckBox zoomBoxCB;
666751 JCheckBox trackCB;
667752 JCheckBox smoothfocusCB;
668753 // JCheckBox speakerMocapCB;
....@@ -705,8 +790,7 @@
705790 dropAttributes |= Object3D.TEXTURE;
706791 else
707792 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
793
+ } else if(e.getSource() == liveCB)
710794 {
711795 cameraView.ToggleLive();
712796 }
....@@ -743,6 +827,10 @@
743827 Recompile();
744828 cameraView.repaint();
745829 // refreshContents();
830
+ }
831
+ else if(e.getSource() == zoomBoxCB)
832
+ {
833
+ cameraView.ToggleZoomBoxMode();
746834 }
747835 else if(e.getSource() == smoothfocusCB)
748836 {
....@@ -857,7 +945,9 @@
857945 // objEditor.DropFile((java.io.File[]) object, true);
858946 // return;
859947 // }
860
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
861951 {
862952 // file(s)
863953 String[] names = string.split("\n");
....@@ -884,7 +974,7 @@
884974
885975 flashIt = false;
886976 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
888978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
889979
890980 if (group.selection.size() == 1)
....@@ -911,11 +1001,11 @@
9111001 {
9121002 loadClipboard(true);
9131003 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1004
+ pasteInto(false, false);
9151005 } else {
9161006 loadClipboard(false);
9171007 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1008
+ pasteInto(false, false); // true); // ???
9191009 }
9201010 }
9211011 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1123,37 @@
10331123 torusItem.addActionListener(this);
10341124 superItem = menu.add(new MenuItem("Superellipsoid"));
10351125 superItem.addActionListener(this);
1126
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1127
+ kleinItem.addActionListener(this);
10361128 particleItem = menu.add(new MenuItem("Particle system"));
10371129 particleItem.addActionListener(this);
1130
+ if (Globals.ADVANCED)
1131
+ {
10381132 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391133 ragdollItem.addActionListener(this);
10401134 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411135 ragdoll2Item.addActionListener(this);
1136
+ }
10421137 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1138
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441139 meshItem.addActionListener(this);
10451140 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461141 // meshGroupItem.addActionListener(this);
1142
+ if (Globals.ADVANCED)
1143
+ {
10471144 springItem = menu.add(new MenuItem("Spring"));
10481145 springItem.addActionListener(this);
10491146 flagItem = menu.add(new MenuItem("Flag"));
10501147 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);
10551148 blobItem = menu.add(new MenuItem("Blob"));
10561149 blobItem.addActionListener(this);
10571150 latheItem = menu.add(new MenuItem("Lathe"));
10581151 latheItem.addActionListener(this);
1152
+ }
1153
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1154
+ bezierItem.addActionListener(this);
1155
+ overlayItem = menu.add(new MenuItem("Overlay"));
1156
+ overlayItem.addActionListener(this);
10591157 lightItem = menu.add(new MenuItem("Light"));
10601158 lightItem.addActionListener(this);
10611159 menu.add("-");
....@@ -1065,34 +1163,39 @@
10651163 loopItem.addActionListener(this);
10661164 doubleItem = menu.add(new MenuItem("Fork"));
10671165 doubleItem.addActionListener(this);
1166
+ if (Globals.ADVANCED)
1167
+ {
10681168 tripleItem = menu.add(new MenuItem("Trident"));
10691169 tripleItem.addActionListener(this);
1170
+ }
10701171 }
10711172
10721173 void buildToolsMenu(Menu menu)
10731174 {
10741175 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751176 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1177
+ animationItem.setState(Globals.ANIMATION);
10771178
10781179 menu.add("-");
10791180 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801181 parseverticesItem.addActionListener(this);
10811182 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821183 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1184
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841185 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871186 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881187 reduceMorphItem.addActionListener(this);
10891188 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901189 reduce34MorphItem.addActionListener(this);
1091
-
1190
+ menu.add("-");
10921191 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931192 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951193
1194
+ if (Globals.ADVANCED)
1195
+ {
1196
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1197
+ mirrorItem.addActionListener(this);
1198
+ menu.add("-");
10961199 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971200 memoryItem.addActionListener(this);
10981201 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1209,8 @@
11061209 resetParentItem.addActionListener(this);
11071210 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081211 repairParentItem.addActionListener(this);
1212
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1213
+ repairShadowItem.addActionListener(this);
11091214 menu.add(invariantsItem = new MenuItem("Invariants"));
11101215 invariantsItem.addActionListener(this);
11111216 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1218,7 @@
11131218 menu.add("-");
11141219 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151220 editScriptItem.addActionListener(this);
1221
+ }
11161222 }
11171223
11181224 void ScreenFit()
....@@ -1441,9 +1547,9 @@
14411547
14421548 void Overwrite(int mask)
14431549 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451551 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
14471553
14481554 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491555 content = ((cGroup)content).get(0);
....@@ -1466,6 +1572,7 @@
14661572 //
14671573 public void actionPerformed(ActionEvent event) // , Object arg)
14681574 {
1575
+ Object source = event.getSource();
14691576 /*
14701577 if (event.getSource() == nameField)
14711578 {
....@@ -1477,11 +1584,11 @@
14771584 }
14781585 else
14791586 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1587
+ if (source == lookAtItem || source == lookFromItem)
14811588 {
14821589 ScreenFit();
14831590 } else
1484
- if (event.getSource() == switchItem)
1591
+ if (source == switchItem)
14851592 {
14861593 cVector v1 = new cVector();
14871594 cVector v2 = new cVector();
....@@ -1490,11 +1597,11 @@
14901597 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911598 objEditor.cameraView.repaint();
14921599 } else
1493
- if (event.getSource() == rectoidItem)
1600
+ if (source == rectoidItem)
14941601 {
14951602 makeSomething(new Box());
14961603 } else
1497
- if (event.getSource() == particleItem)
1604
+ if (source == particleItem)
14981605 {
14991606 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001607 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1622,9 @@
15151622 applyExample(particleGeom, "SMOKE");
15161623 makeSomething(particleGeom);
15171624 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1625
+ if (source == ragdollItem || source == ragdoll2Item)
15191626 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1627
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211628
15221629 ragdoll.toParent = LA.newMatrix();
15231630 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1642,7 @@
15351642 } else
15361643 /*
15371644 */
1538
- if (event.getSource() == heightFieldItem)
1645
+ if (source == heightFieldItem)
15391646 {
15401647 Object3D obj = new Object3D();
15411648
....@@ -1573,27 +1680,31 @@
15731680
15741681 makeSomething(obj);
15751682 } else
1576
- if (event.getSource() == gridItem)
1683
+ if (source == gridItem)
15771684 {
15781685 makeSomething(new Grid());
15791686 } else
1580
- if (event.getSource() == ellipsoidItem)
1687
+ if (source == ellipsoidItem)
15811688 {
15821689 makeSomething(new Sphere());
15831690 } else
1584
- if (event.getSource() == coneItem)
1691
+ if (source == coneItem)
15851692 {
15861693 makeSomething(new Cone());
15871694 } else
1588
- if (event.getSource() == torusItem)
1695
+ if (source == torusItem)
15891696 {
15901697 makeSomething(new Torus());
15911698 } else
1592
- if (event.getSource() == superItem)
1699
+ if (source == superItem)
15931700 {
15941701 makeSomething(new Superellipsoid());
15951702 } else
1596
- if (event.getSource() == blobItem)
1703
+ if (source == kleinItem)
1704
+ {
1705
+ makeSomething(new Klein());
1706
+ } else
1707
+ if (source == blobItem)
15971708 {
15981709 Blob blob = new Blob();
15991710 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1712,15 @@
16011712 //blob.retile();
16021713 makeSomething(blob);
16031714 } else
1604
- if (event.getSource() == latheItem)
1715
+ if (source == latheItem)
16051716 {
16061717 makeSomething(new Lathe());
16071718 } else
1608
- if (event.getSource() == bezierItem)
1719
+ if (source == bezierItem)
16091720 {
16101721 makeSomething(new BezierSurface());
16111722 } else
1612
- if (event.getSource() == checkerItem)
1723
+ if (source == overlayItem)
16131724 {
16141725 /*
16151726 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1735,7 @@
16241735 */
16251736 makeSomething(new Checker());
16261737 } else
1627
- if (event.getSource() == meshItem)
1738
+ if (source == meshItem)
16281739 {
16291740 Object3D itemtomake = new Object3D();
16301741 Object3D child;
....@@ -1645,35 +1756,35 @@
16451756 makeSomething(child);
16461757 }
16471758 } else
1648
- if (event.getSource() == springItem)
1759
+ if (source == springItem)
16491760 {
16501761 cSpring s = new cSpring();
16511762 s.setup();
16521763 makeSomething(s);
16531764 } else
1654
- if (event.getSource() == flagItem)
1765
+ if (source == flagItem)
16551766 {
16561767 cSpring s = new cFlag();
16571768 s.setup();
16581769 makeSomething(s);
16591770 } else
1660
- if (event.getSource() == lightItem)
1771
+ if (source == lightItem)
16611772 {
16621773 makeSomething(new Light());
16631774 } else
1664
- if (event.getSource() == csgItem)
1775
+ if (source == csgItem)
16651776 {
16661777 group(new CSG());
16671778 } else
1668
- if (event.getSource() == templateItem)
1779
+ if (source == templateItem)
16691780 {
16701781 group(new cTemplate());
16711782 } else
1672
- if (event.getSource() == attributeItem)
1783
+ if (source == attributeItem)
16731784 {
16741785 makeSomething(new Attribute());
16751786 } else
1676
- if (event.getSource() == pointflowItem)
1787
+ if (source == pointflowItem)
16771788 {
16781789 makeSomething(new PointFlow());
16791790 } else
....@@ -1685,7 +1796,7 @@
16851796 } else
16861797 */
16871798
1688
- if (event.getSource() == superLoopItem)
1799
+ if (source == superLoopItem)
16891800 {
16901801 Composite g = new cGroup();
16911802 for (int i=0; i<15; i++)
....@@ -1707,7 +1818,7 @@
17071818
17081819 group(g);
17091820 } else
1710
- if (event.getSource() == loopItem)
1821
+ if (source == loopItem)
17111822 {
17121823 Composite csg = new GroupLeaf();
17131824 csg.count = 5;
....@@ -1716,7 +1827,7 @@
17161827 csg.addChild(child);
17171828 child.addChild(csg);
17181829 } else
1719
- if (event.getSource() == doubleItem)
1830
+ if (source == doubleItem)
17201831 {
17211832 Composite csg = new GroupLeaf();
17221833 csg.count = 5;
....@@ -1728,7 +1839,7 @@
17281839 csg.addChild(child);
17291840 child.addChild(csg);
17301841 } else
1731
- if (event.getSource() == tripleItem)
1842
+ if (source == tripleItem)
17321843 {
17331844 Composite csg = new GroupLeaf();
17341845 csg.count = 4;
....@@ -1744,70 +1855,83 @@
17441855 child.addChild(csg);
17451856 } else
17461857
1747
- if (event.getSource() == importGFDItem)
1858
+ if (source == importGFDItem)
17481859 {
17491860 ImportGFD();
17501861 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1862
+ if (source == importVRMLX3DItem)
17521863 {
17531864 ImportVRMLX3D();
17541865 } else
1755
- if (event.getSource() == import3DSItem)
1866
+ if (source == import3DSItem)
17561867 {
17571868 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581869 } else
1759
- if (event.getSource() == importOBJItem)
1870
+ if (source == importOBJItem)
17601871 {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1872
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
+ browser.setVisible(true);
1875
+ String filename = browser.getFile();
1876
+ if (filename != null && filename.length() > 0)
1877
+ {
1878
+ String fullname = browser.getDirectory() + filename;
1879
+ makeSomething(ReadOBJ(fullname), true);
1880
+ }
17621881 } else
1763
- if (event.getSource() == computeAOItem)
1882
+ if (source == computeAOItem)
17641883 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1884
+ Globals.drawMode = CameraPane.OCCLUSION;
1885
+ Globals.theRenderer.repaint();
17671886 } else
1768
- if (event.getSource() == recompileItem)
1887
+ if (source == recompileItem)
17691888 {
17701889 Recompile();
17711890 refreshContents();
17721891 } else
1773
- if (event.getSource() == editScriptItem)
1892
+ if (source == editScriptItem)
17741893 {
17751894 OpenDialog();
17761895 refreshContents();
17771896 } else
1778
- if (event.getSource() == invariantsItem)
1897
+ if (source == invariantsItem)
17791898 {
17801899 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
17821901 } else
1783
- if (event.getSource() == memoryItem)
1902
+ if (source == memoryItem)
17841903 {
17851904 //System.out.println("Invariants:");
17861905 PrintMemory();
17871906 } else
1788
- if (event.getSource() == pathItem)
1907
+ if (source == pathItem)
17891908 {
17901909 PrintPath();
17911910 } else
1792
- if (event.getSource() == analyzeItem)
1911
+ if (source == analyzeItem)
17931912 {
17941913 AnalyzeObject();
17951914 } else
1796
- if (event.getSource() == dumpItem)
1915
+ if (source == dumpItem)
17971916 {
17981917 DumpObject();
17991918 } else
1800
- if (event.getSource() == screenfitButton)
1919
+ if (source == oneStepButton)
1920
+ {
1921
+ Globals.ONESTEP = true;
1922
+ cameraView.repaint();
1923
+ } else
1924
+ if (source == screenfitButton)
18011925 {
18021926 //Reload(lastConverter, lastFilename, true);
18031927 ScreenFit();
18041928 } else
1805
- if (event.getSource() == screenfitpointButton)
1929
+ if (source == screenfitpointButton)
18061930 {
18071931 //Reload(lastConverter, lastFilename, true);
18081932 ScreenFitPoint();
18091933 } else
1810
- if (event.getSource() == snapobjectButton)
1934
+ if (source == snapobjectButton)
18111935 {
18121936 //Reload(lastConverter, lastFilename, true);
18131937 SnapObject();
....@@ -1818,13 +1942,13 @@
18181942 // Recompile();
18191943 // refreshContents();
18201944 // } else
1821
- if (event.getSource() == gcButton)
1945
+ if (source == gcButton)
18221946 {
18231947 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241948 System.gc();
18251949 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261950 } else
1827
- if (event.getSource() == editLeafItem)
1951
+ if (source == editLeafItem)
18281952 {
18291953 Object3D obj;
18301954 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +1962,70 @@
18381962 }
18391963 refreshContents(true);
18401964 } else
1841
- if (event.getSource() == openWindowItem)
1965
+ if (source == openWindowItem)
18421966 {
18431967 EditSelection(true);
18441968 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1969
+ if (source == cutItem || source == clearButton)
18461970 {
18471971 loadClipboard(true);
18481972 } else
1849
- if (event.getSource() == duplicateItem)
1973
+ if (source == duplicateItem)
18501974 {
1851
- Object3D keep = GraphreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
18521976 loadClipboard(false);
18531977 paste(false);
1854
- GraphreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
18551979 } else
1856
- if (event.getSource() == cloneItem)
1980
+ if (source == cloneItem)
18571981 {
18581982 CloneSelection(false);
18591983 } else
1860
- if (event.getSource() == cloneSupportItem)
1984
+ if (source == cloneSupportItem)
18611985 {
18621986 CloneSelection(true);
18631987 } else
1864
- if (event.getSource() == copyItem)
1988
+ if (source == copyItem)
18651989 {
18661990 loadClipboard(false);
18671991 } else
1868
- if (event.getSource() == pasteItem)
1992
+ if (source == pasteItem)
18691993 {
18701994 paste(false);
18711995 } else
1872
- if (event.getSource() == pasteLinkItem)
1996
+ if (source == pasteIntoItem)
18731997 {
1874
- pasteInto(false);
1998
+ pasteInto(true, false);
18751999 } else
1876
- if (event.getSource() == pasteCloneItem)
2000
+ if (source == pasteLinkItem)
18772001 {
1878
- pasteInto(true);
2002
+ pasteInto(false, false);
18792003 } else
1880
- if (event.getSource() == pasteExpandItem)
2004
+ if (source == pasteCloneItem)
2005
+ {
2006
+ pasteInto(true, true);
2007
+ } else
2008
+ if (source == pasteExpandItem)
18812009 {
18822010 paste(true);
18832011 } else
1884
- if (event.getSource() == synchronizeItem)
2012
+ if (source == synchronizeItem)
18852013 {
18862014 Overwrite(Object3D.TRANSFORM);
18872015 } else
1888
- if (event.getSource() == overwriteNameItem)
2016
+ if (source == overwriteNameItem)
18892017 {
18902018 Overwrite(Object3D.NAME);
18912019 } else
1892
- if (event.getSource() == overwriteUVItem)
2020
+ if (source == overwriteUVItem)
18932021 {
18942022 Overwrite(Object3D.UV);
18952023 } else
1896
- if (event.getSource() == overwriteMatItem)
2024
+ if (source == overwriteMatItem)
18972025 {
2026
+ /* july 2015
18982027 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2028
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002029 else
19012030 {
19022031 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2037,16 @@
19082037 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092038 }
19102039 }
2040
+ */
2041
+
2042
+ Overwrite(dropAttributes);
19112043 }
1912
- if (event.getSource() == overwriteGeoItem)
2044
+ if (source == overwriteGeoItem)
19132045 {
19142046 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2047
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162048 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2049
+// Object3D content = GrafreeD.clipboard.get(0);
19182050 //
19192051 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202052 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2058,7 @@
19262058 // refreshContents();
19272059 // }
19282060 } else
1929
- if (event.getSource() == generateMeshItem)
2061
+ if (source == generateMeshItem)
19302062 {
19312063 //if (group.selection.size() == 1)
19322064 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2069,7 @@
19372069 ResetModel();
19382070 refreshContents();
19392071 } else
1940
- if (event.getSource() == extractGeometriesItem)
2072
+ if (source == extractGeometriesItem)
19412073 {
19422074 boolean one = false;
19432075
....@@ -1964,7 +2096,7 @@
19642096 ResetModel();
19652097 refreshContents();
19662098 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2099
+ if (source == cloneGeometriesItem)
19682100 {
19692101 boolean one = false;
19702102
....@@ -1990,32 +2122,37 @@
19902122 ResetModel();
19912123 refreshContents();
19922124 } else
1993
- if (event.getSource() == shareGeometriesItem)
2125
+ if (source == shareGeometriesItem)
19942126 {
19952127 boolean one = false;
19962128
19972129 if (group.selection.size() == 1)
19982130 one = true;
19992131
2132
+ Object3D merge = null;
2133
+
20002134 Object3D content = new cGroup();
20012135
20022136 for (int i=0; i<group.selection.size(); i++)
20032137 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2138
+ merge = new Merge(group.selection.get(i));
20052139
20062140 if (one)
2007
- makeSomething(sel, false);
2141
+ makeSomething(merge, false);
20082142 else
2009
- content.addChild(sel);
2143
+ content.addChild(merge);
20102144 }
20112145
20122146 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2147
+ makeSomething(content, true);
2148
+ else
2149
+ {
2150
+ ResetModel();
2151
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2152
+ refreshContents();
2153
+ }
20172154 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2155
+ if (source == mergeGeometriesItem)
20192156 {
20202157 boolean one = false;
20212158
....@@ -2045,11 +2182,11 @@
20452182 ResetModel();
20462183 refreshContents();
20472184 } else
2048
- if (event.getSource() == linkverticesItem)
2185
+ if (source == linkverticesItem)
20492186 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2187
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512188 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2189
+// Object3D content = GrafreeD.clipboard.get(0);
20532190 //
20542191 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552192 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2195,48 @@
20582195 // group.selection.get(0).setMasterThis(content); // should be identity
20592196 // refreshContents();
20602197 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622199 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
20642201
20652202 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662203 content = ((cGroup)content).get(0);
20672204
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2205
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692206 for (int i=0; i<group.selection.size(); i++)
20702207 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2208
+ boolean random = CameraPane.SWITCH;
2209
+ CameraPane.SWITCH = false; // parse all random nodes
20732210 group.selection.get(i).linkVerticesThis(content);
20742211 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2212
+ CameraPane.SWITCH = random;
20762213 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2214
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782215 refreshContents();
20792216 }
20802217 } else
2081
- if (event.getSource() == resetsupportItem)
2218
+ if (source == resetsupportItem)
20822219 {
20832220 for (int i=0; i<group.selection.size(); i++)
20842221 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2222
+ boolean random = CameraPane.SWITCH;
2223
+ CameraPane.SWITCH = false; // parse all random nodes
20872224 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2225
+ CameraPane.SWITCH = random;
20892226 }
20902227
20912228 refreshContents();
20922229 } else
2093
- if (event.getSource() == resetreferencesItem)
2230
+ if (source == relinkverticesItem)
2231
+ {
2232
+ boolean random = CameraPane.SWITCH;
2233
+ CameraPane.SWITCH = false; // parse all random nodes
2234
+ group.selection.RelinkToSupport();
2235
+ CameraPane.SWITCH = random;
2236
+
2237
+ refreshContents();
2238
+ } else
2239
+ if (source == resetreferencesItem)
20942240 {
20952241 for (int i=0; i<group.selection.size(); i++)
20962242 {
....@@ -2099,11 +2245,11 @@
20992245
21002246 refreshContents();
21012247 } else
2102
- if (event.getSource() == setMasterItem)
2248
+ if (source == setMasterItem)
21032249 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052251 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
21072253
21082254 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092255 content = ((cGroup)content).get(0);
....@@ -2112,13 +2258,13 @@
21122258 refreshContents();
21132259 }
21142260 } else
2115
- if (event.getSource() == poseMeshItem)
2261
+ if (source == poseMeshItem)
21162262 {
21172263 if (group.selection.size() == 1)
21182264 {
2119
- if (GraphreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
21202266 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
21222268
21232269 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242270 content = ((cGroup)content).get(0);
....@@ -2131,19 +2277,19 @@
21312277 }
21322278
21332279 } else
2134
- if (event.getSource() == revertMeshItem)
2280
+ if (source == revertMeshItem)
21352281 {
21362282 RevertMeshes();
21372283 } else
2138
- if (event.getSource() == resetMeshItem)
2284
+ if (source == resetAllItem)
21392285 {
21402286 ResetAll();
21412287 } else
2142
- if (event.getSource() == stepAllItem)
2288
+ if (source == stepAllItem)
21432289 {
21442290 StepAll();
21452291 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2292
+ if (source == clearItem) // || event.getSource() == clearButton)
21472293 {
21482294 //int indices[] = jList.getSelectedIndices();
21492295 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2297,46 @@
21512297
21522298 ClearSelection(false);
21532299 } else
2154
- if (event.getSource() == clearAllItem)
2300
+ if (source == clearAllItem)
21552301 {
21562302 ClearSelection(true);
21572303 } else
2158
- if (event.getSource() == grabItem)
2304
+ if (source == grabItem)
21592305 {
21602306 group(new cGroup(), true);
21612307 } else
2162
- if (event.getSource() == frontItem)
2308
+ if (source == hideItem)
2309
+ {
2310
+ group(new HiddenObject());
2311
+ } else
2312
+ if (source == frontItem)
21632313 {
21642314 front();
21652315 } else
2166
- if (event.getSource() == backItem)
2316
+ if (source == backItem)
21672317 {
21682318 back();
21692319 } else
2170
- if (event.getSource() == cameraItem)
2320
+ if (source == cameraItem)
21712321 {
21722322 makeSomething(new Camera());
21732323 } else
2174
- if (event.getSource() == compositeItem)
2324
+ if (source == compositeItem)
21752325 {
21762326 group(new Composite());
21772327 } else
2178
- if (event.getSource() == randomItem)
2328
+ if (source == randomItem)
21792329 {
21802330 RandomNode random = new RandomNode();
21812331 group(random);
21822332 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2333
+ random.name = random.get(0).name + "Switch";
21842334 } else
2185
- if (event.getSource() == physicsItem)
2335
+ if (source == physicsItem)
21862336 {
21872337 group(new PhysicsNode());
21882338 } else
2189
- if (event.getSource() == frameselectorItem)
2339
+ if (source == frameselectorItem)
21902340 {
21912341 for (int i=0; i<group.selection.size(); i++)
21922342 {
....@@ -2198,7 +2348,7 @@
21982348 ResetModel();
21992349 refreshContents();
22002350 } else
2201
- if (event.getSource() == switchGeoItem)
2351
+ if (source == switchGeoItem)
22022352 {
22032353 for (int i=0; i<group.selection.size(); i++)
22042354 {
....@@ -2210,7 +2360,7 @@
22102360 ResetModel();
22112361 refreshContents();
22122362 } else
2213
- if (event.getSource() == switchTransfoItem)
2363
+ if (source == switchTransfoItem)
22142364 {
22152365 for (int i=0; i<group.selection.size(); i++)
22162366 {
....@@ -2222,7 +2372,7 @@
22222372 ResetModel();
22232373 refreshContents();
22242374 } else
2225
- if (event.getSource() == morphItem)
2375
+ if (source == morphItem)
22262376 {
22272377 for (int i=0; i<group.selection.size(); i++)
22282378 {
....@@ -2234,7 +2384,7 @@
22342384 ResetModel();
22352385 refreshContents();
22362386 } else
2237
- if (event.getSource() == scriptNodeItem)
2387
+ if (source == scriptNodeItem)
22382388 {
22392389 boolean atleastone = false;
22402390
....@@ -2273,195 +2423,223 @@
22732423 }
22742424 }
22752425 } else
2276
- if (event.getSource() == linkerItem)
2426
+ if (source == linkerItem)
22772427 {
22782428 group(new cLinker());
22792429 } else
2280
- if (event.getSource() == textureItem)
2430
+ if (source == textureItem)
22812431 {
22822432 group(new TextureNode());
22832433 } else
2284
- if (event.getSource() == shadowXItem)
2434
+ if (source == billboardItem)
2435
+ {
2436
+ group(new BillboardNode());
2437
+ } else
2438
+ if (source == shadowXItem)
22852439 {
22862440 CastShadow(0);
22872441 } else
2288
- if (event.getSource() == shadowYItem)
2442
+ if (source == shadowYItem)
22892443 {
22902444 CastShadow(1);
22912445 } else
2292
- if (event.getSource() == shadowZItem)
2446
+ if (source == shadowZItem)
22932447 {
22942448 CastShadow(2);
22952449 } else
2296
- if (event.getSource() == ungroupItem)
2450
+ if (source == ungroupItem)
22972451 {
2298
- ungroup();
2452
+ //ungroup();
2453
+ for (int i=0; i<group.selection.size(); i++)
2454
+ {
2455
+ Ungroup(group.selection.get(i));
2456
+ }
2457
+
2458
+ ClearSelection(false);
2459
+
2460
+ refreshContents();
22992461 } else
2300
- if (event.getSource() == genUVItem)
2462
+ if (source == genUVItem)
23012463 {
23022464 GenUV();
23032465 } else
2304
- if (event.getSource() == genNormalsCADItem)
2466
+ if (source == genNormalsCADItem)
23052467 {
23062468 GenNormals(true);
23072469 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2470
+ if (source == genNormalsMESHItem)
2471
+ {
2472
+ GenNormals(true); // TODO
2473
+ } else
2474
+ if (source == genNormalsORGANItem)
23092475 {
23102476 GenNormals(false);
23112477 } else
2312
- if (event.getSource() == stripifyItem)
2478
+ if (source == genNormalsMINEItem)
2479
+ {
2480
+ GenNormalsMINE();
2481
+ } else
2482
+ if (source == stripifyItem)
23132483 {
23142484 Stripify();
23152485 } else
2316
- if (event.getSource() == unstripifyItem)
2486
+ if (source == unstripifyItem)
23172487 {
23182488 Unstripify();
23192489 } else
2320
- if (event.getSource() == trimItem)
2490
+ if (source == trimItem)
23212491 {
23222492 Trim();
23232493 } else
2324
- if (event.getSource() == untrimItem)
2494
+ if (source == untrimItem)
23252495 {
23262496 Untrim();
23272497 } else
2328
- if (event.getSource() == clearColorsItem)
2498
+ if (source == clearColorsItem)
23292499 {
23302500 ClearColors();
23312501 } else
2332
- if (event.getSource() == clearMaterialsItem)
2502
+ if (source == clearMaterialsItem)
23332503 {
23342504 ClearMaterials();
23352505 } else
2336
- if (event.getSource() == liveleavesItem)
2506
+ if (source == liveleavesItem)
23372507 {
23382508 LiveLeaves(true);
23392509 } else
2340
- if (event.getSource() == unliveleavesItem)
2510
+ if (source == unliveleavesItem)
23412511 {
23422512 LiveLeaves(false);
23432513 } else
2344
- if (event.getSource() == supportleavesItem)
2514
+ if (source == supportleavesItem)
23452515 {
23462516 SupportLeaves(true);
23472517 } else
2348
- if (event.getSource() == unsupportleavesItem)
2518
+ if (source == unsupportleavesItem)
23492519 {
23502520 SupportLeaves(false);
23512521 } else
2352
- if (event.getSource() == hideleavesItem)
2522
+ if (source == hideleavesItem)
23532523 {
23542524 HideLeaves(true);
23552525 } else
2356
- if (event.getSource() == showleavesItem)
2526
+ if (source == showleavesItem)
23572527 {
23582528 HideLeaves(false);
23592529 } else
2360
- if (event.getSource() == markleavesItem)
2530
+ if (source == markleavesItem)
23612531 {
23622532 MarkLeaves(true);
23632533 } else
2364
- if (event.getSource() == unmarkleavesItem)
2534
+ if (source == unmarkleavesItem)
23652535 {
23662536 MarkLeaves(false);
23672537 } else
2368
- if (event.getSource() == flipVItem)
2538
+ if (source == flipVItem)
23692539 {
23702540 FlipV(true);
23712541 } else
2372
- if (event.getSource() == unflipVItem)
2542
+ if (source == unflipVItem)
23732543 {
23742544 FlipV(false);
23752545 } else
2376
- if (event.getSource() == lowTexturesItem)
2546
+ if (source == lowTexturesItem)
23772547 {
23782548 SetTexRes(0);
23792549 } else
2380
- if (event.getSource() == normalTexturesItem)
2550
+ if (source == normalTexturesItem)
23812551 {
23822552 SetTexRes(1);
23832553 } else
2384
- if (event.getSource() == highTexturesItem)
2554
+ if (source == highTexturesItem)
23852555 {
23862556 SetTexRes(2);
23872557 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2558
+ if (source == veryhighTexturesItem)
23892559 {
23902560 SetTexRes(3);
23912561 } else
2392
- if (event.getSource() == maxTexturesItem)
2562
+ if (source == maxTexturesItem)
23932563 {
23942564 SetTexRes(4);
23952565 } else
2396
- if (event.getSource() == panoTexturesItem)
2566
+ if (source == panoTexturesItem)
23972567 {
23982568 SetTexRes(5);
23992569 } else
2400
- if (event.getSource() == reverseNormalsItem)
2570
+ if (source == reverseNormalsItem)
24012571 {
24022572 ReverseNormals();
24032573 } else
2404
- if (event.getSource() == parseverticesItem)
2574
+ if (source == parseverticesItem)
24052575 {
24062576 ParseVertices();
24072577 } else
2408
- if (event.getSource() == textureFieldItem)
2578
+ if (source == textureFieldItem)
24092579 {
24102580 TextureVertices();
24112581 } else
2412
- if (event.getSource() == alignItem)
2582
+ if (source == alignItem)
24132583 {
24142584 Align();
24152585 } else
2416
- if (event.getSource() == mirrorItem)
2586
+ if (source == mirrorItem)
24172587 {
24182588 MirrorPoses();
24192589 } else
2420
- if (event.getSource() == reduceMorphItem)
2590
+ if (source == reduceMorphItem)
24212591 {
24222592 MeshReduction(false);
24232593 } else
2424
- if (event.getSource() == reduce34MorphItem)
2594
+ if (source == reduce34MorphItem)
24252595 {
24262596 MeshReduction(true);
24272597 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2598
+ if (source == reverseTrianglesItem)
24292599 {
24302600 ReverseTriangles();
24312601 } else
2432
- if (event.getSource() == reduceMeshItem)
2602
+ if (source == reduceMeshItem)
24332603 {
24342604 ReduceMesh(false);
24352605 } else
2436
- if (event.getSource() == reduce34MeshItem)
2606
+ if (source == reduce34MeshItem)
24372607 {
24382608 ReduceMesh(true);
24392609 } else
2440
- if (event.getSource() == increaseMeshItem)
2610
+ if (source == increaseMeshItem)
24412611 {
24422612 IncreaseMesh();
24432613 } else
2444
- if (event.getSource() == clipMeshItem)
2614
+ if (source == clipMeshItem)
24452615 {
24462616 ClipMesh();
24472617 } else
2448
- if (event.getSource() == smoothMeshItem)
2618
+ if (source == smoothMeshItem)
24492619 {
24502620 SmoothMesh();
24512621 } else
2452
- if (event.getSource() == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
24532623 {
24542624 TransformGeometry();
24552625 } else
2456
- if (event.getSource() == resetTransformItem)
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
2629
+ } else
2630
+ if (source == resetTransformItem)
24572631 {
24582632 ResetTransform();
24592633 } else
2460
- if (event.getSource() == resetCentroidItem)
2634
+ if (source == resetCentroidItem)
24612635 {
2462
- ResetCentroid();
2636
+ ResetCentroid(true);
24632637 } else
2464
- if (event.getSource() == resetParentItem)
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
2641
+ } else
2642
+ if (source == resetParentItem)
24652643 {
24662644 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672645 {
....@@ -2471,7 +2649,7 @@
24712649
24722650 refreshContents();
24732651 } else
2474
- if (event.getSource() == repairParentItem)
2652
+ if (source == repairParentItem)
24752653 {
24762654 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772655 {
....@@ -2485,7 +2663,21 @@
24852663
24862664 refreshContents();
24872665 } else
2488
- if (event.getSource() == sortbysizeItem)
2666
+ if (source == repairShadowItem)
2667
+ {
2668
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2669
+ {
2670
+ Object3D obj = (Object3D)e.nextElement();
2671
+ obj.RepairShadow();
2672
+// for (int i=0; i<obj.size(); i++)
2673
+// {
2674
+// obj.get(i).parent = obj;
2675
+// }
2676
+ }
2677
+
2678
+ refreshContents();
2679
+ } else
2680
+ if (source == sortbysizeItem)
24892681 {
24902682 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912683 {
....@@ -2497,7 +2689,7 @@
24972689 ResetModel();
24982690 refreshContents();
24992691 } else
2500
- if (event.getSource() == sortbynameItem)
2692
+ if (source == sortbynameItem)
25012693 {
25022694 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032695 {
....@@ -2509,7 +2701,7 @@
25092701 ResetModel();
25102702 refreshContents();
25112703 } else
2512
- if (event.getSource() == attachPigmentItem)
2704
+ if (source == attachPigmentItem)
25132705 {
25142706 String texture = GetFile("Attach pigment");
25152707 Object3D obj;
....@@ -2521,7 +2713,7 @@
25212713
25222714 refreshContents();
25232715 } else
2524
- if (event.getSource() == detachPigmentItem)
2716
+ if (source == detachPigmentItem)
25252717 {
25262718 Object3D obj;
25272719 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2724,7 @@
25322724
25332725 refreshContents();
25342726 } else
2535
- if (event.getSource() == attachBumpItem)
2727
+ if (source == attachBumpItem)
25362728 {
25372729 String texture = GetFile("Attach bump");
25382730 Object3D obj;
....@@ -2544,7 +2736,7 @@
25442736
25452737 refreshContents();
25462738 } else
2547
- if (event.getSource() == detachBumpItem)
2739
+ if (source == detachBumpItem)
25482740 {
25492741 Object3D obj;
25502742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2747,7 @@
25552747
25562748 refreshContents();
25572749 } else
2558
- if (event.getSource() == pigmentBumpItem)
2750
+ if (source == pigmentBumpItem)
25592751 {
25602752 Object3D obj;
25612753 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2758,195 @@
25662758
25672759 refreshContents();
25682760 } else
2569
- if (event.getSource() == flashSelectionButton)
2761
+ if (source == flashSelectionButton)
25702762 {
25712763 CameraPane.flash = true;
25722764 refreshContents();
25732765 } else
2574
- if (event.getSource() == oneButton)
2766
+ if (source == oneButton)
25752767 {
25762768 } else
2577
- if (event.getSource() == twoButton)
2769
+ if (source == twoButton)
25782770 {
25792771 radio.layout = twoButton;
25802772 // bug
25812773 //gridPanel.setDividerLocation(1.0);
25822774 //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();
2775
+// bigThree.remove(scenePanel);
2776
+// bigThree.remove(centralPanel);
2777
+// bigThree.remove(XYZPanel);
2778
+// aWindowConstraints.gridx = 0;
2779
+// aWindowConstraints.gridy = 0;
2780
+// aWindowConstraints.gridwidth = 1;
2781
+// // aConstraints.gridheight = 3;
2782
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2783
+// aWindowConstraints.weightx = 0;
2784
+// aWindowConstraints.weighty = 1;
2785
+// //bigThree.add(jtp, aWindowConstraints);
2786
+// aWindowConstraints.weightx = 1;
2787
+// aWindowConstraints.gridwidth = 3;
2788
+// // aConstraints.gridheight = 3;
2789
+// aWindowConstraints.gridx = 1;
2790
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2791
+// bigThree.add(centralPanel, aWindowConstraints);
2792
+// aWindowConstraints.weightx = 0;
2793
+// aWindowConstraints.gridx = 4;
2794
+// aWindowConstraints.gridwidth = 1;
2795
+// // aConstraints.gridheight = 3;
2796
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2797
+// //bigThree.add(XYZPanel, aWindowConstraints);
2798
+// scenePanel.setVisible(false);
2799
+// centralPanel.setVisible(true);
2800
+// XYZPanel.setVisible(false);
2801
+ bigThree.ClearUI();
2802
+ bigThree.add(centralPanel);
2803
+ bigThree.FlushUI();
26072804 } else
2608
- if (event.getSource() == threeButton)
2805
+ if (source == threeButton)
26092806 {
26102807 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();
2808
+
2809
+// bigThree.remove(scenePanel);
2810
+// bigThree.remove(centralPanel);
2811
+// bigThree.remove(XYZPanel);
2812
+// aWindowConstraints.gridx = 0;
2813
+// aWindowConstraints.gridy = 0;
2814
+// aWindowConstraints.gridwidth = 1;
2815
+// // aConstraints.gridheight = 3;
2816
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2817
+// aWindowConstraints.weightx = 0;
2818
+// aWindowConstraints.weighty = 1;
2819
+// //bigThree.add(jtp, aWindowConstraints);
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.gridwidth = 3;
2822
+// // aConstraints.gridheight = 3;
2823
+// aWindowConstraints.gridx = 1;
2824
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2825
+// bigThree.add(centralPanel, aWindowConstraints);
2826
+// aWindowConstraints.weightx = 0;
2827
+// aWindowConstraints.gridx = 4;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// bigThree.add(XYZPanel, aWindowConstraints);
2832
+// bigThree.validate();
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(true);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.add(XYZPanel);
2839
+ bigThree.FlushUI();
26352840 } else
2636
- if (event.getSource() == fourButton)
2841
+ if (source == fourButton)
26372842 {
26382843 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();
2844
+
2845
+// bigThree.remove(scenePanel);
2846
+// bigThree.remove(centralPanel);
2847
+// bigThree.remove(XYZPanel);
2848
+// aWindowConstraints.gridx = 0;
2849
+// aWindowConstraints.gridy = 0;
2850
+// aWindowConstraints.gridwidth = 1;
2851
+// // aWindowConstraints.gridheight = 3;
2852
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2853
+// aWindowConstraints.weightx = 1;
2854
+// aWindowConstraints.weighty = 1;
2855
+// bigThree.add(scenePanel, aWindowConstraints);
2856
+// aWindowConstraints.weightx = 1;
2857
+// aWindowConstraints.gridwidth = 3;
2858
+// // aConstraints.gridheight = 3;
2859
+// aWindowConstraints.gridx = 1;
2860
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2861
+// //bigThree.add(cameraPanel, aWindowConstraints);
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.gridx = 4;
2864
+// aWindowConstraints.gridwidth = 1;
2865
+// // aWindowConstraints.gridheight = 3;
2866
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2867
+// //bigThree.add(XYZPanel, aWindowConstraints);
2868
+// bigThree.validate();
2869
+// scenePanel.setVisible(true);
2870
+// centralPanel.setVisible(false);
2871
+// XYZPanel.setVisible(false);
2872
+ bigThree.ClearUI();
2873
+ bigThree.add(scenePanel);
2874
+ bigThree.FlushUI();
26632875 } else
2664
- if (event.getSource() == sixButton)
2876
+ if (source == sixButton)
26652877 {
26662878 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();
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
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2888
+// aWindowConstraints.weightx = 0;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aWindowConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// bigThree.add(centralPanel, 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, aConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(true);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.add(centralPanel);
2910
+ bigThree.FlushUI();
26912911 } else
2692
- if (event.getSource() == sevenButton)
2912
+ if (source == sevenButton)
26932913 {
26942914 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();
2915
+
2916
+// bigThree.remove(scenePanel);
2917
+// bigThree.remove(centralPanel);
2918
+// bigThree.remove(XYZPanel);
2919
+// aWindowConstraints.gridx = 0;
2920
+// aWindowConstraints.gridy = 0;
2921
+// aWindowConstraints.gridwidth = 1;
2922
+// // aWindowConstraints.gridheight = 3;
2923
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.weighty = 1;
2926
+// bigThree.add(scenePanel, aWindowConstraints);
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.gridwidth = 3;
2929
+// // aWindowConstraints.gridheight = 3;
2930
+// aWindowConstraints.gridx = 1;
2931
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2932
+// bigThree.add(centralPanel, aWindowConstraints);
2933
+// aWindowConstraints.weightx = 0;
2934
+// aWindowConstraints.gridx = 4;
2935
+// aWindowConstraints.gridwidth = 1;
2936
+// // aConstraints.gridheight = 3;
2937
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2938
+// bigThree.add(XYZPanel, aWindowConstraints);
2939
+// bigThree.validate();
2940
+// scenePanel.setVisible(true);
2941
+// centralPanel.setVisible(true);
2942
+// XYZPanel.setVisible(true);
2943
+ bigThree.ClearUI();
2944
+ bigThree.add(scenePanel);
2945
+ bigThree.add(centralPanel);
2946
+ bigThree.add(XYZPanel);
2947
+ bigThree.FlushUI();
27192948 } else
2720
- if (event.getSource() == rootButton)
2949
+ if (source == rootButton)
27212950 {
27222951 Object3D obj;
27232952 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +2958,7 @@
27292958
27302959 refreshContents(true);
27312960 } else
2732
- if (event.getSource() == closeButton)
2961
+ if (source == closeButton)
27332962 {
27342963 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27352964 cRadio ab;
....@@ -2750,11 +2979,11 @@
27502979 }
27512980 refreshContents(true);
27522981 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
2982
+ if (source == editItem || source == editButton)
27542983 {
27552984 EditSelection(false);
27562985 } else
2757
- if (event.getSource() == uneditButton)
2986
+ if (source == uneditButton)
27582987 {
27592988 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27602989 {
....@@ -2766,12 +2995,12 @@
27662995
27672996 child.editWindow = null; // ???????????
27682997 }
2769
- objEditor.ctrlPanel.revalidate();
2998
+ objEditor.ctrlPanel.FlushUI();
27702999 //objEditor.jTree.clearSelection();
27713000 //objEditor.ResetSliders();
27723001 refreshContents(true);
27733002 } else
2774
- if (event.getSource() == clearPanelButton)
3003
+ if (source == clearPanelButton)
27753004 {
27763005 assert(copy == group);
27773006 //copy.ClearUI();
....@@ -2782,7 +3011,7 @@
27823011 listUI.clear();
27833012 refreshContents(true);
27843013 } else
2785
- if (event.getSource() == allParamsButton)
3014
+ if (source == allParamsButton)
27863015 {
27873016 assert(copy == group);
27883017
....@@ -2803,19 +3032,19 @@
28033032
28043033 refreshContents(true);
28053034 } else
2806
- if (event.getSource() == unselectButton)
3035
+ if (source == unselectButton)
28073036 {
28083037 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3038
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103039 objEditor.ResetSliders();
28113040 refreshContents(true);
28123041 } else
2813
- if(event.getSource() instanceof cRadio)
3042
+ if(source instanceof cRadio)
28143043 {
28153044 group.parent = keepparent;
28163045 group.attributes = 0;
28173046 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3047
+ /*cRadio*/ radio = (cRadio)source;
28193048 Object3D obj = radio.GetObject();
28203049 System.out.println("Edit " + obj);
28213050 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3064,7 @@
28353064 }
28363065
28373066 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3067
+ //Globals.theRenderer.object = group;
28393068 if(!useclient)
28403069 {
28413070 cameraView.renderCamera = radio.camera;
....@@ -2844,7 +3073,8 @@
28443073 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453074 cameraView.targetLookAt.set(radio.camera.lookAt);
28463075 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3076
+ //cameraView.lighttouched = true;
3077
+ Globals.lighttouched = true;
28483078 topView.object = group;
28493079 frontView.object = group;
28503080 sideView.object = group;
....@@ -2880,7 +3110,7 @@
28803110 if (useclient)
28813111 {
28823112 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3113
+ Globals.lighttouched = true;
28843114 //topView.object = client;
28853115 //frontView.object = client;
28863116 //sideView.object = client;
....@@ -2888,7 +3118,7 @@
28883118 else
28893119 {
28903120 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3121
+ Globals.lighttouched = true;
28923122 //topView.object = group;
28933123 //frontView.object = group;
28943124 //sideView.object = group;
....@@ -2923,6 +3153,28 @@
29233153 refreshContents();
29243154 }
29253155
3156
+ void TransformChildren()
3157
+ {
3158
+ Object3D obj;
3159
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3160
+ {
3161
+ obj = (Object3D)e.nextElement();
3162
+ obj.KeepTextureMatrices();
3163
+ obj.TransformChildren();
3164
+ obj.RestoreTextureMatrices();
3165
+
3166
+// if (obj.parent == null)
3167
+// {
3168
+// System.out.println("NULL PARENT!");
3169
+// new Exception().printStackTrace();
3170
+// }
3171
+// else
3172
+// TouchTransform(obj);
3173
+// //obj.parent.Touch();
3174
+ }
3175
+
3176
+ refreshContents();
3177
+ }
29263178
29273179 void ResetTransform()
29283180 {
....@@ -3035,7 +3287,7 @@
30353287 refreshContents();
30363288 }
30373289
3038
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
30393291 {
30403292 Object3D obj;
30413293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3302,16 @@
30503302 LA.matIdentity(Object3D.mat);
30513303 obj.getBounds(minima, maxima, false);
30523304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553308 obj.TransformMesh(Object3D.mat);
3309
+
30563310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
30593315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3121,9 +3377,9 @@
31213377 obj = (Object3D)e.nextElement();
31223378
31233379 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
31253381 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
31273383
31283384 // System.err.println((size/1024) + " KB is the size of " + obj);
31293385 }
....@@ -3165,6 +3421,13 @@
31653421 void GenNormals(boolean crease)
31663422 {
31673423 group.GenNormalsS(crease);
3424
+
3425
+ refreshContents();
3426
+ }
3427
+
3428
+ void GenNormalsMINE()
3429
+ {
3430
+ group.selection.GenNormalsMINE();
31683431
31693432 refreshContents();
31703433 }
....@@ -3250,7 +3513,7 @@
32503513 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513514 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523515 //
3253
-// g.add(GraphreeD.clipboard);
3516
+// g.add(GrafreeD.clipboard);
32543517 //
32553518 // buffer.add(g);
32563519 // }
....@@ -3269,8 +3532,8 @@
32693532 // nodes = new Object3D();
32703533 // vertices = new Vector<Vertex>();
32713534 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3535
+// boolean epsequal = GrafreeD.epsequal;
3536
+// GrafreeD.epsequal = true;
32743537 //
32753538 // for (int i=0; i<group.selection.size(); i++)
32763539 // {
....@@ -3311,7 +3574,7 @@
33113574 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123575 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133576 //
3314
-// g.add(GraphreeD.clipboard);
3577
+// g.add(GrafreeD.clipboard);
33153578 //
33163579 // buffer.add(g);
33173580 // }
....@@ -3319,7 +3582,7 @@
33193582 // makeSomething(buffer, i==group.selection.size()-1);
33203583 // }
33213584 //
3322
-// GraphreeD.epsequal = epsequal;
3585
+// GrafreeD.epsequal = epsequal;
33233586 //
33243587 // //buffer = null;
33253588 // temprep = null;
....@@ -3330,8 +3593,8 @@
33303593
33313594 void ParseVertices()
33323595 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
33353598
33363599 for (int i=0; i<group.selection.size(); i++)
33373600 {
....@@ -3356,7 +3619,7 @@
33563619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583621
3359
- g.add(GraphreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
33603623
33613624 buffer.add(g);
33623625 }
....@@ -3371,7 +3634,7 @@
33713634 makeSomething(buffer, i==group.selection.size()-1);
33723635 }
33733636
3374
- GraphreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
33753638
33763639 refreshContents();
33773640 }
....@@ -3389,7 +3652,16 @@
33893652 String pigment = Object3D.GetPigment(tex);
33903653 //String bump = Object3D.GetBump(tex);
33913654
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3655
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3656
+
3657
+ try
3658
+ {
3659
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3660
+ }
3661
+ catch (Exception e)
3662
+ {
3663
+ System.err.println("FAIL: " + node);
3664
+ }
33933665
33943666 double s = v.s;
33953667
....@@ -3416,7 +3688,7 @@
34163688 scale /= 3;
34173689
34183690 scale /= 0xFF;
3419
- scale /= 4;
3691
+ // c'est quoi ca? scale /= 4;
34203692
34213693 //v.AO = scale;
34223694
....@@ -3437,12 +3709,26 @@
34373709
34383710 void Align()
34393711 {
3712
+ if (group.selection.size() == 0)
3713
+ return;
3714
+
3715
+ cVector bbmin = new cVector();
3716
+ cVector bbmax = new cVector();
3717
+
3718
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3719
+
3720
+ double dx = bbmax.x - bbmin.x;
3721
+ double dy = bbmax.y - bbmin.y;
3722
+ double dz = bbmax.z - bbmin.z;
3723
+
3724
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3725
+
34403726 for (int i=0; i<group.selection.size(); i++)
34413727 {
34423728 Object3D obj = group.selection.get(i);
34433729
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3730
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3731
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463732 }
34473733
34483734 refreshContents();
....@@ -3455,7 +3741,7 @@
34553741 // ref.SaveSupports();
34563742 // Object3D par = ref.parent;
34573743 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3744
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593745 // ref.parent = par;
34603746 // ref.RestoreSupports();
34613747
....@@ -3463,11 +3749,11 @@
34633749
34643750 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34653751
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
3752
+ boolean random = CameraPane.SWITCH;
3753
+ CameraPane.SWITCH = false; // parse all random nodes
34683754 lowres.linkVerticesThis(null);
34693755 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
3756
+ CameraPane.SWITCH = random;
34713757
34723758 System.err.flush();
34733759
....@@ -3485,7 +3771,7 @@
34853771 // lowres.SaveSupports();
34863772 // par = lowres.parent;
34873773 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3774
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893775 Object3D newlow = CloneObject(lowres, false);
34903776 newlow.name = sn.switchobject.get(i).name;
34913777 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3793,7 @@
35073793 return;
35083794
35093795 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3796
+ Object3D ref = Grafreed.clipboard.get(0);
35113797
35123798 Object3D newgroup = new Object3D("Po:" + poses.name);
35133799
....@@ -3676,7 +3962,7 @@
36763962 group.selection.RelinkToSupport(); // july 2014
36773963 System.out.println("DONE.");
36783964 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3965
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36803966 }
36813967
36823968 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +3987,20 @@
37013987
37023988 void ClipMesh()
37033989 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3990
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37053991 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
3992
+ Object3D content = Grafreed.clipboard.get(0);
37073993
37083994 if (content instanceof cGroup && ((cGroup)content).transientlink )
37093995 content = ((cGroup)content).get(0);
37103996
37113997 // for (int i=0; i<group.selection.size(); i++)
37123998 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3999
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144000 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4001
+ group.selection.ClipMesh(Grafreed.clipboard);
37164002 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4003
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184004 System.out.println("DONE.");
37194005 refreshContents();
37204006 }
....@@ -3952,25 +4238,25 @@
39524238 System.err.println("info : " + child.GetPath());
39534239 }
39544240 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4241
+// else
4242
+// {
4243
+// objEditor.SetMaterial(group); // .GetMaterial());
4244
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4245
+// System.err.println("info : " + group.GetPath());
4246
+// }
39614247
39624248 objEditor.SetText(); // jan 2014
39634249
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4250
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39654251 CameraPane.flash = true;
39664252
39674253 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39684254 // a camera
39694255 {
39704256 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;
4257
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4258
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4259
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744260 }
39754261
39764262 refreshContents();
....@@ -4052,12 +4338,12 @@
40524338 {
40534339 if (group.selection.isEmpty())
40544340 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4341
+ Grafreed.clipboardIsTempGroup = false;
40564342 Composite tGroup = null;
40574343 if (group.selection.size() > 0) // 1)
40584344 {
40594345 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4346
+ Grafreed.clipboardIsTempGroup = true;
40614347 }
40624348
40634349 if (cut)
....@@ -4097,16 +4383,16 @@
40974383 //System.out.println("cut " + child);
40984384 //System.out.println("parent = " + child.parent);
40994385 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4386
+ if (Grafreed.clipboardIsTempGroup)
41014387 tGroup.add/*Child*/(tmp);
41024388 else
4103
- GraphreeD.clipboard = tmp;
4389
+ Grafreed.clipboard = tmp;
41044390 }
41054391 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4392
+ if (Grafreed.clipboardIsTempGroup)
41074393 tGroup.add/*Child*/(child);
41084394 else
4109
- GraphreeD.clipboard = child;
4395
+ Grafreed.clipboard = child;
41104396 }
41114397
41124398 //ResetModel();
....@@ -4138,21 +4424,21 @@
41384424 //System.out.println("cut " + elem);
41394425 //System.out.println("parent = " + elem.parent);
41404426 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4427
+ if (Grafreed.clipboardIsTempGroup)
41424428 tGroup.add/*Child*/(tmp);
41434429 else
4144
- GraphreeD.clipboard = tmp;
4430
+ Grafreed.clipboard = tmp;
41454431 }
41464432 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4433
+ if (Grafreed.clipboardIsTempGroup)
41484434 tGroup.add/*Child*/(child);
41494435 else
4150
- GraphreeD.clipboard = child;
4436
+ Grafreed.clipboard = child;
41514437 }
41524438
41534439 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4440
+ if (Grafreed.clipboardIsTempGroup)
4441
+ Grafreed.clipboard = tGroup;
41564442 if (cut)
41574443 {
41584444 ResetModel();
....@@ -4162,11 +4448,11 @@
41624448
41634449 void paste(boolean expand)
41644450 {
4165
- // if (GraphreeD.clipboard == null)
4451
+ // if (GrafreeD.clipboard == null)
41664452 // return;
41674453 boolean first = true;
41684454
4169
- if (GraphreeD.clipboardIsTempGroup)
4455
+ if (Grafreed.clipboardIsTempGroup)
41704456 {
41714457 Composite temp;
41724458
....@@ -4177,7 +4463,7 @@
41774463 temp = (Composite)Applet3D.clipboard.deepCopy();
41784464 */
41794465 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4466
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814467 {
41824468 Object3D child = (Object3D)e.nextElement();
41834469
....@@ -4191,7 +4477,7 @@
41914477 else
41924478 elem = child.deepCopy(); // ?
41934479 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4480
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954481 // elem = elem.get(0);
41964482 makeSomething(elem, true); // ?? first);
41974483 //group.addChild(elem);
....@@ -4211,23 +4497,23 @@
42114497 //Object3D cb = Applet3D.clipboard;
42124498 //temp.addChild(cb);
42134499 //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());
4500
+ assert(Grafreed.clipboard.parent == null);
4501
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4502
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4503
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4504
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194505 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4506
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4507
+ Grafreed.clipboard.get(0).parent = keepparent;
42224508 }
42234509
42244510 ResetModel();
42254511 refreshContents();
42264512 }
42274513
4228
- void pasteInto(boolean copyit)
4514
+ void pasteInto(boolean copyit, boolean clone)
42294515 {
4230
-// if (GraphreeD.clipboard == null)
4516
+// if (GrafreeD.clipboard == null)
42314517 // return;
42324518
42334519 if (group.selection.size() != 1)
....@@ -4254,15 +4540,22 @@
42544540 if (copyit)
42554541 {
42564542 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4543
+ if (clone)
4544
+ {
4545
+ CloneClipboard(false); // sept 2014
4546
+ }
4547
+ else
4548
+ {
4549
+ paste(false);
4550
+ }
42584551 }
42594552 else
42604553 {
42614554 boolean first = true;
42624555
4263
- if (GraphreeD.clipboardIsTempGroup)
4556
+ if (Grafreed.clipboardIsTempGroup)
42644557 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4558
+ Composite temp = (Composite)Grafreed.clipboard;
42664559 Object3D copy;
42674560 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684561 {
....@@ -4272,7 +4565,7 @@
42724565 }
42734566 } else
42744567 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4568
+ linkSomething(Grafreed.clipboard); //.get(0));
42764569 }
42774570 }
42784571 }
....@@ -4464,6 +4757,26 @@
44644757 makeSomething(csg);
44654758 }
44664759
4760
+ void Ungroup(Object3D g)
4761
+ {
4762
+ if (g instanceof HiddenObject)
4763
+ {
4764
+ HiddenObject h = (HiddenObject) g;
4765
+
4766
+ for (int i=0; i<h.ActualSize(); i++)
4767
+ {
4768
+ objEditor.makeSomething(h.get(i), false);
4769
+ }
4770
+ }
4771
+ else
4772
+ {
4773
+ for (int i=0; i<g.Size(); i++)
4774
+ {
4775
+ objEditor.makeSomething(g.get(i), false);
4776
+ }
4777
+ }
4778
+ }
4779
+
44674780 void ungroup()
44684781 {
44694782 /*
....@@ -4659,7 +4972,7 @@
46594972
46604973 void ImportGFD()
46614974 {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4975
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
46634976 browser.show();
46644977 String filename = browser.getFile();
46654978 if (filename != null && filename.length() > 0)
....@@ -4697,7 +5010,7 @@
46975010
46985011 void ImportVRMLX3D()
46995012 {
4700
- if (GraphreeD.standAlone)
5013
+ if (Grafreed.standAlone)
47015014 {
47025015 /**/
47035016 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4714,7 +5027,7 @@
47145027
47155028 String GetFile(String dialogName)
47165029 {
4717
- if (GraphreeD.standAlone)
5030
+ if (Grafreed.standAlone)
47185031 {
47195032 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205033 browser.show();
....@@ -4778,10 +5091,12 @@
47785091 cButton flashSelectionButton;
47795092 cButton editButton;
47805093 cButton uneditButton;
5094
+ JCheckBox allParamsButton;
47815095 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835096 cButton unselectButton;
47845097
5098
+ cButton oneStepButton;
5099
+
47855100 cButton screenfitButton;
47865101 cButton screenfitpointButton;
47875102 cButton snapobjectButton;
....@@ -4823,8 +5138,9 @@
48235138 private MenuItem resetsupportItem;
48245139 private MenuItem resetreferencesItem;
48255140 private MenuItem linkverticesItem;
5141
+ private MenuItem relinkverticesItem;
48265142 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5143
+ private MenuItem resetAllItem;
48285144 private MenuItem stepAllItem;
48295145 private MenuItem revertMeshItem;
48305146 private MenuItem poseMeshItem;
....@@ -4835,14 +5151,17 @@
48355151 private MenuItem mergeGeometriesItem;
48365152 private MenuItem copyItem;
48375153 private MenuItem pasteItem;
5154
+ private MenuItem pasteIntoItem;
48385155 private MenuItem pasteLinkItem;
48395156 private MenuItem pasteCloneItem;
48405157 private MenuItem pasteExpandItem;
48415158 private MenuItem clearItem;
48425159 private MenuItem clearAllItem;
48435160 private MenuItem genUVItem;
5161
+ private MenuItem genNormalsMESHItem;
48445162 private MenuItem genNormalsCADItem;
48455163 private MenuItem genNormalsORGANItem;
5164
+ private MenuItem genNormalsMINEItem;
48465165 private MenuItem stripifyItem;
48475166 private MenuItem unstripifyItem;
48485167 private MenuItem trimItem;
....@@ -4882,8 +5201,11 @@
48825201 private MenuItem panoTexturesItem;
48835202
48845203 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5204
+ private MenuItem resetCentroidXZItem;
48865205 private MenuItem resetTransformItem;
5206
+ private MenuItem transformGeometryItem;
5207
+ private MenuItem transformChildrenItem;
5208
+ private MenuItem hideItem;
48875209 private MenuItem grabItem;
48885210 private MenuItem backItem;
48895211 private MenuItem frontItem;
....@@ -4904,6 +5226,7 @@
49045226
49055227 private MenuItem resetParentItem;
49065228 private MenuItem repairParentItem;
5229
+ private MenuItem repairShadowItem;
49075230 private MenuItem sortbysizeItem;
49085231 private MenuItem sortbynameItem;
49095232
....@@ -4924,10 +5247,11 @@
49245247 private MenuItem coneItem;
49255248 private MenuItem torusItem;
49265249 private MenuItem superItem;
5250
+ private MenuItem kleinItem;
49275251 private MenuItem blobItem;
49285252 private MenuItem latheItem;
49295253 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5254
+ private MenuItem overlayItem;
49315255 private MenuItem meshItem;
49325256 // private MenuItem meshGroupItem;
49335257 private MenuItem springItem;
....@@ -4936,6 +5260,7 @@
49365260 private MenuItem csgItem;
49375261 private MenuItem templateItem;
49385262 private MenuItem textureItem;
5263
+ private MenuItem billboardItem;
49395264 private MenuItem shadowXItem;
49405265 private MenuItem shadowYItem;
49415266 private MenuItem shadowZItem;