Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -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,150 +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);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526528
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
530
+
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532
+ twoButton.setToolTipText("Show center view only");
529533 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531535 fourButton.addActionListener(this);
532
- 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");
533539 sixButton.addActionListener(this);
534
- 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");
535542 threeButton.addActionListener(this);
536
- 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");
537545 sevenButton.addActionListener(this);
538546 //
539547
540
- 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");
541550 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- 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");
544554 closeButton.addActionListener(this);
545555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546556 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548557
549
- oe.aConstraints.gridx = 1; //
550
- 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");
551562 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555563
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
557566 uneditButton.addActionListener(this);
558567
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- 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");
571570 allParamsButton.addActionListener(this);
572571
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- 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");
578578 unselectButton.addActionListener(this);
579579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
580585 // oe.aConstraints.gridx += 1;
581586 // oe.aConstraints.weighty = 0;
582587 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +593,37 @@
588593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589594 // gcButton.addActionListener(this);
590595
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
602599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- 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);
604601 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
609605
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- 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");
614610 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- 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");
617614 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620618 textureCB.addItemListener(this);
621619
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
624623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
625627 //jList.addListSelectionListener(this);
626628 oe.jTree.addTreeSelectionListener(this);
627629 //jTree.setRootVisible(false);
....@@ -643,18 +645,91 @@
643645 radio.layout = sevenButton;
644646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645647 }
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
+ }
646720
647721 void EditObject(Object3D obj)
648722 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
723
+ cRadio radioButton = new cRadio(obj.name);
724
+ radioButton.SetObject(obj);
725
+ radioButton.layout = sevenButton;
726
+ radioButton.SetCamera(cameraView.renderCamera, false);
727
+ radioButton.addActionListener(this);
728
+ radioPanel.add(radioButton);
729
+ buttonGroup.add(radioButton);
730
+ radioButton.doClick();
657731 }
732
+
658733 void SetupViews(ObjEditor oe)
659734 {
660735 oe.SetupViews();
....@@ -673,6 +748,7 @@
673748 JCheckBox fastCB;
674749 JCheckBox slowCB;
675750 JCheckBox boxCB;
751
+ JCheckBox zoomBoxCB;
676752 JCheckBox trackCB;
677753 JCheckBox smoothfocusCB;
678754 // JCheckBox speakerMocapCB;
....@@ -715,8 +791,7 @@
715791 dropAttributes |= Object3D.TEXTURE;
716792 else
717793 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
794
+ } else if(e.getSource() == liveCB)
720795 {
721796 cameraView.ToggleLive();
722797 }
....@@ -753,6 +828,10 @@
753828 Recompile();
754829 cameraView.repaint();
755830 // refreshContents();
831
+ }
832
+ else if(e.getSource() == zoomBoxCB)
833
+ {
834
+ cameraView.ToggleZoomBoxMode();
756835 }
757836 else if(e.getSource() == smoothfocusCB)
758837 {
....@@ -867,7 +946,9 @@
867946 // objEditor.DropFile((java.io.File[]) object, true);
868947 // return;
869948 // }
870
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
871952 {
872953 // file(s)
873954 String[] names = string.split("\n");
....@@ -894,7 +975,7 @@
894975
895976 flashIt = false;
896977 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
898979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
899980
900981 if (group.selection.size() == 1)
....@@ -921,11 +1002,11 @@
9211002 {
9221003 loadClipboard(true);
9231004 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1005
+ pasteInto(false, false);
9251006 } else {
9261007 loadClipboard(false);
9271008 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9291010 }
9301011 }
9311012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1128,33 @@
10471128 kleinItem.addActionListener(this);
10481129 particleItem = menu.add(new MenuItem("Particle system"));
10491130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10501133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511134 ragdollItem.addActionListener(this);
10521135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531136 ragdoll2Item.addActionListener(this);
1137
+ }
10541138 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561140 meshItem.addActionListener(this);
10571141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10591145 springItem = menu.add(new MenuItem("Spring"));
10601146 springItem.addActionListener(this);
10611147 flagItem = menu.add(new MenuItem("Flag"));
10621148 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671149 blobItem = menu.add(new MenuItem("Blob"));
10681150 blobItem.addActionListener(this);
10691151 latheItem = menu.add(new MenuItem("Lathe"));
10701152 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);
10711158 lightItem = menu.add(new MenuItem("Light"));
10721159 lightItem.addActionListener(this);
10731160 menu.add("-");
....@@ -1077,34 +1164,39 @@
10771164 loopItem.addActionListener(this);
10781165 doubleItem = menu.add(new MenuItem("Fork"));
10791166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
10801169 tripleItem = menu.add(new MenuItem("Trident"));
10811170 tripleItem.addActionListener(this);
1171
+ }
10821172 }
10831173
10841174 void buildToolsMenu(Menu menu)
10851175 {
10861176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871177 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
10891179
10901180 menu.add("-");
10911181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921182 parseverticesItem.addActionListener(this);
10931183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941184 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961186 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001188 reduceMorphItem.addActionListener(this);
11011189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021190 reduce34MorphItem.addActionListener(this);
1103
-
1191
+ menu.add("-");
11041192 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051193 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
11081200 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091201 memoryItem.addActionListener(this);
11101202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1118,6 +1210,8 @@
11181210 resetParentItem.addActionListener(this);
11191211 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201212 repairParentItem.addActionListener(this);
1213
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1214
+ repairShadowItem.addActionListener(this);
11211215 menu.add(invariantsItem = new MenuItem("Invariants"));
11221216 invariantsItem.addActionListener(this);
11231217 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1219,7 @@
11251219 menu.add("-");
11261220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271221 editScriptItem.addActionListener(this);
1222
+ }
11281223 }
11291224
11301225 void ScreenFit()
....@@ -1453,9 +1548,9 @@
14531548
14541549 void Overwrite(int mask)
14551550 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571552 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14591554
14601555 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611556 content = ((cGroup)content).get(0);
....@@ -1478,6 +1573,7 @@
14781573 //
14791574 public void actionPerformed(ActionEvent event) // , Object arg)
14801575 {
1576
+ Object source = event.getSource();
14811577 /*
14821578 if (event.getSource() == nameField)
14831579 {
....@@ -1489,11 +1585,11 @@
14891585 }
14901586 else
14911587 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1588
+ if (source == lookAtItem || source == lookFromItem)
14931589 {
14941590 ScreenFit();
14951591 } else
1496
- if (event.getSource() == switchItem)
1592
+ if (source == switchItem)
14971593 {
14981594 cVector v1 = new cVector();
14991595 cVector v2 = new cVector();
....@@ -1502,11 +1598,11 @@
15021598 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031599 objEditor.cameraView.repaint();
15041600 } else
1505
- if (event.getSource() == rectoidItem)
1601
+ if (source == rectoidItem)
15061602 {
15071603 makeSomething(new Box());
15081604 } else
1509
- if (event.getSource() == particleItem)
1605
+ if (source == particleItem)
15101606 {
15111607 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121608 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1623,9 @@
15271623 applyExample(particleGeom, "SMOKE");
15281624 makeSomething(particleGeom);
15291625 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1626
+ if (source == ragdollItem || source == ragdoll2Item)
15311627 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1628
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331629
15341630 ragdoll.toParent = LA.newMatrix();
15351631 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1643,7 @@
15471643 } else
15481644 /*
15491645 */
1550
- if (event.getSource() == heightFieldItem)
1646
+ if (source == heightFieldItem)
15511647 {
15521648 Object3D obj = new Object3D();
15531649
....@@ -1585,31 +1681,31 @@
15851681
15861682 makeSomething(obj);
15871683 } else
1588
- if (event.getSource() == gridItem)
1684
+ if (source == gridItem)
15891685 {
15901686 makeSomething(new Grid());
15911687 } else
1592
- if (event.getSource() == ellipsoidItem)
1688
+ if (source == ellipsoidItem)
15931689 {
15941690 makeSomething(new Sphere());
15951691 } else
1596
- if (event.getSource() == coneItem)
1692
+ if (source == coneItem)
15971693 {
15981694 makeSomething(new Cone());
15991695 } else
1600
- if (event.getSource() == torusItem)
1696
+ if (source == torusItem)
16011697 {
16021698 makeSomething(new Torus());
16031699 } else
1604
- if (event.getSource() == superItem)
1700
+ if (source == superItem)
16051701 {
16061702 makeSomething(new Superellipsoid());
16071703 } else
1608
- if (event.getSource() == kleinItem)
1704
+ if (source == kleinItem)
16091705 {
16101706 makeSomething(new Klein());
16111707 } else
1612
- if (event.getSource() == blobItem)
1708
+ if (source == blobItem)
16131709 {
16141710 Blob blob = new Blob();
16151711 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1713,15 @@
16171713 //blob.retile();
16181714 makeSomething(blob);
16191715 } else
1620
- if (event.getSource() == latheItem)
1716
+ if (source == latheItem)
16211717 {
16221718 makeSomething(new Lathe());
16231719 } else
1624
- if (event.getSource() == bezierItem)
1720
+ if (source == bezierItem)
16251721 {
16261722 makeSomething(new BezierSurface());
16271723 } else
1628
- if (event.getSource() == checkerItem)
1724
+ if (source == overlayItem)
16291725 {
16301726 /*
16311727 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1736,7 @@
16401736 */
16411737 makeSomething(new Checker());
16421738 } else
1643
- if (event.getSource() == meshItem)
1739
+ if (source == meshItem)
16441740 {
16451741 Object3D itemtomake = new Object3D();
16461742 Object3D child;
....@@ -1661,35 +1757,35 @@
16611757 makeSomething(child);
16621758 }
16631759 } else
1664
- if (event.getSource() == springItem)
1760
+ if (source == springItem)
16651761 {
16661762 cSpring s = new cSpring();
16671763 s.setup();
16681764 makeSomething(s);
16691765 } else
1670
- if (event.getSource() == flagItem)
1766
+ if (source == flagItem)
16711767 {
16721768 cSpring s = new cFlag();
16731769 s.setup();
16741770 makeSomething(s);
16751771 } else
1676
- if (event.getSource() == lightItem)
1772
+ if (source == lightItem)
16771773 {
16781774 makeSomething(new Light());
16791775 } else
1680
- if (event.getSource() == csgItem)
1776
+ if (source == csgItem)
16811777 {
16821778 group(new CSG());
16831779 } else
1684
- if (event.getSource() == templateItem)
1780
+ if (source == templateItem)
16851781 {
16861782 group(new cTemplate());
16871783 } else
1688
- if (event.getSource() == attributeItem)
1784
+ if (source == attributeItem)
16891785 {
16901786 makeSomething(new Attribute());
16911787 } else
1692
- if (event.getSource() == pointflowItem)
1788
+ if (source == pointflowItem)
16931789 {
16941790 makeSomething(new PointFlow());
16951791 } else
....@@ -1701,7 +1797,7 @@
17011797 } else
17021798 */
17031799
1704
- if (event.getSource() == superLoopItem)
1800
+ if (source == superLoopItem)
17051801 {
17061802 Composite g = new cGroup();
17071803 for (int i=0; i<15; i++)
....@@ -1723,7 +1819,7 @@
17231819
17241820 group(g);
17251821 } else
1726
- if (event.getSource() == loopItem)
1822
+ if (source == loopItem)
17271823 {
17281824 Composite csg = new GroupLeaf();
17291825 csg.count = 5;
....@@ -1732,7 +1828,7 @@
17321828 csg.addChild(child);
17331829 child.addChild(csg);
17341830 } else
1735
- if (event.getSource() == doubleItem)
1831
+ if (source == doubleItem)
17361832 {
17371833 Composite csg = new GroupLeaf();
17381834 csg.count = 5;
....@@ -1744,7 +1840,7 @@
17441840 csg.addChild(child);
17451841 child.addChild(csg);
17461842 } else
1747
- if (event.getSource() == tripleItem)
1843
+ if (source == tripleItem)
17481844 {
17491845 Composite csg = new GroupLeaf();
17501846 csg.count = 4;
....@@ -1760,70 +1856,83 @@
17601856 child.addChild(csg);
17611857 } else
17621858
1763
- if (event.getSource() == importGFDItem)
1859
+ if (source == importGFDItem)
17641860 {
17651861 ImportGFD();
17661862 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1863
+ if (source == importVRMLX3DItem)
17681864 {
17691865 ImportVRMLX3D();
17701866 } else
1771
- if (event.getSource() == import3DSItem)
1867
+ if (source == import3DSItem)
17721868 {
17731869 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17741870 } else
1775
- if (event.getSource() == importOBJItem)
1871
+ if (source == importOBJItem)
17761872 {
1777
- 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
+ }
17781882 } else
1779
- if (event.getSource() == computeAOItem)
1883
+ if (source == computeAOItem)
17801884 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1885
+ Globals.drawMode = CameraPane.OCCLUSION;
1886
+ Globals.theRenderer.repaint();
17831887 } else
1784
- if (event.getSource() == recompileItem)
1888
+ if (source == recompileItem)
17851889 {
17861890 Recompile();
17871891 refreshContents();
17881892 } else
1789
- if (event.getSource() == editScriptItem)
1893
+ if (source == editScriptItem)
17901894 {
17911895 OpenDialog();
17921896 refreshContents();
17931897 } else
1794
- if (event.getSource() == invariantsItem)
1898
+ if (source == invariantsItem)
17951899 {
17961900 System.out.println("Invariants:");
1797
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
17981902 } else
1799
- if (event.getSource() == memoryItem)
1903
+ if (source == memoryItem)
18001904 {
18011905 //System.out.println("Invariants:");
18021906 PrintMemory();
18031907 } else
1804
- if (event.getSource() == pathItem)
1908
+ if (source == pathItem)
18051909 {
18061910 PrintPath();
18071911 } else
1808
- if (event.getSource() == analyzeItem)
1912
+ if (source == analyzeItem)
18091913 {
18101914 AnalyzeObject();
18111915 } else
1812
- if (event.getSource() == dumpItem)
1916
+ if (source == dumpItem)
18131917 {
18141918 DumpObject();
18151919 } else
1816
- if (event.getSource() == screenfitButton)
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
1924
+ } else
1925
+ if (source == screenfitButton)
18171926 {
18181927 //Reload(lastConverter, lastFilename, true);
18191928 ScreenFit();
18201929 } else
1821
- if (event.getSource() == screenfitpointButton)
1930
+ if (source == screenfitpointButton)
18221931 {
18231932 //Reload(lastConverter, lastFilename, true);
18241933 ScreenFitPoint();
18251934 } else
1826
- if (event.getSource() == snapobjectButton)
1935
+ if (source == snapobjectButton)
18271936 {
18281937 //Reload(lastConverter, lastFilename, true);
18291938 SnapObject();
....@@ -1834,13 +1943,13 @@
18341943 // Recompile();
18351944 // refreshContents();
18361945 // } else
1837
- if (event.getSource() == gcButton)
1946
+ if (source == gcButton)
18381947 {
18391948 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401949 System.gc();
18411950 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421951 } else
1843
- if (event.getSource() == editLeafItem)
1952
+ if (source == editLeafItem)
18441953 {
18451954 Object3D obj;
18461955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +1963,66 @@
18541963 }
18551964 refreshContents(true);
18561965 } else
1857
- if (event.getSource() == openWindowItem)
1966
+ if (source == openWindowItem)
18581967 {
18591968 EditSelection(true);
18601969 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1970
+ if (source == cutItem || source == clearButton)
18621971 {
18631972 loadClipboard(true);
18641973 } else
1865
- if (event.getSource() == duplicateItem)
1974
+ if (source == duplicateItem)
18661975 {
1867
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
18681977 loadClipboard(false);
18691978 paste(false);
1870
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
18711980 } else
1872
- if (event.getSource() == cloneItem)
1981
+ if (source == cloneItem)
18731982 {
18741983 CloneSelection(false);
18751984 } else
1876
- if (event.getSource() == cloneSupportItem)
1985
+ if (source == cloneSupportItem)
18771986 {
18781987 CloneSelection(true);
18791988 } else
1880
- if (event.getSource() == copyItem)
1989
+ if (source == copyItem)
18811990 {
18821991 loadClipboard(false);
18831992 } else
1884
- if (event.getSource() == pasteItem)
1993
+ if (source == pasteItem)
18851994 {
18861995 paste(false);
18871996 } else
1888
- if (event.getSource() == pasteLinkItem)
1997
+ if (source == pasteIntoItem)
18891998 {
1890
- pasteInto(false);
1999
+ pasteInto(true, false);
18912000 } else
1892
- if (event.getSource() == pasteCloneItem)
2001
+ if (source == pasteLinkItem)
18932002 {
1894
- pasteInto(true);
2003
+ pasteInto(false, false);
18952004 } else
1896
- if (event.getSource() == pasteExpandItem)
2005
+ if (source == pasteCloneItem)
2006
+ {
2007
+ pasteInto(true, true);
2008
+ } else
2009
+ if (source == pasteExpandItem)
18972010 {
18982011 paste(true);
18992012 } else
1900
- if (event.getSource() == synchronizeItem)
2013
+ if (source == synchronizeItem)
19012014 {
19022015 Overwrite(Object3D.TRANSFORM);
19032016 } else
1904
- if (event.getSource() == overwriteNameItem)
2017
+ if (source == overwriteNameItem)
19052018 {
19062019 Overwrite(Object3D.NAME);
19072020 } else
1908
- if (event.getSource() == overwriteUVItem)
2021
+ if (source == overwriteUVItem)
19092022 {
19102023 Overwrite(Object3D.UV);
19112024 } else
1912
- if (event.getSource() == overwriteMatItem)
2025
+ if (source == overwriteMatItem)
19132026 {
19142027 /* july 2015
19152028 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2042,7 @@
19292042
19302043 Overwrite(dropAttributes);
19312044 }
1932
- if (event.getSource() == overwriteGeoItem)
2045
+ if (source == overwriteGeoItem)
19332046 {
19342047 Overwrite(Object3D.GEOMETRY);
19352048 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2059,7 @@
19462059 // refreshContents();
19472060 // }
19482061 } else
1949
- if (event.getSource() == generateMeshItem)
2062
+ if (source == generateMeshItem)
19502063 {
19512064 //if (group.selection.size() == 1)
19522065 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2070,7 @@
19572070 ResetModel();
19582071 refreshContents();
19592072 } else
1960
- if (event.getSource() == extractGeometriesItem)
2073
+ if (source == extractGeometriesItem)
19612074 {
19622075 boolean one = false;
19632076
....@@ -1984,7 +2097,7 @@
19842097 ResetModel();
19852098 refreshContents();
19862099 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2100
+ if (source == cloneGeometriesItem)
19882101 {
19892102 boolean one = false;
19902103
....@@ -2010,7 +2123,7 @@
20102123 ResetModel();
20112124 refreshContents();
20122125 } else
2013
- if (event.getSource() == shareGeometriesItem)
2126
+ if (source == shareGeometriesItem)
20142127 {
20152128 boolean one = false;
20162129
....@@ -2040,7 +2153,7 @@
20402153 refreshContents();
20412154 }
20422155 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2156
+ if (source == mergeGeometriesItem)
20442157 {
20452158 boolean one = false;
20462159
....@@ -2070,7 +2183,7 @@
20702183 ResetModel();
20712184 refreshContents();
20722185 } else
2073
- if (event.getSource() == linkverticesItem)
2186
+ if (source == linkverticesItem)
20742187 {
20752188 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762189 // {
....@@ -2083,48 +2196,48 @@
20832196 // group.selection.get(0).setMasterThis(content); // should be identity
20842197 // refreshContents();
20852198 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872200 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
20892202
20902203 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912204 content = ((cGroup)content).get(0);
20922205
2093
- 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));
20942207 for (int i=0; i<group.selection.size(); i++)
20952208 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
20982211 group.selection.get(i).linkVerticesThis(content);
20992212 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
21012214 }
2102
- 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));
21032216 refreshContents();
21042217 }
21052218 } else
2106
- if (event.getSource() == resetsupportItem)
2219
+ if (source == resetsupportItem)
21072220 {
21082221 for (int i=0; i<group.selection.size(); i++)
21092222 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
21122225 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
21142227 }
21152228
21162229 refreshContents();
21172230 } else
2118
- if (event.getSource() == relinkverticesItem)
2231
+ if (source == relinkverticesItem)
21192232 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
21222235 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2236
+ CameraPane.SWITCH = random;
21242237
21252238 refreshContents();
21262239 } else
2127
- if (event.getSource() == resetreferencesItem)
2240
+ if (source == resetreferencesItem)
21282241 {
21292242 for (int i=0; i<group.selection.size(); i++)
21302243 {
....@@ -2133,11 +2246,11 @@
21332246
21342247 refreshContents();
21352248 } else
2136
- if (event.getSource() == setMasterItem)
2249
+ if (source == setMasterItem)
21372250 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392252 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21412254
21422255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432256 content = ((cGroup)content).get(0);
....@@ -2146,13 +2259,13 @@
21462259 refreshContents();
21472260 }
21482261 } else
2149
- if (event.getSource() == poseMeshItem)
2262
+ if (source == poseMeshItem)
21502263 {
21512264 if (group.selection.size() == 1)
21522265 {
2153
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21542267 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21562269
21572270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582271 content = ((cGroup)content).get(0);
....@@ -2165,19 +2278,19 @@
21652278 }
21662279
21672280 } else
2168
- if (event.getSource() == revertMeshItem)
2281
+ if (source == revertMeshItem)
21692282 {
21702283 RevertMeshes();
21712284 } else
2172
- if (event.getSource() == resetMeshItem)
2285
+ if (source == resetAllItem)
21732286 {
21742287 ResetAll();
21752288 } else
2176
- if (event.getSource() == stepAllItem)
2289
+ if (source == stepAllItem)
21772290 {
21782291 StepAll();
21792292 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2293
+ if (source == clearItem) // || event.getSource() == clearButton)
21812294 {
21822295 //int indices[] = jList.getSelectedIndices();
21832296 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2298,46 @@
21852298
21862299 ClearSelection(false);
21872300 } else
2188
- if (event.getSource() == clearAllItem)
2301
+ if (source == clearAllItem)
21892302 {
21902303 ClearSelection(true);
21912304 } else
2192
- if (event.getSource() == grabItem)
2305
+ if (source == grabItem)
21932306 {
21942307 group(new cGroup(), true);
21952308 } else
2196
- if (event.getSource() == hideItem)
2309
+ if (source == hideItem)
21972310 {
21982311 group(new HiddenObject());
21992312 } else
2200
- if (event.getSource() == frontItem)
2313
+ if (source == frontItem)
22012314 {
22022315 front();
22032316 } else
2204
- if (event.getSource() == backItem)
2317
+ if (source == backItem)
22052318 {
22062319 back();
22072320 } else
2208
- if (event.getSource() == cameraItem)
2321
+ if (source == cameraItem)
22092322 {
22102323 makeSomething(new Camera());
22112324 } else
2212
- if (event.getSource() == compositeItem)
2325
+ if (source == compositeItem)
22132326 {
22142327 group(new Composite());
22152328 } else
2216
- if (event.getSource() == randomItem)
2329
+ if (source == randomItem)
22172330 {
22182331 RandomNode random = new RandomNode();
22192332 group(random);
22202333 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
22222335 } else
2223
- if (event.getSource() == physicsItem)
2336
+ if (source == physicsItem)
22242337 {
22252338 group(new PhysicsNode());
22262339 } else
2227
- if (event.getSource() == frameselectorItem)
2340
+ if (source == frameselectorItem)
22282341 {
22292342 for (int i=0; i<group.selection.size(); i++)
22302343 {
....@@ -2236,7 +2349,7 @@
22362349 ResetModel();
22372350 refreshContents();
22382351 } else
2239
- if (event.getSource() == switchGeoItem)
2352
+ if (source == switchGeoItem)
22402353 {
22412354 for (int i=0; i<group.selection.size(); i++)
22422355 {
....@@ -2248,7 +2361,7 @@
22482361 ResetModel();
22492362 refreshContents();
22502363 } else
2251
- if (event.getSource() == switchTransfoItem)
2364
+ if (source == switchTransfoItem)
22522365 {
22532366 for (int i=0; i<group.selection.size(); i++)
22542367 {
....@@ -2260,7 +2373,7 @@
22602373 ResetModel();
22612374 refreshContents();
22622375 } else
2263
- if (event.getSource() == morphItem)
2376
+ if (source == morphItem)
22642377 {
22652378 for (int i=0; i<group.selection.size(); i++)
22662379 {
....@@ -2272,7 +2385,7 @@
22722385 ResetModel();
22732386 refreshContents();
22742387 } else
2275
- if (event.getSource() == scriptNodeItem)
2388
+ if (source == scriptNodeItem)
22762389 {
22772390 boolean atleastone = false;
22782391
....@@ -2311,31 +2424,31 @@
23112424 }
23122425 }
23132426 } else
2314
- if (event.getSource() == linkerItem)
2427
+ if (source == linkerItem)
23152428 {
23162429 group(new cLinker());
23172430 } else
2318
- if (event.getSource() == textureItem)
2431
+ if (source == textureItem)
23192432 {
23202433 group(new TextureNode());
23212434 } else
2322
- if (event.getSource() == billboardItem)
2435
+ if (source == billboardItem)
23232436 {
23242437 group(new BillboardNode());
23252438 } else
2326
- if (event.getSource() == shadowXItem)
2439
+ if (source == shadowXItem)
23272440 {
23282441 CastShadow(0);
23292442 } else
2330
- if (event.getSource() == shadowYItem)
2443
+ if (source == shadowYItem)
23312444 {
23322445 CastShadow(1);
23332446 } else
2334
- if (event.getSource() == shadowZItem)
2447
+ if (source == shadowZItem)
23352448 {
23362449 CastShadow(2);
23372450 } else
2338
- if (event.getSource() == ungroupItem)
2451
+ if (source == ungroupItem)
23392452 {
23402453 //ungroup();
23412454 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2460,187 @@
23472460
23482461 refreshContents();
23492462 } else
2350
- if (event.getSource() == genUVItem)
2463
+ if (source == genUVItem)
23512464 {
23522465 GenUV();
23532466 } else
2354
- if (event.getSource() == genNormalsCADItem)
2467
+ if (source == genNormalsCADItem)
23552468 {
23562469 GenNormals(true);
23572470 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2471
+ if (source == genNormalsMESHItem)
23592472 {
23602473 GenNormals(true); // TODO
23612474 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2475
+ if (source == genNormalsORGANItem)
23632476 {
23642477 GenNormals(false);
23652478 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2479
+ if (source == genNormalsMINEItem)
23672480 {
23682481 GenNormalsMINE();
23692482 } else
2370
- if (event.getSource() == stripifyItem)
2483
+ if (source == stripifyItem)
23712484 {
23722485 Stripify();
23732486 } else
2374
- if (event.getSource() == unstripifyItem)
2487
+ if (source == unstripifyItem)
23752488 {
23762489 Unstripify();
23772490 } else
2378
- if (event.getSource() == trimItem)
2491
+ if (source == trimItem)
23792492 {
23802493 Trim();
23812494 } else
2382
- if (event.getSource() == untrimItem)
2495
+ if (source == untrimItem)
23832496 {
23842497 Untrim();
23852498 } else
2386
- if (event.getSource() == clearColorsItem)
2499
+ if (source == clearColorsItem)
23872500 {
23882501 ClearColors();
23892502 } else
2390
- if (event.getSource() == clearMaterialsItem)
2503
+ if (source == clearMaterialsItem)
23912504 {
23922505 ClearMaterials();
23932506 } else
2394
- if (event.getSource() == liveleavesItem)
2507
+ if (source == liveleavesItem)
23952508 {
23962509 LiveLeaves(true);
23972510 } else
2398
- if (event.getSource() == unliveleavesItem)
2511
+ if (source == unliveleavesItem)
23992512 {
24002513 LiveLeaves(false);
24012514 } else
2402
- if (event.getSource() == supportleavesItem)
2515
+ if (source == supportleavesItem)
24032516 {
24042517 SupportLeaves(true);
24052518 } else
2406
- if (event.getSource() == unsupportleavesItem)
2519
+ if (source == unsupportleavesItem)
24072520 {
24082521 SupportLeaves(false);
24092522 } else
2410
- if (event.getSource() == hideleavesItem)
2523
+ if (source == hideleavesItem)
24112524 {
24122525 HideLeaves(true);
24132526 } else
2414
- if (event.getSource() == showleavesItem)
2527
+ if (source == showleavesItem)
24152528 {
24162529 HideLeaves(false);
24172530 } else
2418
- if (event.getSource() == markleavesItem)
2531
+ if (source == markleavesItem)
24192532 {
24202533 MarkLeaves(true);
24212534 } else
2422
- if (event.getSource() == unmarkleavesItem)
2535
+ if (source == unmarkleavesItem)
24232536 {
24242537 MarkLeaves(false);
24252538 } else
2426
- if (event.getSource() == flipVItem)
2539
+ if (source == flipVItem)
24272540 {
24282541 FlipV(true);
24292542 } else
2430
- if (event.getSource() == unflipVItem)
2543
+ if (source == unflipVItem)
24312544 {
24322545 FlipV(false);
24332546 } else
2434
- if (event.getSource() == lowTexturesItem)
2547
+ if (source == lowTexturesItem)
24352548 {
24362549 SetTexRes(0);
24372550 } else
2438
- if (event.getSource() == normalTexturesItem)
2551
+ if (source == normalTexturesItem)
24392552 {
24402553 SetTexRes(1);
24412554 } else
2442
- if (event.getSource() == highTexturesItem)
2555
+ if (source == highTexturesItem)
24432556 {
24442557 SetTexRes(2);
24452558 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2559
+ if (source == veryhighTexturesItem)
24472560 {
24482561 SetTexRes(3);
24492562 } else
2450
- if (event.getSource() == maxTexturesItem)
2563
+ if (source == maxTexturesItem)
24512564 {
24522565 SetTexRes(4);
24532566 } else
2454
- if (event.getSource() == panoTexturesItem)
2567
+ if (source == panoTexturesItem)
24552568 {
24562569 SetTexRes(5);
24572570 } else
2458
- if (event.getSource() == reverseNormalsItem)
2571
+ if (source == reverseNormalsItem)
24592572 {
24602573 ReverseNormals();
24612574 } else
2462
- if (event.getSource() == parseverticesItem)
2575
+ if (source == parseverticesItem)
24632576 {
24642577 ParseVertices();
24652578 } else
2466
- if (event.getSource() == textureFieldItem)
2579
+ if (source == textureFieldItem)
24672580 {
24682581 TextureVertices();
24692582 } else
2470
- if (event.getSource() == alignItem)
2583
+ if (source == alignItem)
24712584 {
24722585 Align();
24732586 } else
2474
- if (event.getSource() == mirrorItem)
2587
+ if (source == mirrorItem)
24752588 {
24762589 MirrorPoses();
24772590 } else
2478
- if (event.getSource() == reduceMorphItem)
2591
+ if (source == reduceMorphItem)
24792592 {
24802593 MeshReduction(false);
24812594 } else
2482
- if (event.getSource() == reduce34MorphItem)
2595
+ if (source == reduce34MorphItem)
24832596 {
24842597 MeshReduction(true);
24852598 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2599
+ if (source == reverseTrianglesItem)
24872600 {
24882601 ReverseTriangles();
24892602 } else
2490
- if (event.getSource() == reduceMeshItem)
2603
+ if (source == reduceMeshItem)
24912604 {
24922605 ReduceMesh(false);
24932606 } else
2494
- if (event.getSource() == reduce34MeshItem)
2607
+ if (source == reduce34MeshItem)
24952608 {
24962609 ReduceMesh(true);
24972610 } else
2498
- if (event.getSource() == increaseMeshItem)
2611
+ if (source == increaseMeshItem)
24992612 {
25002613 IncreaseMesh();
25012614 } else
2502
- if (event.getSource() == clipMeshItem)
2615
+ if (source == clipMeshItem)
25032616 {
25042617 ClipMesh();
25052618 } else
2506
- if (event.getSource() == smoothMeshItem)
2619
+ if (source == smoothMeshItem)
25072620 {
25082621 SmoothMesh();
25092622 } else
2510
- if (event.getSource() == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
25112624 {
25122625 TransformGeometry();
25132626 } else
2514
- if (event.getSource() == resetTransformItem)
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
2630
+ } else
2631
+ if (source == resetTransformItem)
25152632 {
25162633 ResetTransform();
25172634 } else
2518
- if (event.getSource() == resetCentroidItem)
2635
+ if (source == resetCentroidItem)
25192636 {
2520
- ResetCentroid();
2637
+ ResetCentroid(true);
25212638 } else
2522
- if (event.getSource() == resetParentItem)
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
2642
+ } else
2643
+ if (source == resetParentItem)
25232644 {
25242645 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252646 {
....@@ -2529,7 +2650,7 @@
25292650
25302651 refreshContents();
25312652 } else
2532
- if (event.getSource() == repairParentItem)
2653
+ if (source == repairParentItem)
25332654 {
25342655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352656 {
....@@ -2543,7 +2664,21 @@
25432664
25442665 refreshContents();
25452666 } else
2546
- 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)
25472682 {
25482683 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492684 {
....@@ -2555,7 +2690,7 @@
25552690 ResetModel();
25562691 refreshContents();
25572692 } else
2558
- if (event.getSource() == sortbynameItem)
2693
+ if (source == sortbynameItem)
25592694 {
25602695 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612696 {
....@@ -2567,7 +2702,7 @@
25672702 ResetModel();
25682703 refreshContents();
25692704 } else
2570
- if (event.getSource() == attachPigmentItem)
2705
+ if (source == attachPigmentItem)
25712706 {
25722707 String texture = GetFile("Attach pigment");
25732708 Object3D obj;
....@@ -2579,7 +2714,7 @@
25792714
25802715 refreshContents();
25812716 } else
2582
- if (event.getSource() == detachPigmentItem)
2717
+ if (source == detachPigmentItem)
25832718 {
25842719 Object3D obj;
25852720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2725,7 @@
25902725
25912726 refreshContents();
25922727 } else
2593
- if (event.getSource() == attachBumpItem)
2728
+ if (source == attachBumpItem)
25942729 {
25952730 String texture = GetFile("Attach bump");
25962731 Object3D obj;
....@@ -2602,7 +2737,7 @@
26022737
26032738 refreshContents();
26042739 } else
2605
- if (event.getSource() == detachBumpItem)
2740
+ if (source == detachBumpItem)
26062741 {
26072742 Object3D obj;
26082743 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2748,7 @@
26132748
26142749 refreshContents();
26152750 } else
2616
- if (event.getSource() == pigmentBumpItem)
2751
+ if (source == pigmentBumpItem)
26172752 {
26182753 Object3D obj;
26192754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2759,195 @@
26242759
26252760 refreshContents();
26262761 } else
2627
- if (event.getSource() == flashSelectionButton)
2762
+ if (source == flashSelectionButton)
26282763 {
26292764 CameraPane.flash = true;
26302765 refreshContents();
26312766 } else
2632
- if (event.getSource() == oneButton)
2767
+ if (source == oneButton)
26332768 {
26342769 } else
2635
- if (event.getSource() == twoButton)
2770
+ if (source == twoButton)
26362771 {
26372772 radio.layout = twoButton;
26382773 // bug
26392774 //gridPanel.setDividerLocation(1.0);
26402775 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- 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();
26652805 } else
2666
- if (event.getSource() == threeButton)
2806
+ if (source == threeButton)
26672807 {
26682808 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- 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();
26932841 } else
2694
- if (event.getSource() == fourButton)
2842
+ if (source == fourButton)
26952843 {
26962844 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- 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();
27212876 } else
2722
- if (event.getSource() == sixButton)
2877
+ if (source == sixButton)
27232878 {
27242879 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- 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();
27492912 } else
2750
- if (event.getSource() == sevenButton)
2913
+ if (source == sevenButton)
27512914 {
27522915 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- 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();
27772949 } else
2778
- if (event.getSource() == rootButton)
2950
+ if (source == rootButton)
27792951 {
27802952 Object3D obj;
27812953 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +2959,7 @@
27872959
27882960 refreshContents(true);
27892961 } else
2790
- if (event.getSource() == closeButton)
2962
+ if (source == closeButton)
27912963 {
27922964 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27932965 cRadio ab;
....@@ -2808,11 +2980,11 @@
28082980 }
28092981 refreshContents(true);
28102982 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
2983
+ if (source == editItem || source == editButton)
28122984 {
28132985 EditSelection(false);
28142986 } else
2815
- if (event.getSource() == uneditButton)
2987
+ if (source == uneditButton)
28162988 {
28172989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28182990 {
....@@ -2824,12 +2996,12 @@
28242996
28252997 child.editWindow = null; // ???????????
28262998 }
2827
- objEditor.ctrlPanel.revalidate();
2999
+ objEditor.ctrlPanel.FlushUI();
28283000 //objEditor.jTree.clearSelection();
28293001 //objEditor.ResetSliders();
28303002 refreshContents(true);
28313003 } else
2832
- if (event.getSource() == clearPanelButton)
3004
+ if (source == clearPanelButton)
28333005 {
28343006 assert(copy == group);
28353007 //copy.ClearUI();
....@@ -2840,7 +3012,7 @@
28403012 listUI.clear();
28413013 refreshContents(true);
28423014 } else
2843
- if (event.getSource() == allParamsButton)
3015
+ if (source == allParamsButton)
28443016 {
28453017 assert(copy == group);
28463018
....@@ -2861,19 +3033,19 @@
28613033
28623034 refreshContents(true);
28633035 } else
2864
- if (event.getSource() == unselectButton)
3036
+ if (source == unselectButton)
28653037 {
28663038 objEditor.jTree.clearSelection();
28673039 // ?? oct 2012 GrafreeD.clipboard.clear();
28683040 objEditor.ResetSliders();
28693041 refreshContents(true);
28703042 } else
2871
- if(event.getSource() instanceof cRadio)
3043
+ if(source instanceof cRadio)
28723044 {
28733045 group.parent = keepparent;
28743046 group.attributes = 0;
28753047 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3048
+ /*cRadio*/ radio = (cRadio)source;
28773049 Object3D obj = radio.GetObject();
28783050 System.out.println("Edit " + obj);
28793051 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3065,7 @@
28933065 }
28943066
28953067 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3068
+ //Globals.theRenderer.object = group;
28973069 if(!useclient)
28983070 {
28993071 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3074,15 @@
29023074 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033075 cameraView.targetLookAt.set(radio.camera.lookAt);
29043076 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3077
+ //cameraView.lighttouched = true;
3078
+ Globals.lighttouched = true;
29063079 topView.object = group;
29073080 frontView.object = group;
29083081 sideView.object = group;
29093082 }
2910
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
29113086 /*
29123087 currentLayout = radio.layout;
29133088 if (currentLayout == null)
....@@ -2938,7 +3113,7 @@
29383113 if (useclient)
29393114 {
29403115 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3116
+ Globals.lighttouched = true;
29423117 //topView.object = client;
29433118 //frontView.object = client;
29443119 //sideView.object = client;
....@@ -2946,7 +3121,7 @@
29463121 else
29473122 {
29483123 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3124
+ Globals.lighttouched = true;
29503125 //topView.object = group;
29513126 //frontView.object = group;
29523127 //sideView.object = group;
....@@ -2981,6 +3156,28 @@
29813156 refreshContents();
29823157 }
29833158
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
+ }
29843181
29853182 void ResetTransform()
29863183 {
....@@ -3093,7 +3290,7 @@
30933290 refreshContents();
30943291 }
30953292
3096
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
30973294 {
30983295 Object3D obj;
30993296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3305,16 @@
31083305 LA.matIdentity(Object3D.mat);
31093306 obj.getBounds(minima, maxima, false);
31103307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133311 obj.TransformMesh(Object3D.mat);
3312
+
31143313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
31173318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3179,9 +3380,9 @@
31793380 obj = (Object3D)e.nextElement();
31803381
31813382 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
31833384 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
31853386
31863387 // System.err.println((size/1024) + " KB is the size of " + obj);
31873388 }
....@@ -3395,8 +3596,8 @@
33953596
33963597 void ParseVertices()
33973598 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
34003601
34013602 for (int i=0; i<group.selection.size(); i++)
34023603 {
....@@ -3421,7 +3622,7 @@
34213622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233624
3424
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
34253626
34263627 buffer.add(g);
34273628 }
....@@ -3436,7 +3637,7 @@
34363637 makeSomething(buffer, i==group.selection.size()-1);
34373638 }
34383639
3439
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
34403641
34413642 refreshContents();
34423643 }
....@@ -3454,7 +3655,16 @@
34543655 String pigment = Object3D.GetPigment(tex);
34553656 //String bump = Object3D.GetBump(tex);
34563657
3457
- 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
+ }
34583668
34593669 double s = v.s;
34603670
....@@ -3542,11 +3752,11 @@
35423752
35433753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443754
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
35473757 lowres.linkVerticesThis(null);
35483758 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
35503760
35513761 System.err.flush();
35523762
....@@ -3586,7 +3796,7 @@
35863796 return;
35873797
35883798 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
35903800
35913801 Object3D newgroup = new Object3D("Po:" + poses.name);
35923802
....@@ -3755,7 +3965,7 @@
37553965 group.selection.RelinkToSupport(); // july 2014
37563966 System.out.println("DONE.");
37573967 refreshContents();
3758
- 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));
37593969 }
37603970
37613971 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +3990,9 @@
37803990
37813991 void ClipMesh()
37823992 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37843994 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
37863996
37873997 if (content instanceof cGroup && ((cGroup)content).transientlink )
37883998 content = ((cGroup)content).get(0);
....@@ -3791,7 +4001,7 @@
37914001 // {
37924002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934003 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
37954005 }
37964006 // group.selection.ClipMesh(GrafreeD.clipboard);
37974007 System.out.println("DONE.");
....@@ -3926,7 +4136,7 @@
39264136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274137
39284138 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4139
+ if(elem != group || !newWindow)
39304140 {
39314141 // if (!(elem instanceof Composite))
39324142 // newWindow = false;
....@@ -4031,25 +4241,25 @@
40314241 System.err.println("info : " + child.GetPath());
40324242 }
40334243 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
40404250
40414251 objEditor.SetText(); // jan 2014
40424252
4043
- 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))
40444254 CameraPane.flash = true;
40454255
40464256 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474257 // a camera
40484258 {
40494259 CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // 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;
40534263 }
40544264
40554265 refreshContents();
....@@ -4131,12 +4341,12 @@
41314341 {
41324342 if (group.selection.isEmpty())
41334343 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
41354345 Composite tGroup = null;
41364346 if (group.selection.size() > 0) // 1)
41374347 {
41384348 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
41404350 }
41414351
41424352 if (cut)
....@@ -4176,16 +4386,16 @@
41764386 //System.out.println("cut " + child);
41774387 //System.out.println("parent = " + child.parent);
41784388 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
41804390 tGroup.add/*Child*/(tmp);
41814391 else
4182
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
41834393 }
41844394 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
41864396 tGroup.add/*Child*/(child);
41874397 else
4188
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
41894399 }
41904400
41914401 //ResetModel();
....@@ -4217,21 +4427,21 @@
42174427 //System.out.println("cut " + elem);
42184428 //System.out.println("parent = " + elem.parent);
42194429 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
42214431 tGroup.add/*Child*/(tmp);
42224432 else
4223
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
42244434 }
42254435 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
42274437 tGroup.add/*Child*/(child);
42284438 else
4229
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
42304440 }
42314441
42324442 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
42354445 if (cut)
42364446 {
42374447 ResetModel();
....@@ -4245,7 +4455,7 @@
42454455 // return;
42464456 boolean first = true;
42474457
4248
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
42494459 {
42504460 Composite temp;
42514461
....@@ -4256,7 +4466,7 @@
42564466 temp = (Composite)Applet3D.clipboard.deepCopy();
42574467 */
42584468 Object3D elem;
4259
- 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))
42604470 {
42614471 Object3D child = (Object3D)e.nextElement();
42624472
....@@ -4290,21 +4500,21 @@
42904500 //Object3D cb = Applet3D.clipboard;
42914501 //temp.addChild(cb);
42924502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- 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());
42984508 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
43014511 }
43024512
43034513 ResetModel();
43044514 refreshContents();
43054515 }
43064516
4307
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
43084518 {
43094519 // if (GrafreeD.clipboard == null)
43104520 // return;
....@@ -4333,15 +4543,22 @@
43334543 if (copyit)
43344544 {
43354545 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
43374554 }
43384555 else
43394556 {
43404557 boolean first = true;
43414558
4342
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
43434560 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
43454562 Object3D copy;
43464563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474564 {
....@@ -4351,7 +4568,7 @@
43514568 }
43524569 } else
43534570 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
43554572 }
43564573 }
43574574 }
....@@ -4796,7 +5013,7 @@
47965013
47975014 void ImportVRMLX3D()
47985015 {
4799
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
48005017 {
48015018 /**/
48025019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4813,7 +5030,7 @@
48135030
48145031 String GetFile(String dialogName)
48155032 {
4816
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
48175034 {
48185035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195036 browser.show();
....@@ -4877,10 +5094,12 @@
48775094 cButton flashSelectionButton;
48785095 cButton editButton;
48795096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
48805098 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825099 cButton unselectButton;
48835100
5101
+ cButton oneStepButton;
5102
+
48845103 cButton screenfitButton;
48855104 cButton screenfitpointButton;
48865105 cButton snapobjectButton;
....@@ -4924,7 +5143,7 @@
49245143 private MenuItem linkverticesItem;
49255144 private MenuItem relinkverticesItem;
49265145 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
49285147 private MenuItem stepAllItem;
49295148 private MenuItem revertMeshItem;
49305149 private MenuItem poseMeshItem;
....@@ -4935,6 +5154,7 @@
49355154 private MenuItem mergeGeometriesItem;
49365155 private MenuItem copyItem;
49375156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
49385158 private MenuItem pasteLinkItem;
49395159 private MenuItem pasteCloneItem;
49405160 private MenuItem pasteExpandItem;
....@@ -4984,8 +5204,10 @@
49845204 private MenuItem panoTexturesItem;
49855205
49865206 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
49885208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
49895211 private MenuItem hideItem;
49905212 private MenuItem grabItem;
49915213 private MenuItem backItem;
....@@ -5007,6 +5229,7 @@
50075229
50085230 private MenuItem resetParentItem;
50095231 private MenuItem repairParentItem;
5232
+ private MenuItem repairShadowItem;
50105233 private MenuItem sortbysizeItem;
50115234 private MenuItem sortbynameItem;
50125235
....@@ -5031,7 +5254,7 @@
50315254 private MenuItem blobItem;
50325255 private MenuItem latheItem;
50335256 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
50355258 private MenuItem meshItem;
50365259 // private MenuItem meshGroupItem;
50375260 private MenuItem springItem;