Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
#include <Geometry.hpp>

Classes | |
| class | TextureArray |
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| Geometry () | |
| Constructor. | |
| virtual | ~Geometry () |
| Destructor. | |
| ref< Geometry > | shallowCopy () |
| Performs a shallow copy (as opposed to a deep copy) of the specified Geometry. | |
| ref< Geometry > | deepCopy () const |
| Performs a deep copy (as opposed to a shallow copy) of the specified Geometry. | |
| Geometry & | operator= (const Geometry &other) |
| Performs a shallowCopy() of the Geometry. | |
| virtual void | computeBounds_Implementation () |
| size_t | triangleCount () const |
| size_t | lineCount () const |
| size_t | pointCount () const |
| void | computeNormals () |
| Computes the normals in a "smooth" way, i.e. | |
| virtual void | render (const Actor *, const OpenGLContext *, const Camera *) const |
| Renders the Renderable. | |
| virtual void | clearArrays (bool clear_draw_calls=true) |
| Removes all the previously installed arrays. | |
| void | setColorArray (const fvec4 &col) |
| Filles the color array with a single color. | |
| void | setVertexArray (ArrayAbstract *data) |
| void | setNormalArray (ArrayAbstract *data) |
| void | setColorArray (ArrayAbstract *data) |
| void | setSecondaryColorArray (ArrayAbstract *data) |
| void | setFogCoordArray (ArrayAbstract *data) |
| void | setTexCoordArray (int tex_unit, ArrayAbstract *data) |
| const ArrayAbstract * | vertexArray () const |
| ArrayAbstract * | vertexArray () |
| const ArrayAbstract * | normalArray () const |
| ArrayAbstract * | normalArray () |
| const ArrayAbstract * | colorArray () const |
| ArrayAbstract * | colorArray () |
| const ArrayAbstract * | secondaryColorArray () const |
| ArrayAbstract * | secondaryColorArray () |
| const ArrayAbstract * | fogCoordArray () const |
| ArrayAbstract * | fogCoordArray () |
| const ArrayAbstract * | texCoordArray (int tex_unit) const |
| ArrayAbstract * | texCoordArray (int tex_unit) |
| Collection < VertexAttributeArray > * | vertexAttributeArrays () |
| Returns the list of VertexAttributeArray objects bound to a Geometry. | |
| const Collection < VertexAttributeArray > * | vertexAttributeArrays () const |
| Returns the list of VertexAttributeArray objects bound to a Geometry. | |
| void | setVertexAttributeArray (unsigned int name, bool normalize, bool pure_integer, ArrayAbstract *data) |
| void | setVertexAttributeArray (const VertexAttributeArray &info) |
| const VertexAttributeArray * | findVertexAttribute (unsigned int name) const |
| VertexAttributeArray * | findVertexAttribute (unsigned int name) |
| void | eraseVertexAttributeByName (unsigned int name) |
| Collection< Primitives > * | primitives () |
| Returns the list of Primitives objects bound to a Geometry. | |
| const Collection< Primitives > * | primitives () const |
| Returns the list of Primitives objects bound to a Geometry. | |
| void | updateVBOs (bool discard_local_data=false) |
| Uploads the data stored in the local buffers on the GPU memory. | |
| void | deleteVBOs () |
| Destroyes the VBO (VertexBufferObjects) associated to this Geometry attributes. | |
| void | transform (const mat4 &matr, bool normalize=true) |
| Transforms vertices and normals belonging to this geometry. | |
| void | shrinkDrawElements () |
| Tries to convert DrawElementsUInt in DrawElementsUShort/UByte and DrawElementsUShort in DrawElementsUByte in order to use less memory. | |
| void | mergeTriangleStrips () |
| Merges the PT_TRIANGLE_STRIP Primitive objects into one single PT_TRIANGLE_STRIP DrawElements. | |
| void | convertPrimitivesToDrawArrays () |
| Converts all the Primitives objects bound to a Geometry into DrawArrays. | |
| bool | sortVertices () |
| Sorts the vertices of the geometry to maximize vertex-cache coherency. | |
| void | sortTriangles () |
| Calls DrawElements::sortTriangles(). | |
| void | colorizePrimitives () |
| Assigns a random color to each vertex of each Primitives object. If a vertex is shared among more than one Primitives object its color is undefined. | |
| void | regenerateVertices (const std::vector< size_t > &map_new_to_old) |
| void | updateVBOs () |
| Updates the vertex buffer objects. | |
| Geometry::Geometry | ( | ) |
Constructor.
| Geometry::~Geometry | ( | ) | [virtual] |
Destructor.
| virtual const char* vl::Geometry::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::Renderable.
Reimplemented in vl::BezierSurface.
Performs a deep copy (as opposed to a shallow copy) of the specified Geometry.
Performs a shallowCopy() of the Geometry.
| void Geometry::computeBounds_Implementation | ( | ) | [virtual] |
Implements vl::Renderable.
| size_t Geometry::triangleCount | ( | ) | const [virtual] |
Reimplemented from vl::Renderable.
| size_t Geometry::lineCount | ( | ) | const [virtual] |
Reimplemented from vl::Renderable.
| size_t Geometry::pointCount | ( | ) | const [virtual] |
Reimplemented from vl::Renderable.
| void Geometry::computeNormals | ( | ) |
Computes the normals in a "smooth" way, i.e.
averaging the normals of those polygons that share one or more vertices.
This function computes smoothed normals for triangle primitives and leaves unchanged the normals of line and point primitives when possible, i.e. when they don't share vertices with the polygonal primitives.
| void Geometry::render | ( | const Actor * | actor, | |
| const OpenGLContext * | , | |||
| const Camera * | camera | |||
| ) | const [virtual] |
| void Geometry::clearArrays | ( | bool | clear_draw_calls = true |
) | [virtual] |
Removes all the previously installed arrays.
| void Geometry::setColorArray | ( | const fvec4 & | col | ) |
Filles the color array with a single color.
If the color array has been already defined it must be of one of the following types: ArrayFVec3, ArrayFVec4, ArrayUByte3, ArrayUBVec4 If no color array has been defined a new ArrayUBVec4 is installed and filled.
| void Geometry::setVertexArray | ( | ArrayAbstract * | data | ) |
| void Geometry::setNormalArray | ( | ArrayAbstract * | data | ) |
| void Geometry::setColorArray | ( | ArrayAbstract * | data | ) |
| void Geometry::setSecondaryColorArray | ( | ArrayAbstract * | data | ) |
| void Geometry::setFogCoordArray | ( | ArrayAbstract * | data | ) |
| void Geometry::setTexCoordArray | ( | int | tex_unit, | |
| ArrayAbstract * | data | |||
| ) |
| const ArrayAbstract* vl::Geometry::vertexArray | ( | ) | const [inline] |
| ArrayAbstract* vl::Geometry::vertexArray | ( | ) | [inline] |
| const ArrayAbstract* vl::Geometry::normalArray | ( | ) | const [inline] |
| ArrayAbstract* vl::Geometry::normalArray | ( | ) | [inline] |
| const ArrayAbstract* vl::Geometry::colorArray | ( | ) | const [inline] |
| ArrayAbstract* vl::Geometry::colorArray | ( | ) | [inline] |
| const ArrayAbstract* vl::Geometry::secondaryColorArray | ( | ) | const [inline] |
| ArrayAbstract* vl::Geometry::secondaryColorArray | ( | ) | [inline] |
| const ArrayAbstract* vl::Geometry::fogCoordArray | ( | ) | const [inline] |
| ArrayAbstract* vl::Geometry::fogCoordArray | ( | ) | [inline] |
| const ArrayAbstract* vl::Geometry::texCoordArray | ( | int | tex_unit | ) | const [inline] |
| ArrayAbstract* vl::Geometry::texCoordArray | ( | int | tex_unit | ) | [inline] |
| Collection<VertexAttributeArray>* vl::Geometry::vertexAttributeArrays | ( | ) | [inline] |
Returns the list of VertexAttributeArray objects bound to a Geometry.
| const Collection<VertexAttributeArray>* vl::Geometry::vertexAttributeArrays | ( | ) | const [inline] |
Returns the list of VertexAttributeArray objects bound to a Geometry.
| void vl::Geometry::setVertexAttributeArray | ( | unsigned int | name, | |
| bool | normalize, | |||
| bool | pure_integer, | |||
| ArrayAbstract * | data | |||
| ) | [inline] |
| void Geometry::setVertexAttributeArray | ( | const VertexAttributeArray & | info | ) |
| const VertexAttributeArray * Geometry::findVertexAttribute | ( | unsigned int | name | ) | const |
| VertexAttributeArray * Geometry::findVertexAttribute | ( | unsigned int | name | ) |
| void Geometry::eraseVertexAttributeByName | ( | unsigned int | name | ) |
| Collection<Primitives>* vl::Geometry::primitives | ( | ) | [inline] |
Returns the list of Primitives objects bound to a Geometry.
| const Collection<Primitives>* vl::Geometry::primitives | ( | ) | const [inline] |
Returns the list of Primitives objects bound to a Geometry.
| void Geometry::updateVBOs | ( | bool | = false |
) | [virtual] |
Uploads the data stored in the local buffers on the GPU memory.
If 'discard_local_data' is set to true the memory used by the local buffers is released.
Reimplemented from vl::Renderable.
| void Geometry::deleteVBOs | ( | ) | [virtual] |
Destroyes the VBO (VertexBufferObjects) associated to this Geometry attributes.
If 'clear_primitives' all the VBOs associated the Primitives objects are also deleted.
Reimplemented from vl::Renderable.
| void Geometry::transform | ( | const mat4 & | matr, | |
| bool | normalize = true | |||
| ) |
Transforms vertices and normals belonging to this geometry.
If 'normalize' == true the normals are normalized after being transformed
| void Geometry::shrinkDrawElements | ( | ) |
Tries to convert DrawElementsUInt in DrawElementsUShort/UByte and DrawElementsUShort in DrawElementsUByte in order to use less memory.
| void Geometry::mergeTriangleStrips | ( | ) |
Merges the PT_TRIANGLE_STRIP Primitive objects into one single PT_TRIANGLE_STRIP DrawElements.
| void Geometry::convertPrimitivesToDrawArrays | ( | ) |
Converts all the Primitives objects bound to a Geometry into DrawArrays.
| bool Geometry::sortVertices | ( | ) |
Sorts the vertices of the geometry to maximize vertex-cache coherency.
This function will work only if all the Primitives are DrawElements.
| void Geometry::sortTriangles | ( | ) |
| void Geometry::colorizePrimitives | ( | ) |
Assigns a random color to each vertex of each Primitives object. If a vertex is shared among more than one Primitives object its color is undefined.
| void Geometry::regenerateVertices | ( | const std::vector< size_t > & | map_new_to_old | ) |
| void vl::Geometry::updateVBOs | ( | ) |
Updates the vertex buffer objects.