Merge from next

This commit is contained in:
Philipp Möller 2012-07-27 17:58:52 +00:00
commit 495fac8ea1
462 changed files with 31463 additions and 11296 deletions

149
.gitattributes vendored
View File

@ -215,14 +215,10 @@ Algebraic_kernel_d/include/CGAL/RS/algebraic_1_other.h -text
Algebraic_kernel_d/include/CGAL/RS/algebraic_1_real_embeddable.h -text
Algebraic_kernel_d/include/CGAL/RS/basic.h -text
Algebraic_kernel_d/include/CGAL/RS/compare_1.h -text
Algebraic_kernel_d/include/CGAL/RS/crt.h -text
Algebraic_kernel_d/include/CGAL/RS/dyadic.h -text
Algebraic_kernel_d/include/CGAL/RS/inverse.h -text
Algebraic_kernel_d/include/CGAL/RS/isolator_1.h -text
Algebraic_kernel_d/include/CGAL/RS/isole_1.h -text
Algebraic_kernel_d/include/CGAL/RS/memory.h -text
Algebraic_kernel_d/include/CGAL/RS/p.h -text
Algebraic_kernel_d/include/CGAL/RS/pagealloc.h -text
Algebraic_kernel_d/include/CGAL/RS/polynomial_1_constructors.h -text
Algebraic_kernel_d/include/CGAL/RS/polynomial_1_eval.h -text
Algebraic_kernel_d/include/CGAL/RS/polynomial_1_functors.h -text
@ -232,15 +228,19 @@ Algebraic_kernel_d/include/CGAL/RS/polynomial_1_operators.h -text
Algebraic_kernel_d/include/CGAL/RS/polynomial_1_parser.h -text
Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h -text
Algebraic_kernel_d/include/CGAL/RS/polynomial_converter.h -text
Algebraic_kernel_d/include/CGAL/RS/pp.h -text
Algebraic_kernel_d/include/CGAL/RS/primes.h -text
Algebraic_kernel_d/include/CGAL/RS/refine_1.h -text
Algebraic_kernel_d/include/CGAL/RS/refine_1_rs.h -text
Algebraic_kernel_d/include/CGAL/RS/rs_calls_1.h -text
Algebraic_kernel_d/include/CGAL/RS/sign_1.h -text
Algebraic_kernel_d/include/CGAL/RS/sign_1_no_rs.h -text
Algebraic_kernel_d/include/CGAL/RS/sign_1_rs.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd/crt.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd/inverse.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd/p.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd/pagealloc.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd/pp.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd/primes.h -text
Algebraic_kernel_d/include/CGAL/RS/ugcd/ugcd.h -text
Algebraic_kernel_d/package_info/Algebraic_kernel_d/description.txt -text
Algebraic_kernel_d/package_info/Algebraic_kernel_d/maintainer -text
Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp -text
@ -531,6 +531,7 @@ Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier.dat -text
Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Europe.dat -text
Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp -text
Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp -text
Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h -text
Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_planar_vertical_decomposition.cpp -text
Arrangement_on_surface_2/examples/Arrangement_on_surface_2/coll_points.dat -text
Arrangement_on_surface_2/examples/Arrangement_on_surface_2/fan_grids.dat -text
@ -540,6 +541,16 @@ Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_d
Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h -text
Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_partition_traits_2.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_specified_points_generator.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h -text
Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h -text
Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_on_sphere_transformation.h -text
Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_transformation.h -text
Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h -text
@ -565,6 +576,10 @@ Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_ren
Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h -text
Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h -text
Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_test.h -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_dynamic_test.h -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_adaptor_test.h -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake eol=lf
@ -583,13 +598,13 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/algebraic/points -te
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/algebraic/split -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/algebraic/vertex -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/algebraic/xcurves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/assertions.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/assertions.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/compare -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/compare_y_at_x -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/compare_y_at_x.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/compare_y_at_x.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/errors.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/errors.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/intersect.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/intersect.xcv -text
@ -606,14 +621,14 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/split.xcv -te
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/vertex -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/vertex.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/bezier/vertex.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/assertions.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/assertions.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/compare_y_at_x -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/compare_y_at_x_left -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/compare_y_at_x_right -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/constructor -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/constructor.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/errors.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/errors.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect.xcv -text
@ -666,6 +681,7 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/s
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/vertex -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/vertex.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_line_arcs/xcurves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/compare -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/compare.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/compare_y_at_x -text
@ -673,7 +689,6 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/const
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/constructor.cv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/constructor.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/curves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/intersect.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/intersect.xcv -text
@ -692,6 +707,9 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/verte
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circular_lines/xcurves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/compare -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/compare.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/assertions.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/assertions.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/compare -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/compare.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/compare_y_at_x -text
@ -701,9 +719,6 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/constructor -
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/constructor.cv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/constructor.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/curves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/errors.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/errors.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/is_vertical -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/conics/is_vertical.xcv -text
@ -732,12 +747,12 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/lines/paramet
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/lines/points -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/lines/split -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/lines/xcurves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/assertions.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/assertions.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/compare_y_at_x -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/compare_y_at_x_left -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/curves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/errors.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/errors.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/intersect.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/intersect.xcv -text
@ -754,12 +769,12 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/split.xc
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/vertex -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/vertex.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/rays/xcurves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/assertions.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/assertions.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/compare_y_at_x -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/compare_y_at_x_left -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/curves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/errors.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/errors.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/intersect.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/intersect.xcv -text
@ -776,14 +791,31 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/spli
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/vertex -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/vertex.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/xcurves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/curves/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/ops/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/queries/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test03.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test04.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test03.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test04.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/xcurves/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test10.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test10.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/xcurves/test10.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/assertions.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/assertions.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/compare_y_at_x -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/compare_y_at_x.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/compare_y_at_x.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/errors.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/errors.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/intersect.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/intersect.xcv -text
@ -814,12 +846,12 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/rational_arcs/split
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/rational_arcs/vertex -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/rational_arcs/xcurves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/are_mergeable -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/assertions -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/assertions.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/assertions.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/compare_y_at_x -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/compare_y_at_x_left -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/curves -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/errors -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/errors.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/errors.xcv -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/intersect -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/intersect.pt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/segments/intersect.xcv -text
@ -888,6 +920,10 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_construction/te
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_observer/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_overlay/test01.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_overlay/test02.txt -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_circle_segments.cmd -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic.cpp -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic_segments.cmd -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_linear.cmd -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_equal.cpp -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_intersect.cpp -text
Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cmd -text
@ -1811,19 +1847,14 @@ Installation/cmake/modules/CGAL_Macros.cmake -text
Installation/cmake/modules/CGAL_SetupBoost.cmake -text
Installation/cmake/modules/CGAL_SetupDependencies.cmake -text
Installation/cmake/modules/CGAL_SetupFlags.cmake -text
Installation/cmake/modules/CGAL_SetupGMP.cmake -text
Installation/cmake/modules/CGAL_SetupGMPXX.cmake -text
Installation/cmake/modules/CGAL_SetupLEDA.cmake -text
Installation/cmake/modules/CGAL_SetupMPFI.cmake -text
Installation/cmake/modules/CGAL_SetupNTL.cmake -text
Installation/cmake/modules/CGAL_SetupRS.cmake -text
Installation/cmake/modules/CGAL_TweakFindBoost.cmake -text
Installation/cmake/modules/CGAL_UseBLAS.cmake -text
Installation/cmake/modules/CGAL_UseLAPACK.cmake -text
Installation/cmake/modules/CGAL_UseLEDA.cmake -text
Installation/cmake/modules/CGAL_UseMKL.cmake -text
Installation/cmake/modules/CGAL_UseMPFI.cmake -text
Installation/cmake/modules/CGAL_UseNTL.cmake -text
Installation/cmake/modules/CGAL_UseRS.cmake -text
Installation/cmake/modules/CGAL_UseRS3.cmake -text
Installation/cmake/modules/CGAL_UseTAUCS.cmake -text
Installation/cmake/modules/CGAL_VersionUtils.cmake -text
Installation/cmake/modules/FindBLAS.cmake -text
@ -1846,6 +1877,7 @@ Installation/cmake/modules/FindOpenGL.cmake -text
Installation/cmake/modules/FindQGLViewer.cmake -text
Installation/cmake/modules/FindQt3-patched.cmake -text
Installation/cmake/modules/FindRS.cmake -text
Installation/cmake/modules/FindRS3.cmake -text
Installation/cmake/modules/FindTAUCS.cmake -text
Installation/cmake/modules/Qt3Macros-patched.cmake -text
Installation/cmake/modules/UseCGAL.cmake -text
@ -1861,9 +1893,6 @@ Installation/config/support/print_QT_version.cpp -text
Installation/config/support/print_TAUCS_version.cpp -text
Installation/config/support/print_ZLIB_version.cpp -text
Installation/config/support/test_BOOST_THREAD.cpp -text
Installation/config/testfiles/CGAL_CFG_NO_CPP0X_COPY_N.cpp -text
Installation/config/testfiles/CGAL_CFG_NO_CPP0X_ISFINITE.cpp -text
Installation/config/testfiles/CGAL_CFG_NO_CPP0X_NEXT_PREV.cpp -text
Installation/config/version.h.in -text
Installation/doc_tex/Installation/cmakelogo.png -text svneol=unset#image/png
Installation/doc_tex/Installation/illustration.png -text
@ -1890,7 +1919,7 @@ Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersec
Intersections_3/test/Intersections_3/segment_segment.cpp -text
Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp -text
Interval_skip_list/doc_tex/Interval_skip_list/query.png -text
Interval_skip_list/examples/Interval_skip_list/isl_terrain.pts -text
Interval_skip_list/examples/Interval_skip_list/terrain.pts -text
Interval_support/include/CGAL/Test/_test_bigfloat_interval_traits.h -text
Interval_support/include/CGAL/Test/_test_convert_to_bfi.h -text
Interval_support/package_info/Interval_support/description.txt -text
@ -2031,6 +2060,7 @@ Linear_cell_complex/demo/Linear_cell_complex/CreateMenger.ui -text
Linear_cell_complex/demo/Linear_cell_complex/CreateMesh.ui -text
Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3.qrc -text
Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp -text
Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_pqq_subdivision.cpp -text
Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui -text
Linear_cell_complex/demo/Linear_cell_complex/about_Linear_cell_complex_3.html svneol=native#text/html
Linear_cell_complex/doc_tex/Linear_cell_complex/Linear_cell_complex.tex -text
@ -2133,6 +2163,7 @@ Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_triangula
Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_qt.h -text
Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_vtk.h -text
Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_colored_vertices.cpp -text
Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_mypoint.cpp -text
Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_4.cpp -text
Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp -text
Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp -text
@ -2276,11 +2307,12 @@ Maintenance/public_release/announcement/CGAL-3.7 -text
Maintenance/public_release/announcement/CGAL-3.7-beta1 -text
Maintenance/public_release/announcement/CGAL-3.8 -text
Maintenance/public_release/announcement/CGAL-3.8-beta -text
Maintenance/public_release/announcement/CGAL-3.8.1 -text
Maintenance/public_release/announcement/CGAL-3.9 -text
Maintenance/public_release/announcement/CGAL-3.9-beta1 -text
Maintenance/public_release/announcement/CGAL-4.0 -text
Maintenance/public_release/announcement/CGAL-4.0-beta1 -text
Maintenance/public_release/announcement/CGAL-4.0.1 -text
Maintenance/public_release/announcement/CGAL-4.0.2 -text
Maintenance/public_release/scripts/precompiled_demos_zips -text
Maintenance/public_release/scripts/prepare_release -text
Maintenance/release_building/BUGFIX_NUMBER -text
@ -3023,11 +3055,13 @@ Nef_3/test/Nef_3/data/cube+vee.off -text svneol=unset#application/octet-stream
Nef_3/test/Nef_3/data/cube+veeee.off -text svneol=unset#application/octet-stream
Nef_3/test/Nef_3/data/cube+vertex.off -text svneol=unset#application/octet-stream
Nef_3/test/Nef_3/data/cube.off -text svneol=unset#application/octet-stream
Nef_3/test/Nef_3/data/icosahedron.off -text
Nef_3/test/Nef_3/data/nine_planes.off -text svneol=unset#application/octet-stream
Nef_3/test/Nef_3/data/octa.off -text svneol=unset#application/octet-stream
Nef_3/test/Nef_3/data/star.off -text svneol=unset#application/octet-stream
Nef_3/test/Nef_3/data/wrongly_oriented_cube.off -text
Nef_3/test/Nef_3/nary.cpp -text
Nef_3/test/Nef_3/nef_union_error_llvm.cpp -text
Nef_S2/doc_tex/Nef_S2/fig/complex.gif -text svneol=unset#image/gif
Nef_S2/doc_tex/Nef_S2/fig/complex.pdf -text svneol=unset#application/pdf
Nef_S2/doc_tex/Nef_S2/fig/halfspace.gif -text svneol=unset#image/gif
@ -3277,7 +3311,19 @@ Polygon/doc_tex/Polygon/pgn_algos.xml svneol=native#text/xml
Polygon/doc_tex/Polygon/polygon.png -text
Polyhedron/demo/Polyhedron/MainWindow.ui -text
Polyhedron/demo/Polyhedron/Polyhedron_3.qrc -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_corefinement_plugin.cpp -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.ui -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_xyz_plugin.cpp -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_outliers_removal_plugin.cpp -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_outliers_removal_plugin.ui -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.ui -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_smoothing_plugin.cpp -text
Polyhedron/demo/Polyhedron/Polyhedron_demo_poisson_plugin.ui -text
Polyhedron/demo/Polyhedron/Remeshing_dialog.ui -text
Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp -text
Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h -text
Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item_config.h -text
Polyhedron/demo/Polyhedron/Show_point_dialog.ui -text
Polyhedron/demo/Polyhedron/cgal_test_with_cmake eol=lf
Polyhedron/demo/Polyhedron/data/anchor.off -text svneol=unset#application/octet-stream
@ -3377,6 +3423,15 @@ Polyhedron/examples/Polyhedron/corner.off -text svneol=unset#application/octet-s
Polyhedron/examples/Polyhedron/corner_with_hole.off -text svneol=unset#application/octet-stream
Polyhedron/examples/Polyhedron/corner_with_sharp_edge.off -text svneol=unset#application/octet-stream
Polyhedron/examples/Polyhedron/cross.off -text svneol=unset#application/octet-stream
Polyhedron/include/CGAL/corefinement_operations.h -text
Polyhedron/include/CGAL/internal/corefinement/Combinatorial_map_for_corefinement.h -text
Polyhedron/include/CGAL/internal/corefinement/Polyhedron_constness_types.h -text
Polyhedron/include/CGAL/internal/corefinement/Polyhedron_subset_extraction.h -text
Polyhedron/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h -text
Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h -text
Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h -text
Polyhedron/include/CGAL/intersection_of_Polyhedra_3.h -text
Polyhedron/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h -text
Polynomial/doc_tex/Polynomial/Polynomial.png -text
Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d_ConstructCoefficientConstIteratorRange.tex -text
Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d_ConstructInnermostCoefficientConstIteratorRange.tex -text
@ -3623,10 +3678,14 @@ STL_Extension/include/CGAL/internal/boost/mutable_heap.hpp -text
STL_Extension/include/CGAL/internal/boost/mutable_queue.hpp -text
STL_Extension/test/STL_Extension/test_Modifiable_priority_queue.cpp -text
STL_Extension/test/STL_Extension/test_Uncertain.cpp -text
STL_Extension/test/STL_Extension/test_namespaces.cpp -text
STL_Extension/test/STL_Extension/test_type_traits.cpp -text
Scripts/developer_scripts/autotest_cgal -text
Scripts/developer_scripts/autotest_cgal_with_cmake -text
Scripts/developer_scripts/cgal_build -text
Scripts/developer_scripts/cgal_generate_cmake_script -text
Scripts/developer_scripts/cgal_generate_cmake_script.cmake -text
Scripts/developer_scripts/cgal_git_svn_clone -text
Scripts/developer_scripts/cgal_header_clean_up.py -text
Scripts/developer_scripts/cgal_test_with_cmake eol=lf
Scripts/developer_scripts/check_library_uses_no_gpl_files -text
@ -3653,9 +3712,10 @@ Scripts/developer_scripts/remove_package_files_from_build_tree.rb -text
Scripts/developer_scripts/remove_package_files_from_build_tree_impl.rb -text
Scripts/developer_scripts/replace_CGAL_NAMESPACE.py -text
Scripts/developer_scripts/test_testsuite_submission -text
Scripts/developer_scripts/update_git_svn_clone -text
Scripts/scripts/cgal_create_CMakeLists -text
Scripts/scripts/cgal_create_assertions.sh eol=lf
Scripts/scripts/cgal_create_cmake_script -text
Scripts/scripts/cgal_create_cmake_script_with_options -text
SearchStructures/doc_tex/SearchStructures/d-range.gif -text svneol=unset#image/gif
SearchStructures/doc_tex/SearchStructures/d-range.pdf -text svneol=unset#application/pdf
SearchStructures/doc_tex/SearchStructures/d-segment.gif -text svneol=unset#image/gif
@ -4341,6 +4401,7 @@ Testsuite/test/Testsuite/cgal_test_with_cmake eol=lf
Testsuite/test/collect_cgal_testresults_from_cmake -text
Testsuite/test/makefile2 -text
Testsuite/test/run_testsuite_with_cmake -text
Triangulation_2/benchmark/Triangulation_2/CDT_with_intersection_2.cpp -text
Triangulation_2/benchmark/Triangulation_2/Delaunay_remove.cpp -text
Triangulation_2/demo/Triangulation_2/qt3/help/cindex.html svneol=native#text/html
Triangulation_2/demo/Triangulation_2/qt3/help/cinput_point_layer.gif -text svneol=unset#image/gif

11
.gitignore vendored
View File

@ -168,6 +168,13 @@ Interpolation/demo/Interpolation/cgal_test_with_cmake
Intersections_3/test/Intersections_3/CMakeLists.txt
Intersections_3/test/Intersections_3/bbox_other_do_intersect_test
Intersections_3/test/Intersections_3/cgal_test_with_cmake
Intersections_3/test/Intersections_3/circle_other
Intersections_3/test/Intersections_3/line_line
Intersections_3/test/Intersections_3/segment_segment
Intersections_3/test/Intersections_3/test_intersections_3
Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection
Intersections_3/test/Intersections_3/triangle_other
Intersections_3/test/Intersections_3/triangle_other_intersection_test
Jet_fitting_3/examples/Jet_fitting_3/*.exe
Jet_fitting_3/examples/Jet_fitting_3/*.sln
Jet_fitting_3/examples/Jet_fitting_3/*.vcproj
@ -528,6 +535,7 @@ Mesh_2/test/Mesh_2/CMakeLists.txt
Mesh_2/test/Mesh_2/Makefile
Mesh_2/test/Mesh_2/bench_double_map
Mesh_2/test/Mesh_2/cgal_test_with_cmake
Mesh_2/test/Mesh_2/conform_plus
Mesh_2/test/Mesh_2/depends
Mesh_2/test/Mesh_2/my_makefile
Mesh_2/test/Mesh_2/semantic.cache
@ -535,6 +543,7 @@ Mesh_2/test/Mesh_2/test_conforming
Mesh_2/test/Mesh_2/test_double_map
Mesh_2/test/Mesh_2/test_filtred_container
Mesh_2/test/Mesh_2/test_meshing
Mesh_2/test/Mesh_2/test_meshing_user_bug_test_case
Mesh_2/test/Mesh_2/test_vertex_and_face_bases
Mesh_3/*.tags.xml
Mesh_3/.*.deps
@ -1254,8 +1263,10 @@ Triangulation_2/test/Triangulation_2/test_const_triang_plus_2
Triangulation_2/test/Triangulation_2/test_constrained_triangulation_2
Triangulation_2/test/Triangulation_2/test_delaunay_hierarchy_2
Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_2
Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_proj
Triangulation_2/test/Triangulation_2/test_regular_hierarchy_2
Triangulation_2/test/Triangulation_2/test_regular_triangulation_2
Triangulation_2/test/Triangulation_2/test_structural_filtering_traits
Triangulation_2/test/Triangulation_2/test_triangulation_2
Triangulation_2/test/Triangulation_2/test_triangulation_2_bis
Triangulation_2/test/Triangulation_2/test_triangulation_geom_traits

View File

@ -47,7 +47,13 @@ int main()
// computes closest point and primitive id
Point_and_primitive_id pp = tree.closest_point_and_primitive(query);
std::cout << "closest point: " << pp.first << std::endl;
Point closest_point = pp.first;
Polyhedron::Face_handle f = pp.second; // closest primitive id
std::cout << "closest point: " << closest_point << std::endl;
std::cout << "closest triangle: ( "
<< f->halfedge()->vertex()->point() << " , "
<< f->halfedge()->next()->vertex()->point() << " , "
<< f->halfedge()->next()->next()->vertex()->point()
<< " )" << std::endl;
return EXIT_SUCCESS;
}

View File

@ -60,8 +60,8 @@ public:
static Scalar scalar_factor(const NT& a, Field_tag) {
return (a == NT(0)) ? NT(0) : NT(1);
}
static Scalar scalar_factor(const NT& a,
const Scalar& d,
static Scalar scalar_factor(const NT& /* a */,
const Scalar& /* d */,
Integral_domain_tag) {
return Scalar(1);
}

View File

@ -13,17 +13,13 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
endif()
endif()
find_package(CGAL QUIET COMPONENTS Core)
find_package(CGAL QUIET COMPONENTS Core MPFI)
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} )
include( CGAL_CreateSingleSourceCGALProgram )
include( CGAL_VersionUtils )
find_package( MPFI )
if( MPFI_FOUND )
include( ${MPFI_USE_FILE} )
endif( MPFI_FOUND )
include_directories (BEFORE ../../include)

View File

