1 // File: LightApp_DataModel.cxx
2 // Created: 10/25/2004 10:36:06 AM
3 // Author: Sergey LITONIN
4 // Copyright (C) CEA 2004
6 #include "LightApp_DataModel.h"
7 #include "LightApp_Study.h"
8 #include "LightApp_RootObject.h"
9 #include "LightApp_Module.h"
10 #include "LightApp_Application.h"
12 #include <CAM_DataObject.h>
14 #include <SUIT_Application.h>
15 #include <SUIT_ResourceMgr.h>
16 #include <SUIT_Session.h>
17 #include <SUIT_DataObject.h>
19 //=======================================================================
20 // name : LightApp_DataModel::LightApp_DataModel
21 /*!Purpose : Constructor*/
22 //=======================================================================
23 LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule )
24 : CAM_DataModel( theModule )
28 //=======================================================================
29 // name : LightApp_DataModel::~LightApp_DataModel
30 /*! Purpose : Destructor*/
31 //=======================================================================
32 LightApp_DataModel::~LightApp_DataModel()
36 //================================================================
38 /*! Purpose : Emit opened()*/
39 //================================================================
40 bool LightApp_DataModel::open( const QString&, CAM_Study* study, QStringList )
42 emit opened(); //TODO: is it really needed? to be removed maybe...
46 //================================================================
48 /*! Purpose : Emit saved()*/
49 //================================================================
50 bool LightApp_DataModel::save( QStringList& )
56 //================================================================
58 /*! Purpose : Emit saved()*/
59 //================================================================
60 bool LightApp_DataModel::saveAs( const QString&, CAM_Study*, QStringList& )
66 //================================================================
68 /*! Purpose : Emit closed()*/
69 //================================================================
70 bool LightApp_DataModel::close()
76 //================================================================
78 /*! Purpose : Update application (empty virtual function).*/
79 //================================================================
80 void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study )
84 //================================================================
85 // Function : getModule
86 /*! Purpose : gets module*/
87 //================================================================
89 LightApp_Module* LightApp_DataModel::getModule() const
91 return dynamic_cast<LightApp_Module*>( module() );
94 //================================================================
95 // Function : getStudy
96 /*! Purpose : gets study */
97 //================================================================
98 LightApp_Study* LightApp_DataModel::getStudy() const
100 LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root()->root() );
103 return aRoot->study();
106 //================================================================
107 // Function : isModified
108 /*! Purpose : default implementation, always returns false so as not to mask study's isModified()*/
109 //================================================================
110 bool LightApp_DataModel::isModified() const
115 //================================================================
116 // Function : isSaved
117 /*! Purpose : default implementation, always returns true so as not to mask study's isSaved()*/
118 //================================================================
119 bool LightApp_DataModel::isSaved() const