1 // File: PartSet_WidgetPoint2dDistance.h
2 // Created: 23 June 2014
3 // Author: Vitaly Smetannikov
5 #ifndef PartSet_WidgetPoint2dDistance_H
6 #define PartSet_WidgetPoint2dDistance_H
9 #include <ModuleBase_WidgetDoubleValue.h>
11 #include <ModelAPI_CompositeFeature.h>
13 //class ModuleBase_WidgetValue;
16 class ModuleBase_IViewWindow;
19 class PARTSET_EXPORT PartSet_WidgetPoint2dDistance : public ModuleBase_WidgetDoubleValue
24 /// \theParent the parent object
25 /// \theData the widget configuation. The attribute of the model widget is obtained from
26 PartSet_WidgetPoint2dDistance(QWidget* theParent, const Config_WidgetAPI* theData,
27 const std::string& theParentId);
29 virtual ~PartSet_WidgetPoint2dDistance();
31 /// The methiod called when widget is activated
32 virtual void activate();
34 /// The methiod called when widget is deactivated
35 virtual void deactivate();
37 /// Set the given wrapped value to the current widget
38 /// This value should be processed in the widget according to the needs
39 /// \param theValue the wrapped widget value
40 //virtual bool setValue(ModuleBase_WidgetValue* theValue);
42 XGUI_Workshop* workshop() const { return myWorkshop; }
44 void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; }
46 /// \returns the sketch instance
47 CompositeFeaturePtr sketch() const { return mySketch; }
48 void setSketch(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
51 void onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
52 void onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
55 /// Set the second point which defines a value in the widget as a distance with a first point defined by feature
56 void setPoint(FeaturePtr theFeature, const std::shared_ptr<GeomAPI_Pnt2d>& thePnt);
59 XGUI_Workshop* myWorkshop;
60 std::string myFirstPntName;
62 CompositeFeaturePtr mySketch;