Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / idl / SMESH_Mesh.idl
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SMESH_Mesh.idl
24 //  Author : Paul RASCLE, EDF
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   interface SMESH_IDSource;
41   typedef sequence<SMESH_IDSource> ListOfIDSources;
42
43   typedef sequence<double    > double_array ;
44   typedef sequence<long      > long_array ;
45   typedef sequence<string    > string_array ;
46   typedef sequence<long_array> array_of_long_array ;
47
48   enum log_command
49     {
50       ADD_NODE,
51       ADD_EDGE,
52       ADD_TRIANGLE,
53       ADD_QUADRANGLE,
54       ADD_POLYGON,
55       ADD_TETRAHEDRON,
56       ADD_PYRAMID,
57       ADD_PRISM,
58       ADD_HEXAHEDRON,
59       ADD_POLYHEDRON,
60       REMOVE_NODE,
61       REMOVE_ELEMENT,
62       MOVE_NODE,
63       CHANGE_ELEMENT_NODES,
64       CHANGE_POLYHEDRON_NODES,
65       RENUMBER,
66       CLEAR_MESH,
67       ADD_QUADEDGE,
68       ADD_QUADTRIANGLE,
69       ADD_QUADQUADRANGLE,
70       ADD_QUADTETRAHEDRON,
71       ADD_QUADPYRAMID,
72       ADD_QUADPENTAHEDRON,
73       ADD_QUADHEXAHEDRON,
74       ADD_ELEM0D,
75       ADD_BIQUAD_QUADRANGLE,
76       ADD_TRIQUAD_HEXA,
77       ADD_HEXAGONAL_PRISM
78     };
79
80   struct log_block
81   {
82     long commandType;
83     long number;
84     double_array coords;
85     long_array indexes;
86   };
87
88   struct PointStruct { double x;
89                        double y;
90                        double z; } ;
91
92   typedef sequence<PointStruct> nodes_array;
93
94   struct DirStruct   { PointStruct PS ; } ;          // analog to Occ Direction
95
96   struct AxisStruct  { double x;
97                        double y;
98                        double z;
99                        double vx;
100                        double vy;
101                        double vz; } ;
102
103   /*!
104    * Node location on a shape
105    */
106   struct NodePosition {
107     long             shapeID;
108     GEOM::shape_type shapeType;
109     double_array     params; // [U] on EDGE, [U,V] on FACE, [] on the rest shapes
110   };
111
112   /*!
113    * Enumeration for element type, like in SMDS
114    */
115   enum ElementType
116   {
117     ALL,
118     NODE,
119     EDGE,
120     FACE,
121     VOLUME,
122     ELEM0D
123   };
124   typedef sequence<ElementType> array_of_ElementType ;
125
126   /*!
127    * Enumeration for element geometry type, like in SMDS
128    */
129   enum GeometryType
130   {
131     Geom_POINT,
132     Geom_EDGE,
133     Geom_TRIANGLE,
134     Geom_QUADRANGLE,
135     Geom_POLYGON,
136     Geom_TETRA,
137     Geom_PYRAMID,
138     Geom_HEXA,
139     Geom_PENTA,
140     Geom_HEXAGONAL_PRISM,
141     Geom_POLYHEDRA
142   };
143   
144   /*!
145    * ElementOrder points out entities of what order are requested
146    */
147   enum ElementOrder {
148     ORDER_ANY,          /*! entities of any order */
149     ORDER_LINEAR,       /*! entities of 1st order */
150     ORDER_QUADRATIC     /*! entities of 2nd order */
151   };
152
153
154   /*!
155    * Enumeration of entity type used in mesh info array,
156    * it should be synchronised with enum SMDSAbs_EntityType
157    */
158   enum EntityType
159   {
160     Entity_Node,
161     Entity_0D,
162     Entity_Edge,
163     Entity_Quad_Edge,
164     Entity_Triangle,
165     Entity_Quad_Triangle,
166     Entity_Quadrangle,
167     Entity_Quad_Quadrangle,
168     Entity_BiQuad_Quadrangle,
169     Entity_Polygon,
170     Entity_Quad_Polygon,
171     Entity_Tetra,
172     Entity_Quad_Tetra,
173     Entity_Pyramid,
174     Entity_Quad_Pyramid,
175     Entity_Hexa,
176     Entity_Quad_Hexa,
177     Entity_TriQuad_Hexa,
178     Entity_Penta,
179     Entity_Quad_Penta,
180     Entity_Hexagonal_Prism,
181     Entity_Polyhedra,
182     Entity_Quad_Polyhedra,
183     Entity_Last
184   };
185
186
187   /*!
188    * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
189    */
190   enum Hypothesis_Status // in the order of severity
191   {
192     HYP_OK,
193     HYP_MISSING,      // algo misses a hypothesis
194     HYP_CONCURENT,    // several applicable hypotheses
195     HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
196     HYP_HIDDEN_ALGO,  // an algo is hidden by an upper dim algo generating all-dim elements
197     HYP_HIDING_ALGO,  // an algo hides lower dim algos by generating all-dim elements
198     HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
199                       //      for Add/RemoveHypothesis operations
200     HYP_INCOMPATIBLE, // hypothesis does not fit algo
201     HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
202     HYP_ALREADY_EXIST,// such hypothesis already exist
203     HYP_BAD_DIM,      // bad dimension
204     HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its sub-shape, nor a group
205     HYP_BAD_GEOMETRY, // geometry mismatches algorithm's expectation
206     HYP_NEED_SHAPE    // algorithm can work on shape only
207   };
208
209   /*!
210    * Enumeration for DriverMED read status (used by ImportMEDFile() method)
211    */
212   enum DriverMED_ReadStatus // in the order of severity
213   {
214     DRS_OK,
215     DRS_EMPTY,          // a MED file contains no mesh with the given name
216     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
217                         // so the numbers from the file are ignored
218     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
219     DRS_FAIL            // general failure (exception etc.)
220   };
221
222   /*!
223    * Enumeration for DriverMED (used by Perform() method)
224    */
225   enum MED_VERSION // in the order of severity
226   {
227     MED_V2_1,
228     MED_V2_2
229   };
230
231   typedef sequence<log_block> log_array;
232
233
234   /*!
235    * Auxilary flags for advanced extrusion.
236    * BOUNDARY: create or not boundary for result of extrusion
237    * SEW:      try to use existing nodes or create new nodes in any case
238    */
239   const long EXTRUSION_FLAG_BOUNDARY = 1;
240   const long EXTRUSION_FLAG_SEW = 2;
241   
242   /*!
243    * Structure used in mesh edit preview data (MeshPreviewStruct)
244    */
245   struct ElementSubType { ElementType SMDS_ElementType;
246                           boolean     isPoly;
247                           long        nbNodesInElement; };
248
249   typedef sequence<ElementSubType> types_array;
250
251   /*!
252    * Structure containing mesh edit preview data
253    */
254   struct MeshPreviewStruct { nodes_array nodesXYZ;
255                              long_array  elementConnectivities;
256                              types_array elementTypes; };
257
258   interface SMESH_Mesh;
259
260   interface SMESH_IDSource
261   {
262     /*!
263      * Returns a sequence of all element IDs
264      */
265     long_array GetIDs();
266
267     /*!
268      * Returns statistic of mesh elements
269      * @return array of number enityties by index of EntityType
270      */
271     long_array GetMeshInfo();
272
273     /*!
274      * Returns types of elements it contains.
275      * It's empty if the SMESH_IDSource contains no IDs
276      */
277     array_of_ElementType GetTypes();
278
279     /*!
280      * Returns the mesh
281      */
282     SMESH_Mesh GetMesh();
283
284     /*!
285      * Returns false if GetMeshInfo() returns incorrect information that may
286      * happen if mesh data is not yet fully loaded from the file of study.
287      */
288     boolean IsMeshInfoCorrect();
289   };
290
291   interface SMESH_Group;
292   interface SMESH_GroupOnGeom;
293   interface Filter;
294   interface SMESH_GroupOnFilter;
295   interface SMESH_subMesh;
296   interface SMESH_MeshEditor;
297
298   typedef sequence<SMESH_subMesh>     submesh_array;
299   typedef sequence<submesh_array>     submesh_array_array;
300
301   interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
302   {
303     /*!
304      * Return true if there is a geometry to be meshed
305      */
306     boolean HasShapeToMesh()
307       raises (SALOME::SALOME_Exception);
308
309     /*!
310      * Get geom shape to mesh. A result sould not be nil. Use HasShapeToMesh()
311      * to know if a returned shape 
312      */
313     GEOM::GEOM_Object GetShapeToMesh()
314       raises (SALOME::SALOME_Exception);
315
316     /*!
317      * Return false if the mesh is not yet fully loaded from the study file
318      */
319     boolean IsLoaded()
320       raises (SALOME::SALOME_Exception);
321
322     /*!
323      * Load full mesh data from the study file
324      */
325     void Load()
326       raises (SALOME::SALOME_Exception);
327
328     /*!
329      * Remove all nodes and elements
330      */
331     void Clear()
332       raises (SALOME::SALOME_Exception);
333
334     /*!
335      *  Get the list of sub-meshes existing in the mesh
336      */
337     submesh_array GetSubMeshes()
338       raises (SALOME::SALOME_Exception);
339
340     /*!
341      * Remove all nodes and elements of submesh
342      */
343     void ClearSubMesh(in long ShapeID)
344       raises (SALOME::SALOME_Exception);
345
346     /*!
347      * Get the subMesh object associated to a Sub-shape. The subMesh object
348      * gives access to nodes and elements IDs.
349      * SubMesh will be used instead of Sub-shape in a next idl version to
350      * adress a specific subMesh...
351      */
352     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
353       raises (SALOME::SALOME_Exception);
354
355     /*!
356      * Remove a submesh
357      */
358     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
359       raises (SALOME::SALOME_Exception);
360
361
362     /*!
363      * Create a group
364      */
365     SMESH_Group CreateGroup( in ElementType elem_type,
366                              in string      name )
367       raises (SALOME::SALOME_Exception);
368
369     /*!
370      * Create a group from geometry
371      */
372     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType       elemType,
373                                            in string            name,
374                                            in GEOM::GEOM_Object geomObject )
375       raises (SALOME::SALOME_Exception);
376
377     /*!
378      * Create a group from filter
379      */
380     SMESH_GroupOnFilter CreateGroupFromFilter( in ElementType   elemType,
381                                                in string        name,
382                                                in SMESH::Filter filter )
383       raises (SALOME::SALOME_Exception);
384
385     /*!
386      * Remove a group
387      */
388     void RemoveGroup(in SMESH_GroupBase aGroup)
389       raises (SALOME::SALOME_Exception);
390
391     /*!
392      *  Remove group with its contents
393      */
394     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
395       raises (SALOME::SALOME_Exception);
396
397     /*!
398      *  Get the list of groups existing in the mesh
399      */
400     ListOfGroups GetGroups()
401       raises (SALOME::SALOME_Exception);
402
403     /*!
404      *  Get number of groups existing in the mesh
405      */
406     long NbGroups()
407       raises (SALOME::SALOME_Exception);
408
409     /*!
410      * Union of two groups
411      *    New group is created. All mesh elements that are
412      *    present in initial groups are added to the new one
413      */
414     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
415                              in SMESH_GroupBase aGroup2,
416                              in string          name )
417       raises (SALOME::SALOME_Exception);
418       
419     /*!
420      * Union of list of groups
421      * New group is created. All mesh elements that are
422      * present in initial groups are added to the new one
423      */
424     SMESH_Group UnionListOfGroups (in ListOfGroups aListOfGroups,
425                                    in string       name )
426       raises (SALOME::SALOME_Exception);
427
428     /*!
429      *  Intersection of two groups
430      *  New group is created. All mesh elements that are
431      *  present in both initial groups are added to the new one.
432      */
433     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
434                                  in SMESH_GroupBase aGroup2,
435                                  in string          name )
436       raises (SALOME::SALOME_Exception);
437       
438     /*!
439      *  Intersection of list of groups
440      *  New group is created. All mesh elements that are
441      *  present in all initial groups simultaneously are added to the new one.
442      */
443     SMESH_Group IntersectListOfGroups (in ListOfGroups aListOfGroups,
444                                        in string       name)
445       raises (SALOME::SALOME_Exception);
446
447     /*!
448      *  Cut of two groups
449      *  New group is created. All mesh elements that are present in
450      *  main group but do not present in tool group are added to the new one
451      */
452     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
453                            in SMESH_GroupBase aToolGroup,
454                            in string          name )
455       raises (SALOME::SALOME_Exception);
456       
457     /*!
458      *  Cut of lists of groups
459      *  New group is created. All mesh elements that are present in
460      *  main groups but do not present in tool groups are added to the new one
461      */
462     SMESH_Group CutListOfGroups (in ListOfGroups aMainGroups,
463                                  in ListOfGroups aToolGroups,
464                                  in string       name)
465       raises (SALOME::SALOME_Exception);
466       
467     /*!
468      *  Create groups of entities from existing groups of superior dimensions 
469      *  New group is created. System 
470      *  1) extracts all nodes from each group,
471      *  2) combines all elements of specified dimension laying on these nodes.
472      */
473     SMESH_Group CreateDimGroup( in ListOfGroups aListOfGroups,
474                                 in ElementType  anElemType,
475                                 in string       name )
476       raises (SALOME::SALOME_Exception);
477
478     /*!
479      * Convert group on geometry or on filter into standalone group
480      */
481     SMESH_Group ConvertToStandalone( in SMESH_GroupBase theGroupOn )
482       raises (SALOME::SALOME_Exception);
483
484     /*!
485      * Add hypothesis to the mesh, under a particular Sub-shape
486      * (or the main shape itself)
487      * The Add method is only used to prepare the build of the mesh and store
488      * the algorithms and associated parameters.
489      * Actual job of mesh the shape is done by MESH_Gen.
490      * @params
491      * - aSubShape : sub-shape obtained by a shape explode in GEOM
492      *   (or main shape)
493      * - anHyp : hypothesis object
494      * @return
495      * - OK if the hypothesis is compatible with the sub-shape
496      *   (and all previous hypothesis on the sub-shape)
497      * - NOK if the hypothesis is not compatible with the sub-shape
498      *   (or one previous hypothesis on the sub-shape)
499      * raises exception if hypothesis has not been created
500      */
501     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
502                                     in SMESH_Hypothesis anHyp)
503       raises (SALOME::SALOME_Exception);
504 //     boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
505 //       raises (SALOME::SALOME_Exception);
506
507     /*!
508      * Remove an hypothesis previouly added with AddHypothesis.
509      */
510     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
511                                        in SMESH_Hypothesis anHyp)
512       raises (SALOME::SALOME_Exception);
513 //     boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
514 //                           in SMESH_Hypothesis anHyp)
515 //       raises (SALOME::SALOME_Exception);
516
517     /*!
518      * Get the list of hypothesis added on a sub-shape
519      */
520     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
521       raises (SALOME::SALOME_Exception);
522 //     ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
523 //       raises (SALOME::SALOME_Exception);
524
525     /*!
526      * Get the log of nodes and elements added or removed since previous
527      * clear of the log.
528      * @params
529      * - clearAfterGet : log is emptied after Get (safe if concurrents access)
530      */
531     //    string_array GetLog(in boolean clearAfterGet)
532     //      raises (SALOME::SALOME_Exception);
533     log_array GetLog(in boolean clearAfterGet)
534       raises (SALOME::SALOME_Exception);
535
536     /*!
537      * Clear the log of nodes and elements added or removed since previous
538      * clear. Must be used immediately after GetLog if clearAfterGet is false.
539      */
540     void ClearLog()
541       raises (SALOME::SALOME_Exception);
542
543     /*!
544      * Toggle auto color mode on the object.
545      * @params
546      * - theAutoColor : flag which toggles auto color mode.
547      */
548     void SetAutoColor(in boolean theAutoColor)
549       raises (SALOME::SALOME_Exception);
550
551     /*!
552      * Get flag of object's auto color mode.
553      */
554     boolean GetAutoColor()
555       raises (SALOME::SALOME_Exception);
556
557     /*!
558      * Get the internal Id
559      */
560     long GetId();
561
562     /*!
563      * Get the study Id
564      */
565     long GetStudyId();
566
567     /*!
568      * Obtain instance of SMESH_MeshEditor
569      */
570     SMESH_MeshEditor GetMeshEditor()
571       raises (SALOME::SALOME_Exception);
572
573     /*!
574      * Return SMESH_MeshEditor that would not modify the mesh but
575      * fill MeshPreviewStruct
576      */
577     SMESH_MeshEditor GetMeshEditPreviewer()
578       raises (SALOME::SALOME_Exception);
579
580     /*!
581      * Return true if the mesh has been edited since a total re-compute
582      * and those modifications may prevent successful partial re-compute
583      */
584     boolean HasModificationsToDiscard()
585       raises (SALOME::SALOME_Exception);
586
587     /*! Check group names for duplications.
588      *  Consider maximum group name length stored in MED file.
589      */
590     boolean HasDuplicatedGroupNamesMED();
591
592     /*!
593      * Export Mesh to different MED Formats
594      * @params
595      * - file : name of the MED file
596      * - auto_groups : boolean parameter for creating/not creating
597      *   the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
598      *   the typical use is auto_groups=false.
599      * - version : define the version of format of MED file, that will be created
600      * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
601      */
602     void ExportToMEDX( in string      file, 
603                        in boolean     auto_groups, 
604                        in MED_VERSION version, 
605                        in boolean     overwrite ) raises (SALOME::SALOME_Exception);
606
607     /*!
608      * Export a part of Mesh into a MED file
609      * @params
610      * - meshPart : a part of mesh to store
611      * - file : name of the MED file
612      * - version : define the version of format of MED file, that will be created
613      * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
614      */
615     void ExportPartToMED( in SMESH_IDSource meshPart, 
616                           in string         file, 
617                           in boolean        auto_groups,
618                           in MED_VERSION    version,
619                           in boolean        overwrite ) raises (SALOME::SALOME_Exception);
620
621     /*!
622      * Export Mesh to different MED Formats
623      * Works, just the same as ExportToMEDX, with overwrite parameter equal to true.
624      * The method is kept in order to support old functionality
625      */
626     void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
627       raises (SALOME::SALOME_Exception);
628
629     /*!
630      * Export Mesh to MED_V2_1 MED format
631      * Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1
632      * and overwrite parameter equal to true
633      * The method is kept in order to support old functionality
634      */
635     void ExportMED( in string file, in boolean auto_groups )
636       raises (SALOME::SALOME_Exception);
637
638     /*!
639      * Export Mesh to SAUV formatted file
640      * Write a temporary med file and use med2sauv
641      */
642     void ExportSAUV( in string file, in boolean auto_groups )
643       raises (SALOME::SALOME_Exception);
644
645     /*!
646      * Return string representation of a MED file version comprising nbDigits
647      */
648     string GetVersionString(in MED_VERSION version, in short nbDigits);
649
650     /*!
651      * Export Mesh to DAT, UNV and STL Formats
652      * (UNV supported version is I-DEAS 10)
653      */
654     void ExportDAT( in string file ) raises (SALOME::SALOME_Exception);
655     void ExportUNV( in string file ) raises (SALOME::SALOME_Exception);
656     void ExportSTL( in string  file,
657                     in boolean isascii ) raises (SALOME::SALOME_Exception);
658     void ExportCGNS( in SMESH_IDSource meshPart, 
659                      in string         file,
660                      in boolean        overwrite ) raises (SALOME::SALOME_Exception);
661     void ExportPartToDAT( in SMESH_IDSource meshPart, 
662                           in string         file ) raises (SALOME::SALOME_Exception);
663     void ExportPartToUNV( in SMESH_IDSource meshPart, 
664                           in string         file ) raises (SALOME::SALOME_Exception);
665     void ExportPartToSTL( in SMESH_IDSource meshPart,
666                           in string         file,
667                           in boolean        isascii ) raises (SALOME::SALOME_Exception);
668
669     /*!
670      * Get MED Mesh
671      */
672     SALOME_MED::MESH GetMEDMesh()
673       raises (SALOME::SALOME_Exception);
674
675     /*!
676      * Get informations about mesh contents
677      */
678     long NbNodes()
679       raises (SALOME::SALOME_Exception);
680
681     long NbElements()
682       raises (SALOME::SALOME_Exception);
683
684     long Nb0DElements()
685       raises (SALOME::SALOME_Exception);
686
687     long NbEdges()
688       raises (SALOME::SALOME_Exception);
689
690     long NbEdgesOfOrder(in ElementOrder order)
691       raises (SALOME::SALOME_Exception);
692
693     long NbFaces()
694       raises (SALOME::SALOME_Exception);
695
696     long NbFacesOfOrder(in ElementOrder order)
697       raises (SALOME::SALOME_Exception);
698
699     long NbTriangles()
700       raises (SALOME::SALOME_Exception);
701
702     long NbTrianglesOfOrder(in ElementOrder order)
703       raises (SALOME::SALOME_Exception);
704
705     long NbQuadrangles()
706       raises (SALOME::SALOME_Exception);
707
708     long NbQuadranglesOfOrder(in ElementOrder order)
709       raises (SALOME::SALOME_Exception);
710
711     long NbBiQuadQuadrangles()
712       raises (SALOME::SALOME_Exception);
713
714     long NbPolygons()
715       raises (SALOME::SALOME_Exception);
716
717     long NbVolumes()
718       raises (SALOME::SALOME_Exception);
719
720     long NbVolumesOfOrder(in ElementOrder order)
721       raises (SALOME::SALOME_Exception);
722
723     long NbTetras()
724       raises (SALOME::SALOME_Exception);
725
726     long NbTetrasOfOrder(in ElementOrder order)
727       raises (SALOME::SALOME_Exception);
728
729     long NbHexas()
730       raises (SALOME::SALOME_Exception);
731
732     long NbHexasOfOrder(in ElementOrder order)
733       raises (SALOME::SALOME_Exception);
734
735     long NbTriQuadraticHexas()
736       raises (SALOME::SALOME_Exception);
737
738     long NbPyramids()
739       raises (SALOME::SALOME_Exception);
740
741     long NbPyramidsOfOrder(in ElementOrder order)
742       raises (SALOME::SALOME_Exception);
743
744     long NbPrisms()
745       raises (SALOME::SALOME_Exception);
746
747     long NbPrismsOfOrder(in ElementOrder order)
748       raises (SALOME::SALOME_Exception);
749
750     long NbHexagonalPrisms()
751       raises (SALOME::SALOME_Exception);
752
753     long NbPolyhedrons()
754       raises (SALOME::SALOME_Exception);
755
756     long NbSubMesh()
757       raises (SALOME::SALOME_Exception);
758
759     long_array GetElementsId()
760       raises (SALOME::SALOME_Exception);
761
762     long_array GetElementsByType( in ElementType theType )
763       raises (SALOME::SALOME_Exception);
764
765     long_array GetNodesId()
766       raises (SALOME::SALOME_Exception);
767     
768     /*!
769      * Returns type of mesh element
770      */    
771     ElementType GetElementType( in long id, in boolean iselem )
772       raises (SALOME::SALOME_Exception);
773
774     EntityType GetElementGeomType( in long id )
775       raises (SALOME::SALOME_Exception);
776
777     long_array GetSubMeshElementsId(in long ShapeID)
778       raises (SALOME::SALOME_Exception);
779
780     long_array GetSubMeshNodesId(in long ShapeID, in boolean all )
781       raises (SALOME::SALOME_Exception);
782     
783     ElementType GetSubMeshElementType(in long ShapeID)
784       raises (SALOME::SALOME_Exception);
785
786
787     /*!
788      * Methods to set meshing order of submeshes
789      */
790
791     /*!
792      * \brief Return submesh objects list in meshing order
793      */
794     submesh_array_array GetMeshOrder();
795
796     /*!
797      * \brief Set submesh object order
798      */
799     boolean SetMeshOrder(in submesh_array_array theSubMeshArray);
800
801
802     /*!
803      * Get mesh description
804      */
805     string Dump();
806
807     /*!
808      * Get mesh pointer
809      */
810     long long GetMeshPtr();
811
812     /*!
813      * Get XYZ coordinates of node as list of double
814      * If there is not node for given ID - returns empty list
815      */
816     double_array GetNodeXYZ(in long id);
817
818     /*!
819      * For given node returns list of IDs of inverse elements
820      * If there is not node for given ID - returns empty list
821      */
822     long_array GetNodeInverseElements(in long id);
823
824     /*!
825      * \brief Return position of a node on shape
826      */
827     NodePosition GetNodePosition(in long NodeID);
828
829     /*!
830      * If given element is node returns IDs of shape from position
831      * If there is not node for given ID - returns -1
832      */
833     long GetShapeID(in long id);
834
835     /*!
836      * For given element returns ID of result shape after 
837      * ::FindShape() from SMESH_MeshEditor
838      * If there is not element for given ID - returns -1
839      */
840     long GetShapeIDForElem(in long id);
841
842     /*!
843      * Returns number of nodes for given element
844      * If there is not element for given ID - returns -1
845      */
846     long GetElemNbNodes(in long id);
847
848     /*!
849      * Returns IDs of nodes of given element
850      */
851     long_array GetElemNodes(in long id);
852
853     /*!
854      * Returns ID of node by given index for given element
855      * If there is not element for given ID - returns -1
856      * If there is not node for given index - returns -2
857      */
858     long GetElemNode(in long id, in long index);
859
860     /*!
861      * Returns true if given node is medium node
862      * in given quadratic element
863      */
864     boolean IsMediumNode(in long ide, in long idn);
865
866     /*!
867      * Returns true if given node is medium node
868      * in one of quadratic elements
869      */
870     boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type);
871
872     /*!
873      * Returns number of edges for given element
874      */
875     long ElemNbEdges(in long id);
876
877     /*!
878      * Returns number of faces for given element
879      */
880     long ElemNbFaces(in long id);
881
882     /*!
883      * Returns nodes of given face (counted from zero) for given volumic element.
884      */
885     long_array GetElemFaceNodes(in long elemId, in short faceIndex);
886
887     /*!
888      * Returns an element based on all given nodes.
889      */
890     long FindElementByNodes(in long_array nodes);
891
892     /*!
893      * Returns true if given element is polygon
894      */
895     boolean IsPoly(in long id);
896
897     /*!
898      * Returns true if given element is quadratic
899      */
900     boolean IsQuadratic(in long id);
901
902     /*!
903      * Returns XYZ coordinates of bary center for given element
904      * as list of double
905      * If there is not element for given ID - returns empty list
906      */
907     double_array BaryCenter(in long id);
908
909     /*! Gets information about imported MED file */
910     SALOME_MED::MedFileInfo GetMEDFileInfo();
911
912     /*!
913      *  Sets list of notebook variables used for Mesh operations separated by ":" symbol
914      *  \param theParameters is a string containing the notebook variables
915      */
916     void SetParameters (in string theParameters);
917
918     /*!
919      *  Returns list of notebook variables used for Mesh operations separated by ":" symbol
920      */
921     string GetParameters();
922
923     /*!
924      *  Returns list of notebook variables used for last Mesh operation
925      */
926     string_array GetLastParameters();
927   };
928
929   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
930   {
931     /*!
932      *
933      */
934     long GetNumberOfElements()
935       raises (SALOME::SALOME_Exception);
936
937     /*!
938      *
939      */
940     long GetNumberOfNodes( in boolean all )
941       raises (SALOME::SALOME_Exception);
942
943     /*!
944      *
945      */
946     long_array GetElementsId()
947       raises (SALOME::SALOME_Exception);
948
949     /*!
950      *
951      */
952     long_array GetElementsByType( in ElementType theType )
953       raises (SALOME::SALOME_Exception);
954     
955     /*!
956      * Return type of submesh element
957      */
958     ElementType GetElementType( in long id, in boolean iselem )
959       raises (SALOME::SALOME_Exception);
960
961     /*!
962      *
963      */
964     long_array GetNodesId()
965       raises (SALOME::SALOME_Exception);
966
967     /*!
968      * Get geom shape the submesh is dedicated to
969      */
970     GEOM::GEOM_Object GetSubShape()
971       raises (SALOME::SALOME_Exception);
972
973     /*!
974      * Get SMESH_Mesh which stores nodes coordinates & elements definition
975      */
976     SMESH_Mesh GetFather()
977       raises (SALOME::SALOME_Exception);
978
979     /*!
980      * Get the internal Id
981      */
982     long GetId();
983
984     /*!
985      * Get MED subMesh
986      */
987     SALOME_MED::FAMILY GetFamily()
988       raises (SALOME::SALOME_Exception);
989   };
990
991 };
992
993 #endif