|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseInterpolatorNode
Abstract implementation of an interpolator so that specific instances can derive from it.
Interpolator nodes are designed for linear keyframed animation. Interpolators are driven by an input key and produce corresponding piecewise-linear output functions.
As interpolators all have the same number and named fields, we perform all of the setup here in this class. The handling of the basic fields are performed where you see the overridden methods, however routing and sets are not looked after.
| Field Summary | |
protected static int |
FIELD_FRACTION
The field index for fraction |
protected static int |
FIELD_KEY
The field index for key |
protected static int |
FIELD_KEY_VALUE
The field index for keyValue |
protected static int |
FIELD_VALUE
The field index for value |
protected static int |
LAST_INTERPOLATOR_INDEX
The last field index used by this class |
protected int |
numKey
The number of valid values in vfKey |
protected float |
vfFraction
The value of the fraction field |
protected float[] |
vfKey
The value of the key field |
| Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode |
BAD_NODE_MSG, errorReporter, FIELD_METADATA, fieldData, hasChanged, INIT_ONLY_WRITE_MSG, inSetup, isDEF, isStatic, LAST_NODE_INDEX, METADATA_NODE_MSG, METADATA_PROTO_MSG, nodeName, pMetadata, refCount, stateManager, vfMetadata, vrmlMajorVersion, vrmlMinorVersion |
| Constructor Summary | |
BaseInterpolatorNode(java.lang.String name)
Initialise the time dependent node and it's fields that are held locally. |
|
| Method Summary | |
protected void |
copy(VRMLInterpolatorNodeType node)
Set the fields of the interpolator node that has the fields set based on the fields of the passed in node. |
VRMLFieldData |
getFieldValue(int index)
Get the value of a field. |
float |
getFraction()
Get the value of the fraction field. |
float[] |
getKey()
Get current value of key field value. |
int |
getNumKey()
Get the number of valid keys defined for this interpolator. |
int |
getPrimaryType()
Get the primary type of this node. |
void |
sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
Send a routed value from this node to the given destination node. |
void |
setKey(float[] keys,
int numValid)
Set a new value for the key field. |
void |
setValue(int index,
float[] value,
int numValid)
Set the value of the field as an array of floats. |
| Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode |
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, fireFieldChanged, getMetadataObject, getNodeFieldIndices, getRefCount, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setupFinished, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, updateRefCount |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.web3d.vrml.nodes.VRMLInterpolatorNodeType |
setFraction |
| Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType |
addNodeListener, getMetadataObject, getRefCount, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount |
| Methods inherited from interface org.web3d.vrml.lang.VRMLNode |
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion |
| Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener |
allEventsComplete |
| Field Detail |
protected static final int FIELD_KEY
protected static final int FIELD_KEY_VALUE
protected static final int FIELD_FRACTION
protected static final int FIELD_VALUE
protected static final int LAST_INTERPOLATOR_INDEX
protected float vfFraction
protected float[] vfKey
protected int numKey
| Constructor Detail |
public BaseInterpolatorNode(java.lang.String name)
name - The name of the type of node| Method Detail |
protected void copy(VRMLInterpolatorNodeType node)
node - The interpolator node to copy info frompublic int getPrimaryType()
getPrimaryType in interface VRMLNodepublic float getFraction()
getFraction in interface VRMLInterpolatorNodeTypepublic float[] getKey()
getKey in interface VRMLInterpolatorNodeTypepublic int getNumKey()
getNumKey in interface VRMLInterpolatorNodeType
public void setKey(float[] keys,
int numValid)
setKey in interface VRMLInterpolatorNodeTypekeys - The new key values to usenumValid - The number of valid values to copy from the array
public VRMLFieldData getFieldValue(int index)
throws InvalidFieldException
getFieldValue in interface VRMLNodeTypegetFieldValue in class AbstractNodeindex - The index of the field to change.
InvalidFieldException - The field index is not known
public void sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
sendRoute in interface VRMLNodeTypesendRoute in class AbstractNodetime - The time that this route occurred (not necessarily epoch
time. Should be treated as a relative value only)srcIndex - The index of the field in this node that the value
should be sent fromdestNode - The node reference that we will be sending the value todestIndex - The index of the field in the destination node that
the value should be sent to.
public void setValue(int index,
float[] value,
int numValid)
throws InvalidFieldFormatException,
InvalidFieldException,
InvalidFieldValueException
setValue in interface VRMLNodeTypesetValue in class AbstractNodeindex - The index of destination field to setvalue - The raw value string to be parsednumValid - The number of valid values to copy from the array
InvalidFieldFormatException - The string was not in a correct form
for this field.
InvalidFieldValueException - The value provided is out of range
for the field type.
InvalidFieldException - The field index is not known
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||