Normand Briere
2019-05-01 a742f6cebf1d471217d836e07934e5c02c22b6db
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,
....@@ -219,6 +220,8 @@
219220 resetsupportItem.addActionListener(this);
220221 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221222 linkverticesItem.addActionListener(this);
223
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224
+ relinkverticesItem.addActionListener(this);
222225 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223226 setMasterItem.addActionListener(this);
224227
....@@ -231,17 +234,21 @@
231234 frontItem.addActionListener(this);
232235 compositeItem = menu.add(new MenuItem("Composite"));
233236 compositeItem.addActionListener(this);
237
+ hideItem = menu.add(new MenuItem("Hide"));
238
+ hideItem.addActionListener(this);
239
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
240
+ ungroupItem.addActionListener(this);
234241 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
242
+ randomItem = menu.add(new MenuItem("Switch node"));
236243 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);
241244 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242245 switchGeoItem.addActionListener(this);
243246 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244247 switchTransfoItem.addActionListener(this);
248
+ physicsItem = menu.add(new MenuItem("Physics"));
249
+ physicsItem.addActionListener(this);
250
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251
+ frameselectorItem.addActionListener(this);
245252 morphItem = menu.add(new MenuItem("Morph"));
246253 morphItem.addActionListener(this);
247254 scriptNodeItem = menu.add(new MenuItem("Script Node"));
....@@ -252,6 +259,8 @@
252259 oe.menuBar.add(menu = new Menu("Object"));
253260 textureItem = menu.add(new MenuItem("Texture"));
254261 textureItem.addActionListener(this);
262
+ billboardItem = menu.add(new MenuItem("Billboard"));
263
+ billboardItem.addActionListener(this);
255264 csgItem = menu.add(new MenuItem("CSG"));
256265 csgItem.addActionListener(this);
257266 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -269,14 +278,12 @@
269278 pointflowItem = menu.add(new MenuItem("Point Flow"));
270279 pointflowItem.addActionListener(this);
271280 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274281 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275282 resetTransformItem.addActionListener(this);
276283 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277284 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
285
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
+ transformgeometryItem.addActionListener(this);
280287
281288 oe.menuBar.add(menu = new Menu("Geometry"));
282289 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +292,10 @@
285292 genNormalsORGANItem.addActionListener(this);
286293 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287294 genNormalsCADItem.addActionListener(this);
295
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296
+ genNormalsMESHItem.addActionListener(this);
297
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298
+ genNormalsMINEItem.addActionListener(this);
288299 stripifyItem = menu.add(new MenuItem("Stripify"));
289300 stripifyItem.addActionListener(this);
290301 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -423,150 +434,94 @@
423434 oe.radioPanel.add(dummyButton);
424435 oe.buttonGroup.add(dummyButton);
425436 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429438
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
+ liveCB.setToolTipText("Enabled animation");
431441 liveCB.addItemListener(this);
432442
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);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
451445 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);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
448
+ trackCB.setToolTipText("Enable tracking");
493449 trackCB.addItemListener(this);
494450
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
452
+ screenfitButton.setToolTipText("Screen fit");
497453 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
454
+
499455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500456 // 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;
505457
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);
458
+ if (Globals.ADVANCED)
459
+ {
460
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461
+ snapobjectButton.addActionListener(this);
462
+ snapobjectButton.setToolTipText("Snap Object");
463
+ }
464
+
465
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
466
+ flashSelectionButton.setToolTipText("Show selection");
512467 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516468
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
469
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
470
+
471
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
472
+ twoButton.setToolTipText("Show center view only");
519473 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
474
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521475 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ fourButton.setToolTipText("Show left panel only");
477
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
478
+ sixButton.setToolTipText("2-column layout left");
523479 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
+ threeButton.setToolTipText("2-column layout right");
525482 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
+ sevenButton.setToolTipText("3-column layout");
527485 sevenButton.addActionListener(this);
528486 //
529487
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
488
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
489
+ rootButton.setToolTipText("Edit selection in new tab");
531490 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
493
+ closeButton.setToolTipText("Close tab");
534494 closeButton.addActionListener(this);
535495 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536496 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538497
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
498
+ cGridBag commandsPanel = new cGridBag();
499
+
500
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
501
+ editButton.setToolTipText("Edit selection");
541502 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545503
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
504
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
505
+ uneditButton.setToolTipText("Unedit selection");
547506 uneditButton.addActionListener(this);
548507
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);
508
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
509
+ clearPanelButton.setToolTipText("Clear edit panel");
554510 clearPanelButton.addActionListener(this);
555511
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);
512
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ allParamsButton.setToolTipText("All params??");
561514 allParamsButton.addActionListener(this);
562515
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);
516
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ unselectButton.setToolTipText("Unselect");
568518 unselectButton.addActionListener(this);
569519
520
+ commandsPanel.preferredHeight = 1;
521
+
522
+ oe.treePanel.add(commandsPanel);
523
+ oe.treePanel.Return();
524
+
570525 // oe.aConstraints.gridx += 1;
571526 // oe.aConstraints.weighty = 0;
572527 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +533,37 @@
578533 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579534 // gcButton.addActionListener(this);
580535
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;
536
+ cGridBag jSPPanel = new cGridBag();
537
+
538
+ JScrollPane jSP;
592539 //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);
540
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594541 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
542
+
543
+ oe.treePanel.add(jSPPanel);
544
+ oe.treePanel.Return();
599545
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);
546
+ cGridBag copyOptionsPanel = new cGridBag();
547
+
548
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
549
+ colorCB.setToolTipText("Copy color when dropped");
604550 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
551
+
552
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
553
+ materialCB.setToolTipText("Copy material when dropped");
607554 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
555
+
556
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
557
+ textureCB.setToolTipText("Copy texture when dropped");
610558 textureCB.addItemListener(this);
611559
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
560
+ copyOptionsPanel.preferredHeight = 1;
561
+ oe.treePanel.add(copyOptionsPanel);
562
+ oe.treePanel.Return();
614563
564
+// mainPanel.setDividerLocation(0.5); //1.0);
565
+// mainPanel.setResizeWeight(0.5);
566
+
615567 //jList.addListSelectionListener(this);
616568 oe.jTree.addTreeSelectionListener(this);
617569 //jTree.setRootVisible(false);
....@@ -633,17 +585,85 @@
633585 radio.layout = sevenButton;
634586 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635587 }
588
+
589
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
590
+ {
591
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
592
+ supportCB.setToolTipText("Enabled rigging");
593
+ supportCB.addItemListener(this);
594
+
595
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
596
+ // localCB.addItemListener(this);
597
+
598
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
599
+ crowdCB.setToolTipText("Used for crowds");
600
+ crowdCB.addItemListener(this);
601
+
602
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
603
+ smoothCB.setToolTipText("Snapping delay");
604
+ smoothCB.addItemListener(this);
605
+
606
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
607
+ slowCB.setToolTipText("Smooth interpolation");
608
+ slowCB.addItemListener(this);
609
+
610
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
611
+ boxCB.setToolTipText("Display bounding boxes");
612
+ boxCB.addItemListener(this);
613
+
614
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
615
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
616
+ zoomBoxCB.addItemListener(this);
617
+
618
+// constraints.gridy += 1;
619
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
620
+// speakerMocapCB.addItemListener(this);
621
+
622
+ if (false)
623
+ {
624
+ // handled in scripts
625
+ //constraints.gridy += 1;
626
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
627
+ speakerCameraCB.addItemListener(this);
628
+
629
+ //constraints.gridy += 1;
630
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
631
+ speakerFocusCB.addItemListener(this);
632
+
633
+ //constraints.gridy += 1;
634
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
635
+ smoothfocusCB.addItemListener(this);
636
+ }
637
+
638
+//constraints.gridx += 1;
639
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
640
+// debugCB.addItemListener(this);
641
+
642
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
643
+ oeilCB.addItemListener(this);
644
+
645
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
646
+ lookAtCB.setToolTipText("Look-at target");
647
+ lookAtCB.addItemListener(this);
648
+
649
+ cGridBag fill = new cGridBag();
650
+
651
+ fill.preferredHeight = 200;
652
+
653
+ panel.add(fill);
654
+
655
+ }
636656
637657 void EditObject(Object3D obj)
638658 {
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();
659
+ cRadio radioButton = new cRadio(obj.name);
660
+ radioButton.SetObject(obj);
661
+ radioButton.layout = sevenButton;
662
+ radioButton.SetCamera(cameraView.renderCamera, false);
663
+ radioButton.addActionListener(this);
664
+ radioPanel.add(radioButton);
665
+ buttonGroup.add(radioButton);
666
+ radioButton.doClick();
647667 }
648668 void SetupViews(ObjEditor oe)
649669 {
....@@ -663,6 +683,7 @@
663683 JCheckBox fastCB;
664684 JCheckBox slowCB;
665685 JCheckBox boxCB;
686
+ JCheckBox zoomBoxCB;
666687 JCheckBox trackCB;
667688 JCheckBox smoothfocusCB;
668689 // JCheckBox speakerMocapCB;
....@@ -705,8 +726,7 @@
705726 dropAttributes |= Object3D.TEXTURE;
706727 else
707728 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
729
+ } else if(e.getSource() == liveCB)
710730 {
711731 cameraView.ToggleLive();
712732 }
....@@ -743,6 +763,10 @@
743763 Recompile();
744764 cameraView.repaint();
745765 // refreshContents();
766
+ }
767
+ else if(e.getSource() == zoomBoxCB)
768
+ {
769
+ cameraView.ToggleZoomBoxMode();
746770 }
747771 else if(e.getSource() == smoothfocusCB)
748772 {
....@@ -1033,6 +1057,8 @@
10331057 torusItem.addActionListener(this);
10341058 superItem = menu.add(new MenuItem("Superellipsoid"));
10351059 superItem.addActionListener(this);
1060
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1061
+ kleinItem.addActionListener(this);
10361062 particleItem = menu.add(new MenuItem("Particle system"));
10371063 particleItem.addActionListener(this);
10381064 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1073,7 +1099,7 @@
10731099 {
10741100 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751101 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1102
+ animationItem.setState(Globals.ANIMATION);
10771103
10781104 menu.add("-");
10791105 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1106,6 +1132,8 @@
11061132 resetParentItem.addActionListener(this);
11071133 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081134 repairParentItem.addActionListener(this);
1135
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1136
+ repairShadowItem.addActionListener(this);
11091137 menu.add(invariantsItem = new MenuItem("Invariants"));
11101138 invariantsItem.addActionListener(this);
11111139 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1466,6 +1494,7 @@
14661494 //
14671495 public void actionPerformed(ActionEvent event) // , Object arg)
14681496 {
1497
+ Object source = event.getSource();
14691498 /*
14701499 if (event.getSource() == nameField)
14711500 {
....@@ -1477,11 +1506,11 @@
14771506 }
14781507 else
14791508 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1509
+ if (source == lookAtItem || source == lookFromItem)
14811510 {
14821511 ScreenFit();
14831512 } else
1484
- if (event.getSource() == switchItem)
1513
+ if (source == switchItem)
14851514 {
14861515 cVector v1 = new cVector();
14871516 cVector v2 = new cVector();
....@@ -1490,11 +1519,11 @@
14901519 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911520 objEditor.cameraView.repaint();
14921521 } else
1493
- if (event.getSource() == rectoidItem)
1522
+ if (source == rectoidItem)
14941523 {
14951524 makeSomething(new Box());
14961525 } else
1497
- if (event.getSource() == particleItem)
1526
+ if (source == particleItem)
14981527 {
14991528 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001529 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1544,9 @@
15151544 applyExample(particleGeom, "SMOKE");
15161545 makeSomething(particleGeom);
15171546 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1547
+ if (source == ragdollItem || source == ragdoll2Item)
15191548 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1549
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211550
15221551 ragdoll.toParent = LA.newMatrix();
15231552 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1564,7 @@
15351564 } else
15361565 /*
15371566 */
1538
- if (event.getSource() == heightFieldItem)
1567
+ if (source == heightFieldItem)
15391568 {
15401569 Object3D obj = new Object3D();
15411570
....@@ -1573,27 +1602,31 @@
15731602
15741603 makeSomething(obj);
15751604 } else
1576
- if (event.getSource() == gridItem)
1605
+ if (source == gridItem)
15771606 {
15781607 makeSomething(new Grid());
15791608 } else
1580
- if (event.getSource() == ellipsoidItem)
1609
+ if (source == ellipsoidItem)
15811610 {
15821611 makeSomething(new Sphere());
15831612 } else
1584
- if (event.getSource() == coneItem)
1613
+ if (source == coneItem)
15851614 {
15861615 makeSomething(new Cone());
15871616 } else
1588
- if (event.getSource() == torusItem)
1617
+ if (source == torusItem)
15891618 {
15901619 makeSomething(new Torus());
15911620 } else
1592
- if (event.getSource() == superItem)
1621
+ if (source == superItem)
15931622 {
15941623 makeSomething(new Superellipsoid());
15951624 } else
1596
- if (event.getSource() == blobItem)
1625
+ if (source == kleinItem)
1626
+ {
1627
+ makeSomething(new Klein());
1628
+ } else
1629
+ if (source == blobItem)
15971630 {
15981631 Blob blob = new Blob();
15991632 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1634,15 @@
16011634 //blob.retile();
16021635 makeSomething(blob);
16031636 } else
1604
- if (event.getSource() == latheItem)
1637
+ if (source == latheItem)
16051638 {
16061639 makeSomething(new Lathe());
16071640 } else
1608
- if (event.getSource() == bezierItem)
1641
+ if (source == bezierItem)
16091642 {
16101643 makeSomething(new BezierSurface());
16111644 } else
1612
- if (event.getSource() == checkerItem)
1645
+ if (source == checkerItem)
16131646 {
16141647 /*
16151648 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1657,7 @@
16241657 */
16251658 makeSomething(new Checker());
16261659 } else
1627
- if (event.getSource() == meshItem)
1660
+ if (source == meshItem)
16281661 {
16291662 Object3D itemtomake = new Object3D();
16301663 Object3D child;
....@@ -1645,35 +1678,35 @@
16451678 makeSomething(child);
16461679 }
16471680 } else
1648
- if (event.getSource() == springItem)
1681
+ if (source == springItem)
16491682 {
16501683 cSpring s = new cSpring();
16511684 s.setup();
16521685 makeSomething(s);
16531686 } else
1654
- if (event.getSource() == flagItem)
1687
+ if (source == flagItem)
16551688 {
16561689 cSpring s = new cFlag();
16571690 s.setup();
16581691 makeSomething(s);
16591692 } else
1660
- if (event.getSource() == lightItem)
1693
+ if (source == lightItem)
16611694 {
16621695 makeSomething(new Light());
16631696 } else
1664
- if (event.getSource() == csgItem)
1697
+ if (source == csgItem)
16651698 {
16661699 group(new CSG());
16671700 } else
1668
- if (event.getSource() == templateItem)
1701
+ if (source == templateItem)
16691702 {
16701703 group(new cTemplate());
16711704 } else
1672
- if (event.getSource() == attributeItem)
1705
+ if (source == attributeItem)
16731706 {
16741707 makeSomething(new Attribute());
16751708 } else
1676
- if (event.getSource() == pointflowItem)
1709
+ if (source == pointflowItem)
16771710 {
16781711 makeSomething(new PointFlow());
16791712 } else
....@@ -1685,7 +1718,7 @@
16851718 } else
16861719 */
16871720
1688
- if (event.getSource() == superLoopItem)
1721
+ if (source == superLoopItem)
16891722 {
16901723 Composite g = new cGroup();
16911724 for (int i=0; i<15; i++)
....@@ -1707,7 +1740,7 @@
17071740
17081741 group(g);
17091742 } else
1710
- if (event.getSource() == loopItem)
1743
+ if (source == loopItem)
17111744 {
17121745 Composite csg = new GroupLeaf();
17131746 csg.count = 5;
....@@ -1716,7 +1749,7 @@
17161749 csg.addChild(child);
17171750 child.addChild(csg);
17181751 } else
1719
- if (event.getSource() == doubleItem)
1752
+ if (source == doubleItem)
17201753 {
17211754 Composite csg = new GroupLeaf();
17221755 csg.count = 5;
....@@ -1728,7 +1761,7 @@
17281761 csg.addChild(child);
17291762 child.addChild(csg);
17301763 } else
1731
- if (event.getSource() == tripleItem)
1764
+ if (source == tripleItem)
17321765 {
17331766 Composite csg = new GroupLeaf();
17341767 csg.count = 4;
....@@ -1744,70 +1777,70 @@
17441777 child.addChild(csg);
17451778 } else
17461779
1747
- if (event.getSource() == importGFDItem)
1780
+ if (source == importGFDItem)
17481781 {
17491782 ImportGFD();
17501783 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1784
+ if (source == importVRMLX3DItem)
17521785 {
17531786 ImportVRMLX3D();
17541787 } else
1755
- if (event.getSource() == import3DSItem)
1788
+ if (source == import3DSItem)
17561789 {
17571790 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581791 } else
1759
- if (event.getSource() == importOBJItem)
1792
+ if (source == importOBJItem)
17601793 {
17611794 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621795 } else
1763
- if (event.getSource() == computeAOItem)
1796
+ if (source == computeAOItem)
17641797 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1798
+ Globals.drawMode = CameraPane.OCCLUSION;
1799
+ Globals.theRenderer.repaint();
17671800 } else
1768
- if (event.getSource() == recompileItem)
1801
+ if (source == recompileItem)
17691802 {
17701803 Recompile();
17711804 refreshContents();
17721805 } else
1773
- if (event.getSource() == editScriptItem)
1806
+ if (source == editScriptItem)
17741807 {
17751808 OpenDialog();
17761809 refreshContents();
17771810 } else
1778
- if (event.getSource() == invariantsItem)
1811
+ if (source == invariantsItem)
17791812 {
17801813 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1814
+ GrafreeD.grafreeD.universe.invariants();
17821815 } else
1783
- if (event.getSource() == memoryItem)
1816
+ if (source == memoryItem)
17841817 {
17851818 //System.out.println("Invariants:");
17861819 PrintMemory();
17871820 } else
1788
- if (event.getSource() == pathItem)
1821
+ if (source == pathItem)
17891822 {
17901823 PrintPath();
17911824 } else
1792
- if (event.getSource() == analyzeItem)
1825
+ if (source == analyzeItem)
17931826 {
17941827 AnalyzeObject();
17951828 } else
1796
- if (event.getSource() == dumpItem)
1829
+ if (source == dumpItem)
17971830 {
17981831 DumpObject();
17991832 } else
1800
- if (event.getSource() == screenfitButton)
1833
+ if (source == screenfitButton)
18011834 {
18021835 //Reload(lastConverter, lastFilename, true);
18031836 ScreenFit();
18041837 } else
1805
- if (event.getSource() == screenfitpointButton)
1838
+ if (source == screenfitpointButton)
18061839 {
18071840 //Reload(lastConverter, lastFilename, true);
18081841 ScreenFitPoint();
18091842 } else
1810
- if (event.getSource() == snapobjectButton)
1843
+ if (source == snapobjectButton)
18111844 {
18121845 //Reload(lastConverter, lastFilename, true);
18131846 SnapObject();
....@@ -1818,13 +1851,13 @@
18181851 // Recompile();
18191852 // refreshContents();
18201853 // } else
1821
- if (event.getSource() == gcButton)
1854
+ if (source == gcButton)
18221855 {
18231856 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241857 System.gc();
18251858 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261859 } else
1827
- if (event.getSource() == editLeafItem)
1860
+ if (source == editLeafItem)
18281861 {
18291862 Object3D obj;
18301863 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1871,62 @@
18381871 }
18391872 refreshContents(true);
18401873 } else
1841
- if (event.getSource() == openWindowItem)
1874
+ if (source == openWindowItem)
18421875 {
18431876 EditSelection(true);
18441877 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1878
+ if (source == cutItem || source == clearButton)
18461879 {
18471880 loadClipboard(true);
18481881 } else
1849
- if (event.getSource() == duplicateItem)
1882
+ if (source == duplicateItem)
18501883 {
18511884 Object3D keep = GrafreeD.clipboard;
18521885 loadClipboard(false);
18531886 paste(false);
18541887 GrafreeD.clipboard = keep;
18551888 } else
1856
- if (event.getSource() == cloneItem)
1889
+ if (source == cloneItem)
18571890 {
18581891 CloneSelection(false);
18591892 } else
1860
- if (event.getSource() == cloneSupportItem)
1893
+ if (source == cloneSupportItem)
18611894 {
18621895 CloneSelection(true);
18631896 } else
1864
- if (event.getSource() == copyItem)
1897
+ if (source == copyItem)
18651898 {
18661899 loadClipboard(false);
18671900 } else
1868
- if (event.getSource() == pasteItem)
1901
+ if (source == pasteItem)
18691902 {
18701903 paste(false);
18711904 } else
1872
- if (event.getSource() == pasteLinkItem)
1905
+ if (source == pasteLinkItem)
18731906 {
18741907 pasteInto(false);
18751908 } else
1876
- if (event.getSource() == pasteCloneItem)
1909
+ if (source == pasteCloneItem)
18771910 {
18781911 pasteInto(true);
18791912 } else
1880
- if (event.getSource() == pasteExpandItem)
1913
+ if (source == pasteExpandItem)
18811914 {
18821915 paste(true);
18831916 } else
1884
- if (event.getSource() == synchronizeItem)
1917
+ if (source == synchronizeItem)
18851918 {
18861919 Overwrite(Object3D.TRANSFORM);
18871920 } else
1888
- if (event.getSource() == overwriteNameItem)
1921
+ if (source == overwriteNameItem)
18891922 {
18901923 Overwrite(Object3D.NAME);
18911924 } else
1892
- if (event.getSource() == overwriteUVItem)
1925
+ if (source == overwriteUVItem)
18931926 {
18941927 Overwrite(Object3D.UV);
18951928 } else
1896
- if (event.getSource() == overwriteMatItem)
1929
+ if (source == overwriteMatItem)
18971930 {
18981931 /* july 2015
18991932 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +1946,7 @@
19131946
19141947 Overwrite(dropAttributes);
19151948 }
1916
- if (event.getSource() == overwriteGeoItem)
1949
+ if (source == overwriteGeoItem)
19171950 {
19181951 Overwrite(Object3D.GEOMETRY);
19191952 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +1963,7 @@
19301963 // refreshContents();
19311964 // }
19321965 } else
1933
- if (event.getSource() == generateMeshItem)
1966
+ if (source == generateMeshItem)
19341967 {
19351968 //if (group.selection.size() == 1)
19361969 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +1974,7 @@
19411974 ResetModel();
19421975 refreshContents();
19431976 } else
1944
- if (event.getSource() == extractGeometriesItem)
1977
+ if (source == extractGeometriesItem)
19451978 {
19461979 boolean one = false;
19471980
....@@ -1968,7 +2001,7 @@
19682001 ResetModel();
19692002 refreshContents();
19702003 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2004
+ if (source == cloneGeometriesItem)
19722005 {
19732006 boolean one = false;
19742007
....@@ -1994,32 +2027,37 @@
19942027 ResetModel();
19952028 refreshContents();
19962029 } else
1997
- if (event.getSource() == shareGeometriesItem)
2030
+ if (source == shareGeometriesItem)
19982031 {
19992032 boolean one = false;
20002033
20012034 if (group.selection.size() == 1)
20022035 one = true;
20032036
2037
+ Object3D merge = null;
2038
+
20042039 Object3D content = new cGroup();
20052040
20062041 for (int i=0; i<group.selection.size(); i++)
20072042 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2043
+ merge = new Merge(group.selection.get(i));
20092044
20102045 if (one)
2011
- makeSomething(sel, false);
2046
+ makeSomething(merge, false);
20122047 else
2013
- content.addChild(sel);
2048
+ content.addChild(merge);
20142049 }
20152050
20162051 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2052
+ makeSomething(content, true);
2053
+ else
2054
+ {
2055
+ ResetModel();
2056
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2057
+ refreshContents();
2058
+ }
20212059 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2060
+ if (source == mergeGeometriesItem)
20232061 {
20242062 boolean one = false;
20252063
....@@ -2049,7 +2087,7 @@
20492087 ResetModel();
20502088 refreshContents();
20512089 } else
2052
- if (event.getSource() == linkverticesItem)
2090
+ if (source == linkverticesItem)
20532091 {
20542092 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552093 // {
....@@ -2069,7 +2107,7 @@
20692107 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702108 content = ((cGroup)content).get(0);
20712109
2072
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2110
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20732111 for (int i=0; i<group.selection.size(); i++)
20742112 {
20752113 boolean random = CameraPane.RANDOM;
....@@ -2078,11 +2116,11 @@
20782116 // group.selection.get(i).setMasterThis(content); // should be identity
20792117 CameraPane.RANDOM = random;
20802118 }
2081
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2119
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20822120 refreshContents();
20832121 }
20842122 } else
2085
- if (event.getSource() == resetsupportItem)
2123
+ if (source == resetsupportItem)
20862124 {
20872125 for (int i=0; i<group.selection.size(); i++)
20882126 {
....@@ -2094,7 +2132,16 @@
20942132
20952133 refreshContents();
20962134 } else
2097
- if (event.getSource() == resetreferencesItem)
2135
+ if (source == relinkverticesItem)
2136
+ {
2137
+ boolean random = CameraPane.RANDOM;
2138
+ CameraPane.RANDOM = false; // parse all random nodes
2139
+ group.selection.RelinkToSupport();
2140
+ CameraPane.RANDOM = random;
2141
+
2142
+ refreshContents();
2143
+ } else
2144
+ if (source == resetreferencesItem)
20982145 {
20992146 for (int i=0; i<group.selection.size(); i++)
21002147 {
....@@ -2103,7 +2150,7 @@
21032150
21042151 refreshContents();
21052152 } else
2106
- if (event.getSource() == setMasterItem)
2153
+ if (source == setMasterItem)
21072154 {
21082155 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21092156 {
....@@ -2116,7 +2163,7 @@
21162163 refreshContents();
21172164 }
21182165 } else
2119
- if (event.getSource() == poseMeshItem)
2166
+ if (source == poseMeshItem)
21202167 {
21212168 if (group.selection.size() == 1)
21222169 {
....@@ -2135,19 +2182,19 @@
21352182 }
21362183
21372184 } else
2138
- if (event.getSource() == revertMeshItem)
2185
+ if (source == revertMeshItem)
21392186 {
21402187 RevertMeshes();
21412188 } else
2142
- if (event.getSource() == resetMeshItem)
2189
+ if (source == resetMeshItem)
21432190 {
21442191 ResetAll();
21452192 } else
2146
- if (event.getSource() == stepAllItem)
2193
+ if (source == stepAllItem)
21472194 {
21482195 StepAll();
21492196 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2197
+ if (source == clearItem) // || event.getSource() == clearButton)
21512198 {
21522199 //int indices[] = jList.getSelectedIndices();
21532200 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2202,46 @@
21552202
21562203 ClearSelection(false);
21572204 } else
2158
- if (event.getSource() == clearAllItem)
2205
+ if (source == clearAllItem)
21592206 {
21602207 ClearSelection(true);
21612208 } else
2162
- if (event.getSource() == grabItem)
2209
+ if (source == grabItem)
21632210 {
21642211 group(new cGroup(), true);
21652212 } else
2166
- if (event.getSource() == frontItem)
2213
+ if (source == hideItem)
2214
+ {
2215
+ group(new HiddenObject());
2216
+ } else
2217
+ if (source == frontItem)
21672218 {
21682219 front();
21692220 } else
2170
- if (event.getSource() == backItem)
2221
+ if (source == backItem)
21712222 {
21722223 back();
21732224 } else
2174
- if (event.getSource() == cameraItem)
2225
+ if (source == cameraItem)
21752226 {
21762227 makeSomething(new Camera());
21772228 } else
2178
- if (event.getSource() == compositeItem)
2229
+ if (source == compositeItem)
21792230 {
21802231 group(new Composite());
21812232 } else
2182
- if (event.getSource() == randomItem)
2233
+ if (source == randomItem)
21832234 {
21842235 RandomNode random = new RandomNode();
21852236 group(random);
21862237 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2238
+ random.name = random.get(0).name + "Switch";
21882239 } else
2189
- if (event.getSource() == physicsItem)
2240
+ if (source == physicsItem)
21902241 {
21912242 group(new PhysicsNode());
21922243 } else
2193
- if (event.getSource() == frameselectorItem)
2244
+ if (source == frameselectorItem)
21942245 {
21952246 for (int i=0; i<group.selection.size(); i++)
21962247 {
....@@ -2202,7 +2253,7 @@
22022253 ResetModel();
22032254 refreshContents();
22042255 } else
2205
- if (event.getSource() == switchGeoItem)
2256
+ if (source == switchGeoItem)
22062257 {
22072258 for (int i=0; i<group.selection.size(); i++)
22082259 {
....@@ -2214,7 +2265,7 @@
22142265 ResetModel();
22152266 refreshContents();
22162267 } else
2217
- if (event.getSource() == switchTransfoItem)
2268
+ if (source == switchTransfoItem)
22182269 {
22192270 for (int i=0; i<group.selection.size(); i++)
22202271 {
....@@ -2226,7 +2277,7 @@
22262277 ResetModel();
22272278 refreshContents();
22282279 } else
2229
- if (event.getSource() == morphItem)
2280
+ if (source == morphItem)
22302281 {
22312282 for (int i=0; i<group.selection.size(); i++)
22322283 {
....@@ -2238,7 +2289,7 @@
22382289 ResetModel();
22392290 refreshContents();
22402291 } else
2241
- if (event.getSource() == scriptNodeItem)
2292
+ if (source == scriptNodeItem)
22422293 {
22432294 boolean atleastone = false;
22442295
....@@ -2277,195 +2328,215 @@
22772328 }
22782329 }
22792330 } else
2280
- if (event.getSource() == linkerItem)
2331
+ if (source == linkerItem)
22812332 {
22822333 group(new cLinker());
22832334 } else
2284
- if (event.getSource() == textureItem)
2335
+ if (source == textureItem)
22852336 {
22862337 group(new TextureNode());
22872338 } else
2288
- if (event.getSource() == shadowXItem)
2339
+ if (source == billboardItem)
2340
+ {
2341
+ group(new BillboardNode());
2342
+ } else
2343
+ if (source == shadowXItem)
22892344 {
22902345 CastShadow(0);
22912346 } else
2292
- if (event.getSource() == shadowYItem)
2347
+ if (source == shadowYItem)
22932348 {
22942349 CastShadow(1);
22952350 } else
2296
- if (event.getSource() == shadowZItem)
2351
+ if (source == shadowZItem)
22972352 {
22982353 CastShadow(2);
22992354 } else
2300
- if (event.getSource() == ungroupItem)
2355
+ if (source == ungroupItem)
23012356 {
2302
- ungroup();
2357
+ //ungroup();
2358
+ for (int i=0; i<group.selection.size(); i++)
2359
+ {
2360
+ Ungroup(group.selection.get(i));
2361
+ }
2362
+
2363
+ ClearSelection(false);
2364
+
2365
+ refreshContents();
23032366 } else
2304
- if (event.getSource() == genUVItem)
2367
+ if (source == genUVItem)
23052368 {
23062369 GenUV();
23072370 } else
2308
- if (event.getSource() == genNormalsCADItem)
2371
+ if (source == genNormalsCADItem)
23092372 {
23102373 GenNormals(true);
23112374 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2375
+ if (source == genNormalsMESHItem)
2376
+ {
2377
+ GenNormals(true); // TODO
2378
+ } else
2379
+ if (source == genNormalsORGANItem)
23132380 {
23142381 GenNormals(false);
23152382 } else
2316
- if (event.getSource() == stripifyItem)
2383
+ if (source == genNormalsMINEItem)
2384
+ {
2385
+ GenNormalsMINE();
2386
+ } else
2387
+ if (source == stripifyItem)
23172388 {
23182389 Stripify();
23192390 } else
2320
- if (event.getSource() == unstripifyItem)
2391
+ if (source == unstripifyItem)
23212392 {
23222393 Unstripify();
23232394 } else
2324
- if (event.getSource() == trimItem)
2395
+ if (source == trimItem)
23252396 {
23262397 Trim();
23272398 } else
2328
- if (event.getSource() == untrimItem)
2399
+ if (source == untrimItem)
23292400 {
23302401 Untrim();
23312402 } else
2332
- if (event.getSource() == clearColorsItem)
2403
+ if (source == clearColorsItem)
23332404 {
23342405 ClearColors();
23352406 } else
2336
- if (event.getSource() == clearMaterialsItem)
2407
+ if (source == clearMaterialsItem)
23372408 {
23382409 ClearMaterials();
23392410 } else
2340
- if (event.getSource() == liveleavesItem)
2411
+ if (source == liveleavesItem)
23412412 {
23422413 LiveLeaves(true);
23432414 } else
2344
- if (event.getSource() == unliveleavesItem)
2415
+ if (source == unliveleavesItem)
23452416 {
23462417 LiveLeaves(false);
23472418 } else
2348
- if (event.getSource() == supportleavesItem)
2419
+ if (source == supportleavesItem)
23492420 {
23502421 SupportLeaves(true);
23512422 } else
2352
- if (event.getSource() == unsupportleavesItem)
2423
+ if (source == unsupportleavesItem)
23532424 {
23542425 SupportLeaves(false);
23552426 } else
2356
- if (event.getSource() == hideleavesItem)
2427
+ if (source == hideleavesItem)
23572428 {
23582429 HideLeaves(true);
23592430 } else
2360
- if (event.getSource() == showleavesItem)
2431
+ if (source == showleavesItem)
23612432 {
23622433 HideLeaves(false);
23632434 } else
2364
- if (event.getSource() == markleavesItem)
2435
+ if (source == markleavesItem)
23652436 {
23662437 MarkLeaves(true);
23672438 } else
2368
- if (event.getSource() == unmarkleavesItem)
2439
+ if (source == unmarkleavesItem)
23692440 {
23702441 MarkLeaves(false);
23712442 } else
2372
- if (event.getSource() == flipVItem)
2443
+ if (source == flipVItem)
23732444 {
23742445 FlipV(true);
23752446 } else
2376
- if (event.getSource() == unflipVItem)
2447
+ if (source == unflipVItem)
23772448 {
23782449 FlipV(false);
23792450 } else
2380
- if (event.getSource() == lowTexturesItem)
2451
+ if (source == lowTexturesItem)
23812452 {
23822453 SetTexRes(0);
23832454 } else
2384
- if (event.getSource() == normalTexturesItem)
2455
+ if (source == normalTexturesItem)
23852456 {
23862457 SetTexRes(1);
23872458 } else
2388
- if (event.getSource() == highTexturesItem)
2459
+ if (source == highTexturesItem)
23892460 {
23902461 SetTexRes(2);
23912462 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2463
+ if (source == veryhighTexturesItem)
23932464 {
23942465 SetTexRes(3);
23952466 } else
2396
- if (event.getSource() == maxTexturesItem)
2467
+ if (source == maxTexturesItem)
23972468 {
23982469 SetTexRes(4);
23992470 } else
2400
- if (event.getSource() == panoTexturesItem)
2471
+ if (source == panoTexturesItem)
24012472 {
24022473 SetTexRes(5);
24032474 } else
2404
- if (event.getSource() == reverseNormalsItem)
2475
+ if (source == reverseNormalsItem)
24052476 {
24062477 ReverseNormals();
24072478 } else
2408
- if (event.getSource() == parseverticesItem)
2479
+ if (source == parseverticesItem)
24092480 {
24102481 ParseVertices();
24112482 } else
2412
- if (event.getSource() == textureFieldItem)
2483
+ if (source == textureFieldItem)
24132484 {
24142485 TextureVertices();
24152486 } else
2416
- if (event.getSource() == alignItem)
2487
+ if (source == alignItem)
24172488 {
24182489 Align();
24192490 } else
2420
- if (event.getSource() == mirrorItem)
2491
+ if (source == mirrorItem)
24212492 {
24222493 MirrorPoses();
24232494 } else
2424
- if (event.getSource() == reduceMorphItem)
2495
+ if (source == reduceMorphItem)
24252496 {
24262497 MeshReduction(false);
24272498 } else
2428
- if (event.getSource() == reduce34MorphItem)
2499
+ if (source == reduce34MorphItem)
24292500 {
24302501 MeshReduction(true);
24312502 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2503
+ if (source == reverseTrianglesItem)
24332504 {
24342505 ReverseTriangles();
24352506 } else
2436
- if (event.getSource() == reduceMeshItem)
2507
+ if (source == reduceMeshItem)
24372508 {
24382509 ReduceMesh(false);
24392510 } else
2440
- if (event.getSource() == reduce34MeshItem)
2511
+ if (source == reduce34MeshItem)
24412512 {
24422513 ReduceMesh(true);
24432514 } else
2444
- if (event.getSource() == increaseMeshItem)
2515
+ if (source == increaseMeshItem)
24452516 {
24462517 IncreaseMesh();
24472518 } else
2448
- if (event.getSource() == clipMeshItem)
2519
+ if (source == clipMeshItem)
24492520 {
24502521 ClipMesh();
24512522 } else
2452
- if (event.getSource() == smoothMeshItem)
2523
+ if (source == smoothMeshItem)
24532524 {
24542525 SmoothMesh();
24552526 } else
2456
- if (event.getSource() == transformgeometryItem)
2527
+ if (source == transformgeometryItem)
24572528 {
24582529 TransformGeometry();
24592530 } else
2460
- if (event.getSource() == resetTransformItem)
2531
+ if (source == resetTransformItem)
24612532 {
24622533 ResetTransform();
24632534 } else
2464
- if (event.getSource() == resetCentroidItem)
2535
+ if (source == resetCentroidItem)
24652536 {
24662537 ResetCentroid();
24672538 } else
2468
- if (event.getSource() == resetParentItem)
2539
+ if (source == resetParentItem)
24692540 {
24702541 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712542 {
....@@ -2475,7 +2546,7 @@
24752546
24762547 refreshContents();
24772548 } else
2478
- if (event.getSource() == repairParentItem)
2549
+ if (source == repairParentItem)
24792550 {
24802551 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812552 {
....@@ -2489,7 +2560,21 @@
24892560
24902561 refreshContents();
24912562 } else
2492
- if (event.getSource() == sortbysizeItem)
2563
+ if (source == repairShadowItem)
2564
+ {
2565
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2566
+ {
2567
+ Object3D obj = (Object3D)e.nextElement();
2568
+ obj.RepairShadow();
2569
+// for (int i=0; i<obj.size(); i++)
2570
+// {
2571
+// obj.get(i).parent = obj;
2572
+// }
2573
+ }
2574
+
2575
+ refreshContents();
2576
+ } else
2577
+ if (source == sortbysizeItem)
24932578 {
24942579 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952580 {
....@@ -2501,7 +2586,7 @@
25012586 ResetModel();
25022587 refreshContents();
25032588 } else
2504
- if (event.getSource() == sortbynameItem)
2589
+ if (source == sortbynameItem)
25052590 {
25062591 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072592 {
....@@ -2513,7 +2598,7 @@
25132598 ResetModel();
25142599 refreshContents();
25152600 } else
2516
- if (event.getSource() == attachPigmentItem)
2601
+ if (source == attachPigmentItem)
25172602 {
25182603 String texture = GetFile("Attach pigment");
25192604 Object3D obj;
....@@ -2525,7 +2610,7 @@
25252610
25262611 refreshContents();
25272612 } else
2528
- if (event.getSource() == detachPigmentItem)
2613
+ if (source == detachPigmentItem)
25292614 {
25302615 Object3D obj;
25312616 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2621,7 @@
25362621
25372622 refreshContents();
25382623 } else
2539
- if (event.getSource() == attachBumpItem)
2624
+ if (source == attachBumpItem)
25402625 {
25412626 String texture = GetFile("Attach bump");
25422627 Object3D obj;
....@@ -2548,7 +2633,7 @@
25482633
25492634 refreshContents();
25502635 } else
2551
- if (event.getSource() == detachBumpItem)
2636
+ if (source == detachBumpItem)
25522637 {
25532638 Object3D obj;
25542639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2644,7 @@
25592644
25602645 refreshContents();
25612646 } else
2562
- if (event.getSource() == pigmentBumpItem)
2647
+ if (source == pigmentBumpItem)
25632648 {
25642649 Object3D obj;
25652650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2655,195 @@
25702655
25712656 refreshContents();
25722657 } else
2573
- if (event.getSource() == flashSelectionButton)
2658
+ if (source == flashSelectionButton)
25742659 {
25752660 CameraPane.flash = true;
25762661 refreshContents();
25772662 } else
2578
- if (event.getSource() == oneButton)
2663
+ if (source == oneButton)
25792664 {
25802665 } else
2581
- if (event.getSource() == twoButton)
2666
+ if (source == twoButton)
25822667 {
25832668 radio.layout = twoButton;
25842669 // bug
25852670 //gridPanel.setDividerLocation(1.0);
25862671 //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();
2672
+// bigThree.remove(scenePanel);
2673
+// bigThree.remove(centralPanel);
2674
+// bigThree.remove(XYZPanel);
2675
+// aWindowConstraints.gridx = 0;
2676
+// aWindowConstraints.gridy = 0;
2677
+// aWindowConstraints.gridwidth = 1;
2678
+// // aConstraints.gridheight = 3;
2679
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2680
+// aWindowConstraints.weightx = 0;
2681
+// aWindowConstraints.weighty = 1;
2682
+// //bigThree.add(jtp, aWindowConstraints);
2683
+// aWindowConstraints.weightx = 1;
2684
+// aWindowConstraints.gridwidth = 3;
2685
+// // aConstraints.gridheight = 3;
2686
+// aWindowConstraints.gridx = 1;
2687
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2688
+// bigThree.add(centralPanel, aWindowConstraints);
2689
+// aWindowConstraints.weightx = 0;
2690
+// aWindowConstraints.gridx = 4;
2691
+// aWindowConstraints.gridwidth = 1;
2692
+// // aConstraints.gridheight = 3;
2693
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2694
+// //bigThree.add(XYZPanel, aWindowConstraints);
2695
+// scenePanel.setVisible(false);
2696
+// centralPanel.setVisible(true);
2697
+// XYZPanel.setVisible(false);
2698
+ bigThree.ClearUI();
2699
+ bigThree.add(centralPanel);
2700
+ bigThree.FlushUI();
26112701 } else
2612
- if (event.getSource() == threeButton)
2702
+ if (source == threeButton)
26132703 {
26142704 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();
2705
+
2706
+// bigThree.remove(scenePanel);
2707
+// bigThree.remove(centralPanel);
2708
+// bigThree.remove(XYZPanel);
2709
+// aWindowConstraints.gridx = 0;
2710
+// aWindowConstraints.gridy = 0;
2711
+// aWindowConstraints.gridwidth = 1;
2712
+// // aConstraints.gridheight = 3;
2713
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2714
+// aWindowConstraints.weightx = 0;
2715
+// aWindowConstraints.weighty = 1;
2716
+// //bigThree.add(jtp, aWindowConstraints);
2717
+// aWindowConstraints.weightx = 1;
2718
+// aWindowConstraints.gridwidth = 3;
2719
+// // aConstraints.gridheight = 3;
2720
+// aWindowConstraints.gridx = 1;
2721
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2722
+// bigThree.add(centralPanel, aWindowConstraints);
2723
+// aWindowConstraints.weightx = 0;
2724
+// aWindowConstraints.gridx = 4;
2725
+// aWindowConstraints.gridwidth = 1;
2726
+// // aConstraints.gridheight = 3;
2727
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2728
+// bigThree.add(XYZPanel, aWindowConstraints);
2729
+// bigThree.validate();
2730
+// scenePanel.setVisible(false);
2731
+// centralPanel.setVisible(true);
2732
+// XYZPanel.setVisible(true);
2733
+ bigThree.ClearUI();
2734
+ bigThree.add(centralPanel);
2735
+ bigThree.add(XYZPanel);
2736
+ bigThree.FlushUI();
26392737 } else
2640
- if (event.getSource() == fourButton)
2738
+ if (source == fourButton)
26412739 {
26422740 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();
2741
+
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aWindowConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2750
+// aWindowConstraints.weightx = 1;
2751
+// aWindowConstraints.weighty = 1;
2752
+// bigThree.add(scenePanel, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// //bigThree.add(cameraPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aWindowConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// bigThree.validate();
2766
+// scenePanel.setVisible(true);
2767
+// centralPanel.setVisible(false);
2768
+// XYZPanel.setVisible(false);
2769
+ bigThree.ClearUI();
2770
+ bigThree.add(scenePanel);
2771
+ bigThree.FlushUI();
26672772 } else
2668
- if (event.getSource() == sixButton)
2773
+ if (source == sixButton)
26692774 {
26702775 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();
2776
+
2777
+// bigThree.remove(scenePanel);
2778
+// bigThree.remove(centralPanel);
2779
+// bigThree.remove(XYZPanel);
2780
+// aWindowConstraints.gridx = 0;
2781
+// aWindowConstraints.gridy = 0;
2782
+// aWindowConstraints.gridwidth = 1;
2783
+// // aConstraints.gridheight = 3;
2784
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2785
+// aWindowConstraints.weightx = 0;
2786
+// aWindowConstraints.weighty = 1;
2787
+// bigThree.add(scenePanel, aWindowConstraints);
2788
+// aWindowConstraints.weightx = 1;
2789
+// aWindowConstraints.gridwidth = 3;
2790
+// // aWindowConstraints.gridheight = 3;
2791
+// aWindowConstraints.gridx = 1;
2792
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2793
+// bigThree.add(centralPanel, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 0;
2795
+// aWindowConstraints.gridx = 4;
2796
+// aWindowConstraints.gridwidth = 1;
2797
+// // aWindowConstraints.gridheight = 3;
2798
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2799
+// //bigThree.add(XYZPanel, aConstraints);
2800
+// bigThree.validate();
2801
+// scenePanel.setVisible(true);
2802
+// centralPanel.setVisible(true);
2803
+// XYZPanel.setVisible(false);
2804
+ bigThree.ClearUI();
2805
+ bigThree.add(scenePanel);
2806
+ bigThree.add(centralPanel);
2807
+ bigThree.FlushUI();
26952808 } else
2696
- if (event.getSource() == sevenButton)
2809
+ if (source == sevenButton)
26972810 {
26982811 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();
2812
+
2813
+// bigThree.remove(scenePanel);
2814
+// bigThree.remove(centralPanel);
2815
+// bigThree.remove(XYZPanel);
2816
+// aWindowConstraints.gridx = 0;
2817
+// aWindowConstraints.gridy = 0;
2818
+// aWindowConstraints.gridwidth = 1;
2819
+// // aWindowConstraints.gridheight = 3;
2820
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
+// aWindowConstraints.weightx = 0;
2822
+// aWindowConstraints.weighty = 1;
2823
+// bigThree.add(scenePanel, aWindowConstraints);
2824
+// aWindowConstraints.weightx = 1;
2825
+// aWindowConstraints.gridwidth = 3;
2826
+// // aWindowConstraints.gridheight = 3;
2827
+// aWindowConstraints.gridx = 1;
2828
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2829
+// bigThree.add(centralPanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 0;
2831
+// aWindowConstraints.gridx = 4;
2832
+// aWindowConstraints.gridwidth = 1;
2833
+// // aConstraints.gridheight = 3;
2834
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2835
+// bigThree.add(XYZPanel, aWindowConstraints);
2836
+// bigThree.validate();
2837
+// scenePanel.setVisible(true);
2838
+// centralPanel.setVisible(true);
2839
+// XYZPanel.setVisible(true);
2840
+ bigThree.ClearUI();
2841
+ bigThree.add(scenePanel);
2842
+ bigThree.add(centralPanel);
2843
+ bigThree.add(XYZPanel);
2844
+ bigThree.FlushUI();
27232845 } else
2724
- if (event.getSource() == rootButton)
2846
+ if (source == rootButton)
27252847 {
27262848 Object3D obj;
27272849 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2855,7 @@
27332855
27342856 refreshContents(true);
27352857 } else
2736
- if (event.getSource() == closeButton)
2858
+ if (source == closeButton)
27372859 {
27382860 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392861 cRadio ab;
....@@ -2754,11 +2876,11 @@
27542876 }
27552877 refreshContents(true);
27562878 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
2879
+ if (source == editItem || source == editButton)
27582880 {
27592881 EditSelection(false);
27602882 } else
2761
- if (event.getSource() == uneditButton)
2883
+ if (source == uneditButton)
27622884 {
27632885 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27642886 {
....@@ -2770,12 +2892,12 @@
27702892
27712893 child.editWindow = null; // ???????????
27722894 }
2773
- objEditor.ctrlPanel.revalidate();
2895
+ objEditor.ctrlPanel.validate();
27742896 //objEditor.jTree.clearSelection();
27752897 //objEditor.ResetSliders();
27762898 refreshContents(true);
27772899 } else
2778
- if (event.getSource() == clearPanelButton)
2900
+ if (source == clearPanelButton)
27792901 {
27802902 assert(copy == group);
27812903 //copy.ClearUI();
....@@ -2786,7 +2908,7 @@
27862908 listUI.clear();
27872909 refreshContents(true);
27882910 } else
2789
- if (event.getSource() == allParamsButton)
2911
+ if (source == allParamsButton)
27902912 {
27912913 assert(copy == group);
27922914
....@@ -2807,19 +2929,19 @@
28072929
28082930 refreshContents(true);
28092931 } else
2810
- if (event.getSource() == unselectButton)
2932
+ if (source == unselectButton)
28112933 {
28122934 objEditor.jTree.clearSelection();
28132935 // ?? oct 2012 GrafreeD.clipboard.clear();
28142936 objEditor.ResetSliders();
28152937 refreshContents(true);
28162938 } else
2817
- if(event.getSource() instanceof cRadio)
2939
+ if(source instanceof cRadio)
28182940 {
28192941 group.parent = keepparent;
28202942 group.attributes = 0;
28212943 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
2944
+ /*cRadio*/ radio = (cRadio)source;
28232945 Object3D obj = radio.GetObject();
28242946 System.out.println("Edit " + obj);
28252947 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +2961,7 @@
28392961 }
28402962
28412963 copy = group;
2842
- //CameraPane.theRenderer.object = group;
2964
+ //Globals.theRenderer.object = group;
28432965 if(!useclient)
28442966 {
28452967 cameraView.renderCamera = radio.camera;
....@@ -2848,7 +2970,8 @@
28482970 cameraView.cameras[cameraView.cameracount] = radio.camera;
28492971 cameraView.targetLookAt.set(radio.camera.lookAt);
28502972 cameraView.object = group;
2851
- cameraView.lighttouched = true;
2973
+ //cameraView.lighttouched = true;
2974
+ Globals.lighttouched = true;
28522975 topView.object = group;
28532976 frontView.object = group;
28542977 sideView.object = group;
....@@ -2884,7 +3007,7 @@
28843007 if (useclient)
28853008 {
28863009 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3010
+ Globals.lighttouched = true;
28883011 //topView.object = client;
28893012 //frontView.object = client;
28903013 //sideView.object = client;
....@@ -2892,7 +3015,7 @@
28923015 else
28933016 {
28943017 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3018
+ Globals.lighttouched = true;
28963019 //topView.object = group;
28973020 //frontView.object = group;
28983021 //sideView.object = group;
....@@ -3173,6 +3296,13 @@
31733296 refreshContents();
31743297 }
31753298
3299
+ void GenNormalsMINE()
3300
+ {
3301
+ group.selection.GenNormalsMINE();
3302
+
3303
+ refreshContents();
3304
+ }
3305
+
31763306 void Stripify()
31773307 {
31783308 group.StripifyS();
....@@ -3393,7 +3523,7 @@
33933523 String pigment = Object3D.GetPigment(tex);
33943524 //String bump = Object3D.GetBump(tex);
33953525
3396
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3526
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33973527
33983528 double s = v.s;
33993529
....@@ -3441,12 +3571,26 @@
34413571
34423572 void Align()
34433573 {
3574
+ if (group.selection.size() == 0)
3575
+ return;
3576
+
3577
+ cVector bbmin = new cVector();
3578
+ cVector bbmax = new cVector();
3579
+
3580
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3581
+
3582
+ double dx = bbmax.x - bbmin.x;
3583
+ double dy = bbmax.y - bbmin.y;
3584
+ double dz = bbmax.z - bbmin.z;
3585
+
3586
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3587
+
34443588 for (int i=0; i<group.selection.size(); i++)
34453589 {
34463590 Object3D obj = group.selection.get(i);
34473591
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3592
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3593
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503594 }
34513595
34523596 refreshContents();
....@@ -3680,7 +3824,7 @@
36803824 group.selection.RelinkToSupport(); // july 2014
36813825 System.out.println("DONE.");
36823826 refreshContents();
3683
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3827
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36843828 }
36853829
36863830 void ReduceMesh(boolean reduction34)
....@@ -3956,25 +4100,25 @@
39564100 System.err.println("info : " + child.GetPath());
39574101 }
39584102 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4103
+// else
4104
+// {
4105
+// objEditor.SetMaterial(group); // .GetMaterial());
4106
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4107
+// System.err.println("info : " + group.GetPath());
4108
+// }
39654109
39664110 objEditor.SetText(); // jan 2014
39674111
3968
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4112
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39694113 CameraPane.flash = true;
39704114
39714115 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724116 // a camera
39734117 {
39744118 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;
4119
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4120
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4121
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784122 }
39794123
39804124 refreshContents();
....@@ -4468,6 +4612,26 @@
44684612 makeSomething(csg);
44694613 }
44704614
4615
+ void Ungroup(Object3D g)
4616
+ {
4617
+ if (g instanceof HiddenObject)
4618
+ {
4619
+ HiddenObject h = (HiddenObject) g;
4620
+
4621
+ for (int i=0; i<h.ActualSize(); i++)
4622
+ {
4623
+ objEditor.makeSomething(h.get(i), false);
4624
+ }
4625
+ }
4626
+ else
4627
+ {
4628
+ for (int i=0; i<g.Size(); i++)
4629
+ {
4630
+ objEditor.makeSomething(g.get(i), false);
4631
+ }
4632
+ }
4633
+ }
4634
+
44714635 void ungroup()
44724636 {
44734637 /*
....@@ -4827,6 +4991,7 @@
48274991 private MenuItem resetsupportItem;
48284992 private MenuItem resetreferencesItem;
48294993 private MenuItem linkverticesItem;
4994
+ private MenuItem relinkverticesItem;
48304995 private MenuItem setMasterItem;
48314996 private MenuItem resetMeshItem;
48324997 private MenuItem stepAllItem;
....@@ -4845,8 +5010,10 @@
48455010 private MenuItem clearItem;
48465011 private MenuItem clearAllItem;
48475012 private MenuItem genUVItem;
5013
+ private MenuItem genNormalsMESHItem;
48485014 private MenuItem genNormalsCADItem;
48495015 private MenuItem genNormalsORGANItem;
5016
+ private MenuItem genNormalsMINEItem;
48505017 private MenuItem stripifyItem;
48515018 private MenuItem unstripifyItem;
48525019 private MenuItem trimItem;
....@@ -4888,6 +5055,7 @@
48885055 private MenuItem resetCentroidItem;
48895056 private MenuItem transformgeometryItem;
48905057 private MenuItem resetTransformItem;
5058
+ private MenuItem hideItem;
48915059 private MenuItem grabItem;
48925060 private MenuItem backItem;
48935061 private MenuItem frontItem;
....@@ -4908,6 +5076,7 @@
49085076
49095077 private MenuItem resetParentItem;
49105078 private MenuItem repairParentItem;
5079
+ private MenuItem repairShadowItem;
49115080 private MenuItem sortbysizeItem;
49125081 private MenuItem sortbynameItem;
49135082
....@@ -4928,6 +5097,7 @@
49285097 private MenuItem coneItem;
49295098 private MenuItem torusItem;
49305099 private MenuItem superItem;
5100
+ private MenuItem kleinItem;
49315101 private MenuItem blobItem;
49325102 private MenuItem latheItem;
49335103 private MenuItem bezierItem;
....@@ -4940,6 +5110,7 @@
49405110 private MenuItem csgItem;
49415111 private MenuItem templateItem;
49425112 private MenuItem textureItem;
5113
+ private MenuItem billboardItem;
49435114 private MenuItem shadowXItem;
49445115 private MenuItem shadowYItem;
49455116 private MenuItem shadowZItem;