|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.scenegraph.SceneGraphObject
org.xith3d.scenegraph.Node
org.xith3d.scenegraph.GroupNode
org.xith3d.scenegraph.Group
org.xith3d.scenegraph.Switch
public class Switch
Switch group nodes allow an application to choose dynamically amoung a number of subgraphs. The Switch node contains an ordered list of children and a switch value. The switch value determines which child or children will be rendered. The index order of children is only used for selecting the appropriate child or children, it does not specify rendering order.
| Field Summary | |
|---|---|
static int |
CHILD_ALL
indicates that all children are rendered, switch node acts as an oridinary Group node. |
static int |
CHILD_MASK
indicates that the childMask BitSet is used to select the children that are rendered |
static int |
CHILD_NONE
indicates that no children are rendered |
| Fields inherited from class org.xith3d.scenegraph.GroupNode |
|---|
children, hostGroup, numChildren, totalNumChildren, totalNumShapes |
| Fields inherited from class org.xith3d.scenegraph.Node |
|---|
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, transformGroup, untransformedBounds |
| Fields inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
XITH3D_USERDATAKEY_OLDUSERDATA |
| Constructor Summary | |
|---|---|
Switch()
Constructs a new Switch object with an empty childMask and whichChild set to CHILD_NONE. |
|
Switch(int whichChild)
Constructs a new Switch object with an empty childMask and the specified value for whichChild. |
|
Switch(int whichChild,
java.util.BitSet childMask)
Constructs a new Switch object with the specified childMask and the specified value for whichChild. |
|
| Method Summary | |
|---|---|
java.util.BitSet |
getChildMask()
Gets the child mask for this object |
Node |
getCurrentChild()
Gets the curently selected child. |
static boolean |
getIgnoreMaskForTraversal()
If this is true, all children will be traversed by the traverse() method. |
int |
getWhichChild()
Gets the index of the child to render for this object. |
boolean |
isVisible(Node child)
Tests if specified child is visible according current switch settings. |
protected Switch |
newInstance()
|
Node |
removeChild(int index)
Remove the child at the specified index. |
void |
setChildMask(java.util.BitSet childMask)
Sets the child mask for this object. |
static boolean |
setIgnoreMaskForTraversal(boolean ignore)
If this is true, all children will be traversed by the traverse() method. |
void |
setWhichChild(int whichChild)
Sets the index of the child to render for this object. |
boolean |
traverse(DetailedTraversalCallback callback)
Traverses the scenegraph from this node on. |
boolean |
traverse(TraversalCallback listener)
Traverses the scenegraph from this node on. |
| Methods inherited from class org.xith3d.scenegraph.Group |
|---|
moveTo |
| Methods inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
getName, getUserData, getUserData, getUserDataMap, isLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CHILD_NONE
public static final int CHILD_ALL
public static final int CHILD_MASK
| Constructor Detail |
|---|
public Switch(int whichChild,
java.util.BitSet childMask)
public Switch(int whichChild)
public Switch()
| Method Detail |
|---|
public void setWhichChild(int whichChild)
public final int getWhichChild()
public final void setChildMask(java.util.BitSet childMask)
public final java.util.BitSet getChildMask()
public Node getCurrentChild()
public Node removeChild(int index)
removeChild in class GroupNodepublic final boolean isVisible(Node child)
public static boolean setIgnoreMaskForTraversal(boolean ignore)
ignore -
public static boolean getIgnoreMaskForTraversal()
protected Switch newInstance()
newInstance in class GroupGroupNode.sharedCopy(CopyListener)public boolean traverse(TraversalCallback listener)
traverse in class GroupNodelistener - the listener is notified of any traversed Node on the way
getIgnoreMaskForTraversal()public boolean traverse(DetailedTraversalCallback callback)
traverse in class Groupcallback - the listener is notified of any traversed Node on the way
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||