Salome HOME
Issue #251. Append Export/Import NewGeom commands in the SALOME desktop.
[modules/shaper.git] / src / PartSet / PartSet_OperationFeatureBase.h
1 // File:        PartSet_OperationFeatureBase.h
2 // Created:     20 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef PARTSET_OPERATIONFEATUREBASE_H
6 #define PARTSET_OPERATIONFEATUREBASE_H
7
8 #include "PartSet.h"
9
10 #include <PartSet_OperationSketchBase.h>
11 #include <PartSet_Constants.h>
12
13 #include <QObject>
14
15 class GeomDataAPI_Point2D;
16 class QMouseEvent;
17 class QKeyEvent;
18
19 /*!
20  \class PartSet_OperationFeatureBase
21  * \brief The operation for the sketch feature creation
22  */
23 class PARTSET_EXPORT PartSet_OperationFeatureBase : public PartSet_OperationSketchBase
24 {
25 Q_OBJECT
26
27  public:
28   /// Constructor
29   /// \param theId the feature identifier
30   /// \param theParent the operation parent
31   /// \param theSketch the parent feature
32   PartSet_OperationFeatureBase(const QString& theId, QObject* theParent, CompositeFeaturePtr theSketch);
33   /// Destructor
34   virtual ~PartSet_OperationFeatureBase();
35
36   /// Returns the operation sketch feature
37   /// \returns the sketch instance
38   virtual CompositeFeaturePtr sketch() const;
39
40   /// Gives the current selected objects to be processed by the operation
41   /// \param theEvent the mouse event
42   /// \param theView a viewer to have the viewer the eye position
43   /// \param theSelected the list of selected presentations
44   /// \param theHighlighted the list of highlighted presentations
45   virtual void mouseReleased(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer,
46                              ModuleBase_ISelection* theSelection);
47
48  protected:
49   /// Return a widget value point by the selection and the viewer position
50   /// \param thePrs the presentation
51   /// \param theViewer a viewer to have the viewer the eye position
52   /// \param theX the horizontal coordinate
53   /// \param theY the vertical coordinate
54   /// \return true if the point exits in the selection
55   virtual bool getViewerPoint(ModuleBase_ViewerPrs thePrs,
56                                    ModuleBase_IViewer* theViewer,
57                                    double& theX, double& theY);
58
59  protected:
60   CompositeFeaturePtr mySketch;  ///< the sketch of the feature
61 };
62
63 #endif