Skip to content
Snippets Groups Projects
Commit 7ee38c0d authored by Tom Fischer's avatar Tom Fischer
Browse files

[GL] AABB: Init. of _min_pnt / _max_pnt to var. declaration.

parent 331976e8
No related branches found
No related tags found
No related merge requests found
...@@ -41,13 +41,7 @@ public: ...@@ -41,13 +41,7 @@ public:
/** /**
* construction of object, initialization the axis aligned bounding box * construction of object, initialization the axis aligned bounding box
* */ * */
AABB(std::vector<PNT_TYPE*> const& pnts, std::vector<std::size_t> const& ids) : AABB(std::vector<PNT_TYPE*> const& pnts, std::vector<std::size_t> const& ids)
_min_pnt(std::array<double,3>{{std::numeric_limits<double>::max(),
std::numeric_limits<double>::max(),
std::numeric_limits<double>::max()}}),
_max_pnt(std::array<double,3>{{std::numeric_limits<double>::lowest(),
std::numeric_limits<double>::lowest(),
std::numeric_limits<double>::lowest()}})
{ {
assert(! ids.empty()); assert(! ids.empty());
init(pnts[ids[0]]); init(pnts[ids[0]]);
...@@ -74,13 +68,7 @@ public: ...@@ -74,13 +68,7 @@ public:
* @attention{The iterator last must be reachable from first.} * @attention{The iterator last must be reachable from first.}
*/ */
template <typename InputIterator> template <typename InputIterator>
AABB(InputIterator first, InputIterator last) : AABB(InputIterator first, InputIterator last)
_min_pnt(std::array<double,3>{{std::numeric_limits<double>::max(),
std::numeric_limits<double>::max(),
std::numeric_limits<double>::max()}}),
_max_pnt(std::array<double,3>{{std::numeric_limits<double>::lowest(),
std::numeric_limits<double>::lowest(),
std::numeric_limits<double>::lowest()}})
{ {
if (! (std::distance(first,last) > 0)) { if (! (std::distance(first,last) > 0)) {
throw std::invalid_argument("AABB::AABB(InputIterator first, InputIterator last): first == last"); throw std::invalid_argument("AABB::AABB(InputIterator first, InputIterator last): first == last");
...@@ -142,8 +130,14 @@ public: ...@@ -142,8 +130,14 @@ public:
} }
protected: protected:
MathLib::Point3d _min_pnt; MathLib::Point3d _min_pnt = std::array<double,3>{{
MathLib::Point3d _max_pnt; std::numeric_limits<double>::max(),
std::numeric_limits<double>::max(),
std::numeric_limits<double>::max()}};
MathLib::Point3d _max_pnt = std::array<double,3>{{
std::numeric_limits<double>::lowest(),
std::numeric_limits<double>::lowest(),
std::numeric_limits<double>::lowest()}};
private: private:
void init(PNT_TYPE const & pnt) void init(PNT_TYPE const & pnt)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment