Version: 9.12.0
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 &)
 
virtual void initRootObject ()
 For initialization of the data model and registration of SComponent when study is created but module was not activated. More...
 
- 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::LightApp_DataModel ( CAM_Module theModule)

Constructor

References CAM_DataModel::module(), and myGroupId.

◆ ~LightApp_DataModel()

LightApp_DataModel::~LightApp_DataModel ( )
virtual

Destructor

Member Function Documentation

◆ build()

void LightApp_DataModel::build ( )
protectedvirtual

Build whole data model tree

◆ close()

bool LightApp_DataModel::close ( )
virtual

Emit closed()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight.

References closed().

◆ closed

void LightApp_DataModel::closed ( )
signal

◆ createModuleObject()

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().

◆ dumpPython()

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.

◆ getModule()

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

References CAM_DataModel::module().

◆ getStudy()

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

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

◆ groupId()

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

References myGroupId.

◆ initRootObject()

virtual void LightApp_DataModel::initRootObject ( )
inlinevirtual

For initialization of the data model and registration of SComponent when study is created but module was not activated.

◆ isModified()

bool LightApp_DataModel::isModified ( ) const
virtual

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

Reimplemented in SALOME_PYQT_DataModelLight.

◆ isSaved()

bool LightApp_DataModel::isSaved ( ) const
virtual

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

◆ open()

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

Emit opened()

Reimplemented from CAM_DataModel.

Reimplemented in SalomeApp_DataModel, and SALOME_PYQT_DataModelLight.

References opened().

◆ opened

void LightApp_DataModel::opened ( )
signal

◆ registerColumn()

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().

◆ save()

bool LightApp_DataModel::save ( QStringList &  )
virtual

Emit saved()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight.

References saved().

◆ saveAs()

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

Emit saved()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight.

References saved().

◆ saved

void LightApp_DataModel::saved ( )
signal

◆ unregisterColumn()

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().

◆ update()

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().

◆ updateWidgets()

void LightApp_DataModel::updateWidgets ( )
protectedvirtual

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

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

Member Data Documentation

◆ myGroupId

int LightApp_DataModel::myGroupId
private

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