|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.Node | +--javax.media.j3d.Group | +--javax.media.j3d.Switch
The Switch node controls which of its children will be rendered. It defines a child selection value (a switch value) that can either select a single child, or it can select 0 or more children using a mask to indicate which children are selected for rendering.
Field Summary | |
static int |
ALLOW_SWITCH_READ
Specifies that this node allows reading its child selection and mask values and its current child. |
static int |
ALLOW_SWITCH_WRITE
Specifies that this node allows writing its child selection and mask values. |
static int |
CHILD_ALL
Specifies that all children are rendered. |
static int |
CHILD_MASK
Specifies that the childMask BitSet is used to select which children are rendered. |
static int |
CHILD_NONE
Specifies that no children are rendered. |
Fields inherited from class javax.media.j3d.Group |
ALLOW_CHILDREN_EXTEND,
ALLOW_CHILDREN_READ,
ALLOW_CHILDREN_WRITE,
ALLOW_COLLISION_BOUNDS_READ,
ALLOW_COLLISION_BOUNDS_WRITE |
Fields inherited from class javax.media.j3d.Node |
ALLOW_AUTO_COMPUTE_BOUNDS_READ,
ALLOW_AUTO_COMPUTE_BOUNDS_WRITE,
ALLOW_BOUNDS_READ,
ALLOW_BOUNDS_WRITE,
ALLOW_COLLIDABLE_READ,
ALLOW_COLLIDABLE_WRITE,
ALLOW_LOCAL_TO_VWORLD_READ,
ALLOW_PICK,
ALLOW_PICKABLE_READ,
ALLOW_PICKABLE_WRITE,
ENABLE_COLLISION_REPORTING,
ENABLE_PICK_REPORTING |
Constructor Summary | |
Switch()
Constructs a Switch node with default parameters. |
|
Switch(int whichChild)
Constructs and initializes a Switch node using the specified child selection index. |
|
Switch(int whichChild,
java.util.BitSet childMask)
Constructs and initializes a Switch node using the specified child selection index and mask. |
Method Summary | |
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
Node |
currentChild()
Retrieves the currently selected child. |
void |
duplicateNode(Node originalNode,
boolean forceDuplicate)
Copies all node information from originalNode into
the current node. |
java.util.BitSet |
getChildMask()
Retrieves the current child selection mask. |
int |
getWhichChild()
Retrieves the current child selection index that specifies which child is rendered. |
void |
setChildMask(java.util.BitSet childMask)
Sets the child selection mask. |
void |
setWhichChild(int child)
Sets the child selection index that specifies which child is rendered. |
Methods inherited from class javax.media.j3d.Group |
addChild,
getAllChildren,
getAlternateCollisionTarget,
getChild,
getCollisionBounds,
insertChild,
moveTo,
numChildren,
removeChild,
setAlternateCollisionTarget,
setChild,
setCollisionBounds |
Methods inherited from class javax.media.j3d.Node |
cloneTree,
cloneTree,
cloneTree,
getBounds,
getBoundsAutoCompute,
getCollidable,
getLocalToVworld,
getLocalToVworld,
getParent,
getPickable,
setBounds,
setBoundsAutoCompute,
setCollidable,
setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability,
duplicateSceneGraphObject,
getCapability,
getUserData,
isCompiled,
isLive,
setCapability,
setUserData |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int ALLOW_SWITCH_READ
public static final int ALLOW_SWITCH_WRITE
public static final int CHILD_NONE
public static final int CHILD_ALL
public static final int CHILD_MASK
Constructor Detail |
public Switch()
public Switch(int whichChild)
whichChild
- the initial child selection indexpublic Switch(int whichChild, java.util.BitSet childMask)
whichChild
- the initial child selection indexchildMask
- the initial child selection maskMethod Detail |
public final void setWhichChild(int child)
child
- a non-negative integer index value, indicating a
specific child, or one of the following constants: CHILD_NONE,
CHILD_ALL, or CHILD_MASK.CHILD_NONE
,
CHILD_ALL
,
CHILD_MASK
public final int getWhichChild()
CHILD_NONE
,
CHILD_ALL
,
CHILD_MASK
public final void setChildMask(java.util.BitSet childMask)
childMask
- a BitSet that specifies which children are renderedpublic final java.util.BitSet getChildMask()
public final Node currentChild()
public Node cloneNode(boolean forceDuplicate)
cloneTree
to duplicate the current node.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.Node.cloneTree()
,
Node.cloneNode(boolean)
,
Node.duplicateNode(javax.media.j3d.Node, boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
public void duplicateNode(Node originalNode, boolean forceDuplicate)
originalNode
into
the current node. This method is called from the
cloneNode
method which is, in turn, called by the
cloneTree
method.
For any NodeComponent objects
contained by the object being duplicated, each NodeComponent
object's duplicateOnCloneTree
value is used to determine
whether the NodeComponent should be duplicated in the new node
or if just a reference to the current node should be placed in the
new node. This flag can be overridden by setting the
forceDuplicate
parameter in the cloneTree
method to true
.
originalNode
- the original node to duplicate.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.Group.cloneNode(boolean)
,
Node.duplicateNode(javax.media.j3d.Node, boolean)
,
Node.cloneTree()
,
NodeComponent.setDuplicateOnCloneTree(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |