Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Union of validator and filter functionalities.
[modules/shaper.git]
/
src
/
PartSet
/
PartSet_WidgetPoint2dDistance.cpp
diff --git
a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp
b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp
index be108103444444fb9defbfc239b8f925efcddc31..0e40984766fc5af49890a7b32df41b298958473a 100644
(file)
--- a/
src/PartSet/PartSet_WidgetPoint2dDistance.cpp
+++ b/
src/PartSet/PartSet_WidgetPoint2dDistance.cpp
@@
-9,6
+9,7
@@
#include <ModuleBase_DoubleSpinBox.h>
#include <ModuleBase_IViewWindow.h>
#include <ModuleBase_DoubleSpinBox.h>
#include <ModuleBase_IViewWindow.h>
+#include <ModuleBase_Tools.h>
#include <XGUI_ViewerProxy.h>
#include <XGUI_Workshop.h>
#include <XGUI_ViewerProxy.h>
#include <XGUI_Workshop.h>
@@
-40,6
+41,15
@@
PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance()
{
}
{
}
+void PartSet_WidgetPoint2dDistance::reset()
+{
+ bool isOk;
+ double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
+
+ ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0);
+ storeValueCustom();
+}
+
void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& thePnt)
{
void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& thePnt)
{
@@
-53,10
+63,9
@@
void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
AttributeDoublePtr aReal = aData->real(attributeID());
if (aReal && (aReal->value() != aRadius)) {
aReal->setValue(aRadius);
AttributeDoublePtr aReal = aData->real(attributeID());
if (aReal && (aReal->value() != aRadius)) {
aReal->setValue(aRadius);
- mySpinBox->blockSignals(true);
- mySpinBox->setValue(aRadius);
- mySpinBox->blockSignals(false);
- emit valuesChanged();
+
+ ModuleBase_Tools::setSpinValue(mySpinBox, aRadius);
+ storeValue();
}
}
}
}
@@
-81,6
+90,10
@@
void PartSet_WidgetPoint2dDistance::deactivate()
void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
{
void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
{
+ // the contex menu release by the right button should not be processed by this widget
+ if (theEvent->button() != Qt::LeftButton)
+ return;
+
gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWnd->v3dView());
double aX, aY;
gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWnd->v3dView());
double aX, aY;