Wextra results in a dreadful wall of yellow in the test-suite and is
scary when using CGAL. Reduce some of the noise by silencing the
obvious cases with CGAL_USE or comments.
The warning was:
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:353:9: warning: variable 'b' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if( (px == qx) || // <=> (dmin == 0)
^~~~~~~~~~
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:408:12: note: in instantiation of function template specialization 'CGAL::internal::do_intersect_bbox_segment_aux<float, true, true, false>' requested here
return do_intersect_bbox_segment_aux<FT, true, true, false>(
^
[...]/include/CGAL/Kernel/function_objects.h:2052:14: note: in instantiation of function template specialization 'CGAL::internal::do_intersect<CGAL::Simple_cartesian<float> >' requested here
{ return internal::do_intersect(t1, t2, K()); }
^
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:428:10: note: in instantiation of function template specialization 'CGAL::CommonKernelFunctors::Do_intersect_3<CGAL::Simple_cartesian<float> >::operator()<CGAL::Segment_3<CGAL::Simple_cartesian<float>>, CGAL::Bbox_3>' requested here
return typename K::Do_intersect_3()(segment, bbox);
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:67:12: note: in instantiation of function template specialization 'CGAL::do_intersect<CGAL::Simple_cartesian<float> >' requested here
bool b = CGAL::do_intersect(t,bbox);
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:416:12: note: in instantiation of function template specialization 'test_aux<CGAL::Segment_3<CGAL::Simple_cartesian<float>> >' requested here
bool b = test_aux(s12,"s12",bbox,false);
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:665:12: note: in instantiation of function template specialization 'test<CGAL::Simple_cartesian<float> >' requested here
bool b = test<K>(exact_predicates) &&
^
[...]/cmake/platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/test/Intersections_3/bbox_other_do_intersect_test.cpp:678:7: note: in instantiation of function template specialization 'test_kernel<CGAL::Simple_cartesian<float> >' requested here
b = test_kernel<CGAL::Simple_cartesian<float> >(false);
^
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:360:25: note: uninitialized use occurs here
if(is_indeterminate(b)) return b; // Note that the default-constructed
^
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:353:9: note: remove the '||' if its condition is always false
if( (px == qx) || // <=> (dmin == 0)
^~~~~~~~~~~~~
[...]/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h:351:23: note: initialize the variable 'b' to silence this warning
Is_greater_value b;
^
= false
AABB_tree documentation, Intersections_3 and Arrangement_on_surface_2.
The merge also introduced a regression for a bug fixed in R68387 which
fixed a bug in Triangle_3 Segment_3 intersections. The relevant
testcase is in triangle_other_intersection_test.cpp.
One cannot expect exact intersections computations results when the kernel
is not. This patch fixes the test: the equality between the result and the
expected result is tested with an epsilon unless the kernel has exact
constructions.
to be able to known whether the endpoint of the ray lies inside the
plane of the triangle. The running time is the public do_intersect function
should remain the same.
When FT is Interval_nt, it is better that the
Do_intersect_bbox_segment_aux_is_greater returns a Uncertain<bool> instead
of a bool. That can delay the conversion of Uncertain<bool> to bool, and
hence better perf.
Followup to previous commit.
I have managed to transform most of the tests to simple comparison of input
coordinates. That will ease the writing of static filters. Only six
determinant signs have to be exactly determined.
Freie Universitaet Berlin (Germany), Martin-Luther-University Halle-Wittenberg
(Germany) and RISC Linz (Austria) as they transfer the copyright to other
sites.
created at r56349 and last modifications at r56671
modification in r56464 requires that the function point() of triangle returns a const ref
to the triangle point. This has already been done in the trunk at r56954.
Details:
*For Bbox_3 plane_3 intersection:
For floating point arithmetic everything is ok,
but in the presence of floating point filters
things start getting slightly more complicated.
The supporting plane/bbox test uses
the orientation of the normal of the plane
for finding two corners of the cube for a
sidedness test.
For planes parallel to the xy, xz, yz plane
this immediatly leads to problems.
We introduce CGAL::Uncertain, etc in order
to avoid switching to an exact arithmetic
as long as possible.
*For Bbox_3 triangle_3:
Idem. Fine with floating point or exact type
but get into troubles with interval arithmetic when one
triangle boundary is collinear with an axis.
Remember that the implementation is based on the
separating axis theorem. Amongst axis tested, the
one discribed by the cross product of the triangle boundary
and the bbox boundary is tested. In the case they are collinear
this directly fail.
To handle this we added a small part testing whether the triangle
has one boundary collinear to an axis to avoid this situation.
Also, The "underlying" code has been factorized using the swap function.