X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationSketchBase.h;h=62de3116be461513ee152639edc724378ec645e6;hb=7de345ac623f20ab2f2e3405066c75c86f8e662a;hp=7ca7fd2d3ac30aa4a1cfaf37ad690c4fe6cdcb99;hpb=d4572a0253007ff9fc263253720e37bf896f8d0d;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationSketchBase.h b/src/PartSet/PartSet_OperationSketchBase.h index 7ca7fd2d3..62de3116b 100644 --- a/src/PartSet/PartSet_OperationSketchBase.h +++ b/src/PartSet/PartSet_OperationSketchBase.h @@ -8,19 +8,31 @@ #include "PartSet.h" #include +#include #include -#include +#include +#include #include +#include + +class Handle_V3d_View; +class QMouseEvent; +class GeomAPI_Shape; +class XGUI_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_EXPORT PartSet_OperationSketchBase : public ModuleBase_PropPanelOperation +class PARTSET_EXPORT PartSet_OperationSketchBase : public ModuleBase_Operation { Q_OBJECT +public: + enum FeatureActionMode { FM_Activation, FM_Deactivation, FM_Abort }; + public: /// Constructor /// \param theId an feature index @@ -30,18 +42,74 @@ public: virtual ~PartSet_OperationSketchBase(); /// Returns the feature preview shape - const TopoDS_Shape& preview() const; + /// \param theFeature the feature object to obtain the preview + boost::shared_ptr preview(boost::shared_ptr theFeature) const; + + /// 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; /// Returns the operation local selection mode + /// \param theFeature the feature object to get the selection mode /// \return the selection mode - virtual int getSelectionMode() const = 0; + virtual std::list getSelectionModes(boost::shared_ptr theFeature) const = 0; + + /// 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) {} - /// Gives the current selected objects to be processed by the operation - /// \param a list of interactive selected objects - virtual void setSelectedShapes(const NCollection_List& theList) = 0; + /// Processes the mouse pressed in the point + /// \param thePoint a point clicked in the viewer + /// \param theEvent the mouse event + /// \param theSelected the list of selected presentations + virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, + const std::list& theSelected); + + /// Processes the mouse release in the point + /// \param thePoint a point clicked in the viewer + /// \param theEvent the mouse event + /// \param theSelected the list of selected presentations + virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, + const std::list& theSelected); + + /// Processes the mouse move in the point + /// \param thePoint a 3D point clicked in the viewer + /// \param theEvent the mouse event + virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView); + + /// Processes the key pressed in the view + /// \param theKey a key value + virtual void keyReleased(const int theKey) {}; signals: - void viewerProjectionChange(double theX, double theY, double theZ); + /// 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, + 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); + + /// signal to enable/disable usual selection in the viewer + /// \param theEnabled the boolean state + void selectionEnabled(bool theEnabled); + +protected: + /// Creates an operation new feature + /// In addition to the default realization it appends the created line feature to + /// the sketch feature + /// \returns the created feature + virtual boost::shared_ptr createFeature(); }; #endif