From: vsv Date: Mon, 26 Nov 2018 15:33:42 +0000 (+0300) Subject: Issue #2749: Update the point values only on mouse click X-Git-Tag: End2018~148 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ae38357796927c686be938dc8fe6d549cbdd9ab1;p=modules%2Fshaper.git Issue #2749: Update the point values only on mouse click --- 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