1 // File: PartSet_OperationSketch.h
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PartSet_OperationSketch_H
6 #define PartSet_OperationSketch_H
10 #include <PartSet_OperationSketchBase.h>
14 \class PartSet_OperationSketch
15 * \brief The operation for the sketch feature creation
17 class PARTSET_EXPORT PartSet_OperationSketch : public PartSet_OperationSketchBase
21 /// Returns the operation type key
22 static std::string Type() { return "Sketch"; }
26 /// \param theId the feature identifier
27 /// \param theParent the operation parent
28 PartSet_OperationSketch(const QString& theId, QObject* theParent);
30 virtual ~PartSet_OperationSketch();
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;
37 /// Returns the operation sketch feature
38 /// \returns the sketch instance
39 virtual boost::shared_ptr<ModelAPI_Feature> sketch() const;
41 /// Processes the mouse pressed in the point
42 /// \param thePoint a point clicked in the viewer
43 /// \param theEvent the mouse event
44 /// \param theSelected the list of selected presentations
45 virtual void mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
46 const std::list<XGUI_ViewerPrs>& theSelected);
47 /// Processes the mouse release in the point
48 /// \param thePoint a point clicked in the viewer
49 /// \param theEvent the mouse event
50 /// \param theSelected the list of selected presentations
51 virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
52 const std::list<XGUI_ViewerPrs>& theSelected);
53 /// Gives the current mouse point in the viewer
54 /// \param thePoint a point clicked in the viewer
55 /// \param theEvent the mouse event
56 virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView);
58 /// Returns the map of the operation previews including the nested feature previews
59 /// \return the map of feature to the feature preview
60 virtual std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
63 /// Virtual method called when operation stopped - committed or aborted.
64 /// Emits a signal to hide the preview of the operation
65 virtual void stopOperation();
68 /// signal about the sketch plane is selected
69 /// \param theX the value in the X direction of the plane
70 /// \param theX the value in the Y direction value of the plane
71 /// \param theX the value in the Z direction of the plane
72 void planeSelected(double theX, double theY, double theZ);
75 /// Set the plane to the current sketch
76 /// \param theShape the shape
77 void setSketchPlane(const TopoDS_Shape& theShape);
80 bool myIsEditMode; /// the edit mode of this operation
81 std::list<XGUI_ViewerPrs> myFeatures; ///< the features to apply the edit operation