Salome HOME
PR: merged from V5_1_4rc1
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.hxx
1 //  Copyright (C) 2007-2010  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
23 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
24 //  File   : SMESH_MeshEditor_i.hxx
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //
28 #ifndef _SMESH_MESHEDITOR_I_HXX_
29 #define _SMESH_MESHEDIOTR_I_HXX_
30
31 #include "SMESH.hxx"
32
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
35
36 #include "SMESH_Mesh.hxx"
37 #include "SMESH_PythonDump.hxx"
38 #include <list>
39
40 class SMESH_MeshEditor;
41 class SMESH_Mesh_i;
42
43 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
44 {
45 public:
46   SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
47
48   virtual ~ SMESH_MeshEditor_i();
49
50   // --- CORBA
51
52   /*!
53    * \brief Wrap a sequence of ids in a SMESH_IDSource
54    */
55   SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements);
56
57   CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
58   CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
59
60   /*!
61    * Methods for creation new elements.
62    * Returns ID of created element or 0 if element not created
63    */
64   CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
65   CORBA::Long Add0DElement(CORBA::Long IDOfNode);
66   CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
67   CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
68   CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
69   CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
70   CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
71                                   const SMESH::long_array & Quantities);
72   CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
73
74   /*!
75    * \brief Bind a node to a vertex
76    * \param NodeID - node ID
77    * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
78    */
79   void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
80     throw (SALOME::SALOME_Exception);
81   /*!
82    * \brief Store node position on an edge
83    * \param NodeID - node ID
84    * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
85    * \param paramOnEdge - parameter on edge where the node is located
86    */
87   void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
88                      CORBA::Double paramOnEdge)
89     throw (SALOME::SALOME_Exception);
90   /*!
91    * \brief Store node position on a face
92    * \param NodeID - node ID
93    * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
94    * \param u - U parameter on face where the node is located
95    * \param v - V parameter on face where the node is located
96    */
97   void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
98                      CORBA::Double u, CORBA::Double v)
99     throw (SALOME::SALOME_Exception);
100   /*!
101    * \brief Bind a node to a solid
102    * \param NodeID - node ID
103    * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
104    */
105   void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
106     throw (SALOME::SALOME_Exception);
107   /*!
108    * \brief Bind an element to a shape
109    * \param ElementID - element ID
110    * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
111    */
112   void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
113     throw (SALOME::SALOME_Exception);
114
115
116   CORBA::Boolean MoveNode(CORBA::Long NodeID,
117                           CORBA::Double x, CORBA::Double y, CORBA::Double z);
118
119   CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
120   CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
121   CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
122   CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
123
124   // Split/Join faces
125   CORBA::Boolean TriToQuad       (const SMESH::long_array &   IDsOfElements,
126                                   SMESH::NumericalFunctor_ptr Criterion,
127                                   CORBA::Double               MaxAngle);
128   CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
129                                   SMESH::NumericalFunctor_ptr Criterion,
130                                   CORBA::Double               MaxAngle);
131   CORBA::Boolean QuadToTri       (const SMESH::long_array &   IDsOfElements,
132                                   SMESH::NumericalFunctor_ptr Criterion);
133   CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr   theObject,
134                                   SMESH::NumericalFunctor_ptr Criterion);
135   CORBA::Boolean SplitQuad       (const SMESH::long_array &   IDsOfElements,
136                                   CORBA::Boolean              Diag13);
137   CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
138                                   CORBA::Boolean              Diag13);
139   CORBA::Long    BestSplit       (CORBA::Long                 IDOfQuad,
140                                   SMESH::NumericalFunctor_ptr Criterion);
141   void SplitVolumesIntoTetra     (SMESH::SMESH_IDSource_ptr elems,
142                                   CORBA::Short methodFlags) throw (SALOME::SALOME_Exception);
143
144   CORBA::Boolean Smooth(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 SmoothObject(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 SmoothParametric(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   CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
160                                         const SMESH::long_array &              IDsOfFixedNodes,
161                                         CORBA::Long                            MaxNbOfIterations,
162                                         CORBA::Double                          MaxAspectRatio,
163                                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
164   CORBA::Boolean smooth(const SMESH::long_array &              IDsOfElements,
165                         const SMESH::long_array &              IDsOfFixedNodes,
166                         CORBA::Long                            MaxNbOfIterations,
167                         CORBA::Double                          MaxAspectRatio,
168                         SMESH::SMESH_MeshEditor::Smooth_Method Method,
169                         bool                                   IsParametric);
170   CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr              theObject,
171                               const SMESH::long_array &              IDsOfFixedNodes,
172                               CORBA::Long                            MaxNbOfIterations,
173                               CORBA::Double                          MaxAspectRatio,
174                               SMESH::SMESH_MeshEditor::Smooth_Method Method,
175                               bool                                   IsParametric);
176
177
178   void ConvertToQuadratic(CORBA::Boolean Force3d);
179   CORBA::Boolean ConvertFromQuadratic();
180
181   void RenumberNodes();
182   void RenumberElements();
183
184   void RotationSweep(const SMESH::long_array & IDsOfElements,
185                      const SMESH::AxisStruct & Axis,
186                      CORBA::Double             AngleInRadians,
187                      CORBA::Long               NbOfSteps,
188                      CORBA::Double             Tolerance);
189   void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
190                            const SMESH::AxisStruct & Axis,
191                            CORBA::Double             AngleInRadians,
192                            CORBA::Long               NbOfSteps,
193                            CORBA::Double             Tolerance);
194   void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
195                              const SMESH::AxisStruct & Axis,
196                              CORBA::Double             AngleInRadians,
197                              CORBA::Long               NbOfSteps,
198                              CORBA::Double             Tolerance);
199   void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
200                              const SMESH::AxisStruct & Axis,
201                              CORBA::Double             AngleInRadians,
202                              CORBA::Long               NbOfSteps,
203                              CORBA::Double             Tolerance);
204
205   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
206                       const SMESH::DirStruct &  StepVector,
207                       CORBA::Long               NbOfSteps);
208   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
209                             const SMESH::DirStruct &  StepVector,
210                             CORBA::Long               NbOfSteps);
211   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
212                               const SMESH::DirStruct &  StepVector,
213                               CORBA::Long               NbOfSteps);
214   void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
215                               const SMESH::DirStruct &  StepVector,
216                               CORBA::Long               NbOfSteps);
217   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
218                          const SMESH::DirStruct &  theStepVector,
219                          CORBA::Long               theNbOfSteps,
220                          CORBA::Long               theExtrFlags,
221                          CORBA::Double             theSewTolerance);
222
223   SMESH::SMESH_MeshEditor::Extrusion_Error
224   ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
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
233   SMESH::SMESH_MeshEditor::Extrusion_Error
234   ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
235                            SMESH::SMESH_Mesh_ptr       PathMesh,
236                            GEOM::GEOM_Object_ptr       PathShape,
237                            CORBA::Long                 NodeStart,
238                            CORBA::Boolean              HasAngles,
239                            const SMESH::double_array & Angles,
240                            CORBA::Boolean              HasRefPoint,
241                            const SMESH::PointStruct &  RefPoint);
242   SMESH::SMESH_MeshEditor::Extrusion_Error
243   ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
244                              SMESH::SMESH_Mesh_ptr       PathMesh,
245                              GEOM::GEOM_Object_ptr       PathShape,
246                              CORBA::Long                 NodeStart,
247                              CORBA::Boolean              HasAngles,
248                              const SMESH::double_array & Angles,
249                              CORBA::Boolean              HasRefPoint,
250                              const SMESH::PointStruct &  RefPoint);
251   SMESH::SMESH_MeshEditor::Extrusion_Error
252   ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
253                              SMESH::SMESH_Mesh_ptr       PathMesh,
254                              GEOM::GEOM_Object_ptr       PathShape,
255                              CORBA::Long                 NodeStart,
256                              CORBA::Boolean              HasAngles,
257                              const SMESH::double_array & Angles,
258                              CORBA::Boolean              HasRefPoint,
259                              const SMESH::PointStruct &  RefPoint);
260
261   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
262                                              GEOM::GEOM_Object_ptr       PathShape,
263                                              const SMESH::double_array & Angles);
264
265   void Mirror(const SMESH::long_array &           IDsOfElements,
266               const SMESH::AxisStruct &           Axis,
267               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
268               CORBA::Boolean                      Copy);
269   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
270                     const SMESH::AxisStruct &           Axis,
271                     SMESH::SMESH_MeshEditor::MirrorType MirrorType,
272                     CORBA::Boolean                      Copy);
273   void Translate(const SMESH::long_array & IDsOfElements,
274                  const SMESH::DirStruct &   Vector,
275                  CORBA::Boolean            Copy);
276   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
277                        const SMESH::DirStruct &   Vector,
278                        CORBA::Boolean             Copy);
279   void Rotate(const SMESH::long_array & IDsOfElements,
280               const SMESH::AxisStruct &  Axis,
281               CORBA::Double             Angle,
282               CORBA::Boolean            Copy);
283   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
284                     const SMESH::AxisStruct &  Axis,
285                     CORBA::Double              Angle,
286                     CORBA::Boolean             Copy);
287
288   SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
289                                                const SMESH::AxisStruct& Axix,
290                                                CORBA::Double            AngleInRadians,
291                                                CORBA::Long              NbOfSteps,
292                                                CORBA::Double            Tolerance);
293   SMESH::ListOfGroups* RotationSweepObjectMakeGroups(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* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
299                                                        const SMESH::AxisStruct&  Axix,
300                                                        CORBA::Double             AngleInRadians,
301                                                        CORBA::Long               NbOfSteps,
302                                                        CORBA::Double             Tolerance);
303   SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
304                                                        const SMESH::AxisStruct&  Axix,
305                                                        CORBA::Double             AngleInRadians,
306                                                        CORBA::Long               NbOfSteps,
307                                                        CORBA::Double             Tolerance);
308   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
309                                                 const SMESH::DirStruct&  StepVector,
310                                                 CORBA::Long              NbOfSteps);
311   SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
312                                                    const SMESH::DirStruct&  StepVector,
313                                                    CORBA::Long              NbOfSteps,
314                                                    CORBA::Long              ExtrFlags,
315                                                    CORBA::Double            SewTolerance);
316   SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
317                                                       const SMESH::DirStruct&   StepVector,
318                                                       CORBA::Long               NbOfSteps);
319   SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
320                                                         const SMESH::DirStruct&   StepVector,
321                                                         CORBA::Long               NbOfSteps);
322   SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
323                                                         const SMESH::DirStruct&   StepVector,
324                                                         CORBA::Long               NbOfSteps);
325   SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array&   IDsOfElements,
326                                                     SMESH::SMESH_Mesh_ptr      PathMesh,
327                                                     GEOM::GEOM_Object_ptr      PathShape,
328                                                     CORBA::Long                NodeStart,
329                                                     CORBA::Boolean             HasAngles,
330                                                     const SMESH::double_array& Angles,
331                                                     CORBA::Boolean             HasRefPoint,
332                                                     const SMESH::PointStruct&  RefPoint,
333                                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
334   SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
335                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
336                                                           GEOM::GEOM_Object_ptr      PathShape,
337                                                           CORBA::Long                NodeStart,
338                                                           CORBA::Boolean             HasAngles,
339                                                           const SMESH::double_array& Angles,
340                                                           CORBA::Boolean             HasRefPoint,
341                                                           const SMESH::PointStruct&  RefPoint,
342                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
343   SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
344                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
345                                                             GEOM::GEOM_Object_ptr      PathShape,
346                                                             CORBA::Long                NodeStart,
347                                                             CORBA::Boolean             HasAngles,
348                                                             const SMESH::double_array& Angles,
349                                                             CORBA::Boolean             HasRefPoint,
350                                                             const SMESH::PointStruct&  RefPoint,
351                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
352   SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
353                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
354                                                             GEOM::GEOM_Object_ptr      PathShape,
355                                                             CORBA::Long                NodeStart,
356                                                             CORBA::Boolean             HasAngles,
357                                                             const SMESH::double_array& Angles,
358                                                             CORBA::Boolean             HasRefPoint,
359                                                             const SMESH::PointStruct&  RefPoint,
360                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
361
362   // skl 04.06.2009 
363   SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
364                                               SMESH::SMESH_IDSource_ptr  Path,
365                                               CORBA::Long                NodeStart,
366                                               CORBA::Boolean             HasAngles,
367                                               const SMESH::double_array& Angles,
368                                               CORBA::Boolean             LinearVariation,
369                                               CORBA::Boolean             HasRefPoint,
370                                               const SMESH::PointStruct&  RefPoint,
371                                               CORBA::Boolean             MakeGroups,
372                                               SMESH::ElementType         ElemType,
373                                               SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
374   SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
375                                            SMESH::SMESH_IDSource_ptr  Path,
376                                            CORBA::Long                NodeStart,
377                                            CORBA::Boolean             HasAngles,
378                                            const SMESH::double_array& Angles,
379                                            CORBA::Boolean             LinearVariation,
380                                            CORBA::Boolean             HasRefPoint,
381                                            const SMESH::PointStruct&  RefPoint,
382                                            CORBA::Boolean             MakeGroups,
383                                            SMESH::ElementType         ElemType,
384                                            SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
385
386   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
387                                         const SMESH::AxisStruct&            Mirror,
388                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType);
389   SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           Object,
390                                               const SMESH::AxisStruct&            Mirror,
391                                               SMESH::SMESH_MeshEditor::MirrorType MirrorType);
392   SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
393                                            const SMESH::DirStruct&  Vector);
394   SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
395                                                  const SMESH::DirStruct&   Vector);
396   SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
397                                         const SMESH::AxisStruct& Axis,
398                                         CORBA::Double            AngleInRadians);
399   SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
400                                               const SMESH::AxisStruct&  Axis,
401                                               CORBA::Double             AngleInRadians);
402
403   SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array&            IDsOfElements,
404                                        const SMESH::AxisStruct&            Mirror,
405                                        SMESH::SMESH_MeshEditor::MirrorType MirrorType,
406                                        CORBA::Boolean                      CopyGroups,
407                                        const char*                         MeshName);
408   SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           Object,
409                                              const SMESH::AxisStruct&            Mirror,
410                                              SMESH::SMESH_MeshEditor::MirrorType MirrorType,
411                                              CORBA::Boolean                      CopyGroups,
412                                              const char*                         MeshName);
413   SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
414                                           const SMESH::DirStruct&  Vector,
415                                           CORBA::Boolean           CopyGroups,
416                                           const char*              MeshName);
417   SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
418                                                 const SMESH::DirStruct&   Vector,
419                                                 CORBA::Boolean            CopyGroups,
420                                                 const char*               MeshName);
421   SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
422                                        const SMESH::AxisStruct& Axis,
423                                        CORBA::Double            AngleInRadians,
424                                        CORBA::Boolean           CopyGroups,
425                                        const char*              MeshName);
426   SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
427                                              const SMESH::AxisStruct&  Axis,
428                                              CORBA::Double             AngleInRadians,
429                                              CORBA::Boolean            CopyGroups,
430                                              const char*               MeshName);
431
432   void Scale(SMESH::SMESH_IDSource_ptr  theObject,
433              const SMESH::PointStruct&  thePoint,
434              const SMESH::double_array& theScaleFact,
435              CORBA::Boolean             theCopy);
436
437   SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
438                                        const SMESH::PointStruct&  thePoint,
439                                        const SMESH::double_array& theScaleFact);
440
441   SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
442                                       const SMESH::PointStruct& Point,
443                                       const SMESH::double_array& theScaleFact,
444                                       CORBA::Boolean            CopyGroups,
445                                       const char*               MeshName);
446
447   void FindCoincidentNodes (CORBA::Double                  Tolerance,
448                             SMESH::array_of_long_array_out GroupsOfNodes);
449   void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr      Object,
450                                  CORBA::Double                  Tolerance,
451                                  SMESH::array_of_long_array_out GroupsOfNodes);
452   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
453   void FindEqualElements(SMESH::SMESH_IDSource_ptr      Object,
454                          SMESH::array_of_long_array_out GroupsOfElementsID);
455   void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
456   void MergeEqualElements();
457   CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
458                                      CORBA::Double y,
459                                      CORBA::Double z,
460                                      CORBA::Long   nodeID);
461   /*!
462    * \brief Return ID of node closest to a given point
463    */
464   CORBA::Long FindNodeClosestTo(CORBA::Double x,
465                                 CORBA::Double y,
466                                 CORBA::Double z);
467   /*!
468    * Return elements of given type where the given point is IN or ON.
469    * 'ALL' type means elements of any type excluding nodes
470    */
471   SMESH::long_array* FindElementsByPoint(CORBA::Double      x,
472                                          CORBA::Double      y,
473                                          CORBA::Double      z,
474                                          SMESH::ElementType type);
475
476   /*!
477    * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
478    * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
479    */
480   CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z);
481
482   SMESH::SMESH_MeshEditor::Sew_Error
483   SewFreeBorders(CORBA::Long FirstNodeID1,
484                  CORBA::Long SecondNodeID1,
485                  CORBA::Long LastNodeID1,
486                  CORBA::Long FirstNodeID2,
487                  CORBA::Long SecondNodeID2,
488                  CORBA::Long LastNodeID2,
489                  CORBA::Boolean CreatePolygons,
490                  CORBA::Boolean CreatePolyedrs);
491   SMESH::SMESH_MeshEditor::Sew_Error
492   SewConformFreeBorders(CORBA::Long FirstNodeID1,
493                         CORBA::Long SecondNodeID1,
494                         CORBA::Long LastNodeID1,
495                         CORBA::Long FirstNodeID2,
496                         CORBA::Long SecondNodeID2);
497   SMESH::SMESH_MeshEditor::Sew_Error
498   SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
499                   CORBA::Long SecondNodeIDOnFreeBorder,
500                   CORBA::Long LastNodeIDOnFreeBorder,
501                   CORBA::Long FirstNodeIDOnSide,
502                   CORBA::Long LastNodeIDOnSide,
503                   CORBA::Boolean CreatePolygons,
504                   CORBA::Boolean CreatePolyedrs);
505   SMESH::SMESH_MeshEditor::Sew_Error
506   SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
507                   const SMESH::long_array& IDsOfSide2Elements,
508                   CORBA::Long NodeID1OfSide1ToMerge,
509                   CORBA::Long NodeID1OfSide2ToMerge,
510                   CORBA::Long NodeID2OfSide1ToMerge,
511                   CORBA::Long NodeID2OfSide2ToMerge);
512
513   /*!
514    * Set new nodes for given element.
515    * If number of nodes is not corresponded to type of
516    * element - returns false
517    */
518   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
519
520   /*!
521    * Return data of mesh edition preview
522    */
523   SMESH::MeshPreviewStruct* GetPreviewData();
524
525   /*!
526    * If during last operation of MeshEditor some nodes were
527    * created this method returns list of it's IDs, if new nodes
528    * not creared - returns empty list
529    */
530   SMESH::long_array* GetLastCreatedNodes();
531
532   /*!
533    * If during last operation of MeshEditor some elements were
534    * created this method returns list of it's IDs, if new elements
535    * not creared - returns empty list
536    */
537   SMESH::long_array* GetLastCreatedElems();
538
539   /*!
540    * \brief Return edited mesh ID
541    * \retval int - mesh ID
542    */
543   int GetMeshId() const { return myMesh->GetId(); }
544
545  CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
546                               const SMESH::long_array& theModifiedElems );
547
548   CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
549                              const SMESH::long_array& theModifiedElems );
550
551   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
552                                   SMESH::SMESH_GroupBase_ptr theModifiedElems );
553
554   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
555                                    const SMESH::ListOfGroups& theModifiedElems);
556
557   /*!
558    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
559    * \param theElems - the list of elements (edges or faces) to be replicated
560    *       The nodes for duplication could be found from these elements
561    * \param theNodesNot - list of nodes to NOT replicate
562    * \param theAffectedElems - the list of elements (cells and edges) to which the 
563    *       replicated nodes should be associated to.
564    * \return TRUE if operation has been completed successfully, FALSE otherwise
565    * \sa DoubleNodeGroup(), DoubleNodeGroups()
566    */
567   CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems, 
568                                  const SMESH::long_array& theNodesNot,
569                                  const SMESH::long_array& theAffectedElems );
570
571   /*!
572    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
573    * \param theElems - the list of elements (edges or faces) to be replicated
574    *        The nodes for duplication could be found from these elements
575    * \param theNodesNot - list of nodes to NOT replicate
576    * \param theShape - shape to detect affected elements (element which geometric center
577    *        located on or inside shape).
578    *        The replicated nodes should be associated to affected elements.
579    * \return TRUE if operation has been completed successfully, FALSE otherwise
580    * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
581    */
582   CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems, 
583                                          const SMESH::long_array& theNodesNot,
584                                          GEOM::GEOM_Object_ptr    theShape );
585
586   /*!
587    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
588    * \param theElems - group of of elements (edges or faces) to be replicated
589    * \param theNodesNot - group of nodes not to replicated
590    * \param theAffectedElems - group of elements to which the replicated nodes
591    *        should be associated to.
592    * \return TRUE if operation has been completed successfully, FALSE otherwise
593    * \sa DoubleNodes(), DoubleNodeGroups()
594    */
595   CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
596                                       SMESH::SMESH_GroupBase_ptr theNodesNot,
597                                       SMESH::SMESH_GroupBase_ptr theAffectedElems );
598   
599   /*!
600    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
601    * \param theElems - group of of elements (edges or faces) to be replicated
602    * \param theNodesNot - group of nodes not to replicated
603    * \param theShape - shape to detect affected elements (element which geometric center
604    *        located on or inside shape).
605    *        The replicated nodes should be associated to affected elements.
606    * \return TRUE if operation has been completed successfully, FALSE otherwise
607    * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
608    */
609   CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
610                                               SMESH::SMESH_GroupBase_ptr theNodesNot,
611                                               GEOM::GEOM_Object_ptr      theShape );
612
613   /*!
614    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
615    * This method provided for convenience works as DoubleNodes() described above.
616    * \param theElems - list of groups of elements (edges or faces) to be replicated
617    * \param theNodesNot - list of groups of nodes not to replicated
618    * \param theAffectedElems - group of elements to which the replicated nodes
619    *        should be associated to.
620    * \return TRUE if operation has been completed successfully, FALSE otherwise
621    * \sa DoubleNodeGroup(), DoubleNodes()
622    */
623   CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
624                                        const SMESH::ListOfGroups& theNodesNot,
625                                        const SMESH::ListOfGroups& theAffectedElems );
626
627
628   /*!
629    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
630    * This method provided for convenience works as DoubleNodes() described above.
631    * \param theElems - list of groups of elements (edges or faces) to be replicated
632    * \param theNodesNot - list of groups of nodes not to replicated
633    * \param theShape - shape to detect affected elements (element which geometric center
634    *        located on or inside shape).
635    *        The replicated nodes should be associated to affected elements.
636    * \return TRUE if operation has been completed successfully, FALSE otherwise
637    * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
638    */
639   CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
640                                                const SMESH::ListOfGroups& theNodesNot,
641                                                GEOM::GEOM_Object_ptr      theShape );
642
643     /*!
644      * \brief Generated skin mesh (containing 2D cells) from 3D mesh
645      * The created 2D mesh elements based on nodes of free faces of boundary volumes
646      * \return TRUE if operation has been completed successfully, FALSE otherwise
647     */
648     CORBA::Boolean Make2DMeshFrom3D();
649
650  private: //!< private methods
651
652   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
653
654   /*!
655    * \brief Update myLastCreated* or myPreviewData
656    * \param anEditor - it contains edition results
657    */
658   void storeResult(::SMESH_MeshEditor& anEditor);
659   /*!
660    * \brief Clear myLastCreated* or myPreviewData
661    */
662   void initData(bool deleteSearchers=true);
663
664   /*!
665    * \brief Return groups by their IDs
666    */
667   SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
668
669   SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
670                                      const SMESH::AxisStruct & Axis,
671                                      CORBA::Double             AngleInRadians,
672                                      CORBA::Long               NbOfSteps,
673                                      CORBA::Double             Tolerance,
674                                      const bool                MakeGroups,
675                                      const SMDSAbs_ElementType ElementType=SMDSAbs_All);
676   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
677                                       const SMESH::DirStruct &  StepVector,
678                                       CORBA::Long               NbOfSteps,
679                                       const bool                MakeGroups,
680                                       const SMDSAbs_ElementType ElementType=SMDSAbs_All);
681   SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
682                                          const SMESH::DirStruct &  theStepVector,
683                                          CORBA::Long               theNbOfSteps,
684                                          CORBA::Long               theExtrFlags,
685                                          CORBA::Double             theSewTolerance,
686                                          const bool                MakeGroups);
687   SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array &   IDsOfElements,
688                                           SMESH::SMESH_Mesh_ptr       PathMesh,
689                                           GEOM::GEOM_Object_ptr       PathShape,
690                                           CORBA::Long                 NodeStart,
691                                           CORBA::Boolean              HasAngles,
692                                           const SMESH::double_array & Angles,
693                                           CORBA::Boolean              HasRefPoint,
694                                           const SMESH::PointStruct &  RefPoint,
695                                           const bool                  MakeGroups,
696                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
697                                           const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
698   SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array &  IDsOfElements,
699                                            SMESH::SMESH_IDSource_ptr  Path,
700                                            CORBA::Long                NodeStart,
701                                            CORBA::Boolean             HasAngles,
702                                            const SMESH::double_array& Angles,
703                                            CORBA::Boolean             LinearVariation,
704                                            CORBA::Boolean             HasRefPoint,
705                                            const SMESH::PointStruct&  RefPoint,
706                                            const bool                 MakeGroups,
707                                            const SMDSAbs_ElementType  ElementType,
708                                            SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
709   SMESH::ListOfGroups* mirror(const SMESH::long_array &           IDsOfElements,
710                               const SMESH::AxisStruct &           Axis,
711                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
712                               CORBA::Boolean                      Copy,
713                               const bool                          MakeGroups,
714                               ::SMESH_Mesh*                       TargetMesh=0);
715   SMESH::ListOfGroups* translate(const SMESH::long_array & IDsOfElements,
716                                  const SMESH::DirStruct &  Vector,
717                                  CORBA::Boolean            Copy,
718                                  const bool                MakeGroups,
719                                  ::SMESH_Mesh*             TargetMesh=0);
720   SMESH::ListOfGroups* rotate(const SMESH::long_array & IDsOfElements,
721                               const SMESH::AxisStruct &  Axis,
722                               CORBA::Double             Angle,
723                               CORBA::Boolean            Copy,
724                               const bool                MakeGroups,
725                               ::SMESH_Mesh*             TargetMesh=0);
726
727   SMESH::ListOfGroups* scale(const SMESH::long_array &  theIDsOfElements,
728                              const SMESH::PointStruct&  thePoint,
729                              const SMESH::double_array& theScaleFact,
730                              CORBA::Boolean             theCopy,
731                              const bool                 theMakeGroups,
732                              ::SMESH_Mesh*              theTargetMesh=0);
733
734   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
735
736   void DumpGroupsList(SMESH::TPythonDump & theDumpPython, 
737                       const SMESH::ListOfGroups * theGroupList);
738
739 private: //!< fields
740
741   SMESH_Mesh_i*         myMesh_i;
742   SMESH_Mesh *          myMesh;
743
744   SMESH::long_array_var myLastCreatedElems;
745   SMESH::long_array_var myLastCreatedNodes;
746
747   SMESH::MeshPreviewStruct_var myPreviewData;
748   bool                         myPreviewMode;
749 };
750
751 #endif