Salome HOME
387091de33b13916fdb8ff3578186138d3f0ec65
[modules/smesh.git] / idl / SMESH_MeshEditor.idl
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SMESH_MeshEditor.idl
24 //
25 #ifndef _SMESH_MESHEDITOR_IDL_
26 #define _SMESH_MESHEDITOR_IDL_
27
28 #include "SMESH_Mesh.idl"
29
30 module SMESH
31 {
32   /*!
33    * This interface makes modifications on the Mesh - removing elements and nodes etc.
34    */
35   interface NumericalFunctor;
36   interface SMESH_MeshEditor
37   {
38     /*!
39      * \brief Wrap a sequence of ids in a SMESH_IDSource
40      * \param IDsOfElements list of mesh elements identifiers
41      * \return new ID source object
42      */
43     SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type);
44
45     /*!
46      * \brief Remove mesh elements specified by their identifiers.
47      * \param IDsOfElements list of mesh elements identifiers
48      * \return \c true if elements are correctly removed or \c false otherwise
49      */
50     boolean RemoveElements(in long_array IDsOfElements);
51
52     /*!
53      * \brief Remove mesh nodes specified by their identifiers.
54      * \param IDsOfNodes list of mesh nodes identifiers
55      * \return \c true if nodes are correctly removed or \c false otherwise
56      */
57     boolean RemoveNodes(in long_array IDsOfNodes);
58     
59     /*!
60      * \brief Remove all orphan nodes.
61      * \return number of removed nodes
62      */
63     long RemoveOrphanNodes();
64
65     /*!
66      * \brief Add new node.
67      * \param x X coordinate of new node
68      * \param y Y coordinate of new node
69      * \param z Z coordinate of new node
70      * \return integer identifier of new node
71      */
72     long AddNode(in double x, in double y, in double z);
73
74     /*!
75      *  Create 0D element on the given node.
76      *  \param IdOfNode Node IDs for creation of element.
77      */
78     long Add0DElement(in long IDOfNode);
79
80     /*!
81      *  Create edge, either linear and quadratic (this is determed
82      *  by number of given nodes).
83      *  \param IdsOfNodes List of node IDs for creation of element.
84      *  Needed order of nodes in this list corresponds to description
85      *  of MED. This description is located by the following link:
86      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
87      */
88     long AddEdge(in long_array IDsOfNodes);
89
90     /*!
91      *  Create face, either linear and quadratic (this is determed
92      *  by number of given nodes).
93      *  \param IdsOfNodes List of node IDs for creation of element.
94      *  Needed order of nodes in this list corresponds to description
95      *  of MED. This description is located by the following link:
96      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
97      */
98     long AddFace(in long_array IDsOfNodes);
99
100     long AddPolygonalFace(in long_array IdsOfNodes);
101
102     /*!
103      *  Create volume, either linear and quadratic (this is determed
104      *  by number of given nodes).
105      *  \param IdsOfNodes List of node IDs for creation of element.
106      *  Needed order of nodes in this list corresponds to description
107      *  of MED. This description is located by the following link:
108      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
109      */
110     long AddVolume(in long_array IDsOfNodes);
111
112     /*!
113      *  Create volume of many faces, giving nodes for each face.
114      *  \param IdsOfNodes List of node IDs for volume creation face by face.
115      *  \param Quantities List of integer values, Quantities[i]
116      *         gives quantity of nodes in face number i.
117      */
118     long AddPolyhedralVolume (in long_array IdsOfNodes,
119                               in long_array Quantities);
120
121     /*!
122      *  Create volume of many faces, giving IDs of existing faces.
123      *  \param IdsOfFaces List of face IDs for volume creation.
124      *  \note The created volume will refer only to nodes
125      *        of the given faces, not to the faces itself.
126      */
127     long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
128
129     /*!
130      * \brief Bind a node to a vertex
131       * \param NodeID - node ID
132       * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
133      */
134     void SetNodeOnVertex(in long NodeID, in long VertexID)
135       raises (SALOME::SALOME_Exception);
136     /*!
137      * \brief Store node position on an edge
138       * \param NodeID - node ID
139       * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
140       * \param paramOnEdge - parameter on edge where the node is located
141      */
142     void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge)
143       raises (SALOME::SALOME_Exception);
144     /*!
145      * \brief Store node position on a face
146       * \param NodeID - node ID
147       * \param FaceID - face ID available through GEOM_Object.GetSubShapeIndices()[0]
148       * \param u - U parameter on face where the node is located
149       * \param v - V parameter on face where the node is located
150      */
151     void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v)
152       raises (SALOME::SALOME_Exception);
153     /*!
154      * \brief Bind a node to a solid
155       * \param NodeID - node ID
156       * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
157      */
158     void SetNodeInVolume(in long NodeID, in long SolidID)
159       raises (SALOME::SALOME_Exception);
160     /*!
161      * \brief Bind an element to a shape
162       * \param ElementID - element ID
163       * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
164      */
165     void SetMeshElementOnShape(in long ElementID, in long ShapeID)
166       raises (SALOME::SALOME_Exception);
167
168
169     boolean MoveNode(in long NodeID, in double x, in double y, in double z);
170
171     boolean InverseDiag(in long NodeID1, in long NodeID2);
172
173     boolean DeleteDiag(in long NodeID1, in long NodeID2);
174
175     boolean Reorient(in long_array IDsOfElements);
176
177     boolean ReorientObject(in SMESH_IDSource theObject);
178
179     /*!
180      * \brief Fuse neighbour triangles into quadrangles.
181      * \param theElems     The triangles to be fused.
182      * \param theCriterion Is used to choose a neighbour to fuse with.
183      * \param theMaxAngle  Is a max angle between element normals at which fusion
184      *                     is still performed; theMaxAngle is mesured in radians.
185      * \return TRUE in case of success, FALSE otherwise.
186      */
187     boolean TriToQuad (in long_array       IDsOfElements,
188                        in NumericalFunctor Criterion,
189                        in double           MaxAngle);
190
191     /*!
192      * \brief Fuse neighbour triangles into quadrangles.
193      *
194      * Behaves like the above method, taking list of elements from \a theObject
195      */
196     boolean TriToQuadObject (in SMESH_IDSource   theObject,
197                              in NumericalFunctor Criterion,
198                              in double           MaxAngle);
199
200     /*!
201      * \brief Split quadrangles into triangles.
202      * \param theElems     The faces to be splitted.
203      * \param theCriterion Is used to choose a diagonal for splitting.
204      * \return TRUE in case of success, FALSE otherwise.
205      */
206     boolean QuadToTri (in long_array       IDsOfElements,
207                        in NumericalFunctor Criterion);
208
209     /*!
210      * \brief Split quadrangles into triangles.
211      *
212      * Behaves like the above method, taking list of elements from \a theObject
213      */
214     boolean QuadToTriObject (in SMESH_IDSource   theObject,
215                              in NumericalFunctor Criterion);
216
217     /*!
218      * \brief Split quadrangles into triangles.
219      * \param theElems  The faces to be splitted.
220      * \param the13Diag Is used to choose a diagonal for splitting.
221      * \return TRUE in case of success, FALSE otherwise.
222      */
223     boolean SplitQuad (in long_array IDsOfElements,
224                        in boolean    Diag13);
225
226     /*!
227      * \brief Split quadrangles into triangles.
228      *
229      * Behaves like the above method, taking list of elements from \a theObject
230      */
231     boolean SplitQuadObject (in SMESH_IDSource theObject,
232                              in boolean        Diag13);
233
234     /*!
235      *  Find better splitting of the given quadrangle.
236      *  \param IDOfQuad  ID of the quadrangle to be splitted.
237      *  \param Criterion A criterion to choose a diagonal for splitting.
238      *  \return 1 if 1-3 diagonal is better, 2 if 2-4
239      *          diagonal is better, 0 if error occurs.
240      */
241     long BestSplit (in long             IDOfQuad,
242                     in NumericalFunctor Criterion);
243
244     /*!
245      * \brief Split volumic elements into tetrahedrons
246      *  \param elems - elements to split
247      *  \param methodFlags - flags passing splitting method:
248      *         1 - split the hexahedron into 5 tetrahedrons
249      *         2 - split the hexahedron into 6 tetrahedrons
250      *         3 - split the hexahedron into 24 tetrahedrons
251      */
252     void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags)
253       raises (SALOME::SALOME_Exception);
254
255
256     enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
257
258     boolean Smooth(in long_array    IDsOfElements,
259                    in long_array    IDsOfFixedNodes,
260                    in long          MaxNbOfIterations,
261                    in double        MaxAspectRatio,
262                    in Smooth_Method Method);
263
264     boolean SmoothObject(in SMESH_IDSource  theObject,
265                          in long_array      IDsOfFixedNodes,
266                          in long            MaxNbOfIterations,
267                          in double          MaxAspectRatio,
268                          in Smooth_Method   Method);
269
270     boolean SmoothParametric(in long_array    IDsOfElements,
271                              in long_array    IDsOfFixedNodes,
272                              in long          MaxNbOfIterations,
273                              in double        MaxAspectRatio,
274                              in Smooth_Method Method);
275
276     boolean SmoothParametricObject(in SMESH_IDSource  theObject,
277                                    in long_array      IDsOfFixedNodes,
278                                    in long            MaxNbOfIterations,
279                                    in double          MaxAspectRatio,
280                                    in Smooth_Method   Method);
281
282     void ConvertToQuadratic(in boolean theForce3d);
283
284     boolean ConvertFromQuadratic();
285
286     void RenumberNodes();
287
288     void RenumberElements();
289
290     /*!
291      * \brief Genarate dim+1 elements by rotation of given elements around axis
292      * \param IDsOfElements - elements to ratate
293      * \param Axix - rotation axis
294      * \param AngleInRadians - rotation angle
295      * \param NbOfSteps - number of elements to generate from one element
296      */
297     void RotationSweep(in long_array       IDsOfElements,
298                        in AxisStruct       Axix,
299                        in double           AngleInRadians,
300                        in long             NbOfSteps,
301                        in double           Tolerance);
302     /*!
303      * \brief Same as previous but additionally create groups of elements
304      *  generated from elements belonging to preexisting groups
305      */
306     ListOfGroups RotationSweepMakeGroups(in long_array       IDsOfElements,
307                                          in AxisStruct       Axix,
308                                          in double           AngleInRadians,
309                                          in long             NbOfSteps,
310                                          in double           Tolerance);
311     /*!
312      * \brief Genarate dim+1 elements by rotation of the object around axis
313      * \param theObject - object containing elements to ratate
314      * \param Axix - rotation axis
315      * \param AngleInRadians - rotation angle
316      * \param NbOfSteps - number of elements to generate from one element
317      */
318     void RotationSweepObject(in SMESH_IDSource  theObject,
319                              in AxisStruct      Axix,
320                              in double          AngleInRadians,
321                              in long            NbOfSteps,
322                              in double          Tolerance);
323     /*!
324      * \brief Same as previous but additionally create groups of elements
325      *  generated from elements belonging to preexisting groups
326      */
327     ListOfGroups RotationSweepObjectMakeGroups(in SMESH_IDSource  theObject,
328                                                in AxisStruct      Axix,
329                                                in double          AngleInRadians,
330                                                in long            NbOfSteps,
331                                                in double          Tolerance);
332     /*!
333      * \brief Genarate dim+1 elements by rotation of the object around axis
334      * \param theObject - object containing elements to ratate
335      * \param Axix - rotation axis
336      * \param AngleInRadians - rotation angle
337      * \param NbOfSteps - number of elements to generate from one element
338      */
339     void RotationSweepObject1D(in SMESH_IDSource  theObject,
340                                in AxisStruct      Axix,
341                                in double          AngleInRadians,
342                                in long            NbOfSteps,
343                                in double          Tolerance);
344     /*!
345      * \brief Same as previous but additionally create groups of elements
346      *  generated from elements belonging to preexisting groups
347      */
348     ListOfGroups RotationSweepObject1DMakeGroups(in SMESH_IDSource  theObject,
349                                                  in AxisStruct      Axix,
350                                                  in double          AngleInRadians,
351                                                  in long            NbOfSteps,
352                                                  in double          Tolerance);
353     /*!
354      * \brief Genarate dim+1 elements by rotation of the object around axis
355      * \param theObject - object containing elements to ratate
356      * \param Axix - rotation axis
357      * \param AngleInRadians - rotation angle
358      * \param NbOfSteps - number of elements to generate from one element
359      */
360     void RotationSweepObject2D(in SMESH_IDSource  theObject,
361                                in AxisStruct      Axix,
362                                in double          AngleInRadians,
363                                in long            NbOfSteps,
364                                in double          Tolerance);
365     /*!
366      * \brief Same as previous but additionally create groups of elements
367      *  generated from elements belonging to preexisting groups
368      */
369     ListOfGroups RotationSweepObject2DMakeGroups(in SMESH_IDSource  theObject,
370                                                  in AxisStruct      Axix,
371                                                  in double          AngleInRadians,
372                                                  in long            NbOfSteps,
373                                                  in double          Tolerance);
374     /*!
375      * \brief Genarate dim+1 elements by extrusion of elements along vector
376      * \param IDsOfElements - elements to sweep
377      * \param StepVector - vector giving direction and distance of an extrusion step
378      * \param NbOfSteps - number of elements to generate from one element
379      */
380     void ExtrusionSweep(in long_array      IDsOfElements,
381                         in DirStruct       StepVector,
382                         in long            NbOfSteps);
383     /*!
384      * \brief Same as previous but additionally create groups of elements
385      *  generated from elements belonging to preexisting groups
386      */
387     ListOfGroups ExtrusionSweepMakeGroups(in long_array      IDsOfElements,
388                                           in DirStruct       StepVector,
389                                           in long            NbOfSteps);
390    /*!
391     * Generate new elements by extrusion of theElements 
392     * by StepVector by NbOfSteps
393     * param ExtrFlags set flags for performing extrusion
394     * param SewTolerance - uses for comparing locations of nodes if flag
395     *   EXTRUSION_FLAG_SEW is set
396     */
397     void AdvancedExtrusion(in long_array      IDsOfElements,
398                            in DirStruct       StepVector,
399                            in long            NbOfSteps,
400                            in long            ExtrFlags,
401                            in double          SewTolerance);
402     /*!
403      * \brief Same as previous but additionally create groups of elements
404      *  generated from elements belonging to preexisting groups
405      */
406     ListOfGroups AdvancedExtrusionMakeGroups(in long_array      IDsOfElements,
407                                              in DirStruct       StepVector,
408                                              in long            NbOfSteps,
409                                              in long            ExtrFlags,
410                                              in double          SewTolerance);
411
412     void ExtrusionSweepObject(in SMESH_IDSource  theObject,
413                               in DirStruct       StepVector,
414                               in long            NbOfSteps);
415     ListOfGroups ExtrusionSweepObjectMakeGroups(in SMESH_IDSource  theObject,
416                                                 in DirStruct       StepVector,
417                                                 in long            NbOfSteps);
418
419     void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
420                                 in DirStruct      StepVector,
421                                 in long           NbOfSteps);
422     ListOfGroups ExtrusionSweepObject1DMakeGroups(in SMESH_IDSource theObject,
423                                                   in DirStruct      StepVector,
424                                                   in long           NbOfSteps);
425
426     void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
427                                 in DirStruct      StepVector,
428                                 in long           NbOfSteps);
429     ListOfGroups ExtrusionSweepObject2DMakeGroups(in SMESH_IDSource theObject,
430                                                   in DirStruct      StepVector,
431                                                   in long           NbOfSteps);
432
433     enum Extrusion_Error {
434       EXTR_OK,
435       EXTR_NO_ELEMENTS,
436       EXTR_PATH_NOT_EDGE,
437       EXTR_BAD_PATH_SHAPE,
438       EXTR_BAD_STARTING_NODE,
439       EXTR_BAD_ANGLES_NUMBER,
440       EXTR_CANT_GET_TANGENT
441       };
442
443     ListOfGroups ExtrusionAlongPathX(in long_array        IDsOfElements,
444                                      in SMESH_IDSource    Path,
445                                      in long              NodeStart,
446                                      in boolean           HasAngles,
447                                      in double_array      Angles,
448                                      in boolean           LinearVariation,
449                                      in boolean           HasRefPoint,
450                                      in PointStruct       RefPoint,
451                                      in boolean           MakeGroups,
452                                      in ElementType       ElemType,
453                                      out Extrusion_Error  Error);
454
455     ListOfGroups ExtrusionAlongPathObjX(in SMESH_IDSource    theObject,
456                                         in SMESH_IDSource    Path,
457                                         in long              NodeStart,
458                                         in boolean           HasAngles,
459                                         in double_array      Angles,
460                                         in boolean           LinearVariation,
461                                         in boolean           HasRefPoint,
462                                         in PointStruct       RefPoint,
463                                         in boolean           MakeGroups,
464                                         in ElementType       ElemType,
465                                         out Extrusion_Error  Error);
466
467     Extrusion_Error ExtrusionAlongPath(in long_array        IDsOfElements,
468                                        in SMESH_Mesh        PathMesh,
469                                        in GEOM::GEOM_Object PathShape,
470                                        in long              NodeStart,
471                                        in boolean           HasAngles,
472                                        in double_array      Angles,
473                                        in boolean           HasRefPoint,
474                                        in PointStruct       RefPoint);
475     ListOfGroups ExtrusionAlongPathMakeGroups(in long_array        IDsOfElements,
476                                               in SMESH_Mesh        PathMesh,
477                                               in GEOM::GEOM_Object PathShape,
478                                               in long              NodeStart,
479                                               in boolean           HasAngles,
480                                               in double_array      Angles,
481                                               in boolean           HasRefPoint,
482                                               in PointStruct       RefPoint,
483                                               out Extrusion_Error  Error);
484
485     Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource    theObject,
486                                              in SMESH_Mesh        PathMesh,
487                                              in GEOM::GEOM_Object PathShape,
488                                              in long              NodeStart,
489                                              in boolean           HasAngles,
490                                              in double_array      Angles,
491                                              in boolean           HasRefPoint,
492                                              in PointStruct       RefPoint);
493     ListOfGroups ExtrusionAlongPathObjectMakeGroups(in SMESH_IDSource    theObject,
494                                                     in SMESH_Mesh        PathMesh,
495                                                     in GEOM::GEOM_Object PathShape,
496                                                     in long              NodeStart,
497                                                     in boolean           HasAngles,
498                                                     in double_array      Angles,
499                                                     in boolean           HasRefPoint,
500                                                     in PointStruct       RefPoint,
501                                                     out Extrusion_Error  Error);
502
503     Extrusion_Error ExtrusionAlongPathObject1D(in SMESH_IDSource    theObject,
504                                                in SMESH_Mesh        PathMesh,
505                                                in GEOM::GEOM_Object PathShape,
506                                                in long              NodeStart,
507                                                in boolean           HasAngles,
508                                                in double_array      Angles,
509                                                in boolean           HasRefPoint,
510                                                in PointStruct       RefPoint);
511     ListOfGroups ExtrusionAlongPathObject1DMakeGroups(in SMESH_IDSource    theObject,
512                                                       in SMESH_Mesh        PathMesh,
513                                                       in GEOM::GEOM_Object PathShape,
514                                                       in long              NodeStart,
515                                                       in boolean           HasAngles,
516                                                       in double_array      Angles,
517                                                       in boolean           HasRefPoint,
518                                                       in PointStruct       RefPoint,
519                                                       out Extrusion_Error  Error);
520
521     Extrusion_Error ExtrusionAlongPathObject2D(in SMESH_IDSource    theObject,
522                                                in SMESH_Mesh        PathMesh,
523                                                in GEOM::GEOM_Object PathShape,
524                                                in long              NodeStart,
525                                                in boolean           HasAngles,
526                                                in double_array      Angles,
527                                                in boolean           HasRefPoint,
528                                                in PointStruct       RefPoint);
529     ListOfGroups ExtrusionAlongPathObject2DMakeGroups(in SMESH_IDSource    theObject,
530                                                       in SMESH_Mesh        PathMesh,
531                                                       in GEOM::GEOM_Object PathShape,
532                                                       in long              NodeStart,
533                                                       in boolean           HasAngles,
534                                                       in double_array      Angles,
535                                                       in boolean           HasRefPoint,
536                                                       in PointStruct       RefPoint,
537                                                       out Extrusion_Error  Error);
538
539    /*!
540     * Compute rotation angles for ExtrusionAlongPath as linear variation
541     * of given angles along path steps
542     * param PathMesh mesh containing a 1D sub-mesh on the edge, along 
543     *                which proceeds the extrusion
544     * param PathShape is shape(edge); as the mesh can be complex, the edge 
545     *                 is used to define the sub-mesh for the path
546     */
547     double_array LinearAnglesVariation(in SMESH_Mesh        PathMesh,
548                                        in GEOM::GEOM_Object PathShape,
549                                        in double_array      Angles);
550
551     enum MirrorType { POINT, AXIS, PLANE };
552
553     void Mirror (in long_array IDsOfElements,
554                  in AxisStruct Mirror,
555                  in MirrorType Type,
556                  in boolean    Copy);
557     ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
558                                    in AxisStruct Mirror,
559                                    in MirrorType Type);
560     SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
561                                in AxisStruct Mirror,
562                                in MirrorType Type,
563                                in boolean    CopyGroups,
564                                in string     MeshName);
565
566     void MirrorObject (in SMESH_IDSource theObject,
567                        in AxisStruct     Mirror,
568                        in MirrorType     Type,
569                        in boolean        Copy);
570     ListOfGroups MirrorObjectMakeGroups (in SMESH_IDSource theObject,
571                                          in AxisStruct     Mirror,
572                                          in MirrorType     Type);
573     SMESH_Mesh MirrorObjectMakeMesh (in SMESH_IDSource theObject,
574                                      in AxisStruct     Mirror,
575                                      in MirrorType     Type,
576                                      in boolean        CopyGroups,
577                                      in string         MeshName);
578
579     void Translate (in long_array IDsOfElements,
580                     in DirStruct  Vector,
581                     in boolean    Copy);
582     ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
583                                       in DirStruct  Vector);
584     SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
585                                   in DirStruct  Vector,
586                                   in boolean    CopyGroups,
587                                   in string     MeshName);
588
589     void TranslateObject (in SMESH_IDSource theObject,
590                           in DirStruct      Vector,
591                           in boolean        Copy);
592     ListOfGroups TranslateObjectMakeGroups (in SMESH_IDSource theObject,
593                                             in DirStruct      Vector);
594     SMESH_Mesh TranslateObjectMakeMesh (in SMESH_IDSource theObject,
595                                         in DirStruct      Vector,
596                                         in boolean        CopyGroups,
597                                         in string         MeshName);
598
599     void Scale (in SMESH_IDSource theObject,
600                 in PointStruct    thePoint,
601                 in double_array   theScaleFact,
602                 in boolean        Copy);
603     ListOfGroups ScaleMakeGroups (in SMESH_IDSource theObject,
604                                   in PointStruct    thePoint,
605                                   in double_array   theScaleFact);
606     SMESH_Mesh ScaleMakeMesh (in SMESH_IDSource theObject,
607                               in PointStruct    thePoint,
608                               in double_array   theScaleFact,
609                               in boolean        CopyGroups,
610                               in string         MeshName);
611
612     void Rotate (in long_array IDsOfElements,
613                  in AxisStruct Axis,
614                  in double     AngleInRadians,
615                  in boolean    Copy);
616     ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
617                                    in AxisStruct Axis,
618                                    in double     AngleInRadians);
619     SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
620                                in AxisStruct Axis,
621                                in double     AngleInRadians,
622                                in boolean    CopyGroups,
623                                in string     MeshName);
624
625     void RotateObject (in SMESH_IDSource theObject,
626                        in AxisStruct     Axis,
627                        in double         AngleInRadians,
628                        in boolean        Copy);
629     ListOfGroups RotateObjectMakeGroups (in SMESH_IDSource theObject,
630                                          in AxisStruct     Axis,
631                                          in double         AngleInRadians);
632     SMESH_Mesh RotateObjectMakeMesh (in SMESH_IDSource theObject,
633                                      in AxisStruct     Axis,
634                                      in double         AngleInRadians,
635                                      in boolean        CopyGroups,
636                                      in string         MeshName);
637
638     void FindCoincidentNodes (in  double              Tolerance,
639                               out array_of_long_array GroupsOfNodes);
640
641     void FindCoincidentNodesOnPart (in  SMESH_IDSource      SubMeshOrGroup,
642                                     in  double              Tolerance,
643                                     out array_of_long_array GroupsOfNodes);
644
645     void FindCoincidentNodesOnPartBut (in  SMESH_IDSource      SubMeshOrGroup,
646                                        in  double              Tolerance,
647                                        out array_of_long_array GroupsOfNodes,
648                                        in  ListOfIDSources     ExceptSubMeshOrGroups);
649
650     void MergeNodes (in array_of_long_array GroupsOfNodes);
651
652     /*!
653      * \brief Find elements built on the same nodes.
654      * \param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching.
655      * \return List of groups of equal elements.
656      */
657     void FindEqualElements (in  SMESH_IDSource      MeshOrSubMeshOrGroup,
658                             out array_of_long_array GroupsOfElementsID);
659
660     /*!
661      * \brief Merge elements in each given group.
662      * \param GroupsOfElementsID Groups of elements for merging.
663      */
664     void MergeElements(in array_of_long_array GroupsOfElementsID);
665
666     /*!
667      * \brief Merge equal elements in the whole mesh.
668      */
669     void MergeEqualElements();
670     
671     /*!
672      * If the given ID is a valid node ID (nodeID > 0), just move this node, else
673      * move the node closest to the point to point's location and return ID of the node
674      */
675     long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
676
677     /*!
678      * Return ID of node closest to a given point
679      */
680     long FindNodeClosestTo(in double x, in double y, in double z);
681
682     /*!
683      * Return elements of given type where the given point is IN or ON.
684      *
685      * 'ALL' type means elements of any type excluding nodes and 0D elements
686      */
687     long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
688
689     /*!
690      * Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
691      * TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
692      */
693     short GetPointState(in double x, in double y, in double z);
694
695     enum Sew_Error {
696       SEW_OK,
697       SEW_BORDER1_NOT_FOUND,
698       SEW_BORDER2_NOT_FOUND,
699       SEW_BOTH_BORDERS_NOT_FOUND,
700       SEW_BAD_SIDE_NODES,
701       SEW_VOLUMES_TO_SPLIT,
702       // for SewSideElements() only:
703       SEW_DIFF_NB_OF_ELEMENTS,
704       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
705       SEW_BAD_SIDE1_NODES,
706       SEW_BAD_SIDE2_NODES
707       };
708
709     Sew_Error SewFreeBorders (in long FirstNodeID1,
710                               in long SecondNodeID1,
711                               in long LastNodeID1,
712                               in long FirstNodeID2,
713                               in long SecondNodeID2,
714                               in long LastNodeID2,
715                               in boolean CreatePolygons,
716                               in boolean CreatePolyedrs);
717
718     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
719                                      in long SecondNodeID1,
720                                      in long LastNodeID1,
721                                      in long FirstNodeID2,
722                                      in long SecondNodeID2);
723
724     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
725                                in long SecondNodeIDOnFreeBorder,
726                                in long LastNodeIDOnFreeBorder,
727                                in long FirstNodeIDOnSide,
728                                in long LastNodeIDOnSide,
729                                in boolean CreatePolygons,
730                                in boolean CreatePolyedrs);
731
732     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
733                                in long_array IDsOfSide2Elements,
734                                in long       NodeID1OfSide1ToMerge,
735                                in long       NodeID1OfSide2ToMerge,
736                                in long       NodeID2OfSide1ToMerge,
737                                in long       NodeID2OfSide2ToMerge);
738
739    /*!
740     * Set new nodes for given element.
741     * If number of nodes is not corresponded to type of
742     * element - returns false
743     */
744     boolean ChangeElemNodes(in long ide, in long_array newIDs);
745
746    /*!
747     * Return data of mesh edition preview which is computed provided 
748     * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
749     */
750     MeshPreviewStruct GetPreviewData();
751
752    /*!
753     * If during last operation of MeshEditor some nodes were
754     * created this method returns list of it's IDs, if new nodes
755     * not creared - returns empty list
756     */
757     long_array GetLastCreatedNodes();
758
759    /*!
760     * If during last operation of MeshEditor some elements were
761     * created this method returns list of it's IDs, if new elements
762     * not creared - returns empty list
763     */
764     long_array GetLastCreatedElems();
765
766     /*!
767      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
768      * \param theNodes - identifiers of nodes to be doubled
769      * \param theModifiedElems - identifiers of elements to be updated by the new (doubled) 
770      *        nodes. If list of element identifiers is empty then nodes are doubled but 
771      *        they not assigned to elements
772      *        \return TRUE if operation has been completed successfully, FALSE otherwise
773      * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
774     */
775     boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ); 
776
777     /*!
778     * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
779     * This method provided for convenience works as DoubleNodes() described above.
780     * \param theNodeId - identifier of node to be doubled.
781     * \param theModifiedElems - identifiers of elements to be updated.
782     * \return TRUE if operation has been completed successfully, FALSE otherwise
783     * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
784     */
785     boolean DoubleNode( in long theNodeId, in long_array theModifiedElems ); 
786
787     /*!
788     * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
789     * This method provided for convenience works as DoubleNodes() described above.
790     * \param theNodes - group of nodes to be doubled.
791     * \param theModifiedElems - group of elements to be updated.
792     * \return TRUE if operation has been completed successfully, FALSE otherwise
793     * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups(), DoubleNodeGroupNew()
794     */
795     boolean DoubleNodeGroup( in SMESH_GroupBase theNodes, 
796                              in SMESH_GroupBase theModifiedElems );
797
798     /*!
799      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
800      * Works as DoubleNodeGroup() described above, but returns a new group with 
801      * newly created nodes.
802      * \param theNodes - group of nodes to be doubled.
803      * \param theModifiedElems - group of elements to be updated.
804      * \return a new group with newly created nodes
805      * \sa DoubleNodeGroup()
806      */
807     SMESH_Group DoubleNodeGroupNew( in SMESH_GroupBase theNodes, 
808                                     in SMESH_GroupBase theModifiedElems );
809
810     /*!
811     \brief Creates a hole in a mesh by doubling the nodes of some particular elements
812     This method provided for convenience works as DoubleNodes() described above.
813     \param theNodes - list of groups of nodes to be doubled
814     \param theModifiedElems - list of groups of elements to be updated.
815     \return TRUE if operation has been completed successfully, FALSE otherwise
816     \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
817     */
818     boolean DoubleNodeGroups( in ListOfGroups theNodes, 
819                               in ListOfGroups theModifiedElems );
820     
821     /*!
822      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
823      * \param theElems - the list of elements (edges or faces) to be replicated
824      *        The nodes for duplication could be found from these elements
825      * \param theNodesNot - list of nodes to NOT replicate
826      * \param theAffectedElems - the list of elements (cells and edges) to which the 
827      *        replicated nodes should be associated to.
828      * \return TRUE if operation has been completed successfully, FALSE otherwise
829      * \sa DoubleNodeGroup(), DoubleNodeGroups()
830     */
831     boolean DoubleNodeElem( in long_array theElems,
832                             in long_array theNodesNot,
833                             in long_array theAffectedElems ); 
834
835     /*!
836      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
837      * \param theElems - the list of elements (edges or faces) to be replicated
838      *        The nodes for duplication could be found from these elements
839      * \param theNodesNot - list of nodes to NOT replicate
840      * \param theShape - shape to detect affected elements (element which geometric center
841      *        located on or inside shape).
842      *        The replicated nodes should be associated to affected elements.
843      * \return TRUE if operation has been completed successfully, FALSE otherwise
844      * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
845     */
846     boolean DoubleNodeElemInRegion( in long_array theElems,
847                                     in long_array theNodesNot,
848                                     in GEOM::GEOM_Object theShape );
849
850     /*!
851      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
852      * This method provided for convenience works as DoubleNodes() described above.
853      * \param theElems - group of of elements (edges or faces) to be replicated
854      * \param theNodesNot - group of nodes not to replicated
855      * \param theAffectedElems - group of elements to which the replicated nodes
856      *        should be associated to.
857      * \return TRUE if operation has been completed successfully, FALSE otherwise
858      * \sa DoubleNodes(), DoubleNodeGroups(), DoubleNodeElemGroupNew()
859     */
860     boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems, 
861                                  in SMESH_GroupBase theNodesNot,
862                                  in SMESH_GroupBase theAffectedElems );
863
864     /*!
865      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements.
866      * Works as DoubleNodeElemGroup() described above, but returns a new group with 
867      * newly created elements.
868      * \param theElems - group of of elements (edges or faces) to be replicated
869      * \param theNodesNot - group of nodes not to replicated
870      * \param theAffectedElems - group of elements to which the replicated nodes
871      *        should be associated to.
872      * \return a new group with newly created elements
873      * \sa DoubleNodeElemGroup()
874     */
875     SMESH_Group DoubleNodeElemGroupNew( in SMESH_GroupBase theElems, 
876                                         in SMESH_GroupBase theNodesNot,
877                                         in SMESH_GroupBase theAffectedElems );
878     
879     /*!
880      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
881      * This method provided for convenience works as DoubleNodes() described above.
882      * \param theElems - group of elements (edges or faces) to be replicated
883      * \param theNodesNot - group of nodes not to replicated
884      * \param theShape - shape to detect affected elements (element which geometric center
885      *        located on or inside shape).
886      *        The replicated nodes should be associated to affected elements.
887      * \return TRUE if operation has been completed successfully, FALSE otherwise
888      * \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
889     */
890     boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems, 
891                                      in SMESH_GroupBase theNodesNot,
892                                      in GEOM::GEOM_Object theShape );
893
894     /*!
895      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
896      * This method provided for convenience works as DoubleNodes() described above.
897      * \param theElems - list of groups of elements (edges or faces) to be replicated
898      * \param theNodesNot - list of groups of nodes not to replicated
899      * \param theAffectedElems - group of elements to which the replicated nodes
900      *        should be associated to.
901      * \return TRUE if operation has been completed successfully, FALSE otherwise
902      * \sa DoubleNodeGroup(), DoubleNodes()
903     */
904     boolean DoubleNodeElemGroups( in ListOfGroups theElems,
905                                   in ListOfGroups theNodesNot,
906                                   in ListOfGroups theAffectedElems );
907
908     /*!
909      * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
910      * This method provided for convenience works as DoubleNodes() described above.
911      * \param theElems - list of groups of elements (edges or faces) to be replicated
912      * \param theNodesNot - list of groups of nodes not to replicated
913      * \param theShape - shape to detect affected elements (element which geometric center
914      *        located on or inside shape).
915      *        The replicated nodes should be associated to affected elements.
916      * \return TRUE if operation has been completed successfully, FALSE otherwise
917      * \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
918     */
919     boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
920                                           in ListOfGroups theNodesNot,
921                                           in GEOM::GEOM_Object theShape );
922
923     /*!
924      * \brief Generated skin mesh (containing 2D cells) from 3D mesh
925      * The created 2D mesh elements based on nodes of free faces of boundary volumes
926      * \return TRUE if operation has been completed successfully, FALSE otherwise
927      */
928     boolean Make2DMeshFrom3D();
929
930   };
931 };
932
933 #endif