Salome HOME
0020452: EDF 1056 SMESH : 2D Projection Issue
[modules/smesh.git] / src / SMESH / SMESH_MeshEditor.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 // File      : SMESH_MeshEditor.hxx
24 // Created   : Mon Apr 12 14:56:19 2004
25 // Author    : Edward AGAPOV (eap)
26 // Module    : SMESH
27 //
28 #ifndef SMESH_MeshEditor_HeaderFile
29 #define SMESH_MeshEditor_HeaderFile
30
31 #include "SMESH_SMESH.hxx"
32
33 #include "SMDS_MeshElement.hxx"
34 #include "SMESH_Controls.hxx"
35 #include "SMESH_Mesh.hxx"
36 #include "SMESH_SequenceOfElemPtr.hxx"
37 #include "SMESH_SequenceOfNode.hxx"
38
39 #include <TColStd_HSequenceOfReal.hxx>
40 #include <gp_Dir.hxx>
41
42 #include <list>
43 #include <map>
44
45 class SMDS_MeshFace;
46 class SMDS_MeshNode;
47 class gp_Ax1;
48 class gp_Vec;
49 class gp_Pnt;
50 class SMESH_MesherHelper;
51
52
53 typedef std::map<const SMDS_MeshElement*,
54                  std::list<const SMDS_MeshElement*> >        TElemOfElemListMap;
55 typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
56
57  //!< Set of elements sorted by ID, to be used to assure predictability of edition
58 typedef std::set< const SMDS_MeshElement*, TIDCompare >      TIDSortedElemSet;
59
60 typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* >   NLink;
61
62
63 //=======================================================================
64 /*!
65  * \brief A sorted pair of nodes
66  */
67 //=======================================================================
68
69 struct SMESH_TLink: public NLink
70 {
71   SMESH_TLink(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 ):NLink( n1, n2 )
72   { if ( n1->GetID() < n2->GetID() ) std::swap( first, second ); }
73   SMESH_TLink(const NLink& link ):NLink( link )
74   { if ( first->GetID() < second->GetID() ) std::swap( first, second ); }
75   const SMDS_MeshNode* node1() const { return first; }
76   const SMDS_MeshNode* node2() const { return second; }
77 };
78
79 // ============================================================
80 /*!
81  * \brief Searcher for the node closest to point
82  */
83 // ============================================================
84
85 struct SMESH_NodeSearcher
86 {
87   virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
88 };
89
90 // ============================================================
91 /*!
92  * \brief Editor of a mesh
93  */
94 // ============================================================
95
96 class SMESH_EXPORT SMESH_MeshEditor {
97
98 public:
99
100   SMESH_MeshEditor( SMESH_Mesh* theMesh );
101
102   /*!
103    * \brief Add element
104    */
105   SMDS_MeshElement* AddElement(const std::vector<const SMDS_MeshNode*> & nodes,
106                                const SMDSAbs_ElementType                 type,
107                                const bool                                isPoly,
108                                const int                                 ID = 0);
109   /*!
110    * \brief Add element
111    */
112   SMDS_MeshElement* AddElement(const std::vector<int>  & nodeIDs,
113                                const SMDSAbs_ElementType type,
114                                const bool                isPoly,
115                                const int                 ID = 0);
116
117   bool Remove (const std::list< int >& theElemIDs, const bool isNodes);
118   // Remove a node or an element.
119   // Modify a compute state of sub-meshes which become empty
120
121   bool InverseDiag (const SMDS_MeshElement * theTria1,
122                     const SMDS_MeshElement * theTria2 );
123   // Replace two neighbour triangles with ones built on the same 4 nodes
124   // but having other common link.
125   // Return False if args are improper
126
127   bool InverseDiag (const SMDS_MeshNode * theNode1,
128                     const SMDS_MeshNode * theNode2 );
129   // Replace two neighbour triangles sharing theNode1-theNode2 link
130   // with ones built on the same 4 nodes but having other common link.
131   // Return false if proper faces not found
132
133   bool DeleteDiag (const SMDS_MeshNode * theNode1,
134                    const SMDS_MeshNode * theNode2 );
135   // Replace two neighbour triangles sharing theNode1-theNode2 link
136   // with a quadrangle built on the same 4 nodes.
137   // Return false if proper faces not found
138
139   bool Reorient (const SMDS_MeshElement * theElement);
140   // Reverse theElement orientation
141
142
143   /*!
144    * \brief Fuse neighbour triangles into quadrangles.
145    * \param theElems     - The triangles to be fused.
146    * \param theCriterion - Is used to choose a neighbour to fuse with.
147    * \param theMaxAngle  - Is a max angle between element normals at which fusion
148    *                       is still performed; theMaxAngle is mesured in radians.
149    * \retval bool - Success or not.
150    */
151   bool TriToQuad (TIDSortedElemSet &                   theElems,
152                   SMESH::Controls::NumericalFunctorPtr theCriterion,
153                   const double                         theMaxAngle);
154
155   /*!
156    * \brief Split quadrangles into triangles.
157    * \param theElems     - The faces to be splitted.
158    * \param theCriterion - Is used to choose a diagonal for splitting.
159    * \retval bool - Success or not.
160    */
161   bool QuadToTri (TIDSortedElemSet &                   theElems,
162                   SMESH::Controls::NumericalFunctorPtr theCriterion);
163
164   /*!
165    * \brief Split quadrangles into triangles.
166    * \param theElems  - The faces to be splitted.
167    * \param the13Diag - Is used to choose a diagonal for splitting.
168    * \retval bool - Success or not.
169    */
170   bool QuadToTri (TIDSortedElemSet & theElems,
171                   const bool         the13Diag);
172
173   /*!
174    * \brief Find better diagonal for splitting.
175    * \param theQuad      - The face to find better splitting of.
176    * \param theCriterion - Is used to choose a diagonal for splitting.
177    * \retval int - 1 for 1-3 diagonal, 2 for 2-4, -1 - for errors.
178    */
179   int BestSplit (const SMDS_MeshElement*              theQuad,
180                  SMESH::Controls::NumericalFunctorPtr theCriterion);
181
182
183   enum SmoothMethod { LAPLACIAN = 0, CENTROIDAL };
184
185   void Smooth (TIDSortedElemSet &               theElements,
186                std::set<const SMDS_MeshNode*> & theFixedNodes,
187                const SmoothMethod               theSmoothMethod,
188                const int                        theNbIterations,
189                double                           theTgtAspectRatio = 1.0,
190                const bool                       the2D = true);
191   // Smooth theElements using theSmoothMethod during theNbIterations
192   // or until a worst element has aspect ratio <= theTgtAspectRatio.
193   // Aspect Ratio varies in range [1.0, inf].
194   // If theElements is empty, the whole mesh is smoothed.
195   // theFixedNodes contains additionally fixed nodes. Nodes built
196   // on edges and boundary nodes are always fixed.
197   // If the2D, smoothing is performed using UV parameters of nodes
198   // on geometrical faces
199
200   typedef std::auto_ptr< std::list<int> > PGroupIDs;
201
202   PGroupIDs RotationSweep (TIDSortedElemSet & theElements,
203                            const gp_Ax1&      theAxis,
204                            const double       theAngle,
205                            const int          theNbSteps,
206                            const double       theToler,
207                            const bool         theMakeGroups,
208                            const bool         theMakeWalls=true);
209   // Generate new elements by rotation of theElements around theAxis
210   // by theAngle by theNbSteps
211
212   /*!
213    * Auxilary flag for advanced extrusion.
214    * BOUNDARY: create or not boundary for result of extrusion
215    * SEW:      try to use existing nodes or create new nodes in any case
216    */
217   enum ExtrusionFlags {
218     EXTRUSION_FLAG_BOUNDARY = 0x01,
219     EXTRUSION_FLAG_SEW = 0x02
220   };
221   
222   /*!
223    * special structire for control of extrusion functionality
224    */
225   struct ExtrusParam {
226     gp_Dir myDir; // direction of extrusion
227     Handle(TColStd_HSequenceOfReal) mySteps; // magnitudes for each step
228     SMESH_SequenceOfNode myNodes; // nodes for using in sewing
229   };
230
231   /*!
232    * Create new node in the mesh with given coordinates
233    * (auxilary for advanced extrusion)
234    */
235   const SMDS_MeshNode* CreateNode(const double x,
236                                   const double y,
237                                   const double z,
238                                   const double tolnode,
239                                   SMESH_SequenceOfNode& aNodes);
240
241   /*!
242    * Generate new elements by extrusion of theElements
243    * It is a method used in .idl file. All functionality
244    * is implemented in the next method (see below) which
245    * is used in the cuurent method.
246    * param theElems - list of elements for extrusion
247    * param newElemsMap returns history of extrusion
248    * param theFlags set flags for performing extrusion (see description
249    *   of enum ExtrusionFlags for additional information)
250    * param theTolerance - uses for comparing locations of nodes if flag
251    *   EXTRUSION_FLAG_SEW is set
252    */
253   PGroupIDs ExtrusionSweep (TIDSortedElemSet &  theElems,
254                             const gp_Vec&       theStep,
255                             const int           theNbSteps,
256                             TElemOfElemListMap& newElemsMap,
257                             const bool          theMakeGroups,
258                             const int           theFlags = EXTRUSION_FLAG_BOUNDARY,
259                             const double        theTolerance = 1.e-6);
260   
261   /*!
262    * Generate new elements by extrusion of theElements
263    * param theElems - list of elements for extrusion
264    * param newElemsMap returns history of extrusion
265    * param theFlags set flags for performing extrusion (see description
266    *   of enum ExtrusionFlags for additional information)
267    * param theTolerance - uses for comparing locations of nodes if flag
268    *   EXTRUSION_FLAG_SEW is set
269    * param theParams - special structure for manage of extrusion
270    */
271   PGroupIDs ExtrusionSweep (TIDSortedElemSet &  theElems,
272                             ExtrusParam&        theParams,
273                             TElemOfElemListMap& newElemsMap,
274                             const bool          theMakeGroups,
275                             const int           theFlags,
276                             const double        theTolerance);
277
278
279   // Generate new elements by extrusion of theElements 
280   // by theStep by theNbSteps
281
282   enum Extrusion_Error {
283     EXTR_OK,
284     EXTR_NO_ELEMENTS, 
285     EXTR_PATH_NOT_EDGE,
286     EXTR_BAD_PATH_SHAPE,
287     EXTR_BAD_STARTING_NODE,
288     EXTR_BAD_ANGLES_NUMBER,
289     EXTR_CANT_GET_TANGENT
290     };
291   
292   Extrusion_Error ExtrusionAlongTrack (TIDSortedElemSet &   theElements,
293                                        SMESH_subMesh*       theTrackPattern,
294                                        const SMDS_MeshNode* theNodeStart,
295                                        const bool           theHasAngles,
296                                        std::list<double>&   theAngles,
297                                        const bool           theHasRefPoint,
298                                        const gp_Pnt&        theRefPoint,
299                                        const bool           theMakeGroups);
300   // Generate new elements by extrusion of theElements along path given by theTrackPattern,
301   // theHasAngles are the rotation angles, base point can be given by theRefPoint
302
303   PGroupIDs Transform (TIDSortedElemSet & theElements,
304                        const gp_Trsf&     theTrsf,
305                        const bool         theCopy,
306                        const bool         theMakeGroups,
307                        SMESH_Mesh*        theTargetMesh=0);
308   // Move or copy theElements applying theTrsf to their nodes
309
310   typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
311
312   void FindCoincidentNodes (std::set<const SMDS_MeshNode*> & theNodes,
313                             const double                     theTolerance,
314                             TListOfListOfNodes &             theGroupsOfNodes);
315   // Return list of group of nodes close to each other within theTolerance.
316   // Search among theNodes or in the whole mesh if theNodes is empty.
317
318   /*!
319    * \brief Return SMESH_NodeSearcher
320    */
321   SMESH_NodeSearcher* GetNodeSearcher();
322
323   int SimplifyFace (const std::vector<const SMDS_MeshNode *> faceNodes,
324                     std::vector<const SMDS_MeshNode *>&      poly_nodes,
325                     std::vector<int>&                        quantities) const;
326   // Split face, defined by <faceNodes>, into several faces by repeating nodes.
327   // Is used by MergeNodes()
328
329   void MergeNodes (TListOfListOfNodes & theNodeGroups);
330   // In each group, the cdr of nodes are substituted by the first one
331   // in all elements.
332
333   typedef std::list< std::list< int > > TListOfListOfElementsID;
334
335   void FindEqualElements(std::set<const SMDS_MeshElement*> & theElements,
336                          TListOfListOfElementsID &           theGroupsOfElementsID);
337   // Return list of group of elements build on the same nodes.
338   // Search among theElements or in the whole mesh if theElements is empty.
339
340   void MergeElements(TListOfListOfElementsID & theGroupsOfElementsID);
341   // In each group remove all but first of elements.
342
343   void MergeEqualElements();
344   // Remove all but one of elements built on the same nodes.
345   // Return nb of successfully merged groups.
346
347   static bool CheckFreeBorderNodes(const SMDS_MeshNode* theNode1,
348                                    const SMDS_MeshNode* theNode2,
349                                    const SMDS_MeshNode* theNode3 = 0);
350   // Return true if the three nodes are on a free border
351
352   static bool FindFreeBorder (const SMDS_MeshNode*                  theFirstNode,
353                               const SMDS_MeshNode*                  theSecondNode,
354                               const SMDS_MeshNode*                  theLastNode,
355                               std::list< const SMDS_MeshNode* > &   theNodes,
356                               std::list< const SMDS_MeshElement* >& theFaces);
357   // Return nodes and faces of a free border if found 
358
359   enum Sew_Error {
360     SEW_OK,
361     // for SewFreeBorder()
362     SEW_BORDER1_NOT_FOUND,
363     SEW_BORDER2_NOT_FOUND,
364     SEW_BOTH_BORDERS_NOT_FOUND,
365     SEW_BAD_SIDE_NODES,
366     SEW_VOLUMES_TO_SPLIT,
367     // for SewSideElements()
368     SEW_DIFF_NB_OF_ELEMENTS,
369     SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
370     SEW_BAD_SIDE1_NODES,
371     SEW_BAD_SIDE2_NODES,
372     SEW_INTERNAL_ERROR
373     };
374     
375
376   Sew_Error SewFreeBorder (const SMDS_MeshNode* theBorderFirstNode,
377                            const SMDS_MeshNode* theBorderSecondNode,
378                            const SMDS_MeshNode* theBorderLastNode,
379                            const SMDS_MeshNode* theSide2FirstNode,
380                            const SMDS_MeshNode* theSide2SecondNode,
381                            const SMDS_MeshNode* theSide2ThirdNode = 0,
382                            const bool           theSide2IsFreeBorder = true,
383                            const bool           toCreatePolygons = false,
384                            const bool           toCreatePolyedrs = false);
385   // Sew the free border to the side2 by replacing nodes in
386   // elements on the free border with nodes of the elements
387   // of the side 2. If nb of links in the free border and
388   // between theSide2FirstNode and theSide2LastNode are different,
389   // additional nodes are inserted on a link provided that no
390   // volume elements share the splitted link.
391   // The side 2 is a free border if theSide2IsFreeBorder == true.
392   // Sewing is peformed between the given first, second and last
393   // nodes on the sides.
394   // theBorderFirstNode is merged with theSide2FirstNode.
395   // if (!theSide2IsFreeBorder) then theSide2SecondNode gives
396   // the last node on the side 2, which will be merged with
397   // theBorderLastNode.
398   // if (theSide2IsFreeBorder) then theSide2SecondNode will
399   // be merged with theBorderSecondNode.
400   // if (theSide2IsFreeBorder && theSide2ThirdNode == 0) then
401   // the 2 free borders are sewn link by link and no additional
402   // nodes are inserted.
403   // Return false, if sewing failed.
404
405   Sew_Error SewSideElements (TIDSortedElemSet&    theSide1,
406                              TIDSortedElemSet&    theSide2,
407                              const SMDS_MeshNode* theFirstNode1ToMerge,
408                              const SMDS_MeshNode* theFirstNode2ToMerge,
409                              const SMDS_MeshNode* theSecondNode1ToMerge,
410                              const SMDS_MeshNode* theSecondNode2ToMerge);
411   // Sew two sides of a mesh. Nodes belonging to theSide1 are
412   // merged with nodes of elements of theSide2.
413   // Number of elements in theSide1 and in theSide2 must be
414   // equal and they should have similar node connectivity.
415   // The nodes to merge should belong to side s borders and
416   // the first node should be linked to the second.
417
418   void InsertNodesIntoLink(const SMDS_MeshElement*          theFace,
419                            const SMDS_MeshNode*             theBetweenNode1,
420                            const SMDS_MeshNode*             theBetweenNode2,
421                            std::list<const SMDS_MeshNode*>& theNodesToInsert,
422                            const bool                       toCreatePoly = false);
423   // insert theNodesToInsert into theFace between theBetweenNode1 and theBetweenNode2.
424   // If toCreatePoly is true, replace theFace by polygon, else split theFace.
425
426   void UpdateVolumes (const SMDS_MeshNode*             theBetweenNode1,
427                       const SMDS_MeshNode*             theBetweenNode2,
428                       std::list<const SMDS_MeshNode*>& theNodesToInsert);
429   // insert theNodesToInsert into all volumes, containing link
430   // theBetweenNode1 - theBetweenNode2, between theBetweenNode1 and theBetweenNode2.
431
432   void ConvertToQuadratic(const bool theForce3d);
433   //converts all mesh to quadratic one, deletes old elements, replacing 
434   //them with quadratic ones with the same id.
435
436   bool ConvertFromQuadratic();
437   //converts all mesh from quadratic to ordinary ones, deletes old quadratic elements, replacing 
438   //them with ordinary mesh elements with the same id.
439
440
441 //  static int SortQuadNodes (const SMDS_Mesh * theMesh,
442 //                            int               theNodeIds[] );
443 //  // Set 4 nodes of a quadrangle face in a good order.
444 //  // Swap 1<->2 or 2<->3 nodes and correspondingly return
445 //  // 1 or 2 else 0.
446 //
447 //  static bool SortHexaNodes (const SMDS_Mesh * theMesh,
448 //                             int               theNodeIds[] );
449 //  // Set 8 nodes of a hexahedron in a good order.
450 //  // Return success status
451
452   static void AddToSameGroups (const SMDS_MeshElement* elemToAdd,
453                                const SMDS_MeshElement* elemInGroups,
454                                SMESHDS_Mesh *          aMesh);
455   // Add elemToAdd to the all groups the elemInGroups belongs to
456
457   static void RemoveElemFromGroups (const SMDS_MeshElement* element,
458                                     SMESHDS_Mesh *          aMesh);
459   // remove element from the all groups
460
461   static void ReplaceElemInGroups (const SMDS_MeshElement* elemToRm,
462                                    const SMDS_MeshElement* elemToAdd,
463                                    SMESHDS_Mesh *          aMesh);
464   // replace elemToRm by elemToAdd in the all groups
465
466   /*!
467    * \brief Return nodes linked to the given one in elements of the type
468    */
469   static void GetLinkedNodes( const SMDS_MeshNode* node,
470                               TIDSortedElemSet &   linkedNodes,
471                               SMDSAbs_ElementType  type = SMDSAbs_All );
472
473   static const SMDS_MeshElement*
474     FindFaceInSet(const SMDS_MeshNode*    n1,
475                   const SMDS_MeshNode*    n2,
476                   const TIDSortedElemSet& elemSet,
477                   const TIDSortedElemSet& avoidSet);
478   // Return a face having linked nodes n1 and n2 and which is
479   // - not in avoidSet,
480   // - in elemSet provided that !elemSet.empty()
481
482   /*!
483    * \brief Find corresponding nodes in two sets of faces 
484     * \param theSide1 - first face set
485     * \param theSide2 - second first face
486     * \param theFirstNode1 - a boundary node of set 1
487     * \param theFirstNode2 - a node of set 2 corresponding to theFirstNode1
488     * \param theSecondNode1 - a boundary node of set 1 linked with theFirstNode1
489     * \param theSecondNode2 - a node of set 2 corresponding to theSecondNode1
490     * \param nReplaceMap - output map of corresponding nodes
491     * \retval Sew_Error  - is a success or not
492    */
493   static Sew_Error FindMatchingNodes(std::set<const SMDS_MeshElement*>& theSide1,
494                                      std::set<const SMDS_MeshElement*>& theSide2,
495                                      const SMDS_MeshNode*          theFirstNode1,
496                                      const SMDS_MeshNode*          theFirstNode2,
497                                      const SMDS_MeshNode*          theSecondNode1,
498                                      const SMDS_MeshNode*          theSecondNode2,
499                                      TNodeNodeMap &                nReplaceMap);
500
501   /*!
502    * \brief Returns true if given node is medium
503     * \param n - node to check
504     * \param typeToCheck - type of elements containing the node to ask about node status
505     * \retval bool - check result
506    */
507   static bool IsMedium(const SMDS_MeshNode*      node,
508                        const SMDSAbs_ElementType typeToCheck = SMDSAbs_All);
509
510   int FindShape (const SMDS_MeshElement * theElem);
511   // Return an index of the shape theElem is on
512   // or zero if a shape not found
513
514   SMESH_Mesh * GetMesh() { return myMesh; }
515
516   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
517
518   const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; }
519
520   const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; }
521   
522   bool DoubleNodes( const std::list< int >& theListOfNodes, 
523                     const std::list< int >& theListOfModifiedElems );
524
525 private:
526
527   /*!
528    * \brief Convert elements contained in a submesh to quadratic
529     * \retval int - nb of checked elements
530    */
531   int convertElemToQuadratic(SMESHDS_SubMesh *   theSm,
532                              SMESH_MesherHelper& theHelper,
533                              const bool          theForce3d);
534
535   /*!
536    * \brief Convert quadratic elements to linear ones and remove quadratic nodes
537     * \retval int - nb of checked elements
538    */
539   int removeQuadElem( SMESHDS_SubMesh *    theSm,
540                       SMDS_ElemIteratorPtr theItr,
541                       const int            theShapeID);
542   /*!
543    * \brief Create groups of elements made during transformation
544    * \param nodeGens - nodes making corresponding myLastCreatedNodes
545    * \param elemGens - elements making corresponding myLastCreatedElems
546    * \param postfix - to append to names of new groups
547    */
548   PGroupIDs generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
549                            const SMESH_SequenceOfElemPtr& elemGens,
550                            const std::string&             postfix,
551                            SMESH_Mesh*                    targetMesh=0);
552
553
554   typedef std::map<const SMDS_MeshNode*, std::list<const SMDS_MeshNode*> > TNodeOfNodeListMap;
555   typedef TNodeOfNodeListMap::iterator                                     TNodeOfNodeListMapItr;
556   typedef std::vector<TNodeOfNodeListMapItr>                               TVecOfNnlmiMap;
557   typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap >               TElemOfVecOfNnlmiMap;
558
559   /*!
560    * \brief Create elements by sweeping an element
561     * \param elem - element to sweep
562     * \param newNodesItVec - nodes generated from each node of the element
563     * \param newElems - generated elements
564     * \param nbSteps - number of sweeping steps
565     * \param srcElements - to append elem for each generated element
566    */
567   void sweepElement(const SMDS_MeshElement*                    elem,
568                     const std::vector<TNodeOfNodeListMapItr> & newNodesItVec,
569                     std::list<const SMDS_MeshElement*>&        newElems,
570                     const int                                  nbSteps,
571                     SMESH_SequenceOfElemPtr&                   srcElements);
572
573   /*!
574    * \brief Create 1D and 2D elements around swept elements
575     * \param mapNewNodes - source nodes and ones generated from them
576     * \param newElemsMap - source elements and ones generated from them
577     * \param elemNewNodesMap - nodes generated from each node of each element
578     * \param elemSet - all swept elements
579     * \param nbSteps - number of sweeping steps
580     * \param srcElements - to append elem for each generated element
581    */
582   void makeWalls (TNodeOfNodeListMap &     mapNewNodes,
583                   TElemOfElemListMap &     newElemsMap,
584                   TElemOfVecOfNnlmiMap &   elemNewNodesMap,
585                   TIDSortedElemSet&        elemSet,
586                   const int                nbSteps,
587                   SMESH_SequenceOfElemPtr& srcElements);
588 private:
589
590   SMESH_Mesh * myMesh;
591
592   /*!
593    * Sequence for keeping nodes created during last operation
594    */
595   SMESH_SequenceOfElemPtr myLastCreatedNodes;
596
597   /*!
598    * Sequence for keeping elements created during last operation
599    */
600   SMESH_SequenceOfElemPtr myLastCreatedElems;
601
602 };
603
604 #endif