]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketcherPrs/SketcherPrs_Tools.cpp
Salome HOME
Prepare version 1.2.1: quick fix for iteration 2 release
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Tools.cpp
index 980b28f2329d4e32d61981abe2440aa68ce3b63c..f8891b2253bdf2025369ea887e7c5e977ae99b4b 100644 (file)
@@ -58,10 +58,6 @@ std::shared_ptr<GeomAPI_Pnt2d> getPoint(ModelAPI_Feature* theFeature,
     aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
 
-  else if (aFeature && aFeature->getKind() == SketchPlugin_Circle::ID())
-    aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-        aFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID()));
-
   else if (anAttr->attr()) {
     aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttr->attr());
   }
@@ -89,10 +85,6 @@ std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
     aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
         aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
 
-  else if (aFeature && aFeature->getKind() == SketchPlugin_Circle::ID())
-    aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-        aFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID()));
-
   else if (anAttr->attr()) {
     aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttr->attr());
   }
@@ -179,6 +171,7 @@ std::shared_ptr<GeomAPI_Pnt> getAnchorPoint(const ModelAPI_Feature* theConstrain
   double aRadius = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
       aConstraint->attribute(SketchPlugin_Constraint::VALUE()))->value();
   double aLen = aFlyoutPnt->distance(anOrigin);
+  aRadius *= 1.001; // a gap to make point much closer to the circle, but not lying on it
   aFlyoutPnt->setX(aCenter->x() + aFlyoutPnt->x() * aRadius / aLen);
   aFlyoutPnt->setY(aCenter->y() + aFlyoutPnt->y() * aRadius / aLen);
   return thePlane->to3D(aFlyoutPnt->x(), aFlyoutPnt->y());