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"));
....@@ -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,84 +434,30 @@
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);
501457 // oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
458
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503459 snapobjectButton.addActionListener(this);
460
+ snapobjectButton.setToolTipText("Snap Object");
504461 oe.aConstraints.gridx += 1;
505462
506463 //aConstraints.gridx = 0;
....@@ -508,65 +465,66 @@
508465 oe.aConstraints.weighty = 0;
509466 oe.aConstraints.gridwidth = 1;
510467
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
469
+ flashSelectionButton.setToolTipText("Show selection");
512470 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516471
517
- //
518
- 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");
519476 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521478 fourButton.addActionListener(this);
522
- 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");
523482 sixButton.addActionListener(this);
524
- 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");
525485 threeButton.addActionListener(this);
526
- 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");
527488 sevenButton.addActionListener(this);
528489 //
529490
530
- 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");
531493 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- 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");
534497 closeButton.addActionListener(this);
535498 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536499 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538500
539
- oe.aConstraints.gridx = 1; //
540
- 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");
541505 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545506
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
507
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ uneditButton.setToolTipText("Unedit selection");
547509 uneditButton.addActionListener(this);
548510
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);
511
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ clearPanelButton.setToolTipText("Clear edit panel");
554513 clearPanelButton.addActionListener(this);
555514
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);
515
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ allParamsButton.setToolTipText("All params??");
561517 allParamsButton.addActionListener(this);
562518
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);
519
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ unselectButton.setToolTipText("Unselect");
568521 unselectButton.addActionListener(this);
569522
523
+ commandsPanel.preferredHeight = 1;
524
+
525
+ oe.treePanel.add(commandsPanel);
526
+ oe.treePanel.Return();
527
+
570528 // oe.aConstraints.gridx += 1;
571529 // oe.aConstraints.weighty = 0;
572530 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +536,37 @@
578536 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579537 // gcButton.addActionListener(this);
580538
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;
539
+ cGridBag jSPPanel = new cGridBag();
540
+
541
+ JScrollPane jSP;
592542 //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);
543
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594544 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
545
+
546
+ oe.treePanel.add(jSPPanel);
547
+ oe.treePanel.Return();
599548
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);
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");
604553 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- 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");
607557 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- 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");
610561 textureCB.addItemListener(this);
611562
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
563
+ copyOptionsPanel.preferredHeight = 1;
564
+ oe.treePanel.add(copyOptionsPanel);
565
+ oe.treePanel.Return();
614566
567
+// mainPanel.setDividerLocation(0.5); //1.0);
568
+// mainPanel.setResizeWeight(0.5);
569
+
615570 //jList.addListSelectionListener(this);
616571 oe.jTree.addTreeSelectionListener(this);
617572 //jTree.setRootVisible(false);
....@@ -633,17 +588,85 @@
633588 radio.layout = sevenButton;
634589 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635590 }
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
+ }
636659
637660 void EditObject(Object3D obj)
638661 {
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();
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();
647670 }
648671 void SetupViews(ObjEditor oe)
649672 {
....@@ -663,6 +686,7 @@
663686 JCheckBox fastCB;
664687 JCheckBox slowCB;
665688 JCheckBox boxCB;
689
+ JCheckBox zoomBoxCB;
666690 JCheckBox trackCB;
667691 JCheckBox smoothfocusCB;
668692 // JCheckBox speakerMocapCB;
....@@ -705,8 +729,7 @@
705729 dropAttributes |= Object3D.TEXTURE;
706730 else
707731 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
732
+ } else if(e.getSource() == liveCB)
710733 {
711734 cameraView.ToggleLive();
712735 }
....@@ -743,6 +766,10 @@
743766 Recompile();
744767 cameraView.repaint();
745768 // refreshContents();
769
+ }
770
+ else if(e.getSource() == zoomBoxCB)
771
+ {
772
+ cameraView.ToggleZoomBoxMode();
746773 }
747774 else if(e.getSource() == smoothfocusCB)
748775 {
....@@ -1033,6 +1060,8 @@
10331060 torusItem.addActionListener(this);
10341061 superItem = menu.add(new MenuItem("Superellipsoid"));
10351062 superItem.addActionListener(this);
1063
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1064
+ kleinItem.addActionListener(this);
10361065 particleItem = menu.add(new MenuItem("Particle system"));
10371066 particleItem.addActionListener(this);
10381067 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1073,7 +1102,7 @@
10731102 {
10741103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751104 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
10771106
10781107 menu.add("-");
10791108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1106,6 +1135,8 @@
11061135 resetParentItem.addActionListener(this);
11071136 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081137 repairParentItem.addActionListener(this);
1138
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1139
+ repairShadowItem.addActionListener(this);
11091140 menu.add(invariantsItem = new MenuItem("Invariants"));
11101141 invariantsItem.addActionListener(this);
11111142 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1466,6 +1497,7 @@
14661497 //
14671498 public void actionPerformed(ActionEvent event) // , Object arg)
14681499 {
1500
+ Object source = event.getSource();
14691501 /*
14701502 if (event.getSource() == nameField)
14711503 {
....@@ -1477,11 +1509,11 @@
14771509 }
14781510 else
14791511 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1512
+ if (source == lookAtItem || source == lookFromItem)
14811513 {
14821514 ScreenFit();
14831515 } else
1484
- if (event.getSource() == switchItem)
1516
+ if (source == switchItem)
14851517 {
14861518 cVector v1 = new cVector();
14871519 cVector v2 = new cVector();
....@@ -1490,11 +1522,11 @@
14901522 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911523 objEditor.cameraView.repaint();
14921524 } else
1493
- if (event.getSource() == rectoidItem)
1525
+ if (source == rectoidItem)
14941526 {
14951527 makeSomething(new Box());
14961528 } else
1497
- if (event.getSource() == particleItem)
1529
+ if (source == particleItem)
14981530 {
14991531 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001532 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1547,9 @@
15151547 applyExample(particleGeom, "SMOKE");
15161548 makeSomething(particleGeom);
15171549 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1550
+ if (source == ragdollItem || source == ragdoll2Item)
15191551 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1552
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211553
15221554 ragdoll.toParent = LA.newMatrix();
15231555 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1567,7 @@
15351567 } else
15361568 /*
15371569 */
1538
- if (event.getSource() == heightFieldItem)
1570
+ if (source == heightFieldItem)
15391571 {
15401572 Object3D obj = new Object3D();
15411573
....@@ -1573,27 +1605,31 @@
15731605
15741606 makeSomething(obj);
15751607 } else
1576
- if (event.getSource() == gridItem)
1608
+ if (source == gridItem)
15771609 {
15781610 makeSomething(new Grid());
15791611 } else
1580
- if (event.getSource() == ellipsoidItem)
1612
+ if (source == ellipsoidItem)
15811613 {
15821614 makeSomething(new Sphere());
15831615 } else
1584
- if (event.getSource() == coneItem)
1616
+ if (source == coneItem)
15851617 {
15861618 makeSomething(new Cone());
15871619 } else
1588
- if (event.getSource() == torusItem)
1620
+ if (source == torusItem)
15891621 {
15901622 makeSomething(new Torus());
15911623 } else
1592
- if (event.getSource() == superItem)
1624
+ if (source == superItem)
15931625 {
15941626 makeSomething(new Superellipsoid());
15951627 } else
1596
- if (event.getSource() == blobItem)
1628
+ if (source == kleinItem)
1629
+ {
1630
+ makeSomething(new Klein());
1631
+ } else
1632
+ if (source == blobItem)
15971633 {
15981634 Blob blob = new Blob();
15991635 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1637,15 @@
16011637 //blob.retile();
16021638 makeSomething(blob);
16031639 } else
1604
- if (event.getSource() == latheItem)
1640
+ if (source == latheItem)
16051641 {
16061642 makeSomething(new Lathe());
16071643 } else
1608
- if (event.getSource() == bezierItem)
1644
+ if (source == bezierItem)
16091645 {
16101646 makeSomething(new BezierSurface());
16111647 } else
1612
- if (event.getSource() == checkerItem)
1648
+ if (source == checkerItem)
16131649 {
16141650 /*
16151651 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1660,7 @@
16241660 */
16251661 makeSomething(new Checker());
16261662 } else
1627
- if (event.getSource() == meshItem)
1663
+ if (source == meshItem)
16281664 {
16291665 Object3D itemtomake = new Object3D();
16301666 Object3D child;
....@@ -1645,35 +1681,35 @@
16451681 makeSomething(child);
16461682 }
16471683 } else
1648
- if (event.getSource() == springItem)
1684
+ if (source == springItem)
16491685 {
16501686 cSpring s = new cSpring();
16511687 s.setup();
16521688 makeSomething(s);
16531689 } else
1654
- if (event.getSource() == flagItem)
1690
+ if (source == flagItem)
16551691 {
16561692 cSpring s = new cFlag();
16571693 s.setup();
16581694 makeSomething(s);
16591695 } else
1660
- if (event.getSource() == lightItem)
1696
+ if (source == lightItem)
16611697 {
16621698 makeSomething(new Light());
16631699 } else
1664
- if (event.getSource() == csgItem)
1700
+ if (source == csgItem)
16651701 {
16661702 group(new CSG());
16671703 } else
1668
- if (event.getSource() == templateItem)
1704
+ if (source == templateItem)
16691705 {
16701706 group(new cTemplate());
16711707 } else
1672
- if (event.getSource() == attributeItem)
1708
+ if (source == attributeItem)
16731709 {
16741710 makeSomething(new Attribute());
16751711 } else
1676
- if (event.getSource() == pointflowItem)
1712
+ if (source == pointflowItem)
16771713 {
16781714 makeSomething(new PointFlow());
16791715 } else
....@@ -1685,7 +1721,7 @@
16851721 } else
16861722 */
16871723
1688
- if (event.getSource() == superLoopItem)
1724
+ if (source == superLoopItem)
16891725 {
16901726 Composite g = new cGroup();
16911727 for (int i=0; i<15; i++)
....@@ -1707,7 +1743,7 @@
17071743
17081744 group(g);
17091745 } else
1710
- if (event.getSource() == loopItem)
1746
+ if (source == loopItem)
17111747 {
17121748 Composite csg = new GroupLeaf();
17131749 csg.count = 5;
....@@ -1716,7 +1752,7 @@
17161752 csg.addChild(child);
17171753 child.addChild(csg);
17181754 } else
1719
- if (event.getSource() == doubleItem)
1755
+ if (source == doubleItem)
17201756 {
17211757 Composite csg = new GroupLeaf();
17221758 csg.count = 5;
....@@ -1728,7 +1764,7 @@
17281764 csg.addChild(child);
17291765 child.addChild(csg);
17301766 } else
1731
- if (event.getSource() == tripleItem)
1767
+ if (source == tripleItem)
17321768 {
17331769 Composite csg = new GroupLeaf();
17341770 csg.count = 4;
....@@ -1744,70 +1780,70 @@
17441780 child.addChild(csg);
17451781 } else
17461782
1747
- if (event.getSource() == importGFDItem)
1783
+ if (source == importGFDItem)
17481784 {
17491785 ImportGFD();
17501786 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1787
+ if (source == importVRMLX3DItem)
17521788 {
17531789 ImportVRMLX3D();
17541790 } else
1755
- if (event.getSource() == import3DSItem)
1791
+ if (source == import3DSItem)
17561792 {
17571793 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581794 } else
1759
- if (event.getSource() == importOBJItem)
1795
+ if (source == importOBJItem)
17601796 {
17611797 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621798 } else
1763
- if (event.getSource() == computeAOItem)
1799
+ if (source == computeAOItem)
17641800 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1801
+ Globals.drawMode = CameraPane.OCCLUSION;
1802
+ Globals.theRenderer.repaint();
17671803 } else
1768
- if (event.getSource() == recompileItem)
1804
+ if (source == recompileItem)
17691805 {
17701806 Recompile();
17711807 refreshContents();
17721808 } else
1773
- if (event.getSource() == editScriptItem)
1809
+ if (source == editScriptItem)
17741810 {
17751811 OpenDialog();
17761812 refreshContents();
17771813 } else
1778
- if (event.getSource() == invariantsItem)
1814
+ if (source == invariantsItem)
17791815 {
17801816 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1817
+ GrafreeD.grafreeD.universe.invariants();
17821818 } else
1783
- if (event.getSource() == memoryItem)
1819
+ if (source == memoryItem)
17841820 {
17851821 //System.out.println("Invariants:");
17861822 PrintMemory();
17871823 } else
1788
- if (event.getSource() == pathItem)
1824
+ if (source == pathItem)
17891825 {
17901826 PrintPath();
17911827 } else
1792
- if (event.getSource() == analyzeItem)
1828
+ if (source == analyzeItem)
17931829 {
17941830 AnalyzeObject();
17951831 } else
1796
- if (event.getSource() == dumpItem)
1832
+ if (source == dumpItem)
17971833 {
17981834 DumpObject();
17991835 } else
1800
- if (event.getSource() == screenfitButton)
1836
+ if (source == screenfitButton)
18011837 {
18021838 //Reload(lastConverter, lastFilename, true);
18031839 ScreenFit();
18041840 } else
1805
- if (event.getSource() == screenfitpointButton)
1841
+ if (source == screenfitpointButton)
18061842 {
18071843 //Reload(lastConverter, lastFilename, true);
18081844 ScreenFitPoint();
18091845 } else
1810
- if (event.getSource() == snapobjectButton)
1846
+ if (source == snapobjectButton)
18111847 {
18121848 //Reload(lastConverter, lastFilename, true);
18131849 SnapObject();
....@@ -1818,13 +1854,13 @@
18181854 // Recompile();
18191855 // refreshContents();
18201856 // } else
1821
- if (event.getSource() == gcButton)
1857
+ if (source == gcButton)
18221858 {
18231859 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241860 System.gc();
18251861 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261862 } else
1827
- if (event.getSource() == editLeafItem)
1863
+ if (source == editLeafItem)
18281864 {
18291865 Object3D obj;
18301866 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1874,62 @@
18381874 }
18391875 refreshContents(true);
18401876 } else
1841
- if (event.getSource() == openWindowItem)
1877
+ if (source == openWindowItem)
18421878 {
18431879 EditSelection(true);
18441880 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1881
+ if (source == cutItem || source == clearButton)
18461882 {
18471883 loadClipboard(true);
18481884 } else
1849
- if (event.getSource() == duplicateItem)
1885
+ if (source == duplicateItem)
18501886 {
18511887 Object3D keep = GrafreeD.clipboard;
18521888 loadClipboard(false);
18531889 paste(false);
18541890 GrafreeD.clipboard = keep;
18551891 } else
1856
- if (event.getSource() == cloneItem)
1892
+ if (source == cloneItem)
18571893 {
18581894 CloneSelection(false);
18591895 } else
1860
- if (event.getSource() == cloneSupportItem)
1896
+ if (source == cloneSupportItem)
18611897 {
18621898 CloneSelection(true);
18631899 } else
1864
- if (event.getSource() == copyItem)
1900
+ if (source == copyItem)
18651901 {
18661902 loadClipboard(false);
18671903 } else
1868
- if (event.getSource() == pasteItem)
1904
+ if (source == pasteItem)
18691905 {
18701906 paste(false);
18711907 } else
1872
- if (event.getSource() == pasteLinkItem)
1908
+ if (source == pasteLinkItem)
18731909 {
18741910 pasteInto(false);
18751911 } else
1876
- if (event.getSource() == pasteCloneItem)
1912
+ if (source == pasteCloneItem)
18771913 {
18781914 pasteInto(true);
18791915 } else
1880
- if (event.getSource() == pasteExpandItem)
1916
+ if (source == pasteExpandItem)
18811917 {
18821918 paste(true);
18831919 } else
1884
- if (event.getSource() == synchronizeItem)
1920
+ if (source == synchronizeItem)
18851921 {
18861922 Overwrite(Object3D.TRANSFORM);
18871923 } else
1888
- if (event.getSource() == overwriteNameItem)
1924
+ if (source == overwriteNameItem)
18891925 {
18901926 Overwrite(Object3D.NAME);
18911927 } else
1892
- if (event.getSource() == overwriteUVItem)
1928
+ if (source == overwriteUVItem)
18931929 {
18941930 Overwrite(Object3D.UV);
18951931 } else
1896
- if (event.getSource() == overwriteMatItem)
1932
+ if (source == overwriteMatItem)
18971933 {
18981934 /* july 2015
18991935 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +1949,7 @@
19131949
19141950 Overwrite(dropAttributes);
19151951 }
1916
- if (event.getSource() == overwriteGeoItem)
1952
+ if (source == overwriteGeoItem)
19171953 {
19181954 Overwrite(Object3D.GEOMETRY);
19191955 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +1966,7 @@
19301966 // refreshContents();
19311967 // }
19321968 } else
1933
- if (event.getSource() == generateMeshItem)
1969
+ if (source == generateMeshItem)
19341970 {
19351971 //if (group.selection.size() == 1)
19361972 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +1977,7 @@
19411977 ResetModel();
19421978 refreshContents();
19431979 } else
1944
- if (event.getSource() == extractGeometriesItem)
1980
+ if (source == extractGeometriesItem)
19451981 {
19461982 boolean one = false;
19471983
....@@ -1968,7 +2004,7 @@
19682004 ResetModel();
19692005 refreshContents();
19702006 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2007
+ if (source == cloneGeometriesItem)
19722008 {
19732009 boolean one = false;
19742010
....@@ -1994,32 +2030,37 @@
19942030 ResetModel();
19952031 refreshContents();
19962032 } else
1997
- if (event.getSource() == shareGeometriesItem)
2033
+ if (source == shareGeometriesItem)
19982034 {
19992035 boolean one = false;
20002036
20012037 if (group.selection.size() == 1)
20022038 one = true;
20032039
2040
+ Object3D merge = null;
2041
+
20042042 Object3D content = new cGroup();
20052043
20062044 for (int i=0; i<group.selection.size(); i++)
20072045 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2046
+ merge = new Merge(group.selection.get(i));
20092047
20102048 if (one)
2011
- makeSomething(sel, false);
2049
+ makeSomething(merge, false);
20122050 else
2013
- content.addChild(sel);
2051
+ content.addChild(merge);
20142052 }
20152053
20162054 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2055
+ makeSomething(content, true);
2056
+ else
2057
+ {
2058
+ ResetModel();
2059
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2060
+ refreshContents();
2061
+ }
20212062 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2063
+ if (source == mergeGeometriesItem)
20232064 {
20242065 boolean one = false;
20252066
....@@ -2049,7 +2090,7 @@
20492090 ResetModel();
20502091 refreshContents();
20512092 } else
2052
- if (event.getSource() == linkverticesItem)
2093
+ if (source == linkverticesItem)
20532094 {
20542095 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552096 // {
....@@ -2069,7 +2110,7 @@
20692110 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702111 content = ((cGroup)content).get(0);
20712112
2072
- 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));
20732114 for (int i=0; i<group.selection.size(); i++)
20742115 {
20752116 boolean random = CameraPane.RANDOM;
....@@ -2078,11 +2119,11 @@
20782119 // group.selection.get(i).setMasterThis(content); // should be identity
20792120 CameraPane.RANDOM = random;
20802121 }
2081
- 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));
20822123 refreshContents();
20832124 }
20842125 } else
2085
- if (event.getSource() == resetsupportItem)
2126
+ if (source == resetsupportItem)
20862127 {
20872128 for (int i=0; i<group.selection.size(); i++)
20882129 {
....@@ -2094,7 +2135,16 @@
20942135
20952136 refreshContents();
20962137 } else
2097
- 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)
20982148 {
20992149 for (int i=0; i<group.selection.size(); i++)
21002150 {
....@@ -2103,7 +2153,7 @@
21032153
21042154 refreshContents();
21052155 } else
2106
- if (event.getSource() == setMasterItem)
2156
+ if (source == setMasterItem)
21072157 {
21082158 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21092159 {
....@@ -2116,7 +2166,7 @@
21162166 refreshContents();
21172167 }
21182168 } else
2119
- if (event.getSource() == poseMeshItem)
2169
+ if (source == poseMeshItem)
21202170 {
21212171 if (group.selection.size() == 1)
21222172 {
....@@ -2135,19 +2185,19 @@
21352185 }
21362186
21372187 } else
2138
- if (event.getSource() == revertMeshItem)
2188
+ if (source == revertMeshItem)
21392189 {
21402190 RevertMeshes();
21412191 } else
2142
- if (event.getSource() == resetMeshItem)
2192
+ if (source == resetMeshItem)
21432193 {
21442194 ResetAll();
21452195 } else
2146
- if (event.getSource() == stepAllItem)
2196
+ if (source == stepAllItem)
21472197 {
21482198 StepAll();
21492199 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2200
+ if (source == clearItem) // || event.getSource() == clearButton)
21512201 {
21522202 //int indices[] = jList.getSelectedIndices();
21532203 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2205,46 @@
21552205
21562206 ClearSelection(false);
21572207 } else
2158
- if (event.getSource() == clearAllItem)
2208
+ if (source == clearAllItem)
21592209 {
21602210 ClearSelection(true);
21612211 } else
2162
- if (event.getSource() == grabItem)
2212
+ if (source == grabItem)
21632213 {
21642214 group(new cGroup(), true);
21652215 } else
2166
- if (event.getSource() == frontItem)
2216
+ if (source == hideItem)
2217
+ {
2218
+ group(new HiddenObject());
2219
+ } else
2220
+ if (source == frontItem)
21672221 {
21682222 front();
21692223 } else
2170
- if (event.getSource() == backItem)
2224
+ if (source == backItem)
21712225 {
21722226 back();
21732227 } else
2174
- if (event.getSource() == cameraItem)
2228
+ if (source == cameraItem)
21752229 {
21762230 makeSomething(new Camera());
21772231 } else
2178
- if (event.getSource() == compositeItem)
2232
+ if (source == compositeItem)
21792233 {
21802234 group(new Composite());
21812235 } else
2182
- if (event.getSource() == randomItem)
2236
+ if (source == randomItem)
21832237 {
21842238 RandomNode random = new RandomNode();
21852239 group(random);
21862240 if (random.size() > 0)
21872241 random.name = random.get(0).name + "Rnd";
21882242 } else
2189
- if (event.getSource() == physicsItem)
2243
+ if (source == physicsItem)
21902244 {
21912245 group(new PhysicsNode());
21922246 } else
2193
- if (event.getSource() == frameselectorItem)
2247
+ if (source == frameselectorItem)
21942248 {
21952249 for (int i=0; i<group.selection.size(); i++)
21962250 {
....@@ -2202,7 +2256,7 @@
22022256 ResetModel();
22032257 refreshContents();
22042258 } else
2205
- if (event.getSource() == switchGeoItem)
2259
+ if (source == switchGeoItem)
22062260 {
22072261 for (int i=0; i<group.selection.size(); i++)
22082262 {
....@@ -2214,7 +2268,7 @@
22142268 ResetModel();
22152269 refreshContents();
22162270 } else
2217
- if (event.getSource() == switchTransfoItem)
2271
+ if (source == switchTransfoItem)
22182272 {
22192273 for (int i=0; i<group.selection.size(); i++)
22202274 {
....@@ -2226,7 +2280,7 @@
22262280 ResetModel();
22272281 refreshContents();
22282282 } else
2229
- if (event.getSource() == morphItem)
2283
+ if (source == morphItem)
22302284 {
22312285 for (int i=0; i<group.selection.size(); i++)
22322286 {
....@@ -2238,7 +2292,7 @@
22382292 ResetModel();
22392293 refreshContents();
22402294 } else
2241
- if (event.getSource() == scriptNodeItem)
2295
+ if (source == scriptNodeItem)
22422296 {
22432297 boolean atleastone = false;
22442298
....@@ -2277,195 +2331,215 @@
22772331 }
22782332 }
22792333 } else
2280
- if (event.getSource() == linkerItem)
2334
+ if (source == linkerItem)
22812335 {
22822336 group(new cLinker());
22832337 } else
2284
- if (event.getSource() == textureItem)
2338
+ if (source == textureItem)
22852339 {
22862340 group(new TextureNode());
22872341 } else
2288
- if (event.getSource() == shadowXItem)
2342
+ if (source == billboardItem)
2343
+ {
2344
+ group(new BillboardNode());
2345
+ } else
2346
+ if (source == shadowXItem)
22892347 {
22902348 CastShadow(0);
22912349 } else
2292
- if (event.getSource() == shadowYItem)
2350
+ if (source == shadowYItem)
22932351 {
22942352 CastShadow(1);
22952353 } else
2296
- if (event.getSource() == shadowZItem)
2354
+ if (source == shadowZItem)
22972355 {
22982356 CastShadow(2);
22992357 } else
2300
- if (event.getSource() == ungroupItem)
2358
+ if (source == ungroupItem)
23012359 {
2302
- 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();
23032369 } else
2304
- if (event.getSource() == genUVItem)
2370
+ if (source == genUVItem)
23052371 {
23062372 GenUV();
23072373 } else
2308
- if (event.getSource() == genNormalsCADItem)
2374
+ if (source == genNormalsCADItem)
23092375 {
23102376 GenNormals(true);
23112377 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2378
+ if (source == genNormalsMESHItem)
2379
+ {
2380
+ GenNormals(true); // TODO
2381
+ } else
2382
+ if (source == genNormalsORGANItem)
23132383 {
23142384 GenNormals(false);
23152385 } else
2316
- if (event.getSource() == stripifyItem)
2386
+ if (source == genNormalsMINEItem)
2387
+ {
2388
+ GenNormalsMINE();
2389
+ } else
2390
+ if (source == stripifyItem)
23172391 {
23182392 Stripify();
23192393 } else
2320
- if (event.getSource() == unstripifyItem)
2394
+ if (source == unstripifyItem)
23212395 {
23222396 Unstripify();
23232397 } else
2324
- if (event.getSource() == trimItem)
2398
+ if (source == trimItem)
23252399 {
23262400 Trim();
23272401 } else
2328
- if (event.getSource() == untrimItem)
2402
+ if (source == untrimItem)
23292403 {
23302404 Untrim();
23312405 } else
2332
- if (event.getSource() == clearColorsItem)
2406
+ if (source == clearColorsItem)
23332407 {
23342408 ClearColors();
23352409 } else
2336
- if (event.getSource() == clearMaterialsItem)
2410
+ if (source == clearMaterialsItem)
23372411 {
23382412 ClearMaterials();
23392413 } else
2340
- if (event.getSource() == liveleavesItem)
2414
+ if (source == liveleavesItem)
23412415 {
23422416 LiveLeaves(true);
23432417 } else
2344
- if (event.getSource() == unliveleavesItem)
2418
+ if (source == unliveleavesItem)
23452419 {
23462420 LiveLeaves(false);
23472421 } else
2348
- if (event.getSource() == supportleavesItem)
2422
+ if (source == supportleavesItem)
23492423 {
23502424 SupportLeaves(true);
23512425 } else
2352
- if (event.getSource() == unsupportleavesItem)
2426
+ if (source == unsupportleavesItem)
23532427 {
23542428 SupportLeaves(false);
23552429 } else
2356
- if (event.getSource() == hideleavesItem)
2430
+ if (source == hideleavesItem)
23572431 {
23582432 HideLeaves(true);
23592433 } else
2360
- if (event.getSource() == showleavesItem)
2434
+ if (source == showleavesItem)
23612435 {
23622436 HideLeaves(false);
23632437 } else
2364
- if (event.getSource() == markleavesItem)
2438
+ if (source == markleavesItem)
23652439 {
23662440 MarkLeaves(true);
23672441 } else
2368
- if (event.getSource() == unmarkleavesItem)
2442
+ if (source == unmarkleavesItem)
23692443 {
23702444 MarkLeaves(false);
23712445 } else
2372
- if (event.getSource() == flipVItem)
2446
+ if (source == flipVItem)
23732447 {
23742448 FlipV(true);
23752449 } else
2376
- if (event.getSource() == unflipVItem)
2450
+ if (source == unflipVItem)
23772451 {
23782452 FlipV(false);
23792453 } else
2380
- if (event.getSource() == lowTexturesItem)
2454
+ if (source == lowTexturesItem)
23812455 {
23822456 SetTexRes(0);
23832457 } else
2384
- if (event.getSource() == normalTexturesItem)
2458
+ if (source == normalTexturesItem)
23852459 {
23862460 SetTexRes(1);
23872461 } else
2388
- if (event.getSource() == highTexturesItem)
2462
+ if (source == highTexturesItem)
23892463 {
23902464 SetTexRes(2);
23912465 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2466
+ if (source == veryhighTexturesItem)
23932467 {
23942468 SetTexRes(3);
23952469 } else
2396
- if (event.getSource() == maxTexturesItem)
2470
+ if (source == maxTexturesItem)
23972471 {
23982472 SetTexRes(4);
23992473 } else
2400
- if (event.getSource() == panoTexturesItem)
2474
+ if (source == panoTexturesItem)
24012475 {
24022476 SetTexRes(5);
24032477 } else
2404
- if (event.getSource() == reverseNormalsItem)
2478
+ if (source == reverseNormalsItem)
24052479 {
24062480 ReverseNormals();
24072481 } else
2408
- if (event.getSource() == parseverticesItem)
2482
+ if (source == parseverticesItem)
24092483 {
24102484 ParseVertices();
24112485 } else
2412
- if (event.getSource() == textureFieldItem)
2486
+ if (source == textureFieldItem)
24132487 {
24142488 TextureVertices();
24152489 } else
2416
- if (event.getSource() == alignItem)
2490
+ if (source == alignItem)
24172491 {
24182492 Align();
24192493 } else
2420
- if (event.getSource() == mirrorItem)
2494
+ if (source == mirrorItem)
24212495 {
24222496 MirrorPoses();
24232497 } else
2424
- if (event.getSource() == reduceMorphItem)
2498
+ if (source == reduceMorphItem)
24252499 {
24262500 MeshReduction(false);
24272501 } else
2428
- if (event.getSource() == reduce34MorphItem)
2502
+ if (source == reduce34MorphItem)
24292503 {
24302504 MeshReduction(true);
24312505 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2506
+ if (source == reverseTrianglesItem)
24332507 {
24342508 ReverseTriangles();
24352509 } else
2436
- if (event.getSource() == reduceMeshItem)
2510
+ if (source == reduceMeshItem)
24372511 {
24382512 ReduceMesh(false);
24392513 } else
2440
- if (event.getSource() == reduce34MeshItem)
2514
+ if (source == reduce34MeshItem)
24412515 {
24422516 ReduceMesh(true);
24432517 } else
2444
- if (event.getSource() == increaseMeshItem)
2518
+ if (source == increaseMeshItem)
24452519 {
24462520 IncreaseMesh();
24472521 } else
2448
- if (event.getSource() == clipMeshItem)
2522
+ if (source == clipMeshItem)
24492523 {
24502524 ClipMesh();
24512525 } else
2452
- if (event.getSource() == smoothMeshItem)
2526
+ if (source == smoothMeshItem)
24532527 {
24542528 SmoothMesh();
24552529 } else
2456
- if (event.getSource() == transformgeometryItem)
2530
+ if (source == transformgeometryItem)
24572531 {
24582532 TransformGeometry();
24592533 } else
2460
- if (event.getSource() == resetTransformItem)
2534
+ if (source == resetTransformItem)
24612535 {
24622536 ResetTransform();
24632537 } else
2464
- if (event.getSource() == resetCentroidItem)
2538
+ if (source == resetCentroidItem)
24652539 {
24662540 ResetCentroid();
24672541 } else
2468
- if (event.getSource() == resetParentItem)
2542
+ if (source == resetParentItem)
24692543 {
24702544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712545 {
....@@ -2475,7 +2549,7 @@
24752549
24762550 refreshContents();
24772551 } else
2478
- if (event.getSource() == repairParentItem)
2552
+ if (source == repairParentItem)
24792553 {
24802554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812555 {
....@@ -2489,7 +2563,21 @@
24892563
24902564 refreshContents();
24912565 } else
2492
- 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)
24932581 {
24942582 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952583 {
....@@ -2501,7 +2589,7 @@
25012589 ResetModel();
25022590 refreshContents();
25032591 } else
2504
- if (event.getSource() == sortbynameItem)
2592
+ if (source == sortbynameItem)
25052593 {
25062594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072595 {
....@@ -2513,7 +2601,7 @@
25132601 ResetModel();
25142602 refreshContents();
25152603 } else
2516
- if (event.getSource() == attachPigmentItem)
2604
+ if (source == attachPigmentItem)
25172605 {
25182606 String texture = GetFile("Attach pigment");
25192607 Object3D obj;
....@@ -2525,7 +2613,7 @@
25252613
25262614 refreshContents();
25272615 } else
2528
- if (event.getSource() == detachPigmentItem)
2616
+ if (source == detachPigmentItem)
25292617 {
25302618 Object3D obj;
25312619 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2624,7 @@
25362624
25372625 refreshContents();
25382626 } else
2539
- if (event.getSource() == attachBumpItem)
2627
+ if (source == attachBumpItem)
25402628 {
25412629 String texture = GetFile("Attach bump");
25422630 Object3D obj;
....@@ -2548,7 +2636,7 @@
25482636
25492637 refreshContents();
25502638 } else
2551
- if (event.getSource() == detachBumpItem)
2639
+ if (source == detachBumpItem)
25522640 {
25532641 Object3D obj;
25542642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2647,7 @@
25592647
25602648 refreshContents();
25612649 } else
2562
- if (event.getSource() == pigmentBumpItem)
2650
+ if (source == pigmentBumpItem)
25632651 {
25642652 Object3D obj;
25652653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2658,195 @@
25702658
25712659 refreshContents();
25722660 } else
2573
- if (event.getSource() == flashSelectionButton)
2661
+ if (source == flashSelectionButton)
25742662 {
25752663 CameraPane.flash = true;
25762664 refreshContents();
25772665 } else
2578
- if (event.getSource() == oneButton)
2666
+ if (source == oneButton)
25792667 {
25802668 } else
2581
- if (event.getSource() == twoButton)
2669
+ if (source == twoButton)
25822670 {
25832671 radio.layout = twoButton;
25842672 // bug
25852673 //gridPanel.setDividerLocation(1.0);
25862674 //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();
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();
26112704 } else
2612
- if (event.getSource() == threeButton)
2705
+ if (source == threeButton)
26132706 {
26142707 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();
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();
26392740 } else
2640
- if (event.getSource() == fourButton)
2741
+ if (source == fourButton)
26412742 {
26422743 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();
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();
26672775 } else
2668
- if (event.getSource() == sixButton)
2776
+ if (source == sixButton)
26692777 {
26702778 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();
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();
26952811 } else
2696
- if (event.getSource() == sevenButton)
2812
+ if (source == sevenButton)
26972813 {
26982814 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();
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();
27232848 } else
2724
- if (event.getSource() == rootButton)
2849
+ if (source == rootButton)
27252850 {
27262851 Object3D obj;
27272852 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2858,7 @@
27332858
27342859 refreshContents(true);
27352860 } else
2736
- if (event.getSource() == closeButton)
2861
+ if (source == closeButton)
27372862 {
27382863 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392864 cRadio ab;
....@@ -2754,11 +2879,11 @@
27542879 }
27552880 refreshContents(true);
27562881 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
2882
+ if (source == editItem || source == editButton)
27582883 {
27592884 EditSelection(false);
27602885 } else
2761
- if (event.getSource() == uneditButton)
2886
+ if (source == uneditButton)
27622887 {
27632888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27642889 {
....@@ -2770,12 +2895,12 @@
27702895
27712896 child.editWindow = null; // ???????????
27722897 }
2773
- objEditor.ctrlPanel.revalidate();
2898
+ objEditor.ctrlPanel.validate();
27742899 //objEditor.jTree.clearSelection();
27752900 //objEditor.ResetSliders();
27762901 refreshContents(true);
27772902 } else
2778
- if (event.getSource() == clearPanelButton)
2903
+ if (source == clearPanelButton)
27792904 {
27802905 assert(copy == group);
27812906 //copy.ClearUI();
....@@ -2786,7 +2911,7 @@
27862911 listUI.clear();
27872912 refreshContents(true);
27882913 } else
2789
- if (event.getSource() == allParamsButton)
2914
+ if (source == allParamsButton)
27902915 {
27912916 assert(copy == group);
27922917
....@@ -2807,19 +2932,19 @@
28072932
28082933 refreshContents(true);
28092934 } else
2810
- if (event.getSource() == unselectButton)
2935
+ if (source == unselectButton)
28112936 {
28122937 objEditor.jTree.clearSelection();
28132938 // ?? oct 2012 GrafreeD.clipboard.clear();
28142939 objEditor.ResetSliders();
28152940 refreshContents(true);
28162941 } else
2817
- if(event.getSource() instanceof cRadio)
2942
+ if(source instanceof cRadio)
28182943 {
28192944 group.parent = keepparent;
28202945 group.attributes = 0;
28212946 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
2947
+ /*cRadio*/ radio = (cRadio)source;
28232948 Object3D obj = radio.GetObject();
28242949 System.out.println("Edit " + obj);
28252950 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +2964,7 @@
28392964 }
28402965
28412966 copy = group;
2842
- //CameraPane.theRenderer.object = group;
2967
+ //Globals.theRenderer.object = group;
28432968 if(!useclient)
28442969 {
28452970 cameraView.renderCamera = radio.camera;
....@@ -2848,7 +2973,8 @@
28482973 cameraView.cameras[cameraView.cameracount] = radio.camera;
28492974 cameraView.targetLookAt.set(radio.camera.lookAt);
28502975 cameraView.object = group;
2851
- cameraView.lighttouched = true;
2976
+ //cameraView.lighttouched = true;
2977
+ Globals.lighttouched = true;
28522978 topView.object = group;
28532979 frontView.object = group;
28542980 sideView.object = group;
....@@ -2884,7 +3010,7 @@
28843010 if (useclient)
28853011 {
28863012 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3013
+ Globals.lighttouched = true;
28883014 //topView.object = client;
28893015 //frontView.object = client;
28903016 //sideView.object = client;
....@@ -2892,7 +3018,7 @@
28923018 else
28933019 {
28943020 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
28963022 //topView.object = group;
28973023 //frontView.object = group;
28983024 //sideView.object = group;
....@@ -3173,6 +3299,13 @@
31733299 refreshContents();
31743300 }
31753301
3302
+ void GenNormalsMINE()
3303
+ {
3304
+ group.selection.GenNormalsMINE();
3305
+
3306
+ refreshContents();
3307
+ }
3308
+
31763309 void Stripify()
31773310 {
31783311 group.StripifyS();
....@@ -3393,7 +3526,7 @@
33933526 String pigment = Object3D.GetPigment(tex);
33943527 //String bump = Object3D.GetBump(tex);
33953528
3396
- 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);
33973530
33983531 double s = v.s;
33993532
....@@ -3441,12 +3574,26 @@
34413574
34423575 void Align()
34433576 {
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
+
34443591 for (int i=0; i<group.selection.size(); i++)
34453592 {
34463593 Object3D obj = group.selection.get(i);
34473594
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- 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);
34503597 }
34513598
34523599 refreshContents();
....@@ -3680,7 +3827,7 @@
36803827 group.selection.RelinkToSupport(); // july 2014
36813828 System.out.println("DONE.");
36823829 refreshContents();
3683
- 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));
36843831 }
36853832
36863833 void ReduceMesh(boolean reduction34)
....@@ -3956,25 +4103,25 @@
39564103 System.err.println("info : " + child.GetPath());
39574104 }
39584105 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4106
+// else
4107
+// {
4108
+// objEditor.SetMaterial(group); // .GetMaterial());
4109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4110
+// System.err.println("info : " + group.GetPath());
4111
+// }
39654112
39664113 objEditor.SetText(); // jan 2014
39674114
3968
- 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))
39694116 CameraPane.flash = true;
39704117
39714118 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724119 // a camera
39734120 {
39744121 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;
4122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4123
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4124
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784125 }
39794126
39804127 refreshContents();
....@@ -4468,6 +4615,26 @@
44684615 makeSomething(csg);
44694616 }
44704617
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
+
44714638 void ungroup()
44724639 {
44734640 /*
....@@ -4827,6 +4994,7 @@
48274994 private MenuItem resetsupportItem;
48284995 private MenuItem resetreferencesItem;
48294996 private MenuItem linkverticesItem;
4997
+ private MenuItem relinkverticesItem;
48304998 private MenuItem setMasterItem;
48314999 private MenuItem resetMeshItem;
48325000 private MenuItem stepAllItem;
....@@ -4845,8 +5013,10 @@
48455013 private MenuItem clearItem;
48465014 private MenuItem clearAllItem;
48475015 private MenuItem genUVItem;
5016
+ private MenuItem genNormalsMESHItem;
48485017 private MenuItem genNormalsCADItem;
48495018 private MenuItem genNormalsORGANItem;
5019
+ private MenuItem genNormalsMINEItem;
48505020 private MenuItem stripifyItem;
48515021 private MenuItem unstripifyItem;
48525022 private MenuItem trimItem;
....@@ -4888,6 +5058,7 @@
48885058 private MenuItem resetCentroidItem;
48895059 private MenuItem transformgeometryItem;
48905060 private MenuItem resetTransformItem;
5061
+ private MenuItem hideItem;
48915062 private MenuItem grabItem;
48925063 private MenuItem backItem;
48935064 private MenuItem frontItem;
....@@ -4908,6 +5079,7 @@
49085079
49095080 private MenuItem resetParentItem;
49105081 private MenuItem repairParentItem;
5082
+ private MenuItem repairShadowItem;
49115083 private MenuItem sortbysizeItem;
49125084 private MenuItem sortbynameItem;
49135085
....@@ -4928,6 +5100,7 @@
49285100 private MenuItem coneItem;
49295101 private MenuItem torusItem;
49305102 private MenuItem superItem;
5103
+ private MenuItem kleinItem;
49315104 private MenuItem blobItem;
49325105 private MenuItem latheItem;
49335106 private MenuItem bezierItem;
....@@ -4940,6 +5113,7 @@
49405113 private MenuItem csgItem;
49415114 private MenuItem templateItem;
49425115 private MenuItem textureItem;
5116
+ private MenuItem billboardItem;
49435117 private MenuItem shadowXItem;
49445118 private MenuItem shadowYItem;
49455119 private MenuItem shadowZItem;