Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LightApp_DataModel Class Reference

#include <LightApp_DataModel.h>

Inheritance diagram for LightApp_DataModel:
Inheritance graph

Signals

void opened ()
 
void saved ()
 
void closed ()
 
- Signals inherited from CAM_DataModel
void rootChanged (const CAM_DataModel *)
 Emitted when the root data object is changed. More...
 

Public Member Functions

 LightApp_DataModel (CAM_Module *theModule)
 
virtual ~LightApp_DataModel ()
 
virtual bool open (const QString &, CAM_Study *, QStringList)
 
virtual bool save (QStringList &)
 
virtual bool saveAs (const QString &, CAM_Study *, QStringList &)
 
virtual bool close ()
 
virtual bool dumpPython (const QString &, CAM_Study *, bool, QStringList &)
 
virtual void update (LightApp_DataObject *=0, LightApp_Study *=0)
 
virtual bool isModified () const
 
virtual bool isSaved () const
 
LightApp_ModulegetModule () const
 
int groupId () const
 
void registerColumn (SUIT_DataBrowser *, const QString &, const int)
 
void unregisterColumn (SUIT_DataBrowser *, const QString &)
 
- Public Member Functions inherited from CAM_DataModel
 CAM_DataModel (CAM_Module *)
 Constructor. More...
 
virtual ~CAM_DataModel ()
 Destructor. More...
 
virtual void initialize ()
 Initialize data model. More...
 
CAM_DataObjectroot () const
 Get data model root object. More...
 
CAM_Modulemodule () const
 Get module. More...
 
virtual bool create (CAM_Study *)
 Create empty data model. More...
 

Protected Member Functions

LightApp_StudygetStudy () const
 
virtual void build ()
 
virtual void updateWidgets ()
 
virtual CAM_ModuleObjectcreateModuleObject (SUIT_DataObject *theRoot) const
 
- Protected Member Functions inherited from CAM_DataModel
virtual void setRoot (const CAM_DataObject *)
 Set data model root object. More...
 

Private Attributes

int myGroupId
 

Detailed Description

Description : Base class of data model

Constructor & Destructor Documentation

LightApp_DataModel::LightApp_DataModel ( CAM_Module theModule)

Constructor

References CAM_DataModel::module(), and myGroupId.

LightApp_DataModel::~LightApp_DataModel ( )
virtual

Destructor

Member Function Documentation

void LightApp_DataModel::build ( )
protectedvirtual

Build whole data model tree

bool LightApp_DataModel::close ( )
virtual

Emit closed()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight.

References closed().

void LightApp_DataModel::closed ( )
signal
CAM_ModuleObject * LightApp_DataModel::createModuleObject ( SUIT_DataObject theRoot) const
protectedvirtual

Creates the data model's root (module object) using the study services. This is important because different study classes use different moduel object classes. Therefore creation of the module object cannot be done at the data model level where the type of the current study instance should not be known. The module object returned by this method should be then passed to the model's setRoot().

Returns
the module object instance corresponding to the study type
See Also
CAM_DataModel class

References LightApp_Study::createModuleObject(), and LightApp_RootObject::study().

bool LightApp_DataModel::dumpPython ( const QString &  ,
CAM_Study ,
bool  ,
QStringList &   
)
virtual

Does nothing by default. Should be redefined in light modules that want to participate in "Dump study" operation.

Reimplemented in SALOME_PYQT_DataModelLight.

LightApp_Module * LightApp_DataModel::getModule ( ) const
Returns
corresponding module

References CAM_DataModel::module().

LightApp_Study * LightApp_DataModel::getStudy ( ) const
protected
Returns
corresponding study

References CAM_DataModel::root(), SUIT_DataObject::root(), and LightApp_RootObject::study().

int LightApp_DataModel::groupId ( ) const
Returns
data model group id used for custom columns creation

References myGroupId.

bool LightApp_DataModel::isModified ( ) const
virtual

default implementation, always returns false so as not to mask study's isModified()

Reimplemented in SALOME_PYQT_DataModelLight.

bool LightApp_DataModel::isSaved ( ) const
virtual

default implementation, always returns true so as not to mask study's isSaved()

bool LightApp_DataModel::open ( const QString &  ,
CAM_Study study,
QStringList   
)
virtual

Emit opened()

Reimplemented from CAM_DataModel.

Reimplemented in SalomeApp_DataModel, and SALOME_PYQT_DataModelLight.

References opened().

void LightApp_DataModel::opened ( )
signal
void LightApp_DataModel::registerColumn ( SUIT_DataBrowser browser,
const QString &  name,
const int  custom_id 
)

Register custom column in the object browser

Parameters
browser- object browser where new column should be created
name- translated column name
custom_id- custom column identificator passed into data object's methods text(), icon() etc

References groupId(), OB_Browser::model(), and SUIT_AbstractModel::registerColumn().

bool LightApp_DataModel::save ( QStringList &  )
virtual

Emit saved()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight.

References saved().

bool LightApp_DataModel::saveAs ( const QString &  ,
CAM_Study ,
QStringList &   
)
virtual

Emit saved()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight.

References saved().

void LightApp_DataModel::saved ( )
signal
void LightApp_DataModel::unregisterColumn ( SUIT_DataBrowser browser,
const QString &  name 
)

Remove registered custom column from the object browser

Parameters
browser- object browser where new column should be created
name- translated column name

References groupId(), OB_Browser::model(), and SUIT_AbstractModel::unregisterColumn().

void LightApp_DataModel::update ( LightApp_DataObject = 0,
LightApp_Study = 0 
)
virtual

Default behaviour of data model update for light modules

Reimplemented in SalomeApp_DataModel, and SALOME_PYQT_DataModelLight.

References build(), SUIT_DataObject::children(), CAM_DataModel::root(), and updateWidgets().

void LightApp_DataModel::updateWidgets ( )
protectedvirtual

Updates data model presentation in some widgets (for example, in object browser

References app, CAM_Module::application(), CAM_DataModel::module(), LightApp_Application::objectBrowser(), and SUIT_DataBrowser::updateTree().

Member Data Documentation

int LightApp_DataModel::myGroupId
private

The documentation for this class was generated from the following files: