From: apo Date: Tue, 31 May 2005 09:51:43 +0000 (+0000) Subject: Introduce a SALOME_IntaractiveObject attribute X-Git-Tag: T3_0_0_a1~65 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=61829d141b6ab99337d1ccb2de64d94210d8bf4b;p=modules%2Fgui.git Introduce a SALOME_IntaractiveObject attribute --- 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;