1 // File: PartSet_OperationFeatureBase.h
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef PARTSET_OPERATIONFEATUREBASE_H
6 #define PARTSET_OPERATIONFEATUREBASE_H
10 #include <PartSet_OperationSketchBase.h>
11 #include <PartSet_Constants.h>
15 class GeomDataAPI_Point2D;
20 \class PartSet_OperationFeatureBase
21 * \brief The operation for the sketch feature creation
23 class PARTSET_EXPORT PartSet_OperationFeatureBase : public PartSet_OperationSketchBase
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, FeaturePtr theSketch);
34 virtual ~PartSet_OperationFeatureBase();
36 /// Initialisation of operation with preliminary selection
37 /// \param theSelected the list of selected presentations
38 /// \param theHighlighted the list of highlighted presentations
39 virtual void initSelection(const std::list<ModuleBase_ViewerPrs>& theSelected,
40 const std::list<ModuleBase_ViewerPrs>& theHighlighted);
42 /// Initializes the operation with previously created feature. It is used in sequental operations
43 virtual void initFeature(FeaturePtr theFeature);
45 /// Returns the operation sketch feature
46 /// \returns the sketch instance
47 virtual FeaturePtr sketch() const;
49 /// Gives the current selected objects to be processed by the operation
50 /// \param theEvent the mouse event
51 /// \param theView a viewer to have the viewer the eye position
52 /// \param theSelected the list of selected presentations
53 /// \param theHighlighted the list of highlighted presentations
54 virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
55 const std::list<ModuleBase_ViewerPrs>& theSelected,
56 const std::list<ModuleBase_ViewerPrs>& theHighlighted);
60 /// Slots which listen the mode widget activation
61 /// \param theWidget the model widget
62 virtual void onWidgetActivated(ModuleBase_ModelWidget* theWidget);
66 void activateByPreselection();
67 /// Set value to the active widget
68 /// \param theFeature the feature
69 /// \param theX the horizontal coordinate
70 /// \param theY the vertical coordinate
71 /// \return true if the point is set
72 bool setWidgetValue(ObjectPtr theFeature, double theX, double theY);
75 FeaturePtr myInitFeature; ///< the initial feature
76 FeaturePtr mySketch; ///< the sketch of the feature
78 ModuleBase_ModelWidget* myActiveWidget; ///< the active widget
80 std::list<ModuleBase_ViewerPrs> myPreSelection;