Version: 9.16.0
StdMeshers_ProjectionUtils::Delaunay Class Reference

Create a Delaunay triangulation of nodes on a face boundary and provide exploration of nodes shared by elements lying on the face. More...

#include <StdMeshers_ProjectionUtils.hxx>

Inheritance diagram for StdMeshers_ProjectionUtils::Delaunay:

Public Member Functions

 Delaunay (const TSideVector &wires, bool checkUV=false)
 
 Delaunay (const std::vector< const UVPtStructVec * > &boundaryNodes, SMESH_MesherHelper &faceHelper, bool checkUV=false)
 
void InitTraversal (const int nbNodesToVisit=-1)
 Prepare to the exploration of nodes. More...
 
const SMDS_MeshNodeNextNode (double bc[3], int triaNodes[3])
 Return a node with its Barycentric Coordinates within the triangle defined by its node indices (zero based) More...
 
size_t NbVisitedNodes () const
 
const BRepMesh_Triangle * FindTriangle (const gp_XY &uv, const BRepMesh_Triangle *bmTria, double bc[3], int triaNodes[3])
 Find a Delaunay triangle containing a given 2D point and return barycentric coordinates within the found triangle. More...
 
const BRepMesh_Triangle * GetTriangleNear (int iBndNode)
 Return a triangle sharing a given boundary node. More...
 
const std::vector< const SMDS_MeshNode * > & GetBndNodes () const
 
gp_XY GetBndUV (const int iNode) const
 Return UV of the i-th source boundary node (zero based) More...
 
const gp_XY & GetScale () const
 
void ToPython () const
 Write a python script that creates an equal mesh in Mesh module. More...
 
 Handle (BRepMesh_DataStructureOfDelaun) GetDS()
 

Protected Types

typedef std::list< std::pair< const SMDS_MeshNode *, const BRepMesh_Triangle * > > TNodeTriaList
 

Protected Member Functions

virtual gp_XY getNodeUV (const TopoDS_Face &face, const SMDS_MeshNode *node) const
 
 Handle (BRepMesh_DataStructureOfDelaun) _triaDS
 

Static Protected Member Functions

static void addCloseNodes (const SMDS_MeshNode *node, const BRepMesh_Triangle *bmTria, const int faceID, TNodeTriaList &noTriQueue)
 Add non-marked nodes surrounding a given one to a queue. More...
 

Protected Attributes

const TopoDS_Face & _face
 
int _faceID
 
std::vector< const SMDS_MeshNode * > _bndNodes
 
gp_XY _scale
 
size_t _nbNodesToVisit
 
size_t _nbVisitedNodes
 
size_t _iBndNode
 
TNodeTriaList _noTriQueue
 

Private Attributes

SMESH_MesherHelper_helper
 
StdMeshers_FaceSidePtr _wire
 
bool_checkUVPtr
 
bool _checkUV
 

Detailed Description

Create a Delaunay triangulation of nodes on a face boundary and provide exploration of nodes shared by elements lying on the face.

For a returned node, also return a Delaunay triangle the node lies in and its Barycentric Coordinates within the triangle. Only non-marked nodes are visited.

The main methods are defined in ../SMESHUtils/SMESH_Delaunay.hxx

Member Typedef Documentation

◆ TNodeTriaList

typedef std::list< std::pair< const SMDS_MeshNode*, const BRepMesh_Triangle* > > SMESH_Delaunay::TNodeTriaList
protectedinherited

Constructor & Destructor Documentation

◆ Delaunay() [1/2]

StdMeshers_ProjectionUtils::Delaunay::Delaunay ( const TSideVector wires,
bool  checkUV = false 
)

References _checkUV, _checkUVPtr, _helper, and _wire.

◆ Delaunay() [2/2]

StdMeshers_ProjectionUtils::Delaunay::Delaunay ( const std::vector< const UVPtStructVec * > &  boundaryNodes,
SMESH_MesherHelper faceHelper,
bool  checkUV = false 
)

References _checkUV, _checkUVPtr, and _helper.

Member Function Documentation

◆ addCloseNodes()

void SMESH_Delaunay::addCloseNodes ( const SMDS_MeshNode node,
const BRepMesh_Triangle *  bmTria,
const int  faceID,
TNodeTriaList noTriQueue 
)
staticprotectedinherited

◆ FindTriangle()

const BRepMesh_Triangle * SMESH_Delaunay::FindTriangle ( const gp_XY &  uv,
const BRepMesh_Triangle *  bmTria,
double  bc[3],
int  triaNodes[3] 
)
inherited

Find a Delaunay triangle containing a given 2D point and return barycentric coordinates within the found triangle.

