Version: 6.3.1
Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Private Attributes | Friends

LightApp_Study Class Reference

#include <LightApp_Study.h>

Inheritance diagram for LightApp_Study:
Inheritance graph

Public Types

typedef QList< CAM_DataModel * > ModelList

Signals

void saved (SUIT_Study *)
void opened (SUIT_Study *)
void closed (SUIT_Study *)
void created (SUIT_Study *)
void studyModified (SUIT_Study *)

Public Member Functions

 LightApp_Study (SUIT_Application *)
virtual ~LightApp_Study ()
virtual bool createDocument (const QString &)
virtual bool openDocument (const QString &)
virtual bool loadDocument (const QString &)
virtual bool saveDocument ()
virtual bool saveDocumentAs (const QString &)
virtual void closeDocument (bool permanently=true)
virtual bool isSaved () const
virtual bool isModified () const
virtual void addComponent (const CAM_DataModel *dm)
virtual std::string GetTmpDir (const char *theURL, const bool isMultiFile)
virtual QString componentDataType (const QString &) const
virtual QString referencedToEntry (const QString &) const
virtual bool isComponent (const QString &) const
virtual void children (const QString &, QStringList &) const
virtual void components (QStringList &) const
virtual QString centry (const QString &) const
virtual QString getVisualComponentName () const
virtual void setObjectProperty (int theViewMgrId, QString theEntry, QString thePropName, QVariant theValue)
virtual QVariant getObjectProperty (int theViewMgrId, QString theEntry, QString thePropName, QVariant theDefValue) const
virtual void removeViewMgr (int theViewMgrId)
virtual void setObjectPropMap (int theViewMgrId, QString theEntry, PropMap thePropMap)
virtual const PropMapgetObjectPropMap (int theViewMgrId, QString theEntry)
virtual void removeObjectFromAll (QString theEntry)
virtual const ObjMapgetObjectMap (int theViewMgrId)
virtual const ViewMgrMapgetViewMgrMap (int theViewMgrId)
virtual void setVisibilityState (const QString &theEntry, Qtx::VisibilityState theState)
virtual Qtx::VisibilityState visibilityState (const QString &theEntry) const
virtual void setVisibilityStateForAll (Qtx::VisibilityState theState)
virtual LightApp_DataObjectfindObjectByEntry (const QString &theEntry)
bool appendDataModel (const CAM_DataModel *)
 Append data model to the study.
virtual bool insertDataModel (const CAM_DataModel *, const int=-1)
 Insert data model dm with index idx.
bool insertDataModel (const CAM_DataModel *, const CAM_DataModel *)
 Insert data model dm after data model other.
virtual bool removeDataModel (const CAM_DataModel *)
 Remove data model from the study.
bool containsDataModel (const CAM_DataModel *) const
 Check if data model is contained in the list.
void dataModels (ModelList &) const
 Get all data models.
virtual int id () const
SUIT_DataObjectroot () const
virtual QString studyName () const
SUIT_Applicationapplication () const
virtual void Modified ()
virtual void update ()
virtual void sendChangesNotification ()
SUIT_OperationactiveOperation () const
virtual void abortAllOperations ()
const QList< SUIT_Operation * > & operations () const
 Get all started operations.
virtual SUIT_OperationblockingOperation (SUIT_Operation *) const
 Verifies whether operation can be activated above already started ones.
bool start (SUIT_Operation *, const bool check=true)
 Starts operation.
bool abort (SUIT_Operation *)
 Aborts operation.
bool commit (SUIT_Operation *)
 Commits operation.
bool suspend (SUIT_Operation *)
 Commits operation.
bool resume (SUIT_Operation *)
 Resumes operation.
virtual void restoreState (int savePoint)
 Restores the study state.

Protected Slots

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

Protected Member Functions

virtual void saveModuleData (QString theModuleName, QStringList theListOfFiles)
virtual void openModuleData (QString theModuleName, QStringList &theListOfFiles)
virtual bool saveStudyData (const QString &theFileName)
virtual bool openStudyData (const QString &theFileName)
virtual std::vector< std::string > GetListOfFiles (const char *theModuleName) const
virtual void SetListOfFiles (const char *theModuleName, const std::vector< std::string > theListOfFiles)
virtual void RemoveTemporaryFiles (const char *theModuleName, const bool isMultiFile) const
virtual bool openDataModel (const QString &, CAM_DataModel *)
virtual void dataModelInserted (const CAM_DataModel *)
 Called when data model is inserted in the study.
virtual bool saveDataModel (const QString &, CAM_DataModel *)
 Called when data model is saved.
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.
virtual void operationAborted (SUIT_Operation *)
 Perform some actions when operation aborted.
virtual void operationStopped (SUIT_Operation *)
 Perform some actions when operation stopped.
virtual void operationCommited (SUIT_Operation *)
 Perform some actions when operation commited.
virtual bool openTransaction ()
 Opens transaction for data modifications.
virtual bool abortTransaction ()
 Aborts transaction and all performed data modifications.
virtual bool hasTransaction () const
 Returns TRUE if transaction is opened.
virtual bool commitTransaction (const QString &=QString())
 Commits transaction and all performed data modifications.

Private Attributes

LightApp_DrivermyDriver
ViewMgrMap myViewMgrMap

Friends

class LightApp_Application

Detailed Description

Custom study, using for open/close of documents HDF format. Data of each module can be saved to different files, those after that are combined into one HDF file


Member Typedef Documentation

typedef QList<CAM_DataModel*> CAM_Study.ModelList [inherited]

Constructor & Destructor Documentation

LightApp_Study::LightApp_Study ( SUIT_Application app)

Constructor.

References myDriver.

LightApp_Study::~LightApp_Study ( ) [virtual]

Destructor.


Member Function Documentation

bool LightApp_Study::createDocument ( const QString &  theStr) [virtual]

Create document.

Reimplemented from SUIT_Study.

Reimplemented in SalomeApp_Study.

References created(), SUIT_Study.setRoot(), SUIT_Study.setStudyName(), and LightApp_Application.studyId().

bool LightApp_Study::openDocument ( const QString &  theFileName) [virtual]
bool LightApp_Study::loadDocument ( const QString &  theStudyName) [virtual]
bool LightApp_Study::saveDocument ( ) [virtual]
bool LightApp_Study::saveDocumentAs ( const QString &  theFileName) [virtual]
void LightApp_Study::closeDocument ( bool  permanently = true) [virtual]

Closes document

Reimplemented from CAM_Study.

Reimplemented in SalomeApp_Study.

References LightApp_Driver.ClearDriverContents(), closed(), and myDriver.

bool LightApp_Study::isSaved ( ) const [virtual]
Returns:
true if data model is saved

Reimplemented from SUIT_Study.

Reimplemented in SalomeApp_Study.

bool LightApp_Study::isModified ( ) const [virtual]
Returns:
true if study is modified

Reimplemented from SUIT_Study.

Reimplemented in SalomeApp_Study.

References CAM_Study.dataModels(), and LightApp_DataModel.isModified().

void LightApp_Study::addComponent ( const CAM_DataModel dm) [virtual]

Creates SComponent for module, necessary for SalomeApp study

Reimplemented in SalomeApp_Study.

std::string LightApp_Study::GetTmpDir ( const char *  theURL,
const bool  isMultiFile 
) [virtual]
Returns:
temporary directory for saving files of modules

Reimplemented in SalomeApp_Study.

References LightApp_Driver.GetTmpDir(), and myDriver.

QString LightApp_Study::componentDataType ( const QString &  entry) const [virtual]
QString LightApp_Study::referencedToEntry ( const QString &  entry) const [virtual]
Returns:
real entry by entry of reference
Parameters:
entry- entry of reference object

Reimplemented in SalomeApp_Study.

bool LightApp_Study::isComponent ( const QString &  entry) const [virtual]
Returns:
true if entry corresponds to component

Reimplemented in SalomeApp_Study.

References SUIT_DataObject.children(), LightApp_DataObject.entry(), PyInterp.obj, and SUIT_Study.root().

void LightApp_Study::children ( const QString &  ,
QStringList &   
) const [virtual]
Returns:
entries of object children

Reimplemented in SalomeApp_Study.

void LightApp_Study::components ( QStringList &  comp) const [virtual]

Fills list with components names

Parameters:
comp- list to be filled

Reimplemented in SalomeApp_Study.

References SUIT_DataObject.children(), children(), LightApp_DataObject.entry(), getVisualComponentName(), PyInterp.obj, and SUIT_Study.root().

QString LightApp_Study::centry ( const QString &  comp) const [virtual]

Get the entry for the given module

Parameters:
comp- list to be filled
Returns:
module root's entry

Reimplemented in SalomeApp_Study.

References CAM_Study.dataModels(), LightApp_DataObject.entry(), CAM_DataModel.module(), CAM_Module.name(), and CAM_DataModel.root().

QString LightApp_Study::getVisualComponentName ( ) const [virtual]
Returns:
a name of the component where visual parameters are stored
void LightApp_Study::setObjectProperty ( int  theViewId,
QString  theEntry,
QString  thePropName,
QVariant  theValue 
) [virtual]

