]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintLength.cpp
index 7218a5341a6cafca97d0d5359bb0609bff2207d0..76563c003cb6d1f1869210c0633ea8b76c3d18b5 100644 (file)
@@ -31,3 +31,14 @@ const boost::shared_ptr<GeomAPI_Shape>&  SketchPlugin_ConstraintLength::preview(
   return getPreview();
 }
 
+void SketchPlugin_ConstraintLength::move(double theDeltaX, double theDeltaY)
+{
+  boost::shared_ptr<ModelAPI_Data> aData = data();
+  if (!aData->isValid())
+    return;
+
+  boost::shared_ptr<GeomDataAPI_Point2D> aPoint1 =
+        boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(CONSTRAINT_ATTR_FLYOUT_VALUE_PNT));
+  aPoint1->setValue(aPoint1->x() + theDeltaX, aPoint1->y() + theDeltaY);
+}
+