Open Inventor Reference
SoVertexShape Class Reference

Abstract base class for all vertex-based shape nodes. More...

#include <Inventor/nodes/SoVertexShape.h>

Inheritance diagram for SoVertexShape:
SoShape SoNode SoFieldContainer SoBase SoIndexedShape SoNonIndexedShape SoIndexedFaceSet SoIndexedLineSet SoIndexedTriangleSet SoIndexedTriangleStripSet SoFaceSet SoLineSet SoPointSet SoQuadMesh SoTriangleStripSet

List of all members.

Public Types

typedef void VertexArrayRenderingCB (SoVertexShape *shape, SoGLRenderAction *, bool useVbo, uint32_t numVertices)
 callback used for pre/post vertex array rendering on SoVertexShapes (MeVis ONLY)

Public Member Functions

virtual SbBool generateDefaultNormals (SoState *state, SoNormalBundle *nb)
 Subclasses may define this method to generate normals to use when the normal binding is DEFAULT and there aren't enough normals in the state.
virtual void notify (SoNotList *list)
 Redefines this to invalidate normal cache.

Static Public Member Functions

static void initClass ()
 Initializes base node class.
static void setPreVertexArrayRenderingCallback (VertexArrayRenderingCB *cb)
 register global pre callback for vertex array rendering (MeVis ONLY)
static void setPostVertexArrayRenderingCallback (VertexArrayRenderingCB *cb)
 register global post callback for vertex array rendering (MeVis ONLY)

Public Attributes

SoSFNode vertexProperty

Protected Member Functions

 SoVertexShape ()
 Constructor - makes this abstract.
virtual ~SoVertexShape ()
virtual SbBool shouldGLRender (SoGLRenderAction *action)
 Returns TRUE if the shape should be rendered.
void setNormalCache (SoState *state, int numNormals, const SbVec3f *normals)
 Sets up a cache to hold normals.
SoNormalCachegetNormalCache () const
 Returns the current normal cache, or NULL if there is none.
bool beginVertexArrayRendering (SoGLRenderAction *action)
 enables vertex array rendering client state and VBO rendering (if supported), returns true if VBOs are used (MeVis ONLY)
void endVertexArrayRendering (SoGLRenderAction *action, bool vboWasUsed)
 disables vertex array rendering and VBOs if vboWasUsed is passes as true (MeVis ONLY)

Protected Attributes

SoVertexPropertyCache vpCache
 vpCache stores information from one render to the next about what information needs to be grabbed from the state, etc.

Detailed Description

This node is the abstract base class for all vertex-based shape (geometry) nodes. It is used as a repository for convenience functions for subclasses and to provide a type identifier to make it easy to determine whether a shape is vertex-based. It contains one public field, the SoVertexProperty field.

All subclasses of this node draw objects constructed from vertices. If the vertexProperty field is non-null and there are coordinates in the associated vertex property node, then those coordinates are used. Otherwise the objects are drawn using the current coordinates in the state. The coordinates of the shape are transformed by the current transformation matrix and are drawn with the current light model and drawing style.

Subclasses that construct polygons from vertices may not render or pick correctly if any of their polygons are self-intersecting or non-planar.

All vertex shape subclasses use the bounding box of the shape to determine default texture coordinates. The longest dimension of the bounding box defines the S coordinates, and the next longest defines the T coordinates. 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.

When a vertex-based shape is picked with an SoRayPickAction, a detail is always returned. If the shape is composed of faces (such as SoFaceSet or SoTriangleStripSet), an SoFaceDetail is returned. If the shape is composed of line segments (such as SoLineSet), an SoLineDetail is returned. If the shape is composed of points (such as SoPointSet), an SoPointDetail is returned. Note that the type of detail returned is not affected by the current drawing style.

Similarly, each class of vertex-based shape invokes appropriate callbacks if those callbacks are registered with the SoCallbackAction. Shapes made of faces invoke triangle callbacks for each generated triangle. (Faces may be triangulated to create these triangles.) Shapes made of line segments invoke line segment callbacks for each segment, and shapes made of points invoke point callbacks.

The subclass SoIndexedShape is a base class for vertex-based shapes that index into the current set of coordinates. The subclass SoNonIndexedShape is a base class for vertex-based shapes that use the current coordinates in order.

See Also
SoIndexedShape, SoNonIndexedShape, SoVertexProperty

Definition at line 135 of file SoVertexShape.h.


Member Typedef Documentation

typedef void SoVertexShape::VertexArrayRenderingCB(SoVertexShape *shape, SoGLRenderAction *, bool useVbo, uint32_t numVertices)

Definition at line 188 of file SoVertexShape.h.


Constructor & Destructor Documentation

SoVertexShape::SoVertexShape ( ) [protected]
virtual SoVertexShape::~SoVertexShape ( ) [protected, virtual]

Member Function Documentation

bool SoVertexShape::beginVertexArrayRendering ( SoGLRenderAction action) [protected]
void SoVertexShape::endVertexArrayRendering ( SoGLRenderAction action,
bool  vboWasUsed 
) [protected]
virtual SbBool SoVertexShape::generateDefaultNormals ( SoState state,
SoNormalBundle nb 
) [virtual]

This should use the given SoNormalBundle to generate the normals. Returns TRUE if normals were generated.

Reimplemented in SoFaceSet, SoIndexedFaceSet, SoIndexedTriangleSet, SoIndexedTriangleStripSet, SoQuadMesh, and SoTriangleStripSet.

SoNormalCache* SoVertexShape::getNormalCache ( ) const [inline, protected]

Definition at line 177 of file SoVertexShape.h.

static void SoVertexShape::initClass ( ) [static]
virtual void SoVertexShape::notify ( SoNotList list) [virtual]

Reimplemented from SoNode.

Reimplemented in SoIndexedShape.

void SoVertexShape::setNormalCache ( SoState state,
int  numNormals,
const SbVec3f normals 
) [protected]

This assumes the cache depends on only the current coordinates, shape hints, and crease angle.

static void SoVertexShape::setPostVertexArrayRenderingCallback ( VertexArrayRenderingCB cb) [static]
static void SoVertexShape::setPreVertexArrayRenderingCallback ( VertexArrayRenderingCB cb) [static]
virtual SbBool SoVertexShape::shouldGLRender ( SoGLRenderAction action) [protected, virtual]

Checks for transparency in vertexProperty node before invoking render action.

Reimplemented from SoShape.


Member Data Documentation

Definition at line 169 of file SoVertexShape.h.


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