Description : Base class of data model.
#include <SalomeApp_DataModel.h>

Signals | |
| void | opened () |
| void | saved () |
| void | closed () |
| void | rootChanged (const CAM_DataModel *) |
| Emitted when the root data object is changed. | |
Public Member Functions | |
| SalomeApp_DataModel (CAM_Module *theModule) | |
| virtual | ~SalomeApp_DataModel () |
| virtual bool | open (const QString &, CAM_Study *, QStringList) |
| virtual bool | create (CAM_Study *) |
| virtual void | update (LightApp_DataObject *=0, LightApp_Study *=0) |
| QString | getRootEntry (SalomeApp_Study *) const |
| SalomeApp_Module * | getModule () const |
| virtual bool | save (QStringList &) |
| virtual bool | saveAs (const QString &, CAM_Study *, QStringList &) |
| virtual bool | close () |
| virtual bool | isModified () const |
| virtual bool | isSaved () const |
| int | groupId () const |
| void | registerColumn (SUIT_DataBrowser *, const QString &, const int) |
| void | unregisterColumn (SUIT_DataBrowser *, const QString &) |
| virtual void | initialize () |
| Initialize data model. | |
| CAM_DataObject * | root () const |
| Get data model root object. | |
| CAM_Module * | module () const |
| Get module. | |
Static Public Member Functions | |
| static SUIT_DataObject * | synchronize (const _PTR(SComponent)&, SalomeApp_Study *) |
Protected Member Functions | |
| SalomeApp_Study * | getStudy () const |
| virtual void | updateTree (const _PTR(SComponent)&, SalomeApp_Study *) |
| virtual void | build () |
| virtual void | updateWidgets () |
| virtual void | setRoot (const CAM_DataObject *) |
| Set data model root object. | |
| SalomeApp_DataModel::SalomeApp_DataModel | ( | CAM_Module * | theModule | ) |
Constructor
| SalomeApp_DataModel::~SalomeApp_DataModel | ( | ) | [virtual] |
Destructor
| SUIT_DataObject * SalomeApp_DataModel::synchronize | ( | const _PTR(SComponent)& | sobj, |
| SalomeApp_Study * | study | ||
| ) | [static] |
Synchronizes kernel tree and suit data tree starting from component 'sobj'
References SUIT_DataObject.children(), SUIT_DataObject.name(), CAM_DataModel.root(), SUIT_Study.root(), and SalomeApp_RootObject.toSynchronize().
| bool SalomeApp_DataModel::open | ( | const QString & | name, |
| CAM_Study * | study, | ||
| QStringList | |||
| ) | [virtual] |
Opens data model
Reimplemented from LightApp_DataModel.
References _PTR(), getRootEntry(), and updateTree().
| bool SalomeApp_DataModel::create | ( | CAM_Study * | theStudy | ) | [virtual] |
| void SalomeApp_DataModel::update | ( | LightApp_DataObject * | = 0, |
| LightApp_Study * | study = 0 |
||
| ) | [virtual] |
Updates application.
Reimplemented from LightApp_DataModel.
References _PTR(), SUIT_Application.activeStudy(), SalomeApp_DataObject.entry(), SalomeApp_Module.getApp(), getModule(), getRootEntry(), SUIT_DataObject.root(), SUIT_Study.root(), CAM_DataModel.root(), LightApp_RootObject.study(), and updateTree().
| QString SalomeApp_DataModel::getRootEntry | ( | SalomeApp_Study * | study | ) | const |
References _PTR(), SalomeApp_DataObject.entry(), CAM_DataModel.module(), and CAM_DataModel.root().
| SalomeApp_Module * SalomeApp_DataModel::getModule | ( | ) | const |
| SalomeApp_Study * SalomeApp_DataModel::getStudy | ( | ) | const [protected] |
Reimplemented from LightApp_DataModel.
References SUIT_DataObject.root(), CAM_DataModel.root(), and LightApp_RootObject.study().
| void SalomeApp_DataModel::updateTree | ( | const _PTR(SComponent)& | comp, |
| SalomeApp_Study * | study | ||
| ) | [protected, virtual] |
Updates tree.
References CAM_ModuleObject.setDataModel(), CAM_DataModel.setRoot(), and synchronize().
| bool LightApp_DataModel::save | ( | QStringList & | ) | [virtual, inherited] |
Emit saved()
Reimplemented from CAM_DataModel.
Reimplemented in SALOME_PYQT_DataModelLight.
References LightApp_DataModel.saved().
| bool LightApp_DataModel::saveAs | ( | const QString & | , |
| CAM_Study * | , | ||
| QStringList & | |||
| ) | [virtual, inherited] |
Emit saved()
Reimplemented from CAM_DataModel.
Reimplemented in SALOME_PYQT_DataModelLight.
References LightApp_DataModel.saved().
| bool LightApp_DataModel::close | ( | ) | [virtual, inherited] |
Emit closed()
Reimplemented from CAM_DataModel.
Reimplemented in SALOME_PYQT_DataModelLight.
References LightApp_DataModel.closed().
| bool LightApp_DataModel::isModified | ( | ) | const [virtual, inherited] |
default implementation, always returns false so as not to mask study's isModified()
Reimplemented in SALOME_PYQT_DataModelLight.
| bool LightApp_DataModel::isSaved | ( | ) | const [virtual, inherited] |
default implementation, always returns true so as not to mask study's isSaved()
Reimplemented in SALOME_PYQT_DataModelLight.
| int LightApp_DataModel::groupId | ( | ) | const [inherited] |
References LightApp_DataModel.myGroupId.
| void LightApp_DataModel::registerColumn | ( | SUIT_DataBrowser * | browser, |
| const QString & | name, | ||
| const int | custom_id | ||
| ) | [inherited] |
Register custom column in the object browser
| 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 LightApp_DataModel.groupId(), OB_Browser.model(), and SUIT_AbstractModel.registerColumn().
| void LightApp_DataModel::unregisterColumn | ( | SUIT_DataBrowser * | browser, |
| const QString & | name | ||
| ) | [inherited] |
Remove registered custom column from the object browser
| browser | - object browser where new column should be created |
| name | - translated column name |
References LightApp_DataModel.groupId(), OB_Browser.model(), and SUIT_AbstractModel.unregisterColumn().
| void LightApp_DataModel.opened | ( | ) | [signal, inherited] |
| void LightApp_DataModel.saved | ( | ) | [signal, inherited] |
| void LightApp_DataModel.closed | ( | ) | [signal, inherited] |
| void LightApp_DataModel::build | ( | ) | [protected, virtual, inherited] |
Build whole data model tree
| void LightApp_DataModel::updateWidgets | ( | ) | [protected, virtual, inherited] |
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().
| void CAM_DataModel::initialize | ( | ) | [virtual, inherited] |
This method should be re-implemented in the successor classes and can be used for creation of root data object. Default implementation does nothing.
| CAM_DataObject * CAM_DataModel::root | ( | ) | const [inherited] |
| CAM_Module * CAM_DataModel::module | ( | ) | const [inherited] |
References CAM_DataModel.myModule.
| void CAM_DataModel::setRoot | ( | const CAM_DataObject * | newRoot | ) | [protected, virtual, inherited] |
This method should be used to specify custom root object instance.
Root object can be created in several ways, depending on application or module needs:
If root object is changed, this method emits rootChanged() signal.
| newRoot | new root object |
References SUIT_DataObject.connect(), SUIT_DataObject.disconnect(), CAM_DataModel.myRoot, CAM_DataModel.onDestroyed(), and CAM_DataModel.rootChanged().
| void CAM_DataModel::rootChanged | ( | const CAM_DataModel * | root | ) | [signal, inherited] |
| root | new root data object |