1 #ifndef _HOMARD_GEN_I_HXX_
2 #define _HOMARD_GEN_I_HXX_
4 #include <SALOMEconfig.h>
5 #include CORBA_SERVER_HEADER(HOMARD_Gen)
6 #include CORBA_SERVER_HEADER(HOMARD_Cas)
7 #include CORBA_SERVER_HEADER(HOMARD_Hypothesis)
8 #include CORBA_SERVER_HEADER(HOMARD_Iteration)
9 #include CORBA_SERVER_HEADER(HOMARD_Zone)
10 #include CORBA_SERVER_HEADER(HOMARD_Boundary)
11 #include CORBA_CLIENT_HEADER(SALOMEDS)
12 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
14 #include "HOMARD_Gen.hxx"
15 #include "SALOME_Component_i.hxx"
16 #include "SALOME_NamingService.hxx"
17 #include "Utils_CorbaException.hxx"
24 public virtual Engines_Component_i,
25 public virtual POA_HOMARD::HOMARD_Gen
28 HOMARD_Gen_i(CORBA::ORB_ptr orb,
29 PortableServer::POA_ptr poa,
30 PortableServer::ObjectId* contId,
31 const char* instanceName,
32 const char* interfaceName);
33 virtual ~HOMARD_Gen_i();
36 SALOMEDS::Study_ptr GetCurrentStudy();
37 void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
38 int GetCurrentStudyID();
40 HOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas,
41 const char* MeshName, const char* FileName);
42 HOMARD::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis);
43 HOMARD::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent);
44 HOMARD::HOMARD_Zone_ptr CreateZone (const char* nomZone, CORBA::Long typeZone);
45 HOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary);
47 HOMARD::HOMARD_Cas_ptr GetCas (const char* nomCas);
48 HOMARD::HOMARD_Zone_ptr GetZone (const char* nomZone);
49 HOMARD::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis);
50 HOMARD::HOMARD_Iteration_ptr GetIteration (const char* nomIteration);
51 HOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary);
53 void AssociateCaseIter(const char* nomCas, const char* nomIter,
54 const char* labelIter);
55 void AssociateIterIter(const char* nomIterParent, const char* nomIter);
56 void AssociateIterHypo(const char* nomIter, const char* nomHypothesis);
57 void AssociateHypoZone(const char* nomZone, const char* nomHypothesis);
58 void DissociateHypoZone(const char* nomZone, const char* nomHypothesis);
60 void InvalideZone(const char* nomZone);
61 void InvalideHypo(const char* nomHypo);
62 void InvalideIter(const char* nomIter);
64 void SetEtatIter(const char* nomIter,const bool EtatCalcul);
66 HOMARD::listeCases* GetAllCases();
67 HOMARD::listeHypotheses* GetAllHypotheses();
68 HOMARD::listeZones* GetAllZones();
69 HOMARD::listeIterations* GetAllIterations();
70 HOMARD::listeBoundarys* GetAllBoundarys();
72 char* GetCaseName(const char* nomIteration);
74 CORBA::Boolean Compute(const char* nomIteration, CORBA::Long etatMenage);
75 CORBA::Boolean VerifieDir(const char* nomDir);
77 void PublishResultInSmesh(const char* NomFich, CORBA::Long IconeType);
78 void DeleteResultInSmesh(const char* NomFich, const char* MeshName);
79 void PublishFileUnderIteration(const char* NomIter, const char* NomFich,
80 const char* Commentaire);
82 // ---------------------------------------------------------------
83 // next functions are inherited from SALOMEDS::Driver interface
84 // ---------------------------------------------------------------
87 virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
91 virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
95 virtual bool Load(SALOMEDS::SComponent_ptr theComponent,
96 const SALOMEDS::TMPFile& theStream,
100 virtual bool LoadASCII(SALOMEDS::SComponent_ptr theComponent,
101 const SALOMEDS::TMPFile& theStream,
105 virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
107 virtual char* ComponentDataType();
109 virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
110 const char* IORString,
111 CORBA::Boolean isMultiFile,
112 CORBA::Boolean isASCII);
114 virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
115 const char* aLocalPersistentID,
116 CORBA::Boolean isMultiFile,
117 CORBA::Boolean isASCII);
119 // --> Data publishing
120 virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
122 virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
123 SALOMEDS::SObject_ptr theSObject,
124 CORBA::Object_ptr theObject,
125 const char* theName);
128 virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
130 virtual SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject,
131 CORBA::Long& theObjectID);
133 virtual CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
135 virtual SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
136 CORBA::Long theObjectID,
137 SALOMEDS::SObject_ptr theObject);
141 void addInStudy(SALOMEDS::Study_ptr theStudy);
142 SALOMEDS::SObject_ptr PublishCaseInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
143 HOMARD::HOMARD_Cas_ptr theObject, const char* theName);
145 SALOMEDS::SObject_ptr PublishHypotheseInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
146 HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName);
148 SALOMEDS::SObject_ptr PublishZoneInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
149 HOMARD::HOMARD_Zone_ptr theObject, const char* theName);
150 SALOMEDS::SObject_ptr PublishBoundaryInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder,
151 HOMARD::HOMARD_Boundary_ptr theObject, const char* theName);
152 virtual void PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder,
153 SALOMEDS::SObject_var aResultSO,
154 const char* theName, const char* value, const char* icone, const char* ior);
155 PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject);
157 HOMARD::HOMARD_Cas_ptr newCase();
158 HOMARD::HOMARD_Hypothesis_ptr newHypothesis();
159 HOMARD::HOMARD_Iteration_ptr newIteration();
160 HOMARD::HOMARD_Zone_ptr newZone();
161 HOMARD::HOMARD_Boundary_ptr newBoundary();
164 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
165 CORBA::Boolean isPublished,
166 CORBA::Boolean& isValidScript);
172 std::map<std::string, HOMARD::HOMARD_Cas_var> _mesCas;
173 std::map<std::string, HOMARD::HOMARD_Hypothesis_var> _mesHypotheses;
174 std::map<std::string, HOMARD::HOMARD_Iteration_var> _mesIterations;
175 std::map<std::string, HOMARD::HOMARD_Zone_var> _mesZones;
176 std::map<std::string, HOMARD::HOMARD_Boundary_var> _mesBoundarys;
177 std::map<int, PortableServer::ServantBase*> _idmap;
179 typedef std::map<int, StudyContext> ContextMap;
181 ::HOMARD_Gen* myHomard;
182 SALOMEDS::Study_var myCurrentStudy;
183 ContextMap myContextMap;
184 SALOME_NamingService* _NS;