]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Added method getLastSavePoint
authorsrn <srn@opencascade.com>
Wed, 8 Feb 2006 14:15:55 +0000 (14:15 +0000)
committersrn <srn@opencascade.com>
Wed, 8 Feb 2006 14:15:55 +0000 (14:15 +0000)
src/SALOMEDS/SALOMEDS_IParameters.cxx
src/SALOMEDS/SALOMEDS_IParameters.hxx

index 65996f874e2f1e997e3fb79fee2528665da9ec6b..a73712014aa0842dcb4d3cbeab50a90934ad2b2f 100644 (file)
@@ -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;
+}
index f8bb2c4208efc5c60f9a5625e6b3e4da7ac73ece..8bfb8dfc6a4016006ef46a7fe562d0dbe84837fb 100644 (file)
@@ -22,7 +22,7 @@
 #include <string>
 #include <vector>
 
-#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;