28#ifndef SMESH_MeshEditor_HeaderFile
29#define SMESH_MeshEditor_HeaderFile
40#include <TColStd_HSequenceOfReal.hxx>
84 void ClearLastCreated();
95 std::vector<const SMDS_MeshNode*>
myNodes;
98 :myType( type ), myIsPoly(isPoly), myIsQuad(isQuad), myID(-1), myBallDiameter(0) {}
101 { myType = type; myIsPoly = isPoly; myIsQuad = isQuad;
return *
this; }
106 { myType =
SMDSAbs_Ball; myBallDiameter = diameter;
return *
this; }
110 myPolyhedQuantities.swap( quanities );
return *
this; }
114 myPolyhedQuantities = quanities;
return *
this; }
124 SMDS_MeshElement* AddElement(
const std::vector<const SMDS_MeshNode*> & nodes,
125 const ElemFeatures& features);
130 const ElemFeatures& features);
134 void RemoveNodeWithReconnection(
const SMDS_MeshNode* node );
136 smIdType Remove (
const std::list< smIdType >& theElemIDs,
const bool isNodes);
142 const bool duplicateElements);
182 const gp_Vec& theDirection,
184 bool theAllowNonManifold);
190 const bool theOutsideNormal);
204 const double theMaxAngle);
220 const bool the13Diag);
237 typedef std::map < const SMDS_MeshElement*, int, TIDCompare >
TFacetOfElem;
253 void SplitVolumes (
const TFacetOfElem & theElems,
254 const int theMethodFlags,
255 const bool avoidOverConstrainedVolumes =
false );
265 const gp_Ax1& theFacetNormal,
266 TFacetOfElem & theFacets);
288 std::set<const SMDS_MeshNode*> & theFixedNodes,
289 const SmoothMethod theSmoothMethod,
290 const int theNbIterations,
291 double theTgtAspectRatio = 1.0,
292 const bool the2D =
true);
312 const gp_Ax1& theAxis,
313 const double theAngle,
314 const int theNbSteps,
315 const double theToler,
316 const bool theMakeGroups,
317 const bool theMakeWalls=
true);
336 EXTRUSION_FLAG_GROUPS = 0x04,
337 EXTRUSION_FLAG_BY_AVG_NORMAL = 0x08,
338 EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY = 0x10,
339 EXTRUSION_FLAG_SCALE_LINEAR_VARIATION = 0x20,
340 EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION = 0x40
355 PathPoint(): myPnt(99., 99., 99.), myTgt(1.,0.,0.), myAngle(0), myScale(0) {}
359 const int theNbSteps,
360 const std::list<double>& theScales,
361 const std::list<double>& theAngles,
362 const gp_XYZ* theBaseP,
363 const int theFlags = 0,
364 const double theTolerance = 1e-6);
366 Handle(TColStd_HSequenceOfReal) theSteps,
367 const int theFlags = 0,
368 const double theTolerance = 1e-6);
370 const int theNbSteps,
373 ExtrusParam(
const std::vector< PathPoint >& thePoints,
374 const gp_Pnt* theBaseP,
375 const std::list<double>& theScales,
376 const bool theMakeGroups);
386 return mySteps.IsNull() ? (int)myPathPoints.size() - 1: mySteps->Length();
396 std::list<const SMDS_MeshNode*> & newNodes,
397 const bool makeMediumNodes)
399 return (this->*myMakeNodesFun)( mesh, srcNode, newNodes, makeMediumNodes );
415 std::list<const SMDS_MeshNode*> &,
419 std::list<const SMDS_MeshNode*> & newNodes,
420 const bool makeMediumNodes);
423 std::list<const SMDS_MeshNode*> & newNodes,
424 const bool makeMediumNodes);
427 std::list<const SMDS_MeshNode*> & newNodes,
428 const bool makeMediumNodes);
431 std::list<const SMDS_MeshNode*> & newNodes,
432 const bool makeMediumNodes);
435 std::list<const SMDS_MeshNode*> & newNodes,
436 const bool makeMediumNodes);
438 void beginStepIter(
bool withMediumNodes );
459 const gp_Vec& theStep,
460 const int theNbSteps,
463 const double theTolerance = 1.e-6);
490 EXTR_CANT_GET_TANGENT
497 std::list<double>& theAngles,
498 const bool theAngleVariation,
499 std::list<double>& theScales,
500 const bool theScaleVariation,
501 const gp_Pnt* theRefPoint,
502 const bool theMakeGroups);
507 const gp_Trsf& theTrsf,
509 const bool theMakeGroups,
514 const double theValue,
516 const bool theMakeGroups,
517 const bool theCopyElements,
518 const bool theFixSelfIntersection);
524 const double theTolerance,
526 bool theSeparateCornersAndMedium);
531 const bool theAvoidMakingHoles =
false);
545 void MergeEqualElements();
549 int SimplifyFace (
const std::vector<const SMDS_MeshNode *>& faceNodes,
550 std::vector<const SMDS_MeshNode *>& poly_nodes,
551 std::vector<int>& quantities)
const;
555 static bool CheckFreeBorderNodes(
const SMDS_MeshNode* theNode1,
560 static bool FindFreeBorder (
const SMDS_MeshNode* theFirstNode,
563 std::list< const SMDS_MeshNode* > & theNodes,
564 std::list< const SMDS_MeshElement* >& theFaces);
584 Sew_Error SewFreeBorder (
const SMDS_MeshNode* theBorderFirstNode,
590 const bool theSide2IsFreeBorder =
true,
591 const bool toCreatePolygons =
false,
592 const bool toCreatePolyedrs =
false);
629 std::list<const SMDS_MeshNode*>& theNodesToInsert,
630 const bool toCreatePoly =
false);
636 std::list<const SMDS_MeshNode*>& theNodesToInsert);
640 void ConvertToQuadratic(
const bool theForce3d,
const bool theToBiQuad);
641 void ConvertToQuadratic(
const bool theForce3d,
650 bool ConvertFromQuadratic();
671 const std::vector<const SMDS_MeshElement*>& elemToAdd,
693 static Sew_Error FindMatchingNodes(std::set<const SMDS_MeshElement*>& theSide1,
694 std::set<const SMDS_MeshElement*>& theSide2,
716 bool DoubleNodes(
const std::list< int >& theListOfNodes,
717 const std::list< int >& theListOfModifiedElems );
725 const TopoDS_Shape& theShape,
730 const TopoDS_Shape& theShape );
732 double OrientedAngle(
const gp_Pnt& p0,
const gp_Pnt& p1,
const gp_Pnt& g1,
const gp_Pnt& g2);
734 bool DoubleNodesOnGroupBoundaries(
const std::vector<TIDSortedElemSet>& theElems,
735 bool createJointElems,
736 bool onAllBoundaries);
738 bool CreateFlatElementsOnFacesGroups(
const std::vector<TIDSortedElemSet>& theElems );
740 void CreateHoleSkin(
double radius,
741 const TopoDS_Shape& theShape,
743 const char* groupName,
744 std::vector<double>& nodesCoords,
745 std::vector<std::vector<int> >& listOfListOfNodes);
752 bool Make2DMeshFrom3D();
760 bool toCopyElements =
false,
761 bool toCopyExistingBondary =
false,
762 bool toAddExistingBondary =
false,
763 bool aroundElements =
false,
764 bool toCreateAllElements=
false);
774 const bool theForce3d);
782 const int theShapeID);
793 const std::string& postfix,
795 const bool topPresent=
true);
805 const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
806 std::list<const SMDS_MeshElement*>& newElems,
807 const size_t nbSteps,
821 std::vector< ElemFeatures >& newElemDefs,
823 const bool avoidMakingHoles );
833 void makeWalls (TNodeOfNodeListMap & mapNewNodes,
834 TTElemOfElemListMap & newElemsMap,
835 TElemOfVecOfNnlmiMap & elemNewNodesMap,
840 static void linearAngleVariation(
const int NbSteps,
841 std::list<double>& theAngles);
842 static void linearScaleVariation(
const int NbSteps,
843 std::list<double>& theScales);
849 const bool theIsDoubleElem );
SMDSAbs_ElementType
Type (node, edge, face or volume) of elements.
Definition: SMDSAbs_ElementType.hxx:34
@ SMDSAbs_All
Definition: SMDSAbs_ElementType.hxx:35
@ SMDSAbs_Volume
Definition: SMDSAbs_ElementType.hxx:39
@ SMDSAbs_Ball
Definition: SMDSAbs_ElementType.hxx:41
boost::shared_ptr< SMDS_Iterator< const SMDS_MeshElement * > > SMDS_ElemIteratorPtr
Definition: SMDS_ElemIterator.hxx:43
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
Definition: SMESH_ComputeError.hxx:38
std::set< const SMDS_MeshNode *, TIDCompare > TIDSortedNodeSet
Definition: SMESH_OctreeNode.hxx:51
#define SMESH_EXPORT
Definition: SMESH_SMESH.hxx:37
NCollection_Sequence< SMDS_MeshNodePtr > SMESH_SequenceOfNode
Definition: SMESH_TypeDefs.hxx:305
std::map< const SMDS_MeshNode *, const SMDS_MeshNode *, TIDCompare > TNodeNodeMap
Set of elements sorted by ID, to be used to assure predictability of edition.
Definition: SMESH_TypeDefs.hxx:55
std::set< const SMDS_MeshElement *, TIDCompare > TIDSortedElemSet
Definition: SMESH_TypeDefs.hxx:58
std::vector< const SMDS_MeshElement * > SMESH_SequenceOfElemPtr
Definition: SMESH_TypeDefs.hxx:299
Base class for elements.
Definition: SMDS_MeshElement.hxx:56
Mesh face.
Definition: SMDS_MeshFace.hxx:41
Definition: SMDS_MeshNode.hxx:36
Definition: SMESHDS_Group.hxx:40
Definition: SMESHDS_Mesh.hxx:98
Definition: SMESHDS_SubMesh.hxx:48
Definition: SMESH_Group.hxx:43
Generator of nodes for extrusion functionality.
Definition: SMESH_MeshEditor.hxx:347
bool ToMakeBoundary() const
Definition: SMESH_MeshEditor.hxx:380
const TIDSortedElemSet * myElemsToUse
Definition: SMESH_MeshEditor.hxx:411
SMESH_SequenceOfNode & ChangeNodes()
Definition: SMESH_MeshEditor.hxx:378
int MakeNodes(SMESHDS_Mesh *mesh, const SMDS_MeshNode *srcNode, std::list< const SMDS_MeshNode * > &newNodes, const bool makeMediumNodes)
Definition: SMESH_MeshEditor.hxx:394
bool ToUseInpElemsOnly() const
Definition: SMESH_MeshEditor.hxx:382
bool myWithMediumNodes
Definition: SMESH_MeshEditor.hxx:442
std::vector< double > myScales
Definition: SMESH_MeshEditor.hxx:405
bool IsScaleVariation() const
Definition: SMESH_MeshEditor.hxx:383
gp_Dir myDir
Definition: SMESH_MeshEditor.hxx:403
int NbSteps() const
Definition: SMESH_MeshEditor.hxx:385
gp_XYZ myBaseP
Definition: SMESH_MeshEditor.hxx:407
bool ToMakeGroups() const
Definition: SMESH_MeshEditor.hxx:381
SMESH_SequenceOfNode myNodes
Definition: SMESH_MeshEditor.hxx:408
std::vector< double > myCurSteps
Definition: SMESH_MeshEditor.hxx:441
std::vector< PathPoint > myPathPoints
Definition: SMESH_MeshEditor.hxx:412
int & Flags()
Definition: SMESH_MeshEditor.hxx:379
std::vector< double > myAngles
Definition: SMESH_MeshEditor.hxx:406
int myNextStep
Definition: SMESH_MeshEditor.hxx:443
bool IsAngleVariation() const
Definition: SMESH_MeshEditor.hxx:384
int myFlags
Definition: SMESH_MeshEditor.hxx:409
double myTolerance
Definition: SMESH_MeshEditor.hxx:410
Handle(TColStd_HSequenceOfReal) mySteps
Editor of a mesh.
Definition: SMESH_MeshEditor.hxx:74
std::unique_ptr< std::list< int > > PGroupIDs
Definition: SMESH_MeshEditor.hxx:309
Extrusion_Error
Definition: SMESH_MeshEditor.hxx:483
@ EXTR_NO_ELEMENTS
Definition: SMESH_MeshEditor.hxx:485
@ EXTR_BAD_STARTING_NODE
Definition: SMESH_MeshEditor.hxx:488
@ EXTR_PATH_NOT_EDGE
Definition: SMESH_MeshEditor.hxx:486
@ EXTR_OK
Definition: SMESH_MeshEditor.hxx:484
@ EXTR_BAD_PATH_SHAPE
Definition: SMESH_MeshEditor.hxx:487
@ EXTR_BAD_ANGLES_NUMBER
Definition: SMESH_MeshEditor.hxx:489
SMESH_ComputeErrorPtr myError
Definition: SMESH_MeshEditor.hxx:862
SMESH_Mesh * GetMesh()
Definition: SMESH_MeshEditor.hxx:79
std::map< const SMDS_MeshElement *, TVecOfNnlmiMap, TElemSort > TElemOfVecOfNnlmiMap
Definition: SMESH_MeshEditor.hxx:308
Bnd_Dimension
Definition: SMESH_MeshEditor.hxx:754
TIDTypeCompare TElemSort
Definition: SMESH_MeshEditor.hxx:302
ExtrusionFlags
Flags of extrusion.
Definition: SMESH_MeshEditor.hxx:333
std::list< std::list< smIdType > > TListOfListOfElementsID
Definition: SMESH_MeshEditor.hxx:535
std::list< std::list< const SMDS_MeshNode * > > TListOfListOfNodes
Definition: SMESH_MeshEditor.hxx:521
SplitVolumToTetraFlags
Definition: SMESH_MeshEditor.hxx:240
@ HEXA_TO_6
Definition: SMESH_MeshEditor.hxx:241
@ HEXA_TO_2_PRISMS
Definition: SMESH_MeshEditor.hxx:243
@ HEXA_TO_24
Definition: SMESH_MeshEditor.hxx:242
SMESH_Mesh * myMesh
Definition: SMESH_MeshEditor.hxx:856
SMESH_SequenceOfElemPtr myLastCreatedElems
Definition: SMESH_MeshEditor.hxx:859
SMESH_ComputeErrorPtr & GetError()
Definition: SMESH_MeshEditor.hxx:85
std::map< const SMDS_MeshNode *, std::list< const SMDS_MeshNode * > > TNodeOfNodeListMap
Definition: SMESH_MeshEditor.hxx:305
std::map< const SMDS_MeshElement *, std::list< const SMDS_MeshElement * >, TElemSort > TTElemOfElemListMap
Definition: SMESH_MeshEditor.hxx:304
const SMESH_SequenceOfElemPtr & GetLastCreatedNodes() const
Definition: SMESH_MeshEditor.hxx:82
TNodeOfNodeListMap::iterator TNodeOfNodeListMapItr
Definition: SMESH_MeshEditor.hxx:306
std::map< const SMDS_MeshElement *, int, TIDCompare > TFacetOfElem
2nd arg of SplitVolumes()
Definition: SMESH_MeshEditor.hxx:237
bool isVariantOverConstrained(SMDS_VolumeTool &vol, const int *connVariants)
Return true if one of the tetras included in the variant will be an overconstrained tetra.
std::vector< TNodeOfNodeListMapItr > TVecOfNnlmiMap
Definition: SMESH_MeshEditor.hxx:307
Sew_Error
Definition: SMESH_MeshEditor.hxx:567
@ SEW_DIFF_NB_OF_ELEMENTS
Definition: SMESH_MeshEditor.hxx:576
@ SEW_BAD_SIDE1_NODES
Definition: SMESH_MeshEditor.hxx:578
@ SEW_TOPO_DIFF_SETS_OF_ELEMENTS
Definition: SMESH_MeshEditor.hxx:577
@ SEW_VOLUMES_TO_SPLIT
Definition: SMESH_MeshEditor.hxx:574
@ SEW_OK
Definition: SMESH_MeshEditor.hxx:568
@ SEW_BOTH_BORDERS_NOT_FOUND
Definition: SMESH_MeshEditor.hxx:572
@ SEW_BORDER2_NOT_FOUND
Definition: SMESH_MeshEditor.hxx:571
@ SEW_BAD_SIDE_NODES
Definition: SMESH_MeshEditor.hxx:573
@ SEW_BAD_SIDE2_NODES
Definition: SMESH_MeshEditor.hxx:579
@ SEW_BORDER1_NOT_FOUND
Definition: SMESH_MeshEditor.hxx:570
SmoothMethod
Definition: SMESH_MeshEditor.hxx:285
const SMESH_SequenceOfElemPtr & GetLastCreatedElems() const
Definition: SMESH_MeshEditor.hxx:83
Definition: SMESH_Mesh.hxx:80
It helps meshers to add elements and provides other utilities.
Definition: SMESH_MesherHelper.hxx:84
Definition: SMESH_subMesh.hxx:61
static SMESH_NodeSearcher * theNodeSearcher
Definition: SMESH_MeshEditor_i.cxx:176
boost::shared_ptr< NumericalFunctor > NumericalFunctorPtr
Definition: SMESH_Controls.hxx:64
Bnd_Dimension
Definition: SMESH_MeshEditor.idl:35
@ BND_1DFROM2D
Definition: SMESH_MeshEditor.idl:35
@ BND_1DFROM3D
Definition: SMESH_MeshEditor.idl:35
@ BND_2DFROM3D
Definition: SMESH_MeshEditor.idl:35
const long EXTRUSION_FLAG_BOUNDARY
Auxiliary flags for advanced extrusion.
Definition: SMESH_Mesh.idl:264
const long EXTRUSION_FLAG_SEW
Definition: SMESH_Mesh.idl:265
Searcher for elements.
Definition: SMESH_MeshAlgos.hxx:75
< Features of element to create
Definition: SMESH_MeshEditor.hxx:89
bool myIsPoly
Definition: SMESH_MeshEditor.hxx:91
ElemFeatures & Init(double diameter)
Definition: SMESH_MeshEditor.hxx:105
ElemFeatures & SetID(smIdType ID)
Definition: SMESH_MeshEditor.hxx:118
std::vector< const SMDS_MeshNode * > myNodes
Definition: SMESH_MeshEditor.hxx:95
ElemFeatures & SetQuad(bool isQuad)
Definition: SMESH_MeshEditor.hxx:117
ElemFeatures & SetPoly(bool isPoly)
Definition: SMESH_MeshEditor.hxx:116
std::vector< int > myPolyhedQuantities
Definition: SMESH_MeshEditor.hxx:94
ElemFeatures & Init(const std::vector< int > &quanities, bool isQuad=false)
Definition: SMESH_MeshEditor.hxx:112
ElemFeatures & Init(SMDSAbs_ElementType type, bool isPoly=false, bool isQuad=false)
Definition: SMESH_MeshEditor.hxx:100
SMDSAbs_ElementType myType
Definition: SMESH_MeshEditor.hxx:90
ElemFeatures(SMDSAbs_ElementType type=SMDSAbs_All, bool isPoly=false, bool isQuad=false)
Definition: SMESH_MeshEditor.hxx:97
ElemFeatures & Init(std::vector< int > &quanities, bool isQuad=false)
Definition: SMESH_MeshEditor.hxx:108
double myBallDiameter
Definition: SMESH_MeshEditor.hxx:93
smIdType myID
Definition: SMESH_MeshEditor.hxx:92
Point on extrusion path.
Definition: SMESH_MeshEditor.hxx:351
gp_Pnt myPnt
Definition: SMESH_MeshEditor.hxx:352
gp_Dir myTgt
Definition: SMESH_MeshEditor.hxx:353
PathPoint()
Definition: SMESH_MeshEditor.hxx:355
double myAngle
Definition: SMESH_MeshEditor.hxx:354
Searcher for the node closest to a point.
Definition: SMESH_MeshAlgos.hxx:59
Comparator of elements by ID for usage in std containers.
Definition: SMDS_MeshElement.hxx:202