# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::Array< vector_type, scalar_type, gl_size, 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< vector_type, scalar_type, gl_size, gl_type >:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
virtual int | glSize () const
| Returns the number of scalar components for the array, ie 3 for ArrayFVec3, 1 for ArrayUInt etc.
virtual int | glType () const
| Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFVec3, GL_UNSIGNED_INT for ArrayUInt etc.
virtual ref< ArrayAbstract > | clone () const
void | clear ()
void | resize (int dim)
int | size () const
| Returns the number of elements of an array.
int | sizeGPU () const
int | scalarCount () const
int | scalarCountGPU () const
const vector_type * | begin () const
vector_type * | begin ()
const vector_type * | end () const
vector_type * | end ()
vector_type & | at (int i)
const vector_type & | at (int i) const
vector_type & | operator[] (int i)
const vector_type & | operator[] (int i) const
virtual int | 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 (int vector_index) const
| Returns a vector from the buffer as a `vec4` value.
int | compare (int a, int b) const
| Compares two vectors.
void | operator= (const std::vector< vector_type > &vector)

## Detailed Description

### template<typename vector_type, typename scalar_type, int gl_size, GLenum gl_type>
class vl::Array< vector_type, scalar_type, gl_size, gl_type >

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

See also:

- ArrayAbstract
- vl::ArrayFloat, vl::ArrayFVec2, vl::ArrayFVec3, vl::ArrayFVec4
- vl::ArrayDouble, vl::ArrayDVec2, vl::ArrayDVec3, vl::ArrayDVec4
- vl::ArrayInt, vl::ArrayIVec2, vl::ArrayIVec3, vl::ArrayIVec4
- vl::ArrayUInt, vl::ArrayUVec2, vl::ArrayUVec3, vl::ArrayUVec4
- vl::ArrayByte, vl::ArrayBVec2, vl::ArrayBVec3, vl::ArrayBVec4
- vl::ArrayUByte, vl::ArrayUBVec2, vl::ArrayUBVec3, vl::ArrayUBVec4
- vl::ArrayShort, vl::ArraySVec2, vl::ArraySVec3, vl::ArraySVec4
- vl::ArrayUShort, vl::ArrayUSVec2, vl::ArrayUSVec3, vl::ArrayUSVec4

## Member Function Documentation

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

virtual const char* vl::Array< vector_type, scalar_type, gl_size, gl_type >::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

virtual int vl::Array< vector_type, scalar_type, gl_size, gl_type >::glSize | ( |  | ) | const`[inline, virtual]`

Returns the number of scalar components for the array, ie 3 for ArrayFVec3, 1 for ArrayUInt etc.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

virtual int vl::Array< vector_type, scalar_type, gl_size, gl_type >::glType | ( |  | ) | const`[inline, virtual]`

Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFVec3, GL_UNSIGNED_INT for ArrayUInt etc.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

virtual ref<ArrayAbstract> vl::Array< vector_type, scalar_type, gl_size, gl_type >::clone | ( |  | ) | const`[inline, virtual]`

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

void vl::Array< vector_type, scalar_type, gl_size, gl_type >::clear | ( |  | ) | `[inline]`

Reimplemented from vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

void vl::Array< vector_type, scalar_type, gl_size, gl_type >::resize | ( | int | dim | ) | `[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

int vl::Array< vector_type, scalar_type, gl_size, gl_type >::size | ( |  | ) | const`[inline, virtual]`

Returns the number of elements of an array.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

int vl::Array< vector_type, scalar_type, gl_size, gl_type >::sizeGPU | ( |  | ) | const`[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

int vl::Array< vector_type, scalar_type, gl_size, gl_type >::scalarCount | ( |  | ) | const`[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

int vl::Array< vector_type, scalar_type, gl_size, gl_type >::scalarCountGPU | ( |  | ) | const`[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

const vector_type* vl::Array< vector_type, scalar_type, gl_size, gl_type >::begin | ( |  | ) | const`[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

vector_type* vl::Array< vector_type, scalar_type, gl_size, gl_type >::begin | ( |  | ) | `[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

const vector_type* vl::Array< vector_type, scalar_type, gl_size, gl_type >::end | ( |  | ) | const`[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

vector_type* vl::Array< vector_type, scalar_type, gl_size, gl_type >::end | ( |  | ) | `[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

vector_type& vl::Array< vector_type, scalar_type, gl_size, gl_type >::at | ( | int | i | ) | `[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

const vector_type& vl::Array< vector_type, scalar_type, gl_size, gl_type >::at | ( | int | i | ) | const`[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

vector_type& vl::Array< vector_type, scalar_type, gl_size, gl_type >::operator[] | ( | int | i | ) | `[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

const vector_type& vl::Array< vector_type, scalar_type, gl_size, gl_type >::operator[] | ( | int | i | ) | const`[inline]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

virtual int vl::Array< vector_type, scalar_type, gl_size, gl_type >::bytesPerVector | ( |  | ) | const`[inline, virtual]`

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

Sphere vl::Array< vector_type, scalar_type, gl_size, gl_type >::computeBoundingSphere | ( |  | ) | const`[inline, virtual]`

Computes the bounding sphere enclosing the vectors contained in the buffer.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

AABB vl::Array< vector_type, scalar_type, gl_size, gl_type >::computeBoundingBox | ( |  | ) | const`[inline, virtual]`

Computes the axis aligned bounding box enclosing the vectors contained in the buffer.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

void vl::Array< vector_type, scalar_type, gl_size, gl_type >::transform | ( | const mat4 & | m | ) | `[inline, virtual]`

Transforms the vectors contained in the buffer.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

void vl::Array< vector_type, scalar_type, gl_size, gl_type >::normalize | ( |  | ) | `[inline, virtual]`

Normalizes the vectors contained in the buffer.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

vec4 vl::Array< vector_type, scalar_type, gl_size, gl_type >::vectorAsVec4 | ( | int | vector_index | ) | const`[inline, virtual]`

Returns a vector from the buffer as a `vec4` value.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

int vl::Array< vector_type, scalar_type, gl_size, gl_type >::compare | ( | int | a,
|  | int | b |
| ) |  |  | const`[inline, virtual]`

Compares two vectors.

Implements vl::ArrayAbstract.

template<typename vector_type , typename scalar_type , int gl_size, GLenum gl_type>

void vl::Array< vector_type, scalar_type, gl_size, gl_type >::operator= | ( | const std::vector< vector_type > & | vector | ) | `[inline]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Array.hpp

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:33 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.