Open Inventor Reference
SoIndexedFaceSet Class Reference

Indexed polygonal face shape node. More...

#include <Inventor/nodes/SoIndexedFaceSet.h>

Inheritance diagram for SoIndexedFaceSet:
SoIndexedShape SoVertexShape SoShape SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Binding {
  OVERALL, PER_FACE, PER_FACE_INDEXED, PER_VERTEX,
  PER_VERTEX_INDEXED
}
 This enum is used to indicate the current material or normal binding. More...
typedef void(SoIndexedFaceSet::* PMFS )(SoGLRenderAction *)
 Typedef of pointer to method on IndexedFaceSet; This will be used to simplify declaration and initialization.

Public Member Functions

 SoIndexedFaceSet ()
 Creates an indexed face set node with default settings.
virtual void GLRender (SoGLRenderAction *action)
 Implements actions.
virtual SbBool generateDefaultNormals (SoState *state, SoNormalBundle *nb)
 Generates default normals using the given normal bundle.

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Protected Member Functions

virtual void generatePrimitives (SoAction *action)
 Generates triangles representing faces.
virtual SoDetailcreateTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp)
 Overrides standard method to create an SoFaceDetail instance.
 ~SoIndexedFaceSet ()

Detailed Description

This node represents a 3D shape formed by constructing faces (polygons) from vertices located at the coordinates specified in the vertexProperty field (from SoVertexShape), or the current inherited state. For optimal performance, the vertexProperty field is recommended.

SoIndexedFaceSet uses the indices in the coordIndex field (from SoIndexedShape) to specify the polygonal faces. An index of SO_END_FACE_INDEX (-1) indicates that the current face has ended and the next one begins. For improved performance, arrange all the faces with only 3 vertices at beginning of the list, then all faces with 4 vertices, and finally all other faces.

The vertices of the faces are transformed by the current transformation matrix. The faces are drawn with the current light model and drawing style.

Treatment of the current material and normal binding is as follows: The PER_PART and PER_FACE bindings specify a material or normal for each face. PER_VERTEX specifies a material or normal for each vertex. The corresponding _INDEXED bindings are the same, but use the materialIndex or normalIndex indices (see SoIndexedShape). The default material binding is OVERALL. The default normal binding is PER_VERTEX_INDEXED.

If any normals (or materials) are specified, Inventor assumes you provide the correct number of them, as indicated by the binding. You will see unexpected results if you specify fewer normals (or materials) than the shape requires. If no normals are specified, they will be generated automatically.

Textures are applied as described for the SoIndexedShape class.

File Format/Default
IndexedFaceSet {
  coordIndex 0
  materialIndex -1
  normalIndex -1
  textureCoordIndex -1
}
Action Behavior
SoGLRenderAction
Draws faces based on the current coordinates, normals, materials, drawing style, and so on.
SoRayPickAction
Picks faces based on the current coordinates and transformation. Details about the intersection are returned in an SoFaceDetail.
SoGetBoundingBoxAction
Computes the bounding box that encloses all vertices of the face set with the current transformation applied to them. Sets the center to the average of the coordinates of all vertices.
SoCallbackAction
If any triangle callbacks are registered with the action, they will be invoked for each successive triangle generated from each face in the set.
See Also
SoIndexedTriangleSet, SoCoordinate3, SoDrawStyle, SoFaceDetail, SoFaceSet, SoVertexProperty

Definition at line 149 of file SoIndexedFaceSet.h.


Member Typedef Documentation

typedef void(SoIndexedFaceSet::* SoIndexedFaceSet::PMFS)(SoGLRenderAction *)

Definition at line 169 of file SoIndexedFaceSet.h.


Member Enumeration Documentation

Enumerator:
OVERALL 
PER_FACE 
PER_FACE_INDEXED 
PER_VERTEX 
PER_VERTEX_INDEXED 

Definition at line 175 of file SoIndexedFaceSet.h.


Constructor & Destructor Documentation

SoIndexedFaceSet::SoIndexedFaceSet ( )
SoIndexedFaceSet::~SoIndexedFaceSet ( ) [protected]

Member Function Documentation

virtual SoDetail* SoIndexedFaceSet::createTriangleDetail ( SoRayPickAction action,
const SoPrimitiveVertex v1,
const SoPrimitiveVertex v2,
const SoPrimitiveVertex v3,
SoPickedPoint pp 
) [protected, virtual]

Reimplemented from SoShape.

virtual SbBool SoIndexedFaceSet::generateDefaultNormals ( SoState state,
SoNormalBundle nb 
) [virtual]

Returns TRUE.

Reimplemented from SoVertexShape.

virtual void SoIndexedFaceSet::generatePrimitives ( SoAction action) [protected, virtual]

Implements SoShape.

virtual void SoIndexedFaceSet::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoShape.

static void SoIndexedFaceSet::initClass ( ) [static]

Reimplemented from SoIndexedShape.


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