Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoVertexArrayIndexer Class Reference

The SoVertexArrayIndexer class is used to simplify index handling for vertex array rendering. More...

Public Member Functions

 SoVertexArrayIndexer (void)
 
 ~SoVertexArrayIndexer ()
 
void addTriangle (const int32_t v0, const int32_t v1, const int32_t v2)
 
void addLine (const int32_t v0, const int32_t v1)
 
void addPoint (const int32_t v0)
 
void addQuad (const int32_t v0, const int32_t v1, const int32_t v2, const int32_t v3)
 
void beginTarget (GLenum target)
 
void targetVertex (GLenum target, const int32_t v)
 
void endTarget (GLenum target)
 
void close (void)
 
void render (const cc_glglue *glue, const SbBool renderasvbo, const uint32_t vbocontextid)
 
int getNumVertices (void)
 
int getNumIndices (void) const
 
const GLint * getIndices (void) const
 
GLint * getWriteableIndices (void)
 

Detailed Description

The SoVertexArrayIndexer class is used to simplify index handling for vertex array rendering.

FIXME: more doc. when/if this class is made public, pederb 20050111

Constructor & Destructor Documentation

SoVertexArrayIndexer::SoVertexArrayIndexer ( void  )

Constructor

SoVertexArrayIndexer::~SoVertexArrayIndexer ( )

Destructor

Member Function Documentation

void SoVertexArrayIndexer::addTriangle ( const int32_t  v0,
const int32_t  v1,
const int32_t  v2 
)

Adds a triangle to be indexed.

void SoVertexArrayIndexer::addLine ( const int32_t  v0,
const int32_t  v1 
)

Adds a line to be indexed.

void SoVertexArrayIndexer::addPoint ( const int32_t  v0)

Adds a point to be indexed.

void SoVertexArrayIndexer::addQuad ( const int32_t  v0,
const int32_t  v1,
const int32_t  v2,
const int32_t  v3 
)

Adds a quad to be indexed.

void SoVertexArrayIndexer::beginTarget ( GLenum  targetin)

Sets up indexer for new indices of type targetin. Use targetVertex() to add indices, and finish the target by using endTarget().

See Also
targetVertex()
endTarget()
void SoVertexArrayIndexer::targetVertex ( GLenum  targetin,
const int32_t  v 
)

Adds an index to the indexer.

See Also
beginTarget()
endTarget()
void SoVertexArrayIndexer::endTarget ( GLenum  targetin)

Ends the current target.

See Also
beginTarget()
targetVertex()
void SoVertexArrayIndexer::close ( void  )

Closes the indexer. This will reallocate the growable arrays to use as little memory as possible. The indexer will also sort triangles and lines to optimize rendering.

void SoVertexArrayIndexer::render ( const cc_glglue *  glue,
const SbBool  renderasvbo,
const uint32_t  contextid 
)

Render all added targets/indices.

int SoVertexArrayIndexer::getNumVertices ( void  )

Returns the total number of vertex indices added to the indexer.

int SoVertexArrayIndexer::getNumIndices ( void  ) const

Returns the number of indices in the indexer.

const GLint * SoVertexArrayIndexer::getIndices ( void  ) const

Returns a pointer to the index array.

GLint * SoVertexArrayIndexer::getWriteableIndices ( void  )

Returns a pointer to the index array. It's allowed to reorganize these indices to change the rendering order. Calling this function will invalidate any VBO caches used by the indexer.


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