@ -479,7 +479,6 @@ inline
convert_to_bfi(const internal::Algebraic_real_d_1< Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1 >& x){
typedef typename Get_arithmetic_kernel<Coefficient_>::Arithmetic_kernel AT;
typedef typename AT::Bigfloat_interval BFI;
typedef internal::Algebraic_real_d_1< Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1 > ALG;
if (x.is_rational()) return convert_to_bfi(x.rational());

View File

@ -1051,7 +1051,7 @@ public:
* of the isolated polynomial
*
*/
virtual bool is_certainly_simple_root(int i) const {
virtual bool is_certainly_simple_root(int /* i */) const {
return false;
}
@ -1060,7 +1060,7 @@ public:
* of the isolated polynomial
*
*/
virtual bool is_certainly_multiple_root(int i) const {
virtual bool is_certainly_multiple_root(int /* i */) const {
return false;
}
@ -1230,7 +1230,7 @@ public:
* has at most one multiple root over the complex numbers, the roots are
* certainly isolated with success.
*/
Bitstream_descartes(M_k_descartes_tag ,
Bitstream_descartes(M_k_descartes_tag /* t */,
Polynomial f,int m,int k,
Bitstream_descartes_rndl_tree_traits traits
= Bitstream_descartes_rndl_tree_traits(),
@ -1244,7 +1244,7 @@ public:
}
Bitstream_descartes(M_k_descartes_tag t,
Bitstream_descartes(M_k_descartes_tag /* t */,
Polynomial f,int m,int k,
Bitstream_tree tree,
Bitstream_descartes_rndl_tree_traits traits
@ -1299,7 +1299,7 @@ public:
*
*/
template<typename InputIterator>
Bitstream_descartes(Vert_line_adapter_descartes_tag t,
Bitstream_descartes(Vert_line_adapter_descartes_tag /* t */,
InputIterator begin,
InputIterator end,
Bitstream_descartes_rndl_tree_traits traits)

View File

@ -1405,7 +1405,7 @@ public:
if (!is_certainly_zero) ub_log2 = Ceil_log2_abs()(x);
return true; // reported bound is tight
}
bool improve_upper_bound(NT x, long&, bool&) { return true; }
bool improve_upper_bound(NT, long&, bool&) { return true; }
};
/*! \ingroup NiX_Bitstream_descartes_tree

View File

@ -796,8 +796,6 @@ private:
CGAL_precondition(x.is_rational());
Bound r = x.rational();
typedef typename CGAL::Fraction_traits<Poly_coer_1> FT;
int k = degree_of_local_gcd(event_indices(i).fg,x);
Polynomial_2 sres = subresultants(k);
@ -1957,7 +1955,7 @@ create_slice_from_slice_info(size_type id,
switch(it->first) {
case(CGAL::internal::FIRST_CURVE): {
if(event_flag) {
arc_container.push_back(std::make_pair(0,it->second));
arc_container.push_back(Arc_pair(0,it->second));
} else {
int_container.push_back(0);
}
@ -1965,7 +1963,7 @@ create_slice_from_slice_info(size_type id,
}
case(CGAL::internal::SECOND_CURVE): {
if(event_flag) {
arc_container.push_back(std::make_pair(1,it->second));
arc_container.push_back(Arc_pair(1,it->second));
} else {
int_container.push_back(1);
}
@ -1973,7 +1971,7 @@ create_slice_from_slice_info(size_type id,
}
case(CGAL::internal::INTERSECTION): {
CGAL_assertion(event_flag);
arc_container.push_back(std::make_pair(2,it->second));
arc_container.push_back(Arc_pair(2,it->second));
break;
}
case(CGAL::internal::CANDIDATE): {

View File

@ -265,7 +265,6 @@ private:
void intern_decompose( Polynomial P_, ::CGAL::Tag_true){
typename FT_poly::Decompose decompose;
typedef typename FT_poly::Numerator_type Numerator_poly;
typedef typename Numerator_poly::NT Coeff;
typename FT_poly::Numerator_type NumP;
typename FT_poly::Denominator_type dummy;

View File

@ -290,7 +290,7 @@ private:
// X-coordinate of the shear of p
Bound x_sheared(Point p,Integer sh) {
return p.first-s*p.second;
return p.first-sh*p.second;
}
Bound x_sheared(Bound x,Bound y,Integer sh) {
return x-sh*y;

View File

@ -268,12 +268,16 @@ public:
Algebraic_real_1 y() const {
typedef std::vector< Algebraic_real_1 > Roots;
typedef typename Curve_analysis_2::Status_line_1 Key;
typedef Roots Data;
typedef std::map< Key, Data, CGAL::Handle_id_less_than< Key > >
Y_root_map;
// EBEB 2012-07-05 deactivated map for y-roots for not being used
// typedef typename Curve_analysis_2::Status_line_1 Key;
// EBEB 2012-07-05 deactivated map for y-roots for not being used
// typedef Roots Data;
// EBEB 2012-07-05 deactivated map for y-roots for not being used
// typedef std::map< Key, Data, CGAL::Handle_id_less_than< Key > >
// Y_root_map;
static Y_root_map y_root_map;
// EBEB 2012-07-05 deactivated map for y-roots for not being used
//static Y_root_map y_root_map;
if (!this->ptr()->_m_y) {
@ -287,8 +291,9 @@ public:
typename Curve_analysis_2::Status_line_1 line =
curve().status_line_at_exact_x(x());
typename Y_root_map::iterator yit =
y_root_map.find(line);
// EBEB 2012-07-05 deactivated map for y-roots for not being used
//typename Y_root_map::iterator yit =
// y_root_map.find(line);
// TODO: Cache resultant computation
// exacus-related code shouldn't be used here

View File

@ -232,10 +232,6 @@ namespace for_zero_test_bivariate {
template<typename Poly_coer_1,typename Polynomial_1>
void cast_back_utcf(const Poly_coer_1& p,Polynomial_1& q) {
// We can assume that both template arguments are polynomial types
typedef typename CGAL::Polynomial_traits_d<Poly_coer_1>::Coefficient_type
Coercion_type;
typedef typename CGAL::Polynomial_traits_d<Polynomial_1>::Coefficient_type
Coefficient;
typedef CGAL::Fraction_traits<Poly_coer_1> FT;
CGAL_static_assertion((::boost::is_same<typename FT::Is_fraction,
CGAL::Tag_true>::value));
@ -276,7 +272,7 @@ template<typename AlgebraicCurveKernel_2>
typedef typename AlgebraicCurveKernel_2::Polynomial_1 Polynomial_1;
#if !CGAL_ACK_USE_NO_REDUCTION_MODULO_RESULTANT
typedef typename AlgebraicCurveKernel_2::Algebraic_real_1 Algebraic_real_1;
//typedef typename AlgebraicCurveKernel_2::Algebraic_real_1 Algebraic_real_1;
typedef typename AlgebraicCurveKernel_2::Bound Bound;
typedef typename AlgebraicCurveKernel_2::Coefficient Coefficient;
typedef typename AlgebraicCurveKernel_2::Polynomial_2 Polynomial_2;
@ -285,8 +281,6 @@ template<typename AlgebraicCurveKernel_2>
typedef typename Coercion::Type Coercion_type;
typedef typename CGAL::Polynomial_traits_d<Polynomial_2>
::template Rebind<Coercion_type,1>::Other::Type Poly_coer_1;
typedef typename CGAL::Polynomial_traits_d<Polynomial_2>
::template Rebind<Coercion_type,2>::Other::Type Poly_coer_2;
typename Coercion::Cast cast;

View File

@ -99,7 +99,6 @@ int descartes(Polynomial& p, const Field& low,const Field& high){
*/
template <class Polynomial, class Field>
bool refine_zero_against(Field& low, Field& high, Polynomial p, Polynomial q) {
typedef typename Polynomial::NT COEFF;
typename Algebraic_structure_traits<Field>::Simplify simplify;
CGAL_precondition(low < high);

View File

@ -24,7 +24,14 @@
#include <CGAL/Polynomial_type_generator.h>
#include <CGAL/RS/functors_1.h>
template <class _C,class _G=CGAL::Rsgcd_1>
template <class _C,
class _G=
#ifdef CGAL_RS_USE_UGCD
CGAL::Modgcd_1
#else
CGAL::Rsgcd_1
#endif
>
struct Algebraic_kernel_rs_1{
typedef _C Coefficient;

View File

@ -24,7 +24,9 @@
#include <CGAL/RS/polynomial_1.h>
#include <CGAL/RS/polynomial_converter.h>
#include <CGAL/RS/solve_1.h>
#include <CGAL/RS/ugcd.h>
#ifdef CGAL_RS_USE_UGCD
#include <CGAL/RS/ugcd/ugcd.h>
#endif
#include <rs_exports.h>
#ifdef CGAL_USE_RS3
#include <rs3_fncts.h>
@ -67,6 +69,7 @@ public std::binary_function<RS_polynomial_1,RS_polynomial_1,RS_polynomial_1>{
}
};
#ifdef CGAL_RS_USE_UGCD
// my modular gcd algorithm
struct Modgcd_1:
public std::binary_function<RS_polynomial_1,RS_polynomial_1,RS_polynomial_1>{
@ -88,6 +91,7 @@ public std::binary_function<RS_polynomial_1,RS_polynomial_1,RS_polynomial_1>{
return *result;
}
};
#endif // CGAL_RS_USE_UGCD
// Cont()(c,u) stores in c the gcd of the coefficients of u
struct Cont:

View File

@ -19,7 +19,7 @@
#ifndef CGAL_RS__CRT_H
#define CGAL_RS__CRT_H
#include <CGAL/RS/pp.h>
#include "pp.h"
#include <gmp.h>
#include <vector>
#include <boost/multi_array.hpp>

View File

@ -20,7 +20,7 @@
#define CGAL_RS__P_H
#include <CGAL/RS/basic.h>
#include <CGAL/RS/inverse.h>
#include "inverse.h"
namespace CGAL{
namespace RS_MGCD{

View File

@ -20,8 +20,8 @@
#define CGAL_RS__PP_H
#include <gmp.h>
#include <CGAL/RS/p.h>
#include <CGAL/RS/pagealloc.h>
#include "p.h"
#include "pagealloc.h"
#include <cstdio>
namespace CGAL{

View File

@ -19,7 +19,7 @@
#ifndef CGAL_RS__PRIMES_H
#define CGAL_RS__PRIMES_H
#include <CGAL/RS/crt.h>
#include "crt.h"
// I borrowed these numbers from Fabrice, this leaves us around 250000 primes
#define CGALRS_PR_MIN 2145338339

View File

@ -20,9 +20,9 @@
#define CGAL_RS__UGCD_H
#include <gmp.h>
#include <CGAL/RS/primes.h>
#include "primes.h"
// let's assume that 300 is enougn for degree 500 gcds
// let's assume that 300 is enough for degree 500 gcds
#define CGALRS_MOD_QTY 300
namespace CGAL{

View File

@ -1,6 +1,5 @@
# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
project( Algebraic_kernel_d_test )
@ -13,28 +12,43 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
endif()
endif()
find_package(CGAL QUIET COMPONENTS Core )
# CGAL and its components
find_package( CGAL QUIET COMPONENTS Core MPFI RS3)
if ( CGAL_FOUND )
if ( NOT CGAL_FOUND )
message(STATUS "This project requires the CGAL library, and will not be compiled.")
return()
endif()
# include helper file
include( ${CGAL_USE_FILE} )
include( CGAL_CreateSingleSourceCGALProgram )
include( CGAL_VersionUtils )
find_package( MPFI )
if( MPFI_FOUND )
include( ${MPFI_USE_FILE} )
endif( MPFI_FOUND )
# Boost and its components
find_package( Boost REQUIRED )
find_package( RS )
if ( NOT Boost_FOUND )
if( RS_FOUND )
include( ${RS_USE_FILE} )
endif( RS_FOUND )
message(STATUS "This project requires the Boost library, and will not be compiled.")
include_directories (BEFORE ../../include)
return()
endif()
# include for local directory
include_directories( BEFORE include )
# include for local package
include_directories( BEFORE ../../include )
# Creating entries for all .cpp/.C files with "main" routine
# ##########################################################
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "Algebraic_curve_kernel_2.cpp" )
create_single_source_cgal_program( "algebraic_curve_kernel_2_tools.cpp" )
create_single_source_cgal_program( "Algebraic_kernel_d_1_LEDA.cpp" )
@ -54,10 +68,3 @@ if ( CGAL_FOUND )
else()
message(STATUS "NOTICE: Some tests require the RS library, and will not be compiled.")
endif()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -208,7 +208,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
typedef std::vector<std::pair<Algebraic_real_1,unsigned int> > ROOTS;
ROOTS roots;
Polynomial_1 p1 = (x-1)*(x-2)*(x-2);
std::back_insert_iterator<ROOTS> biit =
// std::back_insert_iterator<ROOTS> biit =
solve_1(p1,std::back_inserter(roots));
Algebraic_real_1 ar = roots[1].first;
Polynomial_1 p2 = compute_polynomial_1(ar);
@ -355,25 +355,21 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
ss>>CGAL::iformat(alg2); \
assert(alg1==alg2)
const typename Algebraic_kernel_d_1::Construct_algebraic_real_1 construct_algreal_1 =
ak_1.construct_algebraic_real_1_object();
Algebraic_real_1 alg1,alg2;
std::stringstream ss;
CGAL::set_ascii_mode(ss);
// test construction from int, Coefficient and Bound
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(int(2)));
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(Coefficient(2)));
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(Bound(2)));
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(int(2)));
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(Coefficient(2)));
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(Bound(2)));
// construction by index
Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); // the monom x
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(x*x-2,1));
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(x*x-2,1));
// construction by isolating interval
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(x*x-2,Bound(0),Bound(2)));
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(x*x-2,Bound(0),Bound(2)));
#undef CGAL_TEST_ALGEBRAIC_REAL_IO
}
}

View File

@ -14,14 +14,16 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
endif()
find_package(CGAL QUIET COMPONENTS Core )
find_package(CGAL QUIET COMPONENTS Core GMP MPFR MPFI)
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} )
include( CGAL_VersionUtils )
find_package( MPFI )
IS_VERSION_LESS("${CGAL_GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW)
get_dependency_version( GMP )
IS_VERSION_LESS("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW)
include_directories(../../include)
include_directories(include)

View File

@ -34,3 +34,11 @@ Version~3.9 introduced a new geometry-traits class that handles
rational arcs. It was developed by Oren Salzman and Michael Hemmer.
It replaced an old traits, which handled the same family of
curves, developed by Ron Wein.
Version~4.1 introduces a revised implementation of the point location class
via a randomized incremental construction of the trapezoidal map.
The old class was implemented by Oren Nechushtan, while the revamp
was done by Michal Kleinbort and Michael Hemmer. The new class adds support
for unbounded curves and can now guarantee logarithmic query time in all
cases.

View File

@ -126,13 +126,14 @@ choosing points on a grid, are also available; see the
Reference Manual for more details.
%
\item \ccc{Arr_trapezoid_ric_point_location<Arrangement>} implements
Mulmuley's point-location algorithm~\cite{m-fppa-90} (see
a point location algorithm presented by Seidel~\cite{s-sfira-91}, which uses the
randomized incremental construction described by Mulmuley~\cite{m-fppa-90} (see
also~\cite[Chapter~6]{bkos-cgaa-00}). The
arrangement faces are decomposed into simpler cells of constant
complexity known as {\em pseudo-trapezoids} and a search-structure
(a directed acyclic graph) is constructed on top of these cells,
allowing to locate the pseudo-trapezoid (hence the arrangement
cell) containing a query point in expected logarithmic time.
cell) containing a query point in logarithmic time.
\end{itemize}
The main advantage of the first two strategies is that they do not
@ -152,19 +153,35 @@ On the other hand, the landmarks and the trapezoid RIC strategies
require auxiliary data structures on top of the arrangement, which
they need to construct once they are attached to an arrangement
object and need to keep up-to-date as this arrangement changes.
The data structures needed by both strategies can be constructed
The data structure needed by the landmarks strategy can be constructed
in $O(N \log N)$ time (where $N$ is the overall number of edges in
the arrangement),
but the construction needed by the landmark algorithm is in
practice significantly faster. In addition, although both
the arrangement), whereas the construction of the data structure needed
by the trapezoid RIC strategy takes expected $O(N \log N)$, but
may require several rebuilds. As shown in~\cite{hkh-iiplgtds-12}, one can
expect only a small number of rebuilds.
In practice, the construction needed by the landmark algorithm is
significantly faster.
In addition, although both
resulting data structures are asymptotically linear in size, the
\kdtree\ that the landmark algorithm stores needs significantly
less memory. We note that Mulmuley's algorithm guarantees a
logarithmic query time, while the query time for the landmark
strategy is only logarithmic on average --- and we may have
scenarios where the query time can be linear. In practice however,
less memory.
We note that the trapezoid RIC algorithm guarantees a
logarithmic query time for any scenario
making it advantageous comparing to other strategies.
The query time of the landmarks strategy, on the other hand,
is only logarithmic on average --- and we may have
scenarios where the query time can be linear.
In practice, in many scenarios
the query times of both strategies are competitive. For a detailed
experimental comparison, see \cite{cgal:hh-eplca-05}
experimental comparison, see \cite{hh-esplp-08}.
Another advantageous feature of the trapezoid RIC strategy
when compared with other methods
is the unbounded curves support.
Currently, this is the most efficient strategy
suitable for general unbounded subdivisions.
The main drawback in the current implementation of the landmark
strategy, compared to the trapezoidal RIC strategy, is that while
@ -181,12 +198,14 @@ support these extra operations.
It is therefore recommended to use the
\ccc{Arr_landmarks_point_location} class when the application
frequently issues point-location queries on an
arrangement that only seldom changes. If the arrangement is more
frequently issues point-location queries on a bounded
arrangement that only seldom changes. If the arrangement
consists of unbounded curves or is more
dynamic and is frequently going through changes, the
\ccc{Arr_trapezoid_ric_point_location} class should be the
selected point-location strategy.
\subsubsection{An Example\label{arr_sssec:pl_ex}}
%~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -18,11 +18,12 @@ The \ccRefName\ class implements the incremental randomized algorithm
introduced by Mulmuley~\cite{m-fppa-90} as presented by
Seidel~\cite{s-sfira-91} (see also~\cite[Chapter~6]{bkos-cgaa-00}).
It subdivides each arrangement face to pseudo-trapezoidal cells, each
of constant complexity, and constructs and maintains a search
of constant complexity, and constructs and maintains a linear-size search
structure on top of these cells, such that each query can be answered
in $O(\log n)$ time, where $n$ is the complexity of the arrangement.
Constructing the search structures takes $O(n \log n)$ time, such that
Constructing the search structures takes $O(n \log n)$ expected time
and may require a small number of rebuilds~\cite{hkh-iiplgtds-12}. Therefore
attaching a trapezoidal point-location object to an existing arrangement
may incur some overhead in running times. In addition, the point-location
object needs to keep its auxiliary data structures up-to-date as the
@ -31,12 +32,30 @@ to use this point-location strategy for static arrangements (or arrangement
that do not alter frequently), and when the number of issued queries
is relatively large.
This strategy supports arbitrary subdivisions, including unbounded ones.
\ccInclude{CGAL/Arr_trapezoid_ric_point_location.h}
\ccIsModel
\ccc{ArrangementPointLocation_2} \\
\ccc{ArrangementVerticalRayShoot_2}
\ccCreation
\ccCreationVariable{pl}
%---------------------
\ccConstructor{Arr_trapezoid_ric_point_location (bool with_guarantees = true);}
{If with\_guarantees is set to true, the cunstruction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time.}
\ccConstructor{Arr_trapezoid_ric_point_location (const Arrangement& arr, bool with_guarantees = true);}
{Constructs a point location search structure for the given arrangement. If with\_guarantees is set to true, the cunstruction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time.}
\ccModifiers
%===========
\ccMethod{void with_guarantees (bool with_guarantees);}
{If with\_guarantees is set to true, the structure will guarantee linear size and logarithmic query time, that is, this function may cause a reconstruction of the data structure. }
\end{ccRefClass}
\ccRefPageEnd

View File

@ -0,0 +1,20 @@
#ifndef ARR_INEXACT_CONSTRUCTION_SEGMENTS_H
#define ARR_INEXACT_CONSTRUCTION_SEGMENTS_H
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Arr_non_caching_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT Number_type;
typedef CGAL::Arr_non_caching_segment_traits_2<Kernel> Traits;
typedef Traits::Point_2 Point;
typedef Traits::X_monotone_curve_2 Segment;
typedef CGAL::Arrangement_2<Traits> Arrangement;
typedef Arrangement::Vertex_handle Vertex_handle;
typedef Arrangement::Halfedge_handle Halfedge_handle;
typedef Arrangement::Face_handle Face_handle;
#endif

View File

