]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_OperationSketch.h
Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / PartSet / PartSet_OperationSketch.h
1 // File:        PartSet_OperationSketch.h
2 // Created:     20 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef PartSet_OperationSketch_H
6 #define PartSet_OperationSketch_H
7
8 #include "PartSet.h"
9
10 #include <PartSet_OperationSketchBase.h>
11 #include <QObject>
12
13 /*!
14  \class PartSet_OperationSketch
15  * \brief The operation for the sketch feature creation
16 */
17 class PARTSET_EXPORT PartSet_OperationSketch : public PartSet_OperationSketchBase
18 {
19   Q_OBJECT
20 public:
21   /// Returns the operation type key
22   static std::string Type() { return "Sketch"; }
23
24 public:
25   /// Constructor
26   /// \param theId the feature identifier
27   /// \param theParent the operation parent
28   PartSet_OperationSketch(const QString& theId, QObject* theParent);
29   /// Destructor
30   virtual ~PartSet_OperationSketch();
31
32   /// Returns the operation local selection mode
33   /// \param theFeature the feature object to get the selection mode
34   /// \return the selection mode
35   virtual std::list<int> getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
36
37   /// Processes the mouse pressed in the point
38   /// \param thePoint a point clicked in the viewer
39   /// \param theEvent the mouse event
40   /// \param theSelected the list of selected presentations
41   virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
42                             const std::list<XGUI_ViewerPrs>& theSelected);
43   /// Processes the mouse release in the point
44   /// \param thePoint a point clicked in the viewer
45   /// \param theEvent the mouse event
46   /// \param theSelected the list of selected presentations
47   virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
48                              const std::list<XGUI_ViewerPrs>& theSelected);
49   /// Gives the current mouse point in the viewer
50   /// \param thePoint a point clicked in the viewer
51   /// \param theEvent the mouse event
52   virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView);
53
54   /// Returns the map of the operation previews including the nested feature previews
55   /// \return the map of feature to the feature preview
56   virtual std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
57                                                                            preview() const;
58 signals:
59   /// signal about the sketch plane is selected
60   /// \param theX the value in the X direction of the plane
61   /// \param theX the value in the Y direction value of the plane
62   /// \param theX the value in the Z direction of the plane
63   void planeSelected(double theX, double theY, double theZ);
64
65 protected:
66   /// Set the plane to the current sketch
67   /// \param theShape the shape
68   void setSketchPlane(const TopoDS_Shape& theShape);
69
70 private:
71   bool myIsEditMode; /// the edit mode of this operation
72   std::list<XGUI_ViewerPrs> myFeatures; ///< the features to apply the edit operation
73 };
74
75 #endif