Dynamic allocator for GL types (run-time resolution of type). More...
#include <HdlDynamicData.hpp>
Inherited by Glip::CoreGL::HdlDynamicDataSpecial< T >.
Public Member Functions | |
const GLenum & | getGLType (void) const |
Get the type of the current data as the GL identifier. More... | |
const GLenum & | getGLSupportingType (void) const |
Get the supporting type of the current data as the GL identifier. More... | |
const bool & | isFloatingPointType (void) const |
Test if the content is of floating point type. More... | |
const bool & | isIntegerType (void) const |
Test if the content is of integer type. More... | |
const bool & | isBooleanType (void) const |
Test if the content is of boolean type. More... | |
const bool & | isUnsignedType (void) const |
Test if the content is of unsigned type. More... | |
const int & | getNumRows (void) const |
Get the number of rows of the data. More... | |
const int & | getNumColumns (void) const |
Get the number of columns of the data. More... | |
int | getNumElements (void) const |
Get the number of elements of the matrix (rows times columns). More... | |
bool | isInside (const int &i, const int &j) const |
Test if the coordinates are for a valid element inside the matrix. More... | |
int | getIndex (const int &i, const int &j) const |
Get the linear index corresponding to these coordinates. More... | |
void | getCoordinates (const int &index, int &i, int &j) const |
Get the coordinates from the linear index. More... | |
virtual float | getf (const int &i=0, const int &j=0) const =0 |
Get the value at coordinates (i, j) casted to float. More... | |
virtual void | setf (const float &value, const int &i=0, const int &j=0)=0 |
Set the value at coordinates (i, j) from a float value. More... | |
virtual double | get (const int &i=0, const int &j=0) const =0 |
Get the value at coordinates (i, j) casted to double. More... | |
virtual void | set (const double &value, const int &i=0, const int &j=0)=0 |
Set the value at coordinates (i, j) from a double value. More... | |
virtual const void * | getPtr (void) const =0 |
Get the pointer to the data (const). More... | |
virtual void * | getPtr (void)=0 |
Get the pointer to the data. More... | |
virtual const HdlDynamicData & | operator= (const HdlDynamicData &cpy)=0 |
Copy the value from another HdlDynamicData object. Type MUST match, will raise an exception otherwise. More... | |
Static Public Member Functions | |
static HdlDynamicData * | build (const GLenum &type) |
Build dynamic data from a GL data identifier (see supported types in main description of HdlDynamicData). More... | |
static HdlDynamicData * | copy (const HdlDynamicData &cpy) |
Copy dynamic data. More... | |
Dynamic allocator for GL types (run-time resolution of type).
Supported types : GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT; GL_FLOAT, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, GL_DOUBLE, GL_DOUBLE_VEC2, GL_DOUBLE_VEC3, GL_DOUBLE_VEC4, GL_INT, GL_INT_VEC2, GL_INT_VEC3, GL_INT_VEC4, GL_UNSIGNED_INT, GL_UNSIGNED_INT_VEC2, GL_UNSIGNED_INT_VEC3, GL_UNSIGNED_INT_VEC4, GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4, GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FLOAT_MAT4. The indexing is column major (matrix-like).
Example :
|
static |
Build dynamic data from a GL data identifier (see supported types in main description of HdlDynamicData).
type | The required GL type. |
|
static |
Copy dynamic data.
cpy | The original element to be copied. |
|
pure virtual |
Get the value at coordinates (i, j) casted to double.
i | The index of the row. |
j | The index of the column. |
void HdlDynamicData::getCoordinates | ( | const int & | index, |
int & | i, | ||
int & | j | ||
) | const |
Get the coordinates from the linear index.
index | The linear index. |
i | The index of the row (as output). |
j | The index of the column (as output). |
|
pure virtual |
Get the value at coordinates (i, j) casted to float.
i | The index of the row. |
j | The index of the column. |
const GLenum & HdlDynamicData::getGLSupportingType | ( | void | ) | const |
Get the supporting type of the current data as the GL identifier.
const GLenum & HdlDynamicData::getGLType | ( | void | ) | const |
Get the type of the current data as the GL identifier.
int HdlDynamicData::getIndex | ( | const int & | i, |
const int & | j | ||
) | const |
Get the linear index corresponding to these coordinates.
i | The index of the row. |
j | The index of the column. |
const int & HdlDynamicData::getNumColumns | ( | void | ) | const |
Get the number of columns of the data.
int HdlDynamicData::getNumElements | ( | void | ) | const |
Get the number of elements of the matrix (rows times columns).
const int & HdlDynamicData::getNumRows | ( | void | ) | const |
Get the number of rows of the data.
|
pure virtual |
Get the pointer to the data (const).
|
pure virtual |
Get the pointer to the data.
const bool & HdlDynamicData::isBooleanType | ( | void | ) | const |
Test if the content is of boolean type.
const bool & HdlDynamicData::isFloatingPointType | ( | void | ) | const |
Test if the content is of floating point type.
bool HdlDynamicData::isInside | ( | const int & | i, |
const int & | j | ||
) | const |
Test if the coordinates are for a valid element inside the matrix.
i | The index of the row. |
j | The index of the column. |
const bool & HdlDynamicData::isIntegerType | ( | void | ) | const |
Test if the content is of integer type.
const bool & HdlDynamicData::isUnsignedType | ( | void | ) | const |
Test if the content is of unsigned type.
|
pure virtual |
Copy the value from another HdlDynamicData object. Type MUST match, will raise an exception otherwise.
cpy | The object to be copied. |
|
pure virtual |
Set the value at coordinates (i, j) from a double value.
value | The new value. |
i | The index of the row. |
j | The index of the column. |
|
pure virtual |
Set the value at coordinates (i, j) from a float value.
value | The new value. |
i | The index of the row. |
j | The index of the column. |