Normand Briere
2019-05-05 1e1c7fcdb3d0f8be350c5f6c32b6afa6705168ea
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 {
....@@ -911,11 +994,11 @@
911994 {
912995 loadClipboard(true);
913996 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
997
+ pasteInto(false, false);
915998 } else {
916999 loadClipboard(false);
9171000 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1001
+ pasteInto(false, false); // true); // ???
9191002 }
9201003 }
9211004 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1116,37 @@
10331116 torusItem.addActionListener(this);
10341117 superItem = menu.add(new MenuItem("Superellipsoid"));
10351118 superItem.addActionListener(this);
1119
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1120
+ kleinItem.addActionListener(this);
10361121 particleItem = menu.add(new MenuItem("Particle system"));
10371122 particleItem.addActionListener(this);
1123
+ if (Globals.ADVANCED)
1124
+ {
10381125 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391126 ragdollItem.addActionListener(this);
10401127 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411128 ragdoll2Item.addActionListener(this);
1129
+ }
10421130 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1131
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441132 meshItem.addActionListener(this);
10451133 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461134 // meshGroupItem.addActionListener(this);
1135
+ if (Globals.ADVANCED)
1136
+ {
10471137 springItem = menu.add(new MenuItem("Spring"));
10481138 springItem.addActionListener(this);
10491139 flagItem = menu.add(new MenuItem("Flag"));
10501140 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);
10551141 blobItem = menu.add(new MenuItem("Blob"));
10561142 blobItem.addActionListener(this);
10571143 latheItem = menu.add(new MenuItem("Lathe"));
10581144 latheItem.addActionListener(this);
1145
+ }
1146
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1147
+ bezierItem.addActionListener(this);
1148
+ overlayItem = menu.add(new MenuItem("Overlay"));
1149
+ overlayItem.addActionListener(this);
10591150 lightItem = menu.add(new MenuItem("Light"));
10601151 lightItem.addActionListener(this);
10611152 menu.add("-");
....@@ -1065,34 +1156,39 @@
10651156 loopItem.addActionListener(this);
10661157 doubleItem = menu.add(new MenuItem("Fork"));
10671158 doubleItem.addActionListener(this);
1159
+ if (Globals.ADVANCED)
1160
+ {
10681161 tripleItem = menu.add(new MenuItem("Trident"));
10691162 tripleItem.addActionListener(this);
1163
+ }
10701164 }
10711165
10721166 void buildToolsMenu(Menu menu)
10731167 {
10741168 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751169 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1170
+ animationItem.setState(Globals.ANIMATION);
10771171
10781172 menu.add("-");
10791173 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801174 parseverticesItem.addActionListener(this);
10811175 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821176 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1177
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841178 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871179 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881180 reduceMorphItem.addActionListener(this);
10891181 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901182 reduce34MorphItem.addActionListener(this);
1091
-
1183
+ menu.add("-");
10921184 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931185 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951186
1187
+ if (Globals.ADVANCED)
1188
+ {
1189
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1190
+ mirrorItem.addActionListener(this);
1191
+ menu.add("-");
10961192 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971193 memoryItem.addActionListener(this);
10981194 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1202,8 @@
11061202 resetParentItem.addActionListener(this);
11071203 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081204 repairParentItem.addActionListener(this);
1205
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1206
+ repairShadowItem.addActionListener(this);
11091207 menu.add(invariantsItem = new MenuItem("Invariants"));
11101208 invariantsItem.addActionListener(this);
11111209 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1211,7 @@
11131211 menu.add("-");
11141212 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151213 editScriptItem.addActionListener(this);
1214
+ }
11161215 }
11171216
11181217 void ScreenFit()
....@@ -1466,6 +1565,7 @@
14661565 //
14671566 public void actionPerformed(ActionEvent event) // , Object arg)
14681567 {
1568
+ Object source = event.getSource();
14691569 /*
14701570 if (event.getSource() == nameField)
14711571 {
....@@ -1477,11 +1577,11 @@
14771577 }
14781578 else
14791579 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1580
+ if (source == lookAtItem || source == lookFromItem)
14811581 {
14821582 ScreenFit();
14831583 } else
1484
- if (event.getSource() == switchItem)
1584
+ if (source == switchItem)
14851585 {
14861586 cVector v1 = new cVector();
14871587 cVector v2 = new cVector();
....@@ -1490,11 +1590,11 @@
14901590 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911591 objEditor.cameraView.repaint();
14921592 } else
1493
- if (event.getSource() == rectoidItem)
1593
+ if (source == rectoidItem)
14941594 {
14951595 makeSomething(new Box());
14961596 } else
1497
- if (event.getSource() == particleItem)
1597
+ if (source == particleItem)
14981598 {
14991599 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001600 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1615,9 @@
15151615 applyExample(particleGeom, "SMOKE");
15161616 makeSomething(particleGeom);
15171617 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1618
+ if (source == ragdollItem || source == ragdoll2Item)
15191619 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1620
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211621
15221622 ragdoll.toParent = LA.newMatrix();
15231623 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1635,7 @@
15351635 } else
15361636 /*
15371637 */
1538
- if (event.getSource() == heightFieldItem)
1638
+ if (source == heightFieldItem)
15391639 {
15401640 Object3D obj = new Object3D();
15411641
....@@ -1573,27 +1673,31 @@
15731673
15741674 makeSomething(obj);
15751675 } else
1576
- if (event.getSource() == gridItem)
1676
+ if (source == gridItem)
15771677 {
15781678 makeSomething(new Grid());
15791679 } else
1580
- if (event.getSource() == ellipsoidItem)
1680
+ if (source == ellipsoidItem)
15811681 {
15821682 makeSomething(new Sphere());
15831683 } else
1584
- if (event.getSource() == coneItem)
1684
+ if (source == coneItem)
15851685 {
15861686 makeSomething(new Cone());
15871687 } else
1588
- if (event.getSource() == torusItem)
1688
+ if (source == torusItem)
15891689 {
15901690 makeSomething(new Torus());
15911691 } else
1592
- if (event.getSource() == superItem)
1692
+ if (source == superItem)
15931693 {
15941694 makeSomething(new Superellipsoid());
15951695 } else
1596
- if (event.getSource() == blobItem)
1696
+ if (source == kleinItem)
1697
+ {
1698
+ makeSomething(new Klein());
1699
+ } else
1700
+ if (source == blobItem)
15971701 {
15981702 Blob blob = new Blob();
15991703 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1705,15 @@
16011705 //blob.retile();
16021706 makeSomething(blob);
16031707 } else
1604
- if (event.getSource() == latheItem)
1708
+ if (source == latheItem)
16051709 {
16061710 makeSomething(new Lathe());
16071711 } else
1608
- if (event.getSource() == bezierItem)
1712
+ if (source == bezierItem)
16091713 {
16101714 makeSomething(new BezierSurface());
16111715 } else
1612
- if (event.getSource() == checkerItem)
1716
+ if (source == overlayItem)
16131717 {
16141718 /*
16151719 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1728,7 @@
16241728 */
16251729 makeSomething(new Checker());
16261730 } else
1627
- if (event.getSource() == meshItem)
1731
+ if (source == meshItem)
16281732 {
16291733 Object3D itemtomake = new Object3D();
16301734 Object3D child;
....@@ -1645,35 +1749,35 @@
16451749 makeSomething(child);
16461750 }
16471751 } else
1648
- if (event.getSource() == springItem)
1752
+ if (source == springItem)
16491753 {
16501754 cSpring s = new cSpring();
16511755 s.setup();
16521756 makeSomething(s);
16531757 } else
1654
- if (event.getSource() == flagItem)
1758
+ if (source == flagItem)
16551759 {
16561760 cSpring s = new cFlag();
16571761 s.setup();
16581762 makeSomething(s);
16591763 } else
1660
- if (event.getSource() == lightItem)
1764
+ if (source == lightItem)
16611765 {
16621766 makeSomething(new Light());
16631767 } else
1664
- if (event.getSource() == csgItem)
1768
+ if (source == csgItem)
16651769 {
16661770 group(new CSG());
16671771 } else
1668
- if (event.getSource() == templateItem)
1772
+ if (source == templateItem)
16691773 {
16701774 group(new cTemplate());
16711775 } else
1672
- if (event.getSource() == attributeItem)
1776
+ if (source == attributeItem)
16731777 {
16741778 makeSomething(new Attribute());
16751779 } else
1676
- if (event.getSource() == pointflowItem)
1780
+ if (source == pointflowItem)
16771781 {
16781782 makeSomething(new PointFlow());
16791783 } else
....@@ -1685,7 +1789,7 @@
16851789 } else
16861790 */
16871791
1688
- if (event.getSource() == superLoopItem)
1792
+ if (source == superLoopItem)
16891793 {
16901794 Composite g = new cGroup();
16911795 for (int i=0; i<15; i++)
....@@ -1707,7 +1811,7 @@
17071811
17081812 group(g);
17091813 } else
1710
- if (event.getSource() == loopItem)
1814
+ if (source == loopItem)
17111815 {
17121816 Composite csg = new GroupLeaf();
17131817 csg.count = 5;
....@@ -1716,7 +1820,7 @@
17161820 csg.addChild(child);
17171821 child.addChild(csg);
17181822 } else
1719
- if (event.getSource() == doubleItem)
1823
+ if (source == doubleItem)
17201824 {
17211825 Composite csg = new GroupLeaf();
17221826 csg.count = 5;
....@@ -1728,7 +1832,7 @@
17281832 csg.addChild(child);
17291833 child.addChild(csg);
17301834 } else
1731
- if (event.getSource() == tripleItem)
1835
+ if (source == tripleItem)
17321836 {
17331837 Composite csg = new GroupLeaf();
17341838 csg.count = 4;
....@@ -1744,70 +1848,83 @@
17441848 child.addChild(csg);
17451849 } else
17461850
1747
- if (event.getSource() == importGFDItem)
1851
+ if (source == importGFDItem)
17481852 {
17491853 ImportGFD();
17501854 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1855
+ if (source == importVRMLX3DItem)
17521856 {
17531857 ImportVRMLX3D();
17541858 } else
1755
- if (event.getSource() == import3DSItem)
1859
+ if (source == import3DSItem)
17561860 {
17571861 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581862 } else
1759
- if (event.getSource() == importOBJItem)
1863
+ if (source == importOBJItem)
17601864 {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1865
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
+ browser.setVisible(true);
1868
+ String filename = browser.getFile();
1869
+ if (filename != null && filename.length() > 0)
1870
+ {
1871
+ String fullname = browser.getDirectory() + filename;
1872
+ makeSomething(ReadOBJ(fullname), true);
1873
+ }
17621874 } else
1763
- if (event.getSource() == computeAOItem)
1875
+ if (source == computeAOItem)
17641876 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1877
+ Globals.drawMode = CameraPane.OCCLUSION;
1878
+ Globals.theRenderer.repaint();
17671879 } else
1768
- if (event.getSource() == recompileItem)
1880
+ if (source == recompileItem)
17691881 {
17701882 Recompile();
17711883 refreshContents();
17721884 } else
1773
- if (event.getSource() == editScriptItem)
1885
+ if (source == editScriptItem)
17741886 {
17751887 OpenDialog();
17761888 refreshContents();
17771889 } else
1778
- if (event.getSource() == invariantsItem)
1890
+ if (source == invariantsItem)
17791891 {
17801892 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1893
+ GrafreeD.grafreeD.universe.invariants();
17821894 } else
1783
- if (event.getSource() == memoryItem)
1895
+ if (source == memoryItem)
17841896 {
17851897 //System.out.println("Invariants:");
17861898 PrintMemory();
17871899 } else
1788
- if (event.getSource() == pathItem)
1900
+ if (source == pathItem)
17891901 {
17901902 PrintPath();
17911903 } else
1792
- if (event.getSource() == analyzeItem)
1904
+ if (source == analyzeItem)
17931905 {
17941906 AnalyzeObject();
17951907 } else
1796
- if (event.getSource() == dumpItem)
1908
+ if (source == dumpItem)
17971909 {
17981910 DumpObject();
17991911 } else
1800
- if (event.getSource() == screenfitButton)
1912
+ if (source == oneStepButton)
1913
+ {
1914
+ Globals.ONESTEP = true;
1915
+ cameraView.repaint();
1916
+ } else
1917
+ if (source == screenfitButton)
18011918 {
18021919 //Reload(lastConverter, lastFilename, true);
18031920 ScreenFit();
18041921 } else
1805
- if (event.getSource() == screenfitpointButton)
1922
+ if (source == screenfitpointButton)
18061923 {
18071924 //Reload(lastConverter, lastFilename, true);
18081925 ScreenFitPoint();
18091926 } else
1810
- if (event.getSource() == snapobjectButton)
1927
+ if (source == snapobjectButton)
18111928 {
18121929 //Reload(lastConverter, lastFilename, true);
18131930 SnapObject();
....@@ -1818,13 +1935,13 @@
18181935 // Recompile();
18191936 // refreshContents();
18201937 // } else
1821
- if (event.getSource() == gcButton)
1938
+ if (source == gcButton)
18221939 {
18231940 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241941 System.gc();
18251942 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261943 } else
1827
- if (event.getSource() == editLeafItem)
1944
+ if (source == editLeafItem)
18281945 {
18291946 Object3D obj;
18301947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1955,66 @@
18381955 }
18391956 refreshContents(true);
18401957 } else
1841
- if (event.getSource() == openWindowItem)
1958
+ if (source == openWindowItem)
18421959 {
18431960 EditSelection(true);
18441961 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1962
+ if (source == cutItem || source == clearButton)
18461963 {
18471964 loadClipboard(true);
18481965 } else
1849
- if (event.getSource() == duplicateItem)
1966
+ if (source == duplicateItem)
18501967 {
18511968 Object3D keep = GrafreeD.clipboard;
18521969 loadClipboard(false);
18531970 paste(false);
18541971 GrafreeD.clipboard = keep;
18551972 } else
1856
- if (event.getSource() == cloneItem)
1973
+ if (source == cloneItem)
18571974 {
18581975 CloneSelection(false);
18591976 } else
1860
- if (event.getSource() == cloneSupportItem)
1977
+ if (source == cloneSupportItem)
18611978 {
18621979 CloneSelection(true);
18631980 } else
1864
- if (event.getSource() == copyItem)
1981
+ if (source == copyItem)
18651982 {
18661983 loadClipboard(false);
18671984 } else
1868
- if (event.getSource() == pasteItem)
1985
+ if (source == pasteItem)
18691986 {
18701987 paste(false);
18711988 } else
1872
- if (event.getSource() == pasteLinkItem)
1989
+ if (source == pasteIntoItem)
18731990 {
1874
- pasteInto(false);
1991
+ pasteInto(true, false);
18751992 } else
1876
- if (event.getSource() == pasteCloneItem)
1993
+ if (source == pasteLinkItem)
18771994 {
1878
- pasteInto(true);
1995
+ pasteInto(false, false);
18791996 } else
1880
- if (event.getSource() == pasteExpandItem)
1997
+ if (source == pasteCloneItem)
1998
+ {
1999
+ pasteInto(true, true);
2000
+ } else
2001
+ if (source == pasteExpandItem)
18812002 {
18822003 paste(true);
18832004 } else
1884
- if (event.getSource() == synchronizeItem)
2005
+ if (source == synchronizeItem)
18852006 {
18862007 Overwrite(Object3D.TRANSFORM);
18872008 } else
1888
- if (event.getSource() == overwriteNameItem)
2009
+ if (source == overwriteNameItem)
18892010 {
18902011 Overwrite(Object3D.NAME);
18912012 } else
1892
- if (event.getSource() == overwriteUVItem)
2013
+ if (source == overwriteUVItem)
18932014 {
18942015 Overwrite(Object3D.UV);
18952016 } else
1896
- if (event.getSource() == overwriteMatItem)
2017
+ if (source == overwriteMatItem)
18972018 {
18982019 /* july 2015
18992020 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2034,7 @@
19132034
19142035 Overwrite(dropAttributes);
19152036 }
1916
- if (event.getSource() == overwriteGeoItem)
2037
+ if (source == overwriteGeoItem)
19172038 {
19182039 Overwrite(Object3D.GEOMETRY);
19192040 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2051,7 @@
19302051 // refreshContents();
19312052 // }
19322053 } else
1933
- if (event.getSource() == generateMeshItem)
2054
+ if (source == generateMeshItem)
19342055 {
19352056 //if (group.selection.size() == 1)
19362057 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2062,7 @@
19412062 ResetModel();
19422063 refreshContents();
19432064 } else
1944
- if (event.getSource() == extractGeometriesItem)
2065
+ if (source == extractGeometriesItem)
19452066 {
19462067 boolean one = false;
19472068
....@@ -1968,7 +2089,7 @@
19682089 ResetModel();
19692090 refreshContents();
19702091 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2092
+ if (source == cloneGeometriesItem)
19722093 {
19732094 boolean one = false;
19742095
....@@ -1994,32 +2115,37 @@
19942115 ResetModel();
19952116 refreshContents();
19962117 } else
1997
- if (event.getSource() == shareGeometriesItem)
2118
+ if (source == shareGeometriesItem)
19982119 {
19992120 boolean one = false;
20002121
20012122 if (group.selection.size() == 1)
20022123 one = true;
20032124
2125
+ Object3D merge = null;
2126
+
20042127 Object3D content = new cGroup();
20052128
20062129 for (int i=0; i<group.selection.size(); i++)
20072130 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2131
+ merge = new Merge(group.selection.get(i));
20092132
20102133 if (one)
2011
- makeSomething(sel, false);
2134
+ makeSomething(merge, false);
20122135 else
2013
- content.addChild(sel);
2136
+ content.addChild(merge);
20142137 }
20152138
20162139 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2140
+ makeSomething(content, true);
2141
+ else
2142
+ {
2143
+ ResetModel();
2144
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2145
+ refreshContents();
2146
+ }
20212147 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2148
+ if (source == mergeGeometriesItem)
20232149 {
20242150 boolean one = false;
20252151
....@@ -2049,7 +2175,7 @@
20492175 ResetModel();
20502176 refreshContents();
20512177 } else
2052
- if (event.getSource() == linkverticesItem)
2178
+ if (source == linkverticesItem)
20532179 {
20542180 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552181 // {
....@@ -2069,32 +2195,41 @@
20692195 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702196 content = ((cGroup)content).get(0);
20712197
2072
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2198
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20732199 for (int i=0; i<group.selection.size(); i++)
20742200 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2201
+ boolean random = CameraPane.SWITCH;
2202
+ CameraPane.SWITCH = false; // parse all random nodes
20772203 group.selection.get(i).linkVerticesThis(content);
20782204 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2205
+ CameraPane.SWITCH = random;
20802206 }
2081
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2207
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20822208 refreshContents();
20832209 }
20842210 } else
2085
- if (event.getSource() == resetsupportItem)
2211
+ if (source == resetsupportItem)
20862212 {
20872213 for (int i=0; i<group.selection.size(); i++)
20882214 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2215
+ boolean random = CameraPane.SWITCH;
2216
+ CameraPane.SWITCH = false; // parse all random nodes
20912217 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2218
+ CameraPane.SWITCH = random;
20932219 }
20942220
20952221 refreshContents();
20962222 } else
2097
- if (event.getSource() == resetreferencesItem)
2223
+ if (source == relinkverticesItem)
2224
+ {
2225
+ boolean random = CameraPane.SWITCH;
2226
+ CameraPane.SWITCH = false; // parse all random nodes
2227
+ group.selection.RelinkToSupport();
2228
+ CameraPane.SWITCH = random;
2229
+
2230
+ refreshContents();
2231
+ } else
2232
+ if (source == resetreferencesItem)
20982233 {
20992234 for (int i=0; i<group.selection.size(); i++)
21002235 {
....@@ -2103,7 +2238,7 @@
21032238
21042239 refreshContents();
21052240 } else
2106
- if (event.getSource() == setMasterItem)
2241
+ if (source == setMasterItem)
21072242 {
21082243 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21092244 {
....@@ -2116,7 +2251,7 @@
21162251 refreshContents();
21172252 }
21182253 } else
2119
- if (event.getSource() == poseMeshItem)
2254
+ if (source == poseMeshItem)
21202255 {
21212256 if (group.selection.size() == 1)
21222257 {
....@@ -2135,19 +2270,19 @@
21352270 }
21362271
21372272 } else
2138
- if (event.getSource() == revertMeshItem)
2273
+ if (source == revertMeshItem)
21392274 {
21402275 RevertMeshes();
21412276 } else
2142
- if (event.getSource() == resetMeshItem)
2277
+ if (source == resetMeshItem)
21432278 {
21442279 ResetAll();
21452280 } else
2146
- if (event.getSource() == stepAllItem)
2281
+ if (source == stepAllItem)
21472282 {
21482283 StepAll();
21492284 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2285
+ if (source == clearItem) // || event.getSource() == clearButton)
21512286 {
21522287 //int indices[] = jList.getSelectedIndices();
21532288 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2290,46 @@
21552290
21562291 ClearSelection(false);
21572292 } else
2158
- if (event.getSource() == clearAllItem)
2293
+ if (source == clearAllItem)
21592294 {
21602295 ClearSelection(true);
21612296 } else
2162
- if (event.getSource() == grabItem)
2297
+ if (source == grabItem)
21632298 {
21642299 group(new cGroup(), true);
21652300 } else
2166
- if (event.getSource() == frontItem)
2301
+ if (source == hideItem)
2302
+ {
2303
+ group(new HiddenObject());
2304
+ } else
2305
+ if (source == frontItem)
21672306 {
21682307 front();
21692308 } else
2170
- if (event.getSource() == backItem)
2309
+ if (source == backItem)
21712310 {
21722311 back();
21732312 } else
2174
- if (event.getSource() == cameraItem)
2313
+ if (source == cameraItem)
21752314 {
21762315 makeSomething(new Camera());
21772316 } else
2178
- if (event.getSource() == compositeItem)
2317
+ if (source == compositeItem)
21792318 {
21802319 group(new Composite());
21812320 } else
2182
- if (event.getSource() == randomItem)
2321
+ if (source == randomItem)
21832322 {
21842323 RandomNode random = new RandomNode();
21852324 group(random);
21862325 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2326
+ random.name = random.get(0).name + "Switch";
21882327 } else
2189
- if (event.getSource() == physicsItem)
2328
+ if (source == physicsItem)
21902329 {
21912330 group(new PhysicsNode());
21922331 } else
2193
- if (event.getSource() == frameselectorItem)
2332
+ if (source == frameselectorItem)
21942333 {
21952334 for (int i=0; i<group.selection.size(); i++)
21962335 {
....@@ -2202,7 +2341,7 @@
22022341 ResetModel();
22032342 refreshContents();
22042343 } else
2205
- if (event.getSource() == switchGeoItem)
2344
+ if (source == switchGeoItem)
22062345 {
22072346 for (int i=0; i<group.selection.size(); i++)
22082347 {
....@@ -2214,7 +2353,7 @@
22142353 ResetModel();
22152354 refreshContents();
22162355 } else
2217
- if (event.getSource() == switchTransfoItem)
2356
+ if (source == switchTransfoItem)
22182357 {
22192358 for (int i=0; i<group.selection.size(); i++)
22202359 {
....@@ -2226,7 +2365,7 @@
22262365 ResetModel();
22272366 refreshContents();
22282367 } else
2229
- if (event.getSource() == morphItem)
2368
+ if (source == morphItem)
22302369 {
22312370 for (int i=0; i<group.selection.size(); i++)
22322371 {
....@@ -2238,7 +2377,7 @@
22382377 ResetModel();
22392378 refreshContents();
22402379 } else
2241
- if (event.getSource() == scriptNodeItem)
2380
+ if (source == scriptNodeItem)
22422381 {
22432382 boolean atleastone = false;
22442383
....@@ -2277,195 +2416,215 @@
22772416 }
22782417 }
22792418 } else
2280
- if (event.getSource() == linkerItem)
2419
+ if (source == linkerItem)
22812420 {
22822421 group(new cLinker());
22832422 } else
2284
- if (event.getSource() == textureItem)
2423
+ if (source == textureItem)
22852424 {
22862425 group(new TextureNode());
22872426 } else
2288
- if (event.getSource() == shadowXItem)
2427
+ if (source == billboardItem)
2428
+ {
2429
+ group(new BillboardNode());
2430
+ } else
2431
+ if (source == shadowXItem)
22892432 {
22902433 CastShadow(0);
22912434 } else
2292
- if (event.getSource() == shadowYItem)
2435
+ if (source == shadowYItem)
22932436 {
22942437 CastShadow(1);
22952438 } else
2296
- if (event.getSource() == shadowZItem)
2439
+ if (source == shadowZItem)
22972440 {
22982441 CastShadow(2);
22992442 } else
2300
- if (event.getSource() == ungroupItem)
2443
+ if (source == ungroupItem)
23012444 {
2302
- ungroup();
2445
+ //ungroup();
2446
+ for (int i=0; i<group.selection.size(); i++)
2447
+ {
2448
+ Ungroup(group.selection.get(i));
2449
+ }
2450
+
2451
+ ClearSelection(false);
2452
+
2453
+ refreshContents();
23032454 } else
2304
- if (event.getSource() == genUVItem)
2455
+ if (source == genUVItem)
23052456 {
23062457 GenUV();
23072458 } else
2308
- if (event.getSource() == genNormalsCADItem)
2459
+ if (source == genNormalsCADItem)
23092460 {
23102461 GenNormals(true);
23112462 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2463
+ if (source == genNormalsMESHItem)
2464
+ {
2465
+ GenNormals(true); // TODO
2466
+ } else
2467
+ if (source == genNormalsORGANItem)
23132468 {
23142469 GenNormals(false);
23152470 } else
2316
- if (event.getSource() == stripifyItem)
2471
+ if (source == genNormalsMINEItem)
2472
+ {
2473
+ GenNormalsMINE();
2474
+ } else
2475
+ if (source == stripifyItem)
23172476 {
23182477 Stripify();
23192478 } else
2320
- if (event.getSource() == unstripifyItem)
2479
+ if (source == unstripifyItem)
23212480 {
23222481 Unstripify();
23232482 } else
2324
- if (event.getSource() == trimItem)
2483
+ if (source == trimItem)
23252484 {
23262485 Trim();
23272486 } else
2328
- if (event.getSource() == untrimItem)
2487
+ if (source == untrimItem)
23292488 {
23302489 Untrim();
23312490 } else
2332
- if (event.getSource() == clearColorsItem)
2491
+ if (source == clearColorsItem)
23332492 {
23342493 ClearColors();
23352494 } else
2336
- if (event.getSource() == clearMaterialsItem)
2495
+ if (source == clearMaterialsItem)
23372496 {
23382497 ClearMaterials();
23392498 } else
2340
- if (event.getSource() == liveleavesItem)
2499
+ if (source == liveleavesItem)
23412500 {
23422501 LiveLeaves(true);
23432502 } else
2344
- if (event.getSource() == unliveleavesItem)
2503
+ if (source == unliveleavesItem)
23452504 {
23462505 LiveLeaves(false);
23472506 } else
2348
- if (event.getSource() == supportleavesItem)
2507
+ if (source == supportleavesItem)
23492508 {
23502509 SupportLeaves(true);
23512510 } else
2352
- if (event.getSource() == unsupportleavesItem)
2511
+ if (source == unsupportleavesItem)
23532512 {
23542513 SupportLeaves(false);
23552514 } else
2356
- if (event.getSource() == hideleavesItem)
2515
+ if (source == hideleavesItem)
23572516 {
23582517 HideLeaves(true);
23592518 } else
2360
- if (event.getSource() == showleavesItem)
2519
+ if (source == showleavesItem)
23612520 {
23622521 HideLeaves(false);
23632522 } else
2364
- if (event.getSource() == markleavesItem)
2523
+ if (source == markleavesItem)
23652524 {
23662525 MarkLeaves(true);
23672526 } else
2368
- if (event.getSource() == unmarkleavesItem)
2527
+ if (source == unmarkleavesItem)
23692528 {
23702529 MarkLeaves(false);
23712530 } else
2372
- if (event.getSource() == flipVItem)
2531
+ if (source == flipVItem)
23732532 {
23742533 FlipV(true);
23752534 } else
2376
- if (event.getSource() == unflipVItem)
2535
+ if (source == unflipVItem)
23772536 {
23782537 FlipV(false);
23792538 } else
2380
- if (event.getSource() == lowTexturesItem)
2539
+ if (source == lowTexturesItem)
23812540 {
23822541 SetTexRes(0);
23832542 } else
2384
- if (event.getSource() == normalTexturesItem)
2543
+ if (source == normalTexturesItem)
23852544 {
23862545 SetTexRes(1);
23872546 } else
2388
- if (event.getSource() == highTexturesItem)
2547
+ if (source == highTexturesItem)
23892548 {
23902549 SetTexRes(2);
23912550 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2551
+ if (source == veryhighTexturesItem)
23932552 {
23942553 SetTexRes(3);
23952554 } else
2396
- if (event.getSource() == maxTexturesItem)
2555
+ if (source == maxTexturesItem)
23972556 {
23982557 SetTexRes(4);
23992558 } else
2400
- if (event.getSource() == panoTexturesItem)
2559
+ if (source == panoTexturesItem)
24012560 {
24022561 SetTexRes(5);
24032562 } else
2404
- if (event.getSource() == reverseNormalsItem)
2563
+ if (source == reverseNormalsItem)
24052564 {
24062565 ReverseNormals();
24072566 } else
2408
- if (event.getSource() == parseverticesItem)
2567
+ if (source == parseverticesItem)
24092568 {
24102569 ParseVertices();
24112570 } else
2412
- if (event.getSource() == textureFieldItem)
2571
+ if (source == textureFieldItem)
24132572 {
24142573 TextureVertices();
24152574 } else
2416
- if (event.getSource() == alignItem)
2575
+ if (source == alignItem)
24172576 {
24182577 Align();
24192578 } else
2420
- if (event.getSource() == mirrorItem)
2579
+ if (source == mirrorItem)
24212580 {
24222581 MirrorPoses();
24232582 } else
2424
- if (event.getSource() == reduceMorphItem)
2583
+ if (source == reduceMorphItem)
24252584 {
24262585 MeshReduction(false);
24272586 } else
2428
- if (event.getSource() == reduce34MorphItem)
2587
+ if (source == reduce34MorphItem)
24292588 {
24302589 MeshReduction(true);
24312590 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2591
+ if (source == reverseTrianglesItem)
24332592 {
24342593 ReverseTriangles();
24352594 } else
2436
- if (event.getSource() == reduceMeshItem)
2595
+ if (source == reduceMeshItem)
24372596 {
24382597 ReduceMesh(false);
24392598 } else
2440
- if (event.getSource() == reduce34MeshItem)
2599
+ if (source == reduce34MeshItem)
24412600 {
24422601 ReduceMesh(true);
24432602 } else
2444
- if (event.getSource() == increaseMeshItem)
2603
+ if (source == increaseMeshItem)
24452604 {
24462605 IncreaseMesh();
24472606 } else
2448
- if (event.getSource() == clipMeshItem)
2607
+ if (source == clipMeshItem)
24492608 {
24502609 ClipMesh();
24512610 } else
2452
- if (event.getSource() == smoothMeshItem)
2611
+ if (source == smoothMeshItem)
24532612 {
24542613 SmoothMesh();
24552614 } else
2456
- if (event.getSource() == transformgeometryItem)
2615
+ if (source == transformgeometryItem)
24572616 {
24582617 TransformGeometry();
24592618 } else
2460
- if (event.getSource() == resetTransformItem)
2619
+ if (source == resetTransformItem)
24612620 {
24622621 ResetTransform();
24632622 } else
2464
- if (event.getSource() == resetCentroidItem)
2623
+ if (source == resetCentroidItem)
24652624 {
24662625 ResetCentroid();
24672626 } else
2468
- if (event.getSource() == resetParentItem)
2627
+ if (source == resetParentItem)
24692628 {
24702629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712630 {
....@@ -2475,7 +2634,7 @@
24752634
24762635 refreshContents();
24772636 } else
2478
- if (event.getSource() == repairParentItem)
2637
+ if (source == repairParentItem)
24792638 {
24802639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812640 {
....@@ -2489,7 +2648,21 @@
24892648
24902649 refreshContents();
24912650 } else
2492
- if (event.getSource() == sortbysizeItem)
2651
+ if (source == repairShadowItem)
2652
+ {
2653
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2654
+ {
2655
+ Object3D obj = (Object3D)e.nextElement();
2656
+ obj.RepairShadow();
2657
+// for (int i=0; i<obj.size(); i++)
2658
+// {
2659
+// obj.get(i).parent = obj;
2660
+// }
2661
+ }
2662
+
2663
+ refreshContents();
2664
+ } else
2665
+ if (source == sortbysizeItem)
24932666 {
24942667 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952668 {
....@@ -2501,7 +2674,7 @@
25012674 ResetModel();
25022675 refreshContents();
25032676 } else
2504
- if (event.getSource() == sortbynameItem)
2677
+ if (source == sortbynameItem)
25052678 {
25062679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072680 {
....@@ -2513,7 +2686,7 @@
25132686 ResetModel();
25142687 refreshContents();
25152688 } else
2516
- if (event.getSource() == attachPigmentItem)
2689
+ if (source == attachPigmentItem)
25172690 {
25182691 String texture = GetFile("Attach pigment");
25192692 Object3D obj;
....@@ -2525,7 +2698,7 @@
25252698
25262699 refreshContents();
25272700 } else
2528
- if (event.getSource() == detachPigmentItem)
2701
+ if (source == detachPigmentItem)
25292702 {
25302703 Object3D obj;
25312704 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2709,7 @@
25362709
25372710 refreshContents();
25382711 } else
2539
- if (event.getSource() == attachBumpItem)
2712
+ if (source == attachBumpItem)
25402713 {
25412714 String texture = GetFile("Attach bump");
25422715 Object3D obj;
....@@ -2548,7 +2721,7 @@
25482721
25492722 refreshContents();
25502723 } else
2551
- if (event.getSource() == detachBumpItem)
2724
+ if (source == detachBumpItem)
25522725 {
25532726 Object3D obj;
25542727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2732,7 @@
25592732
25602733 refreshContents();
25612734 } else
2562
- if (event.getSource() == pigmentBumpItem)
2735
+ if (source == pigmentBumpItem)
25632736 {
25642737 Object3D obj;
25652738 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2743,195 @@
25702743
25712744 refreshContents();
25722745 } else
2573
- if (event.getSource() == flashSelectionButton)
2746
+ if (source == flashSelectionButton)
25742747 {
25752748 CameraPane.flash = true;
25762749 refreshContents();
25772750 } else
2578
- if (event.getSource() == oneButton)
2751
+ if (source == oneButton)
25792752 {
25802753 } else
2581
- if (event.getSource() == twoButton)
2754
+ if (source == twoButton)
25822755 {
25832756 radio.layout = twoButton;
25842757 // bug
25852758 //gridPanel.setDividerLocation(1.0);
25862759 //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();
2760
+// bigThree.remove(scenePanel);
2761
+// bigThree.remove(centralPanel);
2762
+// bigThree.remove(XYZPanel);
2763
+// aWindowConstraints.gridx = 0;
2764
+// aWindowConstraints.gridy = 0;
2765
+// aWindowConstraints.gridwidth = 1;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2768
+// aWindowConstraints.weightx = 0;
2769
+// aWindowConstraints.weighty = 1;
2770
+// //bigThree.add(jtp, aWindowConstraints);
2771
+// aWindowConstraints.weightx = 1;
2772
+// aWindowConstraints.gridwidth = 3;
2773
+// // aConstraints.gridheight = 3;
2774
+// aWindowConstraints.gridx = 1;
2775
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2776
+// bigThree.add(centralPanel, aWindowConstraints);
2777
+// aWindowConstraints.weightx = 0;
2778
+// aWindowConstraints.gridx = 4;
2779
+// aWindowConstraints.gridwidth = 1;
2780
+// // aConstraints.gridheight = 3;
2781
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2782
+// //bigThree.add(XYZPanel, aWindowConstraints);
2783
+// scenePanel.setVisible(false);
2784
+// centralPanel.setVisible(true);
2785
+// XYZPanel.setVisible(false);
2786
+ bigThree.ClearUI();
2787
+ bigThree.add(centralPanel);
2788
+ bigThree.FlushUI();
26112789 } else
2612
- if (event.getSource() == threeButton)
2790
+ if (source == threeButton)
26132791 {
26142792 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();
2793
+
2794
+// bigThree.remove(scenePanel);
2795
+// bigThree.remove(centralPanel);
2796
+// bigThree.remove(XYZPanel);
2797
+// aWindowConstraints.gridx = 0;
2798
+// aWindowConstraints.gridy = 0;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// aWindowConstraints.weightx = 0;
2803
+// aWindowConstraints.weighty = 1;
2804
+// //bigThree.add(jtp, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 1;
2806
+// aWindowConstraints.gridwidth = 3;
2807
+// // aConstraints.gridheight = 3;
2808
+// aWindowConstraints.gridx = 1;
2809
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2810
+// bigThree.add(centralPanel, aWindowConstraints);
2811
+// aWindowConstraints.weightx = 0;
2812
+// aWindowConstraints.gridx = 4;
2813
+// aWindowConstraints.gridwidth = 1;
2814
+// // aConstraints.gridheight = 3;
2815
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2816
+// bigThree.add(XYZPanel, aWindowConstraints);
2817
+// bigThree.validate();
2818
+// scenePanel.setVisible(false);
2819
+// centralPanel.setVisible(true);
2820
+// XYZPanel.setVisible(true);
2821
+ bigThree.ClearUI();
2822
+ bigThree.add(centralPanel);
2823
+ bigThree.add(XYZPanel);
2824
+ bigThree.FlushUI();
26392825 } else
2640
- if (event.getSource() == fourButton)
2826
+ if (source == fourButton)
26412827 {
26422828 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();
2829
+
2830
+// bigThree.remove(scenePanel);
2831
+// bigThree.remove(centralPanel);
2832
+// bigThree.remove(XYZPanel);
2833
+// aWindowConstraints.gridx = 0;
2834
+// aWindowConstraints.gridy = 0;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aWindowConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2838
+// aWindowConstraints.weightx = 1;
2839
+// aWindowConstraints.weighty = 1;
2840
+// bigThree.add(scenePanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 1;
2842
+// aWindowConstraints.gridwidth = 3;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.gridx = 1;
2845
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2846
+// //bigThree.add(cameraPanel, aWindowConstraints);
2847
+// aWindowConstraints.weightx = 0;
2848
+// aWindowConstraints.gridx = 4;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aWindowConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// //bigThree.add(XYZPanel, aWindowConstraints);
2853
+// bigThree.validate();
2854
+// scenePanel.setVisible(true);
2855
+// centralPanel.setVisible(false);
2856
+// XYZPanel.setVisible(false);
2857
+ bigThree.ClearUI();
2858
+ bigThree.add(scenePanel);
2859
+ bigThree.FlushUI();
26672860 } else
2668
- if (event.getSource() == sixButton)
2861
+ if (source == sixButton)
26692862 {
26702863 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();
2864
+
2865
+// bigThree.remove(scenePanel);
2866
+// bigThree.remove(centralPanel);
2867
+// bigThree.remove(XYZPanel);
2868
+// aWindowConstraints.gridx = 0;
2869
+// aWindowConstraints.gridy = 0;
2870
+// aWindowConstraints.gridwidth = 1;
2871
+// // aConstraints.gridheight = 3;
2872
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2873
+// aWindowConstraints.weightx = 0;
2874
+// aWindowConstraints.weighty = 1;
2875
+// bigThree.add(scenePanel, aWindowConstraints);
2876
+// aWindowConstraints.weightx = 1;
2877
+// aWindowConstraints.gridwidth = 3;
2878
+// // aWindowConstraints.gridheight = 3;
2879
+// aWindowConstraints.gridx = 1;
2880
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2881
+// bigThree.add(centralPanel, aWindowConstraints);
2882
+// aWindowConstraints.weightx = 0;
2883
+// aWindowConstraints.gridx = 4;
2884
+// aWindowConstraints.gridwidth = 1;
2885
+// // aWindowConstraints.gridheight = 3;
2886
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2887
+// //bigThree.add(XYZPanel, aConstraints);
2888
+// bigThree.validate();
2889
+// scenePanel.setVisible(true);
2890
+// centralPanel.setVisible(true);
2891
+// XYZPanel.setVisible(false);
2892
+ bigThree.ClearUI();
2893
+ bigThree.add(scenePanel);
2894
+ bigThree.add(centralPanel);
2895
+ bigThree.FlushUI();
26952896 } else
2696
- if (event.getSource() == sevenButton)
2897
+ if (source == sevenButton)
26972898 {
26982899 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();
2900
+
2901
+// bigThree.remove(scenePanel);
2902
+// bigThree.remove(centralPanel);
2903
+// bigThree.remove(XYZPanel);
2904
+// aWindowConstraints.gridx = 0;
2905
+// aWindowConstraints.gridy = 0;
2906
+// aWindowConstraints.gridwidth = 1;
2907
+// // aWindowConstraints.gridheight = 3;
2908
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2909
+// aWindowConstraints.weightx = 0;
2910
+// aWindowConstraints.weighty = 1;
2911
+// bigThree.add(scenePanel, aWindowConstraints);
2912
+// aWindowConstraints.weightx = 1;
2913
+// aWindowConstraints.gridwidth = 3;
2914
+// // aWindowConstraints.gridheight = 3;
2915
+// aWindowConstraints.gridx = 1;
2916
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2917
+// bigThree.add(centralPanel, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 0;
2919
+// aWindowConstraints.gridx = 4;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// bigThree.add(XYZPanel, aWindowConstraints);
2924
+// bigThree.validate();
2925
+// scenePanel.setVisible(true);
2926
+// centralPanel.setVisible(true);
2927
+// XYZPanel.setVisible(true);
2928
+ bigThree.ClearUI();
2929
+ bigThree.add(scenePanel);
2930
+ bigThree.add(centralPanel);
2931
+ bigThree.add(XYZPanel);
2932
+ bigThree.FlushUI();
27232933 } else
2724
- if (event.getSource() == rootButton)
2934
+ if (source == rootButton)
27252935 {
27262936 Object3D obj;
27272937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2943,7 @@
27332943
27342944 refreshContents(true);
27352945 } else
2736
- if (event.getSource() == closeButton)
2946
+ if (source == closeButton)
27372947 {
27382948 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392949 cRadio ab;
....@@ -2754,11 +2964,11 @@
27542964 }
27552965 refreshContents(true);
27562966 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
2967
+ if (source == editItem || source == editButton)
27582968 {
27592969 EditSelection(false);
27602970 } else
2761
- if (event.getSource() == uneditButton)
2971
+ if (source == uneditButton)
27622972 {
27632973 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27642974 {
....@@ -2770,12 +2980,12 @@
27702980
27712981 child.editWindow = null; // ???????????
27722982 }
2773
- objEditor.ctrlPanel.revalidate();
2983
+ objEditor.ctrlPanel.FlushUI();
27742984 //objEditor.jTree.clearSelection();
27752985 //objEditor.ResetSliders();
27762986 refreshContents(true);
27772987 } else
2778
- if (event.getSource() == clearPanelButton)
2988
+ if (source == clearPanelButton)
27792989 {
27802990 assert(copy == group);
27812991 //copy.ClearUI();
....@@ -2786,7 +2996,7 @@
27862996 listUI.clear();
27872997 refreshContents(true);
27882998 } else
2789
- if (event.getSource() == allParamsButton)
2999
+ if (source == allParamsButton)
27903000 {
27913001 assert(copy == group);
27923002
....@@ -2807,19 +3017,19 @@
28073017
28083018 refreshContents(true);
28093019 } else
2810
- if (event.getSource() == unselectButton)
3020
+ if (source == unselectButton)
28113021 {
28123022 objEditor.jTree.clearSelection();
28133023 // ?? oct 2012 GrafreeD.clipboard.clear();
28143024 objEditor.ResetSliders();
28153025 refreshContents(true);
28163026 } else
2817
- if(event.getSource() instanceof cRadio)
3027
+ if(source instanceof cRadio)
28183028 {
28193029 group.parent = keepparent;
28203030 group.attributes = 0;
28213031 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3032
+ /*cRadio*/ radio = (cRadio)source;
28233033 Object3D obj = radio.GetObject();
28243034 System.out.println("Edit " + obj);
28253035 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3049,7 @@
28393049 }
28403050
28413051 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3052
+ //Globals.theRenderer.object = group;
28433053 if(!useclient)
28443054 {
28453055 cameraView.renderCamera = radio.camera;
....@@ -2848,7 +3058,8 @@
28483058 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493059 cameraView.targetLookAt.set(radio.camera.lookAt);
28503060 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3061
+ //cameraView.lighttouched = true;
3062
+ Globals.lighttouched = true;
28523063 topView.object = group;
28533064 frontView.object = group;
28543065 sideView.object = group;
....@@ -2884,7 +3095,7 @@
28843095 if (useclient)
28853096 {
28863097 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3098
+ Globals.lighttouched = true;
28883099 //topView.object = client;
28893100 //frontView.object = client;
28903101 //sideView.object = client;
....@@ -2892,7 +3103,7 @@
28923103 else
28933104 {
28943105 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3106
+ Globals.lighttouched = true;
28963107 //topView.object = group;
28973108 //frontView.object = group;
28983109 //sideView.object = group;
....@@ -3173,6 +3384,13 @@
31733384 refreshContents();
31743385 }
31753386
3387
+ void GenNormalsMINE()
3388
+ {
3389
+ group.selection.GenNormalsMINE();
3390
+
3391
+ refreshContents();
3392
+ }
3393
+
31763394 void Stripify()
31773395 {
31783396 group.StripifyS();
....@@ -3393,7 +3611,7 @@
33933611 String pigment = Object3D.GetPigment(tex);
33943612 //String bump = Object3D.GetBump(tex);
33953613
3396
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3614
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33973615
33983616 double s = v.s;
33993617
....@@ -3441,12 +3659,26 @@
34413659
34423660 void Align()
34433661 {
3662
+ if (group.selection.size() == 0)
3663
+ return;
3664
+
3665
+ cVector bbmin = new cVector();
3666
+ cVector bbmax = new cVector();
3667
+
3668
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3669
+
3670
+ double dx = bbmax.x - bbmin.x;
3671
+ double dy = bbmax.y - bbmin.y;
3672
+ double dz = bbmax.z - bbmin.z;
3673
+
3674
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3675
+
34443676 for (int i=0; i<group.selection.size(); i++)
34453677 {
34463678 Object3D obj = group.selection.get(i);
34473679
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3680
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3681
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503682 }
34513683
34523684 refreshContents();
....@@ -3467,11 +3699,11 @@
34673699
34683700 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693701
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3702
+ boolean random = CameraPane.SWITCH;
3703
+ CameraPane.SWITCH = false; // parse all random nodes
34723704 lowres.linkVerticesThis(null);
34733705 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3706
+ CameraPane.SWITCH = random;
34753707
34763708 System.err.flush();
34773709
....@@ -3680,7 +3912,7 @@
36803912 group.selection.RelinkToSupport(); // july 2014
36813913 System.out.println("DONE.");
36823914 refreshContents();
3683
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3915
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36843916 }
36853917
36863918 void ReduceMesh(boolean reduction34)
....@@ -3956,25 +4188,25 @@
39564188 System.err.println("info : " + child.GetPath());
39574189 }
39584190 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4191
+// else
4192
+// {
4193
+// objEditor.SetMaterial(group); // .GetMaterial());
4194
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4195
+// System.err.println("info : " + group.GetPath());
4196
+// }
39654197
39664198 objEditor.SetText(); // jan 2014
39674199
3968
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4200
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39694201 CameraPane.flash = true;
39704202
39714203 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724204 // a camera
39734205 {
39744206 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;
4207
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4208
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4209
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784210 }
39794211
39804212 refreshContents();
....@@ -4229,7 +4461,7 @@
42294461 refreshContents();
42304462 }
42314463
4232
- void pasteInto(boolean copyit)
4464
+ void pasteInto(boolean copyit, boolean clone)
42334465 {
42344466 // if (GrafreeD.clipboard == null)
42354467 // return;
....@@ -4258,7 +4490,14 @@
42584490 if (copyit)
42594491 {
42604492 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4493
+ if (clone)
4494
+ {
4495
+ CloneClipboard(false); // sept 2014
4496
+ }
4497
+ else
4498
+ {
4499
+ paste(false);
4500
+ }
42624501 }
42634502 else
42644503 {
....@@ -4468,6 +4707,26 @@
44684707 makeSomething(csg);
44694708 }
44704709
4710
+ void Ungroup(Object3D g)
4711
+ {
4712
+ if (g instanceof HiddenObject)
4713
+ {
4714
+ HiddenObject h = (HiddenObject) g;
4715
+
4716
+ for (int i=0; i<h.ActualSize(); i++)
4717
+ {
4718
+ objEditor.makeSomething(h.get(i), false);
4719
+ }
4720
+ }
4721
+ else
4722
+ {
4723
+ for (int i=0; i<g.Size(); i++)
4724
+ {
4725
+ objEditor.makeSomething(g.get(i), false);
4726
+ }
4727
+ }
4728
+ }
4729
+
44714730 void ungroup()
44724731 {
44734732 /*
....@@ -4782,10 +5041,12 @@
47825041 cButton flashSelectionButton;
47835042 cButton editButton;
47845043 cButton uneditButton;
5044
+ JCheckBox allParamsButton;
47855045 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875046 cButton unselectButton;
47885047
5048
+ cButton oneStepButton;
5049
+
47895050 cButton screenfitButton;
47905051 cButton screenfitpointButton;
47915052 cButton snapobjectButton;
....@@ -4827,6 +5088,7 @@
48275088 private MenuItem resetsupportItem;
48285089 private MenuItem resetreferencesItem;
48295090 private MenuItem linkverticesItem;
5091
+ private MenuItem relinkverticesItem;
48305092 private MenuItem setMasterItem;
48315093 private MenuItem resetMeshItem;
48325094 private MenuItem stepAllItem;
....@@ -4839,14 +5101,17 @@
48395101 private MenuItem mergeGeometriesItem;
48405102 private MenuItem copyItem;
48415103 private MenuItem pasteItem;
5104
+ private MenuItem pasteIntoItem;
48425105 private MenuItem pasteLinkItem;
48435106 private MenuItem pasteCloneItem;
48445107 private MenuItem pasteExpandItem;
48455108 private MenuItem clearItem;
48465109 private MenuItem clearAllItem;
48475110 private MenuItem genUVItem;
5111
+ private MenuItem genNormalsMESHItem;
48485112 private MenuItem genNormalsCADItem;
48495113 private MenuItem genNormalsORGANItem;
5114
+ private MenuItem genNormalsMINEItem;
48505115 private MenuItem stripifyItem;
48515116 private MenuItem unstripifyItem;
48525117 private MenuItem trimItem;
....@@ -4888,6 +5153,7 @@
48885153 private MenuItem resetCentroidItem;
48895154 private MenuItem transformgeometryItem;
48905155 private MenuItem resetTransformItem;
5156
+ private MenuItem hideItem;
48915157 private MenuItem grabItem;
48925158 private MenuItem backItem;
48935159 private MenuItem frontItem;
....@@ -4908,6 +5174,7 @@
49085174
49095175 private MenuItem resetParentItem;
49105176 private MenuItem repairParentItem;
5177
+ private MenuItem repairShadowItem;
49115178 private MenuItem sortbysizeItem;
49125179 private MenuItem sortbynameItem;
49135180
....@@ -4928,10 +5195,11 @@
49285195 private MenuItem coneItem;
49295196 private MenuItem torusItem;
49305197 private MenuItem superItem;
5198
+ private MenuItem kleinItem;
49315199 private MenuItem blobItem;
49325200 private MenuItem latheItem;
49335201 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5202
+ private MenuItem overlayItem;
49355203 private MenuItem meshItem;
49365204 // private MenuItem meshGroupItem;
49375205 private MenuItem springItem;
....@@ -4940,6 +5208,7 @@
49405208 private MenuItem csgItem;
49415209 private MenuItem templateItem;
49425210 private MenuItem textureItem;
5211
+ private MenuItem billboardItem;
49435212 private MenuItem shadowXItem;
49445213 private MenuItem shadowYItem;
49455214 private MenuItem shadowZItem;