Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Types | Public Member Functions

vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type > Class Template Reference

The Array class is a template array used to conveniently manipulate data stored in a GLBufferObject. More...

#include <Array.hpp>

Inheritance diagram for vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >:
vl::ArrayAbstract vl::Object

List of all members.

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< ArrayAbstractclone () 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)

Detailed Description

template<typename T_VectorType, typename T_Scalar, int T_GL_Size, GLenum T_GL_Type>
class vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >

The Array class is a template array used to conveniently manipulate data stored in a GLBufferObject.

See also:

Definition at line 181 of file Array.hpp.


Member Typedef Documentation

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
typedef T_Scalar vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalar_type

Definition at line 185 of file Array.hpp.


Member Function Documentation

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_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.

Definition at line 184 of file Array.hpp.

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_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.

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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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.

Definition at line 188 of file Array.hpp.

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
virtual ref<ArrayAbstract> vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clone (  ) const [inline, virtual]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clear (  ) [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize ( size_t  dim ) [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size (  ) const [inline, virtual]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::sizeGPU (  ) const [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCount (  ) const [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCountGPU (  ) const [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
const T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end (  ) const [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end (  ) [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at ( size_t  i ) [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
const T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at ( size_t  i ) const [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator[] ( size_t  i ) [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
const T_VectorType& vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator[] ( size_t  i ) const [inline]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
virtual size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::bytesPerVector (  ) const [inline, virtual]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::transform ( const mat4 m ) [inline, virtual]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::normalize (  ) [inline, virtual]
template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
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().

template<typename T_VectorType , typename T_Scalar , int T_GL_Size, GLenum T_GL_Type>
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::operator= ( const std::vector< T_VectorType > &  vector ) [inline]

The documentation for this class was generated from the following file:

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:32.
Permission is granted to use this page to write and publish articles regarding Visualization Library.