SHAPER  9.12.0
ModuleBase_Operation Class Reference

Base class for all operations. More...

Inheritance diagram for ModuleBase_Operation:
Inheritance graph

Public Slots

virtual bool start ()
 Starts operation Public slot. More...
 
virtual void postpone ()
 Deactivates current operation which can be resumed later. More...
 
virtual void resume ()
 Resumes operation Public slot. More...
 
virtual void abort ()
 Aborts operation Public slot. More...
 
virtual bool commit ()
 Commits operation Public slot. More...
 
void onValuesChanged ()
 Changes the modified flag of the operation. More...
 
void onValueStateChanged (int thePreviousState)
 Changes the modified flag of the operation if the current state of the widget is modified. More...
 

Signals

void beforeStarted ()
 The operation is started. More...
 
void started ()
 The operation is started. More...
 
void beforeAborted ()
 The operation is aborted. More...
 
void aborted ()
 The operation is aborted. More...
 
void beforeCommitted ()
 The operation is committed. More...
 
void committed ()
 The operation is committed. More...
 
void stopped ()
 The operation is aborted or committed. More...
 
void resumed ()
 The operation is resumed. More...
 
void postponed ()
 The operation is postponed. More...
 

Public Member Functions

 ModuleBase_Operation (const QString &theId="", QObject *theParent=0)
 Constructor. More...
 
virtual ~ModuleBase_Operation ()
 Destructor. More...
 
ModuleBase_OperationDescriptiongetDescription () const
 Returns the operation description /returns the instance of the description class. More...
 
const QStringList & grantedOperationIds () const
 Returns list of granted operation indices. More...
 
void setGrantedOperationIds (const QStringList &theList)
 Sets list of operation indices, which can be started without the current operation stop. More...
 
virtual bool isGranted (QString theId) const
 Must return true if this operation can be launched as nested for any current operation and it is not necessary to check this operation on validity. More...
 
virtual bool isModified () const
 Returns True if data of its feature was modified during operation. More...
 
QString id () const
 Returns operations Id from it's description. More...
 
virtual bool isValid () const
 Must return True if the operation's feature is valid. More...
 
virtual void setPropertyPanel (ModuleBase_IPropertyPanel *theProp)
 Set property pane to the operation. More...
 
ModuleBase_IPropertyPanelpropertyPanel () const
 
QString helpFileName () const
 
void setHelpFileName (QString theName)
 
void setHideFacesVisible (bool isVisible)
 
bool isHideFacesVisible () const
 

Protected Member Functions

virtual void startOperation ()
 Virtual method called when operation started (see start() method for more description) Default impl calls corresponding slot and commits immediately. More...
 
virtual void postponeOperation ()
 Implementation of specific steps on postpone operation. More...
 
virtual void stopOperation ()
 Virtual method called when operation stopped - committed or aborted. More...
 
virtual void abortOperation ()
 Virtual method called when operation aborted (see abort() method for more description) More...
 
virtual void commitOperation ()
 Virtual method called when operation committed (see commit() method for more description) More...
 
virtual void afterCommitOperation ()
 Virtual method called after operation committed (see commit() method for more description) More...
 
virtual void resumeOperation ()
 Virtual method called after operation resume (see resume() method for more description) More...
 
virtual bool canBeCommitted () const
 Verifies whether this operator can be commited. More...
 

Detailed Description

Base class for all operations.

Base class for all operations. If you perform an action it is reasonable to create operation intended for this. This is a base class for all operations which provides mechanism for correct starting operations, starting operations above already started ones, committing operations and so on. To create own operation it is reasonable to inherit it from this class and redefines virtual methods to provide own behavior Main virtual methods are

Constructor & Destructor Documentation

◆ ModuleBase_Operation()

ModuleBase_Operation::ModuleBase_Operation ( const QString &  theId = "",
QObject theParent = 0 
)

Constructor.

Parameters
theIdthe operation identifier
theParentthe QObject parent

◆ ~ModuleBase_Operation()

ModuleBase_Operation::~ModuleBase_Operation ( )
virtual

Destructor.

Member Function Documentation

◆ getDescription()

ModuleBase_OperationDescription* ModuleBase_Operation::getDescription ( ) const
inline

Returns the operation description /returns the instance of the description class.

◆ grantedOperationIds()

const QStringList & ModuleBase_Operation::grantedOperationIds ( ) const

Returns list of granted operation indices.

◆ setGrantedOperationIds()

void ModuleBase_Operation::setGrantedOperationIds ( const QStringList &  theList)

Sets list of operation indices, which can be started without the current operation stop.

Parameters
theListan ids

◆ isGranted()

bool ModuleBase_Operation::isGranted ( QString  theId) const
virtual

Must return true if this operation can be launched as nested for any current operation and it is not necessary to check this operation on validity.

By default the operation is not granted. The method has to be redefined for granted operations.

◆ isModified()

bool ModuleBase_Operation::isModified ( ) const
virtual

