public class Morph extends Leaf
The following restrictions apply to each GeometryArray object in the specified array of GeometryArray objects:
For IndexedGeometryArray objects, the vertex arrays are morphed before the indexes are applied. Only the indexes in the first geometry array (geometry[0]) are used when rendering the geometry.
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_APPEARANCE_OVERRIDE_READ
Deprecated.
Specifies that this node allows reading its appearance override
enable flag.
|
static int |
ALLOW_APPEARANCE_OVERRIDE_WRITE
Deprecated.
Specifies that this node allows writing its appearance override
enable flag.
|
static int |
ALLOW_APPEARANCE_READ
Deprecated.
Specifies that the node allows read access to its appearance information.
|
static int |
ALLOW_APPEARANCE_WRITE
Deprecated.
Specifies that the node allows write access to its appearance information.
|
static int |
ALLOW_COLLISION_BOUNDS_READ
Deprecated.
Specifies that the node allows reading its collision Bounds.
|
static int |
ALLOW_COLLISION_BOUNDS_WRITE
Deprecated.
Specifies the node allows writing its collision Bounds.
|
static int |
ALLOW_GEOMETRY_ARRAY_READ
Deprecated.
Specifies that the node allows read access to its geometry information.
|
static int |
ALLOW_GEOMETRY_ARRAY_WRITE
Deprecated.
Specifies that the node allows write access to its geometry information.
|
static int |
ALLOW_WEIGHTS_READ
Deprecated.
Specifies that the node allows read access to its morph
weight vector.
|
static int |
ALLOW_WEIGHTS_WRITE
Deprecated.
Specifies that the node allows write access to its morph
weight vector.
|
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_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
Constructor and Description |
---|
Morph(GeometryArray[] geometryArrays)
Deprecated.
Constructs and initializes a Morph node with the specified array
of GeometryArray objects.
|
Morph(GeometryArray[] geometryArrays,
Appearance appearance)
Deprecated.
Constructs and initializes a Morph node with the specified array
of GeometryArray objects and the specified appearance object.
|
Modifier and Type | Method and Description |
---|---|
Node |
cloneNode(boolean forceDuplicate)
Deprecated.
Creates a new instance of the node.
|
void |
duplicateNode(Node originalNode,
boolean forceDuplicate)
Deprecated.
Copies all node information from
originalNode into
the current node. |
Appearance |
getAppearance()
Deprecated.
Retrieves the appearance component of this morph node.
|
boolean |
getAppearanceOverrideEnable()
Deprecated.
Retrieves the appearanceOverrideEnable flag for this node.
|
Bounds |
getCollisionBounds()
Deprecated.
Returns the collision bounding object of this node.
|
GeometryArray |
getGeometryArray(int index)
Deprecated.
Retrieves the geometryArray component of this Morph node.
|
double[] |
getWeights()
Deprecated.
Retrieves the Morph node's morph weight vector.
|
boolean |
intersect(SceneGraphPath path,
PickRay pickRay,
double[] dist)
Deprecated.
Checks whether the geometry in this morph node intersects with
the specified pickRay.
|
boolean |
intersect(SceneGraphPath path,
PickShape pickShape)
Deprecated.
Checks whether the geometry in this morph node intersects with
the specified pickShape.
|
boolean |
intersect(SceneGraphPath path,
PickShape pickShape,
double[] dist)
Deprecated.
Checks whether the geometry in this morph node intersects with
the specified pickShape.
|
void |
setAppearance(Appearance appearance)
Deprecated.
Sets the appearance component of this Morph node.
|
void |
setAppearanceOverrideEnable(boolean flag)
Deprecated.
Sets a flag that indicates whether this node's appearance can
be overridden.
|
void |
setCollisionBounds(Bounds bounds)
Deprecated.
Sets the collision bounds of a node.
|
void |
setGeometryArrays(GeometryArray[] geometryArrays)
Deprecated.
Sets the geometryArrays component of the Morph node.
|
void |
setWeights(double[] weights)
Deprecated.
Sets this Morph node's morph weight vector.
|
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
public static final int ALLOW_GEOMETRY_ARRAY_READ
public static final int ALLOW_GEOMETRY_ARRAY_WRITE
public static final int ALLOW_APPEARANCE_READ
public static final int ALLOW_APPEARANCE_WRITE
public static final int ALLOW_WEIGHTS_READ
public static final int ALLOW_WEIGHTS_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
public Morph(GeometryArray[] geometryArrays)
A null appearance object specifies that default values are used for all appearance attributes.
geometryArrays
- the geometry components of the morph;
a null or zero-length array of GeometryArray objects is
permitted, and specifies that no geometry is drawn. In this case,
the array of weights is initialized to a zero-length array.IllegalArgumentException
- if any of the specified
geometry array objects differ from each other in any of the
following ways:
UnsupportedOperationException
- if the specified
geometry arrays contain vertex attributes (that is, if their
vertexFormat includes the VERTEX_ATTRIBUTES
flag).public Morph(GeometryArray[] geometryArrays, Appearance appearance)
geometryArrays
- the geometry components of the Morph node
a null or zero-length array of GeometryArray objects is
permitted, and specifies that no geometry is drawn. In this case,
the array of weights is initialized to a zero-length array.appearance
- the appearance component of the Morph nodeIllegalArgumentException
- if any of the specified
geometry array objects differ from each other in any of the
following ways:
UnsupportedOperationException
- if the specified
geometry arrays contain vertex attributes (that is, if their
vertexFormat includes the VERTEX_ATTRIBUTES
flag).public void setCollisionBounds(Bounds bounds)
bounds
- the collision bounding object for a nodeCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic Bounds getCollisionBounds()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setGeometryArrays(GeometryArray[] geometryArrays)
geometryArrays
- the new geometryArrays component
for the Morph node.CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
IllegalArgumentException
- if the length of the
specified array of geometry arrays is not equal to the length
of this Morph node's current array of geometry arrays (and the
current array's length is non-zero), or if any of the specified
geometry array objects differ from each other in any of the
following ways:
UnsupportedOperationException
- if the specified
geometry arrays contain vertex attributes (that is, if their
vertexFormat includes the VERTEX_ATTRIBUTES
flag).public GeometryArray getGeometryArray(int index)
index
- the index of GeometryArray to be returnedCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setAppearance(Appearance appearance)
appearance
- the new appearance component for this Morph nodeCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic Appearance getAppearance()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic boolean intersect(SceneGraphPath path, PickShape pickShape)
path
- the SceneGraphPath to this morph nodepickShape
- the PickShape to be intersectedIllegalArgumentException
- if pickShape is a PickPoint.
Java 3D doesn't have spatial information of the surface.
Use PickBounds with BoundingSphere and a small radius, instead.CapabilityNotSetException
- if the Geometry.ALLOW_INTERSECT
capability bit is not set in all of the Geometry objects
referred to by this morph node.public boolean intersect(SceneGraphPath path, PickRay pickRay, double[] dist)
path
- the SceneGraphPath to this morph nodepickRay
- the PickRay to be intersecteddist
- the closest distance of the intersectionCapabilityNotSetException
- if the Geometry.ALLOW_INTERSECT
capability bit is not set in all of the Geometry objects
referred to by this morph node.public boolean intersect(SceneGraphPath path, PickShape pickShape, double[] dist)
path
- the SceneGraphPath to this morph nodepickShape
- the PickShape to be intersecteddist
- the closest distance of the intersectionIllegalArgumentException
- if pickShape is a PickPoint.
Java 3D doesn't have spatial information of the surface.
Use PickBounds with BoundingSphere and a small radius, instead.CapabilityNotSetException
- if the Geometry.ALLOW_INTERSECT
capability bit is not set in all of the Geometry objects
referred to by this morph node.public void setWeights(double[] weights)
weights
parameter must be equal to the length
of the array with which this Morph node was created, otherwise
an IllegalArgumentException is thown.weights
- the morph weight vector that the morph node will
use in combining the node's geometryArrays. The morph node will "weight"
the corresponding GeometryArray by the amount specified.
N.B.: the sum of the weights should equal 1.0CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphIllegalArgumentException
- if sum of all 'weights' is
NOT 1.0 or number of weights is NOT exqual to number of GeometryArrays.public double[] getWeights()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setAppearanceOverrideEnable(boolean flag)
flag
- the apperance override enable flagCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphAlternateAppearance
public boolean getAppearanceOverrideEnable()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic Node cloneNode(boolean forceDuplicate)
cloneTree
to duplicate the current node.cloneNode
in class 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(org.scijava.java3d.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.
duplicateNode
in class Node
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.ClassCastException
- if originalNode is not an instance of
Morph
Node.cloneTree()
,
Node.cloneNode(boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
Copyright © 2016–2022 SciJava. All rights reserved.