Salome HOME
NRI : First integration.
[modules/smesh.git] / src / SMESH / SMESH_Mesh.hxx
1 //=============================================================================
2 // File      : SMESH_Mesh.hxx
3 // Created   : sam mai 18 08:07:35 CEST 2002
4 // Author    : Paul RASCLE, EDF
5 // Project   : SALOME
6 // Copyright : EDF 2002
7 // $Header$
8 //=============================================================================
9
10 #ifndef _SMESH_MESH_HXX_
11 #define _SMESH_MESH_HXX_
12
13 #include "SMESHDS_Document.hxx"
14 #include "SMESHDS_Mesh.hxx"
15 #include "SMESH_Hypothesis.hxx"
16 #include "SMESH_subMesh.hxx"
17 #include "SMESHDS_ListOfCommand.hxx"
18 //#include "SMESHDS_ListOfAsciiString.hxx"
19 //#include "SMESHDS_ListIteratorOfListOfAsciiString.hxx"
20
21
22 #include "Utils_SALOME_Exception.hxx"
23
24 #include <TopExp.hxx>
25 #include <TopExp_Explorer.hxx>
26 #include <TopoDS.hxx>
27 #include <TopoDS_Iterator.hxx>
28 #include <TopoDS_Compound.hxx>
29 #include <TopoDS_CompSolid.hxx>
30 #include <TopoDS_Solid.hxx>
31 #include <TopoDS_Shell.hxx>
32 #include <TopoDS_Face.hxx>
33 #include <TopoDS_Wire.hxx>
34 #include <TopoDS_Edge.hxx>
35 #include <TopoDS_Vertex.hxx>
36 #include <TopoDS_Shape.hxx>
37 #include <TopTools_IndexedMapOfShape.hxx>
38
39 #include <vector>
40 #include <list>
41 #include <map>
42
43 class SMESH_Gen;
44
45 class SMESH_Mesh
46 {
47 public:
48   SMESH_Mesh();
49   SMESH_Mesh(int localId,
50              int studyId,
51              SMESH_Gen* gen,
52              const Handle(SMESHDS_Document)& myDocument);
53
54   virtual ~SMESH_Mesh();
55
56   void ShapeToMesh(const TopoDS_Shape& aShape)
57     throw (SALOME_Exception);
58
59   bool AddHypothesis(const TopoDS_Shape& aSubShape,
60                      int anHypId)
61     throw (SALOME_Exception);
62
63   bool RemoveHypothesis(const TopoDS_Shape& aSubShape,
64                         int anHypId)
65     throw (SALOME_Exception);
66
67   const list<SMESHDS_Hypothesis*>&
68   GetHypothesisList(const TopoDS_Shape& aSubShape)
69     throw (SALOME_Exception);
70
71   const SMESHDS_ListOfCommand& GetLog()
72     throw (SALOME_Exception);
73
74 //   const SMESHDS_ListOfAsciiString& GetLog()
75 //     throw (SALOME_Exception);
76
77   void ClearLog()
78     throw (SALOME_Exception);
79
80   int GetId();
81  
82   const Handle(SMESHDS_Mesh)& GetMeshDS();
83
84   SMESH_Gen* GetGen();
85
86   SMESH_subMesh* GetSubMesh(const TopoDS_Shape & aSubShape)
87     throw (SALOME_Exception);
88
89   SMESH_subMesh* GetSubMeshContaining(const TopoDS_Shape & aSubShape)
90     throw (SALOME_Exception);
91
92   const list <SMESH_subMesh*>&
93   GetSubMeshUsingHypothesis(SMESHDS_Hypothesis* anHyp)
94     throw (SALOME_Exception);
95
96   void ExportDAT( const char* file )
97     throw (SALOME_Exception);
98   void ExportMED( const char* file )
99     throw (SALOME_Exception);
100   void ExportUNV( const char* file )
101     throw (SALOME_Exception);
102     
103   int NbNodes()
104     throw (SALOME_Exception);
105   
106   int NbEdges()
107     throw (SALOME_Exception);
108   
109   int NbFaces()
110     throw (SALOME_Exception);
111
112   int NbTriangles()
113     throw (SALOME_Exception);
114
115   int NbQuadrangles()
116     throw (SALOME_Exception);
117   
118   int NbVolumes()
119     throw (SALOME_Exception);
120
121   int NbTetras()
122     throw (SALOME_Exception);
123
124   int NbHexas()
125     throw (SALOME_Exception);
126   
127   int NbSubMesh()
128     throw (SALOME_Exception);
129   
130
131 private:
132
133   int _id;          // id given by creator (unique within the creator instance)
134   int _studyId;
135   int _idDoc;       // id given by SMESHDS_Document
136   bool _isShapeToMesh; // set to true when a shape is given (only once)
137   list<SMESHDS_Hypothesis*> _subShapeHypothesisList;
138   list<SMESH_subMesh*> _subMeshesUsingHypothesisList;
139   Handle (SMESHDS_Document) _myDocument;
140   Handle (SMESHDS_Mesh) _myMeshDS;
141   TopTools_IndexedMapOfShape _subShapes;
142   map<int, SMESH_subMesh*> _mapSubMesh;
143   SMESH_Gen* _gen;
144 };
145
146 #endif