From 43930a1a60e4efbea6f44ea6b3b3871512972271 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Wed, 27 Jun 2012 00:26:24 -0700 Subject: j3dcore: annotate SetLiveState orderPaths and switchStates lists Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/BackgroundRetained.java | 9 +++--- .../share/javax/media/j3d/GroupRetained.java | 8 ++--- src/classes/share/javax/media/j3d/Locale.java | 16 +++++----- .../javax/media/j3d/OrderedGroupRetained.java | 35 +++++++++------------- .../share/javax/media/j3d/SetLiveState.java | 4 +-- .../share/javax/media/j3d/Shape3DRetained.java | 4 +-- .../share/javax/media/j3d/SharedGroupRetained.java | 16 +++++----- 7 files changed, 42 insertions(+), 50 deletions(-) diff --git a/src/classes/share/javax/media/j3d/BackgroundRetained.java b/src/classes/share/javax/media/j3d/BackgroundRetained.java index adc471f..947f63a 100644 --- a/src/classes/share/javax/media/j3d/BackgroundRetained.java +++ b/src/classes/share/javax/media/j3d/BackgroundRetained.java @@ -490,12 +490,11 @@ GeometryAtom[] bgGeometryAtoms = null; setLiveState.branchGroupPaths = new ArrayList(); setLiveState.branchGroupPaths.add(new BranchGroupRetained[0]); - setLiveState.orderedPaths = new ArrayList(1); - setLiveState.orderedPaths.add(new OrderedPath()); - - setLiveState.switchStates = new ArrayList(1); - setLiveState.switchStates.add(new SwitchState(false)); + setLiveState.orderedPaths = new ArrayList(1); + setLiveState.orderedPaths.add(new OrderedPath()); + setLiveState.switchStates = new ArrayList(1); + setLiveState.switchStates.add(new SwitchState(false)); branch.setLive(setLiveState); diff --git a/src/classes/share/javax/media/j3d/GroupRetained.java b/src/classes/share/javax/media/j3d/GroupRetained.java index b9d1a13..73ef7c4 100644 --- a/src/classes/share/javax/media/j3d/GroupRetained.java +++ b/src/classes/share/javax/media/j3d/GroupRetained.java @@ -78,8 +78,8 @@ ArrayList> altAppearances = null; // the immediate childIndex of a parentSwitchLink int parentSwitchLinkChildIndex = -1; - // per shared path ordered path data - ArrayList orderedPaths = null; +// per shared path ordered path data +ArrayList orderedPaths = null; /** * If collisionBound is set, this is equal to the @@ -1518,7 +1518,7 @@ synchronized void setAltAppScope() { // branchGroupArray since they will get replace (not append) // by creating a new reference in child's group. s.branchGroupPaths = new ArrayList(branchGroupPaths); - s.orderedPaths = orderedPaths; + s.orderedPaths = orderedPaths; // Make the scoped fogs and lights of the child to include, the // the scoped fog of this group @@ -2713,7 +2713,7 @@ synchronized void setAltAppScope() { s.ogList.add(this); s.ogChildIdList.add(new Integer(i)); } - s.orderedPaths = (ArrayList)og.childrenOrderedPaths.get(i); + s.orderedPaths = og.childrenOrderedPaths.get(i); } if (child != null) { diff --git a/src/classes/share/javax/media/j3d/Locale.java b/src/classes/share/javax/media/j3d/Locale.java index 0b6f4d7..9bae012 100644 --- a/src/classes/share/javax/media/j3d/Locale.java +++ b/src/classes/share/javax/media/j3d/Locale.java @@ -215,11 +215,11 @@ public class Locale extends Object { s.branchGroupPaths = new ArrayList(); s.branchGroupPaths.add(new BranchGroupRetained[0]); - s.orderedPaths = new ArrayList(1); - s.orderedPaths.add(new OrderedPath()); + s.orderedPaths = new ArrayList(1); + s.orderedPaths.add(new OrderedPath()); - s.switchStates = new ArrayList(1); - s.switchStates.add(new SwitchState(false)); + s.switchStates = new ArrayList(1); + s.switchStates.add(new SwitchState(false)); bgr.setLive(s); @@ -501,11 +501,11 @@ public class Locale extends Object { universe.setLiveState.branchGroupPaths = new ArrayList(); universe.setLiveState.branchGroupPaths.add(new BranchGroupRetained[0]); - universe.setLiveState.orderedPaths = new ArrayList(1); - universe.setLiveState.orderedPaths.add(new OrderedPath()); + universe.setLiveState.orderedPaths = new ArrayList(1); + universe.setLiveState.orderedPaths.add(new OrderedPath()); - universe.setLiveState.switchStates = new ArrayList(1); - universe.setLiveState.switchStates.add(new SwitchState(false)); + universe.setLiveState.switchStates = new ArrayList(1); + universe.setLiveState.switchStates.add(new SwitchState(false)); nbgr.setLive(universe.setLiveState); diff --git a/src/classes/share/javax/media/j3d/OrderedGroupRetained.java b/src/classes/share/javax/media/j3d/OrderedGroupRetained.java index 6ad32a4..2b2535d 100644 --- a/src/classes/share/javax/media/j3d/OrderedGroupRetained.java +++ b/src/classes/share/javax/media/j3d/OrderedGroupRetained.java @@ -52,9 +52,8 @@ private OrderedBin[] orderedBin = new OrderedBin[0]; // orderedCollection in each orderedBin (per view) int childCount = 0; - // per children ordered path data - ArrayList childrenOrderedPaths = new ArrayList(1); - +// per children ordered path data +ArrayList> childrenOrderedPaths = new ArrayList>(1); // child index order - set by the user. int[] userChildIndexOrder = null; @@ -309,10 +308,7 @@ OrderedBin getOrderedBin(int index) { } void setAuxData(SetLiveState s, int index, int hkIndex) { - OrderedPath setLiveStateOrderedPath, newOrderedPath; - ArrayList childOrderedPaths; - - setLiveStateOrderedPath = (OrderedPath) s.orderedPaths.get(hkIndex); + OrderedPath setLiveStateOrderedPath = s.orderedPaths.get(hkIndex); for (int i=0; i childOrderedPaths; // Must be in reverse, to preserve right indexing. for (i = s.keys.length-1; i >= 0; i--) { @@ -394,7 +389,7 @@ OrderedBin getOrderedBin(int index) { localToVworldKeys.length); if(index >= 0) { for (int j=0; j(1)); } void appendChildrenData() { - childrenOrderedPaths.add(new ArrayList(1)); + childrenOrderedPaths.add(new ArrayList(1)); } void doRemoveChild(int index, J3dMessage messages[], int messageIndex) { @@ -476,19 +471,18 @@ OrderedBin getOrderedBin(int index) { s.ogChildIdList.add(new Integer(childIndex)); s.ogOrderedIdList.add(child.orderedId); } - s.orderedPaths = (ArrayList)childrenOrderedPaths.get(childIndex); + s.orderedPaths = childrenOrderedPaths.get(childIndex); if(child!=null) child.setLive(s); } void childCheckSetLive(NodeRetained child, int childIndex, SetLiveState s, NodeRetained linkNode) { - OrderedPath childOrderedPath; - ArrayList childOrderedPaths; + ArrayList childOrderedPaths; if (linkNode != null) { int ci = children.indexOf(linkNode); - childOrderedPaths = (ArrayList)childrenOrderedPaths.get(ci); + childOrderedPaths = childrenOrderedPaths.get(ci); } else { child.orderedId = getOrderedChildId(); // set this regardless of refCount @@ -505,11 +499,10 @@ OrderedBin getOrderedBin(int index) { s.ogCIOTableList.add(newArr); } - childOrderedPaths = (ArrayList)childrenOrderedPaths.get(childIndex); + childOrderedPaths = childrenOrderedPaths.get(childIndex); for(int i=0; i< orderedPaths.size();i++){ - childOrderedPath = - ((OrderedPath)orderedPaths.get(i)).clonePath(); + OrderedPath childOrderedPath = orderedPaths.get(i).clonePath(); childOrderedPath.addElementToPath(this, child.orderedId); childOrderedPaths.add(childOrderedPath); } diff --git a/src/classes/share/javax/media/j3d/SetLiveState.java b/src/classes/share/javax/media/j3d/SetLiveState.java index b61dacc..398105f 100644 --- a/src/classes/share/javax/media/j3d/SetLiveState.java +++ b/src/classes/share/javax/media/j3d/SetLiveState.java @@ -107,7 +107,7 @@ ArrayList> altAppearances = null; // The current bitmask of types in transformTragets //int transformTargetThreads = 0; - ArrayList orderedPaths = null; +ArrayList orderedPaths = null; ArrayList ogList = new ArrayList(5); ArrayList ogChildIdList = new ArrayList(5); @@ -190,7 +190,7 @@ ArrayList parentBranchGroupPaths = null; // currently used by Switch, can be extended for other node types int[] hashkeyIndex = null; - ArrayList switchStates = null; +ArrayList switchStates = null; SetLiveState(VirtualUniverse u) { universe = u; diff --git a/src/classes/share/javax/media/j3d/Shape3DRetained.java b/src/classes/share/javax/media/j3d/Shape3DRetained.java index d4facf8..5c06447 100644 --- a/src/classes/share/javax/media/j3d/Shape3DRetained.java +++ b/src/classes/share/javax/media/j3d/Shape3DRetained.java @@ -787,7 +787,7 @@ class Shape3DRetained extends LeafRetained { ms.localBounds = localBounds; // End new 1.3.2 - OrderedPath op = (OrderedPath)s.orderedPaths.get(index); + OrderedPath op = s.orderedPaths.get(index); if (op.pathElements.size() == 0) { ms.orderedPath = null; } else { @@ -2175,7 +2175,7 @@ class Shape3DRetained extends LeafRetained { parent = morph.parent; locale = morph.locale; - OrderedPath op = (OrderedPath)s.orderedPaths.get(index); + OrderedPath op = s.orderedPaths.get(index); if (op.pathElements.size() == 0) { orderedPath = null; } else { diff --git a/src/classes/share/javax/media/j3d/SharedGroupRetained.java b/src/classes/share/javax/media/j3d/SharedGroupRetained.java index 2e8aacf..0c42918 100644 --- a/src/classes/share/javax/media/j3d/SharedGroupRetained.java +++ b/src/classes/share/javax/media/j3d/SharedGroupRetained.java @@ -76,7 +76,7 @@ Vector parents = new Vector(1); // combined localTargetThreads and decendants' localTargetThreads int targetThreads = 0; - ArrayList switchStates = null; + ArrayList switchStates = null; SharedGroupRetained() { this.nodeType = NodeRetained.SHAREDGROUP; @@ -92,13 +92,13 @@ Vector parents = new Vector(1); branchGroupPaths.add(hkIndex, s.branchGroupPaths.get(index)); if (orderedPaths == null) { - orderedPaths = new ArrayList(1); + orderedPaths = new ArrayList(1); } orderedPaths.add(hkIndex, s.orderedPaths.get(index)); - if (switchStates == null) { - switchStates = new ArrayList(1); - } + if (switchStates == null) { + switchStates = new ArrayList(1); + } switchStates.add(hkIndex, s.switchStates.get(index)); if (viewLists == null) { @@ -470,7 +470,7 @@ Vector parents = new Vector(1); Transform3D savedLocalToVworld[][] = s.localToVworld; int savedLocalToVworldIndex[][] = s.localToVworldIndex; HashKey savedLocalToVworldKeys[] = s.localToVworldKeys; - ArrayList savedOrderedPaths = s.orderedPaths; + ArrayList savedOrderedPaths = s.orderedPaths; ArrayList savedViewLists = s.viewLists; ArrayList> savedLights = s.lights; @@ -829,7 +829,7 @@ Vector parents = new Vector(1); if (type == TargetsInterface.SWITCH_TARGETS) { // child info is not used, SG does not have per child states if (index < switchStates.size()) { - SwitchState switchState = (SwitchState)switchStates.get(index); + SwitchState switchState = switchStates.get(index); return switchState.cachedTargets; } else { return null; @@ -851,7 +851,7 @@ Vector parents = new Vector(1); System.err.println(" resetCachedTargets: " + this); } for (int i=0; i