]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchPlugin/SketchPlugin_Validators.cpp
Salome HOME
Issue #698 - Distance constraint on circle - crash
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.cpp
index 9dfdb517155a23638c3f2808b20bcf96365c0cda..597f17d47a7e6d63a0df4f0d63a987e10099b801 100644 (file)
@@ -66,7 +66,12 @@ bool SketchPlugin_DistanceAttrValidator::isValid(
 
     FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
     // If it is a line then we have to check that first attribute id not a line
-    std::shared_ptr<GeomDataAPI_Point2D> aPoint = SketcherPrs_Tools::getFeaturePoint(aFeature->data(), aParamA);
+    std::shared_ptr<SketchPlugin_Feature> aSFeature =
+                            std::dynamic_pointer_cast<SketchPlugin_Feature>(theAttribute->owner());
+    SketchPlugin_Sketch* aSketch = aSFeature->sketch();
+    std::shared_ptr<GeomAPI_Ax3> aPlane = SketchPlugin_Sketch::plane(aSketch);
+    std::shared_ptr<GeomDataAPI_Point2D> aPoint = SketcherPrs_Tools::getFeaturePoint(
+                                                               aFeature->data(), aParamA, aPlane);
     if (aPoint)
       return true;
   }