return pVISU_Gen->getId() ;
}
-// VISU::VISU_Gen_ptr
-// GetVisuGen(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex* theMutex){
-// if(MYDEBUG) MESSAGE("extern \"C\" GetVisuGen");
-// VISU::VISU_Gen_i * aVISU_Gen = new VISU::VISU_Gen_i(orb,poa,theMutex);
-// return VISU::VISU_Gen::_duplicate(aVISU_Gen->_this());
-// }
-
- Engines::Component_ptr
- GetVisuGen(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex* theMutex){
+ // VISU::VISU_Gen_ptr
+ // GetVisuGen(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex* theMutex){
+ // if(MYDEBUG) MESSAGE("extern \"C\" GetVisuGen");
+ // VISU::VISU_Gen_i * aVISU_Gen = new VISU::VISU_Gen_i(orb,poa,theMutex);
+ // return VISU::VISU_Gen::_duplicate(aVISU_Gen->_this());
+ // }
+
+ Engines::Component_ptr GetVisuGen(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, QMutex* theMutex){
if(MYDEBUG) MESSAGE("extern \"C\" GetVisuGen");
- VISU::VISU_Gen_i * aVISU_Gen = new VISU::VISU_Gen_i(orb,poa,theMutex);
- return Engines::Component::_narrow( VISU::VISU_Gen::_duplicate(aVISU_Gen->_this()) );
+ VISU::VISU_Gen_i * aVISU_Gen = new VISU::VISU_Gen_i(theORB,thePOA,theMutex);
+ VISU::VISU_Gen_var aVisuGen = VISU::VISU_Gen::_duplicate(aVISU_Gen->_this());
+ return Engines::Component::_narrow( aVisuGen );
}
}
aSComponent = aStudyBuilder->NewComponent("VISU");
SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue("Visu");
+ //NRI aName->SetValue("Visu");
+
+ CORBA::ORB_var anORB = GetORB();
+ SALOME_NamingService *NamingService = new SALOME_NamingService( anORB );
+ CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog");
+ SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN);
+ SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "VISU" );
+ if ( !Comp->_is_nil() ) {
+ aName->SetValue( Comp->componentusername() );
+ }
anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap");
SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
_thisObj = this ;
_id = _poa->activate_object(_thisObj);
SALOME_NamingService aNamingService(orb);
- SALOME::Session_var aSession(SALOME::Session::_narrow(aNamingService.Resolve("/Kernel/Session")));
+ CORBA::Object_ptr anObject = aNamingService.Resolve("/Kernel/Session");
+ SALOME::Session_var aSession = SALOME::Session::_narrow(anObject);
//aSession->GetInterface();
//myVisuGen = aSession->GetVisuGen();
myVisuGen = VISU::VISU_Gen::_narrow( aSession->GetVisuComponent() );
}
- VISU_Gen_i::VISU_Gen_i(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex* theMutex) :
+ VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, QMutex* theMutex) :
Engines_Component_i()
{
if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<theMutex);
Base_i::myMutex = theMutex;
- Base_i::myOrb = CORBA::ORB::_duplicate(orb);
- Base_i::myPOA = PortableServer::POA::_duplicate(poa);
+ Base_i::myOrb = CORBA::ORB::_duplicate(theORB);
+ Base_i::myPOA = PortableServer::POA::_duplicate(thePOA);
Mutex mt(myMutex,qApp);
- VisuORB = orb;
- VisuPOA = poa;
+ VisuORB = theORB;
+ VisuPOA = thePOA;
VisuGen = this;
VisuPOA->activate_object(this);
RegistryStorable();