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