Salome HOME
Implementation of new version ExtrusionAlongPath (20003 from Mantis).
[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
352   // skl 04.06.2009 
353   SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
354                                               SMESH::SMESH_IDSource_ptr  Path,
355                                               CORBA::Long                NodeStart,
356                                               CORBA::Boolean             HasAngles,
357                                               const SMESH::double_array& Angles,
358                                               CORBA::Boolean             LinearVariation,
359                                               CORBA::Boolean             HasRefPoint,
360                                               const SMESH::PointStruct&  RefPoint,
361                                               CORBA::Boolean             MakeGroups,
362                                               SMESH::ElementType         ElemType,
363                                               SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
364   SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
365                                            SMESH::SMESH_IDSource_ptr  Path,
366                                            CORBA::Long                NodeStart,
367                                            CORBA::Boolean             HasAngles,
368                                            const SMESH::double_array& Angles,
369                                            CORBA::Boolean             LinearVariation,
370                                            CORBA::Boolean             HasRefPoint,
371                                            const SMESH::PointStruct&  RefPoint,
372                                            CORBA::Boolean             MakeGroups,
373                                            SMESH::ElementType         ElemType,
374                                            SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
375
376   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
377                                         const SMESH::AxisStruct&            Mirror,
378                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType);
379   SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           Object,
380                                               const SMESH::AxisStruct&            Mirror,
381                                               SMESH::SMESH_MeshEditor::MirrorType MirrorType);
382   SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
383                                            const SMESH::DirStruct&  Vector);
384   SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
385                                                  const SMESH::DirStruct&   Vector);
386   SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
387                                         const SMESH::AxisStruct& Axis,
388                                         CORBA::Double            AngleInRadians);
389   SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
390                                               const SMESH::AxisStruct&  Axis,
391                                               CORBA::Double             AngleInRadians);
392
393   SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array&            IDsOfElements,
394                                        const SMESH::AxisStruct&            Mirror,
395                                        SMESH::SMESH_MeshEditor::MirrorType MirrorType,
396                                        CORBA::Boolean                      CopyGroups,
397                                        const char*                         MeshName);
398   SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           Object,
399                                              const SMESH::AxisStruct&            Mirror,
400                                              SMESH::SMESH_MeshEditor::MirrorType MirrorType,
401                                              CORBA::Boolean                      CopyGroups,
402                                              const char*                         MeshName);
403   SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
404                                           const SMESH::DirStruct&  Vector,
405                                           CORBA::Boolean           CopyGroups,
406                                           const char*              MeshName);
407   SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
408                                                 const SMESH::DirStruct&   Vector,
409                                                 CORBA::Boolean            CopyGroups,
410                                                 const char*               MeshName);
411   SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
412                                        const SMESH::AxisStruct& Axis,
413                                        CORBA::Double            AngleInRadians,
414                                        CORBA::Boolean           CopyGroups,
415                                        const char*              MeshName);
416   SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
417                                              const SMESH::AxisStruct&  Axis,
418                                              CORBA::Double             AngleInRadians,
419                                              CORBA::Boolean            CopyGroups,
420                                              const char*               MeshName);
421
422   void FindCoincidentNodes (CORBA::Double                  Tolerance,
423                             SMESH::array_of_long_array_out GroupsOfNodes);
424   void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr      Object,
425                                  CORBA::Double                  Tolerance,
426                                  SMESH::array_of_long_array_out GroupsOfNodes);
427   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
428   void FindEqualElements(SMESH::SMESH_IDSource_ptr      Object,
429                          SMESH::array_of_long_array_out GroupsOfElementsID);
430   void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
431   void MergeEqualElements();
432   CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
433                                      CORBA::Double y,
434                                      CORBA::Double z,
435                                      CORBA::Long   nodeID);
436
437
438
439   SMESH::SMESH_MeshEditor::Sew_Error
440   SewFreeBorders(CORBA::Long FirstNodeID1,
441                  CORBA::Long SecondNodeID1,
442                  CORBA::Long LastNodeID1,
443                  CORBA::Long FirstNodeID2,
444                  CORBA::Long SecondNodeID2,
445                  CORBA::Long LastNodeID2,
446                  CORBA::Boolean CreatePolygons,
447                  CORBA::Boolean CreatePolyedrs);
448   SMESH::SMESH_MeshEditor::Sew_Error
449   SewConformFreeBorders(CORBA::Long FirstNodeID1,
450                         CORBA::Long SecondNodeID1,
451                         CORBA::Long LastNodeID1,
452                         CORBA::Long FirstNodeID2,
453                         CORBA::Long SecondNodeID2);
454   SMESH::SMESH_MeshEditor::Sew_Error
455   SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
456                   CORBA::Long SecondNodeIDOnFreeBorder,
457                   CORBA::Long LastNodeIDOnFreeBorder,
458                   CORBA::Long FirstNodeIDOnSide,
459                   CORBA::Long LastNodeIDOnSide,
460                   CORBA::Boolean CreatePolygons,
461                   CORBA::Boolean CreatePolyedrs);
462   SMESH::SMESH_MeshEditor::Sew_Error
463   SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
464                   const SMESH::long_array& IDsOfSide2Elements,
465                   CORBA::Long NodeID1OfSide1ToMerge,
466                   CORBA::Long NodeID1OfSide2ToMerge,
467                   CORBA::Long NodeID2OfSide1ToMerge,
468                   CORBA::Long NodeID2OfSide2ToMerge);
469
470   /*!
471    * Set new nodes for given element.
472    * If number of nodes is not corresponded to type of
473    * element - returns false
474    */
475   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
476   
477   /*!
478    * Return data of mesh edition preview
479    */
480   SMESH::MeshPreviewStruct* GetPreviewData();
481
482   /*!
483    * If during last operation of MeshEditor some nodes were
484    * created this method returns list of it's IDs, if new nodes
485    * not creared - returns empty list
486    */
487   SMESH::long_array* GetLastCreatedNodes();
488
489   /*!
490    * If during last operation of MeshEditor some elements were
491    * created this method returns list of it's IDs, if new elements
492    * not creared - returns empty list
493    */
494   SMESH::long_array* GetLastCreatedElems();
495
496   /*!
497    * \brief Return edited mesh ID
498     * \retval int - mesh ID
499    */
500   int GetMeshId() const { return myMesh->GetId(); }
501   
502   CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
503                               const SMESH::long_array& theModifiedElems );
504
505   CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
506                              const SMESH::long_array& theModifiedElems );
507
508   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
509                                   SMESH::SMESH_GroupBase_ptr theModifiedElems );
510
511   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
512                                    const SMESH::ListOfGroups& theModifiedElems);
513
514 private: //!< private methods
515
516   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
517
518   /*!
519    * \brief Update myLastCreated* or myPreviewData
520     * \param anEditor - it contains edition results
521    */
522   void storeResult(::SMESH_MeshEditor& anEditor);
523   /*!
524    * \brief Clear myLastCreated* or myPreviewData
525    */
526   void initData();
527
528   /*!
529    * \brief Return groups by their IDs
530    */
531   SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
532
533   SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
534                                      const SMESH::AxisStruct & Axis,
535                                      CORBA::Double             AngleInRadians,
536                                      CORBA::Long               NbOfSteps,
537                                      CORBA::Double             Tolerance,
538                                      const bool                MakeGroups,
539                                      const SMDSAbs_ElementType ElementType=SMDSAbs_All);
540   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
541                                       const SMESH::DirStruct &  StepVector,
542                                       CORBA::Long               NbOfSteps,
543                                       const bool                MakeGroups,
544                                       const SMDSAbs_ElementType ElementType=SMDSAbs_All);
545   SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
546                                          const SMESH::DirStruct &  theStepVector,
547                                          CORBA::Long               theNbOfSteps,
548                                          CORBA::Long               theExtrFlags,
549                                          CORBA::Double             theSewTolerance,
550                                          const bool                MakeGroups);
551   SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array &   IDsOfElements,
552                                           SMESH::SMESH_Mesh_ptr       PathMesh,
553                                           GEOM::GEOM_Object_ptr       PathShape,
554                                           CORBA::Long                 NodeStart,
555                                           CORBA::Boolean              HasAngles,
556                                           const SMESH::double_array & Angles,
557                                           CORBA::Boolean              HasRefPoint,
558                                           const SMESH::PointStruct &  RefPoint,
559                                           const bool                  MakeGroups,
560                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
561                                           const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
562   SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array &  IDsOfElements,
563                                            SMESH::SMESH_IDSource_ptr  Path,
564                                            CORBA::Long                NodeStart,
565                                            CORBA::Boolean             HasAngles,
566                                            const SMESH::double_array& Angles,
567                                            CORBA::Boolean             LinearVariation,
568                                            CORBA::Boolean             HasRefPoint,
569                                            const SMESH::PointStruct&  RefPoint,
570                                            const bool                 MakeGroups,
571                                            const SMDSAbs_ElementType  ElementType,
572                                            SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
573   SMESH::ListOfGroups* mirror(const SMESH::long_array &           IDsOfElements,
574                               const SMESH::AxisStruct &           Axis,
575                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
576                               CORBA::Boolean                      Copy,
577                               const bool                          MakeGroups,
578                               ::SMESH_Mesh*                       TargetMesh=0);
579   SMESH::ListOfGroups* translate(const SMESH::long_array & IDsOfElements,
580                                  const SMESH::DirStruct &  Vector,
581                                  CORBA::Boolean            Copy,
582                                  const bool                MakeGroups,
583                                  ::SMESH_Mesh*             TargetMesh=0);
584   SMESH::ListOfGroups* rotate(const SMESH::long_array & IDsOfElements,
585                               const SMESH::AxisStruct &  Axis,
586                               CORBA::Double             Angle,
587                               CORBA::Boolean            Copy,
588                               const bool                MakeGroups,
589                               ::SMESH_Mesh*             TargetMesh=0);
590
591   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
592   
593   void DumpGroupsList(SMESH::TPythonDump & theDumpPython, 
594                       const SMESH::ListOfGroups * theGroupList);
595
596 private: //!< fields
597
598   SMESH_Mesh_i*         myMesh_i;
599   SMESH_Mesh *          myMesh;
600
601   SMESH::long_array_var myLastCreatedElems;
602   SMESH::long_array_var myLastCreatedNodes;
603
604   SMESH::MeshPreviewStruct_var myPreviewData;
605   bool                         myPreviewMode;
606 };
607
608 #endif