diff --git a/Tests/GeoLib/TestBoundingSphere.cpp b/Tests/GeoLib/TestBoundingSphere.cpp index f8bf351a448d2799fe6d6597039725f48f4a2bd4..e6c20d798f75b3685724e035c3f741d47a574185 100644 --- a/Tests/GeoLib/TestBoundingSphere.cpp +++ b/Tests/GeoLib/TestBoundingSphere.cpp @@ -15,15 +15,15 @@ #include "gtest/gtest.h" #include "GeoLib/MinimalBoundingSphere.h" -#include "GeoLib/Point.h" +#include "MathLib/MathPoint.h" TEST(GeoLib, TestBoundingSphere) { - std::vector<GeoLib::Point*> pnts; - pnts.push_back(new GeoLib::Point(0, 0 , 0)); - pnts.push_back(new GeoLib::Point(2, 0 , 0)); - pnts.push_back(new GeoLib::Point(1, 0.1 , 0)); - pnts.push_back(new GeoLib::Point(1, -0.1 , 0)); + std::vector<MathLib::MathPoint*> pnts; + pnts.push_back(new MathLib::MathPoint({0, 0 , 0})); + pnts.push_back(new MathLib::MathPoint({2, 0 , 0})); + pnts.push_back(new MathLib::MathPoint({1, 0.1 , 0})); + pnts.push_back(new MathLib::MathPoint({1, -0.1 , 0})); { /** @@ -37,7 +37,7 @@ TEST(GeoLib, TestBoundingSphere) * Expected result is C=(1,0,0), r=1 */ GeoLib::MinimalBoundingSphere s(pnts); - GeoLib::Point center = s.getCenter(); + MathLib::MathPoint center = s.getCenter(); ASSERT_NEAR(1.0, center[0], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.0, center[1], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.0, center[2], std::numeric_limits<double>::epsilon()); @@ -59,21 +59,21 @@ TEST(GeoLib, TestBoundingSphere) */ (*pnts[2])[2] -= 1.4; GeoLib::MinimalBoundingSphere s(pnts); - GeoLib::Point center = s.getCenter(); + MathLib::MathPoint center = s.getCenter(); ASSERT_NEAR(1.0, center[0], 0.0001); ASSERT_NEAR(0.0246, center[1], 0.0001); ASSERT_NEAR(-0.3446, center[2], 0.0001); ASSERT_NEAR(1.0580, s.getRadius(), 0.0001); } - pnts[0] = new GeoLib::Point(0, 0, 0); - pnts[1] = new GeoLib::Point(1, 0, 0); - pnts[2] = new GeoLib::Point(1, 1, 0); - pnts[3] = new GeoLib::Point(0, 1, 0); - pnts.push_back(new GeoLib::Point(0, 0, 1)); - pnts.push_back(new GeoLib::Point(1, 0, 1)); - pnts.push_back(new GeoLib::Point(1, 1, 1)); - pnts.push_back(new GeoLib::Point(0, 1, 0.9)); + pnts[0] = new MathLib::MathPoint({0, 0, 0}); + pnts[1] = new MathLib::MathPoint({1, 0, 0}); + pnts[2] = new MathLib::MathPoint({1, 1, 0}); + pnts[3] = new MathLib::MathPoint({0, 1, 0}); + pnts.push_back(new MathLib::MathPoint({0, 0, 1})); + pnts.push_back(new MathLib::MathPoint({1, 0, 1})); + pnts.push_back(new MathLib::MathPoint({1, 1, 1})); + pnts.push_back(new MathLib::MathPoint({0, 1, 0.9})); { /** @@ -81,7 +81,7 @@ TEST(GeoLib, TestBoundingSphere) * Expected result is C=(0.5,0.5,0.5), r=0.866 */ GeoLib::MinimalBoundingSphere s(pnts); - GeoLib::Point center = s.getCenter(); + MathLib::MathPoint center = s.getCenter(); ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.5, center[2], std::numeric_limits<double>::epsilon()); @@ -95,7 +95,7 @@ TEST(GeoLib, TestBoundingSphere) (*pnts[7])[2] += 0.3; GeoLib::MinimalBoundingSphere s(pnts); { - GeoLib::Point center = s.getCenter(); + MathLib::MathPoint center = s.getCenter(); ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.6, center[2], std::numeric_limits<double>::epsilon()); @@ -103,9 +103,9 @@ TEST(GeoLib, TestBoundingSphere) } /// Calculates the bounding sphere of points on a bounding sphere - std::vector<GeoLib::Point*> *sphere_points (s.getRandomSpherePoints(1000)); + std::vector<MathLib::MathPoint*> *sphere_points (s.getRandomSpherePoints(1000)); GeoLib::MinimalBoundingSphere t(*sphere_points); - GeoLib::Point center = s.getCenter(); + MathLib::MathPoint center = s.getCenter(); ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon()); ASSERT_NEAR(0.6, center[2], std::numeric_limits<double>::epsilon());