Commit Graph

216 Commits

Author SHA1 Message Date
Laurent Rineau f0118a1311 Revert last commit (commited by error) 2012-10-09 09:28:37 +00:00
Laurent Rineau 648472bdac After a run of detect_packages_license 2012-10-09 09:26:23 +00:00
Philipp Möller 79b30908d5 WARNFIX: Silence a good part of unused variable/parameter warnings.
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.
2012-08-07 11:04:32 +00:00
Marc Glisse a758751485 Remove / comment out unused local typedefs. Fix one place where FT was used instead of RT (homogeneous coordinates, probably never compiled). 2012-07-28 06:21:06 +00:00
Sébastien Loriot f1bdb9c8a7 merge from next 2012-07-10 14:33:09 +00:00
Sébastien Loriot fb7a7e2e95 remove warning 2012-07-06 12:35:29 +00:00
Laurent Rineau eef769cf9a Fix Do_intersect_3(Bbox_3, Segment_3)
svn merge --reintegrate \^/branches/features/Intersection_3-fix_do_intersect_bbox_segment-lrineau
2012-06-25 08:37:32 +00:00
Philipp Möller 67fdbf93d1 Prevent spurious warning in the test-suite. Leave the one that is
actually suspicious.
2012-06-22 11:52:14 +00:00
Laurent Rineau 19ab08d6e9 Fix a warning from clang
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
2012-06-20 10:32:46 +00:00
Laurent Rineau eecf1e94be Fix for MSVC: protect the CGAL::max calls to prevent macro substitution 2012-06-20 09:53:56 +00:00
Laurent Rineau 23ab39f2df Remove calls to CGAL::abs for Ray_3 and Segment_3
As t1 and t2 are, by construction, greater than 0, for rays and segments,
no need to call CGAL::abs on t[xyz]min and t[xyz]max.
2012-06-19 10:08:04 +00:00
Laurent Rineau ab28ccf740 Fix bugs in overflow/underflow handling 2012-06-18 16:05:29 +00:00
Laurent Rineau 5142588eb3 Better performance (~10-15% better)
By removing several tests (and use CGAL::max instead), the generated
assembly is more efficient.
2012-06-18 16:05:04 +00:00
Laurent Rineau 090b93f229 Fix compilation for MSVC 2012-06-18 09:41:39 +00:00
Laurent Rineau 6c240a4ae2 Cleanup: remove unused code. 2012-06-15 15:49:33 +00:00
Laurent Rineau 28c9507c17 Go back to the version of revision 69620. That was faster. 2012-06-15 15:38:45 +00:00
Laurent Rineau 02754f17f9 Revert previous commit for CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h
The code cannot be easily reused because a line does not store
two points but the a, b, c, d coefficients.
2012-06-15 15:27:17 +00:00
Laurent Rineau a3587eabf3 A version with less branches and more numerical computation 2012-06-15 15:12:04 +00:00
Laurent Rineau 41ba29e19a Factorize code of Do_intersect(Bbox_3, <something>)
Uniform use of do_intersect_bbox_segment_aux(..) with various Boolean
template arguments.
2012-06-15 15:06:34 +00:00
Laurent Rineau a72bd80380 Pass the bbox as argument instead of the six coordinates
That increased the perfs! :-)
2012-06-14 17:04:35 +00:00
Laurent Rineau 503d441f1e merge changes from next 2012-06-13 15:51:29 +00:00
Sébastien Loriot ace74a2bab Object::empty() is !variant::operator bool () 2012-04-24 16:57:58 +00:00
Philipp Möller 17797b7271 Merge next into this branch. There have been conflicts in the
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.
2012-04-24 15:06:19 +00:00
Laurent Rineau 6c705ab777 Fix the test
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.
2012-04-23 22:17:15 +00:00
Sébastien Loriot 8db3036330 BUGFIX
correct error in intersection computation of triangle_3 segment_3
when the segment is collinear with a triangle edge.
2012-04-05 11:57:58 +00:00
Sébastien Loriot ab57806db7 missing enum_cast 2012-03-22 11:08:05 +00:00
Sébastien Loriot ba760bbdb2 need to use an enum for having the different cases:
when the end point is on the facet, any ray have the endpoint in the
plane of the facet.
2012-03-22 10:39:23 +00:00
Sébastien Loriot b058a2a4f3 modify the internal do_intersect Ray_3 vs Triangle_3 function
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.
2012-03-21 18:20:04 +00:00
Laurent Rineau 672d2dd292 Commit work in progress 2012-03-21 16:58:29 +00:00
Laurent Rineau 439dd0abb9 Fix typo
- Remove a line that was rewritten but not removed.
- Add a comment
2012-03-21 14:34:53 +00:00
Laurent Rineau b5d987a4b5 Increasing the perf of the filtered predicate
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.
2012-03-21 14:24:31 +00:00
Laurent Rineau e940d97a75 Prepare the code factorization with the static filter of Do_intersect_3 2012-03-21 13:59:45 +00:00
Laurent Rineau 0e6dbc4b40 Reorganize expressions that are evaluation of the sign of a determinant
There are six of them in do_intersect(Bbox_3, Segment_3)
2012-03-21 11:49:30 +00:00
Laurent Rineau c291e92442 Less tests of sign of expressions
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.
2012-03-21 11:40:29 +00:00
Laurent Rineau 671464db4c Less tests of sign of expressions
I have managed to transform most of the tests to simple comparison of input
coordinates. That will ease the writing of static filters.
2012-03-21 11:13:19 +00:00
Laurent Rineau e54df14afb Code optimized for all x-, y-, and z-axis 2012-03-20 17:47:55 +00:00
Laurent Rineau 0358937f01 Code optimized for x-axis 2012-03-20 16:56:13 +00:00
Laurent Rineau b0cfb5bc1f Fix a stupid copy-paste error 2012-03-19 14:12:05 +00:00
Laurent Rineau 02acd80611 Better test and bench for do_intersect(BBox_3, Ray_3|Segment_3) 2012-03-19 14:11:45 +00:00
Laurent Rineau 1aa69b5a8b Factorize the _aux function for do_intersect(BBox_3, Ray_3|Segment_3) 2012-03-19 12:07:20 +00:00
Laurent Rineau b5703e9cf8 Add a note about a test that is already covered by previous test. 2012-03-16 16:14:47 +00:00
Laurent Rineau 58809c064a Full test suite of do_intersect(Bbox_3, Segment_3).
I have tested with gcov that all branches of the predicates are tested.
2012-03-16 16:10:44 +00:00
Laurent Rineau 3d36a2e4c3 Display coordinates with full precision 2012-03-15 15:47:36 +00:00
Laurent Rineau bd09875fea Add a few test cases.
One of then use boost::math::nextafter to move around a critical
 case. That is strange that even non-exact FT can deal with that without
 filtering.
