Back to index

salome-smesh  6.5.0
SMESH_MeshEditor.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
00024 // File      : SMESH_MeshEditor.hxx
00025 // Created   : Mon Apr 12 14:56:19 2004
00026 // Author    : Edward AGAPOV (eap)
00027 // Module    : SMESH
00028 //
00029 #ifndef SMESH_MeshEditor_HeaderFile
00030 #define SMESH_MeshEditor_HeaderFile
00031 
00032 #include "SMESH_SMESH.hxx"
00033 
00034 #include "SMDS_MeshElement.hxx"
00035 #include "SMESH_Controls.hxx"
00036 #include "SMESH_Mesh.hxx"
00037 #include "SMESH_TypeDefs.hxx"
00038 
00039 #include <utilities.h>
00040 
00041 #include <TColStd_HSequenceOfReal.hxx>
00042 #include <gp_Dir.hxx>
00043 
00044 #include <list>
00045 #include <map>
00046 #include <set>
00047 
00048 class SMDS_MeshFace;
00049 class SMDS_MeshNode;
00050 class gp_Ax1;
00051 class gp_Vec;
00052 class gp_Pnt;
00053 class SMESH_MesherHelper;
00054 
00055 
00056 //=======================================================================
00060 //=======================================================================
00061 struct SMESH_NodeSearcher
00062 {
00063   virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
00064   virtual void MoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt ) = 0;
00065 };
00066 
00067 //=======================================================================
00075 //=======================================================================
00076 
00077 struct SMESH_ElementSearcher
00078 {
00079   virtual int FindElementsByPoint(const gp_Pnt&                           point,
00080                                   SMDSAbs_ElementType                     type,
00081                                   std::vector< const SMDS_MeshElement* >& foundElems)=0;
00082 
00083   virtual TopAbs_State GetPointState(const gp_Pnt& point) = 0;
00084 
00088   virtual void GetElementsNearLine( const gp_Ax1&                           line,
00089                                     SMDSAbs_ElementType                     type,
00090                                     std::vector< const SMDS_MeshElement* >& foundElems)=0;
00091 };
00092 
00093 // ============================================================
00097 // ============================================================
00098 
00099 class SMESH_EXPORT SMESH_MeshEditor
00100 {
00101 public:
00102 
00103   SMESH_MeshEditor( SMESH_Mesh* theMesh );
00104 
00108   SMDS_MeshElement* AddElement(const std::vector<const SMDS_MeshNode*> & nodes,
00109                                const SMDSAbs_ElementType                 type,
00110                                const bool                                isPoly,
00111                                const int                                 ID = -1);
00115   SMDS_MeshElement* AddElement(const std::vector<int>  & nodeIDs,
00116                                const SMDSAbs_ElementType type,
00117                                const bool                isPoly,
00118                                const int                 ID = -1);
00119 
00120   int Remove (const std::list< int >& theElemIDs, const bool isNodes);
00121   // Remove a node or an element.
00122   // Modify a compute state of sub-meshes which become empty
00123 
00124   bool InverseDiag (const SMDS_MeshElement * theTria1,
00125                     const SMDS_MeshElement * theTria2 );
00126   // Replace two neighbour triangles with ones built on the same 4 nodes
00127   // but having other common link.
00128   // Return False if args are improper
00129 
00130   bool InverseDiag (const SMDS_MeshNode * theNode1,
00131                     const SMDS_MeshNode * theNode2 );
00132   // Replace two neighbour triangles sharing theNode1-theNode2 link
00133   // with ones built on the same 4 nodes but having other common link.
00134   // Return false if proper faces not found
00135 
00136   bool DeleteDiag (const SMDS_MeshNode * theNode1,
00137                    const SMDS_MeshNode * theNode2 );
00138   // Replace two neighbour triangles sharing theNode1-theNode2 link
00139   // with a quadrangle built on the same 4 nodes.
00140   // Return false if proper faces not found
00141 
00142   bool Reorient (const SMDS_MeshElement * theElement);
00143   // Reverse theElement orientation
00144 
00145 
00154   bool TriToQuad (TIDSortedElemSet &                   theElems,
00155                   SMESH::Controls::NumericalFunctorPtr theCriterion,
00156                   const double                         theMaxAngle);
00157 
00164   bool QuadToTri (TIDSortedElemSet &                   theElems,
00165                   SMESH::Controls::NumericalFunctorPtr theCriterion);
00166 
00173   bool QuadToTri (TIDSortedElemSet & theElems,
00174                   const bool         the13Diag);
00175 
00182   int BestSplit (const SMDS_MeshElement*              theQuad,
00183                  SMESH::Controls::NumericalFunctorPtr theCriterion);
00184 
00185 
00186   enum SplitVolumToTetraFlags { HEXA_TO_5 = 1, HEXA_TO_6 = 2, HEXA_TO_24 = 3 };
00187 
00190   void SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, const int theMethodFlags);
00191 
00192 
00193   enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
00194 
00195   void Smooth (TIDSortedElemSet &               theElements,
00196                std::set<const SMDS_MeshNode*> & theFixedNodes,
00197                const SmoothMethod               theSmoothMethod,
00198                const int                        theNbIterations,
00199                double                           theTgtAspectRatio = 1.0,
00200                const bool                       the2D = true);
00201   // Smooth theElements using theSmoothMethod during theNbIterations
00202   // or until a worst element has aspect ratio <= theTgtAspectRatio.
00203   // Aspect Ratio varies in range [1.0, inf].
00204   // If theElements is empty, the whole mesh is smoothed.
00205   // theFixedNodes contains additionally fixed nodes. Nodes built
00206   // on edges and boundary nodes are always fixed.
00207   // If the2D, smoothing is performed using UV parameters of nodes
00208   // on geometrical faces
00209 
00210   typedef std::auto_ptr< std::list<int> > PGroupIDs;
00211 
00212   PGroupIDs RotationSweep (TIDSortedElemSet & theElements,
00213                            const gp_Ax1&      theAxis,
00214                            const double       theAngle,
00215                            const int          theNbSteps,
00216                            const double       theToler,
00217                            const bool         theMakeGroups,
00218                            const bool         theMakeWalls=true);
00219   // Generate new elements by rotation of theElements around theAxis
00220   // by theAngle by theNbSteps
00221 
00227   enum ExtrusionFlags {
00228     EXTRUSION_FLAG_BOUNDARY = 0x01,
00229     EXTRUSION_FLAG_SEW = 0x02
00230   };
00231   
00235   struct ExtrusParam {
00236     gp_Dir myDir; // direction of extrusion
00237     Handle(TColStd_HSequenceOfReal) mySteps; // magnitudes for each step
00238     SMESH_SequenceOfNode myNodes; // nodes for using in sewing
00239   };
00240 
00245   const SMDS_MeshNode* CreateNode(const double x,
00246                                   const double y,
00247                                   const double z,
00248                                   const double tolnode,
00249                                   SMESH_SequenceOfNode& aNodes);
00250 
00263   PGroupIDs ExtrusionSweep (TIDSortedElemSet &  theElems,
00264                             const gp_Vec&       theStep,
00265                             const int           theNbSteps,
00266                             TElemOfElemListMap& newElemsMap,
00267                             const bool          theMakeGroups,
00268                             const int           theFlags = EXTRUSION_FLAG_BOUNDARY,
00269                             const double        theTolerance = 1.e-6);
00270   
00281   PGroupIDs ExtrusionSweep (TIDSortedElemSet &  theElems,
00282                             ExtrusParam&        theParams,
00283                             TElemOfElemListMap& newElemsMap,
00284                             const bool          theMakeGroups,
00285                             const int           theFlags,
00286                             const double        theTolerance);
00287 
00288 
00289   // Generate new elements by extrusion of theElements 
00290   // by theStep by theNbSteps
00291 
00292   enum Extrusion_Error {
00293     EXTR_OK,
00294     EXTR_NO_ELEMENTS, 
00295     EXTR_PATH_NOT_EDGE,
00296     EXTR_BAD_PATH_SHAPE,
00297     EXTR_BAD_STARTING_NODE,
00298     EXTR_BAD_ANGLES_NUMBER,
00299     EXTR_CANT_GET_TANGENT
00300     };
00301   
00302   Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet &   theElements,
00303                                        SMESH_subMesh*       theTrackPattern,
00304                                        const SMDS_MeshNode* theNodeStart,
00305                                        const bool           theHasAngles,
00306                                        std::list<double>&   theAngles,
00307                                        const bool           theLinearVariation,
00308                                        const bool           theHasRefPoint,
00309                                        const gp_Pnt&        theRefPoint,
00310                                        const bool           theMakeGroups);
00311   Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet &   theElements,
00312                                        SMESH_Mesh*          theTrackPattern,
00313                                        const SMDS_MeshNode* theNodeStart,
00314                                        const bool           theHasAngles,
00315                                        std::list<double>&   theAngles,
00316                                        const bool           theLinearVariation,
00317                                        const bool           theHasRefPoint,
00318                                        const gp_Pnt&        theRefPoint,
00319                                        const bool           theMakeGroups);
00320   // Generate new elements by extrusion of theElements along path given by theTrackPattern,
00321   // theHasAngles are the rotation angles, base point can be given by theRefPoint
00322 
00323   PGroupIDs Transform (TIDSortedElemSet & theElements,
00324                        const gp_Trsf&     theTrsf,
00325                        const bool         theCopy,
00326                        const bool         theMakeGroups,
00327                        SMESH_Mesh*        theTargetMesh=0);
00328   // Move or copy theElements applying theTrsf to their nodes
00329 
00330 
00331   typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
00332 
00333   void FindCoincidentNodes (TIDSortedNodeSet &   theNodes,
00334                             const double         theTolerance,
00335                             TListOfListOfNodes & theGroupsOfNodes);
00336   // Return list of group of nodes close to each other within theTolerance.
00337   // Search among theNodes or in the whole mesh if theNodes is empty.
00338 
00342   SMESH_NodeSearcher* GetNodeSearcher();
00343 
00347   SMESH_ElementSearcher* GetElementSearcher();
00348   SMESH_ElementSearcher* GetElementSearcher( SMDS_ElemIteratorPtr elemIt );
00352   static bool isOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
00353 
00354 
00355   int SimplifyFace (const std::vector<const SMDS_MeshNode *> faceNodes,
00356                     std::vector<const SMDS_MeshNode *>&      poly_nodes,
00357                     std::vector<int>&                        quantities) const;
00358   // Split face, defined by <faceNodes>, into several faces by repeating nodes.
00359   // Is used by MergeNodes()
00360 
00361   void MergeNodes (TListOfListOfNodes & theNodeGroups);
00362   // In each group, the cdr of nodes are substituted by the first one
00363   // in all elements.
00364 
00365   typedef std::list< std::list< int > > TListOfListOfElementsID;
00366 
00367   void FindEqualElements(std::set<const SMDS_MeshElement*> & theElements,
00368                          TListOfListOfElementsID &           theGroupsOfElementsID);
00369   // Return list of group of elements build on the same nodes.
00370   // Search among theElements or in the whole mesh if theElements is empty.
00371 
00372   void MergeElements(TListOfListOfElementsID & theGroupsOfElementsID);
00373   // In each group remove all but first of elements.
00374 
00375   void MergeEqualElements();
00376   // Remove all but one of elements built on the same nodes.
00377   // Return nb of successfully merged groups.
00378 
00379   static bool CheckFreeBorderNodes(const SMDS_MeshNode* theNode1,
00380                                    const SMDS_MeshNode* theNode2,
00381                                    const SMDS_MeshNode* theNode3 = 0);
00382   // Return true if the three nodes are on a free border
00383 
00384   static bool FindFreeBorder (const SMDS_MeshNode*                  theFirstNode,
00385                               const SMDS_MeshNode*                  theSecondNode,
00386                               const SMDS_MeshNode*                  theLastNode,
00387                               std::list< const SMDS_MeshNode* > &   theNodes,
00388                               std::list< const SMDS_MeshElement* >& theFaces);
00389   // Return nodes and faces of a free border if found 
00390 
00391   enum Sew_Error {
00392     SEW_OK,
00393     // for SewFreeBorder()
00394     SEW_BORDER1_NOT_FOUND,
00395     SEW_BORDER2_NOT_FOUND,
00396     SEW_BOTH_BORDERS_NOT_FOUND,
00397     SEW_BAD_SIDE_NODES,
00398     SEW_VOLUMES_TO_SPLIT,
00399     // for SewSideElements()
00400     SEW_DIFF_NB_OF_ELEMENTS,
00401     SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
00402     SEW_BAD_SIDE1_NODES,
00403     SEW_BAD_SIDE2_NODES,
00404     SEW_INTERNAL_ERROR
00405     };
00406     
00407 
00408   Sew_Error SewFreeBorder (const SMDS_MeshNode* theBorderFirstNode,
00409                            const SMDS_MeshNode* theBorderSecondNode,
00410                            const SMDS_MeshNode* theBorderLastNode,
00411                            const SMDS_MeshNode* theSide2FirstNode,
00412                            const SMDS_MeshNode* theSide2SecondNode,
00413                            const SMDS_MeshNode* theSide2ThirdNode = 0,
00414                            const bool           theSide2IsFreeBorder = true,
00415                            const bool           toCreatePolygons = false,
00416                            const bool           toCreatePolyedrs = false);
00417   // Sew the free border to the side2 by replacing nodes in
00418   // elements on the free border with nodes of the elements
00419   // of the side 2. If nb of links in the free border and
00420   // between theSide2FirstNode and theSide2LastNode are different,
00421   // additional nodes are inserted on a link provided that no
00422   // volume elements share the splitted link.
00423   // The side 2 is a free border if theSide2IsFreeBorder == true.
00424   // Sewing is peformed between the given first, second and last
00425   // nodes on the sides.
00426   // theBorderFirstNode is merged with theSide2FirstNode.
00427   // if (!theSide2IsFreeBorder) then theSide2SecondNode gives
00428   // the last node on the side 2, which will be merged with
00429   // theBorderLastNode.
00430   // if (theSide2IsFreeBorder) then theSide2SecondNode will
00431   // be merged with theBorderSecondNode.
00432   // if (theSide2IsFreeBorder && theSide2ThirdNode == 0) then
00433   // the 2 free borders are sewn link by link and no additional
00434   // nodes are inserted.
00435   // Return false, if sewing failed.
00436 
00437   Sew_Error SewSideElements (TIDSortedElemSet&    theSide1,
00438                              TIDSortedElemSet&    theSide2,
00439                              const SMDS_MeshNode* theFirstNode1ToMerge,
00440                              const SMDS_MeshNode* theFirstNode2ToMerge,
00441                              const SMDS_MeshNode* theSecondNode1ToMerge,
00442                              const SMDS_MeshNode* theSecondNode2ToMerge);
00443   // Sew two sides of a mesh. Nodes belonging to theSide1 are
00444   // merged with nodes of elements of theSide2.
00445   // Number of elements in theSide1 and in theSide2 must be
00446   // equal and they should have similar node connectivity.
00447   // The nodes to merge should belong to side s borders and
00448   // the first node should be linked to the second.
00449 
00450   void InsertNodesIntoLink(const SMDS_MeshElement*          theFace,
00451                            const SMDS_MeshNode*             theBetweenNode1,
00452                            const SMDS_MeshNode*             theBetweenNode2,
00453                            std::list<const SMDS_MeshNode*>& theNodesToInsert,
00454                            const bool                       toCreatePoly = false);
00455   // insert theNodesToInsert into theFace between theBetweenNode1 and theBetweenNode2.
00456   // If toCreatePoly is true, replace theFace by polygon, else split theFace.
00457 
00458   void UpdateVolumes (const SMDS_MeshNode*             theBetweenNode1,
00459                       const SMDS_MeshNode*             theBetweenNode2,
00460                       std::list<const SMDS_MeshNode*>& theNodesToInsert);
00461   // insert theNodesToInsert into all volumes, containing link
00462   // theBetweenNode1 - theBetweenNode2, between theBetweenNode1 and theBetweenNode2.
00463 
00464   void ConvertToQuadratic(const bool theForce3d);
00465   void ConvertToQuadratic(const bool theForce3d, TIDSortedElemSet& theElements);
00466   // Converts all mesh to quadratic one, deletes old elements, replacing 
00467   // them with quadratic ones with the same id.
00468   // If theForce3d = 1; this results in the medium node lying at the 
00469   // middle of the line segments connecting start and end node of a mesh 
00470   // element
00471   // If theForce3d = 0; this results in the medium node lying at the 
00472   // geometrical edge from which the mesh element is built
00473 
00474   bool ConvertFromQuadratic();
00475   void ConvertFromQuadratic(TIDSortedElemSet& theElements);
00476   // Converts all mesh from quadratic to ordinary ones, deletes old quadratic elements, replacing 
00477   // them with ordinary mesh elements with the same id.
00478   // Returns true in case of success, false otherwise.
00479 
00480   static void AddToSameGroups (const SMDS_MeshElement* elemToAdd,
00481                                const SMDS_MeshElement* elemInGroups,
00482                                SMESHDS_Mesh *          aMesh);
00483   // Add elemToAdd to the all groups the elemInGroups belongs to
00484 
00485   static void RemoveElemFromGroups (const SMDS_MeshElement* element,
00486                                     SMESHDS_Mesh *          aMesh);
00487   // remove element from the all groups
00488 
00489   static void ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
00490                                    const SMDS_MeshElement* elemToAdd,
00491                                    SMESHDS_Mesh *          aMesh);
00492   // replace elemToRm by elemToAdd in the all groups
00493 
00494   static void ReplaceElemInGroups (const SMDS_MeshElement*                     elemToRm,
00495                                    const std::vector<const SMDS_MeshElement*>& elemToAdd,
00496                                    SMESHDS_Mesh *                              aMesh);
00497   // replace elemToRm by elemToAdd in the all groups
00498 
00502   static void GetLinkedNodes( const SMDS_MeshNode* node,
00503                               TIDSortedElemSet &   linkedNodes,
00504                               SMDSAbs_ElementType  type = SMDSAbs_All );
00505 
00506   static const SMDS_MeshElement* FindFaceInSet(const SMDS_MeshNode*    n1,
00507                                                const SMDS_MeshNode*    n2,
00508                                                const TIDSortedElemSet& elemSet,
00509                                                const TIDSortedElemSet& avoidSet,
00510                                                int*                    i1=0,
00511                                                int*                    i2=0);
00512   // Return a face having linked nodes n1 and n2 and which is
00513   // - not in avoidSet,
00514   // - in elemSet provided that !elemSet.empty()
00515   // i1 and i2 optionally returns indices of n1 and n2
00516 
00528   static Sew_Error FindMatchingNodes(std::set<const SMDS_MeshElement*>& theSide1,
00529                                      std::set<const SMDS_MeshElement*>& theSide2,
00530                                      const SMDS_MeshNode*               theFirstNode1,
00531                                      const SMDS_MeshNode*               theFirstNode2,
00532                                      const SMDS_MeshNode*               theSecondNode1,
00533                                      const SMDS_MeshNode*               theSecondNode2,
00534                                      TNodeNodeMap &                     theNodeReplaceMap);
00535 
00542   static bool IsMedium(const SMDS_MeshNode*      node,
00543                        const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
00544 
00545   int FindShape (const SMDS_MeshElement * theElem);
00546   // Return an index of the shape theElem is on
00547   // or zero if a shape not found
00548 
00549   SMESH_Mesh * GetMesh() { return myMesh; }
00550 
00551   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
00552 
00553   const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; }
00554 
00555   const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; }
00556 
00557   bool DoubleNodes( const std::list< int >& theListOfNodes, 
00558                     const std::list< int >& theListOfModifiedElems );
00559   
00560   bool DoubleNodes( const TIDSortedElemSet& theElems, 
00561                     const TIDSortedElemSet& theNodesNot,
00562                     const TIDSortedElemSet& theAffectedElems );
00563 
00564   bool DoubleNodesInRegion( const TIDSortedElemSet& theElems, 
00565                             const TIDSortedElemSet& theNodesNot,
00566                             const TopoDS_Shape&     theShape );
00567   
00568   double OrientedAngle(const gp_Pnt& p0, const gp_Pnt& p1, const gp_Pnt& g1, const gp_Pnt& g2);
00569 
00570   bool DoubleNodesOnGroupBoundaries( const std::vector<TIDSortedElemSet>& theElems,
00571                                      bool createJointElems);
00572 
00573   bool CreateFlatElementsOnFacesGroups( const std::vector<TIDSortedElemSet>& theElems );
00574 
00580   bool Make2DMeshFrom3D();
00581 
00582   enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
00583 
00584   int MakeBoundaryMesh(const TIDSortedElemSet& elements,
00585                        Bnd_Dimension           dimension,
00586                        SMESH_Group*            group = 0,
00587                        SMESH_Mesh*             targetMesh = 0,
00588                        bool                    toCopyElements = false,
00589                        bool                    toCopyExistingBondary = false,
00590                        bool                    toAddExistingBondary = false,
00591                        bool                    aroundElements = false);
00592 
00593 
00594  private:
00595 
00600   int convertElemToQuadratic(SMESHDS_SubMesh *   theSm,
00601                              SMESH_MesherHelper& theHelper,
00602                              const bool          theForce3d);
00603 
00608   int removeQuadElem( SMESHDS_SubMesh *    theSm,
00609                       SMDS_ElemIteratorPtr theItr,
00610                       const int            theShapeID);
00617   PGroupIDs generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
00618                            const SMESH_SequenceOfElemPtr& elemGens,
00619                            const std::string&             postfix,
00620                            SMESH_Mesh*                    targetMesh=0);
00621 
00622 
00623   typedef std::map<const SMDS_MeshNode*, std::list<const SMDS_MeshNode*> > TNodeOfNodeListMap;
00624   typedef TNodeOfNodeListMap::iterator                                     TNodeOfNodeListMapItr;
00625   typedef std::vector<TNodeOfNodeListMapItr>                               TVecOfNnlmiMap;
00626   typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap >               TElemOfVecOfNnlmiMap;
00627 
00636   void sweepElement(const SMDS_MeshElement*                    elem,
00637                     const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
00638                     std::list<const SMDS_MeshElement*>&        newElems,
00639                     const int                                  nbSteps,
00640                     SMESH_SequenceOfElemPtr&                   srcElements);
00641 
00651   void makeWalls (TNodeOfNodeListMap &     mapNewNodes,
00652                   TElemOfElemListMap &     newElemsMap,
00653                   TElemOfVecOfNnlmiMap &   elemNewNodesMap,
00654                   TIDSortedElemSet&        elemSet,
00655                   const int                nbSteps,
00656                   SMESH_SequenceOfElemPtr& srcElements);
00657 
00658   struct SMESH_MeshEditor_PathPoint
00659   {
00660     gp_Pnt myPnt;
00661     gp_Dir myTgt;
00662     double myAngle, myPrm;
00663 
00664     SMESH_MeshEditor_PathPoint(): myPnt(99., 99., 99.), myTgt(1.,0.,0.), myAngle(0), myPrm(0) {}
00665     void          SetPnt      (const gp_Pnt& aP3D)  { myPnt  =aP3D; }
00666     void          SetTangent  (const gp_Dir& aTgt)  { myTgt  =aTgt; }
00667     void          SetAngle    (const double& aBeta) { myAngle=aBeta; }
00668     void          SetParameter(const double& aPrm)  { myPrm  =aPrm; }
00669     const gp_Pnt& Pnt         ()const               { return myPnt; }
00670     const gp_Dir& Tangent     ()const               { return myTgt; }
00671     double        Angle       ()const               { return myAngle; }
00672     double        Parameter   ()const               { return myPrm; }
00673   };
00674   Extrusion_Error MakeEdgePathPoints(std::list<double>&                     aPrms,
00675                                      const TopoDS_Edge&                     aTrackEdge,
00676                                      bool                                   aFirstIsStart,
00677                                      std::list<SMESH_MeshEditor_PathPoint>& aLPP);
00678   Extrusion_Error MakeExtrElements(TIDSortedElemSet&                      theElements,
00679                                    std::list<SMESH_MeshEditor_PathPoint>& theFullList,
00680                                    const bool                             theHasAngles,
00681                                    std::list<double>&                     theAngles,
00682                                    const bool                             theLinearVariation,
00683                                    const bool                             theHasRefPoint,
00684                                    const gp_Pnt&                          theRefPoint,
00685                                    const bool                             theMakeGroups);
00686   void LinearAngleVariation(const int     NbSteps,
00687                             list<double>& theAngles);
00688 
00689   bool doubleNodes( SMESHDS_Mesh*                                           theMeshDS,
00690                     const TIDSortedElemSet&                                 theElems,
00691                     const TIDSortedElemSet&                                 theNodesNot,
00692                     std::map< const SMDS_MeshNode*, const SMDS_MeshNode* >& theNodeNodeMap,
00693                     const bool                                              theIsDoubleElem );
00694 
00695 private:
00696 
00697   SMESH_Mesh * myMesh;
00698 
00702   SMESH_SequenceOfElemPtr myLastCreatedNodes;
00703 
00707   SMESH_SequenceOfElemPtr myLastCreatedElems;
00708 
00709 };
00710 
00711 #endif