|
|||||||||
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.Shape3D
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:
Field Summary | |
static int |
ALLOW_APPEARANCE_OVERRIDE_READ
Specifies that this node allows reading its appearance override enable flag. |
static int |
ALLOW_APPEARANCE_OVERRIDE_WRITE
Specifies that this node allows writing its appearance override enable flag. |
static int |
ALLOW_APPEARANCE_READ
Specifies that the node allows read access to its appearance information. |
static int |
ALLOW_APPEARANCE_WRITE
Specifies that the node allows write access to its appearance information. |
static int |
ALLOW_COLLISION_BOUNDS_READ
Specifies that the node allows reading its collision Bounds |
static int |
ALLOW_COLLISION_BOUNDS_WRITE
Specifies the node allows writing its collision Bounds |
static int |
ALLOW_GEOMETRY_READ
Specifies that the node allows read access to its geometry information. |
static int |
ALLOW_GEOMETRY_WRITE
Specifies that the node allows write access to its geometry information. |
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 | |
Shape3D()
Constructs a Shape3D node with default parameters. |
|
Shape3D(Geometry geometry)
Constructs and initializes a Shape3D node with the specified geometry component and a null appearance component. |
|
Shape3D(Geometry geometry,
Appearance appearance)
Constructs and initializes a Shape3D node with the specified geometry and appearance components. |
Method Summary | |
void |
addGeometry(Geometry geometry)
Appends the specified geometry component to this Shape3D node's list of geometry components. |
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
void |
duplicateNode(Node originalNode,
boolean forceDuplicate)
Copies all node information from originalNode into
the current node. |
java.util.Enumeration |
getAllGeometries()
Returns an enumeration of this Shape3D node's list of geometry components. |
Appearance |
getAppearance()
Retrieves the appearance component of this shape node. |
boolean |
getAppearanceOverrideEnable()
Retrieves the appearanceOverrideEnable flag for this node. |
Bounds |
getCollisionBounds()
Returns the collision bounding object of this node. |
Geometry |
getGeometry()
Retrieves the geometry component at index 0 from this Shape3D node's list of geometry components. |
Geometry |
getGeometry(int index)
Retrieves the geometry component at the specified index from this Shape3D node's list of geometry components. |
void |
insertGeometry(Geometry geometry,
int index)
Inserts the specified geometry component into this Shape3D node's list of geometry components at the specified index. |
boolean |
intersect(SceneGraphPath path,
PickRay pickRay,
double[] dist)
Check if the geometry component of this shape node under path intersects with the pickShape. |
boolean |
intersect(SceneGraphPath path,
PickShape pickShape)
Check if the geometry component of this shape node under path intersects with the pickShape. |
int |
numGeometries()
Returns the number of geometry components in this Shape3D node's list of geometry components. |
void |
removeGeometry(int index)
Removes the geometry component at the specified index from this Shape3D node's list of geometry components. |
void |
setAppearance(Appearance appearance)
Sets the appearance component of this Shape3D node. |
void |
setAppearanceOverrideEnable(boolean flag)
Sets a flag that indicates whether this node's appearance can be overridden. |
void |
setCollisionBounds(Bounds bounds)
Sets the collision bounds of a node. |
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. |
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. |
Methods inherited from class javax.media.j3d.Node |
cloneTree,
cloneTree,
cloneTree,
cloneTree,
cloneTree,
cloneTree,
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,
updateNodeReferences |
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_GEOMETRY_READ
public static final int ALLOW_GEOMETRY_WRITE
public static final int ALLOW_APPEARANCE_READ
public static final int ALLOW_APPEARANCE_WRITE
public static final int ALLOW_COLLISION_BOUNDS_READ
public static final int ALLOW_COLLISION_BOUNDS_WRITE
public static final int ALLOW_APPEARANCE_OVERRIDE_READ
public static final int ALLOW_APPEARANCE_OVERRIDE_WRITE
Constructor Detail |
public Shape3D()
public Shape3D(Geometry geometry)
geometry
- the geometry component with which to initialize
this shape node.public Shape3D(Geometry geometry, Appearance appearance)
geometry
- the geometry component with which to initialize
this shape nodeappearance
- the appearance component of the shape nodeMethod Detail |
public void setCollisionBounds(Bounds bounds)
bounds
- the collision bounding object for a nodepublic Bounds getCollisionBounds()
public void setGeometry(Geometry geometry)
geometry
- the geometry component to be stored at index 0.public Geometry getGeometry()
public void setGeometry(Geometry geometry, int index)
geometry
- the geometry component to be stored at the
specified index.index
- the index of the geometry component to be replaced.public Geometry getGeometry(int index)
index
- the index of the geometry component to be returned.public void insertGeometry(Geometry geometry, int index)
geometry
- the geometry component to be inserted at the
specified index.index
- the index at which the geometry component is inserted.public void removeGeometry(int index)
index
- the index of the geometry component to be removed.public java.util.Enumeration getAllGeometries()
public void addGeometry(Geometry geometry)
geometry
- the geometry component to be appended.public int numGeometries()
public void setAppearance(Appearance appearance)
appearance
- the new appearance component for this shape nodepublic Appearance getAppearance()
public boolean intersect(SceneGraphPath path, PickShape pickShape)
public boolean intersect(SceneGraphPath path, PickRay pickRay, double[] dist)
public void setAppearanceOverrideEnable(boolean flag)
flag
- the apperance override enable flag.AlternateAppearance
public boolean getAppearanceOverrideEnable()
public Node cloneNode(boolean forceDuplicate)
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; }
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.duplicateNode(javax.media.j3d.Node, boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
public void duplicateNode(Node originalNode, boolean forceDuplicate)
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.
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.Shape3D
Node.cloneTree()
,
Node.cloneNode(boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |