From 6ed65dcb597fb2153cef75bf1845978f1115658c Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Fri, 14 Dec 2018 22:53:55 -0500 Subject: [PATCH] Repair shadow, normal push + attractor mesh. --- GroupEditor.java | 75 +++++++++++++++++++++++-------------- 1 files changed, 47 insertions(+), 28 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index d7a1c3e..da3ecc4 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -520,6 +520,9 @@ oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); flashSelectionButton.addActionListener(this); + + oe.toolbarPanel.add(new cButton(" ", false)); + oe.aConstraints.gridx += 1; oe.aConstraints.weighty = 0; oe.aConstraints.gridwidth = 1; @@ -646,14 +649,14 @@ void EditObject(Object3D obj) { - cRadio dummyButton = new cRadio(obj.name); - dummyButton.SetObject(obj); - dummyButton.layout = sevenButton; - dummyButton.SetCamera(cameraView.renderCamera, false); - dummyButton.addActionListener(this); - radioPanel.add(dummyButton); - buttonGroup.add(dummyButton); - dummyButton.doClick(); + cRadio radioButton = new cRadio(obj.name); + radioButton.SetObject(obj); + radioButton.layout = sevenButton; + radioButton.SetCamera(cameraView.renderCamera, false); + radioButton.addActionListener(this); + radioPanel.add(radioButton); + buttonGroup.add(radioButton); + radioButton.doClick(); } void SetupViews(ObjEditor oe) { @@ -715,8 +718,7 @@ dropAttributes |= Object3D.TEXTURE; else dropAttributes &= ~Object3D.TEXTURE; - } - else if(e.getSource() == liveCB) + } else if(e.getSource() == liveCB) { cameraView.ToggleLive(); } @@ -1118,6 +1120,8 @@ resetParentItem.addActionListener(this); repairParentItem = menu.add(new MenuItem("Repair Parent")); repairParentItem.addActionListener(this); + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); + repairShadowItem.addActionListener(this); menu.add(invariantsItem = new MenuItem("Invariants")); invariantsItem.addActionListener(this); menu.add(recompileItem = new MenuItem("Recompile")); @@ -1794,7 +1798,7 @@ if (event.getSource() == invariantsItem) { System.out.println("Invariants:"); - GrafreeD.theApplet3D.universe.invariants(); + GrafreeD.grafreeD.universe.invariants(); } else if (event.getSource() == memoryItem) { @@ -2543,6 +2547,20 @@ refreshContents(); } else + if (event.getSource() == repairShadowItem) + { + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) + { + Object3D obj = (Object3D)e.nextElement(); + obj.RepairShadow(); +// for (int i=0; i<obj.size(); i++) +// { +// obj.get(i).parent = obj; +// } + } + + refreshContents(); + } else if (event.getSource() == sortbysizeItem) { for (Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -2638,8 +2656,8 @@ // bug //gridPanel.setDividerLocation(1.0); //bigPanel.setDividerLocation(0.0); - bigThree.remove(jtp); - bigThree.remove(cameraPanel); + bigThree.remove(scenePanel); + bigThree.remove(centralPanel); bigThree.remove(XYZPanel); aWindowConstraints.gridx = 0; aWindowConstraints.gridy = 0; @@ -2654,7 +2672,7 @@ // aConstraints.gridheight = 3; aWindowConstraints.gridx = 1; aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(cameraPanel, aWindowConstraints); + bigThree.add(centralPanel, aWindowConstraints); aWindowConstraints.weightx = 0; aWindowConstraints.gridx = 4; aWindowConstraints.gridwidth = 1; @@ -2666,8 +2684,8 @@ if (event.getSource() == threeButton) { radio.layout = threeButton; - bigThree.remove(jtp); - bigThree.remove(cameraPanel); + bigThree.remove(scenePanel); + bigThree.remove(centralPanel); bigThree.remove(XYZPanel); aWindowConstraints.gridx = 0; aWindowConstraints.gridy = 0; @@ -2682,7 +2700,7 @@ // aConstraints.gridheight = 3; aWindowConstraints.gridx = 1; aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(cameraPanel, aWindowConstraints); + bigThree.add(centralPanel, aWindowConstraints); aWindowConstraints.weightx = 0; aWindowConstraints.gridx = 4; aWindowConstraints.gridwidth = 1; @@ -2694,8 +2712,8 @@ if (event.getSource() == fourButton) { radio.layout = fourButton; - bigThree.remove(jtp); - bigThree.remove(cameraPanel); + bigThree.remove(scenePanel); + bigThree.remove(centralPanel); bigThree.remove(XYZPanel); aWindowConstraints.gridx = 0; aWindowConstraints.gridy = 0; @@ -2704,7 +2722,7 @@ aWindowConstraints.fill = GridBagConstraints.BOTH; aWindowConstraints.weightx = 1; aWindowConstraints.weighty = 1; - bigThree.add(jtp, aWindowConstraints); + bigThree.add(scenePanel, aWindowConstraints); aWindowConstraints.weightx = 1; aWindowConstraints.gridwidth = 3; // aConstraints.gridheight = 3; @@ -2722,8 +2740,8 @@ if (event.getSource() == sixButton) { radio.layout = sixButton; - bigThree.remove(jtp); - bigThree.remove(cameraPanel); + bigThree.remove(scenePanel); + bigThree.remove(centralPanel); bigThree.remove(XYZPanel); aWindowConstraints.gridx = 0; aWindowConstraints.gridy = 0; @@ -2732,13 +2750,13 @@ aWindowConstraints.fill = GridBagConstraints.VERTICAL; aWindowConstraints.weightx = 0; aWindowConstraints.weighty = 1; - bigThree.add(jtp, aWindowConstraints); + bigThree.add(scenePanel, aWindowConstraints); aWindowConstraints.weightx = 1; aWindowConstraints.gridwidth = 3; // aWindowConstraints.gridheight = 3; aWindowConstraints.gridx = 1; aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(cameraPanel, aWindowConstraints); + bigThree.add(centralPanel, aWindowConstraints); aWindowConstraints.weightx = 0; aWindowConstraints.gridx = 4; aWindowConstraints.gridwidth = 1; @@ -2750,8 +2768,8 @@ if (event.getSource() == sevenButton) { radio.layout = sevenButton; - bigThree.remove(jtp); - bigThree.remove(cameraPanel); + bigThree.remove(scenePanel); + bigThree.remove(centralPanel); bigThree.remove(XYZPanel); aWindowConstraints.gridx = 0; aWindowConstraints.gridy = 0; @@ -2760,13 +2778,13 @@ aWindowConstraints.fill = GridBagConstraints.VERTICAL; aWindowConstraints.weightx = 0; aWindowConstraints.weighty = 1; - bigThree.add(jtp, aWindowConstraints); + bigThree.add(scenePanel, aWindowConstraints); aWindowConstraints.weightx = 1; aWindowConstraints.gridwidth = 3; // aWindowConstraints.gridheight = 3; aWindowConstraints.gridx = 1; aWindowConstraints.fill = GridBagConstraints.BOTH; - bigThree.add(cameraPanel, aWindowConstraints); + bigThree.add(centralPanel, aWindowConstraints); aWindowConstraints.weightx = 0; aWindowConstraints.gridx = 4; aWindowConstraints.gridwidth = 1; @@ -5007,6 +5025,7 @@ private MenuItem resetParentItem; private MenuItem repairParentItem; + private MenuItem repairShadowItem; private MenuItem sortbysizeItem; private MenuItem sortbynameItem; -- Gitblit v1.6.2