Salome HOME
Merge from BR_V5_DEV 16Feb09
[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   void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
185                              const SMESH::AxisStruct & Axis,
186                              CORBA::Double             AngleInRadians,
187                              CORBA::Long               NbOfSteps,
188                              CORBA::Double             Tolerance);
189   void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
190                              const SMESH::AxisStruct & Axis,
191                              CORBA::Double             AngleInRadians,
192                              CORBA::Long               NbOfSteps,
193                              CORBA::Double             Tolerance);
194
195   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
196                       const SMESH::DirStruct &  StepVector,
197                       CORBA::Long               NbOfSteps);
198   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
199                             const SMESH::DirStruct &  StepVector,
200                             CORBA::Long               NbOfSteps);
201   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
202                               const SMESH::DirStruct &  StepVector,
203                               CORBA::Long               NbOfSteps);
204   void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
205                               const SMESH::DirStruct &  StepVector,
206                               CORBA::Long               NbOfSteps);
207   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
208                          const SMESH::DirStruct &  theStepVector,
209                          CORBA::Long               theNbOfSteps,
210                          CORBA::Long               theExtrFlags,
211                          CORBA::Double             theSewTolerance);
212
213   SMESH::SMESH_MeshEditor::Extrusion_Error
214     ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
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::SMESH_MeshEditor::Extrusion_Error
224     ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
225                              SMESH::SMESH_Mesh_ptr       PathMesh,
226                              GEOM::GEOM_Object_ptr       PathShape,
227                              CORBA::Long                 NodeStart,
228                              CORBA::Boolean              HasAngles,
229                              const SMESH::double_array & Angles,
230                              CORBA::Boolean              HasRefPoint,
231                              const SMESH::PointStruct &  RefPoint);
232   SMESH::SMESH_MeshEditor::Extrusion_Error
233     ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
234                                SMESH::SMESH_Mesh_ptr       PathMesh,
235                                GEOM::GEOM_Object_ptr       PathShape,
236                                CORBA::Long                 NodeStart,
237                                CORBA::Boolean              HasAngles,
238                                const SMESH::double_array & Angles,
239                                CORBA::Boolean              HasRefPoint,
240                                const SMESH::PointStruct &  RefPoint);
241   SMESH::SMESH_MeshEditor::Extrusion_Error
242     ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
243                                SMESH::SMESH_Mesh_ptr       PathMesh,
244                                GEOM::GEOM_Object_ptr       PathShape,
245                                CORBA::Long                 NodeStart,
246                                CORBA::Boolean              HasAngles,
247                                const SMESH::double_array & Angles,
248                                CORBA::Boolean              HasRefPoint,
249                                const SMESH::PointStruct &  RefPoint);
250
251   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
252                                              GEOM::GEOM_Object_ptr       PathShape,
253                                              const SMESH::double_array & Angles);
254
255   void Mirror(const SMESH::long_array &           IDsOfElements,
256               const SMESH::AxisStruct &           Axis,
257               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
258               CORBA::Boolean                      Copy);
259   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
260                     const SMESH::AxisStruct &           Axis,
261                     SMESH::SMESH_MeshEditor::MirrorType MirrorType,
262                     CORBA::Boolean                      Copy);
263   void Translate(const SMESH::long_array & IDsOfElements,
264                  const SMESH::DirStruct &   Vector,
265                  CORBA::Boolean            Copy);
266   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
267                        const SMESH::DirStruct &   Vector,
268                        CORBA::Boolean             Copy);
269   void Rotate(const SMESH::long_array & IDsOfElements,
270               const SMESH::AxisStruct &  Axis,
271               CORBA::Double             Angle,
272               CORBA::Boolean            Copy);
273   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
274                     const SMESH::AxisStruct &  Axis,
275                     CORBA::Double              Angle,
276                     CORBA::Boolean             Copy);
277
278   SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
279                                                const SMESH::AxisStruct& Axix,
280                                                CORBA::Double            AngleInRadians,
281                                                CORBA::Long              NbOfSteps,
282                                                CORBA::Double            Tolerance);
283   SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
284                                                      const SMESH::AxisStruct&  Axix,
285                                                      CORBA::Double             AngleInRadians,
286                                                      CORBA::Long               NbOfSteps,
287                                                      CORBA::Double             Tolerance);
288   SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
289                                                        const SMESH::AxisStruct&  Axix,
290                                                        CORBA::Double             AngleInRadians,
291                                                        CORBA::Long               NbOfSteps,
292                                                        CORBA::Double             Tolerance);
293   SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
294                                                        const SMESH::AxisStruct&  Axix,
295                                                        CORBA::Double             AngleInRadians,
296                                                        CORBA::Long               NbOfSteps,
297                                                        CORBA::Double             Tolerance);
298   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
299                                                 const SMESH::DirStruct&  StepVector,
300                                                 CORBA::Long              NbOfSteps);
301   SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
302                                                    const SMESH::DirStruct&  StepVector,
303                                                    CORBA::Long              NbOfSteps,
304                                                    CORBA::Long              ExtrFlags,
305                                                    CORBA::Double            SewTolerance);
306   SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
307                                                       const SMESH::DirStruct&   StepVector,
308                                                       CORBA::Long               NbOfSteps);
309   SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
310                                                         const SMESH::DirStruct&   StepVector,
311                                                         CORBA::Long               NbOfSteps);
312   SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
313                                                         const SMESH::DirStruct&   StepVector,
314                                                         CORBA::Long               NbOfSteps);
315   SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array&   IDsOfElements,
316                                                     SMESH::SMESH_Mesh_ptr      PathMesh,
317                                                     GEOM::GEOM_Object_ptr      PathShape,
318                                                     CORBA::Long                NodeStart,
319                                                     CORBA::Boolean             HasAngles,
320                                                     const SMESH::double_array& Angles,
321                                                     CORBA::Boolean             HasRefPoint,
322                                                     const SMESH::PointStruct&  RefPoint,
323                                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
324   SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
325                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
326                                                           GEOM::GEOM_Object_ptr      PathShape,
327                                                           CORBA::Long                NodeStart,
328                                                           CORBA::Boolean             HasAngles,
329                                                           const SMESH::double_array& Angles,
330                                                           CORBA::Boolean             HasRefPoint,
331                                                           const SMESH::PointStruct&  RefPoint,
332                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
333   SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
334                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
335                                                             GEOM::GEOM_Object_ptr      PathShape,
336                                                             CORBA::Long                NodeStart,
337                                                             CORBA::Boolean             HasAngles,
338                                                             const SMESH::double_array& Angles,
339                                                             CORBA::Boolean             HasRefPoint,
340                                                             const SMESH::PointStruct&  RefPoint,
341                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
342   SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
343                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
344                                                             GEOM::GEOM_Object_ptr      PathShape,
345                                                             CORBA::Long                NodeStart,
346                                                             CORBA::Boolean             HasAngles,
347                                                             const SMESH::double_array& Angles,
348                                                             CORBA::Boolean             HasRefPoint,
349                                                             const SMESH::PointStruct&  RefPoint,
350                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
351   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
352                                         const SMESH::AxisStruct&            Mirror,
353                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType);
354   SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           Object,
355                                               const SMESH::AxisStruct&            Mirror,
356                                               SMESH::SMESH_MeshEditor::MirrorType MirrorType);
357   SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
358                                            const SMESH::DirStruct&  Vector);
359   SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
360                                                  const SMESH::DirStruct&   Vector);
361   SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
362                                         const SMESH::AxisStruct& Axis,
363                                         CORBA::Double            AngleInRadians);
364   SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
365                                               const SMESH::AxisStruct&  Axis,
366                                               CORBA::Double             AngleInRadians);
367
368   SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array&            IDsOfElements,
369                                        const SMESH::AxisStruct&            Mirror,
370                                        SMESH::SMESH_MeshEditor::MirrorType MirrorType,
371                                        CORBA::Boolean                      CopyGroups,
372                                        const char*                         MeshName);
373   SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           Object,
374                                              const SMESH::AxisStruct&            Mirror,
375                                              SMESH::SMESH_MeshEditor::MirrorType MirrorType,
376                                              CORBA::Boolean                      CopyGroups,
377                                              const char*                         MeshName);
378   SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
379                                           const SMESH::DirStruct&  Vector,
380                                           CORBA::Boolean           CopyGroups,
381                                           const char*              MeshName);
382   SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
383                                                 const SMESH::DirStruct&   Vector,
384                                                 CORBA::Boolean            CopyGroups,
385                                                 const char*               MeshName);
386   SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
387                                        const SMESH::AxisStruct& Axis,
388                                        CORBA::Double            AngleInRadians,
389                                        CORBA::Boolean           CopyGroups,
390                                        const char*              MeshName);
391   SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
392                                              const SMESH::AxisStruct&  Axis,
393                                              CORBA::Double             AngleInRadians,
394                                              CORBA::Boolean            CopyGroups,
395                                              const char*               MeshName);
396
397   void FindCoincidentNodes (CORBA::Double                  Tolerance,
398                             SMESH::array_of_long_array_out GroupsOfNodes);
399   void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr      Object,
400                                  CORBA::Double                  Tolerance,
401                                  SMESH::array_of_long_array_out GroupsOfNodes);
402   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
403   void FindEqualElements(SMESH::SMESH_IDSource_ptr      Object,
404                          SMESH::array_of_long_array_out GroupsOfElementsID);
405   void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
406   void MergeEqualElements();
407   CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
408                                      CORBA::Double y,
409                                      CORBA::Double z,
410                                      CORBA::Long   nodeID);
411
412
413
414   SMESH::SMESH_MeshEditor::Sew_Error
415   SewFreeBorders(CORBA::Long FirstNodeID1,
416                  CORBA::Long SecondNodeID1,
417                  CORBA::Long LastNodeID1,
418                  CORBA::Long FirstNodeID2,
419                  CORBA::Long SecondNodeID2,
420                  CORBA::Long LastNodeID2,
421                  CORBA::Boolean CreatePolygons,
422                  CORBA::Boolean CreatePolyedrs);
423   SMESH::SMESH_MeshEditor::Sew_Error
424   SewConformFreeBorders(CORBA::Long FirstNodeID1,
425                         CORBA::Long SecondNodeID1,
426                         CORBA::Long LastNodeID1,
427                         CORBA::Long FirstNodeID2,
428                         CORBA::Long SecondNodeID2);
429   SMESH::SMESH_MeshEditor::Sew_Error
430   SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
431                   CORBA::Long SecondNodeIDOnFreeBorder,
432                   CORBA::Long LastNodeIDOnFreeBorder,
433                   CORBA::Long FirstNodeIDOnSide,
434                   CORBA::Long LastNodeIDOnSide,
435                   CORBA::Boolean CreatePolygons,
436                   CORBA::Boolean CreatePolyedrs);
437   SMESH::SMESH_MeshEditor::Sew_Error
438   SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
439                   const SMESH::long_array& IDsOfSide2Elements,
440                   CORBA::Long NodeID1OfSide1ToMerge,
441                   CORBA::Long NodeID1OfSide2ToMerge,
442                   CORBA::Long NodeID2OfSide1ToMerge,
443                   CORBA::Long NodeID2OfSide2ToMerge);
444
445   /*!
446    * Set new nodes for given element.
447    * If number of nodes is not corresponded to type of
448    * element - returns false
449    */
450   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
451   
452   /*!
453    * Return data of mesh edition preview
454    */
455   SMESH::MeshPreviewStruct* GetPreviewData();
456
457   /*!
458    * If during last operation of MeshEditor some nodes were
459    * created this method returns list of it's IDs, if new nodes
460    * not creared - returns empty list
461    */
462   SMESH::long_array* GetLastCreatedNodes();
463
464   /*!
465    * If during last operation of MeshEditor some elements were
466    * created this method returns list of it's IDs, if new elements
467    * not creared - returns empty list
468    */
469   SMESH::long_array* GetLastCreatedElems();
470
471   /*!
472    * \brief Return edited mesh ID
473     * \retval int - mesh ID
474    */
475   int GetMeshId() const { return myMesh->GetId(); }
476   
477   CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
478                               const SMESH::long_array& theModifiedElems );
479
480   CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
481                              const SMESH::long_array& theModifiedElems );
482
483   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
484                                   SMESH::SMESH_GroupBase_ptr theModifiedElems );
485
486   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
487                                    const SMESH::ListOfGroups& theModifiedElems);
488
489 private: //!< private methods
490
491   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
492
493   /*!
494    * \brief Update myLastCreated* or myPreviewData
495     * \param anEditor - it contains edition results
496    */
497   void storeResult(::SMESH_MeshEditor& anEditor);
498   /*!
499    * \brief Clear myLastCreated* or myPreviewData
500    */
501   void initData();
502
503   /*!
504    * \brief Return groups by their IDs
505    */
506   SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
507
508   SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
509                                      const SMESH::AxisStruct & Axis,
510                                      CORBA::Double             AngleInRadians,
511                                      CORBA::Long               NbOfSteps,
512                                      CORBA::Double             Tolerance,
513                                      const bool                MakeGroups,
514                                      const SMDSAbs_ElementType ElementType=SMDSAbs_All);
515   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
516                                       const SMESH::DirStruct &  StepVector,
517                                       CORBA::Long               NbOfSteps,
518                                       const bool                MakeGroups,
519                                       const SMDSAbs_ElementType ElementType=SMDSAbs_All);
520   SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
521                                          const SMESH::DirStruct &  theStepVector,
522                                          CORBA::Long               theNbOfSteps,
523                                          CORBA::Long               theExtrFlags,
524                                          CORBA::Double             theSewTolerance,
525                                          const bool                MakeGroups);
526   SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array &   IDsOfElements,
527                                           SMESH::SMESH_Mesh_ptr       PathMesh,
528                                           GEOM::GEOM_Object_ptr       PathShape,
529                                           CORBA::Long                 NodeStart,
530                                           CORBA::Boolean              HasAngles,
531                                           const SMESH::double_array & Angles,
532                                           CORBA::Boolean              HasRefPoint,
533                                           const SMESH::PointStruct &  RefPoint,
534                                           const bool                  MakeGroups,
535                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
536                                           const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
537   SMESH::ListOfGroups* mirror(const SMESH::long_array &           IDsOfElements,
538                               const SMESH::AxisStruct &           Axis,
539                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
540                               CORBA::Boolean                      Copy,
541                               const bool                          MakeGroups,
542                               ::SMESH_Mesh*                       TargetMesh=0);
543   SMESH::ListOfGroups* translate(const SMESH::long_array & IDsOfElements,
544                                  const SMESH::DirStruct &  Vector,
545                                  CORBA::Boolean            Copy,
546                                  const bool                MakeGroups,
547                                  ::SMESH_Mesh*             TargetMesh=0);
548   SMESH::ListOfGroups* rotate(const SMESH::long_array & IDsOfElements,
549                               const SMESH::AxisStruct &  Axis,
550                               CORBA::Double             Angle,
551                               CORBA::Boolean            Copy,
552                               const bool                MakeGroups,
553                               ::SMESH_Mesh*             TargetMesh=0);
554
555   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
556   
557   void DumpGroupsList(SMESH::TPythonDump & theDumpPython, 
558                       const SMESH::ListOfGroups * theGroupList);
559
560 private: //!< fields
561
562   SMESH_Mesh_i*         myMesh_i;
563   SMESH_Mesh *          myMesh;
564
565   SMESH::long_array_var myLastCreatedElems;
566   SMESH::long_array_var myLastCreatedNodes;
567
568   SMESH::MeshPreviewStruct_var myPreviewData;
569   bool                         myPreviewMode;
570 };
571
572 #endif