Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
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,18 +645,91 @@
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 }
732
+
648733 void SetupViews(ObjEditor oe)
649734 {
650735 oe.SetupViews();
....@@ -663,6 +748,7 @@
663748 JCheckBox fastCB;
664749 JCheckBox slowCB;
665750 JCheckBox boxCB;
751
+ JCheckBox zoomBoxCB;
666752 JCheckBox trackCB;
667753 JCheckBox smoothfocusCB;
668754 // JCheckBox speakerMocapCB;
....@@ -705,8 +791,7 @@
705791 dropAttributes |= Object3D.TEXTURE;
706792 else
707793 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
794
+ } else if(e.getSource() == liveCB)
710795 {
711796 cameraView.ToggleLive();
712797 }
....@@ -743,6 +828,10 @@
743828 Recompile();
744829 cameraView.repaint();
745830 // refreshContents();
831
+ }
832
+ else if(e.getSource() == zoomBoxCB)
833
+ {
834
+ cameraView.ToggleZoomBoxMode();
746835 }
747836 else if(e.getSource() == smoothfocusCB)
748837 {
....@@ -857,7 +946,9 @@
857946 // objEditor.DropFile((java.io.File[]) object, true);
858947 // return;
859948 // }
860
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
861952 {
862953 // file(s)
863954 String[] names = string.split("\n");
....@@ -884,7 +975,7 @@
884975
885976 flashIt = false;
886977 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
888979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
889980
890981 if (group.selection.size() == 1)
....@@ -911,11 +1002,11 @@
9111002 {
9121003 loadClipboard(true);
9131004 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1005
+ pasteInto(false, false);
9151006 } else {
9161007 loadClipboard(false);
9171008 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9191010 }
9201011 }
9211012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1124,37 @@
10331124 torusItem.addActionListener(this);
10341125 superItem = menu.add(new MenuItem("Superellipsoid"));
10351126 superItem.addActionListener(this);
1127
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1128
+ kleinItem.addActionListener(this);
10361129 particleItem = menu.add(new MenuItem("Particle system"));
10371130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10381133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391134 ragdollItem.addActionListener(this);
10401135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411136 ragdoll2Item.addActionListener(this);
1137
+ }
10421138 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441140 meshItem.addActionListener(this);
10451141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10471145 springItem = menu.add(new MenuItem("Spring"));
10481146 springItem.addActionListener(this);
10491147 flagItem = menu.add(new MenuItem("Flag"));
10501148 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);
10551149 blobItem = menu.add(new MenuItem("Blob"));
10561150 blobItem.addActionListener(this);
10571151 latheItem = menu.add(new MenuItem("Lathe"));
10581152 latheItem.addActionListener(this);
1153
+ }
1154
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1155
+ bezierItem.addActionListener(this);
1156
+ overlayItem = menu.add(new MenuItem("Overlay"));
1157
+ overlayItem.addActionListener(this);
10591158 lightItem = menu.add(new MenuItem("Light"));
10601159 lightItem.addActionListener(this);
10611160 menu.add("-");
....@@ -1065,34 +1164,39 @@
10651164 loopItem.addActionListener(this);
10661165 doubleItem = menu.add(new MenuItem("Fork"));
10671166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
10681169 tripleItem = menu.add(new MenuItem("Trident"));
10691170 tripleItem.addActionListener(this);
1171
+ }
10701172 }
10711173
10721174 void buildToolsMenu(Menu menu)
10731175 {
10741176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751177 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
10771179
10781180 menu.add("-");
10791181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801182 parseverticesItem.addActionListener(this);
10811183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821184 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841186 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881188 reduceMorphItem.addActionListener(this);
10891189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901190 reduce34MorphItem.addActionListener(this);
1091
-
1191
+ menu.add("-");
10921192 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931193 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
10961200 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971201 memoryItem.addActionListener(this);
10981202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1210,8 @@
11061210 resetParentItem.addActionListener(this);
11071211 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081212 repairParentItem.addActionListener(this);
1213
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1214
+ repairShadowItem.addActionListener(this);
11091215 menu.add(invariantsItem = new MenuItem("Invariants"));
11101216 invariantsItem.addActionListener(this);
11111217 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1219,7 @@
11131219 menu.add("-");
11141220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151221 editScriptItem.addActionListener(this);
1222
+ }
11161223 }
11171224
11181225 void ScreenFit()
....@@ -1441,9 +1548,9 @@
14411548
14421549 void Overwrite(int mask)
14431550 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451552 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14471554
14481555 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491556 content = ((cGroup)content).get(0);
....@@ -1466,6 +1573,7 @@
14661573 //
14671574 public void actionPerformed(ActionEvent event) // , Object arg)
14681575 {
1576
+ Object source = event.getSource();
14691577 /*
14701578 if (event.getSource() == nameField)
14711579 {
....@@ -1477,11 +1585,11 @@
14771585 }
14781586 else
14791587 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1588
+ if (source == lookAtItem || source == lookFromItem)
14811589 {
14821590 ScreenFit();
14831591 } else
1484
- if (event.getSource() == switchItem)
1592
+ if (source == switchItem)
14851593 {
14861594 cVector v1 = new cVector();
14871595 cVector v2 = new cVector();
....@@ -1490,11 +1598,11 @@
14901598 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911599 objEditor.cameraView.repaint();
14921600 } else
1493
- if (event.getSource() == rectoidItem)
1601
+ if (source == rectoidItem)
14941602 {
14951603 makeSomething(new Box());
14961604 } else
1497
- if (event.getSource() == particleItem)
1605
+ if (source == particleItem)
14981606 {
14991607 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001608 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1623,9 @@
15151623 applyExample(particleGeom, "SMOKE");
15161624 makeSomething(particleGeom);
15171625 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1626
+ if (source == ragdollItem || source == ragdoll2Item)
15191627 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1628
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211629
15221630 ragdoll.toParent = LA.newMatrix();
15231631 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1643,7 @@
15351643 } else
15361644 /*
15371645 */
1538
- if (event.getSource() == heightFieldItem)
1646
+ if (source == heightFieldItem)
15391647 {
15401648 Object3D obj = new Object3D();
15411649
....@@ -1573,27 +1681,31 @@
15731681
15741682 makeSomething(obj);
15751683 } else
1576
- if (event.getSource() == gridItem)
1684
+ if (source == gridItem)
15771685 {
15781686 makeSomething(new Grid());
15791687 } else
1580
- if (event.getSource() == ellipsoidItem)
1688
+ if (source == ellipsoidItem)
15811689 {
15821690 makeSomething(new Sphere());
15831691 } else
1584
- if (event.getSource() == coneItem)
1692
+ if (source == coneItem)
15851693 {
15861694 makeSomething(new Cone());
15871695 } else
1588
- if (event.getSource() == torusItem)
1696
+ if (source == torusItem)
15891697 {
15901698 makeSomething(new Torus());
15911699 } else
1592
- if (event.getSource() == superItem)
1700
+ if (source == superItem)
15931701 {
15941702 makeSomething(new Superellipsoid());
15951703 } else
1596
- if (event.getSource() == blobItem)
1704
+ if (source == kleinItem)
1705
+ {
1706
+ makeSomething(new Klein());
1707
+ } else
1708
+ if (source == blobItem)
15971709 {
15981710 Blob blob = new Blob();
15991711 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1713,15 @@
16011713 //blob.retile();
16021714 makeSomething(blob);
16031715 } else
1604
- if (event.getSource() == latheItem)
1716
+ if (source == latheItem)
16051717 {
16061718 makeSomething(new Lathe());
16071719 } else
1608
- if (event.getSource() == bezierItem)
1720
+ if (source == bezierItem)
16091721 {
16101722 makeSomething(new BezierSurface());
16111723 } else
1612
- if (event.getSource() == checkerItem)
1724
+ if (source == overlayItem)
16131725 {
16141726 /*
16151727 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1736,7 @@
16241736 */
16251737 makeSomething(new Checker());
16261738 } else
1627
- if (event.getSource() == meshItem)
1739
+ if (source == meshItem)
16281740 {
16291741 Object3D itemtomake = new Object3D();
16301742 Object3D child;
....@@ -1645,35 +1757,35 @@
16451757 makeSomething(child);
16461758 }
16471759 } else
1648
- if (event.getSource() == springItem)
1760
+ if (source == springItem)
16491761 {
16501762 cSpring s = new cSpring();
16511763 s.setup();
16521764 makeSomething(s);
16531765 } else
1654
- if (event.getSource() == flagItem)
1766
+ if (source == flagItem)
16551767 {
16561768 cSpring s = new cFlag();
16571769 s.setup();
16581770 makeSomething(s);
16591771 } else
1660
- if (event.getSource() == lightItem)
1772
+ if (source == lightItem)
16611773 {
16621774 makeSomething(new Light());
16631775 } else
1664
- if (event.getSource() == csgItem)
1776
+ if (source == csgItem)
16651777 {
16661778 group(new CSG());
16671779 } else
1668
- if (event.getSource() == templateItem)
1780
+ if (source == templateItem)
16691781 {
16701782 group(new cTemplate());
16711783 } else
1672
- if (event.getSource() == attributeItem)
1784
+ if (source == attributeItem)
16731785 {
16741786 makeSomething(new Attribute());
16751787 } else
1676
- if (event.getSource() == pointflowItem)
1788
+ if (source == pointflowItem)
16771789 {
16781790 makeSomething(new PointFlow());
16791791 } else
....@@ -1685,7 +1797,7 @@
16851797 } else
16861798 */
16871799
1688
- if (event.getSource() == superLoopItem)
1800
+ if (source == superLoopItem)
16891801 {
16901802 Composite g = new cGroup();
16911803 for (int i=0; i<15; i++)
....@@ -1707,7 +1819,7 @@
17071819
17081820 group(g);
17091821 } else
1710
- if (event.getSource() == loopItem)
1822
+ if (source == loopItem)
17111823 {
17121824 Composite csg = new GroupLeaf();
17131825 csg.count = 5;
....@@ -1716,7 +1828,7 @@
17161828 csg.addChild(child);
17171829 child.addChild(csg);
17181830 } else
1719
- if (event.getSource() == doubleItem)
1831
+ if (source == doubleItem)
17201832 {
17211833 Composite csg = new GroupLeaf();
17221834 csg.count = 5;
....@@ -1728,7 +1840,7 @@
17281840 csg.addChild(child);
17291841 child.addChild(csg);
17301842 } else
1731
- if (event.getSource() == tripleItem)
1843
+ if (source == tripleItem)
17321844 {
17331845 Composite csg = new GroupLeaf();
17341846 csg.count = 4;
....@@ -1744,70 +1856,83 @@
17441856 child.addChild(csg);
17451857 } else
17461858
1747
- if (event.getSource() == importGFDItem)
1859
+ if (source == importGFDItem)
17481860 {
17491861 ImportGFD();
17501862 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1863
+ if (source == importVRMLX3DItem)
17521864 {
17531865 ImportVRMLX3D();
17541866 } else
1755
- if (event.getSource() == import3DSItem)
1867
+ if (source == import3DSItem)
17561868 {
17571869 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581870 } else
1759
- if (event.getSource() == importOBJItem)
1871
+ if (source == importOBJItem)
17601872 {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1874
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1875
+ browser.setVisible(true);
1876
+ String filename = browser.getFile();
1877
+ if (filename != null && filename.length() > 0)
1878
+ {
1879
+ String fullname = browser.getDirectory() + filename;
1880
+ makeSomething(ReadOBJ(fullname), true);
1881
+ }
17621882 } else
1763
- if (event.getSource() == computeAOItem)
1883
+ if (source == computeAOItem)
17641884 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1885
+ Globals.drawMode = CameraPane.OCCLUSION;
1886
+ Globals.theRenderer.repaint();
17671887 } else
1768
- if (event.getSource() == recompileItem)
1888
+ if (source == recompileItem)
17691889 {
17701890 Recompile();
17711891 refreshContents();
17721892 } else
1773
- if (event.getSource() == editScriptItem)
1893
+ if (source == editScriptItem)
17741894 {
17751895 OpenDialog();
17761896 refreshContents();
17771897 } else
1778
- if (event.getSource() == invariantsItem)
1898
+ if (source == invariantsItem)
17791899 {
17801900 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
17821902 } else
1783
- if (event.getSource() == memoryItem)
1903
+ if (source == memoryItem)
17841904 {
17851905 //System.out.println("Invariants:");
17861906 PrintMemory();
17871907 } else
1788
- if (event.getSource() == pathItem)
1908
+ if (source == pathItem)
17891909 {
17901910 PrintPath();
17911911 } else
1792
- if (event.getSource() == analyzeItem)
1912
+ if (source == analyzeItem)
17931913 {
17941914 AnalyzeObject();
17951915 } else
1796
- if (event.getSource() == dumpItem)
1916
+ if (source == dumpItem)
17971917 {
17981918 DumpObject();
17991919 } else
1800
- if (event.getSource() == screenfitButton)
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
1924
+ } else
1925
+ if (source == screenfitButton)
18011926 {
18021927 //Reload(lastConverter, lastFilename, true);
18031928 ScreenFit();
18041929 } else
1805
- if (event.getSource() == screenfitpointButton)
1930
+ if (source == screenfitpointButton)
18061931 {
18071932 //Reload(lastConverter, lastFilename, true);
18081933 ScreenFitPoint();
18091934 } else
1810
- if (event.getSource() == snapobjectButton)
1935
+ if (source == snapobjectButton)
18111936 {
18121937 //Reload(lastConverter, lastFilename, true);
18131938 SnapObject();
....@@ -1818,13 +1943,13 @@
18181943 // Recompile();
18191944 // refreshContents();
18201945 // } else
1821
- if (event.getSource() == gcButton)
1946
+ if (source == gcButton)
18221947 {
18231948 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241949 System.gc();
18251950 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261951 } else
1827
- if (event.getSource() == editLeafItem)
1952
+ if (source == editLeafItem)
18281953 {
18291954 Object3D obj;
18301955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +1963,70 @@
18381963 }
18391964 refreshContents(true);
18401965 } else
1841
- if (event.getSource() == openWindowItem)
1966
+ if (source == openWindowItem)
18421967 {
18431968 EditSelection(true);
18441969 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1970
+ if (source == cutItem || source == clearButton)
18461971 {
18471972 loadClipboard(true);
18481973 } else
1849
- if (event.getSource() == duplicateItem)
1974
+ if (source == duplicateItem)
18501975 {
1851
- Object3D keep = GraphreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
18521977 loadClipboard(false);
18531978 paste(false);
1854
- GraphreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
18551980 } else
1856
- if (event.getSource() == cloneItem)
1981
+ if (source == cloneItem)
18571982 {
18581983 CloneSelection(false);
18591984 } else
1860
- if (event.getSource() == cloneSupportItem)
1985
+ if (source == cloneSupportItem)
18611986 {
18621987 CloneSelection(true);
18631988 } else
1864
- if (event.getSource() == copyItem)
1989
+ if (source == copyItem)
18651990 {
18661991 loadClipboard(false);
18671992 } else
1868
- if (event.getSource() == pasteItem)
1993
+ if (source == pasteItem)
18691994 {
18701995 paste(false);
18711996 } else
1872
- if (event.getSource() == pasteLinkItem)
1997
+ if (source == pasteIntoItem)
18731998 {
1874
- pasteInto(false);
1999
+ pasteInto(true, false);
18752000 } else
1876
- if (event.getSource() == pasteCloneItem)
2001
+ if (source == pasteLinkItem)
18772002 {
1878
- pasteInto(true);
2003
+ pasteInto(false, false);
18792004 } else
1880
- if (event.getSource() == pasteExpandItem)
2005
+ if (source == pasteCloneItem)
2006
+ {
2007
+ pasteInto(true, true);
2008
+ } else
2009
+ if (source == pasteExpandItem)
18812010 {
18822011 paste(true);
18832012 } else
1884
- if (event.getSource() == synchronizeItem)
2013
+ if (source == synchronizeItem)
18852014 {
18862015 Overwrite(Object3D.TRANSFORM);
18872016 } else
1888
- if (event.getSource() == overwriteNameItem)
2017
+ if (source == overwriteNameItem)
18892018 {
18902019 Overwrite(Object3D.NAME);
18912020 } else
1892
- if (event.getSource() == overwriteUVItem)
2021
+ if (source == overwriteUVItem)
18932022 {
18942023 Overwrite(Object3D.UV);
18952024 } else
1896
- if (event.getSource() == overwriteMatItem)
2025
+ if (source == overwriteMatItem)
18972026 {
2027
+ /* july 2015
18982028 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2029
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002030 else
19012031 {
19022032 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2038,16 @@
19082038 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092039 }
19102040 }
2041
+ */
2042
+
2043
+ Overwrite(dropAttributes);
19112044 }
1912
- if (event.getSource() == overwriteGeoItem)
2045
+ if (source == overwriteGeoItem)
19132046 {
19142047 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2048
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162049 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2050
+// Object3D content = GrafreeD.clipboard.get(0);
19182051 //
19192052 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202053 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2059,7 @@
19262059 // refreshContents();
19272060 // }
19282061 } else
1929
- if (event.getSource() == generateMeshItem)
2062
+ if (source == generateMeshItem)
19302063 {
19312064 //if (group.selection.size() == 1)
19322065 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2070,7 @@
19372070 ResetModel();
19382071 refreshContents();
19392072 } else
1940
- if (event.getSource() == extractGeometriesItem)
2073
+ if (source == extractGeometriesItem)
19412074 {
19422075 boolean one = false;
19432076
....@@ -1964,7 +2097,7 @@
19642097 ResetModel();
19652098 refreshContents();
19662099 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2100
+ if (source == cloneGeometriesItem)
19682101 {
19692102 boolean one = false;
19702103
....@@ -1990,32 +2123,37 @@
19902123 ResetModel();
19912124 refreshContents();
19922125 } else
1993
- if (event.getSource() == shareGeometriesItem)
2126
+ if (source == shareGeometriesItem)
19942127 {
19952128 boolean one = false;
19962129
19972130 if (group.selection.size() == 1)
19982131 one = true;
19992132
2133
+ Object3D merge = null;
2134
+
20002135 Object3D content = new cGroup();
20012136
20022137 for (int i=0; i<group.selection.size(); i++)
20032138 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2139
+ merge = new Merge(group.selection.get(i));
20052140
20062141 if (one)
2007
- makeSomething(sel, false);
2142
+ makeSomething(merge, false);
20082143 else
2009
- content.addChild(sel);
2144
+ content.addChild(merge);
20102145 }
20112146
20122147 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2148
+ makeSomething(content, true);
2149
+ else
2150
+ {
2151
+ ResetModel();
2152
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2153
+ refreshContents();
2154
+ }
20172155 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2156
+ if (source == mergeGeometriesItem)
20192157 {
20202158 boolean one = false;
20212159
....@@ -2045,11 +2183,11 @@
20452183 ResetModel();
20462184 refreshContents();
20472185 } else
2048
- if (event.getSource() == linkverticesItem)
2186
+ if (source == linkverticesItem)
20492187 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2188
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512189 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2190
+// Object3D content = GrafreeD.clipboard.get(0);
20532191 //
20542192 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552193 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2196,48 @@
20582196 // group.selection.get(0).setMasterThis(content); // should be identity
20592197 // refreshContents();
20602198 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622200 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
20642202
20652203 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662204 content = ((cGroup)content).get(0);
20672205
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2206
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692207 for (int i=0; i<group.selection.size(); i++)
20702208 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
20732211 group.selection.get(i).linkVerticesThis(content);
20742212 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
20762214 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2215
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782216 refreshContents();
20792217 }
20802218 } else
2081
- if (event.getSource() == resetsupportItem)
2219
+ if (source == resetsupportItem)
20822220 {
20832221 for (int i=0; i<group.selection.size(); i++)
20842222 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
20872225 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
20892227 }
20902228
20912229 refreshContents();
20922230 } else
2093
- if (event.getSource() == resetreferencesItem)
2231
+ if (source == relinkverticesItem)
2232
+ {
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
2235
+ group.selection.RelinkToSupport();
2236
+ CameraPane.SWITCH = random;
2237
+
2238
+ refreshContents();
2239
+ } else
2240
+ if (source == resetreferencesItem)
20942241 {
20952242 for (int i=0; i<group.selection.size(); i++)
20962243 {
....@@ -2099,11 +2246,11 @@
20992246
21002247 refreshContents();
21012248 } else
2102
- if (event.getSource() == setMasterItem)
2249
+ if (source == setMasterItem)
21032250 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052252 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21072254
21082255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092256 content = ((cGroup)content).get(0);
....@@ -2112,13 +2259,13 @@
21122259 refreshContents();
21132260 }
21142261 } else
2115
- if (event.getSource() == poseMeshItem)
2262
+ if (source == poseMeshItem)
21162263 {
21172264 if (group.selection.size() == 1)
21182265 {
2119
- if (GraphreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21202267 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21222269
21232270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242271 content = ((cGroup)content).get(0);
....@@ -2131,19 +2278,19 @@
21312278 }
21322279
21332280 } else
2134
- if (event.getSource() == revertMeshItem)
2281
+ if (source == revertMeshItem)
21352282 {
21362283 RevertMeshes();
21372284 } else
2138
- if (event.getSource() == resetMeshItem)
2285
+ if (source == resetAllItem)
21392286 {
21402287 ResetAll();
21412288 } else
2142
- if (event.getSource() == stepAllItem)
2289
+ if (source == stepAllItem)
21432290 {
21442291 StepAll();
21452292 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2293
+ if (source == clearItem) // || event.getSource() == clearButton)
21472294 {
21482295 //int indices[] = jList.getSelectedIndices();
21492296 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +2298,46 @@
21512298
21522299 ClearSelection(false);
21532300 } else
2154
- if (event.getSource() == clearAllItem)
2301
+ if (source == clearAllItem)
21552302 {
21562303 ClearSelection(true);
21572304 } else
2158
- if (event.getSource() == grabItem)
2305
+ if (source == grabItem)
21592306 {
21602307 group(new cGroup(), true);
21612308 } else
2162
- if (event.getSource() == frontItem)
2309
+ if (source == hideItem)
2310
+ {
2311
+ group(new HiddenObject());
2312
+ } else
2313
+ if (source == frontItem)
21632314 {
21642315 front();
21652316 } else
2166
- if (event.getSource() == backItem)
2317
+ if (source == backItem)
21672318 {
21682319 back();
21692320 } else
2170
- if (event.getSource() == cameraItem)
2321
+ if (source == cameraItem)
21712322 {
21722323 makeSomething(new Camera());
21732324 } else
2174
- if (event.getSource() == compositeItem)
2325
+ if (source == compositeItem)
21752326 {
21762327 group(new Composite());
21772328 } else
2178
- if (event.getSource() == randomItem)
2329
+ if (source == randomItem)
21792330 {
21802331 RandomNode random = new RandomNode();
21812332 group(random);
21822333 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
21842335 } else
2185
- if (event.getSource() == physicsItem)
2336
+ if (source == physicsItem)
21862337 {
21872338 group(new PhysicsNode());
21882339 } else
2189
- if (event.getSource() == frameselectorItem)
2340
+ if (source == frameselectorItem)
21902341 {
21912342 for (int i=0; i<group.selection.size(); i++)
21922343 {
....@@ -2198,7 +2349,7 @@
21982349 ResetModel();
21992350 refreshContents();
22002351 } else
2201
- if (event.getSource() == switchGeoItem)
2352
+ if (source == switchGeoItem)
22022353 {
22032354 for (int i=0; i<group.selection.size(); i++)
22042355 {
....@@ -2210,7 +2361,7 @@
22102361 ResetModel();
22112362 refreshContents();
22122363 } else
2213
- if (event.getSource() == switchTransfoItem)
2364
+ if (source == switchTransfoItem)
22142365 {
22152366 for (int i=0; i<group.selection.size(); i++)
22162367 {
....@@ -2222,7 +2373,7 @@
22222373 ResetModel();
22232374 refreshContents();
22242375 } else
2225
- if (event.getSource() == morphItem)
2376
+ if (source == morphItem)
22262377 {
22272378 for (int i=0; i<group.selection.size(); i++)
22282379 {
....@@ -2234,7 +2385,7 @@
22342385 ResetModel();
22352386 refreshContents();
22362387 } else
2237
- if (event.getSource() == scriptNodeItem)
2388
+ if (source == scriptNodeItem)
22382389 {
22392390 boolean atleastone = false;
22402391
....@@ -2273,195 +2424,223 @@
22732424 }
22742425 }
22752426 } else
2276
- if (event.getSource() == linkerItem)
2427
+ if (source == linkerItem)
22772428 {
22782429 group(new cLinker());
22792430 } else
2280
- if (event.getSource() == textureItem)
2431
+ if (source == textureItem)
22812432 {
22822433 group(new TextureNode());
22832434 } else
2284
- if (event.getSource() == shadowXItem)
2435
+ if (source == billboardItem)
2436
+ {
2437
+ group(new BillboardNode());
2438
+ } else
2439
+ if (source == shadowXItem)
22852440 {
22862441 CastShadow(0);
22872442 } else
2288
- if (event.getSource() == shadowYItem)
2443
+ if (source == shadowYItem)
22892444 {
22902445 CastShadow(1);
22912446 } else
2292
- if (event.getSource() == shadowZItem)
2447
+ if (source == shadowZItem)
22932448 {
22942449 CastShadow(2);
22952450 } else
2296
- if (event.getSource() == ungroupItem)
2451
+ if (source == ungroupItem)
22972452 {
2298
- ungroup();
2453
+ //ungroup();
2454
+ for (int i=0; i<group.selection.size(); i++)
2455
+ {
2456
+ Ungroup(group.selection.get(i));
2457
+ }
2458
+
2459
+ ClearSelection(false);
2460
+
2461
+ refreshContents();
22992462 } else
2300
- if (event.getSource() == genUVItem)
2463
+ if (source == genUVItem)
23012464 {
23022465 GenUV();
23032466 } else
2304
- if (event.getSource() == genNormalsCADItem)
2467
+ if (source == genNormalsCADItem)
23052468 {
23062469 GenNormals(true);
23072470 } else
2308
- if (event.getSource() == genNormalsORGANItem)
2471
+ if (source == genNormalsMESHItem)
2472
+ {
2473
+ GenNormals(true); // TODO
2474
+ } else
2475
+ if (source == genNormalsORGANItem)
23092476 {
23102477 GenNormals(false);
23112478 } else
2312
- if (event.getSource() == stripifyItem)
2479
+ if (source == genNormalsMINEItem)
2480
+ {
2481
+ GenNormalsMINE();
2482
+ } else
2483
+ if (source == stripifyItem)
23132484 {
23142485 Stripify();
23152486 } else
2316
- if (event.getSource() == unstripifyItem)
2487
+ if (source == unstripifyItem)
23172488 {
23182489 Unstripify();
23192490 } else
2320
- if (event.getSource() == trimItem)
2491
+ if (source == trimItem)
23212492 {
23222493 Trim();
23232494 } else
2324
- if (event.getSource() == untrimItem)
2495
+ if (source == untrimItem)
23252496 {
23262497 Untrim();
23272498 } else
2328
- if (event.getSource() == clearColorsItem)
2499
+ if (source == clearColorsItem)
23292500 {
23302501 ClearColors();
23312502 } else
2332
- if (event.getSource() == clearMaterialsItem)
2503
+ if (source == clearMaterialsItem)
23332504 {
23342505 ClearMaterials();
23352506 } else
2336
- if (event.getSource() == liveleavesItem)
2507
+ if (source == liveleavesItem)
23372508 {
23382509 LiveLeaves(true);
23392510 } else
2340
- if (event.getSource() == unliveleavesItem)
2511
+ if (source == unliveleavesItem)
23412512 {
23422513 LiveLeaves(false);
23432514 } else
2344
- if (event.getSource() == supportleavesItem)
2515
+ if (source == supportleavesItem)
23452516 {
23462517 SupportLeaves(true);
23472518 } else
2348
- if (event.getSource() == unsupportleavesItem)
2519
+ if (source == unsupportleavesItem)
23492520 {
23502521 SupportLeaves(false);
23512522 } else
2352
- if (event.getSource() == hideleavesItem)
2523
+ if (source == hideleavesItem)
23532524 {
23542525 HideLeaves(true);
23552526 } else
2356
- if (event.getSource() == showleavesItem)
2527
+ if (source == showleavesItem)
23572528 {
23582529 HideLeaves(false);
23592530 } else
2360
- if (event.getSource() == markleavesItem)
2531
+ if (source == markleavesItem)
23612532 {
23622533 MarkLeaves(true);
23632534 } else
2364
- if (event.getSource() == unmarkleavesItem)
2535
+ if (source == unmarkleavesItem)
23652536 {
23662537 MarkLeaves(false);
23672538 } else
2368
- if (event.getSource() == flipVItem)
2539
+ if (source == flipVItem)
23692540 {
23702541 FlipV(true);
23712542 } else
2372
- if (event.getSource() == unflipVItem)
2543
+ if (source == unflipVItem)
23732544 {
23742545 FlipV(false);
23752546 } else
2376
- if (event.getSource() == lowTexturesItem)
2547
+ if (source == lowTexturesItem)
23772548 {
23782549 SetTexRes(0);
23792550 } else
2380
- if (event.getSource() == normalTexturesItem)
2551
+ if (source == normalTexturesItem)
23812552 {
23822553 SetTexRes(1);
23832554 } else
2384
- if (event.getSource() == highTexturesItem)
2555
+ if (source == highTexturesItem)
23852556 {
23862557 SetTexRes(2);
23872558 } else
2388
- if (event.getSource() == veryhighTexturesItem)
2559
+ if (source == veryhighTexturesItem)
23892560 {
23902561 SetTexRes(3);
23912562 } else
2392
- if (event.getSource() == maxTexturesItem)
2563
+ if (source == maxTexturesItem)
23932564 {
23942565 SetTexRes(4);
23952566 } else
2396
- if (event.getSource() == panoTexturesItem)
2567
+ if (source == panoTexturesItem)
23972568 {
23982569 SetTexRes(5);
23992570 } else
2400
- if (event.getSource() == reverseNormalsItem)
2571
+ if (source == reverseNormalsItem)
24012572 {
24022573 ReverseNormals();
24032574 } else
2404
- if (event.getSource() == parseverticesItem)
2575
+ if (source == parseverticesItem)
24052576 {
24062577 ParseVertices();
24072578 } else
2408
- if (event.getSource() == textureFieldItem)
2579
+ if (source == textureFieldItem)
24092580 {
24102581 TextureVertices();
24112582 } else
2412
- if (event.getSource() == alignItem)
2583
+ if (source == alignItem)
24132584 {
24142585 Align();
24152586 } else
2416
- if (event.getSource() == mirrorItem)
2587
+ if (source == mirrorItem)
24172588 {
24182589 MirrorPoses();
24192590 } else
2420
- if (event.getSource() == reduceMorphItem)
2591
+ if (source == reduceMorphItem)
24212592 {
24222593 MeshReduction(false);
24232594 } else
2424
- if (event.getSource() == reduce34MorphItem)
2595
+ if (source == reduce34MorphItem)
24252596 {
24262597 MeshReduction(true);
24272598 } else
2428
- if (event.getSource() == reverseTrianglesItem)
2599
+ if (source == reverseTrianglesItem)
24292600 {
24302601 ReverseTriangles();
24312602 } else
2432
- if (event.getSource() == reduceMeshItem)
2603
+ if (source == reduceMeshItem)
24332604 {
24342605 ReduceMesh(false);
24352606 } else
2436
- if (event.getSource() == reduce34MeshItem)
2607
+ if (source == reduce34MeshItem)
24372608 {
24382609 ReduceMesh(true);
24392610 } else
2440
- if (event.getSource() == increaseMeshItem)
2611
+ if (source == increaseMeshItem)
24412612 {
24422613 IncreaseMesh();
24432614 } else
2444
- if (event.getSource() == clipMeshItem)
2615
+ if (source == clipMeshItem)
24452616 {
24462617 ClipMesh();
24472618 } else
2448
- if (event.getSource() == smoothMeshItem)
2619
+ if (source == smoothMeshItem)
24492620 {
24502621 SmoothMesh();
24512622 } else
2452
- if (event.getSource() == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
24532624 {
24542625 TransformGeometry();
24552626 } else
2456
- if (event.getSource() == resetTransformItem)
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
2630
+ } else
2631
+ if (source == resetTransformItem)
24572632 {
24582633 ResetTransform();
24592634 } else
2460
- if (event.getSource() == resetCentroidItem)
2635
+ if (source == resetCentroidItem)
24612636 {
2462
- ResetCentroid();
2637
+ ResetCentroid(true);
24632638 } else
2464
- if (event.getSource() == resetParentItem)
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
2642
+ } else
2643
+ if (source == resetParentItem)
24652644 {
24662645 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24672646 {
....@@ -2471,7 +2650,7 @@
24712650
24722651 refreshContents();
24732652 } else
2474
- if (event.getSource() == repairParentItem)
2653
+ if (source == repairParentItem)
24752654 {
24762655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772656 {
....@@ -2485,7 +2664,21 @@
24852664
24862665 refreshContents();
24872666 } else
2488
- if (event.getSource() == sortbysizeItem)
2667
+ if (source == repairShadowItem)
2668
+ {
2669
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2670
+ {
2671
+ Object3D obj = (Object3D)e.nextElement();
2672
+ obj.RepairShadow();
2673
+// for (int i=0; i<obj.size(); i++)
2674
+// {
2675
+// obj.get(i).parent = obj;
2676
+// }
2677
+ }
2678
+
2679
+ refreshContents();
2680
+ } else
2681
+ if (source == sortbysizeItem)
24892682 {
24902683 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24912684 {
....@@ -2497,7 +2690,7 @@
24972690 ResetModel();
24982691 refreshContents();
24992692 } else
2500
- if (event.getSource() == sortbynameItem)
2693
+ if (source == sortbynameItem)
25012694 {
25022695 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25032696 {
....@@ -2509,7 +2702,7 @@
25092702 ResetModel();
25102703 refreshContents();
25112704 } else
2512
- if (event.getSource() == attachPigmentItem)
2705
+ if (source == attachPigmentItem)
25132706 {
25142707 String texture = GetFile("Attach pigment");
25152708 Object3D obj;
....@@ -2521,7 +2714,7 @@
25212714
25222715 refreshContents();
25232716 } else
2524
- if (event.getSource() == detachPigmentItem)
2717
+ if (source == detachPigmentItem)
25252718 {
25262719 Object3D obj;
25272720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +2725,7 @@
25322725
25332726 refreshContents();
25342727 } else
2535
- if (event.getSource() == attachBumpItem)
2728
+ if (source == attachBumpItem)
25362729 {
25372730 String texture = GetFile("Attach bump");
25382731 Object3D obj;
....@@ -2544,7 +2737,7 @@
25442737
25452738 refreshContents();
25462739 } else
2547
- if (event.getSource() == detachBumpItem)
2740
+ if (source == detachBumpItem)
25482741 {
25492742 Object3D obj;
25502743 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2555,7 +2748,7 @@
25552748
25562749 refreshContents();
25572750 } else
2558
- if (event.getSource() == pigmentBumpItem)
2751
+ if (source == pigmentBumpItem)
25592752 {
25602753 Object3D obj;
25612754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +2759,195 @@
25662759
25672760 refreshContents();
25682761 } else
2569
- if (event.getSource() == flashSelectionButton)
2762
+ if (source == flashSelectionButton)
25702763 {
25712764 CameraPane.flash = true;
25722765 refreshContents();
25732766 } else
2574
- if (event.getSource() == oneButton)
2767
+ if (source == oneButton)
25752768 {
25762769 } else
2577
- if (event.getSource() == twoButton)
2770
+ if (source == twoButton)
25782771 {
25792772 radio.layout = twoButton;
25802773 // bug
25812774 //gridPanel.setDividerLocation(1.0);
25822775 //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();
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// //bigThree.add(XYZPanel, aWindowConstraints);
2799
+// scenePanel.setVisible(false);
2800
+// centralPanel.setVisible(true);
2801
+// XYZPanel.setVisible(false);
2802
+ bigThree.ClearUI();
2803
+ bigThree.add(centralPanel);
2804
+ bigThree.FlushUI();
26072805 } else
2608
- if (event.getSource() == threeButton)
2806
+ if (source == threeButton)
26092807 {
26102808 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();
2809
+
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// bigThree.add(XYZPanel, aWindowConstraints);
2833
+// bigThree.validate();
2834
+// scenePanel.setVisible(false);
2835
+// centralPanel.setVisible(true);
2836
+// XYZPanel.setVisible(true);
2837
+ bigThree.ClearUI();
2838
+ bigThree.add(centralPanel);
2839
+ bigThree.add(XYZPanel);
2840
+ bigThree.FlushUI();
26352841 } else
2636
- if (event.getSource() == fourButton)
2842
+ if (source == fourButton)
26372843 {
26382844 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();
2845
+
2846
+// bigThree.remove(scenePanel);
2847
+// bigThree.remove(centralPanel);
2848
+// bigThree.remove(XYZPanel);
2849
+// aWindowConstraints.gridx = 0;
2850
+// aWindowConstraints.gridy = 0;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2854
+// aWindowConstraints.weightx = 1;
2855
+// aWindowConstraints.weighty = 1;
2856
+// bigThree.add(scenePanel, aWindowConstraints);
2857
+// aWindowConstraints.weightx = 1;
2858
+// aWindowConstraints.gridwidth = 3;
2859
+// // aConstraints.gridheight = 3;
2860
+// aWindowConstraints.gridx = 1;
2861
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2862
+// //bigThree.add(cameraPanel, aWindowConstraints);
2863
+// aWindowConstraints.weightx = 0;
2864
+// aWindowConstraints.gridx = 4;
2865
+// aWindowConstraints.gridwidth = 1;
2866
+// // aWindowConstraints.gridheight = 3;
2867
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2868
+// //bigThree.add(XYZPanel, aWindowConstraints);
2869
+// bigThree.validate();
2870
+// scenePanel.setVisible(true);
2871
+// centralPanel.setVisible(false);
2872
+// XYZPanel.setVisible(false);
2873
+ bigThree.ClearUI();
2874
+ bigThree.add(scenePanel);
2875
+ bigThree.FlushUI();
26632876 } else
2664
- if (event.getSource() == sixButton)
2877
+ if (source == sixButton)
26652878 {
26662879 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();
2880
+
2881
+// bigThree.remove(scenePanel);
2882
+// bigThree.remove(centralPanel);
2883
+// bigThree.remove(XYZPanel);
2884
+// aWindowConstraints.gridx = 0;
2885
+// aWindowConstraints.gridy = 0;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// aWindowConstraints.weightx = 0;
2890
+// aWindowConstraints.weighty = 1;
2891
+// bigThree.add(scenePanel, aWindowConstraints);
2892
+// aWindowConstraints.weightx = 1;
2893
+// aWindowConstraints.gridwidth = 3;
2894
+// // aWindowConstraints.gridheight = 3;
2895
+// aWindowConstraints.gridx = 1;
2896
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2897
+// bigThree.add(centralPanel, aWindowConstraints);
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.gridx = 4;
2900
+// aWindowConstraints.gridwidth = 1;
2901
+// // aWindowConstraints.gridheight = 3;
2902
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2903
+// //bigThree.add(XYZPanel, aConstraints);
2904
+// bigThree.validate();
2905
+// scenePanel.setVisible(true);
2906
+// centralPanel.setVisible(true);
2907
+// XYZPanel.setVisible(false);
2908
+ bigThree.ClearUI();
2909
+ bigThree.add(scenePanel);
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.FlushUI();
26912912 } else
2692
- if (event.getSource() == sevenButton)
2913
+ if (source == sevenButton)
26932914 {
26942915 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();
2916
+
2917
+// bigThree.remove(scenePanel);
2918
+// bigThree.remove(centralPanel);
2919
+// bigThree.remove(XYZPanel);
2920
+// aWindowConstraints.gridx = 0;
2921
+// aWindowConstraints.gridy = 0;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aWindowConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// aWindowConstraints.weightx = 0;
2926
+// aWindowConstraints.weighty = 1;
2927
+// bigThree.add(scenePanel, aWindowConstraints);
2928
+// aWindowConstraints.weightx = 1;
2929
+// aWindowConstraints.gridwidth = 3;
2930
+// // aWindowConstraints.gridheight = 3;
2931
+// aWindowConstraints.gridx = 1;
2932
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2933
+// bigThree.add(centralPanel, aWindowConstraints);
2934
+// aWindowConstraints.weightx = 0;
2935
+// aWindowConstraints.gridx = 4;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// bigThree.add(XYZPanel, aWindowConstraints);
2940
+// bigThree.validate();
2941
+// scenePanel.setVisible(true);
2942
+// centralPanel.setVisible(true);
2943
+// XYZPanel.setVisible(true);
2944
+ bigThree.ClearUI();
2945
+ bigThree.add(scenePanel);
2946
+ bigThree.add(centralPanel);
2947
+ bigThree.add(XYZPanel);
2948
+ bigThree.FlushUI();
27192949 } else
2720
- if (event.getSource() == rootButton)
2950
+ if (source == rootButton)
27212951 {
27222952 Object3D obj;
27232953 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2729,7 +2959,7 @@
27292959
27302960 refreshContents(true);
27312961 } else
2732
- if (event.getSource() == closeButton)
2962
+ if (source == closeButton)
27332963 {
27342964 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27352965 cRadio ab;
....@@ -2750,11 +2980,11 @@
27502980 }
27512981 refreshContents(true);
27522982 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
2983
+ if (source == editItem || source == editButton)
27542984 {
27552985 EditSelection(false);
27562986 } else
2757
- if (event.getSource() == uneditButton)
2987
+ if (source == uneditButton)
27582988 {
27592989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27602990 {
....@@ -2766,12 +2996,12 @@
27662996
27672997 child.editWindow = null; // ???????????
27682998 }
2769
- objEditor.ctrlPanel.revalidate();
2999
+ objEditor.ctrlPanel.FlushUI();
27703000 //objEditor.jTree.clearSelection();
27713001 //objEditor.ResetSliders();
27723002 refreshContents(true);
27733003 } else
2774
- if (event.getSource() == clearPanelButton)
3004
+ if (source == clearPanelButton)
27753005 {
27763006 assert(copy == group);
27773007 //copy.ClearUI();
....@@ -2782,7 +3012,7 @@
27823012 listUI.clear();
27833013 refreshContents(true);
27843014 } else
2785
- if (event.getSource() == allParamsButton)
3015
+ if (source == allParamsButton)
27863016 {
27873017 assert(copy == group);
27883018
....@@ -2803,19 +3033,19 @@
28033033
28043034 refreshContents(true);
28053035 } else
2806
- if (event.getSource() == unselectButton)
3036
+ if (source == unselectButton)
28073037 {
28083038 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3039
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103040 objEditor.ResetSliders();
28113041 refreshContents(true);
28123042 } else
2813
- if(event.getSource() instanceof cRadio)
3043
+ if(source instanceof cRadio)
28143044 {
28153045 group.parent = keepparent;
28163046 group.attributes = 0;
28173047 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3048
+ /*cRadio*/ radio = (cRadio)source;
28193049 Object3D obj = radio.GetObject();
28203050 System.out.println("Edit " + obj);
28213051 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3065,7 @@
28353065 }
28363066
28373067 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3068
+ //Globals.theRenderer.object = group;
28393069 if(!useclient)
28403070 {
28413071 cameraView.renderCamera = radio.camera;
....@@ -2844,12 +3074,15 @@
28443074 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453075 cameraView.targetLookAt.set(radio.camera.lookAt);
28463076 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3077
+ //cameraView.lighttouched = true;
3078
+ Globals.lighttouched = true;
28483079 topView.object = group;
28493080 frontView.object = group;
28503081 sideView.object = group;
28513082 }
2852
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
28533086 /*
28543087 currentLayout = radio.layout;
28553088 if (currentLayout == null)
....@@ -2880,7 +3113,7 @@
28803113 if (useclient)
28813114 {
28823115 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3116
+ Globals.lighttouched = true;
28843117 //topView.object = client;
28853118 //frontView.object = client;
28863119 //sideView.object = client;
....@@ -2888,7 +3121,7 @@
28883121 else
28893122 {
28903123 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3124
+ Globals.lighttouched = true;
28923125 //topView.object = group;
28933126 //frontView.object = group;
28943127 //sideView.object = group;
....@@ -2923,6 +3156,28 @@
29233156 refreshContents();
29243157 }
29253158
3159
+ void TransformChildren()
3160
+ {
3161
+ Object3D obj;
3162
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3163
+ {
3164
+ obj = (Object3D)e.nextElement();
3165
+ obj.KeepTextureMatrices();
3166
+ obj.TransformChildren();
3167
+ obj.RestoreTextureMatrices();
3168
+
3169
+// if (obj.parent == null)
3170
+// {
3171
+// System.out.println("NULL PARENT!");
3172
+// new Exception().printStackTrace();
3173
+// }
3174
+// else
3175
+// TouchTransform(obj);
3176
+// //obj.parent.Touch();
3177
+ }
3178
+
3179
+ refreshContents();
3180
+ }
29263181
29273182 void ResetTransform()
29283183 {
....@@ -3035,7 +3290,7 @@
30353290 refreshContents();
30363291 }
30373292
3038
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
30393294 {
30403295 Object3D obj;
30413296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +3305,16 @@
30503305 LA.matIdentity(Object3D.mat);
30513306 obj.getBounds(minima, maxima, false);
30523307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30543310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30553311 obj.TransformMesh(Object3D.mat);
3312
+
30563313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30583316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
30593318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30603319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30613320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3121,9 +3380,9 @@
31213380 obj = (Object3D)e.nextElement();
31223381
31233382 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
31253384 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
31273386
31283387 // System.err.println((size/1024) + " KB is the size of " + obj);
31293388 }
....@@ -3165,6 +3424,13 @@
31653424 void GenNormals(boolean crease)
31663425 {
31673426 group.GenNormalsS(crease);
3427
+
3428
+ refreshContents();
3429
+ }
3430
+
3431
+ void GenNormalsMINE()
3432
+ {
3433
+ group.selection.GenNormalsMINE();
31683434
31693435 refreshContents();
31703436 }
....@@ -3250,7 +3516,7 @@
32503516 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513517 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523518 //
3253
-// g.add(GraphreeD.clipboard);
3519
+// g.add(GrafreeD.clipboard);
32543520 //
32553521 // buffer.add(g);
32563522 // }
....@@ -3269,8 +3535,8 @@
32693535 // nodes = new Object3D();
32703536 // vertices = new Vector<Vertex>();
32713537 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3538
+// boolean epsequal = GrafreeD.epsequal;
3539
+// GrafreeD.epsequal = true;
32743540 //
32753541 // for (int i=0; i<group.selection.size(); i++)
32763542 // {
....@@ -3311,7 +3577,7 @@
33113577 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123578 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133579 //
3314
-// g.add(GraphreeD.clipboard);
3580
+// g.add(GrafreeD.clipboard);
33153581 //
33163582 // buffer.add(g);
33173583 // }
....@@ -3319,7 +3585,7 @@
33193585 // makeSomething(buffer, i==group.selection.size()-1);
33203586 // }
33213587 //
3322
-// GraphreeD.epsequal = epsequal;
3588
+// GrafreeD.epsequal = epsequal;
33233589 //
33243590 // //buffer = null;
33253591 // temprep = null;
....@@ -3330,8 +3596,8 @@
33303596
33313597 void ParseVertices()
33323598 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
33353601
33363602 for (int i=0; i<group.selection.size(); i++)
33373603 {
....@@ -3356,7 +3622,7 @@
33563622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583624
3359
- g.add(GraphreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
33603626
33613627 buffer.add(g);
33623628 }
....@@ -3371,7 +3637,7 @@
33713637 makeSomething(buffer, i==group.selection.size()-1);
33723638 }
33733639
3374
- GraphreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
33753641
33763642 refreshContents();
33773643 }
....@@ -3389,7 +3655,16 @@
33893655 String pigment = Object3D.GetPigment(tex);
33903656 //String bump = Object3D.GetBump(tex);
33913657
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3658
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3659
+
3660
+ try
3661
+ {
3662
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3663
+ }
3664
+ catch (Exception e)
3665
+ {
3666
+ System.err.println("FAIL: " + node);
3667
+ }
33933668
33943669 double s = v.s;
33953670
....@@ -3416,7 +3691,7 @@
34163691 scale /= 3;
34173692
34183693 scale /= 0xFF;
3419
- scale /= 4;
3694
+ // c'est quoi ca? scale /= 4;
34203695
34213696 //v.AO = scale;
34223697
....@@ -3437,12 +3712,26 @@
34373712
34383713 void Align()
34393714 {
3715
+ if (group.selection.size() == 0)
3716
+ return;
3717
+
3718
+ cVector bbmin = new cVector();
3719
+ cVector bbmax = new cVector();
3720
+
3721
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3722
+
3723
+ double dx = bbmax.x - bbmin.x;
3724
+ double dy = bbmax.y - bbmin.y;
3725
+ double dz = bbmax.z - bbmin.z;
3726
+
3727
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3728
+
34403729 for (int i=0; i<group.selection.size(); i++)
34413730 {
34423731 Object3D obj = group.selection.get(i);
34433732
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3733
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3734
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463735 }
34473736
34483737 refreshContents();
....@@ -3455,7 +3744,7 @@
34553744 // ref.SaveSupports();
34563745 // Object3D par = ref.parent;
34573746 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3747
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593748 // ref.parent = par;
34603749 // ref.RestoreSupports();
34613750
....@@ -3463,11 +3752,11 @@
34633752
34643753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34653754
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
34683757 lowres.linkVerticesThis(null);
34693758 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
34713760
34723761 System.err.flush();
34733762
....@@ -3485,7 +3774,7 @@
34853774 // lowres.SaveSupports();
34863775 // par = lowres.parent;
34873776 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3777
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893778 Object3D newlow = CloneObject(lowres, false);
34903779 newlow.name = sn.switchobject.get(i).name;
34913780 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3796,7 @@
35073796 return;
35083797
35093798 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
35113800
35123801 Object3D newgroup = new Object3D("Po:" + poses.name);
35133802
....@@ -3676,7 +3965,7 @@
36763965 group.selection.RelinkToSupport(); // july 2014
36773966 System.out.println("DONE.");
36783967 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3968
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36803969 }
36813970
36823971 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +3990,20 @@
37013990
37023991 void ClipMesh()
37033992 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37053994 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
37073996
37083997 if (content instanceof cGroup && ((cGroup)content).transientlink )
37093998 content = ((cGroup)content).get(0);
37103999
37114000 // for (int i=0; i<group.selection.size(); i++)
37124001 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4002
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144003 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
37164005 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4006
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184007 System.out.println("DONE.");
37194008 refreshContents();
37204009 }
....@@ -3847,7 +4136,7 @@
38474136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38484137
38494138 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
4139
+ if(elem != group || !newWindow)
38514140 {
38524141 // if (!(elem instanceof Composite))
38534142 // newWindow = false;
....@@ -3952,25 +4241,25 @@
39524241 System.err.println("info : " + child.GetPath());
39534242 }
39544243 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
39614250
39624251 objEditor.SetText(); // jan 2014
39634252
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4253
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39654254 CameraPane.flash = true;
39664255
39674256 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39684257 // a camera
39694258 {
39704259 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;
4260
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4261
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4262
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744263 }
39754264
39764265 refreshContents();
....@@ -4052,12 +4341,12 @@
40524341 {
40534342 if (group.selection.isEmpty())
40544343 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
40564345 Composite tGroup = null;
40574346 if (group.selection.size() > 0) // 1)
40584347 {
40594348 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
40614350 }
40624351
40634352 if (cut)
....@@ -4097,16 +4386,16 @@
40974386 //System.out.println("cut " + child);
40984387 //System.out.println("parent = " + child.parent);
40994388 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
41014390 tGroup.add/*Child*/(tmp);
41024391 else
4103
- GraphreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
41044393 }
41054394 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
41074396 tGroup.add/*Child*/(child);
41084397 else
4109
- GraphreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
41104399 }
41114400
41124401 //ResetModel();
....@@ -4138,21 +4427,21 @@
41384427 //System.out.println("cut " + elem);
41394428 //System.out.println("parent = " + elem.parent);
41404429 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
41424431 tGroup.add/*Child*/(tmp);
41434432 else
4144
- GraphreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
41454434 }
41464435 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
41484437 tGroup.add/*Child*/(child);
41494438 else
4150
- GraphreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
41514440 }
41524441
41534442 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
41564445 if (cut)
41574446 {
41584447 ResetModel();
....@@ -4162,11 +4451,11 @@
41624451
41634452 void paste(boolean expand)
41644453 {
4165
- // if (GraphreeD.clipboard == null)
4454
+ // if (GrafreeD.clipboard == null)
41664455 // return;
41674456 boolean first = true;
41684457
4169
- if (GraphreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
41704459 {
41714460 Composite temp;
41724461
....@@ -4177,7 +4466,7 @@
41774466 temp = (Composite)Applet3D.clipboard.deepCopy();
41784467 */
41794468 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4469
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814470 {
41824471 Object3D child = (Object3D)e.nextElement();
41834472
....@@ -4191,7 +4480,7 @@
41914480 else
41924481 elem = child.deepCopy(); // ?
41934482 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4483
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954484 // elem = elem.get(0);
41964485 makeSomething(elem, true); // ?? first);
41974486 //group.addChild(elem);
....@@ -4211,23 +4500,23 @@
42114500 //Object3D cb = Applet3D.clipboard;
42124501 //temp.addChild(cb);
42134502 //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());
4503
+ assert(Grafreed.clipboard.parent == null);
4504
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4505
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4506
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4507
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42194508 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
42224511 }
42234512
42244513 ResetModel();
42254514 refreshContents();
42264515 }
42274516
4228
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
42294518 {
4230
-// if (GraphreeD.clipboard == null)
4519
+// if (GrafreeD.clipboard == null)
42314520 // return;
42324521
42334522 if (group.selection.size() != 1)
....@@ -4254,15 +4543,22 @@
42544543 if (copyit)
42554544 {
42564545 // paste(false);
4257
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
42584554 }
42594555 else
42604556 {
42614557 boolean first = true;
42624558
4263
- if (GraphreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
42644560 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
42664562 Object3D copy;
42674563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684564 {
....@@ -4272,7 +4568,7 @@
42724568 }
42734569 } else
42744570 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
42764572 }
42774573 }
42784574 }
....@@ -4464,6 +4760,26 @@
44644760 makeSomething(csg);
44654761 }
44664762
4763
+ void Ungroup(Object3D g)
4764
+ {
4765
+ if (g instanceof HiddenObject)
4766
+ {
4767
+ HiddenObject h = (HiddenObject) g;
4768
+
4769
+ for (int i=0; i<h.ActualSize(); i++)
4770
+ {
4771
+ objEditor.makeSomething(h.get(i), false);
4772
+ }
4773
+ }
4774
+ else
4775
+ {
4776
+ for (int i=0; i<g.Size(); i++)
4777
+ {
4778
+ objEditor.makeSomething(g.get(i), false);
4779
+ }
4780
+ }
4781
+ }
4782
+
44674783 void ungroup()
44684784 {
44694785 /*
....@@ -4659,7 +4975,7 @@
46594975
46604976 void ImportGFD()
46614977 {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4978
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
46634979 browser.show();
46644980 String filename = browser.getFile();
46654981 if (filename != null && filename.length() > 0)
....@@ -4697,7 +5013,7 @@
46975013
46985014 void ImportVRMLX3D()
46995015 {
4700
- if (GraphreeD.standAlone)
5016
+ if (Grafreed.standAlone)
47015017 {
47025018 /**/
47035019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4714,7 +5030,7 @@
47145030
47155031 String GetFile(String dialogName)
47165032 {
4717
- if (GraphreeD.standAlone)
5033
+ if (Grafreed.standAlone)
47185034 {
47195035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205036 browser.show();
....@@ -4778,10 +5094,12 @@
47785094 cButton flashSelectionButton;
47795095 cButton editButton;
47805096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
47815098 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835099 cButton unselectButton;
47845100
5101
+ cButton oneStepButton;
5102
+
47855103 cButton screenfitButton;
47865104 cButton screenfitpointButton;
47875105 cButton snapobjectButton;
....@@ -4823,8 +5141,9 @@
48235141 private MenuItem resetsupportItem;
48245142 private MenuItem resetreferencesItem;
48255143 private MenuItem linkverticesItem;
5144
+ private MenuItem relinkverticesItem;
48265145 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
48285147 private MenuItem stepAllItem;
48295148 private MenuItem revertMeshItem;
48305149 private MenuItem poseMeshItem;
....@@ -4835,14 +5154,17 @@
48355154 private MenuItem mergeGeometriesItem;
48365155 private MenuItem copyItem;
48375156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
48385158 private MenuItem pasteLinkItem;
48395159 private MenuItem pasteCloneItem;
48405160 private MenuItem pasteExpandItem;
48415161 private MenuItem clearItem;
48425162 private MenuItem clearAllItem;
48435163 private MenuItem genUVItem;
5164
+ private MenuItem genNormalsMESHItem;
48445165 private MenuItem genNormalsCADItem;
48455166 private MenuItem genNormalsORGANItem;
5167
+ private MenuItem genNormalsMINEItem;
48465168 private MenuItem stripifyItem;
48475169 private MenuItem unstripifyItem;
48485170 private MenuItem trimItem;
....@@ -4882,8 +5204,11 @@
48825204 private MenuItem panoTexturesItem;
48835205
48845206 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
48865208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
5211
+ private MenuItem hideItem;
48875212 private MenuItem grabItem;
48885213 private MenuItem backItem;
48895214 private MenuItem frontItem;
....@@ -4904,6 +5229,7 @@
49045229
49055230 private MenuItem resetParentItem;
49065231 private MenuItem repairParentItem;
5232
+ private MenuItem repairShadowItem;
49075233 private MenuItem sortbysizeItem;
49085234 private MenuItem sortbynameItem;
49095235
....@@ -4924,10 +5250,11 @@
49245250 private MenuItem coneItem;
49255251 private MenuItem torusItem;
49265252 private MenuItem superItem;
5253
+ private MenuItem kleinItem;
49275254 private MenuItem blobItem;
49285255 private MenuItem latheItem;
49295256 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
49315258 private MenuItem meshItem;
49325259 // private MenuItem meshGroupItem;
49335260 private MenuItem springItem;
....@@ -4936,6 +5263,7 @@
49365263 private MenuItem csgItem;
49375264 private MenuItem templateItem;
49385265 private MenuItem textureItem;
5266
+ private MenuItem billboardItem;
49395267 private MenuItem shadowXItem;
49405268 private MenuItem shadowYItem;
49415269 private MenuItem shadowZItem;