some work on util

This commit is contained in:
Patrick Brosi 2018-07-12 14:23:29 +02:00
parent cf79e67631
commit b07110840e
9 changed files with 523 additions and 1207 deletions

View file

@ -8,17 +8,22 @@
#include "./Point.h"
namespace util {
namespace geon {
namespace geo {
template <typename T>
class Box {
public:
// maximum inverse box as default value of box
Box() : _ll(std::numeric_limits<T>::max), _ur(std::numeric_limits<T>::min) {}
Box()
: _ll(std::numeric_limits<T>::max(), std::numeric_limits<T>::max()),
_ur(std::numeric_limits<T>::min(), std::numeric_limits<T>::min()) {}
Box(const Point<T>& ll, const Point<T>& ur) : _ll(ll), _ur(ur) {}
const Point<T>& getLowerLeft() const { return _ll; }
const Point<T>& getUpperRight() const { return _ur; }
Point<T>& getLowerLeft() { return _ll; }
Point<T>& getUpperRight() { return _ur; }
void setLowerLeft(const Point<T>& ll) { _ll = ll; }
void setUpperRight(const Point<T>& ur) { _ur = ur; }
@ -33,7 +38,7 @@ class Box {
Point<T> _ll, _ur;
};
} // namespace geon
} // namespace geo
} // namespace util
#endif // UTIL_GEO_BOX_H_