2012-03-15 15:45:31 +00:00
Laurent Rineau 611a2c439b Naively translate and scale the inputs, for test of do_intersect(Bbox, ..) 2012-03-15 15:09:05 +00:00
Laurent Rineau 8dbae2494a Beginning of an intensive test suite of do_intersect(Bbox_3, Segment_3) 2012-03-15 14:48:12 +00:00
Laurent Rineau 71d1ba01e1 This version should be correct. 2012-03-15 13:27:06 +00:00
Laurent Rineau c0a37addfb Also test with Sc<Gmpq>.
Simple_cartesian<Gmpq> is a non-filtering kernel whose FT is not a IEEE 754
type. That number type is interesting to test with.
2012-03-15 11:11:47 +00:00
Laurent Rineau c8bc77e46d Submit work in progress. The old code was really wrong! 2012-03-14 16:41:03 +00:00
Laurent Rineau 300057e17a Test also with Filtered_kernel without static filters
And count the percentage of intersection among random objects
2012-03-14 16:24:41 +00:00
Laurent Rineau 68b48a7151 Commit current version
To be reviewed fully.
2012-03-14 15:54:19 +00:00
Andreas Fabri 6c9625e514 Fix for <windows.h> bug 2012-01-21 08:33:51 +00:00
Andreas Fabri f834260e4c Fix for Windows 'min/max' bug 2012-01-19 08:03:51 +00:00
Andreas Fabri be573d2316 Fix for Windows 'min/max' bug 2012-01-18 09:52:23 +00:00
Laurent Rineau a37c74d534 Add license files, per package 2012-01-16 15:54:22 +00:00
Laurent Rineau 5b5dd33848 merge changes from next 2012-01-09 12:33:39 +00:00
Laurent Rineau 5685e10669 reintegrate \^/branches/features/Static_filter_do_intersect-GF 2011-11-25 17:45:11 +00:00
Laurent Rineau fb796dbc97 Missing match for Intersect_3::operator()(Ray_3, Triangle_3)
There was only Intersect_3::operator()(Triangle_3, Ray_3).

