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

Represents document object in the CAM application architecture. More...

#include <CAM_Study.h>

Inheritance diagram for CAM_Study:
Inheritance graph

Public Types

typedef QList< CAM_DataModel * > ModelList
 

Public Member Functions

 CAM_Study (SUIT_Application *)
 Constructor. More...
 
virtual ~CAM_Study ()
 Destructor. More...
 
virtual void closeDocument (bool permanently=true)
 Called when study is closed. More...
 
bool appendDataModel (const CAM_DataModel *)
 Append data model to the study. More...
 
virtual bool insertDataModel (const CAM_DataModel *, const int=-1)
 Insert data model dm with index idx. More...
 
bool insertDataModel (const CAM_DataModel *, const CAM_DataModel *)
 Insert data model dm after data model other. More...
 
virtual bool removeDataModel (const CAM_DataModel *)
 Remove data model from the study. More...
 
bool containsDataModel (const CAM_DataModel *) const
 Check if data model is contained in the list. More...
 
void dataModels (ModelList &) const
 Get all data models. More...
 
- Public Member Functions inherited from SUIT_Study
 SUIT_Study (SUIT_Application *)
 
virtual ~SUIT_Study ()
 
virtual int id () const
 
SUIT_DataObjectroot () const
 
virtual QString studyName () const
 
SUIT_Applicationapplication () const
 
virtual bool isSaved () const
 
virtual bool isModified () const
 
virtual void Modified ()
 
virtual bool openDocument (const QString &)
 
virtual bool createDocument (const QString &)
 
bool saveDocument ()
 
virtual bool saveDocumentAs (const QString &)
 
virtual void update ()
 
virtual void sendChangesNotification ()
 
SUIT_OperationactiveOperation () const
 
virtual void abortAllOperations ()
 
const QList< SUIT_Operation * > & operations () const
 Get all started operations. More...
 
virtual SUIT_OperationblockingOperation (SUIT_Operation *) const
 Verifies whether operation can be activated above already started ones. More...
 
bool start (SUIT_Operation *, const bool check=true)
 Starts operation. More...
 
bool abort (SUIT_Operation *)
 Aborts operation. More...
 
bool commit (SUIT_Operation *)
 Commits operation. More...
 
bool suspend (SUIT_Operation *)
 Commits operation. More...
 
bool resume (SUIT_Operation *)
 Resumes operation. More...
 
virtual void restoreState (int savePoint)
 Restores the study state. More...
 

Protected Slots

virtual void updateModelRoot (const CAM_DataModel *)
 Update data model root object. More...
 

Protected Member Functions

virtual void dataModelInserted (const CAM_DataModel *)
 Called when data model is inserted in the study. More...
 
virtual bool openDataModel (const QString &, CAM_DataModel *)
 Called when data model is opened. More...
 
virtual bool saveDataModel (const QString &, CAM_DataModel *)
 Called when data model is saved. More...
 
- Protected Member Functions inherited from SUIT_Study
virtual void setIsSaved (const bool)
 
virtual void setIsModified (const bool)
 
virtual void setRoot (SUIT_DataObject *)
 
virtual void setStudyName (const QString &)
 
virtual void operationStarted (SUIT_Operation *)
 Perform some actions when operation starting. More...
 
virtual void operationAborted (SUIT_Operation *)
 Perform some actions when operation aborted. More...
 
virtual void operationStopped (SUIT_Operation *)
 Perform some actions when operation stopped. More...
 
virtual void operationCommited (SUIT_Operation *)
 Perform some actions when operation commited. More...
 
virtual bool openTransaction ()
 Opens transaction for data modifications. More...
 
virtual bool abortTransaction ()
 Aborts transaction and all performed data modifications. More...
 
virtual bool hasTransaction () const
 Returns true if transaction is opened. More...
 
virtual bool commitTransaction (const QString &=QString())
 Commits transaction and all performed data modifications. More...
 

Private Attributes

ModelList myDataModels
 data models list More...
 

Additional Inherited Members

- Signals inherited from SUIT_Study
void studyModified (SUIT_Study *)
 

Detailed Description

For each loaded module study contains the data model instance reference. Provides all necessary functionality for data models management.

Member Typedef Documentation

Constructor & Destructor Documentation

CAM_Study::CAM_Study ( SUIT_Application app)
Parameters
appparent application
CAM_Study::~CAM_Study ( )
virtual

Member Function Documentation

bool CAM_Study::appendDataModel ( const CAM_DataModel dm)
Parameters
dmdata model being added
Returns
true on success and false on error

References insertDataModel(), and myDataModels.

void CAM_Study::closeDocument ( bool  permanently = true)
virtual

Closes all data models.

Parameters
permanentlyif true close study permanently (not used in the base implemetation)

Reimplemented from SUIT_Study.

Reimplemented in LightApp_Study, and SalomeApp_Study.

References SUIT_Study::closeDocument(), and myDataModels.

bool CAM_Study::containsDataModel ( const CAM_DataModel dm) const
Parameters
dmdata model
Returns
true if data model is in the list and false otherwise.

References myDataModels.

void CAM_Study::dataModelInserted ( const CAM_DataModel dModel)
protectedvirtual

Open data model dModel, if it is saved and update data tree.

Parameters
dModeldata model

Reimplemented in SalomeApp_Study.

References CAM_DataModel::create(), SUIT_Study::isSaved(), openDataModel(), SUIT_Study::studyName(), and updateModelRoot().

void CAM_Study::dataModels ( ModelList lst) const
Parameters
lstreturning list of data model.

References myDataModels.

bool CAM_Study::insertDataModel ( const CAM_DataModel dm,
const int  idx = -1 
)
virtual
Parameters
dmdata model being added
idxdata model required index
Returns
true on success and false on error

References dataModelInserted(), myDataModels, and updateModelRoot().

bool CAM_Study::insertDataModel ( const CAM_DataModel dm,
const CAM_DataModel other 
)

If other is 0, the data model is added to the end of list.

Parameters
dmdata model being added
otherdata model to be previous in the list
Returns
true on success and false on error

References insertDataModel(), and myDataModels.

bool CAM_Study::openDataModel ( const QString &  ,
CAM_DataModel  
)
protectedvirtual

Base implementation does nothing and returns false.

Returns
true on success and false on error

Reimplemented in LightApp_Study, and SalomeApp_Study.

bool CAM_Study::removeDataModel ( const CAM_DataModel dm)
virtual
Parameters
dmdata model being removed
Returns
true on success and false on error

References myDataModels, CAM_DataModel::root(), and CAM_ModuleObject::setDataModel().

bool CAM_Study::saveDataModel ( const QString &  ,
CAM_DataModel  
)
protectedvirtual

Base implementation does nothing and returns false.

Returns
true on success and false on error

Member Data Documentation

ModelList CAM_Study::myDataModels
private

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