Represents study for using in CAF module. More...
#include <CAF_Study.h>

Signals | |
| void | studyModified (SUIT_Study *) |
Public Member Functions | |
| CAF_Study (SUIT_Application *theApp) | |
| Constructor. | |
| CAF_Study (SUIT_Application *theApp, Handle(TDocStd_Document)&aStdDoc) | |
| Constructor. | |
| virtual | ~CAF_Study () |
| Destructor. | |
| virtual bool | createDocument (const QString &) |
| Customize document initialization. | |
| virtual void | closeDocument (bool=true) |
| Close document. | |
| virtual bool | openDocument (const QString &) |
| Open document. | |
| virtual bool | saveDocumentAs (const QString &) |
| Save document with other name. | |
| bool | isSaved () const |
| Check if the study is saved. | |
| bool | isModified () const |
| Check if the study is modified. | |
| void | doModified (bool=true) |
| Increment modifications count. | |
| void | undoModified () |
| Decrement modifications count. | |
| void | clearModified () |
| Clear modifications count. | |
| bool | undo () |
| Undo the last command. | |
| bool | redo () |
| Redo the last undo. | |
| bool | canUndo () const |
| Check if it is possible to undo last command. | |
| bool | canRedo () const |
| Check if it is possible to redo last undo. | |
| QStringList | undoNames () const |
| Get names of available undo commands. | |
| QStringList | redoNames () const |
| Get names of available redo commands. | |
| Handle (TDocStd_Document) stdDoc() const | |
| virtual int | id () const |
| SUIT_DataObject * | root () const |
| virtual QString | studyName () const |
| SUIT_Application * | application () const |
| virtual void | Modified () |
| bool | saveDocument () |
| virtual void | update () |
| virtual void | sendChangesNotification () |
| SUIT_Operation * | activeOperation () const |
| virtual void | abortAllOperations () |
| const QList< SUIT_Operation * > & | operations () const |
| Get all started operations. | |
| virtual SUIT_Operation * | blockingOperation (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 Member Functions | |
| Handle (TDocStd_Application) stdApp() const | |
| CAF_Application * | cafApplication () const |
| Get application. | |
| virtual bool | openTransaction () |
| Open OCAF transaction. | |
| virtual bool | abortTransaction () |
| Abort OCAF transaction. | |
| virtual bool | hasTransaction () const |
| Check if there is any transaction opened. | |
| virtual bool | commitTransaction (const QString &=QString()) |
| Commit OCAF transaction. | |
| virtual void | setStdDoc (Handle(TDocStd_Document)&) |
| Set OCAF document. | |
| 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. | |
Private Member Functions | |
| Handle (TDocStd_Document) myStdDoc | |
Private Attributes | |
| int | myModifiedCnt |
Friends | |
| class | CAF_Operation |
A study contains reference to OCAF std document and allows using OCAF services. Provides necessary functionality for OCC transactions management.
| CAF_Study::CAF_Study | ( | SUIT_Application * | theApp | ) |
| theApp | application |
| CAF_Study::CAF_Study | ( | SUIT_Application * | theApp, |
| Handle(TDocStd_Document)& | aStdDoc | ||
| ) |
| theApp | application |
| aStdDoc | OCAF document |
| CAF_Study::~CAF_Study | ( | ) | [virtual] |
| bool CAF_Study::createDocument | ( | const QString & | doc | ) | [virtual] |
| doc | study name |
true on success and false on error Reimplemented from SUIT_Study.
References cafApplication().
| void CAF_Study::closeDocument | ( | bool | permanently = true | ) | [virtual] |
| permanently | if true, a document is closed permanently |
Reimplemented from SUIT_Study.
References Handle().
| bool CAF_Study::openDocument | ( | const QString & | fname | ) | [virtual] |
| fname | study file name |
true on success and false if document cannot be opened Reimplemented from SUIT_Study.
References Handle(), and CAF_Tools.toExtString().
| bool CAF_Study::saveDocumentAs | ( | const QString & | fname | ) | [virtual] |
| fname | study file name |
Reimplemented from SUIT_Study.
References Handle(), myModifiedCnt, CAF_Tools.toExtString(), and CAF_Tools.toQString().
| bool CAF_Study::isSaved | ( | ) | const [virtual] |
true if the document has been saved to file Reimplemented from SUIT_Study.
| bool CAF_Study::isModified | ( | ) | const [virtual] |
true if the document has been modified Reimplemented from SUIT_Study.
References myModifiedCnt.
| void CAF_Study::doModified | ( | bool | undoable = true | ) |
If undoable is true, this modification can be rolled back by undoModified(), otherwise the document will be marked as modified until it is saved.
| undoable | if true the operation is undoable |
References myModifiedCnt.
| void CAF_Study::undoModified | ( | ) |
References myModifiedCnt.
| void CAF_Study::clearModified | ( | ) |
References myModifiedCnt.
| bool CAF_Study::undo | ( | ) |
true on success and false on error References SUIT_Study.application(), SUIT_MessageBox.critical(), and undoModified().
| bool CAF_Study::redo | ( | ) |
true on success and false on error References SUIT_Study.application(), SUIT_MessageBox.critical(), and doModified().
| bool CAF_Study::canUndo | ( | ) | const |
true if undo is avaiable | bool CAF_Study::canRedo | ( | ) | const |
true if redo is avaiable | QStringList CAF_Study::undoNames | ( | ) | const |
References CAF_Tools.toQString().
| QStringList CAF_Study::redoNames | ( | ) | const |
References CAF_Tools.toQString().
| CAF_Study.Handle | ( | TDocStd_Document | ) | const |
| CAF_Study.Handle | ( | TDocStd_Application | ) | const [protected] |
| CAF_Application * CAF_Study::cafApplication | ( | ) | const [protected] |
References SUIT_Study.application().
| bool CAF_Study::openTransaction | ( | ) | [protected, virtual] |
true if transaction is opened successfully Reimplemented from SUIT_Study.
| bool CAF_Study::abortTransaction | ( | ) | [protected, virtual] |
true if transaction is aborted successfully Reimplemented from SUIT_Study.
References SUIT_Study.update().
| bool CAF_Study::hasTransaction | ( | ) | const [protected, virtual] |
true if there is opened OCAF transaction Reimplemented from SUIT_Study.
| bool CAF_Study::commitTransaction | ( | const QString & | name = QString() | ) | [protected, virtual] |
true if transaction is committed successfully Reimplemented from SUIT_Study.
References canUndo(), Handle(), and CAF_Tools.toExtString().
| void CAF_Study::setStdDoc | ( | Handle(TDocStd_Document)& | aStdDoc | ) | [protected, virtual] |
| aStdDoc | new OCAF document |
| CAF_Study.Handle | ( | TDocStd_Document | ) | [private] |
| int SUIT_Study::id | ( | ) | const [virtual, inherited] |
| SUIT_DataObject * SUIT_Study::root | ( | ) | const [inherited] |
| root | data object. |
References SUIT_Study.myRoot.
| QString SUIT_Study::studyName | ( | ) | const [virtual, inherited] |
| SUIT_Application * SUIT_Study::application | ( | ) | const [inherited] |
| 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().
| bool SUIT_Study::saveDocument | ( | ) | [inherited] |
| TRUE | - if document saved successful, else FALSE. |
Reimplemented in LightApp_Study, and SalomeApp_Study.
References SUIT_Study.myName, and SUIT_Study.saveDocumentAs().
| 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] |
| active | operation. |
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] |
References SUIT_Study.myOperations.
| SUIT_Operation * SUIT_Study::blockingOperation | ( | SUIT_Operation * | theOp | ) | const [virtual, inherited] |
| theOp | - operation to be checked |
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] |
| 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 |
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] |
| theOp | - operation to be aborted |
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] |
| theOp | - operation to be committed |
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] |
| theOp | - operation to be committed |
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] |
| theOp | - operation to be resumed |
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] |
Set root object.
References SUIT_Study.myRoot, PyInterp.obj, and SUIT_DataObject.reparentChildren().
| 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] |
friend class CAF_Operation [friend] |
int CAF_Study.myModifiedCnt [private] |