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