From 09fe64569315b77aad34c7f2f3f53da1537e25c0 Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 14 Apr 2005 06:08:49 +0000 Subject: [PATCH] Modified method dump --- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 9db430603..b2a74a8b7 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -17,6 +17,7 @@ using namespace std; #include #include #include +#include #include "SALOMEDSImpl_ChildNodeIterator.hxx" #include "SALOMEDSImpl_Attributes.hxx" @@ -1375,13 +1376,18 @@ void dumpSO(const Handle(SALOMEDSImpl_SObject)& theSO, { TCollection_AsciiString aTab(Tab), anID(theSO->GetID()); fp << aTab << anID << endl; - int aLength, i; - Handle(TColStd_HSequenceOfTransient) aSeq = theSO->GetAllAttributes(); - aLength = aSeq->Length(); - for(i=1; i<=aLength; i++) { - Handle(SALOMEDSImpl_GenericAttribute) anAttr = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aSeq->Value(i)); + TDF_AttributeIterator anItr(theSO->GetLabel()); + for(; anItr.More(); anItr.Next()) { + Handle(SALOMEDSImpl_GenericAttribute) anAttr = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(anItr.Value()); + + if(anAttr.IsNull()) { + fp << Tab << " -- " << anItr.Value()->DynamicType(); + continue; + } + TCollection_AsciiString aType = anAttr->GetClassType(); fp << Tab << " -- " << aType; + if(aType == "AttributeReal") { fp << " : " << Handle(SALOMEDSImpl_AttributeReal)::DownCast(anAttr)->Value(); } @@ -1394,6 +1400,9 @@ void dumpSO(const Handle(SALOMEDSImpl_SObject)& theSO, else if(aType == "AttributeComment") { fp << " : " << Handle(SALOMEDSImpl_AttributeComment)::DownCast(anAttr)->Value(); } + else if(aType == "AttributeReference") { + fp << " : " << Handle(SALOMEDSImpl_AttributeReference)::DownCast(anAttr)->Save(); + } fp << endl; } -- 2.39.2