Go to the documentation of this file.
26 #ifndef SMESH_MesherHelper_HeaderFile
27 #define SMESH_MesherHelper_HeaderFile
35 #include <Geom_Surface.hxx>
36 #include <TopoDS_Face.hxx>
37 #include <TopoDS_Shape.hxx>
38 #include <gp_Pnt2d.hxx>
43 typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator
ItTLinkNode;
85 const TopoDS_Face& theFace,
86 const TopoDS_Edge& theBaseEdge,
103 static int WrapIndex(
const int ind,
const int nbNodes) {
104 if ( ind < 0 )
return nbNodes + ind % nbNodes;
105 if ( ind >= nbNodes )
return ind % nbNodes;
114 TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE);
135 { myCreateQuadratic = theBuildQuadratic; }
179 const bool force3d =
true);
187 const bool force3d =
false);
196 const bool force3d =
false);
205 const bool force3d =
true);
215 const bool force3d =
true);
226 const bool force3d =
true);
239 bool force3d =
true);
253 bool* check=0)
const;
261 const double tol)
const;
285 {
return myDegenShapeIds.find( subShape ) != myDegenShapeIds.end(); }
295 {
return mySeamShapeIds.find( subShape ) != mySeamShapeIds.end(); }
305 {
return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); }
311 {
return mySeamShapeIds.find( -subShape ) != mySeamShapeIds.end(); }
317 {
return IsRealSeam( GetMeshDS()->ShapeToIndex( subShape)); }
323 bool HasSeam()
const {
return !mySeamShapeIds.empty(); }
350 { myTLinkNodeMap.insert(aMap.begin(), aMap.end()); }
373 gp_Pnt2d
GetUVOnSeam(
const gp_Pnt2d& uv1,
const gp_Pnt2d& uv2 )
const;
SMDS_MeshVolume * AddVolume(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8, const int id=0, bool force3d=true)
SMDS_MeshNode * AddNode(double x, double y, double z, int ID=0)
void FixQuadraticElements(bool volumeOnly=true)
Move medium nodes of faces and volumes to fix distorted elements.
void AddTLinkNodeMap(const TLinkNodeMap &aMap)
Auxilary function for filling myTLinkNodeMap.
class Handle(MeshVS_DataSource3D)
bool IsSeamShape(const TopoDS_Shape &subShape) const
Check if shape is a seam edge or it's vertex.
static gp_XY GetMiddleUV(const Handle(Geom_Surface)&surface, const gp_XY &uv1, const gp_XY &uv2)
Return middle UV taking in account surface period.
void SetSubShape(const TopoDS_Shape &subShape)
==SMESHDS_Mesh::ShapeToIndex(shape)
static TopoDS_Shape GetSubShapeByNode(const SMDS_MeshNode *node, SMESHDS_Mesh *meshDS)
Return support shape of a node.
static bool IsMedium(const SMDS_MeshNode *node, const SMDSAbs_ElementType typeToCheck=SMDSAbs_All)
Returns true if given node is medium.
std::set< int > myDegenShapeIds
void SetSubShape(const int subShapeID)
Set shape to make elements on without calling IsQuadraticSubMesh()
int GetSubShapeID() const
Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape()
std::map< SMESH_TLink, const SMDS_MeshNode * > TLinkNodeMap
const SMDS_MeshNode * GetMediumNode(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const bool force3d)
Special function for search or creation medium node.
SMESHDS_Mesh * GetMeshDS() const
TopoDS_Shape GetSubShape() const
Return the shape set by IsQuadraticSubMesh() or SetSubShape()
std::map< SMESH_TLink, const SMDS_MeshNode * >::iterator ItTLinkNode
std::set< int > myOkNodePosShapes
bool HasSeam() const
Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a seam edge.
SMDS_MeshVolume * AddVolume(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const int id=0, const bool force3d=true)
bool IsDegenShape(const int subShape) const
Check if shape is a degenerated edge or it's vertex.
std::vector< const SMDS_MeshNode * > TNodeColumn
It helps meshers to add elements.
static int NbAncestors(const TopoDS_Shape &shape, const SMESH_Mesh &mesh, TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE)
Return number of unique ancestors of the shape.
SMDS_MeshVolume * AddVolume(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const int id=0, const bool force3d=true)
bool IsRealSeam(const int subShape) const
Return true if an edge or a vertex encounters twice in face wire.
const TLinkNodeMap & GetTLinkNodeMap() const
Returns myTLinkNodeMap.
TLinkNodeMap myTLinkNodeMap
SMDS_MeshFace * AddFace(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const int id=0, const bool force3d=false)
double GetOtherParam(const double param) const
Return an alternative parameter for a node on seam.
std::set< int > mySeamShapeIds
SMESH_MesherHelper(SMESH_Mesh &theMesh)
SMDS_MeshEdge * AddEdge(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const int id=0, const bool force3d=true)
gp_Pnt2d GetUVOnSeam(const gp_Pnt2d &uv1, const gp_Pnt2d &uv2) const
Select UV on either of 2 pcurves of a seam edge, closest to the given UV.
bool IsRealSeam(const TopoDS_Shape &subShape) const
Return true if an edge or a vertex encounters twice in face wire.
SMESH_MesherHelper(const SMESH_MesherHelper &theOther)
void SetIsQuadratic(const bool theBuildQuadratic)
Set order of elements to create without calling IsQuadraticSubMesh()
bool GetNodeUVneedInFaceNode(const TopoDS_Face &F=TopoDS_Face()) const
Check if inFaceNode argument is necessary for call GetNodeUV(F,..)
bool IsQuadraticSubMesh(const TopoDS_Shape &theShape)
bool CheckNodeUV(const TopoDS_Face &F, const SMDS_MeshNode *n, gp_XY &uv, const double tol) const
Check and fix node UV on a face.
MType
Check mesh without geometry for: if all elements on this shape are quadratic, quadratic elements will...
SMDS_MeshVolume * AddVolume(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const int id=0, const bool force3d=true)
bool GetIsQuadratic() const
Return myCreateQuadratic flag.
SMESH_Mesh * GetMesh() const
double GetNodeU(const TopoDS_Edge &theEdge, const SMDS_MeshNode *theNode, bool *check=0)
Return U of the given node on the edge.
SMDSAbs_ElementType
Type (node, edge, face or volume) of elements.
static int WrapIndex(const int ind, const int nbNodes)
Return a valid node index, fixing the given one if necessary.
void SetElementsOnShape(bool toSet)
To set created elements on the shape set by IsQuadraticSubMesh() or the next methods....
gp_XY GetNodeUV(const TopoDS_Face &F, const SMDS_MeshNode *n, const SMDS_MeshNode *inFaceNode=0, bool *check=0) const
Return node UV on face.
static bool LoadNodeColumns(TParam2ColumnMap &theParam2ColumnMap, const TopoDS_Face &theFace, const TopoDS_Edge &theBaseEdge, SMESHDS_Mesh *theMesh)
Load nodes bound to face into a map of node columns.
void AddTLinkNode(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n12)
bool IsSeamShape(const int subShape) const
Check if shape is a seam edge or it's vertex.
int GetPeriodicIndex() const
Return index of periodic parametric direction of a closed face.
SMDS_MeshFace * AddFace(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const int id=0, const bool force3d=false)
std::map< double, TNodeColumn > TParam2ColumnMap