Version: 9.12.0
SMESH_Delaunay Class Referenceabstract

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

#include <SMESH_Delaunay.hxx>

Inheritance diagram for SMESH_Delaunay:

Public Member Functions

 SMESH_Delaunay (const std::vector< const UVPtStructVec * > &boundaryNodes, const TopoDS_Face &face, const int faceID)
 Construct a Delaunay triangulation of given boundary nodes. More...
 
virtual ~SMESH_Delaunay ()
 
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 =0
 
 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
 

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. Boundary nodes given at the construction are not returned.

For usage, this class needs to be subclassed to implement getNodeUV();

Member Typedef Documentation

◆ TNodeTriaList

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

Constructor & Destructor Documentation

◆ SMESH_Delaunay()

SMESH_Delaunay::SMESH_Delaunay ( const std::vector< const UVPtStructVec * > &  boundaryNodes,
const TopoDS_Face &  face,
const int  faceID 
)

Construct a Delaunay triangulation of given boundary nodes.

Parameters
[in]boundaryNodes- vector of nodes of a wire
[in]face- the face
[in]faceID- the face ID

References _bndNodes, and _scale.

◆ ~SMESH_Delaunay()

virtual SMESH_Delaunay::~SMESH_Delaunay ( )
virtual

Member Function Documentation

◆ addCloseNodes()

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

◆ FindTriangle()

const BRepMesh_Triangle * SMESH_Delaunay::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.

References _scale, and SMESH_MeshAlgos::GetBarycentricCoords().

Referenced by NextNode().

◆ GetBndNodes()

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

◆ GetBndUV()

gp_XY SMESH_Delaunay::GetBndUV ( const int  iNode) const

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

◆ getNodeUV()

virtual gp_XY SMESH_Delaunay::getNodeUV ( const TopoDS_Face &  face,
const SMDS_MeshNode node 
) const
protectedpure virtual

Implemented in StdMeshers_ProjectionUtils::Delaunay.

Referenced by NextNode().

◆ GetScale()

const gp_XY& SMESH_Delaunay::GetScale ( ) const

◆ GetTriangleNear()

const BRepMesh_Triangle * SMESH_Delaunay::GetTriangleNear ( int  iBndNode)

Return a triangle sharing a given boundary node.

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

References _bndNodes.

Referenced by NextNode().

◆ Handle() [1/2]

SMESH_Delaunay::Handle ( BRepMesh_DataStructureOfDelaun  )
protected

◆ Handle() [2/2]

SMESH_Delaunay::Handle ( BRepMesh_DataStructureOfDelaun  )

◆ InitTraversal()

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

Prepare to the exploration of nodes.

References _iBndNode, _nbNodesToVisit, _nbVisitedNodes, and _noTriQueue.

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

◆ NbVisitedNodes()

size_t SMESH_Delaunay::NbVisitedNodes ( ) const

◆ NextNode()

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

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 _bndNodes, _face, _faceID, _iBndNode, _nbNodesToVisit, _nbVisitedNodes, _noTriQueue, addCloseNodes(), FindTriangle(), getNodeUV(), GetTriangleNear(), SMDS_MeshElement::isMarked(), and SMDS_MeshElement::setIsMarked().

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

◆ ToPython()

void SMESH_Delaunay::ToPython ( ) const

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
protected

◆ _face

const TopoDS_Face& SMESH_Delaunay::_face
protected

Referenced by NextNode().

◆ _faceID

int SMESH_Delaunay::_faceID
protected

Referenced by NextNode().

◆ _iBndNode

size_t SMESH_Delaunay::_iBndNode
protected

Referenced by InitTraversal(), and NextNode().

◆ _nbNodesToVisit

size_t SMESH_Delaunay::_nbNodesToVisit
protected

Referenced by InitTraversal(), and NextNode().

◆ _nbVisitedNodes

size_t SMESH_Delaunay::_nbVisitedNodes
protected

Referenced by InitTraversal(), and NextNode().

◆ _noTriQueue

TNodeTriaList SMESH_Delaunay::_noTriQueue
protected

◆ _scale

gp_XY SMESH_Delaunay::_scale
protected

Referenced by FindTriangle(), and SMESH_Delaunay().