| java.lang.Object javax.media.j3d.SceneGraphObject
All known Subclasses: javax.media.j3d.NodeComponent, javax.media.j3d.Node,
SceneGraphObject | abstract public class SceneGraphObject extends Object (Code) | | 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 | |
public | SceneGraphObject() Constructs a SceneGraphObject with default parameters. |
Method Summary | |
final boolean | capabilityBitsEmpty() | final void | checkForLiveOrCompiled() | final public void | clearCapability(int bit) Clear the specified capability bit. | final public void | clearCapabilityIsFrequent(int bit) Clears the isFrequent bit associated with the specified
capability bit. | final void | clearLive() Clears an internal flag which indicates that this scene graph object
is no longer part of a live scene graph. | void | createRetained() Creates the retained mode object that this scene graph object
will point to. | protected void | duplicateSceneGraphObject(SceneGraphObject originalNode) Copies all SceneGraphObject information from
originalNode into
the current node. | final public boolean | getCapability(int bit) Retrieves the specified capability bit. | final public boolean | getCapabilityIsFrequent(int bit) Retrieves the isFrequent bit associated with the specified capability
bit. | public String | getName() Returns the name of this object. | String | getNamePrefix() | NodeComponent | getNodeComponent(NodeComponent originalNodeComponent, boolean forceDuplicate, Hashtable hashtable) If forceDuplicate is true or
duplicateOnCloneTree flag is true. | public Object | getUserData() Retrieves the userData field from this scene graph object. | final public boolean | isCompiled() Returns a flag indicating whether the node is part of a scene graph
that has been compiled. | final public boolean | isLive() Returns a flag indicating whether the node is part of a live
scene graph. | final boolean | isLiveOrCompiled() Returns a flag indicating whether the node is part of a live
scene graph or a compiled scene graph. | final public void | setCapability(int bit) Sets the specified capability bit. | final public void | setCapabilityIsFrequent(int bit) Sets the isFrequent bit associated with the specified
capability bit. | final void | setCompiled() Sets an internal flag which indicates that this scene graph object
has been compiled. | void | setDefaultReadCapabilities(int[] bits) | final void | setLive() Sets an internal flag which indicates that this scene graph object
is part of a live scene graph. | public void | setName(String name) Sets the name of this object. | public void | setUserData(Object userData) Sets the userData field associated with this scene graph object. | public String | toString() Returns a String representation of this SceneGraphObject. | public 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 .
This method is called by cloneTree after all nodes in
the sub-graph have been duplicated. |
SceneGraphObject | public SceneGraphObject()(Code) | | Constructs a SceneGraphObject with default parameters. The default
values are as follows:
all read capability bits : set (true)
all write capability bits : clear (false)
all capabilityIsFrequent bits : set (true)
isLive : false
isCompiled : false
user data : null
name : null
|
capabilityBitsEmpty | final boolean capabilityBitsEmpty()(Code) | | |
checkForLiveOrCompiled | final void checkForLiveOrCompiled()(Code) | | |
clearCapability | final public void clearCapability(int bit)(Code) | | Clear the specified capability bit. Note that only one capability bit
may be cleared per method invocation--capability bits cannot be ORed
together.
Parameters: bit - the bit to clear exception: RestrictedAccessException - if this object is part of liveor compiled scene graph |
clearCapabilityIsFrequent | final public void clearCapabilityIsFrequent(int bit)(Code) | | Clears the isFrequent bit associated with the specified
capability bit. Clearing the isFrequent bit indicates that the
application will infrequently access or modify those attributes
permitted by the associated capability bit. This can be used
by Java 3D as a hint to enable certain optimizations that it
might otherwise avoid, for example, optimizations that could
cause those accesses or modifications to be expensive.
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.
Parameters: bit - the capability bit for which to clear the associatedisFrequent bit exception: RestrictedAccessException - if this object is part of acompiled scene graph since: Java 3D 1.3 |
clearLive | final void clearLive()(Code) | | Clears an internal flag which indicates that this scene graph object
is no longer part of a live scene graph.
|
createRetained | void createRetained()(Code) | | Creates the retained mode object that this scene graph object
will point to. This should be overridden by those classes
that have a specific retained mode object.
|
duplicateSceneGraphObject | protected void duplicateSceneGraphObject(SceneGraphObject originalNode)(Code) | | Copies all SceneGraphObject information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
NOTE: Applications should not call this method directly.
It should only be called by the cloneNode method.
Parameters: originalNode - the original node to duplicate. See Also: Group.cloneNode See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getCapability | final public boolean getCapability(int bit)(Code) | | Retrieves the specified capability bit. Note that only one capability
bit may be retrieved per method invocation--capability bits cannot
be ORed together.
Parameters: bit - the bit whose value is returned true if the bit is set, false if the bit is clear |
getCapabilityIsFrequent | final public boolean getCapabilityIsFrequent(int bit)(Code) | | Retrieves the isFrequent bit associated with the specified capability
bit.
Note that only one isFrequent bit, for a single capability
bit, may be retrieved per method invocation--capability bits cannot
be ORed together.
Parameters: bit - the bit whose value is returned true if the isFrequent bit is set, false if the isFrequentbit is clear since: Java 3D 1.3 |
getName | public String getName()(Code) | | Returns the name of this object.
the name of this object since: Java 3D 1.4 |
getNodeComponent | NodeComponent getNodeComponent(NodeComponent originalNodeComponent, boolean forceDuplicate, Hashtable hashtable)(Code) | | If forceDuplicate is true or
duplicateOnCloneTree flag is true. This procedure
will return a clone of originalNode or the value in
in nodeHashtable if found. Otherwise return
originalNode
This method is called from the
duplicateAttributes method during cloneNodeComponent.
Parameters: originalNodeComponent - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. Parameters: nodeHashtable - is used to keep track of mapping between old and new node references. |
getUserData | public Object getUserData()(Code) | | Retrieves the userData field from this scene graph object.
the current userData field |
isCompiled | final public boolean isCompiled()(Code) | | Returns a flag indicating whether the node is part of a scene graph
that has been compiled. If so, then only those capabilities explicitly
allowed by the object's capability bits are allowed.
true if node is part of a compiled scene graph, else false |
isLive | final public boolean isLive()(Code) | | Returns a flag indicating whether the node is part of a live
scene graph.
true if node is part of a live scene graph, else false |
isLiveOrCompiled | final boolean isLiveOrCompiled()(Code) | | Returns a flag indicating whether the node is part of a live
scene graph or a compiled scene graph.
true if either live or compiled |
setCapability | final public void setCapability(int bit)(Code) | | Sets the specified capability bit. Note that only one capability bit
may be set per method invocation--capability bits cannot be ORed
together.
Parameters: bit - the bit to set exception: RestrictedAccessException - if this object is part of liveor compiled scene graph |
setCapabilityIsFrequent | final public void setCapabilityIsFrequent(int bit)(Code) | | Sets the isFrequent bit associated with the specified
capability bit. Setting the isFrequent bit indicates that the
application may frequently access or modify those attributes
permitted by the associated capability bit. This can be used
by Java 3D as a hint to avoid certain optimizations that could
cause those accesses or modifications to be expensive. By
default the isFrequent bit associated with each capability bit
is set.
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.
Parameters: bit - the capability bit for which to set the associatedisFrequent bit exception: RestrictedAccessException - if this object is part of acompiled scene graph since: Java 3D 1.3 |
setCompiled | final void setCompiled()(Code) | | Sets an internal flag which indicates that this scene graph object
has been compiled.
|
setDefaultReadCapabilities | void setDefaultReadCapabilities(int[] bits)(Code) | | Method to set default read capability bits to true
|
setLive | final void setLive()(Code) | | Sets an internal flag which indicates that this scene graph object
is part of a live scene graph.
|
setName | public void setName(String name)(Code) | | Sets the name of this object. Object names are for information
only.
Parameters: name - the new name of this object since: Java 3D 1.4 |
setUserData | public void setUserData(Object userData)(Code) | | Sets the userData field associated with this scene graph object.
The userData field is a reference to an arbitrary object
and may be used to store any user-specific data associated
with this scene graph object--it is not used by the Java 3D API.
If this object is cloned, the userData field is copied
to the newly cloned object.
Parameters: userData - a reference to the new userData field |
toString | public String toString()(Code) | | Returns a String representation of this SceneGraphObject.
If its name is non-null, then it is concatenated with
super.toString().
|
updateNodeReferences | public void updateNodeReferences(NodeReferenceTable referenceTable)(Code) | | 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 .
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.
Parameters: referenceTable - a NodeReferenceTableObject that contains thegetNewObjectReference method needed to search fornew object instances. See Also: NodeReferenceTable See Also: Node.cloneTree See Also: DanglingReferenceException |
|
|