- int nbSel = aList.Extent();
- listIOR.length(nbSel);
- int j=0;
- SALOME_ListIteratorOfListIO It(aList);
- for(int i=0; It.More(); It.Next(), i++) {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- if(IObject->hasEntry()) {
- SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
- SALOMEDS::SObject_var obj = aStudy->FindObjectID(IObject->getEntry());
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeIOR_var anIOR;
- if(!obj->_is_nil() && obj->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
- CORBA::ORB_var& _orb = init.orb();
- CORBA::String_var theValue = anIOR->Value();
- CORBA::Object_var theObj = _orb->string_to_object(theValue);
- if(theObj->_is_a("IDL:GEOM/GEOM_Object:1.0")) {
- listIOR[j] = CORBA::string_dup(theValue);
- j++;
- }
- }
- }
- }
- listIOR.length(j);
-}
-
-
-//=======================================================================
-// function : ConvertIOinGEOMObject()
-// purpose :
-//=======================================================================
-GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMObject( const Handle(SALOME_InteractiveObject)& theIO,
- Standard_Boolean& theResult )
-{
- theResult = Standard_False;
- GEOM::GEOM_Object_var aReturnObject;
- if ( !theIO.IsNull() )
- {
- const char* anEntry = theIO->getEntry();
- SALOMEDS::SObject_var aSObj = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument()->FindObjectID( anEntry );
- if ( !CORBA::is_nil( aSObj ) )
- {
- aReturnObject = GEOM::GEOM_Object::_narrow( aSObj->GetObject() );
- theResult = !CORBA::is_nil( aReturnObject );
+ GEOM::GEOM_Object_var object;
+
+ if ( !IO.IsNull() && IO->hasEntry() ) {
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if ( study ) {
+ _PTR(Study) studyDS = study->studyDS();
+ _PTR(SObject) obj = studyDS->FindObjectID( IO->getEntry() );
+ if ( GeometryGUI::IsInGeomComponent( obj )) {
+ CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( obj );
+ object = GEOM::GEOM_Object::_narrow( corbaObj );
+ }