Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetPoint2D.h
index 016b17217c0e0901640cc1293cc6c5c6440858c9..cf92afd3a020d43749965c6d497521599519ae97 100644 (file)
@@ -11,6 +11,7 @@
 #include <QObject>
 
 class ModelAPI_Feature;
+class GeomAPI_Pnt2d;
 
 class QGroupBox;
 class QDoubleSpinBox;
@@ -25,22 +26,21 @@ class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_ModelWidget
 public:
   /// Constructor
   /// \theParent the parent object
-  /// \theTitle the group box title
-  /// \theFeatureAttributeID the identifier of the feature attribute
-  ModuleBase_WidgetPoint2D(QWidget* theParent, QString theTitle,
-                           const std::string& theFeatureAttributeID);
+  /// \theParent the parent object
+  /// \theData the widget configuation. The attribute of the model widget is obtained from
+  ModuleBase_WidgetPoint2D(QWidget* theParent, const Config_WidgetAPI* theData);
   /// Destructor
   virtual ~ModuleBase_WidgetPoint2D();
 
+  /// Fill the widget values by given point
+  /// \param thePoint the point
+  void setPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
+
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
-  virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
-
-  virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  virtual bool storeValue(FeaturePtr theFeature) const;
 
-  /// Set focus to the current widget if it corresponds to the given attribute
-  /// \param theAttribute name
-  virtual bool focusTo(const std::string& theAttributeName);
+  virtual bool restoreValue(FeaturePtr theFeature);
 
   /// Returns the internal parent wiget control, that can be shown anywhere
   /// \returns the widget
@@ -50,10 +50,12 @@ public:
   /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
+  /// Process key release envent on the widget spin box controls
+  /// \param theObject the object where the event happens
+  /// \param theEvent the processed event
   virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
 
 private:
-  std::string myFeatureAttributeID; ///< the identifier of the feature attribute
   QGroupBox* myGroupBox; ///< the parent group box for all intenal widgets
   QDoubleSpinBox* myXSpin; ///< the spin box for the X coordinate
   QDoubleSpinBox* myYSpin; ///< the spin box for the Y coordinate