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

added method AABB::containsAABB() that checks if another AABB object is inside...

added method AABB::containsAABB() that checks if another AABB object is inside this AABB and added documentation to two other methods
parent 4f4f47ce
No related branches found
No related tags found
No related merge requests found
......@@ -86,4 +86,15 @@ bool AABB::containsPoint (double x, double y, double z, double eps) const
} else return false;
}
bool AABB::containsAABB (AABB const& other_aabb) const
{
GeoLib::Point const& min_other(other_aabb.getMinPoint());
GeoLib::Point const& max_other(other_aabb.getMaxPoint());
for (unsigned k(0); k<3; k++) {
if (_min_pnt[k] > min_other[k] || max_other[k] > _max_pnt[k])
return false;
}
return true;
}
} // end namespace GeoLib
......@@ -79,9 +79,29 @@ public:
bool containsPoint(double x, double y, double z, double eps =
std::numeric_limits<double>::epsilon()) const;
/**
* returns a point that coordinates are minimal for each dimension
* for the given point set
* @return a point
*/
GeoLib::Point const& getMinPoint () const { return _min_pnt; }
/**
* returns a point that coordinates are maximal for each dimension
* within the given point set
* @return a point
*/
GeoLib::Point const& getMaxPoint () const { return _max_pnt; }
/**
* Method checks if the given AABB object is contained within the
* AABB represented by this object.
* @param other the AABB to test with
* @return true if the other AABB is contained in the AABB
* represented by this object
*/
bool containsAABB (AABB const& other) const;
protected:
GeoLib::Point _min_pnt;
GeoLib::Point _max_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