Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | List of all members
CDPL::Vis::RightFrustumMesh3D Class Reference

A pre-defined triangle mesh providing the vertices and faces of a right frustum. More...

#include <RightFrustumMesh3D.hpp>

+ Inheritance diagram for CDPL::Vis::RightFrustumMesh3D:

Public Types

typedef std::shared_ptr< RightFrustumMesh3DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated RightFrustumMesh3D instances. More...
 
- Public Types inherited from CDPL::Vis::TriangleMesh3D
typedef std::shared_ptr< TriangleMesh3DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated TriangleMesh3D instances. More...
 
- Public Types inherited from CDPL::Vis::Shape3D
typedef std::shared_ptr< Shape3DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated Shape3D instances. More...
 

Public Member Functions

 RightFrustumMesh3D (double radius1, double radius2, double height, std::size_t num_sides, bool close_btm=true, bool close_top=true)
 Genberates a right frustum triangle mesh with the specified bottom radius, top radius, height, side count and optional bottom/top caps. More...
 
- Public Member Functions inherited from CDPL::Vis::TriangleMesh3D
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::Vector3DArraygetVertices ()
 Returns a non-const reference to the array storing the mesh vertices. More...
 
const Math::Vector3DArraygetVertices () 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::Vector3DArraygetVertexNormals ()
 Returns a non-const reference to the array storing the per-vertex normals. More...
 
const Math::Vector3DArraygetVertexNormals () 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::Vector3ULArraygetFaces ()
 Returns a non-const reference to the array storing the triangle faces. More...
 
const Math::Vector3ULArraygetFaces () 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...
 
TriangleMesh3Doperator+= (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...
 

Detailed Description

A pre-defined triangle mesh providing the vertices and faces of a right frustum.

Since
1.3

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated RightFrustumMesh3D instances.

Constructor & Destructor Documentation

◆ RightFrustumMesh3D()

CDPL::Vis::RightFrustumMesh3D::RightFrustumMesh3D ( double  radius1,
double  radius2,
double  height,
std::size_t  num_sides,
bool  close_btm = true,
bool  close_top = true 
)

Genberates a right frustum triangle mesh with the specified bottom radius, top radius, height, side count and optional bottom/top caps.

Parameters
radius1The radius of the bottom circle (0.0 results in a sharp tip).
radius2The radius of the top circle (0.0 results in a sharp tip).
heightThe height of the frustum.
num_sidesThe number of sides used to approximate the lateral surface (must be > 1).
close_btmtrue if the bottom shall be closed, and false to leave the bottom open.
close_toptrue if the top shall be closed, and false to leave the top open.

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