OpenGL Volumizer 2.7 Reference Pages


NAME
vzIndexArray - An array of integral indices.

INHERITS FROM
vzObject

HEADER FILE
#include <Volumizer2/IndexArray.h>

PUBLIC METHOD SUMMARY
vzIndexArray ( int numIndices, int* indices);
void setDataPtr ( int numIndices, int* indices);
int* getDataPtr (  ) const;
int getNumIndices (  ) const;

PROTECTED METHOD SUMMARY
virtual ~vzIndexArray (  );

CLASS DESCRIPTION
vzIndexArray provides an abstraction to store an array of integer indices. Used in geometry classes where each primitive is represented by a list of indices which point to entries in a vzVertexArray.

METHOD DESCRIPTIONS

   vzIndexArray()
vzIndexArray ( int numIndices, int* indices);

Constructor for vzIndexArray. Calls setDataPtr() with numIndices and indices as arguments.

   ~vzIndexArray()
virtual ~vzIndexArray (  );

Destructor for vzIndexArray.

   getDataPtr()
int* getDataPtr (  ) const;

Return the pointer to the array of indices.

   getNumIndices()
int getNumIndices (  ) const;

Return the number of indices.

   setDataPtr()
void setDataPtr ( int numIndices, int* indices);

setDataPtr performs a shallow copy of indices: no memory allocation is performed. You must call this method whenever you modify index data to let Volumizer know of the change. You might want to do something like -
// A function which modifies the index values of an index array.
void modifyIndexValues(vzIndexArray *indices) {

    // Get the index values of the array
    int *indexValues = indices->getDataPtr();

    // Get the number of indices in the array
    int numIndices = indices->getNumIndices();

    // Modify the value of a particular index
    indexValues[someIndex] = someValue;

    // Call setDataPtr() to notify the API of the change
    indices->setDataPtr(numIndices, indexValues);
}

SEE ALSO
vzIndexArray, vzObject, vzVertexArray

Back to Index