Salome HOME
Merge from V6_3_BR 06/06/2011
[modules/smesh.git] / idl / SMESH_MeshEditor.idl
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  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      * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
699      * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
700      */
701     short GetPointState(in double x, in double y, in double z);
702
703     enum Sew_Error {
704       SEW_OK,
705       SEW_BORDER1_NOT_FOUND,
706       SEW_BORDER2_NOT_FOUND,
707       SEW_BOTH_BORDERS_NOT_FOUND,
708       SEW_BAD_SIDE_NODES,
709       SEW_VOLUMES_TO_SPLIT,
710       // for SewSideElements() only:
711       SEW_DIFF_NB_OF_ELEMENTS,
712       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
713       SEW_BAD_SIDE1_NODES,
714       SEW_BAD_SIDE2_NODES
715       };
716
717     Sew_Error SewFreeBorders (in long FirstNodeID1,
718                               in long SecondNodeID1,
719                               in long LastNodeID1,
720                               in long FirstNodeID2,
721                               in long SecondNodeID2,
722                               in long LastNodeID2,
723                               in boolean CreatePolygons,
724                               in boolean CreatePolyedrs);
725
726     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
727                                      in long SecondNodeID1,
728                                      in long LastNodeID1,
729                                      in long FirstNodeID2,
730                                      in long SecondNodeID2);
731
732     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
733                                in long SecondNodeIDOnFreeBorder,
734                                in long LastNodeIDOnFreeBorder,
735                                in long FirstNodeIDOnSide,
736                                in long LastNodeIDOnSide,
737                                in boolean CreatePolygons,
738                                in boolean CreatePolyedrs);
739
740     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
741                                in long_array IDsOfSide2Elements,
742                                in long       NodeID1OfSide1ToMerge,
743                                in long       NodeID1OfSide2ToMerge,
744                                in long       NodeID2OfSide1ToMerge,
745                                in long       NodeID2OfSide2ToMerge);
746
747    /*!
748     * Set new nodes for given element.
749     * If number of nodes is not corresponded to type of
750     * element - returns false
751     */
752     boolean ChangeElemNodes(in long ide, in long_array newIDs);
753
754    /*!
755     * Return data of mesh edition preview which is computed provided
756     * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
757     */
758     MeshPreviewStruct GetPreviewData();
759
760    /*!
761     * If during last operation of MeshEditor some nodes were
762     * created this method returns list of it's IDs, if new nodes
763     * not creared - returns empty list
764     */
765     long_array GetLastCreatedNodes();
766
767    /*!
768     * If during last operation of MeshEditor some elements were
769     * created this method returns list of it's IDs, if new elements
770     * not creared - returns empty list
771     */
772     long_array GetLastCreatedElems();
773
774     /*!
775      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
776      * \param theNodes - identifiers of nodes to be doubled
777      * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
778      *        nodes. If list of element identifiers is empty then nodes are doubled but
779      *        they not assigned to elements
780      *        \return TRUE if operation has been completed successfully, FALSE otherwise
781      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
782      */
783     boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems );
784
785     /*!
786      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
787      * This method provided for convenience works as DoubleNodes() described above.
788      * \param theNodeId - identifier of node to be doubled.
789      * \param theModifiedElems - identifiers of elements to be updated.
790      * \return TRUE if operation has been completed successfully, FALSE otherwise
791      * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
792      */
793     boolean DoubleNode( in long theNodeId, 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 theNodes - group of nodes to be doubled.
799      * \param theModifiedElems - group of elements to be updated.
800      * \return TRUE if operation has been completed successfully, FALSE otherwise
801      * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
802      */
803     boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
804                              in SMESH_GroupBase theModifiedElems );
805
806     /*!
807      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
808      * Works as DoubleNodeGroup() described above, but returns a new group with
809      * newly created nodes.
810      * \param theNodes - group of nodes to be doubled.
811      * \param theModifiedElems - group of elements to be updated.
812      * \return a new group with newly created nodes
813      * \sa DoubleNodeGroup()
814      */
815     SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
816                                     in SMESH_GroupBase theModifiedElems );
817
818     /*!
819      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
820      * This method provided for convenience works as DoubleNodes() described above.
821      * \param theNodes - list of groups of nodes to be doubled
822      * \param theModifiedElems - list of groups of elements to be updated.
823      * \return TRUE if operation has been completed successfully, FALSE otherwise
824      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
825      */
826     boolean DoubleNodeGroups( in ListOfGroups theNodes,
827                               in ListOfGroups theModifiedElems );
828
829     /*!
830      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
831      * Works as DoubleNodeGroups() described above, but returns a new group with
832      * newly created nodes.
833      * \param theNodes - list of groups of nodes to be doubled
834      * \param theModifiedElems - list of groups of elements to be updated.
835      * \return a new group with newly created nodes
836      * \sa DoubleNodeGroups()
837      */
838     SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
839                                      in ListOfGroups theModifiedElems );
840
841     /*!
842      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
843      * \param theElems - the list of elements (edges or faces) to be replicated
844      *        The nodes for duplication could be found from these elements
845      * \param theNodesNot - list of nodes to NOT replicate
846      * \param theAffectedElems - the list of elements (cells and edges) to which the
847      *        replicated nodes should be associated to.
848      * \return TRUE if operation has been completed successfully, FALSE otherwise
849      * \sa DoubleNodeGroup(), DoubleNodeGroups()
850      */
851     boolean DoubleNodeElem( in long_array theElems,
852                             in long_array theNodesNot,
853                             in long_array theAffectedElems );
854
855     /*!
856      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
857      * \param theElems - the list of elements (edges or faces) to be replicated
858      *        The nodes for duplication could be found from these elements
859      * \param theNodesNot - list of nodes to NOT replicate
860      * \param theShape - shape to detect affected elements (element which geometric center
861      *        located on or inside shape).
862      *        The replicated nodes should be associated to affected elements.
863      * \return TRUE if operation has been completed successfully, FALSE otherwise
864      * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
865      */
866     boolean DoubleNodeElemInRegion( in long_array theElems,
867                                     in long_array theNodesNot,
868                                     in GEOM::GEOM_Object theShape );
869
870     /*!
871      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
872      * This method provided for convenience works as DoubleNodes() described above.
873      * \param theElems - group of of elements (edges or faces) to be replicated
874      * \param theNodesNot - group of nodes not to replicated
875      * \param theAffectedElems - group of elements to which the replicated nodes
876      *        should be associated to.
877      * \return TRUE if operation has been completed successfully, FALSE otherwise
878      * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
879      */
880     boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
881                                  in SMESH_GroupBase theNodesNot,
882                                  in SMESH_GroupBase theAffectedElems );
883
884     /*!
885      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
886      * Works as DoubleNodeElemGroup() described above, but returns a new group with
887      * newly created elements.
888      * \param theElems - group of of elements (edges or faces) to be replicated
889      * \param theNodesNot - group of nodes not to replicated
890      * \param theAffectedElems - group of elements to which the replicated nodes
891      *        should be associated to.
892      * \return a new group with newly created elements
893      * \sa DoubleNodeElemGroup()
894      */
895     SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
896                                         in SMESH_GroupBase theNodesNot,
897                                         in SMESH_GroupBase theAffectedElems );
898
899     /*!
900      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
901      * This method provided for convenience works as DoubleNodes() described above.
902      * \param theElems - group of elements (edges or faces) to be replicated
903      * \param theNodesNot - group of nodes not to replicated
904      * \param theShape - shape to detect affected elements (element which geometric center
905      *        located on or inside shape).
906      *        The replicated nodes should be associated to affected elements.
907      * \return TRUE if operation has been completed successfully, FALSE otherwise
908      * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
909      */
910     boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
911                                      in SMESH_GroupBase theNodesNot,
912                                      in GEOM::GEOM_Object theShape );
913
914     /*!
915      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
916      * This method provided for convenience works as DoubleNodes() described above.
917      * \param theElems - list of groups of elements (edges or faces) to be replicated
918      * \param theNodesNot - list of groups of nodes not to replicated
919      * \param theAffectedElems - group of elements to which the replicated nodes
920      *        should be associated to.
921      * \return TRUE if operation has been completed successfully, FALSE otherwise
922      * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
923      */
924     boolean DoubleNodeElemGroups( in ListOfGroups theElems,
925                                   in ListOfGroups theNodesNot,
926                                   in ListOfGroups theAffectedElems );
927
928     /*!
929      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
930      * Works as DoubleNodeElemGroups() described above, but returns a new group with
931      * newly created elements.
932      * \param theElems - list of groups of elements (edges or faces) to be replicated
933      * \param theNodesNot - list of groups of nodes not to replicated
934      * \param theAffectedElems - group of elements to which the replicated nodes
935      *        should be associated to.
936      * \return a new group with newly created elements
937      * \sa DoubleNodeElemGroups()
938      */
939     SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
940                                          in ListOfGroups theNodesNot,
941                                          in ListOfGroups theAffectedElems );
942
943     /*!
944      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
945      * This method provided for convenience works as DoubleNodes() described above.
946      * \param theElems - list of groups of elements (edges or faces) to be replicated
947      * \param theNodesNot - list of groups of nodes not to replicated
948      * \param theShape - shape to detect affected elements (element which geometric center
949      *        located on or inside shape).
950      *        The replicated nodes should be associated to affected elements.
951      * \return TRUE if operation has been completed successfully, FALSE otherwise
952      * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
953      */
954     boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
955                                           in ListOfGroups theNodesNot,
956                                           in GEOM::GEOM_Object theShape );
957
958     /*!
959      * \brief Generates skin mesh (containing 2D cells) from 3D mesh
960      * The created 2D mesh elements based on nodes of free faces of boundary volumes
961      * \return TRUE if operation has been completed successfully, FALSE otherwise
962      */
963     boolean Make2DMeshFrom3D();
964
965     /*!
966      * \brief Creates missing boundary elements
967      *  \param elements - elements whose boundary is to be checked
968      *  \param dimension - defines type of boundary elements to create
969      *    BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
970      *  \param groupName - a name of group to store created boundary elements in,
971      *                     "" means not to create the group
972      *  \param meshName - a name of new mesh to store created boundary elements in,
973      *                     "" means not to create the new mesh
974      *  \param toCopyElements - if true, the checked elements will be copied into the new mesh
975      *                          else only boundary elements will be copied into the new mesh
976      *  \param toCopyExistingBondary - if true, not only new but also pre-existing
977      *                                boundary elements will be copied into the new mesh
978      *  \param group - returns the create group, if any
979      *  \retval SMESH::SMESH_Mesh - the mesh where elements were added to
980      */
981     SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
982                                 in Bnd_Dimension  dimension,
983                                 in string         groupName,
984                                 in string         meshName,
985                                 in boolean        toCopyElements,
986                                 in boolean        toCopyExistingBondary,
987                                 out SMESH_Group   group);
988     /*!
989      * \brief Creates missing boundary elements around either the whole mesh or 
990      *    groups of 2D elements
991      *  \param dimension - defines type of boundary elements to create
992      *  \param groupName - a name of group to store all boundary elements in,
993      *    "" means not to create the group
994      *  \param meshName - a name of a new mesh, which is a copy of the initial 
995      *    mesh + created boundary elements; "" means not to create the new mesh
996      *  \param toCopyAll - if true, the whole initial mesh will be copied into
997      *    the new mesh else only boundary elements will be copied into the new mesh
998      *  \param groups - optional groups of 2D elements to make boundary around
999      *  \param mesh - returns the mesh where elements were added to
1000      *  \param group - returns the created group, if any
1001      *  \retval long - number of added boundary elements
1002      */
1003     long MakeBoundaryElements(in Bnd_Dimension   dimension,
1004                               in string          groupName,
1005                               in string          meshName,
1006                               in boolean         toCopyAll,
1007                               in ListOfIDSources groups,
1008                               out SMESH_Mesh     mesh,
1009                               out SMESH_Group    group) raises (SALOME::SALOME_Exception);
1010
1011     /*!
1012      * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1013      * Flat elements are mainly used by some types of mechanic calculations.
1014      *
1015      * The list of groups must describe a partition of the mesh volumes.
1016      * The nodes of the internal faces at the boundaries of the groups are doubled.
1017      * In option, the internal faces are replaced by flat elements.
1018      * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1019      * \param theDomains - list of groups of volumes
1020      * \param createJointElems - if TRUE, create the elements
1021      * \return TRUE if operation has been completed successfully, FALSE otherwise
1022      */
1023     boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1024                                           in boolean createJointElems );
1025
1026     /*!
1027      * \brief Double nodes on some external faces and create flat elements.
1028      * Flat elements are mainly used by some types of mechanic calculations.
1029      *
1030      * Each group of the list must be constituted of faces.
1031      * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1032      * \param theGroupsOfFaces - list of groups of faces
1033      * \return TRUE if operation has been completed successfully, FALSE otherwise
1034      */
1035     boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces ); 
1036   };
1037 };
1038
1039 #endif