X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_MeshEditor.hxx;h=cbe9466de8dc270d638effa1f9effb47cfc295da;hp=23f3977aa05c55652e18cbe99ee7793113accfeb;hb=23d90107acec5e54ded86d9f309fe5cb42720b78;hpb=bb40f7c1d3542da1ff59b6c3bface0574789dded diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 23f3977aa..cbe9466de 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -73,21 +73,49 @@ public: void ClearLastCreated(); SMESH_ComputeErrorPtr & GetError() { return myError; } + // -------------------------------------------------------------------------------- + struct ElemFeatures //!< Features of element to create + { + SMDSAbs_ElementType myType; + bool myIsPoly, myIsQuad; + int myID; + double myBallDiameter; + std::vector myPolyhedQuantities; + + ElemFeatures( SMDSAbs_ElementType type=SMDSAbs_All, bool isPoly=false, bool isQuad=false ) + :myType( type ), myIsPoly(isPoly), myIsQuad(isQuad), myID(-1), myBallDiameter(0) {} + + ElemFeatures& Init( SMDSAbs_ElementType type, bool isPoly=false, bool isQuad=false ) + { myType = type; myIsPoly = isPoly; myIsQuad = isQuad; return *this; } + + ElemFeatures& Init( const SMDS_MeshElement* elem, bool basicOnly=true ); + + ElemFeatures& Init( double diameter ) + { myType = SMDSAbs_Ball; myBallDiameter = diameter; return *this; } + + ElemFeatures& Init( vector& quanities, bool isQuad=false ) + { myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad; + myPolyhedQuantities.swap( quanities ); return *this; } + + ElemFeatures& Init( const vector& quanities, bool isQuad=false ) + { myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad; + myPolyhedQuantities = quanities; return *this; } + + ElemFeatures& SetPoly(bool isPoly) { myIsPoly = isPoly; return *this; } + ElemFeatures& SetQuad(bool isQuad) { myIsQuad = isQuad; return *this; } + ElemFeatures& SetID (int ID) { myID = ID; return *this; } + }; + /*! * \brief Add element */ SMDS_MeshElement* AddElement(const std::vector & nodes, - const SMDSAbs_ElementType type, - const bool isPoly, - const int ID = -1, - const double ballDiameter=0.); + const ElemFeatures& features); /*! * \brief Add element */ - SMDS_MeshElement* AddElement(const std::vector & nodeIDs, - const SMDSAbs_ElementType type, - const bool isPoly, - const int ID = -1); + SMDS_MeshElement* AddElement(const std::vector & nodeIDs, + const ElemFeatures& features); int Remove (const std::list< int >& theElemIDs, const bool isNodes); // Remove a node or an element. @@ -229,7 +257,7 @@ public: typedef std::map TElemOfVecOfNnlmiMap; typedef std::auto_ptr< std::list > PGroupIDs; - PGroupIDs RotationSweep (TIDSortedElemSet & theElements, + PGroupIDs RotationSweep (TIDSortedElemSet theElements[2], const gp_Ax1& theAxis, const double theAngle, const int theNbSteps, @@ -345,7 +373,7 @@ public: * @param theTolerance - uses for comparing locations of nodes if flag * EXTRUSION_FLAG_SEW is set */ - PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems, + PGroupIDs ExtrusionSweep (TIDSortedElemSet theElems[2], const gp_Vec& theStep, const int theNbSteps, TTElemOfElemListMap& newElemsMap, @@ -362,7 +390,7 @@ public: * EXTRUSION_FLAG_SEW is set * @param theParams - special structure for manage of extrusion */ - PGroupIDs ExtrusionSweep (TIDSortedElemSet & theElems, + PGroupIDs ExtrusionSweep (TIDSortedElemSet theElems[2], ExtrusParam& theParams, TTElemOfElemListMap& newElemsMap); @@ -380,7 +408,7 @@ public: EXTR_CANT_GET_TANGENT }; - Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements, + Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet theElements[2], SMESH_subMesh* theTrackPattern, const SMDS_MeshNode* theNodeStart, const bool theHasAngles, @@ -389,7 +417,7 @@ public: const bool theHasRefPoint, const gp_Pnt& theRefPoint, const bool theMakeGroups); - Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet & theElements, + Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet theElements[2], SMESH_Mesh* theTrackPattern, const SMDS_MeshNode* theNodeStart, const bool theHasAngles, @@ -730,7 +758,7 @@ public: const TopoDS_Edge& aTrackEdge, bool aFirstIsStart, std::list& aLPP); - Extrusion_Error MakeExtrElements(TIDSortedElemSet& theElements, + Extrusion_Error MakeExtrElements(TIDSortedElemSet theElements[2], std::list& theFullList, const bool theHasAngles, std::list& theAngles, @@ -741,11 +769,11 @@ public: void LinearAngleVariation(const int NbSteps, list& theAngles); - bool doubleNodes( SMESHDS_Mesh* theMeshDS, - const TIDSortedElemSet& theElems, - const TIDSortedElemSet& theNodesNot, - std::map< const SMDS_MeshNode*, const SMDS_MeshNode* >& theNodeNodeMap, - const bool theIsDoubleElem ); + bool doubleNodes( SMESHDS_Mesh* theMeshDS, + const TIDSortedElemSet& theElems, + const TIDSortedElemSet& theNodesNot, + TNodeNodeMap& theNodeNodeMap, + const bool theIsDoubleElem ); void copyPosition( const SMDS_MeshNode* from, const SMDS_MeshNode* to );