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