Go to the documentation of this file.
28 #ifndef SMESH_MeshEditor_HeaderFile
29 #define SMESH_MeshEditor_HeaderFile
31 #include "Standard_Version.hxx"
41 #include <TColStd_HSequenceOfReal.hxx>
58 typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*>
TNodeNodeMap;
63 typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* >
NLink;
89 std::vector< const SMDS_MeshElement* >& foundElems)=0;
101 {
if ( n1->
GetID() < n2->
GetID() ) std::swap( first, second ); }
103 {
if ( first->GetID() < second->GetID() ) std::swap( first, second ); }
116 myPnt.SetCoord(99., 99., 99.);
117 myTgt.SetCoord(1.,0.,0.);
181 bool Remove (
const std::list< int >& theElemIDs,
const bool isNodes);
217 const double theMaxAngle);
235 const bool the13Diag);
250 std::set<const SMDS_MeshNode*> & theFixedNodes,
252 const int theNbIterations,
253 double theTgtAspectRatio = 1.0,
254 const bool the2D =
true);
267 const gp_Ax1& theAxis,
268 const double theAngle,
269 const int theNbSteps,
270 const double theToler,
271 const bool theMakeGroups,
272 const bool theMakeWalls=
true);
282 EXTRUSION_FLAG_BOUNDARY = 0x01,
283 EXTRUSION_FLAG_SEW = 0x02
302 const double tolnode,
318 const gp_Vec& theStep,
319 const int theNbSteps,
321 const bool theMakeGroups,
322 const int theFlags = EXTRUSION_FLAG_BOUNDARY,
323 const double theTolerance = 1.e-6);
338 const bool theMakeGroups,
340 const double theTolerance);
353 EXTR_CANT_GET_TANGENT
359 const bool theHasAngles,
360 std::list<double>& theAngles,
361 const bool theLinearVariation,
362 const bool theHasRefPoint,
363 const gp_Pnt& theRefPoint,
364 const bool theMakeGroups);
368 const bool theHasAngles,
369 std::list<double>& theAngles,
370 const bool theLinearVariation,
371 const bool theHasRefPoint,
372 const gp_Pnt& theRefPoint,
373 const bool theMakeGroups);
378 const gp_Trsf& theTrsf,
380 const bool theMakeGroups,
388 const double theTolerance,
409 std::vector<const SMDS_MeshNode *>& poly_nodes,
410 std::vector<int>& quantities)
const;
440 std::list< const SMDS_MeshNode* > & theNodes,
441 std::list< const SMDS_MeshElement* >& theFaces);
467 const bool theSide2IsFreeBorder =
true,
468 const bool toCreatePolygons =
false,
469 const bool toCreatePolyedrs =
false);
506 std::list<const SMDS_MeshNode*>& theNodesToInsert,
507 const bool toCreatePoly =
false);
513 std::list<const SMDS_MeshNode*>& theNodesToInsert);
579 std::set<const SMDS_MeshElement*>& theSide2,
608 const std::list< int >& theListOfModifiedElems );
616 const TopoDS_Shape& theShape );
633 const bool theForce3d);
641 const int theShapeID);
650 const std::string& postfix,
668 const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
669 std::list<const SMDS_MeshElement*>& newElems,
693 const TopoDS_Edge& aTrackEdge,
695 list<SMESH_MeshEditor_PathPoint>& LPP);
697 list<SMESH_MeshEditor_PathPoint>& fullList,
698 const bool theHasAngles,
699 list<double>& theAngles,
700 const bool theLinearVariation,
701 const bool theHasRefPoint,
702 const gp_Pnt& theRefPoint,
703 const bool theMakeGroups);
705 list<double>& theAngles);
712 const bool theIsDoubleElem );
int BestSplit(const SMDS_MeshElement *theQuad, SMESH::Controls::NumericalFunctorPtr theCriterion)
Find better diagonal for splitting.
SMESHDS_Mesh * GetMeshDS()
bool ConvertFromQuadratic()
bool TriToQuad(TIDSortedElemSet &theElems, SMESH::Controls::NumericalFunctorPtr theCriterion, const double theMaxAngle)
Fuse neighbour triangles into quadrangles.
static void ReplaceElemInGroups(const SMDS_MeshElement *elemToRm, const SMDS_MeshElement *elemToAdd, SMESHDS_Mesh *aMesh)
const SMDS_MeshNode * CreateNode(const double x, const double y, const double z, const double tolnode, SMESH_SequenceOfNode &aNodes)
bool Remove(const std::list< int > &theElemIDs, const bool isNodes)
void LinearAngleVariation(const int NbSteps, list< double > &theAngles)
const SMESH_SequenceOfElemPtr & GetLastCreatedElems() const
boost::shared_ptr< SMDS_Iterator< const SMDS_MeshElement * > > SMDS_ElemIteratorPtr
bool InverseDiag(const SMDS_MeshElement *theTria1, const SMDS_MeshElement *theTria2)
std::set< const SMDS_MeshElement *, TIDCompare > TIDSortedElemSet
PGroupIDs ExtrusionSweep(TIDSortedElemSet &theElems, ExtrusParam &theParams, TElemOfElemListMap &newElemsMap, const bool theMakeGroups, const int theFlags, const double theTolerance)
Sew_Error SewSideElements(TIDSortedElemSet &theSide1, TIDSortedElemSet &theSide2, const SMDS_MeshNode *theFirstNode1ToMerge, const SMDS_MeshNode *theFirstNode2ToMerge, const SMDS_MeshNode *theSecondNode1ToMerge, const SMDS_MeshNode *theSecondNode2ToMerge)
int removeQuadElem(SMESHDS_SubMesh *theSm, SMDS_ElemIteratorPtr theItr, const int theShapeID)
Convert quadratic elements to linear ones and remove quadratic nodes.
bool DoubleNodes(const std::list< int > &theListOfNodes, const std::list< int > &theListOfModifiedElems)
int FindShape(const SMDS_MeshElement *theElem)
Extrusion_Error ExtrusionAlongTrack(TIDSortedElemSet &theElements, SMESH_Mesh *theTrackPattern, const SMDS_MeshNode *theNodeStart, const bool theHasAngles, std::list< double > &theAngles, const bool theLinearVariation, const bool theHasRefPoint, const gp_Pnt &theRefPoint, const bool theMakeGroups)
SMESH_TLink(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2)
static Sew_Error FindMatchingNodes(std::set< const SMDS_MeshElement * > &theSide1, std::set< const SMDS_MeshElement * > &theSide2, const SMDS_MeshNode *theFirstNode1, const SMDS_MeshNode *theFirstNode2, const SMDS_MeshNode *theSecondNode1, const SMDS_MeshNode *theSecondNode2, TNodeNodeMap &nReplaceMap)
Find corresponding nodes in two sets of faces.
static bool CheckFreeBorderNodes(const SMDS_MeshNode *theNode1, const SMDS_MeshNode *theNode2, const SMDS_MeshNode *theNode3=0)
bool doubleNodes(SMESHDS_Mesh *theMeshDS, const TIDSortedElemSet &theElems, const TIDSortedElemSet &theNodesNot, std::map< const SMDS_MeshNode *, const SMDS_MeshNode * > &theNodeNodeMap, const bool theIsDoubleElem)
int convertElemToQuadratic(SMESHDS_SubMesh *theSm, SMESH_MesherHelper &theHelper, const bool theForce3d)
Convert elements contained in a submesh to quadratic.
SMESH_TLink(const NLink &link)
@ SEW_BOTH_BORDERS_NOT_FOUND
SMESH_SequenceOfElemPtr myLastCreatedElems
void Smooth(TIDSortedElemSet &theElements, std::set< const SMDS_MeshNode * > &theFixedNodes, const SmoothMethod theSmoothMethod, const int theNbIterations, double theTgtAspectRatio=1.0, const bool the2D=true)
void MergeElements(TListOfListOfElementsID &theGroupsOfElementsID)
std::vector< TNodeOfNodeListMapItr > TVecOfNnlmiMap
bool Make2DMeshFrom3D()
Generated skin mesh (containing 2D cells) from 3D mesh The created 2D mesh elements based on nodes of...
const SMDS_MeshNode * node2() const
SMDS_MeshElement * AddElement(const std::vector< int > &nodeIDs, const SMDSAbs_ElementType type, const bool isPoly, const int ID=0)
Add element.
bool InverseDiag(const SMDS_MeshNode *theNode1, const SMDS_MeshNode *theNode2)
PGroupIDs Transform(TIDSortedElemSet &theElements, const gp_Trsf &theTrsf, const bool theCopy, const bool theMakeGroups, SMESH_Mesh *theTargetMesh=0)
SMESH_ElementSearcher * GetElementSearcher()
Return SMESH_ElementSearcher.
std::map< const SMDS_MeshNode *, std::list< const SMDS_MeshNode * > > TNodeOfNodeListMap
Handle(TColStd_HSequenceOfReal) mySteps
const SMESH_SequenceOfElemPtr & GetLastCreatedNodes() const
void sweepElement(const SMDS_MeshElement *elem, const std::vector< TNodeOfNodeListMapItr > &newNodesItVec, std::list< const SMDS_MeshElement * > &newElems, const int nbSteps, SMESH_SequenceOfElemPtr &srcElements)
Create elements by sweeping an element.
Extrusion_Error ExtrusionAlongTrack(TIDSortedElemSet &theElements, SMESH_subMesh *theTrackPattern, const SMDS_MeshNode *theNodeStart, const bool theHasAngles, std::list< double > &theAngles, const bool theLinearVariation, const bool theHasRefPoint, const gp_Pnt &theRefPoint, const bool theMakeGroups)
static bool isOut(const SMDS_MeshElement *element, const gp_Pnt &point, double tol)
Return true if the point is IN or ON of the element.
SMESH_SequenceOfElemPtr myLastCreatedNodes
@ SEW_TOPO_DIFF_SETS_OF_ELEMENTS
static void GetLinkedNodes(const SMDS_MeshNode *node, TIDSortedElemSet &linkedNodes, SMDSAbs_ElementType type=SMDSAbs_All)
Return nodes linked to the given one in elements of the type.
PGroupIDs generateGroups(const SMESH_SequenceOfElemPtr &nodeGens, const SMESH_SequenceOfElemPtr &elemGens, const std::string &postfix, SMESH_Mesh *targetMesh=0)
Create groups of elements made during transformation.
SMESH_MeshEditor_PathPoint()
static bool FindFreeBorder(const SMDS_MeshNode *theFirstNode, const SMDS_MeshNode *theSecondNode, const SMDS_MeshNode *theLastNode, std::list< const SMDS_MeshNode * > &theNodes, std::list< const SMDS_MeshElement * > &theFaces)
void UpdateVolumes(const SMDS_MeshNode *theBetweenNode1, const SMDS_MeshNode *theBetweenNode2, std::list< const SMDS_MeshNode * > &theNodesToInsert)
void makeWalls(TNodeOfNodeListMap &mapNewNodes, TElemOfElemListMap &newElemsMap, TElemOfVecOfNnlmiMap &elemNewNodesMap, TIDSortedElemSet &elemSet, const int nbSteps, SMESH_SequenceOfElemPtr &srcElements)
Create 1D and 2D elements around swept elements.
void MergeNodes(TListOfListOfNodes &theNodeGroups)
void FindCoincidentNodes(std::set< const SMDS_MeshNode * > &theNodes, const double theTolerance, TListOfListOfNodes &theGroupsOfNodes)
pair< const SMDS_MeshNode *, const SMDS_MeshNode * > NLink
std::auto_ptr< std::list< int > > PGroupIDs
void SetTangent(const gp_Dir &aTgt)
static void AddToSameGroups(const SMDS_MeshElement *elemToAdd, const SMDS_MeshElement *elemInGroups, SMESHDS_Mesh *aMesh)
NCollection_Sequence< SMDS_MeshNodePtr > SMESH_SequenceOfNode
std::map< const SMDS_MeshElement *, std::list< const SMDS_MeshElement * > > TElemOfElemListMap
const gp_Pnt & Pnt() const
Searcher for the node closest to point.
virtual void MoveNode(const SMDS_MeshNode *node, const gp_Pnt &toPnt)=0
bool DoubleNodesInRegion(const TIDSortedElemSet &theElems, const TIDSortedElemSet &theNodesNot, const TopoDS_Shape &theShape)
void InsertNodesIntoLink(const SMDS_MeshElement *theFace, const SMDS_MeshNode *theBetweenNode1, const SMDS_MeshNode *theBetweenNode2, std::list< const SMDS_MeshNode * > &theNodesToInsert, const bool toCreatePoly=false)
SMESH_MeshEditor(SMESH_Mesh *theMesh)
@ SEW_DIFF_NB_OF_ELEMENTS
SMDS_MeshElement * AddElement(const std::vector< const SMDS_MeshNode * > &nodes, const SMDSAbs_ElementType type, const bool isPoly, const int ID=0)
Add element.
bool Reorient(const SMDS_MeshElement *theElement)
Return elements of given type where the given point is IN or ON.
static void RemoveElemFromGroups(const SMDS_MeshElement *element, SMESHDS_Mesh *aMesh)
Extrusion_Error MakeExtrElements(TIDSortedElemSet &theElements, list< SMESH_MeshEditor_PathPoint > &fullList, const bool theHasAngles, list< double > &theAngles, const bool theLinearVariation, const bool theHasRefPoint, const gp_Pnt &theRefPoint, const bool theMakeGroups)
std::list< std::list< int > > TListOfListOfElementsID
SMESH_NodeSearcher * GetNodeSearcher()
Return SMESH_NodeSearcher.
PGroupIDs RotationSweep(TIDSortedElemSet &theElements, const gp_Ax1 &theAxis, const double theAngle, const int theNbSteps, const double theToler, const bool theMakeGroups, const bool theMakeWalls=true)
Sew_Error SewFreeBorder(const SMDS_MeshNode *theBorderFirstNode, const SMDS_MeshNode *theBorderSecondNode, const SMDS_MeshNode *theBorderLastNode, const SMDS_MeshNode *theSide2FirstNode, const SMDS_MeshNode *theSide2SecondNode, const SMDS_MeshNode *theSide2ThirdNode=0, const bool theSide2IsFreeBorder=true, const bool toCreatePolygons=false, const bool toCreatePolyedrs=false)
SMDSAbs_ElementType
Type (node, edge, face or volume) of elements.
bool QuadToTri(TIDSortedElemSet &theElems, SMESH::Controls::NumericalFunctorPtr theCriterion)
Split quadrangles into triangles.
void SetParameter(const double &aPrm)
const SMDS_MeshNode * node1() const
int SimplifyFace(const std::vector< const SMDS_MeshNode * > faceNodes, std::vector< const SMDS_MeshNode * > &poly_nodes, std::vector< int > &quantities) const
TNodeOfNodeListMap::iterator TNodeOfNodeListMapItr
void MergeEqualElements()
void ConvertToQuadratic(const bool theForce3d)
boost::shared_ptr< NumericalFunctor > NumericalFunctorPtr
PGroupIDs ExtrusionSweep(TIDSortedElemSet &theElems, const gp_Vec &theStep, const int theNbSteps, TElemOfElemListMap &newElemsMap, const bool theMakeGroups, const int theFlags=EXTRUSION_FLAG_BOUNDARY, const double theTolerance=1.e-6)
void SetAngle(const double &aBeta)
std::map< const SMDS_MeshNode *, const SMDS_MeshNode * > TNodeNodeMap
Set of elements sorted by ID, to be used to assure predictability of edition.
virtual void FindElementsByPoint(const gp_Pnt &point, SMDSAbs_ElementType type, std::vector< const SMDS_MeshElement * > &foundElems)=0
bool DeleteDiag(const SMDS_MeshNode *theNode1, const SMDS_MeshNode *theNode2)
Extrusion_Error MakeEdgePathPoints(std::list< double > &aPrms, const TopoDS_Edge &aTrackEdge, bool FirstIsStart, list< SMESH_MeshEditor_PathPoint > &LPP)
static const SMDS_MeshElement * FindFaceInSet(const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const TIDSortedElemSet &elemSet, const TIDSortedElemSet &avoidSet)
static bool IsMedium(const SMDS_MeshNode *node, const SMDSAbs_ElementType typeToCheck=SMDSAbs_All)
Returns true if given node is medium.
const gp_Dir & Tangent() const
std::map< const SMDS_MeshElement *, TVecOfNnlmiMap > TElemOfVecOfNnlmiMap
std::list< std::list< const SMDS_MeshNode * > > TListOfListOfNodes
SMESH_SequenceOfNode myNodes
virtual const SMDS_MeshNode * FindClosestTo(const gp_Pnt &pnt)=0
void SetPnt(const gp_Pnt &aP3D)
bool DoubleNodes(const TIDSortedElemSet &theElems, const TIDSortedElemSet &theNodesNot, const TIDSortedElemSet &theAffectedElems)
void FindEqualElements(std::set< const SMDS_MeshElement * > &theElements, TListOfListOfElementsID &theGroupsOfElementsID)
NCollection_Sequence< SMDS_MeshElementPtr > SMESH_SequenceOfElemPtr
bool QuadToTri(TIDSortedElemSet &theElems, const bool the13Diag)
Split quadrangles into triangles.