// Copyright 2016, University of Freiburg, // Chair of Algorithms and Data Structures. // Author: Patrick Brosi #ifndef UTIL_GEO_BOX_H_ #define UTIL_GEO_BOX_H_ #include "./Point.h" namespace util { namespace geo { template class Box { public: // maximum inverse box as default value of box Box() : _ll(std::numeric_limits::max(), std::numeric_limits::max()), _ur(std::numeric_limits::min(), std::numeric_limits::min()) {} Box(const Point& ll, const Point& ur) : _ll(ll), _ur(ur) {} const Point& getLowerLeft() const { return _ll; } const Point& getUpperRight() const { return _ur; } Point& getLowerLeft() { return _ll; } Point& getUpperRight() { return _ur; } void setLowerLeft(const Point& ll) { _ll = ll; } void setUpperRight(const Point& ur) { _ur = ur; } bool operator==(const Box& b) const { return getLowerLeft() == b.getLowerLeft() && getUpperRight == b.getUpperRight(); } bool operator!=(const Box& p) const { return !(*this == p); } private: Point _ll, _ur; }; } // namespace geo } // namespace util #endif // UTIL_GEO_BOX_H_