1 #ifndef HYDROData_Application_HeaderFile
2 #define HYDROData_Application_HeaderFile
4 #include <HYDROData_Document.h>
5 #include <TDocStd_Application.hxx>
6 #include <NCollection_DataMap.hxx>
8 typedef NCollection_DataMap<int, Handle(HYDROData_Document)> DataMapOfStudyIDDocument;
10 /**\class HYDROData_Application
12 * \brief Realization of Open CASCADE application abstraction. Class for
13 * internal use inside of a package only.
15 * Application supports the formats and document management. It is uses OCAF-lke
16 * architecture and just implements specific features of the module.
18 class HYDROData_Application : public TDocStd_Application
20 public: // useful methods inside of the package
22 //! Retuns the application: one per process
23 HYDRODATA_EXPORT static HYDROData_Application* GetApplication();
25 public: // Redefined OCAF methods
26 //! Return name of resource (i.e. "Standard")
27 Standard_CString ResourcesName();
28 //! Return format (i.e "MDTV-Standard")
29 //! \param theFormats sequence of allowed formats for input/output
30 virtual void Formats(TColStd_SequenceOfExtendedString& theFormats);
32 //! Use method GetInstance() method to obtain
33 //! the static instance of the object (or derive your own application)
34 HYDROData_Application();
37 DEFINE_STANDARD_RTTI(HYDROData_Application)
40 //! Returns document by its study ID, if document doesn't exists return null
41 Handle(HYDROData_Document) GetDocument(int theStudyID);
43 //! Appends document to the application
44 void AddDocument(int theStudyID, Handle(HYDROData_Document) theDocument);
46 //! Removes document from the application
47 void RemoveDocument(Handle(HYDROData_Document) theDocument);
49 //! map from SALOME study ID to the document
50 DataMapOfStudyIDDocument myDocuments;
52 friend class HYDROData_Document; // to manipulate documents of application
55 // Define handle class
56 DEFINE_STANDARD_HANDLE(HYDROData_Application,TDocStd_Application)