Version: 6.3.1
Signals | Public Member Functions | Protected Member Functions | Private Attributes

LightApp_DataModel Class Reference

#include <LightApp_DataModel.h>

Inheritance diagram for LightApp_DataModel:
Inheritance graph

Signals

void opened ()
void saved ()
void closed ()
void rootChanged (const CAM_DataModel *)
 Emitted when the root data object is changed.

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 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 initialize ()
 Initialize data model.
CAM_DataObjectroot () const
 Get data model root object.
CAM_Modulemodule () const
 Get module.
virtual bool create (CAM_Study *)
 Create empty data model.

Protected Member Functions

LightApp_StudygetStudy () const
virtual void build ()
virtual void updateWidgets ()
virtual void setRoot (const CAM_DataObject *)
 Set data model root object.

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

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

Emit opened()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight, and SalomeApp_DataModel.

References opened().

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

bool LightApp_DataModel::close ( ) [virtual]

Emit closed()

Reimplemented from CAM_DataModel.

Reimplemented in SALOME_PYQT_DataModelLight.

References closed().

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

Default behaviour of data model update for light modules

Reimplemented in SALOME_PYQT_DataModelLight, and SalomeApp_DataModel.

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

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

Reimplemented in SALOME_PYQT_DataModelLight.

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

Reimplemented in SalomeApp_DataModel.

References CAM_DataModel.module().

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

References myGroupId.

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

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.opened ( ) [signal]
void LightApp_DataModel.saved ( ) [signal]
void LightApp_DataModel.closed ( ) [signal]
LightApp_Study * LightApp_DataModel::getStudy ( ) const [protected]
Returns:
corresponding study

Reimplemented in SalomeApp_DataModel.

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

void LightApp_DataModel::build ( ) [protected, virtual]

Build whole data model tree

void LightApp_DataModel::updateWidgets ( ) [protected, virtual]

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]
Returns:
root object
See also:
setRoot()

References CAM_DataModel.myRoot.

CAM_Module * CAM_DataModel::module ( ) const [inherited]
Returns:
module owning this data model

References CAM_DataModel.myModule.

bool CAM_DataModel::create ( CAM_Study ) [virtual, inherited]

This method should be re-implemented in the successor classes. Default implementation returns true.

Returns:
true if data model is created successfully

Reimplemented in SALOME_PYQT_DataModelLight, and SalomeApp_DataModel.

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:

  • in initialize() method
  • while the data model is being loaded
  • when the data model is updated and becomes non-empty

If root object is changed, this method emits rootChanged() signal.

Parameters:
newRootnew 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]
Parameters:
rootnew root data object

Field Documentation

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS