Normand Briere
2019-04-23 ec9d13e42c9c8674739acefb0769a9273a1048c9
GroupEditor.java
....@@ -437,7 +437,7 @@
437437 oe.aConstraints.gridwidth = 1;
438438 oe.aConstraints.gridx = 0;
439439
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
440
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441441 liveCB.addItemListener(this);
442442
443443 oe.aConstraints.gridx += 1;
....@@ -449,7 +449,7 @@
449449 // localCB.addItemListener(this);
450450
451451 oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
452
+ oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
453453 crowdCB.addItemListener(this);
454454
455455 oe.aConstraints.gridx += 1;
....@@ -520,6 +520,9 @@
520520
521521 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522522 flashSelectionButton.addActionListener(this);
523
+
524
+ oe.toolbarPanel.add(new cButton(" ", false));
525
+
523526 oe.aConstraints.gridx += 1;
524527 oe.aConstraints.weighty = 0;
525528 oe.aConstraints.gridwidth = 1;
....@@ -646,14 +649,14 @@
646649
647650 void EditObject(Object3D obj)
648651 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
652
+ cRadio radioButton = new cRadio(obj.name);
653
+ radioButton.SetObject(obj);
654
+ radioButton.layout = sevenButton;
655
+ radioButton.SetCamera(cameraView.renderCamera, false);
656
+ radioButton.addActionListener(this);
657
+ radioPanel.add(radioButton);
658
+ buttonGroup.add(radioButton);
659
+ radioButton.doClick();
657660 }
658661 void SetupViews(ObjEditor oe)
659662 {
....@@ -715,8 +718,7 @@
715718 dropAttributes |= Object3D.TEXTURE;
716719 else
717720 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
721
+ } else if(e.getSource() == liveCB)
720722 {
721723 cameraView.ToggleLive();
722724 }
....@@ -1118,6 +1120,8 @@
11181120 resetParentItem.addActionListener(this);
11191121 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201122 repairParentItem.addActionListener(this);
1123
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1124
+ repairShadowItem.addActionListener(this);
11211125 menu.add(invariantsItem = new MenuItem("Invariants"));
11221126 invariantsItem.addActionListener(this);
11231127 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1778,8 +1782,8 @@
17781782 } else
17791783 if (event.getSource() == computeAOItem)
17801784 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1785
+ Globals.drawMode = CameraPane.OCCLUSION;
1786
+ Globals.theRenderer.repaint();
17831787 } else
17841788 if (event.getSource() == recompileItem)
17851789 {
....@@ -1794,7 +1798,7 @@
17941798 if (event.getSource() == invariantsItem)
17951799 {
17961800 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1801
+ GrafreeD.grafreeD.universe.invariants();
17981802 } else
17991803 if (event.getSource() == memoryItem)
18001804 {
....@@ -2090,7 +2094,7 @@
20902094 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912095 content = ((cGroup)content).get(0);
20922096
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2097
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942098 for (int i=0; i<group.selection.size(); i++)
20952099 {
20962100 boolean random = CameraPane.RANDOM;
....@@ -2099,7 +2103,7 @@
20992103 // group.selection.get(i).setMasterThis(content); // should be identity
21002104 CameraPane.RANDOM = random;
21012105 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2106
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032107 refreshContents();
21042108 }
21052109 } else
....@@ -2543,6 +2547,20 @@
25432547
25442548 refreshContents();
25452549 } else
2550
+ if (event.getSource() == repairShadowItem)
2551
+ {
2552
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2553
+ {
2554
+ Object3D obj = (Object3D)e.nextElement();
2555
+ obj.RepairShadow();
2556
+// for (int i=0; i<obj.size(); i++)
2557
+// {
2558
+// obj.get(i).parent = obj;
2559
+// }
2560
+ }
2561
+
2562
+ refreshContents();
2563
+ } else
25462564 if (event.getSource() == sortbysizeItem)
25472565 {
25482566 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2638,8 +2656,8 @@
26382656 // bug
26392657 //gridPanel.setDividerLocation(1.0);
26402658 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(jtp);
2642
- bigThree.remove(cameraPanel);
2659
+ bigThree.remove(scenePanel);
2660
+ bigThree.remove(centralPanel);
26432661 bigThree.remove(XYZPanel);
26442662 aWindowConstraints.gridx = 0;
26452663 aWindowConstraints.gridy = 0;
....@@ -2654,7 +2672,7 @@
26542672 // aConstraints.gridheight = 3;
26552673 aWindowConstraints.gridx = 1;
26562674 aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2675
+ bigThree.add(centralPanel, aWindowConstraints);
26582676 aWindowConstraints.weightx = 0;
26592677 aWindowConstraints.gridx = 4;
26602678 aWindowConstraints.gridwidth = 1;
....@@ -2666,8 +2684,8 @@
26662684 if (event.getSource() == threeButton)
26672685 {
26682686 radio.layout = threeButton;
2669
- bigThree.remove(jtp);
2670
- bigThree.remove(cameraPanel);
2687
+ bigThree.remove(scenePanel);
2688
+ bigThree.remove(centralPanel);
26712689 bigThree.remove(XYZPanel);
26722690 aWindowConstraints.gridx = 0;
26732691 aWindowConstraints.gridy = 0;
....@@ -2682,7 +2700,7 @@
26822700 // aConstraints.gridheight = 3;
26832701 aWindowConstraints.gridx = 1;
26842702 aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2703
+ bigThree.add(centralPanel, aWindowConstraints);
26862704 aWindowConstraints.weightx = 0;
26872705 aWindowConstraints.gridx = 4;
26882706 aWindowConstraints.gridwidth = 1;
....@@ -2694,8 +2712,8 @@
26942712 if (event.getSource() == fourButton)
26952713 {
26962714 radio.layout = fourButton;
2697
- bigThree.remove(jtp);
2698
- bigThree.remove(cameraPanel);
2715
+ bigThree.remove(scenePanel);
2716
+ bigThree.remove(centralPanel);
26992717 bigThree.remove(XYZPanel);
27002718 aWindowConstraints.gridx = 0;
27012719 aWindowConstraints.gridy = 0;
....@@ -2704,7 +2722,7 @@
27042722 aWindowConstraints.fill = GridBagConstraints.BOTH;
27052723 aWindowConstraints.weightx = 1;
27062724 aWindowConstraints.weighty = 1;
2707
- bigThree.add(jtp, aWindowConstraints);
2725
+ bigThree.add(scenePanel, aWindowConstraints);
27082726 aWindowConstraints.weightx = 1;
27092727 aWindowConstraints.gridwidth = 3;
27102728 // aConstraints.gridheight = 3;
....@@ -2722,8 +2740,8 @@
27222740 if (event.getSource() == sixButton)
27232741 {
27242742 radio.layout = sixButton;
2725
- bigThree.remove(jtp);
2726
- bigThree.remove(cameraPanel);
2743
+ bigThree.remove(scenePanel);
2744
+ bigThree.remove(centralPanel);
27272745 bigThree.remove(XYZPanel);
27282746 aWindowConstraints.gridx = 0;
27292747 aWindowConstraints.gridy = 0;
....@@ -2732,13 +2750,13 @@
27322750 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
27332751 aWindowConstraints.weightx = 0;
27342752 aWindowConstraints.weighty = 1;
2735
- bigThree.add(jtp, aWindowConstraints);
2753
+ bigThree.add(scenePanel, aWindowConstraints);
27362754 aWindowConstraints.weightx = 1;
27372755 aWindowConstraints.gridwidth = 3;
27382756 // aWindowConstraints.gridheight = 3;
27392757 aWindowConstraints.gridx = 1;
27402758 aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2759
+ bigThree.add(centralPanel, aWindowConstraints);
27422760 aWindowConstraints.weightx = 0;
27432761 aWindowConstraints.gridx = 4;
27442762 aWindowConstraints.gridwidth = 1;
....@@ -2750,8 +2768,8 @@
27502768 if (event.getSource() == sevenButton)
27512769 {
27522770 radio.layout = sevenButton;
2753
- bigThree.remove(jtp);
2754
- bigThree.remove(cameraPanel);
2771
+ bigThree.remove(scenePanel);
2772
+ bigThree.remove(centralPanel);
27552773 bigThree.remove(XYZPanel);
27562774 aWindowConstraints.gridx = 0;
27572775 aWindowConstraints.gridy = 0;
....@@ -2760,13 +2778,13 @@
27602778 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
27612779 aWindowConstraints.weightx = 0;
27622780 aWindowConstraints.weighty = 1;
2763
- bigThree.add(jtp, aWindowConstraints);
2781
+ bigThree.add(scenePanel, aWindowConstraints);
27642782 aWindowConstraints.weightx = 1;
27652783 aWindowConstraints.gridwidth = 3;
27662784 // aWindowConstraints.gridheight = 3;
27672785 aWindowConstraints.gridx = 1;
27682786 aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2787
+ bigThree.add(centralPanel, aWindowConstraints);
27702788 aWindowConstraints.weightx = 0;
27712789 aWindowConstraints.gridx = 4;
27722790 aWindowConstraints.gridwidth = 1;
....@@ -2893,7 +2911,7 @@
28932911 }
28942912
28952913 copy = group;
2896
- //CameraPane.theRenderer.object = group;
2914
+ //Globals.theRenderer.object = group;
28972915 if(!useclient)
28982916 {
28992917 cameraView.renderCamera = radio.camera;
....@@ -2902,7 +2920,8 @@
29022920 cameraView.cameras[cameraView.cameracount] = radio.camera;
29032921 cameraView.targetLookAt.set(radio.camera.lookAt);
29042922 cameraView.object = group;
2905
- cameraView.lighttouched = true;
2923
+ //cameraView.lighttouched = true;
2924
+ Globals.lighttouched = true;
29062925 topView.object = group;
29072926 frontView.object = group;
29082927 sideView.object = group;
....@@ -2938,7 +2957,7 @@
29382957 if (useclient)
29392958 {
29402959 cameraView.object = client;
2941
- cameraView.lighttouched = true;
2960
+ Globals.lighttouched = true;
29422961 //topView.object = client;
29432962 //frontView.object = client;
29442963 //sideView.object = client;
....@@ -2946,7 +2965,7 @@
29462965 else
29472966 {
29482967 cameraView.object = group;
2949
- cameraView.lighttouched = true;
2968
+ Globals.lighttouched = true;
29502969 //topView.object = group;
29512970 //frontView.object = group;
29522971 //sideView.object = group;
....@@ -3454,7 +3473,7 @@
34543473 String pigment = Object3D.GetPigment(tex);
34553474 //String bump = Object3D.GetBump(tex);
34563475
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3476
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34583477
34593478 double s = v.s;
34603479
....@@ -3755,7 +3774,7 @@
37553774 group.selection.RelinkToSupport(); // july 2014
37563775 System.out.println("DONE.");
37573776 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3777
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37593778 }
37603779
37613780 void ReduceMesh(boolean reduction34)
....@@ -4040,16 +4059,16 @@
40404059
40414060 objEditor.SetText(); // jan 2014
40424061
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4062
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40444063 CameraPane.flash = true;
40454064
40464065 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474066 // a camera
40484067 {
40494068 CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4069
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4070
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4071
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534072 }
40544073
40554074 refreshContents();
....@@ -5007,6 +5026,7 @@
50075026
50085027 private MenuItem resetParentItem;
50095028 private MenuItem repairParentItem;
5029
+ private MenuItem repairShadowItem;
50105030 private MenuItem sortbysizeItem;
50115031 private MenuItem sortbynameItem;
50125032