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