From cca83bbcf0ad69830739262ba8d1351155ec08a8 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 30 Mar 2005 09:48:41 +0000 Subject: [PATCH] Added method GetSObject --- src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx | 7 +++++++ src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx | 3 +++ 2 files changed, 10 insertions(+) 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); -- 2.39.2