-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_Utils.cxx
// Author : Open CASCADE S.A.S.
if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
_PTR(AttributeIOR) anIOR = anAttr;
CORBA::String_var aVal = anIOR->Value().c_str();
- return app->orb()->string_to_object(aVal);
+ // string_to_object() DOC: If the input string is not valid ...
+ // a CORBA::SystemException is thrown.
+ if ( aVal && strlen( aVal ) > 0 )
+ return app->orb()->string_to_object(aVal);
}
}
return CORBA::Object::_nil();
return SObjectToObject(theSObject,aStudy);
}
+ _PTR(SObject) ObjectToSObject( CORBA::Object_ptr theObject )
+ {
+ _PTR(SObject) res;
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
+ (SUIT_Session::session()->activeApplication());
+ if ( app ) {
+ QString IOR = app->orb()->object_to_string( theObject );
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( study && !IOR.isEmpty() )
+ res = study->studyDS()->FindObjectIOR( IOR.toLatin1().constData() );
+ }
+ return res;
+ }
+
CORBA::Object_var IObjectToObject (const Handle(SALOME_InteractiveObject)& theIO)
{
if (!theIO.IsNull()) {