Salome HOME
399fe708eb831e238cbaf0d4c8ebead58063d4c8
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.hxx
1 // Copyright (C) 2007-2013  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 "SMESH_MeshEditor.hxx"
39 #include <list>
40
41 class SMESH_Mesh_i;
42
43 namespace MeshEditor_I {
44   struct TPreviewMesh;
45 }
46
47 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
48 {
49 public:
50   SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
51
52   virtual ~ SMESH_MeshEditor_i();
53   /*!
54    * \brief Return edited mesh ID
55    * \retval int - mesh ID
56    */
57   int GetMeshId() const { return myMesh->GetId(); }
58
59   // --- CORBA
60
61   /*!
62    * Return data of mesh edition preview
63    */
64   SMESH::MeshPreviewStruct* GetPreviewData() throw (SALOME::SALOME_Exception);
65   /*!
66    * If during last operation of MeshEditor some nodes were
67    * created this method returns list of their IDs, if new nodes
68    * not created - returns an empty list
69    */
70   SMESH::long_array* GetLastCreatedNodes() throw (SALOME::SALOME_Exception);
71   /*!
72    * If during last operation of MeshEditor some elements were
73    * created this method returns list of their IDs, if new elements
74    * not created - returns an empty list
75    */
76   SMESH::long_array* GetLastCreatedElems() throw (SALOME::SALOME_Exception);
77   /*!
78    * \brief Clears sequences of last created elements and nodes 
79    */
80   void ClearLastCreated() throw (SALOME::SALOME_Exception);
81   /*!
82    * \brief Returns description of an error/warning occured during the last operation
83    */
84   SMESH::ComputeError* GetLastError() throw (SALOME::SALOME_Exception);
85
86   /*!
87    * \brief Wrap a sequence of ids in a SMESH_IDSource
88    */
89   SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements,
90                                          SMESH::ElementType       type);
91   static bool               IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSource );
92
93   CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements)
94     throw (SALOME::SALOME_Exception);
95   CORBA::Boolean RemoveNodes   (const SMESH::long_array & IDsOfNodes)
96     throw (SALOME::SALOME_Exception);
97   CORBA::Long    RemoveOrphanNodes()
98     throw (SALOME::SALOME_Exception);
99
100   /*!
101    * Methods for creation new elements.
102    * Returns ID of created element or 0 if element not created
103    */
104   CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z)
105     throw (SALOME::SALOME_Exception);
106   CORBA::Long Add0DElement(CORBA::Long IDOfNode)
107     throw (SALOME::SALOME_Exception);
108   CORBA::Long AddBall(CORBA::Long IDOfNodem, CORBA::Double diameter)
109     throw (SALOME::SALOME_Exception);
110   CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes)
111     throw (SALOME::SALOME_Exception);
112   CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes)
113     throw (SALOME::SALOME_Exception);
114   CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes)
115     throw (SALOME::SALOME_Exception);
116   CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes)
117     throw (SALOME::SALOME_Exception);
118   CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
119                                   const SMESH::long_array & Quantities)
120     throw (SALOME::SALOME_Exception);
121   CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces)
122     throw (SALOME::SALOME_Exception);
123
124   /*!
125    * \brief Create 0D elements on all nodes of the given object except those 
126    *        nodes on which a 0D element already exists.
127    *  \param theObject object on whose nodes 0D elements will be created.
128    *  \param theGroupName optional name of a group to add 0D elements created
129    *         and/or found on nodes of \a theObject.
130    *  \return an object (a new group or a temporary SMESH_IDSource) holding
131    *          ids of new and/or found 0D elements.
132    */
133   SMESH::SMESH_IDSource_ptr Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObject,
134                                                        const char*               theGroupName)
135     throw (SALOME::SALOME_Exception);
136
137   /*!
138    * \brief Bind a node to a vertex
139    * \param NodeID - node ID
140    * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
141    */
142   void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
143     throw (SALOME::SALOME_Exception);
144   /*!
145    * \brief Store node position on an edge
146    * \param NodeID - node ID
147    * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
148    * \param paramOnEdge - parameter on edge where the node is located
149    */
150   void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
151                      CORBA::Double paramOnEdge)
152     throw (SALOME::SALOME_Exception);
153   /*!
154    * \brief Store node position on a face
155    * \param NodeID - node ID
156    * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
157    * \param u - U parameter on face where the node is located
158    * \param v - V parameter on face where the node is located
159    */
160   void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
161                      CORBA::Double u, CORBA::Double v)
162     throw (SALOME::SALOME_Exception);
163   /*!
164    * \brief Bind a node to a solid
165    * \param NodeID - node ID
166    * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
167    */
168   void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
169     throw (SALOME::SALOME_Exception);
170   /*!
171    * \brief Bind an element to a shape
172    * \param ElementID - element ID
173    * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
174    */
175   void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
176     throw (SALOME::SALOME_Exception);
177
178
179   CORBA::Boolean MoveNode(CORBA::Long NodeID,
180                           CORBA::Double x, CORBA::Double y, CORBA::Double z)
181     throw (SALOME::SALOME_Exception);
182
183   CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2)
184     throw (SALOME::SALOME_Exception);
185   CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2)
186     throw (SALOME::SALOME_Exception);
187   CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements)
188     throw (SALOME::SALOME_Exception);
189   CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject)
190     throw (SALOME::SALOME_Exception);
191
192   /*!
193    * \brief Reorient faces contained in \a the2Dgroup.
194    * \param the2Dgroup - the mesh or its part to reorient
195    * \param theDirection - desired direction of normal of \a theFace
196    * \param theFace - ID of face whose orientation is checked.
197    *        It can be < 1 then \a thePoint is used to find a face.
198    * \param thePoint - is used to find a face if \a theFace < 1.
199    * \return number of reoriented elements.
200    */
201   CORBA::Long Reorient2D(SMESH::SMESH_IDSource_ptr the2Dgroup,
202                          const SMESH::DirStruct&   theDirection,
203                          CORBA::Long               theFace,
204                          const SMESH::PointStruct& thePoint) throw (SALOME::SALOME_Exception);
205
206   // Split/Join faces
207   CORBA::Boolean TriToQuad       (const SMESH::long_array &   IDsOfElements,
208                                   SMESH::NumericalFunctor_ptr Criterion,
209                                   CORBA::Double               MaxAngle)
210     throw (SALOME::SALOME_Exception);
211   CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
212                                   SMESH::NumericalFunctor_ptr Criterion,
213                                   CORBA::Double               MaxAngle)
214     throw (SALOME::SALOME_Exception);
215   CORBA::Boolean QuadToTri       (const SMESH::long_array &   IDsOfElements,
216                                   SMESH::NumericalFunctor_ptr Criterion)
217     throw (SALOME::SALOME_Exception);
218   CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr   theObject,
219                                   SMESH::NumericalFunctor_ptr Criterion)
220     throw (SALOME::SALOME_Exception);
221   CORBA::Boolean SplitQuad       (const SMESH::long_array &   IDsOfElements,
222                                   CORBA::Boolean              Diag13)
223     throw (SALOME::SALOME_Exception);
224   CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
225                                   CORBA::Boolean              Diag13)
226     throw (SALOME::SALOME_Exception);
227   CORBA::Long    BestSplit       (CORBA::Long                 IDOfQuad,
228                                   SMESH::NumericalFunctor_ptr Criterion)
229     throw (SALOME::SALOME_Exception);
230   void           SplitVolumesIntoTetra(SMESH::SMESH_IDSource_ptr elems,
231                                        CORBA::Short             methodFlags)
232     throw (SALOME::SALOME_Exception);
233
234   CORBA::Boolean Smooth(const SMESH::long_array &              IDsOfElements,
235                         const SMESH::long_array &              IDsOfFixedNodes,
236                         CORBA::Long                            MaxNbOfIterations,
237                         CORBA::Double                          MaxAspectRatio,
238                         SMESH::SMESH_MeshEditor::Smooth_Method Method)
239     throw (SALOME::SALOME_Exception);
240   CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
241                               const SMESH::long_array &              IDsOfFixedNodes,
242                               CORBA::Long                            MaxNbOfIterations,
243                               CORBA::Double                          MaxAspectRatio,
244                               SMESH::SMESH_MeshEditor::Smooth_Method Method)
245     throw (SALOME::SALOME_Exception);
246   CORBA::Boolean SmoothParametric(const SMESH::long_array &              IDsOfElements,
247                                   const SMESH::long_array &              IDsOfFixedNodes,
248                                   CORBA::Long                            MaxNbOfIterations,
249                                   CORBA::Double                          MaxAspectRatio,
250                                   SMESH::SMESH_MeshEditor::Smooth_Method Method)
251     throw (SALOME::SALOME_Exception);
252   CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
253                                         const SMESH::long_array &              IDsOfFixedNodes,
254                                         CORBA::Long                            MaxNbOfIterations,
255                                         CORBA::Double                          MaxAspectRatio,
256                                         SMESH::SMESH_MeshEditor::Smooth_Method Method)
257     throw (SALOME::SALOME_Exception);
258   CORBA::Boolean smooth(const SMESH::long_array &              IDsOfElements,
259                         const SMESH::long_array &              IDsOfFixedNodes,
260                         CORBA::Long                            MaxNbOfIterations,
261                         CORBA::Double                          MaxAspectRatio,
262                         SMESH::SMESH_MeshEditor::Smooth_Method Method,
263                         bool                                   IsParametric)
264     throw (SALOME::SALOME_Exception);
265   CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr              theObject,
266                               const SMESH::long_array &              IDsOfFixedNodes,
267                               CORBA::Long                            MaxNbOfIterations,
268                               CORBA::Double                          MaxAspectRatio,
269                               SMESH::SMESH_MeshEditor::Smooth_Method Method,
270                               bool                                   IsParametric)
271     throw (SALOME::SALOME_Exception);
272
273   CORBA::Boolean ConvertFromQuadratic()
274     throw (SALOME::SALOME_Exception);
275   void           ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
276     throw (SALOME::SALOME_Exception);
277   void           ConvertToQuadratic(CORBA::Boolean Force3d)
278     throw (SALOME::SALOME_Exception);
279   void           ConvertToQuadraticObject(CORBA::Boolean            theForce3d,
280                                           SMESH::SMESH_IDSource_ptr theObject)
281     throw (SALOME::SALOME_Exception);
282   void           ConvertToBiQuadratic(CORBA::Boolean            theForce3d,
283                                       SMESH::SMESH_IDSource_ptr theObject)
284     throw (SALOME::SALOME_Exception);
285
286   void RenumberNodes() throw (SALOME::SALOME_Exception);
287   void RenumberElements() throw (SALOME::SALOME_Exception);
288
289   void RotationSweep(const SMESH::long_array & IDsOfElements,
290                      const SMESH::AxisStruct & Axis,
291                      CORBA::Double             AngleInRadians,
292                      CORBA::Long               NbOfSteps,
293                      CORBA::Double             Tolerance)
294     throw (SALOME::SALOME_Exception);
295   void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
296                            const SMESH::AxisStruct & Axis,
297                            CORBA::Double             AngleInRadians,
298                            CORBA::Long               NbOfSteps,
299                            CORBA::Double             Tolerance)
300     throw (SALOME::SALOME_Exception);
301   void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
302                              const SMESH::AxisStruct & Axis,
303                              CORBA::Double             AngleInRadians,
304                              CORBA::Long               NbOfSteps,
305                              CORBA::Double             Tolerance)
306     throw (SALOME::SALOME_Exception);
307   void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
308                              const SMESH::AxisStruct & Axis,
309                              CORBA::Double             AngleInRadians,
310                              CORBA::Long               NbOfSteps,
311                              CORBA::Double             Tolerance)
312     throw (SALOME::SALOME_Exception);
313
314   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
315                       const SMESH::DirStruct &  StepVector,
316                       CORBA::Long               NbOfSteps)
317     throw (SALOME::SALOME_Exception);
318   void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
319                       const SMESH::DirStruct &  StepVector,
320                       CORBA::Long               NbOfSteps)
321     throw (SALOME::SALOME_Exception);
322
323   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
324                             const SMESH::DirStruct &  StepVector,
325                             CORBA::Long               NbOfSteps)
326     throw (SALOME::SALOME_Exception);
327
328   void ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
329                               const SMESH::DirStruct &  StepVector,
330                               CORBA::Long               NbOfSteps)
331     throw (SALOME::SALOME_Exception);
332   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
333                               const SMESH::DirStruct &  StepVector,
334                               CORBA::Long               NbOfSteps)
335     throw (SALOME::SALOME_Exception);
336   void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
337                               const SMESH::DirStruct &  StepVector,
338                               CORBA::Long               NbOfSteps)
339     throw (SALOME::SALOME_Exception);
340   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
341                          const SMESH::DirStruct &  theStepVector,
342                          CORBA::Long               theNbOfSteps,
343                          CORBA::Long               theExtrFlags,
344                          CORBA::Double             theSewTolerance)
345     throw (SALOME::SALOME_Exception);
346
347   SMESH::SMESH_MeshEditor::Extrusion_Error
348   ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
349                      SMESH::SMESH_Mesh_ptr       PathMesh,
350                      GEOM::GEOM_Object_ptr       PathShape,
351                      CORBA::Long                 NodeStart,
352                      CORBA::Boolean              HasAngles,
353                      const SMESH::double_array & Angles,
354                      CORBA::Boolean              HasRefPoint,
355                      const SMESH::PointStruct &  RefPoint)
356     throw (SALOME::SALOME_Exception);
357
358   SMESH::SMESH_MeshEditor::Extrusion_Error
359   ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
360                            SMESH::SMESH_Mesh_ptr       PathMesh,
361                            GEOM::GEOM_Object_ptr       PathShape,
362                            CORBA::Long                 NodeStart,
363                            CORBA::Boolean              HasAngles,
364                            const SMESH::double_array & Angles,
365                            CORBA::Boolean              HasRefPoint,
366                            const SMESH::PointStruct &  RefPoint)
367     throw (SALOME::SALOME_Exception);
368   SMESH::SMESH_MeshEditor::Extrusion_Error
369   ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
370                              SMESH::SMESH_Mesh_ptr       PathMesh,
371                              GEOM::GEOM_Object_ptr       PathShape,
372                              CORBA::Long                 NodeStart,
373                              CORBA::Boolean              HasAngles,
374                              const SMESH::double_array & Angles,
375                              CORBA::Boolean              HasRefPoint,
376                              const SMESH::PointStruct &  RefPoint)
377     throw (SALOME::SALOME_Exception);
378   SMESH::SMESH_MeshEditor::Extrusion_Error
379   ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
380                              SMESH::SMESH_Mesh_ptr       PathMesh,
381                              GEOM::GEOM_Object_ptr       PathShape,
382                              CORBA::Long                 NodeStart,
383                              CORBA::Boolean              HasAngles,
384                              const SMESH::double_array & Angles,
385                              CORBA::Boolean              HasRefPoint,
386                              const SMESH::PointStruct &  RefPoint)
387     throw (SALOME::SALOME_Exception);
388
389   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
390                                              GEOM::GEOM_Object_ptr       PathShape,
391                                              const SMESH::double_array & Angles);
392
393   void Mirror(const SMESH::long_array &           IDsOfElements,
394               const SMESH::AxisStruct &           Axis,
395               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
396               CORBA::Boolean                      Copy)
397     throw (SALOME::SALOME_Exception);
398   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
399                     const SMESH::AxisStruct &           Axis,
400                     SMESH::SMESH_MeshEditor::MirrorType MirrorType,
401                     CORBA::Boolean                      Copy)
402     throw (SALOME::SALOME_Exception);
403   void Translate(const SMESH::long_array & IDsOfElements,
404                  const SMESH::DirStruct &   Vector,
405                  CORBA::Boolean            Copy)
406     throw (SALOME::SALOME_Exception);
407   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
408                        const SMESH::DirStruct &   Vector,
409                        CORBA::Boolean             Copy)
410     throw (SALOME::SALOME_Exception);
411   void Rotate(const SMESH::long_array & IDsOfElements,
412               const SMESH::AxisStruct &  Axis,
413               CORBA::Double             Angle,
414               CORBA::Boolean            Copy)
415     throw (SALOME::SALOME_Exception);
416   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
417                     const SMESH::AxisStruct &  Axis,
418                     CORBA::Double              Angle,
419                     CORBA::Boolean             Copy)
420     throw (SALOME::SALOME_Exception);
421
422   SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
423                                                const SMESH::AxisStruct& Axix,
424                                                CORBA::Double            AngleInRadians,
425                                                CORBA::Long              NbOfSteps,
426                                                CORBA::Double            Tolerance)
427     throw (SALOME::SALOME_Exception);
428   SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
429                                                      const SMESH::AxisStruct&  Axix,
430                                                      CORBA::Double             AngleInRadians,
431                                                      CORBA::Long               NbOfSteps,
432                                                      CORBA::Double             Tolerance)
433     throw (SALOME::SALOME_Exception);
434   SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
435                                                        const SMESH::AxisStruct&  Axix,
436                                                        CORBA::Double             AngleInRadians,
437                                                        CORBA::Long               NbOfSteps,
438                                                        CORBA::Double             Tolerance)
439     throw (SALOME::SALOME_Exception);
440   SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
441                                                        const SMESH::AxisStruct&  Axix,
442                                                        CORBA::Double             AngleInRadians,
443                                                        CORBA::Long               NbOfSteps,
444                                                        CORBA::Double             Tolerance)
445     throw (SALOME::SALOME_Exception);
446   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
447                                                 const SMESH::DirStruct&  StepVector,
448                                                 CORBA::Long              NbOfSteps)
449     throw (SALOME::SALOME_Exception);
450   SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
451                                                 const SMESH::DirStruct&  StepVector,
452                                                 CORBA::Long              NbOfSteps)
453     throw (SALOME::SALOME_Exception);
454
455   SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
456                                                    const SMESH::DirStruct&  StepVector,
457                                                    CORBA::Long              NbOfSteps,
458                                                    CORBA::Long              ExtrFlags,
459                                                    CORBA::Double            SewTolerance)
460     throw (SALOME::SALOME_Exception);
461   SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
462                                                       const SMESH::DirStruct&   StepVector,
463                                                       CORBA::Long               NbOfSteps)
464     throw (SALOME::SALOME_Exception);
465   SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
466                                                         const SMESH::DirStruct&   StepVector,
467                                                         CORBA::Long               NbOfSteps)
468     throw (SALOME::SALOME_Exception);
469   SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
470                                                         const SMESH::DirStruct&   StepVector,
471                                                         CORBA::Long               NbOfSteps)
472     throw (SALOME::SALOME_Exception);
473   SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
474                                                         const SMESH::DirStruct&   StepVector,
475                                                         CORBA::Long               NbOfSteps)
476     throw (SALOME::SALOME_Exception);
477   SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array&   IDsOfElements,
478                                                     SMESH::SMESH_Mesh_ptr      PathMesh,
479                                                     GEOM::GEOM_Object_ptr      PathShape,
480                                                     CORBA::Long                NodeStart,
481                                                     CORBA::Boolean             HasAngles,
482                                                     const SMESH::double_array& Angles,
483                                                     CORBA::Boolean             HasRefPoint,
484                                                     const SMESH::PointStruct&  RefPoint,
485                                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
486     throw (SALOME::SALOME_Exception);
487   SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
488                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
489                                                           GEOM::GEOM_Object_ptr      PathShape,
490                                                           CORBA::Long                NodeStart,
491                                                           CORBA::Boolean             HasAngles,
492                                                           const SMESH::double_array& Angles,
493                                                           CORBA::Boolean             HasRefPoint,
494                                                           const SMESH::PointStruct&  RefPoint,
495                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
496     throw (SALOME::SALOME_Exception);
497   SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
498                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
499                                                             GEOM::GEOM_Object_ptr      PathShape,
500                                                             CORBA::Long                NodeStart,
501                                                             CORBA::Boolean             HasAngles,
502                                                             const SMESH::double_array& Angles,
503                                                             CORBA::Boolean             HasRefPoint,
504                                                             const SMESH::PointStruct&  RefPoint,
505                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
506     throw (SALOME::SALOME_Exception);
507   SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
508                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
509                                                             GEOM::GEOM_Object_ptr      PathShape,
510                                                             CORBA::Long                NodeStart,
511                                                             CORBA::Boolean             HasAngles,
512                                                             const SMESH::double_array& Angles,
513                                                             CORBA::Boolean             HasRefPoint,
514                                                             const SMESH::PointStruct&  RefPoint,
515                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
516     throw (SALOME::SALOME_Exception);
517
518   // skl 04.06.2009 
519   SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
520                                               SMESH::SMESH_IDSource_ptr  Path,
521                                               CORBA::Long                NodeStart,
522                                               CORBA::Boolean             HasAngles,
523                                               const SMESH::double_array& Angles,
524                                               CORBA::Boolean             LinearVariation,
525                                               CORBA::Boolean             HasRefPoint,
526                                               const SMESH::PointStruct&  RefPoint,
527                                               CORBA::Boolean             MakeGroups,
528                                               SMESH::ElementType         ElemType,
529                                               SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
530     throw (SALOME::SALOME_Exception);
531   SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
532                                            SMESH::SMESH_IDSource_ptr  Path,
533                                            CORBA::Long                NodeStart,
534                                            CORBA::Boolean             HasAngles,
535                                            const SMESH::double_array& Angles,
536                                            CORBA::Boolean             LinearVariation,
537                                            CORBA::Boolean             HasRefPoint,
538                                            const SMESH::PointStruct&  RefPoint,
539                                            CORBA::Boolean             MakeGroups,
540                                            SMESH::ElementType         ElemType,
541                                            SMESH::SMESH_MeshEditor::Extrusion_Error& Error)
542     throw (SALOME::SALOME_Exception);
543
544   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
545                                         const SMESH::AxisStruct&            Mirror,
546                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType)
547     throw (SALOME::SALOME_Exception);
548   SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           Object,
549                                               const SMESH::AxisStruct&            Mirror,
550                                               SMESH::SMESH_MeshEditor::MirrorType MirrorType)
551     throw (SALOME::SALOME_Exception);
552   SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
553                                            const SMESH::DirStruct&  Vector)
554     throw (SALOME::SALOME_Exception);
555   SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
556                                                  const SMESH::DirStruct&   Vector)
557     throw (SALOME::SALOME_Exception);
558   SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
559                                         const SMESH::AxisStruct& Axis,
560                                         CORBA::Double            AngleInRadians)
561     throw (SALOME::SALOME_Exception);
562   SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
563                                               const SMESH::AxisStruct&  Axis,
564                                               CORBA::Double             AngleInRadians)
565     throw (SALOME::SALOME_Exception);
566
567   SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array&            IDsOfElements,
568                                        const SMESH::AxisStruct&            Mirror,
569                                        SMESH::SMESH_MeshEditor::MirrorType MirrorType,
570                                        CORBA::Boolean                      CopyGroups,
571                                        const char*                         MeshName)
572     throw (SALOME::SALOME_Exception);
573   SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           Object,
574                                              const SMESH::AxisStruct&            Mirror,
575                                              SMESH::SMESH_MeshEditor::MirrorType MirrorType,
576                                              CORBA::Boolean                      CopyGroups,
577                                              const char*                         MeshName)
578     throw (SALOME::SALOME_Exception);
579   SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
580                                           const SMESH::DirStruct&  Vector,
581                                           CORBA::Boolean           CopyGroups,
582                                           const char*              MeshName)
583     throw (SALOME::SALOME_Exception);
584   SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
585                                                 const SMESH::DirStruct&   Vector,
586                                                 CORBA::Boolean            CopyGroups,
587                                                 const char*               MeshName)
588     throw (SALOME::SALOME_Exception);
589   SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
590                                        const SMESH::AxisStruct& Axis,
591                                        CORBA::Double            AngleInRadians,
592                                        CORBA::Boolean           CopyGroups,
593                                        const char*              MeshName)
594     throw (SALOME::SALOME_Exception);
595   SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
596                                              const SMESH::AxisStruct&  Axis,
597                                              CORBA::Double             AngleInRadians,
598                                              CORBA::Boolean            CopyGroups,
599                                              const char*               MeshName)
600     throw (SALOME::SALOME_Exception);
601
602   void Scale(SMESH::SMESH_IDSource_ptr  theObject,
603              const SMESH::PointStruct&  thePoint,
604              const SMESH::double_array& theScaleFact,
605              CORBA::Boolean             theCopy)
606     throw (SALOME::SALOME_Exception);
607
608   SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
609                                        const SMESH::PointStruct&  thePoint,
610                                        const SMESH::double_array& theScaleFact)
611     throw (SALOME::SALOME_Exception);
612
613   SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
614                                       const SMESH::PointStruct& Point,
615                                       const SMESH::double_array& theScaleFact,
616                                       CORBA::Boolean            CopyGroups,
617                                       const char*               MeshName)
618     throw (SALOME::SALOME_Exception);
619
620   void FindCoincidentNodes (CORBA::Double                  Tolerance,
621                             SMESH::array_of_long_array_out GroupsOfNodes)
622     throw (SALOME::SALOME_Exception);
623   void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr      Object,
624                                  CORBA::Double                  Tolerance,
625                                  SMESH::array_of_long_array_out GroupsOfNodes)
626     throw (SALOME::SALOME_Exception);
627   void FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr      Object,
628                                     CORBA::Double                  Tolerance,
629                                     SMESH::array_of_long_array_out GroupsOfNodes,
630                                     const SMESH::ListOfIDSources&  ExceptSubMeshOrGroups)
631     throw (SALOME::SALOME_Exception);
632   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes)
633     throw (SALOME::SALOME_Exception);
634   void FindEqualElements(SMESH::SMESH_IDSource_ptr      Object,
635                          SMESH::array_of_long_array_out GroupsOfElementsID)
636     throw (SALOME::SALOME_Exception);
637   void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID)
638     throw (SALOME::SALOME_Exception);
639   void MergeEqualElements()
640     throw (SALOME::SALOME_Exception);
641   CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
642                                      CORBA::Double y,
643                                      CORBA::Double z,
644                                      CORBA::Long   nodeID)
645     throw (SALOME::SALOME_Exception);
646   /*!
647    * \brief Return ID of node closest to a given point
648    */
649   CORBA::Long FindNodeClosestTo(CORBA::Double x,
650                                 CORBA::Double y,
651                                 CORBA::Double z)
652     throw (SALOME::SALOME_Exception);
653   /*!
654    * Return elements of given type where the given point is IN or ON.
655    * 'ALL' type means elements of any type excluding nodes
656    */
657   SMESH::long_array* FindElementsByPoint(CORBA::Double      x,
658                                          CORBA::Double      y,
659                                          CORBA::Double      z,
660                                          SMESH::ElementType type)
661     throw (SALOME::SALOME_Exception);
662   /*!
663    * Searching among the given elements, return elements of given type 
664    * where the given point is IN or ON.
665    * 'ALL' type means elements of any type excluding nodes
666    */
667   SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
668                                               CORBA::Double             x,
669                                               CORBA::Double             y,
670                                               CORBA::Double             z,
671                                               SMESH::ElementType        type)
672     throw (SALOME::SALOME_Exception);
673
674   /*!
675    * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
676    * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
677    */
678   CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z)
679     throw (SALOME::SALOME_Exception);
680
681   SMESH::SMESH_MeshEditor::Sew_Error
682   SewFreeBorders(CORBA::Long FirstNodeID1,
683                  CORBA::Long SecondNodeID1,
684                  CORBA::Long LastNodeID1,
685                  CORBA::Long FirstNodeID2,
686                  CORBA::Long SecondNodeID2,
687                  CORBA::Long LastNodeID2,
688                  CORBA::Boolean CreatePolygons,
689                  CORBA::Boolean CreatePolyedrs)
690     throw (SALOME::SALOME_Exception);
691   SMESH::SMESH_MeshEditor::Sew_Error
692   SewConformFreeBorders(CORBA::Long FirstNodeID1,
693                         CORBA::Long SecondNodeID1,
694                         CORBA::Long LastNodeID1,
695                         CORBA::Long FirstNodeID2,
696                         CORBA::Long SecondNodeID2)
697     throw (SALOME::SALOME_Exception);
698   SMESH::SMESH_MeshEditor::Sew_Error
699   SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
700                   CORBA::Long SecondNodeIDOnFreeBorder,
701                   CORBA::Long LastNodeIDOnFreeBorder,
702                   CORBA::Long FirstNodeIDOnSide,
703                   CORBA::Long LastNodeIDOnSide,
704                   CORBA::Boolean CreatePolygons,
705                   CORBA::Boolean CreatePolyedrs)
706     throw (SALOME::SALOME_Exception);
707   SMESH::SMESH_MeshEditor::Sew_Error
708   SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
709                   const SMESH::long_array& IDsOfSide2Elements,
710                   CORBA::Long NodeID1OfSide1ToMerge,
711                   CORBA::Long NodeID1OfSide2ToMerge,
712                   CORBA::Long NodeID2OfSide1ToMerge,
713                   CORBA::Long NodeID2OfSide2ToMerge)
714     throw (SALOME::SALOME_Exception);
715
716   /*!
717    * Set new nodes for given element.
718    * If number of nodes is not corresponded to type of
719    * element - returns false
720    */
721   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs)
722     throw (SALOME::SALOME_Exception);
723
724   CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
725                               const SMESH::long_array& theModifiedElems )
726     throw (SALOME::SALOME_Exception);
727
728   CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
729                              const SMESH::long_array& theModifiedElems )
730     throw (SALOME::SALOME_Exception);
731
732   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
733                                   SMESH::SMESH_GroupBase_ptr theModifiedElems )
734     throw (SALOME::SALOME_Exception);
735
736   /*!
737    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
738    * Works as DoubleNodeGroup(), but returns a new group with newly created nodes.
739    * \param theNodes - group of nodes to be doubled.
740    * \param theModifiedElems - group of elements to be updated.
741    * \return a new group with newly created nodes
742    * \sa DoubleNodeGroup()
743    */
744   SMESH::SMESH_Group_ptr DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
745                                              SMESH::SMESH_GroupBase_ptr theModifiedElems )
746     throw (SALOME::SALOME_Exception);
747
748   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
749                                    const SMESH::ListOfGroups& theModifiedElems )
750     throw (SALOME::SALOME_Exception);
751
752   SMESH::SMESH_Group_ptr DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
753                                               const SMESH::ListOfGroups& theModifiedElems )
754     throw (SALOME::SALOME_Exception);
755
756   /*!
757    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
758    * \param theElems - the list of elements (edges or faces) to be replicated
759    *       The nodes for duplication could be found from these elements
760    * \param theNodesNot - list of nodes to NOT replicate
761    * \param theAffectedElems - the list of elements (cells and edges) to which the 
762    *       replicated nodes should be associated to.
763    * \return TRUE if operation has been completed successfully, FALSE otherwise
764    * \sa DoubleNodeGroup(), DoubleNodeGroups()
765    */
766   CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems, 
767                                  const SMESH::long_array& theNodesNot,
768                                  const SMESH::long_array& theAffectedElems )
769     throw (SALOME::SALOME_Exception);
770
771   /*!
772    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
773    * \param theElems - the list of elements (edges or faces) to be replicated
774    *        The nodes for duplication could be found from these elements
775    * \param theNodesNot - list of nodes to NOT replicate
776    * \param theShape - shape to detect affected elements (element which geometric center
777    *        located on or inside shape).
778    *        The replicated nodes should be associated to affected elements.
779    * \return TRUE if operation has been completed successfully, FALSE otherwise
780    * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
781    */
782   CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems, 
783                                          const SMESH::long_array& theNodesNot,
784                                          GEOM::GEOM_Object_ptr    theShape )
785     throw (SALOME::SALOME_Exception);
786
787   /*!
788    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
789    * \param theElems - group of of elements (edges or faces) to be replicated
790    * \param theNodesNot - group of nodes not to replicated
791    * \param theAffectedElems - group of elements to which the replicated nodes
792    *        should be associated to.
793    * \return TRUE if operation has been completed successfully, FALSE otherwise
794    * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
795    */
796   CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
797                                       SMESH::SMESH_GroupBase_ptr theNodesNot,
798                                       SMESH::SMESH_GroupBase_ptr theAffectedElems )
799     throw (SALOME::SALOME_Exception);
800
801   /*!
802    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
803    * Works as DoubleNodeElemGroup(), but returns a new group with newly created elements.
804    * \param theElems - group of of elements (edges or faces) to be replicated
805    * \param theNodesNot - group of nodes not to replicated
806    * \param theAffectedElems - group of elements to which the replicated nodes
807    *        should be associated to.
808    * \return a new group with newly created elements
809    * \sa DoubleNodeElemGroup()
810    */
811   SMESH::SMESH_Group_ptr DoubleNodeElemGroupNew( SMESH::SMESH_GroupBase_ptr theElems,
812                                                  SMESH::SMESH_GroupBase_ptr theNodesNot,
813                                                  SMESH::SMESH_GroupBase_ptr theAffectedElems )
814     throw (SALOME::SALOME_Exception);
815
816   SMESH::ListOfGroups*   DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems,
817                                                  SMESH::SMESH_GroupBase_ptr theNodesNot,
818                                                  SMESH::SMESH_GroupBase_ptr theAffectedElems,
819                                                  CORBA::Boolean             theElemGroupNeeded,
820                                                  CORBA::Boolean             theNodeGroupNeeded)
821     throw (SALOME::SALOME_Exception);
822   
823   /*!
824    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
825    * \param theElems - group of of elements (edges or faces) to be replicated
826    * \param theNodesNot - group of nodes not to replicated
827    * \param theShape - shape to detect affected elements (element which geometric center
828    *        located on or inside shape).
829    *        The replicated nodes should be associated to affected elements.
830    * \return TRUE if operation has been completed successfully, FALSE otherwise
831    * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
832    */
833   CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
834                                               SMESH::SMESH_GroupBase_ptr theNodesNot,
835                                               GEOM::GEOM_Object_ptr      theShape )
836     throw (SALOME::SALOME_Exception);
837
838   /*!
839    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
840    * This method provided for convenience works as DoubleNodes() described above.
841    * \param theElems - list of groups of elements (edges or faces) to be replicated
842    * \param theNodesNot - list of groups of nodes not to replicated
843    * \param theAffectedElems - group of elements to which the replicated nodes
844    *        should be associated to.
845    * \return TRUE if operation has been completed successfully, FALSE otherwise
846    * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
847    */
848   CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
849                                        const SMESH::ListOfGroups& theNodesNot,
850                                        const SMESH::ListOfGroups& theAffectedElems )
851     throw (SALOME::SALOME_Exception);
852
853   /*!
854    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
855    * Works as DoubleNodeElemGroups(), but returns a new group with newly created elements.
856    * \param theElems - list of groups of elements (edges or faces) to be replicated
857    * \param theNodesNot - list of groups of nodes not to replicated
858    * \param theAffectedElems - group of elements to which the replicated nodes
859    *        should be associated to.
860    * \return a new group with newly created elements
861    * \sa DoubleNodeElemGroups()
862    */
863   SMESH::SMESH_Group_ptr DoubleNodeElemGroupsNew( const SMESH::ListOfGroups& theElems,
864                                                   const SMESH::ListOfGroups& theNodesNot,
865                                                   const SMESH::ListOfGroups& theAffectedElems )
866     throw (SALOME::SALOME_Exception);
867
868   SMESH::ListOfGroups*   DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems,
869                                                   const SMESH::ListOfGroups& theNodesNot,
870                                                   const SMESH::ListOfGroups& theAffectedElems,
871                                                   CORBA::Boolean             theElemGroupNeeded,
872                                                   CORBA::Boolean             theNodeGroupNeeded)
873     throw (SALOME::SALOME_Exception);
874
875   /*!
876    * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
877    * This method provided for convenience works as DoubleNodes() described above.
878    * \param theElems - list of groups of elements (edges or faces) to be replicated
879    * \param theNodesNot - list of groups of nodes not to replicated
880    * \param theShape - shape to detect affected elements (element which geometric center
881    *        located on or inside shape).
882    *        The replicated nodes should be associated to affected elements.
883    * \return TRUE if operation has been completed successfully, FALSE otherwise
884    * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
885    */
886   CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
887                                                const SMESH::ListOfGroups& theNodesNot,
888                                                GEOM::GEOM_Object_ptr      theShape )
889     throw (SALOME::SALOME_Exception);
890
891   /*!
892    * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed.
893    * This method is the first step of DoubleNodeElemGroupsInRegion.
894    * \param theElems - list of groups of elements (edges or faces) to be replicated
895    * \param theNodesNot - list of groups of nodes not to replicated
896    * \param theShape - shape to detect affected elements (element which geometric center
897    *        located on or inside shape).
898    *        The replicated nodes should be associated to affected elements.
899    * \return groups of affected elements
900    * \sa DoubleNodeElemGroupsInRegion()
901    */
902   SMESH::ListOfGroups* AffectedElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
903                                                    const SMESH::ListOfGroups& theNodesNot,
904                                                    GEOM::GEOM_Object_ptr      theShape )
905     throw (SALOME::SALOME_Exception);
906
907   /*!
908    * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
909    * The list of groups must describe a partition of the mesh volumes.
910    * The nodes of the internal faces at the boundaries of the groups are doubled.
911    * In option, the internal faces are replaced by flat elements.
912    * Triangles are transformed in prisms, and quadrangles in hexahedrons.
913    * @param theDomains - list of groups of volumes
914    * @param createJointElems - if TRUE, create the elements
915    * @return TRUE if operation has been completed successfully, FALSE otherwise
916    */
917   CORBA::Boolean DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
918                                                CORBA::Boolean createJointElems )
919     throw (SALOME::SALOME_Exception);
920   /*!
921    * \brief Double nodes on some external faces and create flat elements.
922    * Flat elements are mainly used by some types of mechanic calculations.
923    *
924    * Each group of the list must be constituted of faces.
925    * Triangles are transformed in prisms, and quadrangles in hexahedrons.
926    * @param theGroupsOfFaces - list of groups of faces
927    * @return TRUE if operation has been completed successfully, FALSE otherwise
928    */
929   CORBA::Boolean CreateFlatElementsOnFacesGroups( const SMESH::ListOfGroups& theGroupsOfFaces )
930     throw (SALOME::SALOME_Exception);
931
932   /*!
933    *  \brief identify all the elements around a geom shape, get the faces delimiting the hole
934    *  Build groups of volume to remove, groups of faces to replace on the skin of the object,
935    *  groups of faces to remove insidethe object, (idem edges).
936    *  Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
937    */
938   void CreateHoleSkin(CORBA::Double radius,
939                       GEOM::GEOM_Object_ptr theShape,
940                       const char* groupName,
941                       const SMESH::double_array& theNodesCoords,
942                       SMESH::array_of_long_array_out GroupsOfNodes)
943   throw (SALOME::SALOME_Exception);
944
945   /*!
946    * \brief Generated skin mesh (containing 2D cells) from 3D mesh
947    * The created 2D mesh elements based on nodes of free faces of boundary volumes
948    * \return TRUE if operation has been completed successfully, FALSE otherwise
949    */
950   CORBA::Boolean Make2DMeshFrom3D()
951     throw (SALOME::SALOME_Exception);
952
953   SMESH::SMESH_Mesh_ptr MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr elements,
954                                          SMESH::Bnd_Dimension      dimension,
955                                          const char*               groupName,
956                                          const char*               meshName,
957                                          CORBA::Boolean            toCopyElements,
958                                          CORBA::Boolean            toCopyMissingBondary,
959                                          SMESH::SMESH_Group_out    group)
960     throw (SALOME::SALOME_Exception);
961
962   CORBA::Long MakeBoundaryElements(SMESH::Bnd_Dimension dimension,
963                                    const char* groupName,
964                                    const char* meshName,
965                                    CORBA::Boolean toCopyAll,
966                                    const SMESH::ListOfIDSources& groups,
967                                    SMESH::SMESH_Mesh_out mesh,
968                                    SMESH::SMESH_Group_out group)
969     throw (SALOME::SALOME_Exception);
970
971 private: //!< private methods
972
973   ::SMESH_MeshEditor& getEditor();
974
975   SMESHDS_Mesh * getMeshDS() { return myMesh->GetMeshDS(); }
976
977   MeshEditor_I::TPreviewMesh * getPreviewMesh( SMDSAbs_ElementType previewType = SMDSAbs_All );
978
979   void declareMeshModified( bool isReComputeSafe );
980
981   /*!
982    * \brief Clear myLastCreated* or myPreviewData
983    */
984   void initData(bool deleteSearchers=true);
985
986   /*!
987    * \brief Return groups by their IDs
988    */
989   SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs)
990     throw (SALOME::SALOME_Exception);
991
992   SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
993                                      const SMESH::AxisStruct & Axis,
994                                      CORBA::Double             AngleInRadians,
995                                      CORBA::Long               NbOfSteps,
996                                      CORBA::Double             Tolerance,
997                                      const bool                MakeGroups,
998                                      const SMDSAbs_ElementType ElementType=SMDSAbs_All)
999     throw (SALOME::SALOME_Exception);
1000   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
1001                                       const SMESH::DirStruct &  StepVector,
1002                                       CORBA::Long               NbOfSteps,
1003                                       bool                      MakeGroups,
1004                                       const SMDSAbs_ElementType ElementType=SMDSAbs_All)
1005     throw (SALOME::SALOME_Exception);
1006   SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
1007                                          const SMESH::DirStruct &  theStepVector,
1008                                          CORBA::Long               theNbOfSteps,
1009                                          CORBA::Long               theExtrFlags,
1010                                          CORBA::Double             theSewTolerance,
1011                                          const bool                MakeGroups)
1012     throw (SALOME::SALOME_Exception);
1013   SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array &   IDsOfElements,
1014                                           SMESH::SMESH_Mesh_ptr       PathMesh,
1015                                           GEOM::GEOM_Object_ptr       PathShape,
1016                                           CORBA::Long                 NodeStart,
1017                                           CORBA::Boolean              HasAngles,
1018                                           const SMESH::double_array & Angles,
1019                                           CORBA::Boolean              HasRefPoint,
1020                                           const SMESH::PointStruct &  RefPoint,
1021                                           const bool                  MakeGroups,
1022                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
1023                                           const SMDSAbs_ElementType   ElementType=SMDSAbs_All)
1024     throw (SALOME::SALOME_Exception);
1025   SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array &  IDsOfElements,
1026                                            SMESH::SMESH_IDSource_ptr  Path,
1027                                            CORBA::Long                NodeStart,
1028                                            CORBA::Boolean             HasAngles,
1029                                            const SMESH::double_array& Angles,
1030                                            CORBA::Boolean             LinearVariation,
1031                                            CORBA::Boolean             HasRefPoint,
1032                                            const SMESH::PointStruct&  RefPoint,
1033                                            bool                       MakeGroups,
1034                                            const SMDSAbs_ElementType  ElementType,
1035                                            SMESH::SMESH_MeshEditor::Extrusion_Error & theError)
1036     throw (SALOME::SALOME_Exception);
1037   SMESH::ListOfGroups* mirror(TIDSortedElemSet &                  IDsOfElements,
1038                               const SMESH::AxisStruct &           Axis,
1039                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
1040                               CORBA::Boolean                      Copy,
1041                               bool                                MakeGroups,
1042                               ::SMESH_Mesh*                       TargetMesh=0)
1043     throw (SALOME::SALOME_Exception);
1044   SMESH::ListOfGroups* translate(TIDSortedElemSet        & IDsOfElements,
1045                                  const SMESH::DirStruct &  Vector,
1046                                  CORBA::Boolean            Copy,
1047                                  bool                      MakeGroups,
1048                                  ::SMESH_Mesh*             TargetMesh=0)
1049     throw (SALOME::SALOME_Exception);
1050   SMESH::ListOfGroups* rotate(TIDSortedElemSet &           IDsOfElements,
1051                               const SMESH::AxisStruct &  Axis,
1052                               CORBA::Double             Angle,
1053                               CORBA::Boolean            Copy,
1054                               bool                      MakeGroups,
1055                               ::SMESH_Mesh*             TargetMesh=0)
1056     throw (SALOME::SALOME_Exception);
1057
1058   SMESH::ListOfGroups* scale(SMESH::SMESH_IDSource_ptr   theObject,
1059                              const SMESH::PointStruct&   thePoint,
1060                              const SMESH::double_array&  theScaleFact,
1061                              CORBA::Boolean              theCopy,
1062                              bool                        theMakeGroups,
1063                              ::SMESH_Mesh*               theTargetMesh=0)
1064     throw (SALOME::SALOME_Exception);
1065
1066   void convertToQuadratic(CORBA::Boolean            theForce3d,
1067                           CORBA::Boolean            theToBiQuad,
1068                           SMESH::SMESH_IDSource_ptr theObject = SMESH::SMESH_IDSource::_nil())
1069     throw (SALOME::SALOME_Exception);
1070
1071   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
1072
1073   void dumpGroupsList(SMESH::TPythonDump & theDumpPython, 
1074                       const SMESH::ListOfGroups * theGroupList);
1075
1076   string generateGroupName(const string& thePrefix);
1077
1078 private: //!< fields
1079
1080   SMESH_Mesh_i*                myMesh_i;
1081   SMESH_Mesh *                 myMesh;
1082   ::SMESH_MeshEditor           myEditor;
1083
1084   bool                         myIsPreviewMode;
1085   MeshEditor_I::TPreviewMesh * myPreviewMesh;
1086   ::SMESH_MeshEditor *         myPreviewEditor;
1087   SMESH::MeshPreviewStruct_var myPreviewData;
1088
1089   // temporary IDSources
1090   struct _IDSource;
1091   std::list< _IDSource* >      myAuxIDSources;
1092   void                         deleteAuxIDSources();
1093 };
1094
1095 #endif