Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Perpendicular.cpp
index 14cef6b266af7a1c93305663db2914bd06e8da1d..7c94af55a221a3e864896c118abe0866f12c04c9 100644 (file)
@@ -37,9 +37,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint,
-                                                     ModelAPI_CompositeFeature* theSketcher,
-                                                     const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
@@ -83,10 +82,10 @@ bool SketcherPrs_Perpendicular::updateIfReadyToDisplay(double theStep, bool with
 
   GeomAPI_Curve aCurve1(aShp1);
   GeomAPI_Curve aCurve2(aShp2);
-  bool isInside1 = ((aParam1 - aCurve1.startParam()) >= -Precision::Confusion()) &&
-    ((aCurve1.endParam() - aParam1) >= Precision::Confusion());
-  bool isInside2 = ((aParam2 - aCurve2.startParam()) >= -Precision::Confusion()) &&
-    ((aCurve2.endParam() - aParam2) >= Precision::Confusion());
+  bool isInside1 = (aParam1 >= (aCurve1.startParam() - Precision::Confusion())) &&
+    (aParam1 <= (aCurve1.endParam() + Precision::Confusion()));
+  bool isInside2 = (aParam2 >= (aCurve2.startParam() - Precision::Confusion())) &&
+    (aParam2 <= (aCurve2.endParam() + Precision::Confusion()));
 
   if (!(isInside1 && isInside2))
     aPnt = std::shared_ptr<GeomAPI_Pnt>();