From c97921c7d0e7925f80fbe28fe2e436b1f3977788 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Wed, 16 Dec 2015 07:34:17 +0100 Subject: [PATCH] Removed template parameter from AABB. --- .../DataView/ElementTreeModel.cpp | 2 +- .../DataView/MeshElementRemovalDialog.cpp | 6 ++--- Applications/Utils/MeshEdit/MoveMesh.cpp | 2 +- Applications/Utils/MeshEdit/checkMesh.cpp | 2 +- Applications/Utils/MeshEdit/moveMeshNodes.cpp | 2 +- .../Utils/MeshEdit/removeMeshElements.cpp | 2 +- GeoLib/Grid.h | 4 +-- GeoLib/PointVec.h | 4 +-- GeoLib/Polygon.h | 2 +- GeoLib/Surface.cpp | 2 +- GeoLib/Surface.h | 4 +-- GeoLib/SurfaceGrid.h | 2 +- MeshGeoToolsLib/GeoMapper.cpp | 4 +-- MeshLib/CoordinateSystem.cpp | 24 ++++++++++++++--- MeshLib/CoordinateSystem.h | 26 ++----------------- .../Mesh2MeshPropertyInterpolation.cpp | 6 ++--- MeshLib/MeshInformation.cpp | 4 +-- MeshLib/MeshInformation.h | 2 +- MeshLib/MeshSearch/ElementSearch.cpp | 2 +- MeshLib/MeshSearch/ElementSearch.h | 2 +- Tests/GeoLib/TestAABB.cpp | 16 ++++++------ Tests/GeoLib/TestOctTree.cpp | 10 +++---- 22 files changed, 63 insertions(+), 67 deletions(-) diff --git a/Applications/DataExplorer/DataView/ElementTreeModel.cpp b/Applications/DataExplorer/DataView/ElementTreeModel.cpp index 562ad717d54..b8eca21c50f 100644 --- a/Applications/DataExplorer/DataView/ElementTreeModel.cpp +++ b/Applications/DataExplorer/DataView/ElementTreeModel.cpp @@ -144,7 +144,7 @@ void ElementTreeModel::setMesh(MeshLib::Mesh const*const mesh) TreeItem* aabb_item = new TreeItem(bounding_box, _rootItem); _rootItem->appendChild(aabb_item); - const GeoLib::AABB<MeshLib::Node> aabb (MeshLib::MeshInformation::getBoundingBox(*mesh)); + const GeoLib::AABB aabb (MeshLib::MeshInformation::getBoundingBox(*mesh)); auto const& min = aabb.getMinPoint(); auto const& max = aabb.getMaxPoint(); diff --git a/Applications/DataExplorer/DataView/MeshElementRemovalDialog.cpp b/Applications/DataExplorer/DataView/MeshElementRemovalDialog.cpp index b55b23d6a03..e366ecf6c4b 100644 --- a/Applications/DataExplorer/DataView/MeshElementRemovalDialog.cpp +++ b/Applications/DataExplorer/DataView/MeshElementRemovalDialog.cpp @@ -80,7 +80,7 @@ void MeshElementRemovalDialog::accept() if (this->boundingBoxCheckBox->isChecked()) { std::vector<MeshLib::Node*> const& nodes (_project.getMesh(this->meshNameComboBox->currentText().toStdString())->getNodes()); - GeoLib::AABB<MeshLib::Node> const aabb(nodes.begin(), nodes.end()); + GeoLib::AABB const aabb(nodes.begin(), nodes.end()); auto minAABB = aabb.getMinPoint(); auto maxAABB = aabb.getMaxPoint(); @@ -94,7 +94,7 @@ void MeshElementRemovalDialog::accept() std::vector<MathLib::Point3d> extent; extent.push_back(minAABB); extent.push_back(maxAABB); - const GeoLib::AABB<MathLib::Point3d> updated_aabb(extent.begin(), extent.end()); + const GeoLib::AABB updated_aabb(extent.begin(), extent.end()); ex.searchByBoundingBox(updated_aabb); anything_checked = true; } @@ -144,7 +144,7 @@ void MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(bool is_checked) { _aabbIndex = _currentIndex; std::vector<MeshLib::Node*> const& nodes (_project.getMesh(this->meshNameComboBox->currentText().toStdString())->getNodes()); - GeoLib::AABB<MeshLib::Node> aabb(nodes.begin(), nodes.end()); + GeoLib::AABB aabb(nodes.begin(), nodes.end()); auto const& minAABB = aabb.getMinPoint(); auto const& maxAABB = aabb.getMaxPoint(); this->xMinEdit->setText(QString::number(minAABB[0], 'f')); diff --git a/Applications/Utils/MeshEdit/MoveMesh.cpp b/Applications/Utils/MeshEdit/MoveMesh.cpp index dc99726ab00..b86ac7d165f 100644 --- a/Applications/Utils/MeshEdit/MoveMesh.cpp +++ b/Applications/Utils/MeshEdit/MoveMesh.cpp @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) if (fabs(x_arg.getValue()) < std::numeric_limits<double>::epsilon() && fabs(y_arg.getValue()) < std::numeric_limits<double>::epsilon() && fabs(z_arg.getValue()) < std::numeric_limits<double>::epsilon()) { - GeoLib::AABB<MeshLib::Node> aabb(mesh->getNodes().begin(), mesh->getNodes().end()); + GeoLib::AABB aabb(mesh->getNodes().begin(), mesh->getNodes().end()); displacement[0] = -(aabb.getMaxPoint()[0] + aabb.getMinPoint()[0])/2.0; displacement[1] = -(aabb.getMaxPoint()[1] + aabb.getMinPoint()[1])/2.0; displacement[2] = -(aabb.getMaxPoint()[2] + aabb.getMinPoint()[2])/2.0; diff --git a/Applications/Utils/MeshEdit/checkMesh.cpp b/Applications/Utils/MeshEdit/checkMesh.cpp index 4b4604ea933..e4e4f01c425 100644 --- a/Applications/Utils/MeshEdit/checkMesh.cpp +++ b/Applications/Utils/MeshEdit/checkMesh.cpp @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) INFO ("Time for reading: %g s", run_time.elapsed()); // Geometric information - const GeoLib::AABB<MeshLib::Node> aabb(MeshLib::MeshInformation::getBoundingBox(*mesh)); + const GeoLib::AABB aabb(MeshLib::MeshInformation::getBoundingBox(*mesh)); auto minPt(aabb.getMinPoint()); auto maxPt(aabb.getMaxPoint()); INFO("Node coordinates:"); diff --git a/Applications/Utils/MeshEdit/moveMeshNodes.cpp b/Applications/Utils/MeshEdit/moveMeshNodes.cpp index 84879cd68c9..0015dc4cfcb 100644 --- a/Applications/Utils/MeshEdit/moveMeshNodes.cpp +++ b/Applications/Utils/MeshEdit/moveMeshNodes.cpp @@ -140,7 +140,7 @@ int main (int argc, char* argv[]) double offset (0.0); // additional offset for elevation (should be 0) MeshLib::Mesh* ground_truth (FileIO::readMeshFromFile(value)); const std::vector<MeshLib::Node*> ground_truth_nodes (ground_truth->getNodes()); - GeoLib::AABB<MeshLib::Node> bounding_box(ground_truth_nodes.begin(), ground_truth_nodes.end()); + GeoLib::AABB bounding_box(ground_truth_nodes.begin(), ground_truth_nodes.end()); MathLib::Point3d const& min(bounding_box.getMinPoint()); MathLib::Point3d const& max(bounding_box.getMaxPoint()); diff --git a/Applications/Utils/MeshEdit/removeMeshElements.cpp b/Applications/Utils/MeshEdit/removeMeshElements.cpp index 71d1f853a2d..20f4ab29f36 100644 --- a/Applications/Utils/MeshEdit/removeMeshElements.cpp +++ b/Applications/Utils/MeshEdit/removeMeshElements.cpp @@ -138,7 +138,7 @@ int main (int argc, char* argv[]) MathLib::Point3d(std::array<double,3>{{xLargeArg.getValue(), yLargeArg.getValue(), zLargeArg.getValue()}})}}); const std::size_t n_removed_elements = ex.searchByBoundingBox( - GeoLib::AABB<MathLib::Point3d>(extent.begin(), extent.end())); + GeoLib::AABB(extent.begin(), extent.end())); INFO("%d elements found.", n_removed_elements); } diff --git a/GeoLib/Grid.h b/GeoLib/Grid.h index d7e732c02e2..1e7f55d3ba0 100644 --- a/GeoLib/Grid.h +++ b/GeoLib/Grid.h @@ -32,7 +32,7 @@ namespace GeoLib { template <typename POINT> -class Grid : public GeoLib::AABB<POINT> +class Grid : public GeoLib::AABB { public: /** @@ -179,7 +179,7 @@ template <typename POINT> template <typename InputIterator> Grid<POINT>::Grid(InputIterator first, InputIterator last, std::size_t max_num_per_grid_cell) - : GeoLib::AABB<POINT>(first, last), _n_steps({{1,1,1}}), + : GeoLib::AABB(first, last), _n_steps({{1,1,1}}), _step_sizes({{0.0,0.0,0.0}}), _inverse_step_sizes({{0.0,0.0,0.0}}), _grid_cell_nodes_map(nullptr) { diff --git a/GeoLib/PointVec.h b/GeoLib/PointVec.h index b2270bbf890..dd2a42b57ed 100644 --- a/GeoLib/PointVec.h +++ b/GeoLib/PointVec.h @@ -100,7 +100,7 @@ public: const std::vector<std::size_t>& getIDMap () const { return _pnt_id_map; } - const GeoLib::AABB<GeoLib::Point>& getAABB () const; + const GeoLib::AABB& getAABB () const; std::string const& getItemNameByID(std::size_t id) const; @@ -136,7 +136,7 @@ private: /// given point id. std::vector<std::string> _id_to_name_map; - AABB<GeoLib::Point> _aabb; + AABB _aabb; double _rel_eps; std::unique_ptr<GeoLib::OctTree<GeoLib::Point, 16>> _oct_tree; }; diff --git a/GeoLib/Polygon.h b/GeoLib/Polygon.h index 82ad848594f..e23b6b29c96 100644 --- a/GeoLib/Polygon.h +++ b/GeoLib/Polygon.h @@ -138,7 +138,7 @@ private: void splitPolygonAtIntersection (std::list<Polygon*>::iterator polygon_it); void splitPolygonAtPoint (std::list<Polygon*>::iterator polygon_it); std::list<Polygon*> _simple_polygon_list; - AABB<GeoLib::Point> _aabb; + AABB _aabb; }; /** diff --git a/GeoLib/Surface.cpp b/GeoLib/Surface.cpp index b731921ab35..34c1d7ad345 100644 --- a/GeoLib/Surface.cpp +++ b/GeoLib/Surface.cpp @@ -58,7 +58,7 @@ void Surface::addTriangle(std::size_t pnt_a, std::size_t pnt_b, std::size_t pnt_ ids[0] = pnt_a; ids[1] = pnt_b; ids[2] = pnt_c; - _bounding_volume = new AABB<Point>(_sfc_pnts, ids); + _bounding_volume = new AABB(_sfc_pnts, ids); if (_surface_grid == nullptr) { _surface_grid = new SurfaceGrid(this); } diff --git a/GeoLib/Surface.h b/GeoLib/Surface.h index 806b1903b4b..1d84ea11c0c 100644 --- a/GeoLib/Surface.h +++ b/GeoLib/Surface.h @@ -87,7 +87,7 @@ public: * method allows access to the internal axis aligned bounding box * @return axis aligned bounding box */ - AABB<GeoLib::Point> const& getAABB () const { return *_bounding_volume; } + AABB const& getAABB () const { return *_bounding_volume; } protected: /** a vector of pointers to Points */ @@ -95,7 +95,7 @@ protected: /** position of pointers to the geometric points */ std::vector<Triangle*> _sfc_triangles; /** bounding volume is an axis aligned bounding box */ - AABB<GeoLib::Point> *_bounding_volume; + AABB *_bounding_volume; /** a helper structure to accelerate the search */ SurfaceGrid * _surface_grid; }; diff --git a/GeoLib/SurfaceGrid.h b/GeoLib/SurfaceGrid.h index 76e12ed768a..4c82d2a3f12 100644 --- a/GeoLib/SurfaceGrid.h +++ b/GeoLib/SurfaceGrid.h @@ -27,7 +27,7 @@ namespace GeoLib { class Triangle; class Surface; -class SurfaceGrid : public AABB<GeoLib::Point> { +class SurfaceGrid : public AABB { public: explicit SurfaceGrid(GeoLib::Surface const*const sfc); bool isPointInSurface(MathLib::Point3d const & pnt, diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp index 1fc01de8d3d..f599f41b30c 100644 --- a/MeshGeoToolsLib/GeoMapper.cpp +++ b/MeshGeoToolsLib/GeoMapper.cpp @@ -110,7 +110,7 @@ void GeoMapper::mapData() double min_val(0), max_val(0); if (_surface_mesh) { - GeoLib::AABB<MeshLib::Node> bounding_box( + GeoLib::AABB bounding_box( _surface_mesh->getNodes().begin(), _surface_mesh->getNodes().end()); min_val = bounding_box.getMinPoint()[2]; max_val = bounding_box.getMaxPoint()[2]; @@ -217,7 +217,7 @@ void GeoMapper::advancedMapOnMesh( const std::vector<GeoLib::Point*> *points (this->_geo_objects.getPointVec(this->_geo_name)); const std::vector<GeoLib::Polyline*> *org_lines (this->_geo_objects.getPolylineVec(this->_geo_name)); - const GeoLib::AABB<GeoLib::Point> aabb(points->begin(), points->end()); + const GeoLib::AABB aabb(points->begin(), points->end()); const double eps = sqrt(std::numeric_limits<float>::epsilon()) * sqrt( MathLib::sqrDist(aabb.getMinPoint(),aabb.getMaxPoint())) ; diff --git a/MeshLib/CoordinateSystem.cpp b/MeshLib/CoordinateSystem.cpp index 03209a90fed..6a20fe66450 100644 --- a/MeshLib/CoordinateSystem.cpp +++ b/MeshLib/CoordinateSystem.cpp @@ -16,9 +16,8 @@ namespace MeshLib CoordinateSystem::CoordinateSystem(const Element &ele) { - const GeoLib::AABB<MeshLib::Node> aabb(ele.getNodes(), - ele.getNodes()+ele.getNNodes()); - const CoordinateSystem bboxCoordSys(getCoordinateSystem(aabb)); + GeoLib::AABB const aabb(ele.getNodes(), ele.getNodes() + ele.getNNodes()); + CoordinateSystem const bboxCoordSys(getCoordinateSystem(aabb)); if (bboxCoordSys.getDimension() >= ele.getDimension()) { _type = bboxCoordSys.getType(); } else { // e.g. zero volume elements @@ -31,4 +30,23 @@ CoordinateSystem::CoordinateSystem(const Element &ele) } } +unsigned char CoordinateSystem::getCoordinateSystem(const GeoLib::AABB &bbox) const +{ + unsigned char coords = 0; + + const MathLib::Vector3 pt_diff(bbox.getMinPoint(), bbox.getMaxPoint()); + + // The axis aligned bounding box is a from the right half-open interval. + // Therefore, the difference between the particular coordinates of the + // points is modified by the unit in the last place towards zero. + if (std::nexttoward(std::abs(pt_diff[0]), 0.0) > .0) + coords |= CoordinateSystemType::X; + if (std::nexttoward(std::abs(pt_diff[1]), 0.0) > .0) + coords |= CoordinateSystemType::Y; + if (std::nexttoward(std::abs(pt_diff[2]), 0.0) > .0) + coords |= CoordinateSystemType::Z; + + return coords; +} + } // end diff --git a/MeshLib/CoordinateSystem.h b/MeshLib/CoordinateSystem.h index 8b244788166..2b2dc03fe8b 100644 --- a/MeshLib/CoordinateSystem.h +++ b/MeshLib/CoordinateSystem.h @@ -47,8 +47,7 @@ public: explicit CoordinateSystem(const Element &ele); /// Decides a coordinate system from a bounding box - template <class T> - explicit CoordinateSystem(const GeoLib::AABB<T> &bbox) : _type(getCoordinateSystem(bbox)) {} + explicit CoordinateSystem(const GeoLib::AABB &bbox) : _type(getCoordinateSystem(bbox)) {} /// get this coordinate type unsigned char getType() const { return _type; } @@ -73,32 +72,11 @@ public: bool hasZ() const { return (_type & CoordinateSystemType::type::Z) != 0; } private: - template <class T> - unsigned char getCoordinateSystem(const GeoLib::AABB<T> &bbox) const; + unsigned char getCoordinateSystem(const GeoLib::AABB &bbox) const; unsigned char _type; }; -template <class T> -unsigned char CoordinateSystem::getCoordinateSystem(const GeoLib::AABB<T> &bbox) const -{ - unsigned char coords = 0; - - const MathLib::Vector3 pt_diff(bbox.getMinPoint(), bbox.getMaxPoint()); - - // The axis aligned bounding box is a from the right half-open interval. - // Therefore, the difference between the particular coordinates of the - // points is modified by the unit in the last place towards zero. - if (std::nexttoward(std::abs(pt_diff[0]), 0.0) > .0) - coords |= CoordinateSystemType::X; - if (std::nexttoward(std::abs(pt_diff[1]), 0.0) > .0) - coords |= CoordinateSystemType::Y; - if (std::nexttoward(std::abs(pt_diff[2]), 0.0) > .0) - coords |= CoordinateSystemType::Z; - - return coords; -} - } // MeshLib #endif // COORDINATESYSTEMTYPE_H_ diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp index 9fa0f45b899..277b76c1361 100644 --- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp +++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp @@ -48,8 +48,8 @@ bool Mesh2MeshPropertyInterpolation::setPropertiesForMesh(Mesh *dest_mesh, std:: return false; } - GeoLib::AABB<MeshLib::Node> src_aabb(_src_mesh->getNodes().begin(), _src_mesh->getNodes().end()); - GeoLib::AABB<MeshLib::Node> dest_aabb(dest_mesh->getNodes().begin(), dest_mesh->getNodes().end()); + GeoLib::AABB src_aabb(_src_mesh->getNodes().begin(), _src_mesh->getNodes().end()); + GeoLib::AABB dest_aabb(dest_mesh->getNodes().begin(), dest_mesh->getNodes().end()); if (!src_aabb.containsAABB(dest_aabb)) { ERR("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() source mesh to small."); ERR("src_aabb: %f, %f, %f | %f, %f, %f", src_aabb.getMinPoint()[0], src_aabb.getMinPoint()[1], src_aabb.getMinPoint()[2], src_aabb.getMaxPoint()[0], src_aabb.getMaxPoint()[1], src_aabb.getMaxPoint()[2]); @@ -89,7 +89,7 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mes for (std::size_t k(0); k<n_dest_elements; k++) { // compute axis aligned bounding box around the current element - const GeoLib::AABB<MeshLib::Node> elem_aabb(dest_elements[k]->getNodes(), dest_elements[k]->getNodes()+dest_elements[k]->getNBaseNodes()); + const GeoLib::AABB elem_aabb(dest_elements[k]->getNodes(), dest_elements[k]->getNodes()+dest_elements[k]->getNBaseNodes()); // request "interesting" nodes from grid std::vector<std::vector<MeshLib::Node*> const*> nodes; diff --git a/MeshLib/MeshInformation.cpp b/MeshLib/MeshInformation.cpp index cca73112f41..aae6d36b94a 100644 --- a/MeshLib/MeshInformation.cpp +++ b/MeshLib/MeshInformation.cpp @@ -37,10 +37,10 @@ const std::pair<int, int> MeshInformation::getValueBounds(const MeshLib::Mesh &m return {*(mat_bounds.first), *(mat_bounds.second)}; } -const GeoLib::AABB<MeshLib::Node> MeshInformation::getBoundingBox(const MeshLib::Mesh &mesh) +const GeoLib::AABB MeshInformation::getBoundingBox(const MeshLib::Mesh &mesh) { const std::vector<MeshLib::Node*> &nodes (mesh.getNodes()); - return GeoLib::AABB<MeshLib::Node>(nodes.begin(), nodes.end()); + return GeoLib::AABB(nodes.begin(), nodes.end()); } const std::array<unsigned, 7> MeshInformation::getNumberOfElementTypes(const MeshLib::Mesh &mesh) diff --git a/MeshLib/MeshInformation.h b/MeshLib/MeshInformation.h index fb542e4b6b9..8203a836aae 100644 --- a/MeshLib/MeshInformation.h +++ b/MeshLib/MeshInformation.h @@ -33,7 +33,7 @@ public: static const std::pair<int, int> getValueBounds(const MeshLib::Mesh &mesh); /// Returns the bounding box of the mesh. - static const GeoLib::AABB<MeshLib::Node> getBoundingBox(const MeshLib::Mesh &mesh); + static const GeoLib::AABB getBoundingBox(const MeshLib::Mesh &mesh); /** * Returns an array with the number of elements of each type in the given mesh. diff --git a/MeshLib/MeshSearch/ElementSearch.cpp b/MeshLib/MeshSearch/ElementSearch.cpp index e31d1eb6c85..9f9fae0bfa9 100644 --- a/MeshLib/MeshSearch/ElementSearch.cpp +++ b/MeshLib/MeshSearch/ElementSearch.cpp @@ -74,7 +74,7 @@ std::size_t ElementSearch::searchByContent(double eps) } std::size_t ElementSearch::searchByBoundingBox( - GeoLib::AABB<MathLib::Point3d> const& aabb) + GeoLib::AABB const& aabb) { auto matchedIDs = filter(_mesh.getElements(), [&aabb](MeshLib::Element* e) { diff --git a/MeshLib/MeshSearch/ElementSearch.h b/MeshLib/MeshSearch/ElementSearch.h index 724743e3d48..f086e8f2c64 100644 --- a/MeshLib/MeshSearch/ElementSearch.h +++ b/MeshLib/MeshSearch/ElementSearch.h @@ -41,7 +41,7 @@ public: std::size_t searchByContent(double eps = std::numeric_limits<double>::epsilon()); /// Marks all elements with at least one node outside the bounding box spanned by x1 and x2; - std::size_t searchByBoundingBox(GeoLib::AABB<MathLib::Point3d> const& aabb); + std::size_t searchByBoundingBox(GeoLib::AABB const& aabb); /// Marks all elements connecting to any of the given nodes std::size_t searchByNodeIDs(const std::vector<std::size_t> &node_ids); diff --git a/Tests/GeoLib/TestAABB.cpp b/Tests/GeoLib/TestAABB.cpp index b7fe841c632..d851f228da5 100644 --- a/Tests/GeoLib/TestAABB.cpp +++ b/Tests/GeoLib/TestAABB.cpp @@ -40,7 +40,7 @@ TEST(GeoLibAABB, RandomNumberOfPointersToRandomPoints) } // construct from list points a axis algined bounding box - GeoLib::AABB<GeoLib::Point> aabb(pnts_list.begin(), pnts_list.end()); + GeoLib::AABB aabb(pnts_list.begin(), pnts_list.end()); MathLib::Point3d const& min_pnt(aabb.getMinPoint()); MathLib::Point3d const& max_pnt(aabb.getMaxPoint()); @@ -76,7 +76,7 @@ TEST(GeoLibAABB, RandomNumberOfPointsRandomPointInAList) } // construct from list points a axis algined bounding box - GeoLib::AABB<GeoLib::Point> aabb(pnts_list.begin(), pnts_list.end()); + GeoLib::AABB aabb(pnts_list.begin(), pnts_list.end()); MathLib::Point3d const& min_pnt(aabb.getMinPoint()); MathLib::Point3d const& max_pnt(aabb.getMaxPoint()); @@ -108,7 +108,7 @@ TEST(GeoLibAABB, RandomNumberOfPointersToRandomPointsInAVector) } // construct from list points a axis aligned bounding box - GeoLib::AABB<GeoLib::Point> aabb(pnts.begin(), pnts.end()); + GeoLib::AABB aabb(pnts.begin(), pnts.end()); MathLib::Point3d const& min_pnt(aabb.getMinPoint()); MathLib::Point3d const& max_pnt(aabb.getMaxPoint()); @@ -144,7 +144,7 @@ TEST(GeoLibAABB, RandomNumberOfPointsRandomPointInAVector) } // construct from list points a axis algined bounding box - GeoLib::AABB<GeoLib::Point> aabb(pnts.begin(), pnts.end()); + GeoLib::AABB aabb(pnts.begin(), pnts.end()); MathLib::Point3d const& min_pnt(aabb.getMinPoint()); MathLib::Point3d const& max_pnt(aabb.getMaxPoint()); @@ -182,7 +182,7 @@ TEST(GeoLibAABB, RandomNumberOfPointsRandomBox) } // construct from list points a axis aligned bounding box - GeoLib::AABB<GeoLib::Point> aabb(pnts.begin(), pnts.end()); + GeoLib::AABB aabb(pnts.begin(), pnts.end()); MathLib::Point3d const& min_pnt(aabb.getMinPoint()); MathLib::Point3d const& max_pnt(aabb.getMaxPoint()); @@ -209,7 +209,7 @@ TEST(GeoLib, AABBAllPointsWithNegativeCoordinatesI) std::vector<std::size_t> ids; ids.push_back(0); ids.push_back(1); - GeoLib::AABB<GeoLib::Point> aabb(pnts, ids); + GeoLib::AABB aabb(pnts, ids); MathLib::Point3d const& max_pnt(aabb.getMaxPoint()); @@ -229,7 +229,7 @@ TEST(GeoLib, AABBAllPointsWithNegativeCoordinatesII) pnts.push_back(GeoLib::Point(-10, -10, -10)); // construct from points of the vector a axis aligned bounding box - GeoLib::AABB<GeoLib::Point> aabb(pnts.begin(), pnts.end()); + GeoLib::AABB aabb(pnts.begin(), pnts.end()); MathLib::Point3d const& max_pnt(aabb.getMaxPoint()); @@ -254,7 +254,7 @@ TEST(GeoLib, AABBSinglePoint) ASSERT_EQ(1u, pnts.size()); // construct from points of the vector a axis aligned bounding box - GeoLib::AABB<GeoLib::Point> aabb(pnts.begin(), pnts.end()); + GeoLib::AABB aabb(pnts.begin(), pnts.end()); double const to_lowest(std::numeric_limits<double>::lowest()); double const to_max(std::numeric_limits<double>::max()); diff --git a/Tests/GeoLib/TestOctTree.cpp b/Tests/GeoLib/TestOctTree.cpp index 9229bee20d9..b8f06ac0289 100644 --- a/Tests/GeoLib/TestOctTree.cpp +++ b/Tests/GeoLib/TestOctTree.cpp @@ -257,7 +257,7 @@ TEST_F(GeoLibOctTree, TestWithAlternatingPoints3d) ps_ptr.push_back(new GeoLib::Point(6*small_displacement,0,0,5)); ps_ptr.push_back(new GeoLib::Point(5*small_displacement,1,0,6)); - GeoLib::AABB<GeoLib::Point> const aabb(ps_ptr.cbegin(), ps_ptr.cend()); + GeoLib::AABB const aabb(ps_ptr.cbegin(), ps_ptr.cend()); MathLib::Point3d min(aabb.getMinPoint()); MathLib::Point3d max(aabb.getMaxPoint()); std::unique_ptr<GeoLib::OctTree<GeoLib::Point, 8>> oct_tree( @@ -308,7 +308,7 @@ TEST_F(GeoLibOctTree, TestSmallDistanceDifferentLeaves) } // create OctTree - GeoLib::AABB<GeoLib::Point> const aabb(ps_ptr.cbegin(), ps_ptr.cend()); + GeoLib::AABB const aabb(ps_ptr.cbegin(), ps_ptr.cend()); MathLib::Point3d min(aabb.getMinPoint()); MathLib::Point3d max(aabb.getMaxPoint()); std::unique_ptr<GeoLib::OctTree<GeoLib::Point, 2>> oct_tree( @@ -339,7 +339,7 @@ TEST_F(GeoLibOctTree, TestOctTreeWithTwoEqualPoints) ps_ptr.push_back(new GeoLib::Point(0,0,0,1)); double const eps(0.0); - GeoLib::AABB<GeoLib::Point> aabb(ps_ptr.begin(), ps_ptr.end()); + GeoLib::AABB aabb(ps_ptr.begin(), ps_ptr.end()); std::unique_ptr<GeoLib::OctTree<GeoLib::Point, 2>> oct_tree( GeoLib::OctTree<GeoLib::Point, 2>::createOctTree( aabb.getMinPoint(), aabb.getMaxPoint(), eps)); @@ -357,7 +357,7 @@ TEST_F(GeoLibOctTree, TestOctTreeWithTwoEqualPointsOne) ps_ptr.push_back(new GeoLib::Point(1,1,1,1)); double const eps(0.0); - GeoLib::AABB<GeoLib::Point> aabb(ps_ptr.begin(), ps_ptr.end()); + GeoLib::AABB aabb(ps_ptr.begin(), ps_ptr.end()); std::unique_ptr<GeoLib::OctTree<GeoLib::Point, 2>> oct_tree( GeoLib::OctTree<GeoLib::Point, 2>::createOctTree( aabb.getMinPoint(), aabb.getMaxPoint(), eps)); @@ -375,7 +375,7 @@ TEST_F(GeoLibOctTree, TestOctTreeOnCubicDomain) ps_ptr.push_back(new GeoLib::Point(1,1,1,1)); double const eps(0.0); - GeoLib::AABB<GeoLib::Point> aabb(ps_ptr.begin(), ps_ptr.end()); + GeoLib::AABB aabb(ps_ptr.begin(), ps_ptr.end()); std::unique_ptr<GeoLib::OctTree<GeoLib::Point, 2>> oct_tree( GeoLib::OctTree<GeoLib::Point, 2>::createOctTree( aabb.getMinPoint(), aabb.getMaxPoint(), eps)); -- GitLab