X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARD_I%2FHOMARD_Gen_i.cxx;h=63d70304335357ac524ab836fb67e71dccc3187c;hb=114be747f34dd617afb4a5e437c5d5f276d31b23;hp=63e6cc8a2da1aa9e1eacc54ef3c233ed64259dde;hpb=96724efdcad64cfccec129fcb439321c2b5d113e;p=modules%2Fhomard.git diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 63e6cc8a..63d70304 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -43,8 +43,6 @@ #include "SALOME_LifeCycleCORBA.hxx" #include "SALOMEconfig.h" #include -#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) -#include CORBA_CLIENT_HEADER(SMESH_Gen) #include #include @@ -92,19 +90,15 @@ HOMARD_Gen_i::HOMARD_Gen_i( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, - const char *interfaceName) : -Engines_Component_i(orb, poa, contId, instanceName, interfaceName) + const char *interfaceName, + bool checkNS) : +Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, checkNS) { MESSAGE("constructor de HOMARD_Gen_i"); _thisObj = this; _id = _poa->activate_object(_thisObj); - myHomard = new ::HOMARD_Gen(); - _NS = SINGLETON_::Instance(); - ASSERT(SINGLETON_::IsAlreadyExisting()); - _NS->init_orb(_orb); - - myStudy = SALOMEDS::Study::_duplicate( SMESH_Gen_i::getStudyServant() ); + myHomard = new ::HOMARD_Gen; _tag_gene = 0 ; _tag_boun = 0 ; @@ -145,9 +139,7 @@ void HOMARD_Gen_i::UpdateStudy() 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()) { @@ -4002,8 +3994,9 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option) // 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; @@ -4580,7 +4573,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, // HOMARD data file name std::string aFileName = ""; if (isMultiFile) - aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(SMESH_Gen_i::getStudyServant()->URL())); + aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(myStudy->URL())); aFileName += "_HOMARD.dat"; // initialize sequence of file names @@ -4704,7 +4697,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, // HOMARD data file name std::string aFileName = ""; if (isMultiFile) - aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(SMESH_Gen_i::getStudyServant()->URL())); + aFileName = SALOMEDS_Tool::GetNameFromPath(Kernel_Utils::encode(myStudy->URL())); aFileName = tmpDir + aFileName + "_HOMARD.dat"; StudyContext& context = myStudyContext; @@ -4966,7 +4959,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, MESSAGE ("Entree dans DumpPython"); isValidScript=1; - SALOMEDS::SObject_var aSO = SMESH_Gen_i::getStudyServant()->FindComponent("HOMARD"); + SALOMEDS::SObject_var aSO = myStudy->FindComponent("HOMARD"); if(CORBA::is_nil(aSO)) return new Engines::TMPFile(0); @@ -5135,7 +5128,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Boolean isPublished, void HOMARD_Gen_i::IsValidStudy( ) { // MESSAGE( "IsValidStudy" ); - if (CORBA::is_nil(SMESH_Gen_i::getStudyServant())) + if (CORBA::is_nil(myStudy)) { SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; @@ -5415,18 +5408,3 @@ CORBA::Long HOMARD_Gen_i::GetYACSConvergenceType() return _YACSTypeTest ; } -//============================================================================= -extern "C" -{ - HOMARDENGINE_EXPORT - PortableServer::ObjectId* HOMARDEngine_factory(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId* contId, - const char* instanceName, - const char* interfaceName) - { - MESSAGE("PortableServer::ObjectId* HOMARDEngine_factory()"); - HOMARD_Gen_i* myHOMARD_Gen = new HOMARD_Gen_i(orb, poa, contId, instanceName, interfaceName); - return myHOMARD_Gen->getId(); - } -}