28 #ifndef SMESH_MeshEditor_HeaderFile
29 #define SMESH_MeshEditor_HeaderFile
37 #include <utilities.h>
39 #include <TColStd_HSequenceOfReal.hxx>
80 void ClearLastCreated();
91 std::vector<const SMDS_MeshNode*>
myNodes;
94 :myType( type ), myIsPoly(isPoly), myIsQuad(isQuad), myID(-1), myBallDiameter(0) {}
97 { myType = type; myIsPoly = isPoly; myIsQuad = isQuad;
return *
this; }
102 { myType =
SMDSAbs_Ball; myBallDiameter = diameter;
return *
this; }
106 myPolyhedQuantities.swap( quanities );
return *
this; }
110 myPolyhedQuantities = quanities;
return *
this; }
120 SMDS_MeshElement* AddElement(
const std::vector<const SMDS_MeshNode*> & nodes,
121 const ElemFeatures& features);
126 const ElemFeatures& features);
128 int Remove (
const std::list< int >& theElemIDs,
const bool isNodes);
134 const bool duplicateElements);
160 const gp_Dir& theDirection,
167 const bool theOutsideNormal);
181 const double theMaxAngle);
197 const bool the13Diag);
214 typedef std::map < const SMDS_MeshElement*, int, TIDCompare > TFacetOfElem;
228 void SplitVolumes (
const TFacetOfElem & theElems,
const int theMethodFlags);
238 const gp_Ax1& theFacetNormal,
239 TFacetOfElem & theFacets);
255 std::set<const SMDS_MeshNode*> & theFixedNodes,
256 const SmoothMethod theSmoothMethod,
257 const int theNbIterations,
258 double theTgtAspectRatio = 1.0,
259 const bool the2D =
true);
279 const gp_Ax1& theAxis,
280 const double theAngle,
281 const int theNbSteps,
282 const double theToler,
283 const bool theMakeGroups,
284 const bool theMakeWalls=
true);
302 EXTRUSION_FLAG_GROUPS = 0x04,
303 EXTRUSION_FLAG_BY_AVG_NORMAL = 0x08,
304 EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY = 0x10,
305 EXTRUSION_FLAG_SCALE_LINEAR_VARIATION = 0x20
314 Handle(TColStd_HSequenceOfReal) mySteps;
315 std::vector<
double> myScales, myMediumScales;
317 SMESH_SequenceOfNode myNodes;
325 const
bool makeMediumNodes);
329 const
int theNbSteps,
330 const std::list<
double>& theScales,
331 const gp_XYZ* theBaseP,
332 const
int theFlags = 0,
333 const
double theTolerance = 1e-6);
335 Handle(TColStd_HSequenceOfReal) theSteps,
336 const
int theFlags = 0,
337 const
double theTolerance = 1e-6);
339 const
int theNbSteps,
343 SMESH_SequenceOfNode& ChangeNodes() {
return myNodes; }
349 int NbSteps()
const {
return mySteps->Length(); }
359 std::list<const SMDS_MeshNode*> & newNodes,
360 const bool makeMediumNodes)
362 return (this->*myMakeNodesFun)( mesh, srcNode, newNodes, makeMediumNodes );
368 std::list<const SMDS_MeshNode*> & newNodes,
369 const bool makeMediumNodes);
372 std::list<const SMDS_MeshNode*> & newNodes,
373 const bool makeMediumNodes);
376 std::list<const SMDS_MeshNode*> & newNodes,
377 const bool makeMediumNodes);
380 std::list<const SMDS_MeshNode*> & newNodes,
381 const bool makeMediumNodes);
383 void beginStepIter(
bool withMediumNodes );
404 const gp_Vec& theStep,
405 const int theNbSteps,
408 const double theTolerance = 1.e-6);
435 EXTR_CANT_GET_TANGENT
441 const bool theHasAngles,
442 std::list<double>& theAngles,
443 const bool theLinearVariation,
444 const bool theHasRefPoint,
445 const gp_Pnt& theRefPoint,
446 const bool theMakeGroups);
450 const bool theHasAngles,
451 std::list<double>& theAngles,
452 const bool theLinearVariation,
453 const bool theHasRefPoint,
454 const gp_Pnt& theRefPoint,
455 const bool theMakeGroups);
460 const gp_Trsf& theTrsf,
462 const bool theMakeGroups,
469 const double theTolerance,
471 bool theSeparateCornersAndMedium);
476 const bool theAvoidMakingHoles =
false);
490 void MergeEqualElements();
494 int SimplifyFace (
const std::vector<const SMDS_MeshNode *>& faceNodes,
495 std::vector<const SMDS_MeshNode *>& poly_nodes,
496 std::vector<int>& quantities)
const;
500 static bool CheckFreeBorderNodes(
const SMDS_MeshNode* theNode1,
505 static bool FindFreeBorder (
const SMDS_MeshNode* theFirstNode,
508 std::list< const SMDS_MeshNode* > & theNodes,
509 std::list< const SMDS_MeshElement* >& theFaces);
529 Sew_Error SewFreeBorder (
const SMDS_MeshNode* theBorderFirstNode,
535 const bool theSide2IsFreeBorder =
true,
536 const bool toCreatePolygons =
false,
537 const bool toCreatePolyedrs =
false);
574 std::list<const SMDS_MeshNode*>& theNodesToInsert,
575 const bool toCreatePoly =
false);
581 std::list<const SMDS_MeshNode*>& theNodesToInsert);
585 void ConvertToQuadratic(
const bool theForce3d,
const bool theToBiQuad);
586 void ConvertToQuadratic(
const bool theForce3d,
595 bool ConvertFromQuadratic();
616 const std::vector<const SMDS_MeshElement*>& elemToAdd,
638 static Sew_Error FindMatchingNodes(std::set<const SMDS_MeshElement*>& theSide1,
639 std::set<const SMDS_MeshElement*>& theSide2,
661 bool DoubleNodes(
const std::list< int >& theListOfNodes,
662 const std::list< int >& theListOfModifiedElems );
670 const TopoDS_Shape& theShape,
675 const TopoDS_Shape& theShape );
677 double OrientedAngle(
const gp_Pnt& p0,
const gp_Pnt& p1,
const gp_Pnt& g1,
const gp_Pnt& g2);
679 bool DoubleNodesOnGroupBoundaries(
const std::vector<TIDSortedElemSet>& theElems,
680 bool createJointElems,
681 bool onAllBoundaries);
683 bool CreateFlatElementsOnFacesGroups(
const std::vector<TIDSortedElemSet>& theElems );
685 void CreateHoleSkin(
double radius,
686 const TopoDS_Shape& theShape,
688 const char* groupName,
689 std::vector<double>& nodesCoords,
690 std::vector<std::vector<int> >& listOfListOfNodes);
697 bool Make2DMeshFrom3D();
705 bool toCopyElements =
false,
706 bool toCopyExistingBondary =
false,
707 bool toAddExistingBondary =
false,
708 bool aroundElements =
false);
718 const bool theForce3d);
726 const int theShapeID);
735 PGroupIDs generateGroups(
const SMESH_SequenceOfElemPtr& nodeGens,
736 const SMESH_SequenceOfElemPtr& elemGens,
737 const std::string& postfix,
739 const bool topPresent=
true);
749 const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
750 std::list<const SMDS_MeshElement*>& newElems,
751 const size_t nbSteps,
752 SMESH_SequenceOfElemPtr& srcElements);
765 std::vector< ElemFeatures >& newElemDefs,
767 const bool avoidMakingHoles );
777 void makeWalls (TNodeOfNodeListMap & mapNewNodes,
778 TTElemOfElemListMap & newElemsMap,
779 TElemOfVecOfNnlmiMap & elemNewNodesMap,
782 SMESH_SequenceOfElemPtr& srcElements);
791 void SetPnt (
const gp_Pnt& aP3D) { myPnt =aP3D; }
793 void SetAngle (
const double& aBeta) { myAngle=aBeta; }
795 const gp_Pnt&
Pnt ()
const {
return myPnt; }
796 const gp_Dir&
Tangent ()
const {
return myTgt; }
797 double Angle ()
const {
return myAngle; }
800 Extrusion_Error makeEdgePathPoints(std::list<double>& aPrms,
801 const TopoDS_Edge& aTrackEdge,
803 std::list<SMESH_MeshEditor_PathPoint>& aLPP);
805 std::list<SMESH_MeshEditor_PathPoint>& theFullList,
806 const bool theHasAngles,
807 std::list<double>& theAngles,
808 const bool theLinearVariation,
809 const bool theHasRefPoint,
810 const gp_Pnt& theRefPoint,
811 const bool theMakeGroups);
812 static void linearAngleVariation(
const int NbSteps,
813 std::list<double>& theAngles);
819 const bool theIsDoubleElem );