Salome HOME
eff6e21e41f55415104295b7e4d6bbfb500480d9
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.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_i.hxx
24 //  Author : Nicolas REJNERI
25 //  Module : SMESH
26 //
27 #ifndef _SMESH_MESHEDITOR_I_HXX_
28 #define _SMESH_MESHEDIOTR_I_HXX_
29
30 #include "SMESH.hxx"
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
34
35 #include "SMESH_Mesh.hxx"
36 #include "SMESH_PythonDump.hxx"
37 #include <list>
38
39 class SMESH_MeshEditor;
40 class SMESH_Mesh_i;
41
42 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
43 {
44  public:
45   SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
46
47   virtual ~ SMESH_MeshEditor_i();
48
49   // --- CORBA
50   CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
51   CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
52
53   /*!
54    * Methods for creation new elements.
55    * Returns ID of created element or 0 if element not created
56    */
57   CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
58   CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
59   CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
60   CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
61   CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
62   CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
63                                   const SMESH::long_array & Quantities);
64   CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
65
66   /*!
67    * \brief Bind a node to a vertex
68    * \param NodeID - node ID
69    * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
70    */
71   void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
72     throw (SALOME::SALOME_Exception);
73   /*!
74    * \brief Store node position on an edge
75    * \param NodeID - node ID
76    * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
77    * \param paramOnEdge - parameter on edge where the node is located
78    */
79   void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
80                      CORBA::Double paramOnEdge)
81     throw (SALOME::SALOME_Exception);
82   /*!
83    * \brief Store node position on a face
84    * \param NodeID - node ID
85    * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
86    * \param u - U parameter on face where the node is located
87    * \param v - V parameter on face where the node is located
88    */
89   void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
90                      CORBA::Double u, CORBA::Double v)
91     throw (SALOME::SALOME_Exception);
92   /*!
93    * \brief Bind a node to a solid
94    * \param NodeID - node ID
95    * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
96    */
97   void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
98     throw (SALOME::SALOME_Exception);
99   /*!
100    * \brief Bind an element to a shape
101    * \param ElementID - element ID
102    * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
103    */
104   void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
105     throw (SALOME::SALOME_Exception);
106
107
108   CORBA::Boolean MoveNode(CORBA::Long NodeID,
109                           CORBA::Double x, CORBA::Double y, CORBA::Double z);
110
111   CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
112   CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
113   CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
114   CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
115
116   // Split/Join faces
117   CORBA::Boolean TriToQuad       (const SMESH::long_array &   IDsOfElements,
118                                   SMESH::NumericalFunctor_ptr Criterion,
119                                   CORBA::Double               MaxAngle);
120   CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
121                                   SMESH::NumericalFunctor_ptr Criterion,
122                                   CORBA::Double               MaxAngle);
123   CORBA::Boolean QuadToTri       (const SMESH::long_array &   IDsOfElements,
124                                   SMESH::NumericalFunctor_ptr Criterion);
125   CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr   theObject,
126                                   SMESH::NumericalFunctor_ptr Criterion);
127   CORBA::Boolean SplitQuad       (const SMESH::long_array &   IDsOfElements,
128                                   CORBA::Boolean              Diag13);
129   CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
130                                   CORBA::Boolean              Diag13);
131   CORBA::Long    BestSplit       (CORBA::Long                 IDOfQuad,
132                                   SMESH::NumericalFunctor_ptr Criterion);
133
134   CORBA::Boolean Smooth(const SMESH::long_array &              IDsOfElements,
135                         const SMESH::long_array &              IDsOfFixedNodes,
136                         CORBA::Long                            MaxNbOfIterations,
137                         CORBA::Double                          MaxAspectRatio,
138                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
139   CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
140                               const SMESH::long_array &              IDsOfFixedNodes,
141                               CORBA::Long                            MaxNbOfIterations,
142                               CORBA::Double                          MaxAspectRatio,
143                               SMESH::SMESH_MeshEditor::Smooth_Method Method);
144   CORBA::Boolean SmoothParametric(const SMESH::long_array &              IDsOfElements,
145                                   const SMESH::long_array &              IDsOfFixedNodes,
146                                   CORBA::Long                            MaxNbOfIterations,
147                                   CORBA::Double                          MaxAspectRatio,
148                                   SMESH::SMESH_MeshEditor::Smooth_Method Method);
149   CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
150                                         const SMESH::long_array &              IDsOfFixedNodes,
151                                         CORBA::Long                            MaxNbOfIterations,
152                                         CORBA::Double                          MaxAspectRatio,
153                                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
154   CORBA::Boolean smooth(const SMESH::long_array &              IDsOfElements,
155                         const SMESH::long_array &              IDsOfFixedNodes,
156                         CORBA::Long                            MaxNbOfIterations,
157                         CORBA::Double                          MaxAspectRatio,
158                         SMESH::SMESH_MeshEditor::Smooth_Method Method,
159                         bool                                   IsParametric);
160   CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr              theObject,
161                               const SMESH::long_array &              IDsOfFixedNodes,
162                               CORBA::Long                            MaxNbOfIterations,
163                               CORBA::Double                          MaxAspectRatio,
164                               SMESH::SMESH_MeshEditor::Smooth_Method Method,
165                               bool                                   IsParametric);
166
167
168   void ConvertToQuadratic(CORBA::Boolean Force3d);
169   CORBA::Boolean ConvertFromQuadratic();
170
171   void RenumberNodes();
172   void RenumberElements();
173
174   void RotationSweep(const SMESH::long_array & IDsOfElements,
175                      const SMESH::AxisStruct & Axis,
176                      CORBA::Double             AngleInRadians,
177                      CORBA::Long               NbOfSteps,
178                      CORBA::Double             Tolerance);
179   void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
180                            const SMESH::AxisStruct & Axis,
181                            CORBA::Double             AngleInRadians,
182                            CORBA::Long               NbOfSteps,
183                            CORBA::Double             Tolerance);
184
185   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
186                       const SMESH::DirStruct &  StepVector,
187                       CORBA::Long               NbOfSteps);
188   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
189                             const SMESH::DirStruct &  StepVector,
190                             CORBA::Long               NbOfSteps);
191   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
192                               const SMESH::DirStruct &  StepVector,
193                               CORBA::Long               NbOfSteps);
194   void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
195                               const SMESH::DirStruct &  StepVector,
196                               CORBA::Long               NbOfSteps);
197   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
198                          const SMESH::DirStruct &  theStepVector,
199                          CORBA::Long               theNbOfSteps,
200                          CORBA::Long               theExtrFlags,
201                          CORBA::Double             theSewTolerance);
202
203   SMESH::SMESH_MeshEditor::Extrusion_Error
204     ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
205                        SMESH::SMESH_Mesh_ptr       PathMesh,
206                        GEOM::GEOM_Object_ptr       PathShape,
207                        CORBA::Long                 NodeStart,
208                        CORBA::Boolean              HasAngles,
209                        const SMESH::double_array & Angles,
210                        CORBA::Boolean              HasRefPoint,
211                        const SMESH::PointStruct &  RefPoint);
212
213   SMESH::SMESH_MeshEditor::Extrusion_Error
214     ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
215                              SMESH::SMESH_Mesh_ptr       PathMesh,
216                              GEOM::GEOM_Object_ptr       PathShape,
217                              CORBA::Long                 NodeStart,
218                              CORBA::Boolean              HasAngles,
219                              const SMESH::double_array & Angles,
220                              CORBA::Boolean              HasRefPoint,
221                              const SMESH::PointStruct &  RefPoint);
222
223   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
224                                              GEOM::GEOM_Object_ptr       PathShape,
225                                              const SMESH::double_array & Angles);
226
227   void Mirror(const SMESH::long_array &           IDsOfElements,
228               const SMESH::AxisStruct &           Axis,
229               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
230               CORBA::Boolean                      Copy);
231   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
232                     const SMESH::AxisStruct &           Axis,
233                     SMESH::SMESH_MeshEditor::MirrorType MirrorType,
234                     CORBA::Boolean                      Copy);
235   void Translate(const SMESH::long_array & IDsOfElements,
236                  const SMESH::DirStruct &   Vector,
237                  CORBA::Boolean            Copy);
238   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
239                        const SMESH::DirStruct &   Vector,
240                        CORBA::Boolean             Copy);
241   void Rotate(const SMESH::long_array & IDsOfElements,
242               const SMESH::AxisStruct &  Axis,
243               CORBA::Double             Angle,
244               CORBA::Boolean            Copy);
245   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
246                     const SMESH::AxisStruct &  Axis,
247                     CORBA::Double              Angle,
248                     CORBA::Boolean             Copy);
249
250   SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
251                                                const SMESH::AxisStruct& Axix,
252                                                CORBA::Double            AngleInRadians,
253                                                CORBA::Long              NbOfSteps,
254                                                CORBA::Double            Tolerance);
255   SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
256                                                      const SMESH::AxisStruct&  Axix,
257                                                      CORBA::Double             AngleInRadians,
258                                                      CORBA::Long               NbOfSteps,
259                                                      CORBA::Double             Tolerance);
260   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
261                                                 const SMESH::DirStruct&  StepVector,
262                                                 CORBA::Long              NbOfSteps);
263   SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
264                                                    const SMESH::DirStruct&  StepVector,
265                                                    CORBA::Long              NbOfSteps,
266                                                    CORBA::Long              ExtrFlags,
267                                                    CORBA::Double            SewTolerance);
268   SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
269                                                       const SMESH::DirStruct&   StepVector,
270                                                       CORBA::Long               NbOfSteps);
271   SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
272                                                         const SMESH::DirStruct&   StepVector,
273                                                         CORBA::Long               NbOfSteps);
274   SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
275                                                         const SMESH::DirStruct&   StepVector,
276                                                         CORBA::Long               NbOfSteps);
277   SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array&   IDsOfElements,
278                                                     SMESH::SMESH_Mesh_ptr      PathMesh,
279                                                     GEOM::GEOM_Object_ptr      PathShape,
280                                                     CORBA::Long                NodeStart,
281                                                     CORBA::Boolean             HasAngles,
282                                                     const SMESH::double_array& Angles,
283                                                     CORBA::Boolean             HasRefPoint,
284                                                     const SMESH::PointStruct&  RefPoint,
285                                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
286   SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
287                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
288                                                           GEOM::GEOM_Object_ptr      PathShape,
289                                                           CORBA::Long                NodeStart,
290                                                           CORBA::Boolean             HasAngles,
291                                                           const SMESH::double_array& Angles,
292                                                           CORBA::Boolean             HasRefPoint,
293                                                           const SMESH::PointStruct&  RefPoint,
294                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
295   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
296                                         const SMESH::AxisStruct&            Mirror,
297                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType);
298   SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           Object,
299                                               const SMESH::AxisStruct&            Mirror,
300                                               SMESH::SMESH_MeshEditor::MirrorType MirrorType);
301   SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
302                                            const SMESH::DirStruct&  Vector);
303   SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
304                                                  const SMESH::DirStruct&   Vector);
305   SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
306                                         const SMESH::AxisStruct& Axis,
307                                         CORBA::Double            AngleInRadians);
308   SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
309                                               const SMESH::AxisStruct&  Axis,
310                                               CORBA::Double             AngleInRadians);
311
312   SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array&            IDsOfElements,
313                                        const SMESH::AxisStruct&            Mirror,
314                                        SMESH::SMESH_MeshEditor::MirrorType MirrorType,
315                                        CORBA::Boolean                      CopyGroups,
316                                        const char*                         MeshName);
317   SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           Object,
318                                              const SMESH::AxisStruct&            Mirror,
319                                              SMESH::SMESH_MeshEditor::MirrorType MirrorType,
320                                              CORBA::Boolean                      CopyGroups,
321                                              const char*                         MeshName);
322   SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
323                                           const SMESH::DirStruct&  Vector,
324                                           CORBA::Boolean           CopyGroups,
325                                           const char*              MeshName);
326   SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
327                                                 const SMESH::DirStruct&   Vector,
328                                                 CORBA::Boolean            CopyGroups,
329                                                 const char*               MeshName);
330   SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
331                                        const SMESH::AxisStruct& Axis,
332                                        CORBA::Double            AngleInRadians,
333                                        CORBA::Boolean           CopyGroups,
334                                        const char*              MeshName);
335   SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
336                                              const SMESH::AxisStruct&  Axis,
337                                              CORBA::Double             AngleInRadians,
338                                              CORBA::Boolean            CopyGroups,
339                                              const char*               MeshName);
340
341   void FindCoincidentNodes (CORBA::Double                  Tolerance,
342                             SMESH::array_of_long_array_out GroupsOfNodes);
343   void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr      Object,
344                                  CORBA::Double                  Tolerance,
345                                  SMESH::array_of_long_array_out GroupsOfNodes);
346   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
347   void FindEqualElements(SMESH::SMESH_IDSource_ptr      Object,
348                          SMESH::array_of_long_array_out GroupsOfElementsID);
349   void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
350   void MergeEqualElements();
351   CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
352                                      CORBA::Double y,
353                                      CORBA::Double z,
354                                      CORBA::Long   nodeID);
355
356
357
358   SMESH::SMESH_MeshEditor::Sew_Error
359   SewFreeBorders(CORBA::Long FirstNodeID1,
360                  CORBA::Long SecondNodeID1,
361                  CORBA::Long LastNodeID1,
362                  CORBA::Long FirstNodeID2,
363                  CORBA::Long SecondNodeID2,
364                  CORBA::Long LastNodeID2,
365                  CORBA::Boolean CreatePolygons,
366                  CORBA::Boolean CreatePolyedrs);
367   SMESH::SMESH_MeshEditor::Sew_Error
368   SewConformFreeBorders(CORBA::Long FirstNodeID1,
369                         CORBA::Long SecondNodeID1,
370                         CORBA::Long LastNodeID1,
371                         CORBA::Long FirstNodeID2,
372                         CORBA::Long SecondNodeID2);
373   SMESH::SMESH_MeshEditor::Sew_Error
374   SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
375                   CORBA::Long SecondNodeIDOnFreeBorder,
376                   CORBA::Long LastNodeIDOnFreeBorder,
377                   CORBA::Long FirstNodeIDOnSide,
378                   CORBA::Long LastNodeIDOnSide,
379                   CORBA::Boolean CreatePolygons,
380                   CORBA::Boolean CreatePolyedrs);
381   SMESH::SMESH_MeshEditor::Sew_Error
382   SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
383                   const SMESH::long_array& IDsOfSide2Elements,
384                   CORBA::Long NodeID1OfSide1ToMerge,
385                   CORBA::Long NodeID1OfSide2ToMerge,
386                   CORBA::Long NodeID2OfSide1ToMerge,
387                   CORBA::Long NodeID2OfSide2ToMerge);
388
389   /*!
390    * Set new nodes for given element.
391    * If number of nodes is not corresponded to type of
392    * element - returns false
393    */
394   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
395   
396   /*!
397    * Return data of mesh edition preview
398    */
399   SMESH::MeshPreviewStruct* GetPreviewData();
400
401   /*!
402    * If during last operation of MeshEditor some nodes were
403    * created this method returns list of it's IDs, if new nodes
404    * not creared - returns empty list
405    */
406   SMESH::long_array* GetLastCreatedNodes();
407
408   /*!
409    * If during last operation of MeshEditor some elements were
410    * created this method returns list of it's IDs, if new elements
411    * not creared - returns empty list
412    */
413   SMESH::long_array* GetLastCreatedElems();
414
415   /*!
416    * \brief Return edited mesh ID
417     * \retval int - mesh ID
418    */
419   int GetMeshId() const { return myMesh->GetId(); }
420   
421   CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
422                               const SMESH::long_array& theModifiedElems );
423
424   CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
425                              const SMESH::long_array& theModifiedElems );
426
427   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
428                                   SMESH::SMESH_GroupBase_ptr theModifiedElems );
429
430   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
431                                    const SMESH::ListOfGroups& theModifiedElems);
432
433 private: //!< private methods
434
435   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
436
437   /*!
438    * \brief Update myLastCreated* or myPreviewData
439     * \param anEditor - it contains edition results
440    */
441   void storeResult(::SMESH_MeshEditor& anEditor);
442   /*!
443    * \brief Clear myLastCreated* or myPreviewData
444    */
445   void initData();
446
447   /*!
448    * \brief Return groups by their IDs
449    */
450   SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
451
452   SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
453                                      const SMESH::AxisStruct & Axis,
454                                      CORBA::Double             AngleInRadians,
455                                      CORBA::Long               NbOfSteps,
456                                      CORBA::Double             Tolerance,
457                                      const bool                MakeGroups);
458   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
459                                       const SMESH::DirStruct &  StepVector,
460                                       CORBA::Long               NbOfSteps,
461                                       const bool                MakeGroups,
462                                       const SMDSAbs_ElementType ElementType=SMDSAbs_All);
463   SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
464                                          const SMESH::DirStruct &  theStepVector,
465                                          CORBA::Long               theNbOfSteps,
466                                          CORBA::Long               theExtrFlags,
467                                          CORBA::Double             theSewTolerance,
468                                          const bool                MakeGroups);
469   SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array &   IDsOfElements,
470                                           SMESH::SMESH_Mesh_ptr       PathMesh,
471                                           GEOM::GEOM_Object_ptr       PathShape,
472                                           CORBA::Long                 NodeStart,
473                                           CORBA::Boolean              HasAngles,
474                                           const SMESH::double_array & Angles,
475                                           CORBA::Boolean              HasRefPoint,
476                                           const SMESH::PointStruct &  RefPoint,
477                                           const bool                  MakeGroups,
478                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error);
479   SMESH::ListOfGroups* mirror(const SMESH::long_array &           IDsOfElements,
480                               const SMESH::AxisStruct &           Axis,
481                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
482                               CORBA::Boolean                      Copy,
483                               const bool                          MakeGroups,
484                               ::SMESH_Mesh*                       TargetMesh=0);
485   SMESH::ListOfGroups* translate(const SMESH::long_array & IDsOfElements,
486                                  const SMESH::DirStruct &  Vector,
487                                  CORBA::Boolean            Copy,
488                                  const bool                MakeGroups,
489                                  ::SMESH_Mesh*             TargetMesh=0);
490   SMESH::ListOfGroups* rotate(const SMESH::long_array & IDsOfElements,
491                               const SMESH::AxisStruct &  Axis,
492                               CORBA::Double             Angle,
493                               CORBA::Boolean            Copy,
494                               const bool                MakeGroups,
495                               ::SMESH_Mesh*             TargetMesh=0);
496
497   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
498   
499   void DumpGroupsList(SMESH::TPythonDump & theDumpPython, 
500                       const SMESH::ListOfGroups * theGroupList);
501
502 private: //!< fields
503
504   SMESH_Mesh_i*         myMesh_i;
505   SMESH_Mesh *          myMesh;
506
507   SMESH::long_array_var myLastCreatedElems;
508   SMESH::long_array_var myLastCreatedNodes;
509
510   SMESH::MeshPreviewStruct_var myPreviewData;
511   bool                         myPreviewMode;
512 };
513
514 #endif