2012-05-11 12:21:47 +10:00
|
|
|
#include "../region.hpp"
|
2012-06-08 16:48:33 +10:00
|
|
|
#include "../point.hpp"
|
2012-05-26 18:01:54 +10:00
|
|
|
#include "../debug.hpp"
|
2012-05-11 12:21:47 +10:00
|
|
|
|
2015-03-03 04:13:29 +11:00
|
|
|
using namespace util;
|
2012-05-11 12:21:47 +10:00
|
|
|
|
|
|
|
int
|
|
|
|
main (int, char **) {
|
|
|
|
{
|
2015-03-03 04:13:29 +11:00
|
|
|
region2d a {32.7, -6.09703, 0.8, 2};
|
|
|
|
region2d b {33.5, -4.5, 0.5, 0.5};
|
2012-05-11 12:21:47 +10:00
|
|
|
|
2015-01-28 14:49:34 +11:00
|
|
|
CHECK (!a.intersects (b));
|
2012-05-11 12:21:47 +10:00
|
|
|
}
|
|
|
|
|
2015-03-03 04:13:29 +11:00
|
|
|
CHECK (region2d::MAX.intersects (region2d::UNIT));
|
|
|
|
CHECK (region2f::MAX.intersects (region2f::UNIT));
|
2012-06-15 16:38:57 +10:00
|
|
|
|
2015-03-03 04:13:29 +11:00
|
|
|
CHECK_EQ (region2d::UNIT.area (), 1.0);
|
|
|
|
CHECK_EQ (region2f::UNIT.area (), 1.0f);
|
2012-06-15 16:38:57 +10:00
|
|
|
|
2015-03-03 04:13:29 +11:00
|
|
|
CHECK (region2u (0, 0, 2, 2).includes (point2u {1, 1}));
|
|
|
|
CHECK (region2u (0, 0, 2, 2).includes (point2u {0, 0}));
|
|
|
|
CHECK (region2u (0, 0, 2, 2).includes (point2u {2, 2}));
|
2012-06-08 16:48:33 +10:00
|
|
|
|
2015-03-03 04:13:29 +11:00
|
|
|
CHECK ( region2u (0, 0, 2, 2).contains (point2u {1, 1}));
|
|
|
|
CHECK (!region2u (0, 0, 2, 2).contains (point2u {0, 0}));
|
|
|
|
CHECK (!region2u (0, 0, 2, 2).contains (point2u {2, 2}));
|
2012-06-08 16:48:33 +10:00
|
|
|
|
2015-03-03 04:13:29 +11:00
|
|
|
//CHECK (region<2,intmax_t> (0, 0, 10, 10).includes (point2d (0.4, 0.01)));
|
|
|
|
//CHECK (region<2,intmax_t> (0, 0, 10, 10).contains (point2d (0.4, 0.01)));
|
2012-06-08 16:48:33 +10:00
|
|
|
|
2012-05-11 12:21:47 +10:00
|
|
|
return 0;
|
|
|
|
}
|