1 // File: Model_Application.cxx
2 // Created: Fri Sep 2 2011
3 // Author: Mikhail PONIKAROV
5 #include <Model_Application.h>
6 #include <Model_Document.h>
8 IMPLEMENT_STANDARD_HANDLE(Model_Application, TDocStd_Application)
9 IMPLEMENT_STANDARD_RTTIEXT(Model_Application, TDocStd_Application)
13 static Handle_Model_Application TheApplication = new Model_Application;
15 //=======================================================================
16 //function : getApplication
18 //=======================================================================
19 Handle(Model_Application) Model_Application::getApplication()
21 return TheApplication;
24 //=======================================================================
25 //function : getDocument
27 //=======================================================================
28 const std::shared_ptr<Model_Document>& Model_Application::getDocument(string theDocID)
30 if (myDocs.find(theDocID) != myDocs.end())
31 return myDocs[theDocID];
33 std::shared_ptr<Model_Document> aNew(new Model_Document(theDocID));
34 myDocs[theDocID] = aNew;
35 return myDocs[theDocID];
38 void Model_Application::deleteDocument(string theDocID)
40 myDocs.erase(theDocID);
43 //=======================================================================
44 //function : OCAFApp_Application
46 //=======================================================================
47 Model_Application::Model_Application()
49 // store handle to the application to avoid nullification
50 static Handle(Model_Application) TheKeepHandle;
54 //=======================================================================
57 //=======================================================================
58 void Model_Application::Formats(TColStd_SequenceOfExtendedString& theFormats)
60 theFormats.Append(TCollection_ExtendedString("BinOcaf")); // standard binary schema
63 //=======================================================================
64 //function : ResourcesName
66 //=======================================================================
67 Standard_CString Model_Application::ResourcesName()
69 return Standard_CString("Standard");