Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglMonoIndexedGeoStripSet Class Reference

#include <sglMonoIndexedGeoStripSet.hpp>

Inheritance diagram for sglMonoIndexedGeoStripSet::

sglMonoIndexedGeoSet sglGeoSet sglDrawable sglObject sglMonoIndexedLineStripSet sglMonoIndexedPolygonSet sglMonoIndexedQuadStripSet sglMonoIndexedTriangleFanSet sglMonoIndexedTriangleStripSet List of all members.

Public Methods

 sglMonoIndexedGeoStripSet ()
virtual ~sglMonoIndexedGeoStripSet ()
virtual unsigned int getPrimSize () const
sglDataPtrgetPrimLengths () const
void setPrimLengths (sglIndexType *alist)
void setPrimLengths (sglDataPtr *data, int offset=0, int stride=0)
int getPrimLengthsOffset () const
int getPrimLengthsStride () const
virtual void addStats (sglStats &stats) const

Protected Methods

virtual bool computeBounds ()
virtual void updateDrawFunc ()

Protected Attributes

sglIndexPtr m_lengths


class  Initializer

Detailed Description

This abstract class extends the sglMonoIndexedGeoSet class to include the lengths array needed to completely specify the variable length primitive types.

{\bf Concrete subclasses: sglMonoIndexedLineStripSet, sglMonoIndexedTriangleFanSet, sglMonoIndexedTriangleStripSet, sglMonoIndexedQuadStripSet, sglMonoIndexedPolygonSet}

These are the concrete subclasses of sglMonoIndexedGeoStripSet that implement the line strip, triangle fan, triangle strip, quad strip, and polygon primitives.

{\bf Example:} \begin{verbatim} unsigned int *lengths = new unsigned int[1]; lengths[0] = 5;

sglVec3f *vertex = new sglVec3f[5]; vertex[0].set( 0.0f, 1.0f, 0.0f); vertex[1].set( 1.0f, 0.0f, 0.0f); vertex[2].set( 1.0f,-1.0f, 0.0f); vertex[3].set(-1.0f,-1.0f, 0.0f); vertex[4].set(-1.0f, 0.0f, 0.0f);

sglVec4f *color = new sglVec4f[5]; color[0].set( 1.0f, 0.0f, 0.0f, 1.0f); color[1].set( 0.0f, 1.0f, 0.0f, 1.0f); color[2].set( 1.0f, 0.0f, 0.0f, 1.0f); color[3].set( 0.0f, 1.0f, 0.0f, 1.0f); color[4].set( 1.0f, 0.0f, 0.0f, 1.0f);

unsigned int *index = new unsigned int[5]; index[0] = 0; // indices for a pentagon (irregular) index[1] = 1; index[2] = 2; index[3] = 3; index[4] = 4;

sglMonoIndexedPolygonSet *poly_set = new sglMonoIndexedPolygonSet; poly_set->setNumPrims(1); poly_set->setPrimLengths(lengths); poly_set->setCoordList(vertex); poly_set->setColorList(sglGeoSet::ePER_VERTEX, color); // uses index array poly_set->setIndexList(index); \end{verbatim}

Definition at line 80 of file sglMonoIndexedGeoStripSet.hpp.

Constructor & Destructor Documentation

sglMonoIndexedGeoStripSet::sglMonoIndexedGeoStripSet ( )

default constructor.

sglMonoIndexedGeoStripSet::~sglMonoIndexedGeoStripSet ( ) [virtual]

virtual destructor.

Member Function Documentation

unsigned int sglMonoIndexedGeoStripSet::getPrimSize ( ) const [inline, virtual]

Not very useful for variable sized primitives.

Reimplemented from sglGeoSet.

Definition at line 89 of file sglMonoIndexedGeoStripSet.hpp.

sglDataPtr * sglMonoIndexedGeoStripSet::getPrimLengths ( ) const [inline]

Get the lengths array.

Definition at line 92 of file sglMonoIndexedGeoStripSet.hpp.

void sglMonoIndexedGeoStripSet::setPrimLengths ( sglIndexType * alist ) [inline]

Set the array of lengths. Deprecated.

Definition at line 95 of file sglMonoIndexedGeoStripSet.hpp.

void sglMonoIndexedGeoStripSet::setPrimLengths ( sglDataPtr * data,
int offset = 0,
int stride = 0 )

Set the array of lengths. This will increment the reference count on the given data pointer, and decrement the reference count of the previous data pointer. If the previous data pointer's refernce count goes to zero, it will be deleted. The lengths must be of type sglIndexType.

data   Pointer to the list of lengths.
offset   Number of bytes in the array before the first length.
stride   Number of bytes from the start of one length to the start of the next length. If zero, the lengths are assumed to be tightly packed (i.e. stride == sizeof(type)). Stride must be non-negative.

int sglMonoIndexedGeoStripSet::getPrimLengthsOffset ( ) const [inline]

Get the number of bytes in the array before the first length.

Definition at line 115 of file sglMonoIndexedGeoStripSet.hpp.

int sglMonoIndexedGeoStripSet::getPrimLengthsStride ( ) const [inline]

Get the number of bytes from the start of one length to the next.

Definition at line 118 of file sglMonoIndexedGeoStripSet.hpp.

void sglMonoIndexedGeoStripSet::addStats ( sglStats & stats ) const [virtual]

Add this drawable's stats to the given sglStats.

Reimplemented from sglGeoSet.

virtual bool sglMonoIndexedGeoStripSet::computeBounds ( ) [protected, virtual]

Compute the bounding box for this geometry and fill in the member variable, m_bbox, in this class.

true if successful (all information is available for computing a bounding box), otherwise false.

Reimplemented from sglMonoIndexedGeoSet.

The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:09 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001