Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Array class is a template array used to conveniently manipulate data stored in a BufferObject. More...
#include <Array.hpp>
Public Types | |
typedef T_Scalar | scalar_type |
typedef T_VectorType | vector_type |
Public Member Functions | |
virtual size_t | glSize () const |
Returns the number of scalar components for the array, ie 3 for ArrayFloat3, 1 for ArrayUInt1 etc. | |
virtual GLenum | glType () const |
Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFloat3, GL_UNSIGNED_INT for ArrayUInt1 etc. | |
virtual size_t | bytesPerVector () const |
void | clear () |
void | resize (size_t dim) |
size_t | size () const |
Returns the number of elements of an array. | |
size_t | sizeBufferObject () const |
size_t | scalarCount () const |
size_t | scalarCountBufferObject () const |
const T_VectorType * | begin () const |
T_VectorType * | begin () |
const T_VectorType * | end () const |
T_VectorType * | end () |
T_VectorType & | at (size_t i) |
const T_VectorType & | at (size_t i) const |
T_VectorType & | operator[] (size_t i) |
const T_VectorType & | operator[] (size_t i) const |
virtual ref< ArrayAbstract > | createArray () const |
virtual ref< ArrayAbstract > | clone () const |
Sphere | computeBoundingSphere () const |
Computes the bounding sphere enclosing the vectors contained in the buffer. | |
AABB | computeBoundingBox () const |
Computes the axis aligned bounding box enclosing the vectors contained in the buffer. | |
void | transform (const mat4 &m) |
Transforms the vectors contained in the buffer. | |
void | normalize () |
Normalizes the vectors contained in the buffer. | |
vec4 | getAsVec4 (size_t vector_index) const |
Returns a vector from the buffer as a vec4 value. | |
vec3 | getAsVec3 (size_t vector_index) const |
Returns a vector from the buffer as a vec3 value. | |
vec2 | getAsVec2 (size_t vector_index) const |
Returns a vector from the buffer as a vec2 value. | |
int | compare (int a, int b) const |
Compares two vectors. | |
void | initFrom (const std::vector< T_VectorType > &vector) |
Static Public Attributes | |
static const size_t | gl_size = T_GL_Size |
static const GLenum | gl_type = T_GL_Type |
The Array class is a template array used to conveniently manipulate data stored in a BufferObject.
Definition at line 185 of file Array.hpp.
typedef T_Scalar vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalar_type |
typedef T_VectorType vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::vector_type |
virtual size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::glSize | ( | ) | const [inline, virtual] |
Returns the number of scalar components for the array, ie 3 for ArrayFloat3, 1 for ArrayUInt1 etc.
Implements vl::ArrayAbstract.
virtual GLenum vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::glType | ( | ) | const [inline, virtual] |
Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFloat3, GL_UNSIGNED_INT for ArrayUInt1 etc.
Implements vl::ArrayAbstract.
virtual size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::bytesPerVector | ( | ) | const [inline, virtual] |
Definition at line 199 of file Array.hpp.
Referenced by vl::Array< bvec2, GLbyte, 2, GL_BYTE >::resize(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::size(), and vl::Array< bvec2, GLbyte, 2, GL_BYTE >::sizeBufferObject().
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clear | ( | ) | [inline] |
Reimplemented from vl::ArrayAbstract.
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize | ( | size_t | dim ) | [inline] |
Definition at line 205 of file Array.hpp.
Referenced by vl::Array< bvec2, GLbyte, 2, GL_BYTE >::clear(), vl::Geometry::fixTriangleWinding(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::initFrom(), vl::loadMD2(), and vl::Geometry::mergeDrawCallsWithTriangles().
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size | ( | ) | const [inline, virtual] |
Returns the number of elements of an array.
Implements vl::ArrayAbstract.
Definition at line 207 of file Array.hpp.
Referenced by vl::Array< bvec2, GLbyte, 2, GL_BYTE >::at(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::clone(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::computeBoundingBox(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::computeBoundingSphere(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::end(), vl::Geometry::fixTriangleWinding(), vl::Geometry::flipNormals(), vl::loadMD2(), vl::Geometry::mergeDrawCallsWithTriangles(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::normalize(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::scalarCount(), vl::Geometry::sortVertices(), and vl::Array< bvec2, GLbyte, 2, GL_BYTE >::transform().
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::sizeBufferObject | ( | ) | const [inline] |
Definition at line 209 of file Array.hpp.
Referenced by vl::Array< bvec2, GLbyte, 2, GL_BYTE >::scalarCountBufferObject().
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCount | ( | ) | const [inline] |
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCountBufferObject | ( | ) | const [inline] |
const T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::begin | ( | ) | const [inline] |
T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::begin | ( | ) | [inline] |
const T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end | ( | ) | const [inline] |
T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end | ( | ) | [inline] |
T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at | ( | size_t | i ) | [inline] |
Definition at line 227 of file Array.hpp.
Referenced by vl::Array< bvec2, GLbyte, 2, GL_BYTE >::compare(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::computeBoundingBox(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::computeBoundingSphere(), vl::Geometry::flipNormals(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::getAsVec2(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::getAsVec3(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::getAsVec4(), vl::loadMD2(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::normalize(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::operator[](), vl::Geometry::sortVertices(), and vl::Array< bvec2, GLbyte, 2, GL_BYTE >::transform().
const T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at | ( | size_t | i ) | const [inline] |
T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator[] | ( | size_t | i ) | [inline] |
const T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator[] | ( | size_t | i ) | const [inline] |
virtual ref<ArrayAbstract> vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::createArray | ( | ) | const [inline, virtual] |
Definition at line 237 of file Array.hpp.
Referenced by vl::Array< bvec2, GLbyte, 2, GL_BYTE >::clone().
virtual ref<ArrayAbstract> vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clone | ( | ) | const [inline, virtual] |
Implements vl::ArrayAbstract.
Sphere vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::computeBoundingSphere | ( | ) | const [inline, virtual] |
Computes the bounding sphere enclosing the vectors contained in the buffer.
Implements vl::ArrayAbstract.
AABB vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::computeBoundingBox | ( | ) | const [inline, virtual] |
Computes the axis aligned bounding box enclosing the vectors contained in the buffer.
Implements vl::ArrayAbstract.
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::transform | ( | const mat4 & | m ) | [inline, virtual] |
Transforms the vectors contained in the buffer.
Implements vl::ArrayAbstract.
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::normalize | ( | ) | [inline, virtual] |
Normalizes the vectors contained in the buffer.
Implements vl::ArrayAbstract.
vec4 vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::getAsVec4 | ( | size_t | vector_index ) | const [inline, virtual] |
Returns a vector from the buffer as a vec4
value.
Implements vl::ArrayAbstract.
vec3 vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::getAsVec3 | ( | size_t | vector_index ) | const [inline, virtual] |
Returns a vector from the buffer as a vec3
value.
Implements vl::ArrayAbstract.
vec2 vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::getAsVec2 | ( | size_t | vector_index ) | const [inline, virtual] |
Returns a vector from the buffer as a vec2
value.
Implements vl::ArrayAbstract.
int vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::compare | ( | int | a, |
int | b | ||
) | const [inline, virtual] |
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::initFrom | ( | const std::vector< T_VectorType > & | vector ) | [inline] |