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