Normand Briere
2019-06-09 cd87df088b1850ba0c90beb6c866c443e4eaf3b9
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,27 +185,37 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
211
+ if (Globals.ADVANCED)
212
+ {
197213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198214 revertMeshItem.addActionListener(this);
199215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200216 resetreferencesItem.addActionListener(this);
201217 menu.add("-");
218
+ }
202219 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203220 overwriteGeoItem.addActionListener(this);
204221 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +227,26 @@
210227 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211228 overwriteUVItem.addActionListener(this);
212229 menu.add("-");
230
+ if (Globals.ADVANCED)
231
+ {
213232 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214233 generateMeshItem.addActionListener(this);
215234 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216235 poseMeshItem.addActionListener(this);
217236 menu.add("-");
237
+ }
218238 resetsupportItem = menu.add(new MenuItem("Reset support"));
219239 resetsupportItem.addActionListener(this);
220240 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221241 linkverticesItem.addActionListener(this);
222242 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223243 relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
224247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225248 setMasterItem.addActionListener(this);
249
+ }
226250
227251 oe.menuBar.add(menu = new Menu("Group"));
228252 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +257,32 @@
233257 frontItem.addActionListener(this);
234258 compositeItem = menu.add(new MenuItem("Composite"));
235259 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237261 hideItem.addActionListener(this);
238262 ungroupItem = menu.add(new MenuItem("Ungroup"));
239263 ungroupItem.addActionListener(this);
240264 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
242266 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248268 switchGeoItem.addActionListener(this);
249269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250270 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
252272 morphItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ menu.add("-");
277
+ physicsItem = menu.add(new MenuItem("Physics"));
278
+ physicsItem.addActionListener(this);
279
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
280
+ frameselectorItem.addActionListener(this);
253281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254282 scriptNodeItem.addActionListener(this);
255283 cameraItem = menu.add(new MenuItem("Camera"));
256284 cameraItem.addActionListener(this);
285
+ }
257286
258287 oe.menuBar.add(menu = new Menu("Object"));
259288 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +297,29 @@
268297 shadowYItem.addActionListener(this);
269298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
271303 linkerItem = menu.add(new MenuItem("Linker"));
272304 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275305 attributeItem = menu.add(new MenuItem("Attribute"));
276306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
277309 pointflowItem = menu.add(new MenuItem("Point Flow"));
278310 pointflowItem.addActionListener(this);
311
+ }
279312 menu.add("-");
280313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281314 resetTransformItem.addActionListener(this);
282315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283316 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
317
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
318
+ resetCentroidXZItem.addActionListener(this);
319
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
320
+ transformGeometryItem.addActionListener(this);
321
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
322
+ transformChildrenItem.addActionListener(this);
286323
287324 oe.menuBar.add(menu = new Menu("Geometry"));
288325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +356,34 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326370 clearMaterialsItem.addActionListener(this);
371
+ resetAllItem = menu.add(new MenuItem("Reset All"));
372
+ resetAllItem.addActionListener(this);
373
+ stepAllItem = menu.add(new MenuItem("Step All"));
374
+ stepAllItem.addActionListener(this);
327375 menu.add("-");
328376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329377 liveleavesItem.addActionListener(this);
330378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
332382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333383 supportleavesItem.addActionListener(this);
334384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335385 unsupportleavesItem.addActionListener(this);
386
+ }
336387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337388 hideleavesItem.addActionListener(this);
338389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,28 +427,34 @@
376427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377428 sortbynameItem.addActionListener(this);
378429 menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ // Pretty much the same as duplicate and clone.
379437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380438 extractGeometriesItem.addActionListener(this);
381439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382440 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
441
+ }
387442
388443 oe.menuBar.add(menu = new Menu("Insert"));
389444 buildCreateMenu(menu);
390445
391
-
392446 oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398448 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
401458
402459 oe.menuBar.add(menu = new Menu("Tools"));
403460 buildToolsMenu(menu);
....@@ -433,153 +490,98 @@
433490 oe.radioPanel.add(dummyButton);
434491 oe.buttonGroup.add(dummyButton);
435492 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
493
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439494
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
441497 liveCB.addItemListener(this);
442498
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500
+ oneStepButton.setToolTipText("Animate one step forward");
501
+ oneStepButton.addActionListener(this);
502
+
503
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
504
+ fastCB.setToolTipText("Fast mode");
461505 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
506
+
507
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
508
+ trackCB.setToolTipText("Enable tracking");
503509 trackCB.addItemListener(this);
504510
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512
+ screenfitButton.setToolTipText("Screen fit");
507513 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
514
+
509515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510516 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515517
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
518
+ if (Globals.ADVANCED)
519
+ {
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521
+ snapobjectButton.addActionListener(this);
522
+ snapobjectButton.setToolTipText("Snap Object");
523
+ }
524
+
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526
+ flashSelectionButton.setToolTipText("Show selection");
522527 flashSelectionButton.addActionListener(this);
523528
524
- oe.toolbarPanel.add(new cButton(" ", false));
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525530
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532
+ twoButton.setToolTipText("Show center view only");
532533 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534535 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
536
+ fourButton.setToolTipText("Show left panel only");
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538
+ sixButton.setToolTipText("2-column layout left");
536539 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541
+ threeButton.setToolTipText("2-column layout right");
538542 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544
+ sevenButton.setToolTipText("3-column layout");
540545 sevenButton.addActionListener(this);
541546 //
542547
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
+ rootButton.setToolTipText("Edit selection in new tab");
544550 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553
+ closeButton.setToolTipText("Close tab");
547554 closeButton.addActionListener(this);
548555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549556 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551557
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
558
+ cGridBag commandsPanel = new cGridBag();
559
+
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ editButton.setToolTipText("Edit selection");
554562 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558563
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
560566 uneditButton.addActionListener(this);
561567
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
568
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
+ allParamsButton.setToolTipText("Edit all params");
574570 allParamsButton.addActionListener(this);
575571
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ clearPanelButton.setToolTipText("Clear edit panel");
574
+ clearPanelButton.addActionListener(this);
575
+
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ unselectButton.setToolTipText("Unselect");
581578 unselectButton.addActionListener(this);
582579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
583585 // oe.aConstraints.gridx += 1;
584586 // oe.aConstraints.weighty = 0;
585587 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +593,37 @@
591593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592594 // gcButton.addActionListener(this);
593595
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
605599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
600
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607601 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
612605
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
+ cGridBag copyOptionsPanel = new cGridBag();
607
+
608
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
+ colorCB.setToolTipText("Copy color when dropped");
617610 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
611
+
612
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
+ materialCB.setToolTipText("Copy material when dropped");
620614 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
615
+
616
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
+ textureCB.setToolTipText("Copy texture when dropped");
623618 textureCB.addItemListener(this);
624619
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
627623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
628627 //jList.addListSelectionListener(this);
629628 oe.jTree.addTreeSelectionListener(this);
630629 //jTree.setRootVisible(false);
....@@ -646,6 +645,78 @@
646645 radio.layout = sevenButton;
647646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648647 }
648
+
649
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
650
+ {
651
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
652
+ boxCB.setToolTipText("Display bounding boxes");
653
+ boxCB.addItemListener(this);
654
+
655
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
656
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
657
+ zoomBoxCB.addItemListener(this);
658
+
659
+ if (true) // Globals.ADVANCED)
660
+ {
661
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
+ supportCB.setToolTipText("Enable rigging");
663
+ supportCB.addItemListener(this);
664
+
665
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
666
+ // localCB.addItemListener(this);
667
+
668
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
669
+ crowdCB.setToolTipText("Used for crowds");
670
+ crowdCB.addItemListener(this);
671
+
672
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
673
+ smoothCB.setToolTipText("Snapping delay");
674
+ smoothCB.addItemListener(this);
675
+
676
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
677
+ slowCB.setToolTipText("Smooth interpolation");
678
+ slowCB.addItemListener(this);
679
+
680
+// constraints.gridy += 1;
681
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
682
+// speakerMocapCB.addItemListener(this);
683
+
684
+ if (false)
685
+ {
686
+ // handled in scripts
687
+ //constraints.gridy += 1;
688
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
689
+ speakerCameraCB.addItemListener(this);
690
+
691
+ //constraints.gridy += 1;
692
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
693
+ speakerFocusCB.addItemListener(this);
694
+
695
+ //constraints.gridy += 1;
696
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
697
+ smoothfocusCB.addItemListener(this);
698
+ }
699
+
700
+//constraints.gridx += 1;
701
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
702
+// debugCB.addItemListener(this);
703
+
704
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
705
+ oeilCB.addItemListener(this);
706
+
707
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
708
+ lookAtCB.setToolTipText("Look-at target");
709
+ lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
718
+
719
+ }
649720
650721 void EditObject(Object3D obj)
651722 {
....@@ -676,6 +747,7 @@
676747 JCheckBox fastCB;
677748 JCheckBox slowCB;
678749 JCheckBox boxCB;
750
+ JCheckBox zoomBoxCB;
679751 JCheckBox trackCB;
680752 JCheckBox smoothfocusCB;
681753 // JCheckBox speakerMocapCB;
....@@ -755,6 +827,10 @@
755827 Recompile();
756828 cameraView.repaint();
757829 // refreshContents();
830
+ }
831
+ else if(e.getSource() == zoomBoxCB)
832
+ {
833
+ cameraView.ToggleZoomBoxMode();
758834 }
759835 else if(e.getSource() == smoothfocusCB)
760836 {
....@@ -869,7 +945,9 @@
869945 // objEditor.DropFile((java.io.File[]) object, true);
870946 // return;
871947 // }
872
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
873951 {
874952 // file(s)
875953 String[] names = string.split("\n");
....@@ -896,7 +974,7 @@
896974
897975 flashIt = false;
898976 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
900978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
901979
902980 if (group.selection.size() == 1)
....@@ -923,11 +1001,11 @@
9231001 {
9241002 loadClipboard(true);
9251003 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1004
+ pasteInto(false, false);
9271005 } else {
9281006 loadClipboard(false);
9291007 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1008
+ pasteInto(false, false); // true); // ???
9311009 }
9321010 }
9331011 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1127,33 @@
10491127 kleinItem.addActionListener(this);
10501128 particleItem = menu.add(new MenuItem("Particle system"));
10511129 particleItem.addActionListener(this);
1130
+ if (Globals.ADVANCED)
1131
+ {
10521132 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531133 ragdollItem.addActionListener(this);
10541134 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551135 ragdoll2Item.addActionListener(this);
1136
+ }
10561137 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1138
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581139 meshItem.addActionListener(this);
10591140 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601141 // meshGroupItem.addActionListener(this);
1142
+ if (Globals.ADVANCED)
1143
+ {
10611144 springItem = menu.add(new MenuItem("Spring"));
10621145 springItem.addActionListener(this);
10631146 flagItem = menu.add(new MenuItem("Flag"));
10641147 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691148 blobItem = menu.add(new MenuItem("Blob"));
10701149 blobItem.addActionListener(this);
10711150 latheItem = menu.add(new MenuItem("Lathe"));
10721151 latheItem.addActionListener(this);
1152
+ }
1153
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1154
+ bezierItem.addActionListener(this);
1155
+ overlayItem = menu.add(new MenuItem("Overlay"));
1156
+ overlayItem.addActionListener(this);
10731157 lightItem = menu.add(new MenuItem("Light"));
10741158 lightItem.addActionListener(this);
10751159 menu.add("-");
....@@ -1079,34 +1163,39 @@
10791163 loopItem.addActionListener(this);
10801164 doubleItem = menu.add(new MenuItem("Fork"));
10811165 doubleItem.addActionListener(this);
1166
+ if (Globals.ADVANCED)
1167
+ {
10821168 tripleItem = menu.add(new MenuItem("Trident"));
10831169 tripleItem.addActionListener(this);
1170
+ }
10841171 }
10851172
10861173 void buildToolsMenu(Menu menu)
10871174 {
10881175 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891176 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1177
+ animationItem.setState(Globals.ANIMATION);
10911178
10921179 menu.add("-");
10931180 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941181 parseverticesItem.addActionListener(this);
10951182 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961183 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1184
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981185 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011186 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021187 reduceMorphItem.addActionListener(this);
11031188 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041189 reduce34MorphItem.addActionListener(this);
1105
-
1190
+ menu.add("-");
11061191 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071192 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091193
1194
+ if (Globals.ADVANCED)
1195
+ {
1196
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1197
+ mirrorItem.addActionListener(this);
1198
+ menu.add("-");
11101199 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111200 memoryItem.addActionListener(this);
11121201 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1120,6 +1209,8 @@
11201209 resetParentItem.addActionListener(this);
11211210 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221211 repairParentItem.addActionListener(this);
1212
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1213
+ repairShadowItem.addActionListener(this);
11231214 menu.add(invariantsItem = new MenuItem("Invariants"));
11241215 invariantsItem.addActionListener(this);
11251216 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1218,7 @@
11271218 menu.add("-");
11281219 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291220 editScriptItem.addActionListener(this);
1221
+ }
11301222 }
11311223
11321224 void ScreenFit()
....@@ -1455,9 +1547,9 @@
14551547
14561548 void Overwrite(int mask)
14571549 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591551 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
14611553
14621554 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631555 content = ((cGroup)content).get(0);
....@@ -1480,6 +1572,7 @@
14801572 //
14811573 public void actionPerformed(ActionEvent event) // , Object arg)
14821574 {
1575
+ Object source = event.getSource();
14831576 /*
14841577 if (event.getSource() == nameField)
14851578 {
....@@ -1491,11 +1584,11 @@
14911584 }
14921585 else
14931586 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1587
+ if (source == lookAtItem || source == lookFromItem)
14951588 {
14961589 ScreenFit();
14971590 } else
1498
- if (event.getSource() == switchItem)
1591
+ if (source == switchItem)
14991592 {
15001593 cVector v1 = new cVector();
15011594 cVector v2 = new cVector();
....@@ -1504,11 +1597,11 @@
15041597 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051598 objEditor.cameraView.repaint();
15061599 } else
1507
- if (event.getSource() == rectoidItem)
1600
+ if (source == rectoidItem)
15081601 {
15091602 makeSomething(new Box());
15101603 } else
1511
- if (event.getSource() == particleItem)
1604
+ if (source == particleItem)
15121605 {
15131606 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141607 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1622,9 @@
15291622 applyExample(particleGeom, "SMOKE");
15301623 makeSomething(particleGeom);
15311624 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1625
+ if (source == ragdollItem || source == ragdoll2Item)
15331626 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1627
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351628
15361629 ragdoll.toParent = LA.newMatrix();
15371630 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1642,7 @@
15491642 } else
15501643 /*
15511644 */
1552
- if (event.getSource() == heightFieldItem)
1645
+ if (source == heightFieldItem)
15531646 {
15541647 Object3D obj = new Object3D();
15551648
....@@ -1587,31 +1680,31 @@
15871680
15881681 makeSomething(obj);
15891682 } else
1590
- if (event.getSource() == gridItem)
1683
+ if (source == gridItem)
15911684 {
15921685 makeSomething(new Grid());
15931686 } else
1594
- if (event.getSource() == ellipsoidItem)
1687
+ if (source == ellipsoidItem)
15951688 {
15961689 makeSomething(new Sphere());
15971690 } else
1598
- if (event.getSource() == coneItem)
1691
+ if (source == coneItem)
15991692 {
16001693 makeSomething(new Cone());
16011694 } else
1602
- if (event.getSource() == torusItem)
1695
+ if (source == torusItem)
16031696 {
16041697 makeSomething(new Torus());
16051698 } else
1606
- if (event.getSource() == superItem)
1699
+ if (source == superItem)
16071700 {
16081701 makeSomething(new Superellipsoid());
16091702 } else
1610
- if (event.getSource() == kleinItem)
1703
+ if (source == kleinItem)
16111704 {
16121705 makeSomething(new Klein());
16131706 } else
1614
- if (event.getSource() == blobItem)
1707
+ if (source == blobItem)
16151708 {
16161709 Blob blob = new Blob();
16171710 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1712,15 @@
16191712 //blob.retile();
16201713 makeSomething(blob);
16211714 } else
1622
- if (event.getSource() == latheItem)
1715
+ if (source == latheItem)
16231716 {
16241717 makeSomething(new Lathe());
16251718 } else
1626
- if (event.getSource() == bezierItem)
1719
+ if (source == bezierItem)
16271720 {
16281721 makeSomething(new BezierSurface());
16291722 } else
1630
- if (event.getSource() == checkerItem)
1723
+ if (source == overlayItem)
16311724 {
16321725 /*
16331726 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1735,7 @@
16421735 */
16431736 makeSomething(new Checker());
16441737 } else
1645
- if (event.getSource() == meshItem)
1738
+ if (source == meshItem)
16461739 {
16471740 Object3D itemtomake = new Object3D();
16481741 Object3D child;
....@@ -1663,35 +1756,35 @@
16631756 makeSomething(child);
16641757 }
16651758 } else
1666
- if (event.getSource() == springItem)
1759
+ if (source == springItem)
16671760 {
16681761 cSpring s = new cSpring();
16691762 s.setup();
16701763 makeSomething(s);
16711764 } else
1672
- if (event.getSource() == flagItem)
1765
+ if (source == flagItem)
16731766 {
16741767 cSpring s = new cFlag();
16751768 s.setup();
16761769 makeSomething(s);
16771770 } else
1678
- if (event.getSource() == lightItem)
1771
+ if (source == lightItem)
16791772 {
16801773 makeSomething(new Light());
16811774 } else
1682
- if (event.getSource() == csgItem)
1775
+ if (source == csgItem)
16831776 {
16841777 group(new CSG());
16851778 } else
1686
- if (event.getSource() == templateItem)
1779
+ if (source == templateItem)
16871780 {
16881781 group(new cTemplate());
16891782 } else
1690
- if (event.getSource() == attributeItem)
1783
+ if (source == attributeItem)
16911784 {
16921785 makeSomething(new Attribute());
16931786 } else
1694
- if (event.getSource() == pointflowItem)
1787
+ if (source == pointflowItem)
16951788 {
16961789 makeSomething(new PointFlow());
16971790 } else
....@@ -1703,7 +1796,7 @@
17031796 } else
17041797 */
17051798
1706
- if (event.getSource() == superLoopItem)
1799
+ if (source == superLoopItem)
17071800 {
17081801 Composite g = new cGroup();
17091802 for (int i=0; i<15; i++)
....@@ -1725,7 +1818,7 @@
17251818
17261819 group(g);
17271820 } else
1728
- if (event.getSource() == loopItem)
1821
+ if (source == loopItem)
17291822 {
17301823 Composite csg = new GroupLeaf();
17311824 csg.count = 5;
....@@ -1734,7 +1827,7 @@
17341827 csg.addChild(child);
17351828 child.addChild(csg);
17361829 } else
1737
- if (event.getSource() == doubleItem)
1830
+ if (source == doubleItem)
17381831 {
17391832 Composite csg = new GroupLeaf();
17401833 csg.count = 5;
....@@ -1746,7 +1839,7 @@
17461839 csg.addChild(child);
17471840 child.addChild(csg);
17481841 } else
1749
- if (event.getSource() == tripleItem)
1842
+ if (source == tripleItem)
17501843 {
17511844 Composite csg = new GroupLeaf();
17521845 csg.count = 4;
....@@ -1762,70 +1855,83 @@
17621855 child.addChild(csg);
17631856 } else
17641857
1765
- if (event.getSource() == importGFDItem)
1858
+ if (source == importGFDItem)
17661859 {
17671860 ImportGFD();
17681861 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1862
+ if (source == importVRMLX3DItem)
17701863 {
17711864 ImportVRMLX3D();
17721865 } else
1773
- if (event.getSource() == import3DSItem)
1866
+ if (source == import3DSItem)
17741867 {
17751868 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17761869 } else
1777
- if (event.getSource() == importOBJItem)
1870
+ if (source == importOBJItem)
17781871 {
1779
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1872
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
+ browser.setVisible(true);
1875
+ String filename = browser.getFile();
1876
+ if (filename != null && filename.length() > 0)
1877
+ {
1878
+ String fullname = browser.getDirectory() + filename;
1879
+ makeSomething(ReadOBJ(fullname), true);
1880
+ }
17801881 } else
1781
- if (event.getSource() == computeAOItem)
1882
+ if (source == computeAOItem)
17821883 {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1884
+ Globals.drawMode = CameraPane.OCCLUSION;
1885
+ Globals.theRenderer.repaint();
17851886 } else
1786
- if (event.getSource() == recompileItem)
1887
+ if (source == recompileItem)
17871888 {
17881889 Recompile();
17891890 refreshContents();
17901891 } else
1791
- if (event.getSource() == editScriptItem)
1892
+ if (source == editScriptItem)
17921893 {
17931894 OpenDialog();
17941895 refreshContents();
17951896 } else
1796
- if (event.getSource() == invariantsItem)
1897
+ if (source == invariantsItem)
17971898 {
17981899 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
18001901 } else
1801
- if (event.getSource() == memoryItem)
1902
+ if (source == memoryItem)
18021903 {
18031904 //System.out.println("Invariants:");
18041905 PrintMemory();
18051906 } else
1806
- if (event.getSource() == pathItem)
1907
+ if (source == pathItem)
18071908 {
18081909 PrintPath();
18091910 } else
1810
- if (event.getSource() == analyzeItem)
1911
+ if (source == analyzeItem)
18111912 {
18121913 AnalyzeObject();
18131914 } else
1814
- if (event.getSource() == dumpItem)
1915
+ if (source == dumpItem)
18151916 {
18161917 DumpObject();
18171918 } else
1818
- if (event.getSource() == screenfitButton)
1919
+ if (source == oneStepButton)
1920
+ {
1921
+ Globals.ONESTEP = true;
1922
+ cameraView.repaint();
1923
+ } else
1924
+ if (source == screenfitButton)
18191925 {
18201926 //Reload(lastConverter, lastFilename, true);
18211927 ScreenFit();
18221928 } else
1823
- if (event.getSource() == screenfitpointButton)
1929
+ if (source == screenfitpointButton)
18241930 {
18251931 //Reload(lastConverter, lastFilename, true);
18261932 ScreenFitPoint();
18271933 } else
1828
- if (event.getSource() == snapobjectButton)
1934
+ if (source == snapobjectButton)
18291935 {
18301936 //Reload(lastConverter, lastFilename, true);
18311937 SnapObject();
....@@ -1836,13 +1942,13 @@
18361942 // Recompile();
18371943 // refreshContents();
18381944 // } else
1839
- if (event.getSource() == gcButton)
1945
+ if (source == gcButton)
18401946 {
18411947 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421948 System.gc();
18431949 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441950 } else
1845
- if (event.getSource() == editLeafItem)
1951
+ if (source == editLeafItem)
18461952 {
18471953 Object3D obj;
18481954 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +1962,66 @@
18561962 }
18571963 refreshContents(true);
18581964 } else
1859
- if (event.getSource() == openWindowItem)
1965
+ if (source == openWindowItem)
18601966 {
18611967 EditSelection(true);
18621968 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1969
+ if (source == cutItem || source == clearButton)
18641970 {
18651971 loadClipboard(true);
18661972 } else
1867
- if (event.getSource() == duplicateItem)
1973
+ if (source == duplicateItem)
18681974 {
1869
- Object3D keep = GrafreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
18701976 loadClipboard(false);
18711977 paste(false);
1872
- GrafreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
18731979 } else
1874
- if (event.getSource() == cloneItem)
1980
+ if (source == cloneItem)
18751981 {
18761982 CloneSelection(false);
18771983 } else
1878
- if (event.getSource() == cloneSupportItem)
1984
+ if (source == cloneSupportItem)
18791985 {
18801986 CloneSelection(true);
18811987 } else
1882
- if (event.getSource() == copyItem)
1988
+ if (source == copyItem)
18831989 {
18841990 loadClipboard(false);
18851991 } else
1886
- if (event.getSource() == pasteItem)
1992
+ if (source == pasteItem)
18871993 {
18881994 paste(false);
18891995 } else
1890
- if (event.getSource() == pasteLinkItem)
1996
+ if (source == pasteIntoItem)
18911997 {
1892
- pasteInto(false);
1998
+ pasteInto(true, false);
18931999 } else
1894
- if (event.getSource() == pasteCloneItem)
2000
+ if (source == pasteLinkItem)
18952001 {
1896
- pasteInto(true);
2002
+ pasteInto(false, false);
18972003 } else
1898
- if (event.getSource() == pasteExpandItem)
2004
+ if (source == pasteCloneItem)
2005
+ {
2006
+ pasteInto(true, true);
2007
+ } else
2008
+ if (source == pasteExpandItem)
18992009 {
19002010 paste(true);
19012011 } else
1902
- if (event.getSource() == synchronizeItem)
2012
+ if (source == synchronizeItem)
19032013 {
19042014 Overwrite(Object3D.TRANSFORM);
19052015 } else
1906
- if (event.getSource() == overwriteNameItem)
2016
+ if (source == overwriteNameItem)
19072017 {
19082018 Overwrite(Object3D.NAME);
19092019 } else
1910
- if (event.getSource() == overwriteUVItem)
2020
+ if (source == overwriteUVItem)
19112021 {
19122022 Overwrite(Object3D.UV);
19132023 } else
1914
- if (event.getSource() == overwriteMatItem)
2024
+ if (source == overwriteMatItem)
19152025 {
19162026 /* july 2015
19172027 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2041,7 @@
19312041
19322042 Overwrite(dropAttributes);
19332043 }
1934
- if (event.getSource() == overwriteGeoItem)
2044
+ if (source == overwriteGeoItem)
19352045 {
19362046 Overwrite(Object3D.GEOMETRY);
19372047 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2058,7 @@
19482058 // refreshContents();
19492059 // }
19502060 } else
1951
- if (event.getSource() == generateMeshItem)
2061
+ if (source == generateMeshItem)
19522062 {
19532063 //if (group.selection.size() == 1)
19542064 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2069,7 @@
19592069 ResetModel();
19602070 refreshContents();
19612071 } else
1962
- if (event.getSource() == extractGeometriesItem)
2072
+ if (source == extractGeometriesItem)
19632073 {
19642074 boolean one = false;
19652075
....@@ -1986,7 +2096,7 @@
19862096 ResetModel();
19872097 refreshContents();
19882098 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2099
+ if (source == cloneGeometriesItem)
19902100 {
19912101 boolean one = false;
19922102
....@@ -2012,7 +2122,7 @@
20122122 ResetModel();
20132123 refreshContents();
20142124 } else
2015
- if (event.getSource() == shareGeometriesItem)
2125
+ if (source == shareGeometriesItem)
20162126 {
20172127 boolean one = false;
20182128
....@@ -2042,7 +2152,7 @@
20422152 refreshContents();
20432153 }
20442154 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2155
+ if (source == mergeGeometriesItem)
20462156 {
20472157 boolean one = false;
20482158
....@@ -2072,7 +2182,7 @@
20722182 ResetModel();
20732183 refreshContents();
20742184 } else
2075
- if (event.getSource() == linkverticesItem)
2185
+ if (source == linkverticesItem)
20762186 {
20772187 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782188 // {
....@@ -2085,48 +2195,48 @@
20852195 // group.selection.get(0).setMasterThis(content); // should be identity
20862196 // refreshContents();
20872197 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892199 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
20912201
20922202 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932203 content = ((cGroup)content).get(0);
20942204
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2205
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962206 for (int i=0; i<group.selection.size(); i++)
20972207 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2208
+ boolean random = CameraPane.SWITCH;
2209
+ CameraPane.SWITCH = false; // parse all random nodes
21002210 group.selection.get(i).linkVerticesThis(content);
21012211 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2212
+ CameraPane.SWITCH = random;
21032213 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2214
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052215 refreshContents();
21062216 }
21072217 } else
2108
- if (event.getSource() == resetsupportItem)
2218
+ if (source == resetsupportItem)
21092219 {
21102220 for (int i=0; i<group.selection.size(); i++)
21112221 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2222
+ boolean random = CameraPane.SWITCH;
2223
+ CameraPane.SWITCH = false; // parse all random nodes
21142224 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2225
+ CameraPane.SWITCH = random;
21162226 }
21172227
21182228 refreshContents();
21192229 } else
2120
- if (event.getSource() == relinkverticesItem)
2230
+ if (source == relinkverticesItem)
21212231 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2232
+ boolean random = CameraPane.SWITCH;
2233
+ CameraPane.SWITCH = false; // parse all random nodes
21242234 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2235
+ CameraPane.SWITCH = random;
21262236
21272237 refreshContents();
21282238 } else
2129
- if (event.getSource() == resetreferencesItem)
2239
+ if (source == resetreferencesItem)
21302240 {
21312241 for (int i=0; i<group.selection.size(); i++)
21322242 {
....@@ -2135,11 +2245,11 @@
21352245
21362246 refreshContents();
21372247 } else
2138
- if (event.getSource() == setMasterItem)
2248
+ if (source == setMasterItem)
21392249 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412251 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
21432253
21442254 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452255 content = ((cGroup)content).get(0);
....@@ -2148,13 +2258,13 @@
21482258 refreshContents();
21492259 }
21502260 } else
2151
- if (event.getSource() == poseMeshItem)
2261
+ if (source == poseMeshItem)
21522262 {
21532263 if (group.selection.size() == 1)
21542264 {
2155
- if (GrafreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
21562266 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
21582268
21592269 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602270 content = ((cGroup)content).get(0);
....@@ -2167,19 +2277,19 @@
21672277 }
21682278
21692279 } else
2170
- if (event.getSource() == revertMeshItem)
2280
+ if (source == revertMeshItem)
21712281 {
21722282 RevertMeshes();
21732283 } else
2174
- if (event.getSource() == resetMeshItem)
2284
+ if (source == resetAllItem)
21752285 {
21762286 ResetAll();
21772287 } else
2178
- if (event.getSource() == stepAllItem)
2288
+ if (source == stepAllItem)
21792289 {
21802290 StepAll();
21812291 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2292
+ if (source == clearItem) // || event.getSource() == clearButton)
21832293 {
21842294 //int indices[] = jList.getSelectedIndices();
21852295 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2297,46 @@
21872297
21882298 ClearSelection(false);
21892299 } else
2190
- if (event.getSource() == clearAllItem)
2300
+ if (source == clearAllItem)
21912301 {
21922302 ClearSelection(true);
21932303 } else
2194
- if (event.getSource() == grabItem)
2304
+ if (source == grabItem)
21952305 {
21962306 group(new cGroup(), true);
21972307 } else
2198
- if (event.getSource() == hideItem)
2308
+ if (source == hideItem)
21992309 {
22002310 group(new HiddenObject());
22012311 } else
2202
- if (event.getSource() == frontItem)
2312
+ if (source == frontItem)
22032313 {
22042314 front();
22052315 } else
2206
- if (event.getSource() == backItem)
2316
+ if (source == backItem)
22072317 {
22082318 back();
22092319 } else
2210
- if (event.getSource() == cameraItem)
2320
+ if (source == cameraItem)
22112321 {
22122322 makeSomething(new Camera());
22132323 } else
2214
- if (event.getSource() == compositeItem)
2324
+ if (source == compositeItem)
22152325 {
22162326 group(new Composite());
22172327 } else
2218
- if (event.getSource() == randomItem)
2328
+ if (source == randomItem)
22192329 {
22202330 RandomNode random = new RandomNode();
22212331 group(random);
22222332 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2333
+ random.name = random.get(0).name + "Switch";
22242334 } else
2225
- if (event.getSource() == physicsItem)
2335
+ if (source == physicsItem)
22262336 {
22272337 group(new PhysicsNode());
22282338 } else
2229
- if (event.getSource() == frameselectorItem)
2339
+ if (source == frameselectorItem)
22302340 {
22312341 for (int i=0; i<group.selection.size(); i++)
22322342 {
....@@ -2238,7 +2348,7 @@
22382348 ResetModel();
22392349 refreshContents();
22402350 } else
2241
- if (event.getSource() == switchGeoItem)
2351
+ if (source == switchGeoItem)
22422352 {
22432353 for (int i=0; i<group.selection.size(); i++)
22442354 {
....@@ -2250,7 +2360,7 @@
22502360 ResetModel();
22512361 refreshContents();
22522362 } else
2253
- if (event.getSource() == switchTransfoItem)
2363
+ if (source == switchTransfoItem)
22542364 {
22552365 for (int i=0; i<group.selection.size(); i++)
22562366 {
....@@ -2262,7 +2372,7 @@
22622372 ResetModel();
22632373 refreshContents();
22642374 } else
2265
- if (event.getSource() == morphItem)
2375
+ if (source == morphItem)
22662376 {
22672377 for (int i=0; i<group.selection.size(); i++)
22682378 {
....@@ -2274,7 +2384,7 @@
22742384 ResetModel();
22752385 refreshContents();
22762386 } else
2277
- if (event.getSource() == scriptNodeItem)
2387
+ if (source == scriptNodeItem)
22782388 {
22792389 boolean atleastone = false;
22802390
....@@ -2313,31 +2423,31 @@
23132423 }
23142424 }
23152425 } else
2316
- if (event.getSource() == linkerItem)
2426
+ if (source == linkerItem)
23172427 {
23182428 group(new cLinker());
23192429 } else
2320
- if (event.getSource() == textureItem)
2430
+ if (source == textureItem)
23212431 {
23222432 group(new TextureNode());
23232433 } else
2324
- if (event.getSource() == billboardItem)
2434
+ if (source == billboardItem)
23252435 {
23262436 group(new BillboardNode());
23272437 } else
2328
- if (event.getSource() == shadowXItem)
2438
+ if (source == shadowXItem)
23292439 {
23302440 CastShadow(0);
23312441 } else
2332
- if (event.getSource() == shadowYItem)
2442
+ if (source == shadowYItem)
23332443 {
23342444 CastShadow(1);
23352445 } else
2336
- if (event.getSource() == shadowZItem)
2446
+ if (source == shadowZItem)
23372447 {
23382448 CastShadow(2);
23392449 } else
2340
- if (event.getSource() == ungroupItem)
2450
+ if (source == ungroupItem)
23412451 {
23422452 //ungroup();
23432453 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2459,187 @@
23492459
23502460 refreshContents();
23512461 } else
2352
- if (event.getSource() == genUVItem)
2462
+ if (source == genUVItem)
23532463 {
23542464 GenUV();
23552465 } else
2356
- if (event.getSource() == genNormalsCADItem)
2466
+ if (source == genNormalsCADItem)
23572467 {
23582468 GenNormals(true);
23592469 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2470
+ if (source == genNormalsMESHItem)
23612471 {
23622472 GenNormals(true); // TODO
23632473 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2474
+ if (source == genNormalsORGANItem)
23652475 {
23662476 GenNormals(false);
23672477 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2478
+ if (source == genNormalsMINEItem)
23692479 {
23702480 GenNormalsMINE();
23712481 } else
2372
- if (event.getSource() == stripifyItem)
2482
+ if (source == stripifyItem)
23732483 {
23742484 Stripify();
23752485 } else
2376
- if (event.getSource() == unstripifyItem)
2486
+ if (source == unstripifyItem)
23772487 {
23782488 Unstripify();
23792489 } else
2380
- if (event.getSource() == trimItem)
2490
+ if (source == trimItem)
23812491 {
23822492 Trim();
23832493 } else
2384
- if (event.getSource() == untrimItem)
2494
+ if (source == untrimItem)
23852495 {
23862496 Untrim();
23872497 } else
2388
- if (event.getSource() == clearColorsItem)
2498
+ if (source == clearColorsItem)
23892499 {
23902500 ClearColors();
23912501 } else
2392
- if (event.getSource() == clearMaterialsItem)
2502
+ if (source == clearMaterialsItem)
23932503 {
23942504 ClearMaterials();
23952505 } else
2396
- if (event.getSource() == liveleavesItem)
2506
+ if (source == liveleavesItem)
23972507 {
23982508 LiveLeaves(true);
23992509 } else
2400
- if (event.getSource() == unliveleavesItem)
2510
+ if (source == unliveleavesItem)
24012511 {
24022512 LiveLeaves(false);
24032513 } else
2404
- if (event.getSource() == supportleavesItem)
2514
+ if (source == supportleavesItem)
24052515 {
24062516 SupportLeaves(true);
24072517 } else
2408
- if (event.getSource() == unsupportleavesItem)
2518
+ if (source == unsupportleavesItem)
24092519 {
24102520 SupportLeaves(false);
24112521 } else
2412
- if (event.getSource() == hideleavesItem)
2522
+ if (source == hideleavesItem)
24132523 {
24142524 HideLeaves(true);
24152525 } else
2416
- if (event.getSource() == showleavesItem)
2526
+ if (source == showleavesItem)
24172527 {
24182528 HideLeaves(false);
24192529 } else
2420
- if (event.getSource() == markleavesItem)
2530
+ if (source == markleavesItem)
24212531 {
24222532 MarkLeaves(true);
24232533 } else
2424
- if (event.getSource() == unmarkleavesItem)
2534
+ if (source == unmarkleavesItem)
24252535 {
24262536 MarkLeaves(false);
24272537 } else
2428
- if (event.getSource() == flipVItem)
2538
+ if (source == flipVItem)
24292539 {
24302540 FlipV(true);
24312541 } else
2432
- if (event.getSource() == unflipVItem)
2542
+ if (source == unflipVItem)
24332543 {
24342544 FlipV(false);
24352545 } else
2436
- if (event.getSource() == lowTexturesItem)
2546
+ if (source == lowTexturesItem)
24372547 {
24382548 SetTexRes(0);
24392549 } else
2440
- if (event.getSource() == normalTexturesItem)
2550
+ if (source == normalTexturesItem)
24412551 {
24422552 SetTexRes(1);
24432553 } else
2444
- if (event.getSource() == highTexturesItem)
2554
+ if (source == highTexturesItem)
24452555 {
24462556 SetTexRes(2);
24472557 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2558
+ if (source == veryhighTexturesItem)
24492559 {
24502560 SetTexRes(3);
24512561 } else
2452
- if (event.getSource() == maxTexturesItem)
2562
+ if (source == maxTexturesItem)
24532563 {
24542564 SetTexRes(4);
24552565 } else
2456
- if (event.getSource() == panoTexturesItem)
2566
+ if (source == panoTexturesItem)
24572567 {
24582568 SetTexRes(5);
24592569 } else
2460
- if (event.getSource() == reverseNormalsItem)
2570
+ if (source == reverseNormalsItem)
24612571 {
24622572 ReverseNormals();
24632573 } else
2464
- if (event.getSource() == parseverticesItem)
2574
+ if (source == parseverticesItem)
24652575 {
24662576 ParseVertices();
24672577 } else
2468
- if (event.getSource() == textureFieldItem)
2578
+ if (source == textureFieldItem)
24692579 {
24702580 TextureVertices();
24712581 } else
2472
- if (event.getSource() == alignItem)
2582
+ if (source == alignItem)
24732583 {
24742584 Align();
24752585 } else
2476
- if (event.getSource() == mirrorItem)
2586
+ if (source == mirrorItem)
24772587 {
24782588 MirrorPoses();
24792589 } else
2480
- if (event.getSource() == reduceMorphItem)
2590
+ if (source == reduceMorphItem)
24812591 {
24822592 MeshReduction(false);
24832593 } else
2484
- if (event.getSource() == reduce34MorphItem)
2594
+ if (source == reduce34MorphItem)
24852595 {
24862596 MeshReduction(true);
24872597 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2598
+ if (source == reverseTrianglesItem)
24892599 {
24902600 ReverseTriangles();
24912601 } else
2492
- if (event.getSource() == reduceMeshItem)
2602
+ if (source == reduceMeshItem)
24932603 {
24942604 ReduceMesh(false);
24952605 } else
2496
- if (event.getSource() == reduce34MeshItem)
2606
+ if (source == reduce34MeshItem)
24972607 {
24982608 ReduceMesh(true);
24992609 } else
2500
- if (event.getSource() == increaseMeshItem)
2610
+ if (source == increaseMeshItem)
25012611 {
25022612 IncreaseMesh();
25032613 } else
2504
- if (event.getSource() == clipMeshItem)
2614
+ if (source == clipMeshItem)
25052615 {
25062616 ClipMesh();
25072617 } else
2508
- if (event.getSource() == smoothMeshItem)
2618
+ if (source == smoothMeshItem)
25092619 {
25102620 SmoothMesh();
25112621 } else
2512
- if (event.getSource() == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
25132623 {
25142624 TransformGeometry();
25152625 } else
2516
- if (event.getSource() == resetTransformItem)
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
2629
+ } else
2630
+ if (source == resetTransformItem)
25172631 {
25182632 ResetTransform();
25192633 } else
2520
- if (event.getSource() == resetCentroidItem)
2634
+ if (source == resetCentroidItem)
25212635 {
2522
- ResetCentroid();
2636
+ ResetCentroid(true);
25232637 } else
2524
- if (event.getSource() == resetParentItem)
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
2641
+ } else
2642
+ if (source == resetParentItem)
25252643 {
25262644 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272645 {
....@@ -2531,7 +2649,7 @@
25312649
25322650 refreshContents();
25332651 } else
2534
- if (event.getSource() == repairParentItem)
2652
+ if (source == repairParentItem)
25352653 {
25362654 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372655 {
....@@ -2545,7 +2663,21 @@
25452663
25462664 refreshContents();
25472665 } else
2548
- if (event.getSource() == sortbysizeItem)
2666
+ if (source == repairShadowItem)
2667
+ {
2668
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2669
+ {
2670
+ Object3D obj = (Object3D)e.nextElement();
2671
+ obj.RepairShadow();
2672
+// for (int i=0; i<obj.size(); i++)
2673
+// {
2674
+// obj.get(i).parent = obj;
2675
+// }
2676
+ }
2677
+
2678
+ refreshContents();
2679
+ } else
2680
+ if (source == sortbysizeItem)
25492681 {
25502682 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512683 {
....@@ -2557,7 +2689,7 @@
25572689 ResetModel();
25582690 refreshContents();
25592691 } else
2560
- if (event.getSource() == sortbynameItem)
2692
+ if (source == sortbynameItem)
25612693 {
25622694 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632695 {
....@@ -2569,7 +2701,7 @@
25692701 ResetModel();
25702702 refreshContents();
25712703 } else
2572
- if (event.getSource() == attachPigmentItem)
2704
+ if (source == attachPigmentItem)
25732705 {
25742706 String texture = GetFile("Attach pigment");
25752707 Object3D obj;
....@@ -2581,7 +2713,7 @@
25812713
25822714 refreshContents();
25832715 } else
2584
- if (event.getSource() == detachPigmentItem)
2716
+ if (source == detachPigmentItem)
25852717 {
25862718 Object3D obj;
25872719 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2724,7 @@
25922724
25932725 refreshContents();
25942726 } else
2595
- if (event.getSource() == attachBumpItem)
2727
+ if (source == attachBumpItem)
25962728 {
25972729 String texture = GetFile("Attach bump");
25982730 Object3D obj;
....@@ -2604,7 +2736,7 @@
26042736
26052737 refreshContents();
26062738 } else
2607
- if (event.getSource() == detachBumpItem)
2739
+ if (source == detachBumpItem)
26082740 {
26092741 Object3D obj;
26102742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2747,7 @@
26152747
26162748 refreshContents();
26172749 } else
2618
- if (event.getSource() == pigmentBumpItem)
2750
+ if (source == pigmentBumpItem)
26192751 {
26202752 Object3D obj;
26212753 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2758,195 @@
26262758
26272759 refreshContents();
26282760 } else
2629
- if (event.getSource() == flashSelectionButton)
2761
+ if (source == flashSelectionButton)
26302762 {
26312763 CameraPane.flash = true;
26322764 refreshContents();
26332765 } else
2634
- if (event.getSource() == oneButton)
2766
+ if (source == oneButton)
26352767 {
26362768 } else
2637
- if (event.getSource() == twoButton)
2769
+ if (source == twoButton)
26382770 {
26392771 radio.layout = twoButton;
26402772 // bug
26412773 //gridPanel.setDividerLocation(1.0);
26422774 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
2775
+// bigThree.remove(scenePanel);
2776
+// bigThree.remove(centralPanel);
2777
+// bigThree.remove(XYZPanel);
2778
+// aWindowConstraints.gridx = 0;
2779
+// aWindowConstraints.gridy = 0;
2780
+// aWindowConstraints.gridwidth = 1;
2781
+// // aConstraints.gridheight = 3;
2782
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2783
+// aWindowConstraints.weightx = 0;
2784
+// aWindowConstraints.weighty = 1;
2785
+// //bigThree.add(jtp, aWindowConstraints);
2786
+// aWindowConstraints.weightx = 1;
2787
+// aWindowConstraints.gridwidth = 3;
2788
+// // aConstraints.gridheight = 3;
2789
+// aWindowConstraints.gridx = 1;
2790
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2791
+// bigThree.add(centralPanel, aWindowConstraints);
2792
+// aWindowConstraints.weightx = 0;
2793
+// aWindowConstraints.gridx = 4;
2794
+// aWindowConstraints.gridwidth = 1;
2795
+// // aConstraints.gridheight = 3;
2796
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2797
+// //bigThree.add(XYZPanel, aWindowConstraints);
2798
+// scenePanel.setVisible(false);
2799
+// centralPanel.setVisible(true);
2800
+// XYZPanel.setVisible(false);
2801
+ bigThree.ClearUI();
2802
+ bigThree.add(centralPanel);
2803
+ bigThree.FlushUI();
26672804 } else
2668
- if (event.getSource() == threeButton)
2805
+ if (source == threeButton)
26692806 {
26702807 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- bigThree.revalidate();
2808
+
2809
+// bigThree.remove(scenePanel);
2810
+// bigThree.remove(centralPanel);
2811
+// bigThree.remove(XYZPanel);
2812
+// aWindowConstraints.gridx = 0;
2813
+// aWindowConstraints.gridy = 0;
2814
+// aWindowConstraints.gridwidth = 1;
2815
+// // aConstraints.gridheight = 3;
2816
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2817
+// aWindowConstraints.weightx = 0;
2818
+// aWindowConstraints.weighty = 1;
2819
+// //bigThree.add(jtp, aWindowConstraints);
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.gridwidth = 3;
2822
+// // aConstraints.gridheight = 3;
2823
+// aWindowConstraints.gridx = 1;
2824
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2825
+// bigThree.add(centralPanel, aWindowConstraints);
2826
+// aWindowConstraints.weightx = 0;
2827
+// aWindowConstraints.gridx = 4;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// bigThree.add(XYZPanel, aWindowConstraints);
2832
+// bigThree.validate();
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(true);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.add(XYZPanel);
2839
+ bigThree.FlushUI();
26952840 } else
2696
- if (event.getSource() == fourButton)
2841
+ if (source == fourButton)
26972842 {
26982843 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
2844
+
2845
+// bigThree.remove(scenePanel);
2846
+// bigThree.remove(centralPanel);
2847
+// bigThree.remove(XYZPanel);
2848
+// aWindowConstraints.gridx = 0;
2849
+// aWindowConstraints.gridy = 0;
2850
+// aWindowConstraints.gridwidth = 1;
2851
+// // aWindowConstraints.gridheight = 3;
2852
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2853
+// aWindowConstraints.weightx = 1;
2854
+// aWindowConstraints.weighty = 1;
2855
+// bigThree.add(scenePanel, aWindowConstraints);
2856
+// aWindowConstraints.weightx = 1;
2857
+// aWindowConstraints.gridwidth = 3;
2858
+// // aConstraints.gridheight = 3;
2859
+// aWindowConstraints.gridx = 1;
2860
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2861
+// //bigThree.add(cameraPanel, aWindowConstraints);
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.gridx = 4;
2864
+// aWindowConstraints.gridwidth = 1;
2865
+// // aWindowConstraints.gridheight = 3;
2866
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2867
+// //bigThree.add(XYZPanel, aWindowConstraints);
2868
+// bigThree.validate();
2869
+// scenePanel.setVisible(true);
2870
+// centralPanel.setVisible(false);
2871
+// XYZPanel.setVisible(false);
2872
+ bigThree.ClearUI();
2873
+ bigThree.add(scenePanel);
2874
+ bigThree.FlushUI();
27232875 } else
2724
- if (event.getSource() == sixButton)
2876
+ if (source == sixButton)
27252877 {
27262878 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- bigThree.revalidate();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2888
+// aWindowConstraints.weightx = 0;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aWindowConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// bigThree.add(centralPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(true);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.add(centralPanel);
2910
+ bigThree.FlushUI();
27512911 } else
2752
- if (event.getSource() == sevenButton)
2912
+ if (source == sevenButton)
27532913 {
27542914 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- bigThree.revalidate();
2915
+
2916
+// bigThree.remove(scenePanel);
2917
+// bigThree.remove(centralPanel);
2918
+// bigThree.remove(XYZPanel);
2919
+// aWindowConstraints.gridx = 0;
2920
+// aWindowConstraints.gridy = 0;
2921
+// aWindowConstraints.gridwidth = 1;
2922
+// // aWindowConstraints.gridheight = 3;
2923
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.weighty = 1;
2926
+// bigThree.add(scenePanel, aWindowConstraints);
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.gridwidth = 3;
2929
+// // aWindowConstraints.gridheight = 3;
2930
+// aWindowConstraints.gridx = 1;
2931
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2932
+// bigThree.add(centralPanel, aWindowConstraints);
2933
+// aWindowConstraints.weightx = 0;
2934
+// aWindowConstraints.gridx = 4;
2935
+// aWindowConstraints.gridwidth = 1;
2936
+// // aConstraints.gridheight = 3;
2937
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2938
+// bigThree.add(XYZPanel, aWindowConstraints);
2939
+// bigThree.validate();
2940
+// scenePanel.setVisible(true);
2941
+// centralPanel.setVisible(true);
2942
+// XYZPanel.setVisible(true);
2943
+ bigThree.ClearUI();
2944
+ bigThree.add(scenePanel);
2945
+ bigThree.add(centralPanel);
2946
+ bigThree.add(XYZPanel);
2947
+ bigThree.FlushUI();
27792948 } else
2780
- if (event.getSource() == rootButton)
2949
+ if (source == rootButton)
27812950 {
27822951 Object3D obj;
27832952 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +2958,7 @@
27892958
27902959 refreshContents(true);
27912960 } else
2792
- if (event.getSource() == closeButton)
2961
+ if (source == closeButton)
27932962 {
27942963 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27952964 cRadio ab;
....@@ -2810,11 +2979,11 @@
28102979 }
28112980 refreshContents(true);
28122981 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
2982
+ if (source == editItem || source == editButton)
28142983 {
28152984 EditSelection(false);
28162985 } else
2817
- if (event.getSource() == uneditButton)
2986
+ if (source == uneditButton)
28182987 {
28192988 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28202989 {
....@@ -2826,12 +2995,12 @@
28262995
28272996 child.editWindow = null; // ???????????
28282997 }
2829
- objEditor.ctrlPanel.revalidate();
2998
+ objEditor.ctrlPanel.FlushUI();
28302999 //objEditor.jTree.clearSelection();
28313000 //objEditor.ResetSliders();
28323001 refreshContents(true);
28333002 } else
2834
- if (event.getSource() == clearPanelButton)
3003
+ if (source == clearPanelButton)
28353004 {
28363005 assert(copy == group);
28373006 //copy.ClearUI();
....@@ -2842,7 +3011,7 @@
28423011 listUI.clear();
28433012 refreshContents(true);
28443013 } else
2845
- if (event.getSource() == allParamsButton)
3014
+ if (source == allParamsButton)
28463015 {
28473016 assert(copy == group);
28483017
....@@ -2863,19 +3032,19 @@
28633032
28643033 refreshContents(true);
28653034 } else
2866
- if (event.getSource() == unselectButton)
3035
+ if (source == unselectButton)
28673036 {
28683037 objEditor.jTree.clearSelection();
28693038 // ?? oct 2012 GrafreeD.clipboard.clear();
28703039 objEditor.ResetSliders();
28713040 refreshContents(true);
28723041 } else
2873
- if(event.getSource() instanceof cRadio)
3042
+ if(source instanceof cRadio)
28743043 {
28753044 group.parent = keepparent;
28763045 group.attributes = 0;
28773046 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3047
+ /*cRadio*/ radio = (cRadio)source;
28793048 Object3D obj = radio.GetObject();
28803049 System.out.println("Edit " + obj);
28813050 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3064,7 @@
28953064 }
28963065
28973066 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3067
+ //Globals.theRenderer.object = group;
28993068 if(!useclient)
29003069 {
29013070 cameraView.renderCamera = radio.camera;
....@@ -2904,7 +3073,8 @@
29043073 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053074 cameraView.targetLookAt.set(radio.camera.lookAt);
29063075 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3076
+ //cameraView.lighttouched = true;
3077
+ Globals.lighttouched = true;
29083078 topView.object = group;
29093079 frontView.object = group;
29103080 sideView.object = group;
....@@ -2940,7 +3110,7 @@
29403110 if (useclient)
29413111 {
29423112 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3113
+ Globals.lighttouched = true;
29443114 //topView.object = client;
29453115 //frontView.object = client;
29463116 //sideView.object = client;
....@@ -2948,7 +3118,7 @@
29483118 else
29493119 {
29503120 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3121
+ Globals.lighttouched = true;
29523122 //topView.object = group;
29533123 //frontView.object = group;
29543124 //sideView.object = group;
....@@ -2983,6 +3153,28 @@
29833153 refreshContents();
29843154 }
29853155
3156
+ void TransformChildren()
3157
+ {
3158
+ Object3D obj;
3159
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3160
+ {
3161
+ obj = (Object3D)e.nextElement();
3162
+ obj.KeepTextureMatrices();
3163
+ obj.TransformChildren();
3164
+ obj.RestoreTextureMatrices();
3165
+
3166
+// if (obj.parent == null)
3167
+// {
3168
+// System.out.println("NULL PARENT!");
3169
+// new Exception().printStackTrace();
3170
+// }
3171
+// else
3172
+// TouchTransform(obj);
3173
+// //obj.parent.Touch();
3174
+ }
3175
+
3176
+ refreshContents();
3177
+ }
29863178
29873179 void ResetTransform()
29883180 {
....@@ -3095,7 +3287,7 @@
30953287 refreshContents();
30963288 }
30973289
3098
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
30993291 {
31003292 Object3D obj;
31013293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3302,16 @@
31103302 LA.matIdentity(Object3D.mat);
31113303 obj.getBounds(minima, maxima, false);
31123304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153308 obj.TransformMesh(Object3D.mat);
3309
+
31163310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
31193315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3181,9 +3377,9 @@
31813377 obj = (Object3D)e.nextElement();
31823378
31833379 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
31853381 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
31873383
31883384 // System.err.println((size/1024) + " KB is the size of " + obj);
31893385 }
....@@ -3397,8 +3593,8 @@
33973593
33983594 void ParseVertices()
33993595 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
34023598
34033599 for (int i=0; i<group.selection.size(); i++)
34043600 {
....@@ -3423,7 +3619,7 @@
34233619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34243620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34253621
3426
- g.add(GrafreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
34273623
34283624 buffer.add(g);
34293625 }
....@@ -3438,7 +3634,7 @@
34383634 makeSomething(buffer, i==group.selection.size()-1);
34393635 }
34403636
3441
- GrafreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
34423638
34433639 refreshContents();
34443640 }
....@@ -3456,7 +3652,16 @@
34563652 String pigment = Object3D.GetPigment(tex);
34573653 //String bump = Object3D.GetBump(tex);
34583654
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3655
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3656
+
3657
+ try
3658
+ {
3659
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3660
+ }
3661
+ catch (Exception e)
3662
+ {
3663
+ System.err.println("FAIL: " + node);
3664
+ }
34603665
34613666 double s = v.s;
34623667
....@@ -3544,11 +3749,11 @@
35443749
35453750 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35463751
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
3752
+ boolean random = CameraPane.SWITCH;
3753
+ CameraPane.SWITCH = false; // parse all random nodes
35493754 lowres.linkVerticesThis(null);
35503755 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
3756
+ CameraPane.SWITCH = random;
35523757
35533758 System.err.flush();
35543759
....@@ -3588,7 +3793,7 @@
35883793 return;
35893794
35903795 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
3796
+ Object3D ref = Grafreed.clipboard.get(0);
35923797
35933798 Object3D newgroup = new Object3D("Po:" + poses.name);
35943799
....@@ -3757,7 +3962,7 @@
37573962 group.selection.RelinkToSupport(); // july 2014
37583963 System.out.println("DONE.");
37593964 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3965
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37613966 }
37623967
37633968 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +3987,9 @@
37823987
37833988 void ClipMesh()
37843989 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3990
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37863991 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
3992
+ Object3D content = Grafreed.clipboard.get(0);
37883993
37893994 if (content instanceof cGroup && ((cGroup)content).transientlink )
37903995 content = ((cGroup)content).get(0);
....@@ -3793,7 +3998,7 @@
37933998 // {
37943999 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954000 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4001
+ group.selection.ClipMesh(Grafreed.clipboard);
37974002 }
37984003 // group.selection.ClipMesh(GrafreeD.clipboard);
37994004 System.out.println("DONE.");
....@@ -4033,25 +4238,25 @@
40334238 System.err.println("info : " + child.GetPath());
40344239 }
40354240 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4241
+// else
4242
+// {
4243
+// objEditor.SetMaterial(group); // .GetMaterial());
4244
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4245
+// System.err.println("info : " + group.GetPath());
4246
+// }
40424247
40434248 objEditor.SetText(); // jan 2014
40444249
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4250
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40464251 CameraPane.flash = true;
40474252
40484253 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40494254 // a camera
40504255 {
40514256 CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4257
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4258
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4259
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554260 }
40564261
40574262 refreshContents();
....@@ -4133,12 +4338,12 @@
41334338 {
41344339 if (group.selection.isEmpty())
41354340 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4341
+ Grafreed.clipboardIsTempGroup = false;
41374342 Composite tGroup = null;
41384343 if (group.selection.size() > 0) // 1)
41394344 {
41404345 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4346
+ Grafreed.clipboardIsTempGroup = true;
41424347 }
41434348
41444349 if (cut)
....@@ -4178,16 +4383,16 @@
41784383 //System.out.println("cut " + child);
41794384 //System.out.println("parent = " + child.parent);
41804385 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4386
+ if (Grafreed.clipboardIsTempGroup)
41824387 tGroup.add/*Child*/(tmp);
41834388 else
4184
- GrafreeD.clipboard = tmp;
4389
+ Grafreed.clipboard = tmp;
41854390 }
41864391 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4392
+ if (Grafreed.clipboardIsTempGroup)
41884393 tGroup.add/*Child*/(child);
41894394 else
4190
- GrafreeD.clipboard = child;
4395
+ Grafreed.clipboard = child;
41914396 }
41924397
41934398 //ResetModel();
....@@ -4219,21 +4424,21 @@
42194424 //System.out.println("cut " + elem);
42204425 //System.out.println("parent = " + elem.parent);
42214426 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4427
+ if (Grafreed.clipboardIsTempGroup)
42234428 tGroup.add/*Child*/(tmp);
42244429 else
4225
- GrafreeD.clipboard = tmp;
4430
+ Grafreed.clipboard = tmp;
42264431 }
42274432 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4433
+ if (Grafreed.clipboardIsTempGroup)
42294434 tGroup.add/*Child*/(child);
42304435 else
4231
- GrafreeD.clipboard = child;
4436
+ Grafreed.clipboard = child;
42324437 }
42334438
42344439 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4440
+ if (Grafreed.clipboardIsTempGroup)
4441
+ Grafreed.clipboard = tGroup;
42374442 if (cut)
42384443 {
42394444 ResetModel();
....@@ -4247,7 +4452,7 @@
42474452 // return;
42484453 boolean first = true;
42494454
4250
- if (GrafreeD.clipboardIsTempGroup)
4455
+ if (Grafreed.clipboardIsTempGroup)
42514456 {
42524457 Composite temp;
42534458
....@@ -4258,7 +4463,7 @@
42584463 temp = (Composite)Applet3D.clipboard.deepCopy();
42594464 */
42604465 Object3D elem;
4261
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4466
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42624467 {
42634468 Object3D child = (Object3D)e.nextElement();
42644469
....@@ -4292,21 +4497,21 @@
42924497 //Object3D cb = Applet3D.clipboard;
42934498 //temp.addChild(cb);
42944499 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4500
+ assert(Grafreed.clipboard.parent == null);
4501
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4502
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4503
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4504
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43004505 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
4506
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4507
+ Grafreed.clipboard.get(0).parent = keepparent;
43034508 }
43044509
43054510 ResetModel();
43064511 refreshContents();
43074512 }
43084513
4309
- void pasteInto(boolean copyit)
4514
+ void pasteInto(boolean copyit, boolean clone)
43104515 {
43114516 // if (GrafreeD.clipboard == null)
43124517 // return;
....@@ -4335,15 +4540,22 @@
43354540 if (copyit)
43364541 {
43374542 // paste(false);
4338
- CloneClipboard(false); // sept 2014
4543
+ if (clone)
4544
+ {
4545
+ CloneClipboard(false); // sept 2014
4546
+ }
4547
+ else
4548
+ {
4549
+ paste(false);
4550
+ }
43394551 }
43404552 else
43414553 {
43424554 boolean first = true;
43434555
4344
- if (GrafreeD.clipboardIsTempGroup)
4556
+ if (Grafreed.clipboardIsTempGroup)
43454557 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
4558
+ Composite temp = (Composite)Grafreed.clipboard;
43474559 Object3D copy;
43484560 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43494561 {
....@@ -4353,7 +4565,7 @@
43534565 }
43544566 } else
43554567 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
4568
+ linkSomething(Grafreed.clipboard); //.get(0));
43574569 }
43584570 }
43594571 }
....@@ -4798,7 +5010,7 @@
47985010
47995011 void ImportVRMLX3D()
48005012 {
4801
- if (GrafreeD.standAlone)
5013
+ if (Grafreed.standAlone)
48025014 {
48035015 /**/
48045016 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4815,7 +5027,7 @@
48155027
48165028 String GetFile(String dialogName)
48175029 {
4818
- if (GrafreeD.standAlone)
5030
+ if (Grafreed.standAlone)
48195031 {
48205032 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215033 browser.show();
....@@ -4879,10 +5091,12 @@
48795091 cButton flashSelectionButton;
48805092 cButton editButton;
48815093 cButton uneditButton;
5094
+ JCheckBox allParamsButton;
48825095 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845096 cButton unselectButton;
48855097
5098
+ cButton oneStepButton;
5099
+
48865100 cButton screenfitButton;
48875101 cButton screenfitpointButton;
48885102 cButton snapobjectButton;
....@@ -4926,7 +5140,7 @@
49265140 private MenuItem linkverticesItem;
49275141 private MenuItem relinkverticesItem;
49285142 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5143
+ private MenuItem resetAllItem;
49305144 private MenuItem stepAllItem;
49315145 private MenuItem revertMeshItem;
49325146 private MenuItem poseMeshItem;
....@@ -4937,6 +5151,7 @@
49375151 private MenuItem mergeGeometriesItem;
49385152 private MenuItem copyItem;
49395153 private MenuItem pasteItem;
5154
+ private MenuItem pasteIntoItem;
49405155 private MenuItem pasteLinkItem;
49415156 private MenuItem pasteCloneItem;
49425157 private MenuItem pasteExpandItem;
....@@ -4986,8 +5201,10 @@
49865201 private MenuItem panoTexturesItem;
49875202
49885203 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5204
+ private MenuItem resetCentroidXZItem;
49905205 private MenuItem resetTransformItem;
5206
+ private MenuItem transformGeometryItem;
5207
+ private MenuItem transformChildrenItem;
49915208 private MenuItem hideItem;
49925209 private MenuItem grabItem;
49935210 private MenuItem backItem;
....@@ -5009,6 +5226,7 @@
50095226
50105227 private MenuItem resetParentItem;
50115228 private MenuItem repairParentItem;
5229
+ private MenuItem repairShadowItem;
50125230 private MenuItem sortbysizeItem;
50135231 private MenuItem sortbynameItem;
50145232
....@@ -5033,7 +5251,7 @@
50335251 private MenuItem blobItem;
50345252 private MenuItem latheItem;
50355253 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5254
+ private MenuItem overlayItem;
50375255 private MenuItem meshItem;
50385256 // private MenuItem meshGroupItem;
50395257 private MenuItem springItem;