Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Types | Public Member Functions | Static Public Attributes

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 BufferObject. 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
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< ArrayAbstractcreateArray () const
virtual ref< ArrayAbstractclone () 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

Detailed Description

template<typename T_VectorType, typename T_Scalar, size_t 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 BufferObject.

See also:

Definition at line 185 of file Array.hpp.


Member Typedef Documentation

template<typename T_VectorType, typename T_Scalar, size_t 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 190 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
typedef T_VectorType vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::vector_type

Definition at line 191 of file Array.hpp.


Member Function Documentation

template<typename T_VectorType, typename T_Scalar, size_t 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 195 of file Array.hpp.

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

Definition at line 197 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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, size_t T_GL_Size, GLenum T_GL_Type>
void vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clear (  ) [inline]

Reimplemented from vl::ArrayAbstract.

Definition at line 203 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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, size_t 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, size_t T_GL_Size, GLenum T_GL_Type>
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::sizeBufferObject (  ) const [inline]
template<typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCount (  ) const [inline]

Definition at line 211 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalarCountBufferObject (  ) const [inline]

Definition at line 213 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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 217 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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 219 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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]

Definition at line 221 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
T_VectorType* vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::end (  ) [inline]

Definition at line 223 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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, size_t 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]

Definition at line 229 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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]

Definition at line 231 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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]

Definition at line 233 of file Array.hpp.

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

template<typename T_VectorType, typename T_Scalar, size_t 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]

Implements vl::ArrayAbstract.

Definition at line 239 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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 252 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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 279 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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]

Transforms the vectors contained in the buffer.

Implements vl::ArrayAbstract.

Definition at line 294 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
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 311 of file Array.hpp.

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

Definition at line 328 of file Array.hpp.

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

Definition at line 337 of file Array.hpp.

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

Definition at line 347 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t 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 357 of file Array.hpp.

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

Definition at line 367 of file Array.hpp.


Member Data Documentation

template<typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
const size_t vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::gl_size = T_GL_Size [static]

Definition at line 192 of file Array.hpp.

template<typename T_VectorType, typename T_Scalar, size_t T_GL_Size, GLenum T_GL_Type>
const GLenum vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::gl_type = T_GL_Type [static]

Definition at line 193 of file Array.hpp.


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:09.
Permission is granted to use this page to write and publish articles regarding Visualization Library.