From c60a1ad4f6aa4904e80280586b440a584b5ff061 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Mon, 22 Apr 2019 15:17:45 -0400 Subject: [PATCH] Refactoring phase 2 --- GroupEditor.java | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index aafbf22..7cc81e0 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -437,7 +437,7 @@ oe.aConstraints.gridwidth = 1; oe.aConstraints.gridx = 0; - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); liveCB.addItemListener(this); oe.aConstraints.gridx += 1; @@ -449,7 +449,7 @@ // localCB.addItemListener(this); oe.aConstraints.gridx += 1; - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); + oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints); crowdCB.addItemListener(this); oe.aConstraints.gridx += 1; @@ -649,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) { @@ -1120,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")); @@ -1780,7 +1782,7 @@ } else if (event.getSource() == computeAOItem) { - CameraPane.drawMode = CameraPane.OCCLUSION; + Globals.drawMode = CameraPane.OCCLUSION; CameraPane.theRenderer.repaint(); } else if (event.getSource() == recompileItem) @@ -2545,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();) @@ -2904,7 +2920,8 @@ cameraView.cameras[cameraView.cameracount] = radio.camera; cameraView.targetLookAt.set(radio.camera.lookAt); cameraView.object = group; - cameraView.lighttouched = true; + //cameraView.lighttouched = true; + Globals.lighttouched = true; topView.object = group; frontView.object = group; sideView.object = group; @@ -2940,7 +2957,7 @@ if (useclient) { cameraView.object = client; - cameraView.lighttouched = true; + Globals.lighttouched = true; //topView.object = client; //frontView.object = client; //sideView.object = client; @@ -2948,7 +2965,7 @@ else { cameraView.object = group; - cameraView.lighttouched = true; + Globals.lighttouched = true; //topView.object = group; //frontView.object = group; //sideView.object = group; @@ -4042,7 +4059,7 @@ objEditor.SetText(); // jan 2014 - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) CameraPane.flash = true; if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) @@ -5009,6 +5026,7 @@ private MenuItem resetParentItem; private MenuItem repairParentItem; + private MenuItem repairShadowItem; private MenuItem sortbysizeItem; private MenuItem sortbynameItem; -- Gitblit v1.6.2