Salome HOME
Merging with WPdev
[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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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     HYP_BAD_GEOMETRY  // geometry mismatches algorithm's expectation
132   };
133
134   /*!
135    * Enumeration for DriverMED read status (used by ImportMEDFile() method)
136    */
137   enum DriverMED_ReadStatus // in the order of severity
138   {
139     DRS_OK,
140     DRS_EMPTY,          // a MED file contains no mesh with the given name
141     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
142                         // so the numbers from the file are ignored
143     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
144     DRS_FAIL            // general failure (exception etc.)
145   };
146
147   /*!
148    * Enumeration for DriverMED (used by Perform() method)
149    */
150   enum MED_VERSION // in the order of severity
151   {
152     MED_V2_1,
153     MED_V2_2
154   };
155
156   typedef sequence<log_block> log_array;
157
158
159   /*!
160    * Auxilary flags for advanced extrusion.
161    * BOUNDARY: create or not boundary for result of extrusion
162    * SEW:      try to use existing nodes or create new nodes in any case
163    */
164   const long EXTRUSION_FLAG_BOUNDARY = 1;
165   const long EXTRUSION_FLAG_SEW = 2;
166   
167   interface SMESH_IDSource
168   {
169     /*!
170      * Returns a sequence of all element IDs
171      */
172     long_array GetIDs();
173   };
174
175   interface SMESH_Group;
176   interface SMESH_GroupOnGeom;
177   interface SMESH_subMesh;
178   interface SMESH_MeshEditor;
179   interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
180   {
181     ///*!
182     // * Associate a Shape to a Mesh created with NewEmpty
183     // */
184     //boolean SetMesh(in GEOM::GEOM_Object anObject)
185     //  raises (SALOME::SALOME_Exception);
186
187     /*!
188      * Get the subMesh object associated to a subShape. The subMesh object
189      * gives access to nodes and elements IDs.
190      * SubMesh will be used instead of SubShape in a next idl version to
191      * adress a specific subMesh...
192      */
193     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
194       raises (SALOME::SALOME_Exception);
195
196     ///*!
197     // * Create a subMesh without reference to a subShape
198     // */
199     //SMESH_subMesh NewEmpty()
200     //  raises (SALOME::SALOME_Exception);
201
202     /*!
203      * Get geom shape to mesh. A result may be nil
204      */
205     GEOM::GEOM_Object GetShapeToMesh()
206       raises (SALOME::SALOME_Exception);
207
208     /*!
209      * Remove a submesh
210      */
211     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
212       raises (SALOME::SALOME_Exception);
213
214     /*!
215      * Create a group
216      */
217     SMESH_Group CreateGroup( in ElementType elem_type,
218                              in string name )
219       raises (SALOME::SALOME_Exception);
220
221     /*!
222      * Create a group from geometry group
223      */
224     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType elem_type,
225                                           in string name,
226                                           in GEOM::GEOM_Object theGeomObject )
227       raises (SALOME::SALOME_Exception);
228
229     /*!
230      * Remove a group
231      */
232     void RemoveGroup(in SMESH_GroupBase aGroup)
233       raises (SALOME::SALOME_Exception);
234
235     /*!
236      *  Remove group with its contents
237      */
238     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
239       raises (SALOME::SALOME_Exception);
240
241     /*!
242      *  Get the list of groups existing in the mesh
243      */
244     ListOfGroups GetGroups()
245       raises (SALOME::SALOME_Exception);
246
247     /*!
248      * Union of two groups
249      *    New group is created. All mesh elements that are
250      *    present in initial groups are added to the new one
251      */
252     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
253                              in SMESH_GroupBase aGroup2,
254                              in string          name )
255       raises (SALOME::SALOME_Exception);
256
257     /*!
258      *  Intersection of two groups
259      *  New group is created. All mesh elements that are
260      *  present in both initial groups are added to the new one.
261      */
262     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
263                                  in SMESH_GroupBase aGroup2,
264                                  in string          name )
265       raises (SALOME::SALOME_Exception);
266
267     /*!
268      *  Cut of two groups
269      *  New group is created. All mesh elements that are present in
270      *  main group but do not present in tool group are added to the new one
271      */
272     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
273                            in SMESH_GroupBase aToolGroup,
274                            in string          name )
275       raises (SALOME::SALOME_Exception);
276
277     /*!
278      * Add hypothesis to the mesh, under a particular subShape
279      * (or the main shape itself)
280      * The Add method is only used to prepare the build of the mesh and store
281      * the algorithms and associated parameters.
282      * Actual job of mesh the shape is done by MESH_Gen.
283      * @params
284      * - aSubShape : subShape obtained by a shape explode in GEOM
285      *   (or main shape)
286      * - anHyp : hypothesis object
287      * @return
288      * - OK if the hypothesis is compatible with the subShape
289      *   (and all previous hypothesis on the subShape)
290      * - NOK if the hypothesis is not compatible with the subShape
291      *   (or one previous hypothesis on the subShape)
292      * raises exception if hypothesis has not been created
293      */
294     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
295                                     in SMESH_Hypothesis anHyp)
296       raises (SALOME::SALOME_Exception);
297 //     boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
298 //       raises (SALOME::SALOME_Exception);
299
300     /*!
301      * Remove an hypothesis previouly added with AddHypothesis.
302      */
303     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
304                                        in SMESH_Hypothesis anHyp)
305       raises (SALOME::SALOME_Exception);
306 //     boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
307 //                           in SMESH_Hypothesis anHyp)
308 //       raises (SALOME::SALOME_Exception);
309
310     /*!
311      * Get the list of hypothesis added on a subShape
312      */
313     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
314       raises (SALOME::SALOME_Exception);
315 //     ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
316 //       raises (SALOME::SALOME_Exception);
317
318     /*!
319      * Get the log of nodes and elements added or removed since previous
320      * clear of the log.
321      * @params
322      * - clearAfterGet : log is emptied after Get (safe if concurrents access)
323      */
324     //    string_array GetLog(in boolean clearAfterGet)
325     //      raises (SALOME::SALOME_Exception);
326     log_array GetLog(in boolean clearAfterGet)
327       raises (SALOME::SALOME_Exception);
328
329     /*!
330      * Clear the log of nodes and elements added or removed since previous
331      * clear. Must be used immediately after GetLog if clearAfterGet is false.
332      */
333     void ClearLog()
334       raises (SALOME::SALOME_Exception);
335
336     /*!
337      * Get the internal Id
338      */
339     long GetId();
340
341     /*!
342      * Get the study Id
343      */
344     long GetStudyId();
345
346     /*!
347      * Obtain instance of SMESH_MeshEditor
348      */
349     SMESH_MeshEditor GetMeshEditor()
350       raises (SALOME::SALOME_Exception);
351
352     /*! Check group names for duplications.
353      *  Consider maximum group name length stored in MED file.
354      */
355     boolean HasDuplicatedGroupNamesMED();
356
357     /*!
358      * Export Mesh to different MED Formats
359      * @params
360      * - auto_groups : boolean parameter for creating/not creating
361      *   the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
362      *   the typical use is auto_groups=false.
363      * - theVersion : define the version of format of MED file, that will be created
364      */
365     void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
366       raises (SALOME::SALOME_Exception);
367
368     /*!
369      * Export Mesh to MED_V2_1 MED format
370      * Works, just the same as ExportToMED, with MED_VERSION parameter equal to MED_V2_1.
371      * The method is kept in order to support old functionality
372      */
373     void ExportMED( in string file, in boolean auto_groups )
374       raises (SALOME::SALOME_Exception);
375
376     /*!
377      * Export Mesh to DAT, UNV and STL Formats
378      * (UNV supported version is I-DEAS 10)
379      */
380     void ExportDAT( in string file )
381       raises (SALOME::SALOME_Exception);
382     void ExportUNV( in string file )
383       raises (SALOME::SALOME_Exception);
384     void ExportSTL( in string file, in boolean isascii )
385       raises (SALOME::SALOME_Exception);
386
387     /*!
388      * Get MED Mesh
389      */
390     SALOME_MED::MESH GetMEDMesh()
391       raises (SALOME::SALOME_Exception);
392
393     /*!
394      * Get informations about mesh contents
395      */
396     long NbNodes()
397       raises (SALOME::SALOME_Exception);
398
399     long NbElements()
400       raises (SALOME::SALOME_Exception);
401
402     long NbEdges()
403       raises (SALOME::SALOME_Exception);
404
405     long NbEdgesOfOrder(in ElementOrder order)
406       raises (SALOME::SALOME_Exception);
407
408     long NbFaces()
409       raises (SALOME::SALOME_Exception);
410
411     long NbFacesOfOrder(in ElementOrder order)
412       raises (SALOME::SALOME_Exception);
413
414     long NbTriangles()
415       raises (SALOME::SALOME_Exception);
416
417     long NbTrianglesOfOrder(in ElementOrder order)
418       raises (SALOME::SALOME_Exception);
419
420     long NbQuadrangles()
421       raises (SALOME::SALOME_Exception);
422
423     long NbQuadranglesOfOrder(in ElementOrder order)
424       raises (SALOME::SALOME_Exception);
425
426     long NbPolygons()
427       raises (SALOME::SALOME_Exception);
428
429     long NbVolumes()
430       raises (SALOME::SALOME_Exception);
431
432     long NbVolumesOfOrder(in ElementOrder order)
433       raises (SALOME::SALOME_Exception);
434
435     long NbTetras()
436       raises (SALOME::SALOME_Exception);
437
438     long NbTetrasOfOrder(in ElementOrder order)
439       raises (SALOME::SALOME_Exception);
440
441     long NbHexas()
442       raises (SALOME::SALOME_Exception);
443
444     long NbHexasOfOrder(in ElementOrder order)
445       raises (SALOME::SALOME_Exception);
446
447     long NbPyramids()
448       raises (SALOME::SALOME_Exception);
449
450     long NbPyramidsOfOrder(in ElementOrder order)
451       raises (SALOME::SALOME_Exception);
452
453     long NbPrisms()
454       raises (SALOME::SALOME_Exception);
455
456     long NbPrismsOfOrder(in ElementOrder order)
457       raises (SALOME::SALOME_Exception);
458
459     long NbPolyhedrons()
460       raises (SALOME::SALOME_Exception);
461
462     long NbSubMesh()
463       raises (SALOME::SALOME_Exception);
464
465     long_array GetElementsId()
466       raises (SALOME::SALOME_Exception);
467
468     long_array GetElementsByType( in ElementType theType )
469       raises (SALOME::SALOME_Exception);
470
471     long_array GetNodesId()
472       raises (SALOME::SALOME_Exception);
473     
474     /*!
475      * Returns type of mesh element
476      */    
477     ElementType GetElementType( in long id, in boolean iselem )
478       raises (SALOME::SALOME_Exception);
479
480     long_array GetSubMeshElementsId(in long ShapeID)
481       raises (SALOME::SALOME_Exception);
482
483     long_array GetSubMeshNodesId(in long ShapeID, in boolean all )
484       raises (SALOME::SALOME_Exception);
485     
486     ElementType GetSubMeshElementType(in long ShapeID)
487       raises (SALOME::SALOME_Exception);
488
489     /*!
490      * Get mesh description
491      */
492     string Dump();
493
494     /*!
495      * Get mesh pointer
496      */
497     long GetMeshPtr();
498
499     /*!
500      * Get XYZ coordinates of node as list of double
501      * If there is not node for given ID - returns empty list
502      */
503     double_array GetNodeXYZ(in long id);
504
505     /*!
506      * For given node returns list of IDs of inverse elements
507      * If there is not node for given ID - returns empty list
508      */
509     long_array GetNodeInverseElements(in long id);
510
511     /*!
512      * If given element is node returns IDs of shape from position
513      * If there is not node for given ID - returns -1
514      */
515     long GetShapeID(in long id);
516
517     /*!
518      * For given element returns ID of result shape after 
519      * ::FindShape() from SMESH_MeshEditor
520      * If there is not element for given ID - returns -1
521      */
522     long GetShapeIDForElem(in long id);
523
524     /*!
525      * Returns number of nodes for given element
526      * If there is not element for given ID - returns -1
527      */
528     long GetElemNbNodes(in long id);
529
530     /*!
531      * Returns IDs of nodes of given element
532      */
533     long_array GetElemNodes(in long id);
534
535     /*!
536      * Returns ID of node by given index for given element
537      * If there is not element for given ID - returns -1
538      * If there is not node for given index - returns -2
539      */
540     long GetElemNode(in long id, in long index);
541
542     /*!
543      * Returns true if given node is medium node
544      * in given quadratic element
545      */
546     boolean IsMediumNode(in long ide, in long idn);
547
548     /*!
549      * Returns true if given node is medium node
550      * in one of quadratic elements
551      */
552     boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type);
553
554     /*!
555      * Returns number of edges for given element
556      */
557     long ElemNbEdges(in long id);
558
559     /*!
560      * Returns number of faces for given element
561      */
562     long ElemNbFaces(in long id);
563
564     /*!
565      * Returns true if given element is polygon
566      */
567     boolean IsPoly(in long id);
568
569     /*!
570      * Returns true if given element is quadratic
571      */
572     boolean IsQuadratic(in long id);
573
574     /*!
575      * Returns XYZ coordinates of bary center for given element
576      * as list of double
577      * If there is not element for given ID - returns empty list
578      */
579     double_array BaryCenter(in long id);
580
581   };
582
583   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
584   {
585     /*!
586      *
587      */
588     long GetNumberOfElements()
589       raises (SALOME::SALOME_Exception);
590
591     /*!
592      *
593      */
594     long GetNumberOfNodes( in boolean all )
595       raises (SALOME::SALOME_Exception);
596
597     /*!
598      *
599      */
600     long_array GetElementsId()
601       raises (SALOME::SALOME_Exception);
602
603     /*!
604      *
605      */
606     long_array GetElementsByType( in ElementType theType )
607       raises (SALOME::SALOME_Exception);
608     
609     /*!
610      * Return type of submesh element
611      */
612     ElementType GetElementType( in long id, in boolean iselem )
613       raises (SALOME::SALOME_Exception);
614
615     /*!
616      *
617      */
618     long_array GetNodesId()
619       raises (SALOME::SALOME_Exception);
620
621     /*!
622      * Get geom shape the submesh is dedicated to
623      */
624     GEOM::GEOM_Object GetSubShape()
625       raises (SALOME::SALOME_Exception);
626
627     /*!
628      * Get SMESH_Mesh which stores nodes coordinates & elements definition
629      */
630     SMESH_Mesh GetFather()
631       raises (SALOME::SALOME_Exception);
632
633     /*!
634      * Get the internal Id
635      */
636     long GetId();
637
638     /*!
639      * Get MED subMesh
640      */
641     SALOME_MED::FAMILY GetFamily()
642       raises (SALOME::SALOME_Exception);
643   };
644
645   /*!
646    * This interface makes modifications on the Mesh - removing elements and nodes etc.
647    */
648   interface NumericalFunctor;
649   interface SMESH_MeshEditor
650   {
651     boolean RemoveElements(in long_array IDsOfElements);
652
653     boolean RemoveNodes(in long_array IDsOfNodes);
654
655     long AddNode(in double x, in double y, in double z);
656
657     /*!
658      *  Create edge, either linear and quadratic (this is determed
659      *  by number of given nodes).
660      *  \param IdsOfNodes List of node IDs for creation of element.
661      *  Needed order of nodes in this list corresponds to description
662      *  of MED. This description is located by the following link:
663      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
664      */
665     long AddEdge(in long_array IDsOfNodes);
666
667     /*!
668      *  Create face, either linear and quadratic (this is determed
669      *  by number of given nodes).
670      *  \param IdsOfNodes List of node IDs for creation of element.
671      *  Needed order of nodes in this list corresponds to description
672      *  of MED. This description is located by the following link:
673      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
674      */
675     long AddFace(in long_array IDsOfNodes);
676
677     long AddPolygonalFace(in long_array IdsOfNodes);
678
679     /*!
680      *  Create volume, either linear and quadratic (this is determed
681      *  by number of given nodes).
682      *  \param IdsOfNodes List of node IDs for creation of element.
683      *  Needed order of nodes in this list corresponds to description
684      *  of MED. This description is located by the following link:
685      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
686      */
687     long AddVolume(in long_array IDsOfNodes);
688
689     /*!
690      *  Create volume of many faces, giving nodes for each face.
691      *  \param IdsOfNodes List of node IDs for volume creation face by face.
692      *  \param Quantities List of integer values, Quantities[i]
693      *         gives quantity of nodes in face number i.
694      */
695     long AddPolyhedralVolume (in long_array IdsOfNodes,
696                                  in long_array Quantities);
697
698     /*!
699      *  Create volume of many faces, giving IDs of existing faces.
700      *  \param IdsOfFaces List of face IDs for volume creation.
701      *  \note The created volume will refer only to nodes
702      *        of the given faces, not to the faces itself.
703      */
704     long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
705
706     boolean MoveNode(in long NodeID, in double x, in double y, in double z);
707
708     boolean InverseDiag(in long NodeID1, in long NodeID2);
709
710     boolean DeleteDiag(in long NodeID1, in long NodeID2);
711
712     boolean Reorient(in long_array IDsOfElements);
713
714     boolean ReorientObject(in SMESH_IDSource theObject);
715
716     /*!
717      * \brief Fuse neighbour triangles into quadrangles.
718      * \param theElems     The triangles to be fused.
719      * \param theCriterion Is used to choose a neighbour to fuse with.
720      * \param theMaxAngle  Is a max angle between element normals at which fusion
721      *                     is still performed; theMaxAngle is mesured in radians.
722      * \return TRUE in case of success, FALSE otherwise.
723      */
724     boolean TriToQuad (in long_array       IDsOfElements,
725                        in NumericalFunctor Criterion,
726                        in double           MaxAngle);
727
728     /*!
729      * \brief Fuse neighbour triangles into quadrangles.
730      *
731      * Behaves like the above method, taking list of elements from \a theObject
732      */
733     boolean TriToQuadObject (in SMESH_IDSource   theObject,
734                              in NumericalFunctor Criterion,
735                              in double           MaxAngle);
736
737     /*!
738      * \brief Split quadrangles into triangles.
739      * \param theElems     The faces to be splitted.
740      * \param theCriterion Is used to choose a diagonal for splitting.
741      * \return TRUE in case of success, FALSE otherwise.
742      */
743     boolean QuadToTri (in long_array       IDsOfElements,
744                        in NumericalFunctor Criterion);
745
746     /*!
747      * \brief Split quadrangles into triangles.
748      *
749      * Behaves like the above method, taking list of elements from \a theObject
750      */
751     boolean QuadToTriObject (in SMESH_IDSource   theObject,
752                              in NumericalFunctor Criterion);
753
754     /*!
755      * \brief Split quadrangles into triangles.
756      * \param theElems  The faces to be splitted.
757      * \param the13Diag Is used to choose a diagonal for splitting.
758      * \return TRUE in case of success, FALSE otherwise.
759      */
760     boolean SplitQuad (in long_array IDsOfElements,
761                        in boolean    Diag13);
762
763     /*!
764      * \brief Split quadrangles into triangles.
765      *
766      * Behaves like the above method, taking list of elements from \a theObject
767      */
768     boolean SplitQuadObject (in SMESH_IDSource theObject,
769                              in boolean        Diag13);
770
771     /*!
772      *  Find better splitting of the given quadrangle.
773      *  \param IDOfQuad  ID of the quadrangle to be splitted.
774      *  \param Criterion A criterion to choose a diagonal for splitting.
775      *  \return 1 if 1-3 diagonal is better, 2 if 2-4
776      *          diagonal is better, 0 if error occurs.
777      */
778     long BestSplit (in long             IDOfQuad,
779                     in NumericalFunctor Criterion);
780
781     enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
782
783     boolean Smooth(in long_array    IDsOfElements,
784                    in long_array    IDsOfFixedNodes,
785                    in long          MaxNbOfIterations,
786                    in double        MaxAspectRatio,
787                    in Smooth_Method Method);
788
789     boolean SmoothObject(in SMESH_IDSource  theObject,
790                          in long_array      IDsOfFixedNodes,
791                          in long            MaxNbOfIterations,
792                          in double          MaxAspectRatio,
793                          in Smooth_Method   Method);
794
795     boolean SmoothParametric(in long_array    IDsOfElements,
796                              in long_array    IDsOfFixedNodes,
797                              in long          MaxNbOfIterations,
798                              in double        MaxAspectRatio,
799                              in Smooth_Method Method);
800
801     boolean SmoothParametricObject(in SMESH_IDSource  theObject,
802                                    in long_array      IDsOfFixedNodes,
803                                    in long            MaxNbOfIterations,
804                                    in double          MaxAspectRatio,
805                                    in Smooth_Method   Method);
806
807     void ConvertToQuadratic(in boolean theForce3d);
808
809     boolean ConvertFromQuadratic();
810
811     void RenumberNodes();
812
813     void RenumberElements();
814
815     void RotationSweep(in long_array       IDsOfElements,
816                        in AxisStruct       Axix,
817                        in double           AngleInRadians,
818                        in long             NbOfSteps,
819                        in double           Tolerance);
820
821     void RotationSweepObject(in SMESH_IDSource  theObject,
822                              in AxisStruct      Axix,
823                              in double          AngleInRadians,
824                              in long            NbOfSteps,
825                              in double          Tolerance);
826
827     void ExtrusionSweep(in long_array      IDsOfElements,
828                         in DirStruct       StepVector,
829                         in long            NbOfSteps);
830
831    /*!
832     * Generate new elements by extrusion of theElements 
833     * by StepVector by NbOfSteps
834     * param ExtrFlags set flags for performing extrusion
835     * param SewTolerance - uses for comparing locations of nodes if flag
836     *   EXTRUSION_FLAG_SEW is set
837     */
838     void AdvancedExtrusion(in long_array      IDsOfElements,
839                            in DirStruct       StepVector,
840                            in long            NbOfSteps,
841                            in long            ExtrFlags,
842                            in double          SewTolerance);
843
844     void ExtrusionSweepObject(in SMESH_IDSource  theObject,
845                               in DirStruct       StepVector,
846                               in long            NbOfSteps);
847
848     void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
849                                 in DirStruct      StepVector,
850                                 in long           NbOfSteps);
851
852     void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
853                                 in DirStruct      StepVector,
854                                 in long           NbOfSteps);
855
856     enum Extrusion_Error {
857       EXTR_OK,
858       EXTR_NO_ELEMENTS,
859       EXTR_PATH_NOT_EDGE,
860       EXTR_BAD_PATH_SHAPE,
861       EXTR_BAD_STARTING_NODE,
862       EXTR_BAD_ANGLES_NUMBER,
863       EXTR_CANT_GET_TANGENT
864       };
865
866     Extrusion_Error ExtrusionAlongPath(in long_array        IDsOfElements,
867                                        in SMESH_Mesh        PathMesh,
868                                        in GEOM::GEOM_Object PathShape,
869                                        in long              NodeStart,
870                                        in boolean           HasAngles,
871                                        in double_array      Angles,
872                                        in boolean           HasRefPoint,
873                                        in PointStruct       RefPoint);
874
875     Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource    theObject,
876                                              in SMESH_Mesh        PathMesh,
877                                              in GEOM::GEOM_Object PathShape,
878                                              in long              NodeStart,
879                                              in boolean           HasAngles,
880                                              in double_array      Angles,
881                                              in boolean           HasRefPoint,
882                                              in PointStruct       RefPoint);
883
884     enum MirrorType { POINT, AXIS, PLANE };
885
886     void Mirror (in long_array       IDsOfElements,
887                  in AxisStruct       Mirror,
888                  in MirrorType       theMirrorType,
889                  in boolean          Copy);
890
891     void MirrorObject (in SMESH_IDSource  theObject,
892                        in AxisStruct      Mirror,
893                        in MirrorType      theMirrorType,
894                        in boolean         Copy);
895
896     void Translate (in long_array      IDsOfElements,
897                     in DirStruct       Vector,
898                     in boolean         Copy);
899
900     void TranslateObject (in SMESH_IDSource  theObject,
901                           in DirStruct       Vector,
902                           in boolean         Copy);
903
904     void Rotate (in long_array       IDsOfElements,
905                  in AxisStruct       Axis,
906                  in double           AngleInRadians,
907                  in boolean          Copy);
908
909     void RotateObject (in SMESH_IDSource  theObject,
910                        in AxisStruct      Axis,
911                        in double          AngleInRadians,
912                        in boolean         Copy);
913
914     void FindCoincidentNodes (in  double              Tolerance,
915                               out array_of_long_array GroupsOfNodes);
916
917     void MergeNodes (in array_of_long_array GroupsOfNodes);
918
919     void MergeEqualElements();
920
921     enum Sew_Error {
922       SEW_OK,
923       SEW_BORDER1_NOT_FOUND,
924       SEW_BORDER2_NOT_FOUND,
925       SEW_BOTH_BORDERS_NOT_FOUND,
926       SEW_BAD_SIDE_NODES,
927       SEW_VOLUMES_TO_SPLIT,
928       // for SewSideElements() only:
929       SEW_DIFF_NB_OF_ELEMENTS,
930       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
931       SEW_BAD_SIDE1_NODES,
932       SEW_BAD_SIDE2_NODES
933       };
934
935     Sew_Error SewFreeBorders (in long FirstNodeID1,
936                               in long SecondNodeID1,
937                               in long LastNodeID1,
938                               in long FirstNodeID2,
939                               in long SecondNodeID2,
940                               in long LastNodeID2,
941                               in boolean CreatePolygons,
942                               in boolean CreatePolyedrs);
943
944     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
945                                      in long SecondNodeID1,
946                                      in long LastNodeID1,
947                                      in long FirstNodeID2,
948                                      in long SecondNodeID2);
949
950     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
951                                in long SecondNodeIDOnFreeBorder,
952                                in long LastNodeIDOnFreeBorder,
953                                in long FirstNodeIDOnSide,
954                                in long LastNodeIDOnSide,
955                                in boolean CreatePolygons,
956                                in boolean CreatePolyedrs);
957
958     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
959                                in long_array IDsOfSide2Elements,
960                                in long       NodeID1OfSide1ToMerge,
961                                in long       NodeID1OfSide2ToMerge,
962                                in long       NodeID2OfSide1ToMerge,
963                                in long       NodeID2OfSide2ToMerge);
964
965    /*!
966     * Set new nodes for given element.
967     * If number of nodes is not corresponded to type of
968     * element - returns false
969     */
970     boolean ChangeElemNodes(in long ide, in long_array newIDs);
971
972    /*!
973     * If during last operation of MeshEditor some nodes were
974     * created this method returns list of it's IDs, if new nodes
975     * not creared - returns empty list
976     */
977     long_array GetLastCreatedNodes();
978
979    /*!
980     * If during last operation of MeshEditor some elements were
981     * created this method returns list of it's IDs, if new elements
982     * not creared - returns empty list
983     */
984     long_array GetLastCreatedElems();
985
986   };
987 };
988
989 #endif