X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationSketchBase.h;h=f5caebdbf968649f550e7a8b2e6c4054890d0e38;hb=f92ef94e9723207fc5b8421f4644e281c5e69d42;hp=d8154f86c247344ad21065c450540dcf7b005780;hpb=41de4f29b4e60b4c733ebd5452296e9849b3e60b;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationSketchBase.h b/src/PartSet/PartSet_OperationSketchBase.h index d8154f86c..f5caebdbf 100644 --- a/src/PartSet/PartSet_OperationSketchBase.h +++ b/src/PartSet/PartSet_OperationSketchBase.h @@ -13,6 +13,9 @@ #include #include + +#include + #include #include @@ -31,7 +34,7 @@ class PARTSET_EXPORT PartSet_OperationSketchBase : public ModuleBase_Operation { Q_OBJECT public: - enum FeatureActionMode { FM_Activation, FM_Deactivation, FM_Abort }; + enum FeatureActionMode { FM_Activation, FM_Deactivation, FM_Hide }; public: /// Constructor @@ -43,59 +46,88 @@ public: /// Returns the feature preview shape /// \param theFeature the feature object to obtain the preview - boost::shared_ptr preview(boost::shared_ptr theFeature) const; + static boost::shared_ptr preview(FeaturePtr theFeature); /// Returns the map of the operation previews including the nested feature previews /// \return the map of feature to the feature preview - virtual std::map, boost::shared_ptr > preview() const; + virtual std::map > subPreview() 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(boost::shared_ptr theFeature) const = 0; + virtual std::list getSelectionModes(FeaturePtr 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) {} - /// Initializes some fields accorging to the feature - /// \param theFeature the feature - /// \param thePresentations the list of additional presentations - virtual void init(boost::shared_ptr theFeature, - const std::list& thePresentations) {} + /// Returns the operation sketch feature + /// \returns the sketch instance + virtual FeaturePtr sketch() const = 0; /// Processes the mouse pressed in the point - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); /// Processes the mouse release in the point - /// \param thePoint a point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position /// \param theSelected the list of selected presentations + /// \param theHighlighted the list of highlighted presentations virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected); + const std::list& theSelected, + const std::list& theHighlighted); /// Processes the mouse move in the point - /// \param thePoint a 3D point clicked in the viewer /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView); + /// Processes the mouse double click in the point + /// \param theEvent the mouse event + /// \param theView a viewer to have the viewer the eye position + /// \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(const int theKey); + + virtual void keyReleased(std::string theName, QKeyEvent* theEvent); + + /// 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, + FeaturePtr theFeature = FeaturePtr()); signals: + /// signal about the request to launch operation + /// theName the operation name + /// theFeature the operation argument + void launchOperation(std::string theName, FeaturePtr theFeature); /// Signal about the feature construing is finished /// \param theFeature the result feature /// \param theMode the mode of the feature modification - void featureConstructed(boost::shared_ptr theFeature, + void featureConstructed(FeaturePtr theFeature, int theMode); /// Signal about the features should be selected /// \param theSelected the list of selected presentations void featureSelected(const std::list& theSelected); - /// signal about the request to launch operation - /// theName the operation name - /// theFeature the operation argument - void launchOperation(std::string theName, boost::shared_ptr theFeature); /// signal to enable/disable multi selection in the viewer /// \param theEnabled the boolean state void multiSelectionEnabled(bool theEnabled); @@ -103,20 +135,21 @@ signals: /// signal to enable/disable selection in the viewer /// \param theFeatures a list of features to be disabled /// \param theToStop the boolean state whether it it stopped or non stopped - /// \param isToSelect the boolean state whether the features should be selected - void stopSelection(const std::list& theFeatures, const bool theToStop, - const bool isToSelect); + void stopSelection(const QFeatureList& theFeatures, const bool theToStop); + /// signal to set selection in the viewer + /// \param theFeatures a list of features to be disabled + void setSelection(const QFeatureList& theFeatures); - /// signal to enable/disable usual selection in the viewer - /// \param theEnabled the boolean state - void selectionEnabled(bool theEnabled); + /// signal to close the operation local context if it is opened + void closeLocalContext(); 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 boost::shared_ptr createFeature(); + virtual FeaturePtr createFeature(const bool theFlushMessage = true); }; #endif