Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoVertexShape Class Reference

The SoVertexShape class is the superclass for all vertex based shapes. More...

#include <Inventor/nodes/SoVertexShape.h>

Inheritance diagram for SoVertexShape::

SoShape SoNode SoFieldContainer SoBase SoIndexedShape SoNonIndexedShape SoIndexedFaceSet SoIndexedLineSet SoIndexedTriangleStripSet SoFaceSet SoLineSet SoPointSet SoQuadMesh SoTriangleStripSet List of all members.

Public Methods

virtual void notify (SoNotList *nl)
virtual SbBool generateDefaultNormals (SoState *state, SoNormalBundle *bundle)
virtual SbBool generateDefaultNormals (SoState *state, SoNormalCache *cache)
virtual void write (SoWriteAction *action)

Static Public Methods

void initClass (void)

Public Attributes

SoSFNode vertexProperty

Protected Methods

 SoVertexShape (void)
virtual ~SoVertexShape ()
virtual SbBool shouldGLRender (SoGLRenderAction *action)
void setNormalCache (SoState *const state, const int num, const SbVec3f *normals)
SoNormalCache * getNormalCache (void) const
void generateNormals (SoState *const state)
void getVertexData (SoState *state, const SoCoordinateElement *&coords, const SbVec3f *&normals, const SbBool neednormals)

Detailed Description

The SoVertexShape class is the superclass for all vertex based shapes.

Basically, every polygon, line or point based shape will inherit this class. It contains methods for organizing the normal cache, and also holds the vertexProperty field which can be used to set vertex data inside the node.


Constructor & Destructor Documentation

SoVertexShape::SoVertexShape void [protected]
 

Constructor.

SoVertexShape::~SoVertexShape [protected, virtual]
 

Destructor.


Member Function Documentation

void SoVertexShape::initClass void [static]
 

Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

Reimplemented from SoShape.

Reimplemented in SoFaceSet, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedShape, SoIndexedTriangleStripSet, SoLineSet, SoMarkerSet, SoNonIndexedShape, SoPointSet, SoQuadMesh, and SoTriangleStripSet.

void SoVertexShape::notify SoNotList * list [virtual]
 

Overloaded to invalidate caches.

Reimplemented from SoNode.

SbBool SoVertexShape::generateDefaultNormals SoState * state,
SoNormalBundle * nb
[virtual]
 

Subclasses should overload this method to generate default normals using the SoNormalBundle class. TRUE should be returned if normals were generated, FALSE otherwise. Default method returns FALSE.

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

SbBool SoVertexShape::generateDefaultNormals SoState * state,
SoNormalCache * nc
[virtual]
 

Subclasses should overload this method to generate default normals using the SoNormalCache class. This is more effective than using SoNormalGenerator. Return TRUE if normals were generated, FALSE otherwise. Default method just returns FALSE.

This method is not part of the original OIV API. Do not overload it if you intend to create a node that can be used on both Coin and OIV.

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

void SoVertexShape::write SoWriteAction * action [virtual]
 

Action method for SoWriteAction.

Writes out a node object, and any connected nodes, engines etc, if necessary.

Reimplemented from SoNode.

SbBool SoVertexShape::shouldGLRender SoGLRenderAction * action [protected, virtual]
 

For internal use only.

Reimplemented from SoShape.

void SoVertexShape::setNormalCache SoState *const state,
const int num,
const SbVec3f * normals
[protected]
 

Sets normal cache to contain the normals specified by normals and num, and forces cache dependencies on coordinates, shape hints and crease angle.

SoNormalCache * SoVertexShape::getNormalCache void const [protected]
 

Returns the current normal cache, or NULL if there is none.

void SoVertexShape::generateNormals SoState *const state [protected]
 

Convenience method that can be used by subclasses to create a new normal cache. It takes care of unrefing the old cache and pushing and popping the state to create element dependencies. This method is not part of the OIV API.

void SoVertexShape::getVertexData SoState * state,
const SoCoordinateElement *& coords,
const SbVec3f *& normals,
const SbBool neednormals
[protected]
 

Convenience method that returns the current coordinate and normal element. This method is not part of the OIV API.


Member Data Documentation

SoSFNode SoVertexShape::vertexProperty
 

If you set the vertexProperty field, it should be with an SoVertexProperty node. Otherwise it will simply be ignored. Nodetypes inheriting SoVertexShape will then get their coordinate data from the vertexProperty node instead of from the global traversal state.

The vertexProperty field of SoVertexShape-derived nodes breaks somewhat with the basic design of Open Inventor, as its contents are not passed to the global state. This is done to provide a simple path to highly optimized rendering of vertexbased shapes.

See also:
SoVertexProperty


The documentation for this class was generated from the following files:
Generated at Tue Mar 5 03:31:33 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001