From ae38357796927c686be938dc8fe6d549cbdd9ab1 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 26 Nov 2018 18:33:42 +0300 Subject: [PATCH] Issue #2749: Update the point values only on mouse click --- .../ModuleBase_WidgetPointInput.cpp | 21 +++++++++++-------- src/ModuleBase/ModuleBase_WidgetPointInput.h | 3 ++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetPointInput.cpp b/src/ModuleBase/ModuleBase_WidgetPointInput.cpp index 7d8596556..9099925f5 100644 --- a/src/ModuleBase/ModuleBase_WidgetPointInput.cpp +++ b/src/ModuleBase/ModuleBase_WidgetPointInput.cpp @@ -219,16 +219,19 @@ QIntList ModuleBase_WidgetPointInput::shapeTypes() const //******************************************************************** bool ModuleBase_WidgetPointInput -::setSelectionCustom(const std::shared_ptr& thePrs) +::setSelection(QList>& theValues, + const bool theToValidate) { - GeomShapePtr aShape = thePrs->shape(); - if (aShape->isVertex()) { - GeomVertexPtr aVertex(new GeomAPI_Vertex(aShape)); - GeomPointPtr aPnt = aVertex->point(); - myXSpin->setValue(aPnt->x()); - myYSpin->setValue(aPnt->y()); - myZSpin->setValue(aPnt->z()); - return true; + if (theValues.size() == 1) { + GeomShapePtr aShape = theValues.first()->shape(); + if (aShape->isVertex()) { + GeomVertexPtr aVertex(new GeomAPI_Vertex(aShape)); + GeomPointPtr aPnt = aVertex->point(); + myXSpin->setValue(aPnt->x()); + myYSpin->setValue(aPnt->y()); + myZSpin->setValue(aPnt->z()); + return true; + } } return false; } diff --git a/src/ModuleBase/ModuleBase_WidgetPointInput.h b/src/ModuleBase/ModuleBase_WidgetPointInput.h index bae10d61a..802649211 100644 --- a/src/ModuleBase/ModuleBase_WidgetPointInput.h +++ b/src/ModuleBase/ModuleBase_WidgetPointInput.h @@ -61,7 +61,8 @@ public: /// Fills the attribute with the value of the selected owner /// \param thePrs a selected owner - virtual bool setSelectionCustom(const std::shared_ptr& thePrs); + virtual bool setSelection(QList>& theValues, + const bool theToValidate); protected: /// Retunrs a list of possible shape types -- 2.30.2