Set a visual property of the object

Parameters:
theViewId- Id of the viewer namager
theEntry- Entry of the object
thePropName- the name of the visual property
theValue- the value of the visual property

References myViewMgrMap.

QVariant LightApp_Study::getObjectProperty ( int  theViewMgrId,
QString  theEntry,
QString  thePropName,
QVariant  theDefValue 
) const [virtual]

Get a visual property of the object identified by theViewMgrId, theEntry and thePropName.

Parameters:
theViewMgrId- Id of the viewer manager.
theEntry- Entry of the object.
thePropName- the name of the visual property.
theDefValue- the default value of the visual property.
Returns:
value of the visual propetry. If value is't found then return theDefValue.

References myViewMgrMap.

void LightApp_Study::removeViewMgr ( int  theViewMgrId) [virtual]

Remove view manager with all objects.

Parameters:
theViewMgrId- Id of the viewer manager.

References myViewMgrMap.

void LightApp_Study::setObjectPropMap ( int  theViewMgrId,
QString  theEntry,
PropMap  thePropMap 
) [virtual]

Set a map of the properties of the object identified by theViewMgrId and theEntry.

Parameters:
theViewMgrId- Id of the viewer manager.
theEntry- Entry of the object.

References myViewMgrMap.

const PropMap & LightApp_Study::getObjectPropMap ( int  theViewMgrId,
QString  theEntry 
) [virtual]

Get a map of the properties of the object identified by theViewMgrId and theEntry.

Parameters:
theViewMgrId- Id of the viewer manager.
theEntry- Entry of the object.
Returns:
a map of the properties of the object.

References myViewMgrMap.

void LightApp_Study::removeObjectFromAll ( QString  theEntry) [virtual]

Remove object's properties from all view managers.

Parameters:
theEntry- Entry of the object.

References myViewMgrMap.

const ObjMap & LightApp_Study::getObjectMap ( int  theViewMgrId) [virtual]

Get all objects and it's properties from view manager identified by theViewMgrId.

Parameters:
theEntry- Entry of the object.

References myViewMgrMap.

virtual const ViewMgrMap& LightApp_Study.getViewMgrMap ( int  theViewMgrId) [virtual]
void LightApp_Study::setVisibilityState ( const QString &  theEntry,
Qtx::VisibilityState  theState 
) [virtual]

Set 'visibility state' property of the object.

Parameters:
theEntry- Entry of the object.
theState- visibility status

References SUIT_Study.application(), OB_Browser.model(), LightApp_Application.objectBrowser(), and SUIT_AbstractModel.setVisibilityState().

Qtx::VisibilityState LightApp_Study::visibilityState ( const QString &  theEntry) const [virtual]

Get 'visibility state' property of the object.

Parameters:
theEntry- Entry of the object.
Returns:
'visibility state' property of the object.

References SUIT_Study.application(), OB_Browser.model(), LightApp_Application.objectBrowser(), Qtx.UnpresentableState, and SUIT_AbstractModel.visibilityState().

void LightApp_Study::setVisibilityStateForAll ( Qtx::VisibilityState  theState) [virtual]

Set 'visibility state' property for all object.

Parameters:
theEntry- Entry of the object.

References SUIT_Study.application(), OB_Browser.model(), LightApp_Application.objectBrowser(), and SUIT_AbstractModel.setVisibilityStateForAll().

LightApp_DataObject * LightApp_Study::findObjectByEntry ( const QString &  theEntry) [virtual]

Find a data object by the specified entry.

Parameters:
theEntry- Entry of the object.
Returns:
data object.

Reimplemented in SalomeApp_Study.

References SUIT_DataObjectIterator.current(), SUIT_DataObjectIterator.DepthLeft, LightApp_DataObject.entry(), and SUIT_Study.root().

void LightApp_Study::saveModuleData ( QString  theModuleName,
QStringList  theListOfFiles 
) [protected, virtual]

Saves list file for module 'theModuleName'

Reimplemented in SalomeApp_Study.

References myDriver, and LightApp_Driver.SetListOfFiles().

void LightApp_Study::openModuleData ( QString  theModuleName,
QStringList &  theListOfFiles 
) [protected, virtual]

Gets list of file for module 'theModuleNam'

Reimplemented in SalomeApp_Study.

References LightApp_Driver.GetListOfFiles(), and myDriver.

bool LightApp_Study::saveStudyData ( const QString &  theFileName) [protected, virtual]
bool LightApp_Study::openStudyData ( const QString &  theFileName) [protected, virtual]
std::vector< std::string > LightApp_Study::GetListOfFiles ( const char *  theModuleName) const [protected, virtual]
Returns:
list of files necessary for module
Parameters:
theModuleName- name of module

