mirror of https://github.com/CGAL/cgal
removed the warnings, except in one of the test cases. Working on it.
This commit is contained in:
parent
9f6aa6b120
commit
0f376fb294
|
|
@ -40,21 +40,21 @@ namespace CGALi {
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Sphere_3& sphere,
|
bool do_intersect(const typename K::Sphere_3& sphere,
|
||||||
const CGAL::Bbox_3& bbox,
|
const CGAL::Bbox_3& bbox,
|
||||||
const K& kernel)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
FT d = (FT)0.0;
|
FT d = 0.0;
|
||||||
FT distance = (FT)0.0;
|
FT distance = 0.0;
|
||||||
for(int i = 0; i < 3; ++i)
|
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;
|
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;
|
distance += d*d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,32 +50,32 @@ namespace CGALi {
|
||||||
for(int i = 0; i < 3; ++i) {
|
for(int i = 0; i < 3; ++i) {
|
||||||
if(p[i] <= q[i]) {
|
if(p[i] <= q[i]) {
|
||||||
if(q[i] <= r[i]) { // pqr
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(p[i] <= r[i]) { // prq
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
else { // rpq
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(p[i] <= r[i]) { // qpr
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(q[i] <= r[i]) { // qrp
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
else { // rqp
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ namespace CGAL {
|
||||||
is_inside_segment_3(const typename K::Point_3& query,
|
is_inside_segment_3(const typename K::Point_3& query,
|
||||||
const typename K::Segment_3 & s,
|
const typename K::Segment_3 & s,
|
||||||
typename K::Point_3& closest_point_on_segment,
|
typename K::Point_3& closest_point_on_segment,
|
||||||
const K& k)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
typedef typename K::Point_3 Point;
|
typedef typename K::Point_3 Point;
|
||||||
|
|
|
||||||
|
|
@ -334,8 +334,7 @@ namespace CGAL {
|
||||||
class Distance_traits
|
class Distance_traits
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Distance_traits(const Point& query,
|
Distance_traits(const Point& hint,
|
||||||
const Point& hint,
|
|
||||||
const typename Primitive::Id& hint_primitive)
|
const typename Primitive::Id& hint_primitive)
|
||||||
: m_closest_point(hint),
|
: m_closest_point(hint),
|
||||||
m_closest_primitive(hint_primitive)
|
m_closest_primitive(hint_primitive)
|
||||||
|
|
@ -571,7 +570,7 @@ namespace CGAL {
|
||||||
const Point& hint) const
|
const Point& hint) const
|
||||||
{
|
{
|
||||||
typename Primitive::Id hint_primitive = m_primitives[0].id();
|
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);
|
this->traversal(query, distance_traits);
|
||||||
return distance_traits.closest_point();
|
return distance_traits.closest_point();
|
||||||
}
|
}
|
||||||
|
|
@ -620,7 +619,7 @@ namespace CGAL {
|
||||||
const Point_and_primitive_id& hint) const
|
const Point_and_primitive_id& hint) const
|
||||||
{
|
{
|
||||||
// const Point hint = best_hint(query);
|
// 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);
|
this->traversal(query, distance_traits);
|
||||||
return distance_traits.closest_point_and_primitive();
|
return distance_traits.closest_point_and_primitive();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,12 +127,18 @@ void test_all_distance_query_types(Tree& tree)
|
||||||
|
|
||||||
FT sqd1 = tree.squared_distance(query);
|
FT sqd1 = tree.squared_distance(query);
|
||||||
FT sqd2 = tree.squared_distance(query,hint.first);
|
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 p1 = tree.closest_point(query);
|
||||||
Point p2 = tree.closest_point(query,hint.first);
|
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 pp1 = tree.closest_point_and_primitive(query);
|
||||||
Point_and_primitive_id pp2 = tree.closest_point_and_primitive(query,hint);
|
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>
|
template <class Tree, class K>
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ void test_hint_strategies(Tree& tree, CGAL::Polyhedron_3<K>& polyhedron)
|
||||||
outputs2.reserve(NBQ);
|
outputs2.reserve(NBQ);
|
||||||
outputs3.reserve(NBQ);
|
outputs3.reserve(NBQ);
|
||||||
|
|
||||||
size_t common_min = NBQ;
|
// size_t common_min = NBQ;
|
||||||
size_t counter;
|
size_t counter;
|
||||||
|
|
||||||
for(size_t i = 0; i < NBQ; ++i)
|
for(size_t i = 0; i < NBQ; ++i)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue