Salome HOME
Lot 2: change bathy associated to natural object propagated to all cases without...
[modules/hydro.git] / src / HYDROData / HYDROData_Application.cxx
index 04a0e18b9c85ca06c86a8a33d71e4acc2f9d1ba2..9fd0d2ed8876acbcdc083447b540d9eb55e80cac 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <TColStd_SequenceOfExtendedString.hxx>
 
+#define _STUDYID_ 1
+
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Application,TDocStd_Application)
 
 static HYDROData_Application* TheApplication = new HYDROData_Application;
@@ -37,30 +39,10 @@ HYDROData_Application* HYDROData_Application::GetApplication()
 //function : GetDocument
 //purpose  : 
 //=======================================================================
-bool HYDROData_Application::GetDocumentId(const Handle(HYDROData_Document)& theDocument,
-                                          int&                              theDocId) const
-{
-  DataMapOfStudyIDDocument::Iterator aMapit( myDocuments );
-  for ( ; aMapit.More(); aMapit.Next() )
-  {
-    if ( aMapit.Value() != theDocument )
-      continue;
-
-    theDocId = aMapit.Key();
-    return true;
-  }
-
-  return false;
-}
-
-//=======================================================================
-//function : GetDocument
-//purpose  : 
-//=======================================================================
-Handle(HYDROData_Document) HYDROData_Application::GetDocument(int theStudyID) const
+Handle(HYDROData_Document) HYDROData_Application::GetDocument() const
 {
-  if (myDocuments.IsBound(theStudyID)) {
-    return myDocuments.Find(theStudyID);
+  if (myDocuments.IsBound(_STUDYID_)) {
+    return myDocuments.Find(_STUDYID_);
   }
   // document not found => create the new one
   return Handle(HYDROData_Document)();
@@ -81,9 +63,9 @@ HYDROData_Application::HYDROData_Application ()
 //function : addDocument
 //purpose  : 
 //=======================================================================
-void HYDROData_Application::AddDocument(int theStudyID, const Handle(HYDROData_Document)& theDocument)
+void HYDROData_Application::AddDocument(const Handle(HYDROData_Document)& theDocument)
 {
-  myDocuments.Bind(theStudyID, theDocument);
+  myDocuments.Bind(_STUDYID_, theDocument);
 }
 
 //=======================================================================