![]() |
Chemical Data Processing Library C++ API - Version 1.4.0
|
Data structure for the storage of 3D triangle mesh vertices, vertex normals and faces. More...
#include <TriangleMesh3D.hpp>
Inheritance diagram for CDPL::Vis::TriangleMesh3D:Public Types | |
| typedef std::shared_ptr< TriangleMesh3D > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated TriangleMesh3D instances. More... | |
Public Types inherited from CDPL::Vis::Shape3D | |
| typedef std::shared_ptr< Shape3D > | SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated Shape3D instances. More... | |
Public Member Functions | |
| Shape3D::SharedPointer | clone () const |
| Creates a dynamically allocated copy of the triangle mesh. More... | |
| void | accept (Shape3DVisitor &visitor) const |
| Accepts the Vis::Shape3DVisitor instance visitor by dispatching to its visitTriangleMesh() method [VPTN]. More... | |
| Math::Vector3DArray & | getVertices () |
Returns a non-const reference to the array storing the mesh vertices. More... | |
| const Math::Vector3DArray & | getVertices () const |
Returns a const reference to the array storing the mesh vertices. More... | |
| void | addVertex (double x, double y, double z) |
| Appends a new vertex at the position (x, y, z). More... | |
| std::size_t | getNumVertices () const |
| Returns the number of stored vertices. More... | |
| Math::Vector3DArray & | getVertexNormals () |
Returns a non-const reference to the array storing the per-vertex normals. More... | |
| const Math::Vector3DArray & | getVertexNormals () const |
Returns a const reference to the array storing the per-vertex normals. More... | |
| void | addVertexNormal (double x, double y, double z) |
| Appends a new vertex normal with the components (x, y, z). More... | |
| std::size_t | getNumVertexNormals () const |
| Returns the number of stored vertex normals. More... | |
| Math::Vector3ULArray & | getFaces () |
Returns a non-const reference to the array storing the triangle faces. More... | |
| const Math::Vector3ULArray & | getFaces () const |
Returns a const reference to the array storing the triangle faces. More... | |
| void | addFace (unsigned long v1_idx, unsigned long v2_idx, unsigned long v3_idx) |
| Appends a new triangle face defined by the three vertex indices v1_idx, v2_idx and v3_idx. More... | |
| std::size_t | getNumFaces () const |
| Returns the number of stored triangle faces. More... | |
| bool | isClosed () const |
| Tells whether the mesh has been flagged as a closed surface. More... | |
| void | setClosed (bool closed=true) |
| Sets the flag that marks the mesh as a closed surface. More... | |
| void | clear () |
| Removes all vertices, vertex normals and faces and resets the closed-surface flag. More... | |
| void | swap (TriangleMesh3D &mesh) |
| Swaps the vertices, vertex normals and faces of this mesh with those of mesh. More... | |
| TriangleMesh3D & | operator+= (const TriangleMesh3D &mesh) |
| Appends the vertices, vertex normals and (vertex index corrected) faces of mesh to this mesh. More... | |
Public Member Functions inherited from CDPL::Vis::Shape3D | |
| virtual | ~Shape3D () |
| Virtual destructor. More... | |
Data structure for the storage of 3D triangle mesh vertices, vertex normals and faces.
| typedef std::shared_ptr<TriangleMesh3D> CDPL::Vis::TriangleMesh3D::SharedPointer |
A reference-counted smart pointer [SHPTR] for dynamically allocated TriangleMesh3D instances.
|
virtual |
Creates a dynamically allocated copy of the triangle mesh.
Implements CDPL::Vis::Shape3D.
|
virtual |
Accepts the Vis::Shape3DVisitor instance visitor by dispatching to its visitTriangleMesh() method [VPTN].
| visitor | The Vis::Shape3DVisitor instance to accept. |
Implements CDPL::Vis::Shape3D.
| Math::Vector3DArray& CDPL::Vis::TriangleMesh3D::getVertices | ( | ) |
Returns a non-const reference to the array storing the mesh vertices.
const reference to the vertex array. | const Math::Vector3DArray& CDPL::Vis::TriangleMesh3D::getVertices | ( | ) | const |
Returns a const reference to the array storing the mesh vertices.
const reference to the vertex array. | void CDPL::Vis::TriangleMesh3D::addVertex | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Appends a new vertex at the position (x, y, z).
| x | The x-coordinate of the vertex. |
| y | The y-coordinate of the vertex. |
| z | The z-coordinate of the vertex. |
| std::size_t CDPL::Vis::TriangleMesh3D::getNumVertices | ( | ) | const |
Returns the number of stored vertices.
| Math::Vector3DArray& CDPL::Vis::TriangleMesh3D::getVertexNormals | ( | ) |
Returns a non-const reference to the array storing the per-vertex normals.
const reference to the vertex-normal array. | const Math::Vector3DArray& CDPL::Vis::TriangleMesh3D::getVertexNormals | ( | ) | const |
Returns a const reference to the array storing the per-vertex normals.
const reference to the vertex-normal array. | void CDPL::Vis::TriangleMesh3D::addVertexNormal | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Appends a new vertex normal with the components (x, y, z).
| x | The x-component of the normal vector. |
| y | The y-component of the normal vector. |
| z | The z-component of the normal vector. |
| std::size_t CDPL::Vis::TriangleMesh3D::getNumVertexNormals | ( | ) | const |
Returns the number of stored vertex normals.
| Math::Vector3ULArray& CDPL::Vis::TriangleMesh3D::getFaces | ( | ) |
Returns a non-const reference to the array storing the triangle faces.
const reference to the face array. | const Math::Vector3ULArray& CDPL::Vis::TriangleMesh3D::getFaces | ( | ) | const |
Returns a const reference to the array storing the triangle faces.
const reference to the face array. | void CDPL::Vis::TriangleMesh3D::addFace | ( | unsigned long | v1_idx, |
| unsigned long | v2_idx, | ||
| unsigned long | v3_idx | ||
| ) |
Appends a new triangle face defined by the three vertex indices v1_idx, v2_idx and v3_idx.
| v1_idx | The zero-based index of the first vertex. |
| v2_idx | The zero-based index of the second vertex. |
| v3_idx | The zero-based index of the third vertex. |
| std::size_t CDPL::Vis::TriangleMesh3D::getNumFaces | ( | ) | const |
Returns the number of stored triangle faces.
| bool CDPL::Vis::TriangleMesh3D::isClosed | ( | ) | const |
Tells whether the mesh has been flagged as a closed surface.
true if the mesh is flagged as closed, and false otherwise. | void CDPL::Vis::TriangleMesh3D::setClosed | ( | bool | closed = true | ) |
Sets the flag that marks the mesh as a closed surface.
| closed | true to flag the mesh as closed, and false otherwise. |
| void CDPL::Vis::TriangleMesh3D::clear | ( | ) |
Removes all vertices, vertex normals and faces and resets the closed-surface flag.
| void CDPL::Vis::TriangleMesh3D::swap | ( | TriangleMesh3D & | mesh | ) |
Swaps the vertices, vertex normals and faces of this mesh with those of mesh.
| mesh | The mesh to swap with. |
| TriangleMesh3D& CDPL::Vis::TriangleMesh3D::operator+= | ( | const TriangleMesh3D & | mesh | ) |
Appends the vertices, vertex normals and (vertex index corrected) faces of mesh to this mesh.
| mesh | The mesh to append. |