Salome HOME
Update copyright info (2010->2011)
[modules/smesh.git] / idl / SMESH_MeshEditor.idl
1 //  Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SMESH_MeshEditor.idl
24 //
25 #ifndef _SMESH_MESHEDITOR_IDL_
26 #define _SMESH_MESHEDITOR_IDL_
27
28 #include "SMESH_Mesh.idl"
29
30 module SMESH
31 {
32   enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
33   
34   /*!
35    * This interface makes modifications on the Mesh - removing elements and nodes etc.
36    */
37   interface NumericalFunctor;
38   interface SMESH_MeshEditor
39   {
40     /*!
41      * \brief Wrap a sequence of ids in a SMESH_IDSource
42      * \param IDsOfElements list of mesh elements identifiers
43      * \return new ID source object
44      */
45     SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type);
46
47     /*!
48      * \brief Remove mesh elements specified by their identifiers.
49      * \param IDsOfElements list of mesh elements identifiers
50      * \return \c true if elements are correctly removed or \c false otherwise
51      */
52     boolean RemoveElements(in long_array IDsOfElements);
53
54     /*!
55      * \brief Remove mesh nodes specified by their identifiers.
56      * \param IDsOfNodes list of mesh nodes identifiers
57      * \return \c true if nodes are correctly removed or \c false otherwise
58      */
59     boolean RemoveNodes(in long_array IDsOfNodes);
60     
61     /*!
62      * \brief Remove all orphan nodes.
63      * \return number of removed nodes
64      */
65     long RemoveOrphanNodes();
66
67     /*!
68      * \brief Add new node.
69      * \param x X coordinate of new node
70      * \param y Y coordinate of new node
71      * \param z Z coordinate of new node
72      * \return integer identifier of new node
73      */
74     long AddNode(in double x, in double y, in double z);
75
76     /*!
77      *  Create 0D element on the given node.
78      *  \param IdOfNode Node IDs for creation of element.
79      */
80     long Add0DElement(in long IDOfNode);
81
82     /*!
83      *  Create edge, either linear and quadratic (this is determed
84      *  by number of given nodes).
85      *  \param IdsOfNodes List of node IDs for creation of element.
86      *  Needed order of nodes in this list corresponds to description
87      *  of MED. This description is located by the following link:
88      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
89      */
90     long AddEdge(in long_array IDsOfNodes);
91
92     /*!
93      *  Create face, either linear and quadratic (this is determed
94      *  by number of given nodes).
95      *  \param IdsOfNodes List of node IDs for creation of element.
96      *  Needed order of nodes in this list corresponds to description
97      *  of MED. This description is located by the following link:
98      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
99      */
100     long AddFace(in long_array IDsOfNodes);
101
102     long AddPolygonalFace(in long_array IdsOfNodes);
103
104     /*!
105      *  Create volume, either linear and quadratic (this is determed
106      *  by number of given nodes).
107      *  \param IdsOfNodes List of node IDs for creation of element.
108      *  Needed order of nodes in this list corresponds to description
109      *  of MED. This description is located by the following link:
110      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
111      */
112     long AddVolume(in long_array IDsOfNodes);
113
114     /*!
115      *  Create volume of many faces, giving nodes for each face.
116      *  \param IdsOfNodes List of node IDs for volume creation face by face.
117      *  \param Quantities List of integer values, Quantities[i]
118      *         gives quantity of nodes in face number i.
119      */
120     long AddPolyhedralVolume (in long_array IdsOfNodes,
121                               in long_array Quantities);
122
123     /*!
124      *  Create volume of many faces, giving IDs of existing faces.
125      *  \param IdsOfFaces List of face IDs for volume creation.
126      *  \note The created volume will refer only to nodes
127      *        of the given faces, not to the faces itself.
128      */
129     long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
130
131     /*!
132      * \brief Bind a node to a vertex
133       * \param NodeID - node ID
134       * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
135      */
136     void SetNodeOnVertex(in long NodeID, in long VertexID)
137       raises (SALOME::SALOME_Exception);
138     /*!
139      * \brief Store node position on an edge
140       * \param NodeID - node ID
141       * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
142       * \param paramOnEdge - parameter on edge where the node is located
143      */
144     void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
145       raises (SALOME::SALOME_Exception);
146     /*!
147      * \brief Store node position on a face
148       * \param NodeID - node ID
149       * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
150       * \param u - U parameter on face where the node is located
151       * \param v - V parameter on face where the node is located
152      */
153     void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
154       raises (SALOME::SALOME_Exception);
155     /*!
156      * \brief Bind a node to a solid
157       * \param NodeID - node ID
158       * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
159      */
160     void SetNodeInVolume(in long NodeID, in long SolidID)
161       raises (SALOME::SALOME_Exception);
162     /*!
163      * \brief Bind an element to a shape
164       * \param ElementID - element ID
165       * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
166      */
167     void SetMeshElementOnShape(in long ElementID, in long ShapeID)
168       raises (SALOME::SALOME_Exception);
169
170
171     boolean MoveNode(in long NodeID, in double x, in double y, in double z);
172
173     boolean InverseDiag(in long NodeID1, in long NodeID2);
174
175     boolean DeleteDiag(in long NodeID1, in long NodeID2);
176
177     boolean Reorient(in long_array IDsOfElements);
178
179     boolean ReorientObject(in SMESH_IDSource theObject);
180
181     /*!
182      * \brief Fuse neighbour triangles into quadrangles.
183      * \param theElems     The triangles to be fused.
184      * \param theCriterion Is used to choose a neighbour to fuse with.
185      * \param theMaxAngle  Is a max angle between element normals at which fusion
186      *                     is still performed; theMaxAngle is mesured in radians.
187      * \return TRUE in case of success, FALSE otherwise.
188      */
189     boolean TriToQuad (in long_array       IDsOfElements,
190                        in NumericalFunctor Criterion,
191                        in double           MaxAngle);
192
193     /*!
194      * \brief Fuse neighbour triangles into quadrangles.
195      *
196      * Behaves like the above method, taking list of elements from \a theObject
197      */
198     boolean TriToQuadObject (in SMESH_IDSource   theObject,
199                              in NumericalFunctor Criterion,
200                              in double           MaxAngle);
201
202     /*!
203      * \brief Split quadrangles into triangles.
204      * \param theElems     The faces to be splitted.
205      * \param theCriterion Is used to choose a diagonal for splitting.
206      * \return TRUE in case of success, FALSE otherwise.
207      */
208     boolean QuadToTri (in long_array       IDsOfElements,
209                        in NumericalFunctor Criterion);
210
211     /*!
212      * \brief Split quadrangles into triangles.
213      *
214      * Behaves like the above method, taking list of elements from \a theObject
215      */
216     boolean QuadToTriObject (in SMESH_IDSource   theObject,
217                              in NumericalFunctor Criterion);
218
219     /*!
220      * \brief Split quadrangles into triangles.
221      * \param theElems  The faces to be splitted.
222      * \param the13Diag Is used to choose a diagonal for splitting.
223      * \return TRUE in case of success, FALSE otherwise.
224      */
225     boolean SplitQuad (in long_array IDsOfElements,
226                        in boolean    Diag13);
227
228     /*!
229      * \brief Split quadrangles into triangles.
230      *
231      * Behaves like the above method, taking list of elements from \a theObject
232      */
233     boolean SplitQuadObject (in SMESH_IDSource theObject,
234                              in boolean        Diag13);
235
236     /*!
237      *  Find better splitting of the given quadrangle.
238      *  \param IDOfQuad  ID of the quadrangle to be splitted.
239      *  \param Criterion A criterion to choose a diagonal for splitting.
240      *  \return 1 if 1-3 diagonal is better, 2 if 2-4
241      *          diagonal is better, 0 if error occurs.
242      */
243     long BestSplit (in long             IDOfQuad,
244                     in NumericalFunctor Criterion);
245
246     /*!
247      * \brief Split volumic elements into tetrahedrons
248      *  \param elems - elements to split
249      *  \param methodFlags - flags passing splitting method:
250      *         1 - split the hexahedron into 5 tetrahedrons
251      *         2 - split the hexahedron into 6 tetrahedrons
252      *         3 - split the hexahedron into 24 tetrahedrons
253      */
254     void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
255       raises (SALOME::SALOME_Exception);
256
257
258     enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
259
260     boolean Smooth(in long_array    IDsOfElements,
261                    in long_array    IDsOfFixedNodes,
262                    in long          MaxNbOfIterations,
263                    in double        MaxAspectRatio,
264                    in Smooth_Method Method);
265
266     boolean SmoothObject(in SMESH_IDSource  theObject,
267                          in long_array      IDsOfFixedNodes,
268                          in long            MaxNbOfIterations,
269                          in double          MaxAspectRatio,
270                          in Smooth_Method   Method);
271
272     boolean SmoothParametric(in long_array    IDsOfElements,
273                              in long_array    IDsOfFixedNodes,
274                              in long          MaxNbOfIterations,
275                              in double        MaxAspectRatio,
276                              in Smooth_Method Method);
277
278     boolean SmoothParametricObject(in SMESH_IDSource  theObject,
279                                    in long_array      IDsOfFixedNodes,
280                                    in long            MaxNbOfIterations,
281                                    in double          MaxAspectRatio,
282                                    in Smooth_Method   Method);
283
284     void ConvertToQuadratic(in boolean theForce3d);
285
286     boolean ConvertFromQuadratic();
287
288     void RenumberNodes();
289
290     void RenumberElements();
291
292     /*!
293      * \brief Genarate dim+1 elements by rotation of given elements around axis
294      * \param IDsOfElements - elements to ratate
295      * \param Axix - rotation axis
296      * \param AngleInRadians - rotation angle
297      * \param NbOfSteps - number of elements to generate from one element
298      */
299     void RotationSweep(in long_array       IDsOfElements,
300                        in AxisStruct       Axix,
301                        in double           AngleInRadians,
302                        in long             NbOfSteps,
303                        in double           Tolerance);
304     /*!
305      * \brief Same as previous but additionally create groups of elements
306      *  generated from elements belonging to preexisting groups
307      */
308     ListOfGroups RotationSweepMakeGroups(in long_array       IDsOfElements,
309                                          in AxisStruct       Axix,
310                                          in double           AngleInRadians,
311                                          in long             NbOfSteps,
312                                          in double           Tolerance);
313     /*!
314      * \brief Genarate dim+1 elements by rotation of the object around axis
315      * \param theObject - object containing elements to ratate
316      * \param Axix - rotation axis
317      * \param AngleInRadians - rotation angle
318      * \param NbOfSteps - number of elements to generate from one element
319      */
320     void RotationSweepObject(in SMESH_IDSource  theObject,
321                              in AxisStruct      Axix,
322                              in double          AngleInRadians,
323                              in long            NbOfSteps,
324                              in double          Tolerance);
325     /*!
326      * \brief Same as previous but additionally create groups of elements
327      *  generated from elements belonging to preexisting groups
328      */
329     ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource  theObject,
330                                                in AxisStruct      Axix,
331                                                in double          AngleInRadians,
332                                                in long            NbOfSteps,
333                                                in double          Tolerance);
334     /*!
335      * \brief Genarate dim+1 elements by rotation of the object around axis
336      * \param theObject - object containing elements to ratate
337      * \param Axix - rotation axis
338      * \param AngleInRadians - rotation angle
339      * \param NbOfSteps - number of elements to generate from one element
340      */
341     void RotationSweepObject1D(in SMESH_IDSource  theObject,
342                                in AxisStruct      Axix,
343                                in double          AngleInRadians,
344                                in long            NbOfSteps,
345                                in double          Tolerance);
346     /*!
347      * \brief Same as previous but additionally create groups of elements
348      *  generated from elements belonging to preexisting groups
349      */
350     ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource  theObject,
351                                                  in AxisStruct      Axix,
352                                                  in double          AngleInRadians,
353                                                  in long            NbOfSteps,
354                                                  in double          Tolerance);
355     /*!
356      * \brief Genarate dim+1 elements by rotation of the object around axis
357      * \param theObject - object containing elements to ratate
358      * \param Axix - rotation axis
359      * \param AngleInRadians - rotation angle
360      * \param NbOfSteps - number of elements to generate from one element
361      */
362     void RotationSweepObject2D(in SMESH_IDSource  theObject,
363                                in AxisStruct      Axix,
364                                in double          AngleInRadians,
365                                in long            NbOfSteps,
366                                in double          Tolerance);
367     /*!
368      * \brief Same as previous but additionally create groups of elements
369      *  generated from elements belonging to preexisting groups
370      */
371     ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource  theObject,
372                                                  in AxisStruct      Axix,
373                                                  in double          AngleInRadians,
374                                                  in long            NbOfSteps,
375                                                  in double          Tolerance);
376     /*!
377      * \brief Genarate dim+1 elements by extrusion of elements along vector
378      * \param IDsOfElements - elements to sweep
379      * \param StepVector - vector giving direction and distance of an extrusion step
380      * \param NbOfSteps - number of elements to generate from one element
381      */
382     void ExtrusionSweep(in long_array      IDsOfElements,
383                         in DirStruct       StepVector,
384                         in long            NbOfSteps);
385     /*!
386      * \brief Same as previous but additionally create groups of elements
387      *  generated from elements belonging to preexisting groups
388      */
389     ListOfGroups ExtrusionSweepMakeGroups(in long_array      IDsOfElements,
390                                           in DirStruct       StepVector,
391                                           in long            NbOfSteps);
392    /*!
393     * Generate new elements by extrusion of theElements 
394     * by StepVector by NbOfSteps
395     * param ExtrFlags set flags for performing extrusion
396     * param SewTolerance - uses for comparing locations of nodes if flag
397     *   EXTRUSION_FLAG_SEW is set
398     */
399     void AdvancedExtrusion(in long_array      IDsOfElements,
400                            in DirStruct       StepVector,
401                            in long            NbOfSteps,
402                            in long            ExtrFlags,
403                            in double          SewTolerance);
404     /*!
405      * \brief Same as previous but additionally create groups of elements
406      *  generated from elements belonging to preexisting groups
407      */
408     ListOfGroups AdvancedExtrusionMakeGroups(in long_array      IDsOfElements,
409                                              in DirStruct       StepVector,
410                                              in long            NbOfSteps,
411                                              in long            ExtrFlags,
412                                              in double          SewTolerance);
413
414     void ExtrusionSweepObject(in SMESH_IDSource  theObject,
415                               in DirStruct       StepVector,
416                               in long            NbOfSteps);
417     ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource  theObject,
418                                                 in DirStruct       StepVector,
419                                                 in long            NbOfSteps);
420
421     void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
422                                 in DirStruct      StepVector,
423                                 in long           NbOfSteps);
424     ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
425                                                   in DirStruct      StepVector,
426                                                   in long           NbOfSteps);
427
428     void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
429                                 in DirStruct      StepVector,
430                                 in long           NbOfSteps);
431     ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
432                                                   in DirStruct      StepVector,
433                                                   in long           NbOfSteps);
434
435     enum Extrusion_Error {
436       EXTR_OK,
437       EXTR_NO_ELEMENTS,
438       EXTR_PATH_NOT_EDGE,
439       EXTR_BAD_PATH_SHAPE,
440       EXTR_BAD_STARTING_NODE,
441       EXTR_BAD_ANGLES_NUMBER,
442       EXTR_CANT_GET_TANGENT
443       };
444
445     ListOfGroups ExtrusionAlongPathX(in long_array        IDsOfElements,
446                                      in SMESH_IDSource    Path,
447                                      in long              NodeStart,
448                                      in boolean           HasAngles,
449                                      in double_array      Angles,
450                                      in boolean           LinearVariation,
451                                      in boolean           HasRefPoint,
452                                      in PointStruct       RefPoint,
453                                      in boolean           MakeGroups,
454                                      in ElementType       ElemType,
455                                      out Extrusion_Error  Error);
456
457     ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource    theObject,
458                                         in SMESH_IDSource    Path,
459                                         in long              NodeStart,
460                                         in boolean           HasAngles,
461                                         in double_array      Angles,
462                                         in boolean           LinearVariation,
463                                         in boolean           HasRefPoint,
464                                         in PointStruct       RefPoint,
465                                         in boolean           MakeGroups,
466                                         in ElementType       ElemType,
467                                         out Extrusion_Error  Error);
468
469     Extrusion_Error ExtrusionAlongPath(in long_array        IDsOfElements,
470                                        in SMESH_Mesh        PathMesh,
471                                        in GEOM::GEOM_Object PathShape,
472                                        in long              NodeStart,
473                                        in boolean           HasAngles,
474                                        in double_array      Angles,
475                                        in boolean           HasRefPoint,
476                                        in PointStruct       RefPoint);
477     ListOfGroups ExtrusionAlongPathMakeGroups(in long_array        IDsOfElements,
478                                               in SMESH_Mesh        PathMesh,
479                                               in GEOM::GEOM_Object PathShape,
480                                               in long              NodeStart,
481                                               in boolean           HasAngles,
482                                               in double_array      Angles,
483                                               in boolean           HasRefPoint,
484                                               in PointStruct       RefPoint,
485                                               out Extrusion_Error  Error);
486
487     Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource    theObject,
488                                              in SMESH_Mesh        PathMesh,
489                                              in GEOM::GEOM_Object PathShape,
490                                              in long              NodeStart,
491                                              in boolean           HasAngles,
492                                              in double_array      Angles,
493                                              in boolean           HasRefPoint,
494                                              in PointStruct       RefPoint);
495     ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource    theObject,
496                                                     in SMESH_Mesh        PathMesh,
497                                                     in GEOM::GEOM_Object PathShape,
498                                                     in long              NodeStart,
499                                                     in boolean           HasAngles,
500                                                     in double_array      Angles,
501                                                     in boolean           HasRefPoint,
502                                                     in PointStruct       RefPoint,
503                                                     out Extrusion_Error  Error);
504
505     Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource    theObject,
506                                                in SMESH_Mesh        PathMesh,
507                                                in GEOM::GEOM_Object PathShape,
508                                                in long              NodeStart,
509                                                in boolean           HasAngles,
510                                                in double_array      Angles,
511                                                in boolean           HasRefPoint,
512                                                in PointStruct       RefPoint);
513     ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource    theObject,
514                                                       in SMESH_Mesh        PathMesh,
515                                                       in GEOM::GEOM_Object PathShape,
516                                                       in long              NodeStart,
517                                                       in boolean           HasAngles,
518                                                       in double_array      Angles,
519                                                       in boolean           HasRefPoint,
520                                                       in PointStruct       RefPoint,
521                                                       out Extrusion_Error  Error);
522
523     Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource    theObject,
524                                                in SMESH_Mesh        PathMesh,
525                                                in GEOM::GEOM_Object PathShape,
526                                                in long              NodeStart,
527                                                in boolean           HasAngles,
528                                                in double_array      Angles,
529                                                in boolean           HasRefPoint,
530                                                in PointStruct       RefPoint);
531     ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource    theObject,
532                                                       in SMESH_Mesh        PathMesh,
533                                                       in GEOM::GEOM_Object PathShape,
534                                                       in long              NodeStart,
535                                                       in boolean           HasAngles,
536                                                       in double_array      Angles,
537                                                       in boolean           HasRefPoint,
538                                                       in PointStruct       RefPoint,
539                                                       out Extrusion_Error  Error);
540
541    /*!
542     * Compute rotation angles for ExtrusionAlongPath as linear variation
543     * of given angles along path steps
544     * param PathMesh mesh containing a 1D sub-mesh on the edge, along 
545     *                which proceeds the extrusion
546     * param PathShape is shape(edge); as the mesh can be complex, the edge 
547     *                 is used to define the sub-mesh for the path
548     */
549     double_array LinearAnglesVariation(in SMESH_Mesh        PathMesh,
550                                        in GEOM::GEOM_Object PathShape,
551                                        in double_array      Angles);
552
553     enum MirrorType { POINT, AXIS, PLANE };
554
555     void Mirror (in long_array IDsOfElements,
556                  in AxisStruct Mirror,
557                  in MirrorType Type,
558                  in boolean    Copy);
559     ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
560                                    in AxisStruct Mirror,
561                                    in MirrorType Type);
562     SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
563                                in AxisStruct Mirror,
564                                in MirrorType Type,
565                                in boolean    CopyGroups,
566                                in string     MeshName);
567
568     void MirrorObject (in SMESH_IDSource theObject,
569                        in AxisStruct     Mirror,
570                        in MirrorType     Type,
571                        in boolean        Copy);
572     ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
573                                          in AxisStruct     Mirror,
574                                          in MirrorType     Type);
575     SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
576                                      in AxisStruct     Mirror,
577                                      in MirrorType     Type,
578                                      in boolean        CopyGroups,
579                                      in string         MeshName);
580
581     void Translate (in long_array IDsOfElements,
582                     in DirStruct  Vector,
583                     in boolean    Copy);
584     ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
585                                       in DirStruct  Vector);
586     SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
587                                   in DirStruct  Vector,
588                                   in boolean    CopyGroups,
589                                   in string     MeshName);
590
591     void TranslateObject (in SMESH_IDSource theObject,
592                           in DirStruct      Vector,
593                           in boolean        Copy);
594     ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
595                                             in DirStruct      Vector);
596     SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
597                                         in DirStruct      Vector,
598                                         in boolean        CopyGroups,
599                                         in string         MeshName);
600
601     void Scale (in SMESH_IDSource theObject,
602                 in PointStruct    thePoint,
603                 in double_array   theScaleFact,
604                 in boolean        Copy);
605     ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
606                                   in PointStruct    thePoint,
607                                   in double_array   theScaleFact);
608     SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
609                               in PointStruct    thePoint,
610                               in double_array   theScaleFact,
611                               in boolean        CopyGroups,
612                               in string         MeshName);
613
614     void Rotate (in long_array IDsOfElements,
615                  in AxisStruct Axis,
616                  in double     AngleInRadians,
617                  in boolean    Copy);
618     ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
619                                    in AxisStruct Axis,
620                                    in double     AngleInRadians);
621     SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
622                                in AxisStruct Axis,
623                                in double     AngleInRadians,
624                                in boolean    CopyGroups,
625                                in string     MeshName);
626
627     void RotateObject (in SMESH_IDSource theObject,
628                        in AxisStruct     Axis,
629                        in double         AngleInRadians,
630                        in boolean        Copy);
631     ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
632                                          in AxisStruct     Axis,
633                                          in double         AngleInRadians);
634     SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
635                                      in AxisStruct     Axis,
636                                      in double         AngleInRadians,
637                                      in boolean        CopyGroups,
638                                      in string         MeshName);
639
640     void FindCoincidentNodes (in  double              Tolerance,
641                               out array_of_long_array GroupsOfNodes);
642
643     void FindCoincidentNodesOnPart (in  SMESH_IDSource      SubMeshOrGroup,
644                                     in  double              Tolerance,
645                                     out array_of_long_array GroupsOfNodes);
646
647     void FindCoincidentNodesOnPartBut (in  SMESH_IDSource      SubMeshOrGroup,
648                                        in  double              Tolerance,
649                                        out array_of_long_array GroupsOfNodes,
650                                        in  ListOfIDSources     ExceptSubMeshOrGroups);
651
652     void MergeNodes (in array_of_long_array GroupsOfNodes);
653
654     /*!
655      * \brief Find elements built on the same nodes.
656      * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
657      * \return List of groups of equal elements.
658      */
659     void FindEqualElements (in  SMESH_IDSource      MeshOrSubMeshOrGroup,
660                             out array_of_long_array GroupsOfElementsID);
661
662     /*!
663      * \brief Merge elements in each given group.
664      * \param GroupsOfElementsID Groups of elements for merging.
665      */
666     void MergeElements(in array_of_long_array GroupsOfElementsID);
667
668     /*!
669      * \brief Merge equal elements in the whole mesh.
670      */
671     void MergeEqualElements();
672     
673     /*!
674      * If the given ID is a valid node ID (nodeID > 0), just move this node, else
675      * move the node closest to the point to point's location and return ID of the node
676      */
677     long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
678
679     /*!
680      * Return ID of node closest to a given point
681      */
682     long FindNodeClosestTo(in double x, in double y, in double z);
683
684     /*!
685      * Return elements of given type where the given point is IN or ON.
686      *
687      * 'ALL' type means elements of any type excluding nodes and 0D elements
688      */
689     long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
690
691     /*!
692      * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
693      * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
694      */
695     short GetPointState(in double x, in double y, in double z);
696
697     enum Sew_Error {
698       SEW_OK,
699       SEW_BORDER1_NOT_FOUND,
700       SEW_BORDER2_NOT_FOUND,
701       SEW_BOTH_BORDERS_NOT_FOUND,
702       SEW_BAD_SIDE_NODES,
703       SEW_VOLUMES_TO_SPLIT,
704       // for SewSideElements() only:
705       SEW_DIFF_NB_OF_ELEMENTS,
706       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
707       SEW_BAD_SIDE1_NODES,
708       SEW_BAD_SIDE2_NODES
709       };
710
711     Sew_Error SewFreeBorders (in long FirstNodeID1,
712                               in long SecondNodeID1,
713                               in long LastNodeID1,
714                               in long FirstNodeID2,
715                               in long SecondNodeID2,
716                               in long LastNodeID2,
717                               in boolean CreatePolygons,
718                               in boolean CreatePolyedrs);
719
720     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
721                                      in long SecondNodeID1,
722                                      in long LastNodeID1,
723                                      in long FirstNodeID2,
724                                      in long SecondNodeID2);
725
726     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
727                                in long SecondNodeIDOnFreeBorder,
728                                in long LastNodeIDOnFreeBorder,
729                                in long FirstNodeIDOnSide,
730                                in long LastNodeIDOnSide,
731                                in boolean CreatePolygons,
732                                in boolean CreatePolyedrs);
733
734     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
735                                in long_array IDsOfSide2Elements,
736                                in long       NodeID1OfSide1ToMerge,
737                                in long       NodeID1OfSide2ToMerge,
738                                in long       NodeID2OfSide1ToMerge,
739                                in long       NodeID2OfSide2ToMerge);
740
741    /*!
742     * Set new nodes for given element.
743     * If number of nodes is not corresponded to type of
744     * element - returns false
745     */
746     boolean ChangeElemNodes(in long ide, in long_array newIDs);
747
748    /*!
749     * Return data of mesh edition preview which is computed provided 
750     * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
751     */
752     MeshPreviewStruct GetPreviewData();
753
754    /*!
755     * If during last operation of MeshEditor some nodes were
756     * created this method returns list of it's IDs, if new nodes
757     * not creared - returns empty list
758     */
759     long_array GetLastCreatedNodes();
760
761    /*!
762     * If during last operation of MeshEditor some elements were
763     * created this method returns list of it's IDs, if new elements
764     * not creared - returns empty list
765     */
766     long_array GetLastCreatedElems();
767
768     /*!
769      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
770      * \param theNodes - identifiers of nodes to be doubled
771      * \param theModifiedElems - identifiers of elements to be updated by the new (doubled) 
772      *        nodes. If list of element identifiers is empty then nodes are doubled but 
773      *        they not assigned to elements
774      *        \return TRUE if operation has been completed successfully, FALSE otherwise
775      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
776     */
777     boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ); 
778
779     /*!
780     * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
781     * This method provided for convenience works as DoubleNodes() described above.
782     * \param theNodeId - identifier of node to be doubled.
783     * \param theModifiedElems - identifiers of elements to be updated.
784     * \return TRUE if operation has been completed successfully, FALSE otherwise
785     * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
786     */
787     boolean DoubleNode( in long theNodeId, in long_array theModifiedElems ); 
788
789     /*!
790     * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
791     * This method provided for convenience works as DoubleNodes() described above.
792     * \param theNodes - group of nodes to be doubled.
793     * \param theModifiedElems - group of elements to be updated.
794     * \return TRUE if operation has been completed successfully, FALSE otherwise
795     * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
796     */
797     boolean DoubleNodeGroup( in SMESH_GroupBase theNodes, 
798                              in SMESH_GroupBase theModifiedElems );
799
800     /*!
801      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
802      * Works as DoubleNodeGroup() described above, but returns a new group with 
803      * newly created nodes.
804      * \param theNodes - group of nodes to be doubled.
805      * \param theModifiedElems - group of elements to be updated.
806      * \return a new group with newly created nodes
807      * \sa DoubleNodeGroup()
808      */
809     SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes, 
810                                     in SMESH_GroupBase theModifiedElems );
811
812     /*!
813     \brief Creates a hole in a mesh by doubling the nodes of some particular elements
814     This method provided for convenience works as DoubleNodes() described above.
815     \param theNodes - list of groups of nodes to be doubled
816     \param theModifiedElems - list of groups of elements to be updated.
817     \return TRUE if operation has been completed successfully, FALSE otherwise
818     \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
819     */
820     boolean DoubleNodeGroups( in ListOfGroups theNodes, 
821                               in ListOfGroups theModifiedElems );
822     
823     /*!
824      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
825      * \param theElems - the list of elements (edges or faces) to be replicated
826      *        The nodes for duplication could be found from these elements
827      * \param theNodesNot - list of nodes to NOT replicate
828      * \param theAffectedElems - the list of elements (cells and edges) to which the 
829      *        replicated nodes should be associated to.
830      * \return TRUE if operation has been completed successfully, FALSE otherwise
831      * \sa DoubleNodeGroup(), DoubleNodeGroups()
832     */
833     boolean DoubleNodeElem( in long_array theElems,
834                             in long_array theNodesNot,
835                             in long_array theAffectedElems ); 
836
837     /*!
838      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
839      * \param theElems - the list of elements (edges or faces) to be replicated
840      *        The nodes for duplication could be found from these elements
841      * \param theNodesNot - list of nodes to NOT replicate
842      * \param theShape - shape to detect affected elements (element which geometric center
843      *        located on or inside shape).
844      *        The replicated nodes should be associated to affected elements.
845      * \return TRUE if operation has been completed successfully, FALSE otherwise
846      * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
847     */
848     boolean DoubleNodeElemInRegion( in long_array theElems,
849                                     in long_array theNodesNot,
850                                     in GEOM::GEOM_Object theShape );
851
852     /*!
853      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
854      * This method provided for convenience works as DoubleNodes() described above.
855      * \param theElems - group of of elements (edges or faces) to be replicated
856      * \param theNodesNot - group of nodes not to replicated
857      * \param theAffectedElems - group of elements to which the replicated nodes
858      *        should be associated to.
859      * \return TRUE if operation has been completed successfully, FALSE otherwise
860      * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
861     */
862     boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems, 
863                                  in SMESH_GroupBase theNodesNot,
864                                  in SMESH_GroupBase theAffectedElems );
865
866     /*!
867      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
868      * Works as DoubleNodeElemGroup() described above, but returns a new group with 
869      * newly created elements.
870      * \param theElems - group of of elements (edges or faces) to be replicated
871      * \param theNodesNot - group of nodes not to replicated
872      * \param theAffectedElems - group of elements to which the replicated nodes
873      *        should be associated to.
874      * \return a new group with newly created elements
875      * \sa DoubleNodeElemGroup()
876     */
877     SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems, 
878                                         in SMESH_GroupBase theNodesNot,
879                                         in SMESH_GroupBase theAffectedElems );
880     
881     /*!
882      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
883      * This method provided for convenience works as DoubleNodes() described above.
884      * \param theElems - group of elements (edges or faces) to be replicated
885      * \param theNodesNot - group of nodes not to replicated
886      * \param theShape - shape to detect affected elements (element which geometric center
887      *        located on or inside shape).
888      *        The replicated nodes should be associated to affected elements.
889      * \return TRUE if operation has been completed successfully, FALSE otherwise
890      * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
891     */
892     boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems, 
893                                      in SMESH_GroupBase theNodesNot,
894                                      in GEOM::GEOM_Object theShape );
895
896     /*!
897      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
898      * This method provided for convenience works as DoubleNodes() described above.
899      * \param theElems - list of groups of elements (edges or faces) to be replicated
900      * \param theNodesNot - list of groups of nodes not to replicated
901      * \param theAffectedElems - group of elements to which the replicated nodes
902      *        should be associated to.
903      * \return TRUE if operation has been completed successfully, FALSE otherwise
904      * \sa DoubleNodeGroup(), DoubleNodes()
905     */
906     boolean DoubleNodeElemGroups( in ListOfGroups theElems,
907                                   in ListOfGroups theNodesNot,
908                                   in ListOfGroups theAffectedElems );
909
910     /*!
911      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
912      * This method provided for convenience works as DoubleNodes() described above.
913      * \param theElems - list of groups of elements (edges or faces) to be replicated
914      * \param theNodesNot - list of groups of nodes not to replicated
915      * \param theShape - shape to detect affected elements (element which geometric center
916      *        located on or inside shape).
917      *        The replicated nodes should be associated to affected elements.
918      * \return TRUE if operation has been completed successfully, FALSE otherwise
919      * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
920     */
921     boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
922                                           in ListOfGroups theNodesNot,
923                                           in GEOM::GEOM_Object theShape );
924
925     /*!
926      * \brief Generates skin mesh (containing 2D cells) from 3D mesh
927      * The created 2D mesh elements based on nodes of free faces of boundary volumes
928      * \return TRUE if operation has been completed successfully, FALSE otherwise
929      */
930     boolean Make2DMeshFrom3D();
931
932     /*!
933      * \brief Creates missing boundary elements
934      *  \param elements - elements whose boundary is to be checked
935      *  \param dimension - defines type of boundary elements to create
936      *  \param groupName - a name of group to store created boundary elements in,
937      *                     "" means not to create the group
938      *  \param meshName - a name of new mesh to store created boundary elements in,
939      *                     "" means not to create the new mesh
940      *  \param toCopyElements - if true, the checked elements will be copied into the new mesh
941      *  \param toCopyExistingBondary - if true, not only new but also pre-existing 
942      *                                boundary elements will be copied into the new mesh
943      *  \param group - returns the create group, if any
944      *  \retval SMESH::SMESH_Mesh - the mesh where elements were added to
945      */
946     SMESH::SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
947                                        in Bnd_Dimension  dimension, 
948                                        in string         groupName,
949                                        in string         meshName,
950                                        in boolean        toCopyElements,
951                                        in boolean        toCopyExistingBondary,
952                                        out SMESH_Group   group);
953
954   };
955 };
956
957 #endif