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>
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_MeshNode * | NextNode (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 |
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();
|
protected |
SMESH_Delaunay::SMESH_Delaunay | ( | const std::vector< const UVPtStructVec * > & | boundaryNodes, |
const TopoDS_Face & | face, | ||
const int | faceID | ||
) |
|
virtual |
|
staticprotected |
Add non-marked nodes surrounding a given one to a queue.
References _noTriQueue, SMDS_MeshNode::GetInverseElementIterator(), SMDS_MeshElement::GetNode(), SMDS_MeshElement::getshapeId(), SMDS_MeshElement::isMarked(), SMDS_MeshElement::NbNodes(), and SMDSAbs_Face.
Referenced by NextNode().
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().
const std::vector< const SMDS_MeshNode* >& SMESH_Delaunay::GetBndNodes | ( | ) | const |
Referenced by StdMeshers_ProjectionUtils::Morph::Perform().
gp_XY SMESH_Delaunay::GetBndUV | ( | const int | iNode | ) | const |
Return UV of the i-th source boundary node (zero based)
|
protectedpure virtual |
Implemented in StdMeshers_ProjectionUtils::Delaunay.
Referenced by NextNode().
const gp_XY& SMESH_Delaunay::GetScale | ( | ) | const |
const BRepMesh_Triangle * SMESH_Delaunay::GetTriangleNear | ( | int | iBndNode | ) |
Return a triangle sharing a given boundary node.
[in] | iBndNode | - index of the boundary node |
References _bndNodes.
Referenced by NextNode().
|
protected |
SMESH_Delaunay::Handle | ( | BRepMesh_DataStructureOfDelaun | ) |
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().
size_t SMESH_Delaunay::NbVisitedNodes | ( | ) | const |
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)
[out] | bc | - Barycentric Coordinates of the returned node |
[out] | triaNodes | - indices of triangle nodes |
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().
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().
|
protected |
Referenced by GetTriangleNear(), NextNode(), and SMESH_Delaunay().
|
protected |
Referenced by NextNode().
|
protected |
Referenced by NextNode().
|
protected |
Referenced by InitTraversal(), and NextNode().
|
protected |
Referenced by InitTraversal(), and NextNode().
|
protected |
Referenced by InitTraversal(), and NextNode().
|
protected |
Referenced by addCloseNodes(), InitTraversal(), and NextNode().
|
protected |
Referenced by FindTriangle(), and SMESH_Delaunay().