diff --git a/GeoLib/AnalyticalGeometry.cpp b/GeoLib/AnalyticalGeometry.cpp index 026462a5f816c2f6db687fd30adb4941e1319ac2..1a22d47307a4b1dac26c296987a76435a027d309 100644 --- a/GeoLib/AnalyticalGeometry.cpp +++ b/GeoLib/AnalyticalGeometry.cpp @@ -44,10 +44,11 @@ double getOrientation2d(MathLib::Point3d const& a, namespace GeoLib { -Orientation getOrientation(const GeoLib::Point* p0, const GeoLib::Point* p1, - const GeoLib::Point* p2) +Orientation getOrientation(GeoLib::Point const& p0, + GeoLib::Point const& p1, + GeoLib::Point const& p2) { - double const orientation = ExactPredicates::getOrientation2d(*p0, *p1, *p2); + double const orientation = ExactPredicates::getOrientation2d(p0, p1, p2); if (orientation > 0) return CCW; if (orientation < 0) diff --git a/GeoLib/AnalyticalGeometry.h b/GeoLib/AnalyticalGeometry.h index 4363725d604c74a054bc8aae61962a9a493a0b40..08b5c8d6b1ba9286324c7d36052579e403e5e82d 100644 --- a/GeoLib/AnalyticalGeometry.h +++ b/GeoLib/AnalyticalGeometry.h @@ -41,9 +41,9 @@ enum Orientation * \returns CW (clockwise), CCW (counterclockwise) or COLLINEAR (points are on a * line) */ -Orientation getOrientation(const GeoLib::Point* p0, - const GeoLib::Point* p1, - const GeoLib::Point* p2); +Orientation getOrientation(GeoLib::Point const& p0, + GeoLib::Point const& p1, + GeoLib::Point const& p2); /** * compute a supporting plane (represented by plane_normal and the value d) for the polygon diff --git a/GeoLib/Polygon.cpp b/GeoLib/Polygon.cpp index 57ab9668162f33c89e3d4d83580d5c077ebd30e8..a0c3276a81965807edff8ea0cdee2fd6ea3de5d1 100644 --- a/GeoLib/Polygon.cpp +++ b/GeoLib/Polygon.cpp @@ -320,22 +320,25 @@ void Polygon::ensureCCWOrientation () // *** determine orientation GeoLib::Orientation orient; if (0 < min_x_max_y_idx && min_x_max_y_idx < n_pnts - 2) - orient = GeoLib::getOrientation ( - tmp_polygon_pnts[min_x_max_y_idx - 1], - tmp_polygon_pnts[min_x_max_y_idx], - tmp_polygon_pnts[min_x_max_y_idx + 1]); + { + orient = GeoLib::getOrientation(*tmp_polygon_pnts[min_x_max_y_idx - 1], + *tmp_polygon_pnts[min_x_max_y_idx], + *tmp_polygon_pnts[min_x_max_y_idx + 1]); + } else { if (0 == min_x_max_y_idx) - orient = GeoLib::getOrientation ( - tmp_polygon_pnts[n_pnts - 1], - tmp_polygon_pnts[0], - tmp_polygon_pnts[1]); + { + orient = GeoLib::getOrientation(*tmp_polygon_pnts[n_pnts - 1], + *tmp_polygon_pnts[0], + *tmp_polygon_pnts[1]); + } else - orient = GeoLib::getOrientation ( - tmp_polygon_pnts[n_pnts - 2], - tmp_polygon_pnts[n_pnts - 1], - tmp_polygon_pnts[0]); + { + orient = GeoLib::getOrientation(*tmp_polygon_pnts[n_pnts - 2], + *tmp_polygon_pnts[n_pnts - 1], + *tmp_polygon_pnts[0]); + } } if (orient != GeoLib::CCW)