X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetPoint2D.h;h=29d65a7b23288511f351566c41cdd561c0f26b5f;hb=164361234cb019c478ad6f254b27a6c9cd799337;hp=255a3950c43bee860c65d9b6eee023d4d6fc8b70;hpb=712dfdf42f58bb738a0db2c051a405391151972f;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2D.h b/src/ModuleBase/ModuleBase_WidgetPoint2D.h index 255a3950c..29d65a7b2 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2D.h +++ b/src/ModuleBase/ModuleBase_WidgetPoint2D.h @@ -11,10 +11,11 @@ #include class ModelAPI_Feature; +class ModuleBase_WidgetValue; class GeomAPI_Pnt2d; class QGroupBox; -class QDoubleSpinBox; +class ModuleBase_DoubleSpinBox; /**\class ModuleBase_WidgetPoint2D * \ingroup GUI @@ -22,25 +23,27 @@ class QDoubleSpinBox; */ class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_ModelWidget { - Q_OBJECT -public: +Q_OBJECT + public: /// Constructor /// \theParent the parent object /// \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); + ModuleBase_WidgetPoint2D(QWidget* theParent, const Config_WidgetAPI* theData, + const std::string& theParentId); /// Destructor virtual ~ModuleBase_WidgetPoint2D(); - /// Fill the widget values by given point - /// \param thePoint the point - void setPoint(const boost::shared_ptr& thePoint); + /// Set the given wrapped value to the current widget + /// This value should be processed in the widget according to the needs + /// \param theValue the wrapped widget value + virtual bool setValue(ModuleBase_WidgetValue* theValue); /// Saves the internal parameters to the given feature - /// \param theFeature a model feature to be changed - virtual bool storeValue(FeaturePtr theFeature) const; + /// \param theObject a model feature to be changed + virtual bool storeValue() const; - virtual bool restoreValue(FeaturePtr theFeature); + virtual bool restoreValue(); /// Returns the internal parent wiget control, that can be shown anywhere /// \returns the widget @@ -50,19 +53,25 @@ public: /// \return a control list virtual QList 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); + bool initFromPrevious(ObjectPtr theObject); + +signals: + /// Signal about the point 2d set to the feature + /// \param the feature + /// \param the attribute of the feature + void storedPoint2D(ObjectPtr theObject, const std::string& theAttribute); - void initFromPrevious(FeaturePtr theFeature); + protected: + /// Fill the widget values by given point + /// \param thePoint the point + void setPoint(const boost::shared_ptr& thePoint); -private: - 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 + private: + QGroupBox* myGroupBox; ///< the parent group box for all intenal widgets + ModuleBase_DoubleSpinBox* myXSpin; ///< the spin box for the X coordinate + ModuleBase_DoubleSpinBox* myYSpin; ///< the spin box for the Y coordinate - std::string myOptionParam; /// Parameter name which has to be taken from previous feature + std::string myOptionParam; /// Parameter name which has to be taken from previous feature }; #endif