Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The Array class is a template array used to conveniently manipulate data stored in a GLBufferObject. More...
#include <Array.hpp>
Public Types | |
| typedef T_Scalar | scalar_type |
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| virtual size_t | glSize () const |
| Returns the number of scalar components for the array, ie 3 for ArrayFloat3, 1 for ArrayUInt1 etc. | |
| virtual int | glType () const |
| Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFloat3, GL_UNSIGNED_INT for ArrayUInt1 etc. | |
| virtual ref< ArrayAbstract > | clone () const |
| void | clear () |
| void | resize (size_t dim) |
| size_t | size () const |
| Returns the number of elements of an array. | |
| size_t | sizeGPU () const |
| size_t | scalarCount () const |
| size_t | scalarCountGPU () 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 size_t | bytesPerVector () 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 | vectorAsVec4 (size_t vector_index) const |
Returns a vector from the buffer as a vec4 value. | |
| vec3 | vectorAsVec3 (size_t vector_index) const |
Returns a vector from the buffer as a vec3 value. | |
| int | compare (int a, int b) const |
| Compares two vectors. | |
| void | operator= (const std::vector< T_VectorType > &vector) |
The Array class is a template array used to conveniently manipulate data stored in a GLBufferObject.
Definition at line 181 of file Array.hpp.
| typedef T_Scalar vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalar_type |
| virtual const char* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::ArrayAbstract.
| 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.
Definition at line 187 of file Array.hpp.
Referenced by vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCount(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCountGPU().
| virtual int 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 ref<ArrayAbstract> vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clone | ( | ) | const [inline, virtual] |
Implements vl::ArrayAbstract.
Definition at line 190 of file Array.hpp.
References vl::ArrayAbstract::bytesUsed(), vl::ArrayAbstract::ptr(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clear | ( | ) | [inline] |
Reimplemented from vl::ArrayAbstract.
Definition at line 201 of file Array.hpp.
References vl::GLBufferObject::deleteGLBufferObject(), vl::ArrayAbstract::gpuBuffer(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize().
| void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize | ( | size_t | dim ) | [inline] |
Definition at line 202 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::bytesPerVector(), vl::ArrayAbstract::gpuBuffer(), vl::Buffer::resize(), and vl::ArrayAbstract::setVBODirty().
Referenced by vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clear(), vl::loadMD2(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator=(), vl::PolygonSimplifier::simplify(), and vl::Geometry::sortVertices().
| 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 203 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::bytesPerVector(), and vl::ArrayAbstract::bytesUsed().
Referenced by vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clone(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::computeBoundingBox(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::computeBoundingSphere(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end(), vl::Geometry::flipNormals(), vl::loadMD2(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::normalize(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCount(), vl::PolygonSimplifier::simplify(), vl::Geometry::sortVertices(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::transform().
| size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::sizeGPU | ( | ) | const [inline] |
Definition at line 204 of file Array.hpp.
References vl::GLBufferObject::byteCountGPU(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::bytesPerVector(), and vl::ArrayAbstract::gpuBuffer().
Referenced by vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCountGPU().
| size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCount | ( | ) | const [inline] |
Definition at line 205 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::glSize(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCountGPU | ( | ) | const [inline] |
Definition at line 206 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::glSize(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::sizeGPU().
| const T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::begin | ( | ) | const [inline] |
Definition at line 208 of file Array.hpp.
References vl::ArrayAbstract::ptr().
| T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::begin | ( | ) | [inline] |
Definition at line 209 of file Array.hpp.
References vl::ArrayAbstract::ptr().
| const T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end | ( | ) | const [inline] |
Definition at line 211 of file Array.hpp.
References vl::ArrayAbstract::ptr(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end | ( | ) | [inline] |
Definition at line 212 of file Array.hpp.
References vl::ArrayAbstract::ptr(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at | ( | size_t | i ) | [inline] |
Definition at line 214 of file Array.hpp.
References vl::ArrayAbstract::ptr(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size(), and VL_CHECK.
Referenced by vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::compare(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::computeBoundingBox(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::computeBoundingSphere(), vl::EdgeExtractor::extractEdges(), vl::Geometry::flipNormals(), vl::RayIntersector::intersectGeometry(), vl::loadMD2(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::normalize(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator[](), vl::Geometry::sortVertices(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::transform(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::vectorAsVec3(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::vectorAsVec4().
| const T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at | ( | size_t | i ) | const [inline] |
Definition at line 215 of file Array.hpp.
References vl::ArrayAbstract::ptr(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size(), and VL_CHECK.
| T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator[] | ( | size_t | i ) | [inline] |
Definition at line 217 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at().
| const T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator[] | ( | size_t | i ) | const [inline] |
Definition at line 218 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at().
| virtual size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::bytesPerVector | ( | ) | const [inline, virtual] |
Definition at line 220 of file Array.hpp.
Referenced by vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::sizeGPU().
| 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.
Definition at line 222 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::AABB::center(), vl::Vector3< T_Scalar >::ptr(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size(), and vl::sqrt().
| 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.
Definition at line 249 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::Vector3< T_Scalar >::ptr(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| 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.
Definition at line 264 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::Vector4< T_Scalar >::ptr(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| 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.
Definition at line 281 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::Vector4< T_Scalar >::normalize(), vl::Vector4< T_Scalar >::ptr(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size().
| vec4 vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::vectorAsVec4 | ( | size_t | vector_index ) | const [inline, virtual] |
Returns a vector from the buffer as a vec4 value.
Implements vl::ArrayAbstract.
Definition at line 298 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), and vl::Vector4< T_Scalar >::ptr().
| vec3 vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::vectorAsVec3 | ( | size_t | vector_index ) | const [inline, virtual] |
Returns a vector from the buffer as a vec3 value.
Implements vl::ArrayAbstract.
Definition at line 307 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), and vl::Vector3< T_Scalar >::ptr().
| int vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::compare | ( | int | a, |
| int | b | ||
| ) | const [inline, virtual] |
Compares two vectors.
Implements vl::ArrayAbstract.
Definition at line 317 of file Array.hpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at().
| void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator= | ( | const std::vector< T_VectorType > & | vector ) | [inline] |
Definition at line 327 of file Array.hpp.
References vl::ArrayAbstract::ptr(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize().