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

Pre-defined triangle mesh providing the vertices and faces of a torus. More...

#include <TorusMesh3D.hpp>

+ Inheritance diagram for CDPL::Vis::TorusMesh3D:

Public Types

typedef std::shared_ptr< TorusMesh3DSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated TorusMesh3D 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

 TorusMesh3D (double radius1, double radius2, std::size_t num_sect1, std::size_t num_sect2, double start_angle=0.0, double first_sect_size=0.0)
 Constructs a torus triangle mesh with the specified ring radius, tube radius, ring/tube subdivision counts and optional tube start angle/first section sizing. 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

Pre-defined triangle mesh providing the vertices and faces of a torus.

Since
1.3

Member Typedef Documentation

◆ SharedPointer

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

Constructor & Destructor Documentation

◆ TorusMesh3D()

CDPL::Vis::TorusMesh3D::TorusMesh3D ( double  radius1,
double  radius2,
std::size_t  num_sect1,
std::size_t  num_sect2,
double  start_angle = 0.0,
double  first_sect_size = 0.0 
)

Constructs a torus triangle mesh with the specified ring radius, tube radius, ring/tube subdivision counts and optional tube start angle/first section sizing.

Parameters
radius1The radius of the torus ring (distance from the torus center to the tube center).
radius2The radius of the tube.
num_sect1The number of sections subdividing the torus ring (must be > 2).
num_sect2The number of sections subdividing the tube (must be > 2).
start_angleThe angle (in radians) at which the first tube section starts.
first_sect_sizeThe angular size (in radians) of the first tube section (0 to use a uniform section size).

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