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