This commit is contained in:
Anthony Geay 2021-02-01 15:53:54 +01:00
parent a489fbfb40
commit 75f7ed9579
6 changed files with 18 additions and 3 deletions

View File

@ -20,6 +20,7 @@
#include "SMESH_Gen_No_Session_i.hxx"
#include "SALOMEDS_Study_i.hxx"
#include "SALOME_KernelServices.hxx"
#include "SALOME_ModuleCatalog_impl.hxx"
SMESH_Gen_No_Session_i::SMESH_Gen_No_Session_i( CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
@ -41,3 +42,9 @@ SALOMEDS::Study_var SMESH_Gen_No_Session_i::getStudyServant() const
{
return SALOMEDS::Study::_duplicate(KERNEL::getStudyServantSA());
}
SALOME_ModuleCatalog::ModuleCatalog_var SMESH_Gen_No_Session_i::getModuleCatalog() const
{
SALOME_ModuleCatalog::ModuleCatalog_var aCat = KERNEL::getModuleComponentServantSA();
return aCat;
}

View File

@ -31,4 +31,5 @@ public:
const char* interfaceName);
GEOM::GEOM_Gen_var GetGeomEngine( bool isShaper ) override;
SALOMEDS::Study_var getStudyServant() const override;
SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const override;
};

View File

@ -43,6 +43,12 @@ SALOMEDS::Study_var SMESH_Gen_Session_i::getStudyServant() const
return SALOMEDS::Study::_duplicate(KERNEL::getStudyServant());
}
SALOME_ModuleCatalog::ModuleCatalog_var SMESH_Gen_Session_i::getModuleCatalog() const
{
SALOME_ModuleCatalog::ModuleCatalog_var aCat = SALOME_ModuleCatalog::ModuleCatalog::_narrow( GetNS()->Resolve("/Kernel/ModulCatalog") );
return aCat;
}
extern "C"
{ SMESH_I_EXPORT
PortableServer::ObjectId* SMESHEngine_factory( CORBA::ORB_ptr orb,

View File

@ -32,4 +32,5 @@ public:
GEOM::GEOM_Gen_var GetGeomEngine( bool isShaper ) override;
// Get the SALOMEDS::Study from naming service
SALOMEDS::Study_var getStudyServant() const override;
SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const override;
};

View File

@ -35,6 +35,7 @@
#include CORBA_CLIENT_HEADER(GEOM_Gen)
#include CORBA_CLIENT_HEADER(SALOMEDS)
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
#include "SMESH_Gen.hxx"
#include "SMESH_Mesh_i.hxx"
@ -111,6 +112,7 @@ public:
static GEOM::GEOM_Gen_var GetGeomEngine( GEOM::GEOM_Object_ptr );
// Retrieve Study depending on Session / Standalone mode
virtual SALOMEDS::Study_var getStudyServant() const = 0;
virtual SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const = 0;
SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR,
SALOMEDS::SObject_ptr theFatherObject,
const int theTag = 0,

View File

@ -34,8 +34,6 @@
#include "SMESH_Mesh_i.hxx"
#include "SMESH_subMesh_i.hxx"
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
#include <utilities.h>
#include <Utils_ExceptHandlers.hxx>
#include <SALOMEDS_wrap.hxx>
@ -577,7 +575,7 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
// If component for this SMESH engine does not exist in the study, create it
SALOME_ModuleCatalog::ModuleCatalog_var aCat = KERNEL::getModuleComponentServantSA();
SALOME_ModuleCatalog::ModuleCatalog_var aCat = this->getModuleCatalog();
if ( CORBA::is_nil( aCat ) )
return father._retn();