Normand Briere
2019-05-01 20c1a07b76c39462594aedfedfe6e6adb17cd552
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,6 +234,10 @@
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("-");
235242 randomItem = menu.add(new MenuItem("Random"));
236243 randomItem.addActionListener(this);
....@@ -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"));
....@@ -287,6 +294,8 @@
287294 genNormalsCADItem.addActionListener(this);
288295 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289296 genNormalsMESHItem.addActionListener(this);
297
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298
+ genNormalsMINEItem.addActionListener(this);
290299 stripifyItem = menu.add(new MenuItem("Stripify"));
291300 stripifyItem.addActionListener(this);
292301 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -425,84 +434,30 @@
425434 oe.radioPanel.add(dummyButton);
426435 oe.buttonGroup.add(dummyButton);
427436 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431438
432
- 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");
433441 liveCB.addItemListener(this);
434442
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- 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");
453445 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- 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");
495449 trackCB.addItemListener(this);
496450
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
452
+ screenfitButton.setToolTipText("Screen fit");
499453 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
454
+
501455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502456 // screenfitpointButton.addActionListener(this);
503457 // oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
458
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
505459 snapobjectButton.addActionListener(this);
460
+ snapobjectButton.setToolTipText("Snap Object");
506461 oe.aConstraints.gridx += 1;
507462
508463 //aConstraints.gridx = 0;
....@@ -510,65 +465,66 @@
510465 oe.aConstraints.weighty = 0;
511466 oe.aConstraints.gridwidth = 1;
512467
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
469
+ flashSelectionButton.setToolTipText("Show selection");
514470 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518471
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
472
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473
+
474
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
475
+ twoButton.setToolTipText("Show center view only");
521476 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523478 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
479
+ fourButton.setToolTipText("Show left panel only");
480
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
+ sixButton.setToolTipText("2-column layout left");
525482 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
+ threeButton.setToolTipText("2-column layout right");
527485 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
486
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
487
+ sevenButton.setToolTipText("3-column layout");
529488 sevenButton.addActionListener(this);
530489 //
531490
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
491
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ rootButton.setToolTipText("Edit selection in new tab");
533493 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
494
+
495
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
496
+ closeButton.setToolTipText("Close tab");
536497 closeButton.addActionListener(this);
537498 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538499 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540500
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
501
+ cGridBag commandsPanel = new cGridBag();
502
+
503
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ editButton.setToolTipText("Edit selection");
543505 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547506
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
507
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ uneditButton.setToolTipText("Unedit selection");
549509 uneditButton.addActionListener(this);
550510
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
511
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ clearPanelButton.setToolTipText("Clear edit panel");
556513 clearPanelButton.addActionListener(this);
557514
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
515
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ allParamsButton.setToolTipText("All params??");
563517 allParamsButton.addActionListener(this);
564518
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
519
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ unselectButton.setToolTipText("Unselect");
570521 unselectButton.addActionListener(this);
571522
523
+ commandsPanel.preferredHeight = 1;
524
+
525
+ oe.treePanel.add(commandsPanel);
526
+ oe.treePanel.Return();
527
+
572528 // oe.aConstraints.gridx += 1;
573529 // oe.aConstraints.weighty = 0;
574530 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +536,37 @@
580536 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581537 // gcButton.addActionListener(this);
582538
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
539
+ cGridBag jSPPanel = new cGridBag();
540
+
541
+ JScrollPane jSP;
594542 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
543
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596544 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
545
+
546
+ oe.treePanel.add(jSPPanel);
547
+ oe.treePanel.Return();
601548
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
549
+ cGridBag copyOptionsPanel = new cGridBag();
550
+
551
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
552
+ colorCB.setToolTipText("Copy color when dropped");
606553 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
556
+ materialCB.setToolTipText("Copy material when dropped");
609557 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
558
+
559
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
560
+ textureCB.setToolTipText("Copy texture when dropped");
612561 textureCB.addItemListener(this);
613562
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
563
+ copyOptionsPanel.preferredHeight = 1;
564
+ oe.treePanel.add(copyOptionsPanel);
565
+ oe.treePanel.Return();
616566
567
+// mainPanel.setDividerLocation(0.5); //1.0);
568
+// mainPanel.setResizeWeight(0.5);
569
+
617570 //jList.addListSelectionListener(this);
618571 oe.jTree.addTreeSelectionListener(this);
619572 //jTree.setRootVisible(false);
....@@ -635,17 +588,85 @@
635588 radio.layout = sevenButton;
636589 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637590 }
591
+
592
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593
+ {
594
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
+ supportCB.setToolTipText("Enabled rigging");
596
+ supportCB.addItemListener(this);
597
+
598
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
599
+ // localCB.addItemListener(this);
600
+
601
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
602
+ crowdCB.setToolTipText("Used for crowds");
603
+ crowdCB.addItemListener(this);
604
+
605
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
606
+ smoothCB.setToolTipText("Snapping delay");
607
+ smoothCB.addItemListener(this);
608
+
609
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
610
+ slowCB.setToolTipText("Smooth interpolation");
611
+ slowCB.addItemListener(this);
612
+
613
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
614
+ boxCB.setToolTipText("Display bounding boxes");
615
+ boxCB.addItemListener(this);
616
+
617
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
618
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
619
+ zoomBoxCB.addItemListener(this);
620
+
621
+// constraints.gridy += 1;
622
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623
+// speakerMocapCB.addItemListener(this);
624
+
625
+ if (false)
626
+ {
627
+ // handled in scripts
628
+ //constraints.gridy += 1;
629
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
630
+ speakerCameraCB.addItemListener(this);
631
+
632
+ //constraints.gridy += 1;
633
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
634
+ speakerFocusCB.addItemListener(this);
635
+
636
+ //constraints.gridy += 1;
637
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
638
+ smoothfocusCB.addItemListener(this);
639
+ }
640
+
641
+//constraints.gridx += 1;
642
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
643
+// debugCB.addItemListener(this);
644
+
645
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
646
+ oeilCB.addItemListener(this);
647
+
648
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649
+ lookAtCB.setToolTipText("Look-at target");
650
+ lookAtCB.addItemListener(this);
651
+
652
+ cGridBag fill = new cGridBag();
653
+
654
+ fill.preferredHeight = 200;
655
+
656
+ panel.add(fill);
657
+
658
+ }
638659
639660 void EditObject(Object3D obj)
640661 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
662
+ cRadio radioButton = new cRadio(obj.name);
663
+ radioButton.SetObject(obj);
664
+ radioButton.layout = sevenButton;
665
+ radioButton.SetCamera(cameraView.renderCamera, false);
666
+ radioButton.addActionListener(this);
667
+ radioPanel.add(radioButton);
668
+ buttonGroup.add(radioButton);
669
+ radioButton.doClick();
649670 }
650671 void SetupViews(ObjEditor oe)
651672 {
....@@ -665,6 +686,7 @@
665686 JCheckBox fastCB;
666687 JCheckBox slowCB;
667688 JCheckBox boxCB;
689
+ JCheckBox zoomBoxCB;
668690 JCheckBox trackCB;
669691 JCheckBox smoothfocusCB;
670692 // JCheckBox speakerMocapCB;
....@@ -707,8 +729,7 @@
707729 dropAttributes |= Object3D.TEXTURE;
708730 else
709731 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
732
+ } else if(e.getSource() == liveCB)
712733 {
713734 cameraView.ToggleLive();
714735 }
....@@ -745,6 +766,10 @@
745766 Recompile();
746767 cameraView.repaint();
747768 // refreshContents();
769
+ }
770
+ else if(e.getSource() == zoomBoxCB)
771
+ {
772
+ cameraView.ToggleZoomBoxMode();
748773 }
749774 else if(e.getSource() == smoothfocusCB)
750775 {
....@@ -1035,6 +1060,8 @@
10351060 torusItem.addActionListener(this);
10361061 superItem = menu.add(new MenuItem("Superellipsoid"));
10371062 superItem.addActionListener(this);
1063
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1064
+ kleinItem.addActionListener(this);
10381065 particleItem = menu.add(new MenuItem("Particle system"));
10391066 particleItem.addActionListener(this);
10401067 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1075,7 +1102,7 @@
10751102 {
10761103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771104 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
10791106
10801107 menu.add("-");
10811108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1108,6 +1135,8 @@
11081135 resetParentItem.addActionListener(this);
11091136 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101137 repairParentItem.addActionListener(this);
1138
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1139
+ repairShadowItem.addActionListener(this);
11111140 menu.add(invariantsItem = new MenuItem("Invariants"));
11121141 invariantsItem.addActionListener(this);
11131142 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1468,6 +1497,7 @@
14681497 //
14691498 public void actionPerformed(ActionEvent event) // , Object arg)
14701499 {
1500
+ Object source = event.getSource();
14711501 /*
14721502 if (event.getSource() == nameField)
14731503 {
....@@ -1479,11 +1509,11 @@
14791509 }
14801510 else
14811511 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1512
+ if (source == lookAtItem || source == lookFromItem)
14831513 {
14841514 ScreenFit();
14851515 } else
1486
- if (event.getSource() == switchItem)
1516
+ if (source == switchItem)
14871517 {
14881518 cVector v1 = new cVector();
14891519 cVector v2 = new cVector();
....@@ -1492,11 +1522,11 @@
14921522 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931523 objEditor.cameraView.repaint();
14941524 } else
1495
- if (event.getSource() == rectoidItem)
1525
+ if (source == rectoidItem)
14961526 {
14971527 makeSomething(new Box());
14981528 } else
1499
- if (event.getSource() == particleItem)
1529
+ if (source == particleItem)
15001530 {
15011531 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021532 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1547,9 @@
15171547 applyExample(particleGeom, "SMOKE");
15181548 makeSomething(particleGeom);
15191549 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1550
+ if (source == ragdollItem || source == ragdoll2Item)
15211551 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1552
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231553
15241554 ragdoll.toParent = LA.newMatrix();
15251555 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1567,7 @@
15371567 } else
15381568 /*
15391569 */
1540
- if (event.getSource() == heightFieldItem)
1570
+ if (source == heightFieldItem)
15411571 {
15421572 Object3D obj = new Object3D();
15431573
....@@ -1575,27 +1605,31 @@
15751605
15761606 makeSomething(obj);
15771607 } else
1578
- if (event.getSource() == gridItem)
1608
+ if (source == gridItem)
15791609 {
15801610 makeSomething(new Grid());
15811611 } else
1582
- if (event.getSource() == ellipsoidItem)
1612
+ if (source == ellipsoidItem)
15831613 {
15841614 makeSomething(new Sphere());
15851615 } else
1586
- if (event.getSource() == coneItem)
1616
+ if (source == coneItem)
15871617 {
15881618 makeSomething(new Cone());
15891619 } else
1590
- if (event.getSource() == torusItem)
1620
+ if (source == torusItem)
15911621 {
15921622 makeSomething(new Torus());
15931623 } else
1594
- if (event.getSource() == superItem)
1624
+ if (source == superItem)
15951625 {
15961626 makeSomething(new Superellipsoid());
15971627 } else
1598
- if (event.getSource() == blobItem)
1628
+ if (source == kleinItem)
1629
+ {
1630
+ makeSomething(new Klein());
1631
+ } else
1632
+ if (source == blobItem)
15991633 {
16001634 Blob blob = new Blob();
16011635 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1637,15 @@
16031637 //blob.retile();
16041638 makeSomething(blob);
16051639 } else
1606
- if (event.getSource() == latheItem)
1640
+ if (source == latheItem)
16071641 {
16081642 makeSomething(new Lathe());
16091643 } else
1610
- if (event.getSource() == bezierItem)
1644
+ if (source == bezierItem)
16111645 {
16121646 makeSomething(new BezierSurface());
16131647 } else
1614
- if (event.getSource() == checkerItem)
1648
+ if (source == checkerItem)
16151649 {
16161650 /*
16171651 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1660,7 @@
16261660 */
16271661 makeSomething(new Checker());
16281662 } else
1629
- if (event.getSource() == meshItem)
1663
+ if (source == meshItem)
16301664 {
16311665 Object3D itemtomake = new Object3D();
16321666 Object3D child;
....@@ -1647,35 +1681,35 @@
16471681 makeSomething(child);
16481682 }
16491683 } else
1650
- if (event.getSource() == springItem)
1684
+ if (source == springItem)
16511685 {
16521686 cSpring s = new cSpring();
16531687 s.setup();
16541688 makeSomething(s);
16551689 } else
1656
- if (event.getSource() == flagItem)
1690
+ if (source == flagItem)
16571691 {
16581692 cSpring s = new cFlag();
16591693 s.setup();
16601694 makeSomething(s);
16611695 } else
1662
- if (event.getSource() == lightItem)
1696
+ if (source == lightItem)
16631697 {
16641698 makeSomething(new Light());
16651699 } else
1666
- if (event.getSource() == csgItem)
1700
+ if (source == csgItem)
16671701 {
16681702 group(new CSG());
16691703 } else
1670
- if (event.getSource() == templateItem)
1704
+ if (source == templateItem)
16711705 {
16721706 group(new cTemplate());
16731707 } else
1674
- if (event.getSource() == attributeItem)
1708
+ if (source == attributeItem)
16751709 {
16761710 makeSomething(new Attribute());
16771711 } else
1678
- if (event.getSource() == pointflowItem)
1712
+ if (source == pointflowItem)
16791713 {
16801714 makeSomething(new PointFlow());
16811715 } else
....@@ -1687,7 +1721,7 @@
16871721 } else
16881722 */
16891723
1690
- if (event.getSource() == superLoopItem)
1724
+ if (source == superLoopItem)
16911725 {
16921726 Composite g = new cGroup();
16931727 for (int i=0; i<15; i++)
....@@ -1709,7 +1743,7 @@
17091743
17101744 group(g);
17111745 } else
1712
- if (event.getSource() == loopItem)
1746
+ if (source == loopItem)
17131747 {
17141748 Composite csg = new GroupLeaf();
17151749 csg.count = 5;
....@@ -1718,7 +1752,7 @@
17181752 csg.addChild(child);
17191753 child.addChild(csg);
17201754 } else
1721
- if (event.getSource() == doubleItem)
1755
+ if (source == doubleItem)
17221756 {
17231757 Composite csg = new GroupLeaf();
17241758 csg.count = 5;
....@@ -1730,7 +1764,7 @@
17301764 csg.addChild(child);
17311765 child.addChild(csg);
17321766 } else
1733
- if (event.getSource() == tripleItem)
1767
+ if (source == tripleItem)
17341768 {
17351769 Composite csg = new GroupLeaf();
17361770 csg.count = 4;
....@@ -1746,70 +1780,70 @@
17461780 child.addChild(csg);
17471781 } else
17481782
1749
- if (event.getSource() == importGFDItem)
1783
+ if (source == importGFDItem)
17501784 {
17511785 ImportGFD();
17521786 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1787
+ if (source == importVRMLX3DItem)
17541788 {
17551789 ImportVRMLX3D();
17561790 } else
1757
- if (event.getSource() == import3DSItem)
1791
+ if (source == import3DSItem)
17581792 {
17591793 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17601794 } else
1761
- if (event.getSource() == importOBJItem)
1795
+ if (source == importOBJItem)
17621796 {
17631797 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17641798 } else
1765
- if (event.getSource() == computeAOItem)
1799
+ if (source == computeAOItem)
17661800 {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1801
+ Globals.drawMode = CameraPane.OCCLUSION;
1802
+ Globals.theRenderer.repaint();
17691803 } else
1770
- if (event.getSource() == recompileItem)
1804
+ if (source == recompileItem)
17711805 {
17721806 Recompile();
17731807 refreshContents();
17741808 } else
1775
- if (event.getSource() == editScriptItem)
1809
+ if (source == editScriptItem)
17761810 {
17771811 OpenDialog();
17781812 refreshContents();
17791813 } else
1780
- if (event.getSource() == invariantsItem)
1814
+ if (source == invariantsItem)
17811815 {
17821816 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1817
+ GrafreeD.grafreeD.universe.invariants();
17841818 } else
1785
- if (event.getSource() == memoryItem)
1819
+ if (source == memoryItem)
17861820 {
17871821 //System.out.println("Invariants:");
17881822 PrintMemory();
17891823 } else
1790
- if (event.getSource() == pathItem)
1824
+ if (source == pathItem)
17911825 {
17921826 PrintPath();
17931827 } else
1794
- if (event.getSource() == analyzeItem)
1828
+ if (source == analyzeItem)
17951829 {
17961830 AnalyzeObject();
17971831 } else
1798
- if (event.getSource() == dumpItem)
1832
+ if (source == dumpItem)
17991833 {
18001834 DumpObject();
18011835 } else
1802
- if (event.getSource() == screenfitButton)
1836
+ if (source == screenfitButton)
18031837 {
18041838 //Reload(lastConverter, lastFilename, true);
18051839 ScreenFit();
18061840 } else
1807
- if (event.getSource() == screenfitpointButton)
1841
+ if (source == screenfitpointButton)
18081842 {
18091843 //Reload(lastConverter, lastFilename, true);
18101844 ScreenFitPoint();
18111845 } else
1812
- if (event.getSource() == snapobjectButton)
1846
+ if (source == snapobjectButton)
18131847 {
18141848 //Reload(lastConverter, lastFilename, true);
18151849 SnapObject();
....@@ -1820,13 +1854,13 @@
18201854 // Recompile();
18211855 // refreshContents();
18221856 // } else
1823
- if (event.getSource() == gcButton)
1857
+ if (source == gcButton)
18241858 {
18251859 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261860 System.gc();
18271861 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281862 } else
1829
- if (event.getSource() == editLeafItem)
1863
+ if (source == editLeafItem)
18301864 {
18311865 Object3D obj;
18321866 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1874,62 @@
18401874 }
18411875 refreshContents(true);
18421876 } else
1843
- if (event.getSource() == openWindowItem)
1877
+ if (source == openWindowItem)
18441878 {
18451879 EditSelection(true);
18461880 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1881
+ if (source == cutItem || source == clearButton)
18481882 {
18491883 loadClipboard(true);
18501884 } else
1851
- if (event.getSource() == duplicateItem)
1885
+ if (source == duplicateItem)
18521886 {
18531887 Object3D keep = GrafreeD.clipboard;
18541888 loadClipboard(false);
18551889 paste(false);
18561890 GrafreeD.clipboard = keep;
18571891 } else
1858
- if (event.getSource() == cloneItem)
1892
+ if (source == cloneItem)
18591893 {
18601894 CloneSelection(false);
18611895 } else
1862
- if (event.getSource() == cloneSupportItem)
1896
+ if (source == cloneSupportItem)
18631897 {
18641898 CloneSelection(true);
18651899 } else
1866
- if (event.getSource() == copyItem)
1900
+ if (source == copyItem)
18671901 {
18681902 loadClipboard(false);
18691903 } else
1870
- if (event.getSource() == pasteItem)
1904
+ if (source == pasteItem)
18711905 {
18721906 paste(false);
18731907 } else
1874
- if (event.getSource() == pasteLinkItem)
1908
+ if (source == pasteLinkItem)
18751909 {
18761910 pasteInto(false);
18771911 } else
1878
- if (event.getSource() == pasteCloneItem)
1912
+ if (source == pasteCloneItem)
18791913 {
18801914 pasteInto(true);
18811915 } else
1882
- if (event.getSource() == pasteExpandItem)
1916
+ if (source == pasteExpandItem)
18831917 {
18841918 paste(true);
18851919 } else
1886
- if (event.getSource() == synchronizeItem)
1920
+ if (source == synchronizeItem)
18871921 {
18881922 Overwrite(Object3D.TRANSFORM);
18891923 } else
1890
- if (event.getSource() == overwriteNameItem)
1924
+ if (source == overwriteNameItem)
18911925 {
18921926 Overwrite(Object3D.NAME);
18931927 } else
1894
- if (event.getSource() == overwriteUVItem)
1928
+ if (source == overwriteUVItem)
18951929 {
18961930 Overwrite(Object3D.UV);
18971931 } else
1898
- if (event.getSource() == overwriteMatItem)
1932
+ if (source == overwriteMatItem)
18991933 {
19001934 /* july 2015
19011935 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +1949,7 @@
19151949
19161950 Overwrite(dropAttributes);
19171951 }
1918
- if (event.getSource() == overwriteGeoItem)
1952
+ if (source == overwriteGeoItem)
19191953 {
19201954 Overwrite(Object3D.GEOMETRY);
19211955 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +1966,7 @@
19321966 // refreshContents();
19331967 // }
19341968 } else
1935
- if (event.getSource() == generateMeshItem)
1969
+ if (source == generateMeshItem)
19361970 {
19371971 //if (group.selection.size() == 1)
19381972 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +1977,7 @@
19431977 ResetModel();
19441978 refreshContents();
19451979 } else
1946
- if (event.getSource() == extractGeometriesItem)
1980
+ if (source == extractGeometriesItem)
19471981 {
19481982 boolean one = false;
19491983
....@@ -1970,7 +2004,7 @@
19702004 ResetModel();
19712005 refreshContents();
19722006 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2007
+ if (source == cloneGeometriesItem)
19742008 {
19752009 boolean one = false;
19762010
....@@ -1996,32 +2030,37 @@
19962030 ResetModel();
19972031 refreshContents();
19982032 } else
1999
- if (event.getSource() == shareGeometriesItem)
2033
+ if (source == shareGeometriesItem)
20002034 {
20012035 boolean one = false;
20022036
20032037 if (group.selection.size() == 1)
20042038 one = true;
20052039
2040
+ Object3D merge = null;
2041
+
20062042 Object3D content = new cGroup();
20072043
20082044 for (int i=0; i<group.selection.size(); i++)
20092045 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2046
+ merge = new Merge(group.selection.get(i));
20112047
20122048 if (one)
2013
- makeSomething(sel, false);
2049
+ makeSomething(merge, false);
20142050 else
2015
- content.addChild(sel);
2051
+ content.addChild(merge);
20162052 }
20172053
20182054 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2055
+ makeSomething(content, true);
2056
+ else
2057
+ {
2058
+ ResetModel();
2059
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2060
+ refreshContents();
2061
+ }
20232062 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2063
+ if (source == mergeGeometriesItem)
20252064 {
20262065 boolean one = false;
20272066
....@@ -2051,7 +2090,7 @@
20512090 ResetModel();
20522091 refreshContents();
20532092 } else
2054
- if (event.getSource() == linkverticesItem)
2093
+ if (source == linkverticesItem)
20552094 {
20562095 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572096 // {
....@@ -2071,7 +2110,7 @@
20712110 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722111 content = ((cGroup)content).get(0);
20732112
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2113
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752114 for (int i=0; i<group.selection.size(); i++)
20762115 {
20772116 boolean random = CameraPane.RANDOM;
....@@ -2080,11 +2119,11 @@
20802119 // group.selection.get(i).setMasterThis(content); // should be identity
20812120 CameraPane.RANDOM = random;
20822121 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2122
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842123 refreshContents();
20852124 }
20862125 } else
2087
- if (event.getSource() == resetsupportItem)
2126
+ if (source == resetsupportItem)
20882127 {
20892128 for (int i=0; i<group.selection.size(); i++)
20902129 {
....@@ -2096,7 +2135,16 @@
20962135
20972136 refreshContents();
20982137 } else
2099
- if (event.getSource() == resetreferencesItem)
2138
+ if (source == relinkverticesItem)
2139
+ {
2140
+ boolean random = CameraPane.RANDOM;
2141
+ CameraPane.RANDOM = false; // parse all random nodes
2142
+ group.selection.RelinkToSupport();
2143
+ CameraPane.RANDOM = random;
2144
+
2145
+ refreshContents();
2146
+ } else
2147
+ if (source == resetreferencesItem)
21002148 {
21012149 for (int i=0; i<group.selection.size(); i++)
21022150 {
....@@ -2105,7 +2153,7 @@
21052153
21062154 refreshContents();
21072155 } else
2108
- if (event.getSource() == setMasterItem)
2156
+ if (source == setMasterItem)
21092157 {
21102158 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21112159 {
....@@ -2118,7 +2166,7 @@
21182166 refreshContents();
21192167 }
21202168 } else
2121
- if (event.getSource() == poseMeshItem)
2169
+ if (source == poseMeshItem)
21222170 {
21232171 if (group.selection.size() == 1)
21242172 {
....@@ -2137,19 +2185,19 @@
21372185 }
21382186
21392187 } else
2140
- if (event.getSource() == revertMeshItem)
2188
+ if (source == revertMeshItem)
21412189 {
21422190 RevertMeshes();
21432191 } else
2144
- if (event.getSource() == resetMeshItem)
2192
+ if (source == resetMeshItem)
21452193 {
21462194 ResetAll();
21472195 } else
2148
- if (event.getSource() == stepAllItem)
2196
+ if (source == stepAllItem)
21492197 {
21502198 StepAll();
21512199 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2200
+ if (source == clearItem) // || event.getSource() == clearButton)
21532201 {
21542202 //int indices[] = jList.getSelectedIndices();
21552203 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2205,46 @@
21572205
21582206 ClearSelection(false);
21592207 } else
2160
- if (event.getSource() == clearAllItem)
2208
+ if (source == clearAllItem)
21612209 {
21622210 ClearSelection(true);
21632211 } else
2164
- if (event.getSource() == grabItem)
2212
+ if (source == grabItem)
21652213 {
21662214 group(new cGroup(), true);
21672215 } else
2168
- if (event.getSource() == frontItem)
2216
+ if (source == hideItem)
2217
+ {
2218
+ group(new HiddenObject());
2219
+ } else
2220
+ if (source == frontItem)
21692221 {
21702222 front();
21712223 } else
2172
- if (event.getSource() == backItem)
2224
+ if (source == backItem)
21732225 {
21742226 back();
21752227 } else
2176
- if (event.getSource() == cameraItem)
2228
+ if (source == cameraItem)
21772229 {
21782230 makeSomething(new Camera());
21792231 } else
2180
- if (event.getSource() == compositeItem)
2232
+ if (source == compositeItem)
21812233 {
21822234 group(new Composite());
21832235 } else
2184
- if (event.getSource() == randomItem)
2236
+ if (source == randomItem)
21852237 {
21862238 RandomNode random = new RandomNode();
21872239 group(random);
21882240 if (random.size() > 0)
21892241 random.name = random.get(0).name + "Rnd";
21902242 } else
2191
- if (event.getSource() == physicsItem)
2243
+ if (source == physicsItem)
21922244 {
21932245 group(new PhysicsNode());
21942246 } else
2195
- if (event.getSource() == frameselectorItem)
2247
+ if (source == frameselectorItem)
21962248 {
21972249 for (int i=0; i<group.selection.size(); i++)
21982250 {
....@@ -2204,7 +2256,7 @@
22042256 ResetModel();
22052257 refreshContents();
22062258 } else
2207
- if (event.getSource() == switchGeoItem)
2259
+ if (source == switchGeoItem)
22082260 {
22092261 for (int i=0; i<group.selection.size(); i++)
22102262 {
....@@ -2216,7 +2268,7 @@
22162268 ResetModel();
22172269 refreshContents();
22182270 } else
2219
- if (event.getSource() == switchTransfoItem)
2271
+ if (source == switchTransfoItem)
22202272 {
22212273 for (int i=0; i<group.selection.size(); i++)
22222274 {
....@@ -2228,7 +2280,7 @@
22282280 ResetModel();
22292281 refreshContents();
22302282 } else
2231
- if (event.getSource() == morphItem)
2283
+ if (source == morphItem)
22322284 {
22332285 for (int i=0; i<group.selection.size(); i++)
22342286 {
....@@ -2240,7 +2292,7 @@
22402292 ResetModel();
22412293 refreshContents();
22422294 } else
2243
- if (event.getSource() == scriptNodeItem)
2295
+ if (source == scriptNodeItem)
22442296 {
22452297 boolean atleastone = false;
22462298
....@@ -2279,199 +2331,215 @@
22792331 }
22802332 }
22812333 } else
2282
- if (event.getSource() == linkerItem)
2334
+ if (source == linkerItem)
22832335 {
22842336 group(new cLinker());
22852337 } else
2286
- if (event.getSource() == textureItem)
2338
+ if (source == textureItem)
22872339 {
22882340 group(new TextureNode());
22892341 } else
2290
- if (event.getSource() == shadowXItem)
2342
+ if (source == billboardItem)
2343
+ {
2344
+ group(new BillboardNode());
2345
+ } else
2346
+ if (source == shadowXItem)
22912347 {
22922348 CastShadow(0);
22932349 } else
2294
- if (event.getSource() == shadowYItem)
2350
+ if (source == shadowYItem)
22952351 {
22962352 CastShadow(1);
22972353 } else
2298
- if (event.getSource() == shadowZItem)
2354
+ if (source == shadowZItem)
22992355 {
23002356 CastShadow(2);
23012357 } else
2302
- if (event.getSource() == ungroupItem)
2358
+ if (source == ungroupItem)
23032359 {
2304
- ungroup();
2360
+ //ungroup();
2361
+ for (int i=0; i<group.selection.size(); i++)
2362
+ {
2363
+ Ungroup(group.selection.get(i));
2364
+ }
2365
+
2366
+ ClearSelection(false);
2367
+
2368
+ refreshContents();
23052369 } else
2306
- if (event.getSource() == genUVItem)
2370
+ if (source == genUVItem)
23072371 {
23082372 GenUV();
23092373 } else
2310
- if (event.getSource() == genNormalsCADItem)
2374
+ if (source == genNormalsCADItem)
23112375 {
23122376 GenNormals(true);
23132377 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2378
+ if (source == genNormalsMESHItem)
23152379 {
23162380 GenNormals(true); // TODO
23172381 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2382
+ if (source == genNormalsORGANItem)
23192383 {
23202384 GenNormals(false);
23212385 } else
2322
- if (event.getSource() == stripifyItem)
2386
+ if (source == genNormalsMINEItem)
2387
+ {
2388
+ GenNormalsMINE();
2389
+ } else
2390
+ if (source == stripifyItem)
23232391 {
23242392 Stripify();
23252393 } else
2326
- if (event.getSource() == unstripifyItem)
2394
+ if (source == unstripifyItem)
23272395 {
23282396 Unstripify();
23292397 } else
2330
- if (event.getSource() == trimItem)
2398
+ if (source == trimItem)
23312399 {
23322400 Trim();
23332401 } else
2334
- if (event.getSource() == untrimItem)
2402
+ if (source == untrimItem)
23352403 {
23362404 Untrim();
23372405 } else
2338
- if (event.getSource() == clearColorsItem)
2406
+ if (source == clearColorsItem)
23392407 {
23402408 ClearColors();
23412409 } else
2342
- if (event.getSource() == clearMaterialsItem)
2410
+ if (source == clearMaterialsItem)
23432411 {
23442412 ClearMaterials();
23452413 } else
2346
- if (event.getSource() == liveleavesItem)
2414
+ if (source == liveleavesItem)
23472415 {
23482416 LiveLeaves(true);
23492417 } else
2350
- if (event.getSource() == unliveleavesItem)
2418
+ if (source == unliveleavesItem)
23512419 {
23522420 LiveLeaves(false);
23532421 } else
2354
- if (event.getSource() == supportleavesItem)
2422
+ if (source == supportleavesItem)
23552423 {
23562424 SupportLeaves(true);
23572425 } else
2358
- if (event.getSource() == unsupportleavesItem)
2426
+ if (source == unsupportleavesItem)
23592427 {
23602428 SupportLeaves(false);
23612429 } else
2362
- if (event.getSource() == hideleavesItem)
2430
+ if (source == hideleavesItem)
23632431 {
23642432 HideLeaves(true);
23652433 } else
2366
- if (event.getSource() == showleavesItem)
2434
+ if (source == showleavesItem)
23672435 {
23682436 HideLeaves(false);
23692437 } else
2370
- if (event.getSource() == markleavesItem)
2438
+ if (source == markleavesItem)
23712439 {
23722440 MarkLeaves(true);
23732441 } else
2374
- if (event.getSource() == unmarkleavesItem)
2442
+ if (source == unmarkleavesItem)
23752443 {
23762444 MarkLeaves(false);
23772445 } else
2378
- if (event.getSource() == flipVItem)
2446
+ if (source == flipVItem)
23792447 {
23802448 FlipV(true);
23812449 } else
2382
- if (event.getSource() == unflipVItem)
2450
+ if (source == unflipVItem)
23832451 {
23842452 FlipV(false);
23852453 } else
2386
- if (event.getSource() == lowTexturesItem)
2454
+ if (source == lowTexturesItem)
23872455 {
23882456 SetTexRes(0);
23892457 } else
2390
- if (event.getSource() == normalTexturesItem)
2458
+ if (source == normalTexturesItem)
23912459 {
23922460 SetTexRes(1);
23932461 } else
2394
- if (event.getSource() == highTexturesItem)
2462
+ if (source == highTexturesItem)
23952463 {
23962464 SetTexRes(2);
23972465 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2466
+ if (source == veryhighTexturesItem)
23992467 {
24002468 SetTexRes(3);
24012469 } else
2402
- if (event.getSource() == maxTexturesItem)
2470
+ if (source == maxTexturesItem)
24032471 {
24042472 SetTexRes(4);
24052473 } else
2406
- if (event.getSource() == panoTexturesItem)
2474
+ if (source == panoTexturesItem)
24072475 {
24082476 SetTexRes(5);
24092477 } else
2410
- if (event.getSource() == reverseNormalsItem)
2478
+ if (source == reverseNormalsItem)
24112479 {
24122480 ReverseNormals();
24132481 } else
2414
- if (event.getSource() == parseverticesItem)
2482
+ if (source == parseverticesItem)
24152483 {
24162484 ParseVertices();
24172485 } else
2418
- if (event.getSource() == textureFieldItem)
2486
+ if (source == textureFieldItem)
24192487 {
24202488 TextureVertices();
24212489 } else
2422
- if (event.getSource() == alignItem)
2490
+ if (source == alignItem)
24232491 {
24242492 Align();
24252493 } else
2426
- if (event.getSource() == mirrorItem)
2494
+ if (source == mirrorItem)
24272495 {
24282496 MirrorPoses();
24292497 } else
2430
- if (event.getSource() == reduceMorphItem)
2498
+ if (source == reduceMorphItem)
24312499 {
24322500 MeshReduction(false);
24332501 } else
2434
- if (event.getSource() == reduce34MorphItem)
2502
+ if (source == reduce34MorphItem)
24352503 {
24362504 MeshReduction(true);
24372505 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2506
+ if (source == reverseTrianglesItem)
24392507 {
24402508 ReverseTriangles();
24412509 } else
2442
- if (event.getSource() == reduceMeshItem)
2510
+ if (source == reduceMeshItem)
24432511 {
24442512 ReduceMesh(false);
24452513 } else
2446
- if (event.getSource() == reduce34MeshItem)
2514
+ if (source == reduce34MeshItem)
24472515 {
24482516 ReduceMesh(true);
24492517 } else
2450
- if (event.getSource() == increaseMeshItem)
2518
+ if (source == increaseMeshItem)
24512519 {
24522520 IncreaseMesh();
24532521 } else
2454
- if (event.getSource() == clipMeshItem)
2522
+ if (source == clipMeshItem)
24552523 {
24562524 ClipMesh();
24572525 } else
2458
- if (event.getSource() == smoothMeshItem)
2526
+ if (source == smoothMeshItem)
24592527 {
24602528 SmoothMesh();
24612529 } else
2462
- if (event.getSource() == transformgeometryItem)
2530
+ if (source == transformgeometryItem)
24632531 {
24642532 TransformGeometry();
24652533 } else
2466
- if (event.getSource() == resetTransformItem)
2534
+ if (source == resetTransformItem)
24672535 {
24682536 ResetTransform();
24692537 } else
2470
- if (event.getSource() == resetCentroidItem)
2538
+ if (source == resetCentroidItem)
24712539 {
24722540 ResetCentroid();
24732541 } else
2474
- if (event.getSource() == resetParentItem)
2542
+ if (source == resetParentItem)
24752543 {
24762544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772545 {
....@@ -2481,7 +2549,7 @@
24812549
24822550 refreshContents();
24832551 } else
2484
- if (event.getSource() == repairParentItem)
2552
+ if (source == repairParentItem)
24852553 {
24862554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872555 {
....@@ -2495,7 +2563,21 @@
24952563
24962564 refreshContents();
24972565 } else
2498
- if (event.getSource() == sortbysizeItem)
2566
+ if (source == repairShadowItem)
2567
+ {
2568
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2569
+ {
2570
+ Object3D obj = (Object3D)e.nextElement();
2571
+ obj.RepairShadow();
2572
+// for (int i=0; i<obj.size(); i++)
2573
+// {
2574
+// obj.get(i).parent = obj;
2575
+// }
2576
+ }
2577
+
2578
+ refreshContents();
2579
+ } else
2580
+ if (source == sortbysizeItem)
24992581 {
25002582 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012583 {
....@@ -2507,7 +2589,7 @@
25072589 ResetModel();
25082590 refreshContents();
25092591 } else
2510
- if (event.getSource() == sortbynameItem)
2592
+ if (source == sortbynameItem)
25112593 {
25122594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132595 {
....@@ -2519,7 +2601,7 @@
25192601 ResetModel();
25202602 refreshContents();
25212603 } else
2522
- if (event.getSource() == attachPigmentItem)
2604
+ if (source == attachPigmentItem)
25232605 {
25242606 String texture = GetFile("Attach pigment");
25252607 Object3D obj;
....@@ -2531,7 +2613,7 @@
25312613
25322614 refreshContents();
25332615 } else
2534
- if (event.getSource() == detachPigmentItem)
2616
+ if (source == detachPigmentItem)
25352617 {
25362618 Object3D obj;
25372619 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2624,7 @@
25422624
25432625 refreshContents();
25442626 } else
2545
- if (event.getSource() == attachBumpItem)
2627
+ if (source == attachBumpItem)
25462628 {
25472629 String texture = GetFile("Attach bump");
25482630 Object3D obj;
....@@ -2554,7 +2636,7 @@
25542636
25552637 refreshContents();
25562638 } else
2557
- if (event.getSource() == detachBumpItem)
2639
+ if (source == detachBumpItem)
25582640 {
25592641 Object3D obj;
25602642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2647,7 @@
25652647
25662648 refreshContents();
25672649 } else
2568
- if (event.getSource() == pigmentBumpItem)
2650
+ if (source == pigmentBumpItem)
25692651 {
25702652 Object3D obj;
25712653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2658,195 @@
25762658
25772659 refreshContents();
25782660 } else
2579
- if (event.getSource() == flashSelectionButton)
2661
+ if (source == flashSelectionButton)
25802662 {
25812663 CameraPane.flash = true;
25822664 refreshContents();
25832665 } else
2584
- if (event.getSource() == oneButton)
2666
+ if (source == oneButton)
25852667 {
25862668 } else
2587
- if (event.getSource() == twoButton)
2669
+ if (source == twoButton)
25882670 {
25892671 radio.layout = twoButton;
25902672 // bug
25912673 //gridPanel.setDividerLocation(1.0);
25922674 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
2675
+// bigThree.remove(scenePanel);
2676
+// bigThree.remove(centralPanel);
2677
+// bigThree.remove(XYZPanel);
2678
+// aWindowConstraints.gridx = 0;
2679
+// aWindowConstraints.gridy = 0;
2680
+// aWindowConstraints.gridwidth = 1;
2681
+// // aConstraints.gridheight = 3;
2682
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2683
+// aWindowConstraints.weightx = 0;
2684
+// aWindowConstraints.weighty = 1;
2685
+// //bigThree.add(jtp, aWindowConstraints);
2686
+// aWindowConstraints.weightx = 1;
2687
+// aWindowConstraints.gridwidth = 3;
2688
+// // aConstraints.gridheight = 3;
2689
+// aWindowConstraints.gridx = 1;
2690
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2691
+// bigThree.add(centralPanel, aWindowConstraints);
2692
+// aWindowConstraints.weightx = 0;
2693
+// aWindowConstraints.gridx = 4;
2694
+// aWindowConstraints.gridwidth = 1;
2695
+// // aConstraints.gridheight = 3;
2696
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2697
+// //bigThree.add(XYZPanel, aWindowConstraints);
2698
+// scenePanel.setVisible(false);
2699
+// centralPanel.setVisible(true);
2700
+// XYZPanel.setVisible(false);
2701
+ bigThree.ClearUI();
2702
+ bigThree.add(centralPanel);
2703
+ bigThree.FlushUI();
26172704 } else
2618
- if (event.getSource() == threeButton)
2705
+ if (source == threeButton)
26192706 {
26202707 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
2708
+
2709
+// bigThree.remove(scenePanel);
2710
+// bigThree.remove(centralPanel);
2711
+// bigThree.remove(XYZPanel);
2712
+// aWindowConstraints.gridx = 0;
2713
+// aWindowConstraints.gridy = 0;
2714
+// aWindowConstraints.gridwidth = 1;
2715
+// // aConstraints.gridheight = 3;
2716
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
+// aWindowConstraints.weightx = 0;
2718
+// aWindowConstraints.weighty = 1;
2719
+// //bigThree.add(jtp, aWindowConstraints);
2720
+// aWindowConstraints.weightx = 1;
2721
+// aWindowConstraints.gridwidth = 3;
2722
+// // aConstraints.gridheight = 3;
2723
+// aWindowConstraints.gridx = 1;
2724
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2725
+// bigThree.add(centralPanel, aWindowConstraints);
2726
+// aWindowConstraints.weightx = 0;
2727
+// aWindowConstraints.gridx = 4;
2728
+// aWindowConstraints.gridwidth = 1;
2729
+// // aConstraints.gridheight = 3;
2730
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2731
+// bigThree.add(XYZPanel, aWindowConstraints);
2732
+// bigThree.validate();
2733
+// scenePanel.setVisible(false);
2734
+// centralPanel.setVisible(true);
2735
+// XYZPanel.setVisible(true);
2736
+ bigThree.ClearUI();
2737
+ bigThree.add(centralPanel);
2738
+ bigThree.add(XYZPanel);
2739
+ bigThree.FlushUI();
26452740 } else
2646
- if (event.getSource() == fourButton)
2741
+ if (source == fourButton)
26472742 {
26482743 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
2744
+
2745
+// bigThree.remove(scenePanel);
2746
+// bigThree.remove(centralPanel);
2747
+// bigThree.remove(XYZPanel);
2748
+// aWindowConstraints.gridx = 0;
2749
+// aWindowConstraints.gridy = 0;
2750
+// aWindowConstraints.gridwidth = 1;
2751
+// // aWindowConstraints.gridheight = 3;
2752
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.weighty = 1;
2755
+// bigThree.add(scenePanel, aWindowConstraints);
2756
+// aWindowConstraints.weightx = 1;
2757
+// aWindowConstraints.gridwidth = 3;
2758
+// // aConstraints.gridheight = 3;
2759
+// aWindowConstraints.gridx = 1;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// //bigThree.add(cameraPanel, aWindowConstraints);
2762
+// aWindowConstraints.weightx = 0;
2763
+// aWindowConstraints.gridx = 4;
2764
+// aWindowConstraints.gridwidth = 1;
2765
+// // aWindowConstraints.gridheight = 3;
2766
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2767
+// //bigThree.add(XYZPanel, aWindowConstraints);
2768
+// bigThree.validate();
2769
+// scenePanel.setVisible(true);
2770
+// centralPanel.setVisible(false);
2771
+// XYZPanel.setVisible(false);
2772
+ bigThree.ClearUI();
2773
+ bigThree.add(scenePanel);
2774
+ bigThree.FlushUI();
26732775 } else
2674
- if (event.getSource() == sixButton)
2776
+ if (source == sixButton)
26752777 {
26762778 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
2779
+
2780
+// bigThree.remove(scenePanel);
2781
+// bigThree.remove(centralPanel);
2782
+// bigThree.remove(XYZPanel);
2783
+// aWindowConstraints.gridx = 0;
2784
+// aWindowConstraints.gridy = 0;
2785
+// aWindowConstraints.gridwidth = 1;
2786
+// // aConstraints.gridheight = 3;
2787
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2788
+// aWindowConstraints.weightx = 0;
2789
+// aWindowConstraints.weighty = 1;
2790
+// bigThree.add(scenePanel, aWindowConstraints);
2791
+// aWindowConstraints.weightx = 1;
2792
+// aWindowConstraints.gridwidth = 3;
2793
+// // aWindowConstraints.gridheight = 3;
2794
+// aWindowConstraints.gridx = 1;
2795
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2796
+// bigThree.add(centralPanel, aWindowConstraints);
2797
+// aWindowConstraints.weightx = 0;
2798
+// aWindowConstraints.gridx = 4;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aWindowConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// //bigThree.add(XYZPanel, aConstraints);
2803
+// bigThree.validate();
2804
+// scenePanel.setVisible(true);
2805
+// centralPanel.setVisible(true);
2806
+// XYZPanel.setVisible(false);
2807
+ bigThree.ClearUI();
2808
+ bigThree.add(scenePanel);
2809
+ bigThree.add(centralPanel);
2810
+ bigThree.FlushUI();
27012811 } else
2702
- if (event.getSource() == sevenButton)
2812
+ if (source == sevenButton)
27032813 {
27042814 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
2815
+
2816
+// bigThree.remove(scenePanel);
2817
+// bigThree.remove(centralPanel);
2818
+// bigThree.remove(XYZPanel);
2819
+// aWindowConstraints.gridx = 0;
2820
+// aWindowConstraints.gridy = 0;
2821
+// aWindowConstraints.gridwidth = 1;
2822
+// // aWindowConstraints.gridheight = 3;
2823
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2824
+// aWindowConstraints.weightx = 0;
2825
+// aWindowConstraints.weighty = 1;
2826
+// bigThree.add(scenePanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.gridwidth = 3;
2829
+// // aWindowConstraints.gridheight = 3;
2830
+// aWindowConstraints.gridx = 1;
2831
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2832
+// bigThree.add(centralPanel, aWindowConstraints);
2833
+// aWindowConstraints.weightx = 0;
2834
+// aWindowConstraints.gridx = 4;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2838
+// bigThree.add(XYZPanel, aWindowConstraints);
2839
+// bigThree.validate();
2840
+// scenePanel.setVisible(true);
2841
+// centralPanel.setVisible(true);
2842
+// XYZPanel.setVisible(true);
2843
+ bigThree.ClearUI();
2844
+ bigThree.add(scenePanel);
2845
+ bigThree.add(centralPanel);
2846
+ bigThree.add(XYZPanel);
2847
+ bigThree.FlushUI();
27292848 } else
2730
- if (event.getSource() == rootButton)
2849
+ if (source == rootButton)
27312850 {
27322851 Object3D obj;
27332852 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2858,7 @@
27392858
27402859 refreshContents(true);
27412860 } else
2742
- if (event.getSource() == closeButton)
2861
+ if (source == closeButton)
27432862 {
27442863 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452864 cRadio ab;
....@@ -2760,11 +2879,11 @@
27602879 }
27612880 refreshContents(true);
27622881 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
2882
+ if (source == editItem || source == editButton)
27642883 {
27652884 EditSelection(false);
27662885 } else
2767
- if (event.getSource() == uneditButton)
2886
+ if (source == uneditButton)
27682887 {
27692888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27702889 {
....@@ -2776,12 +2895,12 @@
27762895
27772896 child.editWindow = null; // ???????????
27782897 }
2779
- objEditor.ctrlPanel.revalidate();
2898
+ objEditor.ctrlPanel.validate();
27802899 //objEditor.jTree.clearSelection();
27812900 //objEditor.ResetSliders();
27822901 refreshContents(true);
27832902 } else
2784
- if (event.getSource() == clearPanelButton)
2903
+ if (source == clearPanelButton)
27852904 {
27862905 assert(copy == group);
27872906 //copy.ClearUI();
....@@ -2792,7 +2911,7 @@
27922911 listUI.clear();
27932912 refreshContents(true);
27942913 } else
2795
- if (event.getSource() == allParamsButton)
2914
+ if (source == allParamsButton)
27962915 {
27972916 assert(copy == group);
27982917
....@@ -2813,19 +2932,19 @@
28132932
28142933 refreshContents(true);
28152934 } else
2816
- if (event.getSource() == unselectButton)
2935
+ if (source == unselectButton)
28172936 {
28182937 objEditor.jTree.clearSelection();
28192938 // ?? oct 2012 GrafreeD.clipboard.clear();
28202939 objEditor.ResetSliders();
28212940 refreshContents(true);
28222941 } else
2823
- if(event.getSource() instanceof cRadio)
2942
+ if(source instanceof cRadio)
28242943 {
28252944 group.parent = keepparent;
28262945 group.attributes = 0;
28272946 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
2947
+ /*cRadio*/ radio = (cRadio)source;
28292948 Object3D obj = radio.GetObject();
28302949 System.out.println("Edit " + obj);
28312950 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +2964,7 @@
28452964 }
28462965
28472966 copy = group;
2848
- //CameraPane.theRenderer.object = group;
2967
+ //Globals.theRenderer.object = group;
28492968 if(!useclient)
28502969 {
28512970 cameraView.renderCamera = radio.camera;
....@@ -2854,7 +2973,8 @@
28542973 cameraView.cameras[cameraView.cameracount] = radio.camera;
28552974 cameraView.targetLookAt.set(radio.camera.lookAt);
28562975 cameraView.object = group;
2857
- cameraView.lighttouched = true;
2976
+ //cameraView.lighttouched = true;
2977
+ Globals.lighttouched = true;
28582978 topView.object = group;
28592979 frontView.object = group;
28602980 sideView.object = group;
....@@ -2890,7 +3010,7 @@
28903010 if (useclient)
28913011 {
28923012 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3013
+ Globals.lighttouched = true;
28943014 //topView.object = client;
28953015 //frontView.object = client;
28963016 //sideView.object = client;
....@@ -2898,7 +3018,7 @@
28983018 else
28993019 {
29003020 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
29023022 //topView.object = group;
29033023 //frontView.object = group;
29043024 //sideView.object = group;
....@@ -3179,6 +3299,13 @@
31793299 refreshContents();
31803300 }
31813301
3302
+ void GenNormalsMINE()
3303
+ {
3304
+ group.selection.GenNormalsMINE();
3305
+
3306
+ refreshContents();
3307
+ }
3308
+
31823309 void Stripify()
31833310 {
31843311 group.StripifyS();
....@@ -3399,7 +3526,7 @@
33993526 String pigment = Object3D.GetPigment(tex);
34003527 //String bump = Object3D.GetBump(tex);
34013528
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3529
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34033530
34043531 double s = v.s;
34053532
....@@ -3447,12 +3574,26 @@
34473574
34483575 void Align()
34493576 {
3577
+ if (group.selection.size() == 0)
3578
+ return;
3579
+
3580
+ cVector bbmin = new cVector();
3581
+ cVector bbmax = new cVector();
3582
+
3583
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3584
+
3585
+ double dx = bbmax.x - bbmin.x;
3586
+ double dy = bbmax.y - bbmin.y;
3587
+ double dz = bbmax.z - bbmin.z;
3588
+
3589
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3590
+
34503591 for (int i=0; i<group.selection.size(); i++)
34513592 {
34523593 Object3D obj = group.selection.get(i);
34533594
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3595
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3596
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563597 }
34573598
34583599 refreshContents();
....@@ -3686,7 +3827,7 @@
36863827 group.selection.RelinkToSupport(); // july 2014
36873828 System.out.println("DONE.");
36883829 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3830
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36903831 }
36913832
36923833 void ReduceMesh(boolean reduction34)
....@@ -3962,25 +4103,25 @@
39624103 System.err.println("info : " + child.GetPath());
39634104 }
39644105 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4106
+// else
4107
+// {
4108
+// objEditor.SetMaterial(group); // .GetMaterial());
4109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4110
+// System.err.println("info : " + group.GetPath());
4111
+// }
39714112
39724113 objEditor.SetText(); // jan 2014
39734114
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4115
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39754116 CameraPane.flash = true;
39764117
39774118 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784119 // a camera
39794120 {
39804121 CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4123
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4124
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844125 }
39854126
39864127 refreshContents();
....@@ -4474,6 +4615,26 @@
44744615 makeSomething(csg);
44754616 }
44764617
4618
+ void Ungroup(Object3D g)
4619
+ {
4620
+ if (g instanceof HiddenObject)
4621
+ {
4622
+ HiddenObject h = (HiddenObject) g;
4623
+
4624
+ for (int i=0; i<h.ActualSize(); i++)
4625
+ {
4626
+ objEditor.makeSomething(h.get(i), false);
4627
+ }
4628
+ }
4629
+ else
4630
+ {
4631
+ for (int i=0; i<g.Size(); i++)
4632
+ {
4633
+ objEditor.makeSomething(g.get(i), false);
4634
+ }
4635
+ }
4636
+ }
4637
+
44774638 void ungroup()
44784639 {
44794640 /*
....@@ -4833,6 +4994,7 @@
48334994 private MenuItem resetsupportItem;
48344995 private MenuItem resetreferencesItem;
48354996 private MenuItem linkverticesItem;
4997
+ private MenuItem relinkverticesItem;
48364998 private MenuItem setMasterItem;
48374999 private MenuItem resetMeshItem;
48385000 private MenuItem stepAllItem;
....@@ -4854,6 +5016,7 @@
48545016 private MenuItem genNormalsMESHItem;
48555017 private MenuItem genNormalsCADItem;
48565018 private MenuItem genNormalsORGANItem;
5019
+ private MenuItem genNormalsMINEItem;
48575020 private MenuItem stripifyItem;
48585021 private MenuItem unstripifyItem;
48595022 private MenuItem trimItem;
....@@ -4895,6 +5058,7 @@
48955058 private MenuItem resetCentroidItem;
48965059 private MenuItem transformgeometryItem;
48975060 private MenuItem resetTransformItem;
5061
+ private MenuItem hideItem;
48985062 private MenuItem grabItem;
48995063 private MenuItem backItem;
49005064 private MenuItem frontItem;
....@@ -4915,6 +5079,7 @@
49155079
49165080 private MenuItem resetParentItem;
49175081 private MenuItem repairParentItem;
5082
+ private MenuItem repairShadowItem;
49185083 private MenuItem sortbysizeItem;
49195084 private MenuItem sortbynameItem;
49205085
....@@ -4935,6 +5100,7 @@
49355100 private MenuItem coneItem;
49365101 private MenuItem torusItem;
49375102 private MenuItem superItem;
5103
+ private MenuItem kleinItem;
49385104 private MenuItem blobItem;
49395105 private MenuItem latheItem;
49405106 private MenuItem bezierItem;
....@@ -4947,6 +5113,7 @@
49475113 private MenuItem csgItem;
49485114 private MenuItem templateItem;
49495115 private MenuItem textureItem;
5116
+ private MenuItem billboardItem;
49505117 private MenuItem shadowXItem;
49515118 private MenuItem shadowYItem;
49525119 private MenuItem shadowZItem;