Class OGLExtrusion
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.geom3d.BaseExtrusion
org.web3d.vrml.renderer.ogl.nodes.geom3d.OGLExtrusion
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,VRMLGeometryNodeType,VRMLNodeType,OGLGeometryNodeType,OGLVRMLNode
public class OGLExtrusion
extends BaseExtrusion
implements OGLGeometryNodeType, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL implGeomementation of an Extrusion
The 1.16 version of OGLExtrusion generates end caps correctly for both convex and concave crossSections. More thorough testing is needed to see if textures are handled properly, however.
- Version:
- $Revision: 1.20 $
- Author:
- Justin Couch, Andrzej Kapolka, Rick Goldberg
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.j3d.geom.GeometryDataUserdata kept in the triangle geometryFields inherited from class org.web3d.vrml.renderer.common.nodes.geom3d.BaseExtrusion
FIELD_BEGIN_CAP, FIELD_CCW, FIELD_CONVEX, FIELD_CREASE_ANGLE, FIELD_CROSS_SECTION, FIELD_END_CAP, FIELD_ORIENTATION, FIELD_SCALE, FIELD_SET_CROSS_SECTION, FIELD_SET_ORIENTATION, FIELD_SET_SCALE, FIELD_SET_SPINE, FIELD_SOLID, FIELD_SPINE, LAST_EXTRUSION_INDEX, NUM_FIELDS, numCrossSection, numOrientation, numScale, numSpine, vfBeginCap, vfCCW, vfConvex, vfCreaseAngle, vfCrossSection, vfEndCap, vfOrientation, vfScale, vfSolid, vfSpineFields 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 default sphere instanceOGLExtrusion(VRMLNodeType node) Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionvoidNotification that the rendering of the event model is complete and that rendering is about to begin.org.j3d.aviatrix3d.GeometryReturns a OGL Geometry nodeintGet the number of texture coordinate sets contained by this nodeorg.j3d.aviatrix3d.SceneGraphObjectGet the Java3D scene graph object representation of this node.getTexCoordGenMode(int setNum) Get the texture coordinate generation mode.voidsetTextureCount(int count) Set the number of textures that were found on the accompanying Appearance node.voidNotification that the construction phase of this node has finished.voidsetValue(int index, float[] value, int numValid) Set the value of the field at the given index as an array of floats.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.geom3d.BaseExtrusion
addLocalColorsListener, addTexCoordGenModeChanged, getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getPrimaryType, hasLocalColorAlpha, hasLocalColors, isCCW, isLightingEnabled, isSolid, removeLocalColorsListener, removeTexCoordGenModeChanged, setValue, 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, notifyExternProtoLoaded, removeNodeListener, sendRoute, 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.VRMLGeometryNodeType
addLocalColorsListener, addTexCoordGenModeChanged, hasLocalColorAlpha, hasLocalColors, isCCW, 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, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Field Details
-
geomData
protected org.j3d.geom.GeometryData geomDataUserdata kept in the triangle geometry
-
-
Constructor Details
-
OGLExtrusion
public OGLExtrusion()Construct a default sphere instance -
OGLExtrusion
Construct a new instance of this node based on the details from the given node. If the node is not a Box node, an exception will be thrown.- Parameters:
node- The node to copy- Throws:
IllegalArgumentException- The node is not a Group node
-
-
Method Details
-
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.
-
getGeometry
public org.j3d.aviatrix3d.Geometry getGeometry()Returns a OGL Geometry node- Specified by:
getGeometryin interfaceOGLGeometryNodeType- Returns:
- A Geometry node
-
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 classBaseExtrusion- 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 classBaseExtrusion- 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 classBaseExtrusion- Parameters:
setNum- The set which this tex gen mode refers- Returns:
- The mode or NULL
-
setValue
public void setValue(int index, float[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of floats. This would be used to set MFFloat, SFVec2f, SFVec3f and SFRotation field types.- Specified by:
setValuein interfaceVRMLNodeType- Overrides:
setValuein classBaseExtrusion- 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 field index is not knownInvalidFieldValueException- The value provided is out of range for the field type.
-
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:
allEventsCompletein interfaceFrameStateListener- Overrides:
allEventsCompletein classAbstractNode
-
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:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OGL representation.
-
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:
setupFinishedin interfaceVRMLNodeType- Overrides:
setupFinishedin classAbstractNode
-