// Function : getEntry
// Purpose :
//================================================================
-static char* getEntry( GEOM::GEOM_Object_ptr object )
+static string getEntry( GEOM::GEOM_Object_ptr object )
{
SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
_PTR(SObject) SO ( study->studyDS()->FindObjectIOR( IOR ) );
if ( SO )
- return (char*)(SO->GetID().c_str());
+ return SO->GetID();
}
}
return "";
// Function : getName
// Purpose :
//================================================================
-static const char* getName( GEOM::GEOM_Object_ptr object )
+static string getName( GEOM::GEOM_Object_ptr object )
{
SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
if ( aSObj && aSObj->FindAttribute( anAttr, "AttributeName") )
{
_PTR(AttributeName) aNameAttr( anAttr );
- return aNameAttr->Value().c_str();
+ return aNameAttr->Value();
}
}
}
string entry = getEntry( theObj );
if ( entry != "" ) {
- Display( new SALOME_InteractiveObject(
- entry.c_str(), "GEOM", strdup( getName( theObj ) ) ), updateViewer );
+ Display(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
+ updateViewer);
}
}
string entry = getEntry( theObj );
if ( entry != "" )
{
- Erase( new SALOME_InteractiveObject(
- entry.c_str(), "GEOM", strdup( getName( theObj ) ) ), forced, updateViewer );
+ Erase(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
+ forced, updateViewer);
}
}
theSelMgr->setSelectedObjects( toSelect, true );
}
-