diff --git a/Tests/GeoLib/CreateTestPoints.cpp b/Tests/GeoLib/CreateTestPoints.cpp index 5c2445a5675117280ec4ea4847050a59a81a42f1..f6837031e5d4601075064e69c4666b9d00eed73f 100644 --- a/Tests/GeoLib/CreateTestPoints.cpp +++ b/Tests/GeoLib/CreateTestPoints.cpp @@ -11,6 +11,7 @@ #include <map> #include <memory> +#include <random> #include <vector> void createSetOfTestPointsAndAssociatedNames(GeoLib::GEOObjects& geo_objs, @@ -42,3 +43,25 @@ void createSetOfTestPointsAndAssociatedNames(GeoLib::GEOObjects& geo_objs, geo_objs.addPointVec(std::move(pnts), name, std::move(pnt_name_map)); } + +std::vector<GeoLib::Point*> createRandomPoints( + std::size_t const number_of_random_points, + std::array<double, 6> const& limits) +{ + std::random_device rd; + std::mt19937 random_engine_mt19937(rd()); + std::normal_distribution<> normal_dist_x(limits[0], limits[1]); + std::normal_distribution<> normal_dist_y(limits[2], limits[3]); + std::normal_distribution<> normal_dist_z(limits[4], limits[5]); + + std::vector<GeoLib::Point*> random_points; + + for (std::size_t k = 0; k < number_of_random_points; ++k) + { + random_points.push_back(new GeoLib::Point( + std::array{normal_dist_x(random_engine_mt19937), + normal_dist_y(random_engine_mt19937), + normal_dist_z(random_engine_mt19937)})); + } + return random_points; +} diff --git a/Tests/GeoLib/CreateTestPoints.h b/Tests/GeoLib/CreateTestPoints.h index 04518c0e9380558c3da8ff17acb1092805f3dc64..3d69b4cc66647ca7afc704dc64d0a8aee30f7f9f 100644 --- a/Tests/GeoLib/CreateTestPoints.h +++ b/Tests/GeoLib/CreateTestPoints.h @@ -9,6 +9,7 @@ #pragma once +#include <array> #include <string> #include "GeoLib/GEOObjects.h" @@ -17,3 +18,7 @@ void createSetOfTestPointsAndAssociatedNames(GeoLib::GEOObjects& geo_objs, std::string& name, std::size_t const pnts_per_edge, GeoLib::Point const& shift); + +std::vector<GeoLib::Point*> createRandomPoints( + std::size_t const number_of_random_points, + std::array<double, 6> const& limits);