H3D::ElevationGrid Class Reference
[X3D node classes.]

The ElevationGrid node specifies a uniform rectangular grid of varying height in the Y=0 plane of the local coordinate system. More...

#include <H3D/ElevationGrid.h>

Inheritance diagram for H3D::ElevationGrid:

Inheritance graph

List of all members.

Classes

class  AutoNormal
 Specialized field for automatically generating normals from coordinates. More...
class  DisplayList
 Display list is extended in order to set front sidedness of triangles outside the display list. More...
class  SFBound
 SFBound is specialized update itself from the fields of the ElevationGrid. More...

Public Types

typedef DependentSFNode
< X3DColorNode, FieldRef
< X3DGeometricPropertyNode,
Field,&X3DColorNode::propertyChanged > > 
SFColorNode
 The SFColorNode is dependent on the propertyChanged field of the contained X3DColorNode.
typedef DependentSFNode
< X3DNormalNode, FieldRef
< X3DGeometricPropertyNode,
Field,&X3DNormalNode::propertyChanged > > 
SFNormalNode
 The SFNormalNode is dependent on the propertyChanged field of the contained X3DNormalNode.
typedef DependentSFNode
< X3DTextureCoordinateNode,
FieldRef
< X3DGeometricPropertyNode,
Field,&X3DTextureCoordinateNode::propertyChanged > > 
SFTextureCoordinateNode
 The SFTextureCoordinteNode is dependent on the propertyChanged field of the contained X3DTextureCoordinateNode.
typedef DependentMFNode
< X3DVertexAttributeNode,
FieldRef
< X3DGeometricPropertyNode,
Field,&X3DVertexAttributeNode::propertyChanged > > 
MFVertexAttributeNode
 The MFVertexAttributeNode is dependent on the propertyChanged field of the contained X3DVertexAttributeNode.
typedef DependentSFNode
< FogCoordinate, FieldRef
< X3DGeometricPropertyNode,
Field,&FogCoordinate::propertyChanged > > 
SFFogCoordinate
 The SFFogCoordinate is dependent on the propertyChanged field of the contained FogCoordinate.

Public Member Functions

virtual void startTexGen (TextureCoordinateGenerator *tex_coord_gen)
 Start texture coordinate generation.
virtual void stopTexGen (TextureCoordinateGenerator *tex_coord_gen)
 Stop texture coordinate generation.
virtual void render ()
 Render the ElevationGrid with OpenGL.
virtual int nrTriangles ()
 The number of triangles renderered in this geometry.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph.
 ElevationGrid (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< DisplayList > _displayList=0, Inst< SFColorNode > _color=0, Inst< SFNormalNode > _normal=0, Inst< SFTextureCoordinateNode > _texCoord=0, Inst< SFBool > _ccw=0, Inst< SFBool > _colorPerVertex=0, Inst< SFBool > _normalPerVertex=0, Inst< SFBool > _solid=0, Inst< MFVertexAttributeNode > _attrib=0, Inst< AutoNormal > _autoNormal=0, Inst< SFFloat > _creaseAngle=0, Inst< SFInt32 > _xDimension=0, Inst< SFInt32 > _zDimension=0, Inst< SFFloat > _xSpacing=0, Inst< SFFloat > _zSpacing=0, Inst< MFFloat > _height=0, Inst< SFFogCoordinate > _fogCoord=0)
 Constructor.

Public Attributes

auto_ptr< SFColorNodecolor
 Contains an X3DColorNode whose colors are applied to the ElevationGrid.
auto_ptr< SFNormalNodenormal
 Contains an X3DNormalNode which colors are applied to the ElevationGrid.
auto_ptr< SFTextureCoordinateNodetexCoord
 Contains an X3DTextureCoordinateNode which colors are applied to the ElevationGrid.
auto_ptr< SFBoolccw
 The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors used in the lighting model equations.
auto_ptr< SFBoolcolorPerVertex
 If TRUE the colors in the color field is applied per vertex, otherwise it is applied per face.
auto_ptr< SFBoolnormalPerVertex
 If TRUE the normals in the normal field is applied per vertex, otherwise it is applied per face.
auto_ptr< SFBoolsolid
 The solid field determines whether one or both sides of each polygon shall be displayed.
auto_ptr< MFVertexAttributeNodeattrib
 If the attrib field is not empty it shall contain a list of X3DVertexAttributeNode instances with per-vertex attribute information for programmable shaders.
auto_ptr< SFFloatcreaseAngle
 The creaseAngle field affects how default normals are generated.
