|
SHAPER
9.15.0
|
Operation manager. More...

Public Types | |
| enum | XGUI_MessageKind { XGUI_AbortOperationMessage , XGUI_InformationMessage } |
| Enumeration of kind of message that is used when trying to stop the active operation. More... | |
Public Slots | |
| void | onAbortOperation () |
| Slot that aborts the current operation. More... | |
| void | onAbortAllOperation () |
| Slot that aborts all operations. It shows aborting message. More... | |
| void | onValidateOperation () |
| Slot that validates the current operation using the validateOperation method. More... | |
| bool | commitAllOperations () |
| Commit all operations. More... | |
| bool | onKeyReleased (QObject *theObject, QKeyEvent *theEvent) |
| SLOT, that is called by the key in the property panel is clicked. More... | |
| bool | onKeyPressed (QObject *theObject, QKeyEvent *theEvent) |
| SLOT, that is called by the key in the property panel is clicked. More... | |
| bool | onProcessDelete (QObject *theObject) |
| The functionality that should be done by hitting delete Firstly the active widget processes it, then workshop. More... | |
Signals | |
| void | operationStopped (ModuleBase_Operation *theOperation) |
| Signal about an operation is stopped. More... | |
| void | operationResumed (ModuleBase_Operation *theOperation) |
| Signal about an operation is resumed. It is emitted after the resume() of operation is done. More... | |
| void | operationCommitted (ModuleBase_Operation *theOperation) |
| Emitted when current operation is Committed. More... | |
| void | operationAborted (ModuleBase_Operation *theOperation) |
| Emitted when current operation is aborted. More... | |
| void | keyEnterReleased () |
| Signal is emitted after the key released click. More... | |
Public Member Functions | |
| XGUI_OperationMgr (QObject *theParent, ModuleBase_IWorkshop *theWorkshop) | |
| Constructor. More... | |
| virtual | ~XGUI_OperationMgr () |
| Destructor. More... | |
| void | activate () |
| Switch on short cut listener. More... | |
| void | deactivate () |
| Switch off short cut listener. More... | |
| void | setWorkshop (ModuleBase_IWorkshop *theWorkshop) |
| Set reference to workshop. More... | |
| ModuleBase_IWorkshop * | workshop () const |
| Current workshop. More... | |
| XGUI_Workshop * | xworkshop () const |
| Current workshop. More... | |
| ModuleBase_Operation * | currentOperation () const |
| Returns the current operation or NULL. More... | |
| bool | isCurrentOperation (ModuleBase_Operation *theOperation) |
| Check if the given operation is active operation. More... | |
| bool | hasOperation () const |
| Returns true is operation manager has at least one non-null operation. More... | |
| bool | hasOperation (const QString &theId) const |
| Returns true is operation manager has an operation with given Id. More... | |
| bool | canStopOperation (ModuleBase_Operation *theOperation, const XGUI_MessageKind &theMessageKind=XGUI_AbortOperationMessage) |
| Returns true if the operation can be aborted. More... | |
| ModuleBase_Operation * | findOperation (const QString &theId) const |
| Find and return operation by its Id. More... | |
| int | operationsCount () const |
| Returns number of operations in the stack. More... | |
| QStringList | operationList () const |
| Returns list of all operations IDs. More... | |
| ModuleBase_Operation * | previousOperation (ModuleBase_Operation *theOperation) const |
| Returns previous (parent) operation if given operation started. More... | |
| ModuleBase_ModelWidget * | activeWidget () const |
| Returns an active widget of the current operation. More... | |
| bool | startOperation (ModuleBase_Operation *theOperation) |
| Start the operation and append it to the stack of operations. More... | |
| bool | canStartOperation (const QString &theId, bool &isCommitted) |
| Returns whether the operation can be started. More... | |
| void | stopOperation (ModuleBase_Operation *theOperation, bool &isCommitted) |
| If Apply is enabled and operation has modification, it is applied, otherwise aborted. More... | |
| void | abortOperation (ModuleBase_Operation *theOperation) |
| Aborts the parameter operation if it is current, else abort operations from the stack of operations until the operation is found. More... | |
| bool | abortAllOperations (const XGUI_MessageKind &theMessageKind=XGUI_AbortOperationMessage) |
| Abort all operations. More... | |
| bool | commitOperation () |
| Commits the current operation. More... | |
| void | setSHIFTPressed (const bool thePressed) |
| Returns true if SHIFT is pressed. More... | |
| bool | hasSHIFTPressed () const |
| Returns true if SHIFT is pressed. More... | |
| void | updateApplyOfOperations (ModuleBase_Operation *theOperation=0) |
| Emits nestedStateChange for operations with an information about validity of the operation. More... | |
Protected Slots | |
| bool | onProcessEnter (QObject *theObject) |
| The functionality that should be done by hitting enter Firstly the active widget processes it, then module. More... | |
| void | onOperationStopped () |
| Slot that is called by an operation stop. More... | |
| void | onBeforeOperationStarted () |
| Slot called before operation started. More... | |
| void | onOperationStarted () |
| Slot called after operation started. More... | |
| void | onBeforeOperationAborted () |
| Slot called before operation aborted. Restore the previous current operation. More... | |
| void | onOperationAborted () |
| Slot called after operation aborted. More... | |
| void | onBeforeOperationCommitted () |
| Slot called before operation committed. Restore the previous current operation. More... | |
| void | onOperationCommitted () |
| Slot called after operation committed. More... | |
| void | onOperationResumed () |
| Slot called on operation resume. More... | |
Protected Member Functions | |
| void | resumeOperation (ModuleBase_Operation *theOperation) |
| Sets the current operation or NULL. More... | |
| bool | isGrantedOperation (const QString &theId) |
| Returns whether the parameter operation is granted in relation to the previous operation in a stack of started operations. More... | |
| void | setCurrentFeature (const FeaturePtr &theFeature) |
| Sets the feature as a current in the document. More... | |
Operation manager.
Servers to manipulate to the workshop operations. Contains a stack of started operations. In simple case, if only one operation is started, the stack contains one operation. It is possible for some kind of operations to start them above already started one. In that case, the previous active operation becomes suspended, a new one - active. The new operation is added to the top of the stack. Then it is finished, it is removed from the stack and the previous operation is activated.
| XGUI_OperationMgr::XGUI_OperationMgr | ( | QObject * | theParent, |
| ModuleBase_IWorkshop * | theWorkshop | ||
| ) |
Constructor.
| theParent | the parent |
| theWorkshop | a reference to workshop |
we need to install filter to the application in order to react to 'Delete' key button this key can not be a short cut for a corresponded action because we need to set the actions priority
|
virtual |
Destructor.
| void XGUI_OperationMgr::activate | ( | ) |
Switch on short cut listener.
| void XGUI_OperationMgr::deactivate | ( | ) |
Switch off short cut listener.
|
inline |
Set reference to workshop.
| theWorkshop | reference to workshop |
|
inline |
Current workshop.
| XGUI_Workshop * XGUI_OperationMgr::xworkshop | ( | ) | const |
Current workshop.
| ModuleBase_Operation * XGUI_OperationMgr::currentOperation | ( | ) | const |
Returns the current operation or NULL.
| bool XGUI_OperationMgr::isCurrentOperation | ( | ModuleBase_Operation * | theOperation | ) |
Check if the given operation is active operation.
Also, returns false is ther is no active operation.
| bool XGUI_OperationMgr::hasOperation | ( | ) | const |
Returns true is operation manager has at least one non-null operation.
| bool XGUI_OperationMgr::hasOperation | ( | const QString & | theId | ) | const |
Returns true is operation manager has an operation with given Id.
| bool XGUI_OperationMgr::canStopOperation | ( | ModuleBase_Operation * | theOperation, |
| const XGUI_MessageKind & | theMessageKind = XGUI_AbortOperationMessage |
||
| ) |
Returns true if the operation can be aborted.
If the operation is modified, the warning message box is shown.
| theOperation | an operation which is checked on stop |
| theMessageKind | a kind of message in warning message box |
| ModuleBase_Operation * XGUI_OperationMgr::findOperation | ( | const QString & | theId | ) | const |
Find and return operation by its Id.
| int XGUI_OperationMgr::operationsCount | ( | ) | const |
Returns number of operations in the stack.
| QStringList XGUI_OperationMgr::operationList | ( | ) | const |
Returns list of all operations IDs.
| ModuleBase_Operation * XGUI_OperationMgr::previousOperation | ( | ModuleBase_Operation * | theOperation | ) | const |
Returns previous (parent) operation if given operation started.
else, or if there is no parent - returns NULL
| ModuleBase_ModelWidget * XGUI_OperationMgr::activeWidget | ( | ) | const |
Returns an active widget of the current operation.
| bool XGUI_OperationMgr::startOperation | ( | ModuleBase_Operation * | theOperation | ) |
Start the operation and append it to the stack of operations.
| theOperation | the started operation |
| bool XGUI_OperationMgr::canStartOperation | ( | const QString & | theId, |
| bool & | isCommitted | ||
| ) |
Returns whether the operation can be started.
Check if there is already started operation and the granted parameter of the launched operation
| theId | id of the operation which is going to start |
| isCommitted | boolean value if the operation was committed otherwise it was aborted |
| void XGUI_OperationMgr::stopOperation | ( | ModuleBase_Operation * | theOperation, |
| bool & | isCommitted | ||
| ) |
If Apply is enabled and operation has modification, it is applied, otherwise aborted.
| theOperation | the started operation |
| isCommitted | boolean value if the operation was committed otherwise it was aborted |
| void XGUI_OperationMgr::abortOperation | ( | ModuleBase_Operation * | theOperation | ) |
Aborts the parameter operation if it is current, else abort operations from the stack of operations until the operation is found.
All operations upper the parameter one are not aborted.
| theOperation | an aborted operation |
| bool XGUI_OperationMgr::abortAllOperations | ( | const XGUI_MessageKind & | theMessageKind = XGUI_AbortOperationMessage | ) |
Abort all operations.
| theMessageKind | kind of shown warning message |
| bool XGUI_OperationMgr::commitOperation | ( | ) |
Commits the current operation.
|
inline |
Returns true if SHIFT is pressed.
| thePressed | new boolean state |
|
inline |
Returns true if SHIFT is pressed.
|
slot |
Slot that aborts the current operation.
|
slot |
Slot that aborts all operations. It shows aborting message.
|
slot |
Slot that validates the current operation using the validateOperation method.
|
slot |
Commit all operations.
|
signal |
Signal about an operation is stopped.
It is emitted after the stop() of operation is done.
| theOperation | a stopped operation |
|
signal |
Signal about an operation is resumed. It is emitted after the resume() of operation is done.
|
signal |
Emitted when current operation is Committed.
|
signal |
Emitted when current operation is aborted.
|
signal |
Signal is emitted after the key released click.
| void XGUI_OperationMgr::updateApplyOfOperations | ( | ModuleBase_Operation * | theOperation = 0 | ) |
Emits nestedStateChange for operations with an information about validity of the operation.
| theOperation | the sent operation. If it is NULL, all operations in the stack are sent. |
|
protected |
Sets the current operation or NULL.
| theOperation | the started operation |
|
protected |
Returns whether the parameter operation is granted in relation to the previous operation in a stack of started operations.
It is used in canStopOperation to avoid warning message when granted operation is aborted, e.g. SketchLine in Sketch
| theId | id of the operation which is checked |
|
protected |
Sets the feature as a current in the document.
| theFeature | a feature |
|
slot |
SLOT, that is called by the key in the property panel is clicked.
| theObject | a sender of the event |
| theEvent | the mouse event |
|
slot |
SLOT, that is called by the key in the property panel is clicked.
| theObject | a sender of the event |
| theEvent | the mouse event |
|
slot |
The functionality that should be done by hitting delete Firstly the active widget processes it, then workshop.
If no one does not process it, do nothing
| theObject | a sender of the event |
other widgets such as line edit controls should not lead to processing delete by workshop
Line Edit of Rename operation in ObjectBrowser
|
protectedslot |
The functionality that should be done by hitting enter Firstly the active widget processes it, then module.
If no one does not process it, the current operation is committed
| theObject | a sender of the event |
functionality is similar to Apply click
|
protectedslot |
Slot that is called by an operation stop.
Removes the stopped operation form the stack. If there is a suspended operation, restart it.
|
protectedslot |
Slot called before operation started.
Stores the previous current feature, set the feature of the operation as a current in the document. The previous current feature should be restored by the operation abort/commit
Set current feature and remember old current feature
|
protectedslot |
Slot called after operation started.
|
protectedslot |
Slot called before operation aborted. Restore the previous current operation.
|
protectedslot |
Slot called after operation aborted.
|
protectedslot |
Slot called before operation committed. Restore the previous current operation.
Restore the previous current feature
Restore the previous current feature
|
protectedslot |
Slot called after operation committed.
|
protectedslot |
Slot called on operation resume.