Salome HOME
9491b921400eddaaff9a5fdf5162a4f1c027ea89
[modules/smesh.git] / idl / SMESH_MeshEditor.idl
1 // Copyright (C) 2007-2016  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, or (at your option) any later version.
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 #include "SMESH_Gen.idl"
29
30 module SMESH
31 {
32   interface NumericalFunctor;
33
34   enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
35
36
37   struct FreeBorder
38   {
39     SMESH::long_array nodeIDs; // all nodes defining a free border
40     // 1st and last node is same in a closed border
41   };
42   struct FreeBorderPart
43   {
44     short border; // border index within a sequence<FreeBorder>
45     long  node1;  // node index within the border-th FreeBorder
46     long  node2;
47     long  nodeLast;
48   };
49   typedef sequence<FreeBorder>       ListOfFreeBorders;
50   typedef sequence<FreeBorderPart>   FreeBordersGroup;
51   typedef sequence<FreeBordersGroup> ListOfFreeBorderGroups;
52
53   struct CoincidentFreeBorders
54   {
55     ListOfFreeBorders      borders;          // nodes of all free borders
56     ListOfFreeBorderGroups coincidentGroups; // groups of coincident parts of borders
57   };
58
59
60   // structure used in MakePolyLine() to define a cutting plane
61   struct PolySegment
62   {
63     // a point is defined as follows:
64     // ( node*ID1 > 0 && node*ID2 > 0 ) ==> point is in the middle of an edge defined by two nodes
65     // ( node*ID1 > 0 && node*ID2 <=0 ) ==> point is at node*ID1
66     // else                             ==> point is at xyz*
67
68     // point 1
69     long node1ID1;
70     long node1ID2;
71     PointStruct xyz1;
72
73     // point 2
74     long node2ID1;
75     long node2ID2;
76     PointStruct xyz2;
77
78     // vector on the plane; to use a default plane set vector = (0,0,0)
79     DirStruct vector;
80   };
81   typedef sequence<PolySegment> ListOfPolySegments;
82
83   // face edge defined by two nodes + optional medium node
84   struct FaceEdge
85   {
86     long node1;
87     long node2;
88     long medium;
89   };
90   typedef sequence<FaceEdge> ListOfEdges;
91
92
93   /*!
94    * This interface makes modifications on the Mesh - removing elements and nodes etc.
95    * Also provides some analysis functions.
96    */
97   interface SMESH_MeshEditor
98   {
99    /*!
100     * Returns a mesh subject to edition
101     */
102     SMESH_Mesh GetMesh();
103
104    /*!
105     * Return data of mesh edition preview which is computed provided
106     * that the editor was obtained through SMESH_Mesh::GetMeshEditPreviewer()
107     */
108     MeshPreviewStruct GetPreviewData() raises (SALOME::SALOME_Exception);
109
110    /*!
111     * If during last operation of MeshEditor some nodes were
112     * created, this method returns list of their IDs, if new nodes
113     * not created - returns empty list
114     */
115     long_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception);
116
117    /*!
118     * If during last operation of MeshEditor some elements were
119     * created, this method returns list of their IDs, if new elements
120     * not created - returns empty list
121     */
122     long_array GetLastCreatedElems() raises (SALOME::SALOME_Exception);
123
124     /*!
125      * \brief Clears sequences of last created elements and nodes 
126      */
127     void ClearLastCreated() raises (SALOME::SALOME_Exception);
128
129     /*!
130      * \brief Returns description of an error/warning occurred during the last operation
131      */
132     ComputeError GetLastError() raises (SALOME::SALOME_Exception);
133
134     /*!
135      * \brief Wrap a sequence of ids in a SMESH_IDSource
136      * \param IDsOfElements list of mesh elements identifiers
137      * \return new ID source object
138      */
139     SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type);
140
141     /*!
142      * \brief Remove mesh elements specified by their identifiers.
143      * \param IDsOfElements list of mesh elements identifiers
144      * \return \c true if elements are correctly removed or \c false otherwise
145      */
146     boolean RemoveElements(in long_array IDsOfElements) raises (SALOME::SALOME_Exception);
147
148     /*!
149      * \brief Remove mesh nodes specified by their identifiers.
150      * \param IDsOfNodes list of mesh nodes identifiers
151      * \return \c true if nodes are correctly removed or \c false otherwise
152      */
153     boolean RemoveNodes(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
154
155     /*!
156      * \brief Remove all orphan nodes.
157      * \return number of removed nodes
158      */
159     long RemoveOrphanNodes() raises (SALOME::SALOME_Exception);
160
161     /*!
162      * \brief Add a new node.
163      * \param x X coordinate of new node
164      * \param y Y coordinate of new node
165      * \param z Z coordinate of new node
166      * \return integer identifier of new node
167      */
168     long AddNode(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
169
170     /*!
171      *  Create a 0D element on the given node.
172      *  \param IdOfNode Node IDs for creation of element.
173      *  \param DuplicateElements to add one more 0D element to a node or not
174      */
175     long Add0DElement(in long    IDOfNode,
176                       in boolean DuplicateElements) raises (SALOME::SALOME_Exception);
177
178     /*!
179      *  Create a ball element on the given node.
180      *  \param IdOfNode Node IDs for creation of element.
181      */
182     long AddBall(in long IDOfNode, in double diameter) raises (SALOME::SALOME_Exception);
183
184     /*!
185      *  Create an edge, either linear and quadratic (this is determed
186      *  by number of given nodes, two or three).
187      *  \param IdsOfNodes List of node IDs for creation of element.
188      *  Needed order of nodes in this list corresponds to description
189      *  of MED. This description is located by the following link:
190      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
191      */
192     long AddEdge(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
193
194     /*!
195      *  Create face, either linear and quadratic (this is determed
196      *  by number of given nodes).
197      *  \param IdsOfNodes List of node IDs for creation of element.
198      *  Needed order of nodes in this list corresponds to description
199      *  of MED. This description is located by the following link:
200      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
201      */
202     long AddFace(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
203
204     long AddPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception);
205
206     /*!
207      * Create a quadratic polygonal face
208      *  \param IdsOfNodes - nodes of the polygon; corner nodes follow first
209      *  \return long - ID of a new polygon
210      */
211     long AddQuadPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception);
212
213     /*!
214      *  Create volume, either linear and quadratic (this is determed
215      *  by number of given nodes).
216      *  \param IdsOfNodes List of node IDs for creation of element.
217      *  Needed order of nodes in this list corresponds to description
218      *  of MED. This description is located by the following link:
219      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
220      */
221     long AddVolume(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception);
222
223     /*!
224      *  Create volume of many faces, giving nodes for each face.
225      *  \param IdsOfNodes List of node IDs for volume creation face by face.
226      *  \param Quantities List of integer values, Quantities[i]
227      *         gives quantity of nodes in face number i.
228      */
229     long AddPolyhedralVolume (in long_array IdsOfNodes,
230                               in long_array Quantities) raises (SALOME::SALOME_Exception);
231     /*!
232      *  Create volume of many faces, giving IDs of existing faces.
233      *  \param IdsOfFaces List of face IDs for volume creation.
234      *  \note The created volume will refer only to nodes
235      *        of the given faces, not to the faces itself.
236      */
237     long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces) raises (SALOME::SALOME_Exception);
238
239     /*!
240      * Create 0D elements on all nodes of the given object.
241      *  \param theObject object on whose nodes 0D elements will be created.
242      *  \param theGroupName optional name of a group to add 0D elements created
243      *         and/or found on nodes of \a theObject.
244      *  \param theDuplicateElements to add one more 0D element to a node or not
245      *  \return an object (a new group or a temporary SMESH_IDSource) holding
246      *          ids of new and/or found 0D elements.
247      */
248     SMESH_IDSource Create0DElementsOnAllNodes(in SMESH_IDSource theObject,
249                                               in string         theGroupName,
250                                               in boolean        theDuplicateElements)
251       raises (SALOME::SALOME_Exception);
252
253     /*!
254      * \brief Bind a node to a vertex
255       * \param NodeID - node ID
256       * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
257      */
258     void SetNodeOnVertex(in long NodeID, in long VertexID)
259       raises (SALOME::SALOME_Exception);
260     /*!
261      * \brief Store node position on an edge
262       * \param NodeID - node ID
263       * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
264       * \param paramOnEdge - parameter on edge where the node is located
265      */
266     void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
267       raises (SALOME::SALOME_Exception);
268     /*!
269      * \brief Store node position on a face
270       * \param NodeID - node ID
271       * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
272       * \param u - U parameter on face where the node is located
273       * \param v - V parameter on face where the node is located
274      */
275     void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
276       raises (SALOME::SALOME_Exception);
277     /*!
278      * \brief Bind a node to a solid
279       * \param NodeID - node ID
280       * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
281      */
282     void SetNodeInVolume(in long NodeID, in long SolidID)
283       raises (SALOME::SALOME_Exception);
284     /*!
285      * \brief Bind an element to a shape
286       * \param ElementID - element ID
287       * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
288      */
289     void SetMeshElementOnShape(in long ElementID, in long ShapeID)
290       raises (SALOME::SALOME_Exception);
291
292
293     boolean MoveNode(in long NodeID, in double x, in double y, in double z)
294       raises (SALOME::SALOME_Exception);
295
296     boolean InverseDiag(in long NodeID1, in long NodeID2) 
297       raises (SALOME::SALOME_Exception);
298
299     boolean DeleteDiag(in long NodeID1, in long NodeID2) 
300       raises (SALOME::SALOME_Exception);
301
302     boolean Reorient(in long_array IDsOfElements) 
303       raises (SALOME::SALOME_Exception);
304
305     boolean ReorientObject(in SMESH_IDSource theObject) 
306       raises (SALOME::SALOME_Exception);
307     /*!
308      * \brief Reorient faces contained in \a the2Dgroup.
309      * \param the2Dgroup - the mesh or its part to reorient
310      * \param theDirection - desired direction of normal of \a theFace
311      * \param theFace - ID of face whose orientation is checked.
312      *        It can be < 1 then \a thePoint is used to find a face.
313      * \param thePoint - is used to find a face if \a theFace < 1.
314      * \return number of reoriented faces.
315      */
316     long Reorient2D(in SMESH_IDSource the2Dgroup,
317                     in DirStruct      theDirection,
318                     in long           theFace,
319                     in PointStruct    thePoint) raises (SALOME::SALOME_Exception);
320     /*!
321      * \brief Reorient faces basing on orientation of adjacent volumes.
322      * \param faces - a list of objects containing face to reorient
323      * \param volumes - an object containing volumes.
324      * \param outsideNormal - to orient faces to have their normal 
325      *        pointing either \a outside or \a inside the adjacent volumes.
326      * \return number of reoriented faces.
327      */
328     long Reorient2DBy3D(in ListOfIDSources faces,
329                         in SMESH_IDSource  volumes,
330                         in boolean         outsideNormal) raises (SALOME::SALOME_Exception);
331
332     /*!
333      * \brief Fuse neighbour triangles into quadrangles.
334      * \param IDsOfElements Ids of triangles to be fused.
335      * \param theCriterion Is used to choose a neighbour to fuse with.
336      * \param theMaxAngle  Is a max angle between element normals at which fusion
337      *                     is still performed; theMaxAngle is measured in radians.
338      * \return \c true in case of success, FALSE otherwise.
339      */
340     boolean TriToQuad (in long_array       IDsOfElements,
341                        in NumericalFunctor Criterion,
342                        in double           MaxAngle) raises (SALOME::SALOME_Exception);
343     /*!
344      * \brief Fuse neighbour triangles into quadrangles.
345      *
346      * Behaves like the above method, taking a list of elements from \a theObject
347      */
348     boolean TriToQuadObject (in SMESH_IDSource   theObject,
349                              in NumericalFunctor Criterion,
350                              in double           MaxAngle) raises (SALOME::SALOME_Exception);
351
352     /*!
353      * \brief Split quadrangles into triangles.
354      * \param IDsOfElements Ids of quadrangles to split.
355      * \param theCriterion Is used to choose a diagonal for splitting.
356      * \return TRUE in case of success, FALSE otherwise.
357      */
358     boolean QuadToTri (in long_array       IDsOfElements,
359                        in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
360     /*!
361      * \brief Split quadrangles into triangles.
362      *
363      * Behaves like the above method, taking a list of elements from \a theObject
364      */
365     boolean QuadToTriObject (in SMESH_IDSource   theObject,
366                              in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
367     /*!
368      * \brief Split each of quadrangles into 4 triangles.
369      * \param theQuads Container of quadrangles to split.
370      */
371     void QuadTo4Tri (in SMESH_IDSource theQuads) raises (SALOME::SALOME_Exception);
372
373     /*!
374      * \brief Split quadrangles into triangles.
375      * \param theElems  The faces to be split.
376      * \param the13Diag Is used to choose a diagonal for splitting.
377      * \return TRUE in case of success, FALSE otherwise.
378      */
379     boolean SplitQuad (in long_array IDsOfElements,
380                        in boolean    Diag13) raises (SALOME::SALOME_Exception);
381     /*!
382      * \brief Split quadrangles into triangles.
383      *
384      * Behaves like the above method, taking list of elements from \a theObject
385      */
386     boolean SplitQuadObject (in SMESH_IDSource theObject,
387                              in boolean        Diag13) raises (SALOME::SALOME_Exception);
388
389     /*!
390      *  Find better splitting of the given quadrangle.
391      *  \param IDOfQuad  ID of the quadrangle to be split.
392      *  \param Criterion A criterion to choose a diagonal for splitting.
393      *  \return 1 if 1-3 diagonal is better, 2 if 2-4
394      *          diagonal is better, 0 if error occurs.
395      */
396     long BestSplit (in long             IDOfQuad,
397                     in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
398
399     /*!
400      * \brief Split volumic elements into tetrahedrons
401      *  \param elems - elements to split
402      *  \param methodFlags - flags passing splitting method:
403      *         1 - split the hexahedron into 5 tetrahedrons
404      *         2 - split the hexahedron into 6 tetrahedrons
405      *         3 - split the hexahedron into 24 tetrahedrons
406      */
407     void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
408       raises (SALOME::SALOME_Exception);
409
410     /*!
411      * \brief Split hexahedra into triangular prisms
412      *  \param elems - elements to split
413      *  \param startHexPoint - a point used to find a hexahedron for which \a facetToSplitNormal
414      *         gives a normal vector defining facets to split into triangles.
415      *  \param facetToSplitNormal - normal used to find a facet of hexahedron
416      *         to split into triangles.
417      *  \param methodFlags - flags passing splitting method:
418      *         1 - split the hexahedron into 2 prisms
419      *         2 - split the hexahedron into 4 prisms
420      *  \param allDomains - if \c False, only hexahedra adjacent to one closest
421      *         to \a facetToSplitNormal location are split, else \a facetToSplitNormal
422      *         is used to find the facet to split in all domains present in \a elems.
423      */
424     void SplitHexahedraIntoPrisms(in SMESH_IDSource     elems,
425                                   in SMESH::PointStruct startHexPoint,
426                                   in SMESH::DirStruct   facetToSplitNormal,
427                                   in short              methodFlags,
428                                   in boolean            allDomains)
429       raises (SALOME::SALOME_Exception);
430
431     /*!
432      * \brief Split bi-quadratic elements into linear ones without creation of additional nodes.
433      *   - bi-quadratic triangle will be split into 3 linear quadrangles;
434      *   - bi-quadratic quadrangle will be split into 4 linear quadrangles;
435      *   - tri-quadratic hexahedron will be split into 8 linear hexahedra;
436      *   Quadratic elements of lower dimension  adjacent to the split bi-quadratic element
437      *   will be split in order to keep the mesh conformal.
438      *  \param elems - elements to split
439      */
440     void SplitBiQuadraticIntoLinear(in ListOfIDSources elems)
441       raises (SALOME::SALOME_Exception);
442
443
444     enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
445
446     boolean Smooth(in long_array    IDsOfElements,
447                    in long_array    IDsOfFixedNodes,
448                    in long          MaxNbOfIterations,
449                    in double        MaxAspectRatio,
450                    in Smooth_Method Method) raises (SALOME::SALOME_Exception);
451
452     boolean SmoothObject(in SMESH_IDSource  theObject,
453                          in long_array      IDsOfFixedNodes,
454                          in long            MaxNbOfIterations,
455                          in double          MaxAspectRatio,
456                          in Smooth_Method   Method) raises (SALOME::SALOME_Exception);
457
458     boolean SmoothParametric(in long_array    IDsOfElements,
459                              in long_array    IDsOfFixedNodes,
460                              in long          MaxNbOfIterations,
461                              in double        MaxAspectRatio,
462                              in Smooth_Method Method) raises (SALOME::SALOME_Exception);
463
464     boolean SmoothParametricObject(in SMESH_IDSource  theObject,
465                                    in long_array      IDsOfFixedNodes,
466                                    in long            MaxNbOfIterations,
467                                    in double          MaxAspectRatio,
468                                    in Smooth_Method   Method) raises (SALOME::SALOME_Exception);
469
470     void ConvertToQuadratic(in boolean theForce3d) 
471       raises (SALOME::SALOME_Exception);
472     void ConvertToQuadraticObject(in boolean        theForce3d, 
473                                   in SMESH_IDSource theObject) 
474       raises (SALOME::SALOME_Exception);
475     
476     boolean ConvertFromQuadratic() 
477       raises (SALOME::SALOME_Exception);
478     void    ConvertFromQuadraticObject(in SMESH_IDSource theObject)
479       raises (SALOME::SALOME_Exception);
480
481     void ConvertToBiQuadratic(in boolean        theForce3d,
482                               in SMESH_IDSource theObject)
483       raises (SALOME::SALOME_Exception);
484
485     void RenumberNodes() raises (SALOME::SALOME_Exception);
486
487     void RenumberElements() raises (SALOME::SALOME_Exception);
488
489     /*!
490      * \brief Generate dim+1 elements by rotation of the object around axis
491      *  \param Nodes - nodes to revolve: a list including groups, sub-meshes or a mesh
492      *  \param Edges - edges to revolve: a list including groups, sub-meshes or a mesh
493      *  \param Faces - faces to revolve: a list including groups, sub-meshes or a mesh
494      *  \param Axis - rotation axis
495      *  \param AngleInRadians - rotation angle
496      *  \param NbOfSteps - number of elements to generate from one element
497      *  \param ToMakeGroups - if true, new elements will be included into new groups
498      *         corresponding to groups the input elements included in.
499      *  \return ListOfGroups - new groups created if \a ToMakeGroups is true
500      */
501     ListOfGroups RotationSweepObjects(in ListOfIDSources Nodes,
502                                       in ListOfIDSources Edges,
503                                       in ListOfIDSources Faces,
504                                       in AxisStruct      Axis,
505                                       in double          AngleInRadians,
506                                       in long            NbOfSteps,
507                                       in double          Tolerance,
508                                       in boolean         ToMakeGroups)
509       raises (SALOME::SALOME_Exception);
510
511     /*!
512      * \brief Generate dim+1 elements by extrusion of elements along vector
513      *  \param nodes - nodes to extrude: a list including groups, sub-meshes or a mesh
514      *  \param edges - edges to extrude: a list including groups, sub-meshes or a mesh
515      *  \param faces - faces to extrude: a list including groups, sub-meshes or a mesh
516      *  \param stepVector - vector giving direction and distance of an extrusion step
517      *  \param nbOfSteps - number of elements to generate from one element
518      *  \param toMakeGroups - if true, new elements will be included into new groups
519      *         corresponding to groups the input elements included in.
520      *  \return ListOfGroups - new groups created if \a toMakeGroups is true
521      */
522     ListOfGroups ExtrusionSweepObjects(in ListOfIDSources nodes,
523                                        in ListOfIDSources edges,
524                                        in ListOfIDSources faces,
525                                        in DirStruct       stepVector,
526                                        in long            nbOfSteps,
527                                        in double_array    scaleFactors,
528                                        in boolean         linearVariation,
529                                        in double_array    basePoint,
530                                        in boolean         toMakeGroups)
531       raises (SALOME::SALOME_Exception);
532
533     /*! Generates new elements by extrusion along the normal to a discretized surface or wire
534      */
535     ListOfGroups ExtrusionByNormal(in ListOfIDSources theObjects,
536                                    in double          stepSize,
537                                    in long            nbOfSteps,
538                                    in boolean         byAverageNormal,
539                                    in boolean         useInputElemsOnly,
540                                    in boolean         makeGroups,
541                                    in short           dim)
542       raises (SALOME::SALOME_Exception);
543
544     /*!
545      * Generate new elements by extrusion of theElements
546      * by StepVector by NbOfSteps
547      *  \param ExtrFlags set flags for performing extrusion
548      *  \param SewTolerance - uses for comparing locations of nodes if flag
549      *         EXTRUSION_FLAG_SEW is set
550      *  \param ToMakeGroups - if true, new elements will be included into new groups
551      *         corresponding to groups the input elements included in.
552      *  \return ListOfGroups - new groups created if \a ToMakeGroups is true
553      */
554     ListOfGroups AdvancedExtrusion(in long_array IDsOfElements,
555                                    in DirStruct  StepVector,
556                                    in long       NbOfSteps,
557                                    in long       ExtrFlags,
558                                    in double     SewTolerance,
559                                    in boolean    ToMakeGroups)
560       raises (SALOME::SALOME_Exception);
561
562     enum Extrusion_Error {
563       EXTR_OK,
564       EXTR_NO_ELEMENTS,
565       EXTR_PATH_NOT_EDGE,
566       EXTR_BAD_PATH_SHAPE,
567       EXTR_BAD_STARTING_NODE,
568       EXTR_BAD_ANGLES_NUMBER,
569       EXTR_CANT_GET_TANGENT
570     };
571
572     ListOfGroups ExtrusionAlongPathObjects(in ListOfIDSources Nodes,
573                                            in ListOfIDSources Edges,
574                                            in ListOfIDSources Faces,
575                                            in SMESH_IDSource    Path,
576                                            in GEOM::GEOM_Object PathShape,
577                                            in long              NodeStart,
578                                            in boolean           HasAngles,
579                                            in double_array      Angles,
580                                            in boolean           LinearVariation,
581                                            in boolean           HasRefPoint,
582                                            in PointStruct       RefPoint,
583                                            in boolean           MakeGroups,
584                                            out Extrusion_Error  Error)
585       raises (SALOME::SALOME_Exception);
586
587    /*!
588     * Compute rotation angles for ExtrusionAlongPath as linear variation
589     * of given angles along path steps
590     * param PathMesh mesh containing a 1D sub-mesh on the edge, along
591     *                which proceeds the extrusion
592     * param PathShape is shape(edge); as the mesh can be complex, the edge
593     *                 is used to define the sub-mesh for the path
594     */
595     double_array LinearAnglesVariation(in SMESH_Mesh        PathMesh,
596                                        in GEOM::GEOM_Object PathShape,
597                                        in double_array      Angles);
598
599     enum MirrorType { POINT, AXIS, PLANE };
600
601     void Mirror (in long_array IDsOfElements,
602                  in AxisStruct Mirror,
603                  in MirrorType Type,
604                  in boolean    Copy) 
605       raises (SALOME::SALOME_Exception);
606     ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
607                                    in AxisStruct Mirror,
608                                    in MirrorType Type) 
609       raises (SALOME::SALOME_Exception);
610     SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
611                                in AxisStruct Mirror,
612                                in MirrorType Type,
613                                in boolean    CopyGroups,
614                                in string     MeshName) 
615       raises (SALOME::SALOME_Exception);
616
617     void MirrorObject (in SMESH_IDSource theObject,
618                        in AxisStruct     Mirror,
619                        in MirrorType     Type,
620                        in boolean        Copy) 
621       raises (SALOME::SALOME_Exception);
622     ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
623                                          in AxisStruct     Mirror,
624                                          in MirrorType     Type) 
625       raises (SALOME::SALOME_Exception);
626     SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
627                                      in AxisStruct     Mirror,
628                                      in MirrorType     Type,
629                                      in boolean        CopyGroups,
630                                      in string         MeshName) 
631       raises (SALOME::SALOME_Exception);
632
633     void Translate (in long_array IDsOfElements,
634                     in DirStruct  Vector,
635                     in boolean    Copy) 
636       raises (SALOME::SALOME_Exception);
637     ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
638                                       in DirStruct  Vector) 
639       raises (SALOME::SALOME_Exception);
640     SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
641                                   in DirStruct  Vector,
642                                   in boolean    CopyGroups,
643                                   in string     MeshName) 
644       raises (SALOME::SALOME_Exception);
645
646     void TranslateObject (in SMESH_IDSource theObject,
647                           in DirStruct      Vector,
648                           in boolean        Copy) 
649       raises (SALOME::SALOME_Exception);
650     ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
651                                             in DirStruct      Vector) 
652       raises (SALOME::SALOME_Exception);
653     SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
654                                         in DirStruct      Vector,
655                                         in boolean        CopyGroups,
656                                         in string         MeshName) 
657       raises (SALOME::SALOME_Exception);
658
659     void Scale (in SMESH_IDSource theObject,
660                 in PointStruct    thePoint,
661                 in double_array   theScaleFact,
662                 in boolean        Copy) 
663       raises (SALOME::SALOME_Exception);
664     ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
665                                   in PointStruct    thePoint,
666                                   in double_array   theScaleFact) 
667       raises (SALOME::SALOME_Exception);
668     SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
669                               in PointStruct    thePoint,
670                               in double_array   theScaleFact,
671                               in boolean        CopyGroups,
672                               in string         MeshName) 
673       raises (SALOME::SALOME_Exception);
674
675     void Rotate (in long_array IDsOfElements,
676                  in AxisStruct Axis,
677                  in double     AngleInRadians,
678                  in boolean    Copy) 
679       raises (SALOME::SALOME_Exception);
680     ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
681                                    in AxisStruct Axis,
682                                    in double     AngleInRadians) 
683       raises (SALOME::SALOME_Exception);
684     SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
685                                in AxisStruct Axis,
686                                in double     AngleInRadians,
687                                in boolean    CopyGroups,
688                                in string     MeshName)
689       raises (SALOME::SALOME_Exception);
690
691     void RotateObject (in SMESH_IDSource theObject,
692                        in AxisStruct     Axis,
693                        in double         AngleInRadians,
694                        in boolean        Copy)
695       raises (SALOME::SALOME_Exception);
696     ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
697                                          in AxisStruct     Axis,
698                                          in double         AngleInRadians)
699       raises (SALOME::SALOME_Exception);
700     SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
701                                      in AxisStruct     Axis,
702                                      in double         AngleInRadians,
703                                      in boolean        CopyGroups,
704                                      in string         MeshName)
705       raises (SALOME::SALOME_Exception);
706
707     SMESH_Mesh Offset(in SMESH_IDSource theObject,
708                       in double         Value,
709                       in boolean        CopyGroups,
710                       in boolean        CopyElements,
711                       in string         MeshName,
712                       out ListOfGroups  Groups)
713       raises (SALOME::SALOME_Exception);
714
715     void FindCoincidentNodes (in  double              Tolerance,
716                               out array_of_long_array GroupsOfNodes,
717                               in  boolean             SeparateCornersAndMedium)
718       raises (SALOME::SALOME_Exception);
719
720     void FindCoincidentNodesOnPart (in  SMESH_IDSource      SubMeshOrGroup,
721                                     in  double              Tolerance,
722                                     out array_of_long_array GroupsOfNodes,
723                                     in  boolean             SeparateCornersAndMedium)
724       raises (SALOME::SALOME_Exception);
725
726     void FindCoincidentNodesOnPartBut (in  SMESH_IDSource      SubMeshOrGroup,
727                                        in  double              Tolerance,
728                                        out array_of_long_array GroupsOfNodes,
729                                        in  ListOfIDSources     ExceptSubMeshOrGroups,
730                                        in  boolean             SeparateCornersAndMedium)
731       raises (SALOME::SALOME_Exception);
732
733     void MergeNodes (in array_of_long_array    GroupsOfNodes,
734                      in SMESH::ListOfIDSources NodesToKeep,
735                      in boolean                AvoidMakingHoles)
736       raises (SALOME::SALOME_Exception);
737
738     /*!
739      * \brief Find elements built on the same nodes.
740      * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
741      * \return List of groups of equal elements.
742      */
743     void FindEqualElements (in  SMESH_IDSource      MeshOrSubMeshOrGroup,
744                             out array_of_long_array GroupsOfElementsID) 
745       raises (SALOME::SALOME_Exception);
746
747     /*!
748      * \brief Merge elements in each given group.
749      * \param GroupsOfElementsID Groups of elements for merging.
750      */
751     void MergeElements(in array_of_long_array GroupsOfElementsID) 
752       raises (SALOME::SALOME_Exception);
753
754     /*!
755      * \brief Merge equal elements in the whole mesh.
756      */
757     void MergeEqualElements() 
758       raises (SALOME::SALOME_Exception);
759
760     /*!
761      * If the given ID is a valid node ID (nodeID > 0), just move this node, else
762      * move the node closest to the point to point's location and return ID of the node
763      */
764     long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID) 
765       raises (SALOME::SALOME_Exception);
766
767     /*!
768      * Return ID of node closest to a given point
769      */
770     long FindNodeClosestTo(in double x, in double y, in double z) 
771       raises (SALOME::SALOME_Exception);
772
773     /*!
774      * Return elements of given type where the given point is IN or ON.
775      *
776      * 'ALL' type means elements of any type excluding nodes and 0D elements
777      */
778     long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type) 
779       raises (SALOME::SALOME_Exception);
780
781     /*!
782      * Searching among the given elements, return elements of given type 
783      * where the given point is IN or ON.
784      *
785      * 'ALL' type means elements of any type excluding nodes and 0D elements
786      */
787     long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
788                                         in double x, in double y, in double z, 
789                                         in ElementType type) 
790       raises (SALOME::SALOME_Exception);
791
792     /*!
793      * Project a point to a mesh object.
794      * Return ID of an element of given type where the given point is projected
795      * and coordinates of the projection point.
796      * In the case if nothing found, return -1 and []
797      */
798     long ProjectPoint(in double         x,
799                       in double         y,
800                       in double         z,
801                       in ElementType    type,
802                       in SMESH_IDSource meshObject,
803                       out double_array  projecton)
804       raises (SALOME::SALOME_Exception);
805
806     /*!
807      * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
808      * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
809      */
810     short GetPointState(in double x, in double y, in double z)
811       raises (SALOME::SALOME_Exception);
812
813     /*!
814      * Check if a 2D mesh is manifold
815      */
816     boolean IsManifold()
817       raises (SALOME::SALOME_Exception);
818
819     /*!
820      * Check if orientation of 2D elements is coherent
821      */
822     boolean IsCoherentOrientation2D()
823       raises (SALOME::SALOME_Exception);
824
825     /*!
826      * Partition given 1D elements into groups of contiguous edges.
827      * A node where number of meeting edges != 2 is a group end.
828      * An optional startNode is used to orient groups it belongs to.
829      * \return a list of edge groups and a list of corresponding node groups.
830      *         If a group is closed, the first and last nodes of the group are same.
831      */
832     array_of_long_array Get1DBranches( in SMESH_IDSource       edges,
833                                        in long                 startNode,
834                                        out array_of_long_array nodeGroups)
835       raises (SALOME::SALOME_Exception);
836
837     /*!
838      * Return sharp edges of faces and non-manifold ones. 
839      * Optionally add existing edges. Angle is in degrees.
840      */
841     ListOfEdges FindSharpEdges(in double angle, in boolean addExistingEdges)
842       raises (SALOME::SALOME_Exception);
843
844     /*!
845      * Returns all or only closed FreeBorder's.
846      */
847     ListOfFreeBorders FindFreeBorders(in boolean closedOnly)
848       raises (SALOME::SALOME_Exception);
849
850     /*!
851      * Fill with 2D elements a hole defined by a FreeBorder.
852      * Optionally add new faces to a given group, which is returned.
853      */
854     SMESH_Group FillHole(in FreeBorder hole, in string groupName)
855       raises (SALOME::SALOME_Exception);
856
857     /*!
858      * Returns groups of FreeBorder's coincident within the given tolerance.
859      * If the tolerance <= 0.0 then one tenth of an average size of elements adjacent
860      * to free borders being compared is used.
861      */
862     CoincidentFreeBorders FindCoincidentFreeBorders(in double tolerance);
863
864     /*!
865      * Sew FreeBorder's of each group
866      */
867     short SewCoincidentFreeBorders (in CoincidentFreeBorders freeBorders,
868                                     in boolean               createPolygons,
869                                     in boolean               createPolyedrs)
870       raises (SALOME::SALOME_Exception);
871
872     enum Sew_Error {
873       SEW_OK,
874       SEW_BORDER1_NOT_FOUND,
875       SEW_BORDER2_NOT_FOUND,
876       SEW_BOTH_BORDERS_NOT_FOUND,
877       SEW_BAD_SIDE_NODES,
878       SEW_VOLUMES_TO_SPLIT,
879       // for SewSideElements() only:
880       SEW_DIFF_NB_OF_ELEMENTS,
881       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
882       SEW_BAD_SIDE1_NODES,
883       SEW_BAD_SIDE2_NODES,
884       SEW_INTERNAL_ERROR
885     };
886
887     Sew_Error SewFreeBorders (in long FirstNodeID1,
888                               in long SecondNodeID1,
889                               in long LastNodeID1,
890                               in long FirstNodeID2,
891                               in long SecondNodeID2,
892                               in long LastNodeID2,
893                               in boolean CreatePolygons,
894                               in boolean CreatePolyedrs) 
895       raises (SALOME::SALOME_Exception);
896
897     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
898                                      in long SecondNodeID1,
899                                      in long LastNodeID1,
900                                      in long FirstNodeID2,
901                                      in long SecondNodeID2) 
902       raises (SALOME::SALOME_Exception);
903
904     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
905                                in long SecondNodeIDOnFreeBorder,
906                                in long LastNodeIDOnFreeBorder,
907                                in long FirstNodeIDOnSide,
908                                in long LastNodeIDOnSide,
909                                in boolean CreatePolygons,
910                                in boolean CreatePolyedrs) 
911       raises (SALOME::SALOME_Exception);
912
913     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
914                                in long_array IDsOfSide2Elements,
915                                in long       NodeID1OfSide1ToMerge,
916                                in long       NodeID1OfSide2ToMerge,
917                                in long       NodeID2OfSide1ToMerge,
918                                in long       NodeID2OfSide2ToMerge) 
919       raises (SALOME::SALOME_Exception);
920
921    /*!
922     * Set new nodes for given element.
923     * If number of nodes is not corresponded to type of
924     * element - returns false
925     */
926     boolean ChangeElemNodes(in long ide, in long_array newIDs) 
927       raises (SALOME::SALOME_Exception);
928
929     /*!
930      * \brief Duplicates given elements, i.e. creates new elements based on the 
931      *        same nodes as the given ones.
932      * \param theElements - container of elements to duplicate.
933      * \param theGroupName - a name of group to contain the generated elements.
934      *                    If a group with such a name already exists, the new elements
935      *                    are added to the existing group, else a new group is created.
936      *                    If \a theGroupName is empty, new elements are not added 
937      *                    in any group.
938      * \return a group where the new elements are added. NULL if theGroupName == "".
939      * \sa DoubleNode()
940      */
941     SMESH_Group DoubleElements( in SMESH_IDSource theElements, 
942                                 in string         theGroupName )
943       raises (SALOME::SALOME_Exception);
944
945     /*!
946      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
947      * \param theNodes - identifiers of nodes to be doubled
948      * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
949      *        nodes. If list of element identifiers is empty then nodes are doubled but
950      *        they not assigned to elements
951      * \return TRUE if operation has been completed successfully, FALSE otherwise
952      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
953      */
954     boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ) 
955       raises (SALOME::SALOME_Exception);
956
957     /*!
958      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
959      * This method provided for convenience works as DoubleNodes() described above.
960      * \param theNodeId - identifier of node to be doubled.
961      * \param theModifiedElems - identifiers of elements to be updated.
962      * \return TRUE if operation has been completed successfully, FALSE otherwise
963      * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
964      */
965     boolean DoubleNode( in long theNodeId, in long_array theModifiedElems ) 
966       raises (SALOME::SALOME_Exception);
967
968     /*!
969      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
970      * This method provided for convenience works as DoubleNodes() described above.
971      * \param theNodes - group of nodes to be doubled.
972      * \param theModifiedElems - group of elements to be updated.
973      * \return TRUE if operation has been completed successfully, FALSE otherwise
974      * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
975      */
976     boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
977                              in SMESH_GroupBase theModifiedElems ) 
978       raises (SALOME::SALOME_Exception);
979     /*!
980      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
981      * Works as DoubleNodeGroup() described above, but returns a new group with
982      * newly created nodes.
983      * \param theNodes - group of nodes to be doubled.
984      * \param theModifiedElems - group of elements to be updated.
985      * \return a new group with newly created nodes
986      * \sa DoubleNodeGroup()
987      */
988     SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes,
989                                     in SMESH_GroupBase theModifiedElems ) 
990       raises (SALOME::SALOME_Exception);
991
992     /*!
993      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
994      * This method provided for convenience works as DoubleNodes() described above.
995      * \param theNodes - list of groups of nodes to be doubled
996      * \param theModifiedElems - list of groups of elements to be updated.
997      * \return TRUE if operation has been completed successfully, FALSE otherwise
998      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
999      */
1000     boolean DoubleNodeGroups( in ListOfGroups theNodes,
1001                               in ListOfGroups theModifiedElems ) 
1002       raises (SALOME::SALOME_Exception);
1003     /*!
1004      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1005      * Works as DoubleNodeGroups() described above, but returns a new group with
1006      * newly created nodes.
1007      * \param theNodes - list of groups of nodes to be doubled
1008      * \param theModifiedElems - list of groups of elements to be updated.
1009      * \return a new group with newly created nodes
1010      * \sa DoubleNodeGroups()
1011      */
1012     SMESH_Group DoubleNodeGroupsNew( in ListOfGroups theNodes,
1013                                      in ListOfGroups theModifiedElems ) 
1014       raises (SALOME::SALOME_Exception);
1015
1016     /*!
1017      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1018      * \param theElems - the list of elements (edges or faces) to be replicated
1019      *        The nodes for duplication could be found from these elements
1020      * \param theNodesNot - list of nodes to NOT replicate
1021      * \param theAffectedElems - the list of elements (cells and edges) to which the
1022      *        replicated nodes should be associated to.
1023      * \return TRUE if operation has been completed successfully, FALSE otherwise
1024      * \sa DoubleNodeGroup(), DoubleNodeGroups()
1025      */
1026     boolean DoubleNodeElem( in long_array theElems,
1027                             in long_array theNodesNot,
1028                             in long_array theAffectedElems ) 
1029       raises (SALOME::SALOME_Exception);
1030
1031     /*!
1032      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1033      * \param theElems - the list of elements (edges or faces) to be replicated
1034      *        The nodes for duplication could be found from these elements
1035      * \param theNodesNot - list of nodes to NOT replicate
1036      * \param theShape - shape to detect affected elements (element which geometric center
1037      *        located on or inside shape).
1038      *        The replicated nodes should be associated to affected elements.
1039      * \return TRUE if operation has been completed successfully, FALSE otherwise
1040      * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
1041      */
1042     boolean DoubleNodeElemInRegion( in long_array theElems,
1043                                     in long_array theNodesNot,
1044                                     in GEOM::GEOM_Object theShape ) 
1045       raises (SALOME::SALOME_Exception);
1046
1047     /*!
1048      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1049      * This method provided for convenience works as DoubleNodes() described above.
1050      * \param theElems - group of of elements (edges or faces) to be replicated
1051      * \param theNodesNot - group of nodes not to replicated
1052      * \param theAffectedElems - group of elements to which the replicated nodes
1053      *        should be associated to.
1054      * \return TRUE if operation has been completed successfully, FALSE otherwise
1055      * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
1056      */
1057     boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
1058                                  in SMESH_GroupBase theNodesNot,
1059                                  in SMESH_GroupBase theAffectedElems ) 
1060       raises (SALOME::SALOME_Exception);
1061     /*!
1062      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1063      * Works as DoubleNodeElemGroup() described above, but returns a new group with
1064      * newly created elements.
1065      * \param theElems - group of of elements (edges or faces) to be replicated
1066      * \param theNodesNot - group of nodes not to replicated
1067      * \param theAffectedElems - group of elements to which the replicated nodes
1068      *        should be associated to.
1069      * \return a new group with newly created elements
1070      * \sa DoubleNodeElemGroup()
1071      */
1072     SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems,
1073                                         in SMESH_GroupBase theNodesNot,
1074                                         in SMESH_GroupBase theAffectedElems ) 
1075       raises (SALOME::SALOME_Exception);
1076     /*!
1077      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1078      * Works as DoubleNodeElemGroup() described above, but returns two new groups:
1079      * a group of newly created elements and a group of newly created nodes
1080      * \param theElems - group of of elements (edges or faces) to be replicated
1081      * \param theNodesNot - group of nodes not to replicated
1082      * \param theAffectedElems - group of elements to which the replicated nodes
1083      *        should be associated to.
1084      * \param theElemGroupNeeded - to create group of new elements or not
1085      * \param theNodeGroupNeeded - to create group of new nodes or not
1086      * \return two new groups of newly created elements (1st) and nodes (2nd)
1087      * \sa DoubleNodeElemGroup()
1088      */
1089     ListOfGroups DoubleNodeElemGroup2New( in SMESH_GroupBase theElems,
1090                                           in SMESH_GroupBase theNodesNot,
1091                                           in SMESH_GroupBase theAffectedElems,
1092                                           in boolean         theElemGroupNeeded,
1093                                           in boolean         theNodeGroupNeeded) 
1094       raises (SALOME::SALOME_Exception);
1095
1096     /*!
1097      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1098      * This method provided for convenience works as DoubleNodes() described above.
1099      * \param theElems - group of elements (edges or faces) to be replicated
1100      * \param theNodesNot - group of nodes not to replicated
1101      * \param theShape - shape to detect affected elements (element which geometric center
1102      *        located on or inside shape).
1103      *        The replicated nodes should be associated to affected elements.
1104      * \return TRUE if operation has been completed successfully, FALSE otherwise
1105      * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
1106      */
1107     boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
1108                                          in SMESH_GroupBase theNodesNot,
1109                                          in GEOM::GEOM_Object theShape ) 
1110       raises (SALOME::SALOME_Exception);
1111
1112     /*!
1113      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1114      * This method provided for convenience works as DoubleNodes() described above.
1115      * \param theElems - list of groups of elements (edges or faces) to be replicated
1116      * \param theNodesNot - list of groups of nodes not to replicated
1117      * \param theAffectedElems - group of elements to which the replicated nodes
1118      *        should be associated to.
1119      * \return TRUE if operation has been completed successfully, FALSE otherwise
1120      * \sa DoubleNodeGroup(), DoubleNodes(), DoubleNodeElemGroupsNew()
1121      */
1122     boolean DoubleNodeElemGroups( in ListOfGroups theElems,
1123                                   in ListOfGroups theNodesNot,
1124                                   in ListOfGroups theAffectedElems ) 
1125       raises (SALOME::SALOME_Exception);
1126     /*!
1127      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1128      * Works as DoubleNodeElemGroups() described above, but returns a new group with
1129      * newly created elements.
1130      * \param theElems - list of groups of elements (edges or faces) to be replicated
1131      * \param theNodesNot - list of groups of nodes not to replicated
1132      * \param theAffectedElems - group of elements to which the replicated nodes
1133      *        should be associated to.
1134      * \return a new group with newly created elements
1135      * \sa DoubleNodeElemGroups()
1136      */
1137     SMESH_Group DoubleNodeElemGroupsNew( in ListOfGroups theElems,
1138                                          in ListOfGroups theNodesNot,
1139                                          in ListOfGroups theAffectedElems ) 
1140       raises (SALOME::SALOME_Exception);
1141     /*!
1142      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
1143      * Works as DoubleNodeElemGroups() described above, but returns two new groups:
1144      * a group of newly created elements and a group of newly created nodes.
1145      * \param theElems - list of groups of elements (edges or faces) to be replicated
1146      * \param theNodesNot - list of groups of nodes not to replicated
1147      * \param theAffectedElems - group of elements to which the replicated nodes
1148      *        should be associated to.
1149      * \param theElemGroupNeeded - to create group of new elements or not
1150      * \param theNodeGroupNeeded - to create group of new nodes or not
1151      * \return two new groups of newly created elements (1st) and nodes (2nd)
1152      * \sa DoubleNodeElemGroups()
1153      */
1154     ListOfGroups DoubleNodeElemGroups2New( in ListOfGroups theElems,
1155                                            in ListOfGroups theNodesNot,
1156                                            in ListOfGroups theAffectedElems,
1157                                            in boolean         theElemGroupNeeded,
1158                                            in boolean         theNodeGroupNeeded ) 
1159       raises (SALOME::SALOME_Exception);
1160
1161     /*!
1162      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
1163      * This method provided for convenience works as DoubleNodes() described above.
1164      * \param theElems - list of groups of elements (edges or faces) to be replicated
1165      * \param theNodesNot - list of groups of nodes not to replicated
1166      * \param theShape - shape to detect affected elements (element which geometric center
1167      *        located on or inside shape).
1168      *        The replicated nodes should be associated to affected elements.
1169      * \return TRUE if operation has been completed successfully, FALSE otherwise
1170      * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
1171      */
1172     boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
1173                                           in ListOfGroups theNodesNot,
1174                                           in GEOM::GEOM_Object theShape )
1175       raises (SALOME::SALOME_Exception);
1176
1177     /*!
1178      * \brief Identify the elements that will be affected by node duplication (actual duplication is not performed).
1179      * This method is the first step of DoubleNodeElemGroupsInRegion.
1180      * \param theElems - list of groups of elements (edges or faces) to be replicated
1181      * \param theNodesNot - list of groups of nodes not to replicated
1182      * \param theShape - shape to detect affected elements (element which geometric center
1183      *        located on or inside shape).
1184      *        The replicated nodes should be associated to affected elements.
1185      * \return groups of affected elements
1186      * \sa DoubleNodeElemGroupsInRegion()
1187      */
1188     ListOfGroups AffectedElemGroupsInRegion( in ListOfGroups theElems,
1189                                              in ListOfGroups theNodesNot,
1190                                              in GEOM::GEOM_Object theShape ) 
1191       raises (SALOME::SALOME_Exception);
1192
1193     /*!
1194      * \brief Generates skin mesh (containing 2D cells) from 3D mesh
1195      * The created 2D mesh elements based on nodes of free faces of boundary volumes
1196      * \return TRUE if operation has been completed successfully, FALSE otherwise
1197      */
1198     boolean Make2DMeshFrom3D() raises (SALOME::SALOME_Exception);
1199
1200     /*!
1201      * \brief Creates missing boundary elements
1202      *  \param elements - elements whose boundary is to be checked
1203      *  \param dimension - defines type of boundary elements to create
1204      *    BND_1DFROM3D creates mesh edges on all borders of free facets of 3D elements.
1205      *  \param groupName - a name of group to store created boundary elements in,
1206      *                     "" means not to create the group
1207      *  \param meshName - a name of new mesh to store created boundary elements in,
1208      *                     "" means not to create the new mesh
1209      *  \param toCopyElements - if true, the checked elements will be copied into the new mesh
1210      *                          else only boundary elements will be copied into the new mesh
1211      *  \param toCopyExistingBondary - if true, not only new but also pre-existing
1212      *                                boundary elements will be copied into the new mesh
1213      *  \param group - returns the create group, if any
1214      *  \retval SMESH::SMESH_Mesh - the mesh where elements were added to
1215      */
1216     SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
1217                                 in Bnd_Dimension  dimension,
1218                                 in string         groupName,
1219                                 in string         meshName,
1220                                 in boolean        toCopyElements,
1221                                 in boolean        toCopyExistingBondary,
1222                                 out SMESH_Group   group) raises (SALOME::SALOME_Exception);
1223     /*!
1224      * \brief Creates missing boundary elements around either the whole mesh or 
1225      *    groups of 2D elements
1226      *  \param dimension - defines type of boundary elements to create
1227      *  \param groupName - a name of group to store all boundary elements in,
1228      *    "" means not to create the group
1229      *  \param meshName - a name of a new mesh, which is a copy of the initial 
1230      *    mesh + created boundary elements; "" means not to create the new mesh
1231      *  \param toCopyAll - if true, the whole initial mesh will be copied into
1232      *    the new mesh else only boundary elements will be copied into the new mesh
1233      *  \param groups - optional groups of 2D elements to make boundary around
1234      *  \param mesh - returns the mesh where elements were added to
1235      *  \param group - returns the created group, if any
1236      *  \retval long - number of added boundary elements
1237      */
1238     long MakeBoundaryElements(in Bnd_Dimension   dimension,
1239                               in string          groupName,
1240                               in string          meshName,
1241                               in boolean         toCopyAll,
1242                               in ListOfIDSources groups,
1243                               out SMESH_Mesh     mesh,
1244                               out SMESH_Group    group) raises (SALOME::SALOME_Exception);
1245
1246     /*!
1247      * \brief Double nodes on shared faces between groups of volumes and create flat elements on demand.
1248      * Flat elements are mainly used by some types of mechanic calculations.
1249      *
1250      * The list of groups must describe a partition of the mesh volumes.
1251      * The nodes of the internal faces at the boundaries of the groups are doubled.
1252      * In option, the internal faces are replaced by flat elements.
1253      * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1254      * \param theDomains - list of groups of volumes
1255      * \param createJointElems - if TRUE, create the elements
1256      * \param onAllBoundaries - if TRUE, the nodes and elements are also created on
1257      *        the boundary between \a theDomains and the rest mesh
1258      * \return TRUE if operation has been completed successfully, FALSE otherwise
1259      */
1260     boolean DoubleNodesOnGroupBoundaries( in ListOfGroups theDomains,
1261                                           in boolean      createJointElems,
1262                                           in boolean      onAllBoundaries) 
1263       raises (SALOME::SALOME_Exception);
1264
1265     /*!
1266      * \brief Double nodes on some external faces and create flat elements.
1267      * Flat elements are mainly used by some types of mechanic calculations.
1268      *
1269      * Each group of the list must be constituted of faces.
1270      * Triangles are transformed in prisms, and quadrangles in hexahedrons.
1271      * \param theGroupsOfFaces - list of groups of faces
1272      * \return TRUE if operation has been completed successfully, FALSE otherwise
1273      */
1274     boolean CreateFlatElementsOnFacesGroups( in ListOfGroups theGroupsOfFaces ) 
1275       raises (SALOME::SALOME_Exception); 
1276
1277     /*!
1278      *  \brief identify all the elements around a geom shape, get the faces delimiting the hole
1279      *  Build groups of volume to remove, groups of faces to replace on the skin of the object,
1280      *  groups of faces to remove insidethe object, (idem edges).
1281      *  Build ordered list of nodes at the border of each group of faces to replace (to be used to build a geom subshape)
1282      */
1283     void CreateHoleSkin(in double radius,
1284                         in GEOM::GEOM_Object theShape,
1285                         in string groupName,
1286                         in double_array theNodesCoords,
1287                         out array_of_long_array GroupsOfNodes)
1288       raises (SALOME::SALOME_Exception);
1289
1290
1291     /*!
1292      * \brief Create a polyline consisting of 1D mesh elements each lying on a 2D element of
1293      *        the initial triangle mesh. Positions of new nodes are found by cutting the mesh by
1294      *        the plane passing through pairs of points specified by each PolySegment structure.
1295      *        If there are several paths connecting a pair of points, the shortest path is
1296      *        selected by the module. Position of the cutting plane is defined by the two
1297      *        points and an optional vector lying on the plane specified by a PolySegment.
1298      *        By default the vector is defined by Mesh module as following. A middle point
1299      *        of the two given points is computed. The middle point is projected to the mesh.
1300      *        The vector goes from the middle point to the projection point. In case of planar
1301      *        mesh, the vector is normal to the mesh.
1302      *  \param [inout] segments - PolySegment's defining positions of cutting planes.
1303      *        Return the used vector which goes from the middle point to its projection.
1304      *  \param [in] groupName - optional name of a group where created mesh segments will
1305      *        be added.
1306      */
1307     void MakePolyLine(inout ListOfPolySegments segments,
1308                       in    string             groupName)
1309       raises (SALOME::SALOME_Exception);
1310
1311     /*!
1312      * \brief Create a slot of given width around given 1D elements lying on a triangle mesh.
1313      *        The slot is consrtucted by cutting faces by cylindrical surfaces made
1314      *        around each segment. Segments are expected to be created by MakePolyLine().
1315      * \return Edges located at the slot boundary
1316      */
1317     ListOfEdges MakeSlot( in SMESH_GroupBase segments,
1318                           in double          width )
1319       raises (SALOME::SALOME_Exception);
1320
1321   };
1322 };
1323
1324 #endif