@ -1,37 +1,21 @@
//! \file examples/Arrangement_on_surface_2/isolated_vertices.cpp
// Constructing an arrangement with isolated vertices.
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include "arr_inexact_construction_segments.h"
#include "arr_print.h"
typedef int Number_type;
typedef CGAL::Simple_cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::Point_2 Point_2;
typedef Traits_2::X_monotone_curve_2 Segment_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
typedef Arrangement_2::Vertex_handle Vertex_handle;
typedef Arrangement_2::Halfedge_handle Halfedge_handle;
typedef Arrangement_2::Face_handle Face_handle;
int main()
{
Arrangement_2 arr;
// Insert some isolated points:
// Insert isolated points.
Arrangement arr;
Face_handle uf = arr.unbounded_face();
Vertex_handle u1 = arr.insert_in_face_interior (Point_2 (3, 3), uf);
Vertex_handle u2 = arr.insert_in_face_interior (Point_2 (1, 5), uf);
Vertex_handle u3 = arr.insert_in_face_interior (Point_2 (5, 5), uf);
arr.insert_in_face_interior(Point(3, 3), uf);
arr.insert_in_face_interior(Point(1, 5), uf);
arr.insert_in_face_interior(Point(5, 5), uf);
// Insert four segments that form a rectangular face:
Segment_2 s1 (Point_2 (1, 3), Point_2 (3, 5));
Segment_2 s2 (Point_2 (3, 5), Point_2 (5, 3));
Segment_2 s3 (Point_2 (5, 3), Point_2 (3, 1));
Segment_2 s4 (Point_2 (3, 1), Point_2 (1, 3));
// Insert four segments that form a square-shaped face.
Point p1(1, 3), p2(3, 5), p3(5, 3), p4(3, 1);
Segment s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p1);
Halfedge_handle e1 = arr.insert_in_face_interior(s1, uf);
Vertex_handle v1 = e1->source();
@ -40,21 +24,14 @@ int main ()
Vertex_handle v3 = e2->target();
Halfedge_handle e3 = arr.insert_from_right_vertex(s3, v3);
Vertex_handle v4 = e3->target();
Halfedge_handle e4 = arr.insert_at_vertices (s4, v4, v1);
arr.insert_at_vertices(s4, v4, v1);
// Remove the isolated vertices located in the unbounded face.
Arrangement_2::Vertex_iterator curr_v, next_v;
for (curr_v = arr.vertices_begin();
curr_v != arr.vertices_end(); curr_v = next_v)
{
// Store an iterator to the next vertex (as we may delete curr_v and
// invalidate the iterator).
next_v = curr_v;
++next_v;
if (curr_v->is_isolated() && curr_v->face() == uf)
arr.remove_isolated_vertex (curr_v);
Arrangement::Vertex_iterator curr, next = arr.vertices_begin();
for (curr = next++; curr != arr.vertices_end(); curr = next++) {
// Keep an iterator to the next vertex, as curr might be deleted.
if (curr->is_isolated() && curr->face() == uf)
arr.remove_isolated_vertex(curr);
}
print_arrangement(arr);

View File

@ -1,36 +1,16 @@
//! \file examples/Arrangement_on_surface_2/special_edge_insertion.cpp
// Constructing an arrangement using the specialized edge-insertion functions.
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include "arr_inexact_construction_segments.h"
#include "arr_print.h"
typedef int Number_type;
typedef CGAL::Simple_cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::Point_2 Point_2;
typedef Traits_2::X_monotone_curve_2 Segment_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
typedef Arrangement_2::Vertex_handle Vertex_handle;
typedef Arrangement_2::Halfedge_handle Halfedge_handle;
int main()
{
Arrangement_2 arr;
Point_2 p0 (3, 3);
Point_2 p1 (1, 3), p2 (3, 5), p3 (5, 3), p4 (3, 1);
Segment_2 s1 (p1, p2);
Segment_2 s2 (p2, p3);
Segment_2 s3 (p3, p4);
Segment_2 s4 (p4, p1);
Segment_2 s5 (p1, p0);
Segment_2 s6 (p0, p3);
Segment_2 s7 (p4, p0);
Segment_2 s8 (p0, p2);
Point p0(3, 3), p1(1, 3), p2(3, 5), p3(5, 3), p4(3, 1);
Segment s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p1);
Segment s5(p1, p0), s6(p0, p3), s7(p4, p0), s8(p0, p2);
Arrangement arr;
Vertex_handle v0 = arr.insert_in_face_interior(p0, arr.unbounded_face());
Halfedge_handle e1 = arr.insert_in_face_interior(s1, arr.unbounded_face());
Halfedge_handle e2 = arr.insert_from_left_vertex(s2, e1);
@ -38,8 +18,8 @@ int main ()
Halfedge_handle e4 = arr.insert_at_vertices(s4, e3, e1->twin());
Halfedge_handle e5 = arr.insert_at_vertices(s5, e1->twin(), v0);
Halfedge_handle e6 = arr.insert_at_vertices(s6, e5, e3->twin());
Halfedge_handle e7 = arr.insert_at_vertices (s7, e4->twin(), e6->twin());
Halfedge_handle e8 = arr.insert_at_vertices (s8, e5, e2->twin());
arr.insert_at_vertices(s7, e4->twin(), e6->twin());
arr.insert_at_vertices(s8, e5, e2->twin());
print_arrangement(arr);
return 0;

View File

@ -65,7 +65,7 @@ public:
// Copy constructor
Arr_algebraic_segment_traits_2 (const Self& s) { /* No state...*/}
Arr_algebraic_segment_traits_2 (const Self& /* s */) { /* No state...*/}
// Assignement operator
const Self& operator= (const Self& s)
@ -314,19 +314,27 @@ public:
if(left_on_arc && (!right_on_arc)) {
if(!it_seg.is_finite(CGAL::ARR_MAX_END) ||
!equal(start.get(),right(it_seg))) {
if(it_seg.is_finite(CGAL::ARR_MIN_END) && equal(start.get(),left(it_seg))) {
segs.push_back(it_seg);
} else {
X_monotone_curve_2 split1,split2;
it_seg.split(start.get(),split1,split2);
segs.push_back(split2);
}
}
}
if((!left_on_arc) && right_on_arc) {
if(!it_seg.is_finite(CGAL::ARR_MIN_END) ||
! equal(left(it_seg),end.get())) {
if(it_seg.is_finite(CGAL::ARR_MAX_END) && equal(end.get(),right(it_seg))) {
segs.push_back(it_seg);
} else {
X_monotone_curve_2 split1,split2;
it_seg.split(end.get(),split1,split2);
segs.push_back(split1);
}
}
}
if( (!left_on_arc) && (!right_on_arc)) {
segs.push_back(it_seg);
}

View File

@ -42,10 +42,10 @@ namespace CGAL {
* and the value-type of OutputIterator is pair<Point_2,Object>, where
* the Object represents the arrangement feature containing the points.
*/
template<class GeomTraits, class TopTraits,
class PointsIterator, class OutputIterator>
OutputIterator locate
(const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
template<typename GeomTraits, typename TopTraits,
typename PointsIterator, typename OutputIterator>
OutputIterator
locate(const Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
PointsIterator points_begin, PointsIterator points_end,
OutputIterator oi)
{
@ -70,34 +70,24 @@ OutputIterator locate
// left.
std::vector<Bpl_x_monotone_curve_2> xcurves_vec(arr.number_of_edges());
Edge_const_iterator eit;
Halfedge_const_handle he;
unsigned int i = 0;
for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit, ++i)
{
for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) {
// Associate each x-monotone curve with the halfedge that represent it
// that is directed from right to left.
if (eit->direction() == ARR_RIGHT_TO_LEFT)
he = eit;
else
he = eit->twin();
xcurves_vec[i] = Bpl_x_monotone_curve_2 (eit->curve(), he);
Halfedge_const_handle he =
(eit->direction() == ARR_RIGHT_TO_LEFT) ? eit : eit->twin();
xcurves_vec[i++] = Bpl_x_monotone_curve_2(eit->curve(), he);
}
// Go over all isolated vertices and collect their points. To each point
// we attach its vertex handle.
std::vector<Bpl_point_2> iso_pts_vec(arr.number_of_isolated_vertices());
Vertex_const_iterator vit;
Vertex_const_handle iso_v;
i = 0;
for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit, ++i)
{
if (vit->is_isolated())
{
iso_v = vit;
iso_pts_vec[i] = Bpl_point_2 (vit->point(), iso_v);
for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) {
if (vit->is_isolated()) {
Vertex_const_handle iso_v = vit;
iso_pts_vec[i++] = Bpl_point_2(vit->point(), iso_v);
}
}

View File

@ -151,7 +151,7 @@ public:
* arrangement (a vertex, halfedge, or face handle).
* \return The nearest landmark point.
*/
virtual Point_2 closest_landmark (Point_2 p, Object &obj)
virtual Point_2 closest_landmark (const Point_2& p, Object &obj)
{
CGAL_assertion(updated);
return (nn.find_nearest_neighbor(p, obj));

View File

@ -128,17 +128,13 @@ protected:
// Create N random landmarks. If N was not given to the constructor,
// set it to be the number of vertices in the arrangement.
CGAL::Random random;
double px, py;
unsigned int i;
if (num_landmarks == 0)
num_landmarks = arr->number_of_vertices();
for (i = 0; i < num_landmarks; i++)
{
px = random.get_double(x_min, x_max);
py = random.get_double(y_min, y_max);
CGAL::Random random;
for (unsigned int i = 0; i < num_landmarks; ++i) {
double px = (x_min == x_max) ? x_min : random.get_double(x_min, x_max);
double py = (y_min == y_max) ? y_min : random.get_double(y_min, y_max);
points.push_back(Point_2 (px, py));
}
}

View File

@ -48,7 +48,7 @@ Object Arr_trapezoid_ric_point_location<Arrangement_2>
// typedef the Locate_type
typename TD::Locate_type td_lt;
const X_curve_plus& cv = td.locate(p,td_lt).top();
Td_map_item& tr = td.locate(p,td_lt);
CGAL_TRAP_PRINT_DEBUG("after td.locate");
@ -57,8 +57,10 @@ Object Arr_trapezoid_ric_point_location<Arrangement_2>
if (td_lt==TD::UNBOUNDED_TRAPEZOID)
{
CGAL_TRAP_PRINT_DEBUG("UNBOUNDED_TRAPEZOID");
Face_const_handle ubf = _get_unbounded_face(tr, p, Are_all_sides_oblivious_tag());
//check isolated vertices
Face_const_handle ubf = this->arrangement()->unbounded_face();
Isolated_vertex_const_iterator iso_verts_it;
for (iso_verts_it = ubf->isolated_vertices_begin();
iso_verts_it != ubf->isolated_vertices_end();
@ -73,54 +75,48 @@ Object Arr_trapezoid_ric_point_location<Arrangement_2>
return (CGAL::make_object (ubf));
}
Halfedge_const_handle h = cv.get_parent();
switch(td_lt)
{
case TD::POINT:
{
//p is interior so it should fall on Td_active_vertex
Td_active_vertex& v (boost::get<Td_active_vertex>(tr));
CGAL_TRAP_PRINT_DEBUG("POINT");
if (m_traits->equal_2_object()(h->target()->point(), p))
{
Vertex_const_handle vh = h->target();
return (CGAL::make_object (vh));
CGAL_assertion(!v.vertex()->is_at_open_boundary());
return (CGAL::make_object(v.vertex()));
}
if (m_traits->equal_2_object()(h->source()->point(), p))
{
Vertex_const_handle vh = h->source();
return (CGAL::make_object (vh));
}
else
CGAL_error();
break;
}
case TD::CURVE:
{
Td_active_edge& e (boost::get<Td_active_edge>(tr));
Halfedge_const_handle h = e.halfedge();
CGAL_TRAP_PRINT_DEBUG("CURVE");
if ( m_traits->is_in_x_range_2_object()(cv,p) &&
m_traits->compare_y_at_x_2_object()(p,cv) == EQUAL)
return (CGAL::make_object(h));
else
if ( m_traits->is_in_x_range_2_object()(h->curve(),p) &&
m_traits->compare_y_at_x_2_object()(p,h->curve()) == EQUAL)
{
//ixx
std::cerr << "curve is: "<<cv<<" point is: "<<p <<std::endl;
return (CGAL::make_object(h));
}
else
CGAL_error();
}
break;
}
case TD::TRAPEZOID:
{
Td_active_trapezoid t (boost::get<Td_active_trapezoid>(tr));
Halfedge_const_handle h = t.top();
CGAL_TRAP_PRINT_DEBUG("TRAPEZOID");
if (!(((m_traits->is_in_x_range_2_object()(h->curve(),p)) &&
(m_traits->compare_y_at_x_2_object()(p, h->curve()) == LARGER)) ==
(m_traits->compare_x_2_object()(h->source()->point(),
h->target()->point()) == SMALLER)
))
bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p))
&& (m_traits->compare_y_at_x_2_object()
(p, h->curve()) == LARGER) ;
bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT);
if (is_p_above_h != is_h_ltr) //if not, take the twin halfedge
{
h = h->twin();
Face_const_handle fh = h->face();
}
Face_const_handle fh = h->face();
//check isolated vertices
Isolated_vertex_const_iterator iso_verts_it;
for (iso_verts_it = fh->isolated_vertices_begin();
@ -135,6 +131,7 @@ Object Arr_trapezoid_ric_point_location<Arrangement_2>
return (CGAL::make_object(fh));
}
break;
default:
CGAL_TRAP_PRINT_DEBUG("DEFAULT");
CGAL_error();
@ -145,6 +142,113 @@ Object Arr_trapezoid_ric_point_location<Arrangement_2>
return Object();
}
/*! gets the unbounded face that contains the point when the trapezoid is unbounded
*/
template <class Arrangement>
typename Arr_trapezoid_ric_point_location<Arrangement>::Face_const_handle
Arr_trapezoid_ric_point_location<Arrangement>::
_get_unbounded_face(const Td_map_item& item, const Point_2& p,
Arr_all_sides_oblivious_tag) const
{
//there's only one unbounded face
return this->arrangement()->unbounded_faces_begin();
}
/*! gets the unbounded face that contains the point when the trapezoid
* is unbounded
*/
template <class Arrangement>
typename Arr_trapezoid_ric_point_location<Arrangement>::Face_const_handle
Arr_trapezoid_ric_point_location<Arrangement>::
_get_unbounded_face(const Td_map_item& item,const Point_2& p,
Arr_not_all_sides_oblivious_tag) const
{
Td_active_trapezoid tr (boost::get<Td_active_trapezoid>(item));
// Halfedge_const_handle h = tr.top();
if (!tr.is_on_top_boundary() || !tr.is_on_bottom_boundary()) {
//if one of top or bottom edges is defined
Halfedge_const_handle h =
(!tr.is_on_top_boundary()) ? tr.top() : tr.bottom();
bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) &&
(m_traits->compare_y_at_x_2_object()(p, h->curve()) == LARGER);
bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT);
if (is_p_above_h != is_h_ltr) //if not, take the twin halfedge
h = h->twin();
return h->face();
}
else if (!tr.is_on_left_boundary()) {
//if top & bottom edges are not defined but the left() curve end is defined
//there are different internal compiler errors if we
// typedef the Locate_type
typename TD::Locate_type td_lt;
//locate the degenerate trapezoid containing tr.left()
Td_map_item& left_v_item = td.locate(tr.left(),td_lt);
CGAL_assertion(td_lt == TD::POINT);
Halfedge_const_handle he;
if (boost::get<Td_active_vertex>(&left_v_item) != NULL) {
Td_active_vertex v(boost::get<Td_active_vertex>(left_v_item));
he = v.cw_he();
}
else {
Td_active_fictitious_vertex
v(boost::get<Td_active_fictitious_vertex>(left_v_item));
he = v.cw_he();
}
//cw_he() holds the "smallest" curve clockwise starting from 12 o'clock
CGAL_assertion_code(Halfedge_const_handle invalid_he);
CGAL_assertion(he != invalid_he);
//the Halfedge_handle source is left_ee.
// this way the face on it's left is the desired one
//MICHAL: maybe add a verification that the above occures
return he->face();
}
else if (!tr.is_on_right_boundary()) {
//if top, bottom, left edges are not defined but the right() curve end
// is defined
//there are different internal compiler errors if we
// typedef the Locate_type
typename TD::Locate_type td_lt;
//locate the degenerate trapezoid of tr.right().
Td_map_item& right_v_item = td.locate(tr.right(),td_lt);
CGAL_assertion(td_lt == TD::POINT);
Halfedge_const_handle he;
if (boost::get<Td_active_vertex>(&right_v_item)!= NULL) {
Td_active_vertex v(boost::get<Td_active_vertex>(right_v_item));
he = v.cw_he();
}
else {
Td_active_fictitious_vertex
v(boost::get<Td_active_fictitious_vertex>(right_v_item));
he = v.cw_he();
}
//its cw_he() holds the "smallest" curve clockwise starting from
// 12 o'clock
CGAL_assertion_code(Halfedge_handle invalid_he);
CGAL_assertion(he != invalid_he);
//the Halfedge_handle source is right_ee.
// this way the face on it's left is the desired one
//MICHAL: maybe add a verification that the above occures
return he->face();
}
//else, on all boundaries (top, bottom, left, right - are not defined),
// this is the only trapezoid in the map
return this->arrangement()->unbounded_faces_begin();
}
//-----------------------------------------------------------------------------
// Locate the arrangement feature which a vertical ray emanating from the
// given point hits, considering isolated vertices.
@ -157,57 +261,58 @@ Object Arr_trapezoid_ric_point_location<Arrangement>
typename TD::Locate_type td_lt;
Halfedge_const_handle invalid_he;
X_curve_plus cv = td.vertical_ray_shoot(p, td_lt, shoot_up);
Td_map_item& item = td.vertical_ray_shoot(p, td_lt, shoot_up);
// treat special case, where trapezoid is unbounded.
// for then get_parent() is not defined
if (td_lt==TD::UNBOUNDED_TRAPEZOID)
{
return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up));
return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up, item));
}
Halfedge_const_handle h = cv.get_parent();
switch(td_lt)
{
case TD::POINT:
if (m_traits->equal_2_object()(h->target()->point(), p))
{
Vertex_const_handle vh = h->target();
return (CGAL::make_object (vh));
//p fell on Td_active_vertex
Td_active_vertex& v (boost::get<Td_active_vertex>(item));
return (CGAL::make_object(v.vertex()));
}
if (m_traits->equal_2_object()(h->source()->point(), p))
{
Vertex_const_handle vh = h->source();
return (CGAL::make_object (vh));
}
else
CGAL_error();
break;
case TD::CURVE:
{
Td_active_edge& e (boost::get<Td_active_edge>(item));
Halfedge_const_handle h = e.halfedge();
if ((shoot_up && h->direction() == ARR_LEFT_TO_RIGHT) ||
(!shoot_up && h->direction() == ARR_RIGHT_TO_LEFT))
{
h=h->twin();
}
return (CGAL::make_object(h));
}
break;
case TD::TRAPEZOID:
if (!(((m_traits->is_in_x_range_2_object()(h->curve(),p)) &&
(m_traits->compare_y_at_x_2_object()(p, h->curve()) == LARGER)) ==
(m_traits->compare_x_2_object()(h->source()->point(),
h->target()->point()) == SMALLER)
))
{
Td_active_trapezoid trpz (boost::get<Td_active_trapezoid>(item));
Halfedge_const_handle h = (shoot_up) ? trpz.top() : trpz.bottom();
bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p))
&& (m_traits->compare_y_at_x_2_object()
(p, h->curve()) == LARGER) ;
bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT);
if (is_p_above_h != is_h_ltr) //if not, take the twin halfedge
h = h->twin();
return (_check_isolated_for_vertical_ray_shoot(h, p, shoot_up));
return (_check_isolated_for_vertical_ray_shoot(h, p, shoot_up, item));
}
break;
default:
{
CGAL_error();
}
break;
}
return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up));
return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up, item));
}
//-----------------------------------------------------------------------------
@ -219,7 +324,8 @@ template <class Arrangement>
Object Arr_trapezoid_ric_point_location<Arrangement>::
_check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found,
const Point_2& p,
bool shoot_up) const
bool shoot_up,
const Td_map_item& tr) const
{
const Comparison_result point_above_under = (shoot_up ? SMALLER : LARGER);
typename Geometry_traits_2::Compare_x_2 compare_x =
@ -238,7 +344,7 @@ _check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found,
// If the closest feature is a valid halfedge, take its incident face.
// Otherwise, take the unbounded face.
if (halfedge_found == invalid_he)
face = this->arrangement()->unbounded_face();
face = _get_unbounded_face(tr, p, Are_all_sides_oblivious_tag());
else
face = halfedge_found->face();

View File

@ -0,0 +1,292 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may uactivese this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h $
// $Id: Td_active_edge.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_ACTIVE_EDGE_H
#define CGAL_TD_ACTIVE_EDGE_H
/*! \file
* Defintion of the Td_active_edge<Td_traits> class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_active_edge : public Handle
{
public:
//type of traits class
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Td_active_edge (Self)
typedef typename Traits::Td_active_edge Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
friend class Td_active_edge<Td_traits_>;
public:
//c'tors
Data (Halfedge_const_handle _he,
const Td_map_item& _next,
Dag_node* _p_node)
: he(_he),next(_next),p_node(_p_node)
{ }
~Data() { }
protected:
Halfedge_const_handle he;
Td_map_item next;
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
#else
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
#endif //CGAL_TD_DEBUG
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
/*! Initialize the trapezoid's neighbours. */
inline void init_neighbours(boost::optional<Td_map_item&> next)
{
set_next((next) ? *next : Td_map_item(0));
}
/*! Set the DAG node. */
CGAL_TD_INLINE void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
//m_dag_node = p;
//#ifdef CGAL_TD_DEBUG
//
// CGAL_assertion(!p || **p == *this);
//
//#endif
}
///*! Set the trapezoid's bottom (Halfedge_const_handle). */
CGAL_TD_INLINE void set_halfedge(Halfedge_const_handle he)
{
if (halfedge() != Traits::empty_he_handle() &&
halfedge()->direction() != he->direction())
{
ptr()->he = he->twin();
}
else
{
ptr()->he = he;
}
}
/*! Set next edge fragment. */
inline void set_next( const Td_map_item& next) { ptr()->next = next; }
public:
/// \name Constructors.
//@{
Td_active_edge ()
{
PTR = new Data
(Traits::empty_he_handle(), Td_map_item(0), NULL);
//m_dag_node = NULL;
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_edge (Halfedge_const_handle he ,
Dag_node* node = 0,
boost::optional<Td_map_item&> next = boost::none)
{
PTR = new Data(he, (next) ? *next : Td_map_item(0), node);
//m_dag_node = node;
}
/*! Copy constructor. */
Td_active_edge(const Self& tr) : Handle(tr)
{
// m_dag_node = tr.m_dag_node;
}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
CGAL_TD_INLINE Self& operator= (const Self& t2)
{
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
CGAL_TD_INLINE bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
/*! Operator!=. */
CGAL_TD_INLINE bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
//@}
/// \name Access methods.
//@{
CGAL_TD_INLINE Self& self()
{
return *this;
}
CGAL_TD_INLINE const Self& self() const
{
return *this;
}
/*! Access the trapezoid id (PTR). */
CGAL_TD_INLINE unsigned long id() const
{
return (unsigned long) PTR;
}
inline Halfedge_const_handle halfedge() const
{
return ptr()->he;
}
/*! Access next edge fragment. */
Td_map_item& next() const { return ptr()->next; }
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;}
//@}
};
} //namespace CGAL
#endif

View File

@ -0,0 +1,309 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h $
// $Id: Td_active_fictitious_vertex.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
#define CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
/*! \file
* Defintion of the Td_active_fictitious_vertex<Td_traits> class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_active_fictitious_vertex : public Handle
{
public:
//type of traits class
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
//type of Td_active_fictitious_vertex (Self)
typedef typename Traits::Td_active_fictitious_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
friend class Td_active_fictitious_vertex<Td_traits_>;
public:
//c'tors
Data (Vertex_const_handle _v,
Halfedge_const_handle _cw_he,
Dag_node* _p_node)
: v(_v),cw_he(_cw_he),p_node(_p_node)
{ }
~Data() { }
protected:
Vertex_const_handle v;
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const
{
//the circulator is of incoming halfedges
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
//if the vertex is associated with a point on the bounded coords,
// we can take any incident halfedge. o/w if the vertex lies at infinity,
// it has 2 fictitious incident halfedges
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
return Curve_end(he->curve(),
(he->direction() == ARR_RIGHT_TO_LEFT)?
ARR_MIN_END : ARR_MAX_END);
}
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
#else
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
/*! Set the vertex handle (Vertex_const_handle). */
inline void set_vertex(Vertex_const_handle v)
{
ptr()->v = v;
}
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
inline void set_cw_he(Halfedge_const_handle he)
{
if (cw_he() != Traits::empty_he_handle() &&
cw_he()->direction() != he->direction())
{
ptr()->cw_he = he->twin();
}
else
{
ptr()->cw_he = he;
}
}
public:
/// \name Constructors.
//@{
Td_active_fictitious_vertex ()
{
PTR = new Data
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_fictitious_vertex (Vertex_const_handle v,
Halfedge_const_handle cw_he,
Dag_node* node = 0)
{
PTR = new Data(v, cw_he, node);
}
/*! Copy constructor. */
Td_active_fictitious_vertex (const Self& tr) : Handle(tr)
{
}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
{
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
/*! Access trapezoid left.
* filters out the infinite case which returns predefined dummy values
*/
inline Vertex_const_handle vertex() const
{
return ptr()->v;
}
Curve_end curve_end() const
{
return vtx_to_ce(vertex());
}
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he () const
{
return ptr()->cw_he;
}
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;}
//@}
};
} //namespace CGAL
#endif

View File

