removed the warnings, except in one of the test cases. Working on it.

This commit is contained in:
Camille Wormser 2009-05-10 15:24:04 +00:00
parent 9f6aa6b120
commit 0f376fb294
6 changed files with 24 additions and 19 deletions

View File

@ -40,21 +40,21 @@ namespace CGALi {
template <class K>
bool do_intersect(const typename K::Sphere_3& sphere,
const CGAL::Bbox_3& bbox,
const K& kernel)
const K&)
{
typedef typename K::FT FT;
FT d = (FT)0.0;
FT distance = (FT)0.0;
FT d = 0.0;
FT distance = 0.0;
for(int i = 0; i < 3; ++i)
{
if(sphere.center()[i] < (FT)bbox.min(i))
if(sphere.center()[i] < bbox.min(i))
{
d = (FT)bbox.min(i) - sphere.center()[i];
d = bbox.min(i) - sphere.center()[i];
distance += d*d;
}
else if(sphere.center()[i] > (FT)bbox.max(i))
else if(sphere.center()[i] > bbox.max(i))
{
d = sphere.center()[i] - (FT)bbox.max(i);
d = sphere.center()[i] - bbox.max(i);
distance += d*d;
}
}

View File

@ -50,32 +50,32 @@ namespace CGALi {
for(int i = 0; i < 3; ++i) {
if(p[i] <= q[i]) {
if(q[i] <= r[i]) { // pqr
if((FT)bbox.max(i) < p[i] || (FT)bbox.min(i) > r[i])
if(bbox.max(i) < p[i] || bbox.min(i) > r[i])
return false;
}
else {
if(p[i] <= r[i]) { // prq
if((FT)bbox.max(i) < p[i] || (FT)bbox.min(i) > q[i])
if(bbox.max(i) < p[i] || bbox.min(i) > q[i])
return false;
}
else { // rpq
if((FT)bbox.max(i) < r[i] || (FT)bbox.min(i) > q[i])
if(bbox.max(i) < r[i] || bbox.min(i) > q[i])
return false;
}
}
}
else {
if(p[i] <= r[i]) { // qpr
if((FT)bbox.max(i) < q[i] || (FT)bbox.min(i) > r[i])
if(bbox.max(i) < q[i] || bbox.min(i) > r[i])
return false;
}
else {
if(q[i] <= r[i]) { // qrp
if((FT)bbox.max(i) < q[i] || (FT)bbox.min(i) > p[i])
if(bbox.max(i) < q[i] || bbox.min(i) > p[i])
return false;
}
else { // rqp
if((FT)bbox.max(i) < r[i] || (FT)bbox.min(i) > p[i])
if(bbox.max(i) < r[i] || bbox.min(i) > p[i])
return false;
}
}

View File

@ -50,7 +50,7 @@ namespace CGAL {
is_inside_segment_3(const typename K::Point_3& query,
const typename K::Segment_3 & s,
typename K::Point_3& closest_point_on_segment,
const K& k)
const K&)
{
typedef typename K::FT FT;
typedef typename K::Point_3 Point;

View File

@ -334,8 +334,7 @@ namespace CGAL {
class Distance_traits
{
public:
Distance_traits(const Point& query,
const Point& hint,
Distance_traits(const Point& hint,
const typename Primitive::Id& hint_primitive)
: m_closest_point(hint),
m_closest_primitive(hint_primitive)
@ -571,7 +570,7 @@ namespace CGAL {
const Point& hint) const
{
typename Primitive::Id hint_primitive = m_primitives[0].id();
Distance_traits distance_traits(query,hint,hint_primitive);
Distance_traits distance_traits(hint,hint_primitive);
this->traversal(query, distance_traits);
return distance_traits.closest_point();
}
@ -620,7 +619,7 @@ namespace CGAL {
const Point_and_primitive_id& hint) const
{
// const Point hint = best_hint(query);
Distance_traits distance_traits(query,hint.first,hint.second);
Distance_traits distance_traits(hint.first,hint.second);
this->traversal(query, distance_traits);
return distance_traits.closest_point_and_primitive();
}

View File

@ -127,12 +127,18 @@ void test_all_distance_query_types(Tree& tree)
FT sqd1 = tree.squared_distance(query);
FT sqd2 = tree.squared_distance(query,hint.first);
if(sqd1 != sqd2)
std::cout << "warning: different distances with and without hint";
Point p1 = tree.closest_point(query);
Point p2 = tree.closest_point(query,hint.first);
if(sqd1 != sqd2)
std::cout << "warning: different closest points with and without hint (possible, in case there are more than one)";
Point_and_primitive_id pp1 = tree.closest_point_and_primitive(query);
Point_and_primitive_id pp2 = tree.closest_point_and_primitive(query,hint);
if(pp1.second != pp2.second)
std::cout << "warning: different closest primitives with and without hint (possible, in case there are more than one)";
}
template <class Tree, class K>

View File

@ -68,7 +68,7 @@ void test_hint_strategies(Tree& tree, CGAL::Polyhedron_3<K>& polyhedron)
outputs2.reserve(NBQ);
outputs3.reserve(NBQ);
size_t common_min = NBQ;
// size_t common_min = NBQ;
size_t counter;
for(size_t i = 0; i < NBQ; ++i)