#include "SALOME_LifeCycleCORBA.hxx"
#include "SALOMEconfig.h"
#include <SMESH_Gen_i.hxx>
-#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
-#include CORBA_CLIENT_HEADER(SMESH_Gen)
#include <cmath>
#include <stdlib.h>
_id = _poa->activate_object(_thisObj);
myHomard = new ::HOMARD_Gen;
- _NS = SINGLETON_<SALOME_NamingService>::Instance();
- ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
- _NS->init_orb(_orb);
_tag_gene = 0 ;
_tag_boun = 0 ;
homardFather = myBuilder->NewComponent(ComponentDataType());
SALOMEDS::GenericAttribute_var anAttr = myBuilder->FindOrCreateAttribute(homardFather,"AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog");
- SALOME_ModuleCatalog::ModuleCatalog_var Catalogue =
- SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
+ SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = this->getModuleCatalog();
SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent(ComponentDataType());
if (!Comp->_is_nil())
{
// On enregistre le fichier
MESSAGE( "Enregistrement du fichier");
- SALOME_LifeCycleCORBA* myLCC = new SALOME_LifeCycleCORBA(_NS);
- SMESH::SMESH_Gen_var aSmeshEngine = SMESH::SMESH_Gen::_narrow(myLCC->FindOrLoad_Component("FactoryServer","SMESH"));
+ //
+ SMESH::SMESH_Gen_var aSmeshEngine = this->retrieveSMESHInst();
+ //
ASSERT(!CORBA::is_nil(aSmeshEngine));
aSmeshEngine->UpdateStudy();
SMESH::DriverMED_ReadStatus theStatus;
#include CORBA_SERVER_HEADER(HOMARD_YACS)
#include CORBA_CLIENT_HEADER(SALOMEDS)
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
+#include CORBA_CLIENT_HEADER(SMESH_Gen)
#include "HOMARD_i.hxx"
#include "HOMARD_Gen.hxx"
virtual char* getVersion();
std::string GetStringInTexte( const std::string Texte, const std::string String, int option ) ;
-
+ virtual SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const = 0;
+ virtual SMESH::SMESH_Gen_var retrieveSMESHInst() const = 0;
private:
struct StudyContext
{
::HOMARD_Gen* myHomard;
StudyContext myStudyContext;
- SALOME_NamingService* _NS;
int _tag_gene ;
int _tag_boun ;
#include "HOMARD_Gen_i_No_Session.hxx"
#include "SALOMEDS_Study_i.hxx"
+#include "SALOME_ModuleCatalog_impl.hxx"
+#include "SMESH_Gen_No_Session_i.hxx"
HOMARD_Gen_i_No_Session::HOMARD_Gen_i_No_Session( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, const char* instanceName, const char* interfaceName ):
HOMARD_Gen_i(orb,poa,contId,instanceName,interfaceName,false)
{
myStudy = KERNEL::getStudyServantSA();
+ SMESH_Gen_No_Session_i *servant = new SMESH_Gen_No_Session_i(orb,poa,contId,"SMESH_inst_3","SMESH");
+ PortableServer::ObjectId *zeId = servant->getId();
+ CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
+ _smesh = SMESH::SMESH_Gen::_narrow(zeRef);
+}
+
+SALOME_ModuleCatalog::ModuleCatalog_var HOMARD_Gen_i_No_Session::getModuleCatalog() const
+{
+ SALOME_ModuleCatalog::ModuleCatalog_var aCat = KERNEL::getModuleComponentServantSA();
+ return aCat;
+}
+
+SMESH::SMESH_Gen_var HOMARD_Gen_i_No_Session::retrieveSMESHInst() const
+{
+ return _smesh;
}
PortableServer::ObjectId* contId,
const char* instanceName,
const char* interfaceName );
+ SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const override;
+ SMESH::SMESH_Gen_var retrieveSMESHInst() const override;
+private:
+ SMESH::SMESH_Gen_var _smesh;
};
#include "HOMARD_Gen_i_Session.hxx"
#include "SALOMEDS_Study_i.hxx"
#include "SALOME_KernelServices.hxx"
+#include "Utils_SINGLETON.hxx"
HOMARD_Gen_i_Session::HOMARD_Gen_i_Session( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, const char* instanceName, const char* interfaceName ):
HOMARD_Gen_i(orb,poa,contId,instanceName,interfaceName,true)
{
- myStudy = SALOMEDS::Study::_duplicate(KERNEL::getStudyServant());
+ myStudy = SALOMEDS::Study::_duplicate(KERNEL::getStudyServant());
+ _NS = SINGLETON_<SALOME_NamingService>::Instance();
+ ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
+ _NS->init_orb(_orb);
+}
+
+SALOME_ModuleCatalog::ModuleCatalog_var HOMARD_Gen_i_Session::getModuleCatalog() const
+{
+ CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog");
+ SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
+ return Catalogue;
+}
+
+SMESH::SMESH_Gen_var HOMARD_Gen_i_Session::retrieveSMESHInst() const
+{
+ SALOME_LifeCycleCORBA* myLCC = new SALOME_LifeCycleCORBA(_NS);
+ SMESH::SMESH_Gen_var aSmeshEngine = SMESH::SMESH_Gen::_narrow(myLCC->FindOrLoad_Component("FactoryServer","SMESH"));
+ return aSmeshEngine;
}
//=============================================================================
PortableServer::ObjectId* contId,
const char* instanceName,
const char* interfaceName );
+ SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const override;
+ SMESH::SMESH_Gen_var retrieveSMESHInst() const override;
+private:
+ SALOME_NamingService* _NS = nullptr;
};