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