From f899b9778209e7706359a5b1e95983d30a413b24 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 8 Feb 2006 14:15:55 +0000 Subject: [PATCH] Added method getLastSavePoint --- src/SALOMEDS/SALOMEDS_IParameters.cxx | 21 +++++++++++++++++++++ src/SALOMEDS/SALOMEDS_IParameters.hxx | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/SALOMEDS/SALOMEDS_IParameters.cxx b/src/SALOMEDS/SALOMEDS_IParameters.cxx index 65996f874..a73712014 100644 --- a/src/SALOMEDS/SALOMEDS_IParameters.cxx +++ b/src/SALOMEDS/SALOMEDS_IParameters.cxx @@ -223,3 +223,24 @@ bool SALOMEDS_IParameters::isDumpPython() if(!_ap->IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN)) return false; return (bool)_ap->GetBool(_AP_DUMP_PYTHON_); } + +int SALOMEDS_IParameters::getLastSavePoint(const string& theID) +{ + if(!_ap) return -1; + _PTR(SObject) main_so = _ap->GetSObject(); + _PTR(Study) study = main_so->GetStudy(); + _PTR(SObject) so = study->FindComponent(theID); + if(!so) return -1; + + _PTR(StudyBuilder) builder = study->NewBuilder(); + _PTR(ChildIterator) anIter ( study->NewChildIterator( so ) ); + int tag = -1; + for(; anIter->More(); anIter->Next()) + { + _PTR(SObject) val( anIter->Value() ); + _PTR(GenericAttribute) genAttr; + if(builder->FindAttribute(val, genAttr, "AttributeParameter")) tag = val->Tag(); + } + + return tag; +} diff --git a/src/SALOMEDS/SALOMEDS_IParameters.hxx b/src/SALOMEDS/SALOMEDS_IParameters.hxx index f8bb2c420..8bfb8dfc6 100644 --- a/src/SALOMEDS/SALOMEDS_IParameters.hxx +++ b/src/SALOMEDS/SALOMEDS_IParameters.hxx @@ -22,7 +22,7 @@ #include #include -#include "SALOMEDSClient_AttributeParameter.hxx" +#include "SALOMEDSClient.hxx" /*! Class which an interface to store the parameters of the objects @@ -122,6 +122,11 @@ public: bool isDumpPython(); + /*! + Returns an ID of the last save point + */ + int getLastSavePoint(const std::string& theID); + private: _PTR(AttributeParameter) _ap; -- 2.39.2