26 #ifndef SMESH_MesherHelper_HeaderFile
27 #define SMESH_MesherHelper_HeaderFile
35 #include <TopoDS_Face.hxx>
36 #include <TopoDS_Shape.hxx>
37 #include <gp_Pnt2d.hxx>
41 typedef std::pair<const SMDS_MeshNode*, const SMDS_MeshNode*>
NLink;
43 typedef std::map<NLink, const SMDS_MeshNode*>::iterator
ItNLinkNode;
85 const TopoDS_Face& theFace,
86 const TopoDS_Edge& theBaseEdge,
104 static int WrapIndex(
const int ind,
const int nbNodes) {
105 if ( ind < 0 )
return nbNodes + ind % nbNodes;
106 if ( ind >= nbNodes )
return ind % nbNodes;
115 TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE);
136 { myCreateQuadratic = theBuildQuadratic; }
152 void SetSubShape(
const int subShapeID);
167 SMDS_MeshNode* AddNode(
double x,
double y,
double z,
int ID = 0);
174 const bool force3d =
true);
182 const bool force3d =
false);
191 const bool force3d =
false);
200 const bool force3d =
true);
210 const bool force3d =
true);
221 const bool force3d =
true);
234 bool force3d =
true);
238 double GetNodeU(
const TopoDS_Edge& theEdge,
244 gp_XY GetNodeUV(
const TopoDS_Face& F,
254 bool GetNodeUVneedInFaceNode(
const TopoDS_Face& F = TopoDS_Face())
const;
264 {
return myDegenShapeIds.find( subShape ) != myDegenShapeIds.end(); }
274 {
return mySeamShapeIds.find( subShape ) != mySeamShapeIds.end(); }
284 {
return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); }
290 {
return mySeamShapeIds.find( -subShape ) != mySeamShapeIds.end(); }
296 {
return IsRealSeam( GetMeshDS()->ShapeToIndex( subShape)); }
302 bool HasSeam()
const {
return !mySeamShapeIds.empty(); }
311 double GetOtherParam(
const double param)
const;
329 { myNLinkNodeMap.insert(aMap.begin(), aMap.end()); }
342 MType IsQuadraticMesh();
352 gp_Pnt2d GetUVOnSeam(
const gp_Pnt2d& uv1,
const gp_Pnt2d& uv2 )
const;
void SetIsQuadratic(const bool theBuildQuadratic)
Set order of elements to create without calling IsQuadraticSubMesh()
const SMDS_PositionPtr & GetPosition() const
bool IsRealSeam(const TopoDS_Shape &subShape) const
Return true if an edge or a vertex encounters twice in face wire.
static const TopoDS_Shape & GetSubShapeByNode(const SMDS_MeshNode *node, SMESHDS_Mesh *meshDS)
Return support shape of a node.
std::set< int > myDegenShapeIds
std::set< int > mySeamShapeIds
const TopoDS_Shape & IndexToShape(int ShapeIndex) const
MType
Check mesh without geometry for: if all elements on this shape are quadratic, quadratic elements will...
bool IsSeamShape(const TopoDS_Shape &subShape) const
Check if shape is a seam edge or it's vertex.
int GetSubShapeID() const
Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape()
SMDSAbs_ElementType
Type (node, edge, face or volume) of elements.
SMESH_Mesh * GetMesh() const
TopoDS_Shape GetSubShape() const
Return the shape set by IsQuadraticSubMesh() or SetSubShape()
const NLinkNodeMap & GetNLinkNodeMap() const
Returns myNLinkNodeMap.
SMESHDS_Mesh * GetMeshDS() const
void SetElementsOnShape(bool toSet)
To set created elements on the shape set by IsQuadraticSubMesh() or the next methods. By defaul elements are set on the shape if a mesh has no shape to be meshed.
std::map< double, TNodeColumn > TParam2ColumnMap
void AddNLinkNodeMap(const NLinkNodeMap &aMap)
Auxilary function for filling myNLinkNodeMap.
static int WrapIndex(const int ind, const int nbNodes)
Return a valid node index, fixing the given one if necessary.
SMESH_MesherHelper(const SMESH_MesherHelper &theOther)
bool IsDegenShape(const int subShape) const
Check if shape is a degenerated edge or it's vertex.
bool GetIsQuadratic() const
Return myCreateQuadratic flag.
std::map< NLink, const SMDS_MeshNode * >::iterator ItNLinkNode
std::map< NLink, const SMDS_MeshNode * > NLinkNodeMap
bool IsSeamShape(const int subShape) const
Check if shape is a seam edge or it's vertex.
std::pair< const SMDS_MeshNode *, const SMDS_MeshNode * > NLink
bool IsRealSeam(const int subShape) const
Return true if an edge or a vertex encounters twice in face wire.
int GetPeriodicIndex() const
Return index of periodic parametric direction of a closed face.
bool HasSeam() const
Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a seam edge.
std::vector< const SMDS_MeshNode * > TNodeColumn
It helps meshers to add elements.