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 HYDRODATA_EXPORT Standard_CString ResourcesName();
28 //! Return format (i.e "MDTV-Standard")
29 //! \param theFormats sequence of allowed formats for input/output
30 HYDRODATA_EXPORT 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_EXPORT 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) const;
43 //! Get study id by document instance, if document doesn't exists return false
44 bool GetDocumentId(const Handle(HYDROData_Document)& theDocument,
47 //! Appends document to the application
48 void AddDocument(int theStudyID, const Handle(HYDROData_Document)& theDocument);
50 //! Removes document from the application
51 void RemoveDocument( const Handle(HYDROData_Document)& theDocument );
53 //! map from SALOME study ID to the document
54 DataMapOfStudyIDDocument myDocuments;
56 friend class HYDROData_Document; // to manipulate documents of application
59 // Define handle class
60 DEFINE_STANDARD_HANDLE(HYDROData_Application,TDocStd_Application)