Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/smesh.git] / idl / SMESH_MeshEditor.idl
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : SMESH_MeshEditor.idl
23 //
24
25 #ifndef _SMESH_MESHEDITOR_IDL_
26 #define _SMESH_MESHEDITOR_IDL_
27
28 #include "SMESH_Mesh.idl"
29
30 module SMESH
31 {
32   /*!
33    * This interface makes modifications on the Mesh - removing elements and nodes etc.
34    */
35   interface NumericalFunctor;
36   interface SMESH_MeshEditor
37   {
38     boolean RemoveElements(in long_array IDsOfElements);
39
40     boolean RemoveNodes(in long_array IDsOfNodes);
41
42     long AddNode(in double x, in double y, in double z);
43
44     /*!
45      *  Create edge, either linear and quadratic (this is determed
46      *  by number of given nodes).
47      *  \param IdsOfNodes List of node IDs for creation of element.
48      *  Needed order of nodes in this list corresponds to description
49      *  of MED. This description is located by the following link:
50      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
51      */
52     long AddEdge(in long_array IDsOfNodes);
53
54     /*!
55      *  Create face, either linear and quadratic (this is determed
56      *  by number of given nodes).
57      *  \param IdsOfNodes List of node IDs for creation of element.
58      *  Needed order of nodes in this list corresponds to description
59      *  of MED. This description is located by the following link:
60      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
61      */
62     long AddFace(in long_array IDsOfNodes);
63
64     long AddPolygonalFace(in long_array IdsOfNodes);
65
66     /*!
67      *  Create volume, either linear and quadratic (this is determed
68      *  by number of given nodes).
69      *  \param IdsOfNodes List of node IDs for creation of element.
70      *  Needed order of nodes in this list corresponds to description
71      *  of MED. This description is located by the following link:
72      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
73      */
74     long AddVolume(in long_array IDsOfNodes);
75
76     /*!
77      *  Create volume of many faces, giving nodes for each face.
78      *  \param IdsOfNodes List of node IDs for volume creation face by face.
79      *  \param Quantities List of integer values, Quantities[i]
80      *         gives quantity of nodes in face number i.
81      */
82     long AddPolyhedralVolume (in long_array IdsOfNodes,
83                               in long_array Quantities);
84
85     /*!
86      *  Create volume of many faces, giving IDs of existing faces.
87      *  \param IdsOfFaces List of face IDs for volume creation.
88      *  \note The created volume will refer only to nodes
89      *        of the given faces, not to the faces itself.
90      */
91     long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
92
93     /*!
94      * \brief Bind a node to a vertex
95       * \param NodeID - node ID
96       * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
97      */
98     void SetNodeOnVertex(in long NodeID, in long VertexID)
99       raises (SALOME::SALOME_Exception);
100     /*!
101      * \brief Store node position on an edge
102       * \param NodeID - node ID
103       * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
104       * \param paramOnEdge - parameter on edge where the node is located
105      */
106     void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
107       raises (SALOME::SALOME_Exception);
108     /*!
109      * \brief Store node position on a face
110       * \param NodeID - node ID
111       * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
112       * \param u - U parameter on face where the node is located
113       * \param v - V parameter on face where the node is located
114      */
115     void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
116       raises (SALOME::SALOME_Exception);
117     /*!
118      * \brief Bind a node to a solid
119       * \param NodeID - node ID
120       * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
121      */
122     void SetNodeInVolume(in long NodeID, in long SolidID)
123       raises (SALOME::SALOME_Exception);
124     /*!
125      * \brief Bind an element to a shape
126       * \param ElementID - element ID
127       * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
128      */
129     void SetMeshElementOnShape(in long ElementID, in long ShapeID)
130       raises (SALOME::SALOME_Exception);
131
132
133     boolean MoveNode(in long NodeID, in double x, in double y, in double z);
134
135     boolean InverseDiag(in long NodeID1, in long NodeID2);
136
137     boolean DeleteDiag(in long NodeID1, in long NodeID2);
138
139     boolean Reorient(in long_array IDsOfElements);
140
141     boolean ReorientObject(in SMESH_IDSource theObject);
142
143     /*!
144      * \brief Fuse neighbour triangles into quadrangles.
145      * \param theElems     The triangles to be fused.
146      * \param theCriterion Is used to choose a neighbour to fuse with.
147      * \param theMaxAngle  Is a max angle between element normals at which fusion
148      *                     is still performed; theMaxAngle is mesured in radians.
149      * \return TRUE in case of success, FALSE otherwise.
150      */
151     boolean TriToQuad (in long_array       IDsOfElements,
152                        in NumericalFunctor Criterion,
153                        in double           MaxAngle);
154
155     /*!
156      * \brief Fuse neighbour triangles into quadrangles.
157      *
158      * Behaves like the above method, taking list of elements from \a theObject
159      */
160     boolean TriToQuadObject (in SMESH_IDSource   theObject,
161                              in NumericalFunctor Criterion,
162                              in double           MaxAngle);
163
164     /*!
165      * \brief Split quadrangles into triangles.
166      * \param theElems     The faces to be splitted.
167      * \param theCriterion Is used to choose a diagonal for splitting.
168      * \return TRUE in case of success, FALSE otherwise.
169      */
170     boolean QuadToTri (in long_array       IDsOfElements,
171                        in NumericalFunctor Criterion);
172
173     /*!
174      * \brief Split quadrangles into triangles.
175      *
176      * Behaves like the above method, taking list of elements from \a theObject
177      */
178     boolean QuadToTriObject (in SMESH_IDSource   theObject,
179                              in NumericalFunctor Criterion);
180
181     /*!
182      * \brief Split quadrangles into triangles.
183      * \param theElems  The faces to be splitted.
184      * \param the13Diag Is used to choose a diagonal for splitting.
185      * \return TRUE in case of success, FALSE otherwise.
186      */
187     boolean SplitQuad (in long_array IDsOfElements,
188                        in boolean    Diag13);
189
190     /*!
191      * \brief Split quadrangles into triangles.
192      *
193      * Behaves like the above method, taking list of elements from \a theObject
194      */
195     boolean SplitQuadObject (in SMESH_IDSource theObject,
196                              in boolean        Diag13);
197
198     /*!
199      *  Find better splitting of the given quadrangle.
200      *  \param IDOfQuad  ID of the quadrangle to be splitted.
201      *  \param Criterion A criterion to choose a diagonal for splitting.
202      *  \return 1 if 1-3 diagonal is better, 2 if 2-4
203      *          diagonal is better, 0 if error occurs.
204      */
205     long BestSplit (in long             IDOfQuad,
206                     in NumericalFunctor Criterion);
207
208     enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
209
210     boolean Smooth(in long_array    IDsOfElements,
211                    in long_array    IDsOfFixedNodes,
212                    in long          MaxNbOfIterations,
213                    in double        MaxAspectRatio,
214                    in Smooth_Method Method);
215
216     boolean SmoothObject(in SMESH_IDSource  theObject,
217                          in long_array      IDsOfFixedNodes,
218                          in long            MaxNbOfIterations,
219                          in double          MaxAspectRatio,
220                          in Smooth_Method   Method);
221
222     boolean SmoothParametric(in long_array    IDsOfElements,
223                              in long_array    IDsOfFixedNodes,
224                              in long          MaxNbOfIterations,
225                              in double        MaxAspectRatio,
226                              in Smooth_Method Method);
227
228     boolean SmoothParametricObject(in SMESH_IDSource  theObject,
229                                    in long_array      IDsOfFixedNodes,
230                                    in long            MaxNbOfIterations,
231                                    in double          MaxAspectRatio,
232                                    in Smooth_Method   Method);
233
234     void ConvertToQuadratic(in boolean theForce3d);
235
236     boolean ConvertFromQuadratic();
237
238     void RenumberNodes();
239
240     void RenumberElements();
241
242     /*!
243      * \brief Genarate dim+1 elements by rotation of given elements around axis
244      * \param IDsOfElements - elements to ratate
245      * \param Axix - rotation axis
246      * \param AngleInRadians - rotation angle
247      * \param NbOfSteps - number of elements to generate from one element
248      */
249     void RotationSweep(in long_array       IDsOfElements,
250                        in AxisStruct       Axix,
251                        in double           AngleInRadians,
252                        in long             NbOfSteps,
253                        in double           Tolerance);
254     /*!
255      * \brief Same as previous but additionally create groups of elements
256      *  generated from elements belonging to preexisting groups
257      */
258     ListOfGroups RotationSweepMakeGroups(in long_array       IDsOfElements,
259                                          in AxisStruct       Axix,
260                                          in double           AngleInRadians,
261                                          in long             NbOfSteps,
262                                          in double           Tolerance);
263     /*!
264      * \brief Genarate dim+1 elements by rotation of the object around axis
265      * \param theObject - object containing elements to ratate
266      * \param Axix - rotation axis
267      * \param AngleInRadians - rotation angle
268      * \param NbOfSteps - number of elements to generate from one element
269      */
270     void RotationSweepObject(in SMESH_IDSource  theObject,
271                              in AxisStruct      Axix,
272                              in double          AngleInRadians,
273                              in long            NbOfSteps,
274                              in double          Tolerance);
275     /*!
276      * \brief Same as previous but additionally create groups of elements
277      *  generated from elements belonging to preexisting groups
278      */
279     ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource  theObject,
280                                                in AxisStruct      Axix,
281                                                in double          AngleInRadians,
282                                                in long            NbOfSteps,
283                                                in double          Tolerance);
284     /*!
285      * \brief Genarate dim+1 elements by rotation of the object around axis
286      * \param theObject - object containing elements to ratate
287      * \param Axix - rotation axis
288      * \param AngleInRadians - rotation angle
289      * \param NbOfSteps - number of elements to generate from one element
290      */
291     void RotationSweepObject1D(in SMESH_IDSource  theObject,
292                                in AxisStruct      Axix,
293                                in double          AngleInRadians,
294                                in long            NbOfSteps,
295                                in double          Tolerance);
296     /*!
297      * \brief Same as previous but additionally create groups of elements
298      *  generated from elements belonging to preexisting groups
299      */
300     ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource  theObject,
301                                                  in AxisStruct      Axix,
302                                                  in double          AngleInRadians,
303                                                  in long            NbOfSteps,
304                                                  in double          Tolerance);
305     /*!
306      * \brief Genarate dim+1 elements by rotation of the object around axis
307      * \param theObject - object containing elements to ratate
308      * \param Axix - rotation axis
309      * \param AngleInRadians - rotation angle
310      * \param NbOfSteps - number of elements to generate from one element
311      */
312     void RotationSweepObject2D(in SMESH_IDSource  theObject,
313                                in AxisStruct      Axix,
314                                in double          AngleInRadians,
315                                in long            NbOfSteps,
316                                in double          Tolerance);
317     /*!
318      * \brief Same as previous but additionally create groups of elements
319      *  generated from elements belonging to preexisting groups
320      */
321     ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource  theObject,
322                                                  in AxisStruct      Axix,
323                                                  in double          AngleInRadians,
324                                                  in long            NbOfSteps,
325                                                  in double          Tolerance);
326     /*!
327      * \brief Genarate dim+1 elements by extrusion of elements along vector
328      * \param IDsOfElements - elements to sweep
329      * \param StepVector - vector giving direction and distance of an extrusion step
330      * \param NbOfSteps - number of elements to generate from one element
331      */
332     void ExtrusionSweep(in long_array      IDsOfElements,
333                         in DirStruct       StepVector,
334                         in long            NbOfSteps);
335     /*!
336      * \brief Same as previous but additionally create groups of elements
337      *  generated from elements belonging to preexisting groups
338      */
339     ListOfGroups ExtrusionSweepMakeGroups(in long_array      IDsOfElements,
340                                           in DirStruct       StepVector,
341                                           in long            NbOfSteps);
342    /*!
343     * Generate new elements by extrusion of theElements 
344     * by StepVector by NbOfSteps
345     * param ExtrFlags set flags for performing extrusion
346     * param SewTolerance - uses for comparing locations of nodes if flag
347     *   EXTRUSION_FLAG_SEW is set
348     */
349     void AdvancedExtrusion(in long_array      IDsOfElements,
350                            in DirStruct       StepVector,
351                            in long            NbOfSteps,
352                            in long            ExtrFlags,
353                            in double          SewTolerance);
354     /*!
355      * \brief Same as previous but additionally create groups of elements
356      *  generated from elements belonging to preexisting groups
357      */
358     ListOfGroups AdvancedExtrusionMakeGroups(in long_array      IDsOfElements,
359                                              in DirStruct       StepVector,
360                                              in long            NbOfSteps,
361                                              in long            ExtrFlags,
362                                              in double          SewTolerance);
363
364     void ExtrusionSweepObject(in SMESH_IDSource  theObject,
365                               in DirStruct       StepVector,
366                               in long            NbOfSteps);
367     ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource  theObject,
368                                                 in DirStruct       StepVector,
369                                                 in long            NbOfSteps);
370
371     void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
372                                 in DirStruct      StepVector,
373                                 in long           NbOfSteps);
374     ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
375                                                   in DirStruct      StepVector,
376                                                   in long           NbOfSteps);
377
378     void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
379                                 in DirStruct      StepVector,
380                                 in long           NbOfSteps);
381     ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
382                                                   in DirStruct      StepVector,
383                                                   in long           NbOfSteps);
384
385     enum Extrusion_Error {
386       EXTR_OK,
387       EXTR_NO_ELEMENTS,
388       EXTR_PATH_NOT_EDGE,
389       EXTR_BAD_PATH_SHAPE,
390       EXTR_BAD_STARTING_NODE,
391       EXTR_BAD_ANGLES_NUMBER,
392       EXTR_CANT_GET_TANGENT
393       };
394
395     Extrusion_Error ExtrusionAlongPath(in long_array        IDsOfElements,
396                                        in SMESH_Mesh        PathMesh,
397                                        in GEOM::GEOM_Object PathShape,
398                                        in long              NodeStart,
399                                        in boolean           HasAngles,
400                                        in double_array      Angles,
401                                        in boolean           HasRefPoint,
402                                        in PointStruct       RefPoint);
403     ListOfGroups ExtrusionAlongPathMakeGroups(in long_array        IDsOfElements,
404                                               in SMESH_Mesh        PathMesh,
405                                               in GEOM::GEOM_Object PathShape,
406                                               in long              NodeStart,
407                                               in boolean           HasAngles,
408                                               in double_array      Angles,
409                                               in boolean           HasRefPoint,
410                                               in PointStruct       RefPoint,
411                                               out Extrusion_Error  Error);
412
413     Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource    theObject,
414                                              in SMESH_Mesh        PathMesh,
415                                              in GEOM::GEOM_Object PathShape,
416                                              in long              NodeStart,
417                                              in boolean           HasAngles,
418                                              in double_array      Angles,
419                                              in boolean           HasRefPoint,
420                                              in PointStruct       RefPoint);
421     ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource    theObject,
422                                                     in SMESH_Mesh        PathMesh,
423                                                     in GEOM::GEOM_Object PathShape,
424                                                     in long              NodeStart,
425                                                     in boolean           HasAngles,
426                                                     in double_array      Angles,
427                                                     in boolean           HasRefPoint,
428                                                     in PointStruct       RefPoint,
429                                                     out Extrusion_Error  Error);
430
431     Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource    theObject,
432                                                in SMESH_Mesh        PathMesh,
433                                                in GEOM::GEOM_Object PathShape,
434                                                in long              NodeStart,
435                                                in boolean           HasAngles,
436                                                in double_array      Angles,
437                                                in boolean           HasRefPoint,
438                                                in PointStruct       RefPoint);
439     ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource    theObject,
440                                                       in SMESH_Mesh        PathMesh,
441                                                       in GEOM::GEOM_Object PathShape,
442                                                       in long              NodeStart,
443                                                       in boolean           HasAngles,
444                                                       in double_array      Angles,
445                                                       in boolean           HasRefPoint,
446                                                       in PointStruct       RefPoint,
447                                                       out Extrusion_Error  Error);
448
449     Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource    theObject,
450                                                in SMESH_Mesh        PathMesh,
451                                                in GEOM::GEOM_Object PathShape,
452                                                in long              NodeStart,
453                                                in boolean           HasAngles,
454                                                in double_array      Angles,
455                                                in boolean           HasRefPoint,
456                                                in PointStruct       RefPoint);
457     ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource    theObject,
458                                                       in SMESH_Mesh        PathMesh,
459                                                       in GEOM::GEOM_Object PathShape,
460                                                       in long              NodeStart,
461                                                       in boolean           HasAngles,
462                                                       in double_array      Angles,
463                                                       in boolean           HasRefPoint,
464                                                       in PointStruct       RefPoint,
465                                                       out Extrusion_Error  Error);
466
467    /*!
468     * Compute rotation angles for ExtrusionAlongPath as linear variation
469     * of given angles along path steps
470     * param PathMesh mesh containing a 1D sub-mesh on the edge, along 
471     *                which proceeds the extrusion
472     * param PathShape is shape(edge); as the mesh can be complex, the edge 
473     *                 is used to define the sub-mesh for the path
474     */
475     double_array LinearAnglesVariation(in SMESH_Mesh        PathMesh,
476                                        in GEOM::GEOM_Object PathShape,
477                                        in double_array      Angles);
478
479     enum MirrorType { POINT, AXIS, PLANE };
480
481     void Mirror (in long_array IDsOfElements,
482                  in AxisStruct Mirror,
483                  in MirrorType Type,
484                  in boolean    Copy);
485     ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
486                                    in AxisStruct Mirror,
487                                    in MirrorType Type);
488     SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
489                                in AxisStruct Mirror,
490                                in MirrorType Type,
491                                in boolean    CopyGroups,
492                                in string     MeshName);
493
494     void MirrorObject (in SMESH_IDSource theObject,
495                        in AxisStruct     Mirror,
496                        in MirrorType     Type,
497                        in boolean        Copy);
498     ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
499                                          in AxisStruct     Mirror,
500                                          in MirrorType     Type);
501     SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
502                                      in AxisStruct     Mirror,
503                                      in MirrorType     Type,
504                                      in boolean        CopyGroups,
505                                      in string         MeshName);
506
507     void Translate (in long_array IDsOfElements,
508                     in DirStruct  Vector,
509                     in boolean    Copy);
510     ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
511                                       in DirStruct  Vector);
512     SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
513                                   in DirStruct  Vector,
514                                   in boolean    CopyGroups,
515                                   in string     MeshName);
516
517     void TranslateObject (in SMESH_IDSource theObject,
518                           in DirStruct      Vector,
519                           in boolean        Copy);
520     ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
521                                             in DirStruct      Vector);
522     SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
523                                         in DirStruct      Vector,
524                                         in boolean        CopyGroups,
525                                         in string         MeshName);
526
527     void Rotate (in long_array IDsOfElements,
528                  in AxisStruct Axis,
529                  in double     AngleInRadians,
530                  in boolean    Copy);
531     ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
532                                    in AxisStruct Axis,
533                                    in double     AngleInRadians);
534     SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
535                                in AxisStruct Axis,
536                                in double     AngleInRadians,
537                                in boolean    CopyGroups,
538                                in string     MeshName);
539
540     void RotateObject (in SMESH_IDSource theObject,
541                        in AxisStruct     Axis,
542                        in double         AngleInRadians,
543                        in boolean        Copy);
544     ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
545                                          in AxisStruct     Axis,
546                                          in double         AngleInRadians);
547     SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
548                                      in AxisStruct     Axis,
549                                      in double         AngleInRadians,
550                                      in boolean        CopyGroups,
551                                      in string         MeshName);
552
553     void FindCoincidentNodes (in  double              Tolerance,
554                               out array_of_long_array GroupsOfNodes);
555
556     void FindCoincidentNodesOnPart (in  SMESH_IDSource      SubMeshOrGroup,
557                                     in  double              Tolerance,
558                                     out array_of_long_array GroupsOfNodes);
559
560     void MergeNodes (in array_of_long_array GroupsOfNodes);
561
562     /*!
563      * \brief Find elements built on the same nodes.
564      * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
565      * \return List of groups of equal elements.
566      */
567     void FindEqualElements (in  SMESH_IDSource      MeshOrSubMeshOrGroup,
568                             out array_of_long_array GroupsOfElementsID);
569
570     /*!
571      * \brief Merge elements in each given group.
572      * \param GroupsOfElementsID Groups of elements for merging.
573      */
574     void MergeElements(in array_of_long_array GroupsOfElementsID);
575
576     /*!
577      * \brief Merge equal elements in the whole mesh.
578      */
579     void MergeEqualElements();
580     
581     /*!
582      * If the given ID is a valid node ID (nodeID > 0), just move this node, else
583      * move the node closest to the point to point's location and return ID of the node
584      */
585     long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
586
587     enum Sew_Error {
588       SEW_OK,
589       SEW_BORDER1_NOT_FOUND,
590       SEW_BORDER2_NOT_FOUND,
591       SEW_BOTH_BORDERS_NOT_FOUND,
592       SEW_BAD_SIDE_NODES,
593       SEW_VOLUMES_TO_SPLIT,
594       // for SewSideElements() only:
595       SEW_DIFF_NB_OF_ELEMENTS,
596       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
597       SEW_BAD_SIDE1_NODES,
598       SEW_BAD_SIDE2_NODES
599       };
600
601     Sew_Error SewFreeBorders (in long FirstNodeID1,
602                               in long SecondNodeID1,
603                               in long LastNodeID1,
604                               in long FirstNodeID2,
605                               in long SecondNodeID2,
606                               in long LastNodeID2,
607                               in boolean CreatePolygons,
608                               in boolean CreatePolyedrs);
609
610     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
611                                      in long SecondNodeID1,
612                                      in long LastNodeID1,
613                                      in long FirstNodeID2,
614                                      in long SecondNodeID2);
615
616     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
617                                in long SecondNodeIDOnFreeBorder,
618                                in long LastNodeIDOnFreeBorder,
619                                in long FirstNodeIDOnSide,
620                                in long LastNodeIDOnSide,
621                                in boolean CreatePolygons,
622                                in boolean CreatePolyedrs);
623
624     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
625                                in long_array IDsOfSide2Elements,
626                                in long       NodeID1OfSide1ToMerge,
627                                in long       NodeID1OfSide2ToMerge,
628                                in long       NodeID2OfSide1ToMerge,
629                                in long       NodeID2OfSide2ToMerge);
630
631    /*!
632     * Set new nodes for given element.
633     * If number of nodes is not corresponded to type of
634     * element - returns false
635     */
636     boolean ChangeElemNodes(in long ide, in long_array newIDs);
637
638    /*!
639     * Return data of mesh edition preview which is computed provided 
640     * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
641     */
642     MeshPreviewStruct GetPreviewData();
643
644    /*!
645     * If during last operation of MeshEditor some nodes were
646     * created this method returns list of it's IDs, if new nodes
647     * not creared - returns empty list
648     */
649     long_array GetLastCreatedNodes();
650
651    /*!
652     * If during last operation of MeshEditor some elements were
653     * created this method returns list of it's IDs, if new elements
654     * not creared - returns empty list
655     */
656     long_array GetLastCreatedElems();
657     
658     /*!
659      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
660      * \param theNodes - identifiers of nodes to be doubled
661      * \param theModifiedElems - identifiers of elements to be updated by the new (doubled) 
662      *        nodes. If list of element identifiers is empty then nodes are doubled but 
663      *        they not assigned to elements
664      *        \return TRUE if operation has been completed successfully, FALSE otherwise
665      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
666     */
667     boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ); 
668
669     /*!
670     * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
671     * This method provided for convenience works as DoubleNodes() described above.
672     * \param theNodeId - identifier of node to be doubled.
673     * \param theModifiedElems - identifiers of elements to be updated.
674     * \return TRUE if operation has been completed successfully, FALSE otherwise
675     * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
676     */
677     boolean DoubleNode( in long theNodeId, in long_array theModifiedElems ); 
678
679     /*!
680     * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
681     * This method provided for convenience works as DoubleNodes() described above.
682     * \param theNodes - group of nodes to be doubled.
683     * \param theModifiedElems - group of elements to be updated.
684     * \return TRUE if operation has been completed successfully, FALSE otherwise
685     * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups()
686     */
687     boolean DoubleNodeGroup( in SMESH_GroupBase theNodes, 
688                              in SMESH_GroupBase theModifiedElems );
689
690     /*!
691     \brief Creates a hole in a mesh by doubling the nodes of some particular elements
692     This method provided for convenience works as DoubleNodes() described above.
693     \param theNodes - list of groups of nodes to be doubled
694     \param theModifiedElems - list of groups of elements to be updated.
695     \return TRUE if operation has been completed successfully, FALSE otherwise
696     \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
697     */
698     boolean DoubleNodeGroups( in ListOfGroups theNodes, 
699                               in ListOfGroups theModifiedElems );
700
701   };
702 };
703
704 #endif