Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / Model / Model_Application.h
1 // File:        Model_Application.hxx
2 // Created:     28 Dec 2011
3 // Author:      Mikhail PONIKAROV
4 // Copyright:   CEA 2011
5
6 #ifndef Model_Application_HeaderFile
7 #define Model_Application_HeaderFile
8
9 #include <Model_Document.hxx> 
10 #include <ModelAPI_Application.hxx> 
11 #include <TDocStd_Application.hxx>
12
13 // Define handle class 
14 DEFINE_STANDARD_HANDLE(Model_Application, TDocStd_Application)
15
16 /**\class Model_Application
17  * \ingroup DataModel
18  * \brief Realization of Open CASCADE application abstraction. Class for internal use only.
19  * Application supports the formats and document management. It is uses OCAF-lke
20  * architecture and just implements specific features of the module.
21  */
22 class Model_Application: public TDocStd_Application, public ModelAPI_Application
23 {
24 public:
25   // useful methods inside of the module
26
27   // CASCADE RTTI
28   DEFINE_STANDARD_RTTI(Model_Application)
29   ;
30
31   //! Retuns the application: one per process    
32   MODEL_EXPORT static Handle_Model_Application GetApplication();
33   //! Returns the main document (on first call creates it)
34   MODEL_EXPORT ModelAPI_Document* GetMainDocument();
35
36 public:
37   // Redefined OCAF methods
38   //! Return name of resource (i.e. "Standard")
39   Standard_CString ResourcesName();
40   //! Return format (i.e "MDTV-Standard")
41   //! \param theFormats sequence of allowed formats for input/output
42   virtual void Formats(TColStd_SequenceOfExtendedString& theFormats);
43   //! Constructor
44   //! Use method GetInstance() method to obtain 
45   //! the static instance of the object (or derive your own application)
46   Model_Application();
47
48 private:
49
50   Handle_Model_Document myMainDoc; ///< main document of an application
51 };
52
53 #endif