Reimplemented in SalomeApp_Study.

References LightApp_Driver.GetListOfFiles(), and myDriver.

void LightApp_Study::SetListOfFiles ( const char *  theModuleName,
const std::vector< std::string >  theListOfFiles 
) [protected, virtual]

Sets list of files necessary for module

Parameters:
theModuleName- name of module
theListOfFiles- list of files

Reimplemented in SalomeApp_Study.

References myDriver, and LightApp_Driver.SetListOfFiles().

void LightApp_Study::RemoveTemporaryFiles ( const char *  theModuleName,
const bool  isMultiFile 
) const [protected, virtual]

Removes temporary files

Reimplemented in SalomeApp_Study.

References myDriver, and LightApp_Driver.RemoveTemporaryFiles().

bool LightApp_Study::openDataModel ( const QString &  studyName,
CAM_DataModel dm 
) [protected, virtual]
void LightApp_Study.saved ( SUIT_Study ) [signal]
void LightApp_Study.opened ( SUIT_Study ) [signal]
void LightApp_Study.closed ( SUIT_Study ) [signal]
void LightApp_Study.created ( SUIT_Study ) [signal]
bool CAM_Study::appendDataModel ( const CAM_DataModel dm) [inherited]
Parameters:
dmdata model being added
Returns:
true on success and false on error

References CAM_Study.insertDataModel(), and CAM_Study.myDataModels.

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

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

bool CAM_Study::insertDataModel ( const CAM_DataModel dm,
const CAM_DataModel other 
) [inherited]

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 CAM_Study.insertDataModel(), and CAM_Study.myDataModels.

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

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

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

References CAM_Study.myDataModels.

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

References CAM_Study.myDataModels.

void CAM_Study::dataModelInserted ( const CAM_DataModel dModel) [protected, virtual, inherited]

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(), CAM_Study.openDataModel(), SUIT_Study.studyName(), and CAM_Study.updateModelRoot().

bool CAM_Study::saveDataModel ( const QString &  ,
CAM_DataModel  
) [protected, virtual, inherited]

Base implementation does nothing and returns false.

Returns:
true on success and false on error
void CAM_Study::updateModelRoot ( const CAM_DataModel dm) [protected, virtual, slot, inherited]
int SUIT_Study::id ( ) const [virtual, inherited]
Return values:
studyid.

Reimplemented in SalomeApp_Study.

References SUIT_Study.myId.

SUIT_DataObject * SUIT_Study::root ( ) const [inherited]
Return values:
rootdata object.

References SUIT_Study.myRoot.

QString SUIT_Study::studyName ( ) const [virtual, inherited]
Return values:
studyname

Reimplemented in SalomeApp_Study.

References SUIT_Study.myName.

SUIT_Application * SUIT_Study::application ( ) const [inherited]
Return values:
Application.

References SUIT_Study.myApp.

void SUIT_Study::Modified ( ) [virtual, inherited]

Set study modified to on.

Reimplemented in SalomeApp_Study.

References SUIT_Study.sendChangesNotification(), and SUIT_Study.setIsModified().

void SUIT_Study::update ( ) [virtual, inherited]

Update study. NOT IMPLEMENTED HERE.

void SUIT_Study::sendChangesNotification ( ) [virtual, inherited]

Emit study modified.

References SUIT_Study.studyModified().

SUIT_Operation * SUIT_Study::activeOperation ( ) const [inherited]
Return values:
activeoperation.

References SUIT_Study.myOperations.

void SUIT_Study::abortAllOperations ( ) [virtual, inherited]

Abort all operations.

References SUIT_Study.myBlockChangeState, and SUIT_Study.myOperations.

const QList< SUIT_Operation * > & SUIT_Study::operations ( ) const [inherited]
Returns:
List of all started operations

References SUIT_Study.myOperations.

SUIT_Operation * SUIT_Study::blockingOperation ( SUIT_Operation theOp) const [virtual, inherited]
Parameters:
theOp- operation to be checked
Returns:
NULL if operation can be activated, pointer to operation which denies starting tested operation

Verifies whether operation can be activated above already started ones. This method is called from SUIT_Study.start() and SUIT_Study.resume() methods.

References SUIT_Operation.isGranted(), SUIT_Operation.isValid(), and SUIT_Study.myOperations.

