SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
InterleavedArraysShape Class Reference

The InterleavedArraysShape class is used to render static geometry very fast. More...

#include <SmallChange/nodes/InterleavedArraysShape.h>

Inheritance diagram for InterleavedArraysShape:
SoVertexShape

Public Types

enum  Type { POINTS , LINES , TRIANGLES , QUADS , TRIANGLE_STRIP , QUAD_STRIP }
 

Public Member Functions

 InterleavedArraysShape (void)
 
virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
 
virtual void GLRender (SoGLRenderAction *action)
 
virtual void rayPick (SoRayPickAction *action)
 

Static Public Member Functions

static void initClass (void)
 

Public Attributes

SoSFEnum type
 
SoMFInt32 vertexIndex
 

Protected Member Functions

virtual ~InterleavedArraysShape ()
 
virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
 
virtual void generatePrimitives (SoAction *action)
 
virtual void notify (SoNotList *nl)
 

Detailed Description

The InterleavedArraysShape class is used to render static geometry very fast.

It creates a VBO (vertex buffer object) vertex cache internally, and all vertex data will be interleaved for maximum rendering performance. If you change one vertex attribute, for instance the normals, the entire cache needs to be rebuilt, and this is why this shape is best suited for relatively static geometry.

To achieve this caching and reduce overhead, it will only render the contents of its SoVertexShape::vertexProperty node, it will not pick up any vertex properties from the state.

This shape only supports OVERALL and PER_VERTEX[_INDEXED] material/normal bindings. If some binding is set to something other than OVERALL, it will be interpreted as PER_VERTEX[_INDEXED], if the SoVertexProperty node contains sufficient data to render that attribute per vertex.

Member Enumeration Documentation

◆ Type

The type of primitives supported by this shape.

Enumerator
POINTS 

For rendering points.

LINES 

For rendering lines.

TRIANGLES 

For rendering triangles.

QUADS 

For rendering quads.

Constructor & Destructor Documentation

◆ InterleavedArraysShape()

InterleavedArraysShape::InterleavedArraysShape ( void )

Constructor.

◆ ~InterleavedArraysShape()

InterleavedArraysShape::~InterleavedArraysShape ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ initClass()

void InterleavedArraysShape::initClass ( void )
static

Required Coin method.

Member Data Documentation

◆ type

SoSFEnum InterleavedArraysShape::type

The type of geometry to render.

◆ vertexIndex

SoMFInt32 InterleavedArraysShape::vertexIndex

Optional field for specifying vertex indices. If this field is empty, the shape will render all vertices in its SoVertexProperty node (using glDrawArrays()).


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