Class OGLIndexedTriangleSet
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseComponentGeometryNode
org.web3d.vrml.renderer.common.nodes.BaseIndexedTriangleGeometryNode
org.web3d.vrml.renderer.common.nodes.render.BaseIndexedTriangleSet
org.web3d.vrml.renderer.ogl.nodes.render.OGLIndexedTriangleSet
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLComponentGeometryNodeType,VRMLGeometryNodeType,VRMLNodeComponentListener,VRMLNodeType,OGLGeometryNodeType,OGLVRMLNode
public class OGLIndexedTriangleSet
extends BaseIndexedTriangleSet
implements OGLGeometryNodeType, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL implementation of an IndexedTriangleSet.
The point set directly maps to Aviatrix3D's IndexedTriangleArray 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 that the length of the coordinate array, colors will be ignored.
- Version:
- $Revision: 1.19 $
- Author:
- Justin Couch, Alan Hudson
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseIndexedTriangleGeometryNode
FIELD_INDEX, FIELD_SET_INDEX, geomData, LAST_INDEXEDTRIANGLEGEOMETRY_INDEX, NORMAL_NODE_MSG, NORMAL_PROTO_MSG, numIndex, TEXCOORD_NODE_MSG, TEXCOORD_PROTO_MSG, vfIndexFields 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, vfTexCoordFields 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 TypeMethodDescriptionprotected voidBuild the implementation.org.j3d.aviatrix3d.GeometryReturns a OGL Geometry node that represents this piece of geometry.intGet the number of texture coordinate sets contained by this nodeorg.j3d.aviatrix3d.SceneGraphObjectGet the OGL scene graph object representation of this node.getTexCoordGenMode(int setNum) Get the texture coordinate generation mode.booleanisCCW()Get the value of the CCW field.voidsetTextureCount(int count) Set the number of textures that were found on the accompanying Appearance node.voidNotification that its safe to update the node now with any operations that could potentially effect the node's bounds.voidNotification 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.BaseIndexedTriangleSet
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, updateIndexMapsMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseIndexedTriangleGeometryNode
allEventsComplete, copy, fieldChanged, getFieldValue, notifyExternProtoLoaded, sendRoute, setColorNode, setCoordinateNode, setIndex, setNormalNode, setTextureCoordinateNode, setupFinished, setValue, setValue, updateColorArray, updateCoordinateArray, updateNormalArrayMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseComponentGeometryNode
addLocalColorsListener, addTexCoordGenModeChanged, fireLocalColorsChanged, getComponents, getPrimaryType, hasColorPerVertex, hasLocalColorAlpha, hasLocalColors, hasNormalPerVertex, isLightingEnabled, isSolid, removeLocalColorsListener, removeTexCoordGenModeChanged, requiresUnlitColor, setComponent, setComponents, setFogCoordinateNode, setTexCoordNode, setUnlitColor, setValueMethods 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, updateRefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsCompleteMethods inherited from interface org.web3d.vrml.nodes.VRMLGeometryNodeType
addLocalColorsListener, addTexCoordGenModeChanged, hasLocalColorAlpha, hasLocalColors, isLightingEnabled, isSolid, removeLocalColorsListener, removeTexCoordGenModeChangedMethods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersionMethods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLIndexedTriangleSet
public OGLIndexedTriangleSet()Construct a new point set instance that contains no child nodes. -
OGLIndexedTriangleSet
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:OGLGeometryNodeTypeReturns a OGL Geometry node that represents this piece of geometry. If no geometry is available, then return null.- Specified by:
getGeometryin interfaceOGLGeometryNodeType- Returns:
- The geometry needed to represent this object
-
setTextureCount
public void setTextureCount(int count) Set the number of textures that were found on the accompanying Appearance node. Used to set the number of texture coordinates that need to be passed in to the renderer when no explicit texture coordinates were given.- Specified by:
setTextureCountin interfaceVRMLGeometryNodeType- Overrides:
setTextureCountin classBaseComponentGeometryNode- Parameters:
count- The number of texture coordinate sets to add
-
getNumSets
public int getNumSets()Get the number of texture coordinate sets contained by this node- Specified by:
getNumSetsin interfaceVRMLGeometryNodeType- Overrides:
getNumSetsin 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:
getTexCoordGenModein interfaceVRMLGeometryNodeType- Overrides:
getTexCoordGenModein 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 OGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used.- Specified by:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OGL representation.
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChangesin 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:
updateNodeDataChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
buildImpl
protected void buildImpl()Build the implementation. May have to change underlying Aviatrix3D representation if the normal node changes.- Specified by:
buildImplin classBaseIndexedTriangleGeometryNode
-
isCCW
public boolean isCCW()Get the value of the CCW field.- Specified by:
isCCWin interfaceVRMLGeometryNodeType- Overrides:
isCCWin classBaseComponentGeometryNode- Returns:
- true Vertices are declared in counter-clockwise order
-