References SMESH_Delaunay::_scale, and SMESH_MeshAlgos::GetBarycentricCoords().

Referenced by SMESH_Delaunay::NextNode().

◆ GetBndNodes()

const std::vector< const SMDS_MeshNode * > & SMESH_Delaunay::GetBndNodes ( ) const
inherited

◆ GetBndUV()

gp_XY SMESH_Delaunay::GetBndUV ( const int  iNode) const
inherited

Return UV of the i-th source boundary node (zero based)

◆ getNodeUV()

gp_XY StdMeshers_ProjectionUtils::Delaunay::getNodeUV ( const TopoDS_Face &  face,
const SMDS_MeshNode node 
) const
protectedvirtual

◆ GetScale()

const gp_XY & SMESH_Delaunay::GetScale ( ) const
inherited

◆ GetTriangleNear()

const BRepMesh_Triangle * SMESH_Delaunay::GetTriangleNear ( int  iBndNode)
inherited

Return a triangle sharing a given boundary node.

Parameters
[in]iBndNode- index of the boundary node
Returns
const BRepMesh_Triangle* - a found triangle

References SMESH_Delaunay::_bndNodes.

Referenced by SMESH_Delaunay::NextNode().

◆ Handle() [1/2]

SMESH_Delaunay::Handle ( BRepMesh_DataStructureOfDelaun  )
protectedinherited

◆ Handle() [2/2]

SMESH_Delaunay::Handle ( BRepMesh_DataStructureOfDelaun  )
inherited

◆ InitTraversal()

void SMESH_Delaunay::InitTraversal ( const int  nbNodesToVisit = -1)
inherited

◆ NbVisitedNodes()

size_t SMESH_Delaunay::NbVisitedNodes ( ) const
inherited

◆ NextNode()

const SMDS_MeshNode * SMESH_Delaunay::NextNode ( double  bc[3],
int  triaNodes[3] 
)
inherited

Return a node with its Barycentric Coordinates within the triangle defined by its node indices (zero based)

Parameters
[out]bc- Barycentric Coordinates of the returned node
[out]triaNodes- indices of triangle nodes
Returns
const SMDS_MeshNode* - the next node or NULL

References SMESH_Delaunay::_bndNodes, SMESH_Delaunay::_face, SMESH_Delaunay::_faceID, SMESH_Delaunay::_iBndNode, SMESH_Delaunay::_nbNodesToVisit, SMESH_Delaunay::_nbVisitedNodes, SMESH_Delaunay::_noTriQueue, SMESH_Delaunay::addCloseNodes(), SMESH_Delaunay::FindTriangle(), SMESH_Delaunay::getNodeUV(), SMESH_Delaunay::GetTriangleNear(), SMDS_MeshElement::isMarked(), and SMDS_MeshElement::setIsMarked().

Referenced by StdMeshers_ProjectionUtils::Morph::Perform().

◆ ToPython()

void SMESH_Delaunay::ToPython ( ) const
inherited

Write a python script that creates an equal mesh in Mesh module.

References SMESH_File::openForWriting(), SMESH_File::remove(), and SMESH_File::write().

Field Documentation

◆ _bndNodes

std::vector< const SMDS_MeshNode* > SMESH_Delaunay::_bndNodes
protectedinherited

◆ _checkUV

bool StdMeshers_ProjectionUtils::Delaunay::_checkUV
private

Referenced by Delaunay().

◆ _checkUVPtr

bool* StdMeshers_ProjectionUtils::Delaunay::_checkUVPtr
private

Referenced by Delaunay(), and getNodeUV().

◆ _face

const TopoDS_Face& SMESH_Delaunay::_face
protectedinherited

◆ _faceID

int SMESH_Delaunay::_faceID
protectedinherited

◆ _helper

SMESH_MesherHelper* StdMeshers_ProjectionUtils::Delaunay::_helper
private

Referenced by Delaunay(), and getNodeUV().

◆ _iBndNode

size_t SMESH_Delaunay::_iBndNode
protectedinherited

◆ _nbNodesToVisit

size_t SMESH_Delaunay::_nbNodesToVisit
protectedinherited

◆ _nbVisitedNodes

size_t SMESH_Delaunay::_nbVisitedNodes
protectedinherited

◆ _noTriQueue

TNodeTriaList SMESH_Delaunay::_noTriQueue
protectedinherited

◆ _scale

gp_XY SMESH_Delaunay::_scale
protectedinherited

◆ _wire

StdMeshers_FaceSidePtr StdMeshers_ProjectionUtils::Delaunay::_wire
private

Referenced by Delaunay().