@ -0,0 +1,429 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//trapezoid
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h $
// $Id: Td_active_trapezoid.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_ACTIVE_TRAPEZOID_H
#define CGAL_TD_ACTIVE_TRAPEZOID_H
/*! \file
* Defintion of the Td_active_trapezoid<Td_traits> class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <CGAL/tuple.h>
#include <boost/variant.hpp>
#include <boost/optional.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
* Implementation of an active trapezoid as two halfedges(top,bottom)
* and two vertices(left,right).
* Trapezoids are represented as two vertices called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Each trapezoid has at most four neighbouring trapezoids.
*/
template <typename Td_traits_>
class Td_active_trapezoid : public Handle
{
public:
//type of traits class
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Td_active_trapezoid (Self)
typedef typename Traits::Td_active_trapezoid Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
protected:
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
friend class Td_active_trapezoid<Td_traits_>;
public:
//c'tors
Data (Vertex_const_handle _left_v,
Vertex_const_handle _right_v,
Halfedge_const_handle _bottom_he,
Halfedge_const_handle _top_he,
const Td_map_item& _lb,
const Td_map_item& _lt,
const Td_map_item& _rb,
const Td_map_item& _rt,
Dag_node* _p_node)
: left_v(_left_v), right_v(_right_v),
bottom_he(_bottom_he), top_he(_top_he),
lb(_lb), lt(_lt), rb(_rb), rt(_rt), p_node(_p_node)
{ }
~Data() { }
protected:
Vertex_const_handle left_v;
Vertex_const_handle right_v;
Halfedge_const_handle bottom_he;
Halfedge_const_handle top_he;
Td_map_item lb;
Td_map_item lt;
Td_map_item rb;
Td_map_item rt;
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
#else
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
#endif //CGAL_TD_DEBUG
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
/*! Initialize the trapezoid's neighbours. */
inline void init_neighbours(boost::optional<Td_map_item&> lb,
boost::optional<Td_map_item&> lt,
boost::optional<Td_map_item&> rb,
boost::optional<Td_map_item&> rt)
{
set_lb((lb) ? *lb : Td_map_item(0));
set_lt((lt) ? *lt : Td_map_item(0));
set_rb((rb) ? *rb : Td_map_item(0));
set_rt((rt) ? *rt : Td_map_item(0));
}
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
// m_dag_node = p;
//
//#ifdef CGAL_TD_DEBUG
//
// CGAL_assertion(!p || **p == *this);
//
//#endif
}
/*! Set the trapezoid's left (Vertex_const_handle). */
inline void set_left(Vertex_const_handle v) { ptr()->left_v = v; }
/*! Set the trapezoid's right (Vertex_const_handle). */
inline void set_right(Vertex_const_handle v) { ptr()->right_v = v; }
/*! Set the trapezoid's bottom (Halfedge_const_handle). */
inline void set_bottom(Halfedge_const_handle he)
{
if (!is_on_bottom_boundary() && (bottom()->direction() != he->direction()))
{
ptr()->bottom_he = he->twin();
}
else
{
ptr()->bottom_he = he;
}
}
/*! Set the trapezoid's top (Halfedge_const_handle). */
inline void set_top(Halfedge_const_handle he)
{
if (!is_on_top_boundary() && (top()->direction() != he->direction()))
{
ptr()->top_he = he->twin();
}
else
{
ptr()->top_he = he;
}
}
/*! Set left bottom neighbour. */
inline void set_lb(const Td_map_item& lb) { ptr()->lb = lb; }
/*! Set left top neighbour. */
inline void set_lt(const Td_map_item& lt) { ptr()->lt = lt; }
/*! Set right bottom neighbour. */
inline void set_rb(const Td_map_item& rb) { ptr()->rb = rb; }
/*! Set right top neighbour. */
inline void set_rt(const Td_map_item& rt) { ptr()->rt = rt; }
public:
/// \name Constructors.
//@{
/*! Default constructor. */
Td_active_trapezoid()
{
//define the initial trapezoid: left, right, btm, top are at infinity.
// has no neighbours
PTR = new Data(Traits::empty_vtx_handle(),
Traits::empty_vtx_handle(),
Traits::empty_he_handle(),
Traits::empty_he_handle(),
Td_map_item(0), Td_map_item(0) ,
Td_map_item(0), Td_map_item(0), NULL);
//m_dag_node = 0;
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r,
Halfedge_const_handle b, Halfedge_const_handle t,
boost::optional<Td_map_item&> lb = boost::none,
boost::optional<Td_map_item&> lt = boost::none,
boost::optional<Td_map_item&> rb = boost::none,
boost::optional<Td_map_item&> rt = boost::none,
Dag_node* node = 0)
{
PTR = new Data(l, r, b, t, (lb) ? *lb : Td_map_item(0),
(lt) ? *lt : Td_map_item(0), (rb) ? *rb : Td_map_item(0),
(rt) ? *rt : Td_map_item(0), node);
//m_dag_node = node;
}
/*! Copy constructor. */
Td_active_trapezoid (const Self& tr) : Handle(tr)
{
//m_dag_node = tr.m_dag_node;
}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator=(const Self& t2)
{
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator==(const Self& t2) const
{
return (ptr() == t2.ptr());
}
/*! Operator!=. */
inline bool operator!=(const Self& t2) const
{
return !(operator==(t2));
}
//@}
/// \name Access methods.
//@{
inline Self& self() { return *this; }
inline const Self& self() const { return *this; }
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const { return (unsigned long) PTR; }
/*! Access trapezoid left.
* filters out the infinite case which returns predefined dummy values
*/
inline Vertex_const_handle left() const { return ptr()->left_v; }
/*! Access trapezoid right.
* filters out the infinite case which returns predefined dummy values
*/
inline Vertex_const_handle right() const { return ptr()->right_v; }
/*! Access trapezoid bottom.
* filters out the infinite case which returns predefined dummy values
*/
inline Halfedge_const_handle bottom() const { return ptr()->bottom_he; }
/*! Access trapezoid top.
* filters out the infinite case which returns predefined dummy values
*/
inline Halfedge_const_handle top() const { return ptr()->top_he; }
/*! Access is on left boundary. */
inline bool is_on_left_boundary() const
{ return (left() == Traits::empty_vtx_handle()); }
/*! Access is on right boundary. */
inline bool is_on_right_boundary() const
{ return (right() == Traits::empty_vtx_handle()); }
/*! Access is on bottom boundary. */
inline bool is_on_bottom_boundary() const
{ return (bottom() == Traits::empty_he_handle()); }
/*! Access is on top boundary. */
inline bool is_on_top_boundary() const
{ return (top() == Traits::empty_he_handle()); }
/*! Access is on at least one boundary. */
inline bool is_on_boundaries() const
{
return (is_on_left_boundary() || is_on_right_boundary() ||
is_on_bottom_boundary() || is_on_top_boundary());
}
/*! Access left bottom neighbour. */
Td_map_item& lb() const { return ptr()->lb; }
/*! Access left top neighbour. */
Td_map_item& lt() const { return ptr()->lt; }
/*! Access right bottom neighbour. */
Td_map_item& rb() const { return ptr()->rb; }
/*! Access right top neighbour. */
Td_map_item& rt() const { return ptr()->rt; }
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; }
void clear_neighbors()
{
set_lb(Td_map_item(0));
set_lt(Td_map_item(0));
set_rb(Td_map_item(0));
set_rt(Td_map_item(0));
}
//@}
// Merge this trapezoid with the input trapezoid.
// Precondition:
// Both trapezoids are active and have the same bounding edges from
// above and below and the trapezoids are adjacent to one another
// with the first to the left.
// Postcondition:
// This trapezoid is the union of the old this trapezoid and the input
// trapezoid.
inline void merge_trapezoid(Self& right)
{
//precondition: the left trapezoid is not on the right boundary
CGAL_assertion(!is_on_right_boundary());
// bool on_right_boundary = right.is_on_right_boundary();
ptr()->left_v = left();
ptr()->right_v = right.right();
ptr()->bottom_he = bottom();
ptr()->top_he = top();
ptr()->lb = lb();
ptr()->lt = lt();
ptr()->rb = right.rb();
ptr()->rt = right.rt();
Td_map_item item (*this);
if (ptr()->rb.which() != 0)
{
Self tr(boost::get<Self>(rb()));
tr.set_lb(item);
}
if (ptr()->rt.which() != 0)
{
Self tr(boost::get<Self>(rt()));
tr.set_lt(item);
}
CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary());
}
};
} //namespace CGAL
#endif

View File

@ -0,0 +1,311 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h $
// $Id: Td_active_vertex.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_ACTIVE_VERTEX_H
#define CGAL_TD_ACTIVE_VERTEX_H
/*! \file
* Defintion of the Td_active_vertex<Td_traits> class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_active_vertex : public Handle
{
public:
//type of traits class
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
//type of Td_active_vertex (Self)
typedef typename Traits::Td_active_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
friend class Td_active_vertex<Td_traits_>;
public:
//c'tors
Data (Vertex_const_handle _v,
Halfedge_const_handle _cw_he,
Dag_node* _p_node)
: v(_v),cw_he(_cw_he),p_node(_p_node)
{ }
~Data() { }
protected:
Vertex_const_handle v;
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const
{
//the circulator is of incoming halfedges
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
//if the vertex is associated with a point on the bounded coords,
// we can take any incident halfedge. o/w if the vertex lies at infinity,
// it has 2 fictitious incident halfedges
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
return Curve_end(he->curve(),
(he->direction() == ARR_RIGHT_TO_LEFT)?
ARR_MIN_END : ARR_MAX_END);
}
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
#else
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
/*! Set the vertex handle (Vertex_const_handle). */
inline void set_vertex(Vertex_const_handle v)
{
ptr()->v = v;
}
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
inline void set_cw_he(Halfedge_const_handle he)
{
if (cw_he() != Traits::empty_he_handle() &&
cw_he()->direction() != he->direction())
{
ptr()->cw_he = he->twin();
}
else
{
ptr()->cw_he = he;
}
}
public:
/// \name Constructors.
//@{
Td_active_vertex ()
{
PTR = new Data
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
}
/*! Constructor given Vertex & Halfedge handles. */
Td_active_vertex (Vertex_const_handle v,
Halfedge_const_handle cw_he,
Dag_node* node = 0)
{
PTR = new Data (v, cw_he, node);
}
/*! Copy constructor. */
Td_active_vertex(const Self& tr) : Handle(tr)
{
}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
{
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline Vertex_const_handle vertex() const
{
return ptr()->v;
}
Curve_end curve_end() const
{
return vtx_to_ce(vertex());
}
inline const Point& point() const
{
return vertex()->point();
}
/*! Access the first he starting at 12 o'clock clockwise.
*/
inline Halfedge_const_handle cw_he () const
{
return ptr()->cw_he;
}
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; }
//@}
};
} //namespace CGAL
#endif

View File

@ -0,0 +1,582 @@
// Author(s) : Michal Balas <balasmic@post.tau.ac.il>
// (based on old version by Iddo Hanniel & Oren Nechushtan)
/* Directed acyclic binary graph template class */
#ifndef CGAL_TD_DAG_NODE_H
#define CGAL_TD_DAG_NODE_H
#include <CGAL/basic.h>
#include <CGAL/number_utils.h>
#include <CGAL/kernel_assertions.h>
#include <CGAL/Handle.h>
#include <cstdlib>
#include <iostream>
#include <list>
#include <functional>
#include <boost/variant.hpp>
namespace CGAL {
/*! \class
* Trapezoidal decomposition DAG node base class derived from Handle
*/
template<class Traits>
class Td_dag_node_base : public Handle
{
protected:
void init() { PTR = 0; } //MICHAL: I think it is not used - so need to be removed
public:
//c'tors
Td_dag_node_base() { init(); }
Td_dag_node_base(const Td_dag_node_base<Traits>& x) : Handle(x) { }
//operators overloading
Td_dag_node_base& operator=(const Td_dag_node_base<Traits> & x)
{
Handle::operator=(x);
return *this;
}
//bool operator!() const { return PTR == 0; } //MICHAL: maybe use ptr(), and also can change to is_null or something similar
bool is_null() const { return PTR == 0; }
protected:
Rep * ptr() const { return (Rep*) PTR; }
//Rep *& ptr() { return (Rep*) PTR; }
void set_ptr(Rep* rep) { PTR = rep; }
};
/*! \class
* Trapezoidal decomposition DAG node class derived from
* Td_dag_node_base class
*/
template<class Traits>
class Td_dag_node : public Td_dag_node_base<Traits>
{
public:
//type of base class
typedef Td_dag_node_base<Traits> Td_dag_node_handle;
typedef Td_dag_node_base<Traits> Base;
//type of Td_dag_node (Self)
typedef Td_dag_node<Traits> Self;
//type of td_map_item
typedef typename Traits::Td_map_item Td_map_item;
//type of Td_active_trapezoid
typedef typename Traits::Td_active_trapezoid Td_active_trapezoid;
#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2
public:
//using Td_dag_node_handle::PTR;
//using Td_dag_node_handle::operator!;
#endif //CGAL_CFG_USING_BASE_MEMBER_BUG_2
protected:
/*! \class
* Inner class Node derived from Rep class
*/
class Node : public Rep
{
friend class Td_dag_node<Traits>;
public:
class clear_neighbors_visitor : public boost::static_visitor< void >
{
public:
void operator()(Td_active_trapezoid& t) const
{
t.clear_neighbors();
}
template < typename Tp >
void operator()(Tp& t) const
{
}
};
//c'tors
Node(const Td_map_item& e,unsigned long depth=0) :
m_data(e), m_left_child(), m_right_child(),
m_depth(depth), m_visited(false)
{}
Node(const Td_map_item& e, const Td_dag_node_handle& left,
const Td_dag_node_handle& right, unsigned long depth=0) :
m_data(e), m_left_child(left), m_right_child(right),
m_depth(depth), m_visited(false)
{}
//d'tor
~Node()
{
boost::apply_visitor(clear_neighbors_visitor(), m_data);
}
bool is_inner_node() const //MICHAL: a node with only left child (like removed node) will be concidered as a leaf
{
//return !!m_left_child && !!m_right_child;
return (!m_left_child.is_null() && !m_right_child.is_null());
}
bool visited() const { return m_visited; }
protected:
//protected data members
//information stored in node
Td_map_item m_data;
//left & right child nodes
Td_dag_node_handle m_left_child;
Td_dag_node_handle m_right_child;
//depth of the node in the DAG
mutable unsigned long m_depth;
//visited flag for traversing the DAG
mutable bool m_visited;
};
public:
//c'tors
Td_dag_node() { }
Td_dag_node(const Td_dag_node_handle& dag) : Td_dag_node_handle(dag) { }
Td_dag_node(const Self& dag) : Td_dag_node_handle(dag) { }
Td_dag_node(const Td_map_item& rootValue){ this->set_ptr(new Node(rootValue)); }
Td_dag_node(const Td_map_item& rootValue, unsigned long depth)
{ this->set_ptr(new Node(rootValue, depth)); }
Td_dag_node(const Td_map_item& rootValue, const Self& left, const Self& right)
{
this->set_ptr(new Node( rootValue, left, right));
depth_propagation();
}
Td_dag_node(const Td_map_item& rootValue, const Self& left, const Self& right,
unsigned long depth)
{
this->set_ptr(new Node( rootValue, left, right, depth));
depth_propagation();
}
//d'tor
~Td_dag_node() { }
//information retrieval
const Self& left_child() const
{
CGAL_precondition(!this->is_null());
return *(const Self*)&this->node()->m_left_child;
}
Self& left_child()
{
CGAL_precondition(!this->is_null());
return (Self &)this->node()->m_left_child;
}
const Self& right_child() const
{
CGAL_precondition(!this->is_null());
return *(const Self*)&this->node()->m_right_child;
}
Self& right_child()
{
CGAL_precondition(!this->is_null());
return (Self &)this->node()->m_right_child;
}
Td_map_item& get_data() const
{
CGAL_precondition(!this->is_null());
return node()->m_data;
}
Td_map_item& operator*() const
{
return this->get_data();
}
Td_map_item* data_ptr() const
{
CGAL_precondition(!this->is_null());
return &operator*();
}
Td_map_item* operator->() const
{
return this->data_ptr();
}
bool is_inner_node() const
{
return !this->is_null() && this->node()->is_inner_node();
}
unsigned long size_inaccurate() const //exponential
{
init_visited();
unsigned long res = recursive_size_inaccurate();
init_visited();
return res;
}
unsigned long size() const
{
init_visited();
unsigned long res = recursive_size();
init_visited();
return res;
}
unsigned long rec_depth() const //exponential
{
init_visited();
unsigned long res = recursive_depth();
init_visited();
return res;
}
#if 0
unsigned long rec_check(unsigned long rec_bound) const //exponential
{
unsigned long res = recursive_check(1,rec_bound);
return res;
}
#endif //0
unsigned long max_depth() const
{
init_visited();
unsigned long res = rec_max_depth();
init_visited();
return res;
}
const unsigned long& depth() const
{
return node()->m_depth;
}
unsigned long& depth()
{
return node()->m_depth;
}
bool operator==(const Self& b) const
{
return this->ptr() == b.ptr();
}
bool operator!=(const Self& b) const
{
return !operator==(b);
}
//dynamic management:
//Shallow copy
Self& operator=(const Self& b)
{
Handle::operator=(b);
return *this;
}
void set_data(const Td_map_item& data)
{
if (!this->is_null())
node()->m_data = data;
else
operator=(Self(data));
}
void set_left_child(Self& left)
{
CGAL_precondition(!this->is_null());
node()->m_left_child = left;
if (left.depth() < depth()+1)
left.depth() = depth()+1;
left.depth_propagation();
// does nothing if left is a leaf
}
void set_right_child(Self& right)
{
CGAL_precondition(!this->is_null());
node()->m_right_child = right;
if (right.depth() < depth()+1)
right.depth() = depth()+1;
right.depth_propagation();
// does nothing if right is a leaf
}
void replace(const Td_map_item& data, Self& left, Self& right)
{
set_data(data);
set_left_child(left);
set_right_child(right);
}
// Td_dag implementation not thread safe!
void init_visited() const
{
if (this->is_null() || node()->m_visited == false)
return;
node()->m_visited = false;
left_child().init_visited();
right_child().init_visited();
}
void visit_node() const
{
if (!this->is_null())
node()->m_visited = true;
}
/* -----output ---------------*/
#ifdef CGAL_PRE_IN_POST_ORDER
void preorder() const //exponential
{
if (!is_null())
{
std::cout << operator*() << '\t';
left_child().preorder();
right_child().preorder();
}
}
void inorder() const //exponential
{
if (!is_null())
{
left_child().inorder();
std::cout << operator*() << '\t';
right_child().inorder();
}
}
void postorder() const //exponential
{
if (!is_null())
{
left_child().postorder();
right_child().postorder();
std::cout << operator*() << '\t';
}
}
#endif //CGAL_PRE_IN_POST_ORDER
template <class Container,class Predicate>
Container& filter(Container& c,const Predicate& pr) const
{
init_visited();
Container& res = recursive_filter(c,pr);
init_visited();
return res;
}
protected:
//
//Propagating depth for left child & right child if they exist
//
void depth_propagation() //exponential
{
if (!is_inner_node())
return;
if (left_child().depth() < depth() + 1)
{
left_child().depth() = depth() + 1;
left_child().depth_propagation();
}
if (right_child().depth() < depth() + 1)
{
right_child().depth() = depth() + 1;
right_child().depth_propagation();
}
}
unsigned long recursive_depth() const
{
if (this->is_null() || node()->visited())
return 0;
return 1 + (std::max)(left_child().recursive_depth(),
right_child().recursive_depth());
}
#if 0
unsigned long recursive_check(unsigned long curr_rec_depth, unsigned long rec_bound) const
{
if (is_null())
return 0;
//std::cout << curr_rec_depth << "," << std::flush;
if ( curr_rec_depth > rec_bound + 30)
{
std::cout << "passed " << rec_bound + 30 << ", stopping\n";
return 0;
}
return 1 + (std::max)(left_child().recursive_check(curr_rec_depth + 1, rec_bound),
right_child().recursive_check(curr_rec_depth + 1, rec_bound));
}
#endif //0
unsigned long rec_max_depth() const
{
if (this->is_null() || node()->visited())
return 0;
visit_node();
if (is_inner_node())
return std::max(left_child().rec_max_depth(),
right_child().rec_max_depth());
else
return depth();
}
unsigned long recursive_size_inaccurate() const
{
if (!this->is_null() && !node()->visited())
return 1+ left_child().recursive_size_inaccurate() + right_child().recursive_size_inaccurate();
return 0;
}
unsigned long recursive_size() const
{
if (this->is_null() || node()->visited())
return 0;
visit_node();
return (1 + left_child().recursive_size() + right_child().recursive_size());
}
template <class Container,class Predicate>
Container& recursive_filter(Container& c,const Predicate& pr) const
{
if (this->is_null() || node()->visited())
return c;
if (pr(operator*()))
c.insert(c.end(),operator*());
visit_node();
left_child().recursive_filter(c, pr);
right_child().recursive_filter(c, pr);
return c;
}
private:
Node* node() const { return (Node*)Base::PTR; }
};
/*
//io methods
template<class T,class Traits>
std::ostream& write (std::ostream& out,
const Td_dag_node<T>& t,
const Traits& traits)
{
static int depth;
int i;
if (!t.is_null())
{
out << "\n";
for(i=0; i<depth; i++) out << ">";
out << "Data=";
write(out,*t,traits);
{
depth++;
out << "\n";
for(i=0; i<depth; i++) out << ">";
out << "left_child=";
write(out,t.left_child(),traits);
out << "\n";
for(i=0; i<depth; i++) out << ">";
out << "right_child=";
write(out,t.right_child(),traits);
depth--;
}
}
else
{
out << "Empty";
}
return out ;
}
template<class T>
std::ostream& operator<< (std::ostream& out,
const Td_dag_node<T>& t)
{
static int depth;
int i;
if (!t.is_null())
{
out << "\n";
for(i=0; i<depth; i++) out << ">";
out << "Data=" << *t;
{
depth++;
out << "\n";
for(i=0; i<depth; i++) out << ">";
out << "left_child=" << t.left_child();
out << "\n";
for(i=0; i<depth; i++) out << ">";
out << "right_child=" <<t.right_child();
depth--;
}
}
else
{
out << "Empty";
}
return out ;
}
*/
} //namespace CGAL
#endif //CGAL_TD_DAG_NODE_H
/*
tech notes:
The code is Handle designed.
left_child(),right_child() are designed to cope with Handle(Handle& x)
precondition x.PTR!=0
operator=() performs shallow copy
operator*() returns data type
output is done as a binary tree.
*/

View File

@ -0,0 +1,246 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h $
// $Id: Td_inactive_edge.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_INACTIVE_EDGE_H
#define CGAL_TD_INACTIVE_EDGE_H
/*! \file
* Defintion of the Td_inactive_edge<Td_traits> class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_inactive_edge : public Handle
{
public:
//type of traits class
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Td_inactive_edge (Self)
typedef typename Traits::Td_inactive_edge Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
friend class Td_inactive_edge<Td_traits_>;
public:
//c'tors
Data (boost::shared_ptr<X_monotone_curve_2>& _cv, Dag_node* _p_node)
: cv(_cv), p_node(_p_node) //, lb(_lb),lt(_lt),rb(_rb),rt(_rt)
{ }
~Data() { }
protected:
boost::shared_ptr<X_monotone_curve_2> cv;
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
#else
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
/*! Set the x_monotone_curve_2 for removed edge degenerate trapezoid. */
CGAL_TD_INLINE void set_curve(boost::shared_ptr<X_monotone_curve_2>& cv)
{
ptr()->cv = cv;
}
public:
/// \name Constructors.
//@{
/*! Constructor given Vertex & Halfedge handles. */
Td_inactive_edge (boost::shared_ptr<X_monotone_curve_2>& cv, Dag_node* node = NULL)
{
PTR = new Data(cv,node);
}
/*! Copy constructor. */
Td_inactive_edge (const Self& tr) : Handle(tr)
{
}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
{
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline X_monotone_curve_2& curve() const
{
X_monotone_curve_2* cv_ptr = (ptr()->cv).get();
CGAL_assertion(cv_ptr != NULL);
return *cv_ptr;
}
/*! Access DAG node. */
Dag_node* dag_node() const {return ptr()->p_node; }
//@}
};
} //namespace CGAL
#endif

View File

@ -0,0 +1,275 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h $
// $Id: Td_inactive_fictitious_vertex.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_INACTIVE_FICTITIOUS_VERTEX_H
#define CGAL_TD_INACTIVE_FICTITIOUS_VERTEX_H
/*! \file
* Defintion of the Td_inactive_fictitious_vertex<Td_traits> class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_inactive_fictitious_vertex : public Handle
{
public:
//type of traits class
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Halfedge_around_vertex_const_circulator
typedef typename Traits::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
//type of Td_inactive_fictitious_vertex (Self)
typedef typename Traits::Td_inactive_fictitious_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
friend class Td_inactive_fictitious_vertex<Td_traits_>;
public:
//c'tors
Data (const X_monotone_curve_2& _cv,
Arr_curve_end _ce,
Dag_node* _p_node): cv(_cv),ce(_ce),p_node(_p_node)
{ }
~Data() { }
protected:
X_monotone_curve_2 cv;
Arr_curve_end ce;
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const
{
//the circulator is of incoming halfedges
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
//if the vertex is associated with a point on the bounded coords,
// we can take any incident halfedge. o/w if the vertex lies at infinity,
// it has 2 fictitious incident halfedges
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
return Curve_end(he->curve(),
(he->direction() == ARR_RIGHT_TO_LEFT)?
ARR_MIN_END : ARR_MAX_END);
}
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
#else
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
inline void set_curve_end(Vertex_const_handle v_before_rem)
{
Curve_end v_ce(vtx_to_ce(v_before_rem));
ptr()->cv(v_ce.cv());
ptr()->ce(v_ce.ce());
}
public:
/// \name Constructors.
//@{
/*! Constructor given Vertex & Halfedge handles. */
Td_inactive_fictitious_vertex (Vertex_const_handle v_before_rem, Dag_node* node = NULL)
{
Curve_end v_ce(vtx_to_ce(v_before_rem));
PTR = new Data( v_ce.cv(), v_ce.ce(), node);
}
/*! Copy constructor. */
Td_inactive_fictitious_vertex (const Self& tr) : Handle(tr)
{
}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
{
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline Curve_end curve_end() const
{
return Curve_end(ptr()->cv, ptr()->ce);
}
/*! Access DAG node. */
Dag_node* dag_node() const
{
return ptr()->p_node;
}
//@}
};
} //namespace CGAL
#endif

