]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2749: Update the point values only on mouse click
authorvsv <vsv@opencascade.com>
Mon, 26 Nov 2018 15:33:42 +0000 (18:33 +0300)
committervsv <vsv@opencascade.com>
Mon, 26 Nov 2018 15:33:42 +0000 (18:33 +0300)
src/ModuleBase/ModuleBase_WidgetPointInput.cpp
src/ModuleBase/ModuleBase_WidgetPointInput.h

index 7d8596556b0eaf6a7c47c734fd3e4057ad04db4d..9099925f512219b762f8625d89445fcdbbda55c9 100644 (file)
@@ -219,16 +219,19 @@ QIntList ModuleBase_WidgetPointInput::shapeTypes() const
 
 //********************************************************************
 bool ModuleBase_WidgetPointInput
-::setSelectionCustom(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs)
+::setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& 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;
 }
index bae10d61a71ca2af8a2a6d763f2e911d5224a037..8026492118a1c46e6e7f5f66b69b391266cb5ea8 100644 (file)
@@ -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<ModuleBase_ViewerPrs>& thePrs);
+  virtual bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
+    const bool theToValidate);
 
 protected:
   /// Retunrs a list of possible shape types