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