# Visualization Library

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

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

# vl::ArrayAbstract Class Reference

The ArrayAbstract class defines an abstract interface to conveniently manipulate data stored in a GLBufferObject. More...

`#include <Array.hpp>`

Inheritance diagram for vl::ArrayAbstract:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| ArrayAbstract ()
| Default constructor.
| ArrayAbstract (const ArrayAbstract &other)
| Copies only the local data and not the VBO related fields.
void | operator= (const ArrayAbstract &other)
| Copies only the local data and not the VBO related fields.
virtual ref< ArrayAbstract > | clone () const =0
const GLBufferObject * | gpuBuffer () const
GLBufferObject * | gpuBuffer ()
void | clear ()
const unsigned char * | ptr () const
| Returns the pointer to the first element of the local buffer. Equivalent to gpuBuffer()->ptr().
unsigned char * | ptr ()
| Returns the pointer to the first element of the local buffer. Equivalent to gpuBuffer()->ptr().
virtual int | bytesUsed () const
| Returns the amount of memory in bytes used by an array. Equivalent to gpuBuffer()->bytesUsed().
virtual int | glSize () const =0
| Returns the number of scalar components for the array, ie 3 for ArrayFVec3, 1 for ArrayUInt etc.
virtual int | glType () const =0
| Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFVec3, GL_UNSIGNED_INT for ArrayUInt etc.
virtual int | size () const =0
| Returns the number of elements of an array.
virtual Sphere | computeBoundingSphere () const =0
| Computes the bounding sphere enclosing the vectors contained in the buffer.
virtual AABB | computeBoundingBox () const =0
| Computes the axis aligned bounding box enclosing the vectors contained in the buffer.
virtual void | transform (const mat4 &m)=0
| Transforms the vectors contained in the buffer.
virtual void | normalize ()=0
| Normalizes the vectors contained in the buffer.
virtual vec4 | vectorAsVec4 (int vector_index) const =0
| Returns a vector from the buffer as a `vec4` value.
virtual int | compare (int a, int b) const =0
| Compares two vectors.
bool | vboDirty () const
| true by default
void | setVBODirty (bool dirty)
| true by default
EGLBufferUsage | usage () const
| GBU_STATIC_DRAW by default.
void | setUsage (EGLBufferUsage usage)
| GBU_STATIC_DRAW by default.
void | updateVBO (bool discard_local_storage=false)

## Protected Attributes

ref< GLBufferObject > | mBufferGPU
EGLBufferUsage | mVBOUsage
bool | mVBODirty

## Detailed Description

The ArrayAbstract class defines an abstract interface to conveniently manipulate data stored in a GLBufferObject.

See also:

- vl::Array
- 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

## Constructor & Destructor Documentation

vl::ArrayAbstract::ArrayAbstract | ( |  | ) | `[inline]`

Default constructor.

vl::ArrayAbstract::ArrayAbstract | ( | const ArrayAbstract & | other | ) | `[inline]`

Copies only the local data and not the VBO related fields.

## Member Function Documentation

virtual const char* vl::ArrayAbstract::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Reimplemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

void vl::ArrayAbstract::operator= | ( | const ArrayAbstract & | other | ) | `[inline]`

Copies only the local data and not the VBO related fields.

virtual ref<ArrayAbstract> vl::ArrayAbstract::clone | ( |  | ) | const`[pure virtual]`

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

const GLBufferObject* vl::ArrayAbstract::gpuBuffer | ( |  | ) | const`[inline]`

GLBufferObject* vl::ArrayAbstract::gpuBuffer | ( |  | ) | `[inline]`

void vl::ArrayAbstract::clear | ( |  | ) | `[inline]`

Reimplemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

const unsigned char* vl::ArrayAbstract::ptr | ( |  | ) | const`[inline]`

Returns the pointer to the first element of the local buffer. Equivalent to gpuBuffer()->ptr().

unsigned char* vl::ArrayAbstract::ptr | ( |  | ) | `[inline]`

Returns the pointer to the first element of the local buffer. Equivalent to gpuBuffer()->ptr().

virtual int vl::ArrayAbstract::bytesUsed | ( |  | ) | const`[inline, virtual]`

Returns the amount of memory in bytes used by an array. Equivalent to gpuBuffer()->bytesUsed().

virtual int vl::ArrayAbstract::glSize | ( |  | ) | const`[pure virtual]`

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

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual int vl::ArrayAbstract::glType | ( |  | ) | const`[pure virtual]`

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

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual int vl::ArrayAbstract::size | ( |  | ) | const`[pure virtual]`

Returns the number of elements of an array.

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual Sphere vl::ArrayAbstract::computeBoundingSphere | ( |  | ) | const`[pure virtual]`

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

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual AABB vl::ArrayAbstract::computeBoundingBox | ( |  | ) | const`[pure virtual]`

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

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual void vl::ArrayAbstract::transform | ( | const mat4 & | m | ) | `[pure virtual]`

Transforms the vectors contained in the buffer.

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual void vl::ArrayAbstract::normalize | ( |  | ) | `[pure virtual]`

Normalizes the vectors contained in the buffer.

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual vec4 vl::ArrayAbstract::vectorAsVec4 | ( | int | vector_index | ) | const`[pure virtual]`

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

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

virtual int vl::ArrayAbstract::compare | ( | int | a,
|  | int | b |
| ) |  |  | const`[pure virtual]`

Compares two vectors.

Implemented in vl::Array< vector_type, scalar_type, gl_size, gl_type >.

bool vl::ArrayAbstract::vboDirty | ( |  | ) | const`[inline]`

true by default

void vl::ArrayAbstract::setVBODirty | ( | bool | dirty | ) | `[inline]`

true by default

EGLBufferUsage vl::ArrayAbstract::usage | ( |  | ) | const`[inline]`

GBU_STATIC_DRAW by default.

void vl::ArrayAbstract::setUsage | ( | EGLBufferUsage | usage | ) | `[inline]`

GBU_STATIC_DRAW by default.

void vl::ArrayAbstract::updateVBO | ( | bool | discard_local_storage = `false` | ) | `[inline]`

## Member Data Documentation

ref<GLBufferObject> vl::ArrayAbstract::mBufferGPU`[protected]`

EGLBufferUsage vl::ArrayAbstract::mVBOUsage`[protected]`

bool vl::ArrayAbstract::mVBODirty`[protected]`

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.