Salome HOME
Boost has been removed from code
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValueFeature.h
1 // File:        ModuleBase_WidgetValueFeature.h
2 // Created:     25 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef ModuleBase_WidgetValueFeature_H
6 #define ModuleBase_WidgetValueFeature_H
7
8 #include <ModuleBase.h>
9 #include <ModuleBase_WidgetValue.h>
10
11 #include <ModelAPI_Result.h>
12
13 #include <memory>
14
15 class GeomAPI_Pnt2d;
16
17 /**\class ModuleBase_WidgetValueFeature
18  * \ingroup GUI
19  * \brief Custom widget value. The widget contains a feature and 2D point.
20  */
21 class ModuleBase_WidgetValueFeature : public ModuleBase_WidgetValue
22 {
23  public:
24   /// Constructor
25   MODULEBASE_EXPORT ModuleBase_WidgetValueFeature();
26   /// Destructor
27   MODULEBASE_EXPORT virtual ~ModuleBase_WidgetValueFeature();
28
29   /// Fill the widget values by given point
30   /// \param thePoint the point
31   MODULEBASE_EXPORT void setObject(const ObjectPtr& theFeature);
32
33   /// Returns the widget values by given point
34   /// \return theFeature the current feature
35   MODULEBASE_EXPORT const ObjectPtr& object() const;
36
37   /// Fill the widget values by given point
38   /// \param thePoint the point
39   MODULEBASE_EXPORT void setPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
40
41   /// Returns the widget point
42   /// \return the current point
43   MODULEBASE_EXPORT const std::shared_ptr<GeomAPI_Pnt2d>& point() const;
44
45  private:
46   ObjectPtr myResult;
47   std::shared_ptr<GeomAPI_Pnt2d> myPoint;
48 };
49
50 #endif