All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Shape3D

java.lang.Object
   |
   +----java.media.j3d.SceneGraphObject
           |
           +----java.media.j3d.Node
                   |
                   +----java.media.j3d.Leaf
                           |
                           +----java.media.j3d.Shape3D

public class Shape3D
extends Leaf
A shape leaf node consisting of geometery and appearance properties.


Variable Index

 o ALLOW_APPEARANCE_READ
Specifies that the node allows read access to its appearance information.
 o ALLOW_APPEARANCE_WRITE
Specifies that the node allows write access to its appearance information.
 o ALLOW_COLLISION_BOUNDS_READ
Specifies that the node allows reading its collision Bounds
 o ALLOW_COLLISION_BOUNDS_WRITE
Specifies the node allows writing its collision Bounds
 o ALLOW_GEOMETRY_READ
Specifies that the node allows read access to its geometry information.
 o ALLOW_GEOMETRY_WRITE
Specifies that the node allows write access to its geometry information.
 o ALLOW_SQUASH_READ
Specifies that the node allows read access to its squash information.
 o ALLOW_SQUASH_WRITE
Specifies that the node allows write access to its squash information.

Constructor Index

 o Shape3D()
Constructs and initializes a Shape3D object with null geometry and default appearance.
 o Shape3D(Geometry)
Constructs and initializes a Shape3D object with the default appearance.
 o Shape3D(Geometry, Appearance)
Constructs and initializes a Shape3D object.

Method Index

 o cloneNode(boolean)
Used to create a new instance of the node.
 o duplicateNode(Node, boolean)
Copies all node information from originalNode into the current node.
 o getAppearance()
Retrieves the appearance component of this shape node.
 o getCollisionBounds()
Returns the collision bounding object of this node.
 o getGeometry()
Retrieves the geometry component of this Shape3D node.
 o getSquash()
Retrieves the squash component of this shape node.
 o setAppearance(Appearance)
Sets the appearance component of this Shape3D node.
 o setCollisionBounds(Bounds)
Sets the collision bounds of a node.
 o setGeometry(Geometry)
Sets the geometry component of the Shape3D node.
 o setSquash(Squash)
Sets the squash component of this Shape3D node.

Variables

 o ALLOW_GEOMETRY_READ
 public static final int ALLOW_GEOMETRY_READ
Specifies that the node allows read access to its geometry information.

 o ALLOW_GEOMETRY_WRITE
 public static final int ALLOW_GEOMETRY_WRITE
Specifies that the node allows write access to its geometry information.

 o ALLOW_APPEARANCE_READ
 public static final int ALLOW_APPEARANCE_READ
Specifies that the node allows read access to its appearance information.

 o ALLOW_APPEARANCE_WRITE
 public static final int ALLOW_APPEARANCE_WRITE
Specifies that the node allows write access to its appearance information.

 o ALLOW_SQUASH_READ
 public static final int ALLOW_SQUASH_READ
Specifies that the node allows read access to its squash information.

 o ALLOW_SQUASH_WRITE
 public static final int ALLOW_SQUASH_WRITE
Specifies that the node allows write access to its squash information.

 o ALLOW_COLLISION_BOUNDS_READ
 public static final int ALLOW_COLLISION_BOUNDS_READ
Specifies that the node allows reading its collision Bounds

 o ALLOW_COLLISION_BOUNDS_WRITE
 public static final int ALLOW_COLLISION_BOUNDS_WRITE
Specifies the node allows writing its collision Bounds

Constructors

 o Shape3D
 public Shape3D()
Constructs and initializes a Shape3D object with null geometry and default appearance.

 o Shape3D
 public Shape3D(Geometry geometry)
Constructs and initializes a Shape3D object with the default appearance.

Parameters:
geometry - the geometry component of the shape
 o Shape3D
 public Shape3D(Geometry geometry,
                Appearance appearance)
Constructs and initializes a Shape3D object.

Parameters:
geometry - the geometry component of the shape
appearance - the appearance component of the shape

Methods

 o setCollisionBounds
 public final void setCollisionBounds(Bounds bounds)
Sets the collision bounds of a node.

Parameters:
bounds - the collision bounding object for a node
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getCollisionBounds
 public final Bounds getCollisionBounds()
Returns the collision bounding object of this node.

Returns:
the node's collision bounding object
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setGeometry
 public final void setGeometry(Geometry geometry)
Sets the geometry component of the Shape3D node.

Parameters:
geometry - the new geometry component for the shape node
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getGeometry
 public final Geometry getGeometry()
Retrieves the geometry component of this Shape3D node.

Returns:
the geometry component of this shape node
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setAppearance
 public final void setAppearance(Appearance appearance)
Sets the appearance component of this Shape3D node.

Parameters:
appearance - the new appearance component for this shape node
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getAppearance
 public final Appearance getAppearance()
Retrieves the appearance component of this shape node.

Returns:
the appearance component of this shape node
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setSquash
 public final void setSquash(Squash squash)
Sets the squash component of this Shape3D node.

Parameters:
squash - the squash component applied to the geometry referenced by this shape node. This is used to stretch or squash an object (e.g., to turn a sphere into an ellipsoid. If squash is null then no scaling is applied to the geometry.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getSquash
 public final Squash getSquash()
Retrieves the squash component of this shape node.

Returns:
the squash component of this shape node
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o cloneNode
 public Node cloneNode(boolean forceDuplicate)
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 the duplicateOnCloneTree flag to be ignored. When false, the value of each node's duplicateOnCloneTree variable determines whether NodeComponent data is duplicated or copied.
Overrides:
cloneNode in class Node
See Also:
cloneTree, duplicateNode, setDuplicateOnCloneTree
 o duplicateNode
 public void duplicateNode(Node originalNode,
                           boolean forceDuplicate)
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.

Parameters:
originalNode - the original node to duplicate.
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.
Overrides:
duplicateNode in class Node
See Also:
cloneTree, cloneNode, setDuplicateOnCloneTree

All Packages  Class Hierarchy  This Package  Previous  Next  Index