This commit is contained in:
jfa 2009-11-19 14:43:15 +00:00
parent a614e772f5
commit afcc3b209a

View File

@ -22,7 +22,7 @@
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// File : GEOMBase.cxx // File : GEOMBase.cxx
// Author : Damien COQUERET, Open CASCADE S.A.S. // Author : Damien COQUERET, Open CASCADE S.A.S.
//
#include "GEOMBase.h" #include "GEOMBase.h"
#include <GeometryGUI.h> #include <GeometryGUI.h>
@ -510,14 +510,16 @@ Handle(GEOM_AISShape) GEOMBase::ConvertIOinGEOMAISShape(const Handle(SALOME_Inte
// function : ConvertIOinGEOMShape() // function : ConvertIOinGEOMShape()
// purpose : // purpose :
//======================================================================= //=======================================================================
GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO, Standard_Boolean& testResult) GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMShape(const Handle(SALOME_InteractiveObject)& IO,
Standard_Boolean& testResult)
{ {
GEOM::GEOM_Object_var aShape; GEOM::GEOM_Object_var aShape;
testResult = false; testResult = false;
/* case SObject */ /* case SObject */
if(IO->hasEntry()) { if(IO->hasEntry()) {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() ); SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
(SUIT_Session::session()->activeApplication()->activeStudy());
if ( !appStudy ) return GEOM::GEOM_Object::_nil(); if ( !appStudy ) return GEOM::GEOM_Object::_nil();
_PTR(Study) aStudy = appStudy->studyDS(); _PTR(Study) aStudy = appStudy->studyDS();
@ -577,26 +579,27 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::stri
// function : ConvertIOinGEOMObject() // function : ConvertIOinGEOMObject()
// purpose : // purpose :
//======================================================================= //=======================================================================
GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMObject( const Handle(SALOME_InteractiveObject)& theIO, GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMObject (const Handle(SALOME_InteractiveObject)& theIO,
Standard_Boolean& theResult ) Standard_Boolean& theResult)
{ {
theResult = Standard_False; theResult = Standard_False;
GEOM::GEOM_Object_var aReturnObject; GEOM::GEOM_Object_var aReturnObject;
if ( !theIO.IsNull() )
if (!theIO.IsNull())
{ {
const char* anEntry = theIO->getEntry(); const char* anEntry = theIO->getEntry();
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*> SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
( SUIT_Session::session()->activeApplication()->activeStudy() ); (SUIT_Session::session()->activeApplication()->activeStudy());
if ( !appStudy ) return GEOM::GEOM_Object::_nil(); if (!appStudy) return GEOM::GEOM_Object::_nil();
_PTR(Study) aStudy = appStudy->studyDS(); _PTR(Study) aStudy = appStudy->studyDS();
_PTR(SObject) aSObj ( aStudy->FindObjectID( anEntry ) ); _PTR(SObject) aSObj (aStudy->FindObjectID(anEntry));
if (aSObj) if (aSObj)
{ {
aReturnObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObj)); aReturnObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObj));
theResult = !CORBA::is_nil( aReturnObject ); theResult = !CORBA::is_nil(aReturnObject);
} }
} }
return aReturnObject._retn(); return aReturnObject._retn();