#include <sglGeoStripSet.hpp>
Inheritance diagram for sglGeoStripSet::
Public Methods | |
sglGeoStripSet () | |
virtual | ~sglGeoStripSet () |
virtual unsigned int | getPrimSize () const |
sglDataPtr* | getPrimLengths () 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 |
Friends | |
class | Initializer |
{\bf Concrete subclasses: sglLineStripSet, sglTriangleFanSet, sglTriangleStripSet, sglQuadStripSet, sglPolygonSet}
These are the concrete subclasses of sglGeoStripSet that can be instantiated by the user. The example below illustrates the creation of an sglTriangleStripSet with two strips of lengths 6 and 4 with per primitive normal attributes, and overall color attribute.
{\bf Example:} \begin{verbatim} unsigned int *lengths = new lengths[2]; lengths[0] = 6; // implies use of vertices[0..5] lengths[1] = 4; // implies use of vertices[6..9]
sglVec3f *vertex = new sglVec4f[10]; vertex[0].set(0.0f, 0.0f, 0.0f); // 1st primitive: 4 triangles in a strip vertex[1].set(5.0f, 0.0f, 0.0f); vertex[2].set(0.0f, 4.0f, 0.0f); vertex[3].set(5.0f, 4.0f, 0.0f); vertex[4].set(0.0f, 8.0f, 0.0f); vertex[5].set(5.0f, 8.0f, 0.0f);
vertex[6].set(5.0f, 0.0f, 0.0f); // 2nd primitive: 2 triangles in a strip vertex[7].set(0.0f, 0.0f, 0.0f); vertex[8].set(5.0f, 0.0f, 4.0f); vertex[9].set(0.0f, 0.0f, 4.0f);
sglVec4f *color = new sglVec4f[1]; color[0].set(1.0f, 0.0f, 0.0f, 1.0f); // both strips red
sglVec3f *normal = new sglVec3f[2]; // one normal for each primitive normal[0].set(0.0f,0.0f,1.0f); normal[1].set(0.0f,1.0f,0.0f);
sglTriangleStripSet *tstrip = new sglTriangleStripSet; tstrip->setNumPrims(2); tstrip->setPrimLengths(lengths) tstrip->setCoordList(vertex); // sglGeoSet::ePER_VERTEX is implied tstrip->setColorList(sglGeoSet::eOVERALL, color); tstrip->setNormalList(sglGeoSet::ePER_PRIM, normal); \end{verbatim}
Definition at line 89 of file sglGeoStripSet.hpp.
|
default constructor.
|
|
virtual destructor.
|
|
Not very useful for variable sized primitives.
Reimplemented from sglGeoSet. Definition at line 98 of file sglGeoStripSet.hpp. |
|
Get the lengths array (for strip and poly primitives only).
Definition at line 101 of file sglGeoStripSet.hpp. |
|
Set the array of lengths. Deprecated.
Definition at line 104 of file sglGeoStripSet.hpp. |
|
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.
|
|
Get the number of bytes in the array before the first length.
Definition at line 124 of file sglGeoStripSet.hpp. |
|
Get the number of bytes from the start of one length to the next.
Definition at line 127 of file sglGeoStripSet.hpp. |
|
Add this drawable's stats to the given sglStats.
Reimplemented from sglGeoSet. |
|
Compute the bounding box for this geometry and fill in the member variable, m_bbox, in this class.
Reimplemented from sglGeoSet. |