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