| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.ModelClip
ModelClip | public class ModelClip extends Leaf (Code) | | The ModelClip leaf node defines a set of 6 arbitrary clipping
planes in the virtual universe. The planes are specified in the
local coordinate system of this node, and may be individually
enabled or disabled. This node also specifies a region of
influence in which this set of planes is active.
A ModelClip node also contains a list of Group nodes that specifies the
hierarchical scope of this ModelClip. If the scope list is empty, then
the ModelClip node has universe scope: all nodes within the region of
influence are affected by this ModelClip 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 ModelClip node (subject to the
influencing bounds).
If the regions of influence of multiple ModelClip nodes overlap, the
Java 3D system will choose a single set of model clip planes for those
objects that lie in the intersection. This is done in an
implementation-dependent manner, but in general, the ModelClip node that
is "closest" to the object is chosen.
The individual planes specify a half-space defined by the equation:
where A, B, C, D are the parameters that specify the plane. The
parameters are passed in the x, y, z, and w fields, respectively,
of a Vector4d object. The intersection of the set of half-spaces
corresponding to the enabled planes in this ModelClip node defines
a region in which points are accepted. Points in this acceptance
region will be rendered (subject to view clipping and other
attributes). Points that are not in the acceptance region will not
be rendered.
since: Java 3D 1.2 |
Field Summary | |
final public static int | ALLOW_ENABLE_READ Specifies that the ModelClip node allows read access to its enable
flags at runtime. | final public static int | ALLOW_ENABLE_WRITE Specifies that the ModelClip node allows write access to its enable
flags at runtime. | final public static int | ALLOW_INFLUENCING_BOUNDS_READ Specifies that the ModelClip node allows read access to its influencing
bounds and bounding leaf at runtime. | final public static int | ALLOW_INFLUENCING_BOUNDS_WRITE Specifies that the ModelClip node allows write access to its influencing
bounds and bounding leaf at runtime. | final public static int | ALLOW_PLANE_READ Specifies that the ModelClip node allows read access to its planes
at runtime. | final public static int | ALLOW_PLANE_WRITE Specifies that the ModelClip node allows write access to its planes
at runtime. | final public static int | ALLOW_SCOPE_READ Specifies that this ModelClip node allows read access to its scope
information at runtime. | final public static int | ALLOW_SCOPE_WRITE Specifies that this ModelClip node allows write access to its scope
information at runtime. |
Constructor Summary | |
public | ModelClip() Constructs a ModelClip node with default parameters. | public | ModelClip(Vector4d[] planes) Constructs a ModelClip node using the specified planes. | public | ModelClip(Vector4d[] planes, boolean[] enables) Constructs a ModelClip node using the specified planes and enable
flags. |
Method Summary | |
public void | addScope(Group scope) Appends the specified Group node to this ModelClip node's list of scopes.
By default, ModelClip nodes are scoped only by their influencing
bounds. | public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode ModelClipRetained object that
this ModelClip node will point to. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all Clip information from
originalNode into
the current node. | public Enumeration | getAllScopes() Returns an enumeration of this ModelClip node's list of scopes. | public boolean | getEnable(int planeNum) Retrieves the specified enable flag from this ModelClip node. | public void | getEnables(boolean[] enables) Retrieves the per-plane enable flags from this ModelClip node. | public BoundingLeaf | getInfluencingBoundingLeaf() Retrieves the ModelClip node's influencing bounding leaf. | public Bounds | getInfluencingBounds() Retrieves the ModelClip node's influencing bounds. | public void | getPlane(int planeNum, Vector4d plane) Retrieves the specified clipping plane from this ModelClip node. | public void | getPlanes(Vector4d[] planes) Retrieves the clipping planes from this ModelClip node.
The individual planes are copied into the specified planes, which
must be allocated by the caller. | public Group | getScope(int index) Retrieves the Group node at the specified index from this ModelClip node's
list of scopes.
Parameters: index - the index of the Group node to be returned. | public int | indexOfScope(Group scope) Retrieves the index of the specified Group node in this
ModelClip node's list of scopes.
Parameters: scope - the Group node to be looked up. | public void | insertScope(Group scope, int index) Inserts the specified Group node into this ModelClip node's
list of scopes at the specified index.
By default, ModelClip nodes are scoped only by their influencing
bounds. | public int | numScopes() Returns the number of nodes in this ModelClip node's list of scopes. | public void | removeAllScopes() Removes all Group nodes from this ModelClip node's
list of scopes. | public void | removeScope(int index) Removes the node at the specified index from this ModelClip node's
list of scopes. | public void | removeScope(Group scope) Removes the specified Group node from this ModelClip
node's list of scopes. | public void | setEnable(int planeNum, boolean enable) Sets the specified enable flag of this ModelClip node. | public void | setEnables(boolean[] enables) Sets the per-plane enable flags of this ModelClip node to the
specified values. | public void | setInfluencingBoundingLeaf(BoundingLeaf region) Set the ModelClip node's influencing region to the specified
bounding leaf. | public void | setInfluencingBounds(Bounds region) Set the ModelClip node's influencing region to the specified bounds. | public void | setPlane(int planeNum, Vector4d plane) Sets the specified clipping plane of this ModelClip node. | public void | setPlanes(Vector4d[] planes) Sets the clipping planes of this ModelClip node to the
specified planes. | public void | setScope(Group scope, int index) Replaces the node at the specified index in this ModelClip node's
list of scopes with the specified Group node.
By default, ModelClip nodes are scoped only by their influencing
bounds. | 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. |
ALLOW_ENABLE_READ | final public static int ALLOW_ENABLE_READ(Code) | | Specifies that the ModelClip node allows read access to its enable
flags at runtime.
|
ALLOW_ENABLE_WRITE | final public static int ALLOW_ENABLE_WRITE(Code) | | Specifies that the ModelClip node allows write access to its enable
flags at runtime.
|
ALLOW_INFLUENCING_BOUNDS_READ | final public static int ALLOW_INFLUENCING_BOUNDS_READ(Code) | | Specifies that the ModelClip node allows read access to its influencing
bounds and bounding leaf at runtime.
|
ALLOW_INFLUENCING_BOUNDS_WRITE | final public static int ALLOW_INFLUENCING_BOUNDS_WRITE(Code) | | Specifies that the ModelClip node allows write access to its influencing
bounds and bounding leaf at runtime.
|
ALLOW_PLANE_READ | final public static int ALLOW_PLANE_READ(Code) | | Specifies that the ModelClip node allows read access to its planes
at runtime.
|
ALLOW_PLANE_WRITE | final public static int ALLOW_PLANE_WRITE(Code) | | Specifies that the ModelClip node allows write access to its planes
at runtime.
|
ALLOW_SCOPE_READ | final public static int ALLOW_SCOPE_READ(Code) | | Specifies that this ModelClip node allows read access to its scope
information at runtime.
|
ALLOW_SCOPE_WRITE | final public static int ALLOW_SCOPE_WRITE(Code) | | Specifies that this ModelClip node allows write access to its scope
information at runtime.
|
ModelClip | public ModelClip()(Code) | | Constructs a ModelClip node with default parameters. The default
values are as follows:
planes[0] : x <= 1 (1,0,0,-1)
planes[1] : -x <= 1 (-1,0,0,-1)
planes[2] : y <= 1 (0,1,0,-1)
planes[3] : -y <= 1 (0,-1,0,-1)
planes[4] : z <= 1 (0,0,1,-1)
planes[5] : -z <= 1 (0,0,-1,-1)
enables : all planes enabled
scope : empty (universe scope)
influencing bounds : null
influencing bounding leaf : null
|
ModelClip | public ModelClip(Vector4d[] planes)(Code) | | Constructs a ModelClip node using the specified planes. The individual
planes are copied into this node. All planes are enabled.
Parameters: planes - an array of 6 model clipping planes |
ModelClip | public ModelClip(Vector4d[] planes, boolean[] enables)(Code) | | Constructs a ModelClip node using the specified planes and enable
flags. The individual
planes and enable flags are copied into this node.
Parameters: planes - an array of 6 model clipping planes Parameters: enables - an array of 6 enable flags |
addScope | public void addScope(Group scope)(Code) | | Appends the specified Group node to this ModelClip node's list of scopes.
By default, ModelClip nodes are scoped only by their influencing
bounds. This allows them to be further scoped by a list of
nodes in the hierarchy.
Parameters: scope - the Group node to be appended. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph |
cloneNode | public Node cloneNode(boolean forceDuplicate)(Code) | | Used to create a new instance of the node. This routine is called
by cloneTree to duplicate the current node.
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. See Also: Node.cloneTree See Also: Node.cloneNode See Also: Node.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
createRetained | void createRetained()(Code) | | Creates the retained mode ModelClipRetained object that
this ModelClip node will point to.
|
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all Clip information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - 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. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getAllScopes | public Enumeration getAllScopes()(Code) | | Returns an enumeration of this ModelClip node's list of scopes.
an Enumeration object containing all nodes in this ModelClip node'slist of scopes. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getEnable | public boolean getEnable(int planeNum)(Code) | | Retrieves the specified enable flag from this ModelClip node.
Parameters: planeNum - specifies which enable flag (0-5) is retrieved the specified enable flag |
getEnables | public void getEnables(boolean[] enables)(Code) | | Retrieves the per-plane enable flags from this ModelClip node.
The enable flags are copied into the specified array.
The array must be large enough to hold all of the enables.
Parameters: enables - an array of 6 booleans that will receive theenable flags from this node |
getInfluencingBoundingLeaf | public BoundingLeaf getInfluencingBoundingLeaf()(Code) | | Retrieves the ModelClip node's influencing bounding leaf.
this node's influencing bounding leaf information exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getInfluencingBounds | public Bounds getInfluencingBounds()(Code) | | Retrieves the ModelClip node's influencing bounds.
this node's influencing bounds information exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getPlane | public void getPlane(int planeNum, Vector4d plane)(Code) | | Retrieves the specified clipping plane from this ModelClip node.
The plane is copied into the specified plane, which
must be allocated by the caller.
Parameters: planeNum - specifies which model clipping plane (0-5) is retrieved Parameters: plane - a vector that will receive the specified modelclipping plane from this node |
getPlanes | public void getPlanes(Vector4d[] planes)(Code) | | Retrieves the clipping planes from this ModelClip node.
The individual planes are copied into the specified planes, which
must be allocated by the caller. The array must be large
enough to hold all of the vectors.
Parameters: planes - an array of 6 vectors that will receive the modelclipping planes from this node |
getScope | public Group getScope(int index)(Code) | | Retrieves the Group node at the specified index from this ModelClip node's
list of scopes.
Parameters: index - the index of the Group node to be returned. the Group node at the specified index. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
indexOfScope | public int indexOfScope(Group scope)(Code) | | Retrieves the index of the specified Group node in this
ModelClip node's list of scopes.
Parameters: scope - the Group node to be looked up. the index of the specified Group node;returns -1 if the object is not in the list. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
insertScope | public void insertScope(Group scope, int index)(Code) | | Inserts the specified Group node into this ModelClip node's
list of scopes at the specified index.
By default, ModelClip nodes are scoped only by their influencing
bounds. This allows them to be further scoped by a list of
nodes in the hierarchy.
Parameters: scope - the Group node to be inserted at the specified index. Parameters: index - the index at which the Group node is inserted. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph |
numScopes | public int numScopes()(Code) | | Returns the number of nodes in this ModelClip node's list of scopes.
If this number is 0, then the list of scopes is empty and this
ModelClip node has universe scope: all nodes within the region of
influence are affected by this ModelClip node.
the number of nodes in this ModelClip node's list of scopes. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
removeAllScopes | public void removeAllScopes()(Code) | | Removes all Group nodes from this ModelClip node's
list of scopes. The ModelClip node will then have
universe scope: all nodes within the region of influence will
be affected by this ModelClip node.
exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if any group node in thisnode's list of scopes is part of a compiled scene graph since: Java 3D 1.3 |
removeScope | public void removeScope(int index)(Code) | | Removes the node at the specified index from this ModelClip node's
list of scopes. If this operation causes the list of scopes to
become empty, then this ModelClip will have universe scope: all nodes
within the region of influence will be affected by this ModelClip node.
Parameters: index - the index of the Group node to be removed. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the group node at thespecified index is part of a compiled scene graph |
removeScope | public void removeScope(Group scope)(Code) | | Removes the specified Group node from this ModelClip
node's list of scopes. If the specified object is not in the
list, the list is not modified. If this operation causes the
list of scopes to become empty, then this ModelClip
will have universe scope: all nodes within the region of
influence will be affected by this ModelClip node.
Parameters: scope - the Group node to be removed. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph since: Java 3D 1.3 |
setEnable | public void setEnable(int planeNum, boolean enable)(Code) | | Sets the specified enable flag of this ModelClip node.
Parameters: planeNum - specifies which enable flag (0-5) is set Parameters: enable - new enable flag |
setEnables | public void setEnables(boolean[] enables)(Code) | | Sets the per-plane enable flags of this ModelClip node to the
specified values.
Parameters: enables - an array of 6 enable flags |
setInfluencingBoundingLeaf | public void setInfluencingBoundingLeaf(BoundingLeaf region)(Code) | | Set the ModelClip node's influencing region to the specified
bounding leaf.
When set to a value other than null, this overrides the influencing
bounds object.
Parameters: region - the bounding leaf node used to specify thenew influencing region. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setInfluencingBounds | public void setInfluencingBounds(Bounds region)(Code) | | Set the ModelClip node's influencing region to the specified bounds.
This is used when the influencing bounding leaf is set to null.
Parameters: region - the bounds that contains the new influencingregion. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setPlane | public void setPlane(int planeNum, Vector4d plane)(Code) | | Sets the specified clipping plane of this ModelClip node.
The specified plane is copied into this node.
Parameters: planeNum - specifies which model clipping plane (0-5) is replaced Parameters: plane - new model clipping plane |
setPlanes | public void setPlanes(Vector4d[] planes)(Code) | | Sets the clipping planes of this ModelClip node to the
specified planes.
The individual planes are copied into this node.
Parameters: planes - an array of 6 model clipping planes |
setScope | public void setScope(Group scope, int index)(Code) | | Replaces the node at the specified index in this ModelClip node's
list of scopes with the specified Group node.
By default, ModelClip nodes are scoped only by their influencing
bounds. This allows them to be further scoped by a list of
nodes in the hierarchy.
Parameters: scope - the Group node to be stored at the specified index. Parameters: index - the index of the Group node to be replaced. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if the specified group nodeis part of a compiled scene graph |
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's method
will be called and the Leaf node 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 |
|
|