The specializations for CGAL::intersection were for both order however.
2011-11-25 17:40:02 +00:00
Laurent Rineau ede47077ce cleanup 2011-11-24 14:43:25 +00:00
Andreas Fabri c4c4a24029 cleanup 2011-11-24 14:15:32 +00:00
Laurent Rineau e0c80037ae merge changes from next 2011-11-23 15:53:51 +00:00
Laurent Rineau fc5a23bc06 Comments to help debugging 2011-11-21 14:53:16 +00:00
Philipp Möller 3fe7c7b9dd Removed cruft from Intersection_traits and Kernel_d now uses the macros do declare global functions 2011-11-21 13:52:39 +00:00
Sébastien Loriot 59f5cc0ba0 optimise Bbox_3-line_3 do_intersect (prevent filter failures) 2011-11-21 13:43:45 +00:00
Laurent Rineau 1ea6830233 New version of Do_intersect_3 static filter
This time we hope it is correct.
2011-11-18 15:34:26 +00:00
Philipp Möller ee09ef2297 Overloading intersection and do_intersect now work by introducing a better match for every possible function 2011-11-18 14:14:41 +00:00
Philipp Möller 450f438518 IT shortcut not circumvents specifying a kernel making it an actual shortcut and nicer for exposure in APIs 2011-11-10 11:06:26 +00:00
Philipp Möller c2bfb68112 * Now dispatching on Ambient_dimension
* incorporated result_type == Object to remove more ifdefs
2011-11-09 11:35:04 +00:00
Philipp Möller 33430eef68 Intersections_3 now fully uses CGAL_INTERSECTION_VERSION 2011-11-08 17:37:24 +00:00
Philipp Möller 0929a0f92a Move the define to Intersection_traits. Those will be included every time. 2011-11-08 14:38:32 +00:00
Philipp Möller a6f4cb16ae Macro for versioning the intersections and support for both versions in the top level function. 2011-11-08 11:56:57 +00:00
Laurent Rineau cfd37935cf merge from next 2011-10-20 16:04:32 +00:00
Andreas Fabri 278d79915d Suppress warning 2011-10-20 11:09:41 +00:00
Sébastien Loriot 91a5327fa8 change LGPLv2 -> LGPLv3 2011-10-10 13:48:25 +00:00
Sébastien Loriot 554f62d411 remove executable property from copyright files 2011-10-03 08:18:16 +00:00
Andreas Fabri d10a333947 Add a file with the copyright holder(s) to the package_info 2011-09-29 20:45:16 +00:00
Sébastien Loriot dff6dda8b3 Remove from copyright holder
Freie Universitaet Berlin (Germany), Martin-Luther-University Halle-Wittenberg
(Germany) and RISC Linz (Austria) as they transfer the copyright to other
sites.
2011-09-21 19:46:31 +00:00
Philipp Möller b07e2df018 * Circular_kernel is now Object free, doesn't compile with Lazy yet,
* hack for ternary function
2011-08-25 21:40:12 +00:00
Philipp Möller 5b925d6f6e * Reworked Intersection_traits into a single traits, adjusted
intersections accordingly, turned on IT<....> as return type
* removed result_type from the intersection functors
2011-08-25 10:18:31 +00:00
Philipp Möller fad504838f * Circular_kernel: - Intersections now use variants
- removed most internal uses of Object
* Intersections: more traits, typofix, doc typofix, aliases IT23d
2011-07-20 22:54:03 +00:00
Philipp Möller b457bcc7c8 merged next, fiddled with deprecation warning to resolve tree conflict 2011-07-18 18:14:21 +00:00
Philipp Möller 12f79a7d1e Object includes and last intersection stragglers 2011-07-18 17:31:20 +00:00
Philipp Möller 525fe15e9a Internals switched to variant. 2011-07-15 14:13:55 +00:00
Sébastien Loriot 5ec3807e64 testsuite do_intersect Bbox_3-Ray_3 2011-07-13 14:58:51 +00:00
Sébastien Loriot bbc56adedc raffine bugfix of 64734
(remove unneed code added)
2011-07-13 14:35:58 +00:00
Philipp Möller 6987321d4e More overloads removed and another test. 2011-07-12 17:35:19 +00:00
Philipp Möller 2f9b36d618 * intersection and do_intersection now pick their appropriate
overloads automatically;