View File

@ -0,0 +1,54 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h $
// $Id: Td_inactive_trapezoid.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_INACTIVE_TRAPEZOID_H
#define CGAL_TD_INACTIVE_TRAPEZOID_H
/*! \file
* Defintion of the Td_inactive_trapezoid class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
*/
class Td_inactive_trapezoid
{
public:
/*! Operator==. */
inline bool operator== (const Td_inactive_trapezoid& t2) const
{
return (this == &t2);
}
};
} //namespace CGAL
#endif

View File

@ -0,0 +1,248 @@
// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h $
// $Id: Td_inactive_vertex.h 65793 2011-10-10 17:04:38Z balasmic $
//
//
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
// updated by: Michal Balas <balasmic@post.tau.ac.il>
#ifndef CGAL_TD_INACTIVE_VERTEX_H
#define CGAL_TD_INACTIVE_VERTEX_H
/*! \file
* Defintion of the Td_inactive_vertex<Td_traits> class.
*/
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE
#else
#define CGAL_TD_INLINE inline
#endif
namespace CGAL {
/*! \class
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
* and two curve-ends(left,right).
* Trapezoids are represented as two curve-ends called right and left and
* two halfedges called top and bottom. The curve-ends (points) lie on the
* right and left boundaries of the trapezoid respectively and the halfedges
* bound the trapezoid from above and below.
* There exist degenerate trapezoids called infinite trapezoid; this happens
* when one of the four sides is on the parameter space boundary.
* Trapezoids are created as active and become inactive when Remove() member
* function called.
* Each trapezoid has at most four neighbouring trapezoids.
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
* edge-end (end point).
*/
template <class Td_traits_>
class Td_inactive_vertex : public Handle
{
public:
//type of traits class
typedef Td_traits_ Traits;
//type of point (Point_2)
typedef typename Traits::Point Point;
//type of X_monotone_curve_2
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
//type of Curve_end
typedef typename Traits::Curve_end Curve_end;
//type of Halfedge_const_handle (trapezoid edge)
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
//type of Vertex_const_handle (trapezoid vertex)
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
//type of Td_inactive_vertex (Self)
typedef typename Traits::Td_inactive_vertex Self;
typedef typename Traits::Td_map_item Td_map_item;
//type of Trapezoidal decomposition
typedef Trapezoidal_decomposition_2<Traits> TD;
//type of In face iterator
typedef typename TD::In_face_iterator In_face_iterator;
//type of Trapezoidal map search structure
typedef typename TD::Dag_node Dag_node;
//friend class declarations:
friend class Trapezoidal_decomposition_2<Traits>;
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif
#endif
/*! \class
* Inner class Data derived from Rep class
*/
class Data : public Rep
{
friend class Td_inactive_vertex<Td_traits_>;
public:
//c'tors
Data (Point _p, Dag_node* _p_node): p(_p),p_node(_p_node)
{ }
~Data() { }
protected:
Point p;
Dag_node* p_node;
};
private:
Data* ptr() const { return (Data*)(PTR); }
#ifndef CGAL_TD_DEBUG
#ifdef CGAL_PM_FRIEND_CLASS
protected:
#else
public: // workaround
#endif
#else //CGAL_TD_DEBUG
public:
#endif //CGAL_TD_DEBUG
/*! Set the DAG node. */
inline void set_dag_node(Dag_node* p)
{
ptr()->p_node = p;
}
inline void set_point(Vertex_const_handle v_before_rem)
{
ptr()->p = v_before_rem->point();
}
public:
/// \name Constructors.
//@{
/*! Constructor given Vertex & Halfedge handles. */
Td_inactive_vertex (Vertex_const_handle v_before_rem, Dag_node* node = NULL)
{
PTR = new Data(v_before_rem->point(), node);
}
/*! Copy constructor. */
Td_inactive_vertex (const Self& tr) : Handle(tr)
{
}
//@}
/// \name Operator overloading.
//@{
/*! Assignment operator.
* operator= should not copy m_dag_node (or otherwise update
* Dag_node::replace)
*/
inline Self& operator= (const Self& t2)
{
Handle::operator=(t2);
return *this;
}
/*! Operator==. */
inline bool operator== (const Self& t2) const
{
return (ptr() == t2.ptr());
}
/*! Operator!=. */
inline bool operator!= (const Self& t2) const
{
return !(operator==(t2));
}
//@}
/// \name Access methods.
//@{
inline Self& self()
{
return *this;
}
inline const Self& self() const
{
return *this;
}
/*! Access the trapezoid id (PTR). */
inline unsigned long id() const
{
return (unsigned long) PTR;
}
inline Point& point() const
{
return ptr()->p;
}
/*! Access DAG node. */
Dag_node* dag_node() const
{
return ptr()->p_node;
}
//@}
};
} //namespace CGAL
#endif

View File

@ -29,45 +29,45 @@ namespace CGAL {
template < class Td_traits> class Trapezoidal_decomposition_2;
template <class X_trapezoid>
struct Td_active_trapezoid : public std::unary_function<X_trapezoid,bool>
{
bool operator()(const X_trapezoid& tr) const
{
return tr.is_active();
}
};
////MICHAL: not in use
//template <class map_item>
//struct Td_active_map_item : public std::unary_function<map_item,bool>
//{
// bool operator()(const map_item& item) const
// {
// return item.is_active();
// }
//};
template <class X_trapezoid,class Traits>
struct Td_active_non_degenerate_trapezoid :
public std::unary_function<X_trapezoid,bool>
{
Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {}
bool operator()(const X_trapezoid& tr) const
{
return tr.is_active() && !traits.is_degenerate(tr);
}
protected:
const Traits& traits;
};
////MICHAL: not in use
//template <class X_trapezoid,class Traits>
//struct Td_active_non_degenerate_trapezoid :
//public std::unary_function<X_trapezoid,bool>
//{
// Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {}
// bool operator()(const X_trapezoid& tr) const
// {
// return tr.is_active() && !traits.is_degenerate(tr);
// }
//protected:
// const Traits& traits;
//};
template <class X_trapezoid,class Traits>
struct Td_active_right_degenerate_curve_trapezoid:
public std::unary_function<X_trapezoid,bool>
template <class map_item,class Traits>
struct Td_active_edge_item:
public std::unary_function<map_item,bool>
{
typedef const Traits& const_Traits_ref;
Td_active_right_degenerate_curve_trapezoid(const_Traits_ref t) : traits(t) {}
bool operator()(const X_trapezoid& tr) const
Td_active_edge_item(const Traits& t) : traits(t) {}
bool operator()(const map_item& item) const
{
return tr.is_active() && traits.is_degenerate_curve(tr) &&
!tr.right_bottom_neighbour();
return traits.is_active(item) && traits.is_td_edge(item);
}
protected:
const Traits& traits;
};
template <class _Tp>
struct Trapezoid_handle_less : public std::binary_function<_Tp, _Tp, bool>
struct Td_map_item_handle_less : public std::binary_function<_Tp, _Tp, bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const {
return __x->id() < __y->id(); }

View File

@ -23,58 +23,12 @@
namespace CGAL {
template <class Traits,class X_curve_plus>
const typename Td_traits<Traits,X_curve_plus>::Point&
Td_traits<Traits,X_curve_plus>::point_at_left_top_infinity(){
/*
static typename Td_traits<Traits,X_curve_plus>::Point
Td_traits<Traits,X_curve_plus>::POINT_AT_LEFT_TOP_INFINITY;
return Td_traits<Traits,X_curve_plus>::POINT_AT_LEFT_TOP_INFINITY;
*/
// static Point POINT_AT_LEFT_TOP_INFINITY;
if (!POINT_AT_LEFT_TOP_INFINITY)
POINT_AT_LEFT_TOP_INFINITY = new Point();
return *POINT_AT_LEFT_TOP_INFINITY;
}
template <class Traits,class Arrangement_on_surface_2>
typename Td_traits<Traits,Arrangement_on_surface_2>::Vertex_const_handle
Td_traits<Traits,Arrangement_on_surface_2>::m_empty_vtx_handle = Vertex_const_handle();
template <class Traits,class X_curve_plus>
const typename Td_traits<Traits,X_curve_plus>::Point&
Td_traits<Traits,X_curve_plus>::point_at_right_bottom_infinity(){
/*
static typename Td_traits<Traits,X_curve_plus>::Point
Td_traits<Traits,X_curve_plus>::POINT_AT_RIGHT_BOTTOM_INFINITY;
return Td_traits<Traits,X_curve_plus>::POINT_AT_RIGHT_BOTTOM_INFINITY;
*/
// static Point POINT_AT_RIGHT_BOTTOM_INFINITY;
if (!POINT_AT_RIGHT_BOTTOM_INFINITY)
POINT_AT_RIGHT_BOTTOM_INFINITY = new Point();
return *POINT_AT_RIGHT_BOTTOM_INFINITY;
}
template <class Traits,class X_curve_plus>
const typename Td_traits<Traits,X_curve_plus>::X_curve&
Td_traits<Traits,X_curve_plus>::curve_at_infinity(){
/*
static typename typename Traits::X_curveTraits::X_curve
Td_traits<Traits,X_curve_plus>::CURVE_AT_INFINITY;
return Td_traits<Traits,X_curve_plus>::CURVE_AT_INFINITY;
*/
// static X_curve CURVE_AT_INFINITY;
if (!CURVE_AT_INFINITY)
CURVE_AT_INFINITY = new X_curve();
return *CURVE_AT_INFINITY;
}
template <class Traits,class X_curve_plus>
typename Td_traits<Traits,X_curve_plus>::Point *
Td_traits<Traits,X_curve_plus>::POINT_AT_LEFT_TOP_INFINITY = 0;
template <class Traits,class X_curve_plus>
typename Td_traits<Traits,X_curve_plus>::Point *
Td_traits<Traits,X_curve_plus>::POINT_AT_RIGHT_BOTTOM_INFINITY = 0;
template <class Traits,class X_curve_plus>
typename Td_traits<Traits,X_curve_plus>::X_curve *
Td_traits<Traits,X_curve_plus>::CURVE_AT_INFINITY = 0;
template <class Traits,class Arrangement_on_surface_2>
typename Td_traits<Traits,Arrangement_on_surface_2>::Halfedge_const_handle
Td_traits<Traits,Arrangement_on_surface_2>::m_empty_he_handle = Halfedge_const_handle();
} //namespace CGAL

View File

@ -47,7 +47,7 @@ template < class Traits>
std::ostream& operator<<(
std::ostream &out,const Trapezoidal_decomposition_2<Traits>& td)
{
return write(out,td.data_structure(),td.get_traits());
return write(out,td.dag_root(),td.get_traits());
}
template < class Traits>
@ -59,14 +59,16 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid<Traits>& t,
typedef X_trapezoid* pointer;
bool pad=false;
//MICHAL: this may fail for inactive trapezoids
out << "(";
if (!t.is_left_unbounded()) out << t.left(); else out << "-oo";
if (!t.is_on_left_boundary()) out << t.left(); else out << "-oo"; //MICHAL: this may fail for removed point
out << ",";
if (!t.is_right_unbounded()) out << t.right(); else out << "+oo";
if (!t.is_on_right_boundary()) out << t.right(); else out << "+oo";
out << "," << std::flush;
if (!t.is_bottom_unbounded()) out << t.bottom(); else out << "-oo";
if (!t.is_on_bottom_boundary()) out << t.bottom(); else out << "-oo";
out << ",";
if (!t.is_top_unbounded()) out << t.top(); else out << "+oo";
if (!t.is_on_top_boundary()) out << t.top(); else out << "+oo";
out << ",neighbours(" << std::flush;
// debug neighbours equivalence relation
@ -76,11 +78,11 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid<Traits>& t,
X_trapezoid* value[] =
{
0,
(X_trapezoid*)CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE,
t.left_bottom_neighbour(),
t.left_top_neighbour(),
t.right_bottom_neighbour(),
t.right_top_neighbour()
(X_trapezoid*)CGAL_TD_DELETE_SIGNATURE,
t.lb(),
t.lt(),
t.rb(),
t.rt()
};
typedef char debug_string[256];
debug_string name[]=
@ -114,32 +116,32 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid<Traits>& t,
else pad=true;
out << name[j];
// identify neighbours
if (traits.is_degenerate_point(t) && value[j])
if (traits.is_td_vertex(t) && value[j])
out << "=" << value[j]->top();
}
out << ")" << std::flush;
if (t.is_active())
{
if (!traits.is_degenerate(t))
if (traits.is_td_trapezoid(t))
{
if (t.is_unbounded())
{
out << ",U=";
if (t.is_left_unbounded()) out << ")";
if (t.is_bottom_unbounded()) {
if (t.is_top_unbounded())
if (t.is_on_left_boundary()) out << ")";
if (t.is_on_bottom_boundary()) {
if (t.is_on_top_boundary())
out << "/\\/";
else
out << "/\\";
}
else if (t.is_top_unbounded()) out << "\\/";
if (t.is_right_unbounded()) out << "(";
else if (t.is_on_top_boundary()) out << "\\/";
if (t.is_on_right_boundary()) out << "(";
}
else
out << ",T";
}
else if (traits.is_degenerate_curve(t))
else if (traits.is_td_edge(t))
out << ",C";
else // if (t.is_degenerate_point())
out << ",P";
@ -170,14 +172,16 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid<Traits>& t)
typedef X_trapezoid* pointer;
Traits traits;
//MICHAL: this may fail for inactive trapezoids
out << "(";
if (!t.is_left_unbounded()) out << t.left(); else out << "-oo";
if (!t.is_on_left_boundary()) out << t.left(); else out << "-oo";
out << ",";
if (!t.is_right_unbounded()) out << t.right(); else out << "+oo";
if (!t.is_on_right_boundary()) out << t.right(); else out << "+oo";
out << "," << std::flush;
if (!t.is_bottom_unbounded()) out << t.bottom(); else out << "-oo";
if (!t.is_on_bottom_boundary()) out << t.bottom(); else out << "-oo";
out << ",";
if (!t.is_top_unbounded()) out << t.top(); else out << "+oo";
if (!t.is_on_top_boundary()) out << t.top(); else out << "+oo";
out << ",neighbours(" << std::flush;
// debug neighbours equivalence relation
@ -187,11 +191,11 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid<Traits>& t)
X_trapezoid* value[] =
{
0,
(X_trapezoid*)CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE,
t.left_bottom_neighbour(),
t.left_top_neighbour(),
t.right_bottom_neighbour(),
t.right_top_neighbour()
(X_trapezoid*)CGAL_TD_DELETE_SIGNATURE,
t.lb(),
t.lt(),
t.rb(),
t.rt()
};
typedef char debug_string[256];
debug_string name[]=
@ -223,7 +227,7 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid<Traits>& t)
{
out << name[j];
// identify neighbours
if (traits.is_degenerate_point(t) && value[j])
if (traits.is_td_vertex(t) && value[j])
out << "=" << value[j]->top();
out << " ";
}
@ -231,24 +235,24 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid<Traits>& t)
if (t.is_active())
{
if (!traits.is_degenerate(t))
if (traits.is_td_trapezoid(t))
{
if (t.is_unbounded())
{
out << ",U";
if (t.is_left_unbounded())
if (t.is_on_left_boundary())
out << (char) 174;
if (t.is_bottom_unbounded())
if (t.is_on_bottom_boundary())
out << (char) 25;
if (t.is_top_unbounded())
if (t.is_on_top_boundary())
out << (char) 24;
if (t.is_right_unbounded())
if (t.is_on_right_boundary())
out << (char) 175;
}
else
out << ",T";
}
else if (traits.is_degenerate_curve(t))
else if (traits.is_td_edge(t))
out << ",C";
else // if (t.is_degenerate_point())
out << ",P";

View File

@ -21,31 +21,37 @@
#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_MISC_H
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_MISC_H
#ifndef CGAL_TD_TENTUPLE_H
#include <CGAL/Handle.h>
#include <CGAL/Arr_point_location/Td_ninetuple.h>
#endif
#ifndef CGAL_TD_DAG_H
#include <CGAL/Arr_point_location/Td_dag.h>
#include <CGAL/Arr_point_location/Td_dag_node.h>
#endif
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE 0xffffffff
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED 0x1
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED 0x2
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED 0x4
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED 0x8
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOTALLY_UNBOUNDED \
(CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED| \
CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED| \
CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED| \
CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED)
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOUNDED 0
#define CGAL_TD_DEFAULT_DEPTH_THRESHOLD 2
#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 2
//#define CGAL_TD_DELETE_SIGNATURE 0xffffffff
//
////type
//#define CGAL_TD_VERTEX 0
//#define CGAL_TD_EDGE 0x1
//#define CGAL_TD_TRAPEZOID 0x2
//#define CGAL_TD_TYPE_MASK 0x3
//
//#define CGAL_TD_ON_LEFT_BOUNDARY 0x4
//#define CGAL_TD_ON_RIGHT_BOUNDARY 0x8
//#define CGAL_TD_ON_BOTTOM_BOUNDARY 0x10
//#define CGAL_TD_ON_TOP_BOUNDARY 0x20
//#define CGAL_TD_ON_ALL_BOUNDARIES
// (CGAL_TD_ON_LEFT_BOUNDARY | CGAL_TD_ON_RIGHT_BOUNDARY |
// CGAL_TD_ON_BOTTOM_BOUNDARY| CGAL_TD_ON_TOP_BOUNDARY)
//#define CGAL_TD_INTERIOR 0
//
//#define CGAL_TD_CV_MIN_END 0
//#define CGAL_TD_CV_MAX_END 0x1
#define CGAL_TD_DEFAULT_DEPTH_THRESHOLD 60
#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 12
#ifndef _MSC_VER
#if !defined __GNUC__ || __GNUC__>2 || __GNUC__==2 && __GNUC_MINOR__>=95
#if !defined __GNUC__ || __GNUC__> 3 || ((__GNUC__== 3) && (__GNUC_MINOR__> 4))
#define CGAL_PM_FRIEND_CLASS
#endif
#endif

View File

@ -192,13 +192,16 @@ public:
if(_rational_function.sign_at(_x_coordinate)==CGAL::ZERO)
return std::make_pair(Bound(0),Bound(0));
typename BFI_traits::Set_precision set_precision;
typename BFI_polynomial_traits::Evaluate evaluate;
typedef typename BFI_traits::Bound BF;
long precision = 16;
Rational error_bound = CGAL::ipower(Rational(1,2),r);
while (true)
{
set_precision(precision);
BF eps = CGAL::ipower(BF(1)/2,r);
while (true){
set_precision(precision);
BFI x_bfi(convert_to_bfi(_x_coordinate));
@ -213,10 +216,13 @@ public:
if (CGAL::zero_in(y_denom_bfi) == false)
{
BFI y_bfi(y_numer_bfi/y_denom_bfi);
if (CGAL::compare(CGAL::width(y_bfi),
Rational(CGAL::lower(CGAL::abs(y_bfi))) * error_bound )
if (CGAL::compare(
CGAL::width(y_bfi),
CGAL::lower(CGAL::abs(y_bfi)) * eps)
== SMALLER)
return std::make_pair(Bound(CGAL::lower(y_bfi)),
return std::make_pair(
Bound(CGAL::lower(y_bfi)),
Bound(CGAL::upper(y_bfi)));
}
else precision*=2;
@ -258,7 +264,10 @@ private:
{
typename BFI_traits::Set_precision set_precision;
typename BFI_polynomial_traits::Evaluate evaluate;
Rational error_bound = CGAL::ipower(Rational(1,2),a);
typedef typename BFI_traits::Bound BF;
BF eps = CGAL::ipower(BF(1)/2,a);
while (true)
{
set_precision(precision);
@ -273,9 +282,11 @@ private:
if (CGAL::zero_in(y_denom_bfi) == false)
{
BFI y_bfi(y_numer_bfi/y_denom_bfi);
if (Bound(CGAL::width(y_bfi)) < error_bound )
return std::make_pair(Bound(CGAL::lower(y_bfi)),
if (CGAL::width(y_bfi) < eps )
return std::make_pair(
Bound(CGAL::lower(y_bfi)),
Bound(CGAL::upper(y_bfi)));
}
else precision*=2;
}

View File

@ -33,59 +33,6 @@
namespace CGAL {
/*!
* \class
* Mapping of an x-monotone curve to the halfedge associated with it.
*/
template <class Arrangement_>
class PL_X_curve_plus: public Arrangement_::X_monotone_curve_2
{
public:
typedef Arrangement_ Arrangement_2;
typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2;
typedef typename Arrangement_2::Traits_adaptor_2 Traits_adaptor_2;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2;
protected:
//Data members
Halfedge_handle parent; // The halfedge associated with the curve.
public:
/*! Default constructor. */
PL_X_curve_plus() :
X_monotone_curve_2(),
parent()
{}
/*! Constructor from a curve and a halfedge. */
PL_X_curve_plus (const X_monotone_curve_2& cv,
const Halfedge_handle& p) :
X_monotone_curve_2(cv),
parent(p)
{}
/*! Constrtuctor from a halfedge only. */
PL_X_curve_plus(const Halfedge_handle& p) :
X_monotone_curve_2(p->curve()),
parent(p)
{}
/*! Constrtuctor from a curve only. */
PL_X_curve_plus(const X_monotone_curve_2 &cv) :
X_monotone_curve_2(cv),
parent()
{}
/*! Get the parent halfedge. */
Halfedge_handle get_parent() const
{
return (parent);
}
};
/*! \class
* A class that answers point-location and queries
@ -96,89 +43,166 @@ template <class Arrangement_>
class Arr_trapezoid_ric_point_location : public Arr_observer <Arrangement_>
{
public:
//type of arrangement on surface
typedef Arrangement_ Arrangement_on_surface_2;
typedef Arrangement_ Arrangement_2;
typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2;
typedef typename Arrangement_2::Traits_adaptor_2 Traits_adaptor_2;
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle;
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle;
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
typedef typename Arrangement_2::Vertex_handle Vertex_handle;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
typedef typename Arrangement_2::Face_handle Face_handle;
typedef typename Arrangement_2::Halfedge_iterator Halfedge_iterator;
typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator;
typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator;
typedef typename Arrangement_2::Hole_const_iterator Hole_const_iterator;
typedef typename Arrangement_2::Halfedge_const_iterator
Halfedge_const_iterator;
typedef typename Arrangement_2::Halfedge_around_vertex_const_circulator
Halfedge_around_vertex_const_circulator;
typedef typename Arrangement_2::Ccb_halfedge_const_circulator
Ccb_halfedge_const_circulator;
typedef typename Arrangement_2::Ccb_halfedge_circulator
Ccb_halfedge_circulator;
typedef typename Arrangement_2::Isolated_vertex_const_iterator
//type of geometry traits
typedef typename Arrangement_on_surface_2::Geometry_traits_2
Geometry_traits_2;
//type of traits adaptor
typedef typename Arrangement_on_surface_2::Traits_adaptor_2
Traits_adaptor_2;
//type of vertex handle
typedef typename Arrangement_on_surface_2::Vertex_handle
Vertex_handle;
//type of vertex const handle
typedef typename Arrangement_on_surface_2::Vertex_const_handle
Vertex_const_handle;
//type of halfedge handle
typedef typename Arrangement_on_surface_2::Halfedge_handle
Halfedge_handle;
//type of halfedge const handle
typedef typename Arrangement_on_surface_2::Halfedge_const_handle
Halfedge_const_handle;
//type of face const handle
typedef typename Arrangement_on_surface_2::Face_const_handle
Face_const_handle;
//type of edge const iterator
typedef typename Arrangement_on_surface_2::Edge_const_iterator
Edge_const_iterator;
//type of isolated vertex const iterator
typedef typename Arrangement_on_surface_2::Isolated_vertex_const_iterator
Isolated_vertex_const_iterator;
//type of point
typedef typename Geometry_traits_2::Point_2 Point_2;
typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2;
typedef std::list<Halfedge_const_handle> Edge_list;
typedef typename Edge_list::iterator Std_edge_iterator;
//type of x-monotone curve
typedef typename Geometry_traits_2::X_monotone_curve_2
X_monotone_curve_2;
typedef PL_X_curve_plus<Arrangement_2> X_curve_plus;
//type of trapezoidal decomposition traits class
typedef CGAL::Td_traits<Traits_adaptor_2, Arrangement_on_surface_2>
Td_traits;
//type of trapezoidal decomposition class
typedef Trapezoidal_decomposition_2<Td_traits>
Trapezoidal_decomposition;
//!types of Td_map_item-s
typedef typename Trapezoidal_decomposition::Td_map_item
Td_map_item;
typedef typename Trapezoidal_decomposition::Td_active_vertex
Td_active_vertex;
typedef typename Trapezoidal_decomposition::Td_active_fictitious_vertex
Td_active_fictitious_vertex;
typedef typename Trapezoidal_decomposition::Td_active_edge
Td_active_edge;
typedef typename Trapezoidal_decomposition::Td_active_trapezoid
Td_active_trapezoid;
//!type of side tags
typedef typename Traits_adaptor_2::Left_side_category
Left_side_category;
typedef typename Traits_adaptor_2::Bottom_side_category
Bottom_side_category;
typedef typename Traits_adaptor_2::Top_side_category
Top_side_category;
typedef typename Traits_adaptor_2::Right_side_category
Right_side_category;
typedef CGAL::Td_traits<Traits_adaptor_2, X_curve_plus> Td_traits;
typedef Trapezoidal_decomposition_2<Td_traits> Trapezoidal_decomposition;
typedef std::vector<Halfedge_const_handle> Halfedge_handle_container;
typedef typename Halfedge_handle_container::iterator
Halfedge_handle_iterator;
protected:
//type of trapezoidal decomposition class
typedef Trapezoidal_decomposition TD;
typedef typename Arr_are_all_sides_oblivious_tag<
Left_side_category, Bottom_side_category,
Top_side_category, Right_side_category >::result
Are_all_sides_oblivious_tag;
// Data members:
const Traits_adaptor_2 *m_traits; // Its associated traits object.
TD td; // instance of trapezoidal decomposition
const Td_traits* td_traits;// instance of the TD traits
bool m_with_guarantees;
//for the notification functions
X_monotone_curve_2 m_curve_before_split;
X_monotone_curve_2 m_curve_before_merge1;
X_monotone_curve_2 m_curve_before_merge2;
X_monotone_curve_2 m_cv_before_split;
Halfedge_handle m_he_after_merge;
//X_monotone_curve_2 m_cv_before_merge1;
//X_monotone_curve_2 m_cv_before_merge2;
public:
/*! Default constructor. */
Arr_trapezoid_ric_point_location (bool rebuild = true) :
m_traits (NULL),
td_traits(NULL)
Arr_trapezoid_ric_point_location (bool with_guarantees = true,
double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD,
double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD)
: m_traits (NULL), m_with_guarantees(with_guarantees)
{
td.set_needs_update(rebuild);
td.set_with_guarantees(with_guarantees);
td.depth_threshold(depth_thrs);
td.size_threshold(size_thrs);
}
/*! Constructor given an arrangement. */
Arr_trapezoid_ric_point_location (const Arrangement_2& arr) :
Arr_observer<Arrangement_2> (const_cast<Arrangement_2 &>(arr))
Arr_trapezoid_ric_point_location (const Arrangement_on_surface_2& arr,
bool with_guarantees = true,
double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD,
double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) :
Arr_observer<Arrangement_on_surface_2>
(const_cast<Arrangement_on_surface_2 &>(arr)),
m_with_guarantees(with_guarantees)
{
m_traits = static_cast<const Traits_adaptor_2*> (arr.traits());
td_traits = new Td_traits(*m_traits);
td.init_traits(td_traits);
build_trapezoid_ric();
m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits());
td.set_with_guarantees(with_guarantees);
td.init_arrangement_and_traits(&arr);
td.depth_threshold(depth_thrs);
td.size_threshold(size_thrs);
_construct_td();
}
/*! Destructor. */
~Arr_trapezoid_ric_point_location ()
~Arr_trapezoid_ric_point_location () { }
/*! defines whether the underlying search structure guarantees logarithmic
* query time and linear size */
void with_guarantees (bool with_guarantees)
{
if (td_traits)
delete (td_traits);
//if with_guarantees was changed from false to true - reconstruct
// the search structure with guarantees
td.set_with_guarantees(with_guarantees);
if (with_guarantees && !m_with_guarantees)
{
td.clear();
_construct_td();
}
m_with_guarantees = with_guarantees;
}
/*! returns the depth of the underlying search structure
* (the longest path in the DAG)
*/
unsigned long depth() //longest_dag_path()
{
return td.largest_leaf_depth() + 1;
}
/*! returns the longest query path in the underlying search structure */
unsigned long longest_query_path_length()
{
return td.longest_query_path_length();
}
#ifdef CGAL_TD_DEBUG
//void locate_and_print (std::ostream& out, const Point_2& p) const
//{
// td.locate_and_print(out, p);
//}
void print_dag(std::ostream& out) const
{
td.print_dag(out);
}
#endif
/*!
* Locate the arrangement feature containing the given point.
@ -219,50 +243,48 @@ public:
// base observer.
//@{
virtual void before_assign (const Arrangement_2& arr)
virtual void before_assign (const Arrangement_on_surface_2& arr)
{
clear_trapezoid_ric();
m_traits = static_cast<const Traits_adaptor_2*> (arr.traits());
td.clear();
m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits());
td.init_arrangement_and_traits(&arr, false);
}
virtual void after_assign ()
{
build_trapezoid_ric();
_construct_td();
}
virtual void before_clear ()
{
clear_trapezoid_ric ();
td.clear();
}
virtual void after_clear ()
{
build_trapezoid_ric();
_construct_td();
}
virtual void before_attach (const Arrangement_2& arr)
virtual void before_attach (const Arrangement_on_surface_2& arr)
{
clear_trapezoid_ric();
m_traits = static_cast<const Traits_adaptor_2*> (arr.traits());
td_traits = new Td_traits(*m_traits);
td.init_traits(td_traits);
td.clear();
m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits());
td.init_arrangement_and_traits(&arr);
}
virtual void after_attach ()
{
build_trapezoid_ric();
_construct_td();
}
virtual void before_detach ()
{
clear_trapezoid_ric();
td.clear();
}
virtual void after_create_edge (Halfedge_handle e)
{
// Postcondition: h->curve() with a reference back to h
// is inserted into TD.
td.insert(X_curve_plus(e));
td.insert(e);
}
//TODO IDIT OREN: what can be done in order to avoid the need
@ -272,94 +294,100 @@ public:
//this curve.
virtual void before_split_edge (Halfedge_handle e,
Vertex_handle /* v */,
const X_monotone_curve_2& /* c1 */,
const X_monotone_curve_2& /* c2 */)
const X_monotone_curve_2& cv1 ,
const X_monotone_curve_2& cv2 )
{
//save this curve for the "after" function.
m_curve_before_split = e->curve();
////MICHAL: commented due to inefficient depth update, remove and insert instead
////save the curve for the "after" function.
//m_cv_before_split = e->curve();
//td.before_split_edge(m_cv_before_split, cv1, cv2);
td.remove(e);
}
virtual void after_split_edge (Halfedge_handle e1,
Halfedge_handle e2)
{
td.split_edge(X_curve_plus(m_curve_before_split),
X_curve_plus(e1),
X_curve_plus(e2));
//MICHAL: commented due to inefficient depth update, remove and insert instead
//td.split_edge(m_cv_before_split,e1,e2);
td.insert(e1);
td.insert(e2);
}
//TODO IDIT OREN: create a merged X_curve_plus withput a halfedge,
// and in the "after" function update the halfedge.
// think ...
virtual void before_merge_edge (Halfedge_handle e1,
Halfedge_handle e2,
const X_monotone_curve_2& /* c */)
const X_monotone_curve_2& cv)
{
//save the curves for the "after" function.
m_curve_before_merge1 = e1->curve();
m_curve_before_merge2 = e2->curve();
//save the halfedge handle for the "after" function.
m_he_after_merge = e1;
td.merge_edge (e1, e2, cv);
}
virtual void after_merge_edge (Halfedge_handle e)
{
td.merge_edge(X_curve_plus(m_curve_before_merge1),
X_curve_plus(m_curve_before_merge2),
X_curve_plus(e));
td.after_merge_edge(e, m_he_after_merge);
}
virtual void before_remove_edge (Halfedge_handle e)
{
//called before combinatoric deletion
td.remove(X_curve_plus(e));
td.remove(e);
}
//@}
public:
#ifdef CGAL_TD_DEBUG
void debug()
{
td.debug();
}
#endif
//#ifdef CGAL_TD_DEBUG
// void debug()
// {
// td.debug();
// }
//#endif
protected:
/*! Clear the trapezoidal decomposition. */
inline void clear_trapezoid_ric ()
{
td.clear();
}
/*! Construct the trapezoidal decomposition. */
void build_trapezoid_ric ()
void _construct_td ()
{
td.clear();
Halfedge_handle_container c;
std::vector<Halfedge_const_handle> he_container;
Edge_const_iterator eit;
Halfedge_const_handle hh;
Arrangement_2 *arr = this->arrangement();
Halfedge_const_handle he_cst;
Arrangement_on_surface_2 *arr = this->arrangement();
//collect the arrangement halfedges
for (eit = arr->edges_begin(); eit != arr->edges_end(); ++eit)
{
hh = eit;
c.push_back(hh);
he_cst = eit;
he_container.push_back(he_cst);
}
//container insertion
td.insert(he_container.begin(), he_container.end());
}
// Random shuffle of the halfedges.
std::random_shuffle (c.begin (), c.end ());
/*! gets the unbounded face that contains the point when the trapezoid is unbounded
* \param tr The unbounded trapezoid whose face we should get
* \param p The query point.
* \param Arr_all_sides_oblivious_tag
* \return A Face_const_handle representing the arrangement unbounded face in which
* the point p lies
*/
Face_const_handle _get_unbounded_face (const Td_map_item& tr,
const Point_2& p,
Arr_all_sides_oblivious_tag) const;
Halfedge_handle_iterator cit;
Halfedge_handle he;
for (cit = c.begin(); cit < c.end(); cit++)
{
hh = *cit;
he = arr->non_const_handle(hh);
td.insert(X_curve_plus(he));
}
}
/*! gets the unbounded face that contains the point when the trapezoid is unbounded
* \param tr The unbounded trapezoid whose face we should get
* \param p The query point.
* \param Arr_not_all_sides_oblivious_tag
* \return A Face_const_handle representing the arrangement unbounded face in which
* the point p lies
*/
Face_const_handle _get_unbounded_face (const Td_map_item& tr,
const Point_2& p,
Arr_not_all_sides_oblivious_tag) const;
/*!
* Locate the arrangement feature which a vertical ray emanating from the
@ -379,7 +407,8 @@ protected:
*/
Object _check_isolated_for_vertical_ray_shoot
(Halfedge_const_handle halfedge_found,
const Point_2& p, bool shoot_up) const;
const Point_2& p, bool shoot_up,
const Td_map_item& tr) const;
};
} //namespace CGAL

