X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationSketchBase.h;h=c7d639348f858daae620f6403558e1f81e3f17a6;hb=43780ffac779af7f061513b0f6243f2edb73602c;hp=caae337a73894df0e2f689083d37450c390ce773;hpb=d3b42dea410986c9fa81711e5cf0b0e18bbf6d6a;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationSketchBase.h b/src/PartSet/PartSet_OperationSketchBase.h index caae337a7..c7d639348 100644 --- a/src/PartSet/PartSet_OperationSketchBase.h +++ b/src/PartSet/PartSet_OperationSketchBase.h @@ -29,17 +29,22 @@ class GeomAPI_Shape; class ModuleBase_ViewerPrs; /*! - \class PartSet_OperationSketchBase - * \brief The base operation for the sketch features. - * Base class for all sketch operations. It provides an access to the feature preview -*/ + \class PartSet_OperationSketchBase + * \brief The base operation for the sketch features. + * Base class for all sketch operations. It provides an access to the feature preview + */ class PARTSET_EXPORT PartSet_OperationSketchBase : public ModuleBase_Operation { - Q_OBJECT -public: - enum FeatureActionMode { FM_Activation, FM_Deactivation, FM_Hide }; - -public: +Q_OBJECT + public: + enum FeatureActionMode + { + FM_Activation, + FM_Deactivation, + FM_Hide + }; + + public: /// Constructor /// \param theId an feature index /// \param theParent the object parent @@ -55,23 +60,9 @@ public: /// \return the list of subfeatures virtual std::list subFeatures() const; - /// Returns the operation local selection mode - /// \param theFeature the feature object to get the selection mode - /// \return the selection mode - virtual std::list getSelectionModes(ObjectPtr theFeature) const; - - /// Initializes the operation with previously created feature. It is used in sequental operations - virtual void initFeature(FeaturePtr theFeature) {} - - /// Initialisation of operation with preliminary selection - /// \param theSelected the list of selected presentations - /// \param theHighlighted the list of highlighted presentations - virtual void initSelection(const std::list& theSelected, - const std::list& theHighlighted) {} - /// Returns the operation sketch feature /// \returns the sketch instance - virtual FeaturePtr sketch() const = 0; + virtual CompositeFeaturePtr sketch() const = 0; /// Processes the mouse pressed in the point /// \param theEvent the mouse event @@ -102,28 +93,25 @@ public: /// \param theSelected the list of selected presentations /// \param theHighlighted the list of highlighted presentations virtual void mouseDoubleClick(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected, - const std::list& theHighlighted); - - /// Processes the key pressed in the view - /// \param theKey a key value - virtual void keyReleased(const int theKey); - - virtual void keyReleased(std::string theName, QKeyEvent* theEvent); + const std::list& theSelected, + const std::list& theHighlighted); /// Emits a signal about the operation start. This signal has an information about the feature. /// If the provided feature is empty, the current operation feature is used. /// \param theType a type of an operation started /// theFeature the operation argument - void restartOperation(const std::string& theType, - ObjectPtr theFeature = ObjectPtr()); + void restartOperation(const std::string& theType, ObjectPtr theFeature = ObjectPtr()); + + /// If operation needs to redisplay its result during operation + /// then this method has to return True + virtual bool hasPreview() const { return true; } signals: /// signal about the request to launch operation /// theName the operation name /// theFeature the operation argument - void launchOperation(std::string theName, ObjectPtr theFeature); - + void restartRequired(std::string theName, ObjectPtr theFeature); + /// Signal about the feature construing is finished /// \param theFeature the result feature /// \param theMode the mode of the feature modification @@ -132,7 +120,7 @@ signals: /// Signal about the features should be selected /// \param theSelected the list of selected presentations void featureSelected(const std::list& theSelected); - + /// signal to enable/disable multi selection in the viewer /// \param theEnabled the boolean state void multiSelectionEnabled(bool theEnabled); @@ -141,21 +129,21 @@ signals: /// \param theFeatures a list of features to be disabled /// \param theToStop the boolean state whether it it stopped or non stopped void stopSelection(const QList& theFeatures, const bool theToStop); - + /// signal to set selection in the viewer /// \param theFeatures a list of features to be disabled void setSelection(const QList& theFeatures); - /// signal to close the operation local context if it is opened - void closeLocalContext(); - -protected: + protected: /// Creates an operation new feature /// In addition to the default realization it appends the created line feature to /// the sketch feature /// \param theFlushMessage the flag whether the create message should be flushed /// \returns the created feature virtual FeaturePtr createFeature(const bool theFlushMessage = true); + + /// Activates widgets by preselection if it is accepted + virtual void activateByPreselection(); }; #endif