Salome HOME
fix PythonDump: write Criterion arg of QuadToTri() in PythonDump
[modules/smesh.git] / idl / SMESH_Mesh.idl
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 //  This library is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU Lesser General Public
6 //  License as published by the Free Software Foundation; either
7 //  version 2.1 of the License.
8 //
9 //  This library is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 //  Lesser General Public License for more details.
13 //
14 //  You should have received a copy of the GNU Lesser General Public
15 //  License along with this library; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 //
20 //
21 //
22 //  File   : SMESH_Mesh.idl
23 //  Author : Paul RASCLE, EDF
24 //  $Header$
25
26 #ifndef _SMESH_MESH_IDL_
27 #define _SMESH_MESH_IDL_
28
29 #include "SALOME_Exception.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "GEOM_Gen.idl"
32 #include "MED.idl"
33
34 module SMESH
35 {
36   interface SMESH_Hypothesis;
37   typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
38   interface SMESH_GroupBase;
39   typedef sequence<SMESH_GroupBase> ListOfGroups;
40
41   typedef sequence<double> double_array ;
42   typedef sequence<long> long_array ;
43   typedef sequence<string> string_array ;
44   typedef sequence<long_array> array_of_long_array ;
45
46   enum log_command
47     {
48       ADD_NODE,
49       ADD_EDGE,
50       ADD_TRIANGLE,
51       ADD_QUADRANGLE,
52       ADD_POLYGON,
53       ADD_TETRAHEDRON,
54       ADD_PYRAMID,
55       ADD_PRISM,
56       ADD_HEXAHEDRON,
57       ADD_POLYHEDRON,
58       REMOVE_NODE,
59       REMOVE_ELEMENT,
60       MOVE_NODE,
61       CHANGE_ELEMENT_NODES,
62       CHANGE_POLYHEDRON_NODES,
63       RENUMBER,
64       ADD_QUADEDGE,
65       ADD_QUADTRIANGLE,
66       ADD_QUADQUADRANGLE,
67       ADD_QUADTETRAHEDRON,
68       ADD_QUADPYRAMID,
69       ADD_QUADPENTAHEDRON,
70       ADD_QUADHEXAHEDRON
71     };
72
73   struct log_block
74   {
75     long commandType;
76     long number;
77     double_array coords;
78     long_array indexes;
79   };
80
81   struct PointStruct { double x;
82                        double y;
83                        double z; } ;
84   struct DirStruct   { PointStruct PS ; } ;          // analog to Occ Direction
85
86   struct AxisStruct  { double x;
87                        double y;
88                        double z;
89                        double vx;
90                        double vy;
91                        double vz; } ;
92
93
94   /*!
95    * Enumeration for element type, like in SMDS
96    */
97   enum ElementType
98   {
99     ALL,
100     NODE,
101     EDGE,
102     FACE,
103     VOLUME
104   };
105   
106   /*!
107    * ElementOrder points out entities of what order are requested
108    */
109   enum ElementOrder {
110     ORDER_ANY,          /*! entities of any order */
111     ORDER_LINEAR,       /*! entities of 1st order */
112     ORDER_QUADRATIC     /*! entities of 2nd order */
113   };
114
115   /*!
116    * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
117    */
118   enum Hypothesis_Status // in the order of severity
119   {
120     HYP_OK,
121     HYP_MISSING,      // algo misses a hypothesis
122     HYP_CONCURENT,    // several applicable hypotheses
123     HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
124     HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
125                       //      for Add/RemoveHypothesis operations
126     HYP_INCOMPATIBLE, // hypothesis does not fit algo
127     HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
128     HYP_ALREADY_EXIST,// such hypothesis already exist
129     HYP_BAD_DIM,      // bad dimension
130     HYP_BAD_SUBSHAPE  // shape is neither the main one, nor its subshape, nor a group
131   };
132
133   /*!
134    * Enumeration for DriverMED read status (used by ImportMEDFile() method)
135    */
136   enum DriverMED_ReadStatus // in the order of severity
137   {
138     DRS_OK,
139     DRS_EMPTY,          // a MED file contains no mesh with the given name
140     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
141                         // so the numbers from the file are ignored
142     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
143     DRS_FAIL            // general failure (exception etc.)
144   };
145
146   /*!
147    * Enumeration for DriverMED (used by Perform() method)
148    */
149   enum MED_VERSION // in the order of severity
150   {
151     MED_V2_1,
152     MED_V2_2
153   };
154
155   typedef sequence<log_block> log_array;
156
157
158   /*!
159    * Auxilary flags for advanced extrusion.
160    * BOUNDARY: create or not boundary for result of extrusion
161    * SEW:      try to use existing nodes or create new nodes in any case
162    */
163   const long EXTRUSION_FLAG_BOUNDARY = 1;
164   const long EXTRUSION_FLAG_SEW = 2;
165   
166   interface SMESH_IDSource
167   {
168     /*!
169      * Returns a sequence of all element IDs
170      */
171     long_array GetIDs();
172   };
173
174   interface SMESH_Group;
175   interface SMESH_GroupOnGeom;
176   interface SMESH_subMesh;
177   interface SMESH_MeshEditor;
178   interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
179   {
180     ///*!
181     // * Associate a Shape to a Mesh created with NewEmpty
182     // */
183     //boolean SetMesh(in GEOM::GEOM_Object anObject)
184     //  raises (SALOME::SALOME_Exception);
185
186     /*!
187      * Get the subMesh object associated to a subShape. The subMesh object
188      * gives access to nodes and elements IDs.
189      * SubMesh will be used instead of SubShape in a next idl version to
190      * adress a specific subMesh...
191      */
192     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
193       raises (SALOME::SALOME_Exception);
194
195     ///*!
196     // * Create a subMesh without reference to a subShape
197     // */
198     //SMESH_subMesh NewEmpty()
199     //  raises (SALOME::SALOME_Exception);
200
201     /*!
202      * Get geom shape to mesh. A result may be nil
203      */
204     GEOM::GEOM_Object GetShapeToMesh()
205       raises (SALOME::SALOME_Exception);
206
207     /*!
208      * Remove a submesh
209      */
210     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
211       raises (SALOME::SALOME_Exception);
212
213     /*!
214      * Create a group
215      */
216     SMESH_Group CreateGroup( in ElementType elem_type,
217                              in string name )
218       raises (SALOME::SALOME_Exception);
219
220     /*!
221      * Create a group from geometry group
222      */
223     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType elem_type,
224                                           in string name,
225                                           in GEOM::GEOM_Object theGeomObject )
226       raises (SALOME::SALOME_Exception);
227
228     /*!
229      * Remove a group
230      */
231     void RemoveGroup(in SMESH_GroupBase aGroup)
232       raises (SALOME::SALOME_Exception);
233
234     /*!
235      *  Remove group with its contents
236      */
237     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
238       raises (SALOME::SALOME_Exception);
239
240     /*!
241      *  Get the list of groups existing in the mesh
242      */
243     ListOfGroups GetGroups()
244       raises (SALOME::SALOME_Exception);
245
246     /*!
247      * Union of two groups
248      *    New group is created. All mesh elements that are
249      *    present in initial groups are added to the new one
250      */
251     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
252                              in SMESH_GroupBase aGroup2,
253                              in string          name )
254       raises (SALOME::SALOME_Exception);
255
256     /*!
257      *  Intersection of two groups
258      *  New group is created. All mesh elements that are
259      *  present in both initial groups are added to the new one.
260      */
261     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
262                                  in SMESH_GroupBase aGroup2,
263                                  in string          name )
264       raises (SALOME::SALOME_Exception);
265
266     /*!
267      *  Cut of two groups
268      *  New group is created. All mesh elements that are present in
269      *  main group but do not present in tool group are added to the new one
270      */
271     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
272                            in SMESH_GroupBase aToolGroup,
273                            in string          name )
274       raises (SALOME::SALOME_Exception);
275
276     /*!
277      * Add hypothesis to the mesh, under a particular subShape
278      * (or the main shape itself)
279      * The Add method is only used to prepare the build of the mesh and store
280      * the algorithms and associated parameters.
281      * Actual job of mesh the shape is done by MESH_Gen.
282      * @params
283      * - aSubShape : subShape obtained by a shape explode in GEOM
284      *   (or main shape)
285      * - anHyp : hypothesis object
286      * @return
287      * - OK if the hypothesis is compatible with the subShape
288      *   (and all previous hypothesis on the subShape)
289      * - NOK if the hypothesis is not compatible with the subShape
290      *   (or one previous hypothesis on the subShape)
291      * raises exception if hypothesis has not been created
292      */
293     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
294                                     in SMESH_Hypothesis anHyp)
295       raises (SALOME::SALOME_Exception);
296 //     boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
297 //       raises (SALOME::SALOME_Exception);
298
299     /*!
300      * Remove an hypothesis previouly added with AddHypothesis.
301      */
302     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
303                                        in SMESH_Hypothesis anHyp)
304       raises (SALOME::SALOME_Exception);
305 //     boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
306 //                           in SMESH_Hypothesis anHyp)
307 //       raises (SALOME::SALOME_Exception);
308
309     /*!
310      * Get the list of hypothesis added on a subShape
311      */
312     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
313       raises (SALOME::SALOME_Exception);
314 //     ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
315 //       raises (SALOME::SALOME_Exception);
316
317     /*!
318      * Get the log of nodes and elements added or removed since previous
319      * clear of the log.
320      * @params
321      * - clearAfterGet : log is emptied after Get (safe if concurrents access)
322      */
323     //    string_array GetLog(in boolean clearAfterGet)
324     //      raises (SALOME::SALOME_Exception);
325     log_array GetLog(in boolean clearAfterGet)
326       raises (SALOME::SALOME_Exception);
327
328     /*!
329      * Clear the log of nodes and elements added or removed since previous
330      * clear. Must be used immediately after GetLog if clearAfterGet is false.
331      */
332     void ClearLog()
333       raises (SALOME::SALOME_Exception);
334
335     /*!
336      * Get the internal Id
337      */
338     long GetId();
339
340     /*!
341      * Get the study Id
342      */
343     long GetStudyId();
344
345     /*!
346      * Obtain instance of SMESH_MeshEditor
347      */
348     SMESH_MeshEditor GetMeshEditor()
349       raises (SALOME::SALOME_Exception);
350
351     /*! Check group names for duplications.
352      *  Consider maximum group name length stored in MED file.
353      */
354     boolean HasDuplicatedGroupNamesMED();
355
356     /*!
357      * Export Mesh to different MED Formats
358      * @params
359      * - auto_groups : boolean parameter for creating/not creating
360      *   the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
361      *   the typical use is auto_groups=false.
362      * - theVersion : define the version of format of MED file, that will be created
363      */
364     void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
365       raises (SALOME::SALOME_Exception);
366
367     /*!
368      * Export Mesh to MED_V2_1 MED format
369      * Works, just the same as ExportToMED, with MED_VERSION parameter equal to MED_V2_1.
370      * The method is kept in order to support old functionality
371      */
372     void ExportMED( in string file, in boolean auto_groups )
373       raises (SALOME::SALOME_Exception);
374
375     /*!
376      * Export Mesh to DAT, UNV and STL Formats
377      */
378     void ExportDAT( in string file )
379       raises (SALOME::SALOME_Exception);
380     void ExportUNV( in string file )
381       raises (SALOME::SALOME_Exception);
382     void ExportSTL( in string file, in boolean isascii )
383       raises (SALOME::SALOME_Exception);
384
385     /*!
386      * Get MED Mesh
387      */
388     SALOME_MED::MESH GetMEDMesh()
389       raises (SALOME::SALOME_Exception);
390
391     /*!
392      * Get informations about mesh contents
393      */
394     long NbNodes()
395       raises (SALOME::SALOME_Exception);
396
397     long NbElements()
398       raises (SALOME::SALOME_Exception);
399
400     long NbEdges()
401       raises (SALOME::SALOME_Exception);
402
403     long NbEdgesOfOrder(in ElementOrder order)
404       raises (SALOME::SALOME_Exception);
405
406     long NbFaces()
407       raises (SALOME::SALOME_Exception);
408
409     long NbFacesOfOrder(in ElementOrder order)
410       raises (SALOME::SALOME_Exception);
411
412     long NbTriangles()
413       raises (SALOME::SALOME_Exception);
414
415     long NbTrianglesOfOrder(in ElementOrder order)
416       raises (SALOME::SALOME_Exception);
417
418     long NbQuadrangles()
419       raises (SALOME::SALOME_Exception);
420
421     long NbQuadranglesOfOrder(in ElementOrder order)
422       raises (SALOME::SALOME_Exception);
423
424     long NbPolygons()
425       raises (SALOME::SALOME_Exception);
426
427     long NbVolumes()
428       raises (SALOME::SALOME_Exception);
429
430     long NbVolumesOfOrder(in ElementOrder order)
431       raises (SALOME::SALOME_Exception);
432
433     long NbTetras()
434       raises (SALOME::SALOME_Exception);
435
436     long NbTetrasOfOrder(in ElementOrder order)
437       raises (SALOME::SALOME_Exception);
438
439     long NbHexas()
440       raises (SALOME::SALOME_Exception);
441
442     long NbHexasOfOrder(in ElementOrder order)
443       raises (SALOME::SALOME_Exception);
444
445     long NbPyramids()
446       raises (SALOME::SALOME_Exception);
447
448     long NbPyramidsOfOrder(in ElementOrder order)
449       raises (SALOME::SALOME_Exception);
450
451     long NbPrisms()
452       raises (SALOME::SALOME_Exception);
453
454     long NbPrismsOfOrder(in ElementOrder order)
455       raises (SALOME::SALOME_Exception);
456
457     long NbPolyhedrons()
458       raises (SALOME::SALOME_Exception);
459
460     long NbSubMesh()
461       raises (SALOME::SALOME_Exception);
462
463     long_array GetElementsId()
464       raises (SALOME::SALOME_Exception);
465
466     long_array GetElementsByType( in ElementType theType )
467       raises (SALOME::SALOME_Exception);
468
469     long_array GetNodesId()
470       raises (SALOME::SALOME_Exception);
471     
472     /*!
473      * Returns type of mesh element
474      */    
475     ElementType GetElementType( in long id, in boolean iselem )
476       raises (SALOME::SALOME_Exception);
477
478     long_array GetSubMeshElementsId(in long ShapeID)
479       raises (SALOME::SALOME_Exception);
480
481     long_array GetSubMeshNodesId(in long ShapeID, in boolean all )
482       raises (SALOME::SALOME_Exception);
483     
484     ElementType GetSubMeshElementType(in long ShapeID)
485       raises (SALOME::SALOME_Exception);
486
487     /*!
488      * Get mesh description
489      */
490     string Dump();
491
492     /*!
493      * Get mesh pointer
494      */
495     long GetMeshPtr();
496
497     /*!
498      * Get XYZ coordinates of node as list of double
499      * If there is not node for given ID - returns empty list
500      */
501     double_array GetNodeXYZ(in long id);
502
503     /*!
504      * For given node returns list of IDs of inverse elements
505      * If there is not node for given ID - returns empty list
506      */
507     long_array GetNodeInverseElements(in long id);
508
509     /*!
510      * If given element is node returns IDs of shape from position
511      * else - return ID of result shape after ::FindShape()
512      * from SMESH_MeshEditor
513      * If there is not element for given ID - returns -1
514      */
515     long GetShapeID(in long id);
516
517     /*!
518      * Returns number of nodes for given element
519      * If there is not element for given ID - returns -1
520      */
521     long GetElemNbNodes(in long id);
522
523     /*!
524      * Returns ID of node by given index for given element
525      * If there is not element for given ID - returns -1
526      * If there is not node for given index - returns -2
527      */
528     long GetElemNode(in long id, in long index);
529
530     /*!
531      * Returns true if given node is medium node
532      * in given quadratic element
533      */
534     boolean IsMediumNode(in long ide, in long idn);
535
536     /*!
537      * Returns true if given node is medium node
538      * in one of quadratic elements
539      */
540     boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type);
541
542     /*!
543      * Returns number of edges for given element
544      */
545     long ElemNbEdges(in long id);
546
547     /*!
548      * Returns number of faces for given element
549      */
550     long ElemNbFaces(in long id);
551
552     /*!
553      * Returns true if given element is polygon
554      */
555     boolean IsPoly(in long id);
556
557     /*!
558      * Returns true if given element is quadratic
559      */
560     boolean IsQuadratic(in long id);
561
562     /*!
563      * Returns XYZ coordinates of bary center for given element
564      * as list of double
565      * If there is not element for given ID - returns empty list
566      */
567     double_array BaryCenter(in long id);
568
569   };
570
571   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
572   {
573     /*!
574      *
575      */
576     long GetNumberOfElements()
577       raises (SALOME::SALOME_Exception);
578
579     /*!
580      *
581      */
582     long GetNumberOfNodes( in boolean all )
583       raises (SALOME::SALOME_Exception);
584
585     /*!
586      *
587      */
588     long_array GetElementsId()
589       raises (SALOME::SALOME_Exception);
590
591     /*!
592      *
593      */
594     long_array GetElementsByType( in ElementType theType )
595       raises (SALOME::SALOME_Exception);
596     
597     /*!
598      * Return type of submesh element
599      */
600     ElementType GetElementType( in long id, in boolean iselem )
601       raises (SALOME::SALOME_Exception);
602
603     /*!
604      *
605      */
606     long_array GetNodesId()
607       raises (SALOME::SALOME_Exception);
608
609     /*!
610      * Get geom shape the submesh is dedicated to
611      */
612     GEOM::GEOM_Object GetSubShape()
613       raises (SALOME::SALOME_Exception);
614
615     /*!
616      * Get SMESH_Mesh which stores nodes coordinates & elements definition
617      */
618     SMESH_Mesh GetFather()
619       raises (SALOME::SALOME_Exception);
620
621     /*!
622      * Get the internal Id
623      */
624     long GetId();
625
626     /*!
627      * Get MED subMesh
628      */
629     SALOME_MED::FAMILY GetFamily()
630       raises (SALOME::SALOME_Exception);
631   };
632
633   /*!
634    * This interface makes modifications on the Mesh - removing elements and nodes etc.
635    */
636   interface NumericalFunctor;
637   interface SMESH_MeshEditor
638   {
639     boolean RemoveElements(in long_array IDsOfElements);
640
641     boolean RemoveNodes(in long_array IDsOfNodes);
642
643     long AddNode(in double x, in double y, in double z);
644
645     long AddEdge(in long_array IDsOfNodes);
646
647     long AddFace(in long_array IDsOfNodes);
648
649     long AddPolygonalFace(in long_array IdsOfNodes);
650
651     long AddVolume(in long_array IDsOfNodes);
652
653     /*!
654      *  Create volume of many faces, giving nodes for each face.
655      *  \param IdsOfNodes List of node IDs for volume creation face by face.
656      *  \param Quantities List of integer values, Quantities[i]
657      *         gives quantity of nodes in face number i.
658      */
659     long AddPolyhedralVolume (in long_array IdsOfNodes,
660                                  in long_array Quantities);
661
662     /*!
663      *  Create volume of many faces, giving IDs of existing faces.
664      *  \param IdsOfFaces List of face IDs for volume creation.
665      *  \note The created volume will refer only to nodes
666      *        of the given faces, not to the faces itself.
667      */
668     long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
669
670     boolean MoveNode(in long NodeID, in double x, in double y, in double z);
671
672     boolean InverseDiag(in long NodeID1, in long NodeID2);
673
674     boolean DeleteDiag(in long NodeID1, in long NodeID2);
675
676     boolean Reorient(in long_array IDsOfElements);
677
678     boolean ReorientObject(in SMESH_IDSource theObject);
679
680     /*!
681      * \brief Fuse neighbour triangles into quadrangles.
682      * \param theElems     The triangles to be fused.
683      * \param theCriterion Is used to choose a neighbour to fuse with.
684      * \param theMaxAngle  Is a max angle between element normals at which fusion
685      *                     is still performed; theMaxAngle is mesured in radians.
686      * \return TRUE in case of success, FALSE otherwise.
687      */
688     boolean TriToQuad (in long_array       IDsOfElements,
689                        in NumericalFunctor Criterion,
690                        in double           MaxAngle);
691
692     /*!
693      * \brief Fuse neighbour triangles into quadrangles.
694      *
695      * Behaves like the above method, taking list of elements from \a theObject
696      */
697     boolean TriToQuadObject (in SMESH_IDSource   theObject,
698                              in NumericalFunctor Criterion,
699                              in double           MaxAngle);
700
701     /*!
702      * \brief Split quadrangles into triangles.
703      * \param theElems     The faces to be splitted.
704      * \param theCriterion Is used to choose a diagonal for splitting.
705      * \return TRUE in case of success, FALSE otherwise.
706      */
707     boolean QuadToTri (in long_array       IDsOfElements,
708                        in NumericalFunctor Criterion);
709
710     /*!
711      * \brief Split quadrangles into triangles.
712      *
713      * Behaves like the above method, taking list of elements from \a theObject
714      */
715     boolean QuadToTriObject (in SMESH_IDSource   theObject,
716                              in NumericalFunctor Criterion);
717
718     /*!
719      * \brief Split quadrangles into triangles.
720      * \param theElems  The faces to be splitted.
721      * \param the13Diag Is used to choose a diagonal for splitting.
722      * \return TRUE in case of success, FALSE otherwise.
723      */
724     boolean SplitQuad (in long_array IDsOfElements,
725                        in boolean    Diag13);
726
727     /*!
728      * \brief Split quadrangles into triangles.
729      *
730      * Behaves like the above method, taking list of elements from \a theObject
731      */
732     boolean SplitQuadObject (in SMESH_IDSource theObject,
733                              in boolean        Diag13);
734
735     /*!
736      *  Find better splitting of the given quadrangle.
737      *  \param IDOfQuad  ID of the quadrangle to be splitted.
738      *  \param Criterion A criterion to choose a diagonal for splitting.
739      *  \return 1 if 1-3 diagonal is better, 2 if 2-4
740      *          diagonal is better, 0 if error occurs.
741      */
742     long BestSplit (in long             IDOfQuad,
743                     in NumericalFunctor Criterion);
744
745     enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
746
747     boolean Smooth(in long_array    IDsOfElements,
748                    in long_array    IDsOfFixedNodes,
749                    in long          MaxNbOfIterations,
750                    in double        MaxAspectRatio,
751                    in Smooth_Method Method);
752
753     boolean SmoothObject(in SMESH_IDSource  theObject,
754                          in long_array      IDsOfFixedNodes,
755                          in long            MaxNbOfIterations,
756                          in double          MaxAspectRatio,
757                          in Smooth_Method   Method);
758
759     boolean SmoothParametric(in long_array    IDsOfElements,
760                              in long_array    IDsOfFixedNodes,
761                              in long          MaxNbOfIterations,
762                              in double        MaxAspectRatio,
763                              in Smooth_Method Method);
764
765     boolean SmoothParametricObject(in SMESH_IDSource  theObject,
766                                    in long_array      IDsOfFixedNodes,
767                                    in long            MaxNbOfIterations,
768                                    in double          MaxAspectRatio,
769                                    in Smooth_Method   Method);
770
771     void ConvertToQuadratic(in boolean theForce3d);
772
773     boolean ConvertFromQuadratic();
774
775     void RenumberNodes();
776
777     void RenumberElements();
778
779     void RotationSweep(in long_array       IDsOfElements,
780                        in AxisStruct       Axix,
781                        in double           AngleInRadians,
782                        in long             NbOfSteps,
783                        in double           Tolerance);
784
785     void RotationSweepObject(in SMESH_IDSource  theObject,
786                              in AxisStruct      Axix,
787                              in double          AngleInRadians,
788                              in long            NbOfSteps,
789                              in double          Tolerance);
790
791     void ExtrusionSweep(in long_array      IDsOfElements,
792                         in DirStruct       StepVector,
793                         in long            NbOfSteps);
794
795    /*!
796     * Generate new elements by extrusion of theElements 
797     * by StepVector by NbOfSteps
798     * param ExtrFlags set flags for performing extrusion
799     * param SewTolerance - uses for comparing locations of nodes if flag
800     *   EXTRUSION_FLAG_SEW is set
801     */
802     void AdvancedExtrusion(in long_array      IDsOfElements,
803                            in DirStruct       StepVector,
804                            in long            NbOfSteps,
805                            in long            ExtrFlags,
806                            in double          SewTolerance);
807
808     void ExtrusionSweepObject(in SMESH_IDSource  theObject,
809                               in DirStruct       StepVector,
810                               in long            NbOfSteps);
811
812     void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
813                                 in DirStruct      StepVector,
814                                 in long           NbOfSteps);
815
816     void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
817                                 in DirStruct      StepVector,
818                                 in long           NbOfSteps);
819
820     enum Extrusion_Error {
821       EXTR_OK,
822       EXTR_NO_ELEMENTS,
823       EXTR_PATH_NOT_EDGE,
824       EXTR_BAD_PATH_SHAPE,
825       EXTR_BAD_STARTING_NODE,
826       EXTR_BAD_ANGLES_NUMBER,
827       EXTR_CANT_GET_TANGENT
828       };
829
830     Extrusion_Error ExtrusionAlongPath(in long_array        IDsOfElements,
831                                        in SMESH_Mesh        PathMesh,
832                                        in GEOM::GEOM_Object PathShape,
833                                        in long              NodeStart,
834                                        in boolean           HasAngles,
835                                        in double_array      Angles,
836                                        in boolean           HasRefPoint,
837                                        in PointStruct       RefPoint);
838
839     Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource    theObject,
840                                              in SMESH_Mesh        PathMesh,
841                                              in GEOM::GEOM_Object PathShape,
842                                              in long              NodeStart,
843                                              in boolean           HasAngles,
844                                              in double_array      Angles,
845                                              in boolean           HasRefPoint,
846                                              in PointStruct       RefPoint);
847
848     enum MirrorType { POINT, AXIS, PLANE };
849
850     void Mirror (in long_array       IDsOfElements,
851                  in AxisStruct       Mirror,
852                  in MirrorType       theMirrorType,
853                  in boolean          Copy);
854
855     void MirrorObject (in SMESH_IDSource  theObject,
856                        in AxisStruct      Mirror,
857                        in MirrorType      theMirrorType,
858                        in boolean         Copy);
859
860     void Translate (in long_array      IDsOfElements,
861                     in DirStruct       Vector,
862                     in boolean         Copy);
863
864     void TranslateObject (in SMESH_IDSource  theObject,
865                           in DirStruct       Vector,
866                           in boolean         Copy);
867
868     void Rotate (in long_array       IDsOfElements,
869                  in AxisStruct       Axis,
870                  in double           AngleInRadians,
871                  in boolean          Copy);
872
873     void RotateObject (in SMESH_IDSource  theObject,
874                        in AxisStruct      Axis,
875                        in double          AngleInRadians,
876                        in boolean         Copy);
877
878     void FindCoincidentNodes (in  double              Tolerance,
879                               out array_of_long_array GroupsOfNodes);
880
881     void MergeNodes (in array_of_long_array GroupsOfNodes);
882
883     void MergeEqualElements();
884
885     enum Sew_Error {
886       SEW_OK,
887       SEW_BORDER1_NOT_FOUND,
888       SEW_BORDER2_NOT_FOUND,
889       SEW_BOTH_BORDERS_NOT_FOUND,
890       SEW_BAD_SIDE_NODES,
891       SEW_VOLUMES_TO_SPLIT,
892       // for SewSideElements() only:
893       SEW_DIFF_NB_OF_ELEMENTS,
894       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
895       SEW_BAD_SIDE1_NODES,
896       SEW_BAD_SIDE2_NODES
897       };
898
899     Sew_Error SewFreeBorders (in long FirstNodeID1,
900                               in long SecondNodeID1,
901                               in long LastNodeID1,
902                               in long FirstNodeID2,
903                               in long SecondNodeID2,
904                               in long LastNodeID2,
905                               in boolean CreatePolygons,
906                               in boolean CreatePolyedrs);
907
908     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
909                                      in long SecondNodeID1,
910                                      in long LastNodeID1,
911                                      in long FirstNodeID2,
912                                      in long SecondNodeID2);
913
914     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
915                                in long SecondNodeIDOnFreeBorder,
916                                in long LastNodeIDOnFreeBorder,
917                                in long FirstNodeIDOnSide,
918                                in long LastNodeIDOnSide,
919                                in boolean CreatePolygons,
920                                in boolean CreatePolyedrs);
921
922     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
923                                in long_array IDsOfSide2Elements,
924                                in long       NodeID1OfSide1ToMerge,
925                                in long       NodeID1OfSide2ToMerge,
926                                in long       NodeID2OfSide1ToMerge,
927                                in long       NodeID2OfSide2ToMerge);
928
929    /*!
930     * Set new nodes for given element.
931     * If number of nodes is not corresponded to type of
932     * element - returns false
933     */
934     boolean ChangeElemNodes(in long ide, in long_array newIDs);
935
936    /*!
937     * If during last operation of MeshEditor some nodes were
938     * created this method returns list of it's IDs, if new nodes
939     * not creared - returns empty list
940     */
941     long_array GetLastCreatedNodes();
942
943    /*!
944     * If during last operation of MeshEditor some elements were
945     * created this method returns list of it's IDs, if new elements
946     * not creared - returns empty list
947     */
948     long_array GetLastCreatedElems();
949
950   };
951 };
952
953 #endif