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