Class OGLGeoElevationGrid
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.geospatial.BaseGeoElevationGrid
org.web3d.vrml.renderer.ogl.nodes.geospatial.OGLGeoElevationGrid
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener
,VRMLNode
,FrameStateListener
,VRMLComponentGeometryNodeType
,VRMLGeometryNodeType
,VRMLNodeType
,OGLGeometryNodeType
,OGLVRMLNode
,OriginListener
public class OGLGeoElevationGrid
extends BaseGeoElevationGrid
implements OGLGeometryNodeType, org.j3d.aviatrix3d.NodeUpdateListener, OriginListener
OpenGL implementation of an GeoElevationGrid
In order to handle colorPerVertex=FALSE and normalPerVertex=FALSE we have to two representations. Under normal conditions(TRUE,TRUE) we can use TriStrips. Otherwise we must revert back to Quads to get the right coloring. Issues: If you specify normalPerVertex = FALSE but colorPerVertex = TRUE then the colorInterpolation is different then Cosmo/Cortona. Is it wrong, hard to say. CreaseAngle is not supported. All terrains are smooth shaded. Not sure ccw handling is correct. TODO: Needed Observers: color, normal, texCoord
- Version:
- $Revision: 1.11 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.geospatial.BaseGeoElevationGrid
FIELD_CCW, FIELD_COLOR, FIELD_COLORPERVERTEX, FIELD_CREASEANGLE, FIELD_GEO_GRID_ORIGIN, FIELD_GEO_ORIGIN, FIELD_GEO_SYSTEM, FIELD_HEIGHT, FIELD_NORMAL, FIELD_NORMALPERVERTEX, FIELD_SET_HEIGHT, FIELD_SOLID, FIELD_TEXCOORD, FIELD_XDIMENSION, FIELD_XSPACING, FIELD_YSCALE, FIELD_ZDIMENSION, FIELD_ZSPACING, geoCoordSwap, geoTransform, heightLen, LAST_ELEVATIONGRID_INDEX, local_origin, localColors, localColorsListeners, localCoords, originManager, pColor, pGeoOrigin, pNormal, pTexCoord, TRANSFORM_ERR_MSG, useOriginManager, vfCcw, vfColor, vfColorPerVertex, vfCreaseAngle, vfGeoGridOrigin, vfGeoOrigin, vfGeoSystem, vfHeight, vfNormal, vfNormalPerVertex, vfSolid, vfTexCoord, vfXDimension, vfXSpacing, vfYScale, vfZDimension, vfZSpacing
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
ConstructorsConstructorDescriptionDefault constructorConstruct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.Geometry
Returns a OGL Geometry node that represents this piece of geometry.org.j3d.aviatrix3d.SceneGraphObject
Get the Java3D scene graph object representation of this node.void
Notification that the origin has changed.void
setComponent
(VRMLNodeType comp) Set a component that composes part of a geometry object.void
setComponents
(VRMLNodeType[] comps) Set the components that compose a geometry object.void
Notification that the construction phase of this node has finished.void
setValue
(int index, VRMLNodeType child) Set the value of the field at the given index as a node.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.geospatial.BaseGeoElevationGrid
addLocalColorsListener, addTexCoordGenModeChanged, fireLocalColorsChanged, getComponents, getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getNumSets, getPrimaryType, getSecondaryType, getTexCoordGenMode, hasColorPerVertex, hasLocalColorAlpha, hasLocalColors, hasNormalPerVertex, isCCW, isLightingEnabled, isSolid, removeLocalColorsListener, removeTexCoordGenModeChanged, requiresUnlitColor, sendRoute, setTextureCount, setUnlitColor, setValue, setValue, setValue, setValue, setValue, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, 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.nodes.VRMLGeometryNodeType
addLocalColorsListener, addTexCoordGenModeChanged, getNumSets, getTexCoordGenMode, 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, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLGeoElevationGrid
public OGLGeoElevationGrid()Default constructor -
OGLGeoElevationGrid
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
-
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.
-
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 classBaseGeoElevationGrid
-
setValue
public void setValue(int index, VRMLNodeType child) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as a node. This would be used to set SFNode field types.- Specified by:
setValue
in interfaceVRMLNodeType
- Overrides:
setValue
in classBaseGeoElevationGrid
- Parameters:
index
- The index of destination field to setchild
- The new value to use for the node- Throws:
InvalidFieldException
- The field index is not knownInvalidFieldValueException
- The node does not match the required type.
-
setComponents
Set the components that compose a geometry object.- Specified by:
setComponents
in interfaceVRMLComponentGeometryNodeType
- Overrides:
setComponents
in classBaseGeoElevationGrid
- Parameters:
comps
- An array of geometric properties- Throws:
InvalidFieldValueException
- The node does not match the required type.
-
setComponent
Set a component that composes part of a geometry object.- Specified by:
setComponent
in interfaceVRMLComponentGeometryNodeType
- Overrides:
setComponent
in classBaseGeoElevationGrid
- Parameters:
comp
- A geometric property- Throws:
InvalidFieldValueException
- The node does not match the required type.
-
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.
-
originChanged
public void originChanged()Notification that the origin has changed.- Specified by:
originChanged
in interfaceOriginListener
-