|
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.BaseComponentGeometryNode
An abstract implementation of any node that uses component nodes to provide coordinate, normal and texture information.
| Field Summary | |
protected static int |
ATTRIB_CHANGED
Flag value for the changeFlags color node change |
protected static int |
ATTRIB_INDEX_CHANGED
Flag value for the changeFlags attrib index change |
protected static java.lang.String |
ATTRIB_NODE_MSG
Message for when the node in setValue() is not a vertex attribute |
protected static java.lang.String |
ATTRIB_PROTO_MSG
Message for when the proto is not a vertex attribute |
protected static java.lang.String |
BAD_NODE_MSG
Message for when the node in setValue() is not a Geometry |
protected static java.lang.String |
BAD_PROTO_MSG
Message for when the proto is not a Geometry |
protected int |
changeFlags
Bit-flags to work out what has changed during the last frame |
protected static java.lang.String |
COLOR_NODE_MSG
Message for when the node in setValue() is not a Color |
protected static java.lang.String |
COLOR_PROTO_MSG
Message for when the proto is not a Color |
protected static int |
COLORS_CHANGED
Flag value for the changeFlags color node change |
protected static int |
COLORS_INDEX_CHANGED
Flag value for the changeFlags color index change |
protected static java.lang.String |
COORD_NODE_MSG
Message for when the node in setValue() is not a Coord |
protected static java.lang.String |
COORD_PROTO_MSG
Message for when the proto is not a Coord |
protected static int |
COORDS_CHANGED
Flag value for the changeFlags coordinate node change |
protected static int |
COORDS_INDEX_CHANGED
Flag value for the changeFlags coordinate index change |
protected static int |
FIELD_ATTRIBS
Index of the attribs exposedField |
protected static int |
FIELD_CCW
Index of the ccw field |
protected static int |
FIELD_COLOR
Index of the color exposedField |
protected static int |
FIELD_COLORPERVERTEX
Index of the colorPerVertex field |
protected static int |
FIELD_COORD
Index of the coord exposedField |
protected static int |
FIELD_FOG_COORD
Index of the fogCoord exposedField |
protected static int |
FIELD_NORMAL
Index of the normal exposedField |
protected static int |
FIELD_NORMALPERVERTEX
Index of the normalPerVertex field |
protected static int |
FIELD_SOLID
Index of the solid field |
protected static int |
FIELD_TEXCOORD
Index of the texture exposedField |
protected static int |
FOG_CHANGED
Flag value for the changeFlags color node change |
protected static int |
FOG_INDEX_CHANGED
Flag value for the changeFlags fog index change |
protected static java.lang.String |
FOG_NODE_MSG
Message for when the node in setValue() is not a FogCoordinate |
protected static java.lang.String |
FOG_PROTO_MSG
Message for when the proto is not a FogCoordinate |
protected static int |
LAST_GEOMETRY_INDEX
The last field index used by this class |
protected boolean |
localColors
Should local color node be used for diffuse lighting |
protected java.util.ArrayList |
localColorsListeners
The list of listeners for localColor changes |
protected static int |
NORMALS_CHANGED
Flag value for the changeFlags normal node change |
protected static int |
NORMALS_INDEX_CHANGED
Flag value for the changeFlags normal index change |
protected VRMLProtoInstance |
pColor
Proto version of the color |
protected VRMLProtoInstance |
pCoord
Proto version of the coord |
protected VRMLProtoInstance |
pFogCoord
Proto version of the fogCoord |
protected VRMLProtoInstance |
pNormal
Proto version of the normal |
protected VRMLProtoInstance |
pTexCoord
Proto version of the texCoord |
protected static int |
TEXCOORDS_CHANGED
Flag value for the changeFlags texCoords node change |
protected static int |
TEXCOORDS_INDEX_CHANGED
Flag value for the changeFlags texCoords index change |
protected java.util.ArrayList |
vfAttribs
List of per-vertex attribute nodes provided |
protected boolean |
vfCcw
field SFBool ccw TRUE |
protected VRMLColorNodeType |
vfColor
exposedField SFNode color |
protected boolean |
vfColorPerVertex
field SFBool colorPerVertex TRUE |
protected VRMLCoordinateNodeType |
vfCoord
exposedField SFNode coord |
protected VRMLGeometricPropertyNodeType |
vfFogCoord
exposedField SFNode fogCoord |
protected VRMLNormalNodeType |
vfNormal
exposedField SFNode normal |
protected boolean |
vfNormalPerVertex
field SFBool normalPerVertex TRUE |
protected boolean |
vfSolid
field SFBool solid TRUE |
protected VRMLTextureCoordinateNodeType |
vfTexCoord
exposedField SFNode texCoord |
| Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode |
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 | |
protected |
BaseComponentGeometryNode(java.lang.String name)
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 | |
void |
addLocalColorsListener(LocalColorsListener l)
Add a listener for local color changes. |
void |
addTexCoordGenModeChanged(TexCoordGenModeListener l)
Add a listener for texture coordinate generation mode changes. |
protected void |
copy(VRMLComponentGeometryNodeType node)
Set the fields of the binadble node that has the fields set based on the fields of the passed in node. |
protected void |
fireLocalColorsChanged(boolean enabled)
Send the localColorsChanged event to LocalColorsListeners |
VRMLNodeType[] |
getComponents()
Get the components that compose a geometry object. |
VRMLFieldData |
getFieldValue(int index)
Get the value of a field. |
int |
getNumSets()
Get the number of texture coordinate sets contained by this node |
int |
getPrimaryType()
Get the primary type of this node. |
java.lang.String |
getTexCoordGenMode(int setNum)
Get the texture coordinate generation mode. |
boolean |
hasColorPerVertex()
Check to see if the colors are per vertex or per face. |
boolean |
hasLocalColors()
Specified whether this node has color information. |
boolean |
hasNormalPerVertex()
Check to see if the normals are per vertex or per face. |
boolean |
isCCW()
Get the value of the CCW field. |
boolean |
isLightingEnabled()
Specifies whether this node requires lighting. |
boolean |
isSolid()
Get the value of the solid field. |
void |
removeLocalColorsListener(LocalColorsListener l)
Remove a listener for local color changes. |
void |
removeTexCoordGenModeChanged(TexCoordGenModeListener l)
Remove a listener for texture coordinate generation mode changes. |
void |
sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
Send a routed value from this node to the given destination node. |
protected void |
setColorNode(VRMLColorNodeType node)
Notification of the color node being set. |
void |
setComponent(VRMLNodeType comp)
Set a component that composes part of a geometry object. |
void |
setComponents(VRMLNodeType[] comps)
Set the components the compose a geometry object. |
protected void |
setCoordinateNode(VRMLCoordinateNodeType node)
Notification of the coordinate node being set. |
protected void |
setFogCoordinateNode(VRMLGeometricPropertyNodeType node)
Notification of the coordinate node being set. |
protected void |
setNormalNode(VRMLNormalNodeType node)
Notification of the normal node being set. |
protected void |
setTexCoordNode(VRMLTextureCoordinateNodeType node)
Notification of the texture coordinate node being set. |
void |
setupFinished()
Notification that the construction phase of this node has finished. |
void |
setValue(int index,
boolean value)
Set the value of the field at the given index as an boolean. |
void |
setValue(int index,
VRMLNodeType child)
Set the value of the field at the given index as a node. |
| 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, setUserData, 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.VRMLNodeType |
addNodeListener, getMetadataObject, getRefCount, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setFrameStateManager, setMetadataObject, 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 |
| Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeComponentListener |
fieldChanged |
| Field Detail |
protected static final int FIELD_COORD
protected static final int FIELD_COLOR
protected static final int FIELD_NORMAL
protected static final int FIELD_TEXCOORD
protected static final int FIELD_SOLID
protected static final int FIELD_CCW
protected static final int FIELD_COLORPERVERTEX
protected static final int FIELD_NORMALPERVERTEX
protected static final int FIELD_FOG_COORD
protected static final int FIELD_ATTRIBS
protected static final int LAST_GEOMETRY_INDEX
protected static final int COORDS_CHANGED
protected static final int NORMALS_CHANGED
protected static final int TEXCOORDS_CHANGED
protected static final int COLORS_CHANGED
protected static final int FOG_CHANGED
protected static final int ATTRIB_CHANGED
protected static final int COORDS_INDEX_CHANGED
protected static final int NORMALS_INDEX_CHANGED
protected static final int TEXCOORDS_INDEX_CHANGED
protected static final int COLORS_INDEX_CHANGED
protected static final int FOG_INDEX_CHANGED
protected static final int ATTRIB_INDEX_CHANGED
protected static final java.lang.String BAD_PROTO_MSG
protected static final java.lang.String BAD_NODE_MSG
protected static final java.lang.String COORD_PROTO_MSG
protected static final java.lang.String COORD_NODE_MSG
protected static final java.lang.String COLOR_PROTO_MSG
protected static final java.lang.String COLOR_NODE_MSG
protected static final java.lang.String FOG_PROTO_MSG
protected static final java.lang.String FOG_NODE_MSG
protected static final java.lang.String ATTRIB_PROTO_MSG
protected static final java.lang.String ATTRIB_NODE_MSG
protected VRMLProtoInstance pColor
protected VRMLColorNodeType vfColor
protected VRMLProtoInstance pCoord
protected VRMLCoordinateNodeType vfCoord
protected VRMLProtoInstance pNormal
protected VRMLNormalNodeType vfNormal
protected VRMLProtoInstance pTexCoord
protected VRMLTextureCoordinateNodeType vfTexCoord
protected VRMLProtoInstance pFogCoord
protected VRMLGeometricPropertyNodeType vfFogCoord
protected boolean vfColorPerVertex
protected boolean vfNormalPerVertex
protected boolean vfSolid
protected boolean vfCcw
protected int changeFlags
protected java.util.ArrayList vfAttribs
protected boolean localColors
protected java.util.ArrayList localColorsListeners
| Constructor Detail |
protected BaseComponentGeometryNode(java.lang.String name)
name - The name of the type of node| Method Detail |
public boolean hasLocalColors()
hasLocalColors in interface VRMLGeometryNodeTypepublic void addLocalColorsListener(LocalColorsListener l)
addLocalColorsListener in interface VRMLGeometryNodeTypel - The listener.public void removeLocalColorsListener(LocalColorsListener l)
removeLocalColorsListener in interface VRMLGeometryNodeTypel - The listener.public void addTexCoordGenModeChanged(TexCoordGenModeListener l)
addTexCoordGenModeChanged in interface VRMLGeometryNodeTypel - The listener.public void removeTexCoordGenModeChanged(TexCoordGenModeListener l)
removeTexCoordGenModeChanged in interface VRMLGeometryNodeTypel - The listener.public int getNumSets()
getNumSets in interface VRMLGeometryNodeTypepublic java.lang.String getTexCoordGenMode(int setNum)
getTexCoordGenMode in interface VRMLGeometryNodeTypesetNum - The set which this tex gen mode refers
protected void copy(VRMLComponentGeometryNodeType node)
node - The bindable node to copy info frompublic boolean isSolid()
isSolid in interface VRMLGeometryNodeTypepublic boolean isCCW()
isCCW in interface VRMLGeometryNodeTypepublic boolean isLightingEnabled()
isLightingEnabled in interface VRMLGeometryNodeTypepublic VRMLNodeType[] getComponents()
This method will return either VRMLGeometricPropertyNodeType or VRMLProtoInstance. With a proto you can use getImplementationNode to get a node conforming to the VRMLGeometricPropertyNodeType interface.
If there are no components then a zero length array will be returned.
getComponents in interface VRMLComponentGeometryNodeType
public void setComponents(VRMLNodeType[] comps)
throws InvalidFieldValueException
setComponents in interface VRMLComponentGeometryNodeTypecomps - An array of geometric properties
InvalidFieldValueException - The node is not a known or supported
field for this node
public void setComponent(VRMLNodeType comp)
throws InvalidFieldValueException
setComponent in interface VRMLComponentGeometryNodeTypecomp - A geometric property
InvalidFieldValueException - The node is not a known or supported
field for this nodepublic boolean hasColorPerVertex()
hasColorPerVertex in interface VRMLComponentGeometryNodeTypepublic boolean hasNormalPerVertex()
hasNormalPerVertex in interface VRMLComponentGeometryNodeTypepublic int getPrimaryType()
getPrimaryType in interface VRMLNodepublic void setupFinished()
setupFinished in interface VRMLNodeTypesetupFinished in class AbstractNode
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,
boolean value)
throws InvalidFieldException,
InvalidFieldValueException
setValue in interface VRMLNodeTypesetValue in class AbstractNodeindex - The index of destination field to setvalue - The new value to use for the node
InvalidFieldException - The field index is not know
InvalidFieldValueException - The value provided is out of range
for the field type.
public void setValue(int index,
VRMLNodeType child)
throws InvalidFieldException,
InvalidFieldValueException
setValue in interface VRMLNodeTypesetValue in class AbstractNodeindex - The index of destination field to setchild - The new value to use for the node
InvalidFieldException - The field index is not known
InvalidFieldValueException - The node does not match the required
type.protected void setCoordinateNode(VRMLCoordinateNodeType node)
node - The node to useprotected void setColorNode(VRMLColorNodeType node)
node - The node to useprotected void setNormalNode(VRMLNormalNodeType node)
node - The node to useprotected void setTexCoordNode(VRMLTextureCoordinateNodeType node)
node - The node to useprotected void setFogCoordinateNode(VRMLGeometricPropertyNodeType node)
node - The node to useprotected void fireLocalColorsChanged(boolean enabled)
enabled - Whether local colors are used.
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||