Normand Briere
2019-06-09 3ae9b1de47e51e7c150412f2bb14383cb6a5f8f8
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,
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -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,19 +227,26 @@
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);
222242 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223243 relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
224247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225248 setMasterItem.addActionListener(this);
249
+ }
226250
227251 oe.menuBar.add(menu = new Menu("Group"));
228252 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +257,32 @@
233257 frontItem.addActionListener(this);
234258 compositeItem = menu.add(new MenuItem("Composite"));
235259 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237261 hideItem.addActionListener(this);
238262 ungroupItem = menu.add(new MenuItem("Ungroup"));
239263 ungroupItem.addActionListener(this);
240264 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
242266 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248268 switchGeoItem.addActionListener(this);
249269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250270 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
252272 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);
253281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254282 scriptNodeItem.addActionListener(this);
255283 cameraItem = menu.add(new MenuItem("Camera"));
256284 cameraItem.addActionListener(this);
285
+ }
257286
258287 oe.menuBar.add(menu = new Menu("Object"));
259288 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +297,29 @@
268297 shadowYItem.addActionListener(this);
269298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
271303 linkerItem = menu.add(new MenuItem("Linker"));
272304 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275305 attributeItem = menu.add(new MenuItem("Attribute"));
276306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
277309 pointflowItem = menu.add(new MenuItem("Point Flow"));
278310 pointflowItem.addActionListener(this);
311
+ }
279312 menu.add("-");
280313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281314 resetTransformItem.addActionListener(this);
282315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283316 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.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);
286323
287324 oe.menuBar.add(menu = new Menu("Geometry"));
288325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +356,34 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326370 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);
327375 menu.add("-");
328376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329377 liveleavesItem.addActionListener(this);
330378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
332382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333383 supportleavesItem.addActionListener(this);
334384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335385 unsupportleavesItem.addActionListener(this);
386
+ }
336387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337388 hideleavesItem.addActionListener(this);
338389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,28 +427,34 @@
376427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377428 sortbynameItem.addActionListener(this);
378429 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.
379437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380438 extractGeometriesItem.addActionListener(this);
381439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382440 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
441
+ }
387442
388443 oe.menuBar.add(menu = new Menu("Insert"));
389444 buildCreateMenu(menu);
390445
391
-
392446 oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398448 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400451 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);
401458
402459 oe.menuBar.add(menu = new Menu("Tools"));
403460 buildToolsMenu(menu);
....@@ -433,153 +490,98 @@
433490 oe.radioPanel.add(dummyButton);
434491 oe.buttonGroup.add(dummyButton);
435492 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
493
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439494
440
- 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");
441497 liveCB.addItemListener(this);
442498
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- 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");
461505 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- 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");
503509 trackCB.addItemListener(this);
504510
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512
+ screenfitButton.setToolTipText("Screen fit");
507513 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
514
+
509515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510516 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515517
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- 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");
522527 flashSelectionButton.addActionListener(this);
523528
524
- oe.toolbarPanel.add(new cButton(" ", false));
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525530
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532
+ twoButton.setToolTipText("Show center view only");
532533 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534535 fourButton.addActionListener(this);
535
- 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");
536539 sixButton.addActionListener(this);
537
- 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");
538542 threeButton.addActionListener(this);
539
- 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");
540545 sevenButton.addActionListener(this);
541546 //
542547
543
- 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");
544550 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- 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");
547554 closeButton.addActionListener(this);
548555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549556 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551557
552
- oe.aConstraints.gridx = 1; //
553
- 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");
554562 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558563
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
560566 uneditButton.addActionListener(this);
561567
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- 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");
574570 allParamsButton.addActionListener(this);
575571
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- 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");
581578 unselectButton.addActionListener(this);
582579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
583585 // oe.aConstraints.gridx += 1;
584586 // oe.aConstraints.weighty = 0;
585587 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +593,37 @@
591593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592594 // gcButton.addActionListener(this);
593595
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
605599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- 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);
607601 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
612605
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- 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");
617610 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620614 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- 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");
623618 textureCB.addItemListener(this);
624619
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
627623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
628627 //jList.addListSelectionListener(this);
629628 oe.jTree.addTreeSelectionListener(this);
630629 //jTree.setRootVisible(false);
....@@ -646,6 +645,78 @@
646645 radio.layout = sevenButton;
647646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648647 }
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
+ }
649720
650721 void EditObject(Object3D obj)
651722 {
....@@ -658,6 +729,7 @@
658729 buttonGroup.add(radioButton);
659730 radioButton.doClick();
660731 }
732
+
661733 void SetupViews(ObjEditor oe)
662734 {
663735 oe.SetupViews();
....@@ -676,6 +748,7 @@
676748 JCheckBox fastCB;
677749 JCheckBox slowCB;
678750 JCheckBox boxCB;
751
+ JCheckBox zoomBoxCB;
679752 JCheckBox trackCB;
680753 JCheckBox smoothfocusCB;
681754 // JCheckBox speakerMocapCB;
....@@ -755,6 +828,10 @@
755828 Recompile();
756829 cameraView.repaint();
757830 // refreshContents();
831
+ }
832
+ else if(e.getSource() == zoomBoxCB)
833
+ {
834
+ cameraView.ToggleZoomBoxMode();
758835 }
759836 else if(e.getSource() == smoothfocusCB)
760837 {
....@@ -869,7 +946,9 @@
869946 // objEditor.DropFile((java.io.File[]) object, true);
870947 // return;
871948 // }
872
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
873952 {
874953 // file(s)
875954 String[] names = string.split("\n");
....@@ -896,7 +975,7 @@
896975
897976 flashIt = false;
898977 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
900979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
901980
902981 if (group.selection.size() == 1)
....@@ -923,11 +1002,11 @@
9231002 {
9241003 loadClipboard(true);
9251004 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1005
+ pasteInto(false, false);
9271006 } else {
9281007 loadClipboard(false);
9291008 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9311010 }
9321011 }
9331012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1128,33 @@
10491128 kleinItem.addActionListener(this);
10501129 particleItem = menu.add(new MenuItem("Particle system"));
10511130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10521133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531134 ragdollItem.addActionListener(this);
10541135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551136 ragdoll2Item.addActionListener(this);
1137
+ }
10561138 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581140 meshItem.addActionListener(this);
10591141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10611145 springItem = menu.add(new MenuItem("Spring"));
10621146 springItem.addActionListener(this);
10631147 flagItem = menu.add(new MenuItem("Flag"));
10641148 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691149 blobItem = menu.add(new MenuItem("Blob"));
10701150 blobItem.addActionListener(this);
10711151 latheItem = menu.add(new MenuItem("Lathe"));
10721152 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);
10731158 lightItem = menu.add(new MenuItem("Light"));
10741159 lightItem.addActionListener(this);
10751160 menu.add("-");
....@@ -1079,34 +1164,39 @@
10791164 loopItem.addActionListener(this);
10801165 doubleItem = menu.add(new MenuItem("Fork"));
10811166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
10821169 tripleItem = menu.add(new MenuItem("Trident"));
10831170 tripleItem.addActionListener(this);
1171
+ }
10841172 }
10851173
10861174 void buildToolsMenu(Menu menu)
10871175 {
10881176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891177 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
10911179
10921180 menu.add("-");
10931181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941182 parseverticesItem.addActionListener(this);
10951183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961184 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981186 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021188 reduceMorphItem.addActionListener(this);
11031189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041190 reduce34MorphItem.addActionListener(this);
1105
-
1191
+ menu.add("-");
11061192 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071193 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
11101200 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111201 memoryItem.addActionListener(this);
11121202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1120,6 +1210,8 @@
11201210 resetParentItem.addActionListener(this);
11211211 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221212 repairParentItem.addActionListener(this);
1213
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1214
+ repairShadowItem.addActionListener(this);
11231215 menu.add(invariantsItem = new MenuItem("Invariants"));
11241216 invariantsItem.addActionListener(this);
11251217 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1219,7 @@
11271219 menu.add("-");
11281220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291221 editScriptItem.addActionListener(this);
1222
+ }
11301223 }
11311224
11321225 void ScreenFit()
....@@ -1455,9 +1548,9 @@
14551548
14561549 void Overwrite(int mask)
14571550 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591552 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14611554
14621555 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631556 content = ((cGroup)content).get(0);
....@@ -1480,6 +1573,7 @@
14801573 //
14811574 public void actionPerformed(ActionEvent event) // , Object arg)
14821575 {
1576
+ Object source = event.getSource();
14831577 /*
14841578 if (event.getSource() == nameField)
14851579 {
....@@ -1491,11 +1585,11 @@
14911585 }
14921586 else
14931587 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1588
+ if (source == lookAtItem || source == lookFromItem)
14951589 {
14961590 ScreenFit();
14971591 } else
1498
- if (event.getSource() == switchItem)
1592
+ if (source == switchItem)
14991593 {
15001594 cVector v1 = new cVector();
15011595 cVector v2 = new cVector();
....@@ -1504,11 +1598,11 @@
15041598 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051599 objEditor.cameraView.repaint();
15061600 } else
1507
- if (event.getSource() == rectoidItem)
1601
+ if (source == rectoidItem)
15081602 {
15091603 makeSomething(new Box());
15101604 } else
1511
- if (event.getSource() == particleItem)
1605
+ if (source == particleItem)
15121606 {
15131607 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141608 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1623,9 @@
15291623 applyExample(particleGeom, "SMOKE");
15301624 makeSomething(particleGeom);
15311625 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1626
+ if (source == ragdollItem || source == ragdoll2Item)
15331627 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1628
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351629
15361630 ragdoll.toParent = LA.newMatrix();
15371631 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1643,7 @@
15491643 } else
15501644 /*
15511645 */
1552
- if (event.getSource() == heightFieldItem)
1646
+ if (source == heightFieldItem)
15531647 {
15541648 Object3D obj = new Object3D();
15551649
....@@ -1587,31 +1681,31 @@
15871681
15881682 makeSomething(obj);
15891683 } else
1590
- if (event.getSource() == gridItem)
1684
+ if (source == gridItem)
15911685 {
15921686 makeSomething(new Grid());
15931687 } else
1594
- if (event.getSource() == ellipsoidItem)
1688
+ if (source == ellipsoidItem)
15951689 {
15961690 makeSomething(new Sphere());
15971691 } else
1598
- if (event.getSource() == coneItem)
1692
+ if (source == coneItem)
15991693 {
16001694 makeSomething(new Cone());
16011695 } else
1602
- if (event.getSource() == torusItem)
1696
+ if (source == torusItem)
16031697 {
16041698 makeSomething(new Torus());
16051699 } else
1606
- if (event.getSource() == superItem)
1700
+ if (source == superItem)
16071701 {
16081702 makeSomething(new Superellipsoid());
16091703 } else
1610
- if (event.getSource() == kleinItem)
1704
+ if (source == kleinItem)
16111705 {
16121706 makeSomething(new Klein());
16131707 } else
1614
- if (event.getSource() == blobItem)
1708
+ if (source == blobItem)
16151709 {
16161710 Blob blob = new Blob();
16171711 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1713,15 @@
16191713 //blob.retile();
16201714 makeSomething(blob);
16211715 } else
1622
- if (event.getSource() == latheItem)
1716
+ if (source == latheItem)
16231717 {
16241718 makeSomething(new Lathe());
16251719 } else
1626
- if (event.getSource() == bezierItem)
1720
+ if (source == bezierItem)
16271721 {
16281722 makeSomething(new BezierSurface());
16291723 } else
1630
- if (event.getSource() == checkerItem)
1724
+ if (source == overlayItem)
16311725 {
16321726 /*
16331727 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1736,7 @@
16421736 */
16431737 makeSomething(new Checker());
16441738 } else
1645
- if (event.getSource() == meshItem)
1739
+ if (source == meshItem)
16461740 {
16471741 Object3D itemtomake = new Object3D();
16481742 Object3D child;
....@@ -1663,35 +1757,35 @@
16631757 makeSomething(child);
16641758 }
16651759 } else
1666
- if (event.getSource() == springItem)
1760
+ if (source == springItem)
16671761 {
16681762 cSpring s = new cSpring();
16691763 s.setup();
16701764 makeSomething(s);
16711765 } else
1672
- if (event.getSource() == flagItem)
1766
+ if (source == flagItem)
16731767 {
16741768 cSpring s = new cFlag();
16751769 s.setup();
16761770 makeSomething(s);
16771771 } else
1678
- if (event.getSource() == lightItem)
1772
+ if (source == lightItem)
16791773 {
16801774 makeSomething(new Light());
16811775 } else
1682
- if (event.getSource() == csgItem)
1776
+ if (source == csgItem)
16831777 {
16841778 group(new CSG());
16851779 } else
1686
- if (event.getSource() == templateItem)
1780
+ if (source == templateItem)
16871781 {
16881782 group(new cTemplate());
16891783 } else
1690
- if (event.getSource() == attributeItem)
1784
+ if (source == attributeItem)
16911785 {
16921786 makeSomething(new Attribute());
16931787 } else
1694
- if (event.getSource() == pointflowItem)
1788
+ if (source == pointflowItem)
16951789 {
16961790 makeSomething(new PointFlow());
16971791 } else
....@@ -1703,7 +1797,7 @@
17031797 } else
17041798 */
17051799
1706
- if (event.getSource() == superLoopItem)
1800
+ if (source == superLoopItem)
17071801 {
17081802 Composite g = new cGroup();
17091803 for (int i=0; i<15; i++)
....@@ -1725,7 +1819,7 @@
17251819
17261820 group(g);
17271821 } else
1728
- if (event.getSource() == loopItem)
1822
+ if (source == loopItem)
17291823 {
17301824 Composite csg = new GroupLeaf();
17311825 csg.count = 5;
....@@ -1734,7 +1828,7 @@
17341828 csg.addChild(child);
17351829 child.addChild(csg);
17361830 } else
1737
- if (event.getSource() == doubleItem)
1831
+ if (source == doubleItem)
17381832 {
17391833 Composite csg = new GroupLeaf();
17401834 csg.count = 5;
....@@ -1746,7 +1840,7 @@
17461840 csg.addChild(child);
17471841 child.addChild(csg);
17481842 } else
1749
- if (event.getSource() == tripleItem)
1843
+ if (source == tripleItem)
17501844 {
17511845 Composite csg = new GroupLeaf();
17521846 csg.count = 4;
....@@ -1762,70 +1856,83 @@
17621856 child.addChild(csg);
17631857 } else
17641858
1765
- if (event.getSource() == importGFDItem)
1859
+ if (source == importGFDItem)
17661860 {
17671861 ImportGFD();
17681862 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1863
+ if (source == importVRMLX3DItem)
17701864 {
17711865 ImportVRMLX3D();
17721866 } else
1773
- if (event.getSource() == import3DSItem)
1867
+ if (source == import3DSItem)
17741868 {
17751869 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17761870 } else
1777
- if (event.getSource() == importOBJItem)
1871
+ if (source == importOBJItem)
17781872 {
1779
- 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
+ }
17801882 } else
1781
- if (event.getSource() == computeAOItem)
1883
+ if (source == computeAOItem)
17821884 {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1885
+ Globals.drawMode = CameraPane.OCCLUSION;
1886
+ Globals.theRenderer.repaint();
17851887 } else
1786
- if (event.getSource() == recompileItem)
1888
+ if (source == recompileItem)
17871889 {
17881890 Recompile();
17891891 refreshContents();
17901892 } else
1791
- if (event.getSource() == editScriptItem)
1893
+ if (source == editScriptItem)
17921894 {
17931895 OpenDialog();
17941896 refreshContents();
17951897 } else
1796
- if (event.getSource() == invariantsItem)
1898
+ if (source == invariantsItem)
17971899 {
17981900 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
18001902 } else
1801
- if (event.getSource() == memoryItem)
1903
+ if (source == memoryItem)
18021904 {
18031905 //System.out.println("Invariants:");
18041906 PrintMemory();
18051907 } else
1806
- if (event.getSource() == pathItem)
1908
+ if (source == pathItem)
18071909 {
18081910 PrintPath();
18091911 } else
1810
- if (event.getSource() == analyzeItem)
1912
+ if (source == analyzeItem)
18111913 {
18121914 AnalyzeObject();
18131915 } else
1814
- if (event.getSource() == dumpItem)
1916
+ if (source == dumpItem)
18151917 {
18161918 DumpObject();
18171919 } else
1818
- if (event.getSource() == screenfitButton)
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
1924
+ } else
1925
+ if (source == screenfitButton)
18191926 {
18201927 //Reload(lastConverter, lastFilename, true);
18211928 ScreenFit();
18221929 } else
1823
- if (event.getSource() == screenfitpointButton)
1930
+ if (source == screenfitpointButton)
18241931 {
18251932 //Reload(lastConverter, lastFilename, true);
18261933 ScreenFitPoint();
18271934 } else
1828
- if (event.getSource() == snapobjectButton)
1935
+ if (source == snapobjectButton)
18291936 {
18301937 //Reload(lastConverter, lastFilename, true);
18311938 SnapObject();
....@@ -1836,13 +1943,13 @@
18361943 // Recompile();
18371944 // refreshContents();
18381945 // } else
1839
- if (event.getSource() == gcButton)
1946
+ if (source == gcButton)
18401947 {
18411948 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421949 System.gc();
18431950 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441951 } else
1845
- if (event.getSource() == editLeafItem)
1952
+ if (source == editLeafItem)
18461953 {
18471954 Object3D obj;
18481955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +1963,66 @@
18561963 }
18571964 refreshContents(true);
18581965 } else
1859
- if (event.getSource() == openWindowItem)
1966
+ if (source == openWindowItem)
18601967 {
18611968 EditSelection(true);
18621969 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1970
+ if (source == cutItem || source == clearButton)
18641971 {
18651972 loadClipboard(true);
18661973 } else
1867
- if (event.getSource() == duplicateItem)
1974
+ if (source == duplicateItem)
18681975 {
1869
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
18701977 loadClipboard(false);
18711978 paste(false);
1872
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
18731980 } else
1874
- if (event.getSource() == cloneItem)
1981
+ if (source == cloneItem)
18751982 {
18761983 CloneSelection(false);
18771984 } else
1878
- if (event.getSource() == cloneSupportItem)
1985
+ if (source == cloneSupportItem)
18791986 {
18801987 CloneSelection(true);
18811988 } else
1882
- if (event.getSource() == copyItem)
1989
+ if (source == copyItem)
18831990 {
18841991 loadClipboard(false);
18851992 } else
1886
- if (event.getSource() == pasteItem)
1993
+ if (source == pasteItem)
18871994 {
18881995 paste(false);
18891996 } else
1890
- if (event.getSource() == pasteLinkItem)
1997
+ if (source == pasteIntoItem)
18911998 {
1892
- pasteInto(false);
1999
+ pasteInto(true, false);
18932000 } else
1894
- if (event.getSource() == pasteCloneItem)
2001
+ if (source == pasteLinkItem)
18952002 {
1896
- pasteInto(true);
2003
+ pasteInto(false, false);
18972004 } else
1898
- if (event.getSource() == pasteExpandItem)
2005
+ if (source == pasteCloneItem)
2006
+ {
2007
+ pasteInto(true, true);
2008
+ } else
2009
+ if (source == pasteExpandItem)
18992010 {
19002011 paste(true);
19012012 } else
1902
- if (event.getSource() == synchronizeItem)
2013
+ if (source == synchronizeItem)
19032014 {
19042015 Overwrite(Object3D.TRANSFORM);
19052016 } else
1906
- if (event.getSource() == overwriteNameItem)
2017
+ if (source == overwriteNameItem)
19072018 {
19082019 Overwrite(Object3D.NAME);
19092020 } else
1910
- if (event.getSource() == overwriteUVItem)
2021
+ if (source == overwriteUVItem)
19112022 {
19122023 Overwrite(Object3D.UV);
19132024 } else
1914
- if (event.getSource() == overwriteMatItem)
2025
+ if (source == overwriteMatItem)
19152026 {
19162027 /* july 2015
19172028 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2042,7 @@
19312042
19322043 Overwrite(dropAttributes);
19332044 }
1934
- if (event.getSource() == overwriteGeoItem)
2045
+ if (source == overwriteGeoItem)
19352046 {
19362047 Overwrite(Object3D.GEOMETRY);
19372048 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2059,7 @@
19482059 // refreshContents();
19492060 // }
19502061 } else
1951
- if (event.getSource() == generateMeshItem)
2062
+ if (source == generateMeshItem)
19522063 {
19532064 //if (group.selection.size() == 1)
19542065 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2070,7 @@
19592070 ResetModel();
19602071 refreshContents();
19612072 } else
1962
- if (event.getSource() == extractGeometriesItem)
2073
+ if (source == extractGeometriesItem)
19632074 {
19642075 boolean one = false;
19652076
....@@ -1986,7 +2097,7 @@
19862097 ResetModel();
19872098 refreshContents();
19882099 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2100
+ if (source == cloneGeometriesItem)
19902101 {
19912102 boolean one = false;
19922103
....@@ -2012,7 +2123,7 @@
20122123 ResetModel();
20132124 refreshContents();
20142125 } else
2015
- if (event.getSource() == shareGeometriesItem)
2126
+ if (source == shareGeometriesItem)
20162127 {
20172128 boolean one = false;
20182129
....@@ -2042,7 +2153,7 @@
20422153 refreshContents();
20432154 }
20442155 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2156
+ if (source == mergeGeometriesItem)
20462157 {
20472158 boolean one = false;
20482159
....@@ -2072,7 +2183,7 @@
20722183 ResetModel();
20732184 refreshContents();
20742185 } else
2075
- if (event.getSource() == linkverticesItem)
2186
+ if (source == linkverticesItem)
20762187 {
20772188 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782189 // {
....@@ -2085,48 +2196,48 @@
20852196 // group.selection.get(0).setMasterThis(content); // should be identity
20862197 // refreshContents();
20872198 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892200 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
20912202
20922203 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932204 content = ((cGroup)content).get(0);
20942205
2095
- 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));
20962207 for (int i=0; i<group.selection.size(); i++)
20972208 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
21002211 group.selection.get(i).linkVerticesThis(content);
21012212 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
21032214 }
2104
- 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));
21052216 refreshContents();
21062217 }
21072218 } else
2108
- if (event.getSource() == resetsupportItem)
2219
+ if (source == resetsupportItem)
21092220 {
21102221 for (int i=0; i<group.selection.size(); i++)
21112222 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
21142225 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
21162227 }
21172228
21182229 refreshContents();
21192230 } else
2120
- if (event.getSource() == relinkverticesItem)
2231
+ if (source == relinkverticesItem)
21212232 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
21242235 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2236
+ CameraPane.SWITCH = random;
21262237
21272238 refreshContents();
21282239 } else
2129
- if (event.getSource() == resetreferencesItem)
2240
+ if (source == resetreferencesItem)
21302241 {
21312242 for (int i=0; i<group.selection.size(); i++)
21322243 {
....@@ -2135,11 +2246,11 @@
21352246
21362247 refreshContents();
21372248 } else
2138
- if (event.getSource() == setMasterItem)
2249
+ if (source == setMasterItem)
21392250 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412252 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21432254
21442255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452256 content = ((cGroup)content).get(0);
....@@ -2148,13 +2259,13 @@
21482259 refreshContents();
21492260 }
21502261 } else
2151
- if (event.getSource() == poseMeshItem)
2262
+ if (source == poseMeshItem)
21522263 {
21532264 if (group.selection.size() == 1)
21542265 {
2155
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21562267 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21582269
21592270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602271 content = ((cGroup)content).get(0);
....@@ -2167,19 +2278,19 @@
21672278 }
21682279
21692280 } else
2170
- if (event.getSource() == revertMeshItem)
2281
+ if (source == revertMeshItem)
21712282 {
21722283 RevertMeshes();
21732284 } else
2174
- if (event.getSource() == resetMeshItem)
2285
+ if (source == resetAllItem)
21752286 {
21762287 ResetAll();
21772288 } else
2178
- if (event.getSource() == stepAllItem)
2289
+ if (source == stepAllItem)
21792290 {
21802291 StepAll();
21812292 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2293
+ if (source == clearItem) // || event.getSource() == clearButton)
21832294 {
21842295 //int indices[] = jList.getSelectedIndices();
21852296 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2298,46 @@
21872298
21882299 ClearSelection(false);
21892300 } else
2190
- if (event.getSource() == clearAllItem)
2301
+ if (source == clearAllItem)
21912302 {
21922303 ClearSelection(true);
21932304 } else
2194
- if (event.getSource() == grabItem)
2305
+ if (source == grabItem)
21952306 {
21962307 group(new cGroup(), true);
21972308 } else
2198
- if (event.getSource() == hideItem)
2309
+ if (source == hideItem)
21992310 {
22002311 group(new HiddenObject());
22012312 } else
2202
- if (event.getSource() == frontItem)
2313
+ if (source == frontItem)
22032314 {
22042315 front();
22052316 } else
2206
- if (event.getSource() == backItem)
2317
+ if (source == backItem)
22072318 {
22082319 back();
22092320 } else
2210
- if (event.getSource() == cameraItem)
2321
+ if (source == cameraItem)
22112322 {
22122323 makeSomething(new Camera());
22132324 } else
2214
- if (event.getSource() == compositeItem)
2325
+ if (source == compositeItem)
22152326 {
22162327 group(new Composite());
22172328 } else
2218
- if (event.getSource() == randomItem)
2329
+ if (source == randomItem)
22192330 {
22202331 RandomNode random = new RandomNode();
22212332 group(random);
22222333 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
22242335 } else
2225
- if (event.getSource() == physicsItem)
2336
+ if (source == physicsItem)
22262337 {
22272338 group(new PhysicsNode());
22282339 } else
2229
- if (event.getSource() == frameselectorItem)
2340
+ if (source == frameselectorItem)
22302341 {
22312342 for (int i=0; i<group.selection.size(); i++)
22322343 {
....@@ -2238,7 +2349,7 @@
22382349 ResetModel();
22392350 refreshContents();
22402351 } else
2241
- if (event.getSource() == switchGeoItem)
2352
+ if (source == switchGeoItem)
22422353 {
22432354 for (int i=0; i<group.selection.size(); i++)
22442355 {
....@@ -2250,7 +2361,7 @@
22502361 ResetModel();
22512362 refreshContents();
22522363 } else
2253
- if (event.getSource() == switchTransfoItem)
2364
+ if (source == switchTransfoItem)
22542365 {
22552366 for (int i=0; i<group.selection.size(); i++)
22562367 {
....@@ -2262,7 +2373,7 @@
22622373 ResetModel();
22632374 refreshContents();
22642375 } else
2265
- if (event.getSource() == morphItem)
2376
+ if (source == morphItem)
22662377 {
22672378 for (int i=0; i<group.selection.size(); i++)
22682379 {
....@@ -2274,7 +2385,7 @@
22742385 ResetModel();
22752386 refreshContents();
22762387 } else
2277
- if (event.getSource() == scriptNodeItem)
2388
+ if (source == scriptNodeItem)
22782389 {
22792390 boolean atleastone = false;
22802391
....@@ -2313,31 +2424,31 @@
23132424 }
23142425 }
23152426 } else
2316
- if (event.getSource() == linkerItem)
2427
+ if (source == linkerItem)
23172428 {
23182429 group(new cLinker());
23192430 } else
2320
- if (event.getSource() == textureItem)
2431
+ if (source == textureItem)
23212432 {
23222433 group(new TextureNode());
23232434 } else
2324
- if (event.getSource() == billboardItem)
2435
+ if (source == billboardItem)
23252436 {
23262437 group(new BillboardNode());
23272438 } else
2328
- if (event.getSource() == shadowXItem)
2439
+ if (source == shadowXItem)
23292440 {
23302441 CastShadow(0);
23312442 } else
2332
- if (event.getSource() == shadowYItem)
2443
+ if (source == shadowYItem)
23332444 {
23342445 CastShadow(1);
23352446 } else
2336
- if (event.getSource() == shadowZItem)
2447
+ if (source == shadowZItem)
23372448 {
23382449 CastShadow(2);
23392450 } else
2340
- if (event.getSource() == ungroupItem)
2451
+ if (source == ungroupItem)
23412452 {
23422453 //ungroup();
23432454 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2460,187 @@
23492460
23502461 refreshContents();
23512462 } else
2352
- if (event.getSource() == genUVItem)
2463
+ if (source == genUVItem)
23532464 {
23542465 GenUV();
23552466 } else
2356
- if (event.getSource() == genNormalsCADItem)
2467
+ if (source == genNormalsCADItem)
23572468 {
23582469 GenNormals(true);
23592470 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2471
+ if (source == genNormalsMESHItem)
23612472 {
23622473 GenNormals(true); // TODO
23632474 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2475
+ if (source == genNormalsORGANItem)
23652476 {
23662477 GenNormals(false);
23672478 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2479
+ if (source == genNormalsMINEItem)
23692480 {
23702481 GenNormalsMINE();
23712482 } else
2372
- if (event.getSource() == stripifyItem)
2483
+ if (source == stripifyItem)
23732484 {
23742485 Stripify();
23752486 } else
2376
- if (event.getSource() == unstripifyItem)
2487
+ if (source == unstripifyItem)
23772488 {
23782489 Unstripify();
23792490 } else
2380
- if (event.getSource() == trimItem)
2491
+ if (source == trimItem)
23812492 {
23822493 Trim();
23832494 } else
2384
- if (event.getSource() == untrimItem)
2495
+ if (source == untrimItem)
23852496 {
23862497 Untrim();
23872498 } else
2388
- if (event.getSource() == clearColorsItem)
2499
+ if (source == clearColorsItem)
23892500 {
23902501 ClearColors();
23912502 } else
2392
- if (event.getSource() == clearMaterialsItem)
2503
+ if (source == clearMaterialsItem)
23932504 {
23942505 ClearMaterials();
23952506 } else
2396
- if (event.getSource() == liveleavesItem)
2507
+ if (source == liveleavesItem)
23972508 {
23982509 LiveLeaves(true);
23992510 } else
2400
- if (event.getSource() == unliveleavesItem)
2511
+ if (source == unliveleavesItem)
24012512 {
24022513 LiveLeaves(false);
24032514 } else
2404
- if (event.getSource() == supportleavesItem)
2515
+ if (source == supportleavesItem)
24052516 {
24062517 SupportLeaves(true);
24072518 } else
2408
- if (event.getSource() == unsupportleavesItem)
2519
+ if (source == unsupportleavesItem)
24092520 {
24102521 SupportLeaves(false);
24112522 } else
2412
- if (event.getSource() == hideleavesItem)
2523
+ if (source == hideleavesItem)
24132524 {
24142525 HideLeaves(true);
24152526 } else
2416
- if (event.getSource() == showleavesItem)
2527
+ if (source == showleavesItem)
24172528 {
24182529 HideLeaves(false);
24192530 } else
2420
- if (event.getSource() == markleavesItem)
2531
+ if (source == markleavesItem)
24212532 {
24222533 MarkLeaves(true);
24232534 } else
2424
- if (event.getSource() == unmarkleavesItem)
2535
+ if (source == unmarkleavesItem)
24252536 {
24262537 MarkLeaves(false);
24272538 } else
2428
- if (event.getSource() == flipVItem)
2539
+ if (source == flipVItem)
24292540 {
24302541 FlipV(true);
24312542 } else
2432
- if (event.getSource() == unflipVItem)
2543
+ if (source == unflipVItem)
24332544 {
24342545 FlipV(false);
24352546 } else
2436
- if (event.getSource() == lowTexturesItem)
2547
+ if (source == lowTexturesItem)
24372548 {
24382549 SetTexRes(0);
24392550 } else
2440
- if (event.getSource() == normalTexturesItem)
2551
+ if (source == normalTexturesItem)
24412552 {
24422553 SetTexRes(1);
24432554 } else
2444
- if (event.getSource() == highTexturesItem)
2555
+ if (source == highTexturesItem)
24452556 {
24462557 SetTexRes(2);
24472558 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2559
+ if (source == veryhighTexturesItem)
24492560 {
24502561 SetTexRes(3);
24512562 } else
2452
- if (event.getSource() == maxTexturesItem)
2563
+ if (source == maxTexturesItem)
24532564 {
24542565 SetTexRes(4);
24552566 } else
2456
- if (event.getSource() == panoTexturesItem)
2567
+ if (source == panoTexturesItem)
24572568 {
24582569 SetTexRes(5);
24592570 } else
2460
- if (event.getSource() == reverseNormalsItem)
2571
+ if (source == reverseNormalsItem)
24612572 {
24622573 ReverseNormals();
24632574 } else
2464
- if (event.getSource() == parseverticesItem)
2575
+ if (source == parseverticesItem)
24652576 {
24662577 ParseVertices();
24672578 } else
2468
- if (event.getSource() == textureFieldItem)
2579
+ if (source == textureFieldItem)
24692580 {
24702581 TextureVertices();
24712582 } else
2472
- if (event.getSource() == alignItem)
2583
+ if (source == alignItem)
24732584 {
24742585 Align();
24752586 } else
2476
- if (event.getSource() == mirrorItem)
2587
+ if (source == mirrorItem)
24772588 {
24782589 MirrorPoses();
24792590 } else
2480
- if (event.getSource() == reduceMorphItem)
2591
+ if (source == reduceMorphItem)
24812592 {
24822593 MeshReduction(false);
24832594 } else
2484
- if (event.getSource() == reduce34MorphItem)
2595
+ if (source == reduce34MorphItem)
24852596 {
24862597 MeshReduction(true);
24872598 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2599
+ if (source == reverseTrianglesItem)
24892600 {
24902601 ReverseTriangles();
24912602 } else
2492
- if (event.getSource() == reduceMeshItem)
2603
+ if (source == reduceMeshItem)
24932604 {
24942605 ReduceMesh(false);
24952606 } else
2496
- if (event.getSource() == reduce34MeshItem)
2607
+ if (source == reduce34MeshItem)
24972608 {
24982609 ReduceMesh(true);
24992610 } else
2500
- if (event.getSource() == increaseMeshItem)
2611
+ if (source == increaseMeshItem)
25012612 {
25022613 IncreaseMesh();
25032614 } else
2504
- if (event.getSource() == clipMeshItem)
2615
+ if (source == clipMeshItem)
25052616 {
25062617 ClipMesh();
25072618 } else
2508
- if (event.getSource() == smoothMeshItem)
2619
+ if (source == smoothMeshItem)
25092620 {
25102621 SmoothMesh();
25112622 } else
2512
- if (event.getSource() == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
25132624 {
25142625 TransformGeometry();
25152626 } else
2516
- if (event.getSource() == resetTransformItem)
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
2630
+ } else
2631
+ if (source == resetTransformItem)
25172632 {
25182633 ResetTransform();
25192634 } else
2520
- if (event.getSource() == resetCentroidItem)
2635
+ if (source == resetCentroidItem)
25212636 {
2522
- ResetCentroid();
2637
+ ResetCentroid(true);
25232638 } else
2524
- if (event.getSource() == resetParentItem)
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
2642
+ } else
2643
+ if (source == resetParentItem)
25252644 {
25262645 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272646 {
....@@ -2531,7 +2650,7 @@
25312650
25322651 refreshContents();
25332652 } else
2534
- if (event.getSource() == repairParentItem)
2653
+ if (source == repairParentItem)
25352654 {
25362655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372656 {
....@@ -2545,7 +2664,21 @@
25452664
25462665 refreshContents();
25472666 } else
2548
- 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)
25492682 {
25502683 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512684 {
....@@ -2557,7 +2690,7 @@
25572690 ResetModel();
25582691 refreshContents();
25592692 } else
2560
- if (event.getSource() == sortbynameItem)
2693
+ if (source == sortbynameItem)
25612694 {
25622695 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632696 {
....@@ -2569,7 +2702,7 @@
25692702 ResetModel();
25702703 refreshContents();
25712704 } else
2572
- if (event.getSource() == attachPigmentItem)
2705
+ if (source == attachPigmentItem)
25732706 {
25742707 String texture = GetFile("Attach pigment");
25752708 Object3D obj;
....@@ -2581,7 +2714,7 @@
25812714
25822715 refreshContents();
25832716 } else
2584
- if (event.getSource() == detachPigmentItem)
2717
+ if (source == detachPigmentItem)
25852718 {
25862719 Object3D obj;
25872720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2725,7 @@
25922725
25932726 refreshContents();
25942727 } else
2595
- if (event.getSource() == attachBumpItem)
2728
+ if (source == attachBumpItem)
25962729 {
25972730 String texture = GetFile("Attach bump");
25982731 Object3D obj;
....@@ -2604,7 +2737,7 @@
26042737
26052738 refreshContents();
26062739 } else
2607
- if (event.getSource() == detachBumpItem)
2740
+ if (source == detachBumpItem)
26082741 {
26092742 Object3D obj;
26102743 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2748,7 @@
26152748
26162749 refreshContents();
26172750 } else
2618
- if (event.getSource() == pigmentBumpItem)
2751
+ if (source == pigmentBumpItem)
26192752 {
26202753 Object3D obj;
26212754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2759,195 @@
26262759
26272760 refreshContents();
26282761 } else
2629
- if (event.getSource() == flashSelectionButton)
2762
+ if (source == flashSelectionButton)
26302763 {
26312764 CameraPane.flash = true;
26322765 refreshContents();
26332766 } else
2634
- if (event.getSource() == oneButton)
2767
+ if (source == oneButton)
26352768 {
26362769 } else
2637
- if (event.getSource() == twoButton)
2770
+ if (source == twoButton)
26382771 {
26392772 radio.layout = twoButton;
26402773 // bug
26412774 //gridPanel.setDividerLocation(1.0);
26422775 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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();
26672805 } else
2668
- if (event.getSource() == threeButton)
2806
+ if (source == threeButton)
26692807 {
26702808 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- 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();
26952841 } else
2696
- if (event.getSource() == fourButton)
2842
+ if (source == fourButton)
26972843 {
26982844 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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();
27232876 } else
2724
- if (event.getSource() == sixButton)
2877
+ if (source == sixButton)
27252878 {
27262879 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- 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();
27512912 } else
2752
- if (event.getSource() == sevenButton)
2913
+ if (source == sevenButton)
27532914 {
27542915 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- 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();
27792949 } else
2780
- if (event.getSource() == rootButton)
2950
+ if (source == rootButton)
27812951 {
27822952 Object3D obj;
27832953 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +2959,7 @@
27892959
27902960 refreshContents(true);
27912961 } else
2792
- if (event.getSource() == closeButton)
2962
+ if (source == closeButton)
27932963 {
27942964 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27952965 cRadio ab;
....@@ -2810,11 +2980,11 @@
28102980 }
28112981 refreshContents(true);
28122982 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
2983
+ if (source == editItem || source == editButton)
28142984 {
28152985 EditSelection(false);
28162986 } else
2817
- if (event.getSource() == uneditButton)
2987
+ if (source == uneditButton)
28182988 {
28192989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28202990 {
....@@ -2826,12 +2996,12 @@
28262996
28272997 child.editWindow = null; // ???????????
28282998 }
2829
- objEditor.ctrlPanel.revalidate();
2999
+ objEditor.ctrlPanel.FlushUI();
28303000 //objEditor.jTree.clearSelection();
28313001 //objEditor.ResetSliders();
28323002 refreshContents(true);
28333003 } else
2834
- if (event.getSource() == clearPanelButton)
3004
+ if (source == clearPanelButton)
28353005 {
28363006 assert(copy == group);
28373007 //copy.ClearUI();
....@@ -2842,7 +3012,7 @@
28423012 listUI.clear();
28433013 refreshContents(true);
28443014 } else
2845
- if (event.getSource() == allParamsButton)
3015
+ if (source == allParamsButton)
28463016 {
28473017 assert(copy == group);
28483018
....@@ -2863,19 +3033,19 @@
28633033
28643034 refreshContents(true);
28653035 } else
2866
- if (event.getSource() == unselectButton)
3036
+ if (source == unselectButton)
28673037 {
28683038 objEditor.jTree.clearSelection();
28693039 // ?? oct 2012 GrafreeD.clipboard.clear();
28703040 objEditor.ResetSliders();
28713041 refreshContents(true);
28723042 } else
2873
- if(event.getSource() instanceof cRadio)
3043
+ if(source instanceof cRadio)
28743044 {
28753045 group.parent = keepparent;
28763046 group.attributes = 0;
28773047 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3048
+ /*cRadio*/ radio = (cRadio)source;
28793049 Object3D obj = radio.GetObject();
28803050 System.out.println("Edit " + obj);
28813051 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3065,7 @@
28953065 }
28963066
28973067 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3068
+ //Globals.theRenderer.object = group;
28993069 if(!useclient)
29003070 {
29013071 cameraView.renderCamera = radio.camera;
....@@ -2904,12 +3074,15 @@
29043074 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053075 cameraView.targetLookAt.set(radio.camera.lookAt);
29063076 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3077
+ //cameraView.lighttouched = true;
3078
+ Globals.lighttouched = true;
29083079 topView.object = group;
29093080 frontView.object = group;
29103081 sideView.object = group;
29113082 }
2912
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
29133086 /*
29143087 currentLayout = radio.layout;
29153088 if (currentLayout == null)
....@@ -2940,7 +3113,7 @@
29403113 if (useclient)
29413114 {
29423115 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3116
+ Globals.lighttouched = true;
29443117 //topView.object = client;
29453118 //frontView.object = client;
29463119 //sideView.object = client;
....@@ -2948,7 +3121,7 @@
29483121 else
29493122 {
29503123 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3124
+ Globals.lighttouched = true;
29523125 //topView.object = group;
29533126 //frontView.object = group;
29543127 //sideView.object = group;
....@@ -2983,6 +3156,28 @@
29833156 refreshContents();
29843157 }
29853158
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
+ }
29863181
29873182 void ResetTransform()
29883183 {
....@@ -3095,7 +3290,7 @@
30953290 refreshContents();
30963291 }
30973292
3098
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
30993294 {
31003295 Object3D obj;
31013296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3305,16 @@
31103305 LA.matIdentity(Object3D.mat);
31113306 obj.getBounds(minima, maxima, false);
31123307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153311 obj.TransformMesh(Object3D.mat);
3312
+
31163313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
31193318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3181,9 +3380,9 @@
31813380 obj = (Object3D)e.nextElement();
31823381
31833382 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
31853384 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
31873386
31883387 // System.err.println((size/1024) + " KB is the size of " + obj);
31893388 }
....@@ -3397,8 +3596,8 @@
33973596
33983597 void ParseVertices()
33993598 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
34023601
34033602 for (int i=0; i<group.selection.size(); i++)
34043603 {
....@@ -3423,7 +3622,7 @@
34233622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34243623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34253624
3426
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
34273626
34283627 buffer.add(g);
34293628 }
....@@ -3438,7 +3637,7 @@
34383637 makeSomething(buffer, i==group.selection.size()-1);
34393638 }
34403639
3441
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
34423641
34433642 refreshContents();
34443643 }
....@@ -3456,7 +3655,16 @@
34563655 String pigment = Object3D.GetPigment(tex);
34573656 //String bump = Object3D.GetBump(tex);
34583657
3459
- 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
+ }
34603668
34613669 double s = v.s;
34623670
....@@ -3544,11 +3752,11 @@
35443752
35453753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35463754
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
35493757 lowres.linkVerticesThis(null);
35503758 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
35523760
35533761 System.err.flush();
35543762
....@@ -3588,7 +3796,7 @@
35883796 return;
35893797
35903798 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
35923800
35933801 Object3D newgroup = new Object3D("Po:" + poses.name);
35943802
....@@ -3757,7 +3965,7 @@
37573965 group.selection.RelinkToSupport(); // july 2014
37583966 System.out.println("DONE.");
37593967 refreshContents();
3760
- 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));
37613969 }
37623970
37633971 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +3990,9 @@
37823990
37833991 void ClipMesh()
37843992 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37863994 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
37883996
37893997 if (content instanceof cGroup && ((cGroup)content).transientlink )
37903998 content = ((cGroup)content).get(0);
....@@ -3793,7 +4001,7 @@
37934001 // {
37944002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954003 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
37974005 }
37984006 // group.selection.ClipMesh(GrafreeD.clipboard);
37994007 System.out.println("DONE.");
....@@ -3928,7 +4136,7 @@
39284136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294137
39304138 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4139
+ if(elem != group || !newWindow)
39324140 {
39334141 // if (!(elem instanceof Composite))
39344142 // newWindow = false;
....@@ -4033,25 +4241,25 @@
40334241 System.err.println("info : " + child.GetPath());
40344242 }
40354243 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
40424250
40434251 objEditor.SetText(); // jan 2014
40444252
4045
- 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))
40464254 CameraPane.flash = true;
40474255
40484256 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40494257 // a camera
40504258 {
40514259 CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // 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;
40554263 }
40564264
40574265 refreshContents();
....@@ -4133,12 +4341,12 @@
41334341 {
41344342 if (group.selection.isEmpty())
41354343 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
41374345 Composite tGroup = null;
41384346 if (group.selection.size() > 0) // 1)
41394347 {
41404348 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
41424350 }
41434351
41444352 if (cut)
....@@ -4178,16 +4386,16 @@
41784386 //System.out.println("cut " + child);
41794387 //System.out.println("parent = " + child.parent);
41804388 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
41824390 tGroup.add/*Child*/(tmp);
41834391 else
4184
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
41854393 }
41864394 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
41884396 tGroup.add/*Child*/(child);
41894397 else
4190
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
41914399 }
41924400
41934401 //ResetModel();
....@@ -4219,21 +4427,21 @@
42194427 //System.out.println("cut " + elem);
42204428 //System.out.println("parent = " + elem.parent);
42214429 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
42234431 tGroup.add/*Child*/(tmp);
42244432 else
4225
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
42264434 }
42274435 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
42294437 tGroup.add/*Child*/(child);
42304438 else
4231
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
42324440 }
42334441
42344442 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
42374445 if (cut)
42384446 {
42394447 ResetModel();
....@@ -4247,7 +4455,7 @@
42474455 // return;
42484456 boolean first = true;
42494457
4250
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
42514459 {
42524460 Composite temp;
42534461
....@@ -4258,7 +4466,7 @@
42584466 temp = (Composite)Applet3D.clipboard.deepCopy();
42594467 */
42604468 Object3D elem;
4261
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4469
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42624470 {
42634471 Object3D child = (Object3D)e.nextElement();
42644472
....@@ -4292,21 +4500,21 @@
42924500 //Object3D cb = Applet3D.clipboard;
42934501 //temp.addChild(cb);
42944502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.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());
43004508 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
43034511 }
43044512
43054513 ResetModel();
43064514 refreshContents();
43074515 }
43084516
4309
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
43104518 {
43114519 // if (GrafreeD.clipboard == null)
43124520 // return;
....@@ -4335,15 +4543,22 @@
43354543 if (copyit)
43364544 {
43374545 // paste(false);
4338
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
43394554 }
43404555 else
43414556 {
43424557 boolean first = true;
43434558
4344
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
43454560 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
43474562 Object3D copy;
43484563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43494564 {
....@@ -4353,7 +4568,7 @@
43534568 }
43544569 } else
43554570 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
43574572 }
43584573 }
43594574 }
....@@ -4798,7 +5013,7 @@
47985013
47995014 void ImportVRMLX3D()
48005015 {
4801
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
48025017 {
48035018 /**/
48045019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4815,7 +5030,7 @@
48155030
48165031 String GetFile(String dialogName)
48175032 {
4818
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
48195034 {
48205035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215036 browser.show();
....@@ -4879,10 +5094,12 @@
48795094 cButton flashSelectionButton;
48805095 cButton editButton;
48815096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
48825098 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845099 cButton unselectButton;
48855100
5101
+ cButton oneStepButton;
5102
+
48865103 cButton screenfitButton;
48875104 cButton screenfitpointButton;
48885105 cButton snapobjectButton;
....@@ -4926,7 +5143,7 @@
49265143 private MenuItem linkverticesItem;
49275144 private MenuItem relinkverticesItem;
49285145 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
49305147 private MenuItem stepAllItem;
49315148 private MenuItem revertMeshItem;
49325149 private MenuItem poseMeshItem;
....@@ -4937,6 +5154,7 @@
49375154 private MenuItem mergeGeometriesItem;
49385155 private MenuItem copyItem;
49395156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
49405158 private MenuItem pasteLinkItem;
49415159 private MenuItem pasteCloneItem;
49425160 private MenuItem pasteExpandItem;
....@@ -4986,8 +5204,10 @@
49865204 private MenuItem panoTexturesItem;
49875205
49885206 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
49905208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
49915211 private MenuItem hideItem;
49925212 private MenuItem grabItem;
49935213 private MenuItem backItem;
....@@ -5009,6 +5229,7 @@
50095229
50105230 private MenuItem resetParentItem;
50115231 private MenuItem repairParentItem;
5232
+ private MenuItem repairShadowItem;
50125233 private MenuItem sortbysizeItem;
50135234 private MenuItem sortbynameItem;
50145235
....@@ -5033,7 +5254,7 @@
50335254 private MenuItem blobItem;
50345255 private MenuItem latheItem;
50355256 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
50375258 private MenuItem meshItem;
50385259 // private MenuItem meshGroupItem;
50395260 private MenuItem springItem;