+
+QList<QWidget*> ModuleBase_WidgetPoint2D::getControls() const
+{
+ QList<QWidget*> aControls;
+ aControls.push_back(myXSpin);
+ aControls.push_back(myYSpin);
+
+ return aControls;
+}
+
+bool ModuleBase_WidgetPoint2D::initFromPrevious(ObjectPtr theObject)
+{
+ if (myOptionParam.length() == 0)
+ return false;
+ boost::shared_ptr<ModelAPI_Data> aData = theObject->data();
+ boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aData->attribute(myOptionParam));
+ if (aPoint) {
+ bool isBlocked = this->blockSignals(true);
+ myXSpin->setValue(aPoint->x());
+ myYSpin->setValue(aPoint->y());
+ this->blockSignals(isBlocked);
+
+ emit valuesChanged();
+ emit storedPoint2D(theObject, myOptionParam);
+ return true;
+ }
+ return false;
+}