-
-}
-
-/*!
- * \brief Unique name of the operation
- *
- * Returns string name of the operation.
- */
-QString ModuleBase_Operation::operationId() const
-{
- return myOperationId;
-}
-
-/*!
- * \brief Gets state of operation
- * \return Value from OperationState enumeration
- *
- * Gets state of operation (see OperationState enumeration)
- */
-ModuleBase_Operation::OperationState ModuleBase_Operation::state() const
-{
- return myState;
-}
-
-/*!
- * \brief Verifies whether operation is an ran one (state()==Running)
- * \return TRUE if operation is active, FALSE otherwise
- *
- * Verifies whether operation is an running. Returns TRUE if state of operator
- * is Running
- */
-bool ModuleBase_Operation::isRunning() const
-{
- return state() == Running;
-}
-
-/*!
- * \brief Verifies whether given operator is valid for this one
- * \param theOtherOp - other operation
- * \return Returns TRUE if the given operator is valid for this one
- *
- * Verifies whether given operator is valid for this one (i.e. can be started "above"
- * this operator)
- */
-bool ModuleBase_Operation::isValid(ModuleBase_Operation*) const
-{
- return false;
-}
-
-/*!
- * \brief Verifies whether this operator can be always started above any already running one
- * \return Returns TRUE if current operation must not be checked for ActiveOperation->IsValid( this )
- *
- * This method must be redefined in derived operation if operation of derived class
- * must be always can start above any launched one. Default implementation returns FALSE,
- * so it is being checked for IsValid, but some operations may overload IsGranted()
- * In this case they will always start, no matter what operation is running.
- */
-bool ModuleBase_Operation::isGranted() const
-{
- return false;
-}
-
-/*
- * Returns pointer to the root document.
- */
-std::shared_ptr<ModelAPI_Document> ModuleBase_Operation::document() const
-{
- return ModelAPI_PluginManager::get()->rootDocument();
-}
-
-/*!
- * \brief Sets slot which is called when operation is started
- * \param theReceiver - object containing slot
- * \param theSlot - slot of theReceiver object
- * \return TR if slot was connected successfully, FALSE otherwise
- *
- * Sets slot which is called when operation is started. There is no point in
- * using this method. It would be better to inherit own operator from base
- * one and redefine startOperation method
- */
-bool ModuleBase_Operation::setSlot(const QObject* theReceiver, const char* theSlot)
-{
- return connect(this, SIGNAL(callSlot()), theReceiver, theSlot);
-}
-
-/*!
- * \brief Sets the flags of operation
- * \param f - flags of operation to be set
- *
- * Sets flags of operation (see Flags enumeration)
- */
-void ModuleBase_Operation::setFlags(const int f)
-{
- myFlags = myFlags | f;
-}
-
-/*!
- * \brief Clears the flags of operation
- * \param f - flags of operation to be cleared
- *
- * Clears flags of operation (see Flags enumeration)
- */
-void ModuleBase_Operation::clearFlags(const int f)
-{
- myFlags = myFlags & ~f;
-}
-
-/*!
- * \brief Test the flags of operation
- * \param f - flags of operation to be tested
- *
- * Returns TRUE if the specified flags set in the operation (see Flags enumeration)
- */
-bool ModuleBase_Operation::testFlags(const int f) const
-{
- return (myFlags & f) == f;