bool SUIT_Study::start ( SUIT_Operation theOp,
const bool  toCheck = true 
) [inherited]
Parameters:
theOp- operation to be started
toCheck- if parameters is equal TRUE then checking performed whether all already started operations allow to start this operation above them (default value is TRUE
Returns:
TRUE if operation is started, FALSE otherwise

Verifies whether theOp operation can be started above already started ones (if toCheck parameter is equal TRUE) and starts it

References SUIT_Study.activeOperation(), SUIT_Study.application(), SUIT_Study.blockingOperation(), SUIT_Operation.isReadyToStart(), SUIT_Study.myOperations, SUIT_Study.operationStarted(), SUIT_MessageBox.question(), SUIT_Operation.Rejected, SUIT_Operation.Running, SUIT_Operation.setExecStatus(), SUIT_Operation.setState(), SUIT_Operation.setStudy(), SUIT_Operation.started(), SUIT_Operation.startOperation(), SUIT_Operation.Suspended, and SUIT_Operation.suspendOperation().

bool SUIT_Study::abort ( SUIT_Operation theOp) [inherited]
Parameters:
theOp- operation to be aborted
Returns:
TRUE if operation is aborted successfully

Verifies whether operation already started and aborts it in this case (sets execution status to Rejected and stops operation)

References SUIT_Operation.aborted(), SUIT_Operation.abortOperation(), SUIT_Study.myOperations, SUIT_Study.operationAborted(), SUIT_Operation.Rejected, SUIT_Operation.setExecStatus(), and SUIT_Study.stop().

bool SUIT_Study::commit ( SUIT_Operation theOp) [inherited]
Parameters:
theOp- operation to be committed
Returns:
TRUE if operation is committed successfully

Verifies whether operation already started and commits it in this case (sets execution status to Accepted and stops operation)

References SUIT_Operation.Accepted, SUIT_Operation.commitOperation(), SUIT_Operation.committed(), SUIT_Study.myOperations, SUIT_Study.operationCommited(), SUIT_Operation.setExecStatus(), SUIT_Study.stop(), and SUIT_Study.studyModified().

bool SUIT_Study::suspend ( SUIT_Operation theOp) [inherited]
Parameters:
theOp- operation to be committed
Returns:
TRUE if operation is suspended successfully

Verifies whether operation already started and suspends it in this case. Operations ususlly are suspended to start other one above them.

References SUIT_Study.myOperations, SUIT_Operation.setState(), SUIT_Operation.state(), SUIT_Operation.suspended(), SUIT_Operation.Suspended, and SUIT_Operation.suspendOperation().

bool SUIT_Study::resume ( SUIT_Operation theOp) [inherited]
Parameters:
theOp- operation to be resumed
Returns:
TRUE if operation is aborted successfully

Verifies whether operation already started but suspended and resumesit in this case.

References SUIT_Study.blockingOperation(), SUIT_Study.myOperations, SUIT_Operation.resumed(), SUIT_Operation.resumeOperation(), SUIT_Operation.Running, SUIT_Operation.setState(), SUIT_Operation.state(), and SUIT_Study.suspend().

void SUIT_Study::restoreState ( int  savePoint) [virtual, inherited]

Reimplemented in SalomeApp_Study.

void SUIT_Study.studyModified ( SUIT_Study ) [signal, inherited]
void SUIT_Study::setIsSaved ( const bool  on) [protected, virtual, inherited]

Set study saved to on.

References SUIT_Study.myIsSaved.

void SUIT_Study::setIsModified ( const bool  on) [protected, virtual, inherited]

Set study modified to on.

References SUIT_Study.myIsModified.

void SUIT_Study::setRoot ( SUIT_DataObject obj) [protected, virtual, inherited]
void SUIT_Study::setStudyName ( const QString &  name) [protected, virtual, inherited]

Set study name.

References SUIT_Study.myName.

void SUIT_Study::operationStarted ( SUIT_Operation op) [protected, virtual, inherited]
void SUIT_Study::operationAborted ( SUIT_Operation op) [protected, virtual, inherited]
void SUIT_Study::operationStopped ( SUIT_Operation ) [protected, virtual, inherited]
void SUIT_Study::operationCommited ( SUIT_Operation op) [protected, virtual, inherited]
bool SUIT_Study::openTransaction ( ) [protected, virtual, inherited]

Reimplemented in CAF_Study.

bool SUIT_Study::abortTransaction ( ) [protected, virtual, inherited]

Reimplemented in CAF_Study.

bool SUIT_Study::hasTransaction ( ) const [protected, virtual, inherited]

Reimplemented in CAF_Study.

bool SUIT_Study::commitTransaction ( const QString &  = QString()) [protected, virtual, inherited]

Reimplemented in CAF_Study.


Friends And Related Function Documentation

friend class LightApp_Application [friend]

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