35 #define BOOST_TEST_MODULE COAL_DISTANCE_LOWER_BOUND
36 #include <boost/test/included/unit_test.hpp>
37 #include <boost/filesystem.hpp>
47 #include "fcl_resources/config.h"
58 using coal::shared_ptr;
116 std::vector<Vec3s>
p1, p2;
117 std::vector<Triangle> t1,
t2;
127 m1->addSubModel(
p1, t1);
131 m2->addSubModel(p2,
t2);
134 std::vector<Transform3s> transforms;
141 for (std::size_t i = 0; i < transforms.size(); ++i) {
143 bool col1, col2, col3;
147 std::cout <<
"col1 = " << col1 <<
", col2 = " << col2 <<
", col3 = " << col3
149 std::cout <<
"distance lower bound = " << distanceLowerBound << std::endl;
150 std::cout <<
"distance = " <<
distance << std::endl;
151 BOOST_CHECK(col1 == col3);
153 BOOST_CHECK_MESSAGE(distanceLowerBound <=
distance,
154 "distance = " <<
distance <<
", lower bound = "
155 << distanceLowerBound);
169 std::vector<Transform3s> transforms;
171 const std::size_t n = 1000;
179 BOOST_CHECK(col1 == col2);
180 BOOST_CHECK(distanceLowerBound <=
distance);
182 for (std::size_t i = 0; i < transforms.size(); ++i) {
188 BOOST_CHECK(col1 == col2);
190 BOOST_CHECK_MESSAGE(distanceLowerBound <=
distance,
191 "distance = " <<
distance <<
", lower bound = "
192 << distanceLowerBound);
198 shared_ptr<coal::Sphere> sphere1(
new coal::Sphere(0.5));
206 std::vector<Transform3s> transforms;
208 const std::size_t n = 1000;
216 BOOST_CHECK(col1 == col2);
217 BOOST_CHECK(distanceLowerBound <=
distance);
219 for (std::size_t i = 0; i < transforms.size(); ++i) {
225 BOOST_CHECK(col1 == col2);
227 BOOST_CHECK_MESSAGE(distanceLowerBound <=
distance,
228 "distance = " <<
distance <<
", lower bound = "
229 << distanceLowerBound);
235 std::vector<Vec3s>
p1;
236 std::vector<Triangle> t1;
242 shared_ptr<coal::Box> m2(
new coal::Box(500, 200, 150));
245 m1->addSubModel(
p1, t1);
248 std::vector<Transform3s> transforms;
255 for (std::size_t i = 0; i < transforms.size(); ++i) {
260 BOOST_CHECK(col1 == col2);
262 BOOST_CHECK_MESSAGE(distanceLowerBound <=
distance,
263 "distance = " <<
distance <<
", lower bound = "
264 << distanceLowerBound);