Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i.hxx
1 //=============================================================================
2 // File      : SMESH_Gen_i.hxx
3 // Created   : lun mai  6 13:41:30 CEST 2002
4 // Author    : Paul RASCLE, EDF
5 // Project   : SALOME
6 // Copyright : EDF 2002
7 // $Header$
8 //=============================================================================
9
10 #ifndef _SMESH_GEN_I_HXX_
11 #define _SMESH_GEN_I_HXX_
12
13 #include <SALOMEconfig.h>
14 #include CORBA_SERVER_HEADER(SMESH_Gen)
15 #include CORBA_SERVER_HEADER(SMESH_Mesh)
16 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
17 #include CORBA_CLIENT_HEADER(GEOM_Gen)
18 #include CORBA_CLIENT_HEADER(GEOM_Shape)
19 #include CORBA_CLIENT_HEADER(SALOMEDS)
20 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
21
22
23 class SMESH_Mesh_i;
24
25 #include "SMESH_HypothesisFactory_i.hxx"
26 #include "SMESH_Mesh_i.hxx"
27 #include "SALOME_Component_i.hxx"
28 #include "SALOME_NamingService.hxx"
29
30 #include "SMESH_Gen.hxx"
31 #include "SMESH_topo.hxx"
32 #include "GEOM_Client.hxx"
33
34 #include <HDFOI.hxx>
35
36 #include <map>
37
38 typedef struct studyContext_iStruct
39 {
40   map<int,SMESH_Mesh_i*> mapMesh_i;
41 } StudyContext_iStruct;
42
43 class SMESH_Gen_i:
44   public POA_SMESH::SMESH_Gen,
45   public Engines_Component_i 
46 {
47 public:
48
49   SMESH_Gen_i();
50   SMESH_Gen_i(CORBA::ORB_ptr orb,
51               PortableServer::POA_ptr poa,
52               PortableServer::ObjectId * contId, 
53               const char *instanceName, 
54               const char *interfaceName);
55   virtual ~SMESH_Gen_i();
56   
57   SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const char* anHyp,
58                                                CORBA::Long studyId)
59     throw (SALOME::SALOME_Exception);
60   
61   SMESH::SMESH_Mesh_ptr Init(GEOM::GEOM_Gen_ptr geomEngine,
62                              CORBA::Long studyId,
63                              GEOM::GEOM_Shape_ptr aShape)
64     throw (SALOME::SALOME_Exception);
65
66   CORBA::Boolean Compute(SMESH::SMESH_Mesh_ptr aMesh,
67                          GEOM::GEOM_Shape_ptr aShape)
68     throw (SALOME::SALOME_Exception);
69
70   CORBA::Boolean IsReadyToCompute(SMESH::SMESH_Mesh_ptr aMesh,
71                                   GEOM::GEOM_Shape_ptr aShape)
72     throw (SALOME::SALOME_Exception);
73
74   SMESH::long_array* GetSubShapesId(GEOM::GEOM_Gen_ptr geomEngine,
75                                    CORBA::Long studyId,
76                                    GEOM::GEOM_Shape_ptr mainShape,
77                                    const SMESH::shape_array& listOfSubShape)
78     throw (SALOME::SALOME_Exception);
79
80
81   // inherited methods from SALOMEDS::Driver
82
83   SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
84                           const char* theURL,
85                           bool isMultiFile);
86   bool Load(SALOMEDS::SComponent_ptr theComponent,
87             const SALOMEDS::TMPFile& theStream,
88             const char* theURL,
89             bool isMultiFile);
90   void Close(SALOMEDS::SComponent_ptr theComponent);
91   char* ComponentDataType();
92     
93   char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
94                                const char* IORString,
95                                CORBA::Boolean isMultiFile);
96   char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
97                                const char* aLocalPersistentID,
98                                CORBA::Boolean isMultiFile);
99
100   bool CanPublishInStudy(CORBA::Object_ptr theIOR) { return false; }
101   SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
102                                        SALOMEDS::SObject_ptr theSObject,
103                                        CORBA::Object_ptr theObject,
104                                        const char* theName) throw (SALOME::SALOME_Exception) {
105     SALOMEDS::SObject_var aResultSO;
106     return aResultSO._retn();
107   }
108
109   CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject) {return false;}
110   SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {return false;}
111   CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID) {return false;}
112   SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
113                                   CORBA::Long theObjectID,
114                                   SALOMEDS::SObject_ptr theObject) {
115     SALOMEDS::SObject_var aResultSO;
116     return aResultSO._retn();
117   }
118
119   GEOM_Client* _ShapeReader;
120 protected:
121   SMESH_topo* ExploreMainShape(GEOM::GEOM_Gen_ptr geomEngine,
122                                CORBA::Long studyId,
123                                GEOM::GEOM_Shape_ptr aShape);
124   
125 private:
126   SMESH_HypothesisFactory_i _hypothesisFactory_i;
127   ::SMESH_Gen _impl;  // no namespace here
128   int _localId; // unique Id of created objects, within SMESH_Gen_i entity
129
130   map<int, StudyContext_iStruct*> _mapStudyContext_i;
131   map <string, string> _SMESHCorbaObj;
132 };
133
134 #endif