- Handle(GEOM_AISShape) res;
-
- if ( !IO->hasEntry() )
- {
- testResult = false;
- return res;
- }
-
- QPtrList<SUIT_ViewWindow> aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows();
-
- for ( QPtrListIterator<SUIT_ViewWindow> it( aViewWindowsList ); it.current(); ++it ) {
- if (it.current()->getViewManager()->getType() == OCCViewer_Viewer::Type()) {
- Handle (AIS_InteractiveContext) ic = ((OCCViewer_Viewer*)it.current()->getViewManager()->getViewModel())->getAISContext();
-
- AIS_ListOfInteractive List;
- ic->DisplayedObjects(List);
- AIS_ListOfInteractive List1;
- ic->ObjectsInCollector(List1);
- List.Append(List1);
-
- AIS_ListIteratorOfListOfInteractive ite(List);
- while(ite.More())
- {
- if(ite.Value()->IsInstance(STANDARD_TYPE(GEOM_AISShape)))
- {
- Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(ite.Value());
- if( aSh->hasIO() )
- {
- if( strcmp( aSh->getIO()->getEntry(), IO->getEntry() ) == 0 )
- {
- if(onlyInActiveView)
- {
- if(it.current() == SUIT_Session::session()->activeApplication()->desktop()->activeWindow())
- {
- testResult = true;
- return aSh;
- }
- }
- else
- {
- testResult = true;
- return aSh;
- }
- }
- }
- }
- ite.Next();
- }
- }
- }
- testResult = false;
- return res;
-}
-
-
-//=======================================================================
-// function : ConvertIOinGEOMShape()
-// purpose :
-//=======================================================================
-GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult)
-{
- GEOM::GEOM_Object_var aShape;
- testResult = false;
-
- /* case SObject */
- if(IO->hasEntry()) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
- if ( !appStudy ) return GEOM::GEOM_Object::_nil();
- _PTR(Study) aStudy = appStudy->studyDS();
-
- _PTR(SObject) obj ( aStudy->FindObjectID(IO->getEntry()) );
- _PTR(GenericAttribute) anAttr;
- if(obj) {
- if(obj->FindAttribute(anAttr, "AttributeIOR")) {
- _PTR(AttributeIOR) anIOR ( anAttr );
- aShape = GeometryGUI::GetGeomGen()->GetIORFromString(anIOR->Value().c_str());
- if(!CORBA::is_nil(aShape))
- testResult = true;
- return aShape._retn();
- }
- }
- }
- return GEOM::GEOM_Object::_nil();