Normand Briere
2019-05-05 44b1501b5c4cd60ea67cc3d0971ed53f53b594e6
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,
....@@ -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,18 +185,31 @@
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"));
211
+ if (Globals.ADVANCED)
212
+ {
193213 resetMeshItem = menu.add(new MenuItem("Reset All"));
194214 resetMeshItem.addActionListener(this);
195215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +219,7 @@
199219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200220 resetreferencesItem.addActionListener(this);
201221 menu.add("-");
222
+ }
202223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203224 overwriteGeoItem.addActionListener(this);
204225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +231,26 @@
210231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211232 overwriteUVItem.addActionListener(this);
212233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
213236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214237 generateMeshItem.addActionListener(this);
215238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216239 poseMeshItem.addActionListener(this);
217240 menu.add("-");
241
+ }
218242 resetsupportItem = menu.add(new MenuItem("Reset support"));
219243 resetsupportItem.addActionListener(this);
220244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221245 linkverticesItem.addActionListener(this);
246
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
247
+ relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
222251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223252 setMasterItem.addActionListener(this);
253
+ }
224254
225255 oe.menuBar.add(menu = new Menu("Group"));
226256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +261,38 @@
231261 frontItem.addActionListener(this);
232262 compositeItem = menu.add(new MenuItem("Composite"));
233263 compositeItem.addActionListener(this);
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
265
+ hideItem.addActionListener(this);
266
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
267
+ ungroupItem.addActionListener(this);
234268 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
236270 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242272 switchGeoItem.addActionListener(this);
243273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244274 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
246276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
247285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248286 scriptNodeItem.addActionListener(this);
249287 cameraItem = menu.add(new MenuItem("Camera"));
250288 cameraItem.addActionListener(this);
289
+ }
251290
252291 oe.menuBar.add(menu = new Menu("Object"));
253292 textureItem = menu.add(new MenuItem("Texture"));
254293 textureItem.addActionListener(this);
294
+ billboardItem = menu.add(new MenuItem("Billboard"));
295
+ billboardItem.addActionListener(this);
255296 csgItem = menu.add(new MenuItem("CSG"));
256297 csgItem.addActionListener(this);
257298 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +301,25 @@
260301 shadowYItem.addActionListener(this);
261302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
263307 linkerItem = menu.add(new MenuItem("Linker"));
264308 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267309 attributeItem = menu.add(new MenuItem("Attribute"));
268310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
269313 pointflowItem = menu.add(new MenuItem("Point Flow"));
270314 pointflowItem.addActionListener(this);
315
+ }
271316 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275318 resetTransformItem.addActionListener(this);
276319 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277320 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
321
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
+ transformgeometryItem.addActionListener(this);
280323
281324 oe.menuBar.add(menu = new Menu("Geometry"));
282325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +328,13 @@
285328 genNormalsORGANItem.addActionListener(this);
286329 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287330 genNormalsCADItem.addActionListener(this);
331
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
332
+ genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
335
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
336
+ genNormalsMINEItem.addActionListener(this);
337
+ }
288338 stripifyItem = menu.add(new MenuItem("Stripify"));
289339 stripifyItem.addActionListener(this);
290340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,10 +356,14 @@
306356 reduce34MeshItem.addActionListener(this);
307357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308358 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
313367
314368 oe.menuBar.add(menu = new Menu("Attributes"));
315369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -319,10 +373,13 @@
319373 liveleavesItem.addActionListener(this);
320374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
322378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323379 supportleavesItem.addActionListener(this);
324380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325381 unsupportleavesItem.addActionListener(this);
382
+ }
326383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327384 hideleavesItem.addActionListener(this);
328385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -365,6 +422,8 @@
365422 sortbysizeItem.addActionListener(this);
366423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
368427 menu.add("-");
369428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370429 extractGeometriesItem.addActionListener(this);
....@@ -374,20 +433,23 @@
374433 shareGeometriesItem.addActionListener(this);
375434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376435 mergeGeometriesItem.addActionListener(this);
436
+ }
377437
378438 oe.menuBar.add(menu = new Menu("Insert"));
379439 buildCreateMenu(menu);
380440
381
-
382441 oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
388443 importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
390446 import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
391453
392454 oe.menuBar.add(menu = new Menu("Tools"));
393455 buildToolsMenu(menu);
....@@ -423,150 +485,98 @@
423485 oe.radioPanel.add(dummyButton);
424486 oe.buttonGroup.add(dummyButton);
425487 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
488
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429489
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
490
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
+ liveCB.setToolTipText("Enabled animation");
431492 liveCB.addItemListener(this);
432493
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
495
+ oneStepButton.setToolTipText("Animate one step forward");
496
+ oneStepButton.addActionListener(this);
497
+
498
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
499
+ fastCB.setToolTipText("Fast mode");
451500 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
501
+
502
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
503
+ trackCB.setToolTipText("Enable tracking");
493504 trackCB.addItemListener(this);
494505
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
507
+ screenfitButton.setToolTipText("Screen fit");
497508 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
509
+
499510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500511 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505512
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
513
+ if (Globals.ADVANCED)
514
+ {
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ snapobjectButton.addActionListener(this);
517
+ snapobjectButton.setToolTipText("Snap Object");
518
+ }
519
+
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
+ flashSelectionButton.setToolTipText("Show selection");
512522 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516523
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525
+
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527
+ twoButton.setToolTipText("Show center view only");
519528 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521530 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
531
+ fourButton.setToolTipText("Show left panel only");
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
+ sixButton.setToolTipText("2-column layout left");
523534 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
+ threeButton.setToolTipText("2-column layout right");
525537 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
539
+ sevenButton.setToolTipText("3-column layout");
527540 sevenButton.addActionListener(this);
528541 //
529542
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
+ rootButton.setToolTipText("Edit selection in new tab");
531545 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548
+ closeButton.setToolTipText("Close tab");
534549 closeButton.addActionListener(this);
535550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536551 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538552
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
553
+ cGridBag commandsPanel = new cGridBag();
554
+
555
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
+ editButton.setToolTipText("Edit selection");
541557 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545558
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
547561 uneditButton.addActionListener(this);
548562
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
563
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
+ allParamsButton.setToolTipText("Edit all params");
561565 allParamsButton.addActionListener(this);
562566
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
568
+ clearPanelButton.setToolTipText("Clear edit panel");
569
+ clearPanelButton.addActionListener(this);
570
+
571
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ unselectButton.setToolTipText("Unselect");
568573 unselectButton.addActionListener(this);
569574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
570580 // oe.aConstraints.gridx += 1;
571581 // oe.aConstraints.weighty = 0;
572582 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +588,37 @@
578588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579589 // gcButton.addActionListener(this);
580590
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
592594 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
595
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594596 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
599600
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
601
+ cGridBag copyOptionsPanel = new cGridBag();
602
+
603
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
+ colorCB.setToolTipText("Copy color when dropped");
604605 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
606
+
607
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
+ materialCB.setToolTipText("Copy material when dropped");
607609 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
+
611
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
+ textureCB.setToolTipText("Copy texture when dropped");
610613 textureCB.addItemListener(this);
611614
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
614618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
615622 //jList.addListSelectionListener(this);
616623 oe.jTree.addTreeSelectionListener(this);
617624 //jTree.setRootVisible(false);
....@@ -633,17 +640,89 @@
633640 radio.layout = sevenButton;
634641 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635642 }
643
+
644
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
645
+ {
646
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
647
+ boxCB.setToolTipText("Display bounding boxes");
648
+ boxCB.addItemListener(this);
649
+
650
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
652
+ zoomBoxCB.addItemListener(this);
653
+
654
+ if (Globals.ADVANCED)
655
+ {
656
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
+ supportCB.setToolTipText("Enable rigging");
658
+ supportCB.addItemListener(this);
659
+
660
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661
+ // localCB.addItemListener(this);
662
+
663
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664
+ crowdCB.setToolTipText("Used for crowds");
665
+ crowdCB.addItemListener(this);
666
+
667
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
668
+ smoothCB.setToolTipText("Snapping delay");
669
+ smoothCB.addItemListener(this);
670
+
671
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
672
+ slowCB.setToolTipText("Smooth interpolation");
673
+ slowCB.addItemListener(this);
674
+
675
+// constraints.gridy += 1;
676
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
677
+// speakerMocapCB.addItemListener(this);
678
+
679
+ if (false)
680
+ {
681
+ // handled in scripts
682
+ //constraints.gridy += 1;
683
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
684
+ speakerCameraCB.addItemListener(this);
685
+
686
+ //constraints.gridy += 1;
687
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
688
+ speakerFocusCB.addItemListener(this);
689
+
690
+ //constraints.gridy += 1;
691
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
692
+ smoothfocusCB.addItemListener(this);
693
+ }
694
+
695
+//constraints.gridx += 1;
696
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
697
+// debugCB.addItemListener(this);
698
+
699
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
700
+ oeilCB.addItemListener(this);
701
+
702
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
703
+ lookAtCB.setToolTipText("Look-at target");
704
+ lookAtCB.addItemListener(this);
705
+
706
+ }
707
+
708
+ cGridBag fill = new cGridBag();
709
+
710
+ fill.preferredHeight = 200;
711
+
712
+ panel.add(fill);
713
+
714
+ }
636715
637716 void EditObject(Object3D obj)
638717 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
718
+ cRadio radioButton = new cRadio(obj.name);
719
+ radioButton.SetObject(obj);
720
+ radioButton.layout = sevenButton;
721
+ radioButton.SetCamera(cameraView.renderCamera, false);
722
+ radioButton.addActionListener(this);
723
+ radioPanel.add(radioButton);
724
+ buttonGroup.add(radioButton);
725
+ radioButton.doClick();
647726 }
648727 void SetupViews(ObjEditor oe)
649728 {
....@@ -663,6 +742,7 @@
663742 JCheckBox fastCB;
664743 JCheckBox slowCB;
665744 JCheckBox boxCB;
745
+ JCheckBox zoomBoxCB;
666746 JCheckBox trackCB;
667747 JCheckBox smoothfocusCB;
668748 // JCheckBox speakerMocapCB;
....@@ -705,8 +785,7 @@
705785 dropAttributes |= Object3D.TEXTURE;
706786 else
707787 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
788
+ } else if(e.getSource() == liveCB)
710789 {
711790 cameraView.ToggleLive();
712791 }
....@@ -743,6 +822,10 @@
743822 Recompile();
744823 cameraView.repaint();
745824 // refreshContents();
825
+ }
826
+ else if(e.getSource() == zoomBoxCB)
827
+ {
828
+ cameraView.ToggleZoomBoxMode();
746829 }
747830 else if(e.getSource() == smoothfocusCB)
748831 {
....@@ -857,7 +940,9 @@
857940 // objEditor.DropFile((java.io.File[]) object, true);
858941 // return;
859942 // }
860
- if (string.charAt(0) == '/')
943
+
944
+ // File path for Mac and Windows
945
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
861946 {
862947 // file(s)
863948 String[] names = string.split("\n");
....@@ -884,7 +969,7 @@
884969
885970 flashIt = false;
886971 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
972
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
888973 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
889974
890975 if (group.selection.size() == 1)
....@@ -911,11 +996,11 @@
911996 {
912997 loadClipboard(true);
913998 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
999
+ pasteInto(false, false);
9151000 } else {
9161001 loadClipboard(false);
9171002 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1003
+ pasteInto(false, false); // true); // ???
9191004 }
9201005 }
9211006 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1118,37 @@
10331118 torusItem.addActionListener(this);
10341119 superItem = menu.add(new MenuItem("Superellipsoid"));
10351120 superItem.addActionListener(this);
1121
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1122
+ kleinItem.addActionListener(this);
10361123 particleItem = menu.add(new MenuItem("Particle system"));
10371124 particleItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10381127 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391128 ragdollItem.addActionListener(this);
10401129 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411130 ragdoll2Item.addActionListener(this);
1131
+ }
10421132 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1133
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441134 meshItem.addActionListener(this);
10451135 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461136 // meshGroupItem.addActionListener(this);
1137
+ if (Globals.ADVANCED)
1138
+ {
10471139 springItem = menu.add(new MenuItem("Spring"));
10481140 springItem.addActionListener(this);
10491141 flagItem = menu.add(new MenuItem("Flag"));
10501142 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551143 blobItem = menu.add(new MenuItem("Blob"));
10561144 blobItem.addActionListener(this);
10571145 latheItem = menu.add(new MenuItem("Lathe"));
10581146 latheItem.addActionListener(this);
1147
+ }
1148
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1149
+ bezierItem.addActionListener(this);
1150
+ overlayItem = menu.add(new MenuItem("Overlay"));
1151
+ overlayItem.addActionListener(this);
10591152 lightItem = menu.add(new MenuItem("Light"));
10601153 lightItem.addActionListener(this);
10611154 menu.add("-");
....@@ -1065,34 +1158,39 @@
10651158 loopItem.addActionListener(this);
10661159 doubleItem = menu.add(new MenuItem("Fork"));
10671160 doubleItem.addActionListener(this);
1161
+ if (Globals.ADVANCED)
1162
+ {
10681163 tripleItem = menu.add(new MenuItem("Trident"));
10691164 tripleItem.addActionListener(this);
1165
+ }
10701166 }
10711167
10721168 void buildToolsMenu(Menu menu)
10731169 {
10741170 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751171 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1172
+ animationItem.setState(Globals.ANIMATION);
10771173
10781174 menu.add("-");
10791175 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801176 parseverticesItem.addActionListener(this);
10811177 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821178 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1179
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841180 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871181 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881182 reduceMorphItem.addActionListener(this);
10891183 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901184 reduce34MorphItem.addActionListener(this);
1091
-
1185
+ menu.add("-");
10921186 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931187 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951188
1189
+ if (Globals.ADVANCED)
1190
+ {
1191
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1192
+ mirrorItem.addActionListener(this);
1193
+ menu.add("-");
10961194 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971195 memoryItem.addActionListener(this);
10981196 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1204,8 @@
11061204 resetParentItem.addActionListener(this);
11071205 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081206 repairParentItem.addActionListener(this);
1207
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1208
+ repairShadowItem.addActionListener(this);
11091209 menu.add(invariantsItem = new MenuItem("Invariants"));
11101210 invariantsItem.addActionListener(this);
11111211 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1213,7 @@
11131213 menu.add("-");
11141214 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151215 editScriptItem.addActionListener(this);
1216
+ }
11161217 }
11171218
11181219 void ScreenFit()
....@@ -1466,6 +1567,7 @@
14661567 //
14671568 public void actionPerformed(ActionEvent event) // , Object arg)
14681569 {
1570
+ Object source = event.getSource();
14691571 /*
14701572 if (event.getSource() == nameField)
14711573 {
....@@ -1477,11 +1579,11 @@
14771579 }
14781580 else
14791581 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1582
+ if (source == lookAtItem || source == lookFromItem)
14811583 {
14821584 ScreenFit();
14831585 } else
1484
- if (event.getSource() == switchItem)
1586
+ if (source == switchItem)
14851587 {
14861588 cVector v1 = new cVector();
14871589 cVector v2 = new cVector();
....@@ -1490,11 +1592,11 @@
14901592 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911593 objEditor.cameraView.repaint();
14921594 } else
1493
- if (event.getSource() == rectoidItem)
1595
+ if (source == rectoidItem)
14941596 {
14951597 makeSomething(new Box());
14961598 } else
1497
- if (event.getSource() == particleItem)
1599
+ if (source == particleItem)
14981600 {
14991601 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001602 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1617,9 @@
15151617 applyExample(particleGeom, "SMOKE");
15161618 makeSomething(particleGeom);
15171619 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1620
+ if (source == ragdollItem || source == ragdoll2Item)
15191621 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1622
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211623
15221624 ragdoll.toParent = LA.newMatrix();
15231625 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1637,7 @@
15351637 } else
15361638 /*
15371639 */
1538
- if (event.getSource() == heightFieldItem)
1640
+ if (source == heightFieldItem)
15391641 {
15401642 Object3D obj = new Object3D();
15411643
....@@ -1573,27 +1675,31 @@
15731675
15741676 makeSomething(obj);
15751677 } else
1576
- if (event.getSource() == gridItem)
1678
+ if (source == gridItem)
15771679 {
15781680 makeSomething(new Grid());
15791681 } else
1580
- if (event.getSource() == ellipsoidItem)
1682
+ if (source == ellipsoidItem)
15811683 {
15821684 makeSomething(new Sphere());
15831685 } else
1584
- if (event.getSource() == coneItem)
1686
+ if (source == coneItem)
15851687 {
15861688 makeSomething(new Cone());
15871689 } else
1588
- if (event.getSource() == torusItem)
1690
+ if (source == torusItem)
15891691 {
15901692 makeSomething(new Torus());
15911693 } else
1592
- if (event.getSource() == superItem)
1694
+ if (source == superItem)
15931695 {
15941696 makeSomething(new Superellipsoid());
15951697 } else
1596
- if (event.getSource() == blobItem)
1698
+ if (source == kleinItem)
1699
+ {
1700
+ makeSomething(new Klein());
1701
+ } else
1702
+ if (source == blobItem)
15971703 {
15981704 Blob blob = new Blob();
15991705 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1707,15 @@
16011707 //blob.retile();
16021708 makeSomething(blob);
16031709 } else
1604
- if (event.getSource() == latheItem)
1710
+ if (source == latheItem)
16051711 {
16061712 makeSomething(new Lathe());
16071713 } else
1608
- if (event.getSource() == bezierItem)
1714
+ if (source == bezierItem)
16091715 {
16101716 makeSomething(new BezierSurface());
16111717 } else
1612
- if (event.getSource() == checkerItem)
1718
+ if (source == overlayItem)
16131719 {
16141720 /*
16151721 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1730,7 @@
16241730 */
16251731 makeSomething(new Checker());
16261732 } else
1627
- if (event.getSource() == meshItem)
1733
+ if (source == meshItem)
16281734 {
16291735 Object3D itemtomake = new Object3D();
16301736 Object3D child;
....@@ -1645,35 +1751,35 @@
16451751 makeSomething(child);
16461752 }
16471753 } else
1648
- if (event.getSource() == springItem)
1754
+ if (source == springItem)
16491755 {
16501756 cSpring s = new cSpring();
16511757 s.setup();
16521758 makeSomething(s);
16531759 } else
1654
- if (event.getSource() == flagItem)
1760
+ if (source == flagItem)
16551761 {
16561762 cSpring s = new cFlag();
16571763 s.setup();
16581764 makeSomething(s);
16591765 } else
1660
- if (event.getSource() == lightItem)
1766
+ if (source == lightItem)
16611767 {
16621768 makeSomething(new Light());
16631769 } else
1664
- if (event.getSource() == csgItem)
1770
+ if (source == csgItem)
16651771 {
16661772 group(new CSG());
16671773 } else
1668
- if (event.getSource() == templateItem)
1774
+ if (source == templateItem)
16691775 {
16701776 group(new cTemplate());
16711777 } else
1672
- if (event.getSource() == attributeItem)
1778
+ if (source == attributeItem)
16731779 {
16741780 makeSomething(new Attribute());
16751781 } else
1676
- if (event.getSource() == pointflowItem)
1782
+ if (source == pointflowItem)
16771783 {
16781784 makeSomething(new PointFlow());
16791785 } else
....@@ -1685,7 +1791,7 @@
16851791 } else
16861792 */
16871793
1688
- if (event.getSource() == superLoopItem)
1794
+ if (source == superLoopItem)
16891795 {
16901796 Composite g = new cGroup();
16911797 for (int i=0; i<15; i++)
....@@ -1707,7 +1813,7 @@
17071813
17081814 group(g);
17091815 } else
1710
- if (event.getSource() == loopItem)
1816
+ if (source == loopItem)
17111817 {
17121818 Composite csg = new GroupLeaf();
17131819 csg.count = 5;
....@@ -1716,7 +1822,7 @@
17161822 csg.addChild(child);
17171823 child.addChild(csg);
17181824 } else
1719
- if (event.getSource() == doubleItem)
1825
+ if (source == doubleItem)
17201826 {
17211827 Composite csg = new GroupLeaf();
17221828 csg.count = 5;
....@@ -1728,7 +1834,7 @@
17281834 csg.addChild(child);
17291835 child.addChild(csg);
17301836 } else
1731
- if (event.getSource() == tripleItem)
1837
+ if (source == tripleItem)
17321838 {
17331839 Composite csg = new GroupLeaf();
17341840 csg.count = 4;
....@@ -1744,70 +1850,83 @@
17441850 child.addChild(csg);
17451851 } else
17461852
1747
- if (event.getSource() == importGFDItem)
1853
+ if (source == importGFDItem)
17481854 {
17491855 ImportGFD();
17501856 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1857
+ if (source == importVRMLX3DItem)
17521858 {
17531859 ImportVRMLX3D();
17541860 } else
1755
- if (event.getSource() == import3DSItem)
1861
+ if (source == import3DSItem)
17561862 {
17571863 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581864 } else
1759
- if (event.getSource() == importOBJItem)
1865
+ if (source == importOBJItem)
17601866 {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1867
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
+ browser.setVisible(true);
1870
+ String filename = browser.getFile();
1871
+ if (filename != null && filename.length() > 0)
1872
+ {
1873
+ String fullname = browser.getDirectory() + filename;
1874
+ makeSomething(ReadOBJ(fullname), true);
1875
+ }
17621876 } else
1763
- if (event.getSource() == computeAOItem)
1877
+ if (source == computeAOItem)
17641878 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1879
+ Globals.drawMode = CameraPane.OCCLUSION;
1880
+ Globals.theRenderer.repaint();
17671881 } else
1768
- if (event.getSource() == recompileItem)
1882
+ if (source == recompileItem)
17691883 {
17701884 Recompile();
17711885 refreshContents();
17721886 } else
1773
- if (event.getSource() == editScriptItem)
1887
+ if (source == editScriptItem)
17741888 {
17751889 OpenDialog();
17761890 refreshContents();
17771891 } else
1778
- if (event.getSource() == invariantsItem)
1892
+ if (source == invariantsItem)
17791893 {
17801894 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1895
+ GrafreeD.grafreeD.universe.invariants();
17821896 } else
1783
- if (event.getSource() == memoryItem)
1897
+ if (source == memoryItem)
17841898 {
17851899 //System.out.println("Invariants:");
17861900 PrintMemory();
17871901 } else
1788
- if (event.getSource() == pathItem)
1902
+ if (source == pathItem)
17891903 {
17901904 PrintPath();
17911905 } else
1792
- if (event.getSource() == analyzeItem)
1906
+ if (source == analyzeItem)
17931907 {
17941908 AnalyzeObject();
17951909 } else
1796
- if (event.getSource() == dumpItem)
1910
+ if (source == dumpItem)
17971911 {
17981912 DumpObject();
17991913 } else
1800
- if (event.getSource() == screenfitButton)
1914
+ if (source == oneStepButton)
1915
+ {
1916
+ Globals.ONESTEP = true;
1917
+ cameraView.repaint();
1918
+ } else
1919
+ if (source == screenfitButton)
18011920 {
18021921 //Reload(lastConverter, lastFilename, true);
18031922 ScreenFit();
18041923 } else
1805
- if (event.getSource() == screenfitpointButton)
1924
+ if (source == screenfitpointButton)
18061925 {
18071926 //Reload(lastConverter, lastFilename, true);
18081927 ScreenFitPoint();
18091928 } else
1810
- if (event.getSource() == snapobjectButton)
1929
+ if (source == snapobjectButton)
18111930 {
18121931 //Reload(lastConverter, lastFilename, true);
18131932 SnapObject();
....@@ -1818,13 +1937,13 @@
18181937 // Recompile();
18191938 // refreshContents();
18201939 // } else
1821
- if (event.getSource() == gcButton)
1940
+ if (source == gcButton)
18221941 {
18231942 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241943 System.gc();
18251944 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261945 } else
1827
- if (event.getSource() == editLeafItem)
1946
+ if (source == editLeafItem)
18281947 {
18291948 Object3D obj;
18301949 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1957,66 @@
18381957 }
18391958 refreshContents(true);
18401959 } else
1841
- if (event.getSource() == openWindowItem)
1960
+ if (source == openWindowItem)
18421961 {
18431962 EditSelection(true);
18441963 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1964
+ if (source == cutItem || source == clearButton)
18461965 {
18471966 loadClipboard(true);
18481967 } else
1849
- if (event.getSource() == duplicateItem)
1968
+ if (source == duplicateItem)
18501969 {
18511970 Object3D keep = GrafreeD.clipboard;
18521971 loadClipboard(false);
18531972 paste(false);
18541973 GrafreeD.clipboard = keep;
18551974 } else
1856
- if (event.getSource() == cloneItem)
1975
+ if (source == cloneItem)
18571976 {
18581977 CloneSelection(false);
18591978 } else
1860
- if (event.getSource() == cloneSupportItem)
1979
+ if (source == cloneSupportItem)
18611980 {
18621981 CloneSelection(true);
18631982 } else
1864
- if (event.getSource() == copyItem)
1983
+ if (source == copyItem)
18651984 {
18661985 loadClipboard(false);
18671986 } else
1868
- if (event.getSource() == pasteItem)
1987
+ if (source == pasteItem)
18691988 {
18701989 paste(false);
18711990 } else
1872
- if (event.getSource() == pasteLinkItem)
1991
+ if (source == pasteIntoItem)
18731992 {
1874
- pasteInto(false);
1993
+ pasteInto(true, false);
18751994 } else
1876
- if (event.getSource() == pasteCloneItem)
1995
+ if (source == pasteLinkItem)
18771996 {
1878
- pasteInto(true);
1997
+ pasteInto(false, false);
18791998 } else
1880
- if (event.getSource() == pasteExpandItem)
1999
+ if (source == pasteCloneItem)
2000
+ {
2001
+ pasteInto(true, true);
2002
+ } else
2003
+ if (source == pasteExpandItem)
18812004 {
18822005 paste(true);
18832006 } else
1884
- if (event.getSource() == synchronizeItem)
2007
+ if (source == synchronizeItem)
18852008 {
18862009 Overwrite(Object3D.TRANSFORM);
18872010 } else
1888
- if (event.getSource() == overwriteNameItem)
2011
+ if (source == overwriteNameItem)
18892012 {
18902013 Overwrite(Object3D.NAME);
18912014 } else
1892
- if (event.getSource() == overwriteUVItem)
2015
+ if (source == overwriteUVItem)
18932016 {
18942017 Overwrite(Object3D.UV);
18952018 } else
1896
- if (event.getSource() == overwriteMatItem)
2019
+ if (source == overwriteMatItem)
18972020 {
18982021 /* july 2015
18992022 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2036,7 @@
19132036
19142037 Overwrite(dropAttributes);
19152038 }
1916
- if (event.getSource() == overwriteGeoItem)
2039
+ if (source == overwriteGeoItem)
19172040 {
19182041 Overwrite(Object3D.GEOMETRY);
19192042 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2053,7 @@
19302053 // refreshContents();
19312054 // }
19322055 } else
1933
- if (event.getSource() == generateMeshItem)
2056
+ if (source == generateMeshItem)
19342057 {
19352058 //if (group.selection.size() == 1)
19362059 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2064,7 @@
19412064 ResetModel();
19422065 refreshContents();
19432066 } else
1944
- if (event.getSource() == extractGeometriesItem)
2067
+ if (source == extractGeometriesItem)
19452068 {
19462069 boolean one = false;
19472070
....@@ -1968,7 +2091,7 @@
19682091 ResetModel();
19692092 refreshContents();
19702093 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2094
+ if (source == cloneGeometriesItem)
19722095 {
19732096 boolean one = false;
19742097
....@@ -1994,32 +2117,37 @@
19942117 ResetModel();
19952118 refreshContents();
19962119 } else
1997
- if (event.getSource() == shareGeometriesItem)
2120
+ if (source == shareGeometriesItem)
19982121 {
19992122 boolean one = false;
20002123
20012124 if (group.selection.size() == 1)
20022125 one = true;
20032126
2127
+ Object3D merge = null;
2128
+
20042129 Object3D content = new cGroup();
20052130
20062131 for (int i=0; i<group.selection.size(); i++)
20072132 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2133
+ merge = new Merge(group.selection.get(i));
20092134
20102135 if (one)
2011
- makeSomething(sel, false);
2136
+ makeSomething(merge, false);
20122137 else
2013
- content.addChild(sel);
2138
+ content.addChild(merge);
20142139 }
20152140
20162141 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2142
+ makeSomething(content, true);
2143
+ else
2144
+ {
2145
+ ResetModel();
2146
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2147
+ refreshContents();
2148
+ }
20212149 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2150
+ if (source == mergeGeometriesItem)
20232151 {
20242152 boolean one = false;
20252153
....@@ -2049,7 +2177,7 @@
20492177 ResetModel();
20502178 refreshContents();
20512179 } else
2052
- if (event.getSource() == linkverticesItem)
2180
+ if (source == linkverticesItem)
20532181 {
20542182 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552183 // {
....@@ -2069,32 +2197,41 @@
20692197 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702198 content = ((cGroup)content).get(0);
20712199
2072
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2200
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20732201 for (int i=0; i<group.selection.size(); i++)
20742202 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2203
+ boolean random = CameraPane.SWITCH;
2204
+ CameraPane.SWITCH = false; // parse all random nodes
20772205 group.selection.get(i).linkVerticesThis(content);
20782206 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
20802208 }
2081
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2209
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20822210 refreshContents();
20832211 }
20842212 } else
2085
- if (event.getSource() == resetsupportItem)
2213
+ if (source == resetsupportItem)
20862214 {
20872215 for (int i=0; i<group.selection.size(); i++)
20882216 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2217
+ boolean random = CameraPane.SWITCH;
2218
+ CameraPane.SWITCH = false; // parse all random nodes
20912219 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2220
+ CameraPane.SWITCH = random;
20932221 }
20942222
20952223 refreshContents();
20962224 } else
2097
- if (event.getSource() == resetreferencesItem)
2225
+ if (source == relinkverticesItem)
2226
+ {
2227
+ boolean random = CameraPane.SWITCH;
2228
+ CameraPane.SWITCH = false; // parse all random nodes
2229
+ group.selection.RelinkToSupport();
2230
+ CameraPane.SWITCH = random;
2231
+
2232
+ refreshContents();
2233
+ } else
2234
+ if (source == resetreferencesItem)
20982235 {
20992236 for (int i=0; i<group.selection.size(); i++)
21002237 {
....@@ -2103,7 +2240,7 @@
21032240
21042241 refreshContents();
21052242 } else
2106
- if (event.getSource() == setMasterItem)
2243
+ if (source == setMasterItem)
21072244 {
21082245 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21092246 {
....@@ -2116,7 +2253,7 @@
21162253 refreshContents();
21172254 }
21182255 } else
2119
- if (event.getSource() == poseMeshItem)
2256
+ if (source == poseMeshItem)
21202257 {
21212258 if (group.selection.size() == 1)
21222259 {
....@@ -2135,19 +2272,19 @@
21352272 }
21362273
21372274 } else
2138
- if (event.getSource() == revertMeshItem)
2275
+ if (source == revertMeshItem)
21392276 {
21402277 RevertMeshes();
21412278 } else
2142
- if (event.getSource() == resetMeshItem)
2279
+ if (source == resetMeshItem)
21432280 {
21442281 ResetAll();
21452282 } else
2146
- if (event.getSource() == stepAllItem)
2283
+ if (source == stepAllItem)
21472284 {
21482285 StepAll();
21492286 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2287
+ if (source == clearItem) // || event.getSource() == clearButton)
21512288 {
21522289 //int indices[] = jList.getSelectedIndices();
21532290 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2292,46 @@
21552292
21562293 ClearSelection(false);
21572294 } else
2158
- if (event.getSource() == clearAllItem)
2295
+ if (source == clearAllItem)
21592296 {
21602297 ClearSelection(true);
21612298 } else
2162
- if (event.getSource() == grabItem)
2299
+ if (source == grabItem)
21632300 {
21642301 group(new cGroup(), true);
21652302 } else
2166
- if (event.getSource() == frontItem)
2303
+ if (source == hideItem)
2304
+ {
2305
+ group(new HiddenObject());
2306
+ } else
2307
+ if (source == frontItem)
21672308 {
21682309 front();
21692310 } else
2170
- if (event.getSource() == backItem)
2311
+ if (source == backItem)
21712312 {
21722313 back();
21732314 } else
2174
- if (event.getSource() == cameraItem)
2315
+ if (source == cameraItem)
21752316 {
21762317 makeSomething(new Camera());
21772318 } else
2178
- if (event.getSource() == compositeItem)
2319
+ if (source == compositeItem)
21792320 {
21802321 group(new Composite());
21812322 } else
2182
- if (event.getSource() == randomItem)
2323
+ if (source == randomItem)
21832324 {
21842325 RandomNode random = new RandomNode();
21852326 group(random);
21862327 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2328
+ random.name = random.get(0).name + "Switch";
21882329 } else
2189
- if (event.getSource() == physicsItem)
2330
+ if (source == physicsItem)
21902331 {
21912332 group(new PhysicsNode());
21922333 } else
2193
- if (event.getSource() == frameselectorItem)
2334
+ if (source == frameselectorItem)
21942335 {
21952336 for (int i=0; i<group.selection.size(); i++)
21962337 {
....@@ -2202,7 +2343,7 @@
22022343 ResetModel();
22032344 refreshContents();
22042345 } else
2205
- if (event.getSource() == switchGeoItem)
2346
+ if (source == switchGeoItem)
22062347 {
22072348 for (int i=0; i<group.selection.size(); i++)
22082349 {
....@@ -2214,7 +2355,7 @@
22142355 ResetModel();
22152356 refreshContents();
22162357 } else
2217
- if (event.getSource() == switchTransfoItem)
2358
+ if (source == switchTransfoItem)
22182359 {
22192360 for (int i=0; i<group.selection.size(); i++)
22202361 {
....@@ -2226,7 +2367,7 @@
22262367 ResetModel();
22272368 refreshContents();
22282369 } else
2229
- if (event.getSource() == morphItem)
2370
+ if (source == morphItem)
22302371 {
22312372 for (int i=0; i<group.selection.size(); i++)
22322373 {
....@@ -2238,7 +2379,7 @@
22382379 ResetModel();
22392380 refreshContents();
22402381 } else
2241
- if (event.getSource() == scriptNodeItem)
2382
+ if (source == scriptNodeItem)
22422383 {
22432384 boolean atleastone = false;
22442385
....@@ -2277,195 +2418,215 @@
22772418 }
22782419 }
22792420 } else
2280
- if (event.getSource() == linkerItem)
2421
+ if (source == linkerItem)
22812422 {
22822423 group(new cLinker());
22832424 } else
2284
- if (event.getSource() == textureItem)
2425
+ if (source == textureItem)
22852426 {
22862427 group(new TextureNode());
22872428 } else
2288
- if (event.getSource() == shadowXItem)
2429
+ if (source == billboardItem)
2430
+ {
2431
+ group(new BillboardNode());
2432
+ } else
2433
+ if (source == shadowXItem)
22892434 {
22902435 CastShadow(0);
22912436 } else
2292
- if (event.getSource() == shadowYItem)
2437
+ if (source == shadowYItem)
22932438 {
22942439 CastShadow(1);
22952440 } else
2296
- if (event.getSource() == shadowZItem)
2441
+ if (source == shadowZItem)
22972442 {
22982443 CastShadow(2);
22992444 } else
2300
- if (event.getSource() == ungroupItem)
2445
+ if (source == ungroupItem)
23012446 {
2302
- ungroup();
2447
+ //ungroup();
2448
+ for (int i=0; i<group.selection.size(); i++)
2449
+ {
2450
+ Ungroup(group.selection.get(i));
2451
+ }
2452
+
2453
+ ClearSelection(false);
2454
+
2455
+ refreshContents();
23032456 } else
2304
- if (event.getSource() == genUVItem)
2457
+ if (source == genUVItem)
23052458 {
23062459 GenUV();
23072460 } else
2308
- if (event.getSource() == genNormalsCADItem)
2461
+ if (source == genNormalsCADItem)
23092462 {
23102463 GenNormals(true);
23112464 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2465
+ if (source == genNormalsMESHItem)
2466
+ {
2467
+ GenNormals(true); // TODO
2468
+ } else
2469
+ if (source == genNormalsORGANItem)
23132470 {
23142471 GenNormals(false);
23152472 } else
2316
- if (event.getSource() == stripifyItem)
2473
+ if (source == genNormalsMINEItem)
2474
+ {
2475
+ GenNormalsMINE();
2476
+ } else
2477
+ if (source == stripifyItem)
23172478 {
23182479 Stripify();
23192480 } else
2320
- if (event.getSource() == unstripifyItem)
2481
+ if (source == unstripifyItem)
23212482 {
23222483 Unstripify();
23232484 } else
2324
- if (event.getSource() == trimItem)
2485
+ if (source == trimItem)
23252486 {
23262487 Trim();
23272488 } else
2328
- if (event.getSource() == untrimItem)
2489
+ if (source == untrimItem)
23292490 {
23302491 Untrim();
23312492 } else
2332
- if (event.getSource() == clearColorsItem)
2493
+ if (source == clearColorsItem)
23332494 {
23342495 ClearColors();
23352496 } else
2336
- if (event.getSource() == clearMaterialsItem)
2497
+ if (source == clearMaterialsItem)
23372498 {
23382499 ClearMaterials();
23392500 } else
2340
- if (event.getSource() == liveleavesItem)
2501
+ if (source == liveleavesItem)
23412502 {
23422503 LiveLeaves(true);
23432504 } else
2344
- if (event.getSource() == unliveleavesItem)
2505
+ if (source == unliveleavesItem)
23452506 {
23462507 LiveLeaves(false);
23472508 } else
2348
- if (event.getSource() == supportleavesItem)
2509
+ if (source == supportleavesItem)
23492510 {
23502511 SupportLeaves(true);
23512512 } else
2352
- if (event.getSource() == unsupportleavesItem)
2513
+ if (source == unsupportleavesItem)
23532514 {
23542515 SupportLeaves(false);
23552516 } else
2356
- if (event.getSource() == hideleavesItem)
2517
+ if (source == hideleavesItem)
23572518 {
23582519 HideLeaves(true);
23592520 } else
2360
- if (event.getSource() == showleavesItem)
2521
+ if (source == showleavesItem)
23612522 {
23622523 HideLeaves(false);
23632524 } else
2364
- if (event.getSource() == markleavesItem)
2525
+ if (source == markleavesItem)
23652526 {
23662527 MarkLeaves(true);
23672528 } else
2368
- if (event.getSource() == unmarkleavesItem)
2529
+ if (source == unmarkleavesItem)
23692530 {
23702531 MarkLeaves(false);
23712532 } else
2372
- if (event.getSource() == flipVItem)
2533
+ if (source == flipVItem)
23732534 {
23742535 FlipV(true);
23752536 } else
2376
- if (event.getSource() == unflipVItem)
2537
+ if (source == unflipVItem)
23772538 {
23782539 FlipV(false);
23792540 } else
2380
- if (event.getSource() == lowTexturesItem)
2541
+ if (source == lowTexturesItem)
23812542 {
23822543 SetTexRes(0);
23832544 } else
2384
- if (event.getSource() == normalTexturesItem)
2545
+ if (source == normalTexturesItem)
23852546 {
23862547 SetTexRes(1);
23872548 } else
2388
- if (event.getSource() == highTexturesItem)
2549
+ if (source == highTexturesItem)
23892550 {
23902551 SetTexRes(2);
23912552 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2553
+ if (source == veryhighTexturesItem)
23932554 {
23942555 SetTexRes(3);
23952556 } else
2396
- if (event.getSource() == maxTexturesItem)
2557
+ if (source == maxTexturesItem)
23972558 {
23982559 SetTexRes(4);
23992560 } else
2400
- if (event.getSource() == panoTexturesItem)
2561
+ if (source == panoTexturesItem)
24012562 {
24022563 SetTexRes(5);
24032564 } else
2404
- if (event.getSource() == reverseNormalsItem)
2565
+ if (source == reverseNormalsItem)
24052566 {
24062567 ReverseNormals();
24072568 } else
2408
- if (event.getSource() == parseverticesItem)
2569
+ if (source == parseverticesItem)
24092570 {
24102571 ParseVertices();
24112572 } else
2412
- if (event.getSource() == textureFieldItem)
2573
+ if (source == textureFieldItem)
24132574 {
24142575 TextureVertices();
24152576 } else
2416
- if (event.getSource() == alignItem)
2577
+ if (source == alignItem)
24172578 {
24182579 Align();
24192580 } else
2420
- if (event.getSource() == mirrorItem)
2581
+ if (source == mirrorItem)
24212582 {
24222583 MirrorPoses();
24232584 } else
2424
- if (event.getSource() == reduceMorphItem)
2585
+ if (source == reduceMorphItem)
24252586 {
24262587 MeshReduction(false);
24272588 } else
2428
- if (event.getSource() == reduce34MorphItem)
2589
+ if (source == reduce34MorphItem)
24292590 {
24302591 MeshReduction(true);
24312592 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2593
+ if (source == reverseTrianglesItem)
24332594 {
24342595 ReverseTriangles();
24352596 } else
2436
- if (event.getSource() == reduceMeshItem)
2597
+ if (source == reduceMeshItem)
24372598 {
24382599 ReduceMesh(false);
24392600 } else
2440
- if (event.getSource() == reduce34MeshItem)
2601
+ if (source == reduce34MeshItem)
24412602 {
24422603 ReduceMesh(true);
24432604 } else
2444
- if (event.getSource() == increaseMeshItem)
2605
+ if (source == increaseMeshItem)
24452606 {
24462607 IncreaseMesh();
24472608 } else
2448
- if (event.getSource() == clipMeshItem)
2609
+ if (source == clipMeshItem)
24492610 {
24502611 ClipMesh();
24512612 } else
2452
- if (event.getSource() == smoothMeshItem)
2613
+ if (source == smoothMeshItem)
24532614 {
24542615 SmoothMesh();
24552616 } else
2456
- if (event.getSource() == transformgeometryItem)
2617
+ if (source == transformgeometryItem)
24572618 {
24582619 TransformGeometry();
24592620 } else
2460
- if (event.getSource() == resetTransformItem)
2621
+ if (source == resetTransformItem)
24612622 {
24622623 ResetTransform();
24632624 } else
2464
- if (event.getSource() == resetCentroidItem)
2625
+ if (source == resetCentroidItem)
24652626 {
24662627 ResetCentroid();
24672628 } else
2468
- if (event.getSource() == resetParentItem)
2629
+ if (source == resetParentItem)
24692630 {
24702631 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712632 {
....@@ -2475,7 +2636,7 @@
24752636
24762637 refreshContents();
24772638 } else
2478
- if (event.getSource() == repairParentItem)
2639
+ if (source == repairParentItem)
24792640 {
24802641 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812642 {
....@@ -2489,7 +2650,21 @@
24892650
24902651 refreshContents();
24912652 } else
2492
- if (event.getSource() == sortbysizeItem)
2653
+ if (source == repairShadowItem)
2654
+ {
2655
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2656
+ {
2657
+ Object3D obj = (Object3D)e.nextElement();
2658
+ obj.RepairShadow();
2659
+// for (int i=0; i<obj.size(); i++)
2660
+// {
2661
+// obj.get(i).parent = obj;
2662
+// }
2663
+ }
2664
+
2665
+ refreshContents();
2666
+ } else
2667
+ if (source == sortbysizeItem)
24932668 {
24942669 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952670 {
....@@ -2501,7 +2676,7 @@
25012676 ResetModel();
25022677 refreshContents();
25032678 } else
2504
- if (event.getSource() == sortbynameItem)
2679
+ if (source == sortbynameItem)
25052680 {
25062681 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072682 {
....@@ -2513,7 +2688,7 @@
25132688 ResetModel();
25142689 refreshContents();
25152690 } else
2516
- if (event.getSource() == attachPigmentItem)
2691
+ if (source == attachPigmentItem)
25172692 {
25182693 String texture = GetFile("Attach pigment");
25192694 Object3D obj;
....@@ -2525,7 +2700,7 @@
25252700
25262701 refreshContents();
25272702 } else
2528
- if (event.getSource() == detachPigmentItem)
2703
+ if (source == detachPigmentItem)
25292704 {
25302705 Object3D obj;
25312706 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2711,7 @@
25362711
25372712 refreshContents();
25382713 } else
2539
- if (event.getSource() == attachBumpItem)
2714
+ if (source == attachBumpItem)
25402715 {
25412716 String texture = GetFile("Attach bump");
25422717 Object3D obj;
....@@ -2548,7 +2723,7 @@
25482723
25492724 refreshContents();
25502725 } else
2551
- if (event.getSource() == detachBumpItem)
2726
+ if (source == detachBumpItem)
25522727 {
25532728 Object3D obj;
25542729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2734,7 @@
25592734
25602735 refreshContents();
25612736 } else
2562
- if (event.getSource() == pigmentBumpItem)
2737
+ if (source == pigmentBumpItem)
25632738 {
25642739 Object3D obj;
25652740 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2745,195 @@
25702745
25712746 refreshContents();
25722747 } else
2573
- if (event.getSource() == flashSelectionButton)
2748
+ if (source == flashSelectionButton)
25742749 {
25752750 CameraPane.flash = true;
25762751 refreshContents();
25772752 } else
2578
- if (event.getSource() == oneButton)
2753
+ if (source == oneButton)
25792754 {
25802755 } else
2581
- if (event.getSource() == twoButton)
2756
+ if (source == twoButton)
25822757 {
25832758 radio.layout = twoButton;
25842759 // bug
25852760 //gridPanel.setDividerLocation(1.0);
25862761 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- bigThree.revalidate();
2762
+// bigThree.remove(scenePanel);
2763
+// bigThree.remove(centralPanel);
2764
+// bigThree.remove(XYZPanel);
2765
+// aWindowConstraints.gridx = 0;
2766
+// aWindowConstraints.gridy = 0;
2767
+// aWindowConstraints.gridwidth = 1;
2768
+// // aConstraints.gridheight = 3;
2769
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2770
+// aWindowConstraints.weightx = 0;
2771
+// aWindowConstraints.weighty = 1;
2772
+// //bigThree.add(jtp, aWindowConstraints);
2773
+// aWindowConstraints.weightx = 1;
2774
+// aWindowConstraints.gridwidth = 3;
2775
+// // aConstraints.gridheight = 3;
2776
+// aWindowConstraints.gridx = 1;
2777
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2778
+// bigThree.add(centralPanel, aWindowConstraints);
2779
+// aWindowConstraints.weightx = 0;
2780
+// aWindowConstraints.gridx = 4;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// //bigThree.add(XYZPanel, aWindowConstraints);
2785
+// scenePanel.setVisible(false);
2786
+// centralPanel.setVisible(true);
2787
+// XYZPanel.setVisible(false);
2788
+ bigThree.ClearUI();
2789
+ bigThree.add(centralPanel);
2790
+ bigThree.FlushUI();
26112791 } else
2612
- if (event.getSource() == threeButton)
2792
+ if (source == threeButton)
26132793 {
26142794 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- bigThree.revalidate();
2795
+
2796
+// bigThree.remove(scenePanel);
2797
+// bigThree.remove(centralPanel);
2798
+// bigThree.remove(XYZPanel);
2799
+// aWindowConstraints.gridx = 0;
2800
+// aWindowConstraints.gridy = 0;
2801
+// aWindowConstraints.gridwidth = 1;
2802
+// // aConstraints.gridheight = 3;
2803
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2804
+// aWindowConstraints.weightx = 0;
2805
+// aWindowConstraints.weighty = 1;
2806
+// //bigThree.add(jtp, aWindowConstraints);
2807
+// aWindowConstraints.weightx = 1;
2808
+// aWindowConstraints.gridwidth = 3;
2809
+// // aConstraints.gridheight = 3;
2810
+// aWindowConstraints.gridx = 1;
2811
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2812
+// bigThree.add(centralPanel, aWindowConstraints);
2813
+// aWindowConstraints.weightx = 0;
2814
+// aWindowConstraints.gridx = 4;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// bigThree.add(XYZPanel, aWindowConstraints);
2819
+// bigThree.validate();
2820
+// scenePanel.setVisible(false);
2821
+// centralPanel.setVisible(true);
2822
+// XYZPanel.setVisible(true);
2823
+ bigThree.ClearUI();
2824
+ bigThree.add(centralPanel);
2825
+ bigThree.add(XYZPanel);
2826
+ bigThree.FlushUI();
26392827 } else
2640
- if (event.getSource() == fourButton)
2828
+ if (source == fourButton)
26412829 {
26422830 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
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(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
2831
+
2832
+// bigThree.remove(scenePanel);
2833
+// bigThree.remove(centralPanel);
2834
+// bigThree.remove(XYZPanel);
2835
+// aWindowConstraints.gridx = 0;
2836
+// aWindowConstraints.gridy = 0;
2837
+// aWindowConstraints.gridwidth = 1;
2838
+// // aWindowConstraints.gridheight = 3;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// aWindowConstraints.weightx = 1;
2841
+// aWindowConstraints.weighty = 1;
2842
+// bigThree.add(scenePanel, aWindowConstraints);
2843
+// aWindowConstraints.weightx = 1;
2844
+// aWindowConstraints.gridwidth = 3;
2845
+// // aConstraints.gridheight = 3;
2846
+// aWindowConstraints.gridx = 1;
2847
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2848
+// //bigThree.add(cameraPanel, aWindowConstraints);
2849
+// aWindowConstraints.weightx = 0;
2850
+// aWindowConstraints.gridx = 4;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2854
+// //bigThree.add(XYZPanel, aWindowConstraints);
2855
+// bigThree.validate();
2856
+// scenePanel.setVisible(true);
2857
+// centralPanel.setVisible(false);
2858
+// XYZPanel.setVisible(false);
2859
+ bigThree.ClearUI();
2860
+ bigThree.add(scenePanel);
2861
+ bigThree.FlushUI();
26672862 } else
2668
- if (event.getSource() == sixButton)
2863
+ if (source == sixButton)
26692864 {
26702865 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
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
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- bigThree.revalidate();
2866
+
2867
+// bigThree.remove(scenePanel);
2868
+// bigThree.remove(centralPanel);
2869
+// bigThree.remove(XYZPanel);
2870
+// aWindowConstraints.gridx = 0;
2871
+// aWindowConstraints.gridy = 0;
2872
+// aWindowConstraints.gridwidth = 1;
2873
+// // aConstraints.gridheight = 3;
2874
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2875
+// aWindowConstraints.weightx = 0;
2876
+// aWindowConstraints.weighty = 1;
2877
+// bigThree.add(scenePanel, aWindowConstraints);
2878
+// aWindowConstraints.weightx = 1;
2879
+// aWindowConstraints.gridwidth = 3;
2880
+// // aWindowConstraints.gridheight = 3;
2881
+// aWindowConstraints.gridx = 1;
2882
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2883
+// bigThree.add(centralPanel, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 0;
2885
+// aWindowConstraints.gridx = 4;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aWindowConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// //bigThree.add(XYZPanel, aConstraints);
2890
+// bigThree.validate();
2891
+// scenePanel.setVisible(true);
2892
+// centralPanel.setVisible(true);
2893
+// XYZPanel.setVisible(false);
2894
+ bigThree.ClearUI();
2895
+ bigThree.add(scenePanel);
2896
+ bigThree.add(centralPanel);
2897
+ bigThree.FlushUI();
26952898 } else
2696
- if (event.getSource() == sevenButton)
2899
+ if (source == sevenButton)
26972900 {
26982901 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.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
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
2902
+
2903
+// bigThree.remove(scenePanel);
2904
+// bigThree.remove(centralPanel);
2905
+// bigThree.remove(XYZPanel);
2906
+// aWindowConstraints.gridx = 0;
2907
+// aWindowConstraints.gridy = 0;
2908
+// aWindowConstraints.gridwidth = 1;
2909
+// // aWindowConstraints.gridheight = 3;
2910
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2911
+// aWindowConstraints.weightx = 0;
2912
+// aWindowConstraints.weighty = 1;
2913
+// bigThree.add(scenePanel, aWindowConstraints);
2914
+// aWindowConstraints.weightx = 1;
2915
+// aWindowConstraints.gridwidth = 3;
2916
+// // aWindowConstraints.gridheight = 3;
2917
+// aWindowConstraints.gridx = 1;
2918
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2919
+// bigThree.add(centralPanel, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 0;
2921
+// aWindowConstraints.gridx = 4;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// bigThree.add(XYZPanel, aWindowConstraints);
2926
+// bigThree.validate();
2927
+// scenePanel.setVisible(true);
2928
+// centralPanel.setVisible(true);
2929
+// XYZPanel.setVisible(true);
2930
+ bigThree.ClearUI();
2931
+ bigThree.add(scenePanel);
2932
+ bigThree.add(centralPanel);
2933
+ bigThree.add(XYZPanel);
2934
+ bigThree.FlushUI();
27232935 } else
2724
- if (event.getSource() == rootButton)
2936
+ if (source == rootButton)
27252937 {
27262938 Object3D obj;
27272939 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2945,7 @@
27332945
27342946 refreshContents(true);
27352947 } else
2736
- if (event.getSource() == closeButton)
2948
+ if (source == closeButton)
27372949 {
27382950 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392951 cRadio ab;
....@@ -2754,11 +2966,11 @@
27542966 }
27552967 refreshContents(true);
27562968 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
2969
+ if (source == editItem || source == editButton)
27582970 {
27592971 EditSelection(false);
27602972 } else
2761
- if (event.getSource() == uneditButton)
2973
+ if (source == uneditButton)
27622974 {
27632975 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27642976 {
....@@ -2770,12 +2982,12 @@
27702982
27712983 child.editWindow = null; // ???????????
27722984 }
2773
- objEditor.ctrlPanel.revalidate();
2985
+ objEditor.ctrlPanel.FlushUI();
27742986 //objEditor.jTree.clearSelection();
27752987 //objEditor.ResetSliders();
27762988 refreshContents(true);
27772989 } else
2778
- if (event.getSource() == clearPanelButton)
2990
+ if (source == clearPanelButton)
27792991 {
27802992 assert(copy == group);
27812993 //copy.ClearUI();
....@@ -2786,7 +2998,7 @@
27862998 listUI.clear();
27872999 refreshContents(true);
27883000 } else
2789
- if (event.getSource() == allParamsButton)
3001
+ if (source == allParamsButton)
27903002 {
27913003 assert(copy == group);
27923004
....@@ -2807,19 +3019,19 @@
28073019
28083020 refreshContents(true);
28093021 } else
2810
- if (event.getSource() == unselectButton)
3022
+ if (source == unselectButton)
28113023 {
28123024 objEditor.jTree.clearSelection();
28133025 // ?? oct 2012 GrafreeD.clipboard.clear();
28143026 objEditor.ResetSliders();
28153027 refreshContents(true);
28163028 } else
2817
- if(event.getSource() instanceof cRadio)
3029
+ if(source instanceof cRadio)
28183030 {
28193031 group.parent = keepparent;
28203032 group.attributes = 0;
28213033 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3034
+ /*cRadio*/ radio = (cRadio)source;
28233035 Object3D obj = radio.GetObject();
28243036 System.out.println("Edit " + obj);
28253037 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3051,7 @@
28393051 }
28403052
28413053 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3054
+ //Globals.theRenderer.object = group;
28433055 if(!useclient)
28443056 {
28453057 cameraView.renderCamera = radio.camera;
....@@ -2848,7 +3060,8 @@
28483060 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493061 cameraView.targetLookAt.set(radio.camera.lookAt);
28503062 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3063
+ //cameraView.lighttouched = true;
3064
+ Globals.lighttouched = true;
28523065 topView.object = group;
28533066 frontView.object = group;
28543067 sideView.object = group;
....@@ -2884,7 +3097,7 @@
28843097 if (useclient)
28853098 {
28863099 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3100
+ Globals.lighttouched = true;
28883101 //topView.object = client;
28893102 //frontView.object = client;
28903103 //sideView.object = client;
....@@ -2892,7 +3105,7 @@
28923105 else
28933106 {
28943107 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3108
+ Globals.lighttouched = true;
28963109 //topView.object = group;
28973110 //frontView.object = group;
28983111 //sideView.object = group;
....@@ -3173,6 +3386,13 @@
31733386 refreshContents();
31743387 }
31753388
3389
+ void GenNormalsMINE()
3390
+ {
3391
+ group.selection.GenNormalsMINE();
3392
+
3393
+ refreshContents();
3394
+ }
3395
+
31763396 void Stripify()
31773397 {
31783398 group.StripifyS();
....@@ -3393,7 +3613,7 @@
33933613 String pigment = Object3D.GetPigment(tex);
33943614 //String bump = Object3D.GetBump(tex);
33953615
3396
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3616
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33973617
33983618 double s = v.s;
33993619
....@@ -3441,12 +3661,26 @@
34413661
34423662 void Align()
34433663 {
3664
+ if (group.selection.size() == 0)
3665
+ return;
3666
+
3667
+ cVector bbmin = new cVector();
3668
+ cVector bbmax = new cVector();
3669
+
3670
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3671
+
3672
+ double dx = bbmax.x - bbmin.x;
3673
+ double dy = bbmax.y - bbmin.y;
3674
+ double dz = bbmax.z - bbmin.z;
3675
+
3676
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3677
+
34443678 for (int i=0; i<group.selection.size(); i++)
34453679 {
34463680 Object3D obj = group.selection.get(i);
34473681
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3682
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3683
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503684 }
34513685
34523686 refreshContents();
....@@ -3467,11 +3701,11 @@
34673701
34683702 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693703
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3704
+ boolean random = CameraPane.SWITCH;
3705
+ CameraPane.SWITCH = false; // parse all random nodes
34723706 lowres.linkVerticesThis(null);
34733707 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3708
+ CameraPane.SWITCH = random;
34753709
34763710 System.err.flush();
34773711
....@@ -3680,7 +3914,7 @@
36803914 group.selection.RelinkToSupport(); // july 2014
36813915 System.out.println("DONE.");
36823916 refreshContents();
3683
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3917
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36843918 }
36853919
36863920 void ReduceMesh(boolean reduction34)
....@@ -3956,25 +4190,25 @@
39564190 System.err.println("info : " + child.GetPath());
39574191 }
39584192 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4193
+// else
4194
+// {
4195
+// objEditor.SetMaterial(group); // .GetMaterial());
4196
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4197
+// System.err.println("info : " + group.GetPath());
4198
+// }
39654199
39664200 objEditor.SetText(); // jan 2014
39674201
3968
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4202
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39694203 CameraPane.flash = true;
39704204
39714205 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724206 // a camera
39734207 {
39744208 CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4209
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4210
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4211
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784212 }
39794213
39804214 refreshContents();
....@@ -4229,7 +4463,7 @@
42294463 refreshContents();
42304464 }
42314465
4232
- void pasteInto(boolean copyit)
4466
+ void pasteInto(boolean copyit, boolean clone)
42334467 {
42344468 // if (GrafreeD.clipboard == null)
42354469 // return;
....@@ -4258,7 +4492,14 @@
42584492 if (copyit)
42594493 {
42604494 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4495
+ if (clone)
4496
+ {
4497
+ CloneClipboard(false); // sept 2014
4498
+ }
4499
+ else
4500
+ {
4501
+ paste(false);
4502
+ }
42624503 }
42634504 else
42644505 {
....@@ -4468,6 +4709,26 @@
44684709 makeSomething(csg);
44694710 }
44704711
4712
+ void Ungroup(Object3D g)
4713
+ {
4714
+ if (g instanceof HiddenObject)
4715
+ {
4716
+ HiddenObject h = (HiddenObject) g;
4717
+
4718
+ for (int i=0; i<h.ActualSize(); i++)
4719
+ {
4720
+ objEditor.makeSomething(h.get(i), false);
4721
+ }
4722
+ }
4723
+ else
4724
+ {
4725
+ for (int i=0; i<g.Size(); i++)
4726
+ {
4727
+ objEditor.makeSomething(g.get(i), false);
4728
+ }
4729
+ }
4730
+ }
4731
+
44714732 void ungroup()
44724733 {
44734734 /*
....@@ -4782,10 +5043,12 @@
47825043 cButton flashSelectionButton;
47835044 cButton editButton;
47845045 cButton uneditButton;
5046
+ JCheckBox allParamsButton;
47855047 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875048 cButton unselectButton;
47885049
5050
+ cButton oneStepButton;
5051
+
47895052 cButton screenfitButton;
47905053 cButton screenfitpointButton;
47915054 cButton snapobjectButton;
....@@ -4827,6 +5090,7 @@
48275090 private MenuItem resetsupportItem;
48285091 private MenuItem resetreferencesItem;
48295092 private MenuItem linkverticesItem;
5093
+ private MenuItem relinkverticesItem;
48305094 private MenuItem setMasterItem;
48315095 private MenuItem resetMeshItem;
48325096 private MenuItem stepAllItem;
....@@ -4839,14 +5103,17 @@
48395103 private MenuItem mergeGeometriesItem;
48405104 private MenuItem copyItem;
48415105 private MenuItem pasteItem;
5106
+ private MenuItem pasteIntoItem;
48425107 private MenuItem pasteLinkItem;
48435108 private MenuItem pasteCloneItem;
48445109 private MenuItem pasteExpandItem;
48455110 private MenuItem clearItem;
48465111 private MenuItem clearAllItem;
48475112 private MenuItem genUVItem;
5113
+ private MenuItem genNormalsMESHItem;
48485114 private MenuItem genNormalsCADItem;
48495115 private MenuItem genNormalsORGANItem;
5116
+ private MenuItem genNormalsMINEItem;
48505117 private MenuItem stripifyItem;
48515118 private MenuItem unstripifyItem;
48525119 private MenuItem trimItem;
....@@ -4888,6 +5155,7 @@
48885155 private MenuItem resetCentroidItem;
48895156 private MenuItem transformgeometryItem;
48905157 private MenuItem resetTransformItem;
5158
+ private MenuItem hideItem;
48915159 private MenuItem grabItem;
48925160 private MenuItem backItem;
48935161 private MenuItem frontItem;
....@@ -4908,6 +5176,7 @@
49085176
49095177 private MenuItem resetParentItem;
49105178 private MenuItem repairParentItem;
5179
+ private MenuItem repairShadowItem;
49115180 private MenuItem sortbysizeItem;
49125181 private MenuItem sortbynameItem;
49135182
....@@ -4928,10 +5197,11 @@
49285197 private MenuItem coneItem;
49295198 private MenuItem torusItem;
49305199 private MenuItem superItem;
5200
+ private MenuItem kleinItem;
49315201 private MenuItem blobItem;
49325202 private MenuItem latheItem;
49335203 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5204
+ private MenuItem overlayItem;
49355205 private MenuItem meshItem;
49365206 // private MenuItem meshGroupItem;
49375207 private MenuItem springItem;
....@@ -4940,6 +5210,7 @@
49405210 private MenuItem csgItem;
49415211 private MenuItem templateItem;
49425212 private MenuItem textureItem;
5213
+ private MenuItem billboardItem;
49435214 private MenuItem shadowXItem;
49445215 private MenuItem shadowYItem;
49455216 private MenuItem shadowZItem;