Salome HOME
fd6c63166673ad3659e03c05963dd65e629bf935
[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 //  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 ConvertToQuadraticObject(in boolean        theForce3d, 
288                                   in SMESH_IDSource theObject) 
289       raises (SALOME::SALOME_Exception);
290
291     void ConvertFromQuadraticObject(in SMESH_IDSource theObject)
292       raises (SALOME::SALOME_Exception);
293
294     void RenumberNodes();
295
296     void RenumberElements();
297
298     /*!
299      * \brief Genarate dim+1 elements by rotation of given elements around axis
300      * \param IDsOfElements - elements to ratate
301      * \param Axix - rotation axis
302      * \param AngleInRadians - rotation angle
303      * \param NbOfSteps - number of elements to generate from one element
304      */
305     void RotationSweep(in long_array       IDsOfElements,
306                        in AxisStruct       Axix,
307                        in double           AngleInRadians,
308                        in long             NbOfSteps,
309                        in double           Tolerance);
310     /*!
311      * \brief Same as previous but additionally create groups of elements
312      *  generated from elements belonging to preexisting groups
313      */
314     ListOfGroups RotationSweepMakeGroups(in long_array       IDsOfElements,
315                                          in AxisStruct       Axix,
316                                          in double           AngleInRadians,
317                                          in long             NbOfSteps,
318                                          in double           Tolerance);
319     /*!
320      * \brief Genarate dim+1 elements by rotation of the object around axis
321      * \param theObject - object containing elements to ratate
322      * \param Axix - rotation axis
323      * \param AngleInRadians - rotation angle
324      * \param NbOfSteps - number of elements to generate from one element
325      */
326     void RotationSweepObject(in SMESH_IDSource  theObject,
327                              in AxisStruct      Axix,
328                              in double          AngleInRadians,
329                              in long            NbOfSteps,
330                              in double          Tolerance);
331     /*!
332      * \brief Same as previous but additionally create groups of elements
333      *  generated from elements belonging to preexisting groups
334      */
335     ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource  theObject,
336                                                in AxisStruct      Axix,
337                                                in double          AngleInRadians,
338                                                in long            NbOfSteps,
339                                                in double          Tolerance);
340     /*!
341      * \brief Genarate dim+1 elements by rotation of the object around axis
342      * \param theObject - object containing elements to ratate
343      * \param Axix - rotation axis
344      * \param AngleInRadians - rotation angle
345      * \param NbOfSteps - number of elements to generate from one element
346      */
347     void RotationSweepObject1D(in SMESH_IDSource  theObject,
348                                in AxisStruct      Axix,
349                                in double          AngleInRadians,
350                                in long            NbOfSteps,
351                                in double          Tolerance);
352     /*!
353      * \brief Same as previous but additionally create groups of elements
354      *  generated from elements belonging to preexisting groups
355      */
356     ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource  theObject,
357                                                  in AxisStruct      Axix,
358                                                  in double          AngleInRadians,
359                                                  in long            NbOfSteps,
360                                                  in double          Tolerance);
361     /*!
362      * \brief Genarate dim+1 elements by rotation of the object around axis
363      * \param theObject - object containing elements to ratate
364      * \param Axix - rotation axis
365      * \param AngleInRadians - rotation angle
366      * \param NbOfSteps - number of elements to generate from one element
367      */
368     void RotationSweepObject2D(in SMESH_IDSource  theObject,
369                                in AxisStruct      Axix,
370                                in double          AngleInRadians,
371                                in long            NbOfSteps,
372                                in double          Tolerance);
373     /*!
374      * \brief Same as previous but additionally create groups of elements
375      *  generated from elements belonging to preexisting groups
376      */
377     ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource  theObject,
378                                                  in AxisStruct      Axix,
379                                                  in double          AngleInRadians,
380                                                  in long            NbOfSteps,
381                                                  in double          Tolerance);
382     /*!
383      * \brief Genarate dim+1 elements by extrusion of elements along vector
384      * \param IDsOfElements - elements to sweep
385      * \param StepVector - vector giving direction and distance of an extrusion step
386      * \param NbOfSteps - number of elements to generate from one element
387      */
388     void ExtrusionSweep(in long_array      IDsOfElements,
389                         in DirStruct       StepVector,
390                         in long            NbOfSteps);
391     /*!
392      * \brief Genarate dim+1 elements by extrusion of elements along vector
393      * \param IDsOfElements - elements to sweep
394      * \param StepVector - vector giving direction and distance of an extrusion step
395      * \param NbOfSteps - number of elements to generate from one element
396      */
397     void ExtrusionSweep0D(in long_array    IDsOfElements,
398                         in DirStruct       StepVector,
399                         in long            NbOfSteps);
400     /*!
401      * \brief Same as previous but additionally create groups of elements
402      *  generated from elements belonging to preexisting groups
403      */
404     ListOfGroups ExtrusionSweepMakeGroups(in long_array      IDsOfElements,
405                                           in DirStruct       StepVector,
406                                           in long            NbOfSteps);
407    /*!
408      * \brief Same as previous but elements are nodes
409      */
410     ListOfGroups ExtrusionSweepMakeGroups0D(in long_array      IDsOfElements,
411                                           in DirStruct       StepVector,
412                                           in long            NbOfSteps);
413    /*!
414     * Generate new elements by extrusion of theElements
415     * by StepVector by NbOfSteps
416     * param ExtrFlags set flags for performing extrusion
417     * param SewTolerance - uses for comparing locations of nodes if flag
418     *   EXTRUSION_FLAG_SEW is set
419     */
420     void AdvancedExtrusion(in long_array      IDsOfElements,
421                            in DirStruct       StepVector,
422                            in long            NbOfSteps,
423                            in long            ExtrFlags,
424                            in double          SewTolerance);
425     /*!
426      * \brief Same as previous but additionally create groups of elements
427      *  generated from elements belonging to preexisting groups
428      */
429     ListOfGroups AdvancedExtrusionMakeGroups(in long_array      IDsOfElements,
430                                              in DirStruct       StepVector,
431                                              in long            NbOfSteps,
432                                              in long            ExtrFlags,
433                                              in double          SewTolerance);
434
435     void ExtrusionSweepObject(in SMESH_IDSource  theObject,
436                               in DirStruct       StepVector,
437                               in long            NbOfSteps);
438     ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource  theObject,
439                                                 in DirStruct       StepVector,
440                                                 in long            NbOfSteps);
441
442     void ExtrusionSweepObject0D(in SMESH_IDSource theObject,
443                                 in DirStruct      StepVector,
444                                 in long           NbOfSteps);
445     ListOfGroups ExtrusionSweepObject0DMakeGroups(in SMESH_IDSource theObject,
446                                                   in DirStruct      StepVector,
447                                                   in long           NbOfSteps);
448
449     void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
450                                 in DirStruct      StepVector,
451                                 in long           NbOfSteps);
452     ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
453                                                   in DirStruct      StepVector,
454                                                   in long           NbOfSteps);
455
456     void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
457                                 in DirStruct      StepVector,
458                                 in long           NbOfSteps);
459     ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
460                                                   in DirStruct      StepVector,
461                                                   in long           NbOfSteps);
462
463     enum Extrusion_Error {
464       EXTR_OK,
465       EXTR_NO_ELEMENTS,
466       EXTR_PATH_NOT_EDGE,
467       EXTR_BAD_PATH_SHAPE,
468       EXTR_BAD_STARTING_NODE,
469       EXTR_BAD_ANGLES_NUMBER,
470       EXTR_CANT_GET_TANGENT
471       };
472
473     ListOfGroups ExtrusionAlongPathX(in long_array        IDsOfElements,
474                                      in SMESH_IDSource    Path,
475                                      in long              NodeStart,
476                                      in boolean           HasAngles,
477                                      in double_array      Angles,
478                                      in boolean           LinearVariation,
479                                      in boolean           HasRefPoint,
480                                      in PointStruct       RefPoint,
481                                      in boolean           MakeGroups,
482                                      in ElementType       ElemType,
483                                      out Extrusion_Error  Error);
484
485     ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource    theObject,
486                                         in SMESH_IDSource    Path,
487                                         in long              NodeStart,
488                                         in boolean           HasAngles,
489                                         in double_array      Angles,
490                                         in boolean           LinearVariation,
491                                         in boolean           HasRefPoint,
492                                         in PointStruct       RefPoint,
493                                         in boolean           MakeGroups,
494                                         in ElementType       ElemType,
495                                         out Extrusion_Error  Error);
496
497     Extrusion_Error ExtrusionAlongPath(in long_array        IDsOfElements,
498                                        in SMESH_Mesh        PathMesh,
499                                        in GEOM::GEOM_Object PathShape,
500                                        in long              NodeStart,
501                                        in boolean           HasAngles,
502                                        in double_array      Angles,
503                                        in boolean           HasRefPoint,
504                                        in PointStruct       RefPoint);
505     ListOfGroups ExtrusionAlongPathMakeGroups(in long_array        IDsOfElements,
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                                               out Extrusion_Error  Error);
514
515     Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource    theObject,
516                                              in SMESH_Mesh        PathMesh,
517                                              in GEOM::GEOM_Object PathShape,
518                                              in long              NodeStart,
519                                              in boolean           HasAngles,
520                                              in double_array      Angles,
521                                              in boolean           HasRefPoint,
522                                              in PointStruct       RefPoint);
523     ListOfGroups ExtrusionAlongPathObjectMakeGroups(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                                                     out Extrusion_Error  Error);
532
533     Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource    theObject,
534                                                in SMESH_Mesh        PathMesh,
535                                                in GEOM::GEOM_Object PathShape,
536                                                in long              NodeStart,
537                                                in boolean           HasAngles,
538                                                in double_array      Angles,
539                                                in boolean           HasRefPoint,
540                                                in PointStruct       RefPoint);
541     ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource    theObject,
542                                                       in SMESH_Mesh        PathMesh,
543                                                       in GEOM::GEOM_Object PathShape,
544                                                       in long              NodeStart,
545                                                       in boolean           HasAngles,
546                                                       in double_array      Angles,
547                                                       in boolean           HasRefPoint,
548                                                       in PointStruct       RefPoint,
549                                                       out Extrusion_Error  Error);
550
551     Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource    theObject,
552                                                in SMESH_Mesh        PathMesh,
553                                                in GEOM::GEOM_Object PathShape,
554                                                in long              NodeStart,
555                                                in boolean           HasAngles,
556                                                in double_array      Angles,
557                                                in boolean           HasRefPoint,
558                                                in PointStruct       RefPoint);
559     ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource    theObject,
560                                                       in SMESH_Mesh        PathMesh,
561                                                       in GEOM::GEOM_Object PathShape,
562                                                       in long              NodeStart,
563                                                       in boolean           HasAngles,
564                                                       in double_array      Angles,
565                                                       in boolean           HasRefPoint,
566                                                       in PointStruct       RefPoint,
567                                                       out Extrusion_Error  Error);
568
569    /*!
570     * Compute rotation angles for ExtrusionAlongPath as linear variation
571     * of given angles along path steps
572     * param PathMesh mesh containing a 1D sub-mesh on the edge, along
573     *                which proceeds the extrusion
574     * param PathShape is shape(edge); as the mesh can be complex, the edge
575     *                 is used to define the sub-mesh for the path
576     */
577     double_array LinearAnglesVariation(in SMESH_Mesh        PathMesh,
578                                        in GEOM::GEOM_Object PathShape,
579                                        in double_array      Angles);
580
581     enum MirrorType { POINT, AXIS, PLANE };
582
583     void Mirror (in long_array IDsOfElements,
584                  in AxisStruct Mirror,
585                  in MirrorType Type,
586                  in boolean    Copy);
587     ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
588                                    in AxisStruct Mirror,
589                                    in MirrorType Type);
590     SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
591                                in AxisStruct Mirror,
592                                in MirrorType Type,
593                                in boolean    CopyGroups,
594                                in string     MeshName);
595
596     void MirrorObject (in SMESH_IDSource theObject,
597                        in AxisStruct     Mirror,
598                        in MirrorType     Type,
599                        in boolean        Copy);
600     ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
601                                          in AxisStruct     Mirror,
602                                          in MirrorType     Type);
603     SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
604                                      in AxisStruct     Mirror,
605                                      in MirrorType     Type,
606                                      in boolean        CopyGroups,
607                                      in string         MeshName);
608
609     void Translate (in long_array IDsOfElements,
610                     in DirStruct  Vector,
611                     in boolean    Copy);
612     ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
613                                       in DirStruct  Vector);
614     SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
615                                   in DirStruct  Vector,
616                                   in boolean    CopyGroups,
617                                   in string     MeshName);
618
619     void TranslateObject (in SMESH_IDSource theObject,
620                           in DirStruct      Vector,
621                           in boolean        Copy);
622     ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
623                                             in DirStruct      Vector);
624     SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
625                                         in DirStruct      Vector,
626                                         in boolean        CopyGroups,
627                                         in string         MeshName);
628
629     void Scale (in SMESH_IDSource theObject,
630                 in PointStruct    thePoint,
631                 in double_array   theScaleFact,
632                 in boolean        Copy);
633     ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
634                                   in PointStruct    thePoint,
635                                   in double_array   theScaleFact);
636     SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
637                               in PointStruct    thePoint,
638                               in double_array   theScaleFact,
639                               in boolean        CopyGroups,
640                               in string         MeshName);
641
642     void Rotate (in long_array IDsOfElements,
643                  in AxisStruct Axis,
644                  in double     AngleInRadians,
645                  in boolean    Copy);
646     ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
647                                    in AxisStruct Axis,
648                                    in double     AngleInRadians);
649     SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
650                                in AxisStruct Axis,
651                                in double     AngleInRadians,
652                                in boolean    CopyGroups,
653                                in string     MeshName);
654
655     void RotateObject (in SMESH_IDSource theObject,
656                        in AxisStruct     Axis,
657                        in double         AngleInRadians,
658                        in boolean        Copy);
659     ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
660                                          in AxisStruct     Axis,
661                                          in double         AngleInRadians);
662     SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
663                                      in AxisStruct     Axis,
664                                      in double         AngleInRadians,
665                                      in boolean        CopyGroups,
666                                      in string         MeshName);
667
668     void FindCoincidentNodes (in  double              Tolerance,
669                               out array_of_long_array GroupsOfNodes);
670
671     void FindCoincidentNodesOnPart (in  SMESH_IDSource      SubMeshOrGroup,
672                                     in  double              Tolerance,
673                                     out array_of_long_array GroupsOfNodes);
674
675     void FindCoincidentNodesOnPartBut (in  SMESH_IDSource      SubMeshOrGroup,
676                                        in  double              Tolerance,
677                                        out array_of_long_array GroupsOfNodes,
678                                        in  ListOfIDSources     ExceptSubMeshOrGroups);
679
680     void MergeNodes (in array_of_long_array GroupsOfNodes);
681
682     /*!
683      * \brief Find elements built on the same nodes.
684      * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
685      * \return List of groups of equal elements.
686      */
687     void FindEqualElements (in  SMESH_IDSource      MeshOrSubMeshOrGroup,
688                             out array_of_long_array GroupsOfElementsID);
689
690     /*!
691      * \brief Merge elements in each given group.
692      * \param GroupsOfElementsID Groups of elements for merging.
693      */
694     void MergeElements(in array_of_long_array GroupsOfElementsID);
695
696     /*!
697      * \brief Merge equal elements in the whole mesh.
698      */
699     void MergeEqualElements();
700
701     /*!
702      * If the given ID is a valid node ID (nodeID > 0), just move this node, else
703      * move the node closest to the point to point's location and return ID of the node
704      */
705     long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
706
707     /*!
708      * Return ID of node closest to a given point
709      */
710     long FindNodeClosestTo(in double x, in double y, in double z);
711
712     /*!
713      * Return elements of given type where the given point is IN or ON.
714      *
715      * 'ALL' type means elements of any type excluding nodes and 0D elements
716      */
717     long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
718
719     /*!
720      * Searching among the given elements, return elements of given type 
721      * where the given point is IN or ON.
722      *
723      * 'ALL' type means elements of any type excluding nodes and 0D elements
724      */
725     long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
726                                         in double x, in double y, in double z, 
727                                         in ElementType type);
728
729     /*!
730      * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
731      * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
732      */
733     short GetPointState(in double x, in double y, in double z);
734
735     enum Sew_Error {
736       SEW_OK,
737       SEW_BORDER1_NOT_FOUND,
738       SEW_BORDER2_NOT_FOUND,
739       SEW_BOTH_BORDERS_NOT_FOUND,
740       SEW_BAD_SIDE_NODES,
741       SEW_VOLUMES_TO_SPLIT,
742       // for SewSideElements() only:
743       SEW_DIFF_NB_OF_ELEMENTS,
744       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
745       SEW_BAD_SIDE1_NODES,
746       SEW_BAD_SIDE2_NODES
747       };
748
749     Sew_Error SewFreeBorders (in long FirstNodeID1,
750                               in long SecondNodeID1,
751                               in long LastNodeID1,
752                               in long FirstNodeID2,
753                               in long SecondNodeID2,
754                               in long LastNodeID2,
755                               in boolean CreatePolygons,
756                               in boolean CreatePolyedrs);
757
758     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
759                                      in long SecondNodeID1,
760                                      in long LastNodeID1,
761                                      in long FirstNodeID2,
762                                      in long SecondNodeID2);
763
764     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
765                                in long SecondNodeIDOnFreeBorder,
766                                in long LastNodeIDOnFreeBorder,
767                                in long FirstNodeIDOnSide,
768                                in long LastNodeIDOnSide,
769                                in boolean CreatePolygons,
770                                in boolean CreatePolyedrs);
771
772     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
773                                in long_array IDsOfSide2Elements,
774                                in long       NodeID1OfSide1ToMerge,
775                                in long       NodeID1OfSide2ToMerge,
776                                in long       NodeID2OfSide1ToMerge,
777                                in long       NodeID2OfSide2ToMerge);
778
779    /*!
780     * Set new nodes for given element.
781     * If number of nodes is not corresponded to type of
782     * element - returns false
783     */
784     boolean ChangeElemNodes(in long ide, in long_array newIDs);
785
786    /*!
787     * Return data of mesh edition preview which is computed provided
788     * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
789     */
790     MeshPreviewStruct GetPreviewData();
791
792    /*!
793     * If during last operation of MeshEditor some nodes were
794     * created this method returns list of it's IDs, if new nodes
795     * not creared - returns empty list
796     */
797     long_array GetLastCreatedNodes();
798
799    /*!
800     * If during last operation of MeshEditor some elements were
801     * created this method returns list of it's IDs, if new elements
802     * not creared - returns empty list
803     */
804     long_array GetLastCreatedElems();
805
806     /*!
807      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
808      * \param theNodes - identifiers of nodes to be doubled
809      * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
810      *        nodes. If list of element identifiers is empty then nodes are doubled but
811      *        they not assigned to elements
812      *        \return TRUE if operation has been completed successfully, FALSE otherwise
813      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
814      */
815     boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems );
816
817     /*!
818      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
819      * This method provided for convenience works as DoubleNodes() described above.
820      * \param theNodeId - identifier of node to be doubled.
821      * \param theModifiedElems - identifiers of elements to be updated.
822      * \return TRUE if operation has been completed successfully, FALSE otherwise
823      * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
824      */
825     boolean DoubleNode( in long theNodeId, in long_array theModifiedElems );
826
827     /*!
828      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
829      * This method provided for convenience works as DoubleNodes() described above.
830      * \param theNodes - group of nodes to be doubled.
831      * \param theModifiedElems - group of elements to be updated.
832      * \return TRUE if operation has been completed successfully, FALSE otherwise
833      * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
834      */
835     boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
836                              in SMESH_GroupBase theModifiedElems );
837
838     /*!
839      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
840      * Works as DoubleNodeGroup() described above, but returns a new group with
841      * newly created nodes.
842      * \param theNodes - group of nodes to be doubled.
843      * \param theModifiedElems - group of elements to be updated.
844      * \return a new group with newly created nodes
845      * \sa DoubleNodeGroup()
846      */
847     SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
848                                     in SMESH_GroupBase theModifiedElems );
849
850     /*!
851      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
852      * This method provided for convenience works as DoubleNodes() described above.
853      * \param theNodes - list of groups of nodes to be doubled
854      * \param theModifiedElems - list of groups of elements to be updated.
855      * \return TRUE if operation has been completed successfully, FALSE otherwise
856      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
857      */
858     boolean DoubleNodeGroups( in ListOfGroups theNodes,
859                               in ListOfGroups theModifiedElems );
860
861     /*!
862      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
863      * Works as DoubleNodeGroups() described above, but returns a new group with
864      * newly created nodes.
865      * \param theNodes - list of groups of nodes to be doubled
866      * \param theModifiedElems - list of groups of elements to be updated.
867      * \return a new group with newly created nodes
868      * \sa DoubleNodeGroups()
869      */
870     SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
871                                      in ListOfGroups theModifiedElems );
872
873     /*!
874      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
875      * \param theElems - the list of elements (edges or faces) to be replicated
876      *        The nodes for duplication could be found from these elements
877      * \param theNodesNot - list of nodes to NOT replicate
878      * \param theAffectedElems - the list of elements (cells and edges) to which the
879      *        replicated nodes should be associated to.
880      * \return TRUE if operation has been completed successfully, FALSE otherwise
881      * \sa DoubleNodeGroup(), DoubleNodeGroups()
882      */
883     boolean DoubleNodeElem( in long_array theElems,
884                             in long_array theNodesNot,
885                             in long_array theAffectedElems );
886
887     /*!
888      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
889      * \param theElems - the list of elements (edges or faces) to be replicated
890      *        The nodes for duplication could be found from these elements
891      * \param theNodesNot - list of nodes to NOT replicate
892      * \param theShape - shape to detect affected elements (element which geometric center
893      *        located on or inside shape).
894      *        The replicated nodes should be associated to affected elements.
895      * \return TRUE if operation has been completed successfully, FALSE otherwise
896      * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
897      */
898     boolean DoubleNodeElemInRegion( in long_array theElems,
899                                     in long_array theNodesNot,
900                                     in GEOM::GEOM_Object theShape );
901
902     /*!
903      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
904      * This method provided for convenience works as DoubleNodes() described above.
905      * \param theElems - group of of elements (edges or faces) to be replicated
906      * \param theNodesNot - group of nodes not to replicated
907      * \param theAffectedElems - group of elements to which the replicated nodes
908      *        should be associated to.
909      * \return TRUE if operation has been completed successfully, FALSE otherwise
910      * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
911      */
912     boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
913                                  in SMESH_GroupBase theNodesNot,
914                                  in SMESH_GroupBase theAffectedElems );
915
916     /*!
917      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
918      * Works as DoubleNodeElemGroup() described above, but returns a new group with
919      * newly created elements.
920      * \param theElems - group of of elements (edges or faces) to be replicated
921      * \param theNodesNot - group of nodes not to replicated
922      * \param theAffectedElems - group of elements to which the replicated nodes
923      *        should be associated to.
924      * \return a new group with newly created elements
925      * \sa DoubleNodeElemGroup()
926      */
927     SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
928                                         in SMESH_GroupBase theNodesNot,
929                                         in SMESH_GroupBase theAffectedElems );
930
931     /*!
932      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
933      * This method provided for convenience works as DoubleNodes() described above.
934      * \param theElems - group of elements (edges or faces) to be replicated
935      * \param theNodesNot - group of nodes not to replicated
936      * \param theShape - shape to detect affected elements (element which geometric center
937      *        located on or inside shape).
938      *        The replicated nodes should be associated to affected elements.
939      * \return TRUE if operation has been completed successfully, FALSE otherwise
940      * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
941      */
942     boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
943                                      in SMESH_GroupBase theNodesNot,
944                                      in GEOM::GEOM_Object theShape );
945
946     /*!
947      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
948      * This method provided for convenience works as DoubleNodes() described above.
949      * \param theElems - list of groups of elements (edges or faces) to be replicated
950      * \param theNodesNot - list of groups of nodes not to replicated
951      * \param theAffectedElems - group of elements to which the replicated nodes
952      *        should be associated to.
953      * \return TRUE if operation has been completed successfully, FALSE otherwise
954      * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
955      */
956     boolean DoubleNodeElemGroups( in ListOfGroups theElems,
957                                   in ListOfGroups theNodesNot,
958                                   in ListOfGroups theAffectedElems );
959
960     /*!
961      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
962      * Works as DoubleNodeElemGroups() described above, but returns a new group with
963      * newly created elements.
964      * \param theElems - list of groups of elements (edges or faces) to be replicated
965      * \param theNodesNot - list of groups of nodes not to replicated
966      * \param theAffectedElems - group of elements to which the replicated nodes
967      *        should be associated to.
968      * \return a new group with newly created elements
969      * \sa DoubleNodeElemGroups()
970      */
971     SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
972                                          in ListOfGroups theNodesNot,
973                                          in ListOfGroups theAffectedElems );
974
975     /*!
976      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
977      * This method provided for convenience works as DoubleNodes() described above.
978      * \param theElems - list of groups of elements (edges or faces) to be replicated
979      * \param theNodesNot - list of groups of nodes not to replicated
980      * \param theShape - shape to detect affected elements (element which geometric center
981      *        located on or inside shape).
982      *        The replicated nodes should be associated to affected elements.
983      * \return TRUE if operation has been completed successfully, FALSE otherwise
984      * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
985      */
986     boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
987                                           in ListOfGroups theNodesNot,
988                                           in GEOM::GEOM_Object theShape );
989
990     /*!
991      * \brief Generates skin mesh (containing 2D cells) from 3D mesh
992      * The created 2D mesh elements based on nodes of free faces of boundary volumes
993      * \return TRUE if operation has been completed successfully, FALSE otherwise
994      */
995     boolean Make2DMeshFrom3D();
996
997     /*!
998      * \brief Creates missing boundary elements
999      *  \param elements - elements whose boundary is to be checked
1000      *  \param dimension - defines type of boundary elements to create
1001      *    BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1002      *  \param groupName - a name of group to store created boundary elements in,
1003      *                     "" means not to create the group
1004      *  \param meshName - a name of new mesh to store created boundary elements in,
1005      *                     "" means not to create the new mesh
1006      *  \param toCopyElements - if true, the checked elements will be copied into the new mesh
1007      *                          else only boundary elements will be copied into the new mesh
1008      *  \param toCopyExistingBondary - if true, not only new but also pre-existing
1009      *                                boundary elements will be copied into the new mesh
1010      *  \param group - returns the create group, if any
1011      *  \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1012      */
1013     SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1014                                 in Bnd_Dimension  dimension,
1015                                 in string         groupName,
1016                                 in string         meshName,
1017                                 in boolean        toCopyElements,
1018                                 in boolean        toCopyExistingBondary,
1019                                 out SMESH_Group   group);
1020     /*!
1021      * \brief Creates missing boundary elements around either the whole mesh or 
1022      *    groups of 2D elements
1023      *  \param dimension - defines type of boundary elements to create
1024      *  \param groupName - a name of group to store all boundary elements in,
1025      *    "" means not to create the group
1026      *  \param meshName - a name of a new mesh, which is a copy of the initial 
1027      *    mesh + created boundary elements; "" means not to create the new mesh
1028      *  \param toCopyAll - if true, the whole initial mesh will be copied into
1029      *    the new mesh else only boundary elements will be copied into the new mesh
1030      *  \param groups - optional groups of 2D elements to make boundary around
1031      *  \param mesh - returns the mesh where elements were added to
1032      *  \param group - returns the created group, if any
1033      *  \retval long - number of added boundary elements
1034      */
1035     long MakeBoundaryElements(in Bnd_Dimension   dimension,
1036                               in string          groupName,
1037                               in string          meshName,
1038                               in boolean         toCopyAll,
1039                               in ListOfIDSources groups,
1040                               out SMESH_Mesh     mesh,
1041                               out SMESH_Group    group) raises (SALOME::SALOME_Exception);
1042
1043     /*!
1044      * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1045      * Flat elements are mainly used by some types of mechanic calculations.
1046      *
1047      * The list of groups must describe a partition of the mesh volumes.
1048      * The nodes of the internal faces at the boundaries of the groups are doubled.
1049      * In option, the internal faces are replaced by flat elements.
1050      * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1051      * \param theDomains - list of groups of volumes
1052      * \param createJointElems - if TRUE, create the elements
1053      * \return TRUE if operation has been completed successfully, FALSE otherwise
1054      */
1055     boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1056                                           in boolean createJointElems ) 
1057       raises (SALOME::SALOME_Exception);
1058
1059     /*!
1060      * \brief Double nodes on some external faces and create flat elements.
1061      * Flat elements are mainly used by some types of mechanic calculations.
1062      *
1063      * Each group of the list must be constituted of faces.
1064      * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1065      * \param theGroupsOfFaces - list of groups of faces
1066      * \return TRUE if operation has been completed successfully, FALSE otherwise
1067      */
1068     boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces ); 
1069   };
1070 };
1071
1072 #endif