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"));
....@@ -287,6 +294,8 @@
287294 genNormalsCADItem.addActionListener(this);
288295 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289296 genNormalsMESHItem.addActionListener(this);
297
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298
+ genNormalsMINEItem.addActionListener(this);
290299 stripifyItem = menu.add(new MenuItem("Stripify"));
291300 stripifyItem.addActionListener(this);
292301 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -425,84 +434,26 @@
425434 oe.radioPanel.add(dummyButton);
426435 oe.buttonGroup.add(dummyButton);
427436 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431438
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
+ liveCB.setToolTipText("Enabled animation");
433441 liveCB.addItemListener(this);
434442
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
453
- fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444
+ trackCB.setToolTipText("Enable tracking");
495445 trackCB.addItemListener(this);
496446
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
448
+ screenfitButton.setToolTipText("Screen fit");
499449 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
450
+
501451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502452 // screenfitpointButton.addActionListener(this);
503453 // oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
505455 snapobjectButton.addActionListener(this);
456
+ snapobjectButton.setToolTipText("Snap Object");
506457 oe.aConstraints.gridx += 1;
507458
508459 //aConstraints.gridx = 0;
....@@ -510,65 +461,66 @@
510461 oe.aConstraints.weighty = 0;
511462 oe.aConstraints.gridwidth = 1;
512463
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
+ flashSelectionButton.setToolTipText("Show selection");
514466 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518467
519
- //
520
- 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");
521472 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523474 fourButton.addActionListener(this);
524
- 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");
525478 sixButton.addActionListener(this);
526
- 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");
527481 threeButton.addActionListener(this);
528
- 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");
529484 sevenButton.addActionListener(this);
530485 //
531486
532
- 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");
533489 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- 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");
536493 closeButton.addActionListener(this);
537494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538495 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540496
541
- oe.aConstraints.gridx = 1; //
542
- 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");
543501 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547502
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
549505 uneditButton.addActionListener(this);
550506
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
507
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ clearPanelButton.setToolTipText("Clear edit panel");
556509 clearPanelButton.addActionListener(this);
557510
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
511
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ allParamsButton.setToolTipText("All params??");
563513 allParamsButton.addActionListener(this);
564514
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
570517 unselectButton.addActionListener(this);
571518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
572524 // oe.aConstraints.gridx += 1;
573525 // oe.aConstraints.weighty = 0;
574526 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +532,37 @@
580532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581533 // gcButton.addActionListener(this);
582534
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
594538 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
539
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596540 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
601544
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
606549 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- 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");
609553 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- 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");
612557 textureCB.addItemListener(this);
613558
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
616562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
617566 //jList.addListSelectionListener(this);
618567 oe.jTree.addTreeSelectionListener(this);
619568 //jTree.setRootVisible(false);
....@@ -635,17 +584,97 @@
635584 radio.layout = sevenButton;
636585 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637586 }
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
+ }
638667
639668 void EditObject(Object3D obj)
640669 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
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();
649678 }
650679 void SetupViews(ObjEditor oe)
651680 {
....@@ -665,6 +694,7 @@
665694 JCheckBox fastCB;
666695 JCheckBox slowCB;
667696 JCheckBox boxCB;
697
+ JCheckBox zoomBoxCB;
668698 JCheckBox trackCB;
669699 JCheckBox smoothfocusCB;
670700 // JCheckBox speakerMocapCB;
....@@ -707,8 +737,7 @@
707737 dropAttributes |= Object3D.TEXTURE;
708738 else
709739 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
740
+ } else if(e.getSource() == liveCB)
712741 {
713742 cameraView.ToggleLive();
714743 }
....@@ -745,6 +774,10 @@
745774 Recompile();
746775 cameraView.repaint();
747776 // refreshContents();
777
+ }
778
+ else if(e.getSource() == zoomBoxCB)
779
+ {
780
+ cameraView.ToggleZoomBoxMode();
748781 }
749782 else if(e.getSource() == smoothfocusCB)
750783 {
....@@ -1035,6 +1068,8 @@
10351068 torusItem.addActionListener(this);
10361069 superItem = menu.add(new MenuItem("Superellipsoid"));
10371070 superItem.addActionListener(this);
1071
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1072
+ kleinItem.addActionListener(this);
10381073 particleItem = menu.add(new MenuItem("Particle system"));
10391074 particleItem.addActionListener(this);
10401075 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1108,6 +1143,8 @@
11081143 resetParentItem.addActionListener(this);
11091144 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101145 repairParentItem.addActionListener(this);
1146
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1147
+ repairShadowItem.addActionListener(this);
11111148 menu.add(invariantsItem = new MenuItem("Invariants"));
11121149 invariantsItem.addActionListener(this);
11131150 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1468,6 +1505,7 @@
14681505 //
14691506 public void actionPerformed(ActionEvent event) // , Object arg)
14701507 {
1508
+ Object source = event.getSource();
14711509 /*
14721510 if (event.getSource() == nameField)
14731511 {
....@@ -1479,11 +1517,11 @@
14791517 }
14801518 else
14811519 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1520
+ if (source == lookAtItem || source == lookFromItem)
14831521 {
14841522 ScreenFit();
14851523 } else
1486
- if (event.getSource() == switchItem)
1524
+ if (source == switchItem)
14871525 {
14881526 cVector v1 = new cVector();
14891527 cVector v2 = new cVector();
....@@ -1492,11 +1530,11 @@
14921530 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931531 objEditor.cameraView.repaint();
14941532 } else
1495
- if (event.getSource() == rectoidItem)
1533
+ if (source == rectoidItem)
14961534 {
14971535 makeSomething(new Box());
14981536 } else
1499
- if (event.getSource() == particleItem)
1537
+ if (source == particleItem)
15001538 {
15011539 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021540 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1555,9 @@
15171555 applyExample(particleGeom, "SMOKE");
15181556 makeSomething(particleGeom);
15191557 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1558
+ if (source == ragdollItem || source == ragdoll2Item)
15211559 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1560
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231561
15241562 ragdoll.toParent = LA.newMatrix();
15251563 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1575,7 @@
15371575 } else
15381576 /*
15391577 */
1540
- if (event.getSource() == heightFieldItem)
1578
+ if (source == heightFieldItem)
15411579 {
15421580 Object3D obj = new Object3D();
15431581
....@@ -1575,27 +1613,31 @@
15751613
15761614 makeSomething(obj);
15771615 } else
1578
- if (event.getSource() == gridItem)
1616
+ if (source == gridItem)
15791617 {
15801618 makeSomething(new Grid());
15811619 } else
1582
- if (event.getSource() == ellipsoidItem)
1620
+ if (source == ellipsoidItem)
15831621 {
15841622 makeSomething(new Sphere());
15851623 } else
1586
- if (event.getSource() == coneItem)
1624
+ if (source == coneItem)
15871625 {
15881626 makeSomething(new Cone());
15891627 } else
1590
- if (event.getSource() == torusItem)
1628
+ if (source == torusItem)
15911629 {
15921630 makeSomething(new Torus());
15931631 } else
1594
- if (event.getSource() == superItem)
1632
+ if (source == superItem)
15951633 {
15961634 makeSomething(new Superellipsoid());
15971635 } else
1598
- if (event.getSource() == blobItem)
1636
+ if (source == kleinItem)
1637
+ {
1638
+ makeSomething(new Klein());
1639
+ } else
1640
+ if (source == blobItem)
15991641 {
16001642 Blob blob = new Blob();
16011643 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1645,15 @@
16031645 //blob.retile();
16041646 makeSomething(blob);
16051647 } else
1606
- if (event.getSource() == latheItem)
1648
+ if (source == latheItem)
16071649 {
16081650 makeSomething(new Lathe());
16091651 } else
1610
- if (event.getSource() == bezierItem)
1652
+ if (source == bezierItem)
16111653 {
16121654 makeSomething(new BezierSurface());
16131655 } else
1614
- if (event.getSource() == checkerItem)
1656
+ if (source == checkerItem)
16151657 {
16161658 /*
16171659 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1668,7 @@
16261668 */
16271669 makeSomething(new Checker());
16281670 } else
1629
- if (event.getSource() == meshItem)
1671
+ if (source == meshItem)
16301672 {
16311673 Object3D itemtomake = new Object3D();
16321674 Object3D child;
....@@ -1647,35 +1689,35 @@
16471689 makeSomething(child);
16481690 }
16491691 } else
1650
- if (event.getSource() == springItem)
1692
+ if (source == springItem)
16511693 {
16521694 cSpring s = new cSpring();
16531695 s.setup();
16541696 makeSomething(s);
16551697 } else
1656
- if (event.getSource() == flagItem)
1698
+ if (source == flagItem)
16571699 {
16581700 cSpring s = new cFlag();
16591701 s.setup();
16601702 makeSomething(s);
16611703 } else
1662
- if (event.getSource() == lightItem)
1704
+ if (source == lightItem)
16631705 {
16641706 makeSomething(new Light());
16651707 } else
1666
- if (event.getSource() == csgItem)
1708
+ if (source == csgItem)
16671709 {
16681710 group(new CSG());
16691711 } else
1670
- if (event.getSource() == templateItem)
1712
+ if (source == templateItem)
16711713 {
16721714 group(new cTemplate());
16731715 } else
1674
- if (event.getSource() == attributeItem)
1716
+ if (source == attributeItem)
16751717 {
16761718 makeSomething(new Attribute());
16771719 } else
1678
- if (event.getSource() == pointflowItem)
1720
+ if (source == pointflowItem)
16791721 {
16801722 makeSomething(new PointFlow());
16811723 } else
....@@ -1687,7 +1729,7 @@
16871729 } else
16881730 */
16891731
1690
- if (event.getSource() == superLoopItem)
1732
+ if (source == superLoopItem)
16911733 {
16921734 Composite g = new cGroup();
16931735 for (int i=0; i<15; i++)
....@@ -1709,7 +1751,7 @@
17091751
17101752 group(g);
17111753 } else
1712
- if (event.getSource() == loopItem)
1754
+ if (source == loopItem)
17131755 {
17141756 Composite csg = new GroupLeaf();
17151757 csg.count = 5;
....@@ -1718,7 +1760,7 @@
17181760 csg.addChild(child);
17191761 child.addChild(csg);
17201762 } else
1721
- if (event.getSource() == doubleItem)
1763
+ if (source == doubleItem)
17221764 {
17231765 Composite csg = new GroupLeaf();
17241766 csg.count = 5;
....@@ -1730,7 +1772,7 @@
17301772 csg.addChild(child);
17311773 child.addChild(csg);
17321774 } else
1733
- if (event.getSource() == tripleItem)
1775
+ if (source == tripleItem)
17341776 {
17351777 Composite csg = new GroupLeaf();
17361778 csg.count = 4;
....@@ -1746,70 +1788,70 @@
17461788 child.addChild(csg);
17471789 } else
17481790
1749
- if (event.getSource() == importGFDItem)
1791
+ if (source == importGFDItem)
17501792 {
17511793 ImportGFD();
17521794 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1795
+ if (source == importVRMLX3DItem)
17541796 {
17551797 ImportVRMLX3D();
17561798 } else
1757
- if (event.getSource() == import3DSItem)
1799
+ if (source == import3DSItem)
17581800 {
17591801 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17601802 } else
1761
- if (event.getSource() == importOBJItem)
1803
+ if (source == importOBJItem)
17621804 {
17631805 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17641806 } else
1765
- if (event.getSource() == computeAOItem)
1807
+ if (source == computeAOItem)
17661808 {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1809
+ Globals.drawMode = CameraPane.OCCLUSION;
1810
+ Globals.theRenderer.repaint();
17691811 } else
1770
- if (event.getSource() == recompileItem)
1812
+ if (source == recompileItem)
17711813 {
17721814 Recompile();
17731815 refreshContents();
17741816 } else
1775
- if (event.getSource() == editScriptItem)
1817
+ if (source == editScriptItem)
17761818 {
17771819 OpenDialog();
17781820 refreshContents();
17791821 } else
1780
- if (event.getSource() == invariantsItem)
1822
+ if (source == invariantsItem)
17811823 {
17821824 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1825
+ GrafreeD.grafreeD.universe.invariants();
17841826 } else
1785
- if (event.getSource() == memoryItem)
1827
+ if (source == memoryItem)
17861828 {
17871829 //System.out.println("Invariants:");
17881830 PrintMemory();
17891831 } else
1790
- if (event.getSource() == pathItem)
1832
+ if (source == pathItem)
17911833 {
17921834 PrintPath();
17931835 } else
1794
- if (event.getSource() == analyzeItem)
1836
+ if (source == analyzeItem)
17951837 {
17961838 AnalyzeObject();
17971839 } else
1798
- if (event.getSource() == dumpItem)
1840
+ if (source == dumpItem)
17991841 {
18001842 DumpObject();
18011843 } else
1802
- if (event.getSource() == screenfitButton)
1844
+ if (source == screenfitButton)
18031845 {
18041846 //Reload(lastConverter, lastFilename, true);
18051847 ScreenFit();
18061848 } else
1807
- if (event.getSource() == screenfitpointButton)
1849
+ if (source == screenfitpointButton)
18081850 {
18091851 //Reload(lastConverter, lastFilename, true);
18101852 ScreenFitPoint();
18111853 } else
1812
- if (event.getSource() == snapobjectButton)
1854
+ if (source == snapobjectButton)
18131855 {
18141856 //Reload(lastConverter, lastFilename, true);
18151857 SnapObject();
....@@ -1820,13 +1862,13 @@
18201862 // Recompile();
18211863 // refreshContents();
18221864 // } else
1823
- if (event.getSource() == gcButton)
1865
+ if (source == gcButton)
18241866 {
18251867 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261868 System.gc();
18271869 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281870 } else
1829
- if (event.getSource() == editLeafItem)
1871
+ if (source == editLeafItem)
18301872 {
18311873 Object3D obj;
18321874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1882,62 @@
18401882 }
18411883 refreshContents(true);
18421884 } else
1843
- if (event.getSource() == openWindowItem)
1885
+ if (source == openWindowItem)
18441886 {
18451887 EditSelection(true);
18461888 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1889
+ if (source == cutItem || source == clearButton)
18481890 {
18491891 loadClipboard(true);
18501892 } else
1851
- if (event.getSource() == duplicateItem)
1893
+ if (source == duplicateItem)
18521894 {
18531895 Object3D keep = GrafreeD.clipboard;
18541896 loadClipboard(false);
18551897 paste(false);
18561898 GrafreeD.clipboard = keep;
18571899 } else
1858
- if (event.getSource() == cloneItem)
1900
+ if (source == cloneItem)
18591901 {
18601902 CloneSelection(false);
18611903 } else
1862
- if (event.getSource() == cloneSupportItem)
1904
+ if (source == cloneSupportItem)
18631905 {
18641906 CloneSelection(true);
18651907 } else
1866
- if (event.getSource() == copyItem)
1908
+ if (source == copyItem)
18671909 {
18681910 loadClipboard(false);
18691911 } else
1870
- if (event.getSource() == pasteItem)
1912
+ if (source == pasteItem)
18711913 {
18721914 paste(false);
18731915 } else
1874
- if (event.getSource() == pasteLinkItem)
1916
+ if (source == pasteLinkItem)
18751917 {
18761918 pasteInto(false);
18771919 } else
1878
- if (event.getSource() == pasteCloneItem)
1920
+ if (source == pasteCloneItem)
18791921 {
18801922 pasteInto(true);
18811923 } else
1882
- if (event.getSource() == pasteExpandItem)
1924
+ if (source == pasteExpandItem)
18831925 {
18841926 paste(true);
18851927 } else
1886
- if (event.getSource() == synchronizeItem)
1928
+ if (source == synchronizeItem)
18871929 {
18881930 Overwrite(Object3D.TRANSFORM);
18891931 } else
1890
- if (event.getSource() == overwriteNameItem)
1932
+ if (source == overwriteNameItem)
18911933 {
18921934 Overwrite(Object3D.NAME);
18931935 } else
1894
- if (event.getSource() == overwriteUVItem)
1936
+ if (source == overwriteUVItem)
18951937 {
18961938 Overwrite(Object3D.UV);
18971939 } else
1898
- if (event.getSource() == overwriteMatItem)
1940
+ if (source == overwriteMatItem)
18991941 {
19001942 /* july 2015
19011943 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +1957,7 @@
19151957
19161958 Overwrite(dropAttributes);
19171959 }
1918
- if (event.getSource() == overwriteGeoItem)
1960
+ if (source == overwriteGeoItem)
19191961 {
19201962 Overwrite(Object3D.GEOMETRY);
19211963 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +1974,7 @@
19321974 // refreshContents();
19331975 // }
19341976 } else
1935
- if (event.getSource() == generateMeshItem)
1977
+ if (source == generateMeshItem)
19361978 {
19371979 //if (group.selection.size() == 1)
19381980 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +1985,7 @@
19431985 ResetModel();
19441986 refreshContents();
19451987 } else
1946
- if (event.getSource() == extractGeometriesItem)
1988
+ if (source == extractGeometriesItem)
19471989 {
19481990 boolean one = false;
19491991
....@@ -1970,7 +2012,7 @@
19702012 ResetModel();
19712013 refreshContents();
19722014 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2015
+ if (source == cloneGeometriesItem)
19742016 {
19752017 boolean one = false;
19762018
....@@ -1996,32 +2038,37 @@
19962038 ResetModel();
19972039 refreshContents();
19982040 } else
1999
- if (event.getSource() == shareGeometriesItem)
2041
+ if (source == shareGeometriesItem)
20002042 {
20012043 boolean one = false;
20022044
20032045 if (group.selection.size() == 1)
20042046 one = true;
20052047
2048
+ Object3D merge = null;
2049
+
20062050 Object3D content = new cGroup();
20072051
20082052 for (int i=0; i<group.selection.size(); i++)
20092053 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2054
+ merge = new Merge(group.selection.get(i));
20112055
20122056 if (one)
2013
- makeSomething(sel, false);
2057
+ makeSomething(merge, false);
20142058 else
2015
- content.addChild(sel);
2059
+ content.addChild(merge);
20162060 }
20172061
20182062 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2063
+ makeSomething(content, true);
2064
+ else
2065
+ {
2066
+ ResetModel();
2067
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2068
+ refreshContents();
2069
+ }
20232070 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2071
+ if (source == mergeGeometriesItem)
20252072 {
20262073 boolean one = false;
20272074
....@@ -2051,7 +2098,7 @@
20512098 ResetModel();
20522099 refreshContents();
20532100 } else
2054
- if (event.getSource() == linkverticesItem)
2101
+ if (source == linkverticesItem)
20552102 {
20562103 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572104 // {
....@@ -2071,7 +2118,7 @@
20712118 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722119 content = ((cGroup)content).get(0);
20732120
2074
- 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));
20752122 for (int i=0; i<group.selection.size(); i++)
20762123 {
20772124 boolean random = CameraPane.RANDOM;
....@@ -2080,11 +2127,11 @@
20802127 // group.selection.get(i).setMasterThis(content); // should be identity
20812128 CameraPane.RANDOM = random;
20822129 }
2083
- 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));
20842131 refreshContents();
20852132 }
20862133 } else
2087
- if (event.getSource() == resetsupportItem)
2134
+ if (source == resetsupportItem)
20882135 {
20892136 for (int i=0; i<group.selection.size(); i++)
20902137 {
....@@ -2096,7 +2143,16 @@
20962143
20972144 refreshContents();
20982145 } else
2099
- 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)
21002156 {
21012157 for (int i=0; i<group.selection.size(); i++)
21022158 {
....@@ -2105,7 +2161,7 @@
21052161
21062162 refreshContents();
21072163 } else
2108
- if (event.getSource() == setMasterItem)
2164
+ if (source == setMasterItem)
21092165 {
21102166 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21112167 {
....@@ -2118,7 +2174,7 @@
21182174 refreshContents();
21192175 }
21202176 } else
2121
- if (event.getSource() == poseMeshItem)
2177
+ if (source == poseMeshItem)
21222178 {
21232179 if (group.selection.size() == 1)
21242180 {
....@@ -2137,19 +2193,19 @@
21372193 }
21382194
21392195 } else
2140
- if (event.getSource() == revertMeshItem)
2196
+ if (source == revertMeshItem)
21412197 {
21422198 RevertMeshes();
21432199 } else
2144
- if (event.getSource() == resetMeshItem)
2200
+ if (source == resetMeshItem)
21452201 {
21462202 ResetAll();
21472203 } else
2148
- if (event.getSource() == stepAllItem)
2204
+ if (source == stepAllItem)
21492205 {
21502206 StepAll();
21512207 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2208
+ if (source == clearItem) // || event.getSource() == clearButton)
21532209 {
21542210 //int indices[] = jList.getSelectedIndices();
21552211 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2213,46 @@
21572213
21582214 ClearSelection(false);
21592215 } else
2160
- if (event.getSource() == clearAllItem)
2216
+ if (source == clearAllItem)
21612217 {
21622218 ClearSelection(true);
21632219 } else
2164
- if (event.getSource() == grabItem)
2220
+ if (source == grabItem)
21652221 {
21662222 group(new cGroup(), true);
21672223 } else
2168
- if (event.getSource() == frontItem)
2224
+ if (source == hideItem)
2225
+ {
2226
+ group(new HiddenObject());
2227
+ } else
2228
+ if (source == frontItem)
21692229 {
21702230 front();
21712231 } else
2172
- if (event.getSource() == backItem)
2232
+ if (source == backItem)
21732233 {
21742234 back();
21752235 } else
2176
- if (event.getSource() == cameraItem)
2236
+ if (source == cameraItem)
21772237 {
21782238 makeSomething(new Camera());
21792239 } else
2180
- if (event.getSource() == compositeItem)
2240
+ if (source == compositeItem)
21812241 {
21822242 group(new Composite());
21832243 } else
2184
- if (event.getSource() == randomItem)
2244
+ if (source == randomItem)
21852245 {
21862246 RandomNode random = new RandomNode();
21872247 group(random);
21882248 if (random.size() > 0)
21892249 random.name = random.get(0).name + "Rnd";
21902250 } else
2191
- if (event.getSource() == physicsItem)
2251
+ if (source == physicsItem)
21922252 {
21932253 group(new PhysicsNode());
21942254 } else
2195
- if (event.getSource() == frameselectorItem)
2255
+ if (source == frameselectorItem)
21962256 {
21972257 for (int i=0; i<group.selection.size(); i++)
21982258 {
....@@ -2204,7 +2264,7 @@
22042264 ResetModel();
22052265 refreshContents();
22062266 } else
2207
- if (event.getSource() == switchGeoItem)
2267
+ if (source == switchGeoItem)
22082268 {
22092269 for (int i=0; i<group.selection.size(); i++)
22102270 {
....@@ -2216,7 +2276,7 @@
22162276 ResetModel();
22172277 refreshContents();
22182278 } else
2219
- if (event.getSource() == switchTransfoItem)
2279
+ if (source == switchTransfoItem)
22202280 {
22212281 for (int i=0; i<group.selection.size(); i++)
22222282 {
....@@ -2228,7 +2288,7 @@
22282288 ResetModel();
22292289 refreshContents();
22302290 } else
2231
- if (event.getSource() == morphItem)
2291
+ if (source == morphItem)
22322292 {
22332293 for (int i=0; i<group.selection.size(); i++)
22342294 {
....@@ -2240,7 +2300,7 @@
22402300 ResetModel();
22412301 refreshContents();
22422302 } else
2243
- if (event.getSource() == scriptNodeItem)
2303
+ if (source == scriptNodeItem)
22442304 {
22452305 boolean atleastone = false;
22462306
....@@ -2279,199 +2339,215 @@
22792339 }
22802340 }
22812341 } else
2282
- if (event.getSource() == linkerItem)
2342
+ if (source == linkerItem)
22832343 {
22842344 group(new cLinker());
22852345 } else
2286
- if (event.getSource() == textureItem)
2346
+ if (source == textureItem)
22872347 {
22882348 group(new TextureNode());
22892349 } else
2290
- if (event.getSource() == shadowXItem)
2350
+ if (source == billboardItem)
2351
+ {
2352
+ group(new BillboardNode());
2353
+ } else
2354
+ if (source == shadowXItem)
22912355 {
22922356 CastShadow(0);
22932357 } else
2294
- if (event.getSource() == shadowYItem)
2358
+ if (source == shadowYItem)
22952359 {
22962360 CastShadow(1);
22972361 } else
2298
- if (event.getSource() == shadowZItem)
2362
+ if (source == shadowZItem)
22992363 {
23002364 CastShadow(2);
23012365 } else
2302
- if (event.getSource() == ungroupItem)
2366
+ if (source == ungroupItem)
23032367 {
2304
- 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();
23052377 } else
2306
- if (event.getSource() == genUVItem)
2378
+ if (source == genUVItem)
23072379 {
23082380 GenUV();
23092381 } else
2310
- if (event.getSource() == genNormalsCADItem)
2382
+ if (source == genNormalsCADItem)
23112383 {
23122384 GenNormals(true);
23132385 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2386
+ if (source == genNormalsMESHItem)
23152387 {
23162388 GenNormals(true); // TODO
23172389 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2390
+ if (source == genNormalsORGANItem)
23192391 {
23202392 GenNormals(false);
23212393 } else
2322
- if (event.getSource() == stripifyItem)
2394
+ if (source == genNormalsMINEItem)
2395
+ {
2396
+ GenNormalsMINE();
2397
+ } else
2398
+ if (source == stripifyItem)
23232399 {
23242400 Stripify();
23252401 } else
2326
- if (event.getSource() == unstripifyItem)
2402
+ if (source == unstripifyItem)
23272403 {
23282404 Unstripify();
23292405 } else
2330
- if (event.getSource() == trimItem)
2406
+ if (source == trimItem)
23312407 {
23322408 Trim();
23332409 } else
2334
- if (event.getSource() == untrimItem)
2410
+ if (source == untrimItem)
23352411 {
23362412 Untrim();
23372413 } else
2338
- if (event.getSource() == clearColorsItem)
2414
+ if (source == clearColorsItem)
23392415 {
23402416 ClearColors();
23412417 } else
2342
- if (event.getSource() == clearMaterialsItem)
2418
+ if (source == clearMaterialsItem)
23432419 {
23442420 ClearMaterials();
23452421 } else
2346
- if (event.getSource() == liveleavesItem)
2422
+ if (source == liveleavesItem)
23472423 {
23482424 LiveLeaves(true);
23492425 } else
2350
- if (event.getSource() == unliveleavesItem)
2426
+ if (source == unliveleavesItem)
23512427 {
23522428 LiveLeaves(false);
23532429 } else
2354
- if (event.getSource() == supportleavesItem)
2430
+ if (source == supportleavesItem)
23552431 {
23562432 SupportLeaves(true);
23572433 } else
2358
- if (event.getSource() == unsupportleavesItem)
2434
+ if (source == unsupportleavesItem)
23592435 {
23602436 SupportLeaves(false);
23612437 } else
2362
- if (event.getSource() == hideleavesItem)
2438
+ if (source == hideleavesItem)
23632439 {
23642440 HideLeaves(true);
23652441 } else
2366
- if (event.getSource() == showleavesItem)
2442
+ if (source == showleavesItem)
23672443 {
23682444 HideLeaves(false);
23692445 } else
2370
- if (event.getSource() == markleavesItem)
2446
+ if (source == markleavesItem)
23712447 {
23722448 MarkLeaves(true);
23732449 } else
2374
- if (event.getSource() == unmarkleavesItem)
2450
+ if (source == unmarkleavesItem)
23752451 {
23762452 MarkLeaves(false);
23772453 } else
2378
- if (event.getSource() == flipVItem)
2454
+ if (source == flipVItem)
23792455 {
23802456 FlipV(true);
23812457 } else
2382
- if (event.getSource() == unflipVItem)
2458
+ if (source == unflipVItem)
23832459 {
23842460 FlipV(false);
23852461 } else
2386
- if (event.getSource() == lowTexturesItem)
2462
+ if (source == lowTexturesItem)
23872463 {
23882464 SetTexRes(0);
23892465 } else
2390
- if (event.getSource() == normalTexturesItem)
2466
+ if (source == normalTexturesItem)
23912467 {
23922468 SetTexRes(1);
23932469 } else
2394
- if (event.getSource() == highTexturesItem)
2470
+ if (source == highTexturesItem)
23952471 {
23962472 SetTexRes(2);
23972473 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2474
+ if (source == veryhighTexturesItem)
23992475 {
24002476 SetTexRes(3);
24012477 } else
2402
- if (event.getSource() == maxTexturesItem)
2478
+ if (source == maxTexturesItem)
24032479 {
24042480 SetTexRes(4);
24052481 } else
2406
- if (event.getSource() == panoTexturesItem)
2482
+ if (source == panoTexturesItem)
24072483 {
24082484 SetTexRes(5);
24092485 } else
2410
- if (event.getSource() == reverseNormalsItem)
2486
+ if (source == reverseNormalsItem)
24112487 {
24122488 ReverseNormals();
24132489 } else
2414
- if (event.getSource() == parseverticesItem)
2490
+ if (source == parseverticesItem)
24152491 {
24162492 ParseVertices();
24172493 } else
2418
- if (event.getSource() == textureFieldItem)
2494
+ if (source == textureFieldItem)
24192495 {
24202496 TextureVertices();
24212497 } else
2422
- if (event.getSource() == alignItem)
2498
+ if (source == alignItem)
24232499 {
24242500 Align();
24252501 } else
2426
- if (event.getSource() == mirrorItem)
2502
+ if (source == mirrorItem)
24272503 {
24282504 MirrorPoses();
24292505 } else
2430
- if (event.getSource() == reduceMorphItem)
2506
+ if (source == reduceMorphItem)
24312507 {
24322508 MeshReduction(false);
24332509 } else
2434
- if (event.getSource() == reduce34MorphItem)
2510
+ if (source == reduce34MorphItem)
24352511 {
24362512 MeshReduction(true);
24372513 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2514
+ if (source == reverseTrianglesItem)
24392515 {
24402516 ReverseTriangles();
24412517 } else
2442
- if (event.getSource() == reduceMeshItem)
2518
+ if (source == reduceMeshItem)
24432519 {
24442520 ReduceMesh(false);
24452521 } else
2446
- if (event.getSource() == reduce34MeshItem)
2522
+ if (source == reduce34MeshItem)
24472523 {
24482524 ReduceMesh(true);
24492525 } else
2450
- if (event.getSource() == increaseMeshItem)
2526
+ if (source == increaseMeshItem)
24512527 {
24522528 IncreaseMesh();
24532529 } else
2454
- if (event.getSource() == clipMeshItem)
2530
+ if (source == clipMeshItem)
24552531 {
24562532 ClipMesh();
24572533 } else
2458
- if (event.getSource() == smoothMeshItem)
2534
+ if (source == smoothMeshItem)
24592535 {
24602536 SmoothMesh();
24612537 } else
2462
- if (event.getSource() == transformgeometryItem)
2538
+ if (source == transformgeometryItem)
24632539 {
24642540 TransformGeometry();
24652541 } else
2466
- if (event.getSource() == resetTransformItem)
2542
+ if (source == resetTransformItem)
24672543 {
24682544 ResetTransform();
24692545 } else
2470
- if (event.getSource() == resetCentroidItem)
2546
+ if (source == resetCentroidItem)
24712547 {
24722548 ResetCentroid();
24732549 } else
2474
- if (event.getSource() == resetParentItem)
2550
+ if (source == resetParentItem)
24752551 {
24762552 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772553 {
....@@ -2481,7 +2557,7 @@
24812557
24822558 refreshContents();
24832559 } else
2484
- if (event.getSource() == repairParentItem)
2560
+ if (source == repairParentItem)
24852561 {
24862562 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872563 {
....@@ -2495,7 +2571,21 @@
24952571
24962572 refreshContents();
24972573 } else
2498
- 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)
24992589 {
25002590 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012591 {
....@@ -2507,7 +2597,7 @@
25072597 ResetModel();
25082598 refreshContents();
25092599 } else
2510
- if (event.getSource() == sortbynameItem)
2600
+ if (source == sortbynameItem)
25112601 {
25122602 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132603 {
....@@ -2519,7 +2609,7 @@
25192609 ResetModel();
25202610 refreshContents();
25212611 } else
2522
- if (event.getSource() == attachPigmentItem)
2612
+ if (source == attachPigmentItem)
25232613 {
25242614 String texture = GetFile("Attach pigment");
25252615 Object3D obj;
....@@ -2531,7 +2621,7 @@
25312621
25322622 refreshContents();
25332623 } else
2534
- if (event.getSource() == detachPigmentItem)
2624
+ if (source == detachPigmentItem)
25352625 {
25362626 Object3D obj;
25372627 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2632,7 @@
25422632
25432633 refreshContents();
25442634 } else
2545
- if (event.getSource() == attachBumpItem)
2635
+ if (source == attachBumpItem)
25462636 {
25472637 String texture = GetFile("Attach bump");
25482638 Object3D obj;
....@@ -2554,7 +2644,7 @@
25542644
25552645 refreshContents();
25562646 } else
2557
- if (event.getSource() == detachBumpItem)
2647
+ if (source == detachBumpItem)
25582648 {
25592649 Object3D obj;
25602650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2655,7 @@
25652655
25662656 refreshContents();
25672657 } else
2568
- if (event.getSource() == pigmentBumpItem)
2658
+ if (source == pigmentBumpItem)
25692659 {
25702660 Object3D obj;
25712661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2666,195 @@
25762666
25772667 refreshContents();
25782668 } else
2579
- if (event.getSource() == flashSelectionButton)
2669
+ if (source == flashSelectionButton)
25802670 {
25812671 CameraPane.flash = true;
25822672 refreshContents();
25832673 } else
2584
- if (event.getSource() == oneButton)
2674
+ if (source == oneButton)
25852675 {
25862676 } else
2587
- if (event.getSource() == twoButton)
2677
+ if (source == twoButton)
25882678 {
25892679 radio.layout = twoButton;
25902680 // bug
25912681 //gridPanel.setDividerLocation(1.0);
25922682 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
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();
26172712 } else
2618
- if (event.getSource() == threeButton)
2713
+ if (source == threeButton)
26192714 {
26202715 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
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();
26452748 } else
2646
- if (event.getSource() == fourButton)
2749
+ if (source == fourButton)
26472750 {
26482751 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
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();
26732783 } else
2674
- if (event.getSource() == sixButton)
2784
+ if (source == sixButton)
26752785 {
26762786 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
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();
27012819 } else
2702
- if (event.getSource() == sevenButton)
2820
+ if (source == sevenButton)
27032821 {
27042822 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
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();
27292856 } else
2730
- if (event.getSource() == rootButton)
2857
+ if (source == rootButton)
27312858 {
27322859 Object3D obj;
27332860 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2866,7 @@
27392866
27402867 refreshContents(true);
27412868 } else
2742
- if (event.getSource() == closeButton)
2869
+ if (source == closeButton)
27432870 {
27442871 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452872 cRadio ab;
....@@ -2760,11 +2887,11 @@
27602887 }
27612888 refreshContents(true);
27622889 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
2890
+ if (source == editItem || source == editButton)
27642891 {
27652892 EditSelection(false);
27662893 } else
2767
- if (event.getSource() == uneditButton)
2894
+ if (source == uneditButton)
27682895 {
27692896 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27702897 {
....@@ -2776,12 +2903,12 @@
27762903
27772904 child.editWindow = null; // ???????????
27782905 }
2779
- objEditor.ctrlPanel.revalidate();
2906
+ objEditor.ctrlPanel.validate();
27802907 //objEditor.jTree.clearSelection();
27812908 //objEditor.ResetSliders();
27822909 refreshContents(true);
27832910 } else
2784
- if (event.getSource() == clearPanelButton)
2911
+ if (source == clearPanelButton)
27852912 {
27862913 assert(copy == group);
27872914 //copy.ClearUI();
....@@ -2792,7 +2919,7 @@
27922919 listUI.clear();
27932920 refreshContents(true);
27942921 } else
2795
- if (event.getSource() == allParamsButton)
2922
+ if (source == allParamsButton)
27962923 {
27972924 assert(copy == group);
27982925
....@@ -2813,19 +2940,19 @@
28132940
28142941 refreshContents(true);
28152942 } else
2816
- if (event.getSource() == unselectButton)
2943
+ if (source == unselectButton)
28172944 {
28182945 objEditor.jTree.clearSelection();
28192946 // ?? oct 2012 GrafreeD.clipboard.clear();
28202947 objEditor.ResetSliders();
28212948 refreshContents(true);
28222949 } else
2823
- if(event.getSource() instanceof cRadio)
2950
+ if(source instanceof cRadio)
28242951 {
28252952 group.parent = keepparent;
28262953 group.attributes = 0;
28272954 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
2955
+ /*cRadio*/ radio = (cRadio)source;
28292956 Object3D obj = radio.GetObject();
28302957 System.out.println("Edit " + obj);
28312958 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +2972,7 @@
28452972 }
28462973
28472974 copy = group;
2848
- //CameraPane.theRenderer.object = group;
2975
+ //Globals.theRenderer.object = group;
28492976 if(!useclient)
28502977 {
28512978 cameraView.renderCamera = radio.camera;
....@@ -2854,7 +2981,8 @@
28542981 cameraView.cameras[cameraView.cameracount] = radio.camera;
28552982 cameraView.targetLookAt.set(radio.camera.lookAt);
28562983 cameraView.object = group;
2857
- cameraView.lighttouched = true;
2984
+ //cameraView.lighttouched = true;
2985
+ Globals.lighttouched = true;
28582986 topView.object = group;
28592987 frontView.object = group;
28602988 sideView.object = group;
....@@ -2890,7 +3018,7 @@
28903018 if (useclient)
28913019 {
28923020 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
28943022 //topView.object = client;
28953023 //frontView.object = client;
28963024 //sideView.object = client;
....@@ -2898,7 +3026,7 @@
28983026 else
28993027 {
29003028 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3029
+ Globals.lighttouched = true;
29023030 //topView.object = group;
29033031 //frontView.object = group;
29043032 //sideView.object = group;
....@@ -3179,6 +3307,13 @@
31793307 refreshContents();
31803308 }
31813309
3310
+ void GenNormalsMINE()
3311
+ {
3312
+ group.selection.GenNormalsMINE();
3313
+
3314
+ refreshContents();
3315
+ }
3316
+
31823317 void Stripify()
31833318 {
31843319 group.StripifyS();
....@@ -3399,7 +3534,7 @@
33993534 String pigment = Object3D.GetPigment(tex);
34003535 //String bump = Object3D.GetBump(tex);
34013536
3402
- 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);
34033538
34043539 double s = v.s;
34053540
....@@ -3447,12 +3582,26 @@
34473582
34483583 void Align()
34493584 {
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
+
34503599 for (int i=0; i<group.selection.size(); i++)
34513600 {
34523601 Object3D obj = group.selection.get(i);
34533602
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- 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);
34563605 }
34573606
34583607 refreshContents();
....@@ -3686,7 +3835,7 @@
36863835 group.selection.RelinkToSupport(); // july 2014
36873836 System.out.println("DONE.");
36883837 refreshContents();
3689
- 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));
36903839 }
36913840
36923841 void ReduceMesh(boolean reduction34)
....@@ -3962,25 +4111,25 @@
39624111 System.err.println("info : " + child.GetPath());
39634112 }
39644113 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
39714120
39724121 objEditor.SetText(); // jan 2014
39734122
3974
- 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))
39754124 CameraPane.flash = true;
39764125
39774126 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784127 // a camera
39794128 {
39804129 CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4130
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4131
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4132
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844133 }
39854134
39864135 refreshContents();
....@@ -4474,6 +4623,26 @@
44744623 makeSomething(csg);
44754624 }
44764625
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
+
44774646 void ungroup()
44784647 {
44794648 /*
....@@ -4833,6 +5002,7 @@
48335002 private MenuItem resetsupportItem;
48345003 private MenuItem resetreferencesItem;
48355004 private MenuItem linkverticesItem;
5005
+ private MenuItem relinkverticesItem;
48365006 private MenuItem setMasterItem;
48375007 private MenuItem resetMeshItem;
48385008 private MenuItem stepAllItem;
....@@ -4854,6 +5024,7 @@
48545024 private MenuItem genNormalsMESHItem;
48555025 private MenuItem genNormalsCADItem;
48565026 private MenuItem genNormalsORGANItem;
5027
+ private MenuItem genNormalsMINEItem;
48575028 private MenuItem stripifyItem;
48585029 private MenuItem unstripifyItem;
48595030 private MenuItem trimItem;
....@@ -4895,6 +5066,7 @@
48955066 private MenuItem resetCentroidItem;
48965067 private MenuItem transformgeometryItem;
48975068 private MenuItem resetTransformItem;
5069
+ private MenuItem hideItem;
48985070 private MenuItem grabItem;
48995071 private MenuItem backItem;
49005072 private MenuItem frontItem;
....@@ -4915,6 +5087,7 @@
49155087
49165088 private MenuItem resetParentItem;
49175089 private MenuItem repairParentItem;
5090
+ private MenuItem repairShadowItem;
49185091 private MenuItem sortbysizeItem;
49195092 private MenuItem sortbynameItem;
49205093
....@@ -4935,6 +5108,7 @@
49355108 private MenuItem coneItem;
49365109 private MenuItem torusItem;
49375110 private MenuItem superItem;
5111
+ private MenuItem kleinItem;
49385112 private MenuItem blobItem;
49395113 private MenuItem latheItem;
49405114 private MenuItem bezierItem;
....@@ -4947,6 +5121,7 @@
49475121 private MenuItem csgItem;
49485122 private MenuItem templateItem;
49495123 private MenuItem textureItem;
5124
+ private MenuItem billboardItem;
49505125 private MenuItem shadowXItem;
49515126 private MenuItem shadowYItem;
49525127 private MenuItem shadowZItem;