Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Array class is a template array used to conveniently manipulate data stored in a BufferObject. More...
#include <Array.hpp>
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. More... | |
virtual GLenum | glType () const |
Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFloat3, GL_UNSIGNED_INT for ArrayUInt1 etc. More... | |
virtual size_t | bytesPerVector () const |
void | clear () |
void | resize (size_t dim) |
size_t | size () const |
Returns the number of elements of an array. More... | |
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< ArrayAbstract > | createArray () const |
virtual ref< ArrayAbstract > | clone () const |
Sphere | computeBoundingSphere () const |
Computes the bounding sphere enclosing the vectors contained in the buffer. More... | |
AABB | computeBoundingBox () const |
Computes the axis aligned bounding box enclosing the vectors contained in the buffer. More... | |
void | transform (const mat4 &m) |
Transforms the vectors contained in the buffer. More... | |
void | normalize () |
Normalizes the vectors contained in the buffer. More... | |
vec4 | getAsVec4 (size_t vector_index) const |
Returns a vector from the buffer as a vec4 value. More... | |
vec3 | getAsVec3 (size_t vector_index) const |
Returns a vector from the buffer as a vec3 value. More... | |
vec2 | getAsVec2 (size_t vector_index) const |
Returns a vector from the buffer as a vec2 value. More... | |
int | compare (int a, int b) const |
Compares two vectors. More... | |
void | initFrom (const std::vector< T_VectorType > &vector) |
Public Member Functions inherited from vl::ArrayAbstract | |
ArrayAbstract () | |
Default constructor. More... | |
ArrayAbstract (const ArrayAbstract &other) | |
Copies only the local data and not the BufferObject related fields. More... | |
void | operator= (const ArrayAbstract &other) |
Copies only the local data and not the BufferObject related fields. More... | |
const BufferObject * | bufferObject () const |
BufferObject * | bufferObject () |
void | clear () |
const unsigned char * | ptr () const |
Returns the pointer to the first element of the local buffer. Equivalent to bufferObject()->ptr() More... | |
unsigned char * | ptr () |
Returns the pointer to the first element of the local buffer. Equivalent to bufferObject()->ptr() More... | |
virtual size_t | bytesUsed () const |
Returns the amount of memory in bytes used by an array. Equivalent to bufferObject()->bytesUsed(). More... | |
bool | isBufferObjectDirty () const |
Wether the BufferObject should be updated or not using the local storage. More... | |
void | setBufferObjectDirty (bool dirty=true) |
Wether the BufferObject should be updated or not using the local storage. More... | |
EBufferObjectUsage | usage () const |
BU_STATIC_DRAW by default. More... | |
void | setUsage (EBufferObjectUsage usage) |
BU_STATIC_DRAW by default. More... | |
void | updateBufferObject (EBufferObjectUpdateMode mode=BUM_KeepRamBuffer) |
Updates the BufferObject. More... | |
void | setNormalize (bool normalize) |
The 'normalized' parameter as used with glVertexAttribPointer() More... | |
bool | normalize () const |
The 'normalized' parameter as used with glVertexAttribPointer() More... | |
void | setInterpretation (EVertexAttribInterpretation behavior) |
How the data is interpreted by the OpenGL, see EVertexAttribInterpretation. More... | |
EVertexAttribInterpretation | interpretation () const |
How the data is interpreted by the OpenGL, see EVertexAttribInterpretation. More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Static Public Attributes | |
static const size_t | gl_size = T_GL_Size |
static const GLenum | gl_type = T_GL_Type |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Protected Attributes inherited from vl::ArrayAbstract | |
ref< BufferObject > | mBufferObject |
EBufferObjectUsage | mBufferObjectUsage |
bool | mBufferObjectDirty |
EVertexAttribInterpretation | mInterpretation |
bool | mNormalize |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
The Array class is a template array used to conveniently manipulate data stored in a BufferObject.
typedef T_Scalar vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::scalar_type |
typedef T_VectorType vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::vector_type |
|
inline |
Definition at line 255 of file Array.hpp.
Referenced by vl::Geometry::colorizePrimitives(), vl::VectorGraphics::drawLines(), vl::VectorGraphics::drawPoints(), vl::Extrusion::extrude(), vl::Extrusions::extrude(), vl::Geometry::flipNormals(), vl::EdgeExtractor::generateEdgeGeometry(), vl::DaeLoader::generateGeometry(), vl::Terrain::init(), vl::load3DS(), vl::loadAC3D(), vl::STLLoader::loadBinary(), vl::loadMD2(), vl::ObjLoader::loadOBJ(), vl::makeCapsule(), vl::makeCircle(), vl::makeCone(), vl::makeCylinder(), vl::makeGrid(), vl::makeIcosahedron(), vl::makeIcosphere(), vl::makePoints(), vl::makePyramid(), makeScales(), vl::makeTorus(), vl::makeUVSphere(), vl::PolygonSimplifier::outputSimplifiedGeometry(), vl::VectorGraphics::popScissor(), vl::DoubleVertexRemover::removeDoubles(), vl::SceneManagerPortals::renderPortal(), vl::Geometry::shrinkDrawCalls(), vl::Geometry::sortVertices(), and vl::BezierSurface::updateBezierSurface().
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
Implements vl::ArrayAbstract.
|
inlinevirtual |
|
inlinevirtual |
Computes the axis aligned bounding box enclosing the vectors contained in the buffer.
Implements vl::ArrayAbstract.
|
inlinevirtual |
Computes the bounding sphere enclosing the vectors contained in the buffer.
Implements vl::ArrayAbstract.
|
inlinevirtual |
|
inline |
Definition at line 249 of file Array.hpp.
Referenced by vl::Geometry::mergeDrawCallsWithMultiDrawElements(), vl::Geometry::mergeDrawCallsWithPrimitiveRestart(), vl::PolygonSimplifier::outputSimplifiedGeometry(), and vl::Geometry::triangulateDrawCalls().
|
inline |
|
inlinevirtual |
Returns a vector from the buffer as a vec2
value.
Implements vl::ArrayAbstract.
|
inlinevirtual |
Returns a vector from the buffer as a vec3
value.
Implements vl::ArrayAbstract.
|
inlinevirtual |
Returns a vector from the buffer as a vec4
value.
Implements vl::ArrayAbstract.
|
inlinevirtual |
Returns the number of scalar components for the array, ie 3 for ArrayFloat3, 1 for ArrayUInt1 etc.
Implements vl::ArrayAbstract.
|
inlinevirtual |
Returns the OpenGL type for the array, ie GL_FLOAT for ArrayFloat3, GL_UNSIGNED_INT for ArrayUInt1 etc.
Implements vl::ArrayAbstract.
|
inline |
Definition at line 395 of file Array.hpp.
Referenced by vl::Extrusion::extrude(), vl::Extrusions::extrude(), vl::Molecule::generateRings(), vl::makeCapsule(), vl::Tessellator::tessellateGeometry(), and vl::Molecule::wireframeStyle().
|
inlinevirtual |
Normalizes the vectors contained in the buffer.
Implements vl::ArrayAbstract.
|
inline |
|
inline |
|
inline |
Definition at line 233 of file Array.hpp.
Referenced by vl::Geometry::colorizePrimitives(), vl::Geometry::computeNormals(), vl::VectorGraphics::drawLines(), vl::VectorGraphics::drawPoints(), vl::Extrusions::extrude(), vl::Extrusion::extrude(), vl::Geometry::fixTriangleWinding(), vl::EdgeExtractor::generateEdgeGeometry(), vl::DaeLoader::generateGeometry(), vlX::VLXClassWrapper_Array::importVLX(), vl::Terrain::init(), vl::load3DS(), vl::loadAC3D(), vl::STLLoader::loadAscii(), vl::STLLoader::loadBinary(), vl::loadMD2(), vl::ObjLoader::loadOBJ(), vl::PlyLoader::loadPly(), vl::makeBox(), vl::makeCapsule(), vl::makeCircle(), vl::makeCone(), vl::makeCylinder(), vl::makeGrid(), vl::makeIcosahedron(), vl::makeIcosphere(), vl::makePoints(), vl::makePyramid(), makeScales(), vl::makeTorus(), vl::makeUVSphere(), vl::Geometry::mergeDrawCallsWithMultiDrawElements(), vl::Geometry::mergeDrawCallsWithPrimitiveRestart(), vl::Geometry::mergeDrawCallsWithTriangles(), vl::Geometry::mergeTriangleStrips(), vl::SlicedVolume::onActorRenderStarted(), vl::PolygonSimplifier::outputSimplifiedGeometry(), vl::VectorGraphics::popScissor(), vl::RaycastVolume::RaycastVolume(), vl::DoubleVertexRemover::removeDoubles(), vl::SceneManagerPortals::renderPortal(), vl::Geometry::shrinkDrawCalls(), vl::Geometry::sortVertices(), vl::TriangleStripGenerator::stripfy(), vl::Geometry::triangulateDrawCalls(), and vl::BezierSurface::updateBezierSurface().
|
inline |
|
inline |
|
inlinevirtual |
Returns the number of elements of an array.
Implements vl::ArrayAbstract.
Definition at line 235 of file Array.hpp.
Referenced by vl::Geometry::computeNormals(), vl::VectorGraphics::drawLines(), vl::VectorGraphics::drawPoints(), vl::Geometry::fixTriangleWinding(), vl::Geometry::flipNormals(), vl::EdgeExtractor::generateEdgeGeometry(), vl::DaeLoader::generateGeometry(), vl::Molecule::generateRings(), vl::loadMD2(), vl::makeBox(), vl::makeCircle(), vl::makeIcosphere(), vl::makePoints(), makeScales(), vl::Geometry::mergeDrawCallsWithTriangles(), vl::VectorGraphics::popScissor(), vl::SceneManagerPortals::renderPortal(), vl::Geometry::shrinkDrawCalls(), vl::Geometry::sortVertices(), vl::Tessellator::tessellateGeometry(), and vl::Molecule::wireframeStyle().
|
inline |
|
inlinevirtual |
Transforms the vectors contained in the buffer.
Implements vl::ArrayAbstract.
Definition at line 322 of file Array.hpp.
Referenced by makeScales().
|
static |
|
static |
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:05.
© Copyright Michele Bosi. All rights reserved.