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