mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 21:44:04 +00:00
[geometry] pending commit, added check for within/disjoint, 3d boxes
[SVN r83527]
This commit is contained in:
parent
ffbf792eb8
commit
2ca66acb56
@ -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* [])
|
int test_main(int, char* [])
|
||||||
{
|
{
|
||||||
test_all<bg::model::d2::point_xy<float> >();
|
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> >();
|
test_all<bg::model::d2::point_xy<ttmath_big> >();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
test_3d<bg::model::point<double, 3, bg::cs::cartesian> >();
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -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, 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, 4), box), false);
|
||||||
BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 5), 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>
|
template <typename P1, typename P2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user