View File

@ -1135,8 +1135,8 @@ public:
}
Comparison_result comp_x_on_bnd(const Point_2&,
const X_monotone_curve_2& xcv,
Arr_curve_end ce,
const X_monotone_curve_2& /* xcv */,
Arr_curve_end /* ce */,
Arr_use_dummy_tag) const
{
CGAL_error();
@ -1153,10 +1153,10 @@ public:
return m_base->compare_x_on_boundary_2_object()(xcv1, ce1, xcv2, ce2);
}
Comparison_result comp_x_on_bnd(const X_monotone_curve_2&
xcv1, Arr_curve_end ce1,
const X_monotone_curve_2& xcv2,
Arr_curve_end ce2,
Comparison_result comp_x_on_bnd(const X_monotone_curve_2& /* xcv1 */,
Arr_curve_end /* ce1 */,
const X_monotone_curve_2& /* xcv2 */,
Arr_curve_end /* ce2 */,
Arr_use_dummy_tag) const
{
CGAL_error();

View File

@ -731,6 +731,7 @@ public:
return (DFace_const_iter (Base::isolated_vertex()->face()));
}
private:
// Blocking access to inherited functions from the Dcel::Vertex.

View File

@ -3234,7 +3234,7 @@ public:
return is_equal(arc2);
}
#if defined(_MSC_VER)
#if defined(_MSC_VER) || defined(__clang__)
// befriending the kernel point
friend typename Curved_kernel_via_analysis_2::Point_2;
@ -3246,19 +3246,19 @@ public:
friend typename Curved_kernel_via_analysis_2::Z; \
friend typename Curved_kernel_via_analysis_2_Functors:: \
Z<Curved_kernel_via_analysis_2>
#else
#else // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER)
// befriending the kernel point
friend class Curved_kernel_via_analysis_2::Point_2;
//friend class Curved_kernel_via_analysis_2::Point_2;
// befriending the kernel arc
friend class Curved_kernel_via_analysis_2::Arc_2;
//friend class Curved_kernel_via_analysis_2::Arc_2;
// befriending the functors
#define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \
friend class Curved_kernel_via_analysis_2::Z; \
friend class Curved_kernel_via_analysis_2_Functors:: \
Z<Curved_kernel_via_analysis_2>
#endif
#endif // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER)
//Curved_kernel_via_analysis_2_functors<
// Curved_kernel_via_analysis_2> >;
@ -3348,8 +3348,8 @@ std::istream& operator>> (
CGAL_precondition(CGAL::is_ascii(is));
typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2;
typedef Rep_ Rep;
//typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2;
//typedef Rep_ Rep;
arc.read(is);

View File

@ -1600,9 +1600,8 @@ public:
CGAL_precondition(cv.compare_y_at_x(p) == CGAL::EQUAL);
// check that p is not an end-point of the arc
CGAL_precondition_code(
cv._same_arc_compare_xy(cv._minpoint(), p) != CGAL::EQUAL &&
cv._same_arc_compare_xy(cv._maxpoint(), p) != CGAL::EQUAL);
CGAL_precondition(cv._same_arc_compare_xy(cv._minpoint(), p) != CGAL::EQUAL);
CGAL_precondition(cv._same_arc_compare_xy(cv._maxpoint(), p) != CGAL::EQUAL);
CERR("\nsplit\n");
c1 = cv._replace_endpoints(

View File

@ -291,7 +291,7 @@ std::ostream& operator << (std::ostream& os,
template <class SweepCurvesAdaptor_2, class Rep_>
std::istream& operator >> (std::istream& is,
Generic_arc_2<SweepCurvesAdaptor_2, Rep_>& arc) {
Generic_arc_2<SweepCurvesAdaptor_2, Rep_>& /* arc */) {
std::cerr << "bogus >> call for generic_arc\n";
return is;

View File

@ -213,7 +213,7 @@ std::ostream& operator << (std::ostream& os,
template <class SweepCurvesAdaptor_2, class Rep_>
std::istream& operator >> (std::istream& is,
Generic_point_2<SweepCurvesAdaptor_2, Rep_>& pt) {
Generic_point_2<SweepCurvesAdaptor_2, Rep_>& /* pt */) {
std::cerr << "bogus >> call for generic_point\n";
return is;

View File

@ -784,15 +784,14 @@ public:
// befriending the functors
#if defined(_MSC_VER)
#if defined(_MSC_VER) || defined(__clang__)
#define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \
friend typename Curved_kernel_via_analysis_2::Z; \
friend typename Curved_kernel_via_analysis_2_Functors::Z< Curved_kernel_via_analysis_2 >
#else
#else // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER)
#define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \
friend class Curved_kernel_via_analysis_2::Z; \
friend class Curved_kernel_via_analysis_2_Functors::Z< Curved_kernel_via_analysis_2 >
#endif
#endif // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER)
CGAL_BEFRIEND_CKvA_2_FUNCTOR(Construct_point_2);
CGAL_BEFRIEND_CKvA_2_FUNCTOR(Compare_x_2);
@ -824,8 +823,8 @@ std::istream& operator>> (
CGAL_precondition(CGAL::is_ascii(is));
typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2;
typedef Rep_ Rep;
//typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2;
//typedef Rep_ Rep;
pt.read(is);

View File

@ -593,8 +593,9 @@ public:
* lexicographic order of endpoints is ensured automatically, hence no
* special handling is required
*/
result_type operator()(const Arc_2& cv, const Point_2& p,
const Point_2& q) const {
result_type operator()(const Arc_2& cv,
const Point_2& /* p */,
const Point_2& /* q */) const {
SCA_CERR("\n\nWARNING!! New_endpoints_opposite_2: cv: " << cv <<
"\n p: " << p << "\n q: " << q << std::endl);
CGAL_error_msg("New_endpoints_opposite_2 deprecated and must not be \

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,285 @@
#ifndef CGAL_IO_TEST_H
#define CGAL_IO_TEST_H
#include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include "IO_base_test.h"
template <typename T_Traits>
class IO_test : public IO_base_test<T_Traits> {
public:
typedef T_Traits Traits;
typedef IO_base_test<Traits> Base;
typedef typename Base::Point_2 Point_2;
typedef typename Base::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Base::Curve_2 Curve_2;
typedef typename std::vector<Point_2> Points_vector;
typedef typename std::vector<X_monotone_curve_2> Xcurves_vector;
typedef typename std::vector<Curve_2> Curves_vector;
/*! Constructor */
IO_test();
/*! Destructor */
virtual ~IO_test();
bool read_xcurves(const char* filename, Xcurves_vector& xcurves);
bool read_points(const char* filename, Points_vector& points);
bool read_curves(const char* filename, Curves_vector& curves);
/*! Set the file names */
void set_filenames(const char* points_filename,
const char* xcurves_filename,
const char* curves_filename);
/*! Parse the command line */
virtual bool parse(int argc, char* argv[]);
/*! Initialize the data structure */
virtual bool init();
/*! Clear the data structures */
virtual void clear();
protected:
/*! Skip comments */
std::istream& skip_comments(std::istream& is, std::string& line);
/*! Remove blanks */
std::string remove_blanks(char* str);
/*! Print an error message */
void print_error(const std::string& msg)
{ std::cerr << "Error: " << msg.c_str() << std::endl; }
/*! Print the end-of-line */
void print_eol()
{
std::cout << std::endl;
m_eol_printed = true;
}
/*! Print information */
void print_info(std::string& info,
bool start_line = true, bool end_line = true)
{
if (start_line && !m_eol_printed) print_eol();
std::cout << info.c_str();
if (end_line) print_eol();
}
/*! Print final results */
void print_result(bool result)
{
std::string result_str((result) ? "Passed" : "Failed");
print_info(result_str, false);
}
/*! Print expected answer and real answer */
void print_answer(const std::string& exp, const std::string& real,
const std::string& str)
{
print_info(std::string("Expected ").append(str).append(": ").append(exp));
print_info(std::string("Obtained ").append(str).append(": ").append(real));
}
/*! Indicates whether the end-of-line has been printed */
bool m_eol_printed;
/*! The input data file of points*/
std::string m_filename_points;
/*! The input data file of curves*/
std::string m_filename_curves;
/*! The input data file of xcurves*/
std::string m_filename_xcurves;
/*! The container of input points */
Points_vector m_points;
/*! The container of input curves */
Curves_vector m_curves;
/*! The container of x-monotone curves */
Xcurves_vector m_xcurves;
};
/*!
* Constructor.
* Accepts test data file name.
*/
template <typename T_Traits>
IO_test<T_Traits>::IO_test() : m_eol_printed(true) {}
/*!
* Destructor.
*/
template <typename T_Traits>
IO_test<T_Traits>::~IO_test() { clear(); }
/*! Set the file names */
template <typename T_Traits>
void IO_test<T_Traits>::set_filenames(const char* points_filename,
const char* xcurves_filename,
const char* curves_filename)
{
m_filename_points.assign(points_filename);
m_filename_xcurves.assign(xcurves_filename);
m_filename_curves.assign(curves_filename);
}
template <typename T_Traits>
bool IO_test<T_Traits>::parse(int argc, char* argv[])
{
if (argc < 4) {
print_info(std::string("Usage: ").append(argv[0]).
append(" points_file xcurves_file curves_file"));
return false;
}
m_filename_points.assign(argv[1]);
m_filename_xcurves.assign(argv[2]);
m_filename_curves.assign(argv[3]);
return true;
}
/*! Initialize the data structure */
template <typename T_Traits>
bool IO_test<T_Traits>::init()
{
if (!read_points(m_filename_points.c_str(), m_points)) return false;
if (!read_xcurves(m_filename_xcurves.c_str(), m_xcurves)) return false;
if (!read_curves(m_filename_curves.c_str(), m_curves)) return false;
return true;
}
/*! Clear the data structures */
template <typename T_Traits>
void IO_test<T_Traits>::clear()
{
m_filename_points.clear();
m_filename_xcurves.clear();
m_filename_curves.clear();
m_points.clear();
m_curves.clear();
m_xcurves.clear();
}
/*!
* Skip comments. Comments start with the '#' character and extend to the
* end of the line
*/
template <typename T_Traits>
std::istream& IO_test<T_Traits>::skip_comments(std::istream& is,
std::string& line)
{
while (std::getline(is, line))
if ((line[0] != '#') && !line.empty()) break;
return is;
}
/*!
*/
template <typename T_Traits>
std::string IO_test<T_Traits>::remove_blanks(char* str)
{
std::string result = "";
bool flag = false;
//only alphanumeric characters and underscores are allowed
for (; *str != '\0'; ++str) {
if ((*str >= '0' && *str <= '9') || //digits
(*str >= 'A' && *str <= 'Z') || //upper case letters
(*str >= 'a' && *str <= 'z') || //lower case letters
*str == '_') //underscores
{
if (!flag)
flag = true;
result += *str;
}
if (*str == ' ' && flag) break;
}
return result;
}
/*! */
template <typename T_Traits>
bool IO_test<T_Traits>::read_points(const char* filename, Points_vector& points)
{
typedef T_Traits Traits;
// read points from file into associative container
std::ifstream p_stream(filename);
if (!p_stream.is_open()) {
std::cerr << "Cannot open file " << filename << "!" << std::endl;
return false;
}
std::string line;
while (skip_comments(p_stream, line)) {
std::istringstream line_stream(line);
typename Traits::Point_2 p;
this->read_point(line_stream, p);
points.push_back(p);
line_stream.clear();
}
return true;
}
/*! */
template <typename T_Traits>
bool
IO_test<T_Traits>::read_xcurves(const char* filename, Xcurves_vector& xcurves)
{
typedef T_Traits Traits;
// read x-monotone curves from file into associative container
std::ifstream xcv_stream(filename);
if (!xcv_stream.is_open()) {
std::cerr << "Cannot open file " << filename << "!" << std::endl;
return false;
}
std::string line;
while (skip_comments(xcv_stream, line)) {
std::istringstream line_stream(line);
typename Traits::X_monotone_curve_2 xcv;
this->read_xcurve(line_stream, xcv);
xcurves.push_back(xcv);
line_stream.clear();
}
return true;
}
/*! */
template <typename T_Traits>
bool
IO_test<T_Traits>::read_curves(const char* filename, Curves_vector& curves)
{
typedef T_Traits Traits;
// Read curves from file into associative container
std::ifstream cv_stream(filename);
if (!cv_stream.is_open()) {
std::cerr << "Cannot open file " << filename << "!" << std::endl;
return false;
}
std::string line;
while (skip_comments(cv_stream, line)) {
std::istringstream line_stream(line);
typename Traits::Curve_2 cv;
this->read_curve(line_stream, cv);
curves.push_back(cv);
line_stream.clear();
}
return true;
}
#endif

View File

@ -0,0 +1,150 @@
#ifndef CGAL_POINT_LOCATION_DYNAMIC_TEST_H
#define CGAL_POINT_LOCATION_DYNAMIC_TEST_H
#include <CGAL/basic.h>
#include "Point_location_test.h"
/*! Point location test */
template <typename T_Traits>
class Point_location_dynamic_test : public Point_location_test<T_Traits> {
private:
typedef T_Traits Traits;
typedef Point_location_test<Traits> Base;
public:
typedef typename Base::Point_2 Point_2;
typedef typename Base::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Base::Curve_2 Curve_2;
typedef typename Base::Arrangement_2 Arrangement_2;
/*! Destructor */
virtual ~Point_location_dynamic_test()
{
this->deallocate_arrangement();
clear();
this->deallocate_pl_strategies();
}
/*! Clear the data structures */
virtual void clear();
void set_filenames(const char* points_filename, const char* xcurves_filename,
const char* curves_filename, const char* commands_filename,
const char* queries_filename)
{
Base::set_filenames(points_filename, xcurves_filename,
curves_filename, queries_filename);
m_filename_commands.assign(commands_filename);
}
bool construct_arrangement();
private:
bool read_perform_opts(std::istream& is);
bool remove(const X_monotone_curve_2& xcv);
/*! The input data file of commands*/
std::string m_filename_commands;
};
/*! Clear the data structures */
template<class T_Traits>
void Point_location_dynamic_test<T_Traits>::clear()
{
Base::clear();
m_filename_commands.clear();
}
template <typename T_Traits>
bool Point_location_dynamic_test<T_Traits>::construct_arrangement()
{
std::ifstream in_com(this->m_filename_commands.c_str());
if (!in_com.is_open()) {
this->print_error(std::string("cannot open file ").append(this->m_filename_commands));
return false;
}
if (!read_perform_opts(in_com)) {
in_com.close();
return false;
}
in_com.close();
// Print the size of the arrangement.
std::cout << "V = " << this->m_arr->number_of_vertices()
<< ", E = " << this->m_arr->number_of_edges()
<< ", F = " << this->m_arr->number_of_faces() << std::endl;
return true;
}
template <typename T_Traits>
bool Point_location_dynamic_test<T_Traits>::read_perform_opts(std::istream& is)
{
bool rc = true;
CGAL::Timer timer;
timer.reset();
timer.start();
std::string sline;
while (this->skip_comments(is, sline)) {
std::istringstream line(sline);
char cmd;
line >> cmd;
if (cmd == 'a') {
// Insert all into the arrangement
CGAL::insert(*(this->m_arr), this->m_xcurves.begin(), this->m_xcurves.end());
// insert(*(this->m_arr), m_points.begin(), m_points.end());
CGAL::insert(*(this->m_arr), this->m_curves.begin(), this->m_curves.end());
continue;
}
unsigned int id;
line >> id;
if (id >= this->m_xcurves.size()) {
std::cerr << "Index of x-monotone curve " << id << " is out of range ("
<< this->m_xcurves.size() << ") in " << "m_filename_commands"
<< "!" << std::endl;
rc = false;
continue;
}
if (cmd == 'i') CGAL::insert(*(this->m_arr), this->m_xcurves[id]);
if (cmd == 'd') {
if (!remove(this->m_xcurves[id])) rc = false;
}
}
timer.stop(); ///END
std::cout << "Arrangement aggregate construction took "
<< timer.time() << std::endl;
return rc;
}
template <typename T_Traits>
bool Point_location_dynamic_test<T_Traits>::remove(const X_monotone_curve_2& xcv)
{
typedef T_Traits Traits;
bool rc = false; // be pasimistic, assume nothing is removed.
const Traits* traits = this->m_arr->geometry_traits();
typename Traits::Equal_2 equal = traits->equal_2_object();
typename Arrangement_2::Edge_iterator eit;
for (eit = this->m_arr->edges_begin(); eit != this->m_arr->edges_end(); ++eit) {
const X_monotone_curve_2& xcv_arr = eit->curve();
if (equal(xcv, xcv_arr)) {
this->m_arr->remove_edge(eit);
rc = true; // found a curve to remove.
break;
}
}
return rc;
}
#endif

View File

@ -0,0 +1,742 @@
#ifndef CGAL_POINT_LOCATION_TEST_H
#define CGAL_POINT_LOCATION_TEST_H
#include <CGAL/basic.h>
#include <CGAL/Timer.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Arr_naive_point_location.h>
#include <CGAL/Arr_simple_point_location.h>
#include <CGAL/Arr_walk_along_line_point_location.h>
#include <CGAL/Arr_landmarks_point_location.h>
#include <CGAL/Arr_trapezoid_ric_point_location.h>
#include <CGAL/Arr_point_location/Arr_lm_random_generator.h>
#include <CGAL/Arr_point_location/Arr_lm_grid_generator.h>
#include <CGAL/Arr_point_location/Arr_lm_halton_generator.h>
#include <CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h>
#include <CGAL/Arr_point_location/Arr_lm_specified_points_generator.h>
//#include <CGAL/Arr_triangulation_point_location.h>
#include "IO_test.h"
/*! Point location test */
template <typename T_Traits>
class Point_location_test : public IO_test<T_Traits> {
private:
typedef T_Traits Traits;
typedef IO_test<Traits> Base;
public:
typedef typename Base::Point_2 Point_2;
typedef typename Base::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Base::Curve_2 Curve_2;
typedef typename Base::Points_vector Points_vector;
typedef typename Base::Xcurves_vector Xcurves_vector;
typedef typename Base::Curves_vector Curves_vector;
typedef CGAL::Arrangement_2<Traits> Arrangement_2;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle;
typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator;
typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator;
typedef typename Points_vector::iterator Point_iterator;
typedef std::vector<CGAL::Object> Objects_vector;
typedef Objects_vector::iterator Object_iterator;
protected:
typedef typename CGAL::Arr_naive_point_location<Arrangement_2>
Naive_point_location;
typedef typename CGAL::Arr_simple_point_location<Arrangement_2>
Simple_point_location;
typedef typename CGAL::Arr_walk_along_line_point_location<Arrangement_2>
Walk_point_location;
typedef typename CGAL::Arr_landmarks_point_location<Arrangement_2>
Lm_point_location;
typedef typename CGAL::Arr_random_landmarks_generator<Arrangement_2>
Random_lm_generator;
typedef typename CGAL::Arr_landmarks_point_location<Arrangement_2,
Random_lm_generator>
Lm_random_point_location;
typedef typename CGAL::Arr_grid_landmarks_generator<Arrangement_2>
Grid_lm_generator;
typedef typename CGAL::Arr_landmarks_point_location<Arrangement_2,
Grid_lm_generator>
Lm_grid_point_location;
typedef typename CGAL::Arr_halton_landmarks_generator<Arrangement_2>
Halton_lm_generator;
typedef typename CGAL::Arr_landmarks_point_location<Arrangement_2,
Halton_lm_generator>
Lm_halton_point_location;
typedef typename CGAL::Arr_middle_edges_landmarks_generator<Arrangement_2>
Middle_edges_generator;
typedef typename CGAL::Arr_landmarks_point_location<Arrangement_2,
Middle_edges_generator>
Lm_middle_edges_point_location;
typedef typename CGAL::Arr_landmarks_specified_points_generator<Arrangement_2>
Specified_points_generator;
typedef typename CGAL::Arr_landmarks_point_location<Arrangement_2,
Specified_points_generator>
Lm_specified_points_point_location;
typedef typename CGAL::Arr_trapezoid_ric_point_location<Arrangement_2>
Trapezoid_ric_point_location;
// typedef CGAL::Arr_triangulation_point_location<Arrangement_2>
// Triangulation_point_location;
// ===> Add new point location type here <===
Naive_point_location* m_naive_pl; // 0
Simple_point_location* m_simple_pl; // 1
Walk_point_location* m_walk_pl; // 2
Lm_point_location* m_lm_pl; // 3
Lm_random_point_location* m_random_lm_pl; // 4
Lm_grid_point_location* m_grid_lm_pl; // 5
Lm_halton_point_location* m_halton_lm_pl; // 6
Lm_middle_edges_point_location* m_middle_edges_lm_pl; // 7
Lm_specified_points_point_location* m_specified_points_lm_pl; // 8
// Triangulation_point_location m_triangulation_pl; // 9
Trapezoid_ric_point_location* m_trapezoid_ric_pl; // 10
Trapezoid_ric_point_location* m_trapezoid_ric_no_grnt_pl; // 11
Random_lm_generator* m_random_g;
Grid_lm_generator* m_grid_g;
Halton_lm_generator* m_halton_g;
Middle_edges_generator* m_middle_edges_g;
Specified_points_generator* m_specified_points_g;
// // ===> Change the number of point-location startegies
// // when a new point location is added. <===
#define MAX_NUM_POINT_LOCATION_STRATEGIES 11
public:
/*! Constructor */
Point_location_test();
/*! Destructor */
virtual ~Point_location_test()
{
deallocate_arrangement();
clear();
deallocate_pl_strategies();
}
void set_filenames(const char* points_filename, const char* xcurves_filename,
const char* curves_filename, const char* queries_filename);
/*! Initialize the data structures */
virtual bool init();
/*! Perform the test */
virtual bool perform();
/*! Clear the data structures */
virtual void clear();
bool allocate_arrangement();
void deallocate_arrangement();
bool construct_arrangement();
void clear_arrangement();
bool allocate_pl_strategies();
bool construct_pl_strategies();
bool attach_pl_strategies();
void deallocate_pl_strategies();
template <typename Point_location,
typename InputIterator, typename OutputIterator>
void query(Point_location& pl, const char* type,
InputIterator begin, InputIterator end, OutputIterator oi)
{
typedef InputIterator Input_iterator;
CGAL::Timer timer;
timer.reset(); timer.start();
Input_iterator piter;
for (piter = begin; piter != end; ++piter) {
Point_2 q = (*piter);
CGAL::Object obj = pl.locate(q);
*oi++ = obj;
}
timer.stop();
std::cout << type << " location took " << timer.time() << std::endl;
}
/*! The arrangement */
Arrangement_2* m_arr;
private:
/*! The input data file of the query points*/
std::string m_filename_queries;
/*! The query points */
Points_vector m_query_points;
};
/*!
* Constructor.
* Accepts test data file name.
*/
template <typename T_Traits>
Point_location_test<T_Traits>::Point_location_test() :
m_naive_pl(NULL),
m_simple_pl(NULL),
m_walk_pl(NULL),
m_lm_pl(NULL),
m_random_lm_pl(NULL),
m_grid_lm_pl(NULL),
m_halton_lm_pl(NULL),
m_middle_edges_lm_pl(NULL),
m_specified_points_lm_pl(NULL),
// m_triangulation_pl(NULL),
m_trapezoid_ric_pl(NULL),
m_trapezoid_ric_no_grnt_pl(NULL),
m_random_g(NULL),
m_grid_g(NULL),
m_halton_g(NULL),
m_middle_edges_g(NULL),
m_specified_points_g(NULL),
m_arr(NULL)
{}
/*! Set the file names */
template <typename T_Traits>
void Point_location_test<T_Traits>::set_filenames(const char* points_filename,
const char* xcurves_filename,
const char* curves_filename,
const char* queries_filename)
{
Base::set_filenames(points_filename, xcurves_filename, curves_filename);
m_filename_queries.assign(queries_filename);
}
/*! Initialize the data structures */
template <typename T_Traits>
bool Point_location_test<T_Traits>::init()
{
if (!Base::init()) return false;
// Read the query points
if (!this->read_points(m_filename_queries.c_str(), m_query_points))
return false;
return true;
}
/*! Clear the data structures */
template<class T_Traits>
void Point_location_test<T_Traits>::clear()
{
Base::clear();
m_query_points.clear();
m_filename_queries.clear();
}
/*! Clear the data structures */
template<class T_Traits>
void Point_location_test<T_Traits>::deallocate_pl_strategies()
{
if (m_naive_pl) {
delete m_naive_pl;
m_naive_pl = NULL;
}
if (m_simple_pl) {
delete m_simple_pl;
m_simple_pl = NULL;
}
if (m_walk_pl) {
delete m_walk_pl;
m_walk_pl = NULL;
}
#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS)
if (m_lm_pl) {
delete m_lm_pl;
m_lm_pl = NULL;
}
if (m_random_lm_pl) {
delete m_random_lm_pl;
m_random_lm_pl = NULL;
}
if (m_grid_lm_pl) {
delete m_grid_lm_pl;
m_grid_lm_pl = NULL;
}
if (m_halton_lm_pl) {
delete m_halton_lm_pl;
m_halton_lm_pl = NULL;
}
if (m_middle_edges_lm_pl) {
delete m_middle_edges_lm_pl;
m_middle_edges_lm_pl = NULL;
}
if (m_specified_points_lm_pl) {
delete m_specified_points_lm_pl;
m_specified_points_lm_pl = NULL;
}
// Free Generators
if (m_random_g) {
delete m_random_g;
m_random_g = NULL;
}
if (m_grid_g) {
delete m_grid_g;
m_grid_g = NULL;
}
if (m_halton_g) {
delete m_halton_g;
m_halton_g = NULL;
}
if (m_middle_edges_g) {
delete m_middle_edges_g;
m_middle_edges_g = NULL;
}
if (m_specified_points_g) {
delete m_specified_points_g;
m_specified_points_g = NULL;
}
#endif
// if (m_triangulation_pl) {
// delete m_triangulation_pl;
// m_triangulation_pl = NULL;
// }
if (m_trapezoid_ric_pl) {
delete m_trapezoid_ric_pl;
m_trapezoid_ric_pl = NULL;
}
if (m_trapezoid_ric_no_grnt_pl) {
delete m_trapezoid_ric_no_grnt_pl;
m_trapezoid_ric_no_grnt_pl = NULL;
}
}
template <typename T_Traits>
bool Point_location_test<T_Traits>::allocate_arrangement()
{
if (!(m_arr = new Arrangement_2())) return false;
return true;
}
template <typename T_Traits>
void Point_location_test<T_Traits>::deallocate_arrangement()
{
if (m_arr) {
delete m_arr;
m_arr = NULL;
}
}
template <typename T_Traits>
bool Point_location_test<T_Traits>::construct_arrangement()
{
// Insert all into the arrangement
CGAL::insert(*m_arr, this->m_xcurves.begin(), this->m_xcurves.end());
// insert(*m_arr, m_points.begin(), m_points.end());
CGAL::insert(*m_arr, this->m_curves.begin(), this->m_curves.end());
// Print the size of the arrangement.
std::cout << "V = " << m_arr->number_of_vertices()
<< ", E = " << m_arr->number_of_edges()
<< ", F = " << m_arr->number_of_faces() << std::endl;
return true;
}
template <typename T_Traits>
void Point_location_test<T_Traits>::clear_arrangement()
{
if (m_arr) m_arr->clear();
}
template <typename T_Traits>
bool Point_location_test<T_Traits>::allocate_pl_strategies()
{
// Allocate all point location strategies.
if (!(m_naive_pl = new Naive_point_location())) return false;
if (!(m_simple_pl = new Simple_point_location())) return false;
if (!(m_walk_pl = new Walk_point_location())) return false;
#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS)
if (!(m_lm_pl = new Lm_point_location())) return false;
if (!(m_random_lm_pl = new Lm_random_point_location())) return false;
if (!(m_grid_lm_pl = new Lm_grid_point_location())) return false;
if (!(m_halton_lm_pl = new Lm_halton_point_location())) return false;
if (!(m_middle_edges_lm_pl = new Lm_middle_edges_point_location()))
return false;
if (!(m_specified_points_lm_pl = new Lm_specified_points_point_location()))
return false;
// if (!(m_triangulation_pl = new Triangulation_point_location()))
// return false;
#endif
if (!(m_trapezoid_ric_pl = new Trapezoid_ric_point_location())) return false;
if (!(m_trapezoid_ric_no_grnt_pl = new Trapezoid_ric_point_location()))
return false;
// ===> Add new point location instance here. <===
return true;
}
template <typename T_Traits>
bool Point_location_test<T_Traits>::construct_pl_strategies()
{
typedef T_Traits Traits;
// Initialize all point location strategies.
CGAL::Timer timer;
m_naive_pl = new Naive_point_location(*m_arr); // 0
m_simple_pl = new Simple_point_location(*m_arr); // 1
m_walk_pl = new Walk_point_location(*m_arr); // 2
#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS)
timer.reset(); timer.start();
m_lm_pl = new Lm_point_location(*m_arr); // 3
timer.stop();
std::cout << "Lm (vert) construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_random_g = new Random_lm_generator(*m_arr);
m_random_lm_pl = new Lm_random_point_location(*m_arr, m_random_g); // 4
timer.stop();
std::cout << "Random lm construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_grid_g = new Grid_lm_generator(*m_arr);
m_grid_lm_pl = new Lm_grid_point_location(*m_arr, m_grid_g); // 5
timer.stop();
std::cout << "Grid lm construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_halton_g = new Halton_lm_generator(*m_arr);
m_halton_lm_pl = new Lm_halton_point_location(*m_arr, m_halton_g); // 6
timer.stop();
std::cout << "Halton lm construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_middle_edges_g = new Middle_edges_generator(*m_arr);
m_middle_edges_lm_pl =
new Lm_middle_edges_point_location(*m_arr, m_middle_edges_g); // 7
timer.stop();
std::cout << "Middle edges lm construction took " << timer.time()
<< std::endl;
timer.reset(); timer.start();
m_specified_points_g = new Specified_points_generator(*m_arr);
m_specified_points_lm_pl =
new Lm_specified_points_point_location(*m_arr, m_specified_points_g); // 8
timer.stop();
std::cout << "Specified_points lm construction took "
<< timer.time() << std::endl;
// timer.reset(); timer.start();
// m_triangulation_pl = new Triangulation_point_location(*m_arr); // 9
// timer.stop();
// std::cout << "Triangulation lm construction took "
// << timer.time() << std::endl;
#endif
timer.reset(); timer.start();
m_trapezoid_ric_pl = new Trapezoid_ric_point_location(*m_arr); // 10
timer.stop();
std::cout << "Trapezoid RIC construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_trapezoid_ric_no_grnt_pl =
new Trapezoid_ric_point_location(*m_arr, false); // 11
timer.stop();
std::cout << "Trapezoid RIC without-guarantees construction took "
<< timer.time() << std::endl;
std::cout << std::endl;
// ===> Add new point location instance here. <===
return true;
}
template <typename T_Traits>
bool Point_location_test<T_Traits>::attach_pl_strategies()
{
typedef T_Traits Traits;
// Initialize all point location strategies.
CGAL::Timer timer;
m_naive_pl->attach(*m_arr);
m_simple_pl->attach(*m_arr);
m_walk_pl->attach(*m_arr);
#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS)
timer.reset(); timer.start();
m_lm_pl->attach(*m_arr);
timer.stop();
std::cout << "Lm (vert) construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_random_g = new Random_lm_generator(*m_arr);
m_random_lm_pl->attach(*m_arr, m_random_g);
timer.stop();
std::cout << "Random lm construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_grid_g = new Grid_lm_generator(*m_arr);
m_grid_lm_pl->attach(*m_arr, m_grid_g);
timer.stop();
std::cout << "Grid lm construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_halton_g = new Halton_lm_generator(*m_arr);
m_halton_lm_pl->attach(*m_arr, m_halton_g);
timer.stop();
std::cout << "Halton lm construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_middle_edges_g = new Middle_edges_generator(*m_arr);
m_middle_edges_lm_pl->attach(*m_arr, m_middle_edges_g);
timer.stop();
std::cout << "Middle edges lm construction took " << timer.time()
<< std::endl;
timer.reset(); timer.start();
m_specified_points_g = new Specified_points_generator(*m_arr);
m_specified_points_lm_pl->attach(*m_arr, m_specified_points_g);
timer.stop();
std::cout << "Specified_points lm construction took "
<< timer.time() << std::endl;
// timer.reset(); timer.start();
// m_location triangulation_lm_pl->attach(*m_arr);
// timer.stop();
// std::cout << "Triangulation lm construction took "
// << timer.time() << std::endl;
#endif
timer.reset(); timer.start();
m_trapezoid_ric_pl->attach(*m_arr);
timer.stop();
std::cout << "Trapezoid RIC construction took " << timer.time() << std::endl;
timer.reset(); timer.start();
m_trapezoid_ric_no_grnt_pl->with_guarantees(false);
m_trapezoid_ric_no_grnt_pl->attach(*m_arr);
timer.stop();
std::cout << "Trapezoid RIC without-guarantees construction took "
<< timer.time() << std::endl;
std::cout << std::endl;
// ===> Add new point location instance here. <===
return true;
}
// Perform the test
template <typename T_Traits>
bool Point_location_test<T_Traits>::perform()
{
Objects_vector objs[MAX_NUM_POINT_LOCATION_STRATEGIES];
typename Arrangement_2::Vertex_const_handle vh_ref, vh_curr;
typename Arrangement_2::Halfedge_const_handle hh_ref, hh_curr;
typename Arrangement_2::Face_const_handle fh_ref, fh_curr;
// Locate the points in the list using all point location strategies.
// std::cout << "Time in seconds" << std::endl;
std::cout << std::endl;
unsigned int pl_index = 0;
query(*m_naive_pl, "Naive", m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Naive
query(*m_simple_pl, "Simple", m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Simple
query(*m_walk_pl, "Walk", m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Walk
#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS)
query(*m_lm_pl, "Landmarks (vertices)",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Landmarks (vertices)
query(*m_random_lm_pl, "Landmarks random",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Landmarks random
query(*m_grid_lm_pl, "Landmarks grid",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Landmarks grid
query(*m_halton_lm_pl, "Landmarks Halton",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Landmarks Halton
query(*m_middle_edges_lm_pl, "Landmarks middle edges",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Landmarks middle edges
query(*m_specified_points_lm_pl, "Landmarks specified points",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Landmarks specified points
// Triangulation
// query(*m_triangulation_pl, "Triangulation",
// m_query_points.begin(), m_query_points.end(),
// std::back_inserter(objs[pl_index++])); // Triangulation
#endif
query(*m_trapezoid_ric_pl, "Trapezoidal RIC",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++])); // Trapezoidal RIC
// Trapezoidal RIC without guarantees
query(*m_trapezoid_ric_no_grnt_pl, "Trapezoidal RIC without guarantees",
m_query_points.begin(), m_query_points.end(),
std::back_inserter(objs[pl_index++]));
std::cout << std::endl;
// ===> Add a call to operate the new point location. <===
// Number of point location strategies used.
unsigned int pls_num = pl_index;
std::cout << "Number of strategies is " << pls_num << std::endl;
// End Location
int result = 0;
//init all obejct iterators
Object_iterator ob_iter[MAX_NUM_POINT_LOCATION_STRATEGIES];
for (pl_index = 0; pl_index < pls_num; ++pl_index)
ob_iter[pl_index] = objs[pl_index].begin();
// get size of objects
unsigned int size = objs[0].size();
std::cout << "size is " << size << std::endl;
for (pl_index = 0; pl_index < pls_num; ++pl_index) {
if (size != objs[pl_index].size()) {
std::cout << "Error: size of pl number " << pl_index << " is "
<< objs[pl_index].size() << std::endl;
result = -1;
}
}
// Assign and check results
unsigned int qi; //qi is the query point index
for (qi = 0; qi < size; ++qi) {
// Assign object to a face
if (CGAL::assign(fh_ref, ob_iter[0][qi])) {
for (unsigned int pl_index = 1; pl_index < pls_num; ++pl_index) {
if (! CGAL::assign(fh_curr, ob_iter[pl_index][qi])) {
std::cout << "Error in point location number " << pl_index;
if (CGAL::assign(fh_curr, ob_iter[pl_index][qi])) {
std::cout << ", an halfedge returned instead of a face"
<< std::endl;
}
else if (CGAL::assign(hh_curr, ob_iter[pl_index][qi])) {
std::cout << ", a vertex returned instead of a face"
<< std::endl;
}
else {
std::cout << ", an unknowen object returned instead of a face"
<< std::endl;
}
result = -1;
}
else if (fh_curr != fh_ref) {
std::cout << "Error: point location number "
<< pl_index << " return a different face" << std::endl;
result = -1;
}
}
//if (fh_ref->is_unbounded())
// std::cout << "Unbounded face." << std::endl;
//else
// std::cout << "Face." << std::endl;
}
// Assign object to a halfedge
else if (CGAL::assign (hh_ref, ob_iter[0][qi])) {
std::cout << "Halfedge: " << hh_ref->curve() << std::endl;
for (unsigned int pl_index = 1; pl_index < pls_num; ++pl_index) {
if (! CGAL::assign(hh_curr, ob_iter[pl_index][qi])) {
std::cout << "Error in point location number " << pl_index;
if (CGAL::assign(fh_curr, ob_iter[pl_index][qi])) {
std::cout << ", a face returned instead of an halfedge"
<< std::endl;
}
else if (CGAL::assign(hh_curr, ob_iter[pl_index][qi])) {
std::cout << ", a vertex returned instead of an halfedge"
<< std::endl;
}
else {
std::cout << ", an unknowen object returned instead of an halfedge"
<< std::endl;
}
result = -1;
}
else if ((hh_curr != hh_ref) && (hh_curr->twin() != hh_ref)) {
std::cout << "Error: point location number "
<< pl_index << " return a different halfedge" << std::endl;
std::cout << "Halfedge (curr): " << hh_curr->curve() << std::endl;
result = -1;
}
}
}
// Assign object to a vertex
else if (CGAL::assign(vh_ref, ob_iter[0][qi])) {
for (unsigned int pl_index = 1; pl_index < pls_num; ++pl_index) {
if (! CGAL::assign(vh_curr, ob_iter[pl_index][qi])) {
std::cout << "Error in point location number " << pl_index;
if (CGAL::assign(fh_curr, ob_iter[pl_index][qi])) {
std::cout << ", a face returned instead of a vertex"<< std::endl;
}
else if (CGAL::assign(hh_curr, ob_iter[pl_index][qi])) {
std::cout << ", an halfedge returned instead of a vertex"
<< std::endl;
}
else {
std::cout << ", an unknown object returned instead of a vertex"
<< std::endl;
}
result = -1;
}
else if (vh_curr != vh_ref) {
std::cout << "Error: point location number "
<< pl_index << " return a different vertex"<< std::endl;
result = -1;
}
}
std::cout << "Vertex: "<< vh_ref->point() << std::endl;
}
else {
std::cout << "Illegal point-location result." << std::endl;
result = -1;
}
}
return (result == 0);
}
#endif

View File

@ -8,11 +8,8 @@
#include <list>
template <class Traits>
class Segment_reader
{
class Segment_reader {
public:
typedef typename Traits::Kernel Kernel;
typedef typename Kernel::FT NT;
typedef typename Traits::Point_2 Point_2;
@ -35,8 +32,7 @@ public:
NT x1, y1, x2, y2;
int i;
for (i = 0; i < count; i++)
{
for (i = 0; i < count; i++) {
inp >> x1 >> y1 >> x2 >> y2;
//std::cout << "x1 ="<<x1<< "x2 ="<<x2<< "y1 ="<<y1<< "y2 ="<<y2<<std::endl;

View File

@ -3,7 +3,7 @@
#include "Traits_base_test.h"
template <class T_Traits>
template <typename T_Traits>
class Traits_adaptor_test : public Traits_base_test<T_Traits> {
private:
/*! A map between (strings) commands and (member functions) operations */
@ -49,7 +49,7 @@ private:
public:
/*! Constructor */
Traits_adaptor_test(int argc, char * argv[]);
Traits_adaptor_test();
/*! Destructor */
virtual ~Traits_adaptor_test();
@ -59,9 +59,8 @@ public:
* Constructor.
* Accepts test data file name.
*/
template <class T_Traits>
Traits_adaptor_test<T_Traits>::Traits_adaptor_test(int argc, char * argv[]) :
Traits_base_test<T_Traits>(argc, argv)
template <typename T_Traits>
Traits_adaptor_test<T_Traits>::Traits_adaptor_test()
{
typedef T_Traits Traits;
@ -85,10 +84,10 @@ Traits_adaptor_test<T_Traits>::Traits_adaptor_test(int argc, char * argv[]) :
* Destructor.
* Declares as virtual.
*/
template <class T_Traits>
template <typename T_Traits>
Traits_adaptor_test<T_Traits>::~Traits_adaptor_test() {}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_compare_y_at_x_left_wrapper(std::istringstream & str_stream)
{
@ -96,7 +95,7 @@ ta_compare_y_at_x_left_wrapper(std::istringstream & str_stream)
return ta_compare_y_at_x_left_wrapper_imp(str_stream, Has_left_category());
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_compare_y_at_x_left_wrapper_imp(std::istringstream &, CGAL::Tag_false)
{
@ -104,7 +103,7 @@ ta_compare_y_at_x_left_wrapper_imp (std::istringstream &, CGAL::Tag_false)
return false;
}
template <class T_Traits>
template <typename T_Traits>
bool
Traits_adaptor_test<T_Traits>::
ta_compare_y_at_x_left_wrapper_imp(std::istringstream & str_stream,
@ -124,7 +123,7 @@ ta_compare_y_at_x_left_wrapper_imp(std::istringstream & str_stream,
return this->compare(exp_answer, real_answer);
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_is_in_x_range_wrapper(std::istringstream & str_stream)
{
@ -149,7 +148,7 @@ ta_is_in_x_range_wrapper(std::istringstream & str_stream)
return this->compare(exp_answer, real_answer);
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_compare_y_position_wrapper(std::istringstream & str_stream)
{
@ -165,7 +164,7 @@ ta_compare_y_position_wrapper(std::istringstream & str_stream)
return this->compare(exp_answer, real_answer);
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_is_between_cw_wrapper(std::istringstream & str_stream)
{
@ -192,7 +191,7 @@ ta_is_between_cw_wrapper(std::istringstream & str_stream)
return this->compare(exp_answer, real_answer);
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_compare_cw_around_point_wrapper(std::istringstream & str_stream)
{
@ -218,7 +217,7 @@ ta_compare_cw_around_point_wrapper(std::istringstream & str_stream)
return this->compare(exp_answer, real_answer);
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_are_mergeable_wrapper(std::istringstream & str_stream)
{
@ -226,7 +225,7 @@ ta_are_mergeable_wrapper(std::istringstream & str_stream)
return ta_are_mergeable_wrapper_imp(str_stream, Has_merge_category());
}
template <class T_Traits>
template <typename T_Traits>
bool
Traits_adaptor_test<T_Traits>::
ta_are_mergeable_wrapper_imp(std::istringstream &, CGAL::Tag_false)
@ -235,7 +234,7 @@ ta_are_mergeable_wrapper_imp(std::istringstream &, CGAL::Tag_false)
return false;
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::
ta_are_mergeable_wrapper_imp (std::istringstream & str_stream, CGAL::Tag_true)
{
@ -251,7 +250,7 @@ ta_are_mergeable_wrapper_imp (std::istringstream & str_stream, CGAL::Tag_true)
return this->compare(exp_answer, real_answer);
}
template <class T_Traits>
template <typename T_Traits>
bool Traits_adaptor_test<T_Traits>::ta_merge_wrapper
(std::istringstream & str_stream)
{
@ -259,7 +258,7 @@ bool Traits_adaptor_test<T_Traits>::ta_merge_wrapper
return ta_merge_wrapper_imp(str_stream, Has_merge_category());
}
template <class T_Traits>
template <typename T_Traits>
bool
Traits_adaptor_test<T_Traits>::
ta_merge_wrapper_imp(std::istringstream &, CGAL::Tag_false)
@ -268,7 +267,7 @@ ta_merge_wrapper_imp (std::istringstream &, CGAL::Tag_false)
return false;
}
template <class T_Traits>
template <typename T_Traits>
bool
Traits_adaptor_test<T_Traits>::
ta_merge_wrapper_imp(std::istringstream & str_stream, CGAL::Tag_true)

View File

@ -237,7 +237,7 @@ private:
public:
/*! Constructor */
Traits_test(int argc, char * argv[]);
Traits_test();
/*! Destructor */
~Traits_test();
@ -248,8 +248,7 @@ public:
* Accepts test data file name.
*/
template <typename T_Traits>
Traits_test<T_Traits>::Traits_test(int argc, char * argv[]) :
Traits_base_test<T_Traits>(argc, argv)
Traits_test<T_Traits>::Traits_test()
{
typedef T_Traits Traits;

View File

@ -77,7 +77,7 @@ INTERSECT=8
SPLIT=9
ARE_MERGEABLE=10
MERGE=11
ERRORS=12
ASSERTIONS=12
CONSTRUCTOR=13
COMPARE_X_AT_LIMIT=14
COMPARE_X_NEAR_LIMIT=15
@ -186,8 +186,8 @@ run_trapped_test()
else
run_test $1 $2 $3 $4 $5 $6 &
WPID=$!
trap "kill -HUP $WPID" INT
(sleep 1200; kill -HUP $WPID) > /dev/null 2>&1 &
trap "kill -9 $WPID" INT
(sleep 1200; kill -9 $WPID) > /dev/null 2>&1 &
SPID=$!
wait $WPID > /dev/null 2>&1
# RES=$?
@ -334,7 +334,7 @@ execute_commands_old_structure()
commands_indicator[SPLIT]=1
commands_indicator[ARE_MERGEABLE]=1
commands_indicator[MERGE]=1
commands_indicator[ERRORS]=1
commands_indicator[ASSERTIONS]=1
commands_indicator[CONSTRUCTOR]=1
i=1
if [ $# -gt 2 ] ; then
@ -400,10 +400,10 @@ execute_commands_old_structure()
data/empty.zero data/$1/merge.xcv \
data/empty.zero data/$1/merge $2
fi
if [ ${commands_indicator[$ERRORS]} -ne 0 ] ; then
if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then
run_trapped_test test_traits \
data/$1/errors.pt data/$1/errors.xcv \
data/empty.zero data/$1/errors $2
data/$1/assertions.pt data/$1/assertions.xcv \
data/empty.zero data/$1/assertions $2
fi
if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then
run_trapped_test test_traits \
@ -440,7 +440,7 @@ execute_commands_new_structure()
commands_indicator[SPLIT]=0
commands_indicator[ARE_MERGEABLE]=0
commands_indicator[MERGE]=0
commands_indicator[ERRORS]=0
commands_indicator[ASSERTIONS]=0
commands_indicator[CONSTRUCTOR]=0
i=1
if [ $# -gt 2 ] ; then
@ -523,9 +523,9 @@ execute_commands_new_structure()
run_trapped_test test_traits data/$1/points \
data/$1/xcurves data/$1/curves data/$1/merge $2
fi
if [ ${commands_indicator[$ERRORS]} -ne 0 ] ; then
if [ ${commands_indicator[$ASSERTIONS]} -ne 0 ] ; then
run_trapped_test test_traits data/$1/points \
data/$1/xcurves data/$1/curves data/$1/errors $2
data/$1/xcurves data/$1/curves data/$1/assertions $2
fi
if [ ${commands_indicator[$CONSTRUCTOR]} -ne 0 ] ; then
run_trapped_test test_traits data/$1/points \
@ -707,6 +707,126 @@ test_spherical_arcs_traits_adaptor()
clean_tests
}
#---------------------------------------------------------------------#
# point location with segments
#---------------------------------------------------------------------#
test_point_location_segments()
{
compile_test point_location $CGAL_GMPQ_NT $CARTESIAN_KERNEL $SEGMENT_TRAITS point_location_segments
if [ ${res} -eq 0 ] ; then
echo " ERROR: not executed point location of segments" >> $ERRORFILE
else
OUTPUTFILE=ProgramOutput.point_location_segments.$PLATFORM
rm -f $OUTPUTFILE
COMMAND="./point_location"
if [ -f point_location_segments.cmd ] ; then
COMMAND="$COMMAND `cat point_location_segments.cmd`"
fi
if [ -f point_location_segments.cin ] ; then
COMMAND="cat point_location_segments.cin | $COMMAND"
fi
echo "Executing point location of segments ..."
echo
ulimit -t 3600 2> /dev/null
if eval $COMMAND > $OUTPUTFILE 2>&1 ; then
echo " successful execution of point location of segments" >> $ERRORFILE
else
echo " ERROR: execution of point location of segments" >> $ERRORFILE
fi
fi
clean_tests
}
#---------------------------------------------------------------------#
# point location with segments
#---------------------------------------------------------------------#
test_point_location_dynamic_segments()
{
compile_test point_location_dynamic $CGAL_GMPQ_NT $CARTESIAN_KERNEL $SEGMENT_TRAITS point_location_dynamic_segments
if [ ${res} -eq 0 ] ; then
echo " ERROR: not executed point location of segments" >> $ERRORFILE
else
OUTPUTFILE=ProgramOutput.point_location_dynamic_segments.$PLATFORM
rm -f $OUTPUTFILE
COMMAND="./point_location_dynamic"
if [ -f point_location_dynamic_segments.cmd ] ; then
COMMAND="$COMMAND `cat point_location_dynamic_segments.cmd`"
fi
if [ -f point_location_dynamic_segments.cin ] ; then
COMMAND="cat point_location_dynamic_segments.cin | $COMMAND"
fi
echo "Executing point location of segments ..."
echo
ulimit -t 3600 2> /dev/null
if eval $COMMAND > $OUTPUTFILE 2>&1 ; then
echo " successful execution of point location of segments" >> $ERRORFILE
else
echo " ERROR: execution of point location of segments" >> $ERRORFILE
fi
fi
clean_tests
}
#---------------------------------------------------------------------#
# point location with circle segments
#---------------------------------------------------------------------#
test_point_location_circle_segments()
{
compile_test point_location $CGAL_GMPQ_NT $CARTESIAN_KERNEL $CIRCLE_SEGMENT_TRAITS point_location_circle_segments
if [ ${res} -eq 0 ] ; then
echo " ERROR: not executed point_location of circle segments" >> $ERRORFILE
else
OUTPUTFILE=ProgramOutput.point_location_circle_segments.$PLATFORM
rm -f $OUTPUTFILE
COMMAND="./point_location"
if [ -f point_location_circle_segments.cmd ] ; then
COMMAND="$COMMAND `cat point_location_circle_segments.cmd`"
fi
if [ -f point_location_circle_segments.cin ] ; then
COMMAND="cat point_location_circle_segments.cin | $COMMAND"
fi
echo "Executing point_location of circle segments ..."
echo
ulimit -t 3600 2> /dev/null
if eval $COMMAND > $OUTPUTFILE 2>&1 ; then
echo " successful execution of point_location of circle segments" >> $ERRORFILE
else
echo " ERROR: execution of point_location of circle segments" >> $ERRORFILE
fi
fi
clean_tests
}
#---------------------------------------------------------------------#
# point location with linear objects
#---------------------------------------------------------------------#
test_point_location_linear()
{
compile_test point_location $CGAL_GMPQ_NT $CARTESIAN_KERNEL $LINEAR_TRAITS point_location_linear
if [ ${res} -eq 0 ] ; then
echo " ERROR: not executed point_location of linear objects" >> $ERRORFILE
else
OUTPUTFILE=ProgramOutput.point_location_linear.$PLATFORM
rm -f $OUTPUTFILE
COMMAND="./point_location"
if [ -f point_location_linear.cmd ] ; then
COMMAND="$COMMAND `cat point_location_linear.cmd`"
fi
if [ -f point_location_linear.cin ] ; then
COMMAND="cat point_location_linear.cin | $COMMAND"
fi
echo "Executing point_location of linear objects ..."
echo
ulimit -t 3600 2> /dev/null
if eval $COMMAND > $OUTPUTFILE 2>&1 ; then
echo " successful execution of point_location of linear objects" >> $ERRORFILE
else
echo " ERROR: execution of point_location of linear objects" >> $ERRORFILE
fi
fi
clean_tests
}
#---------------------------------------------------------------------#
# segment traits
#---------------------------------------------------------------------#
@ -743,7 +863,7 @@ test_non_caching_segment_traits()
else
execute_commands_old_structure segments non_caching_segment_traits \
VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT CONSTRUCTOR \
COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE ERRORS
COMPARE_Y_AT_X_RIGHT ARE_MERGEABLE ASSERTIONS
execute_commands_new_structure segments segment_traits \
IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT
@ -867,7 +987,7 @@ test_line_arc_traits()
else
execute_commands_old_structure circular_lines line_arc_traits \
VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \
ERRORS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE
ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE
execute_commands_new_structure circular_lines line_arc_traits \
IS_VERTICAL COMPARE_Y_AT_X
@ -895,7 +1015,7 @@ test_circular_arc_traits()
else
execute_commands_old_structure circular_arcs circular_arc_traits \
VERTEX IS_VERTICAL COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \
ERRORS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE
ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE
execute_commands_new_structure circular_arcs circular_arc_traits \
VERTEX IS_VERTICAL COMPARE_Y_AT_X
@ -915,7 +1035,7 @@ test_circular_line_arc_traits()
else
execute_commands_old_structure circular_line_arcs circular_line_arc_traits \
VERTEX IS_VERTICAL CONSTRUCTOR COMPARE_Y_AT_X COMPARE_Y_AT_X_LEFT \
ERRORS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE
ASSERTIONS COMPARE_Y_AT_X_RIGHT MERGE ARE_MERGEABLE
execute_commands_new_structure circular_line_arcs circular_line_arc_traits \
IS_VERTICAL COMPARE_Y_AT_X
@ -975,7 +1095,7 @@ test_bezier_traits()
else
execute_commands_old_structure bezier bezier_traits \
COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT SPLIT \
CONSTRUCTOR ERRORS ARE_MERGEABLE
CONSTRUCTOR ASSERTIONS ARE_MERGEABLE
fi
clean_tests
}
@ -993,7 +1113,7 @@ test_spherical_arc_traits()
execute_commands_old_structure spherical_arcs spherical_arc_traits \
COMPARE_Y_AT_X_LEFT COMPARE_Y_AT_X_RIGHT INTERSECT \
CONSTRUCTOR \
COMPARE MAKE_X_MONOTONE SPLIT MERGE ERRORS ARE_MERGEABLE
COMPARE MAKE_X_MONOTONE SPLIT MERGE ASSERTIONS ARE_MERGEABLE
execute_commands_new_structure spherical_arcs spherical_arc_traits \
INTERSECT \
@ -1118,7 +1238,6 @@ if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then
configure
fi
if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then
compile_and_run construction_test_suite_generator
fi
@ -1145,19 +1264,21 @@ test_algebraic_traits_core
test_algebraic_traits_gmp
test_algebraic_traits_leda
compile_and_run test_insertion
compile_and_run test_unbounded_rational_insertion
compile_and_run test_rational_function_traits_2
compile_and_run test_removal
compile_and_run test_iso_verts
compile_and_run test_iso_verts
compile_and_run test_vert_ray_shoot_vert_segments
compile_and_run test_construction
compile_and_run test_overlay
compile_and_run point_location
test_point_location_segments
test_point_location_circle_segments
test_point_location_linear
test_point_location_dynamic_segments
compile_and_run test_dual
compile_and_run test_do_intersect

View File

@ -1,34 +0,0 @@
33
0/1 0/1 1000000/1 0/1
0/1 1/1 1000000/1 1/1
0/1 2/1 1000000/1 2/1
0/1 3/1 1000000/1 3/1
0/1 4/1 1000000/1 4/1
0/1 5/1 1000000/1 5/1
0/1 6/1 1000000/1 6/1
0/1 7/1 1000000/1 7/1
0/1 8/1 1000000/1 8/1
0/1 9/1 1000000/1 9/1
0/1 10/1 1000000/1 10/1
0/1 0/1 0/1 1/1
0/1 1/1 0/1 2/1
0/1 2/1 0/1 3/1
0/1 3/1 0/1 4/1
0/1 4/1 0/1 5/1
0/1 5/1 0/1 6/1
0/1 6/1 0/1 7/1
0/1 7/1 0/1 8/1
0/1 8/1 0/1 9/1
0/1 9/1 0/1 10/1
1000000/1 0/1 1000000/1 1/1
1000000/1 1/1 1000000/1 2/1
1000000/1 2/1 1000000/1 3/1
1000000/1 3/1 1000000/1 4/1
1000000/1 4/1 1000000/1 5/1
1000000/1 5/1 1000000/1 6/1
1000000/1 6/1 1000000/1 7/1
1000000/1 7/1 1000000/1 8/1
1000000/1 8/1 1000000/1 9/1
1000000/1 9/1 1000000/1 10/1
0/1 10/1 500000/1 11/1
500000/1 11/1 1000000/1 10/1

View File

@ -1,18 +0,0 @@
16
0/1 0/1 10/1 0/1
10/1 0/1 10/1 10/1
10/1 10/1 0/1 10/1
0/1 10/1 0/1 0/1
4/1 4/1 5/1 5/1
5/1 5/1 6/1 4/1
6/1 4/1 4/1 4/1
7/1 4/1 5/1 5/1
5/1 5/1 7/1 6/1
7/1 6/1 7/1 4/1
6/1 8/1 5/1 5/1
5/1 5/1 4/1 8/1
4/1 8/1 6/1 8/1
3/1 6/1 5/1 5/1
5/1 5/1 3/1 4/1
3/1 4/1 3/1 6/1

View File

@ -1,10 +0,0 @@
9
-1/1 0/1 0/1 1/1
0/1 1/1 1/1 0/1
1/1 0/1 0/1 -1/1
0/1 -1/1 -1/1 0/1
0/1 2/1 2/1 0/1
2/1 0/1 0/1 -2/1
0/1 -2/1 -2/1 0/1
-2/1 0/1 -5/9 1/2
-5/9 1/2 0/1 2/1

Some files were not shown because too many files have changed in this diff Show More