From 24ee7c1960b98a14654ee50612dc769dd2087a80 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 7 May 2015 11:49:56 +0300 Subject: [PATCH] Refactoring. Better name. --HG-- branch : release --- src/app/geometry/vabstractcurve.cpp | 2 +- src/app/geometry/vgobject.cpp | 2 +- src/app/tools/drawTools/vtoolpointofcontact.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/geometry/vabstractcurve.cpp b/src/app/geometry/vabstractcurve.cpp index 1fe4e149a..9d1df7b04 100644 --- a/src/app/geometry/vabstractcurve.cpp +++ b/src/app/geometry/vabstractcurve.cpp @@ -76,7 +76,7 @@ QVector VAbstractCurve::FromBegin(const QVector &points, const { if (theBegin == false) { - if (PointInSegment(begin, points.at(i), points.at(i+1))) + if (IsPointOnLineSegment(begin, points.at(i), points.at(i+1))) { theBegin = true; segment.append(begin); diff --git a/src/app/geometry/vgobject.cpp b/src/app/geometry/vgobject.cpp index 467d1be37..61ab1d3ed 100644 --- a/src/app/geometry/vgobject.cpp +++ b/src/app/geometry/vgobject.cpp @@ -352,7 +352,7 @@ void VGObject::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c } //--------------------------------------------------------------------------------------------------------------------- -bool VGObject::PointInSegment(const QPointF &t, const QPointF &p1, const QPointF &p2) +bool VGObject::IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const QPointF &p2) { const qreal eps = 1e-8; diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index 598370a08..a9ab674b7 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -107,8 +107,8 @@ QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF ¢e break; case 2: { - const bool flagP1 = VGObject::PointInSegment (p1, firstPoint, secondPoint); - const bool flagP2 = VGObject::PointInSegment (p2, firstPoint, secondPoint); + const bool flagP1 = VGObject::IsPointOnLineSegment (p1, firstPoint, secondPoint); + const bool flagP2 = VGObject::IsPointOnLineSegment (p2, firstPoint, secondPoint); if ((flagP1 == true && flagP2 == true) || (flagP1 == false && flagP2 == false)/*In case we have something wrong*/) {