From: srn Date: Wed, 30 Mar 2005 09:48:41 +0000 (+0000) Subject: Added method GetSObject X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cca83bbcf0ad69830739262ba8d1351155ec08a8;p=modules%2Fkernel.git Added method GetSObject --- diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index 881b9fe24..89df8e7a2 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -41,3 +41,10 @@ void SALOMEDSImpl_GenericAttribute::CheckLocked() throw LockProtection("LockProtection"); } } + +Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_GenericAttribute::GetSObject() +{ + TDF_Label aLabel = Label(); + if(aLabel.IsNull()) return NULL; + return SALOMEDSImpl_Study::GetStudy(aLabel)->GetSObject(aLabel); +} diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx index f2df39229..31e710f7d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx @@ -11,6 +11,8 @@ #include #include +#include "SALOMEDSImpl_SObject.hxx" + class Handle(TDF_Attribute); class Handle(TDF_RelocationTable); @@ -34,6 +36,7 @@ Standard_EXPORT virtual void Load(const TCollection_AsciiString&) {} Standard_EXPORT virtual TCollection_AsciiString Type(); Standard_EXPORT virtual void CheckLocked(); Standard_EXPORT TCollection_AsciiString GetClassType() { return _type; } +Standard_EXPORT Handle(SALOMEDSImpl_SObject) GetSObject(); Standard_EXPORT static char* Impl_GetType(const Handle(TDF_Attribute)& theAttr); Standard_EXPORT static void Impl_CheckLocked(const Handle(TDF_Attribute)& theAttr);