Returns True if data of its feature was modified during operation.

◆ id()

QString ModuleBase_Operation::id ( ) const

Returns operations Id from it's description.

◆ isValid()

bool ModuleBase_Operation::isValid ( ) const
virtual

Must return True if the operation's feature is valid.

Since IOperation does not have any feature returns false.

Reimplemented in ModuleBase_OperationFeature.

◆ setPropertyPanel()

void ModuleBase_Operation::setPropertyPanel ( ModuleBase_IPropertyPanel theProp)
virtual

Set property pane to the operation.

Parameters
thePropa property panel instance

Reimplemented in ModuleBase_OperationFeature.

◆ propertyPanel()

ModuleBase_IPropertyPanel* ModuleBase_Operation::propertyPanel ( ) const
inline
Returns
Currently installed property panel

◆ beforeStarted

void ModuleBase_Operation::beforeStarted ( )
signal

The operation is started.

◆ started

void ModuleBase_Operation::started ( )
signal

The operation is started.

◆ beforeAborted

void ModuleBase_Operation::beforeAborted ( )
signal

The operation is aborted.

◆ aborted

void ModuleBase_Operation::aborted ( )
signal

The operation is aborted.

◆ beforeCommitted

void ModuleBase_Operation::beforeCommitted ( )
signal

The operation is committed.

◆ committed

void ModuleBase_Operation::committed ( )
signal

The operation is committed.

◆ stopped

void ModuleBase_Operation::stopped ( )
signal

The operation is aborted or committed.

◆ resumed

void ModuleBase_Operation::resumed ( )
signal

The operation is resumed.

◆ postponed

void ModuleBase_Operation::postponed ( )
signal

The operation is postponed.

◆ start

bool ModuleBase_Operation::start ( )
virtualslot

Starts operation Public slot.

Verifies whether operation can be started and starts operation. This slot is not virtual and cannot be redefined. Redefine startOperation method to change behavior of operation. There is no point in using this method. It would be better to inherit own operator from base one and redefine startOperation method instead.

Returns
true if the start is successful

◆ postpone

void ModuleBase_Operation::postpone ( )
virtualslot

Deactivates current operation which can be resumed later.

◆ resume

void ModuleBase_Operation::resume ( )
virtualslot

Resumes operation Public slot.

Verifies whether operation can be started and starts operation. This slot is not virtual and cannot be redefined. Redefine startOperation method to change behavior of operation. There is no point in using this method. It would be better to inherit own operator from base one and redefine startOperation method instead.

◆ abort

void ModuleBase_Operation::abort ( )
virtualslot

Aborts operation Public slot.

Aborts operation. This slot is not virtual and cannot be redefined. Redefine abortOperation method to change behavior of operation instead

◆ commit

bool ModuleBase_Operation::commit ( )
virtualslot

Commits operation Public slot.

Commits operation. This slot is not virtual and cannot be redefined. Redefine commitOperation method to change behavior of operation instead

◆ onValuesChanged

void ModuleBase_Operation::onValuesChanged ( )
slot

Changes the modified flag of the operation.

◆ onValueStateChanged

void ModuleBase_Operation::onValueStateChanged ( int  thePreviousState)
slot

Changes the modified flag of the operation if the current state of the widget is modified.

Parameters
thePreviousStatethe previous vlaue state of the widget

◆ startOperation()

virtual void ModuleBase_Operation::startOperation ( )
inlineprotectedvirtual

Virtual method called when operation started (see start() method for more description) Default impl calls corresponding slot and commits immediately.

Reimplemented in ModuleBase_OperationFeature.

◆ postponeOperation()

virtual void ModuleBase_Operation::postponeOperation ( )
inlineprotectedvirtual

Implementation of specific steps on postpone operation.

◆ stopOperation()

virtual void ModuleBase_Operation::stopOperation ( )
inlineprotectedvirtual

Virtual method called when operation stopped - committed or aborted.

Reimplemented in ModuleBase_OperationFeature.

◆ abortOperation()

virtual void ModuleBase_Operation::abortOperation ( )
inlineprotectedvirtual

Virtual method called when operation aborted (see abort() method for more description)

◆ commitOperation()

virtual void ModuleBase_Operation::commitOperation ( )
inlineprotectedvirtual

Virtual method called when operation committed (see commit() method for more description)

◆ afterCommitOperation()

virtual void ModuleBase_Operation::afterCommitOperation ( )
inlineprotectedvirtual

Virtual method called after operation committed (see commit() method for more description)

◆ resumeOperation()

virtual void ModuleBase_Operation::resumeOperation ( )
inlineprotectedvirtual

Virtual method called after operation resume (see resume() method for more description)

Reimplemented in ModuleBase_OperationFeature.

◆ canBeCommitted()

bool ModuleBase_Operation::canBeCommitted ( ) const
protectedvirtual

Verifies whether this operator can be commited.

Returns
Returns TRUE if current operation can be committed, e.g. all parameters are filled