diff --git a/FileIO/TetGenInterface.cpp b/FileIO/TetGenInterface.cpp index 329fe60ad1bb98774541a01a113490a56878373f..536117bdd0f3e70608e7114fcfbc55a7f110c5e4 100644 --- a/FileIO/TetGenInterface.cpp +++ b/FileIO/TetGenInterface.cpp @@ -26,12 +26,6 @@ // FileIO #include "TetGenInterface.h" -// GeoLib -#include "GeoLib/PointWithID.h" - -// MathLib -#include "TemplatePoint.h" - // MeshLib #include "Mesh.h" #include "MeshLib/Node.h" @@ -502,7 +496,7 @@ bool TetGenInterface::parseElements(std::ifstream& ins, bool TetGenInterface::writeTetGenSmesh(const std::string &file_name, const GeoLib::GEOObjects &geo_objects, const std::string &geo_name, - const std::vector<GeoLib::PointWithID> &attribute_points) const + const std::vector<GeoLib::Point> &attribute_points) const { std::vector<GeoLib::Point*> const*const points = geo_objects.getPointVec(geo_name); std::vector<GeoLib::Surface*> const*const surfaces = geo_objects.getSurfaceVec(geo_name); diff --git a/FileIO/TetGenInterface.h b/FileIO/TetGenInterface.h index 45431769aac3894469d1c6e198be8156584fb3e4..b6548d3699cc280cb2dd6cf29f10c792c72b36f4 100644 --- a/FileIO/TetGenInterface.h +++ b/FileIO/TetGenInterface.h @@ -17,7 +17,9 @@ #include <vector> -#include "GEOObjects.h" +// GeoLib +#include "GeoLib/Point.h" +#include "GeoLib/GEOObjects.h" // forward declaration of class Node and Element namespace MeshLib @@ -71,7 +73,7 @@ public: bool writeTetGenSmesh(const std::string &file_name, const GeoLib::GEOObjects &geo_objects, const std::string &geo_name, - const std::vector<GeoLib::PointWithID> &attribute_points) const; + const std::vector<GeoLib::Point> &attribute_points) const; /** * Writes the geometry of a given name to TetGen smesh-file. diff --git a/GeoLib/PointVec.cpp b/GeoLib/PointVec.cpp index 727d194dffdaf9d4347eca317d53edced719f039..dab41d47257a30ac8089e80339a1fdb13ab14219 100644 --- a/GeoLib/PointVec.cpp +++ b/GeoLib/PointVec.cpp @@ -19,7 +19,6 @@ // GeoLib #include "PointVec.h" -#include "PointWithID.h" // BaseLib #include "quicksort.h" @@ -214,7 +213,7 @@ std::vector<GeoLib::Point*>* PointVec::getSubset(const std::vector<std::size_t> const std::size_t nPoints(subset.size()); for (std::size_t i = 0; i < nPoints; i++) - (*new_points)[i] = new GeoLib::PointWithID((*this->_data_vec)[subset[i]]->getCoords(), subset[i]); + (*new_points)[i] = new GeoLib::Point(*(*this->_data_vec)[subset[i]]); return new_points; } diff --git a/GeoLib/PointVec.h b/GeoLib/PointVec.h index 95f471aa267ce598b7614e29a75f94c719946fd5..d768d2528507da77d51bcfcd8618acf1ada19b3b 100644 --- a/GeoLib/PointVec.h +++ b/GeoLib/PointVec.h @@ -29,8 +29,6 @@ namespace GeoLib { -class PointWithID; - /** * \ingroup GeoLib * @@ -102,7 +100,7 @@ public: const GeoLib::AABB<GeoLib::Point>& getAABB () const; - /// Returns a subset of this point vector containing only the points specified in "subset" as PointWithID-objects + /// Returns a subset of this point vector containing only the points specified in "subset" std::vector<GeoLib::Point*>* getSubset(const std::vector<std::size_t> &subset) const; private: diff --git a/Tests/GeoLib/TestGrid.cpp b/Tests/GeoLib/TestGrid.cpp index d2f8a77b2c2776f43a75db27e80423a3d08e425e..44a31879297920f15dc7dc0cfaff2c67b1a8bba6 100644 --- a/Tests/GeoLib/TestGrid.cpp +++ b/Tests/GeoLib/TestGrid.cpp @@ -16,7 +16,6 @@ #include "gtest/gtest.h" #include "GeoLib/Point.h" -#include "GeoLib/PointWithID.h" #include "GeoLib/Grid.h" #include "MathTools.h" @@ -95,7 +94,7 @@ TEST(GeoLib, SearchNearestPointInGrid) TEST(GeoLib, SearchNearestPointsInDenseGrid) { const std::size_t i_max(50), j_max(50), k_max(50); - std::vector<GeoLib::PointWithID*> pnts(i_max*j_max*k_max); + std::vector<GeoLib::Point*> pnts(i_max*j_max*k_max); // fill the vector with equi-distant points in the // cube [0,(i_max-1)/i_max] x [0,(j_max-1)/j_max] x [0,(k_max-1)/k_max] @@ -104,19 +103,21 @@ TEST(GeoLib, SearchNearestPointsInDenseGrid) for (std::size_t j(0); j < j_max; j++) { std::size_t offset1(j * k_max + offset0); for (std::size_t k(0); k < k_max; k++) { - pnts[offset1 + k] = new GeoLib::PointWithID(static_cast<double>(i) / i_max, - static_cast<double>(j) / j_max, static_cast<double>(k) / k_max, offset1+k); + pnts[offset1 + k] = new GeoLib::Point( + std::array<double,3>({{static_cast<double>(i) / i_max, + static_cast<double>(j) / j_max, + static_cast<double>(k) / k_max}}), offset1+k); } } } // create the grid - GeoLib::Grid<GeoLib::PointWithID>* grid(nullptr); - ASSERT_NO_THROW(grid = new GeoLib::Grid<GeoLib::PointWithID> (pnts.begin(), pnts.end())); + GeoLib::Grid<GeoLib::Point>* grid(nullptr); + ASSERT_NO_THROW(grid = new GeoLib::Grid<GeoLib::Point> (pnts.begin(), pnts.end())); // search point (1,1,1) is outside of the point set - GeoLib::PointWithID search_pnt(1,1,1, 0); - GeoLib::PointWithID* res(grid->getNearestPoint(search_pnt.getCoords())); + GeoLib::Point search_pnt(std::array<double,3>({{1,1,1}}), 0); + GeoLib::Point* res(grid->getNearestPoint(search_pnt.getCoords())); ASSERT_EQ(res->getID(), i_max*j_max*k_max-1); ASSERT_NEAR(sqrt(MathLib::sqrDist(*res, search_pnt)), sqrt(3.0)/50.0, std::numeric_limits<double>::epsilon()); @@ -145,5 +146,5 @@ TEST(GeoLib, SearchNearestPointsInDenseGrid) } delete grid; - std::for_each(pnts.begin(), pnts.end(), std::default_delete<GeoLib::PointWithID>()); + std::for_each(pnts.begin(), pnts.end(), std::default_delete<GeoLib::Point>()); }