]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_OperationSketchBase.h
Salome HOME
Updating property pannel on sketch editing (refs #31)
[modules/shaper.git] / src / PartSet / PartSet_OperationSketchBase.h
1 // File:        PartSet_OperationSketchBase.h
2 // Created:     20 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef PartSet_OperationSketchBase_H
6 #define PartSet_OperationSketchBase_H
7
8 #include "PartSet.h"
9
10 #include <TopoDS_Shape.hxx>
11 #include <gp_Pnt.hxx>
12 #include <NCollection_List.hxx>
13
14 #include <ModuleBase_Operation.h>
15 #include <ModuleBase_Operation.h>
16 #include <QObject>
17
18 class GeomAPI_Shape;
19
20 /*!
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
24 */
25 class PARTSET_EXPORT PartSet_OperationSketchBase : public ModuleBase_Operation
26 {
27   Q_OBJECT
28 public:
29   /// Constructor
30   /// \param theId an feature index
31   /// \param theParent the object parent
32   PartSet_OperationSketchBase(const QString& theId, QObject* theParent);
33   /// Destructor
34   virtual ~PartSet_OperationSketchBase();
35
36   /// Returns the feature preview shape
37   /// \param theFeature the feature object to obtain the preview
38   boost::shared_ptr<GeomAPI_Shape> preview(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
39
40   /// Returns the operation local selection mode
41   /// \param theFeature the feature object to get the selection mode
42   /// \return the selection mode
43   virtual int getSelectionMode(boost::shared_ptr<ModelAPI_Feature> theFeature) const = 0;
44
45   /// Gives the current selected objects to be processed by the operation
46   /// \param theList a list of interactive selected shapes
47   virtual void setSelectedShapes(const NCollection_List<TopoDS_Shape>& theList) {};
48
49   /// Processes the mouse release in the point
50   /// \param thePoint a point clicked in the viewer
51   virtual void mouseReleased(const gp_Pnt& thePoint) {};
52
53   /// Processes the mouse move in the point
54   /// \param thePoint a 3D point clicked in the viewer
55   virtual void mouseMoved(const gp_Pnt& thePoint) {};
56
57   /// Processes the key pressed in the view
58   /// \param theKey a key value
59   virtual void keyReleased(const int theKey) {};
60
61 signals:
62   /// Signal about the feature construing is finished
63   /// \param theFeature the result feature
64   void featureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature);
65
66 public:
67   /// temporary code to provide edition mode
68   void setEditMode(const bool isEditMode) { myIsEditMode = isEditMode; };
69 protected:
70   bool isEditMode() const { return myIsEditMode; }
71 private:
72   bool myIsEditMode;
73 };
74
75 #endif