![]() |
http://www.sim.no http://www.coin3d.org |
Basically, every polygon-, line- or point-based shape will inherit this class. It contains methods for organizing the normal cache, and also holds the SoVertexShape::vertexProperty field which can be used to set vertex data inside the node. More...
#include <Inventor/nodes/SoVertexShape.h>
Public Member Functions | |
virtual SoType | getTypeId (void) const |
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 Member Functions | |
static SoType | getClassTypeId (void) |
static void | initClass (void) |
Public Attributes | |
SoSFNode | vertexProperty |
Protected Member Functions | |
virtual const SoFieldData * | getFieldData (void) const |
SoVertexShape (void) | |
virtual | ~SoVertexShape () |
virtual SbBool | shouldGLRender (SoGLRenderAction *action) |
void | setNormalCache (SoState *const state, const int num, const SbVec3f *normals) |
SoNormalCache * | getNormalCache (void) const |
SoNormalCache * | generateAndReadLockNormalCache (SoState *const state) |
void | getVertexData (SoState *state, const SoCoordinateElement *&coords, const SbVec3f *&normals, const SbBool neednormals) |
void | readLockNormalCache (void) |
void | readUnlockNormalCache (void) |
Static Protected Member Functions | |
static const SoFieldData ** | getFieldDataPtr (void) |
Basically, every polygon-, line- or point-based shape will inherit this class. It contains methods for organizing the normal cache, and also holds the SoVertexShape::vertexProperty field which can be used to set vertex data inside the node.
SoVertexShape::SoVertexShape | ( | void | ) | [protected] |
Constructor.
References vertexProperty.
SoVertexShape::~SoVertexShape | ( | ) | [protected, virtual] |
Destructor.
SoType SoVertexShape::getClassTypeId | ( | void | ) | [static] |
This static method returns the SoType object associated with objects of this class.
Reimplemented from SoShape.
Reimplemented in SoFaceSet, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedShape, SoIndexedTriangleStripSet, SoLineSet, SoMarkerSet, SoNonIndexedShape, SoPointSet, SoQuadMesh, and SoTriangleStripSet.
Referenced by SoReorganizeAction::apply(), and SoShape::GLRender().
SoType SoVertexShape::getTypeId | ( | void | ) | const [virtual] |
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and "downward" casting.
Usage example:
void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) { SoGroup * group = (SoGroup *)node; // safe downward cast, knows the type } }
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Reimplemented from SoShape.
Reimplemented in SoFaceSet, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedShape, SoIndexedTriangleStripSet, SoLineSet, SoMarkerSet, SoNonIndexedShape, SoPointSet, SoQuadMesh, and SoTriangleStripSet.
const SoFieldData ** SoVertexShape::getFieldDataPtr | ( | void | ) | [static, protected] |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Reimplemented from SoShape.
Reimplemented in SoFaceSet, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedShape, SoIndexedTriangleStripSet, SoLineSet, SoMarkerSet, SoNonIndexedShape, SoPointSet, SoQuadMesh, and SoTriangleStripSet.
const SoFieldData * SoVertexShape::getFieldData | ( | void | ) | const [protected, virtual] |
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL
.
Reimplemented from SoShape.
Reimplemented in SoFaceSet, SoIndexedFaceSet, SoIndexedLineSet, SoIndexedShape, SoIndexedTriangleStripSet, SoLineSet, SoMarkerSet, SoNonIndexedShape, SoPointSet, SoQuadMesh, and SoTriangleStripSet.
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 * | l | ) | [virtual] |
Notifies all auditors for this instance when changes are made.
Reimplemented from SoShape.
References SoShape::notify(), readLockNormalCache(), and readUnlockNormalCache().
SbBool SoVertexShape::generateDefaultNormals | ( | SoState * | state, | |
SoNormalBundle * | bundle | |||
) | [virtual] |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Subclasses should override this method to generate default normals using the SoNormalBundle class. TRUE
should be returned if normals were generated, FALSE
otherwise.
Default method returns FALSE
.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Reimplemented in SoFaceSet, SoIndexedFaceSet, SoIndexedTriangleStripSet, SoPointSet, SoQuadMesh, and SoTriangleStripSet.
Referenced by generateAndReadLockNormalCache().
SbBool SoVertexShape::generateDefaultNormals | ( | SoState * | state, | |
SoNormalCache * | cache | |||
) | [virtual] |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Subclasses should override 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 function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
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.
References SoNode::write().
SbBool SoVertexShape::shouldGLRender | ( | SoGLRenderAction * | action | ) | [protected, virtual] |
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Reimplemented from SoShape.
Referenced by SoTriangleStripSet::GLRender(), SoQuadMesh::GLRender(), SoPointSet::GLRender(), SoMarkerSet::GLRender(), SoLineSet::GLRender(), SoIndexedTriangleStripSet::GLRender(), SoIndexedLineSet::GLRender(), SoIndexedFaceSet::GLRender(), and SoFaceSet::GLRender().
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.
References SoState::pop(), and SoState::push().
SoNormalCache * SoVertexShape::getNormalCache | ( | void | ) | const [protected] |
Returns the current normal cache, or NULL if there is none.
SoNormalCache * SoVertexShape::generateAndReadLockNormalCache | ( | SoState *const | state | ) | [protected] |
Convenience method that can be used by subclasses to return or create a normal cache. If the current cache is not valid, it takes care of unrefing the old cache and pushing and popping the state to create element dependencies when creating the new cache.
When returning from this method, the normal cache will be read locked, and the caller should call readUnlockNormalCache() when the normals in the cache is no longer needed.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
References generateDefaultNormals(), SoState::pop(), SoState::push(), readLockNormalCache(), readUnlockNormalCache(), and SoFieldContainer::set().
Referenced by SoTriangleStripSet::generatePrimitives(), SoQuadMesh::generatePrimitives(), SoFaceSet::generatePrimitives(), SoIndexedShape::getVertexData(), SoTriangleStripSet::GLRender(), SoQuadMesh::GLRender(), and SoFaceSet::GLRender().
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.
Referenced by SoTriangleStripSet::generatePrimitives(), SoQuadMesh::generatePrimitives(), SoPointSet::generatePrimitives(), SoLineSet::generatePrimitives(), SoFaceSet::generatePrimitives(), SoMarkerSet::getPrimitiveCount(), SoTriangleStripSet::GLRender(), SoQuadMesh::GLRender(), SoPointSet::GLRender(), SoMarkerSet::GLRender(), SoLineSet::GLRender(), and SoFaceSet::GLRender().
void SoVertexShape::readLockNormalCache | ( | void | ) | [protected] |
Read lock the normal cache. This method should be called before fetching the normal cache (using getNormalCache()). When the cached normals are no longer needed, readUnlockNormalCache() must be called.
It is also possible to use generateAndReadLockNormalCache().
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Referenced by generateAndReadLockNormalCache(), and notify().
void SoVertexShape::readUnlockNormalCache | ( | void | ) | [protected] |
Read unlock the normal cache. Should be called when the read-locked cached normals are no longer needed.
Referenced by generateAndReadLockNormalCache(), SoTriangleStripSet::generatePrimitives(), SoQuadMesh::generatePrimitives(), SoIndexedTriangleStripSet::generatePrimitives(), SoIndexedFaceSet::generatePrimitives(), SoFaceSet::generatePrimitives(), SoIndexedShape::getVertexData(), SoTriangleStripSet::GLRender(), SoQuadMesh::GLRender(), SoIndexedTriangleStripSet::GLRender(), SoIndexedFaceSet::GLRender(), SoFaceSet::GLRender(), and notify().
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.
SGI Inventor v2.1
Referenced by SoIndexedShape::computeBBox(), SoNonIndexedShape::computeCoordBBox(), SoNonIndexedShape::fixNumVerticesPointers(), SoIndexedTriangleStripSet::generateDefaultNormals(), SoTriangleStripSet::generatePrimitives(), SoQuadMesh::generatePrimitives(), SoPointSet::generatePrimitives(), SoLineSet::generatePrimitives(), SoIndexedTriangleStripSet::generatePrimitives(), SoIndexedFaceSet::generatePrimitives(), SoFaceSet::generatePrimitives(), SoPointSet::getPrimitiveCount(), SoMarkerSet::getPrimitiveCount(), SoTriangleStripSet::GLRender(), SoQuadMesh::GLRender(), SoPointSet::GLRender(), SoMarkerSet::GLRender(), SoLineSet::GLRender(), SoIndexedTriangleStripSet::GLRender(), SoIndexedLineSet::GLRender(), SoIndexedFaceSet::GLRender(), SoFaceSet::GLRender(), and SoVertexShape().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Feb 23 16:34:06 2009 for Coin by Doxygen. 1.5.8