auto_ptr< SFInt32xDimension
 The number of elements in the grid height array in the x direction.
auto_ptr< SFInt32zDimension
 The number of elements in the grid height array in the x direction.
auto_ptr< SFFloatxSpacing
 The distance between vertices in the x direction.
auto_ptr< SFFloatzSpacing
 The distance between vertices in the z direction.
auto_ptr< MFFloatheight
 The height field is an xDimension by zDimension array of scalar values representing the height above the grid for each vertex.
auto_ptr< AutoNormalautoNormal
 Auto-generated normals that are used if the normal field is NULL.
auto_ptr< SFFogCoordinatefogCoord
 If the fogCoord field is not empty, it shall contain a list of per-vertex depth values for calculating fog depth.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The ElevationGrid node specifies a uniform rectangular grid of varying height in the Y=0 plane of the local coordinate system.

The geometry is described by a scalar array of height values that specify the height of a surface above each point of the grid.

The xDimension and zDimension fields indicate the number of elements of the grid height array in the X and Z directions. Both xDimension and zDimension shall be greater than or equal to zero. If either the xDimension or the zDimension is less than two, the ElevationGrid contains no quadrilaterals. The vertex locations for the rectangles are defined by the height field and the xSpacing and zSpacing fields:

The color field specifies per-vertex or per-quadrilateral colours for the ElevationGrid node depending on the value of colorPerVertex. If the color field is NULL, the ElevationGrid node is rendered with the overall attributes of the Shape node enclosing the ElevationGrid node).

The colorPerVertex field determines whether colours specified in the color field are applied to each vertex or each quadrilateral of the ElevationGrid node. If colorPerVertex is FALSE and the color field is not NULL, the color field shall specify a Color node containing at least (xDimension-1)(zDimension-1) colours; one for each quadrilateral.

If colorPerVertex is TRUE and the color field is not NULL, the color field shall specify a Color node containing at least xDimension zDimension colours, one for each vertex.

The normal field specifies per-vertex or per-quadrilateral normals for the ElevationGrid node. If the normal field is NULL, normals are automatically generated, using the creaseAngle field to determine if and how normals are smoothed across the surface(see Section 11.2.3 in the X3D specification).

The normalPerVertex field determines whether normals are applied to each vertex or each quadrilateral of the ElevationGrid node depending on the value of normalPerVertex. If normalPerVertex is FALSE and the normal node is not NULL, the normal field shall specify a Normal node containing at least (xDimension-1)(zDimension-1) normals; one for each quadrilateral

If normalPerVertex is TRUE and the normal field is not NULL, the normal field shall specify a Normal node containing at least xDimension zDimension normals; one for each vertex.

The texCoord field specifies per-vertex texture coordinates for the ElevationGrid node. If texCoord is NULL, default texture coordinates are applied to the geometry. The default texture coordinates range from (0,0) at the first vertex to (1,1) at the last vertex. The S texture coordinate is aligned with the positive X-axis, and the T texture coordinate with positive Z-axis. If texCoord is not NULL, it shall specify a TextureCoordinate node containing at least (xDimension)(zDimension) texture coordinates; one for each vertex.

By default, the quadrilaterals are defined with a counterclockwise ordering. Hence, the Y-component of the normal is positive. Setting the ccw field to FALSE reverses the normal direction. Backface culling is enabled when the solid field is TRUE.

Internal routes:
ElevationGrid.dot

Member Typedef Documentation

The MFVertexAttributeNode is dependent on the propertyChanged field of the contained X3DVertexAttributeNode.

The SFColorNode is dependent on the propertyChanged field of the contained X3DColorNode.

The SFFogCoordinate is dependent on the propertyChanged field of the contained FogCoordinate.

The SFNormalNode is dependent on the propertyChanged field of the contained X3DNormalNode.

The SFTextureCoordinteNode is dependent on the propertyChanged field of the contained X3DTextureCoordinateNode.


Member Function Documentation

void ElevationGrid::startTexGen ( TextureCoordinateGenerator tex_coord_gen  )  [virtual]

Start texture coordinate generation.

Texture coordinates will be generated for all texture units used by the currently active texture. If tex_coord_gen is NULL then texture coordinates will be generated from the bounding box of the geometry as defined in the X3D specification. If tex_coord_gen is not NULL then we use the TextureCoordinateGenerator to define the texture coordinate generation.

References H3D::H3DBoundedObject::bound, H3D::BoxBound::center, H3D::X3DTextureNode::getActiveTexture(), H3D_FULL_LOCATION, H3DAbs(), H3D::BoxBound::size, H3D::TextureCoordinateGenerator::startTexGen(), and H3D::MultiTexture::texture.

