1 #include <HYDROData_Application.h>
3 #include <TColStd_SequenceOfExtendedString.hxx>
5 IMPLEMENT_STANDARD_HANDLE(HYDROData_Application,TDocStd_Application)
6 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Application,TDocStd_Application)
8 static HYDROData_Application* TheApplication = new HYDROData_Application;
10 //=======================================================================
11 //function : getApplication
13 //=======================================================================
14 HYDROData_Application* HYDROData_Application::GetApplication()
16 return TheApplication;
19 //=======================================================================
20 //function : getDocument
22 //=======================================================================
23 Handle(HYDROData_Document) HYDROData_Application::GetDocument(int theStudyID)
25 if (myDocuments.IsBound(theStudyID)) {
26 return myDocuments.Find(theStudyID);
28 // document not found => create the new one
29 return Handle(HYDROData_Document)();
32 //=======================================================================
33 //function : OCAFApp_Application
35 //=======================================================================
36 HYDROData_Application::HYDROData_Application ()
38 // store handle to the application to avoid nullification
39 static Handle(HYDROData_Application) TheKeepHandle;
43 //=======================================================================
44 //function : addDocument
46 //=======================================================================
47 void HYDROData_Application::AddDocument(int theStudyID, Handle(HYDROData_Document) theDocument)
49 myDocuments.Bind(theStudyID, theDocument);
52 //=======================================================================
53 //function : removeDocument
55 //=======================================================================
56 void HYDROData_Application::RemoveDocument(Handle(HYDROData_Document) theDocument)
58 DataMapOfStudyIDDocument::Iterator anIter(myDocuments);
59 for(; anIter.More(); anIter.Next())
60 if (anIter.Value() == theDocument) {
61 myDocuments.UnBind(anIter.Key());
66 //=======================================================================
69 //=======================================================================
70 void HYDROData_Application::Formats(TColStd_SequenceOfExtendedString& theFormats)
72 theFormats.Append(TCollection_ExtendedString ("BinOcaf")); // standard binary schema
75 //=======================================================================
76 //function : ResourcesName
78 //=======================================================================
79 Standard_CString HYDROData_Application::ResourcesName()
81 return Standard_CString("Standard");