|
|||||||||
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.Leaf | +--javax.media.j3d.AlternateAppearance
The AlternateAppearance leaf node is used for overriding the Appearance component of selected nodes. It defines an Appearance component object and a region of influence in which this AlternateAppearance node is active. An AlternateAppearance node also contains a list of Group nodes that specifies the hierarchical scope of this AlternateAppearance. If the scope list is empty, then the AlternateAppearance node has universe scope: all nodes within the region of influence are affected by this AlternateAppearance node. If the scope list is non-empty, then only those Leaf nodes under the Group nodes in the scope list are affected by this AlternateAppearance node (subject to the influencing bounds).
An AlternateAppearance node affects Shape3D and Morph nodes by overriding their appearance component with the appearance component in this AlternateAppearance node. Only those Shape3D and Morph nodes that explicitly allow their appearance to be overridden are affected. The AlternateAppearance node has no effect on Shape3D and Morph nodes that do not allow their appearance to be overridden.
If the regions of influence of multiple AlternateAppearance nodes overlap, the Java 3D system will choose a single alternate appearance for those objects that lie in the intersection. This is done in an implementation-dependent manner, but in general, the AlternateAppearance node that is "closest" to the object is chosen.
Field Summary | |
static int |
ALLOW_APPEARANCE_READ
Specifies that this AlternateAppearance node allows read access to its appearance information. |
static int |
ALLOW_APPEARANCE_WRITE
Specifies that this AlternateAppearance node allows write access to its appearance information. |
static int |
ALLOW_INFLUENCING_BOUNDS_READ
Specifies that this AlternateAppearance node allows read access to its influencing bounds and bounds leaf information. |
static int |
ALLOW_INFLUENCING_BOUNDS_WRITE
Specifies that this AlternateAppearance node allows write access to its influencing bounds and bounds leaf information. |
static int |
ALLOW_SCOPE_READ
Specifies that this AlternateAppearance node allows read access to its scope information at runtime. |
static int |
ALLOW_SCOPE_WRITE
Specifies that this AlternateAppearance node allows write access to its scope information at runtime. |
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_PICKABLE_READ,
ALLOW_PICKABLE_WRITE,
ENABLE_COLLISION_REPORTING,
ENABLE_PICK_REPORTING |
Constructor Summary | |
AlternateAppearance()
Constructs an AlternateAppearance node with default parameters. |
|
AlternateAppearance(Appearance appearance)
Constructs an AlternateAppearance node with the specified appearance. |
Method Summary | |
void |
addScope(Group scope)
Appends the specified Group node to this AlternateAppearance node's list of scopes. |
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
java.util.Enumeration |
getAllScopes()
Returns an enumeration of this AlternateAppearance node's list of scopes. |
Appearance |
getAppearance()
Retrieves the appearance from this AlternateAppearance node. |
BoundingLeaf |
getInfluencingBoundingLeaf()
Retrieves the AlternateAppearance node's influencing bounding leaf. |
Bounds |
getInfluencingBounds()
Retrieves the AlternateAppearance node's influencing bounds. |
Group |
getScope(int index)
Retrieves the Group node at the specified index from this AlternateAppearance node's list of scopes. |
void |
insertScope(Group scope,
int index)
Inserts the specified Group node into this AlternateAppearance node's list of scopes at the specified index. |
int |
numScopes()
Returns the number of nodes in this AlternateAppearance node's list of scopes. |
void |
removeScope(int index)
Removes the node at the specified index from this AlternateAppearance node's list of scopes. |
void |
setAppearance(Appearance appearance)
Sets the appearance of this AlternateAppearance node. |
void |
setInfluencingBoundingLeaf(BoundingLeaf region)
Sets the AlternateAppearance's influencing region to the specified bounding leaf. |
void |
setInfluencingBounds(Bounds region)
Sets the AlternateAppearance's influencing region to the specified bounds. |
void |
setScope(Group scope,
int index)
Replaces the node at the specified index in this AlternateAppearance node's list of scopes with the specified Group node. |
void |
updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any nodes referenced by that node have been duplicated via a call to cloneTree . |
Methods inherited from class javax.media.j3d.Node |
cloneTree,
cloneTree,
cloneTree,
cloneTree,
cloneTree,
cloneTree,
duplicateNode,
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_INFLUENCING_BOUNDS_READ
public static final int ALLOW_INFLUENCING_BOUNDS_WRITE
public static final int ALLOW_APPEARANCE_READ
public static final int ALLOW_APPEARANCE_WRITE
public static final int ALLOW_SCOPE_READ
public static final int ALLOW_SCOPE_WRITE
Constructor Detail |
public AlternateAppearance()
public AlternateAppearance(Appearance appearance)
appearance
- the appearance that is used for those nodes affected
by this AlternateAppearance node.Method Detail |
public void setAppearance(Appearance appearance)
appearance
- the new appearance.public Appearance getAppearance()
public void setInfluencingBounds(Bounds region)
region
- the bounds that contains the AlternateAppearance's
new influencing region.public Bounds getInfluencingBounds()
public void setInfluencingBoundingLeaf(BoundingLeaf region)
region
- the bounding leaf node used to specify the
AlternateAppearance node's new influencing region.public BoundingLeaf getInfluencingBoundingLeaf()
public void setScope(Group scope, int index)
scope
- the Group node to be stored at the specified index.index
- the index of the Group node to be replaced.public Group getScope(int index)
index
- the index of the Group node to be returned.public void insertScope(Group scope, int index)
scope
- the Group node to be inserted at the specified index.index
- the index at which the Group node is inserted.public void removeScope(int index)
index
- the index of the Group node to be removed.public java.util.Enumeration getAllScopes()
public void addScope(Group scope)
scope
- the Group node to be appended.public int numScopes()
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's method
will be called and the Leaf node can then look up any node references
by using the getNewObjectReference
method found in the
NodeReferenceTable
object. If a match is found, a
reference to the corresponding Node 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
node 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 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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |