mds::seg::CDelaunayTetra Class Reference

#include <mdsDelaunayTetra.h>

Inheritance diagram for mds::seg::CDelaunayTetra:

Inheritance graph
[legend]
List of all members.

Detailed Description

Enables checking of minimal edge length.

Class providing Delaunay triangulation in 3D space.


Public Types

enum  {
  XMIN_BOUNDARY = 1 << 4, YMIN_BOUNDARY = 1 << 5, ZMIN_BOUNDARY = 1 << 6, XMAX_BOUNDARY = 1 << 7,
  YMAX_BOUNDARY = 1 << 8, ZMAX_BOUNDARY = 1 << 9, BOUNDARY_FLAGS
}
 Flags used to mark boundary vertices. More...
typedef bool(* tConstraintFunc )(vctl::MCPoint3D *p1, vctl::MCPoint3D *p2, vctl::MCPoint3D *p3, CDelaunayTetra *pMesh)
 Function called to check constrained facets.
typedef bool(* tMinEdgeLengthFunc )(vctl::MCPoint3D *p1, vctl::MCPoint3D *p2, CDelaunayTetra *pMesh)
 Function called to check minimal allowed edge length.
typedef mds::base::CSharedPtr<
CDelaunayTetra
tSmartPtr
 Smart pointer type.
typedef void(* tTetrahedronFunc )(vctl::MCTetra *pTetrahedron, CDelaunayTetra *pMesh)
 Tetrahedron processing function.

Public Member Functions

bool addVertex (vctl::MCVertex *pVertex, int iBoundaryVertex=0, tTetrahedronFunc InsertFunc=NULL, tTetrahedronFunc RemoveFunc=NULL)
 Inserts a new vertex to the current triangulation satisfying the Delaunay criterion.
virtual bool attractVertex (vctl::MCPoint3D *pPoint)
 Modifies position of a given vertex.
 CDelaunayTetra ()
 Default constructor.
void clear ()
 Removes all tetrahedra and vertices.
bool construct ()
 Constructs the Delaunay triangulation from all vertices which are currently registered in the container of vertices.
template<class S>
void deserialize (mds::mod::CChannelSerializer< S > &Reader)
 Deserializes all class members the tetrahedron mesh.
template<class Function>
Function forEachTetrahedron (Function Func)
 Calls function object for every tetrahedron in the mesh.
template<class Function>
Function forEachVertex (Function Func)
 Calls function object for every vertex in the mesh.
vctl::MCTetra * getFirstTetrahedron ()
 Returns pointer to the first tetrahedron.
vctl::MCVertex * getFirstVertex ()
 Returns pointer to the first vertex.
bool getMaxCoordinates (double &dX, double &dY, double &dZ)
 Estimates maximal vertex coordinates.
bool getMinCoordinates (double &dX, double &dY, double &dZ)
 Estimates minimal vertex coordinates in the mesh.
double getMinDihedralAngle ()
 Returns current minimal allowed dihedral angle [degrees].
double getMinEdgeLength ()
 Returns current minimal allowed edge length.
int getNumOfTetrahedra ()
 Returns the number of all tetrahedra.
int getNumOfVertices ()
 Returns the number of vertices.
vctl::MCTetraS * getTetrahedra ()
 Returns pointer to the container of tetrahedra.
vctl::MCVerticeS * getVertices ()
 Returns pointer to the vertices container.
bool init (vctl::MCPoint3D *pMin, vctl::MCPoint3D *pMax, mds::tSize NumOfNodes=DEFAULT_NUMBER_OF_NODES)
 Initializes the Delaunay triangulation.
 MDS_ENTITY_BLOCK_SIZE (4096)
 Standard method getEntityBlockSize().
 MDS_ENTITY_COMPRESSION (mds::mod::CC_RAW)
 Standard method getEntityCompression().
 MDS_ENTITY_NAME ("DelaunayTetra")
 Standard method getEntityName().
vctl::MCVertex * newVertex (double x, double y, double z, int iFlags=0)
 Returns pointer to a newly created vertex.
vctl::MCVertex * newVertex (vctl::MCPoint3D *pPoint, int iFlags=0)
 Returns pointer to a newly created vertex.
bool optimizeByVertexAdding (double dMinQuality, bool bRandomPosition=true)
 Optimizes the triangulation.
vctl::MCVertex * randomVertex (double x, double y, double z, double dMax=MAX_MOVEMENT)
 Generates randomly moved vertex.
vctl::MCVertex * randomVertex (vctl::MCPoint3D *pPoint, double dMax=MAX_MOVEMENT)
 Generates randomly moved vertex.
template<class S>
void serialize (mds::mod::CChannelSerializer< S > &Writer)
 Serializes the tetrahedron mesh.
void setConstraintFunc (tConstraintFunc ConstraintFunc)
 Sets function called to check constrained facets.
void setDefaultConstraintFunc ()
 Sets default function for constrained facets checking.
void setDefaultMinEdgeLengthFunc ()
 Sets default function for checking minimal allowed edge length.
void setMinDihedralAngle (double dValue=DEFAULT_MIN_DIHEDRAL_ANGLE)
 Sets minimal allowed dihedral angle in the triangulation [degrees].
void setMinEdgeLength (double dValue=DEFAULT_MIN_EDGE_LENGTH)
 Sets minimal allowed edge length in the triangulation.
void setMinEdgeLengthFunc (tMinEdgeLengthFunc MinEdgeLengthFunc)
 Sets function for checking minimal allowed edge length.
virtual ~CDelaunayTetra ()
 Virtual destructor.

Static Public Attributes

static const double DEFAULT_MIN_DIHEDRAL_ANGLE = 0.1
 Minimal dihedral angle used to check tetrahedra flatness.
static const double DEFAULT_MIN_EDGE_LENGTH = 1.5
 Minimal length of a tetrahedron edge in the mesh.
static const mds::tSize DEFAULT_NUMBER_OF_NODES = 5
 Default methods parameters.
static const double MAX_MOVEMENT = 0.001
 Maximal allowed random permutation of vertex coordinates.

Protected Types

typedef std::vector< vctl::MCTetra * > tTetrahedra
 Vector of pointers to tetrahedra.
typedef std::vector< vctl::MCVertex * > tVertices
 Vector of pointers to vertices.

Protected Member Functions

vctl::MCTetra * addTetrahedron (vctl::MCVertex *pV0, vctl::MCVertex *pV1, vctl::MCVertex *pV2, vctl::MCVertex *pV3)
 Creates a new tetrahedron.
int checkBoundary (vctl::MCPoint3D *pPoint)
 Checks if a given vertex lies on the mesh boundary.
bool checkFlatness (vctl::MCVertex *pV0, vctl::MCVertex *pV1, vctl::MCVertex *pV2, vctl::MCVertex *pV3)
 Checks if given vertices lie on a plane.
bool checkTetrahedron (vctl::MCTetra *pTetrahedron)
 Checks if a tetrahedral mesh around a given tetrahedron is coherent.
void clearFlags (const tTetrahedra &Tetrahedra)
 Clears entity flags of given tetrahedra.
void clearFlags ()
 Clears entity flags of all tetrahedra.
vctl::MCTetra * findBaseTetrahedron (vctl::MCPoint3D *pPoint)
 Uses a simple recursive tunneling algorithm to find out tetrahedron in which a given point lies.
bool findCavity (vctl::MCPoint3D *pPoint, tTetrahedra &Cavity)
 Finds cavity of a given point.
bool findCavityEnvelope (const tTetrahedra &Cavity, tVertices &Envelope)
 Finds triangles covering a given cavity.
vctl::MCVertex * findNearestVertex (vctl::MCPoint3D *pPoint, bool bStartFromPrevious=false)
 Finds nearest vertex.
void removeTetrahedron (vctl::MCTetra *pTetrahedron, bool bEraseVertices=false)
 Removes a given existing tetrahedron.

Static Protected Member Functions

static double getTetrahedronQuality (vctl::MCTetra *pTetrahedron)
 Computes tetrahedron quality.

Protected Attributes

tConstraintFunc m_ConstraintFunc
 Function for checking if a given facet is constrained.
double m_dMaxX
 Maximal vertex coordinates in the mesh.
double m_dMaxY
double m_dMaxZ
double m_dMinDihedralAngle
 Minimal allowed dihedral angle.
double m_dMinEdgeLength
 Minimal allowed edge length.
double m_dMinX
 Minimal vertex coordinates in the mesh.
double m_dMinY
double m_dMinZ
tMinEdgeLengthFunc m_MinEdgeLengthFunc
 Function for checking minimal length of an edge.
vctl::MCVerticeS * m_pVertices
 Pointer to the container of vertices which is stored.
mds::math::CUniformPRNG m_Random
 Random number generator.
vctl::MCTetraS m_Tetrahedra
 Container of all tetrahedra in the mesh.

Friends

class mds::base::CSharedPtr< CDelaunayTetra >


Member Typedef Documentation

typedef bool(* mds::seg::CDelaunayTetra::tConstraintFunc)(vctl::MCPoint3D *p1, vctl::MCPoint3D *p2, vctl::MCPoint3D *p3, CDelaunayTetra *pMesh)
 

Function called to check constrained facets.

typedef bool(* mds::seg::CDelaunayTetra::tMinEdgeLengthFunc)(vctl::MCPoint3D *p1, vctl::MCPoint3D *p2, CDelaunayTetra *pMesh)
 

Function called to check minimal allowed edge length.

typedef mds::base::CSharedPtr< CDelaunayTetra > mds::seg::CDelaunayTetra::tSmartPtr
 

Smart pointer type.

  • Declares type tSmartPtr.

Reimplemented in mds::seg::CTetraMesh.

typedef std::vector<vctl::MCTetra *> mds::seg::CDelaunayTetra::tTetrahedra [protected]
 

Vector of pointers to tetrahedra.

typedef void(* mds::seg::CDelaunayTetra::tTetrahedronFunc)(vctl::MCTetra *pTetrahedron, CDelaunayTetra *pMesh)
 

Tetrahedron processing function.

typedef std::vector<vctl::MCVertex *> mds::seg::CDelaunayTetra::tVertices [protected]
 

Vector of pointers to vertices.


Member Enumeration Documentation

anonymous enum
 

Flags used to mark boundary vertices.

Enumerator:
XMIN_BOUNDARY 
YMIN_BOUNDARY 
ZMIN_BOUNDARY 
XMAX_BOUNDARY 
YMAX_BOUNDARY 
ZMAX_BOUNDARY 
BOUNDARY_FLAGS 


Constructor & Destructor Documentation

mds::seg::CDelaunayTetra::CDelaunayTetra  ) 
 

Default constructor.

virtual mds::seg::CDelaunayTetra::~CDelaunayTetra  )  [inline, virtual]
 

Virtual destructor.


Member Function Documentation

vctl::MCTetra * mds::seg::CDelaunayTetra::addTetrahedron vctl::MCVertex *  pV0,
vctl::MCVertex *  pV1,
vctl::MCVertex *  pV2,
vctl::MCVertex *  pV3
[protected]
 

Creates a new tetrahedron.

  • It is garanteed that normals of all triangles are oriented to the tetrahedron center.
  • Returns pointer to the newly created tetrahedron.

bool mds::seg::CDelaunayTetra::addVertex vctl::MCVertex *  pVertex,
int  iBoundaryVertex = 0,
tTetrahedronFunc  InsertFunc = NULL,
tTetrahedronFunc  RemoveFunc = NULL
 

Inserts a new vertex to the current triangulation satisfying the Delaunay criterion.

  • Functions called for each removed and newly inserted tetrahedron can be specified.

bool mds::seg::CDelaunayTetra::attractVertex vctl::MCPoint3D *  pPoint  )  [virtual]
 

Modifies position of a given vertex.

Reimplemented in mds::seg::CTetraMesh.

int mds::seg::CDelaunayTetra::checkBoundary vctl::MCPoint3D *  pPoint  )  [protected]
 

Checks if a given vertex lies on the mesh boundary.

  • Normalizes vertex coordinates.
  • Returns appropriate boundary flag.

bool mds::seg::CDelaunayTetra::checkFlatness vctl::MCVertex *  pV0,
vctl::MCVertex *  pV1,
vctl::MCVertex *  pV2,
vctl::MCVertex *  pV3
[protected]
 

Checks if given vertices lie on a plane.

  • Returns true if the vertices are flat.

bool mds::seg::CDelaunayTetra::checkTetrahedron vctl::MCTetra *  pTetrahedron  )  [protected]
 

Checks if a tetrahedral mesh around a given tetrahedron is coherent.

  • Returns true if the mesh is OK.

void mds::seg::CDelaunayTetra::clear  ) 
 

Removes all tetrahedra and vertices.

void mds::seg::CDelaunayTetra::clearFlags const tTetrahedra Tetrahedra  )  [protected]
 

Clears entity flags of given tetrahedra.

void mds::seg::CDelaunayTetra::clearFlags  )  [protected]
 

Clears entity flags of all tetrahedra.

bool mds::seg::CDelaunayTetra::construct  ) 
 

Constructs the Delaunay triangulation from all vertices which are currently registered in the container of vertices.

  • Container of candidate vertices should be initiliazed first.
  • Incremental method is used.

template<class S>
void mds::seg::CDelaunayTetra::deserialize mds::mod::CChannelSerializer< S > &  Reader  )  [inline]
 

Deserializes all class members the tetrahedron mesh.

Reimplemented in mds::seg::CTetraMesh.

vctl::MCTetra * mds::seg::CDelaunayTetra::findBaseTetrahedron vctl::MCPoint3D *  pPoint  )  [protected]
 

Uses a simple recursive tunneling algorithm to find out tetrahedron in which a given point lies.

  • Returns NULL on failure.

bool mds::seg::CDelaunayTetra::findCavity vctl::MCPoint3D *  pPoint,
tTetrahedra Cavity
[protected]
 

Finds cavity of a given point.

  • Cavity means all tetrahedra whose circumsphere contains the point.
  • Note: It uses entity flag vctl::ENTITY_MARK_FLAG to stop recursion. This flag is not cleared after the cavity is found.
  • Returns false if the point lies on circumsphere boundary of some tetrahedron. In this case you should randomly move the point.

bool mds::seg::CDelaunayTetra::findCavityEnvelope const tTetrahedra Cavity,
tVertices Envelope
[protected]
 

Finds triangles covering a given cavity.

  • Note: It uses entity flag vctl::ENTITY_MARK_FLAG to recognize tetrahedra in the cavity. This flag is cleared after the envelope is found.
  • Returns false on failure.

vctl::MCVertex * mds::seg::CDelaunayTetra::findNearestVertex vctl::MCPoint3D *  pPoint,
bool  bStartFromPrevious = false
[protected]
 

Finds nearest vertex.

  • Returns NULL on failure.

template<class Function>
Function mds::seg::CDelaunayTetra::forEachTetrahedron Function  Func  )  [inline]
 

Calls function object for every tetrahedron in the mesh.

template<class Function>
Function mds::seg::CDelaunayTetra::forEachVertex Function  Func  )  [inline]
 

Calls function object for every vertex in the mesh.

vctl::MCTetra* mds::seg::CDelaunayTetra::getFirstTetrahedron  )  [inline]
 

Returns pointer to the first tetrahedron.

  • Returns NULL if there is no tetrahedron in the list.

vctl::MCVertex* mds::seg::CDelaunayTetra::getFirstVertex  )  [inline]
 

Returns pointer to the first vertex.

  • Returns NULL if there is no vertex in the list.

bool mds::seg::CDelaunayTetra::getMaxCoordinates double &  dX,
double &  dY,
double &  dZ
 

Estimates maximal vertex coordinates.

bool mds::seg::CDelaunayTetra::getMinCoordinates double &  dX,
double &  dY,
double &  dZ
 

Estimates minimal vertex coordinates in the mesh.

double mds::seg::CDelaunayTetra::getMinDihedralAngle  )  [inline]
 

Returns current minimal allowed dihedral angle [degrees].

double mds::seg::CDelaunayTetra::getMinEdgeLength  )  [inline]
 

Returns current minimal allowed edge length.

int mds::seg::CDelaunayTetra::getNumOfTetrahedra  )  [inline]
 

Returns the number of all tetrahedra.

int mds::seg::CDelaunayTetra::getNumOfVertices  )  [inline]
 

Returns the number of vertices.

vctl::MCTetraS* mds::seg::CDelaunayTetra::getTetrahedra  )  [inline]
 

Returns pointer to the container of tetrahedra.

double mds::seg::CDelaunayTetra::getTetrahedronQuality vctl::MCTetra *  pTetrahedron  )  [static, protected]
 

Computes tetrahedron quality.

  • Quotient of the longest tetrahedron edge and the inscribed sphere radius.

vctl::MCVerticeS* mds::seg::CDelaunayTetra::getVertices  )  [inline]
 

Returns pointer to the vertices container.

bool mds::seg::CDelaunayTetra::init vctl::MCPoint3D *  pMin,
vctl::MCPoint3D *  pMax,
mds::tSize  NumOfNodes = DEFAULT_NUMBER_OF_NODES
 

Initializes the Delaunay triangulation.

  • Vertices pMin and pMax are points defining the minimal and maximal vertex coordinates.
  • Removes all tetrahedra and vertices.

mds::seg::CDelaunayTetra::MDS_ENTITY_BLOCK_SIZE 4096   ) 
 

Standard method getEntityBlockSize().

Reimplemented in mds::seg::CTetraMesh.

mds::seg::CDelaunayTetra::MDS_ENTITY_COMPRESSION mds::mod::CC_RAW   ) 
 

Standard method getEntityCompression().

Reimplemented in mds::seg::CTetraMesh.

mds::seg::CDelaunayTetra::MDS_ENTITY_NAME "DelaunayTetra"   ) 
 

Standard method getEntityName().

vctl::MCVertex* mds::seg::CDelaunayTetra::newVertex double  x,
double  y,
double  z,
int  iFlags = 0
[inline]
 

Returns pointer to a newly created vertex.

vctl::MCVertex* mds::seg::CDelaunayTetra::newVertex vctl::MCPoint3D *  pPoint,
int  iFlags = 0
[inline]
 

Returns pointer to a newly created vertex.

bool mds::seg::CDelaunayTetra::optimizeByVertexAdding double  dMinQuality,
bool  bRandomPosition = true
 

Optimizes the triangulation.

  • Minimal required tetrahedron quality, the best value (= equilateral tetrahedron) is equal to one.

vctl::MCVertex * mds::seg::CDelaunayTetra::randomVertex double  x,
double  y,
double  z,
double  dMax = MAX_MOVEMENT
 

Generates randomly moved vertex.

vctl::MCVertex* mds::seg::CDelaunayTetra::randomVertex vctl::MCPoint3D *  pPoint,
double  dMax = MAX_MOVEMENT
[inline]
 

Generates randomly moved vertex.

void mds::seg::CDelaunayTetra::removeTetrahedron vctl::MCTetra *  pTetrahedron,
bool  bEraseVertices = false
[protected]
 

Removes a given existing tetrahedron.

template<class S>
void mds::seg::CDelaunayTetra::serialize mds::mod::CChannelSerializer< S > &  Writer  )  [inline]
 

Serializes the tetrahedron mesh.

Reimplemented in mds::seg::CTetraMesh.

void mds::seg::CDelaunayTetra::setConstraintFunc tConstraintFunc  ConstraintFunc  )  [inline]
 

Sets function called to check constrained facets.

void mds::seg::CDelaunayTetra::setDefaultConstraintFunc  )  [inline]
 

Sets default function for constrained facets checking.

void mds::seg::CDelaunayTetra::setDefaultMinEdgeLengthFunc  )  [inline]
 

Sets default function for checking minimal allowed edge length.

void mds::seg::CDelaunayTetra::setMinDihedralAngle double  dValue = DEFAULT_MIN_DIHEDRAL_ANGLE  )  [inline]
 

Sets minimal allowed dihedral angle in the triangulation [degrees].

void mds::seg::CDelaunayTetra::setMinEdgeLength double  dValue = DEFAULT_MIN_EDGE_LENGTH  )  [inline]
 

Sets minimal allowed edge length in the triangulation.

void mds::seg::CDelaunayTetra::setMinEdgeLengthFunc tMinEdgeLengthFunc  MinEdgeLengthFunc  )  [inline]
 

Sets function for checking minimal allowed edge length.


Friends And Related Function Documentation

friend class mds::base::CSharedPtr< CDelaunayTetra > [friend]
 


Member Data Documentation

const double mds::seg::CDelaunayTetra::DEFAULT_MIN_DIHEDRAL_ANGLE = 0.1 [static]
 

Minimal dihedral angle used to check tetrahedra flatness.

const double mds::seg::CDelaunayTetra::DEFAULT_MIN_EDGE_LENGTH = 1.5 [static]
 

Minimal length of a tetrahedron edge in the mesh.

const mds::tSize mds::seg::CDelaunayTetra::DEFAULT_NUMBER_OF_NODES = 5 [static]
 

Default methods parameters.

tConstraintFunc mds::seg::CDelaunayTetra::m_ConstraintFunc [protected]
 

Function for checking if a given facet is constrained.

double mds::seg::CDelaunayTetra::m_dMaxX [protected]
 

Maximal vertex coordinates in the mesh.

double mds::seg::CDelaunayTetra::m_dMaxY [protected]
 

double mds::seg::CDelaunayTetra::m_dMaxZ [protected]
 

double mds::seg::CDelaunayTetra::m_dMinDihedralAngle [protected]
 

Minimal allowed dihedral angle.

double mds::seg::CDelaunayTetra::m_dMinEdgeLength [protected]
 

Minimal allowed edge length.

double mds::seg::CDelaunayTetra::m_dMinX [protected]
 

Minimal vertex coordinates in the mesh.

double mds::seg::CDelaunayTetra::m_dMinY [protected]
 

double mds::seg::CDelaunayTetra::m_dMinZ [protected]
 

tMinEdgeLengthFunc mds::seg::CDelaunayTetra::m_MinEdgeLengthFunc [protected]
 

Function for checking minimal length of an edge.

vctl::MCVerticeS* mds::seg::CDelaunayTetra::m_pVertices [protected]
 

Pointer to the container of vertices which is stored.

in the container of vertices.

mds::math::CUniformPRNG mds::seg::CDelaunayTetra::m_Random [protected]
 

Random number generator.

vctl::MCTetraS mds::seg::CDelaunayTetra::m_Tetrahedra [protected]
 

Container of all tetrahedra in the mesh.

const double mds::seg::CDelaunayTetra::MAX_MOVEMENT = 0.001 [static]
 

Maximal allowed random permutation of vertex coordinates.


The documentation for this class was generated from the following files:
Generated on Thu Mar 11 10:35:58 2010 for MDSTk Extension Libraries by  doxygen 1.4.6-NO