1 // File: PartSet_OperationSketchBase.h
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PartSet_OperationSketchBase_H
6 #define PartSet_OperationSketchBase_H
10 #include <TopoDS_Shape.hxx>
12 #include <NCollection_List.hxx>
14 #include <ModuleBase_Operation.h>
15 #include <ModuleBase_Operation.h>
21 \class PartSet_OperationSketchBase
22 * \brief The base operation for the sketch features.
23 * Base class for all sketch operations. It provides an access to the feature preview
25 class PARTSET_EXPORT PartSet_OperationSketchBase : public ModuleBase_Operation
29 enum FeatureActionMode { FM_Activation, FM_Deactivation, FM_Abort };
33 /// \param theId an feature index
34 /// \param theParent the object parent
35 PartSet_OperationSketchBase(const QString& theId, QObject* theParent);
37 virtual ~PartSet_OperationSketchBase();
39 /// Returns the feature preview shape
40 /// \param theFeature the feature object to obtain the preview
41 boost::shared_ptr<GeomAPI_Shape> preview(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
43 /// Returns the operation local selection mode
44 /// \param theFeature the feature object to get the selection mode
45 /// \return the selection mode
46 virtual int getSelectionMode(boost::shared_ptr<ModelAPI_Feature> theFeature) const = 0;
48 /// Gives the current selected objects to be processed by the operation
49 /// \param theList a list of interactive selected shapes
50 virtual void setSelectedShapes(const NCollection_List<TopoDS_Shape>& theList) {};
52 /// Processes the mouse release in the point
53 /// \param thePoint a point clicked in the viewer
54 virtual void mouseReleased(const gp_Pnt& thePoint) {};
56 /// Processes the mouse move in the point
57 /// \param thePoint a 3D point clicked in the viewer
58 virtual void mouseMoved(const gp_Pnt& thePoint) {};
60 /// Processes the key pressed in the view
61 /// \param theKey a key value
62 virtual void keyReleased(const int theKey) {};
65 /// Signal about the feature construing is finished
66 /// \param theFeature the result feature
67 /// \param theMode the mode of the feature modification
68 void featureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature,
72 /// temporary code to provide edition mode
73 void setEditMode(const bool isEditMode) { myIsEditMode = isEditMode; };
75 bool isEditMode() const { return myIsEditMode; }