From 61829d141b6ab99337d1ccb2de64d94210d8bf4b Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 31 May 2005 09:51:43 +0000 Subject: [PATCH] Introduce a SALOME_IntaractiveObject attribute --- src/SalomeApp/SalomeApp_DataOwner.cxx | 31 +++++++++++++++++++++------ src/SalomeApp/SalomeApp_DataOwner.h | 8 +++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/SalomeApp/SalomeApp_DataOwner.cxx b/src/SalomeApp/SalomeApp_DataOwner.cxx index a3d3ad971..a3b696378 100644 --- a/src/SalomeApp/SalomeApp_DataOwner.cxx +++ b/src/SalomeApp/SalomeApp_DataOwner.cxx @@ -8,24 +8,43 @@ #include -SalomeApp_DataOwner::SalomeApp_DataOwner( const QString& entry ) -: myEntry( entry ) +SalomeApp_DataOwner +::SalomeApp_DataOwner( const QString& theEntry ): + myEntry( theEntry ) { - //cout << "---> created DataOwner with entry = " << entry << endl; } -SalomeApp_DataOwner::~SalomeApp_DataOwner() +SalomeApp_DataOwner +::SalomeApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ): + myEntry(!theIO.IsNull()? theIO->getEntry(): ""), + myIO(theIO) { } -bool SalomeApp_DataOwner::isEqual( const SUIT_DataOwner& obj ) const +SalomeApp_DataOwner +::~SalomeApp_DataOwner() +{ +} + +bool +SalomeApp_DataOwner +::isEqual( const SUIT_DataOwner& obj ) const { const SalomeApp_DataOwner* other = dynamic_cast( &obj ); return other && entry() == other->entry(); } -QString SalomeApp_DataOwner::entry() const +QString +SalomeApp_DataOwner +::entry() const { return myEntry; } + +const Handle(SALOME_InteractiveObject)& +SalomeApp_DataOwner +::IO() const +{ + return myIO; +} diff --git a/src/SalomeApp/SalomeApp_DataOwner.h b/src/SalomeApp/SalomeApp_DataOwner.h index 128463cbb..5f81f6979 100644 --- a/src/SalomeApp/SalomeApp_DataOwner.h +++ b/src/SalomeApp/SalomeApp_DataOwner.h @@ -2,19 +2,23 @@ #ifndef SALOMEAPP_DATAOWNER_H #define SALOMEAPP_DATAOWNER_H -#include +#include "SUIT_DataOwner.h" +#include "SALOME_InteractiveObject.hxx" class SalomeApp_DataOwner : public SUIT_DataOwner { public: + SalomeApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ); SalomeApp_DataOwner( const QString& ); virtual ~SalomeApp_DataOwner(); virtual bool isEqual( const SUIT_DataOwner& ) const; - QString entry() const; + const Handle(SALOME_InteractiveObject)& IO() const; + QString entry() const; private: QString myEntry; + Handle(SALOME_InteractiveObject) myIO; }; typedef SMART(SalomeApp_DataOwner) SalomeApp_DataOwnerPtr; -- 2.39.2