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