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,
94 static TopoDS_Shape GetSubShapeByNode(
const SMDS_MeshNode* node,
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;
112 static int NbAncestors(
const TopoDS_Shape& shape,
114 TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE);
130 bool IsQuadraticSubMesh(
const TopoDS_Shape& theShape);
135 { myCreateQuadratic = theBuildQuadratic; }
145 void FixQuadraticElements(
bool volumeOnly=
true);
157 void SetSubShape(
const int subShapeID);
158 void SetSubShape(
const TopoDS_Shape& subShape);
172 SMDS_MeshNode* AddNode(
double x,
double y,
double z,
int ID = 0);
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);
243 double GetNodeU(
const TopoDS_Edge& theEdge,
250 gp_XY GetNodeUV(
const TopoDS_Face& F,
253 bool* check=0)
const;
258 bool CheckNodeUV(
const TopoDS_Face& F,
261 const double tol)
const;
265 static gp_XY GetMiddleUV(
const Handle(Geom_Surface)& surface,
275 bool GetNodeUVneedInFaceNode(
const TopoDS_Face& F = TopoDS_Face())
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(); }
332 double GetOtherParam(
const double param)
const;
350 { myTLinkNodeMap.insert(aMap.begin(), aMap.end()); }
363 MType IsQuadraticMesh();
373 gp_Pnt2d GetUVOnSeam(
const gp_Pnt2d& uv1,
const gp_Pnt2d& uv2 )
const;
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.
std::set< int > myDegenShapeIds
int GetSubShapeID() const
Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape()
std::map< SMESH_TLink, const SMDS_MeshNode * > TLinkNodeMap
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.
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.
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.
std::set< int > mySeamShapeIds
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()
MType
Check mesh without geometry for: if all elements on this shape are quadratic, quadratic elements will...
bool GetIsQuadratic() const
Return myCreateQuadratic flag.
SMESH_Mesh * GetMesh() const
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....
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.
std::map< double, TNodeColumn > TParam2ColumnMap