+ FeaturePtr feature() const;
+
+ /**
+ * Must return True if the operation's feature is valid.
+ * Since IOperation does not have any feature returns false.
+ */
+ virtual bool isValid() const;
+
+ /// Returns whether the nested operations are enabled.
+ /// The state can depend on the operation current state.
+ /// \return enabled state
+ virtual bool isNestedOperationsEnabled() const;
+
+ /// Sets the operation feature
+ void setFeature(FeaturePtr theFeature);
+
+ /// Returns True if the current operation works with the given object (feature or result)
+ virtual bool hasObject(ObjectPtr theObj) const;
+
+ //virtual void keyReleased(const int theKey) {};
+
+ /// If operation needs to redisplay its result during operation
+ /// then this method has to return True
+ //virtual bool hasPreview() const { return false; }
+
+ /// Initialisation of operation with preliminary selection
+ /// \param theSelected the list of selected presentations
+ /// \param theHighlighted the list of highlighted presentations
+ /// \param theViewer a viewer to have the viewer the eye position
+ virtual void initSelection(ModuleBase_ISelection* theSelection,
+ ModuleBase_IViewer* /* theViewer*/);
+
+ virtual void setPropertyPanel(ModuleBase_IPropertyPanel* theProp);
+
+ ModuleBase_IPropertyPanel* propertyPanel() const { return myPropertyPanel; }
+
+ /// Activates widgets by preselection if it is accepted
+ virtual bool activateByPreselection();
+
+ /// If the operation works with feature which is sub-feature of another one
+ /// then this variable has to be initialised by parent feature
+ /// before operation feature creating
+ void setParentFeature(CompositeFeaturePtr theParent) { myParentFeature = theParent; }
+ CompositeFeaturePtr parentFeature() const { return myParentFeature; }
+
+signals:
+ void started(); /// the operation is started
+ void aborted(); /// the operation is aborted
+ void committed(); /// the operation is committed
+ void stopped(); /// the operation is aborted or committed
+ void resumed(); /// the operation is resumed
+ void postponed(); /// the operation is postponed
+
+ public slots:
+ /// 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.
+ void start();
+
+ /// Deactivates current operation which can be resumed later.
+ void postpone();
+
+ /// 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.
+ void resume();
+
+ /// Aborts operation
+ /// Public slot. Aborts operation. This slot is not virtual and cannot be redefined.
+ /// Redefine abortOperation method to change behavior of operation instead
+ void abort();
+
+ /// Commits operation
+ /// Public slot. Commits operation. This slot is not virtual and cannot be redefined.
+ /// Redefine commitOperation method to change behavior of operation instead
+ bool commit();
+
+ /// Alias for start/abort slots
+ /// Public slot. Aborts operation if false, else does nothing.
+ /// Provided for S/S compatibility with QAction's toggle(bool)
+ /// \param theState th flag to abort, if it is true, do nothing, overwise abort
+ void setRunning(bool theState);