Class OGLIndexedLineSet
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener
,VRMLNode
,FrameStateListener
,VRMLComponentGeometryNodeType
,VRMLGeometryNodeType
,VRMLNodeComponentListener
,VRMLNodeType
,OGLGeometryNodeType
,OGLVRMLNode
The point set directly maps to Aviatrix3D's LineArray class. When the coordinates change to a different length than the current set, it will notify the geometry listener to fetch the new information.
If the VRML file did not provide a Coordinate node, then this class will
not present any geometry from the getGeometry()
or
getSceneGraphObject()
calls. If the user later specifies the
renderety through an event, the listener(s) will be notified.
In this implementation, if the length of the color array is shorter than the length of the coordinate array, colors will be ignored.
- Version:
- $Revision: 1.18 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseIndexedGeometryNode
FIELD_COLORINDEX, FIELD_COORDINDEX, FIELD_NORMALINDEX, FIELD_SET_COLORINDEX, FIELD_SET_COORDINDEX, FIELD_SET_NORMALINDEX, FIELD_SET_TEXCOORDINDEX, FIELD_TEXCOORDINDEX, LAST_INDEXEDGEOMETRY_INDEX, NORMAL_NODE_MSG, NORMAL_PROTO_MSG, numColorIndex, numCoordIndex, numNormalIndex, numTexCoordIndex, TEXCOORD_NODE_MSG, TEXCOORD_PROTO_MSG, vfColorIndex, vfCoordIndex, vfNormalIndex, vfTexCoordIndex
Fields 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
ConstructorsConstructorDescriptionConstruct a new point set instance that contains no child nodes.Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Notification that the rendering of the event model is complete and that rendering is about to begin.void
fieldChanged
(VRMLNodeType node, int index) Notification that the field from the node has changed.org.j3d.aviatrix3d.Geometry
Returns a OGL Geometry node that represents this piece of geometry.int
Get the number of texture coordinate sets contained by this nodeorg.j3d.aviatrix3d.SceneGraphObject
Get the Java3D scene graph object representation of this node.getTexCoordGenMode
(int setNum) Get the texture coordinate generation mode.void
notifyExternProtoLoaded
(int index, VRMLNodeType node) Notify a node that an ExternProto has resolved.boolean
Check to see if this geometry implementation type requires unlit color values to be set.protected void
setColorIndex
(int[] value, int numValid) Set the colorIndex field.protected void
Notification of the color node being set.protected void
Notification of the coordinate node being set.protected void
setCoordIndex
(int[] value, int numValid) Set the coordIndex field.void
setUnlitColor
(float[] color) Set the local colour override for this geometry.void
Notification that the construction phase of this node has finished.void
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.void
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.Methods inherited from class org.web3d.vrml.renderer.common.nodes.render.BaseIndexedLineSet
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, isLightingEnabled
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseIndexedGeometryNode
copy, getFieldValue, sendRoute, setNormalIndex, setTexCoordIndex, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseComponentGeometryNode
addLocalColorsListener, addTexCoordGenModeChanged, fireLocalColorsChanged, getComponents, getPrimaryType, hasColorPerVertex, hasLocalColorAlpha, hasLocalColors, hasNormalPerVertex, isCCW, isSolid, removeLocalColorsListener, removeTexCoordGenModeChanged, setComponent, setComponents, setFogCoordinateNode, setNormalNode, setTexCoordNode, setTextureCount, setValue, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, 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.VRMLGeometryNodeType
addLocalColorsListener, addTexCoordGenModeChanged, hasLocalColorAlpha, hasLocalColors, isCCW, isLightingEnabled, isSolid, removeLocalColorsListener, removeTexCoordGenModeChanged, setTextureCount
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLIndexedLineSet
public OGLIndexedLineSet()Construct a new point set instance that contains no child nodes. -
OGLIndexedLineSet
Construct a new instance of this node based on the details from the given node. If the node is not the same type, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- Incorrect Node Type
-
-
Method Details
-
getGeometry
public org.j3d.aviatrix3d.Geometry getGeometry()Description copied from interface:OGLGeometryNodeType
Returns a OGL Geometry node that represents this piece of geometry. If no geometry is available, then return null.- Specified by:
getGeometry
in interfaceOGLGeometryNodeType
- Returns:
- The geometry needed to represent this object
-
getNumSets
public int getNumSets()Get the number of texture coordinate sets contained by this node- Specified by:
getNumSets
in interfaceVRMLGeometryNodeType
- Overrides:
getNumSets
in classBaseComponentGeometryNode
- Returns:
- the number of texture coordinate sets
-
getTexCoordGenMode
Get the texture coordinate generation mode. NULL is returned if the texture coordinates are not generated.- Specified by:
getTexCoordGenMode
in interfaceVRMLGeometryNodeType
- Overrides:
getTexCoordGenMode
in classBaseComponentGeometryNode
- Parameters:
setNum
- The set which this tex gen mode refers- Returns:
- The mode or NULL
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the Java3D scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OGL representation.
-
notifyExternProtoLoaded
Description copied from interface:VRMLNodeType
Notify a node that an ExternProto has resolved. This will verify the objects type and add it to the render sceneGraph.- Specified by:
notifyExternProtoLoaded
in interfaceVRMLNodeType
- Overrides:
notifyExternProtoLoaded
in classAbstractNode
- Parameters:
index
- The field indexnode
- The node resolved- Throws:
InvalidFieldValueException
- If the proto contains he wrong type
-
setupFinished
public void setupFinished()Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.- Specified by:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classBaseComponentGeometryNode
-
fieldChanged
Notification that the field from the node has changed.- Specified by:
fieldChanged
in interfaceVRMLNodeComponentListener
- Overrides:
fieldChanged
in classBaseIndexedLineSet
- Parameters:
node
- The component node that changedindex
- The index of the field that has changed
-
requiresUnlitColor
public boolean requiresUnlitColor()Check to see if this geometry implementation type requires unlit color values to be set. For the most part this will always return false, but some will need it (points and lines). This value should be constant for the geometry regardless of whether a Color component has been provided or not. It is up to the implementation to decide when to pass these values on to the underlying rendering structures or not.The default implementation returns false. Override if different behaviour is needed.
- Specified by:
requiresUnlitColor
in interfaceVRMLComponentGeometryNodeType
- Overrides:
requiresUnlitColor
in classBaseComponentGeometryNode
- Returns:
- true if we need unlit colour information
-
setUnlitColor
public void setUnlitColor(float[] color) Set the local colour override for this geometry. Typically used to set the emissiveColor from the Material node into the geometry for the line and point-type geometries which are unlit in the X3D/VRML model.The default implementation does nothing. Override to do something useful.
- Specified by:
setUnlitColor
in interfaceVRMLComponentGeometryNodeType
- Overrides:
setUnlitColor
in classBaseComponentGeometryNode
- Parameters:
color
- The colour value to use
-
setCoordinateNode
Notification of the coordinate node being set. If the passed value is null then that clears the node. The node passed is the actual geometry, not any proto wrapper, that will have been previously stripped. The default implementation does nothing.- Overrides:
setCoordinateNode
in classBaseComponentGeometryNode
- Parameters:
node
- The node to use
-
setColorNode
Notification of the color node being set. If the passed value is null then that clears the node. The node passed is the actual color, not any proto wrapper, that will have been previously stripped. The default implementation does nothing.- Overrides:
setColorNode
in classBaseComponentGeometryNode
- Parameters:
node
- The node to use
-
allEventsComplete
public void allEventsComplete()Notification that the rendering of the event model is complete and that rendering is about to begin. Used to update the j3d representation only once per frame.- Specified by:
allEventsComplete
in interfaceFrameStateListener
- Overrides:
allEventsComplete
in classAbstractNode
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
updateNodeDataChanges
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.- Specified by:
updateNodeDataChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
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.- Overrides:
setCoordIndex
in classBaseIndexedGeometryNode
- Parameters:
value
- The array of 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.- Overrides:
setColorIndex
in classBaseIndexedGeometryNode
- Parameters:
value
- The new valuenumValid
- The number of valid indices in the array
-