From 233ad6ff34e49399ac904a6c86c7e8fe5e686313 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Fri, 5 Apr 2013 10:10:06 +0200 Subject: [PATCH] Renamed method isPntInBV() and private attribute. Renamed - from isPntInBV() to isPntInBoundingVolume() and - from _bv to _bounding_volume to make the code more readable. --- GeoLib/Surface.cpp | 18 +++++++++--------- GeoLib/Surface.h | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/GeoLib/Surface.cpp b/GeoLib/Surface.cpp index 1e839f69908..ae8e6316a6e 100644 --- a/GeoLib/Surface.cpp +++ b/GeoLib/Surface.cpp @@ -29,14 +29,14 @@ namespace GeoLib { Surface::Surface (const std::vector<Point*> &pnt_vec) : - GeoObject(), _sfc_pnts(pnt_vec), _bv(nullptr) + GeoObject(), _sfc_pnts(pnt_vec), _bounding_volume(nullptr) {} Surface::~Surface () { for (std::size_t k(0); k < _sfc_triangles.size(); k++) delete _sfc_triangles[k]; - delete _bv; + delete _bounding_volume; } void Surface::addTriangle (std::size_t pnt_a, std::size_t pnt_b, std::size_t pnt_c) @@ -48,16 +48,16 @@ void Surface::addTriangle (std::size_t pnt_a, std::size_t pnt_b, std::size_t pnt return; _sfc_triangles.push_back (new Triangle(_sfc_pnts, pnt_a, pnt_b, pnt_c)); - if (!_bv) { + if (!_bounding_volume) { std::vector<size_t> ids(3); ids[0] = pnt_a; ids[1] = pnt_b; ids[2] = pnt_c; - _bv = new AABB<Point>(_sfc_pnts, ids); + _bounding_volume = new AABB<Point>(_sfc_pnts, ids); } else { - _bv->update (*_sfc_pnts[pnt_a]); - _bv->update (*_sfc_pnts[pnt_b]); - _bv->update (*_sfc_pnts[pnt_c]); + _bounding_volume->update (*_sfc_pnts[pnt_a]); + _bounding_volume->update (*_sfc_pnts[pnt_b]); + _bounding_volume->update (*_sfc_pnts[pnt_c]); } } @@ -112,9 +112,9 @@ const Triangle* Surface::operator[] (std::size_t i) const return _sfc_triangles[i]; } -bool Surface::isPntInBV (const double *pnt) const +bool Surface::isPntInBoundingVolume(const double *pnt) const { - return _bv->containsPoint (pnt); + return _bounding_volume->containsPoint (pnt); } bool Surface::isPntInSfc (const double *pnt) const diff --git a/GeoLib/Surface.h b/GeoLib/Surface.h index b3aef6af265..abd3ae012f1 100644 --- a/GeoLib/Surface.h +++ b/GeoLib/Surface.h @@ -58,7 +58,7 @@ public: /** * is the given point in the bounding volume of the surface */ - bool isPntInBV (const double *pnt) const; + bool isPntInBoundingVolume(const double *pnt) const; /** * is the given point pnt located in the surface @@ -73,7 +73,7 @@ public: * method allows access to the internal axis aligned bounding box * @return axis aligned bounding box */ - AABB<GeoLib::Point> const& getAABB () const { return *_bv; } + AABB<GeoLib::Point> const& getAABB () const { return *_bounding_volume; } protected: /** a vector of pointers to Points */ @@ -81,7 +81,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> *_bv; + AABB<GeoLib::Point> *_bounding_volume; }; } -- GitLab