[geometry] pending commit, added check for within/disjoint, 3d boxes

[SVN r83527]
This commit is contained in:
Barend Gehrels 2013-03-23 13:03:57 +00:00
parent ffbf792eb8
commit 2ca66acb56
2 changed files with 23 additions and 0 deletions

View File

@ -205,6 +205,22 @@ void test_all()
}
template <typename P>
void test_3d()
{
typedef bg::model::box<P> box;
test_disjoint<P, P>("pp 3d 1", "point(1 1 1)", "point(1 1 1)", false);
test_disjoint<P, P>("pp 3d 2", "point(1 1 1)", "point(1.001 1 1)", true);
test_disjoint<box, box>("bb1", "box(1 1 1, 2 2 2)", "box(3 1 1, 4 2 1)", true);
test_disjoint<box, box>("bb2", "box(1 1 1, 2 2 2)", "box(2 1 1, 3 2 1)", false);
test_disjoint<box, box>("bb3", "box(1 1 1, 2 2 2)", "box(2 2 1, 3 3 1)", false);
test_disjoint<box, box>("bb4", "box(1 1 1, 2 2 2)", "box(2.001 2 1, 3 3 1)", true);
}
int test_main(int, char* [])
{
test_all<bg::model::d2::point_xy<float> >();
@ -214,5 +230,8 @@ int test_main(int, char* [])
test_all<bg::model::d2::point_xy<ttmath_big> >();
#endif
test_3d<bg::model::point<double, 3, bg::cs::cartesian> >();
return 0;
}

View File

@ -151,6 +151,10 @@ void test_3d()
BOOST_CHECK_EQUAL(bg::within(point_type(2, 4, 2), box), false);
BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 4), box), false);
BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 5), box), false);
box_type box2(point_type(2, 2, 2), point_type(3, 3, 3));
BOOST_CHECK_EQUAL(bg::within(box2, box), false);
}
template <typename P1, typename P2>