|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
public abstract class SceneGraphObject
SceneGraphObject is the common superclass for all scene graph objects. Scene graph objects are classified into two main types: nodes and node components. The Node object is the common superclass of all nodes, which includes TransformGroup, Shape3D, etc. The NodeComponent object is the common superclass of all node components, which includes Geometry, Appearance, etc.
All scene graph objects have a name, a user data object, a set of capability bits, and a set of capabilityIsFrequent bits.
Capability bits control whether a particular attribute in a node or
node component is readable or writable. For live or compiled scene
graphs, only those attributes whose capabilities are set before the
scene graph is compiled or made live may be read or written. The
default value for all read capability bits is true, meaning
that all attributes may be read by default. The default value for
all write capability bits is false, meaning that no
attributes may be written by default. Read capability bits are
defined as those capability bits of the form ALLOW_*_READ
,
plus the ALLOW_INTERSECT
capability bit. Write
capability bits are defined as those capability bits of the form
ALLOW_*_WRITE
, plus the ALLOW_CHILDREN_EXTEND
and ALLOW_DETACH
capability bits.
NOTE that the ENABLE_COLLISION_REPORTING
and
ENABLE_PICK_REPORTING
bits are not really capability bits,
although they are set with the setCapability method. The default value
for each of the ENABLE_*_REPORTING bits
is false.
For more information, see the Introduction to the Java 3D API.
Constructor Summary | |
---|---|
SceneGraphObject()
Constructs a SceneGraphObject with default parameters. |
Method Summary | |
---|---|
void |
clearCapability(int bit)
Clear the specified capability bit. |
void |
clearCapabilityIsFrequent(int bit)
Clears the isFrequent bit associated with the specified capability bit. |
boolean |
getCapability(int bit)
Retrieves the specified capability bit. |
boolean |
getCapabilityIsFrequent(int bit)
Retrieves the isFrequent bit associated with the specified capability bit. |
java.lang.String |
getName()
Returns the name of this object. |
java.lang.Object |
getUserData()
Retrieves the userData field from this scene graph object. |
boolean |
isCompiled()
Returns a flag indicating whether the node is part of a scene graph that has been compiled. |
boolean |
isLive()
Returns a flag indicating whether the node is part of a live scene graph. |
void |
setCapability(int bit)
Sets the specified capability bit. |
void |
setCapabilityIsFrequent(int bit)
Sets the isFrequent bit associated with the specified capability bit. |
void |
setName(java.lang.String name)
Sets the name of this object. |
void |
setUserData(java.lang.Object userData)
Sets the userData field associated with this scene graph object. |
java.lang.String |
toString()
Returns a String representation of this SceneGraphObject. |
void |
updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any scene graph objects referenced by that node have been duplicated via a call to cloneTree . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SceneGraphObject()
Method Detail |
---|
public final boolean getCapability(int bit)
bit
- the bit whose value is returned
public final void setCapability(int bit)
bit
- the bit to set
RestrictedAccessException
- if this object is part of live
or compiled scene graphpublic final void clearCapability(int bit)
bit
- the bit to clear
RestrictedAccessException
- if this object is part of live
or compiled scene graphpublic final boolean getCapabilityIsFrequent(int bit)
bit
- the bit whose value is returned
public final void setCapabilityIsFrequent(int bit)
Unlike setCapability, this method may be called on a live scene graph object (but not on a compiled object).
Note that only one isFrequent bit, for a single capability bit, may be set per method invocation--capability bits cannot be ORed together.
bit
- the capability bit for which to set the associated
isFrequent bit
RestrictedAccessException
- if this object is part of a
compiled scene graphpublic final void clearCapabilityIsFrequent(int bit)
Unlike clearCapability, this method may be called on a live scene graph object (but not on a compiled object).
Note that only one isFrequent bit, for a single capability bit, may be cleared per method invocation--capability bits cannot be ORed together.
bit
- the capability bit for which to clear the associated
isFrequent bit
RestrictedAccessException
- if this object is part of a
compiled scene graphpublic final boolean isCompiled()
public final boolean isLive()
public void setUserData(java.lang.Object userData)
userData
- a reference to the new userData fieldpublic java.lang.Object getUserData()
public void updateNodeReferences(NodeReferenceTable referenceTable)
cloneTree
.
This method is called by cloneTree
after all nodes in
the sub-graph have been duplicated. The cloned Leaf
node and cloned NodeComponent's method
will be called and the Leaf node/NodeComponent can then look up
any object references
by using the getNewObjectReference
method found in the
NodeReferenceTable
object. If a match is found, a
reference to the corresponding object in the newly cloned sub-graph
is returned. If no corresponding reference is found, either a
DanglingReferenceException is thrown or a reference to the original
object is returned depending on the value of the
allowDanglingReferences
parameter passed in the
cloneTree
call.
NOTE: Applications should not call this method directly. It should only be called by the cloneTree method.
referenceTable
- a NodeReferenceTableObject that contains the
getNewObjectReference
method needed to search for
new object instances.NodeReferenceTable
,
Node.cloneTree()
,
DanglingReferenceException
public void setName(java.lang.String name)
name
- the new name of this objectpublic java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |