|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.Node
The Node class provides an abstract class for all Group and Leaf Nodes. It provides a common framework for constructing a Java 3D scene graph, specifically bounding volumes.
NOTE: Applications should not extend this class directly.
Field Summary | |
static int |
ALLOW_AUTO_COMPUTE_BOUNDS_READ
Specifies that this Node allows read access to its bounds auto compute information. |
static int |
ALLOW_AUTO_COMPUTE_BOUNDS_WRITE
Specifies that this Node allows write access to its bounds auto compute information. |
static int |
ALLOW_BOUNDS_READ
Specifies that this Node allows read access to its bounds information. |
static int |
ALLOW_BOUNDS_WRITE
Specifies that this Node allows write access to its bounds information. |
static int |
ALLOW_COLLIDABLE_READ
Specifies that this Node allows reading its collidability state. |
static int |
ALLOW_COLLIDABLE_WRITE
Specifies that this Node allows write access its collidability state. |
static int |
ALLOW_LOCAL_TO_VWORLD_READ
Specifies that this Node allows read access to its local coordinates to virtual world (Vworld) coordinates transform. |
static int |
ALLOW_PICKABLE_READ
Specifies that this Node allows reading its pickability state. |
static int |
ALLOW_PICKABLE_WRITE
Specifies that this Node allows write access its pickability state. |
static int |
ENABLE_COLLISION_REPORTING
Specifies that this Node will be reported in the collision SceneGraphPath if a collision occurs. |
static int |
ENABLE_PICK_REPORTING
Specifies that this Node will be reported in the pick SceneGraphPath if a pick occurs. |
Constructor Summary | |
Node()
Constructs a Node object with default parameters. |
Method Summary | |
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
Node |
cloneTree()
Duplicates all the nodes of the specified sub-graph. |
Node |
cloneTree(boolean forceDuplicate)
Duplicates all the nodes of the specified sub-graph. |
Node |
cloneTree(boolean forceDuplicate,
boolean allowDanglingReference)
Duplicates all the nodes of the specified sub-graph. |
Node |
cloneTree(NodeReferenceTable referenceTable)
Duplicates all the nodes of the specified sub-graph. |
Node |
cloneTree(NodeReferenceTable referenceTable,
boolean forceDuplicate)
Duplicates all the nodes of the specified sub-graph. |
Node |
cloneTree(NodeReferenceTable referenceTable,
boolean forceDuplicate,
boolean allowDanglingReferences)
Duplicates all the nodes of the specified sub-graph. |
void |
duplicateNode(Node originalNode,
boolean forceDuplicate)
Copies all node information from originalNode into
the current node. |
Bounds |
getBounds()
Returns the bounding object of a node. |
boolean |
getBoundsAutoCompute()
Gets the value indicating if the automatic calcuation of geometric bounds of a node is on/off. |
boolean |
getCollidable()
Returns the collidable value; this value determines whether this node and it's children, if a group node, can be considered for collision purposes; if it is set to false, then neither this node nor any children nodes will be traversed for collision purposes; the default value is true. |
void |
getLocalToVworld(SceneGraphPath path,
Transform3D t)
Retrieves the local coordinates to virtual world coordinates transform for the particular path in the scene graph ending with this node. |
void |
getLocalToVworld(Transform3D t)
Retrieves the local coordinates to virtual world coordinates transform for this node in the scene graph. |
Node |
getParent()
Retrieves the parent of this Node. |
boolean |
getPickable()
Returns true if this Node is pickable,
false if it is not pickable. |
void |
setBounds(Bounds bounds)
Sets the geometric bounds of a node. |
void |
setBoundsAutoCompute(boolean autoCompute)
Turns the automatic calcuation of geometric bounds of a node on/off. |
void |
setCollidable(boolean collidable)
Sets the collidable value; determines whether this node and any of its children, if a group node, can be considered for collision purposes. |
void |
setPickable(boolean pickable)
When set to true this Node can be Picked. |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ENABLE_PICK_REPORTING
SceneGraphPath
,
Constant Field Valuespublic static final int ENABLE_COLLISION_REPORTING
SceneGraphPath
,
Constant Field Valuespublic static final int ALLOW_BOUNDS_READ
public static final int ALLOW_BOUNDS_WRITE
public static final int ALLOW_PICKABLE_READ
public static final int ALLOW_PICKABLE_WRITE
public static final int ALLOW_COLLIDABLE_READ
public static final int ALLOW_COLLIDABLE_WRITE
public static final int ALLOW_AUTO_COMPUTE_BOUNDS_READ
public static final int ALLOW_AUTO_COMPUTE_BOUNDS_WRITE
public static final int ALLOW_LOCAL_TO_VWORLD_READ
Constructor Detail |
public Node()
Method Detail |
public Node getParent()
RestrictedAccessException
- if this object is part of live
or compiled scene graphpublic void setBounds(Bounds bounds)
bounds
- the bounding object for a node
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic Bounds getBounds()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
SceneGraphCycleException
- if there is a cycle in the
scene graphpublic boolean getCollidable()
public void setCollidable(boolean collidable)
collidable
- the new collidable value for this nodepublic void setBoundsAutoCompute(boolean autoCompute)
autoCompute
- indicates if the node's bounding object is
automatically computed.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic boolean getBoundsAutoCompute()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void getLocalToVworld(Transform3D t)
this
node. It is only valid
for nodes that are part of a live scene graph.
t
- the object that will receive the local coordinates to
Vworld coordinates transform.
RestrictedAccessException
- if the node is not
part of a live scene graph
CapabilityNotSetException
- if appropriate capability is
not set and this node is part of live scene graph
IllegalSharingException
- if the node is a descendant
of a SharedGroup node.public void getLocalToVworld(SceneGraphPath path, Transform3D t)
this
node via the specified Link nodes. It is
only valid for nodes that are part of a live scene graph.
path
- the specific path from the node to the Localet
- the object that will receive the local coordinates to
Vworld coordinates transform.
RestrictedAccessException
- if the node is not
part of a live scene graph
CapabilityNotSetException
- if appropriate capability is
not set and this node is part of live scene graph
java.lang.IllegalArgumentException
- if the specified path does
not contain a valid Locale, or if the last node in the path is
different from this nodepublic Node cloneTree()
cloneNode
and then cloneTree
is called for each child node. For Leaf Nodes, component
data can either be duplicated or be made a reference to the original
data. Leaf Node cloneTree behavior is determined by the
duplicateOnCloneTree
flag found in every Leaf Node's
component data class and by the forceDuplicate
paramter.
DanglingReferenceException
- When a dangling reference is
discovered during the cloneTree operation.
RestrictedAccessException
- if this object is part of live
or compiled scene graph
SceneGraphCycleException
- if there is a cycle in the
scene graphNodeComponent.setDuplicateOnCloneTree(boolean)
public Node cloneTree(boolean forceDuplicate)
cloneNode
and then cloneTree
is called for each child node.
For Leaf Nodes, component
data can either be duplicated or be made a reference to the original
data. Leaf Node cloneTree behavior is determined by the
duplicateOnCloneTree
flag found in every Leaf Node's
component data class and by the forceDuplicate
paramter.
forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
determines whether data is
duplicated or copied.
DanglingReferenceException
- When a dangling reference is
discovered during the cloneTree operation.
RestrictedAccessException
- if this object is part of live
or compiled scene graph
SceneGraphCycleException
- if there is a cycle in the
scene graphNodeComponent.setDuplicateOnCloneTree(boolean)
public Node cloneTree(boolean forceDuplicate, boolean allowDanglingReference)
cloneNode
and
then cloneTree
is called for each child node. For
Leaf Nodes, component
data can either be duplicated or be made a reference to the original
data. Leaf Node cloneTree behavior is determined by the
duplicateOnCloneTree
flag found in every Leaf Node's
component data class and by the forceDuplicate
paramter.
forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When false
, the value of each node's
duplicateOnCloneTree
determines whether data is
duplicated or copied.
DanglingReferenceException
- When a dangling reference is
discovered during the cloneTree operation and the
allowDanglingReference
parameter is false.
RestrictedAccessException
- if this object is part of live
or compiled scene graph
SceneGraphCycleException
- if there is a cycle in the
scene graphNodeComponent.setDuplicateOnCloneTree(boolean)
public Node cloneTree(NodeReferenceTable referenceTable)
cloneNode
and then cloneTree
is called for each child node. For Leaf Nodes, component
data can either be duplicated or be made a reference to the original
data. Leaf Node cloneTree behavior is determined by the
duplicateOnCloneTree
flag found in every Leaf Node's
component data class and by the forceDuplicate
paramter.
referenceTable
- table that stores the mapping between
original and cloned nodes. All previous values in the
referenceTable will be cleared before the clone is made.
DanglingReferenceException
- When a dangling reference is
discovered during the cloneTree operation.
RestrictedAccessException
- if this object is part of live
or compiled scene graph
SceneGraphCycleException
- if there is a cycle in the
scene graphNodeComponent.setDuplicateOnCloneTree(boolean)
public Node cloneTree(NodeReferenceTable referenceTable, boolean forceDuplicate)
cloneNode
and then cloneTree
is called for each child node.
For Leaf Nodes, component
data can either be duplicated or be made a reference to the original
data. Leaf Node cloneTree behavior is determined by the
duplicateOnCloneTree
flag found in every Leaf Node's
component data class and by the forceDuplicate
paramter.
referenceTable
- table that stores the mapping between
original and cloned nodes. All previous values in the
referenceTable will be cleared before the clone is made.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
determines whether data is
duplicated or copied.
DanglingReferenceException
- When a dangling reference is
discovered during the cloneTree operation.
RestrictedAccessException
- if this object is part of live
or compiled scene graph
SceneGraphCycleException
- if there is a cycle in the
scene graphNodeComponent.setDuplicateOnCloneTree(boolean)
public Node cloneTree(NodeReferenceTable referenceTable, boolean forceDuplicate, boolean allowDanglingReferences)
cloneNode
and then cloneTree
is called for each child node.
For Leaf Nodes, component
data can either be duplicated or be made a reference to the original
data. Leaf Node cloneTree behavior is determined by the
duplicateOnCloneTree
flag found in every Leaf Node's
component data class and by the forceDuplicate
paramter.
referenceTable
- table that stores the mapping between
original and cloned nodes. All previous values in the
referenceTable will be cleared before the clone is made.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
determines whether data is
duplicated or copied.allowDanglingReferences
- when set to true
allows
the cloneTree
method to complete even whan a dangling reference is discovered. When
this parameter is false
a
DanglingReferenceException
is generated as
soon as cloneTree detects this situation.
DanglingReferenceException
- When a dangling reference is
discovered during the cloneTree operation.
RestrictedAccessException
- if this object is part of live
or compiled scene graph
SceneGraphCycleException
- if there is a cycle in the
scene graphNodeComponent.setDuplicateOnCloneTree(boolean)
public Node cloneNode(boolean forceDuplicate)
cloneTree
to duplicate the current node.
cloneNode
should be overridden by any user subclassed
objects. All subclasses must have their cloneNode
method consist of the following lines:
NOTE: Applications should not call this method directly. It should only be called by the cloneTree method.public Node cloneNode(boolean forceDuplicate) { UserSubClass usc = new UserSubClass(); usc.duplicateNode(this, forceDuplicate); return usc; }
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.
RestrictedAccessException
- if this object is part of live
or compiled scene graphcloneTree()
,
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
.
NOTE: Applications should not call this method directly.
It should only be called by the cloneNode method.
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)
,
duplicateNode(javax.media.j3d.Node, boolean)
,
cloneTree()
,
NodeComponent.setDuplicateOnCloneTree(boolean)
public void setPickable(boolean pickable)
true
this Node
can be Picked.
Setting to false indicates that this node and it's children
are ALL unpickable.
pickable
- Indicates if this node should be pickable or notpublic boolean getPickable()
Node
is pickable,
false if it is not pickable.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |