#include <sglIndexedGeoSet.hpp>
Inheritance diagram for sglIndexedGeoSet::
Public Methods | |
sglIndexedGeoSet () | |
virtual | ~sglIndexedGeoSet () |
void | setCoordIndexList (sglIndexType *alist) |
void | setCoordIndexList (sglDataPtr *data, int offset=0, int stride=0) |
void | setNormalIndexList (sglIndexType *alist) |
void | setNormalIndexList (sglDataPtr *data, int offset=0, int stride=0) |
void | setTexCoordIndexList (sglIndexType *alist) |
void | setTexCoordIndexList (sglDataPtr *data, int offset=0, int stride=0) |
void | setColorIndexList (sglIndexType *alist) |
void | setColorIndexList (sglDataPtr *data, int offset=0, int stride=0) |
sglDataPtr* | getCoordIndexList () const |
sglDataPtr* | getNormalIndexList () const |
sglDataPtr* | getTexCoordIndexList () const |
sglDataPtr* | getColorIndexList () const |
int | getCoordIndexOffset () const |
int | getNormalIndexOffset () const |
int | getTexCoordIndexOffset () const |
int | getColorIndexOffset () const |
int | getCoordIndexStride () const |
int | getNormalIndexStride () const |
int | getTexCoordIndexStride () const |
int | getColorIndexStride () const |
Protected Methods | |
virtual bool | computeBounds () |
Protected Attributes | |
sglIndexPtr | m_vindex |
sglIndexPtr | m_nindex |
sglIndexPtr | m_tindex |
sglIndexPtr | m_cindex |
Note that if one attribute array (coord, normal, color, and texcoord) is indexed, then all of them have to be indexed. The exception to this rule is if the color or normal attributes are bound as sglGeoSet::eOVERALL (that is, no index array is needed in this case). Each attribute can have its own index array or share them in any combination.
The index arrays consist of unsigned ints. Should the indexed arrays be unsigned shorts to reduce storage requirements? The original need for index arrays that could index into attribute arrays larger than 2^16 may no longer be there.
{\bf Concrete subclasses: sglIndexedPointSet, sglIndexedLineSet, sglIndexedTriangleSet, sglIndexedQuadSet}
These are the concrete subclasses of sglIndexedGeoSet that implement the point, line segment, triangle and quad primitives.
{\bf Example:}
\begin{verbatim} sglVec3f *vertex = new sglVec3f[6]; vertex[0].set( 0.0f, 0.0f, 0.0f); vertex[1].set( 0.0f, 1.0f, 0.0f); vertex[2].set( 1.0f, 0.0f, 0.0f); vertex[3].set( 1.0f,-1.0f, 0.0f); vertex[4].set(-1.0f,-1.0f, 0.0f); vertex[5].set(-1.0f, 0.0f, 0.0f);
sglVec4f *color = new sglVec4f[3]; 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( 0.0f, 0.0f, 1.0f, 1.0f);
unsigned int *vindex = new unsigned int[10]; vindex[0] = 0; vindex[1] = 1; // indices for a five pointed star (sorta) vindex[2] = 0; vindex[3] = 2; vindex[4] = 0; vindex[5] = 3; vindex[6] = 0; vindex[7] = 4; vindex[8] = 0; vindex[9] = 5;
unsigned int *cindex = new unsigned int[5]; cindex[0] = 0; cindex[1] = 1; cindex[2] = 2; cindex[3] = 2; cindex[4] = 1;
sglIndexedLineSet *line_gset = new sglIndexedLineSet; line_gset->setNumPrims(5); line_gset->setCoordList(vertex); line_gset->setCoordIndexList(vindex); line_gset->setColorList(sglGeoSet::ePER_PRIM, color); line_gset->setColorIndexList(cindex); \end{verbatim}
Definition at line 100 of file sglIndexedGeoSet.hpp.
|
default constructor.
|
|
virtual destructor.
|
|
Set the array of vertex indices. Deprecated.
Definition at line 109 of file sglIndexedGeoSet.hpp. |
|
Set the array of vertex indices. 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 indices must be of type sglIndexType.
|
|
Set the array of normal indices. Deprecated.
Definition at line 130 of file sglIndexedGeoSet.hpp. |
|
Set the array of vertex indices. 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 indices must be of type sglIndexType.
|
|
Set the array of texture coordinate indices. Deprecated.
Definition at line 151 of file sglIndexedGeoSet.hpp. |
|
Set the array of texture coordinate indices. 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 indices must be of type sglIndexType.
|
|
Set the array of color indices. Deprecated.
Definition at line 172 of file sglIndexedGeoSet.hpp. |
|
Set the array of color indices. 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 indices must be of type sglIndexType.
|
|
get the current vertex, normal, color, texcoord attribute lists.
Definition at line 193 of file sglIndexedGeoSet.hpp. |
|
Get the number of bytes in the array before the first index.
Definition at line 202 of file sglIndexedGeoSet.hpp. |
|
Get the number of bytes from the start of one index to the next.
Definition at line 211 of file sglIndexedGeoSet.hpp. |
|
Compute the bounding box for this geometry and fill in the member variable, m_bbox, in this class.
Reimplemented from sglGeoSet. Reimplemented in sglIndexedGeoStripSet. |