Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
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,26 @@
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);
451
- 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);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444
+ trackCB.setToolTipText("Enable tracking");
493445 trackCB.addItemListener(this);
494446
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
448
+ screenfitButton.setToolTipText("Screen fit");
497449 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
450
+
499451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500452 // screenfitpointButton.addActionListener(this);
501453 // oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503455 snapobjectButton.addActionListener(this);
456
+ snapobjectButton.setToolTipText("Snap Object");
504457 oe.aConstraints.gridx += 1;
505458
506459 //aConstraints.gridx = 0;
....@@ -508,65 +461,66 @@
508461 oe.aConstraints.weighty = 0;
509462 oe.aConstraints.gridwidth = 1;
510463
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
+ flashSelectionButton.setToolTipText("Show selection");
512466 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516467
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
+
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
+ twoButton.setToolTipText("Show center view only");
519472 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521474 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
475
+ fourButton.setToolTipText("Show left panel only");
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
477
+ sixButton.setToolTipText("2-column layout left");
523478 sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
480
+ threeButton.setToolTipText("2-column layout right");
525481 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483
+ sevenButton.setToolTipText("3-column layout");
527484 sevenButton.addActionListener(this);
528485 //
529486
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
487
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
+ rootButton.setToolTipText("Edit selection in new tab");
531489 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
490
+
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ closeButton.setToolTipText("Close tab");
534493 closeButton.addActionListener(this);
535494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536495 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538496
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
497
+ cGridBag commandsPanel = new cGridBag();
498
+
499
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
500
+ editButton.setToolTipText("Edit selection");
541501 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545502
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
547505 uneditButton.addActionListener(this);
548506
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);
507
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ clearPanelButton.setToolTipText("Clear edit panel");
554509 clearPanelButton.addActionListener(this);
555510
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);
511
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ allParamsButton.setToolTipText("All params??");
561513 allParamsButton.addActionListener(this);
562514
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);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
568517 unselectButton.addActionListener(this);
569518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
570524 // oe.aConstraints.gridx += 1;
571525 // oe.aConstraints.weighty = 0;
572526 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +532,37 @@
578532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579533 // gcButton.addActionListener(this);
580534
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;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
592538 //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);
539
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
594540 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
599544
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);
545
+ cGridBag copyOptionsPanel = new cGridBag();
546
+
547
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
+ colorCB.setToolTipText("Copy color when dropped");
604549 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
550
+
551
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
+ materialCB.setToolTipText("Copy material when dropped");
607553 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
+ textureCB.setToolTipText("Copy texture when dropped");
610557 textureCB.addItemListener(this);
611558
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
614562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
615566 //jList.addListSelectionListener(this);
616567 oe.jTree.addTreeSelectionListener(this);
617568 //jTree.setRootVisible(false);
....@@ -633,17 +584,97 @@
633584 radio.layout = sevenButton;
634585 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635586 }
587
+
588
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589
+ {
590
+ //constraints.gridx = 0;
591
+ //constraints.gridy = 0;
592
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
+ fastCB.setToolTipText("Fast mode");
594
+ fastCB.addItemListener(this);
595
+ //constraints.gridy += 1;
596
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597
+ supportCB.setToolTipText("Enabled rigging");
598
+ supportCB.addItemListener(this);
599
+
600
+ // constraints.gridy += 1;
601
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602
+ // localCB.addItemListener(this);
603
+
604
+ //constraints.gridy += 1;
605
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606
+ crowdCB.setToolTipText("Used for crowds");
607
+ crowdCB.addItemListener(this);
608
+
609
+ //constraints.gridy += 1;
610
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611
+ smoothCB.setToolTipText("Snapping delay");
612
+ smoothCB.addItemListener(this);
613
+
614
+ //constraints.gridy += 1;
615
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616
+ slowCB.setToolTipText("Smooth interpolation");
617
+ slowCB.addItemListener(this);
618
+ //constraints.gridy += 1;
619
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620
+ boxCB.setToolTipText("Display bounding boxes");
621
+ boxCB.addItemListener(this);
622
+ //constraints.gridy += 1;
623
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625
+ zoomBoxCB.addItemListener(this);
626
+
627
+// constraints.gridy += 1;
628
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629
+// speakerMocapCB.addItemListener(this);
630
+
631
+ if (false)
632
+ {
633
+ // handled in scripts
634
+ //constraints.gridy += 1;
635
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
636
+ speakerCameraCB.addItemListener(this);
637
+
638
+ //constraints.gridy += 1;
639
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
640
+ speakerFocusCB.addItemListener(this);
641
+
642
+ //constraints.gridy += 1;
643
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
644
+ smoothfocusCB.addItemListener(this);
645
+ }
646
+
647
+//constraints.gridx += 1;
648
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649
+// debugCB.addItemListener(this);
650
+
651
+ //constraints.gridy += 1;
652
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653
+ oeilCB.addItemListener(this);
654
+
655
+ //constraints.gridy += 1;
656
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657
+ lookAtCB.setToolTipText("Look-at target");
658
+ lookAtCB.addItemListener(this);
659
+
660
+ cGridBag fill = new cGridBag();
661
+
662
+ fill.preferredHeight = 200;
663
+
664
+ panel.add(fill);
665
+
666
+ }
636667
637668 void EditObject(Object3D obj)
638669 {
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();
670
+ cRadio radioButton = new cRadio(obj.name);
671
+ radioButton.SetObject(obj);
672
+ radioButton.layout = sevenButton;
673
+ radioButton.SetCamera(cameraView.renderCamera, false);
674
+ radioButton.addActionListener(this);
675
+ radioPanel.add(radioButton);
676
+ buttonGroup.add(radioButton);
677
+ radioButton.doClick();
647678 }
648679 void SetupViews(ObjEditor oe)
649680 {
....@@ -663,6 +694,7 @@
663694 JCheckBox fastCB;
664695 JCheckBox slowCB;
665696 JCheckBox boxCB;
697
+ JCheckBox zoomBoxCB;
666698 JCheckBox trackCB;
667699 JCheckBox smoothfocusCB;
668700 // JCheckBox speakerMocapCB;
....@@ -705,8 +737,7 @@
705737 dropAttributes |= Object3D.TEXTURE;
706738 else
707739 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
740
+ } else if(e.getSource() == liveCB)
710741 {
711742 cameraView.ToggleLive();
712743 }
....@@ -743,6 +774,10 @@
743774 Recompile();
744775 cameraView.repaint();
745776 // refreshContents();
777
+ }
778
+ else if(e.getSource() == zoomBoxCB)
779
+ {
780
+ cameraView.ToggleZoomBoxMode();
746781 }
747782 else if(e.getSource() == smoothfocusCB)
748783 {
....@@ -1033,6 +1068,8 @@
10331068 torusItem.addActionListener(this);
10341069 superItem = menu.add(new MenuItem("Superellipsoid"));
10351070 superItem.addActionListener(this);
1071
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1072
+ kleinItem.addActionListener(this);
10361073 particleItem = menu.add(new MenuItem("Particle system"));
10371074 particleItem.addActionListener(this);
10381075 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1106,6 +1143,8 @@
11061143 resetParentItem.addActionListener(this);
11071144 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081145 repairParentItem.addActionListener(this);
1146
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1147
+ repairShadowItem.addActionListener(this);
11091148 menu.add(invariantsItem = new MenuItem("Invariants"));
11101149 invariantsItem.addActionListener(this);
11111150 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1466,6 +1505,7 @@
14661505 //
14671506 public void actionPerformed(ActionEvent event) // , Object arg)
14681507 {
1508
+ Object source = event.getSource();
14691509 /*
14701510 if (event.getSource() == nameField)
14711511 {
....@@ -1477,11 +1517,11 @@
14771517 }
14781518 else
14791519 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1520
+ if (source == lookAtItem || source == lookFromItem)
14811521 {
14821522 ScreenFit();
14831523 } else
1484
- if (event.getSource() == switchItem)
1524
+ if (source == switchItem)
14851525 {
14861526 cVector v1 = new cVector();
14871527 cVector v2 = new cVector();
....@@ -1490,11 +1530,11 @@
14901530 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911531 objEditor.cameraView.repaint();
14921532 } else
1493
- if (event.getSource() == rectoidItem)
1533
+ if (source == rectoidItem)
14941534 {
14951535 makeSomething(new Box());
14961536 } else
1497
- if (event.getSource() == particleItem)
1537
+ if (source == particleItem)
14981538 {
14991539 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001540 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1555,9 @@
15151555 applyExample(particleGeom, "SMOKE");
15161556 makeSomething(particleGeom);
15171557 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1558
+ if (source == ragdollItem || source == ragdoll2Item)
15191559 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1560
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211561
15221562 ragdoll.toParent = LA.newMatrix();
15231563 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1575,7 @@
15351575 } else
15361576 /*
15371577 */
1538
- if (event.getSource() == heightFieldItem)
1578
+ if (source == heightFieldItem)
15391579 {
15401580 Object3D obj = new Object3D();
15411581
....@@ -1573,27 +1613,31 @@
15731613
15741614 makeSomething(obj);
15751615 } else
1576
- if (event.getSource() == gridItem)
1616
+ if (source == gridItem)
15771617 {
15781618 makeSomething(new Grid());
15791619 } else
1580
- if (event.getSource() == ellipsoidItem)
1620
+ if (source == ellipsoidItem)
15811621 {
15821622 makeSomething(new Sphere());
15831623 } else
1584
- if (event.getSource() == coneItem)
1624
+ if (source == coneItem)
15851625 {
15861626 makeSomething(new Cone());
15871627 } else
1588
- if (event.getSource() == torusItem)
1628
+ if (source == torusItem)
15891629 {
15901630 makeSomething(new Torus());
15911631 } else
1592
- if (event.getSource() == superItem)
1632
+ if (source == superItem)
15931633 {
15941634 makeSomething(new Superellipsoid());
15951635 } else
1596
- if (event.getSource() == blobItem)
1636
+ if (source == kleinItem)
1637
+ {
1638
+ makeSomething(new Klein());
1639
+ } else
1640
+ if (source == blobItem)
15971641 {
15981642 Blob blob = new Blob();
15991643 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1645,15 @@
16011645 //blob.retile();
16021646 makeSomething(blob);
16031647 } else
1604
- if (event.getSource() == latheItem)
1648
+ if (source == latheItem)
16051649 {
16061650 makeSomething(new Lathe());
16071651 } else
1608
- if (event.getSource() == bezierItem)
1652
+ if (source == bezierItem)
16091653 {
16101654 makeSomething(new BezierSurface());
16111655 } else
1612
- if (event.getSource() == checkerItem)
1656
+ if (source == checkerItem)
16131657 {
16141658 /*
16151659 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1668,7 @@
16241668 */
16251669 makeSomething(new Checker());
16261670 } else
1627
- if (event.getSource() == meshItem)
1671
+ if (source == meshItem)
16281672 {
16291673 Object3D itemtomake = new Object3D();
16301674 Object3D child;
....@@ -1645,35 +1689,35 @@
16451689 makeSomething(child);
16461690 }
16471691 } else
1648
- if (event.getSource() == springItem)
1692
+ if (source == springItem)
16491693 {
16501694 cSpring s = new cSpring();
16511695 s.setup();
16521696 makeSomething(s);
16531697 } else
1654
- if (event.getSource() == flagItem)
1698
+ if (source == flagItem)
16551699 {
16561700 cSpring s = new cFlag();
16571701 s.setup();
16581702 makeSomething(s);
16591703 } else
1660
- if (event.getSource() == lightItem)
1704
+ if (source == lightItem)
16611705 {
16621706 makeSomething(new Light());
16631707 } else
1664
- if (event.getSource() == csgItem)
1708
+ if (source == csgItem)
16651709 {
16661710 group(new CSG());
16671711 } else
1668
- if (event.getSource() == templateItem)
1712
+ if (source == templateItem)
16691713 {
16701714 group(new cTemplate());
16711715 } else
1672
- if (event.getSource() == attributeItem)
1716
+ if (source == attributeItem)
16731717 {
16741718 makeSomething(new Attribute());
16751719 } else
1676
- if (event.getSource() == pointflowItem)
1720
+ if (source == pointflowItem)
16771721 {
16781722 makeSomething(new PointFlow());
16791723 } else
....@@ -1685,7 +1729,7 @@
16851729 } else
16861730 */
16871731
1688
- if (event.getSource() == superLoopItem)
1732
+ if (source == superLoopItem)
16891733 {
16901734 Composite g = new cGroup();
16911735 for (int i=0; i<15; i++)
....@@ -1707,7 +1751,7 @@
17071751
17081752 group(g);
17091753 } else
1710
- if (event.getSource() == loopItem)
1754
+ if (source == loopItem)
17111755 {
17121756 Composite csg = new GroupLeaf();
17131757 csg.count = 5;
....@@ -1716,7 +1760,7 @@
17161760 csg.addChild(child);
17171761 child.addChild(csg);
17181762 } else
1719
- if (event.getSource() == doubleItem)
1763
+ if (source == doubleItem)
17201764 {
17211765 Composite csg = new GroupLeaf();
17221766 csg.count = 5;
....@@ -1728,7 +1772,7 @@
17281772 csg.addChild(child);
17291773 child.addChild(csg);
17301774 } else
1731
- if (event.getSource() == tripleItem)
1775
+ if (source == tripleItem)
17321776 {
17331777 Composite csg = new GroupLeaf();
17341778 csg.count = 4;
....@@ -1744,70 +1788,70 @@
17441788 child.addChild(csg);
17451789 } else
17461790
1747
- if (event.getSource() == importGFDItem)
1791
+ if (source == importGFDItem)
17481792 {
17491793 ImportGFD();
17501794 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1795
+ if (source == importVRMLX3DItem)
17521796 {
17531797 ImportVRMLX3D();
17541798 } else
1755
- if (event.getSource() == import3DSItem)
1799
+ if (source == import3DSItem)
17561800 {
17571801 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581802 } else
1759
- if (event.getSource() == importOBJItem)
1803
+ if (source == importOBJItem)
17601804 {
17611805 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621806 } else
1763
- if (event.getSource() == computeAOItem)
1807
+ if (source == computeAOItem)
17641808 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1809
+ Globals.drawMode = CameraPane.OCCLUSION;
1810
+ Globals.theRenderer.repaint();
17671811 } else
1768
- if (event.getSource() == recompileItem)
1812
+ if (source == recompileItem)
17691813 {
17701814 Recompile();
17711815 refreshContents();
17721816 } else
1773
- if (event.getSource() == editScriptItem)
1817
+ if (source == editScriptItem)
17741818 {
17751819 OpenDialog();
17761820 refreshContents();
17771821 } else
1778
- if (event.getSource() == invariantsItem)
1822
+ if (source == invariantsItem)
17791823 {
17801824 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1825
+ GrafreeD.grafreeD.universe.invariants();
17821826 } else
1783
- if (event.getSource() == memoryItem)
1827
+ if (source == memoryItem)
17841828 {
17851829 //System.out.println("Invariants:");
17861830 PrintMemory();
17871831 } else
1788
- if (event.getSource() == pathItem)
1832
+ if (source == pathItem)
17891833 {
17901834 PrintPath();
17911835 } else
1792
- if (event.getSource() == analyzeItem)
1836
+ if (source == analyzeItem)
17931837 {
17941838 AnalyzeObject();
17951839 } else
1796
- if (event.getSource() == dumpItem)
1840
+ if (source == dumpItem)
17971841 {
17981842 DumpObject();
17991843 } else
1800
- if (event.getSource() == screenfitButton)
1844
+ if (source == screenfitButton)
18011845 {
18021846 //Reload(lastConverter, lastFilename, true);
18031847 ScreenFit();
18041848 } else
1805
- if (event.getSource() == screenfitpointButton)
1849
+ if (source == screenfitpointButton)
18061850 {
18071851 //Reload(lastConverter, lastFilename, true);
18081852 ScreenFitPoint();
18091853 } else
1810
- if (event.getSource() == snapobjectButton)
1854
+ if (source == snapobjectButton)
18111855 {
18121856 //Reload(lastConverter, lastFilename, true);
18131857 SnapObject();
....@@ -1818,13 +1862,13 @@
18181862 // Recompile();
18191863 // refreshContents();
18201864 // } else
1821
- if (event.getSource() == gcButton)
1865
+ if (source == gcButton)
18221866 {
18231867 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241868 System.gc();
18251869 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261870 } else
1827
- if (event.getSource() == editLeafItem)
1871
+ if (source == editLeafItem)
18281872 {
18291873 Object3D obj;
18301874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1882,62 @@
18381882 }
18391883 refreshContents(true);
18401884 } else
1841
- if (event.getSource() == openWindowItem)
1885
+ if (source == openWindowItem)
18421886 {
18431887 EditSelection(true);
18441888 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1889
+ if (source == cutItem || source == clearButton)
18461890 {
18471891 loadClipboard(true);
18481892 } else
1849
- if (event.getSource() == duplicateItem)
1893
+ if (source == duplicateItem)
18501894 {
18511895 Object3D keep = GrafreeD.clipboard;
18521896 loadClipboard(false);
18531897 paste(false);
18541898 GrafreeD.clipboard = keep;
18551899 } else
1856
- if (event.getSource() == cloneItem)
1900
+ if (source == cloneItem)
18571901 {
18581902 CloneSelection(false);
18591903 } else
1860
- if (event.getSource() == cloneSupportItem)
1904
+ if (source == cloneSupportItem)
18611905 {
18621906 CloneSelection(true);
18631907 } else
1864
- if (event.getSource() == copyItem)
1908
+ if (source == copyItem)
18651909 {
18661910 loadClipboard(false);
18671911 } else
1868
- if (event.getSource() == pasteItem)
1912
+ if (source == pasteItem)
18691913 {
18701914 paste(false);
18711915 } else
1872
- if (event.getSource() == pasteLinkItem)
1916
+ if (source == pasteLinkItem)
18731917 {
18741918 pasteInto(false);
18751919 } else
1876
- if (event.getSource() == pasteCloneItem)
1920
+ if (source == pasteCloneItem)
18771921 {
18781922 pasteInto(true);
18791923 } else
1880
- if (event.getSource() == pasteExpandItem)
1924
+ if (source == pasteExpandItem)
18811925 {
18821926 paste(true);
18831927 } else
1884
- if (event.getSource() == synchronizeItem)
1928
+ if (source == synchronizeItem)
18851929 {
18861930 Overwrite(Object3D.TRANSFORM);
18871931 } else
1888
- if (event.getSource() == overwriteNameItem)
1932
+ if (source == overwriteNameItem)
18891933 {
18901934 Overwrite(Object3D.NAME);
18911935 } else
1892
- if (event.getSource() == overwriteUVItem)
1936
+ if (source == overwriteUVItem)
18931937 {
18941938 Overwrite(Object3D.UV);
18951939 } else
1896
- if (event.getSource() == overwriteMatItem)
1940
+ if (source == overwriteMatItem)
18971941 {
18981942 /* july 2015
18991943 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +1957,7 @@
19131957
19141958 Overwrite(dropAttributes);
19151959 }
1916
- if (event.getSource() == overwriteGeoItem)
1960
+ if (source == overwriteGeoItem)
19171961 {
19181962 Overwrite(Object3D.GEOMETRY);
19191963 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +1974,7 @@
19301974 // refreshContents();
19311975 // }
19321976 } else
1933
- if (event.getSource() == generateMeshItem)
1977
+ if (source == generateMeshItem)
19341978 {
19351979 //if (group.selection.size() == 1)
19361980 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +1985,7 @@
19411985 ResetModel();
19421986 refreshContents();
19431987 } else
1944
- if (event.getSource() == extractGeometriesItem)
1988
+ if (source == extractGeometriesItem)
19451989 {
19461990 boolean one = false;
19471991
....@@ -1968,7 +2012,7 @@
19682012 ResetModel();
19692013 refreshContents();
19702014 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2015
+ if (source == cloneGeometriesItem)
19722016 {
19732017 boolean one = false;
19742018
....@@ -1994,32 +2038,37 @@
19942038 ResetModel();
19952039 refreshContents();
19962040 } else
1997
- if (event.getSource() == shareGeometriesItem)
2041
+ if (source == shareGeometriesItem)
19982042 {
19992043 boolean one = false;
20002044
20012045 if (group.selection.size() == 1)
20022046 one = true;
20032047
2048
+ Object3D merge = null;
2049
+
20042050 Object3D content = new cGroup();
20052051
20062052 for (int i=0; i<group.selection.size(); i++)
20072053 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2054
+ merge = new Merge(group.selection.get(i));
20092055
20102056 if (one)
2011
- makeSomething(sel, false);
2057
+ makeSomething(merge, false);
20122058 else
2013
- content.addChild(sel);
2059
+ content.addChild(merge);
20142060 }
20152061
20162062 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2063
+ makeSomething(content, true);
2064
+ else
2065
+ {
2066
+ ResetModel();
2067
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2068
+ refreshContents();
2069
+ }
20212070 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2071
+ if (source == mergeGeometriesItem)
20232072 {
20242073 boolean one = false;
20252074
....@@ -2049,7 +2098,7 @@
20492098 ResetModel();
20502099 refreshContents();
20512100 } else
2052
- if (event.getSource() == linkverticesItem)
2101
+ if (source == linkverticesItem)
20532102 {
20542103 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552104 // {
....@@ -2069,7 +2118,7 @@
20692118 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702119 content = ((cGroup)content).get(0);
20712120
2072
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2121
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20732122 for (int i=0; i<group.selection.size(); i++)
20742123 {
20752124 boolean random = CameraPane.RANDOM;
....@@ -2078,11 +2127,11 @@
20782127 // group.selection.get(i).setMasterThis(content); // should be identity
20792128 CameraPane.RANDOM = random;
20802129 }
2081
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2130
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20822131 refreshContents();
20832132 }
20842133 } else
2085
- if (event.getSource() == resetsupportItem)
2134
+ if (source == resetsupportItem)
20862135 {
20872136 for (int i=0; i<group.selection.size(); i++)
20882137 {
....@@ -2094,7 +2143,16 @@
20942143
20952144 refreshContents();
20962145 } else
2097
- if (event.getSource() == resetreferencesItem)
2146
+ if (source == relinkverticesItem)
2147
+ {
2148
+ boolean random = CameraPane.RANDOM;
2149
+ CameraPane.RANDOM = false; // parse all random nodes
2150
+ group.selection.RelinkToSupport();
2151
+ CameraPane.RANDOM = random;
2152
+
2153
+ refreshContents();
2154
+ } else
2155
+ if (source == resetreferencesItem)
20982156 {
20992157 for (int i=0; i<group.selection.size(); i++)
21002158 {
....@@ -2103,7 +2161,7 @@
21032161
21042162 refreshContents();
21052163 } else
2106
- if (event.getSource() == setMasterItem)
2164
+ if (source == setMasterItem)
21072165 {
21082166 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21092167 {
....@@ -2116,7 +2174,7 @@
21162174 refreshContents();
21172175 }
21182176 } else
2119
- if (event.getSource() == poseMeshItem)
2177
+ if (source == poseMeshItem)
21202178 {
21212179 if (group.selection.size() == 1)
21222180 {
....@@ -2135,19 +2193,19 @@
21352193 }
21362194
21372195 } else
2138
- if (event.getSource() == revertMeshItem)
2196
+ if (source == revertMeshItem)
21392197 {
21402198 RevertMeshes();
21412199 } else
2142
- if (event.getSource() == resetMeshItem)
2200
+ if (source == resetMeshItem)
21432201 {
21442202 ResetAll();
21452203 } else
2146
- if (event.getSource() == stepAllItem)
2204
+ if (source == stepAllItem)
21472205 {
21482206 StepAll();
21492207 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2208
+ if (source == clearItem) // || event.getSource() == clearButton)
21512209 {
21522210 //int indices[] = jList.getSelectedIndices();
21532211 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2213,46 @@
21552213
21562214 ClearSelection(false);
21572215 } else
2158
- if (event.getSource() == clearAllItem)
2216
+ if (source == clearAllItem)
21592217 {
21602218 ClearSelection(true);
21612219 } else
2162
- if (event.getSource() == grabItem)
2220
+ if (source == grabItem)
21632221 {
21642222 group(new cGroup(), true);
21652223 } else
2166
- if (event.getSource() == frontItem)
2224
+ if (source == hideItem)
2225
+ {
2226
+ group(new HiddenObject());
2227
+ } else
2228
+ if (source == frontItem)
21672229 {
21682230 front();
21692231 } else
2170
- if (event.getSource() == backItem)
2232
+ if (source == backItem)
21712233 {
21722234 back();
21732235 } else
2174
- if (event.getSource() == cameraItem)
2236
+ if (source == cameraItem)
21752237 {
21762238 makeSomething(new Camera());
21772239 } else
2178
- if (event.getSource() == compositeItem)
2240
+ if (source == compositeItem)
21792241 {
21802242 group(new Composite());
21812243 } else
2182
- if (event.getSource() == randomItem)
2244
+ if (source == randomItem)
21832245 {
21842246 RandomNode random = new RandomNode();
21852247 group(random);
21862248 if (random.size() > 0)
21872249 random.name = random.get(0).name + "Rnd";
21882250 } else
2189
- if (event.getSource() == physicsItem)
2251
+ if (source == physicsItem)
21902252 {
21912253 group(new PhysicsNode());
21922254 } else
2193
- if (event.getSource() == frameselectorItem)
2255
+ if (source == frameselectorItem)
21942256 {
21952257 for (int i=0; i<group.selection.size(); i++)
21962258 {
....@@ -2202,7 +2264,7 @@
22022264 ResetModel();
22032265 refreshContents();
22042266 } else
2205
- if (event.getSource() == switchGeoItem)
2267
+ if (source == switchGeoItem)
22062268 {
22072269 for (int i=0; i<group.selection.size(); i++)
22082270 {
....@@ -2214,7 +2276,7 @@
22142276 ResetModel();
22152277 refreshContents();
22162278 } else
2217
- if (event.getSource() == switchTransfoItem)
2279
+ if (source == switchTransfoItem)
22182280 {
22192281 for (int i=0; i<group.selection.size(); i++)
22202282 {
....@@ -2226,7 +2288,7 @@
22262288 ResetModel();
22272289 refreshContents();
22282290 } else
2229
- if (event.getSource() == morphItem)
2291
+ if (source == morphItem)
22302292 {
22312293 for (int i=0; i<group.selection.size(); i++)
22322294 {
....@@ -2238,7 +2300,7 @@
22382300 ResetModel();
22392301 refreshContents();
22402302 } else
2241
- if (event.getSource() == scriptNodeItem)
2303
+ if (source == scriptNodeItem)
22422304 {
22432305 boolean atleastone = false;
22442306
....@@ -2277,195 +2339,215 @@
22772339 }
22782340 }
22792341 } else
2280
- if (event.getSource() == linkerItem)
2342
+ if (source == linkerItem)
22812343 {
22822344 group(new cLinker());
22832345 } else
2284
- if (event.getSource() == textureItem)
2346
+ if (source == textureItem)
22852347 {
22862348 group(new TextureNode());
22872349 } else
2288
- if (event.getSource() == shadowXItem)
2350
+ if (source == billboardItem)
2351
+ {
2352
+ group(new BillboardNode());
2353
+ } else
2354
+ if (source == shadowXItem)
22892355 {
22902356 CastShadow(0);
22912357 } else
2292
- if (event.getSource() == shadowYItem)
2358
+ if (source == shadowYItem)
22932359 {
22942360 CastShadow(1);
22952361 } else
2296
- if (event.getSource() == shadowZItem)
2362
+ if (source == shadowZItem)
22972363 {
22982364 CastShadow(2);
22992365 } else
2300
- if (event.getSource() == ungroupItem)
2366
+ if (source == ungroupItem)
23012367 {
2302
- ungroup();
2368
+ //ungroup();
2369
+ for (int i=0; i<group.selection.size(); i++)
2370
+ {
2371
+ Ungroup(group.selection.get(i));
2372
+ }
2373
+
2374
+ ClearSelection(false);
2375
+
2376
+ refreshContents();
23032377 } else
2304
- if (event.getSource() == genUVItem)
2378
+ if (source == genUVItem)
23052379 {
23062380 GenUV();
23072381 } else
2308
- if (event.getSource() == genNormalsCADItem)
2382
+ if (source == genNormalsCADItem)
23092383 {
23102384 GenNormals(true);
23112385 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2386
+ if (source == genNormalsMESHItem)
2387
+ {
2388
+ GenNormals(true); // TODO
2389
+ } else
2390
+ if (source == genNormalsORGANItem)
23132391 {
23142392 GenNormals(false);
23152393 } else
2316
- if (event.getSource() == stripifyItem)
2394
+ if (source == genNormalsMINEItem)
2395
+ {
2396
+ GenNormalsMINE();
2397
+ } else
2398
+ if (source == stripifyItem)
23172399 {
23182400 Stripify();
23192401 } else
2320
- if (event.getSource() == unstripifyItem)
2402
+ if (source == unstripifyItem)
23212403 {
23222404 Unstripify();
23232405 } else
2324
- if (event.getSource() == trimItem)
2406
+ if (source == trimItem)
23252407 {
23262408 Trim();
23272409 } else
2328
- if (event.getSource() == untrimItem)
2410
+ if (source == untrimItem)
23292411 {
23302412 Untrim();
23312413 } else
2332
- if (event.getSource() == clearColorsItem)
2414
+ if (source == clearColorsItem)
23332415 {
23342416 ClearColors();
23352417 } else
2336
- if (event.getSource() == clearMaterialsItem)
2418
+ if (source == clearMaterialsItem)
23372419 {
23382420 ClearMaterials();
23392421 } else
2340
- if (event.getSource() == liveleavesItem)
2422
+ if (source == liveleavesItem)
23412423 {
23422424 LiveLeaves(true);
23432425 } else
2344
- if (event.getSource() == unliveleavesItem)
2426
+ if (source == unliveleavesItem)
23452427 {
23462428 LiveLeaves(false);
23472429 } else
2348
- if (event.getSource() == supportleavesItem)
2430
+ if (source == supportleavesItem)
23492431 {
23502432 SupportLeaves(true);
23512433 } else
2352
- if (event.getSource() == unsupportleavesItem)
2434
+ if (source == unsupportleavesItem)
23532435 {
23542436 SupportLeaves(false);
23552437 } else
2356
- if (event.getSource() == hideleavesItem)
2438
+ if (source == hideleavesItem)
23572439 {
23582440 HideLeaves(true);
23592441 } else
2360
- if (event.getSource() == showleavesItem)
2442
+ if (source == showleavesItem)
23612443 {
23622444 HideLeaves(false);
23632445 } else
2364
- if (event.getSource() == markleavesItem)
2446
+ if (source == markleavesItem)
23652447 {
23662448 MarkLeaves(true);
23672449 } else
2368
- if (event.getSource() == unmarkleavesItem)
2450
+ if (source == unmarkleavesItem)
23692451 {
23702452 MarkLeaves(false);
23712453 } else
2372
- if (event.getSource() == flipVItem)
2454
+ if (source == flipVItem)
23732455 {
23742456 FlipV(true);
23752457 } else
2376
- if (event.getSource() == unflipVItem)
2458
+ if (source == unflipVItem)
23772459 {
23782460 FlipV(false);
23792461 } else
2380
- if (event.getSource() == lowTexturesItem)
2462
+ if (source == lowTexturesItem)
23812463 {
23822464 SetTexRes(0);
23832465 } else
2384
- if (event.getSource() == normalTexturesItem)
2466
+ if (source == normalTexturesItem)
23852467 {
23862468 SetTexRes(1);
23872469 } else
2388
- if (event.getSource() == highTexturesItem)
2470
+ if (source == highTexturesItem)
23892471 {
23902472 SetTexRes(2);
23912473 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2474
+ if (source == veryhighTexturesItem)
23932475 {
23942476 SetTexRes(3);
23952477 } else
2396
- if (event.getSource() == maxTexturesItem)
2478
+ if (source == maxTexturesItem)
23972479 {
23982480 SetTexRes(4);
23992481 } else
2400
- if (event.getSource() == panoTexturesItem)
2482
+ if (source == panoTexturesItem)
24012483 {
24022484 SetTexRes(5);
24032485 } else
2404
- if (event.getSource() == reverseNormalsItem)
2486
+ if (source == reverseNormalsItem)
24052487 {
24062488 ReverseNormals();
24072489 } else
2408
- if (event.getSource() == parseverticesItem)
2490
+ if (source == parseverticesItem)
24092491 {
24102492 ParseVertices();
24112493 } else
2412
- if (event.getSource() == textureFieldItem)
2494
+ if (source == textureFieldItem)
24132495 {
24142496 TextureVertices();
24152497 } else
2416
- if (event.getSource() == alignItem)
2498
+ if (source == alignItem)
24172499 {
24182500 Align();
24192501 } else
2420
- if (event.getSource() == mirrorItem)
2502
+ if (source == mirrorItem)
24212503 {
24222504 MirrorPoses();
24232505 } else
2424
- if (event.getSource() == reduceMorphItem)
2506
+ if (source == reduceMorphItem)
24252507 {
24262508 MeshReduction(false);
24272509 } else
2428
- if (event.getSource() == reduce34MorphItem)
2510
+ if (source == reduce34MorphItem)
24292511 {
24302512 MeshReduction(true);
24312513 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2514
+ if (source == reverseTrianglesItem)
24332515 {
24342516 ReverseTriangles();
24352517 } else
2436
- if (event.getSource() == reduceMeshItem)
2518
+ if (source == reduceMeshItem)
24372519 {
24382520 ReduceMesh(false);
24392521 } else
2440
- if (event.getSource() == reduce34MeshItem)
2522
+ if (source == reduce34MeshItem)
24412523 {
24422524 ReduceMesh(true);
24432525 } else
2444
- if (event.getSource() == increaseMeshItem)
2526
+ if (source == increaseMeshItem)
24452527 {
24462528 IncreaseMesh();
24472529 } else
2448
- if (event.getSource() == clipMeshItem)
2530
+ if (source == clipMeshItem)
24492531 {
24502532 ClipMesh();
24512533 } else
2452
- if (event.getSource() == smoothMeshItem)
2534
+ if (source == smoothMeshItem)
24532535 {
24542536 SmoothMesh();
24552537 } else
2456
- if (event.getSource() == transformgeometryItem)
2538
+ if (source == transformgeometryItem)
24572539 {
24582540 TransformGeometry();
24592541 } else
2460
- if (event.getSource() == resetTransformItem)
2542
+ if (source == resetTransformItem)
24612543 {
24622544 ResetTransform();
24632545 } else
2464
- if (event.getSource() == resetCentroidItem)
2546
+ if (source == resetCentroidItem)
24652547 {
24662548 ResetCentroid();
24672549 } else
2468
- if (event.getSource() == resetParentItem)
2550
+ if (source == resetParentItem)
24692551 {
24702552 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712553 {
....@@ -2475,7 +2557,7 @@
24752557
24762558 refreshContents();
24772559 } else
2478
- if (event.getSource() == repairParentItem)
2560
+ if (source == repairParentItem)
24792561 {
24802562 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812563 {
....@@ -2489,7 +2571,21 @@
24892571
24902572 refreshContents();
24912573 } else
2492
- if (event.getSource() == sortbysizeItem)
2574
+ if (source == repairShadowItem)
2575
+ {
2576
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2577
+ {
2578
+ Object3D obj = (Object3D)e.nextElement();
2579
+ obj.RepairShadow();
2580
+// for (int i=0; i<obj.size(); i++)
2581
+// {
2582
+// obj.get(i).parent = obj;
2583
+// }
2584
+ }
2585
+
2586
+ refreshContents();
2587
+ } else
2588
+ if (source == sortbysizeItem)
24932589 {
24942590 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952591 {
....@@ -2501,7 +2597,7 @@
25012597 ResetModel();
25022598 refreshContents();
25032599 } else
2504
- if (event.getSource() == sortbynameItem)
2600
+ if (source == sortbynameItem)
25052601 {
25062602 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072603 {
....@@ -2513,7 +2609,7 @@
25132609 ResetModel();
25142610 refreshContents();
25152611 } else
2516
- if (event.getSource() == attachPigmentItem)
2612
+ if (source == attachPigmentItem)
25172613 {
25182614 String texture = GetFile("Attach pigment");
25192615 Object3D obj;
....@@ -2525,7 +2621,7 @@
25252621
25262622 refreshContents();
25272623 } else
2528
- if (event.getSource() == detachPigmentItem)
2624
+ if (source == detachPigmentItem)
25292625 {
25302626 Object3D obj;
25312627 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2632,7 @@
25362632
25372633 refreshContents();
25382634 } else
2539
- if (event.getSource() == attachBumpItem)
2635
+ if (source == attachBumpItem)
25402636 {
25412637 String texture = GetFile("Attach bump");
25422638 Object3D obj;
....@@ -2548,7 +2644,7 @@
25482644
25492645 refreshContents();
25502646 } else
2551
- if (event.getSource() == detachBumpItem)
2647
+ if (source == detachBumpItem)
25522648 {
25532649 Object3D obj;
25542650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2655,7 @@
25592655
25602656 refreshContents();
25612657 } else
2562
- if (event.getSource() == pigmentBumpItem)
2658
+ if (source == pigmentBumpItem)
25632659 {
25642660 Object3D obj;
25652661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2666,195 @@
25702666
25712667 refreshContents();
25722668 } else
2573
- if (event.getSource() == flashSelectionButton)
2669
+ if (source == flashSelectionButton)
25742670 {
25752671 CameraPane.flash = true;
25762672 refreshContents();
25772673 } else
2578
- if (event.getSource() == oneButton)
2674
+ if (source == oneButton)
25792675 {
25802676 } else
2581
- if (event.getSource() == twoButton)
2677
+ if (source == twoButton)
25822678 {
25832679 radio.layout = twoButton;
25842680 // bug
25852681 //gridPanel.setDividerLocation(1.0);
25862682 //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();
2683
+// bigThree.remove(scenePanel);
2684
+// bigThree.remove(centralPanel);
2685
+// bigThree.remove(XYZPanel);
2686
+// aWindowConstraints.gridx = 0;
2687
+// aWindowConstraints.gridy = 0;
2688
+// aWindowConstraints.gridwidth = 1;
2689
+// // aConstraints.gridheight = 3;
2690
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2691
+// aWindowConstraints.weightx = 0;
2692
+// aWindowConstraints.weighty = 1;
2693
+// //bigThree.add(jtp, aWindowConstraints);
2694
+// aWindowConstraints.weightx = 1;
2695
+// aWindowConstraints.gridwidth = 3;
2696
+// // aConstraints.gridheight = 3;
2697
+// aWindowConstraints.gridx = 1;
2698
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2699
+// bigThree.add(centralPanel, aWindowConstraints);
2700
+// aWindowConstraints.weightx = 0;
2701
+// aWindowConstraints.gridx = 4;
2702
+// aWindowConstraints.gridwidth = 1;
2703
+// // aConstraints.gridheight = 3;
2704
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2705
+// //bigThree.add(XYZPanel, aWindowConstraints);
2706
+// scenePanel.setVisible(false);
2707
+// centralPanel.setVisible(true);
2708
+// XYZPanel.setVisible(false);
2709
+ bigThree.ClearUI();
2710
+ bigThree.add(centralPanel);
2711
+ bigThree.FlushUI();
26112712 } else
2612
- if (event.getSource() == threeButton)
2713
+ if (source == threeButton)
26132714 {
26142715 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();
2716
+
2717
+// bigThree.remove(scenePanel);
2718
+// bigThree.remove(centralPanel);
2719
+// bigThree.remove(XYZPanel);
2720
+// aWindowConstraints.gridx = 0;
2721
+// aWindowConstraints.gridy = 0;
2722
+// aWindowConstraints.gridwidth = 1;
2723
+// // aConstraints.gridheight = 3;
2724
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2725
+// aWindowConstraints.weightx = 0;
2726
+// aWindowConstraints.weighty = 1;
2727
+// //bigThree.add(jtp, aWindowConstraints);
2728
+// aWindowConstraints.weightx = 1;
2729
+// aWindowConstraints.gridwidth = 3;
2730
+// // aConstraints.gridheight = 3;
2731
+// aWindowConstraints.gridx = 1;
2732
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2733
+// bigThree.add(centralPanel, aWindowConstraints);
2734
+// aWindowConstraints.weightx = 0;
2735
+// aWindowConstraints.gridx = 4;
2736
+// aWindowConstraints.gridwidth = 1;
2737
+// // aConstraints.gridheight = 3;
2738
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2739
+// bigThree.add(XYZPanel, aWindowConstraints);
2740
+// bigThree.validate();
2741
+// scenePanel.setVisible(false);
2742
+// centralPanel.setVisible(true);
2743
+// XYZPanel.setVisible(true);
2744
+ bigThree.ClearUI();
2745
+ bigThree.add(centralPanel);
2746
+ bigThree.add(XYZPanel);
2747
+ bigThree.FlushUI();
26392748 } else
2640
- if (event.getSource() == fourButton)
2749
+ if (source == fourButton)
26412750 {
26422751 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();
2752
+
2753
+// bigThree.remove(scenePanel);
2754
+// bigThree.remove(centralPanel);
2755
+// bigThree.remove(XYZPanel);
2756
+// aWindowConstraints.gridx = 0;
2757
+// aWindowConstraints.gridy = 0;
2758
+// aWindowConstraints.gridwidth = 1;
2759
+// // aWindowConstraints.gridheight = 3;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// aWindowConstraints.weightx = 1;
2762
+// aWindowConstraints.weighty = 1;
2763
+// bigThree.add(scenePanel, aWindowConstraints);
2764
+// aWindowConstraints.weightx = 1;
2765
+// aWindowConstraints.gridwidth = 3;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.gridx = 1;
2768
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
+// //bigThree.add(cameraPanel, aWindowConstraints);
2770
+// aWindowConstraints.weightx = 0;
2771
+// aWindowConstraints.gridx = 4;
2772
+// aWindowConstraints.gridwidth = 1;
2773
+// // aWindowConstraints.gridheight = 3;
2774
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
+// //bigThree.add(XYZPanel, aWindowConstraints);
2776
+// bigThree.validate();
2777
+// scenePanel.setVisible(true);
2778
+// centralPanel.setVisible(false);
2779
+// XYZPanel.setVisible(false);
2780
+ bigThree.ClearUI();
2781
+ bigThree.add(scenePanel);
2782
+ bigThree.FlushUI();
26672783 } else
2668
- if (event.getSource() == sixButton)
2784
+ if (source == sixButton)
26692785 {
26702786 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();
2787
+
2788
+// bigThree.remove(scenePanel);
2789
+// bigThree.remove(centralPanel);
2790
+// bigThree.remove(XYZPanel);
2791
+// aWindowConstraints.gridx = 0;
2792
+// aWindowConstraints.gridy = 0;
2793
+// aWindowConstraints.gridwidth = 1;
2794
+// // aConstraints.gridheight = 3;
2795
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2796
+// aWindowConstraints.weightx = 0;
2797
+// aWindowConstraints.weighty = 1;
2798
+// bigThree.add(scenePanel, aWindowConstraints);
2799
+// aWindowConstraints.weightx = 1;
2800
+// aWindowConstraints.gridwidth = 3;
2801
+// // aWindowConstraints.gridheight = 3;
2802
+// aWindowConstraints.gridx = 1;
2803
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2804
+// bigThree.add(centralPanel, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 0;
2806
+// aWindowConstraints.gridx = 4;
2807
+// aWindowConstraints.gridwidth = 1;
2808
+// // aWindowConstraints.gridheight = 3;
2809
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2810
+// //bigThree.add(XYZPanel, aConstraints);
2811
+// bigThree.validate();
2812
+// scenePanel.setVisible(true);
2813
+// centralPanel.setVisible(true);
2814
+// XYZPanel.setVisible(false);
2815
+ bigThree.ClearUI();
2816
+ bigThree.add(scenePanel);
2817
+ bigThree.add(centralPanel);
2818
+ bigThree.FlushUI();
26952819 } else
2696
- if (event.getSource() == sevenButton)
2820
+ if (source == sevenButton)
26972821 {
26982822 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();
2823
+
2824
+// bigThree.remove(scenePanel);
2825
+// bigThree.remove(centralPanel);
2826
+// bigThree.remove(XYZPanel);
2827
+// aWindowConstraints.gridx = 0;
2828
+// aWindowConstraints.gridy = 0;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aWindowConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// aWindowConstraints.weightx = 0;
2833
+// aWindowConstraints.weighty = 1;
2834
+// bigThree.add(scenePanel, aWindowConstraints);
2835
+// aWindowConstraints.weightx = 1;
2836
+// aWindowConstraints.gridwidth = 3;
2837
+// // aWindowConstraints.gridheight = 3;
2838
+// aWindowConstraints.gridx = 1;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// bigThree.add(centralPanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 0;
2842
+// aWindowConstraints.gridx = 4;
2843
+// aWindowConstraints.gridwidth = 1;
2844
+// // aConstraints.gridheight = 3;
2845
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2846
+// bigThree.add(XYZPanel, aWindowConstraints);
2847
+// bigThree.validate();
2848
+// scenePanel.setVisible(true);
2849
+// centralPanel.setVisible(true);
2850
+// XYZPanel.setVisible(true);
2851
+ bigThree.ClearUI();
2852
+ bigThree.add(scenePanel);
2853
+ bigThree.add(centralPanel);
2854
+ bigThree.add(XYZPanel);
2855
+ bigThree.FlushUI();
27232856 } else
2724
- if (event.getSource() == rootButton)
2857
+ if (source == rootButton)
27252858 {
27262859 Object3D obj;
27272860 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2866,7 @@
27332866
27342867 refreshContents(true);
27352868 } else
2736
- if (event.getSource() == closeButton)
2869
+ if (source == closeButton)
27372870 {
27382871 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392872 cRadio ab;
....@@ -2754,11 +2887,11 @@
27542887 }
27552888 refreshContents(true);
27562889 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
2890
+ if (source == editItem || source == editButton)
27582891 {
27592892 EditSelection(false);
27602893 } else
2761
- if (event.getSource() == uneditButton)
2894
+ if (source == uneditButton)
27622895 {
27632896 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27642897 {
....@@ -2770,12 +2903,12 @@
27702903
27712904 child.editWindow = null; // ???????????
27722905 }
2773
- objEditor.ctrlPanel.revalidate();
2906
+ objEditor.ctrlPanel.validate();
27742907 //objEditor.jTree.clearSelection();
27752908 //objEditor.ResetSliders();
27762909 refreshContents(true);
27772910 } else
2778
- if (event.getSource() == clearPanelButton)
2911
+ if (source == clearPanelButton)
27792912 {
27802913 assert(copy == group);
27812914 //copy.ClearUI();
....@@ -2786,7 +2919,7 @@
27862919 listUI.clear();
27872920 refreshContents(true);
27882921 } else
2789
- if (event.getSource() == allParamsButton)
2922
+ if (source == allParamsButton)
27902923 {
27912924 assert(copy == group);
27922925
....@@ -2807,19 +2940,19 @@
28072940
28082941 refreshContents(true);
28092942 } else
2810
- if (event.getSource() == unselectButton)
2943
+ if (source == unselectButton)
28112944 {
28122945 objEditor.jTree.clearSelection();
28132946 // ?? oct 2012 GrafreeD.clipboard.clear();
28142947 objEditor.ResetSliders();
28152948 refreshContents(true);
28162949 } else
2817
- if(event.getSource() instanceof cRadio)
2950
+ if(source instanceof cRadio)
28182951 {
28192952 group.parent = keepparent;
28202953 group.attributes = 0;
28212954 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
2955
+ /*cRadio*/ radio = (cRadio)source;
28232956 Object3D obj = radio.GetObject();
28242957 System.out.println("Edit " + obj);
28252958 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +2972,7 @@
28392972 }
28402973
28412974 copy = group;
2842
- //CameraPane.theRenderer.object = group;
2975
+ //Globals.theRenderer.object = group;
28432976 if(!useclient)
28442977 {
28452978 cameraView.renderCamera = radio.camera;
....@@ -2848,7 +2981,8 @@
28482981 cameraView.cameras[cameraView.cameracount] = radio.camera;
28492982 cameraView.targetLookAt.set(radio.camera.lookAt);
28502983 cameraView.object = group;
2851
- cameraView.lighttouched = true;
2984
+ //cameraView.lighttouched = true;
2985
+ Globals.lighttouched = true;
28522986 topView.object = group;
28532987 frontView.object = group;
28542988 sideView.object = group;
....@@ -2884,7 +3018,7 @@
28843018 if (useclient)
28853019 {
28863020 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
28883022 //topView.object = client;
28893023 //frontView.object = client;
28903024 //sideView.object = client;
....@@ -2892,7 +3026,7 @@
28923026 else
28933027 {
28943028 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3029
+ Globals.lighttouched = true;
28963030 //topView.object = group;
28973031 //frontView.object = group;
28983032 //sideView.object = group;
....@@ -3173,6 +3307,13 @@
31733307 refreshContents();
31743308 }
31753309
3310
+ void GenNormalsMINE()
3311
+ {
3312
+ group.selection.GenNormalsMINE();
3313
+
3314
+ refreshContents();
3315
+ }
3316
+
31763317 void Stripify()
31773318 {
31783319 group.StripifyS();
....@@ -3393,7 +3534,7 @@
33933534 String pigment = Object3D.GetPigment(tex);
33943535 //String bump = Object3D.GetBump(tex);
33953536
3396
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3537
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33973538
33983539 double s = v.s;
33993540
....@@ -3441,12 +3582,26 @@
34413582
34423583 void Align()
34433584 {
3585
+ if (group.selection.size() == 0)
3586
+ return;
3587
+
3588
+ cVector bbmin = new cVector();
3589
+ cVector bbmax = new cVector();
3590
+
3591
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3592
+
3593
+ double dx = bbmax.x - bbmin.x;
3594
+ double dy = bbmax.y - bbmin.y;
3595
+ double dz = bbmax.z - bbmin.z;
3596
+
3597
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3598
+
34443599 for (int i=0; i<group.selection.size(); i++)
34453600 {
34463601 Object3D obj = group.selection.get(i);
34473602
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3603
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3604
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34503605 }
34513606
34523607 refreshContents();
....@@ -3680,7 +3835,7 @@
36803835 group.selection.RelinkToSupport(); // july 2014
36813836 System.out.println("DONE.");
36823837 refreshContents();
3683
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3838
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36843839 }
36853840
36863841 void ReduceMesh(boolean reduction34)
....@@ -3956,25 +4111,25 @@
39564111 System.err.println("info : " + child.GetPath());
39574112 }
39584113 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
39654120
39664121 objEditor.SetText(); // jan 2014
39674122
3968
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4123
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39694124 CameraPane.flash = true;
39704125
39714126 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724127 // a camera
39734128 {
39744129 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;
4130
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4131
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4132
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39784133 }
39794134
39804135 refreshContents();
....@@ -4468,6 +4623,26 @@
44684623 makeSomething(csg);
44694624 }
44704625
4626
+ void Ungroup(Object3D g)
4627
+ {
4628
+ if (g instanceof HiddenObject)
4629
+ {
4630
+ HiddenObject h = (HiddenObject) g;
4631
+
4632
+ for (int i=0; i<h.ActualSize(); i++)
4633
+ {
4634
+ objEditor.makeSomething(h.get(i), false);
4635
+ }
4636
+ }
4637
+ else
4638
+ {
4639
+ for (int i=0; i<g.Size(); i++)
4640
+ {
4641
+ objEditor.makeSomething(g.get(i), false);
4642
+ }
4643
+ }
4644
+ }
4645
+
44714646 void ungroup()
44724647 {
44734648 /*
....@@ -4827,6 +5002,7 @@
48275002 private MenuItem resetsupportItem;
48285003 private MenuItem resetreferencesItem;
48295004 private MenuItem linkverticesItem;
5005
+ private MenuItem relinkverticesItem;
48305006 private MenuItem setMasterItem;
48315007 private MenuItem resetMeshItem;
48325008 private MenuItem stepAllItem;
....@@ -4845,8 +5021,10 @@
48455021 private MenuItem clearItem;
48465022 private MenuItem clearAllItem;
48475023 private MenuItem genUVItem;
5024
+ private MenuItem genNormalsMESHItem;
48485025 private MenuItem genNormalsCADItem;
48495026 private MenuItem genNormalsORGANItem;
5027
+ private MenuItem genNormalsMINEItem;
48505028 private MenuItem stripifyItem;
48515029 private MenuItem unstripifyItem;
48525030 private MenuItem trimItem;
....@@ -4888,6 +5066,7 @@
48885066 private MenuItem resetCentroidItem;
48895067 private MenuItem transformgeometryItem;
48905068 private MenuItem resetTransformItem;
5069
+ private MenuItem hideItem;
48915070 private MenuItem grabItem;
48925071 private MenuItem backItem;
48935072 private MenuItem frontItem;
....@@ -4908,6 +5087,7 @@
49085087
49095088 private MenuItem resetParentItem;
49105089 private MenuItem repairParentItem;
5090
+ private MenuItem repairShadowItem;
49115091 private MenuItem sortbysizeItem;
49125092 private MenuItem sortbynameItem;
49135093
....@@ -4928,6 +5108,7 @@
49285108 private MenuItem coneItem;
49295109 private MenuItem torusItem;
49305110 private MenuItem superItem;
5111
+ private MenuItem kleinItem;
49315112 private MenuItem blobItem;
49325113 private MenuItem latheItem;
49335114 private MenuItem bezierItem;
....@@ -4940,6 +5121,7 @@
49405121 private MenuItem csgItem;
49415122 private MenuItem templateItem;
49425123 private MenuItem textureItem;
5124
+ private MenuItem billboardItem;
49435125 private MenuItem shadowXItem;
49445126 private MenuItem shadowYItem;
49455127 private MenuItem shadowZItem;