Referenced by render().

void ElevationGrid::traverseSG ( TraverseInfo ti  )  [virtual]

Traverse the scenegraph.

A HAPIHapticShape is added for haptic rendering if haptics is enabled.

Parameters:
ti The TraverseInfo object containing information about the traversal.

Reimplemented from H3D::X3DGeometryNode.

References solid, and H3D::X3DGeometryNode::useBackFaceCulling().


Member Data Documentation

If the attrib field is not empty it shall contain a list of X3DVertexAttributeNode instances with per-vertex attribute information for programmable shaders.

Access type: inputOutput

Referenced by ElevationGrid(), and render().

Auto-generated normals that are used if the normal field is NULL.

Only accessable in C++.

Referenced by ElevationGrid(), and render().

The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors used in the lighting model equations.

If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the local coordinate system of the Shape) from the opposite direction as the normal. If ccw is FALSE, the normals shall be oriented in the opposite direction. If normals are not generated but are supplied using a Normal node, and the orientation of the normals does not match the setting of the ccw field, results are undefined.

Access type: inputOutput
Default value: TRUE

ElevationGrid_ccw.dot

Referenced by H3D::ElevationGrid::DisplayList::callList(), and ElevationGrid().

Contains an X3DColorNode whose colors are applied to the ElevationGrid.

If the color field is NULL, the geometry shall be rendered normally using the Material and texture defined in the Appearance node

Access type: inputOutput

ElevationGrid_color.dot

Referenced by ElevationGrid(), and render().

If TRUE the colors in the color field is applied per vertex, otherwise it is applied per face.

Access type: inputOutput
Default value: TRUE

ElevationGrid_colorPerVertex.dot

Referenced by ElevationGrid(), and render().

The creaseAngle field affects how default normals are generated.

If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.

Access type: inputOutput
Default value: 0
Valid range: [0-inf]

ElevationGrid_creaseAngle.dot

Referenced by ElevationGrid(), and render().

If the fogCoord field is not empty, it shall contain a list of per-vertex depth values for calculating fog depth.

Access type: inputOutput

ElevationGrid_fogCoord.dot

Referenced by ElevationGrid(), and render().

The height field is an xDimension by zDimension array of scalar values representing the height above the grid for each vertex.

Access type: inputOutput
Default value: []

ElevationGrid_height.dot

Referenced by ElevationGrid().

Contains an X3DNormalNode which colors are applied to the ElevationGrid.

If the normal field is NULL, the normals are automatically generated in accordance with the node's definition. If the node does not define a behaviour, the default is to generate an averaged normal for all faces that share that vertex.

Access type: inputOutput

ElevationGrid_normal.dot

Referenced by ElevationGrid(), and render().

If TRUE the normals in the normal field is applied per vertex, otherwise it is applied per face.

Access type: inputOutput
Default value: TRUE

ElevationGrid_normalPerVertex.dot

Referenced by ElevationGrid(), and render().

The solid field determines whether one or both sides of each polygon shall be displayed.

If solid is FALSE, each polygon shall be visible regardless of the viewing direction (i.e., no backface culling shall be done, and two sided lighting shall be performed to illuminate both sides of lit surfaces). If solid is TRUE, back face culling will be performed.

Access type: inputOutput
Default value: TRUE

ElevationGrid_solid.dot

Referenced by ElevationGrid(), and traverseSG().

Contains an X3DTextureCoordinateNode which colors are applied to the ElevationGrid.

Access type: inputOutput

ElevationGrid_texCoord.dot

Referenced by ElevationGrid(), and render().

The number of elements in the grid height array in the x direction.

Access type: inputOutput
Default value: 0
Valid range: [0-inf]

ElevationGrid_xDimension.dot

Referenced by ElevationGrid(), and render().

The distance between vertices in the x direction.

Access type: inputOutput
Default value: 1.0
Valid range: (0-inf]

ElevationGrid_xSpacing.dot

Referenced by ElevationGrid(), and render().

The number of elements in the grid height array in the x direction.

Access type: inputOutput
Default value: 0
Valid range: [0-inf]

ElevationGrid_zDimension.dot

Referenced by ElevationGrid(), and render().

The distance between vertices in the z direction.

Access type: inputOutput
Default value: 1.0
Valid range: (0-inf]

ElevationGrid_zSpacing.dot

Referenced by ElevationGrid(), and render().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:30:00 2008 for H3D API by  doxygen 1.5.7