#include "HYDROGUI_DataModel.h"
#include "HYDROGUI_Module.h"
+#include "HYDROGUI_Tool.h"
#include <GraphicsView_Object.h>
#include <LightApp_Application.h>
-#include <LightApp_DataOwner.h>
#include <LightApp_GVSelector.h>
#include <LightApp_SelectionMgr.h>
if( !myBtn->isChecked() )
return;
- SUIT_SelectionMgr* aSelMgr = myModule->getApp()->selectionMgr();
- SUIT_DataOwnerPtrList anOwners;
- aSelMgr->selected( anOwners );
+ QString anObjName;
+ Handle(HYDROData_Object) anObject = HYDROGUI_Tool::GetSelectedObject( myModule );
+ if( !anObject.IsNull() )
+ anObjName = anObject->GetName();
- HYDROGUI_DataModel* aModel = myModule->getDataModel();
+ SetName( anObjName );
+}
- QString anObjName;
- foreach( SUIT_DataOwner* anOwner, anOwners )
- {
- LightApp_DataOwner* aGrDOwner = dynamic_cast<LightApp_DataOwner*>( anOwner );
- if( aGrDOwner )
- {
- QString anEntry = aGrDOwner->entry();
- Handle(HYDROData_Object) anObject = aModel->objectByEntry( anEntry, KIND_IMAGE );
- if( !anObject.IsNull() )
- {
- anObjName = anObject->GetName();
- break;
- }
- }
- }
- myObjName->setText( anObjName );
+void HYDROGUI_ObjSelector::SetName( const QString& theName )
+{
+ myObjName->setText( theName );
}
QString HYDROGUI_ObjSelector::GetName() const