Class BaseIndexedGeometryNode
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseComponentGeometryNode
org.web3d.vrml.renderer.common.nodes.BaseIndexedGeometryNode
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLComponentGeometryNodeType
,VRMLGeometryNodeType
,VRMLNodeComponentListener
,VRMLNodeType
- Direct Known Subclasses:
BaseIndexedFaceSet
,BaseIndexedLineSet
An abstract implementation of any node that uses component nodes to provide
coordinate, normal and texture information.
This includes normal and texture indexes. These may not be needed by some implementations like IndexedLineSet. Just don't define the fields in the static setup.
- Version:
- $Revision: 1.16 $
- Author:
- Justin Couch, Alan Hudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
Index of the colorIndex MFInt32 fieldprotected static final int
Index of the coordIndex SFInt32 fieldprotected static final int
Index of the normalIndex SFInt32 fieldprotected static final int
Index of the set_colorIndex MFInt32 eventInprotected static final int
Index of the set_coordIndex SFInt32 eventInprotected static final int
Index of the set_normalIndex SFInt32 eventInprotected static final int
Index of the set_texCoordIndex SFInt32 fieldprotected static final int
Index of the texCoordIndex SFInt32 fieldprotected static final int
The last field index used by this classprotected static final String
Message for when the node in setValue() is not a Normalprotected static final String
Message for when the proto is not a Normalprotected int
Number of valid values in vfColorIndexprotected int
Number of valid values in vfColorIndexprotected int
Number of valid values in vfColorIndexprotected int
Number of valid values in vfColorIndexprotected static final String
Message for when the node in setValue() is not a TexCoordprotected static final String
Message for when the proto is not a TexCoordprotected int[]
field MFInt32 colorIndexprotected int[]
field MFInt32 coordIndexprotected int[]
field MFInt32 normalIndexprotected int[]
field MFInt32 texCoordIndexFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseComponentGeometryNode
ATTRIB_CHANGED, ATTRIB_INDEX_CHANGED, ATTRIB_NODE_MSG, ATTRIB_PROTO_MSG, BAD_NODE_MSG, BAD_PROTO_MSG, changeFlags, COLOR_NODE_MSG, COLOR_PROTO_MSG, COLORS_CHANGED, COLORS_INDEX_CHANGED, COORD_NODE_MSG, COORD_PROTO_MSG, COORDS_CHANGED, COORDS_INDEX_CHANGED, FIELD_ATTRIBS, FIELD_CCW, FIELD_COLOR, FIELD_COLORPERVERTEX, FIELD_COORD, FIELD_FOG_COORD, FIELD_NORMAL, FIELD_NORMALPERVERTEX, FIELD_SOLID, FIELD_TEXCOORD, FOG_CHANGED, FOG_INDEX_CHANGED, FOG_NODE_MSG, FOG_PROTO_MSG, LAST_GEOMETRY_INDEX, localColors, localColorsListeners, NORMALS_CHANGED, NORMALS_INDEX_CHANGED, pColor, pCoord, pFogCoord, pNormal, pTexCoord, TEXCOORDS_CHANGED, TEXCOORDS_INDEX_CHANGED, UNLIT_COLORS_CHANGED, VBO_MIN_VERTICES, vfAttribs, vfCcw, vfColor, vfColorPerVertex, vfCoord, vfFogCoord, vfNormal, vfNormalPerVertex, vfSolid, vfTexCoord
Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Construct a default instance of this class with the bind flag set to false and no time information set (effective value of zero). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Set the fields of the binadble node that has the fields set based on the fields of the passed in node.getFieldValue
(int index) Get the value of a field.void
sendRoute
(double time, int srcIndex, VRMLNodeType destNode, int destIndex) Send a routed value from this node to the given destination node.protected void
setColorIndex
(int[] value, int numValid) Set the colorIndex field.protected void
setCoordIndex
(int[] value, int numValid) Set the coordIndex field.protected void
setNormalIndex
(int[] value, int numValid) Set the normalIndex field.protected void
setTexCoordIndex
(int[] value, int numValid) Set the texCoordIndex field.void
setValue
(int index, int[] value, int numValid) Set the value of the field at the given index as an array of integers.Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseComponentGeometryNode
addLocalColorsListener, addTexCoordGenModeChanged, fireLocalColorsChanged, getComponents, getNumSets, getPrimaryType, getTexCoordGenMode, hasColorPerVertex, hasLocalColorAlpha, hasLocalColors, hasNormalPerVertex, isCCW, isLightingEnabled, isSolid, removeLocalColorsListener, removeTexCoordGenModeChanged, requiresUnlitColor, setColorNode, setComponent, setComponents, setCoordinateNode, setFogCoordinateNode, setNormalNode, setTexCoordNode, setTextureCount, setUnlitColor, setupFinished, setValue, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefs
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.FrameStateListener
allEventsComplete
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.VRMLNodeComponentListener
fieldChanged
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Field Details
-
FIELD_COLORINDEX
protected static final int FIELD_COLORINDEXIndex of the colorIndex MFInt32 field- See Also:
-
FIELD_SET_COLORINDEX
protected static final int FIELD_SET_COLORINDEXIndex of the set_colorIndex MFInt32 eventIn- See Also:
-
FIELD_COORDINDEX
protected static final int FIELD_COORDINDEXIndex of the coordIndex SFInt32 field- See Also:
-
FIELD_SET_COORDINDEX
protected static final int FIELD_SET_COORDINDEXIndex of the set_coordIndex SFInt32 eventIn- See Also:
-
FIELD_TEXCOORDINDEX
protected static final int FIELD_TEXCOORDINDEXIndex of the texCoordIndex SFInt32 field- See Also:
-
FIELD_SET_TEXCOORDINDEX
protected static final int FIELD_SET_TEXCOORDINDEXIndex of the set_texCoordIndex SFInt32 field- See Also:
-
FIELD_NORMALINDEX
protected static final int FIELD_NORMALINDEXIndex of the normalIndex SFInt32 field- See Also:
-
FIELD_SET_NORMALINDEX
protected static final int FIELD_SET_NORMALINDEXIndex of the set_normalIndex SFInt32 eventIn- See Also:
-
LAST_INDEXEDGEOMETRY_INDEX
protected static final int LAST_INDEXEDGEOMETRY_INDEXThe last field index used by this class- See Also:
-
NORMAL_PROTO_MSG
-
NORMAL_NODE_MSG
Message for when the node in setValue() is not a Normal- See Also:
-
TEXCOORD_PROTO_MSG
Message for when the proto is not a TexCoord- See Also:
-
TEXCOORD_NODE_MSG
Message for when the node in setValue() is not a TexCoord- See Also:
-
vfColorIndex
protected int[] vfColorIndexfield MFInt32 colorIndex -
numColorIndex
protected int numColorIndexNumber of valid values in vfColorIndex -
vfCoordIndex
protected int[] vfCoordIndexfield MFInt32 coordIndex -
numCoordIndex
protected int numCoordIndexNumber of valid values in vfColorIndex -
vfNormalIndex
protected int[] vfNormalIndexfield MFInt32 normalIndex -
numNormalIndex
protected int numNormalIndexNumber of valid values in vfColorIndex -
vfTexCoordIndex
protected int[] vfTexCoordIndexfield MFInt32 texCoordIndex -
numTexCoordIndex
protected int numTexCoordIndexNumber of valid values in vfColorIndex
-
-
Constructor Details
-
BaseIndexedGeometryNode
Construct a default instance of this class with the bind flag set to false and no time information set (effective value of zero).- Parameters:
name
- The name of the type of node
-
-
Method Details
-
copy
Set the fields of the binadble node that has the fields set based on the fields of the passed in node. This directly copies the bind state, so could cause some interesting problems. Not sure what we should do with this currently.- Overrides:
copy
in classBaseComponentGeometryNode
- Parameters:
node
- The bindable node to copy info from
-
getFieldValue
Get the value of a field. If the field is a primitive type, it will return a class representing the value. For arrays or nodes it will return the instance directly.- Specified by:
getFieldValue
in interfaceVRMLNodeType
- Overrides:
getFieldValue
in classBaseComponentGeometryNode
- Parameters:
index
- The index of the field to change.- Returns:
- The class representing the field value
- Throws:
InvalidFieldException
- The field index is not known
-
sendRoute
Send a routed value from this node to the given destination node. The route should use the appropriate setValue() method of the destination node. It should not attempt to cast the node up to a higher level. Routing should also follow the standard rules for the loop breaking and other appropriate rules for the specification.- Specified by:
sendRoute
in interfaceVRMLNodeType
- Overrides:
sendRoute
in classBaseComponentGeometryNode
- Parameters:
time
- 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.
-
setValue
public void setValue(int index, int[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException, InvalidFieldAccessException Set the value of the field at the given index as an array of integers. This would be used to set MFInt32 field types.- Specified by:
setValue
in interfaceVRMLNodeType
- Overrides:
setValue
in classAbstractNode
- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The index does not match a known fieldInvalidFieldValueException
- The value provided is out of range for the field type.InvalidFieldAccessException
- The call is attempting to write to a field that does not permit writing now
-
setCoordIndex
protected void setCoordIndex(int[] value, int numValid) Set the coordIndex field. Override to provide.renderer-specific behaviour, but remember to also call this implementation too.- Parameters:
value
- The list of index values to usenumValid
- The number of valid indices in the array
-
setNormalIndex
protected void setNormalIndex(int[] value, int numValid) Set the normalIndex field. Override to provide.renderer-specific behaviour, but remember to also call this implementation too.- Parameters:
value
- The list of index values to usenumValid
- The number of valid indices in the array
-
setColorIndex
protected void setColorIndex(int[] value, int numValid) Set the colorIndex field. Override to provide.renderer-specific behaviour, but remember to also call this implementation too.- Parameters:
value
- The list of index values to usenumValid
- The number of valid indices in the array
-
setTexCoordIndex
protected void setTexCoordIndex(int[] value, int numValid) Set the texCoordIndex field. Override to provide.renderer-specific behaviour, but remember to also call this implementation too.- Parameters:
value
- The list of index values to usenumValid
- The number of valid indices in the array
-