1 //=============================================================================
2 // File : SMESH_Gen.hxx
3 // Created : jeu mai 16 22:53:13 CEST 2002
4 // Author : Paul RASCLE, EDF
6 // Copyright : EDF 2002
8 //=============================================================================
10 #ifndef _SMESH_GEN_HXX_
11 #define _SMESH_GEN_HXX_
13 #include "Utils_SALOME_Exception.hxx"
15 #include "SMESH_HypothesisFactory.hxx"
16 #include "SMESH_Hypothesis.hxx"
17 #include "SMESH_Algo.hxx"
18 #include "SMESH_1D_Algo.hxx"
19 #include "SMESH_2D_Algo.hxx"
20 #include "SMESH_3D_Algo.hxx"
21 #include "SMESH_Mesh.hxx"
23 #include "SMESHDS_Document.hxx"
25 #include <TopoDS_Shape.hxx>
29 typedef struct studyContextStruct
31 map<int, SMESH_Hypothesis*> mapHypothesis;
32 map<int, SMESH_Mesh*> mapMesh;
33 Handle (SMESHDS_Document) myDocument;
34 } StudyContextStruct ;
42 SMESH_Hypothesis* CreateHypothesis(const char* anHyp, int studyId)
43 throw (SALOME_Exception);
44 SMESH_Mesh* Init(int studyId, const TopoDS_Shape& aShape)
45 throw (SALOME_Exception);
46 bool Compute(::SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
47 throw (SALOME_Exception);
48 StudyContextStruct* GetStudyContext(int studyId);
50 static int GetShapeDim(const TopoDS_Shape& aShape);
51 SMESH_Algo* GetAlgo(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
53 // inherited methods from SALOMEDS::Driver
55 void Save(int studyId, const char *aUrlOfFile);
56 void Load(int studyId, const char *aUrlOfFile);
57 void Close(int studyId);
58 const char* ComponentDataType();
60 const char* IORToLocalPersistentID(const char* IORString, bool& IsAFile);
61 const char* LocalPersistentIDToIOR(const char* aLocalPersistentID);
63 SMESH_HypothesisFactory _hypothesisFactory;
65 map<int, SMESH_Algo*> _mapAlgo;
66 map<int, SMESH_1D_Algo*> _map1D_Algo;
67 map<int, SMESH_2D_Algo*> _map2D_Algo;
68 map<int, SMESH_3D_Algo*> _map3D_Algo;
71 int _localId; // unique Id of created objects, within SMESH_Gen entity
72 map<int, StudyContextStruct*> _mapStudyContext;
73 map<int, SMESH_Hypothesis*> _mapHypothesis;