* a test for the availability of all calls has been added
2011-07-12 16:53:49 +00:00
Sébastien Loriot 0331ea939b BUGFIX: Bbox_3-line_3 do_intersect missing two cases when the y-slope or z-slope
of the line is 0. Add a testsuite for Bbox_3-Line_3 do_intersect.
2011-07-12 07:05:40 +00:00
Laurent Rineau 369498d1e5 Cancel revision 64607. There had been a problem with the branch.
| ------------------------------------------------------------------------
  | r64607 | efif | 2011-07-05 17:27:04 +0200 (Tue, 05 Jul 2011) | 1 line
  | 
  | Merged feature-branch Aos_2-new_functors-tau into next
  | ------------------------------------------------------------------------
2011-07-06 11:11:58 +00:00
Laurent Rineau a618b1db81 Cherry-pick this patch:
| ------------------------------------------------------------------------
  | r61610 | sloriot | 2011-03-09 17:32:05 +0100 (Wed, 09 Mar 2011) | 2 lines
  | Changed paths:
  |    M /branches/experimental-packages/Mesh_3-protecting_balls-branch/Intersections_3/include/CGAL/Triangle_3_Segment_3_do_intersect.h
  | 
  | split an internal function to reuse it
  | 
  | ------------------------------------------------------------------------
2011-06-17 13:12:31 +00:00
Sébastien Loriot a03f2c88c0 bug fix in tersection of 3D colinear segments.
Update test-suite to test all possible configurations.
2011-05-20 08:52:12 +00:00
Sébastien Loriot 1674fa6240 use coplanar intersection (avoid retesting it) 2011-05-16 17:12:06 +00:00
Sébastien Loriot a372589e67 intersection can be empty 2011-04-11 08:06:51 +00:00
Andreas Fabri ab7736631e QPL -> LGPL 2011-03-10 21:15:14 +00:00
Andreas Fabri dcf575beb3 Remove unused variable 2010-11-12 08:33:25 +00:00
Sébastien Loriot b2f7df6513 add do_intersect for Ray_3 vs {Line_3,Segment_3,Ray_3}
add intersection for Ray_3 vs {Line_3,Segment_3,Ray_3}
append test to the testsuite

correct a variable name in line vs segment intersection
2010-10-28 15:13:53 +00:00
Sébastien Loriot 799a3448ab merge modifications made in the branch branches/experimental-packages/AABB_tree-faster-BBox_3_Triangle_do_intersect
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.
2010-10-15 08:57:22 +00:00
Marc Glisse 51e7039a93 Remove extra ';' 2010-09-05 09:12:08 +00:00
Sébastien Loriot d01decf3ad correct include path 2010-09-01 20:40:33 +00:00
Sébastien Loriot 458b5136cc add missing symetric function 2010-09-01 10:11:57 +00:00