| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Shape3D
All known Subclasses: org.jdesktop.j3d.examples.texture_by_ref.Tetrahedron, org.jdesktop.j3d.examples.picking.Cube, com.sun.j3d.utils.geometry.ColorCube, org.jdesktop.j3d.examples.picking.Tetrahedron, com.sun.j3d.utils.behaviors.sensor.SensorBeamEcho, com.sun.j3d.utils.behaviors.sensor.SensorGnomonEcho, org.jdesktop.j3d.examples.collision.Box, org.jdesktop.j3d.examples.appearance.Tetrahedron, javax.media.j3d.OrientedShape3D, com.sun.j3d.utils.geometry.Text2D,
Shape3D | public class Shape3D extends Leaf (Code) | | The Shape3D leaf node specifies all geometric objects. It contains
a list of one or more Geometry component objects and a single
Appearance component object. The geometry objects define the shape
node's geometric data. The appearance object specifies that
object's appearance attributes, including color, material, texture,
and so on.
The list of geometry objects must all be of the same equivalence
class, that is, the same basic type of primitive. For subclasses
of GeometryArray, all point objects are equivalent, all line
objects are equivalent, and all polygon objects are equivalent.
For other subclasses of Geometry, only objects of the same
subclass are equivalent. The equivalence classes are as follows:
- GeometryArray (point): [Indexed]PointArray
- GeometryArray (line): [Indexed]{LineArray, LineStripArray}
- GeometryArray (polygon): [Indexed]{TriangleArray, TriangleStripArray,
TriangleFanArray, QuadArray}
- CompressedGeometry
- Raster
- Text3D
When Shape3D is used with multiple geometry components, Java 3D may
choose to use individual geometry bounds instead of the shape's
bounds for region of influence operations, such as lighting.
For example, the individual characters of a Text3D shape object
may be rendered with a different light set.
|
Constructor Summary | |
public | Shape3D() Constructs a Shape3D node with default parameters. | public | Shape3D(Geometry geometry) Constructs and initializes a Shape3D node with the specified
geometry component and a null appearance component. | public | Shape3D(Geometry geometry, Appearance appearance) Constructs and initializes a Shape3D node with the specified
geometry and appearance components. |
Method Summary | |
public void | addGeometry(Geometry geometry) Appends the specified geometry component to this Shape3D
node's list of geometry components. | public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode Shape3DRetained object that this
Shape3D object will point to. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all Shape3D information from
originalNode into
the current node. | public void | duplicateNode(Node originalNode, boolean forceDuplicate) Copies all node information from originalNode into
the current node. | public Enumeration | getAllGeometries() Returns an enumeration of this Shape3D node's list of geometry
components. | public Appearance | getAppearance() Retrieves the appearance component of this shape node. | public boolean | getAppearanceOverrideEnable() Retrieves the appearanceOverrideEnable flag for this node. | public Bounds | getBounds() See parent class for the documentation on getBounds(). | public Bounds | getCollisionBounds() Returns the collision bounding object of this node. | public Geometry | getGeometry() Retrieves the geometry component at index 0 from this Shape3D node's
list of geometry components. | public Geometry | getGeometry(int index) Retrieves the geometry component at the specified index from
this Shape3D node's list of geometry components.
Parameters: index - the index of the geometry component to be returned. | public int | indexOfGeometry(Geometry geometry) Retrieves the index of the specified geometry component in
this Shape3D node's list of geometry components.
Parameters: geometry - the geometry component to be looked up. | public void | insertGeometry(Geometry geometry, int index) Inserts the specified geometry component into this Shape3D
node's list of geometry components at the specified index. | public boolean | intersect(SceneGraphPath path, PickShape pickShape) Checks whether the geometry in this shape node intersects with
the specified pickShape. | public boolean | intersect(SceneGraphPath path, PickRay pickRay, double[] dist) Checks whether the geometry in this shape node intersects with
the specified pickRay.
Parameters: path - the SceneGraphPath to this shape node Parameters: pickRay - the PickRay to be intersected Parameters: dist - the closest distance of the intersection true if the pick shape intersects this node; falseotherwise. | public boolean | intersect(SceneGraphPath path, PickShape pickShape, double[] dist) Checks whether the geometry in this shape node intersects with
the specified pickShape.
Parameters: path - the SceneGraphPath to this shape node Parameters: pickShape - the PickShape to be intersected Parameters: dist - the closest distance of the intersection true if the pick shape intersects this node; falseotherwise. | public int | numGeometries() Returns the number of geometry components in this Shape3D node's
list of geometry components. | public void | removeAllGeometries() Removes all geometry components from this Shape3D node. | public void | removeGeometry(int index) Removes the geometry component at the specified index from
this Shape3D node's list of geometry components. | public void | removeGeometry(Geometry geometry) Removes the specified geometry component from this
Shape3D node's list of geometry components. | public void | setAppearance(Appearance appearance) Sets the appearance component of this Shape3D node. | public void | setAppearanceOverrideEnable(boolean flag) Sets a flag that indicates whether this node's appearance can
be overridden. | public void | setCollisionBounds(Bounds bounds) Sets the collision bounds of a node. | public void | setGeometry(Geometry geometry) Replaces the geometry component at index 0 in this Shape3D node's
list of geometry components with the specified geometry component. | public void | setGeometry(Geometry geometry, int index) Replaces the geometry component at the specified index in this
Shape3D node's list of geometry components with the specified
geometry component. |
ALLOW_APPEARANCE_OVERRIDE_READ | final public static int ALLOW_APPEARANCE_OVERRIDE_READ(Code) | | Specifies that this node allows reading its appearance override
enable flag.
since: Java 3D 1.2 |
ALLOW_APPEARANCE_OVERRIDE_WRITE | final public static int ALLOW_APPEARANCE_OVERRIDE_WRITE(Code) | | Specifies that this node allows writing its appearance override
enable flag.
since: Java 3D 1.2 |
ALLOW_APPEARANCE_READ | final public static int ALLOW_APPEARANCE_READ(Code) | | Specifies that the node allows read access to its appearance
information.
|
ALLOW_APPEARANCE_WRITE | final public static int ALLOW_APPEARANCE_WRITE(Code) | | Specifies that the node allows write access to its appearance
information.
|
ALLOW_COLLISION_BOUNDS_READ | final public static int ALLOW_COLLISION_BOUNDS_READ(Code) | | Specifies that the node allows reading its collision Bounds
|
ALLOW_COLLISION_BOUNDS_WRITE | final public static int ALLOW_COLLISION_BOUNDS_WRITE(Code) | | Specifies the node allows writing its collision Bounds
|
ALLOW_GEOMETRY_READ | final public static int ALLOW_GEOMETRY_READ(Code) | | Specifies that the node allows read access to its geometry information.
|
ALLOW_GEOMETRY_WRITE | final public static int ALLOW_GEOMETRY_WRITE(Code) | | Specifies that the node allows write access to its geometry information.
|
id | int id(Code) | | Id used in the compile optimization to determine
how to get to the geometry in the case of read
or picking ..
|
Shape3D | public Shape3D()(Code) | | Constructs a Shape3D node with default parameters. The default
values are as follows:
appearance : null
geometry : { null }
collision bounds : null
appearance override enable : false
The list of geometry components is initialized with a null
geometry component as the single element with an index of 0.
A null geometry component specifies
that no geometry is drawn. A null appearance component specifies
that default values are used for all appearance attributes.
|
Shape3D | public Shape3D(Geometry geometry)(Code) | | Constructs and initializes a Shape3D node with the specified
geometry component and a null appearance component.
The list of geometry components is initialized with the
specified geometry component as the single element with an
index of 0.
A null appearance component specifies that default values are
used for all appearance attributes.
Parameters: geometry - the geometry component with which to initializethis shape node. |
Shape3D | public Shape3D(Geometry geometry, Appearance appearance)(Code) | | Constructs and initializes a Shape3D node with the specified
geometry and appearance components.
The list of geometry components is initialized with the
specified geometry component as the single element with an
index of 0.
Parameters: geometry - the geometry component with which to initializethis shape node Parameters: appearance - the appearance component of the shape node |
addGeometry | public void addGeometry(Geometry geometry)(Code) | | Appends the specified geometry component to this Shape3D
node's list of geometry components.
If there are existing geometry components in the list, the new
geometry component must be of the same equivalence class
(point, line, polygon, CompressedGeometry, Raster, Text3D) as
the others.
Parameters: geometry - the geometry component to be appended. exception: IllegalArgumentException - if the new geometrycomponent is not of of the same equivalence class as theexisting geometry components. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
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.
cloneNode should be overridden by any user subclassed
objects. All subclasses must have their cloneNode
method consist of the following lines:
public Node cloneNode(boolean forceDuplicate) {
UserSubClass usc = new UserSubClass();
usc.duplicateNode(this, forceDuplicate);
return usc;
}
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.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
createRetained | void createRetained()(Code) | | Creates the retained mode Shape3DRetained object that this
Shape3D object will point to.
|
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all Shape3D 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 |
duplicateNode | public void duplicateNode(Node originalNode, boolean forceDuplicate)(Code) | | Copies all node information from 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.
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: ClassCastException - if originalNode is not an instance of Shape3D See Also: Node.cloneTree See Also: Node.cloneNode See Also: NodeComponent.setDuplicateOnCloneTree |
getAllGeometries | public Enumeration getAllGeometries()(Code) | | Returns an enumeration of this Shape3D node's list of geometry
components.
an Enumeration object containing all geometry components inthis Shape3D node's list of geometry components. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
getAppearance | public Appearance getAppearance()(Code) | | Retrieves the appearance component of this shape node.
the appearance component of this shape node exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getAppearanceOverrideEnable | public boolean getAppearanceOverrideEnable()(Code) | | Retrieves the appearanceOverrideEnable flag for this node.
true if the appearance can be overridden; falseotherwise. exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
getBounds | public Bounds getBounds()(Code) | | See parent class for the documentation on getBounds().
|
getCollisionBounds | public Bounds getCollisionBounds()(Code) | | Returns the collision bounding object of this node.
the node's collision bounding object exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getGeometry | public Geometry getGeometry()(Code) | | Retrieves the geometry component at index 0 from this Shape3D node's
list of geometry components.
the geometry component at index 0. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getGeometry | public Geometry getGeometry(int index)(Code) | | Retrieves the geometry component at the specified index from
this Shape3D node's list of geometry components.
Parameters: index - the index of the geometry component to be returned. the geometry component at the specified index. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
indexOfGeometry | public int indexOfGeometry(Geometry geometry)(Code) | | Retrieves the index of the specified geometry component in
this Shape3D node's list of geometry components.
Parameters: geometry - the geometry component to be looked up. the index of the specified geometry component;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 |
insertGeometry | public void insertGeometry(Geometry geometry, int index)(Code) | | Inserts the specified geometry component into this Shape3D
node's list of geometry components at the specified index.
If there are existing geometry components in the list, the new
geometry component must be of the same equivalence class
(point, line, polygon, CompressedGeometry, Raster, Text3D) as
the others.
Parameters: geometry - the geometry component to be inserted at thespecified index. Parameters: index - the index at which the geometry component is inserted. exception: IllegalArgumentException - if the new geometrycomponent is not of of the same equivalence class as theexisting geometry components. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
intersect | public boolean intersect(SceneGraphPath path, PickShape pickShape)(Code) | | Checks whether the geometry in this shape node intersects with
the specified pickShape.
Parameters: path - the SceneGraphPath to this shape node Parameters: pickShape - the PickShape to be intersected true if the pick shape intersects this node; falseotherwise. exception: IllegalArgumentException - if pickShape is a PickPoint.Java 3D doesn't have spatial information of the surface.Use PickBounds with BoundingSphere and a small radius, instead. exception: CapabilityNotSetException - if the Geometry.ALLOW_INTERSECTcapability bit is not set in all of the Geometry objectsreferred to by this shape node. |
intersect | public boolean intersect(SceneGraphPath path, PickRay pickRay, double[] dist)(Code) | | Checks whether the geometry in this shape node intersects with
the specified pickRay.
Parameters: path - the SceneGraphPath to this shape node Parameters: pickRay - the PickRay to be intersected Parameters: dist - the closest distance of the intersection true if the pick shape intersects this node; falseotherwise. If true, dist contains the closest distance ofintersection. exception: CapabilityNotSetException - if the Geometry.ALLOW_INTERSECTcapability bit is not set in all of the Geometry objectsreferred to by this shape node. |
intersect | public boolean intersect(SceneGraphPath path, PickShape pickShape, double[] dist)(Code) | | Checks whether the geometry in this shape node intersects with
the specified pickShape.
Parameters: path - the SceneGraphPath to this shape node Parameters: pickShape - the PickShape to be intersected Parameters: dist - the closest distance of the intersection true if the pick shape intersects this node; falseotherwise. If true, dist contains the closest distance ofintersection. exception: IllegalArgumentException - if pickShape is a PickPoint.Java 3D doesn't have spatial information of the surface.Use PickBounds with BoundingSphere and a small radius, instead. exception: CapabilityNotSetException - if the Geometry.ALLOW_INTERSECTcapability bit is not set in all of the Geometry objectsreferred to by this shape node. since: Java 3D 1.3 |
numGeometries | public int numGeometries()(Code) | | Returns the number of geometry components in this Shape3D node's
list of geometry components.
the number of geometry components in this Shape3D node'slist of geometry components. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
removeAllGeometries | public void removeAllGeometries()(Code) | | Removes all geometry components from this Shape3D node.
exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
removeGeometry | public void removeGeometry(int index)(Code) | | Removes the geometry component at the specified index from
this Shape3D node's list of geometry components.
Parameters: index - the index of the geometry component to be removed. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
removeGeometry | public void removeGeometry(Geometry geometry)(Code) | | Removes the specified geometry component from this
Shape3D node's list of geometry components.
If the specified object is not in the list, the list is not modified.
Parameters: geometry - the geometry component to be removed. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setAppearance | public void setAppearance(Appearance appearance)(Code) | | Sets the appearance component of this Shape3D node. Setting it to null
specifies that default values are used for all appearance attributes.
Parameters: appearance - the new appearance component for this shape node exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setAppearanceOverrideEnable | public void setAppearanceOverrideEnable(boolean flag)(Code) | | Sets a flag that indicates whether this node's appearance can
be overridden. If the flag is true, then this node's
appearance may be overridden by an AlternateAppearance leaf
node, regardless of the value of the ALLOW_APPEARANCE_WRITE
capability bit.
The default value is false.
Parameters: flag - the apperance override enable flag. exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph See Also: AlternateAppearance since: Java 3D 1.2 |
setCollisionBounds | public void setCollisionBounds(Bounds bounds)(Code) | | Sets the collision bounds of a node.
Parameters: bounds - the collision bounding object for a node exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setGeometry | public void setGeometry(Geometry geometry)(Code) | | Replaces the geometry component at index 0 in this Shape3D node's
list of geometry components with the specified geometry component.
If there are existing geometry components in the list (besides
the one being replaced), the new geometry component must be of
the same equivalence class (point, line, polygon, CompressedGeometry,
Raster, Text3D) as the others.
Parameters: geometry - the geometry component to be stored at index 0. exception: IllegalArgumentException - if the new geometrycomponent is not of of the same equivalence class as theexisting geometry components. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setGeometry | public void setGeometry(Geometry geometry, int index)(Code) | | Replaces the geometry component at the specified index in this
Shape3D node's list of geometry components with the specified
geometry component.
If there are existing geometry components in the list (besides
the one being replaced), the new geometry component must be of
the same equivalence class (point, line, polygon, CompressedGeometry,
Raster, Text3D) as the others.
Parameters: geometry - the geometry component to be stored at thespecified index. Parameters: index - the index of the geometry component to be replaced. exception: IllegalArgumentException - if the new geometrycomponent is not of of the same equivalence class as theexisting geometry components. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
|
|