From: azv Date: Fri, 11 Sep 2015 12:45:03 +0000 (+0300) Subject: Ability to change direction of the Angle presentation (issue #882) X-Git-Tag: V_1.4.0_beta4~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7bc72b12553b3a2134ea9b6b1add602c8141bc52;p=modules%2Fshaper.git Ability to change direction of the Angle presentation (issue #882) --- diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index 40133d9cb..1e35ac470 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -82,10 +82,15 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& theP TopoDS_Edge aEdge2 = TopoDS::Edge(aTEdge2); SetMeasuredGeometry(aEdge1, aEdge2); - gp_Pnt aCenter = CenterPoint(); + const gp_Pnt& aCenter = CenterPoint(); + const gp_Pnt& aFirst = FirstPoint(); + const gp_Pnt& aSecond = SecondPoint(); - gp_Pnt aFLyPnt(aFlyoutPnt->x(), aFlyoutPnt->y(), aFlyoutPnt->z()); - double aDist = aCenter.Distance(aFLyPnt); + gp_Dir aBisector((aFirst.XYZ() + aSecond.XYZ()) * 0.5 - aCenter.XYZ()); + + gp_Pnt aFlyPnt(aFlyoutPnt->x(), aFlyoutPnt->y(), aFlyoutPnt->z()); + gp_XYZ aFlyDir = aFlyPnt.XYZ() - aCenter.XYZ(); + double aDist = aFlyDir.Dot(aBisector.XYZ()); SetFlyout(aDist); // Angle value is in degrees