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

The IndexedFaceSet node represents a 3D shape formed by constructing faces (polygons) from vertices listed in the coord field. More...

#include <H3D/IndexedFaceSet.h>

Inheritance diagram for H3D::IndexedFaceSet:

Inheritance graph

List of all members.

Classes

class  AutoNormal
 Specialized field for automatically generating normals from coordinates. More...

Public Types

typedef CoordBoundField SFBound
 The bound field for IndexedFaceSet is a CoordBoundField.

Public Member Functions

 IndexedFaceSet (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< DisplayList > _displayList=0, Inst< SFColorNode > _color=0, Inst< SFCoordinateNode > _coord=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< SFBool > _convex=0, Inst< SFFloat > _creaseAngle=0, Inst< MFInt32 > _set_colorIndex=0, Inst< MFInt32 > _set_coordIndex=0, Inst< MFInt32 > _set_normalIndex=0, Inst< MFInt32 > _set_texCoordIndex=0, Inst< MFInt32 > _colorIndex=0, Inst< MFInt32 > _coordIndex=0, Inst< MFInt32 > _normalIndex=0, Inst< MFInt32 > _texCoordIndex=0, Inst< SFFogCoordinate > _fogCoord=0)
 Constructor.
virtual void render ()
 Renders the IndexedFaceSet using GL_POLYGONs.
virtual int nrTriangles ()
 An upper bound on the number of triangles.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph.

Public Attributes

auto_ptr< MFInt32set_colorIndex
 Field for setting the value of the colorIndex field.
auto_ptr< MFInt32set_coordIndex
 Field for setting the value of the coordIndex field.
auto_ptr< MFInt32set_normalIndex
 Field for setting the value of the normalIndex field.
auto_ptr< MFInt32set_texCoordIndex
 Field for setting the value of the texCoordIndex field.
auto_ptr< MFInt32colorIndex
 Indices into the color field.
auto_ptr< SFBoolconvex
 The convex field indicates whether all polygons in the shape are convex.
auto_ptr< MFInt32coordIndex
 Indices into the coord field.
auto_ptr< SFFloatcreaseAngle
 The creaseAngle field affects how default normals are generated.
auto_ptr< MFInt32normalIndex
 Indices into the normal field.
auto_ptr< MFInt32texCoordIndex
 Indices into the texCoord field.
auto_ptr< AutoNormalautoNormal
 Auto-generated normals that are used if the normal field is NULL.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The IndexedFaceSet node represents a 3D shape formed by constructing faces (polygons) from vertices listed in the coord field.

The coord field contains a Coordinate node that defines the 3D vertices referenced by the coordIndex field. IndexedFaceSet uses the indices in its coordIndex field to specify the polygonal faces by indexing into the coordinates in the Coordinate node. An index of "-1" indicates that the current face has ended and the next one begins. The last face may be (but does not have to be) followed by a "-1" index. If the greatest index in the coordIndex field is N, the Coordinate node shall contain N+1 coordinates (indexed as 0 to N). Each face of the IndexedFaceSet shall have:

Otherwise, The results are undefined.

The IndexedFaceSet node is specified in the local coordinate system and is affected by the transformations of its ancestors. Descriptions of the coord, normal, and texCoord fields are provided in the Coordinate, Normal, and TextureCoordinate nodes, respectively. Details on lighting equations and the interaction between color field, normal field, textures, materials, and geometries are provided in 11 Rendering component and 12 Shape component.

If the color field is not NULL, it shall contain a Color node whose colours are applied to the vertices or faces of the IndexedFaceSet as follows:

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

If the normal field is not NULL, it shall contain a Normal node whose normals are applied to the vertices or faces of the IndexedFaceSet in a manner exactly equivalent to that described above for applying colours to vertices/faces (where normalPerVertex corresponds to colorPerVertex and normalIndex corresponds to colorIndex). If the normal field is NULL, the browser shall automatically generate normals, using creaseAngle to determine if and how normals are smoothed across shared vertices (see Section 11.2.3 in the X3D specification).

If the texCoord field is not NULL, it shall contain a TextureCoordinate node. The texture coordinates in that node are applied to the vertices of the IndexedFaceSet as follows:

If the texCoord field is NULL, a default texture coordinate mapping is calculated using the local coordinate system bounding box of the shape. The longest dimension of the bounding box defines the S coordinates, and the next longest defines the T coordinates. If two or all three dimensions of the bounding box are equal, ties shall be broken by choosing the X, Y, or Z dimension in that order of preference. The value of the S coordinate ranges from 0 to 1, from one end of the bounding box to the other. The T coordinate ranges between 0 and the ratio of the second greatest dimension of the bounding box to the greatest dimension and the R coordinate ranges between 0 and the ratio of the smallest dimension of the bounding box to the greatest dimension.

Internal routes:
IndexedFaceSet.dot

Member Function Documentation

void IndexedFaceSet::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 H3D::X3DComposedGeometryNode::solid, and H3D::X3DGeometryNode::useBackFaceCulling().


Member Data Documentation

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

Only accessable in C++.

IndexedFaceSet_autoNormal.dot

Referenced by IndexedFaceSet(), and render().

Indices into the color field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_colorIndex.dot

Referenced by IndexedFaceSet(), and render().

The convex field indicates whether all polygons in the shape are convex.

A polygon is convex if it is planar, does not intersect itself, and all of the interior angles at its vertices are less than 180 degrees. Non planar and self intersecting polygons may produce undefined results even if the convex field is FALSE.

Access type: inputOutput
Default value: TRUE

IndexedFaceSet_convex.dot

Referenced by IndexedFaceSet().

Indices into the coord field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_coordIndex.dot

Referenced by IndexedFaceSet(), 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]

IndexedFaceSet_creaseAngle.dot

Referenced by IndexedFaceSet(), and render().

Indices into the normal field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_normalIndex.dot

Referenced by IndexedFaceSet(), and render().

Field for setting the value of the colorIndex field.

Access type: inputOnly

IndexedFaceSet_set_colorIndex.dot

Referenced by IndexedFaceSet().

Field for setting the value of the coordIndex field.

Access type: inputOnly

IndexedFaceSet_set_coordIndex.dot

Referenced by IndexedFaceSet().

Field for setting the value of the normalIndex field.

Access type: inputOnly

IndexedFaceSet_set_normalIndex.dot

Referenced by IndexedFaceSet().

Field for setting the value of the texCoordIndex field.

Access type: inputOnly

IndexedFaceSet_set_texCoordIndex.dot

Referenced by IndexedFaceSet().

Indices into the texCoord field.

See Detailed description for details on how it is used.

Access type: inputOutput
Value range: [0,inf) or -1

IndexedFaceSet_texCoordIndex.dot

Referenced by IndexedFaceSet(), and render().


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

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