diff --git a/.gitattributes b/.gitattributes index edf568ed329..7767becb220 100644 --- a/.gitattributes +++ b/.gitattributes @@ -809,8 +809,10 @@ Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/fig/unb_dcel.fig -text Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/fig/unb_dcel.gif -text svneol=unset#image/gif Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/fig/unb_dcel.pdf -text svneol=unset#application/pdf Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_algebraic_segment_traits.tex -text +Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_face_index_map.tex -text Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_halfedge_direction.tex -text Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_rational_function_traits.tex -text +Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_vertex_index_map.tex -text Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/arr_do_intersect.tex -text Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/arr_zone.tex -text Arrangement_on_surface_2/doc_tex/Sweep_line_2/fig/Curve_intersections_2.png -text @@ -2532,6 +2534,12 @@ Generator/doc_tex/Generator/generators_prog1.png -text svneol=unset#image/png Generator/doc_tex/Generator/generators_prog2.png -text svneol=unset#image/png Generator/doc_tex/Generator/hypergrid.gif -text svneol=unset#image/gif Generator/doc_tex/Generator/hypergrid.pdf -text svneol=unset#application/pdf +Generator/doc_tex/Generator_ref/CombinationElement.tex -text +Generator/doc_tex/Generator_ref/Combination_enumerator.tex -text +Generator/examples/Generator/combination_enumerator.cpp -text +Generator/examples/Generator/name_pairs.cpp -text +Generator/include/CGAL/Combination_enumerator.h -text +Generator/test/Generator/test_combination_enumerator.cpp -text Geomview/demo/Geomview/CMakeLists.txt -text Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h -text Geomview/doc/Geomview/Geomview.txt -text @@ -2777,6 +2785,7 @@ Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgramQt4.cmake -text Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake -text Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake -text Installation/cmake/modules/CGAL_Macros.cmake -text +Installation/cmake/modules/CGAL_SCM.cmake -text Installation/cmake/modules/CGAL_SetupBoost.cmake -text Installation/cmake/modules/CGAL_SetupDependencies.cmake -text Installation/cmake/modules/CGAL_SetupFlags.cmake -text @@ -3565,6 +3574,7 @@ 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/announcement/CGAL-4.1 -text Maintenance/public_release/announcement/CGAL-4.1-beta1 -text Maintenance/public_release/scripts/precompiled_demos_zips -text Maintenance/public_release/scripts/prepare_release -text @@ -4842,6 +4852,7 @@ Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.ui -t Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_smoothing_plugin.cpp -text Polyhedron/demo/Polyhedron/Polyhedron_demo_poisson_plugin.ui -text Polyhedron/demo/Polyhedron/Polyhedron_demo_transform_polyhedron_plugin.cpp -text +Polyhedron/demo/Polyhedron/Preferences.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 @@ -5114,11 +5125,12 @@ Polynomial/include/CGAL/Polynomial/sturm_habicht_sequence.h -text Polynomial/include/CGAL/Polynomial/subresultants.h -text Polynomial/include/CGAL/Polynomial_type_generator.h -text Polynomial/include/CGAL/Test/_test_polynomial_traits_d.h -text -Polynomial/test/Polynomial/Coercion_traits.cpp -text -Polynomial/test/Polynomial/Get_arithmetic_kernel.cpp -text Polynomial/test/Polynomial/Polynomial_type_generator.cpp -text Polynomial/test/Polynomial/polynomial_utils.cpp -text Polynomial/test/Polynomial/sturm_habicht_sequence.cpp -text +Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp -text +Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp -text +Polynomial/test/Polynomial/test_subresultants.cpp -text Polynomial/test/Polynomial/subresultants.cpp -text Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d.h -text Polytope_distance_d/doc/Polytope_distance_d/CGAL/Polytope_distance_d_traits_2.h -text @@ -5192,6 +5204,15 @@ Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedr Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h -text Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h -text Principal_component_analysis/test/Principal_component_analysis/Principal_component_analysis.sln eol=crlf +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_circles_2.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_cuboids_3.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_rectangles_2.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_2.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_3.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_spheres_3.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_tetrahedra_3.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_2.cpp -text +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_3.cpp -text Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_circles_2.cpp -text Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_cuboids_3.cpp -text Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_rectangles_2.cpp -text @@ -5222,6 +5243,7 @@ QP_solver/doc/QP_solver/fig/first_nonnegative_qp.png -text svneol=unset#image/pn QP_solver/doc/QP_solver/fig/first_qp.pdf -text svneol=unset#application/pdf QP_solver/doc/QP_solver/fig/first_qp.png -text svneol=unset#image/png QP_solver/doc/QP_solver/fig/qp.png -text svneol=unset#image/png + QP_solver/doc_tex/QP_solver/PkgDescription.tex -text QP_solver/doc_tex/QP_solver/closest_point.fig -text svneol=unset#application/octet-stream QP_solver/doc_tex/QP_solver/closest_point.gif -text svneol=unset#image/gif @@ -5405,7 +5427,7 @@ 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_git_update_hooks_for_client -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 @@ -6009,6 +6031,7 @@ Straight_skeleton_2/test/Straight_skeleton_2/data/wheel_16_spokes.poly -text Straight_skeleton_2/test/Straight_skeleton_2/data/wheel_16_spokes_b.poly -text Straight_skeleton_2/test/Straight_skeleton_2/data/wiggly_03_cgal.poly -text Straight_skeleton_2/test/Straight_skeleton_2/include/CGAL/test_sls_types.h -text +Straight_skeleton_2/test/Straight_skeleton_2/offset_bug.cpp -text Straight_skeleton_2/test/Straight_skeleton_2/selected.rsp -text Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cmd -text Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp -text diff --git a/.gitignore b/.gitignore index e3be1d2474d..c777563a002 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,16 @@ AABB_tree/test/AABB_tree/aabb_naive_vs_tree_distance_segment_test AABB_tree/test/AABB_tree/aabb_projection_triangle_test AABB_tree/test/AABB_tree/aabb_projection_triangle_test.vcproj AABB_tree/test/AABB_tree/cgal_test_with_cmake +Algebraic_foundations/test/Algebraic_foundations/Algebraic_extension_traits +Algebraic_foundations/test/Algebraic_foundations/Algebraic_structure_traits +Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt +Algebraic_foundations/test/Algebraic_foundations/Chinese_remainder_traits +Algebraic_foundations/test/Algebraic_foundations/Coercion_traits +Algebraic_foundations/test/Algebraic_foundations/Real_embeddable_traits +Algebraic_foundations/test/Algebraic_foundations/Scalar_factor_traits +Algebraic_foundations/test/Algebraic_foundations/cgal_test_with_cmake +Algebraic_foundations/test/Algebraic_foundations/extended_euclidean_algorithm +Algebraic_foundations/test/Algebraic_foundations/ipower Algebraic_kernel_d/test/Algebraic_kernel_d/cgal_test_with_cmake Algebraic_kernel_d/test/Algebraic_kernel_d/rs_isolator Alpha_shapes_2/demo/Alpha_shapes_2/*.exe @@ -62,8 +72,61 @@ Arithmetic_kernel/test/Arithmetic_kernel/Get_arithmetic_kernel Arithmetic_kernel/test/Arithmetic_kernel/LEDA_arithmetic_kernel Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier_curves Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/aggregated_insertion +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_ex_dcel_io.dat +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_ex_io.dat +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_ex_io_hist.dat +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_ex_io_unbounded.dat +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_planar_vertical_decomposition +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/cgal_test_with_cmake +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circles +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_arcs +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conics +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_insertion +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_insertion +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/global_removal +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_unbounded +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/observer +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_example +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polylines +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sweep_line +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_non_intersecting +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt +Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp BGL/examples/BGL_arrangement_2/CMakeLists.txt BGL/examples/BGL_arrangement_2/Makefile BGL/examples/BGL_arrangement_2/cgal_test_with_cmake @@ -76,6 +139,13 @@ Boolean_set_operations_2/demo/Boolean_set_operations_2/*.sln Boolean_set_operations_2/demo/Boolean_set_operations_2/*.vcproj Boolean_set_operations_2/demo/Boolean_set_operations_2/Makefile Boolean_set_operations_2/demo/Boolean_set_operations_2/boolean_operations_2 +Box_intersection_d/test/Box_intersection_d/CMakeLists.txt +Box_intersection_d/test/Box_intersection_d/automated_test +Box_intersection_d/test/Box_intersection_d/benchmark.data +Box_intersection_d/test/Box_intersection_d/benchmark_box_intersection +Box_intersection_d/test/Box_intersection_d/box_grid +Box_intersection_d/test/Box_intersection_d/cgal_test_with_cmake +Box_intersection_d/test/Box_intersection_d/random_set_test CGAL_ImageIO/demo/CGALimageIO/Makefile CGAL_ImageIO/demo/CGALimageIO/cgal_test_with_cmake CGAL_ImageIO/demo/CGALimageIO/cmake_install.cmake @@ -122,9 +192,11 @@ Generator/examples/Generator/random_segments1 Generator/examples/Generator/random_segments2 Generator/examples/Generator/sphere_d Generator/test/Generator/CMakeLists.txt +Generator/test/Generator/bug Generator/test/Generator/cgal_test_with_cmake Generator/test/Generator/random_poly_test Generator/test/Generator/rcs_test +Generator/test/Generator/test_combination_enumerator Generator/test/Generator/test_generators GraphicsView/TAGS GraphicsView/demo/Circular_kernel_2/*.exe @@ -242,6 +314,7 @@ Kinetic_data_structures/test/Kinetic_data_structures/random_kds Kinetic_data_structures/test/Kinetic_data_structures/regular_triangulation_3 Kinetic_data_structures/test/Kinetic_data_structures/simulator Kinetic_data_structures/test/Kinetic_data_structures/solvers +Kinetic_data_structures/test/Kinetic_data_structures/test_KDS_Delaunay_triangulation_2 Kinetic_data_structures/test/Kinetic_data_structures/timings Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3.qrc.depends Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_demo @@ -652,6 +725,7 @@ Mesh_3/test/Mesh_3/.*.deps Mesh_3/test/Mesh_3/CTestTestfile.cmake Mesh_3/test/Mesh_3/Makefile Mesh_3/test/Mesh_3/ProgramOutput.* +Mesh_3/test/Mesh_3/a.lua Mesh_3/test/Mesh_3/applications Mesh_3/test/Mesh_3/cgal_test_with_cmake Mesh_3/test/Mesh_3/cgal_to_medit @@ -670,6 +744,9 @@ Mesh_3/test/Mesh_3/off_to_ghs Mesh_3/test/Mesh_3/read_mesh Mesh_3/test/Mesh_3/slivers_exuder Mesh_3/test/Mesh_3/stat_mesh +Mesh_3/test/Mesh_3/test-tetgen.elem +Mesh_3/test/Mesh_3/test-tetgen.face +Mesh_3/test/Mesh_3/test-tetgen.node Mesh_3/test/Mesh_3/test_backward_compatibility_MeshFoobarCriteria_3 Mesh_3/test/Mesh_3/test_boost_has_xxx Mesh_3/test/Mesh_3/test_c3t3 @@ -694,6 +771,12 @@ Modular_arithmetic/doc_tex/Modular_arithmetic/*.aux Modular_arithmetic/doc_tex/Modular_arithmetic/*.hax Modular_arithmetic/doc_tex/Modular_arithmetic_ref/main.aux Modular_arithmetic/doc_tex/Modular_arithmetic_ref/main.hax +Nef_2/test/Nef_2/CMakeLists.txt +Nef_2/test/Nef_2/EPoint-test +Nef_2/test/Nef_2/Nef_polyhedron_2-test +Nef_2/test/Nef_2/Polynomial-test +Nef_2/test/Nef_2/cgal_test_with_cmake +Nef_2/test/Nef_2/nef_2_point_location Nef_3/demo/Nef_3/Makefile Nef_3/examples/Nef_3/Makefile Nef_3/examples/Nef_3/comparison @@ -754,6 +837,7 @@ Number_types/test/Number_types/cgal_test_with_cmake Number_types/test/Number_types/constant Number_types/test/Number_types/double Number_types/test/Number_types/doubletst +Number_types/test/Number_types/eigen Number_types/test/Number_types/float Number_types/test/Number_types/floattst Number_types/test/Number_types/int @@ -773,7 +857,9 @@ Number_types/test/Number_types/quotient_io Number_types/test/Number_types/root_of_2 Number_types/test/Number_types/rounding_modes Number_types/test/Number_types/simplest_rational +Number_types/test/Number_types/test_nt_Coercion_traits Number_types/test/Number_types/to_interval_test +Number_types/test/Number_types/unsigned Number_types/test/Number_types/utilities Optimisation_basic/*.aux Optimisation_basic/*.bbl @@ -792,22 +878,6 @@ Optimisation_basic/Makefile Optimisation_basic/bin Optimisation_basic/doc_ps Optimisation_basic/src/Optimisation -Optimisation_doc/*.aux -Optimisation_doc/*.bbl -Optimisation_doc/*.blg -Optimisation_doc/*.dvi -Optimisation_doc/*.idx -Optimisation_doc/*.ilg -Optimisation_doc/*.ind -Optimisation_doc/*.log -Optimisation_doc/*.mxp -Optimisation_doc/*.toc -Optimisation_doc/.dep -Optimisation_doc/.obj -Optimisation_doc/.tmp -Optimisation_doc/Makefile -Optimisation_doc/bin -Optimisation_doc/doc_ps Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/*.exe Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/*.sln Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/*.vcproj @@ -830,6 +900,13 @@ Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_trian Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_triangulation_traits_H_3 Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_triangulation_traits_SC_3 Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/test_periodic_3_triangulation_traits_SH_3 +Point_set_2/test/Point_set_2/CMakeLists.txt +Point_set_2/test/Point_set_2/cgal_test_with_cmake +Point_set_2/test/Point_set_2/nearest_nb1 +Point_set_2/test/Point_set_2/nearest_nb_fcn +Point_set_2/test/Point_set_2/range_search_fcn +Point_set_2/test/Point_set_2/rs_check_empty +Point_set_2/test/Point_set_2/test_range_search Point_set_processing_3/doc_doxygen Point_set_processing_3/doc_html Point_set_processing_3/doc_pdf @@ -912,6 +989,28 @@ Polynomial/doc_tex/Polynomial/main.aux Polynomial/doc_tex/Polynomial/main.hax Polynomial/doc_tex/Polynomial_ref/main.aux Polynomial/doc_tex/Polynomial_ref/main.hax +Polynomial/test/Polynomial/CMakeLists.txt +Polynomial/test/Polynomial/Exponent_vector +Polynomial/test/Polynomial/Interpolator +Polynomial/test/Polynomial/Polynomial_traits_d +Polynomial/test/Polynomial/Polynomial_type_generator +Polynomial/test/Polynomial/Polynomial_using_core +Polynomial/test/Polynomial/Polynomial_using_leda +Polynomial/test/Polynomial/cgal_test_with_cmake +Polynomial/test/Polynomial/modular_gcd_utcf_algorithm_M +Polynomial/test/Polynomial/modular_gcd_utcf_dfai +Polynomial/test/Polynomial/modular_gcd_utcf_pure_wang +Polynomial/test/Polynomial/modular_gcd_utcf_with_wang +Polynomial/test/Polynomial/modular_gcd_utils +Polynomial/test/Polynomial/polynomial_functions +Polynomial/test/Polynomial/polynomial_gcd +Polynomial/test/Polynomial/polynomial_utils +Polynomial/test/Polynomial/resultant +Polynomial/test/Polynomial/sturm_habicht_sequence +Polynomial/test/Polynomial/subresultants +Polynomial/test/Polynomial/test_polynomial_Coercion_traits +Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel +Polynomial/test/Polynomial/test_subresultants Polytope_distance_d/*.aux Polytope_distance_d/*.bbl Polytope_distance_d/*.blg @@ -931,6 +1030,33 @@ Polytope_distance_d/doc_ps Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt Polytope_distance_d/test/Polytope_distance_d/cgal_test_with_cmake Polytope_distance_d/test/Polytope_distance_d/test_Polytope_distance_d_d +Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt +Principal_component_analysis/test/Principal_component_analysis/bounding_box +Principal_component_analysis/test/Principal_component_analysis/cgal_test_with_cmake +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_circles_2 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_cuboids_3 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_points_2 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_points_3 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_rectangles_2 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_segments_2 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_segments_3 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_spheres_3 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_tetrahedra_3 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_triangles_2 +Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_triangles_3 +Principal_component_analysis/test/Principal_component_analysis/test_barycenter +Principal_component_analysis/test/Principal_component_analysis/test_bounding_box +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_circles_2 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_cuboids_3 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_points_2 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_points_3 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_rectangles_2 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_2 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_3 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_spheres_3 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_tetrahedra_3 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_2 +Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_3 QP_solver/documentation/Degeneracies.aux QP_solver/documentation/Degeneracies.log QP_solver/documentation/Degeneracies.pdf @@ -986,10 +1112,14 @@ STL_Extension/test/STL_Extension/test_is_iterator STL_Extension/test/STL_Extension/test_is_streamable STL_Extension/test/STL_Extension/test_lexcompare_outputrange STL_Extension/test/STL_Extension/test_multiset +STL_Extension/test/STL_Extension/test_namespaces STL_Extension/test/STL_Extension/test_nth_element STL_Extension/test/STL_Extension/test_stl_extension STL_Extension/test/STL_Extension/test_type_traits STL_Extension/test/STL_Extension/test_vector +SearchStructures/test/RangeSegmentTrees/CMakeLists.txt +SearchStructures/test/RangeSegmentTrees/cgal_test_with_cmake +SearchStructures/test/RangeSegmentTrees/test_segment_tree_set_2 Skin_surface_3/.cdtproject Skin_surface_3/.project Skin_surface_3/.settings @@ -1286,10 +1416,96 @@ Triangulation_3/test/Triangulation_3/test_delaunay_hierarchy_3_old Triangulation_3/test/Triangulation_3/test_dt_deterministic_3 Triangulation_3/test/Triangulation_3/test_regular_3 Triangulation_3/test/Triangulation_3/test_regular_as_delaunay_3 +Triangulation_3/test/Triangulation_3/test_regular_insert_range_with_info Triangulation_3/test/Triangulation_3/test_regular_remove_3 Triangulation_3/test/Triangulation_3/test_regular_traits_3 Triangulation_3/test/Triangulation_3/test_simplex_3 Triangulation_3/test/Triangulation_3/test_static_filters Triangulation_3/test/Triangulation_3/test_triangulation_3 Triangulation_3/test/Triangulation_3/test_triangulation_tds +Triangulation_3/test/Triangulation_3/test_triangulation_tds_3 /build* +*.bak +*.bk? +*.old +.DS_Store +*.a +*.o +*.lib +*.dll +*.exe +*.so +*.so.* +debug +release +Debug +Release +x64 +*.blg +*.cgallog +*.aux +*.maf +*.hax +*.hlg +*.ilg +*.pdflg +*.log + +*.toc +*.cgallog.tmp* +*.inc +*.dvi +*.mtc* +*.idx +ProgramOutput* +ErrorOutput* +CompilerOutput* +error.txt +*.ncb +*.suo +contents.obv +.xvpics +semantic.cache +doc_ps +doc_html +doc_pdf +*.moc +.*~ +*~ +.#* +*.user +*.aps +doc_doxygen +CMakeCache.txt +CMakeFiles +cmake_install.cmake +Doxyfile +*.dir +ALL_BUILD.vcproj +ZERO_CHECK.vcproj +gmon.* +.qglviewer.xml +*.moc_parameters +*.cpp_parameters +*_moc.cpp +ui_*.h +qrc_*.cxx +*.sbr +.dir-locals.el +*.tmp +*.ilk +*.pdb +*.exe.* +Makefile +*.cpp.noheader +*.h.noheader +*.h.filename +*.cpp.filename +.scm-urls +*.exp +*.resource.txt +*.manifest +*.manifest.res +*.vcproj +*.sln +*.depends diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index cf7334a6437..931bfd389aa 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -96,8 +96,6 @@ public: /// Default constructor. AABB_traits() { }; - // Non-virtual Destructor - ~AABB_traits() { }; typedef typename GeomTraits::Compute_squared_distance_3 Squared_distance; Squared_distance squared_distance_object() const { return GeomTraits().compute_squared_distance_3_object(); } diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/EuclideanRing.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/EuclideanRing.tex index 091376a9f04..e75369e59c3 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/EuclideanRing.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/EuclideanRing.tex @@ -13,9 +13,9 @@ Moreover, \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >::Algebraic_type} derived from \ccc{Unique_factorization_domain_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >::Mod} \\ -- \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >::Div} \\ -- \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >::Div_mod}\\ +- \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >::Mod} a model of \ccc{AlgebraicStructureTraits::Mod}\\ +- \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >::Div} a model of \ccc{AlgebraicStructureTraits::Div}\\ +- \ccc{CGAL::Algebraic_structure_traits< EuclideanRing >::Div_mod} a model of \ccc{AlgebraicStructureTraits::DivMod}\\ diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Field.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Field.tex index 64e92bceaef..090300a6c3f 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Field.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/Field.tex @@ -13,7 +13,7 @@ operators / and /=. Moreover, \ccc{CGAL::Algebraic_structure_traits< Field >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< Field >::Algebraic_type} derived from \ccc{Field_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< FieldWithSqrt >::Inverse}\\ +- \ccc{CGAL::Algebraic_structure_traits< FieldWithSqrt >::Inverse} a model of \ccc{AlgebraicStructureTraits::Inverse}\\ \ccRefines diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithKthRoot.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithKthRoot.tex index 50487b00056..e2f3c6793f3 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithKthRoot.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithKthRoot.tex @@ -6,7 +6,7 @@ A model of \ccc{FieldWithKthRoot} is a \ccc{FieldWithSqrt} that has operations t Moreover, \ccc{CGAL::Algebraic_structure_traits< FieldWithKthRoot >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< FieldWithKthRoot >::Algebraic_type} derived from \ccc{Field_with_kth_root_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< FieldWithKthRoot >::Kth_root}\\ +- \ccc{CGAL::Algebraic_structure_traits< FieldWithKthRoot >::Kth_root} a model of \ccc{AlgebraicStructureTraits::KthRoot}\\ \ccRefines \ccc{FieldWithSqrt} diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithRootOf.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithRootOf.tex index bf795681872..57986204329 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithRootOf.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithRootOf.tex @@ -7,7 +7,7 @@ construct it as the root of a univariate polynomial. Moreover, \ccc{CGAL::Algebraic_structure_traits< FieldWithRootOf >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< FieldWithRootOf >::Algebraic_type} derived from \ccc{Field_with_kth_root_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< FieldWithRootOf >::Root_of}\\ +- \ccc{CGAL::Algebraic_structure_traits< FieldWithRootOf >::Root_of} model of \ccc{AlgebraicStructureTraits::RootOf}\\ \ccRefines \ccc{FieldWithKthRoot} diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithSqrt.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithSqrt.tex index ea035ca0023..01e9cc92f71 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithSqrt.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/FieldWithSqrt.tex @@ -6,7 +6,7 @@ A model of \ccc{FieldWithSqrt} is a \ccc{Field} that has operations to take squa Moreover, \ccc{CGAL::Algebraic_structure_traits< FieldWithSqrt >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< FieldWithSqrt >::Algebraic_type} derived from \ccc{Field_with_sqrt_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< FieldWithSqrt >::Sqrt}\\ +- \ccc{CGAL::Algebraic_structure_traits< FieldWithSqrt >::Sqrt} a model of \ccc{AlgebraicStructureTraits::Sqrt} \\ \ccRefines \ccc{Field} diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomain.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomain.tex index 36734061a80..9dc94bb4d06 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomain.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomain.tex @@ -15,8 +15,8 @@ Moreover, \ccc{CGAL::Algebraic_structure_traits< IntegralDomain >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< IntegralDomain >::Algebraic_type} derived from \ccc{Integral_domain_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< IntegralDomain >::Integral_division}\\ -- \ccc{CGAL::Algebraic_structure_traits< IntegralDomain >::Divides}\\ +- \ccc{CGAL::Algebraic_structure_traits< IntegralDomain >::Integral_division} a model of \ccc{AlgebraicStructureTraits::IntegralDivision}\\ +- \ccc{CGAL::Algebraic_structure_traits< IntegralDomain >::Divides} a model of \ccc{AlgebraicStructureTraits::Divides}\\ \ccRefines \ccc{IntegralDomainWithoutDivision} diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomainWithoutDivision.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomainWithoutDivision.tex index 5695bf4c492..523f4bf1ba3 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomainWithoutDivision.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/IntegralDomainWithoutDivision.tex @@ -20,11 +20,11 @@ implement the respective ring operations. Moreover, \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Algebraic_type} derived from \ccc{Integral_domain_without_division_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_zero} \\ -- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_one} \\ -- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Square} \\ -- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Simplify} \\ -- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Unit_part} \\ +- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_zero} a model of \ccc{AlgebraicStructureTraits::IsZero}\\ +- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Is_one} a model of \ccc{AlgebraicStructureTraits::IsOne} \\ +- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Square} a model of \ccc{AlgebraicStructureTraits::Square} \\ +- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Simplify} a model of \ccc{AlgebraicStructureTraits::Simplify} \\ +- \ccc{CGAL::Algebraic_structure_traits< IntegralDomainWithoutDivision >::Unit_part} a model of \ccc{AlgebraicStructureTraits::UnitPart} \\ %{ \em \small FROM \exacus: \\ diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/RealEmbeddable.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/RealEmbeddable.tex index 60b1ca3dc8a..cdd16b39098 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/RealEmbeddable.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/RealEmbeddable.tex @@ -11,14 +11,14 @@ Moreover, \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >} is a model of with:\\ - \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Is_real_embeddable} set to \ccc{Tag_true} \\ and functors :\\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Is_zero} \\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Abs} \\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Sgn} \\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Is_positive} \\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Is_negative} \\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Compare} \\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::To_double} \\ -- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::To_interval} \\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Is_zero} a model of \ccc{AlgebraicStructureTraits::IsZero} \\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Abs} a model of \ccc{AlgebraicStructureTraits::Abs}\\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Sgn} a model of \ccc{AlgebraicStructureTraits::Sgn}\\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Is_positive} a model of \ccc{AlgebraicStructureTraits::IsPositive}\\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Is_negative} a model of \ccc{AlgebraicStructureTraits::IsNegative}\\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::Compare} a model of \ccc{AlgebraicStructureTraits::Compare} \\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::To_double} a model of \ccc{AlgebraicStructureTraits::ToDouble} \\ +- \ccc{CGAL::Real_embeddable_traits< RealEmbeddable >::To_interval} a model of \ccc{AlgebraicStructureTraits::ToInterval} \\ Remark:\\ If a number type is a model of both \ccc{IntegralDomainWithoutDivision} and diff --git a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/UniqueFactorizationDomain.tex b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/UniqueFactorizationDomain.tex index 3b1805e0112..ae8e99bb299 100644 --- a/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/UniqueFactorizationDomain.tex +++ b/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/UniqueFactorizationDomain.tex @@ -21,7 +21,7 @@ Moreover, \ccc{CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >} is a model of \ccc{AlgebraicStructureTraits} providing:\\ - \ccc{CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >::Algebraic_type} derived from \ccc{Unique_factorization_domain_tag} \\ -- \ccc{CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >::Gcd}\\ +- \ccc{CGAL::Algebraic_structure_traits< UniqueFactorizationDomain >::Gcd} a model of \ccc{AlgebraicStructureTraits::Gcd}\\ diff --git a/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h b/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h index f9020e57163..e43fde416c9 100644 --- a/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h +++ b/Algebraic_foundations/include/CGAL/Algebraic_extension_traits.h @@ -29,6 +29,9 @@ #define CGAL_ALGEBRAIC_NUMBER_TRAITS_H 1 #include // for std::accumulate +#include // for std::unary_function +#include +#include namespace CGAL { diff --git a/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h b/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h index 76a0b601e58..12dbcf57506 100644 --- a/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h +++ b/Algebraic_foundations/include/CGAL/Algebraic_structure_traits.h @@ -24,8 +24,11 @@ #ifndef CGAL_ALGEBRAIC_STRUCTURE_TRAITS_H #define CGAL_ALGEBRAIC_STRUCTURE_TRAITS_H -#include +#include +#include #include +#include +#include namespace CGAL { diff --git a/Algebraic_foundations/include/CGAL/Coercion_traits.h b/Algebraic_foundations/include/CGAL/Coercion_traits.h index 331911d4506..bc220340f77 100644 --- a/Algebraic_foundations/include/CGAL/Coercion_traits.h +++ b/Algebraic_foundations/include/CGAL/Coercion_traits.h @@ -30,13 +30,13 @@ #ifndef CGAL_COERCION_TRAITS_H #define CGAL_COERCION_TRAITS_H 1 -#include - #include #include #include +#include + // Makro to define an additional operator for binary functors which takes // two number types as parameters that are interoperable with the // number type diff --git a/Algebraic_foundations/include/CGAL/Fraction_traits.h b/Algebraic_foundations/include/CGAL/Fraction_traits.h index da94c1535fc..684a5ec2c4f 100644 --- a/Algebraic_foundations/include/CGAL/Fraction_traits.h +++ b/Algebraic_foundations/include/CGAL/Fraction_traits.h @@ -35,7 +35,7 @@ #ifndef CGAL_FRACTION_TRAITS_H #define CGAL_FRACTION_TRAITS_H -#include +#include namespace CGAL { diff --git a/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h b/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h index 21e6d18a4ec..671a7c9c79e 100644 --- a/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h +++ b/Algebraic_foundations/include/CGAL/Real_embeddable_traits.h @@ -24,7 +24,7 @@ #ifndef CGAL_REAL_EMBEDDABLE_TRAITS_H #define CGAL_REAL_EMBEDDABLE_TRAITS_H -#include +#include namespace CGAL { diff --git a/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h b/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h index 959d50489a3..8697e799d1e 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_coercion_traits.h @@ -26,6 +26,10 @@ */ #include +#include +#include +#include +#include // These are test functions for the Coercion_traits namespace CGAL { diff --git a/Algebraic_foundations/include/CGAL/ipower.h b/Algebraic_foundations/include/CGAL/ipower.h index 5908be86d37..6b107816061 100644 --- a/Algebraic_foundations/include/CGAL/ipower.h +++ b/Algebraic_foundations/include/CGAL/ipower.h @@ -26,6 +26,8 @@ #ifndef CGAL_IPOWER_H #define CGAL_IPOWER_H +#include + namespace CGAL { template diff --git a/Algebraic_foundations/include/CGAL/number_utils.h b/Algebraic_foundations/include/CGAL/number_utils.h index aff2dbe2be2..b3e55286698 100644 --- a/Algebraic_foundations/include/CGAL/number_utils.h +++ b/Algebraic_foundations/include/CGAL/number_utils.h @@ -25,7 +25,9 @@ #ifndef CGAL_NUMBER_UTILS_H #define CGAL_NUMBER_UTILS_H -#include +#include +#include +#include namespace CGAL { CGAL_NTS_BEGIN_NAMESPACE diff --git a/Algebraic_foundations/include/CGAL/number_utils_classes.h b/Algebraic_foundations/include/CGAL/number_utils_classes.h index bdb7a96701a..005e01a7643 100644 --- a/Algebraic_foundations/include/CGAL/number_utils_classes.h +++ b/Algebraic_foundations/include/CGAL/number_utils_classes.h @@ -28,7 +28,8 @@ #ifndef CGAL_NUMBER_UTILS_CLASSES_H #define CGAL_NUMBER_UTILS_CLASSES_H 1 -#include +#include +#include #include #include diff --git a/Algebraic_foundations/package_info/Algebraic_foundations/maintainer b/Algebraic_foundations/package_info/Algebraic_foundations/maintainer index 1a805590fcb..2fac76fa750 100644 --- a/Algebraic_foundations/package_info/Algebraic_foundations/maintainer +++ b/Algebraic_foundations/package_info/Algebraic_foundations/maintainer @@ -1 +1 @@ -Michael Hemmer +Michael Hemmer \ No newline at end of file diff --git a/Algebraic_kernel_d/include/CGAL/RS/refine_1_rs.h b/Algebraic_kernel_d/include/CGAL/RS/refine_1_rs.h index dd19eb24b3e..6c6192c173e 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/refine_1_rs.h +++ b/Algebraic_kernel_d/include/CGAL/RS/refine_1_rs.h @@ -29,6 +29,19 @@ namespace RS3{ inline void refine_1(const CGAL::Algebraic_1 &a,unsigned int s=10000){ CGAL_precondition(a.inf()<=a.sup()); + // If the algebraic endpoints have room for a refinement bigger + // than desired, refine as much is possible. This would ensure that + // small refinements are never made. Other possibility to avoid + // small refinements is to refine the number just after it was + // isolated (this early refinement would also have the advantage + // that one can choose to refine until reaching a certain criterion + // and assume it is true for later refinements, but this can slow + // down the Solve_1 functor). And a last option would be to + // determine a lower bound on the precisions RS likes to refine. + if(sleft)-2) + s=mpfr_get_prec(&((mpfi_ptr)(a.mpfi()))->left)-2; + if(sright)-2) + s=mpfr_get_prec(&((mpfi_ptr)(a.mpfi()))->right)-2; // If the precision of the endpoints is not enough for the desired // refinement, allocate a new mpfi and swap later the result. if(mpfr_get_prec(&((mpfi_ptr)(a.mpfi()))->left). Univariate algebraic kernel based on RS: Luis Peņaranda. Bivariate algebraic kernel: Michael Kerber. diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h index 7aafb882d24..6c0c72d3303 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h @@ -290,63 +290,120 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ assert(compare_1(bound,Algebraic_real_1(1)) == LARGER ); assert(compare_1(bound,Algebraic_real_1(2)) == SMALLER ); } - { // Approximate_absolute_1 - { - std::list roots; - solve_1((x*x-2),true,std::back_inserter(roots)); - Algebraic_real_1 root = (CGAL::max)(roots.front(),roots.back()); - BInterval bi = approximate_absolute_1(root,5); - assert(compare_1(bi.first ,root) != LARGER ); - assert(compare_1(Algebraic_real_1(bi.second),root) != SMALLER); - assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); - assert((bi.second - bi.first) * ipower(Bound(2),5) <= Bound(1) ); - }{ - std::list roots; - solve_1((x*x-3),true,std::back_inserter(roots)); - Algebraic_real_1 root = (CGAL::min)(roots.front(),roots.back()); - BInterval bi = approximate_absolute_1(root,-5); - assert(compare_1(bi.first ,root) != LARGER ); - assert(compare_1(bi.second,root) != SMALLER); - assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); - assert((bi.second - bi.first) <= ipower(Bound(2),5) ); - } - } - { // Approximate_relative_1 - { - std::list roots; - solve_1((x*x-2),true,std::back_inserter(roots)); - Algebraic_real_1 root = (CGAL::max)(roots.front(),roots.back()); - BInterval bi = approximate_relative_1(root,5); - assert(compare_1(bi.first ,root) != LARGER ); - assert(compare_1(bi.second,root) != SMALLER); - assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); - assert((bi.second - bi.first * ipower(Bound(2),5)) - <= (CGAL::max)(abs(bi.first),abs(bi.second))); - }{ - std::list roots; - solve_1((x*x-30),true,std::back_inserter(roots)); - Algebraic_real_1 root = (CGAL::min)(roots.front(),roots.back()); - BInterval bi = approximate_relative_1(root,-5); - assert(compare_1(bi.first ,root) != LARGER ); - assert(compare_1(bi.second,root) != SMALLER); - assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); - assert((bi.second - bi.first) - <= (CGAL::max)(abs(bi.first),abs(bi.second)) * ipower(Bound(2),5)); - } - { - std::list roots; - solve_1((300*x*x-2),true,std::back_inserter(roots)); - Algebraic_real_1 root = (CGAL::min)(roots.front(),roots.back()); - BInterval bi = approximate_relative_1(root,5); - assert(compare_1(bi.first ,root) != LARGER ); - assert(compare_1(bi.second,root) != SMALLER); - assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); - assert((bi.second - bi.first) * ipower(Bound(2),5) - <= (CGAL::max)(abs(bi.first),abs(bi.second)) ); - } - } + CGAL::set_pretty_mode(std::cerr); + // Approximations + bool all_right = true; + std::cout << "start test_approximation (takes a while) " << std::flush; + Coefficient c = CGAL::ipower(Coefficient(2), 2500) + 1; + // we choose coefficients: small, large, (close to) power of two + std::vector< int > coeffs; + coeffs.push_back(1); + coeffs.push_back(13); + //coeffs.push_back(255); + //coeffs.push_back(499); + //coeffs.push_back(512); + //coeffs.push_back(10000); + //coeffs.push_back(3); + //coeffs.push_back(7); + //coeffs.push_back(64); + //coeffs.push_back(100); + coeffs.push_back(1023); + //coeffs.push_back(4096); + std::vector< int > precs; + //precs.push_back(0); + //precs.push_back(1); + //precs.push_back(2); + //precs.push_back(4); + precs.push_back(8); + //precs.push_back(13); + // precs.push_back(1023); + // precs.push_back(2048); + //precs.push_back(53); + //precs.push_back(3); + //precs.push_back(64); + //precs.push_back(106); + //precs.push_back(424); + for (typename std::vector< int >::const_iterator c0i = coeffs.begin(); + c0i != coeffs.end(); c0i++) { + for (typename std::vector< int >::const_iterator c2i = coeffs.begin(); + c2i != coeffs.end(); c2i++) { + // we basically test a quadratic polynomial (with choosen small and large + // quadratic and constant coefficient, which is disturbed by a root close to zero). + //Polynomial_1 poly((*c2i*x*x - *c0i) * (c*x-1)); + Polynomial_1 poly((*c2i*x*x - *c0i) * (c*x-1)); + std::list roots; + solve_1(poly,true,std::back_inserter(roots)); + for (typename std::vector< int >::const_iterator pi = precs.begin(); + pi != precs.end(); pi++) { + // all three roots are approximated with various precisions + long p = *pi; + { // Approximate_absolute_1 with positive p + for (typename std::list< Algebraic_real_1 >::const_iterator rit = roots.begin(); + rit != roots.end(); rit++) { + BInterval bi = approximate_absolute_1(*rit,p); + assert(compare_1(bi.first ,*rit) != LARGER ); + assert(compare_1(bi.second,*rit) != SMALLER); + assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); + if (!((bi.second - bi.first) * (p == 0 ? Bound(1) : ipower(Bound(2),p-1)) + <= (p == 0 ? Bound(2) : Bound(1)) )) { + all_right = false; + std::cerr << "ERROR: Approximate_absolute_1 fails for prec = " << p + << " of this root: " << *rit << std::endl; + } + } + } + { // Approximate_absolute_1 with negative p + for (typename std::list< Algebraic_real_1 >::const_iterator rit = roots.begin(); + rit != roots.end(); rit++) { + BInterval bi = approximate_absolute_1(*rit,-p); + assert(compare_1(bi.first ,*rit) != LARGER ); + assert(compare_1(bi.second,*rit) != SMALLER); + assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); + if (!((bi.second - bi.first) <= ipower(Bound(2),1-(-p)) )) { + all_right = false; + std::cerr << "ERROR: Approximate_absolute_1 fails for prec = " << -p + << " of this root: " << *rit << std::endl; + } + } + } + { // Approximate_relative_1 with positive p + for (typename std::list< Algebraic_real_1 >::const_iterator rit = roots.begin(); + rit != roots.end(); rit++) { + BInterval bi = approximate_relative_1(*rit,p); + assert(compare_1(bi.first ,*rit) != LARGER ); + assert(compare_1(bi.second,*rit) != SMALLER); + assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); + if (!((bi.second - bi.first) * (p == 0 ? Bound(1) : ipower(Bound(2),p-1)) + <= (p == 0 ? Bound(2) : Bound(1)) * (CGAL::max)(abs(bi.first),abs(bi.second)))) { + all_right = false; + std::cerr << "ERROR: Approximate_relative_1 fails for prec = " << p + << " of this root: " << *rit << std::endl; + + } + } + } + { // Approximate_relative_1 with negative p + for (typename std::list< Algebraic_real_1 >::const_iterator rit = roots.begin(); + rit != roots.end(); rit++) { + BInterval bi = approximate_relative_1(*rit,-p); + assert(compare_1(bi.first ,*rit) != LARGER ); + assert(compare_1(bi.second,*rit) != SMALLER); + assert(CGAL::sign(bi.second - bi.first) != NEGATIVE); + if (!((bi.second - bi.first) <= + ipower(Bound(2),1-(-p)) * (CGAL::max)(abs(bi.first),abs(bi.second)))) { + all_right = false; + std::cerr << "ERROR: Approximate_relative_1 fails for prec = " << -p + << " of this root: " << *rit << std::endl; + } + } + } + } + } + } + assert(all_right); // some approximation was not good enough + std::cout << " ok" << std::endl; { #define CGAL_TEST_ALGEBRAIC_REAL_IO(_f) \ diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index 85b6fb811a8..3b42b8f24e6 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -591,7 +591,7 @@ public: // Classifies a point `p' with respect to `A'. Locate_type type; int i; - Face_handle pFace = locate(p, type, i); + Face_handle pFace = this->locate(p, type, i); switch (type) { case VERTEX : return classify(pFace->vertex(i), alpha); diff --git a/Arithmetic_kernel/package_info/Arithmetic_kernel/maintainer b/Arithmetic_kernel/package_info/Arithmetic_kernel/maintainer index b354f14e7dd..291dcf918ae 100644 --- a/Arithmetic_kernel/package_info/Arithmetic_kernel/maintainer +++ b/Arithmetic_kernel/package_info/Arithmetic_kernel/maintainer @@ -1 +1 @@ -Michael Hemmer +Michael Hemmer diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_boost.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_boost.tex index 767cfeaca80..efe482e0aa9 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_boost.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_boost.tex @@ -25,7 +25,7 @@ faces. %------------------------------------------------- Arrangement instances are adapted to \boost\ graphs by specializing the -\ccc{boost:graph_traits} template for \ccc{Arrangement_2} instances. The +\ccc{boost::graph_traits} template for \ccc{Arrangement_2} instances. The graph-traits states the graph concepts that the arrangement class models (see below) and defines the types required by these concepts. @@ -67,10 +67,12 @@ For example, when we compute the shortest paths from a given source vertex $s$ to all other vertices we can obtain a map of distances and a map of predecessors --- namely for each $v$ vertex we have its distance from $s$ and a descriptor of the vertex that precedes $v$ in the shortest path from $s$. -If the vertex descriptors are simply indices, one can use vectors to -efficiently represent the property maps. As this is not the case with the -arrangement graph, we offer the \ccc{Arr_vertex_property_map} -template allows for an efficient mapping of \ccc{Vertex_handle} objects to +If the vertex descriptors are simply indices, boost supplies tools to +easily represent property maps using vectors. +\ccc{Arr_vertex_index_map} class allows create such +indices, and together with \ccc{boost::vector_property_map} allows for +an efficient mapping of \ccc{Vertex_handle} objects to properties of type \ccc{Type}. Note however that unlike the \ccc{Arr_vertex_index_map} class, the vertex property-map class is not kept synchronized with the number of vertices in the arrangement, so it @@ -100,8 +102,9 @@ as shown in Figure~\ref{arr_fig:ex_bgl}, then use Dijkstra's shortest-paths algorithm from the \bgl\ to compute the graph distance of all vertices from the leftmost vertex in the arrangement $v_0$. Note the usage of the \ccc{Arr_vertex_index_map} and -the \ccc{Arr_vertex_property_map} classes. The latter one, instantiated by -the type \ccc{double} is used to map vertices to their distances from $v_0$. +the \ccc{boost::vector_property_map} classes. The +latter one, instantiated by the type \ccc{double} is used to map +vertices to their distances from $v_0$. \ccIncludeExampleCode{Arrangement_on_surface_2/bgl_primal_adapter.cpp} @@ -112,7 +115,7 @@ It is possible to give a dual graph representation for an arrangement instance, such that each arrangement face corresponds to a graph vertex and two vertices are adjacent iff the corresponding faces share a common edge on their boundaries. This is done by specializing the -\ccc{boost:graph_traits} template for \ccc{Dual} instances, +\ccc{boost::graph_traits} template for \ccc{Dual} instances, where \ccc{Dual} is a template specialization that gives a dual interpretation to an arrangement instance. @@ -129,16 +132,16 @@ arrangement graph is also a model of the concepts \ccc{VertexListGraph}, Since we use \ccc{Face_handle} objects as the vertex descriptors, we define the \ccc{Arr_face_index_map} class-template, which maintains an -efficient mapping of face handles to indices. We also provide the template -\ccc{Arr_face_property_map} for associating arbitrary -data with the arrangement faces. +efficient mapping of face handles to indices. +Like vertices, \ccc{boost::vector_property_map} can be +used for associating arbitrary data with the arrangement faces. In the following example we construct the same arrangement as in example \ccc{bgl_primal_adapter.cpp} (see Figure~\ref{arr_fig:ex_bgl}), and perform breadth-first search on the graph faces, starting from the unbounded face. We extend the \dcel\ faces -with an unsigned integer, marking the discover time of the face and use a -breadth-first-search visitor to obtain these times and update the faces -accordingly: +with an unsigned integer, marking the discover time of the face +using \boost\ visitors and a property-map class that directly accesses +the extended data of the faces: \ccIncludeExampleCode{Arrangement_on_surface_2/bgl_dual_adapter.cpp} diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_queries.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_queries.tex index 43eb24bcf5b..39a6839a65d 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_queries.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_queries.tex @@ -236,7 +236,7 @@ can be found in \ccc{point_location_utils.h}). It then employs the naive and the landmark strategies to issue several point-location queries on this arrangement: -\ccIncludeExampleCode{Arrangement_on_surface_2/point_location.cpp} +\ccIncludeExampleCode{Arrangement_on_surface_2/point_location_example.cpp} Note that the program uses the auxiliary \ccc{point_location_query()} function template to nicely print the @@ -316,7 +316,7 @@ void vertical_ray_shooting_query The following program uses the auxiliary function listed above to perform vertical ray-shooting queries on an arrangement. The arrangement and the query points are exactly the same as in -\ccc{point_location.cpp} (see Figure~\ref{arr_fig:ex_5}): +\ccc{point_location_example.cpp} (see Figure~\ref{arr_fig:ex_5}): \ccIncludeExampleCode{Arrangement_on_surface_2/vertical_ray_shooting.cpp} @@ -360,6 +360,6 @@ additional data structures. The following program issues a batched point-location query, which is essentially equivalent to the six separate queries performed in -\ccc{point_location.cpp} (see Section~\ref{arr_ssec:pl}): +\ccc{point_location_example.cpp} (see Section~\ref{arr_ssec:pl}): \ccIncludeExampleCode{Arrangement_on_surface_2/batched_point_location.cpp} diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_face_index_map.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_face_index_map.tex new file mode 100644 index 00000000000..22ea4a6ea9f --- /dev/null +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_face_index_map.tex @@ -0,0 +1,79 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Arr_face_index_map.tex +% +------------------------------------------------------------------------+ +% | +% | Package: Arrangement_2 +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +\begin{ccRefClass}{Arr_face_index_map} +\label{arr_ref:arr_face_index_map} + +\ccDefinition +%============ + +\ccClassTemplateName{} maintains a mapping of face handles of an +attached arrangement object to indices (of type \ccc{unsigned int}). +This class template is a model of the \boost{} concept +\ccc{ReadablePropertyMap}. A mapping between face handles and indices +enables convenient usage of property-map classes supplied by \boost{}. +For example, the property-map class templates +\ccc{boost::vector_property_map}, which is based on \ccc{std::vector}, +and \ccc{boost::iterator_property_map}, which can be used to implement +a property map based on a native C\hbox{\tt ++} array, require the +user to supply a mapping such as \ccClassTemplateName{}. + +As new faces might be inserted into the attached arrangement, and +existing faces might be removed, the notification mechanism is used +to dynamically maintain the mapping of face handles to indices. + +\ccRefines{DefaultConstructible, CopyConstructible, Assignable} + +\ccIsModel + \ccc{boost::ReadablePropertyMap} + +\ccInheritsFrom\ccc{Arr_observer} + +\ccInclude{CGAL/Arr_face_index_map.h} + +\ccTypes +%======= + +\ccNestedType{Arrangement_2}{the type of the attached arrangement.} + +\ccNestedType{category}{\ccc{boost::readable_property_map_tag}} +\ccGlue +\ccNestedType{value_type}{\ccc{unsigned int}} +\ccGlue +\ccNestedType{reference}{u\ccc{nsigned int}} +\ccGlue +\ccNestedType{key_type}{\ccc{Face_handle}} + +\ccTypedef{typedef typename Arrangement_2::Face_handle Face_handle;} + {The face handle type.} + +\ccTypedef{typedef Unique_hash_map Index_map;} + {The type of mapping of faces to indices.} + +\ccCreation +\ccCreationVariable{face_index_map} +%=================================== + +\ccConstructor{Arr_face_index_map();} + {constructs a map that is unattached to any arrangement instance.} + +\ccConstructor{Arr_face_index_map(Arrangement_2& arr);} + {constructs a map and attaches it to the given arrangement \ccc{arr}.} + +\ccSeeAlso +%========= + \ccc{Arr_observer}\lcTex{ + (\ccRefPage{Arr_observer})}\\ + \ccc{Arr_vertex_index_map}\lcTex{ + (\ccRefPage{Arr_vertex_index_map})} + +\end{ccRefClass} + +\ccRefPageEnd diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_linear_traits.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_linear_traits.tex index 95b1affac40..b7a0713a028 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_linear_traits.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_linear_traits.tex @@ -13,15 +13,17 @@ \ccDefinition %============ -The traits class \ccRefName\ is a model of the \ccc{ArrangementTraits_2} -concept that allows for the construction and maintenance of arrangements of -linear objects which may be bounded (line segments) or unbounded (rays -and lines). The traits class is parameterized with a \cgal-kernel model; -see the reference page of \ccc{Arr_segment_traits_2} +The traits class \ccRefName{} is a model of the \ccc{ArrangementTraits_2} +concept, which enables the construction and maintenance of arrangements of +linear objects. The linear objects may be bounded (line segments) or +unbounded (rays and lines). Thus, it is also a model of the concept +\ccc{ArrangementOpenBoundaryTraits_2}. The traits class is parameterized +with a \cgal-kernel model; see the reference page of +\ccc{Arr_segment_traits_2} (\ccRefPage{CGAL::Arr_segment_traits_2}) for further explanations and recommendations on choosing a kernel. -\ccRefName\ defines \ccc{Kernel::Point_2} as its point type. The nested +\ccRefName{} defines \ccc{Kernel::Point_2} as its point type. The nested \ccc{X_monotone_curve_2} and \ccc{Curve_2} types defined by the traits class (as is the case with the various segment-traits classes, both types refer to the same class, as {\sl every} linear object is (weakly) $x$-monotone), @@ -35,8 +37,9 @@ it to the respective kernel object (say, to a \ccc{Kernel::Ray_2}). \ccIsModel \ccc{ArrangementTraits_2} \\ - \ccc{ArrangementLandmarkTraits_2} - + \ccc{ArrangementLandmarkTraits_2} \\ + \ccc{ArrangementOpenBoundaryTraits_2} + \subsection*{Class Arr\_linear\_traits\_2$<$Kernel$>$::Curve\_2} %==================================================== diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_rational_function_traits.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_rational_function_traits.tex index dba629449fd..6ed48bee00c 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_rational_function_traits.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_rational_function_traits.tex @@ -14,10 +14,12 @@ %============ The traits class \ccRefName{} is a model of the \ccc{ArrangementTraits_2} -concept. It handles bounded and unbounded arcs of rational functions, -referred to as {\sl rational arcs} (in particular, such an arc may -correspond to the entire graph of a rational function), and enables the -construction and maintenance of arrangements of such arcs. +concept. It handles arcs of rational functions, referred to as +{\sl rational arcs} (in particular, such an arc may correspond to the +entire graph of a rational function). It supports bounded and +unbounded arcs. Thus, it is also a model of the concept +\ccc{ArrangementOpenBoundaryTraits_2}. The traits class enables +the construction and maintenance of arrangements of such arcs. %Rational functions, and polynomial functions in particular, are not only %interesting in their own right, they are also very useful for approximating or %interpolating more complex curves. diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_vertex_index_map.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_vertex_index_map.tex new file mode 100644 index 00000000000..0a003a87dab --- /dev/null +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_vertex_index_map.tex @@ -0,0 +1,79 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Arr_vertex_index_map.tex +% +------------------------------------------------------------------------+ +% | +% | Package: Arrangement_2 +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +\begin{ccRefClass}{Arr_vertex_index_map} +\label{arr_ref:arr_vertex_index_map} + +\ccDefinition +%============ + +\ccClassTemplateName{} maintains a mapping of vertex handles of an +attached arrangement object to indices (of type \ccc{unsigned int}). +This class template is a model of the \boost{} concept +\ccc{ReadablePropertyMap}. A mapping between vertex handles and indices +enables convenient usage of property-map classes supplied by \boost{}. +For example, the property-map class templates +\ccc{boost::vector_property_map}, which is based on \ccc{std::vector}, +and \ccc{boost::iterator_property_map}, which can be used to implement +a property map based on a native C\hbox{\tt ++} array, require the +user to supply a mapping such as \ccClassTemplateName{}. + +As new vertices might be inserted into the attached arrangement, and +existing vertices might be removed, the notification mechanism is used +to dynamically maintain the mapping of vertex handles to indices. + +\ccRefines{DefaultConstructible, CopyConstructible, Assignable} + +\ccIsModel + \ccc{boost::ReadablePropertyMap} + +\ccInheritsFrom\ccc{Arr_observer} + +\ccInclude{CGAL/Arr_vertex_index_map.h} + +\ccTypes +%======= + +\ccNestedType{Arrangement_2}{the type of the attached arrangement.} + +\ccNestedType{category}{\ccc{boost::readable_property_map_tag}} +\ccGlue +\ccNestedType{value_type}{\ccc{unsigned int}} +\ccGlue +\ccNestedType{reference}{\ccc{unsigned int}} +\ccGlue +\ccNestedType{key_type}{V\ccc{ertex_handle}} + +\ccTypedef{typedef typename Arrangement_2::Vertex_handle Vertex_handle;} + {The vertex handle type.} + +\ccTypedef{typedef Unique_hash_map Index_map;} + {The type of mapping of vertices to indices.} + +\ccCreation +\ccCreationVariable{vertex_index_map} +%=================================== + +\ccConstructor{Arr_vertex_index_map();} + {constructs a map that is unattached to any arrangement instance.} + +\ccConstructor{Arr_vertex_index_map(Arrangement_2& arr);} + {constructs a map and attaches it to the given arrangement \ccc{arr}.} + +\ccSeeAlso +%========= +\ccc{Arr_observer}\lcTex{ + (\ccRefPage{Arr_observer})}\\ +\ccc{Arr_face_index_map}\lcTex{ + (\ccRefPage{Arr_face_index_map})} + +\end{ccRefClass} + +\ccRefPageEnd diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/intro.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/intro.tex index fbdfe854b97..08a9561ba1c 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/intro.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/intro.tex @@ -130,7 +130,10 @@ implemented as peripheral classes or as free (global) functions. \ccRefIdfierPage{CGAL::Arr_naive_point_location}\\ \ccRefIdfierPage{CGAL::Arr_walk_along_line_point_location}\\ \ccRefIdfierPage{CGAL::Arr_trapezoid_ric_point_location}\\ -\ccRefIdfierPage{CGAL::Arr_landmarks_point_location} +\ccRefIdfierPage{CGAL::Arr_landmarks_point_location}\\ +~\\ +\ccRefIdfierPage{CGAL::Arr_vertex_index_map}\\ +\ccRefIdfierPage{CGAL::Arr_face_index_map} \subsection*{Tags} diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/main.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/main.tex index 5b46db53339..4a8657ef268 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/main.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/main.tex @@ -85,4 +85,6 @@ \input{Arrangement_on_surface_2_ref/Arr_with_hist_text_formatter.tex} \input{Arrangement_on_surface_2_ref/Arr_oblivious_side_tag.tex} \input{Arrangement_on_surface_2_ref/Arr_open_side_tag.tex} +\input{Arrangement_on_surface_2_ref/Arr_vertex_index_map.tex} +\input{Arrangement_on_surface_2_ref/Arr_face_index_map.tex} \endgroup diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp index b08bb6aeb00..63dff41194e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp @@ -6,89 +6,79 @@ #include #include #include - -#include -#include - #include #include +#include +#include +#include + #include "arr_print.h" -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arr_face_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Arrangement_2; -typedef CGAL::Dual Dual_arrangement_2; - -// A BFS visitor class that associates each vertex with its discover time. -// In our case graph vertices represent arrangement faces. -template -class Discover_time_bfs_visitor : public boost::default_bfs_visitor -{ -private: - - const IndexMap *index_map; // Mapping vertices to indices. - unsigned int time; // The current time stamp. - +// A property map that reads/writes the information to/from the extended +// face. +template class Extended_face_property_map { public: + typedef typename Arrangement::Face_handle Face_handle; - // Constructor. - Discover_time_bfs_visitor (const IndexMap& imap) : - index_map (&imap), - time (0) - {} + // Boost property type definitions. + typedef boost::read_write_property_map_tag category; + typedef Type value_type; + typedef value_type& reference; + typedef Face_handle key_type; - // Write the discover time for a given vertex. - template - void discover_vertex(Vertex u, const Graph& /* g */) - { - u->set_data (time); - time++; - } + // The get function is required by the property map concept. + friend reference get(const Extended_face_property_map& map, key_type key) + { return key->data(); } + + // The put function is required by the property map concept. + friend void put(const Extended_face_property_map& map, + key_type key, value_type val) + { key->set_data(val); } }; -int main () +typedef CGAL::Cartesian Kernel; +typedef CGAL::Arr_segment_traits_2 Traits_2; +typedef CGAL::Arr_face_extended_dcel Dcel; +typedef CGAL::Arrangement_2 Ex_arrangement; +typedef CGAL::Dual Dual_arrangement; +typedef CGAL::Arr_face_index_map Face_index_map; +typedef Extended_face_property_map + Face_property_map; +typedef Kernel::Point_2 Point_2; +typedef Kernel::Segment_2 Segment_2; + +int main() { - Arrangement_2 arr; - // Construct an arrangement of seven intersecting line segments. - insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (7, 1))); - insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7))); - insert (arr, Segment_2 (Point_2 (1, 4), Point_2 (7, 1))); - insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (9, 3))); - insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (4, 4))); - insert (arr, Segment_2 (Point_2 (7, 1), Point_2 (9, 3))); - insert (arr, Segment_2 (Point_2 (3, 7), Point_2 (9, 3))); + Point_2 p1(1, 1), p2(1, 4), p3(2, 2), p4(3, 7), p5(4, 4), p6(7, 1), p7(9, 3); + Ex_arrangement arr; + insert(arr, Segment_2(p1, p6)); + insert(arr, Segment_2(p1, p4)); insert(arr, Segment_2(p2, p6)); + insert(arr, Segment_2(p3, p7)); insert(arr, Segment_2(p3, p5)); + insert(arr, Segment_2(p6, p7)); insert(arr, Segment_2(p4, p7)); // Create a mapping of the arrangement faces to indices. - CGAL::Arr_face_index_map index_map (arr); - - // Perform breadth-first search from the unbounded face, and use the BFS + Face_index_map index_map(arr); + + // Perform breadth-first search from the unbounded face, using the event // visitor to associate each arrangement face with its discover time. - Discover_time_bfs_visitor > - bfs_visitor (index_map); - Arrangement_2::Face_handle uf = arr.unbounded_face(); - - boost::breadth_first_search (Dual_arrangement_2 (arr), uf, - boost::vertex_index_map (index_map). - visitor (bfs_visitor)); - - // Print the results: - Arrangement_2::Face_iterator fit; + unsigned int time = 0; + boost::breadth_first_search(Dual_arrangement(arr), arr.unbounded_face(), + boost::vertex_index_map(index_map).visitor + (boost::make_bfs_visitor + (stamp_times(Face_property_map(), time, + boost::on_discover_vertex())))); + // Print the discover time of each arrangement face. + Ex_arrangement::Face_iterator fit; for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) { std::cout << "Discover time " << fit->data() << " for "; - if (fit != uf) { + if (fit != arr.unbounded_face()) { std::cout << "face "; - print_ccb (fit->outer_ccb()); + print_ccb(fit->outer_ccb()); } - else - std::cout << "the unbounded face." << std::endl; + else std::cout << "the unbounded face." << std::endl; } - return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp index 5480f252b5b..86f064c8657 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp @@ -11,6 +11,12 @@ #include #include +#if BOOST_VERSION > 104000 +#include +#else +#include +#endif + typedef CGAL::Cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Traits_2; typedef Traits_2::Point_2 Point_2; @@ -123,7 +129,8 @@ int main() // Perform Dijkstra's algorithm from the vertex v0. Edge_length_func edge_length; - CGAL::Arr_vertex_property_map dist_map(index_map); + + boost::vector_property_map > dist_map(arr.number_of_vertices(), index_map); boost::dijkstra_shortest_paths(arr, v0, boost::vertex_index_map(index_map). weight_map(edge_length). diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_example.cpp similarity index 100% rename from Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp rename to Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_example.cpp diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h index f8323f8ee5e..89326e7d3af 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_face_index_map.h @@ -275,107 +275,6 @@ unsigned int get (const CGAL::Arr_face_index_map& index_map, return (index_map[f]); } -/*! \class - * An auxiliary class that automatically maintains a mapping of the - * arrangement faces to some property of a given type. - */ -template -class Arr_face_property_map -{ -public: - - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Face_handle Face_handle; - typedef Arr_face_index_map Index_map; - - // Boost property type definitions: - typedef boost::read_write_property_map_tag category; - typedef Type_ value_type; - typedef value_type& reference; - typedef Face_handle key_type; - -private: - - typedef Arr_face_property_map Self; - - // Data members: - const Index_map *ind_map; // The index map. - value_type *props; // The properties vector. - bool owner; // Should the vector be freed. - - /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); - -public: - - /*! Constructor. */ - Arr_face_property_map (const Index_map& index_map) : - ind_map (&index_map), - owner (true) - { - props = new value_type [index_map.arrangement()->number_of_faces()]; - } - - /*! Copy constructor - performs shallow copy. */ - Arr_face_property_map (const Self& map) : - ind_map (map.ind_map), - props (map.props), - owner (false) - {} - - /*! Destructor. */ - ~Arr_face_property_map () - { - if (owner) - delete[] props; - } - - /*! Get the property associated with a face (const version). */ - const value_type& operator[] (Face_handle f) const - { - return (props [(*ind_map)[f]]); - } - - /*! Get the property associated with a face (non-const version). */ - value_type& operator[] (Face_handle f) - { - return (props [(*ind_map)[f]]); - } - -}; - -/*! - * Get the index property-map function. Provided so that boost is able to - * access the Arr_face_property_map above. - * \param prop_map The property map. - * \param f A face handle. - * \return The face propery. - */ -template -const typename CGAL::Arr_face_property_map::value_type& -get (const CGAL::Arr_face_property_map& prop_map, - typename Arrangement::Face_handle f) -{ - return (prop_map[f]); -} - -/*! - * Put the index property-map function. Provided so that boost is able to - * update the Arr_face_property_map above. - * \param prop_map The property map. - * \param f A face handle. - * \param t The face propery. - */ -template -void put (CGAL::Arr_face_property_map& prop_map, - typename Arrangement::Face_handle f, - typename CGAL::Arr_face_property_map:: - value_type t) -{ - prop_map[f] = t; - return; -} - } //namespace CGAL #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h index e5641f230d7..d9f12b19000 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_index_map.h @@ -280,106 +280,6 @@ unsigned int get (const CGAL::Arr_vertex_index_map& index_map, return index_map[v]; } -/*! \class - * An auxiliary class that automatically maintains a mapping of the - * arrangement vertices to some property of a given type. - */ -template -class Arr_vertex_property_map -{ -public: - - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Vertex_handle Vertex_handle; - typedef Arr_vertex_index_map Index_map; - - // Boost property type definitions: - typedef boost::read_write_property_map_tag category; - typedef Type_ value_type; - typedef value_type& reference; - typedef Vertex_handle key_type; - -private: - - typedef Arr_vertex_property_map Self; - - // Data members: - const Index_map *ind_map; // The index map. - value_type *props; // The properties vector. - bool owner; // Should the vector be freed. - - /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); - -public: - - /*! Constructor. */ - Arr_vertex_property_map (const Index_map& index_map) : - ind_map (&index_map), - owner (true) - { - props = new value_type [index_map.arrangement()->number_of_vertices()]; - } - - /*! Copy constructor - performs shallow copy. */ - Arr_vertex_property_map (const Self& map) : - ind_map (map.ind_map), - props (map.props), - owner (false) - {} - - /*! Destructor. */ - ~Arr_vertex_property_map () - { - if (owner) - delete[] props; - } - - /*! Get the property associated with a vertex (const version). */ - const value_type& operator[] (Vertex_handle v) const - { - return props[(*ind_map)[v]]; - } - - /*! Get the property associated with a vertex (non-const version). */ - value_type& operator[] (Vertex_handle v) - { - return props[(*ind_map)[v]]; - } - -}; - -/*! - * Get the index property-map function. Provided so that boost is able to - * access the Arr_vertex_property_map above. - * \param prop_map The property map. - * \param v A vertex handle. - * \return The vertex propery. - */ -template -const typename CGAL::Arr_vertex_property_map::value_type& -get (const CGAL::Arr_vertex_property_map& prop_map, - typename Arrangement::Vertex_handle v) -{ - return prop_map[v]; -} - -/*! - * Put the index property-map function. Provided so that boost is able to - * update the Arr_vertex_property_map above. - * \param prop_map The property map. - * \param v A vertex handle. - * \param t The vertex propery. - */ -template -void put (CGAL::Arr_vertex_property_map& prop_map, - typename Arrangement::Vertex_handle v, - typename CGAL::Arr_vertex_property_map:: - value_type t) -{ - prop_map[v] = t; -} - } //namespace CGAL #endif diff --git a/BGL/examples/BGL_arrangement_2/dual.cpp b/BGL/examples/BGL_arrangement_2/dual.cpp index dbd473bbfe8..63dff41194e 100644 --- a/BGL/examples/BGL_arrangement_2/dual.cpp +++ b/BGL/examples/BGL_arrangement_2/dual.cpp @@ -1,3 +1,4 @@ +//! \file examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp // Adapting the dual of an arrangement to a BGL graph. #include "arr_rational_nt.h" @@ -5,91 +6,79 @@ #include #include #include - -#include -#include - #include #include +#include +#include +#include + #include "arr_print.h" -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arr_face_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Arrangement_2; -typedef CGAL::Dual Dual_arrangement_2; - -// A BFS visitor class that associates each vertex with its discover time. -// In our case graph vertices represent arrangement faces. -template -class Discover_time_bfs_visitor : public boost::default_bfs_visitor -{ -private: - - const IndexMap *index_map; // Mapping vertices to indices. - unsigned int time; // The current time stamp. - +// A property map that reads/writes the information to/from the extended +// face. +template class Extended_face_property_map { public: + typedef typename Arrangement::Face_handle Face_handle; - // Constructor. - Discover_time_bfs_visitor (const IndexMap& imap) : - index_map (&imap), - time (0) - {} + // Boost property type definitions. + typedef boost::read_write_property_map_tag category; + typedef Type value_type; + typedef value_type& reference; + typedef Face_handle key_type; - // Write the discover time for a given vertex. - template - void discover_vertex (Vertex u, const Graph& ) - { - u->set_data (time); - time++; - } + // The get function is required by the property map concept. + friend reference get(const Extended_face_property_map& map, key_type key) + { return key->data(); } + + // The put function is required by the property map concept. + friend void put(const Extended_face_property_map& map, + key_type key, value_type val) + { key->set_data(val); } }; -int main () -{ - Arrangement_2 arr; +typedef CGAL::Cartesian Kernel; +typedef CGAL::Arr_segment_traits_2 Traits_2; +typedef CGAL::Arr_face_extended_dcel Dcel; +typedef CGAL::Arrangement_2 Ex_arrangement; +typedef CGAL::Dual Dual_arrangement; +typedef CGAL::Arr_face_index_map Face_index_map; +typedef Extended_face_property_map + Face_property_map; +typedef Kernel::Point_2 Point_2; +typedef Kernel::Segment_2 Segment_2; +int main() +{ // Construct an arrangement of seven intersecting line segments. - insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (7, 1))); - insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7))); - insert (arr, Segment_2 (Point_2 (1, 4), Point_2 (7, 1))); - insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (9, 3))); - insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (4, 4))); - insert (arr, Segment_2 (Point_2 (7, 1), Point_2 (9, 3))); - insert (arr, Segment_2 (Point_2 (3, 7), Point_2 (9, 3))); + Point_2 p1(1, 1), p2(1, 4), p3(2, 2), p4(3, 7), p5(4, 4), p6(7, 1), p7(9, 3); + Ex_arrangement arr; + insert(arr, Segment_2(p1, p6)); + insert(arr, Segment_2(p1, p4)); insert(arr, Segment_2(p2, p6)); + insert(arr, Segment_2(p3, p7)); insert(arr, Segment_2(p3, p5)); + insert(arr, Segment_2(p6, p7)); insert(arr, Segment_2(p4, p7)); // Create a mapping of the arrangement faces to indices. - CGAL::Arr_face_index_map index_map (arr); + Face_index_map index_map(arr); - // Perform breadth-first search from the unbounded face, and use the BFS + // Perform breadth-first search from the unbounded face, using the event // visitor to associate each arrangement face with its discover time. - Discover_time_bfs_visitor > - bfs_visitor (index_map); - Arrangement_2::Face_handle uf = arr.unbounded_face(); + unsigned int time = 0; + boost::breadth_first_search(Dual_arrangement(arr), arr.unbounded_face(), + boost::vertex_index_map(index_map).visitor + (boost::make_bfs_visitor + (stamp_times(Face_property_map(), time, + boost::on_discover_vertex())))); - boost::breadth_first_search (Dual_arrangement_2 (arr), uf, - boost::vertex_index_map (index_map). - visitor (bfs_visitor)); - - // Print the results: - Arrangement_2::Face_iterator fit; - - for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) - { + // Print the discover time of each arrangement face. + Ex_arrangement::Face_iterator fit; + for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) { std::cout << "Discover time " << fit->data() << " for "; - if (fit != uf) - { + if (fit != arr.unbounded_face()) { std::cout << "face "; - print_ccb (fit->outer_ccb()); + print_ccb(fit->outer_ccb()); } - else - std::cout << "the unbounded face." << std::endl; + else std::cout << "the unbounded face." << std::endl; } - - return (0); + return 0; } diff --git a/BGL/examples/BGL_arrangement_2/primal.cpp b/BGL/examples/BGL_arrangement_2/primal.cpp index 74aa9cfeb67..86f064c8657 100644 --- a/BGL/examples/BGL_arrangement_2/primal.cpp +++ b/BGL/examples/BGL_arrangement_2/primal.cpp @@ -1,15 +1,21 @@ +//! \file examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp // Adapting an arrangement to a BGL graph. #include "arr_rational_nt.h" #include #include #include +#include +#include #include #include -#include -#include +#if BOOST_VERSION > 104000 +#include +#else +#include +#endif typedef CGAL::Cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Traits_2; @@ -28,7 +34,7 @@ public: typedef value_type reference; typedef Arrangement_2::Halfedge_handle key_type; - double operator() (Arrangement_2::Halfedge_handle e) const + double operator()(Arrangement_2::Halfedge_handle e) const { const double x1 = CGAL::to_double (e->source()->point().x()); const double y1 = CGAL::to_double (e->source()->point().y()); @@ -37,13 +43,13 @@ public: const double diff_x = x2 - x1; const double diff_y = y2 - y1; - return (std::sqrt (diff_x*diff_x + diff_y*diff_y)); + return std::sqrt(diff_x*diff_x + diff_y*diff_y); } }; -double get (Edge_length_func edge_length, Arrangement_2::Halfedge_handle e) +double get(Edge_length_func edge_length, Arrangement_2::Halfedge_handle e) { - return (edge_length (e)); + return edge_length(e); } /* The folowing is a workaround for a bug in the BGL upto and including version @@ -63,6 +69,7 @@ double get (Edge_length_func edge_length, Arrangement_2::Halfedge_handle e) * boost namespace, and is a simple derivation of the 1st parameter of the * CGAL::get() function. */ + namespace boost { template @@ -98,15 +105,15 @@ get(const boost::Arr_vertex_index_map_boost & index_map, } } - -int main () + +int main() { Arrangement_2 arr; - + // Construct an arrangement of seven intersecting line segments. // We keep a handle for the vertex v_0 that corresponds to the point (1,1). Arrangement_2::Halfedge_handle e = - insert_non_intersecting_curve (arr, Segment_2 (Point_2 (1, 1), + insert_non_intersecting_curve (arr, Segment_2 (Point_2 (1, 1), Point_2 (7, 1))); Arrangement_2::Vertex_handle v0 = e->source(); insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7))); @@ -119,27 +126,24 @@ int main () // Create a mapping of the arrangement vertices to indices. CGAL::Arr_vertex_index_map index_map_tmp(arr); boost::Arr_vertex_index_map_boost index_map(index_map_tmp); - + // Perform Dijkstra's algorithm from the vertex v0. - Edge_length_func edge_length; - CGAL::Arr_vertex_property_map dist_map (index_map); - - boost::dijkstra_shortest_paths (arr, v0, - boost::vertex_index_map (index_map). - weight_map (edge_length). - distance_map (dist_map)); - + Edge_length_func edge_length; + + boost::vector_property_map > dist_map(arr.number_of_vertices(), index_map); + boost::dijkstra_shortest_paths(arr, v0, + boost::vertex_index_map(index_map). + weight_map(edge_length). + distance_map(dist_map)); + // Print the results: Arrangement_2::Vertex_iterator vit; std::cout << "The distances of the arrangement vertices from (" << v0->point() << ") :" << std::endl; for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) - { std::cout << "(" << vit->point() << ") at distance " << dist_map[vit] << std::endl; - } - return (0); + return 0; } diff --git a/BGL/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h b/BGL/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h index 4fd8a41f53e..0945d88b309 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h @@ -337,6 +337,15 @@ namespace boost { typedef typename map_gen::const_type const_type; }; + // see struct property_map in Polyehdron for an explanation + template + struct property_map, Tag> { + typedef typename + DT2_property_map::template bind_ map_gen; + typedef typename map_gen::type type; + typedef typename map_gen::const_type const_type; + }; + template inline typename boost::property_traits< diff --git a/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h b/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h index 9443772bb43..b6674a82dc3 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_Triangulation_2.h @@ -488,6 +488,15 @@ namespace boost { typedef typename map_gen::const_type const_type; }; + // see struct property_map in Polyehdron for an explanation + template + struct property_map, Tag> { + typedef typename + T2_property_map::template bind_ map_gen; + typedef typename map_gen::type type; + typedef typename map_gen::const_type const_type; + }; + template inline typename boost::property_traits< diff --git a/BGL/include/CGAL/boost/graph/named_function_params.h b/BGL/include/CGAL/boost/graph/named_function_params.h index f1baca36367..c8df45cdcb3 100644 --- a/BGL/include/CGAL/boost/graph/named_function_params.h +++ b/BGL/include/CGAL/boost/graph/named_function_params.h @@ -50,7 +50,16 @@ #include #include #include +#include +#include +// An explanation about the version hackery below: There is no real +// API to introduce custom properties to the Graph API and the +// internals have changed with Boost Version 1.51 and changes aren't +// backward compatible. To work around that we carry around two +// versions of cgal_bgl_named_params. One imitates the pre 1.51 +// bgl_named_params, the newer one hooks into the API through +// inheritance and addition of the some partial specializations. namespace CGAL { enum vertex_is_fixed_t { vertex_is_fixed } ; @@ -60,6 +69,105 @@ namespace CGAL { enum get_placement_policy_t { get_placement_policy } ; enum get_placement_policy_params_t { get_placement_policy_params } ; +#if BOOST_VERSION >= 105100 + template + struct cgal_bgl_named_params : boost::bgl_named_params + { + typedef boost::bgl_named_params base; + typedef cgal_bgl_named_params self; + + cgal_bgl_named_params(T v = T()) : base(v) {} + cgal_bgl_named_params(T v, const Base& b) : base(v, b) {} + + template + cgal_bgl_named_params + vertex_index_map(const IndexMap& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + vertex_point_map(const PointMap& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + vertex_is_fixed_map(const IsFixedMap& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + edge_index_map(const IndexMap& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + edge_is_border_map(const IsBorderMap& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + visitor(const Visitor& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + set_cache(const SetCache& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + get_cost(const GetCost& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + get_cost_params(const GetCostParams& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + get_placement(const GetPlacement& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + + template + cgal_bgl_named_params + get_placement_params(const GetPlacementParams& p) const + { + typedef cgal_bgl_named_params Params; + return Params(p, *this); + } + }; +#else template struct cgal_bgl_named_params : public Base { @@ -164,6 +272,20 @@ namespace CGAL { } }; + template + inline + typename boost::property_value< cgal_bgl_named_params, Tag2>::type + get_param(const cgal_bgl_named_params& p, Tag2 tag2) + { + enum { match = boost::detail::same_property::value }; + typedef typename + boost::property_value< cgal_bgl_named_params, Tag2>::type T2; + T2* t2 = 0; + typedef boost::detail::property_value_dispatch Dispatcher; + return Dispatcher::const_get_value(p, t2, tag2); + } +#endif + template cgal_bgl_named_params vertex_index_map(IndexMap const& p) @@ -251,21 +373,28 @@ namespace CGAL { typedef cgal_bgl_named_params Params; return Params(p); } - - - template - inline - typename boost::property_value< cgal_bgl_named_params, Tag2>::type - get_param(const cgal_bgl_named_params& p, Tag2 tag2) - { - enum { match = boost::detail::same_property::value }; - typedef typename - boost::property_value< cgal_bgl_named_params, Tag2>::type T2; - T2* t2 = 0; - typedef boost::detail::property_value_dispatch Dispatcher; - return Dispatcher::const_get_value(p, t2, tag2); - } - } //namespace CGAL +#if BOOST_VERSION >= 105100 +// partial specializations hate inheritance and we need to repeat +// those here. this is rather fragile. +namespace boost { +template +struct lookup_named_param_def, Def> { + typedef T type; + static const type& get(const bgl_named_params& p, const Def&) { + return p.m_value; + } +}; + +template +struct lookup_named_param_def, Def> { + typedef typename lookup_named_param_def::type type; + static const type& get(const bgl_named_params& p, const Def& def) { + return lookup_named_param_def::get(p.m_base, def); + } +}; +} // boost +#endif + #endif // CGAL_BOOST_GRAPH_NAMED_FUNCTION_PARAMS_HPP diff --git a/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h b/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h index 9e606e605f1..ad2d0eaeda1 100644 --- a/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h +++ b/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h @@ -377,6 +377,16 @@ struct property_map, Tag> typedef typename map_gen::const_type const_type; }; +// This partial specialization shouldn't be needed but is due to a bug in Boost 1.51. +template +struct property_map, Tag> +{ + typedef typename CGAL::Polyhedron_property_map:: + template bind_ map_gen; + typedef typename map_gen::type type; + typedef typename map_gen::const_type const_type; +}; + template inline typename property_traits,PropertyTag>::type>::reference diff --git a/Box_intersection_d/test/Box_intersection_d/benchmark.cpp b/Box_intersection_d/test/Box_intersection_d/benchmark_box_intersection.cpp similarity index 100% rename from Box_intersection_d/test/Box_intersection_d/benchmark.cpp rename to Box_intersection_d/test/Box_intersection_d/benchmark_box_intersection.cpp diff --git a/Box_intersection_d/test/Box_intersection_d/box_grid.cpp b/Box_intersection_d/test/Box_intersection_d/test_box_grid.cpp similarity index 100% rename from Box_intersection_d/test/Box_intersection_d/box_grid.cpp rename to Box_intersection_d/test/Box_intersection_d/test_box_grid.cpp diff --git a/CGAL_ImageIO/package_info/CGALimageIO/license.txt b/CGAL_ImageIO/package_info/CGAL_ImageIO/license.txt similarity index 100% rename from CGAL_ImageIO/package_info/CGALimageIO/license.txt rename to CGAL_ImageIO/package_info/CGAL_ImageIO/license.txt diff --git a/CGAL_ImageIO/package_info/CGALimageIO/maintainer b/CGAL_ImageIO/package_info/CGAL_ImageIO/maintainer similarity index 100% rename from CGAL_ImageIO/package_info/CGALimageIO/maintainer rename to CGAL_ImageIO/package_info/CGAL_ImageIO/maintainer diff --git a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt index 1b52e8dcec2..7508c18dbb3 100644 --- a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt @@ -21,7 +21,11 @@ if ( CGAL_FOUND ) include( CGAL_CreateSingleSourceCGALProgram ) -create_single_source_cgal_program( "test_trilinear_interpolation.cpp" ) + if (WITH_CGAL_ImageIO) + create_single_source_cgal_program( "test_trilinear_interpolation.cpp" ) + else() + message(STATUS "NOTICE: Some tests require the CGAL_ImageIO library, and will not be compiled.") + endif() else() diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h index deaf48795ae..c4308666270 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h @@ -60,7 +60,8 @@ namespace CGAL{ typedef ipe::Curve IpeSegmentSubPath;//ipe6 compatibility typedef ipe::Matrix IpeMatrix;//ipe6 compatibility typedef ipe::Path IpePath;//ipe6 compatibility - + //indicates if the selection should be primary or secondary. Exactly one primary selection should exist + ipe::TSelect get_selection_type() const { return get_IpePage()->primarySelection()==-1 ? ipe::EPrimarySelected : ipe::ESecondarySelected;} //ipe6 compatibility void transform_selected_objects_(const IpeMatrix& tfm) const { for (int i=0;icount();++i) @@ -82,7 +83,7 @@ namespace CGAL{ //~ grp->push_back( get_IpePage()->object(i-1) ); get_IpePage()->remove(i-1); } - get_IpePage()->append(ipe::ESecondarySelected,CURRENTLAYER,grp); + get_IpePage()->append(get_selection_type(),CURRENTLAYER,grp); } @@ -318,7 +319,7 @@ public: shape.appendSubPath(*it); if (delete_underlying_polygons) delete_selected_objects_(); - get_IpePage()->append(ipe::ESecondarySelected,CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); + get_IpePage()->append(get_selection_type(),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); } void @@ -372,7 +373,7 @@ public: obj_ipe->setPathMode(ipe::EStrokedAndFilled); obj_ipe->setFill(ipe::Attribute::BLACK()); } - get_IpePage()->append( (deselect_all?ipe::ENotSelected:ipe::ESecondarySelected),CURRENTLAYER,obj_ipe); + get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,obj_ipe); return obj_ipe; } return NULL; @@ -386,14 +387,14 @@ public: ); ipe::Shape shape; shape.appendSubPath(ellipse); - get_IpePage()->append( (deselect_all?ipe::ENotSelected:ipe::EPrimarySelected),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); + get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); } void draw_in_ipe(const Point_2& P,bool deselect_all=false) const { ipe::Reference *mark = new ipe::Reference(CURRENTATTRIBUTES,CURRENTATTRIBUTES.iMarkShape, ipe::Vector(CGAL::to_double(P.x()),CGAL::to_double(P.y()))); - get_IpePage()->append( (deselect_all?ipe::ENotSelected:ipe::ESecondarySelected),CURRENTLAYER,mark); + get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,mark); } void @@ -402,7 +403,7 @@ public: ipe::Segment seg_ipe; seg_ipe.iP = ipe::Vector(CGAL::to_double(S.point(0).x()),CGAL::to_double(S.point(0).y())); seg_ipe.iQ = ipe::Vector(CGAL::to_double(S.point(1).x()),CGAL::to_double(S.point(1).y())); - get_IpePage()->append( (deselect_all?ipe::ENotSelected:ipe::ESecondarySelected),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,ipe::Shape(seg_ipe))); + get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,ipe::Shape(seg_ipe))); } template @@ -431,7 +432,7 @@ public: ipeS,ipeT); ipe::Shape shape; shape.appendSubPath(SSP_ipe); - get_IpePage()->append( (deselect_all?ipe::ENotSelected:ipe::ESecondarySelected),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); + get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); } @@ -448,7 +449,7 @@ public: SSP_ipe->setClosed(true); ipe::Shape shape; shape.appendSubPath(SSP_ipe); - get_IpePage()->append( (deselect_all?ipe::ENotSelected:ipe::ESecondarySelected),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); + get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); } void @@ -466,7 +467,7 @@ public: SSP_ipe->setClosed(true); ipe::Shape shape; shape.appendSubPath(SSP_ipe); - get_IpePage()->append( (deselect_all?ipe::ENotSelected:ipe::ESecondarySelected),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); + get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,new ipe::Path(CURRENTATTRIBUTES,shape)); } diff --git a/CMakeLists.txt b/CMakeLists.txt index f8c4637b0b7..c60bbc8ee4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,83 +14,7 @@ endif() option( CGAL_BRANCH_BUILD "Create CGAL from branch" ON) mark_as_advanced( CGAL_BRANCH_BUILD ) -# search for some SCM - -# TODO - -if ( EXISTS ${CMAKE_SOURCE_DIR}/.svn ) - set ( CGAL_SCM_NAME "svn" ) -else () - if ( NOT EXISTS ${CMAKE_SOURCE_DIR}/.git ) - message( ERROR "Neither 'svn' nor 'git' as SCM found" ) - endif() - set ( CGAL_SCM_NAME "git" ) -endif() - -if ( ${CGAL_SCM_NAME} STREQUAL "svn" ) - - find_program(SVN_EXECUTABLE svn DOC "subversion command line client") - - function(Subversion_GET_INFO dir variable) - # use svnversion - execute_process(COMMAND "${SVN_EXECUTABLE}" info --xml - WORKING_DIRECTORY "${dir}" - OUTPUT_VARIABLE ${variable} - OUTPUT_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE svn_error) - if(svn_error) - message("Warning: `svn info --xml \"${dir}\"` returned an error!") - set(${variable} "") - endif() - set(${variable} ${${variable}} PARENT_SCOPE) - endfunction() - - function(Subversion_GET_REVISION dir variable) - Subversion_GET_INFO("${dir}" ${variable}) - string(REGEX REPLACE "^(.*\n)? revision=\"([^\n]+)\".*url.*" "\\2" ${variable} "${${variable}}") - if(NOT variable) - message("Warning: can not get the Subversion revision of directory ${dir}") - endif() - set(${variable} ${${variable}} PARENT_SCOPE) - endfunction(Subversion_GET_REVISION) - - function(Subversion_GET_URL dir variable) - Subversion_GET_INFO("${dir}" ${variable}) - string(REGEX REPLACE ".*([^<]+).*" "\\1" ${variable} "${${variable}}") - if(NOT variable) - message("Warning: can not get the Subversion URL of directory ${dir}") - endif() - set(${variable} ${${variable}} PARENT_SCOPE) - endfunction(Subversion_GET_URL) - - Subversion_GET_URL("${CMAKE_CURRENT_SOURCE_DIR}" CGAL_TMP_SVN_BRANCH_NAME) - # Remove the prefix of the URL "https://scm.gforge.inria.fr/". - string(REGEX REPLACE "[a-z+]+://[a-z0-9.]+" "" CGAL_TMP_SVN_BRANCH_NAME "${CGAL_TMP_SVN_BRANCH_NAME}") - - set ( CGAL_SCM_BRANCH_NAME "${CGAL_TMP_SVN_BRANCH_NAME}" ) -endif() - -if ( ${CGAL_SCM_NAME} STREQUAL "git" ) - - find_program(GIT_EXECUTABLE git DOC "git command line client") - -# EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir=${CMAKE_SOURCE_DIR}/.git branch -# OUTPUT_VARIABLE CGAL_GIT_BRANCH_OUT -# OUTPUT_STRIP_TRAILING_WHITESPACE) -# #foreach (line IN ${CGAL_GIT_BRANCH_OUT}) -# # message (STATUS "Line: ${line}") -# if ( STRING( REGEX MATCH "* " CGAL_GIT_BRANCH_LINE -# ${CGAL_GIT_BRANCH_OUT} ) ) -# string ( REGEX REPLACE "# On branch " "" CGAL_GIT_BRANCH ${CGAL_GIT_BRANCH_LINE}) -# endif() -# #endforeach() - - message( STATUS "Git branch ${CGAL_GIT_BRANCH}") - - # TODO detect name - set ( CGAL_SCM_BRANCH_NAME "n/a" ) - -endif() +include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake) # add option for duplicate file detection option( CGAL_REPORT_DUPLICATE_FILES "Switch on to start (naive) detection of duplicate source- and headerfiles in packages" OFF) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h index d5a25f176b7..4502c872680 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h @@ -26,6 +26,8 @@ #define CGAL_CARTESIAN_AFF_TRANSFORMATION_REP_2_H #include +#include +#include namespace CGAL { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h index a759fd70241..21c900d60ff 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h @@ -25,6 +25,7 @@ #ifndef CGAL_CARTESIAN_AFF_TRANSFORMATION_REP_3_H #define CGAL_CARTESIAN_AFF_TRANSFORMATION_REP_3_H +#include #include namespace CGAL { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h index 698b3b87763..d59e03a7e09 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace CGAL { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h index c5e17c7b3a0..c1831ad95b7 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h index 05f13266216..1f7143b2a15 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h @@ -25,6 +25,8 @@ #ifndef CGAL_CARTESIAN_TRANSLATION_REP_2_H #define CGAL_CARTESIAN_TRANSLATION_REP_2_H +#include + namespace CGAL { template < class R > diff --git a/Cartesian_kernel/include/CGAL/Cartesian/line_constructions_2.h b/Cartesian_kernel/include/CGAL/Cartesian/line_constructions_2.h index 3b3a3451fd7..3109bca1594 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/line_constructions_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/line_constructions_2.h @@ -28,6 +28,8 @@ #include #include +#include + namespace CGAL { template < class K > diff --git a/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h b/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h index a311c2ff745..470ab3803ca 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h @@ -26,6 +26,7 @@ #define CGAL_CARTESIAN_PLANE_CONSTRUCTIONS_3_H #include +#include #include namespace CGAL { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/point_constructions_2.h b/Cartesian_kernel/include/CGAL/Cartesian/point_constructions_2.h index 295c206f23a..0084292a38a 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/point_constructions_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/point_constructions_2.h @@ -26,6 +26,7 @@ #define CGAL_CARTESIAN_POINT_CONSTRUCTIONS_2_H #include +#include namespace CGAL { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_points_3.h b/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_points_3.h index a56f561753d..0adb098a6c3 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_points_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_points_3.h @@ -26,6 +26,7 @@ #define CGAL_CARTESIAN_PREDICATES_ON_POINTS_3_H #include +#include namespace CGAL { diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h index ab3238f2710..e30c68b2022 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h @@ -26,6 +26,7 @@ #define CGAL_CONSTRUCTIONS_KERNEL_FTC2_H #include +#include namespace CGAL { diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h index f1d2af1c552..ae9c0c9edfc 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h @@ -26,6 +26,7 @@ #define CGAL_CONSTRUCTIONS_KERNEL_FTC3_H #include +#include namespace CGAL { diff --git a/Developers_manual/doc_tex/Developers_manual/submission_process.tex b/Developers_manual/doc_tex/Developers_manual/submission_process.tex index 52d3e26bc6e..ca038394b58 100644 --- a/Developers_manual/doc_tex/Developers_manual/submission_process.tex +++ b/Developers_manual/doc_tex/Developers_manual/submission_process.tex @@ -32,8 +32,8 @@ editorial board for approval. The process is described in the and review rules}. % This can be done by sending mail to -% the \ccAnchor{mailto:cgal-editorial-board@lists-sop.inria.fr}{board} -% \lcTex{(\texttt{cgal-editorial-board@lists-sop.inria.fr})} indicating +% the \ccAnchor{mailto:cgal-editorial-board@inria.fr}{board} +% \lcTex{(\texttt{cgal-editorial-board@inria.fr})} indicating % where the (PDF) documentation and code can be found. After % some reasonable amount of time, you should receive feedback from % the board about the specification and what, if anything, needs to diff --git a/Distance_2/include/CGAL/squared_distance_2_1.h b/Distance_2/include/CGAL/squared_distance_2_1.h index 9851623ab28..333ca3cb232 100644 --- a/Distance_2/include/CGAL/squared_distance_2_1.h +++ b/Distance_2/include/CGAL/squared_distance_2_1.h @@ -35,6 +35,7 @@ #include #include #include +#include namespace CGAL { diff --git a/Generator/doc_tex/Generator/generators.tex b/Generator/doc_tex/Generator/generators.tex index 21dbd993bc9..9c3d2aeb0e1 100644 --- a/Generator/doc_tex/Generator/generators.tex +++ b/Generator/doc_tex/Generator/generators.tex @@ -91,6 +91,11 @@ The function \ccc{random_selection} chooses $n$ items at random from a random access iterator range which is useful to produce degenerate input data sets with multiple entries of identical items. +The class \ccc{Combination_enumerator} is used to enumerate +all fixed-size combinations (subsets) of a range of elements. It is useful +in the context of high-dimensional triangulations, e.g., for enumerating the +faces of a simplex. + \section{Example Generating Degenerate Point Sets} We want to generate a test set of 1000 points, where 60\% are chosen @@ -313,6 +318,33 @@ Generating 20 grid points in 4D \end{ccTexOnly} +\section{Example Generating Combinations} + +\paragraph{From a Range of Integers} + +The following example enumerates and outputs all subsets of 3 elements from the +range $[10, 15]$. Accordingly, it outputs $\displaystyle\frac{6!}{3! 3!}=20$ +triples. + +\smallskip +\ccIncludeExampleCode{Generator/combination_enumerator.cpp} + +The output of this example is: +\begin{verbatim} +Taking 3 distinct integers in the range [10, 15]: {10 11 12} {10 11 13} {10 11 14} +{10 11 15} {10 12 13} {10 12 14} {10 12 15} {10 13 14} {10 13 15} {10 14 15} +{11 12 13} {11 12 14} {11 12 15} {11 13 14} {11 13 15} {11 14 15} {12 13 14} +{12 13 15} {12 14 15} {13 14 15} +Enumerated 20 combinations. +\end{verbatim} + +\paragraph{From an Array of Strings} +The following example generates all pairs of names from a set of names stored +in an array of strings. + +\smallskip +\ccIncludeExampleCode{Generator/name_pairs.cpp} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Design and Implementation History} diff --git a/Generator/doc_tex/Generator_ref/CombinationElement.tex b/Generator/doc_tex/Generator_ref/CombinationElement.tex new file mode 100644 index 00000000000..841d3acba0a --- /dev/null +++ b/Generator/doc_tex/Generator_ref/CombinationElement.tex @@ -0,0 +1,44 @@ +\begin{ccRefConcept}{CombinationElement} + +\ccDefinition + +A \ccRefName\ can be used as template parameter for the class +\ccc{Combination_enumerator}. + +\ccCreationVariable{e} + +\ccCreation + +\ccConstructor{CombinationElement(const CombinationElement & e2)}{Copy +constructor.} + +\ccOperations + +\ccMethod{void operator++();}{Incrementation of \ccVar.} + +\ccMethod{void operator--();}{Decrementation of \ccVar.} + +\ccMethod{bool operator<(const CombinationElement & e2);}{Total order comparison.} + +\ccMethod{bool operator==(const CombinationElement & e2);}{Equality test.} + +\ccMethod{CombinationElement operator+(int i);}{% +Equivalent to calling \ccc{++}\ccVar\ ~\ccc{i} times if \ccc{i} is positive. +Equivalent to calling \ccc{--}\ccVar\ ~\ccc{(-i)} times if \ccc{i} is negative.} + +\ccMethod{int operator-(const CombinationElement & e2);}{Compute the difference +\ccc{d} between \ccc{e2} and \ccVar\ so that \ccc{e2+d==e}.} + +\ccHasModels + +Any integer type (\ccc{char}, \ccc{short}, \ccc{int}, \ccc{long}, etc.) + +Pointers + +Random access iterators + +\ccSeeAlso + +\ccc{Combination_enumerator} + +\end{ccRefConcept} diff --git a/Generator/doc_tex/Generator_ref/Combination_enumerator.tex b/Generator/doc_tex/Generator_ref/Combination_enumerator.tex new file mode 100644 index 00000000000..38bb5921357 --- /dev/null +++ b/Generator/doc_tex/Generator_ref/Combination_enumerator.tex @@ -0,0 +1,70 @@ + +\begin{ccRefClass}{Combination_enumerator} + +\ccDefinition +The class \ccRefName\ is used to enumerate all fixed-size combinations +(subsets) of a \emph{source range} of elements. For example, it can +enumerate all the combinations of 2 elements from the source range $[3,7)$ +($7$ excluded) which gives the enumeration \{3,4\}, \{3,5\}, \{3,6\}, \{4,5\}, +\{4,6\}, \{5,6\}. The source range consists of elements of type +\ccc{CombinationElement} and is specified by its first element and the element +just beyond its last one. + +The template parameter should be a model of the concept \ccc{CombinationElement}. + +Each combination is uniquely represented as an increasing sequence of elements. +Thus, the combinations can be lexicographically ordered. They are enumerated in +that order, so that we can talk about the first or last combination. + +%\ccIsModel +%\ccRefConceptPage{ConceptName} + +\ccInclude{CGAL/Combination_enumerator.h} + +\ccCreation + +\ccCreationVariable{c} +\ccConstructor{Combination_enumerator(int k, const CombinationElement & first, +const CombinationElement & beyond);}{This constructor initializes \ccVar\ to +enumerate the combinations of \ccc{k} elements from the source range +\ccc{[first, beyond)}. The current combination is set to the first combination +of the enumeration. \ccPrecond{\ccc{1 <= k <= beyond - first}}} + +\ccConstructor{Combination_enumerator(const Combination_enumerator & combi);}% +{The copy constructor.} + +\ccHeading{Access to the current combination} + +\ccMethod{const CombinationElement & operator[](int i);}{Returns the \ccc{i}-th +element of the current combination. \ccPrecond{\ccc{0 <= i < } +\ccVar.\ccc{number_of_elements()}}} + +\ccHeading{Access to the enumeration} + +\ccMethod{int number_of_elements();}{Returns the size of the enumerated +combinations (the parameter \ccc{k} from the class' constructor).} + +\ccMethod{const CombinationElement & min_element();}{Returns the smallest +element of the source range. (the parameter \ccc{first} of the class' +constructor).} + +\ccMethod{const CombinationElement & beyond_element();}{Returns the successor +to the largest element of the source range (the parameter \ccc{beyond} of +the class' constructor).} + +\ccMethod{bool finished();}{Returns \ccc{true} if and only if all combinations +have been enumerated.} + +\ccOperations + +\ccMethod{void reset();}{Resets the enumerator. The current combination is set +to the first one of the enumeration.} + +\ccMethod{void operator++();}{Moves \ccVar\ to the next combination.} + +\ccMethod{Combination_enumerator operator++(int);}{Post-incrementation. Same as +the pre-incrementation above, but returns the original value of \ccVar.} + +%\ccSeeAlso + +\end{ccRefClass} diff --git a/Generator/doc_tex/Generator_ref/intro.tex b/Generator/doc_tex/Generator_ref/intro.tex index 4a3d0f8b02c..69338507273 100644 --- a/Generator/doc_tex/Generator_ref/intro.tex +++ b/Generator/doc_tex/Generator_ref/intro.tex @@ -20,6 +20,7 @@ to achieve random permutations for otherwise regular generators ( \ccRefConceptPage{PointGenerator} \\ \ccRefConceptPage{RandomConvexSetTraits_2} \\ \ccRefConceptPage{RandomPolygonTraits_2} \\ +\ccRefConceptPage{CombinationElement} \\ \subsection*{Functions} @@ -36,6 +37,7 @@ to achieve random permutations for otherwise regular generators ( \subsection*{Classes} +\ccRefIdfierPage{CGAL::Combination_enumerator} \\ \ccRefIdfierPage{CGAL::Random} \\ \ccRefIdfierPage{CGAL::Points_on_segment_2} \\ \ccRefIdfierPage{CGAL::Random_points_in_ball_d} \\ diff --git a/Generator/doc_tex/Generator_ref/main.tex b/Generator/doc_tex/Generator_ref/main.tex index 30b31b94dd6..d56316f3a82 100644 --- a/Generator/doc_tex/Generator_ref/main.tex +++ b/Generator/doc_tex/Generator_ref/main.tex @@ -19,6 +19,8 @@ \input{Generator_ref/random_convex_set.tex} \input{Generator_ref/random_polygon.tex} \input{Generator_ref/random_selection.tex} +\input{Generator_ref/Combination_enumerator.tex} +\input{Generator_ref/CombinationElement.tex} \input{Generator_ref/Random.tex} \input{Generator_ref/RandomConvexSetTraits_2.tex} \input{Generator_ref/RandomPolygonTraits_2.tex} diff --git a/Generator/examples/Generator/combination_enumerator.cpp b/Generator/examples/Generator/combination_enumerator.cpp new file mode 100644 index 00000000000..4cfe9fb0455 --- /dev/null +++ b/Generator/examples/Generator/combination_enumerator.cpp @@ -0,0 +1,25 @@ +#include "CGAL/Combination_enumerator.h" +#include +using namespace std; +int main() +{ + unsigned int n(0); + const int k(3), first(10), last(15); + cout << "Taking " << k << " distinct integers in the range [" << + first << ", " << last << "]:"; + + CGAL::Combination_enumerator combi(k, first, last + 1); + while( ! combi.finished() ) { + cout << " {"; + for(int i = 0; i < k; ++i) { + cout << combi[i]; + if( i < k - 1 ) + cout << ' '; + } + cout << '}'; + ++n; + ++combi; + } + cout << endl << "Enumerated " << n << " combinations." << endl; + return EXIT_SUCCESS; +} diff --git a/Generator/examples/Generator/name_pairs.cpp b/Generator/examples/Generator/name_pairs.cpp new file mode 100644 index 00000000000..58a743e4426 --- /dev/null +++ b/Generator/examples/Generator/name_pairs.cpp @@ -0,0 +1,20 @@ +#include "CGAL/Combination_enumerator.h" +#include +#include +using namespace std; +int main() +{ + vector names; + names.push_back("Sun"); names.push_back("Shannon"); + names.push_back("Hurley"); names.push_back("Sawyer"); + names.push_back("Kate"); names.push_back("Claire"); + names.push_back("John"); names.push_back("Jack"); + CGAL::Combination_enumerator::iterator> + combi(2, names.begin(), names.end()); + while( ! combi.finished() ) { + cout << " {" << *combi[0] << ' ' << *combi[1] << '}'; + ++combi; + } + cout << endl; + return EXIT_SUCCESS; +} diff --git a/Generator/include/CGAL/Combination_enumerator.h b/Generator/include/CGAL/Combination_enumerator.h new file mode 100644 index 00000000000..302c4fb196d --- /dev/null +++ b/Generator/include/CGAL/Combination_enumerator.h @@ -0,0 +1,138 @@ +// Copyright (c) 2012 +// Inria Nancy - Grand Est +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// 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$ +// $Id$ +// +// Author(s) : Samuel Hornus + +#ifndef CGAL_COMBINATION_ENUMERATOR_H +#define CGAL_COMBINATION_ENUMERATOR_H + +#include +#include + +namespace CGAL { + +template< typename T > +class Combination_enumerator +{ + // types and member data + typedef std::vector Combination; + Combination combi_; + const int k_; + const T first_; + const T beyond_; + const T max_at_pos_0_; + + // protected methods + const T & element(const int i) const + { + CGAL_assertion( 0 <= i && i < k_ ); + return combi_[i]; + } + + T & element(const int i) + { + CGAL_assertion( 0 <= i && i < k_ ); + return combi_[i]; + } + +public: + + // For generating all the combinations of |k| distinct elements in the + // interval [first, beyond] (both included) + Combination_enumerator(const int k, const T & first, const T & beyond) + : combi_(k), k_(k), first_(first), beyond_(beyond), max_at_pos_0_(beyond - k) + { + CGAL_assertion_msg( (1 <= k) && (k <= beyond - first), "wrong value of k"); + reset(); + } + + Combination_enumerator(const Combination_enumerator & c) + : combi_(c.combi_), k_(c.k_), first_(c.first_), beyond_(c.beyond_), max_at_pos_0_(c.max_at_pos_0_) + {} + + int number_of_elements() const + { + return k_; + } + + const T & min_element() const + { + return first_; + } + + const T & beyond_element() const + { + return beyond_; + } + + void reset() + { + T elem(min_element()); + for( int i = 0; i < number_of_elements(); ++i ) + { + element(i) = elem; + ++elem; + } + } + + bool finished() const + { + return max_at_pos_0_ < element(0); + } + + const T & operator[](const int i) const + { + return element(i); + } + + void operator++() + { + int i(k_ - 1); + T max_at_pos_i(beyond_-1); + while( ( i >= 0 ) && ( ! (element(i) < max_at_pos_i) ) ) + { + --i; + --max_at_pos_i; + } + if( -1 == i ) + { + if( element(0) == max_at_pos_0_ ) + ++element(0); // mark then end of the enumeration with an impossible value. + // Note than when we have arrived at the end of the enumeration, applying + // operator++() again does not change anything, so it is safe to + // apply it too many times. + } + else + { + ++element(i); + for( int j = i + 1; j < k_; ++j ) + element(j) = element(i) + (j - i); + } + } + + Combination_enumerator operator++(int) + { + Combination_enumerator tmp(*this); + ++(*this); + return tmp; + } +}; + +} // end of namespace CGAL + +#endif // CGAL_COMBINATION_ENUMERATOR_H diff --git a/Generator/test/Generator/test_combination_enumerator.cpp b/Generator/test/Generator/test_combination_enumerator.cpp new file mode 100644 index 00000000000..72831519525 --- /dev/null +++ b/Generator/test/Generator/test_combination_enumerator.cpp @@ -0,0 +1,54 @@ +#include "CGAL/Combination_enumerator.h" +#include +#include +#include +#include + +using namespace std; + +long fac(long from, long to) +{ + long result(1); + while( from <= to ) + { + result *= from; + ++from; + } + return result; +} + +template< typename T > +void test(const int K, const T & first, const T & beyond) +{ + long n(0); + + CGAL::Combination_enumerator combi(K, first, beyond); + CGAL_assertion( first == combi.min_element() ); + CGAL_assertion( beyond == combi.beyond_element() ); + CGAL_assertion( K == combi.number_of_elements() ); + while( ! combi.finished() ) + { + ++n; + ++combi; + } + long nelem = beyond - first; + long num = fac(nelem - K + 1, nelem) / fac(2, K); + cout << endl << "Enumerated " << n << " combinations. Should be " << num; + CGAL_assertion(n == num); +} + +int main() +{ + srand(time(NULL)); + test(3, 10, 21); // triples in [10,20] + test(1, -10, 21); // singletons in [-10,20] + test(4, 3, 7); // the unique set {3,4,5,6} + char name[] = {'s', 'a', 'm', 'u', 'e', 'l', 0}; + test(2, name+0, name+6); + vector l; + for( int i = 0; i < 10; ++i ) + l.push_back(rand()); + test(3, l.begin(), l.end()); + cout << endl; + return EXIT_SUCCESS; +} diff --git a/GraphicsView/doc_tex/GraphicsView/GraphicsView.tex b/GraphicsView/doc_tex/GraphicsView/GraphicsView.tex index ba65f000090..b4292777f31 100644 --- a/GraphicsView/doc_tex/GraphicsView/GraphicsView.tex +++ b/GraphicsView/doc_tex/GraphicsView/GraphicsView.tex @@ -1,17 +1,17 @@ -\ccAnchor{http://qt.nokia.com/}{Qt} is a {\sc Gui} toolkit for +\ccAnchor{http://qt.digia.com/}{Qt} is a {\sc Gui} toolkit for cross-platform application development. % +-----------------------------------------------------+ \section{Introduction} This chapter describes classes that help to visualize two dimensional \cgal\ objects -with the \ccAnchor{http://doc.qt.nokia.com/latest/graphicsview.html}{Qt Graphics View Framework}. +with the \ccAnchor{http://doc.qt.digia.com/latest/graphicsview.html}{Qt Graphics View Framework}. -This framework uses the model view paradigm. \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsitem.html}{\ccc{QGraphicsItem}}s are stored in a -\ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsscene.html}{\ccc{QGraphicsScene}} -and are displayed in a \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsview.html}{\ccc{QGraphicsView}}. The items +This framework uses the model view paradigm. \ccAnchor{http://doc.qt.digia.com/latest/qgraphicsitem.html}{\ccc{QGraphicsItem}}s are stored in a +\ccAnchor{http://doc.qt.digia.com/latest/qgraphicsscene.html}{\ccc{QGraphicsScene}} +and are displayed in a \ccAnchor{http://doc.qt.digia.com/latest/qgraphicsview.html}{\ccc{QGraphicsView}}. The items have a paint method which is called when an item is in the visible area of a view. The framework is also responsible for dispatching events from the view via the scene to the items. The framework is extensible in the sense @@ -46,14 +46,14 @@ brings them together we adopted the following, hybrid naming conventions. \section{Overall Design} In Figure~\ref{graphicsview:uml} you see four classes depicted in grey, -that come from the Qt Graphics View Framework. The \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsscene.html}{\ccc{QGraphicsScene}} -contains \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsitem.html}{\ccc{QGraphicsItem}}s, which get displayed in any number -of \ccAnchor{http://doc.qt.nokia.com/latest/qgraphicsview.html}{\ccc{QGraphicsView}}s. The views are widgets, that is they take screen space +that come from the Qt Graphics View Framework. The \ccAnchor{http://doc.qt.digia.com/latest/qgraphicsscene.html}{\ccc{QGraphicsScene}} +contains \ccAnchor{http://doc.qt.digia.com/latest/qgraphicsitem.html}{\ccc{QGraphicsItem}}s, which get displayed in any number +of \ccAnchor{http://doc.qt.digia.com/latest/qgraphicsview.html}{\ccc{QGraphicsView}}s. The views are widgets, that is they take screen space in an application. -The fourth class is the \ccAnchor{http://doc.qt.nokia.com/latest/qobject.html}{\ccc{QObject}}. It plays an important role in Qt for -event handling and memory management. First, it allows to add \ccAnchor{http://doc.qt.nokia.com/latest/signalsandslots.html}{signals and -slots}, and to connect them. Second, it allows to install \ccAnchor{http://doc.qt.nokia.com/latest/eventsandfilters.html}{event filters}. +The fourth class is the \ccAnchor{http://doc.qt.digia.com/latest/qobject.html}{\ccc{QObject}}. It plays an important role in Qt for +event handling and memory management. First, it allows to add \ccAnchor{http://doc.qt.digia.com/latest/signalsandslots.html}{signals and +slots}, and to connect them. Second, it allows to install \ccAnchor{http://doc.qt.digia.com/latest/eventsandfilters.html}{event filters}. \begin{figure}[t] diff --git a/GraphicsView/doc_tex/GraphicsView/PkgDescription.tex b/GraphicsView/doc_tex/GraphicsView/PkgDescription.tex index 0da44f0ae44..e342a60453f 100644 --- a/GraphicsView/doc_tex/GraphicsView/PkgDescription.tex +++ b/GraphicsView/doc_tex/GraphicsView/PkgDescription.tex @@ -2,7 +2,7 @@ \begin{ccPkgDescription}{CGAL and the Qt Graphics View Framework \label{Pkg:GraphicsView}} \ccPkgHowToCiteCgal{cgal:fr-cqgvf-12} \ccPkgSummary{This package provides classes for displaying \cgal\ objects -and data structures in the \ccAnchor{http://doc.qt.nokia.com/latest/graphicsview.html}{Qt 4 Graphics View Framework}.} +and data structures in the \ccAnchor{http://doc.qt.digia.com/latest/graphicsview.html}{Qt 4 Graphics View Framework}.} % \ccPkgDependsOn{Qt 4} \ccPkgIntroducedInCGAL{3.4} diff --git a/GraphicsView/doc_tex/GraphicsView_ref/intro.tex b/GraphicsView/doc_tex/GraphicsView_ref/intro.tex index 662ad85fef6..6ec49e18636 100644 --- a/GraphicsView/doc_tex/GraphicsView_ref/intro.tex +++ b/GraphicsView/doc_tex/GraphicsView_ref/intro.tex @@ -6,7 +6,7 @@ This package provides some classes which allow to use \cgal\ classes in -\qt\ applications which make use of the \ccAnchor{http://doc.qt.nokia.com/latest/graphicsview.html}{Qt Graphics View Framework}. +\qt\ applications which make use of the \ccAnchor{http://doc.qt.digia.com/latest/graphicsview.html}{Qt Graphics View Framework}. \section{Classified Reference Pages} diff --git a/GraphicsView/src/CGAL_Qt4/DemosMainWindow.cpp b/GraphicsView/src/CGAL_Qt4/DemosMainWindow.cpp index 0cc364176f1..e8c7baeab43 100644 --- a/GraphicsView/src/CGAL_Qt4/DemosMainWindow.cpp +++ b/GraphicsView/src/CGAL_Qt4/DemosMainWindow.cpp @@ -91,8 +91,10 @@ DemosMainWindow::dragEnterEvent(QDragEnterEvent *event) void DemosMainWindow::dropEvent(QDropEvent *event) { - QString filename = event->mimeData()->urls().at(0).toLocalFile(); - this->open(filename); + Q_FOREACH(QUrl url, event->mimeData()->urls()) { + QString filename = url.toLocalFile(); + this->open(filename); + } event->acceptProposedAction(); } diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h index 117d6eaef3e..252b2ccd81a 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h @@ -27,6 +27,7 @@ #include #include +#include namespace CGAL { diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h index 58ad8d18a9f..25d5589dc7c 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h @@ -27,6 +27,8 @@ #include #include +#include +#include namespace CGAL { diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h index 61909ff49f8..ce4842b0ee1 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH2.h @@ -27,6 +27,8 @@ #include #include +#include +#include namespace CGAL { diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h index 4848bf6631a..e253a47e643 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/DirectionH3.h @@ -25,9 +25,10 @@ #ifndef CGAL_HOMOGENEOUS_DIRECTION_3_H #define CGAL_HOMOGENEOUS_DIRECTION_3_H +#include #include #include - +#include namespace CGAL { template < class R_ > diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h index e9097ed552f..46df6df4119 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Iso_cuboidH3.h @@ -26,6 +26,9 @@ #define CGAL_ISO_CUBOIDH3_H #include +#include +#include +#include namespace CGAL { diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h index 01e5801567d..dc9e9971634 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/LineH2.h @@ -25,6 +25,7 @@ #ifndef CGAL_LINEH2_H #define CGAL_LINEH2_H +#include #include namespace CGAL { diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h index 8dd63794be6..44b191a06f0 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/RayH3.h @@ -26,6 +26,9 @@ #define CGAL_RAYH3_H #include +#include +#include +#include namespace CGAL { diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h index fc9c8342a4e..57f3424e003 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/SphereH3.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace CGAL { diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h index 8fe6c0dfbd2..937b08f5a79 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/basic_constructionsH3.h @@ -26,6 +26,10 @@ #ifndef CGAL_BASIC_CONSTRUCTIONSH3_H #define CGAL_BASIC_CONSTRUCTIONSH3_H +#include +#include + + namespace CGAL { template diff --git a/Inscribed_areas/package_info/Inscribed_areas/license.txt b/Inscribed_areas/package_info/Inscribed_areas/license.txt index 8bb8efcb72b..0d3d7e59728 100644 --- a/Inscribed_areas/package_info/Inscribed_areas/license.txt +++ b/Inscribed_areas/package_info/Inscribed_areas/license.txt @@ -1 +1 @@ -GPL (v3 or later) +GPL (v3 or later) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 35d9a874297..419ed508b27 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -153,21 +153,15 @@ if ( CGAL_BRANCH_BUILD ) set(CGAL_CREATED_VERSION_NR "1${CGAL_TMP_MAJOR}${CGAL_TMP_MINOR}${CGAL_BUGFIX_VERSION}${CGAL_TMP_BUILD}") message(STATUS "CGAL_VERSION_NR is ${CGAL_CREATED_VERSION_NR}") - if ( ${CGAL_SCM_NAME} STREQUAL "svn" ) - - # The function Subversion_GET_REVISION is defined in ../CMakeLists.txt - Subversion_GET_REVISION("${CMAKE_SOURCE_DIR}" CGAL_TMP_REVISION) - set(CGAL_CREATED_SVN_REVISION "${CGAL_TMP_REVISION}") - message(STATUS "CGAL_SVN_REVISION is ${CGAL_TMP_REVISION}") - - endif() - if ( ${CGAL_SCM_NAME} STREQUAL "git" ) ### TODO EBEB GIT_NR? set(CGAL_GIT_HASH "n/a") + set(CGAL_CREATED_SVN_REVISION "99999") message(STATUS "CGAL_GIT_HASH is ${CGAL_GIT_HASH}") + message(STATUS "CGAL_CREATED_SVN_REVISION is ${CGAL_CREATED_SVN_REVISION} (dummy)") + endif() file(REMOVE ${CMAKE_BINARY_DIR}/include/CGAL/version.h) @@ -948,3 +942,65 @@ if( WITH_CPACK AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake" ) endif() + +if ( CGAL_BRANCH_BUILD ) + option(CGAL_ENABLE_CHECK_HEADERS + "Enable the special targets \"check_pkg_headers\", and \"check_pkg__headers\" for each package" + FALSE) + + if(CGAL_ENABLE_CHECK_HEADERS) + + if(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY) + execute_process(COMMAND + ${CMAKE_CXX_COMPILER} -x c++ -fsyntax-only ${CMAKE_CURRENT_SOURCE_DIR}/config/support/test_syntaxonly.cpp + ERROR_QUIET + RESULT_VARIABLE ok) + if(ok EQUAL 0) + set(CGAL_CHECK_SYNTAX_ONLY ON CACHE INTERNAL "") + else() + set(CGAL_CHECK_SYNTAX_ONLY OFF CACHE INTERNAL "") + endif() + endif(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY) + + if(NOT CGAL_CHECK_SYNTAX_ONLY) + message(FATAL_ERROR "Your compiler does not seem to support -fsyntax-only. +You must disable CGAL_ENABLE_CHECK_HEADERS.") + endif() + + ## Fill the variable include_options with all the -I and -isystem options + set(include_options) + foreach (incdir ${CGAL_INCLUDE_DIRS}) + list(APPEND include_options "-I${incdir}") + endforeach() + foreach (incdir ${CGAL_3RD_PARTY_INCLUDE_DIRS}) + list(APPEND include_options "-isystem${incdir}") + endforeach() + include_directories ( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ) + + ## Loop on package and headers + set(check_pkg_target_list) + foreach (package ${CGAL_CONFIGURED_PACKAGES_NAMES}) + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include) + set(depends "") + file(GLOB ${package}_HEADERS + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include" + "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/CGAL/*.h") + foreach(header ${${package}_HEADERS}) + string(REPLACE "/" "__" header2 "${header}") + string(REPLACE "." "_" header2 "${header2}") + add_custom_command(OUTPUT check_${header2} + COMMAND ${CMAKE_CXX_COMPILER} ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_DEFINITIONS} ${include_options} -x c++ -fsyntax-only "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" + COMMAND ${CMAKE_COMMAND} -E touch check_${header2} + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" + VERBATIM + COMMENT "Check header ${header}" + ) + list(APPEND depends check_${header2}) + endforeach() # look on headers + add_custom_target(check_pkg_${package}_headers DEPENDS ${depends}) + list(APPEND check_pkg_target_list check_pkg_${package}_headers) + endif() # if the package has an include directory + endforeach() # loop on packages + add_custom_target(check_headers DEPENDS ${check_pkg_target_list}) + endif() +endif( CGAL_BRANCH_BUILD ) diff --git a/Installation/auxiliary/cgal_create_cmake_script.1 b/Installation/auxiliary/cgal_create_cmake_script.1 index 78fccf7e86c..c2e36ddfee6 100644 --- a/Installation/auxiliary/cgal_create_cmake_script.1 +++ b/Installation/auxiliary/cgal_create_cmake_script.1 @@ -1,4 +1,4 @@ -.TH CGAL_CREATE_CMAKE_SCRIPT "1" "March 2012" "CGAL 4.0" "User Commands" +.TH CGAL_CREATE_CMAKE_SCRIPT "1" "October 2012" "CGAL 4.1" "User Commands" .SH NAME cgal_create_cmake_script \- create a cmake script for applications using CGAL .SH SYNOPSIS @@ -35,7 +35,7 @@ Create a cmake script that is suited for the testsuite used by the CGAL develope .SH AUTHOR The CGAL project (http://www.cgal.org/). .SH "REPORTING BUGS" -Report bugs to (see http://www.cgal.org/ +Report bugs to (see http://www.cgal.org/ for further instructions). .SH "SEE ALSO" The full documentation for CGAL is available at http://www.cgal.org/ in PDF and diff --git a/Installation/changes.html b/Installation/changes.html index d39203f5130..7373bf75444 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -96,7 +96,7 @@ Number of lines of code of CGAL
(using David A. Wheeler's 'SLOCCount', restricted to the include/CGAL/ and src/ directories). -Releases size graph +Releases size graph @@ -112,6 +112,12 @@ David A. Wheeler's 'SLOCCount', restricted to the include/CGAL/
  • Update requirements of the concepts AABBTraits and AABBGeomTraits to match the implementation of the package. +

    Generator

    +
      +
    • Addition of the Combination_enumerator +
    + +

    Release 4.1

    Release date:

    diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index 193bf8bbb89..e7d0e9b0c1c 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -14,6 +14,8 @@ set(CGAL_CORE_PACKAGE_DIR "@CGAL_CORE_PACKAGE_DIR@") set(CGAL_MAJOR_VERSION "@CGAL_MAJOR_VERSION@" ) set(CGAL_MINOR_VERSION "@CGAL_MINOR_VERSION@" ) set(CGAL_BUILD_VERSION "@CGAL_BUILD_VERSION@" ) +set(CGAL_SCM_BRANCH_NAME "@CGAL_SCM_BRANCH_NAME@") +set(CGAL_GIT_SHA1 "@CGAL_GIT_SHA1@") set(CGAL_BUILD_SHARED_LIBS "@CGAL_BUILD_SHARED_LIBS@" ) set(CGAL_Boost_USE_STATIC_LIBS "@CGAL_Boost_USE_STATIC_LIBS@" ) diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index f86a4c97298..09082b15732 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -14,6 +14,8 @@ set(CGAL_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") set(CGAL_MAJOR_VERSION "@CGAL_MAJOR_VERSION@" ) set(CGAL_MINOR_VERSION "@CGAL_MINOR_VERSION@" ) set(CGAL_BUILD_VERSION "@CGAL_BUILD_VERSION@" ) +set(CGAL_SCM_BRANCH_NAME "@CGAL_SCM_BRANCH_NAME@") +set(CGAL_GIT_SHA1 "@CGAL_GIT_SHA1@") set(CGAL_BUILD_SHARED_LIBS "@CGAL_BUILD_SHARED_LIBS@" ) set(CGAL_Boost_USE_STATIC_LIBS "@CGAL_Boost_USE_STATIC_LIBS@" ) diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index 781743f15be..507f113d120 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -2,40 +2,40 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) set(CGAL_MACROS_FILE_INCLUDED 1 ) include("${CGAL_MODULES_DIR}/CGAL_VersionUtils.cmake") - + # Probably unused. -- Laurent Rineau, 2011/07/21 macro(assert _arg ) if ( NOT ${_arg} ) - message( FATAL_ERROR "Variable ${_arg} must be defined" ) + message( FATAL_ERROR "Variable ${_arg} must be defined" ) endif() endmacro() macro( hide_variable var ) - set ( ${var} ${${var}} CACHE INTERNAL "Variable hidden from user" FORCE ) + set ( ${var} ${${var}} CACHE INTERNAL "Variable hidden from user" FORCE ) endmacro() macro( cache_set var ) - set ( ${var} ${ARGN} CACHE INTERNAL "" ) - set ( ${var} ${ARGN} CACHE INTERNAL "" ) + set ( ${var} ${ARGN} CACHE INTERNAL "" ) + set ( ${var} ${ARGN} CACHE INTERNAL "" ) endmacro() - + macro( typed_cache_set type doc var ) - set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE ) - set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE ) + set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE ) + set ( ${var} ${ARGN} CACHE ${type} ${doc} FORCE ) endmacro() - + macro( cache_get var ) - set ( ${var} ) + set ( ${var} ) endmacro() # Splits inlist in the first element (head) and the rest (tail) macro( list_split head tail ) - set( ${head} ) + set( ${head} ) set( ${tail} ) set( _LS_is_head TRUE ) foreach( _LS_item ${ARGN} ) if ( _LS_is_head ) - set( ${head} ${_LS_item} ) + set( ${head} ${_LS_item} ) set( _LS_is_head FALSE ) else() list( APPEND ${tail} ${_LS_item} ) @@ -43,7 +43,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endforeach() endmacro() - # adds elements to an internal cached list + # adds elements to an internal cached list macro( add_to_cached_list listname ) cache_get ( ${listname} ) set( _ATC_${listname}_tmp ${${listname}} ) @@ -52,7 +52,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endif() cache_set ( ${listname} ${_ATC_${listname}_tmp} ) endmacro() - + # adds elements to an in-memory variable named 'listname' macro( add_to_memory_list listname ) if ( NOT "${ARGN}" STREQUAL "" ) @@ -61,7 +61,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endmacro() # adds elements to a list. - # If the first argument after 'listname' is PERSISTENT then 'listname' + # If the first argument after 'listname' is PERSISTENT then 'listname' # is a persistent internal cached variable, otherwise is a memory variable. macro( add_to_list listname ) list_split( _ATL_ARGN_HEAD _ATL_ARGN_TAIL ${ARGN} ) @@ -78,19 +78,19 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) if ( ${idx} LESS ${${list}_length} ) list( GET ${list} ${idx} ${var} ) else() - set( ${var} "NOTFOUND" ) + set( ${var} "NOTFOUND" ) endif() endmacro() - + macro( found_in_list item_list item result ) set( ${result} "FALSE" ) foreach( element ${${item_list}} ) if ( "${element}" STREQUAL "${item}" ) set( ${result} "TRUE" ) endif() - endforeach() + endforeach() endmacro() - + macro( uniquely_add_flags target_var ) if ( "${ARGC}" GREATER "1" ) set( target_list "${${target_var}}" ) @@ -101,7 +101,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) found_in_list( target_list ${flag} ${flag}_FOUND ) if ( NOT ${flag}_FOUND ) typed_cache_set( STRING "User-defined flags" ${target_var} "${${target_var}} ${flag}" ) - endif() + endif() endforeach() endif() endmacro() @@ -146,62 +146,62 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) message("${search_dirs}") endif() endfunction() - + macro( get_dependency_version LIB ) - + if ( "${ARGC}" GREATER "1" ) set( PKG ${ARGV1} ) else() set( PKG ${LIB} ) endif() - + if ( ${PKG}_FOUND ) - + set ( ${LIB}_VERSION "unknown" ) - + try_run( ${LIB}_RUN_RES - ${LIB}_COMPILE_RES + ${LIB}_COMPILE_RES "${CMAKE_BINARY_DIR}" "${CGAL_INSTALLATION_PACKAGE_DIR}/config/support/print_${LIB}_version.cpp" CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${${PKG}_INCLUDE_DIR};${${PKG}_DEPENDENCY_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${${PKG}_LIBRARIES};${${PKG}_DEPENDENCY_LIBRARIES}" - "-DLINK_DIRECTORIES:STRING=${${PKG}_LIBRARY_DIR};${${PKG}_DEPENDENCY_LIBRARY_DIR}" - OUTPUT_VARIABLE ${LIB}_OUTPUT + "-DLINK_DIRECTORIES:STRING=${${PKG}_LIBRARIES_DIR};${${PKG}_DEPENDENCY_LIBRARIES_DIR}" + OUTPUT_VARIABLE ${LIB}_OUTPUT ) - + if ( ${LIB}_COMPILE_RES ) - + if ( ${LIB}_RUN_RES EQUAL "0" ) - + string( REGEX MATCH "version=.*\$" ${LIB}_VERSION_LINE ${${LIB}_OUTPUT} ) string( REPLACE "\n" "" ${LIB}_VERSION_LINE2 ${${LIB}_VERSION_LINE} ) string( REPLACE "\r" "" ${LIB}_VERSION_LINE3 ${${LIB}_VERSION_LINE2} ) string( REPLACE "version=" "" ${LIB}_VERSION ${${LIB}_VERSION_LINE3} ) - + else() - + message( STATUS "WARNING: ${LIB} found but print_${LIB}_version.cpp exited with error condition: ${${LIB}_RUN_RES}" ) message( STATUS "${PKG}_INCLUDE_DIR=${${PKG}_INCLUDE_DIR}" ) message( STATUS "${PKG}_LIBRARIES=${${PKG}_LIBRARIES}" ) - message( STATUS "${PKG}_LIBRARY_DIR=${${PKG}_LIBRARY_DIR}" ) + message( STATUS "${PKG}_LIBRARIES_DIR=${${PKG}_LIBRARIES_DIR}" ) message( STATUS "${${LIB}_OUTPUT}" ) - + endif() - + else() - + message( STATUS "WARNING: ${LIB} found but could not compile print_${LIB}_version.cpp:") message( STATUS "${PKG}_INCLUDE_DIR=${${PKG}_INCLUDE_DIR}" ) message( STATUS "${PKG}_LIBRARIES=${${PKG}_LIBRARIES}" ) - message( STATUS "${PKG}_LIBRARY_DIR=${${PKG}_LIBRARY_DIR}" ) + message( STATUS "${PKG}_LIBRARIES_DIR=${${PKG}_LIBRARIES_DIR}" ) message( STATUS "${${LIB}_OUTPUT}" ) - - endif() - + + endif() + message( STATUS "USING ${LIB}_VERSION = '${${LIB}_VERSION}'" ) - + endif() - + endmacro() macro( use_lib ) @@ -229,7 +229,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) ####message( STATUS "${lib} include: ${${vlib}_INCLUDE_DIR}" ) include_directories ( SYSTEM ${${vlib}_INCLUDE_DIR} ) - # TODO EBEB remove definitions? + # TODO EBEB remove definitions? ####message( STATUS "${lib} definitions: ${${vlib}_DEFINITIONS}" ) add_definitions( ${${vlib}_DEFINITIONS} "-DCGAL_USE_${vlib}" ) @@ -239,9 +239,9 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endif() ####message (STATUS "Configured ${lib} in standard way") - + set( ${vlib}_SETUP TRUE ) - + endif() endif() @@ -274,24 +274,24 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) add_to_list( CGAL_LIBRARIES ${CGAL_${component}_LIBRARY} ) endif() add_to_list( CGAL_3RD_PARTY_LIBRARIES ${CGAL_${component}_3RD_PARTY_LIBRARIES} ) - + add_to_list( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_${component}_3RD_PARTY_INCLUDE_DIRS} ) add_to_list( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_${component}_3RD_PARTY_DEFINITIONS} ) add_to_list( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_${component}_3RD_PARTY_LIBRARIES_DIRS} ) # Nothing to add for Core - if (${component} STREQUAL "ImageIO") + if (${component} STREQUAL "ImageIO") find_package( OpenGL ) find_package( ZLIB ) endif() - if (${component} STREQUAL "Qt3") + if (${component} STREQUAL "Qt3") find_package( OpenGL ) find_package( Qt3-patched ) endif() - if (${component} STREQUAL "Qt4") + if (${component} STREQUAL "Qt4") find_package( OpenGL ) find_package( Qt4 ) endif() @@ -302,39 +302,50 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) if ( ${component} STREQUAL "ALL_PRECONFIGURED_LIBS" ) - if (CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT) + if (CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT) message( STATUS "External libraries are all used") foreach ( CGAL_3RD_PARTY_LIB ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) - if (${CGAL_3RD_PARTY_LIB}_FOUND) + if (${CGAL_3RD_PARTY_LIB}_FOUND) use_lib( ${CGAL_3RD_PARTY_LIB} ${${CGAL_3RD_PARTY_LIB}_USE_FILE}) endif() endforeach() else() - message( SEND_ERROR "Component ALL_PRECONFIGURED_LIBS only allow with CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT=ON") - endif() - - else() - if (NOT DEFINED CGAL_EXT_LIB_${component}_PREFIX) - set(CGAL_EXT_LIB_${component}_PREFIX ${component}) + message( SEND_ERROR "Component ALL_PRECONFIGURED_LIBS only allow with CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT=ON") endif() - - set( vlib "${CGAL_EXT_LIB_${component}_PREFIX}" ) - if ( NOT CGAL_IGNORE_PRECONFIGURED_${component} AND ${vlib}_FOUND) + else() - ####message( STATUS "External library ${component} has been preconfigured") - use_lib( ${component} ${${vlib}_USE_FILE}) + list( FIND CGAL_CONFIGURED_LIBRARIES "CGAL_${component}" POSITION ) + if ( "${POSITION}" EQUAL "-1" ) # if component is not a CGAL_ + if (NOT DEFINED CGAL_EXT_LIB_${component}_PREFIX) + set(CGAL_EXT_LIB_${component}_PREFIX ${component}) + endif() + + set( vlib "${CGAL_EXT_LIB_${component}_PREFIX}" ) + + if ( NOT CGAL_IGNORE_PRECONFIGURED_${component} AND ${vlib}_FOUND) + + ####message( STATUS "External library ${component} has been preconfigured") + use_lib( ${component} ${${vlib}_USE_FILE}) + + else() + + ####message( STATUS "External library ${component} has not been preconfigured") + find_package( ${component} ) + ####message( STATUS "External library ${vlib} after find") + if (${vlib}_FOUND) + ####message( STATUS "External library ${vlib} about to be used") + use_lib( ${component} ${${vlib}_USE_FILE}) + endif() + + endif() else() - ####message( STATUS "External library ${component} has not been preconfigured") - find_package( ${component} ) - ####message( STATUS "External library ${vlib} after find") - if (${vlib}_FOUND) - ####message( STATUS "External library ${vlib} about to be used") - use_lib( ${component} ${${vlib}_USE_FILE}) + if (NOT WITH_CGAL_${component}) + message(STATUS "NOTICE: The CGAL_${component} library seems to be required but is not build. Thus, it is expected that some executables will not be compiled.") endif() - + endif() endif() @@ -359,7 +370,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endif() use_component( MPFR ) - if (GMPXX_FOUND) + if (GMPXX_FOUND) use_component( GMPXX ) endif() use_component( GMP ) @@ -395,7 +406,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endif() set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE) - + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CGAL_CMAKE_MODULE_PATH}) # Export those variables to the parent scope (the scope that calls the function) @@ -407,23 +418,23 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endfunction() macro( create_CGALconfig_files ) - + # CGALConfig.cmake is platform specific so it is generated and stored in the binary folder. configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary.cmake.in" "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) - + # There is also a version of CGALConfig.cmake that is prepared in case CGAL in installed in CMAKE_INSTALL_PREFIX. configure_file("${CGAL_MODULES_DIR}/CGALConfig_install.cmake.in" "${CMAKE_BINARY_DIR}/config/CGALConfig.cmake" @ONLY) #write prefix exceptions file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake "${SPECIAL_PREFIXES}\n") - file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake "${SPECIAL_PREFIXES}") + file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake "${SPECIAL_PREFIXES}") foreach( lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES} ) list( FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION ) # if lib is essential or preconfiguration for an activated library ... if ( ("${POSITION}" STRGREATER "-1") OR ( CGAL_ENABLE_PRECONFIG AND WITH_${lib} )) - + set (vlib ${CGAL_EXT_LIB_${lib}_PREFIX} ) #the next 'if' is needed to avoid ${vlib} config variables to be overidden in case of a local configuration change file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake "if (NOT CGAL_IGNORE_PRECONFIGURED_${lib})\n") @@ -433,8 +444,8 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_LIBRARIES \"${${vlib}_LIBRARIES}\" )\n") file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_DEFINITIONS \"${${vlib}_DEFINITIONS}\" )\n") file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake "endif()\n\n") - - + + #the next 'if' is needed to avoid ${vlib} config variables to be overidden in case of a local configuration change file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake "if (NOT CGAL_IGNORE_PRECONFIGURED_${lib})\n") file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_FOUND \"${${vlib}_FOUND}\")\n") @@ -443,12 +454,12 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_LIBRARIES \"${${vlib}_LIBRARIES}\" )\n") file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_DEFINITIONS \"${${vlib}_DEFINITIONS}\" )\n") file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake "endif()\n\n") - endif() + endif() endforeach() endmacro() - + macro ( fetch_env_var VAR ) if ( "${${VAR}}" STREQUAL "" ) set( ${VAR}_env_value "$ENV{${VAR}}" ) @@ -461,19 +472,19 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) ## All the following macros are probably unused. -- Laurent Rineau, 2011/07/21 - + # Composes a tagged list of libraries: a list with interpersed keywords or tags # indicating that all following libraries, up to the next tag, are to be linked only for the # corresponding build type. The 'general' tag indicates libraries that corresponds to all build types. - # 'optimized' corresponds to release builds and 'debug' to debug builds. Tags are case sensitve and - # the inital range of libraries listed before any tag is implicitely 'general' + # 'optimized' corresponds to release builds and 'debug' to debug builds. Tags are case sensitve and + # the inital range of libraries listed before any tag is implicitely 'general' # # This macro takes 3 lists of general, optimized and debug libraries, resp, and populates the list # given in the fourth argument. # # The first three parameters must be strings containing a semi-colon separated list of elements. # All three lists must be passed, but any of them can be an empty string "". - # The fourth parameter, corresponding to the result, must be a variable name and it will be APPENDED + # The fourth parameter, corresponding to the result, must be a variable name and it will be APPENDED # (retaining any previous contents) # # If there is a last parameter whose value is "PERSISTENT" then the result is an internal cached variable, @@ -494,7 +505,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) if ( NOT "${libs_optimized}" STREQUAL "" ) add_to_list( ${libs} ${_CTL_IN_CACHE} optimized ${libs_optimized} ) endif() - + if ( NOT "${libs_debug}" STREQUAL "" ) add_to_list( ${libs} ${_CTL_IN_CACHE} debug ${libs_debug} ) endif() @@ -532,13 +543,13 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) else() - if ( "${_DTL_tag}" STREQUAL "general" ) - set( _DTL_target ${libs_general} ) - elseif ( "${_DTL_tag}" STREQUAL "optimized" ) - set( _DTL_target ${libs_optimized} ) - else() - set( _DTL_target ${libs_debug} ) - endif() + if ( "${_DTL_tag}" STREQUAL "general" ) + set( _DTL_target ${libs_general} ) + elseif ( "${_DTL_tag}" STREQUAL "optimized" ) + set( _DTL_target ${libs_optimized} ) + else() + set( _DTL_target ${libs_debug} ) + endif() add_to_list( ${_DTL_target} ${_DTL_IN_CACHE} ${_DTL_lib} ) @@ -579,28 +590,28 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) list( LENGTH ${libs_general_or_optimized} _TL_libs_general_or_optimized_len ) list( LENGTH ${libs_general_or_debug} _TL_libs_general_or_debug_len ) - if ( _TL_libs_general_or_optimized_len EQUAL 0 ) + if ( _TL_libs_general_or_optimized_len EQUAL 0 ) compose_tagged_libraries( "${${libs_general_or_debug}}" "" "" ${libs} ${ARGN} ) - elseif ( _TL_libs_general_or_debug_len EQUAL 0 ) + elseif ( _TL_libs_general_or_debug_len EQUAL 0 ) compose_tagged_libraries( "${${libs_general_or_optimized}}" "" "" ${libs} ${ARGN} ) - else() + else() compose_tagged_libraries( "" "${${libs_general_or_optimized}}" "${${libs_general_or_debug}}" ${libs} ${ARGN} ) endif() endmacro() # add_to_tagged_libraries( libsR ${libsA} ) - # + # # Appends the list of tagged libraries contained in the variable 'libA' to the list # of tagged libraries contained in the variable 'libR', properly redistributing each tagged subsequence. # # The first argument is the name of the variable recieving the list. It will be APPENDED - # (retaining any previous contents). + # (retaining any previous contents). # The second parameter is a single string value containing the tagged # lists of libraries to append (as a semi-colon separated list). It can be empty, in which case noting is added. # # If there is a third parameter whose value is PERSISTENT, then 'libR' is an internal cached variable, otherwise - # it is an in-memory variable. + # it is an in-memory variable. # # It is not possible to append more than one list in the same call. # @@ -619,7 +630,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) macro( add_to_tagged_libraries libsR in_cache libsA ) if ( "${in_cache}" STREQUAL "PERSISTENT" ) - set( _CTL_IN_CACHE "PERSISTENT" ) + set( _CTL_IN_CACHE "PERSISTENT" ) else() set( _CTL_IN_CACHE ) endif() @@ -642,7 +653,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) cache_set( ${libsR} ) else() set( ${libsR} ) - endif() + endif() compose_tagged_libraries( "${_CTL_general_0}" "${_CTL_optimized_0}" "${_CTL_debug_0}" ${libsR} ${_CTL_IN_CACHE} ) @@ -678,15 +689,15 @@ function(process_CGAL_subdirectory entry subdir type_name) if(EXISTS ${entry}/../../dont_submit) file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${ENTRY_DIR_NAME}/?\$") - if(dont_submit_grep) + if(dont_submit_grep) set(ADD_SUBDIR FALSE) endif() file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${subdir}/${ENTRY_DIR_NAME}/?\$") - if(dont_submit_grep) + if(dont_submit_grep) set(ADD_SUBDIR FALSE) endif() file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${subdir}/?\$") - if(dont_submit_grep) + if(dont_submit_grep) set(ADD_SUBDIR FALSE) endif() endif() diff --git a/Installation/cmake/modules/CGAL_SCM.cmake b/Installation/cmake/modules/CGAL_SCM.cmake new file mode 100644 index 00000000000..09e4dc383b1 --- /dev/null +++ b/Installation/cmake/modules/CGAL_SCM.cmake @@ -0,0 +1,48 @@ +# Common settings for CGAL cmake scripts +if( NOT CGAL_SCM_FILE_INCLUDED ) + set(CGAL_SCM_FILE_INCLUDED 1 ) + +#message ("-----CSD: ${CMAKE_SOURCE_DIR}") + +set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}") +set(GIT_DIR "${GIT_PARENT_DIR}/.git") +#message ("-----GD: ${GIT_DIR}") +if (EXISTS "${GIT_DIR}") + set( CGAL_SCM_NAME "git" ) +else() + while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories + set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") + get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) + #message ("-----GPD1: ${GIT_PARENT_DIR}") + #message ("-----PPD1: ${GIT_PREVIOUS_PARENT}") + if( "${GIT_PARENT_DIR}" STREQUAL "${GIT_PREVIOUS_PARENT}" ) + # We have reached the root directory, we are not in git + set(_refspecvar "GITDIR-NOTFOUND") + set(_hashvar "GITDIR-NOTFOUND") + set ( CGAL_SCM_NAME "" ) + break() + else() + set( GIT_DIR "${GIT_PARENT_DIR}/.git" ) + set( CGAL_SCM_NAME "git" ) + endif() + endwhile() +endif() + +#message ("====GPD1: ${GIT_PARENT_DIR}") + +if ( "${CGAL_SCM_NAME}" STREQUAL "git" ) + #message ("====GPD2: ${GIT_PARENT_DIR}") + + find_program(GIT_EXECUTABLE git DOC "git command line client") + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_PARENT_DIR}/.git symbolic-ref HEAD + OUTPUT_VARIABLE CGAL_GIT_BRANCH_OUT + OUTPUT_STRIP_TRAILING_WHITESPACE) + + string ( REGEX REPLACE "refs/heads/" "" CGAL_GIT_BRANCH ${CGAL_GIT_BRANCH_OUT}) + # message( STATUS "Git branch ${CGAL_GIT_BRANCH}") + + set ( CGAL_SCM_BRANCH_NAME "${CGAL_GIT_BRANCH}" ) + +endif() + +endif() diff --git a/Installation/cmake/modules/CGAL_UseLEDA.cmake b/Installation/cmake/modules/CGAL_UseLEDA.cmake index a66a58badca..cca9859f03a 100644 --- a/Installation/cmake/modules/CGAL_UseLEDA.cmake +++ b/Installation/cmake/modules/CGAL_UseLEDA.cmake @@ -22,10 +22,21 @@ if ( LEDA_FOUND AND NOT LEDA_SETUP ) link_libraries( ${LEDA_LIBRARIES} ) endif() + if (LEDA_CGAL_FRIEND_INJECTION) + message( STATUS "${LEDA_CGAL_FRIEND_INJECTION}" ) + endif() + if (LEDA_CGAL_NO_STRICT_ALIASING) + message( STATUS "${LEDA_CGAL_NO_STRICT_ALIASING}" ) + endif() + if (LEDA_CGAL_LINK_X11) + message( STATUS "${LEDA_CGAL_LINK_X11}" ) + endif() + uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} ) + uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS ${LEDA_LINKER_FLAGS} ) + uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS ${LEDA_LINKER_FLAGS} ) # Setup is done set ( LEDA_SETUP TRUE ) endif() - diff --git a/Installation/cmake/modules/FindESBTL.cmake b/Installation/cmake/modules/FindESBTL.cmake index acb4fc3f6ae..cae5dd8681f 100644 --- a/Installation/cmake/modules/FindESBTL.cmake +++ b/Installation/cmake/modules/FindESBTL.cmake @@ -8,14 +8,16 @@ # Is it already configured? if (ESBTL_INCLUDE_DIR) set(ESBTL_FOUND TRUE) -else() +else() - find_path(ESBTL_INCLUDE_DIR + find_path(ESBTL_INCLUDE_DIR NAMES ESBTL/default.h - PATHS ENV ESBTL_INC_DIR + HINTS ENV ESBTL_INC_DIR + ENV ESBTL_DIR /usr/include /usr/local/include - DOC "The directory containing the ESBTL header files WITHOUT the ESBTL prefix" + PATH_SUFFIXES include + DOC "The directory containing the ESBTL header files WITHOUT the ESBTL prefix" ) if(ESBTL_INCLUDE_DIR) @@ -23,7 +25,7 @@ else() endif() endif() - + if(ESBTL_FOUND) message(STATUS "Found ESBTL: ${ESBTL_INCLUDE_DIR}") endif() diff --git a/Installation/cmake/modules/FindEigen3.cmake b/Installation/cmake/modules/FindEigen3.cmake index 1f49d7284af..6b259f68ea2 100644 --- a/Installation/cmake/modules/FindEigen3.cmake +++ b/Installation/cmake/modules/FindEigen3.cmake @@ -66,17 +66,16 @@ if (EIGEN3_INCLUDE_DIR) "set to ${EIGEN3_INCLUDE_DIR}, but that path does not contains the file " "signature_of_eigen3_matrix_library and is considered as invalid.") endif() - - + + else (EIGEN3_INCLUDE_DIR) find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library - HINTS - $ENV{EIGEN3_INC_DIR} - PATHS - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen + HINTS ENV EIGEN3_INC_DIR + ENV EIGEN3_DIR + PATHS ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES include eigen3 eigen ) if(EIGEN3_INCLUDE_DIR) @@ -91,7 +90,7 @@ else (EIGEN3_INCLUDE_DIR) # Add variables to cache set( EIGEN3_INCLUDE_DIR "${EIGEN3_INCLUDE_DIR}" CACHE PATH "Directories containing the Eigen3 header files" FORCE ) - - + + endif(EIGEN3_INCLUDE_DIR) diff --git a/Installation/cmake/modules/FindGMP.cmake b/Installation/cmake/modules/FindGMP.cmake index f54aa604266..11f1add0ae9 100644 --- a/Installation/cmake/modules/FindGMP.cmake +++ b/Installation/cmake/modules/FindGMP.cmake @@ -22,37 +22,41 @@ endif() # Is it already configured? if (GMP_in_cache) - - set(GMP_FOUND TRUE) - -else() - find_path(GMP_INCLUDE_DIR - NAMES gmp.h - PATHS ENV GMP_INC_DIR + set(GMP_FOUND TRUE) + +else() + + find_path(GMP_INCLUDE_DIR + NAMES gmp.h + HINTS ENV GMP_INC_DIR + ENV GMP_DIR ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include + PATH_SUFFIXES include DOC "The directory containing the GMP header files" ) if ( GMP_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include" ) cache_set( GMP_IN_CGAL_AUXILIARY TRUE ) endif() - + find_library(GMP_LIBRARIES NAMES gmp libgmp-10 - PATHS ENV GMP_LIB_DIR - ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib + HINTS ENV GMP_LIB_DIR + ENV GMP_DIR + ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib + PATH_SUFFIXES lib DOC "Path to the GMP library" ) - - if ( GMP_LIBRARIES ) + + if ( GMP_LIBRARIES ) get_filename_component(GMP_LIBRARIES_DIR ${GMP_LIBRARIES} PATH CACHE ) endif() - + # Attempt to load a user-defined configuration for GMP if couldn't be found if ( NOT GMP_INCLUDE_DIR OR NOT GMP_LIBRARIES_DIR ) include( GMPConfig OPTIONAL ) endif() - + find_package_handle_standard_args(GMP "DEFAULT_MSG" GMP_LIBRARIES GMP_INCLUDE_DIR) - + endif() diff --git a/Installation/cmake/modules/FindGMPXX.cmake b/Installation/cmake/modules/FindGMPXX.cmake index 9c049f72cf6..f851cd90343 100644 --- a/Installation/cmake/modules/FindGMPXX.cmake +++ b/Installation/cmake/modules/FindGMPXX.cmake @@ -17,18 +17,24 @@ if(WITH_GMP AND GMP_FOUND) set(GMPXX_FIND_QUIETLY TRUE) endif() - find_path(GMPXX_INCLUDE_DIR NAMES gmpxx.h - PATHS ${GMP_INCLUDE_DIR_SEARCH} + find_path(GMPXX_INCLUDE_DIR NAMES gmpxx.h + HINTS ENV GMPXX_INC_DIR + ENV GMPXX_DIR + ${GMP_INCLUDE_DIR_SEARCH} + PATH_SUFFIXES include DOC "The directory containing the GMPXX include files" ) find_library(GMPXX_LIBRARIES NAMES gmpxx - PATHS ${GMP_LIBRARIES_DIR_SEARCH} + HINTS ENV GMPXX_LIB_DIR + ENV GMPXX_DIR + ${GMP_LIBRARIES_DIR_SEARCH} + PATH_SUFFIXES lib DOC "Path to the GMPXX library" ) - + include(FindPackageHandleStandardArgs) - + find_package_handle_standard_args(GMPXX "DEFAULT_MSG" GMPXX_LIBRARIES GMPXX_INCLUDE_DIR ) else() diff --git a/Installation/cmake/modules/FindLEDA.cmake b/Installation/cmake/modules/FindLEDA.cmake index 7350ce01c21..f65cbe38ad0 100644 --- a/Installation/cmake/modules/FindLEDA.cmake +++ b/Installation/cmake/modules/FindLEDA.cmake @@ -1,40 +1,46 @@ -if (LEDA_INCLUDE_DIR AND LEDA_LIBRARIES ) - +if (LEDA_INCLUDE_DIR AND LEDA_LIBRARIES ) + set(LEDA_FOUND TRUE) - -else() - - find_path(LEDA_INCLUDE_DIR + +else() + + find_path(LEDA_INCLUDE_DIR NAMES "LEDA/basic.h" "LEDA/system/basic.h" - PATHS ENV LEDA_INC_DIR + HINTS ENV LEDA_INC_DIR + ENV LEDA_DIR + PATH_SUFFIXES incl DOC "The directory containing the LEDA header files WITHOUT the LEDA prefix" ) - + find_library(LEDA_LIBRARY_RELEASE NAMES "leda" - PATHS ENV LEDA_LIB_DIR - DOC "Path to the LEDA library" + HINTS ENV LEDA_LIB_DIR + ENV LEDA_DIR +# PATH_SUFFIXES lib + DOC "Path to the LEDA library" ) - + find_library(LEDA_LIBRARY_DEBUG NAMES "ledaD" - PATHS ENV LEDA_LIB_DIR - DOC "Path to the LEDA library" + HINTS ENV LEDA_LIB_DIR + ENV LEDA_DIR +# PATH_SUFFIXES lib + DOC "Path to the LEDA library" ) - + if ( NOT LEDA_INCLUDE_DIR ) typed_cache_set( FILEPATH "The directory containing the LEDA header files WITHOUT the LEDA prefix" LEDA_INCLUDE_DIR "$ENV{LEDA_INC_DIR}" ) endif() - + if ( NOT LEDA_DEFINITIONS ) typed_cache_set( STRING "Definitions for the LEDA library" LEDA_DEFINITIONS "$ENV{LEDA_DEFINITIONS}" ) - endif() - + endif() + if ( NOT LEDA_CXX_FLAGS ) typed_cache_set( STRING "Compiler flags for the LEDA library" LEDA_CXX_FLAGS "$ENV{LEDA_CXX_FLAGS}" ) - endif() - + endif() + if ( NOT LEDA_LINKER_FLAGS ) typed_cache_set( STRING "Linker flags for the LEDA library" LEDA_LINKER_FLAGS "$ENV{LEDA_LINKER_FLAGS}" ) - endif() + endif() if ( NOT LEDA_LIBRARY_RELEASE ) typed_cache_set( FILEPATH "The LEDA release-mode libraries" LEDA_LIBRARY_RELEASE "$ENV{LEDA_LIBRARY_RELEASE}" ) @@ -51,24 +57,24 @@ else() set(LEDA_LIBRARIES_ ${LEDA_LIBRARY_RELEASE}) endif() endif() - + set(LEDA_LIBRARIES ${LEDA_LIBRARIES_} CACHE FILEPATH "The LEDA library") endif() - + set( LEDA_BASIC_H "${LEDA_INCLUDE_DIR}/LEDA/system/basic.h" ) if ( NOT EXISTS ${LEDA_BASIC_H} ) set( LEDA_BASIC_H "${LEDA_INCLUDE_DIR}/LEDA/basic.h" ) endif() if ( EXISTS ${LEDA_BASIC_H} ) - + file(READ "${LEDA_BASIC_H}" LEDA_BASIC_H_CONTENTS) - + string(REGEX REPLACE ".*#define __LEDA__ ([0-9]+).*" "\\1" LEDA_VERSION "${LEDA_BASIC_H_CONTENTS}") - + message( STATUS "USING LEDA_VERSION = '${LEDA_VERSION}'" ) - + endif() if ( NOT LEDA_VERSION AND NOT "$ENV{LEDA_VERSION}" STREQUAL "" ) @@ -83,6 +89,26 @@ endif() if ( LEDA_INCLUDE_DIR AND LEDA_LIBRARIES) set(LEDA_FOUND TRUE) + + if ( CMAKE_COMPILER_IS_GNUCXX ) + get_dependency_version (GCC) + if ( NOT "${GCC_VERSION}" VERSION_LESS "4.1" ) + set(LEDA_CGAL_FRIEND_INJECTION TRUE) + typed_cache_set( STRING "Add -ffriend-injection on gcc >= 4.1" LEDA_CGAL_FRIEND_INJECTION "Using LEDA with gcc version 4.1 or later: Adding -ffriend-injection") + uniquely_add_flags (LEDA_CXX_FLAGS "-ffriend-injection") + endif() + if ( NOT "${GCC_VERSION}" VERSION_LESS "4.4" ) + set(LEDA_CGAL_NO_STRICT_ALIASING TRUE) + typed_cache_set( STRING "Add -fno-strict-aliasing on gcc >= 4.4" LEDA_CGAL_NO_STRICT_ALIASING "Using LEDA with gcc version 4.4 or later: Adding -fno-strict-aliasing") + uniquely_add_flags (LEDA_CXX_FLAGS "-fno-strict-aliasing") + endif() + if ( UNIX ) + set(LEDA_CGAL_LINK_X11 TRUE) + typed_cache_set( STRING "Link against X11 on *nix" LEDA_CGAL_LINK_X11 "Using LEDA with gcc on *nix: Adding -lX11") + uniquely_add_flags( LEDA_LINKER_FLAGS "-lX11" ) + endif() + endif() + set(LEDA_USE_FILE "CGAL_UseLEDA") endif() - + diff --git a/Installation/cmake/modules/FindMPFI.cmake b/Installation/cmake/modules/FindMPFI.cmake index 113ae900312..630227c99d5 100644 --- a/Installation/cmake/modules/FindMPFI.cmake +++ b/Installation/cmake/modules/FindMPFI.cmake @@ -1,24 +1,24 @@ find_package( GMP QUIET ) if( GMP_FOUND ) - + if( MPFI_INCLUDE_DIR AND MPFI_LIBRARIES ) set( MPFI_FOUND TRUE ) endif( MPFI_INCLUDE_DIR AND MPFI_LIBRARIES ) find_path(MPFI_INCLUDE_DIR NAMES mpfi.h - HINTS - $ENV{MPFI_INC_DIR} - PATHS - ${GMP_INCLUDE_DIR_SEARCH} + HINTS ENV MPFI_INC_DIR + ENV MPFI_DIR + PATHS ${GMP_INCLUDE_DIR_SEARCH} + PATH_SUFFIXES include DOC "The directory containing the MPFI header files" ) find_library(MPFI_LIBRARIES NAMES mpfi - HINTS - $ENV{MPFI_LIB_DIR} - PATHS - ${GMP_LIBRARIES_DIR_SEARCH} + HINTS ENV MPFI_LIB_DIR + ENV MPFI_DIR + PATHS ${GMP_LIBRARIES_DIR_SEARCH} + PATH_SUFFIXES lib DOC "Directory containing the MPFI library" ) diff --git a/Installation/cmake/modules/FindMPFR.cmake b/Installation/cmake/modules/FindMPFR.cmake index 94f41f9d9a6..c01948fb188 100644 --- a/Installation/cmake/modules/FindMPFR.cmake +++ b/Installation/cmake/modules/FindMPFR.cmake @@ -20,33 +20,37 @@ if(NOT MPFR_LIBRARIES) endif() # Is it already configured? -if (MPFR_in_cache) - - set(MPFR_FOUND TRUE) - -else() +if (MPFR_in_cache) - find_path(MPFR_INCLUDE_DIR - NAMES mpfr.h - PATHS ENV MPFR_INC_DIR + set(MPFR_FOUND TRUE) + +else() + + find_path(MPFR_INCLUDE_DIR + NAMES mpfr.h + HINTS ENV MPFR_INC_DIR + ENV MPFR_DIR ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include - DOC "The directory containing the MPFR header files" + PATH_SUFFIXES include + DOC "The directory containing the MPFR header files" ) if ( MPFR_INCLUDE_DIR STREQUAL "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include" ) cache_set( MPFR_IN_CGAL_AUXILIARY TRUE ) endif() - + find_library(MPFR_LIBRARIES NAMES mpfr libmpfr-4 libmpfr-1 - PATHS ENV MPFR_LIB_DIR - ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib + HINTS ENV MPFR_LIB_DIR + ENV MPFR_DIR + ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib + PATH_SUFFIXES lib DOC "Path to the MPFR library" ) - - if ( MPFR_LIBRARIES ) + + if ( MPFR_LIBRARIES ) get_filename_component(MPFR_LIBRARIES_DIR ${MPFR_LIBRARIES} PATH CACHE ) endif() - + # Attempt to load a user-defined configuration for MPFR if couldn't be found if ( NOT MPFR_INCLUDE_DIR OR NOT MPFR_LIBRARIES_DIR ) include( MPFRConfig OPTIONAL ) diff --git a/Installation/cmake/modules/FindNTL.cmake b/Installation/cmake/modules/FindNTL.cmake index cbbf5ca34a2..1a76114b2b3 100644 --- a/Installation/cmake/modules/FindNTL.cmake +++ b/Installation/cmake/modules/FindNTL.cmake @@ -24,20 +24,22 @@ else( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND ) find_path(NTL_INCLUDE_DIR NAMES NTL/ZZ.h - HINTS - $ENV{NTL_INC_DIR} + HINTS ENV NTL_INC_DIR + ENV NTL_DIR + PATH_SUFFIXES include DOC "The directory containing the NTL include files" ) find_library(NTL_LIBRARY NAMES ntl - HINTS - $ENV{NTL_LIB_DIR} + HINTS ENV NTL_LIB_DIR + ENV NTL_DIR + PATH_SUFFIXES lib DOC "Path to the NTL library" ) - if ( NTL_INCLUDE_DIR AND NTL_LIBRARY ) - + if ( NTL_INCLUDE_DIR AND NTL_LIBRARY ) + #check version set( NTL_VERSION_H "${NTL_INCLUDE_DIR}/NTL/version.h" ) @@ -45,10 +47,10 @@ else( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND ) if ( EXISTS ${NTL_VERSION_H} ) file( READ "${NTL_VERSION_H}" NTL_VERSION_H_CONTENTS ) - - string( REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" CGAL_NTL_VERSION "${NTL_VERSION_H_CONTENTS}" ) - - #message( STATUS "DETECTED NTL_VERSION = '${CGAL_NTL_VERSION}'" ) + + string( REGEX MATCH "[0-9]+(\\.[0-9]+)+" CGAL_NTL_VERSION "${NTL_VERSION_H_CONTENTS}" ) + + message( STATUS "DETECTED NTL_VERSION = '${CGAL_NTL_VERSION}'" ) IS_VERSION_GREATER( "${CGAL_NTL_VERSION}" "5.0.0" _IS_NTL_VERSION_GREATER ) @@ -61,7 +63,7 @@ else( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND ) endif (EXISTS ${NTL_VERSION_H} ) - endif ( NTL_INCLUDE_DIR AND NTL_LIBRARY ) + endif ( NTL_INCLUDE_DIR AND NTL_LIBRARY ) if ( NTL_FOUND ) @@ -77,7 +79,7 @@ else( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND ) DEFAULT_MSG NTL_LIBRARY NTL_INCLUDE_DIR ) - + mark_as_advanced( NTL_INCLUDE_DIR NTL_LIBRARY ) # TODO add flag to CGAL Polynomials diff --git a/Installation/cmake/modules/FindRS.cmake b/Installation/cmake/modules/FindRS.cmake index ab39259e8ef..9ddba75c32c 100644 --- a/Installation/cmake/modules/FindRS.cmake +++ b/Installation/cmake/modules/FindRS.cmake @@ -1,11 +1,11 @@ # RS needs GMP 4.2 or newer, this script will fail if an old version is # detected -if( NOT GMP_FOUND ) +if( NOT GMP_FOUND ) find_package( GMP ) endif() -if( NOT MPFI_FOUND ) +if( NOT MPFI_FOUND ) find_package( MPFI ) endif() @@ -15,21 +15,23 @@ if( MPFI_FOUND ) find_path(RS_INCLUDE_DIR NAMES rs_exports.h - HINTS - $ENV{RS_INC_DIR} + HINTS ENV RS_INC_DIR + ENV RS_DIR + PATH_SUFFIXES include DOC "The directory containing the RS include files" ) find_library(RS_LIBRARIES NAMES rsexport_rs - HINTS - $ENV{RS_LIB_DIR} + HINTS ENV RS_LIB_DIR + ENV RS_DIR + PATH_SUFFIXES lib DOC "Path to the RS library" ) - + get_dependency_version( GMP ) - IS_VERSION_LESS("$GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) + IS_VERSION_LESS("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) if(_IS_GMP_VERSION_TO_LOW) diff --git a/Installation/cmake/modules/FindRS3.cmake b/Installation/cmake/modules/FindRS3.cmake index e592d0bf8ce..d2d1753e83b 100644 --- a/Installation/cmake/modules/FindRS3.cmake +++ b/Installation/cmake/modules/FindRS3.cmake @@ -13,23 +13,29 @@ if( MPFI_FOUND ) find_path(RS3_INCLUDE_DIR NAMES rs3_fncts.h - HINTS - $ENV{RS_INC_DIR} -# TODO uses the same environment variable + HINTS ENV RS3_INC_DIR + ENV RS3_DIR + ENV RS_INC_DIR + ENV RS_DIR + PATHS ${RS_INCLUDE_DIR} + PATH_SUFFIXES include DOC "The directory containing the RS3 include files" ) find_library(RS3_LIBRARIES NAMES rs3 - HINTS - $ENV{RS_LIB_DIR} -# TODO uses the same environment variable + HINTS ENV RS3_LIB_DIR + ENV RS3_DIR + ENV RS_LIB_DIR + ENV RS_DIR + PATHS ${RS_LIBRARIES_DIR} + PATH_SUFFIXES lib DOC "Path to the RS3 library" ) get_dependency_version( GMP ) - IS_VERSION_LESS("$GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) + IS_VERSION_LESS("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) if(_IS_GMP_VERSION_TO_LOW) diff --git a/Installation/cmake/modules/FindTAUCS.cmake b/Installation/cmake/modules/FindTAUCS.cmake index 4c35c3e6e3d..d6625e7471c 100644 --- a/Installation/cmake/modules/FindTAUCS.cmake +++ b/Installation/cmake/modules/FindTAUCS.cmake @@ -52,9 +52,10 @@ else() else() find_path(TAUCS_INCLUDE_DIR NAMES taucs.h - PATHS ${CGAL_TAUCS_INCLUDE_DIR} + HINTS ${CGAL_TAUCS_INCLUDE_DIR} + ENV TAUCS_DIR ENV TAUCS_INC_DIR - PATH_SUFFIXES taucs + PATH_SUFFIXES taucs include ) endif() @@ -67,15 +68,17 @@ else() find_library(TAUCS_LIBRARY NAMES "taucs" PATHS ${CGAL_TAUCS_LIBRARIES_DIR} + ENV TAUCS_DIR ENV TAUCS_LIB_DIR - PATH_SUFFIXES taucs + PATH_SUFFIXES taucs lib DOC "TAUCS library" ) find_library(METIS_LIBRARY NAMES "metis" PATHS ${CGAL_TAUCS_LIBRARIES_DIR} + ENV TAUCS ENV TAUCS_LIB_DIR - PATH_SUFFIXES taucs + PATH_SUFFIXES taucs lib DOC "Metis library" ) if(TAUCS_LIBRARY AND METIS_LIBRARY) diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index af05b46b0e1..c473904b2e1 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -19,6 +19,19 @@ if(NOT USE_CGAL_FILE_INCLUDED) include(CGAL_GeneratorSpecificSettings) include(CGAL_TweakFindBoost) + set(CGAL_INSTALLED_SCM_BRANCH_NAME ${CGAL_SCM_BRANCH_NAME}) + set(CGAL_SCM_BRANCH_NAME "") + + if( NOT "${CGAL_INSTALLED_SCM_BRANCH_NAME}" STREQUAL "" ) + include(CGAL_SCM) + if ( NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "" ) + message ( STATUS "Code taken from Git branch: ${CGAL_SCM_BRANCH_NAME}" ) + if ( NOT "${CGAL_SCM_BRANCH_NAME}" STREQUAL "${CGAL_INSTALLED_SCM_BRANCH_NAME}") + message (AUTHOR_WARNING "Branch '${CGAL_SCM_BRANCH_NAME}' does not match branch '${CGAL_INSTALLED_SCM_BRANCH_NAME}' from which CGAL has been installed. Please consider to rebuild CGAL from this branch.") + endif() + endif() + endif() + set( CGAL_LIBRARIES ) foreach ( component ${CGAL_REQUESTED_COMPONENTS} ) diff --git a/Installation/config/support/test_syntaxonly.cpp b/Installation/config/support/test_syntaxonly.cpp new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Installation/doc_tex/Installation/installation.tex b/Installation/doc_tex/Installation/installation.tex index 3630fe38e57..09f7695cc0c 100644 --- a/Installation/doc_tex/Installation/installation.tex +++ b/Installation/doc_tex/Installation/installation.tex @@ -162,7 +162,7 @@ contains the following subdirectories:\index{directories!structure} \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|} \hline \textbf{directory} & \textbf{contents}\\\hline\hline - \texttt{auxiliary} & precompiled \gmp, \mpfr\ and \taucs\ for Windows\\\hline + \texttt{auxiliary} & precompiled \gmp and \mpfr\ for Windows\\\hline \texttt{cmake/modules} & modules for finding and using libraries\\\hline \texttt{config} & configuration files for install script\\\hline \texttt{demo} & demo programs (most of them need \qt, geomview or other third-party products)\\\hline @@ -516,9 +516,11 @@ your own demos you might need these \cgal-libraries. \section{Optional Third Party Libraries\label{sec:optional3rdpartysoftware}} -Optional 3rd party software is only required to build examples and -demos shipped with \cgal\ or to build your own project using \cgal. In order -to simplify these builds, various libraries can be \emph{prepared to be +Optional 3rd party software can be used by \cgal\ for various reasons: +Usually certain optional libraries are required to build examples and +demos shipped with \cgal\ or to build your own project using \cgal. +Another reason is to speed up basic tasks. +In order to support these goals, all optional libraries can be \emph{prepared to be used with \cgal} while configuring \cgal, just in the same way as essential libraries are configured. Whenever building an example or a demo (or your own executable), these \emph{preconfigured} libraries @@ -581,9 +583,9 @@ Mainly parts in \cgal's algebraic kernel require \rs3. \ntl\ provides data structures and algorithms for signed, arbitrary length integers, and for vectors, matrices, and polynomials over the -integers and over finite fields. In \cgal\ \ntl\ is used to speed up -polynomial operations such as GCDs. It is recommended to install \ntl\ -with support from \gmp. +integers and over finite fields. The optional library \ntl\ is used by +\cgal\ to speed up operations of the Polynomial package, such as GCDs. +It is recommended to install \ntl\ with support from \gmp. \ntl\ can be downloaded from \ntlpage. Version 5.1 or higher is recommended. @@ -605,14 +607,10 @@ with support from \gmp. In \cgal, \eigen\ provides sparse linear solvers in the \ccRef[Surface Reconstruction from Point Sets]{Pkg:SurfaceReconstructionFromPointSets} and the \ccRef[Planar Parameterization of Triangulated Surface Meshes]{Pkg:SurfaceParameterization} packages. - Since \cgal\ version 4.0, \eigen\ is recommended over \taucs\ that is not longer maintained. - + In addition, \eigen\ also provides singular value decomposition for the \ccRef[Estimation of Local Differential Properties]{Pkg:Jet_fitting_3} and the \ccRef[Approximation of Ridges and Umbilics]{Pkg:Ridges_3} packages. - The usage of \eigen\ allows to remove \lapack, \blas\ and \taucs\ from the list of third party libraries - required by some \cgal\ packages. Note that the version 3.1 (or greater) of \eigen\ is required. - The \eigen\ web site is \eigenpage. % \subsection{\taucs \label{thirdparty:Taucs}} @@ -684,7 +682,7 @@ In \cgal\ some 3D demos are based on libQGLViewer. It can be downloaded from \libqglviewerpage. -\subsection{\coin \label{thirdparty:Coin}} +\subsection{\coin \label{thirdparty:Coin3D}} \coin\ is an implementation of Open Inventor. @@ -1049,6 +1047,7 @@ usage of \gmp\ and of \mpfr\ will be disabled. \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline \texttt{WITH\_GMP} & Indicates whether to search and use \gmp\/\mpfr\ or not & CMake\\\hline + \texttt{GMP\_DIR} & Directory of \gmp\ default installation & Environment\\\hline \texttt{GMP\_INCLUDE\_DIR} & Directory containing the \texttt{gmp.h} file & CMake\\\hline \texttt{GMP\_INC\_DIR} & Idem & Environment\\\hline \texttt{GMP\_LIBRARIES\_DIR} & Directory containing the compiled \gmp\ library & CMake\\\hline @@ -1069,6 +1068,7 @@ Under Linux, the \gmpxx\ is also searched for, and you may specify the following \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{GMPXX\_DIR} & Directory of \gmpxx\ default installation & Environment\\\hline \texttt{GMPXX\_INCLUDE\_DIR} & Directory containing the \texttt{gmpxx.h} file & CMake\\\hline \texttt{GMPXX\_LIBRARIES} & Full pathname of the compiled \gmpxx\ library & CMake\\\hline \end{tabular} @@ -1135,7 +1135,7 @@ be sufficient to just indicate the library directory via the \texttt{LEDA\_LIBRA If that doesn't work because, for example, the names are different, you can provide the full pathnames of each variant via \texttt{LEDA\_LIBRARY\_RELEASE} and \texttt{LEDA\_LIBRARY\_DEBUG}. -The variables specifying definitions and flags can be left undefined if they are not needed by LEDA. +The variables specifying definitions and flags can be left undefined if they are not needed by \leda. {\ccTexHtml{\small}{} \renewcommand{\arraystretch}{1.3} @@ -1143,6 +1143,7 @@ The variables specifying definitions and flags can be left undefined if they are \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline \texttt{WITH\_LEDA} & Indicates whether to search and use \leda\ or not & CMake\\\hline + \texttt{LEDA\_DIR} & Directory of \leda\ default installation & Environment\\\hline \texttt{LEDA\_INCLUDE\_DIR} & Directory containing the file \texttt{LEDA/system/basic.h} & CMake\\\hline \texttt{LEDA\_LIBRARIES} & Directory containing the compiled \leda\ libraries & CMake\\\hline \texttt{LEDA\_INC\_DIR} & Directory containing the file \texttt{LEDA/system/basic.h} & Environment\\\hline @@ -1170,6 +1171,7 @@ and library files must be specified by using environment variables. \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{MPFI\_DIR} & Directory of \mpfi\ default installation & Environment\\\hline \texttt{MPFI\_INCLUDE\_DIR} & Directory containing the \texttt{mpfi.h} file & CMake\\\hline \texttt{MPFI\_INC\_DIR} & Idem & Environment\\\hline \texttt{MPFI\_LIBRARIES\_DIR} & Directory containing the compiled \mpfi\ library & CMake\\\hline @@ -1197,6 +1199,7 @@ related to the latter library may also need to be defined. \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{RS\_DIR} & Directory of \rs\ default installation & Environment\\\hline \texttt{RS\_INCLUDE\_DIR} & Directory containing the \texttt{rs\_exports.h} file & CMake\\\hline \texttt{RS\_INC\_DIR} & Idem & Environment\\\hline \texttt{RS\_LIBRARIES\_DIR} & Directory containing the compiled \rs\ library & CMake\\\hline @@ -1212,6 +1215,7 @@ Similar variables exist for \rs3. \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{RS3\_DIR} & Directory of \rs3 default installation & Environment\\\hline \texttt{RS3\_INCLUDE\_DIR} & Directory containing the \texttt{rs\_exports.h} file & CMake\\\hline \texttt{RS3\_INC\_DIR} & Idem & Environment\\\hline \texttt{RS3\_LIBRARIES\_DIR} & Directory containing the compiled \rs\ library & CMake\\\hline @@ -1238,6 +1242,7 @@ headers and library files must be specified using environment variables. \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{NTL\_DIR} & Directory of \ntl\ default installation & Environment\\\hline \texttt{NTL\_INCLUDE\_DIR} & Directory containing the \texttt{NTL/ZZX.h} file & CMake\\\hline \texttt{NTL\_INC\_DIR} & Idem & Environment\\\hline \texttt{NTL\_LIBRARIES\_DIR} & Directory containing the compiled \ntl\ library & CMake\\\hline @@ -1257,6 +1262,7 @@ Only the {\em directory} containing the header files of \eigen\ 3.1 (or greater \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{EIGEN3\_DIR} & Directory of \eigen\ default installation & Environment\\\hline \texttt{EIGEN3\_INCLUDE\_DIR} & Directory containing the file \texttt{signature\_of\_eigen3\_matrix\_library} & CMake\\\hline \texttt{EIGEN3\_INC\_DIR} & Idem & Environment\\\hline \end{tabular} @@ -1340,7 +1346,7 @@ the header files and the full pathnames of the release and debug libraries \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline - \texttt{QGLVIEWERROOT} & Root directory of the QGLViewer library & Environment\\\hline + \texttt{QGLVIEWERROOT} & Root directory of the QGLViewer library & Environment\\\hline \texttt{QGLVIEWER\_INCLUDE\_DIR} & Directory containing the \texttt{QGLViewer/qglviewer.h} file & CMake\\\hline \texttt{QGLVIEWER\_LIBRARY\_RELEASE} & Full pathname to a release build of the QGLViewer library & CMake\\\hline \texttt{QGLVIEWER\_LIBRARY\_DEBUG} & Full pathname to a debug build of the QGLViewer library & CMake\\\hline @@ -1360,6 +1366,7 @@ environment variable is sufficient. \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{ESBTL\_DIR} & Directory of \esbtl\ default installation & Environment\\\hline \texttt{ESBTL\_INC\_DIR} & Directory containing the \texttt{ESBTL/default.h} file & Environment\\\hline \texttt{ESBTL\_INCLUDE\_DIR} & Directory containing the \texttt{ESBTL/default.h} file & CMake\\\hline \end{tabular} diff --git a/Installation/doc_tex/Installation/usage.tex b/Installation/doc_tex/Installation/usage.tex index 374368c1b39..b7e48926492 100644 --- a/Installation/doc_tex/Installation/usage.tex +++ b/Installation/doc_tex/Installation/usage.tex @@ -79,16 +79,17 @@ configuration. behaviour is usually needed for (graphical) demos. \\ If the parameter is not given, the script creates \textbf{one executable for each given source file}. -\item [\texttt{-c com1:com2:...}] Lists components ("com1", - "com2") of \cgal\ to which the executable(s) should be linked. Valid components are \cgal's - libraries (i.e.~"Core", "ImageIO", "Qt3" and "Qt4"; note - that it only make sense to either pick "Qt3" or "Qt4") and all - preconfigured 3rd party software, such as "MPFI", "RS3", - or "LAPACK"). An example is \texttt{-c Core:GMP:RS3:MPFI} -\item [\texttt{-b boost1:boost2:...}] Lists components ("boost1", - "boost2") of \boost\ to which the executable(s) should be - linked. Valid options are, for instance, "filesystem" or "program\_options". +\item [\texttt{-c com1:com2:...}] Lists components (``com1'', + ``com2'') of \cgal\ to which the executable(s) should be linked. Valid components are \cgal's + libraries (i.e.~``Core'', ``ImageIO'', ``Qt3'' and ``Qt4''; note + that it only make sense to either pick ``Qt3'' or ``Qt4'') and all + preconfigured 3rd party software, such as ``MPFI'' or ``RS3'' + ). An example is \texttt{-c Core:GMP:RS3:MPFI} + +\item [\texttt{-b boost1:boost2:...}] Lists components (``boost1'', + ``boost2'') of \boost\ to which the executable(s) should be + linked. Valid options are, for instance, ``filesystem'' or ``program\_options''. \end{description} @@ -121,8 +122,8 @@ link with \cgal\ and essential third party libraries. Beyond, \texttt{find\_package} can demand for \texttt{COMPONENTS} of \cgal, that is, all \cgal\ libraries libCGAL\_Core (``Core''), libCGAL\_ImageIO (``ImageIO'') , libCGAL\_Qt3 (``Qt3'') and libCGAL\_Qt4 -(``Qt4'') or optional 3rd party software such as ``MPFI'', ``RS3'' or -``LAPACK''. A user is free to create the \texttt{CMakeLists.txt} +(``Qt4'') or optional 3rd party software such as ``MPFI'' or ``RS3''. +A user is free to create the \texttt{CMakeLists.txt} without calling the script (manual creation). diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 0df55caceb1..9abad1bc6cf 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -111,12 +111,10 @@ #if defined(BOOST_NO_VARIADIC_TEMPLATES) #define CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES 1 #endif -#if !defined(BOOST_HAS_TR1_ARRAY) +// never use TR1 #define CGAL_CFG_NO_TR1_ARRAY 1 -#endif -#if !defined(BOOST_HAS_TR1_TUPLE) +// never use TR1 #define CGAL_CFG_NO_TR1_TUPLE 1 -#endif #if !defined(__GNUC__) #define CGAL_CFG_NO_STATEMENT_EXPRESSIONS 1 #endif diff --git a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h index 4cc9b6a4ba0..4d7221fa329 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h @@ -30,14 +30,15 @@ #include #include -namespace CGAL{ - template +namespace CGAL{ namespace internal{ + + template Object - intersection(const Triangle_2 &t, const Iso_rectangle_2 &r) + intersection(const typename K::Triangle_2 &t, const typename K::Iso_rectangle_2 &r, const K&) { - typedef typename R::FT FT; - typedef Segment_2 Segment; - typedef Point_2 Point; + typedef typename K::FT FT; + typedef typename K::Segment_2 Segment; + typedef typename K::Point_2 Point; FT xr1, yr1, xr2, yr2; bool position[3][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}; @@ -252,7 +253,10 @@ namespace CGAL{ result.push_back(s[k].source()); } } - + //remove duplicated consecutive points + typename std::vector::iterator last = std::unique(result.begin(),result.end()); + result.erase(last,result.end()); + switch(result.size()){ case 0: return Object(); @@ -261,7 +265,7 @@ namespace CGAL{ case 2: return make_object(Segment(result[0], result[1])); case 3: - return make_object(Triangle_2(result[0], result[1], result[2])); + return make_object(typename K::Triangle_2(result[0], result[1], result[2])); default: return make_object(result); } @@ -269,6 +273,74 @@ namespace CGAL{ }//end if(intersection) return Object(); }//end intersection + + template + Object + inline intersection(const typename K::Iso_rectangle_2 &r, const typename K::Triangle_2 &t, const K& k) + { + return intersection(t,r,k); + } + + template + bool do_intersect( + const typename K::Triangle_2 &tr, + const typename K::Iso_rectangle_2 &ir, + const K& k) + { + //1) check if at least one vertex of tr is not outside ir + //2) if not, check if at least on vertex of tr is not outside tr + + typename K::Has_on_unbounded_side_2 unbounded_side=k.has_on_unbounded_side_2_object(); + typename K::Construct_vertex_2 vertex=k.construct_vertex_2_object(); + for (int i=0;i<3;++i) + if ( !unbounded_side( ir,vertex(tr,i) ) ) return true; + for (int i=0;i<4;++i) + if ( !unbounded_side( tr,vertex(ir,i) ) ) return true; + return false; + } + + template + inline bool do_intersect( + const typename K::Iso_rectangle_2 &ir, + const typename K::Triangle_2 &tr, + const K& k) + { + return do_intersect(tr,ir,k); + } + + } //namespace internal + + template + Object + inline intersection(const Iso_rectangle_2 &r, const Triangle_2 &t) + { + return typename K::Intersect_2()(r,t); + } + + template + Object + inline intersection(const Triangle_2 &t, const Iso_rectangle_2 &r) + { + return typename K::Intersect_2()(t,r); + } + + template + inline bool + do_intersect(const Iso_rectangle_2 & iso, + const Triangle_2 &tr) + { + typedef typename K::Do_intersect_2 Do_intersect; + return Do_intersect()(iso, tr); + } + + template + inline bool + do_intersect(const Triangle_2 &tr, const Iso_rectangle_2 &iso) + { + typedef typename K::Do_intersect_2 Do_intersect; + return Do_intersect()(tr, iso); + } + }//end namespace #endif diff --git a/Intersections_2/include/CGAL/intersection_2_2.h b/Intersections_2/include/CGAL/intersection_2_2.h index 470c966d748..d5b900b7b5b 100644 --- a/Intersections_2/include/CGAL/intersection_2_2.h +++ b/Intersections_2/include/CGAL/intersection_2_2.h @@ -36,5 +36,6 @@ #include #include #include +#include #endif diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index c128bb5a50d..185da603d2e 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -21,10 +21,6 @@ #include #include -#ifdef NDEBUG -# error The test-suite needs no NDEBUG defined -#endif - const double epsilon = 0.001; struct randomint { @@ -115,6 +111,14 @@ struct Test { assert(CGAL::intersection(o1, o2).empty()); assert(!CGAL::do_intersect(o2, o1)); assert(CGAL::intersection(o2, o1).empty()); + + //check with the functors + typename CGAL::Kernel_traits::Kernel::Do_intersect_2 do_2; + typename CGAL::Kernel_traits::Kernel::Intersect_2 i_2; + assert(!do_2(o1, o2)); + assert(i_2(o1, o2).empty()); + assert(!do_2(o2, o1)); + assert(i_2(o2, o1).empty()); } template < typename Res, typename O1, typename O2 > @@ -308,6 +312,19 @@ struct Test { check_intersection (Rec(p( 10, 12), p(30, 40)), Rec(p( 25, 40), p( 26, 103)), Rec(P(25, 40), P(26, 40))); } + void T_Rec() + { + std::cout << "Triangle Iso_rectangle\n"; + check_no_intersection (Rec(p( 10, 12), p(30, 40)), T(p( 4, 0), p( 12, 4), p(-4, 8))); + check_intersection(Rec(p( 0, 0), p(1, 1)), T(p( -1, 0), p( -1, 2), p(2, 2))); + check_intersection(Rec(p( 0, 0), p(1, 1)), T(p( -1, 0), p(2, 2), p( -1, 2))); + check_intersection(Rec(p( 0, 0), p(1, 1)), T(p( -1, -2), p( -1, 2), p(5, 2))); + check_intersection(Rec(p( 0, 0), p(2, 2)), T(p( 0, 0), p( 1, 0), p(0, 1))); + check_intersection(Rec(p( 0, 0), p(3, 3)), T(p( 1, 1), p( 2, 1), p(1, 2))); + check_intersection

    (Rec(p( 0, 0), p(1, 1)), T(p( -1, 0), p( 0, 0), p(0, -1))); + check_intersection

    (Rec(p( 0, 0), p(1, 1)), T(p( 0, 0), p( -1, 0), p(0, -1))); + } + void run() { std::cout << "2D Intersection tests\n"; @@ -326,6 +343,7 @@ struct Test { R_Rec(); S_Rec(); Rec_Rec(); + T_Rec(); } }; diff --git a/Intersections_3/test/Intersections_3/test_intersections_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_3.cpp index 36921c8a403..f45790aa32d 100644 --- a/Intersections_3/test/Intersections_3/test_intersections_3.cpp +++ b/Intersections_3/test/Intersections_3/test_intersections_3.cpp @@ -10,10 +10,6 @@ #include #include -#ifdef NDEBUG -# error The test-suite needs no NDEBUG defined -#endif - const double epsilon = 0.001; struct randomint { diff --git a/Interval_support/include/CGAL/Interval_traits.h b/Interval_support/include/CGAL/Interval_traits.h index 6d434bc477d..ba54a3614b3 100644 --- a/Interval_support/include/CGAL/Interval_traits.h +++ b/Interval_support/include/CGAL/Interval_traits.h @@ -51,7 +51,8 @@ #ifndef CGAL_INTERVAL_TRAITS_H #define CGAL_INTERVAL_TRAITS_H -#include +#include +#include #include #include diff --git a/Interval_support/package_info/Interval_support/maintainer b/Interval_support/package_info/Interval_support/maintainer index b354f14e7dd..291dcf918ae 100644 --- a/Interval_support/package_info/Interval_support/maintainer +++ b/Interval_support/package_info/Interval_support/maintainer @@ -1 +1 @@ -Michael Hemmer +Michael Hemmer diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Projection_traits_xy_3.tex b/Kernel_23/doc_tex/Kernel_23_ref/Projection_traits_xy_3.tex index 242e259ad95..870054641dd 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Projection_traits_xy_3.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Projection_traits_xy_3.tex @@ -35,7 +35,8 @@ of the concepts \ccc{PolygonTraits_2} and \ccc{ConvexHullTraits_2}. \ccRefConceptPage{DelaunayTriangulationTraits_2} \\ \ccRefConceptPage{ConstrainedTriangulationTraits_2} \\ \ccRefConceptPage{PolygonTraits_2} \\ -\ccRefConceptPage{ConvexHullTraits_2} +\ccRefConceptPage{ConvexHullTraits_2} \\ +\ccRefConceptPage{DelaunayMeshTraits_2} \ccTypes diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 8939078661f..ec304568b2c 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -33,6 +33,7 @@ #include #include #include +#include namespace CGAL { diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h index 126e359fca2..a870077752c 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h @@ -31,6 +31,7 @@ // These functions are not documented for now, but could be as some point. #include +#include #include #include "boost/mpl/equal_to.hpp" #include diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h index 1da73db32ba..89eb748c483 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h @@ -29,6 +29,7 @@ // See comments in CGAL/Kernel/global_functions_internal_3.h. #include +#include #include #include "boost/mpl/equal_to.hpp" #include diff --git a/Kernel_23/include/CGAL/determinant.h b/Kernel_23/include/CGAL/determinant.h index b23d8f181d4..d576653d909 100644 --- a/Kernel_23/include/CGAL/determinant.h +++ b/Kernel_23/include/CGAL/determinant.h @@ -26,6 +26,8 @@ #ifndef CGAL_DETERMINANT_H #define CGAL_DETERMINANT_H +#include + namespace CGAL { template diff --git a/Kernel_23/include/CGAL/internal/Projection_traits_3.h b/Kernel_23/include/CGAL/internal/Projection_traits_3.h index 8aa46bca30b..bc5c563733b 100644 --- a/Kernel_23/include/CGAL/internal/Projection_traits_3.h +++ b/Kernel_23/include/CGAL/internal/Projection_traits_3.h @@ -1,554 +1,585 @@ -// Copyright (c) 1997-2010 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// 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$ -// $Id$ -// -// -// Author(s) : Mariette Yvinec, Sebastien Loriot - -#ifndef CGAL_INTERNAL_PROJECTION_TRAITS_3_H -#define CGAL_INTERNAL_PROJECTION_TRAITS_3_H - -#include - -#include -#include -#include - -namespace CGAL { - -namespace internal { - -//project Point_3 along coordinate dim -template -struct Projector; - -//project onto yz -template -struct Projector -{ - typedef typename R::Less_y_3 Less_x_2; - typedef typename R::Less_z_3 Less_y_2; - typedef typename R::Compare_y_3 Compare_x_2; - typedef typename R::Compare_z_3 Compare_y_2; - typedef typename R::Equal_y_3 Equal_x_2; - typedef typename R::Equal_z_3 Equal_y_2; - - static typename R::FT x(const typename R::Point_3& p) {return p.y();} - static typename R::FT y(const typename R::Point_3& p) {return p.z();} - static const int x_index=1; - static const int y_index=2; -}; -//project onto xz -template -struct Projector -{ - typedef typename R::Less_x_3 Less_x_2; - typedef typename R::Less_z_3 Less_y_2; - typedef typename R::Compare_x_3 Compare_x_2; - typedef typename R::Compare_z_3 Compare_y_2; - typedef typename R::Equal_x_3 Equal_x_2; - typedef typename R::Equal_z_3 Equal_y_2; - static typename R::FT x(const typename R::Point_3& p) {return p.x();} - static typename R::FT y(const typename R::Point_3& p) {return p.z();} - static const int x_index=0; - static const int y_index=2; -}; - -//project onto xy -template -struct Projector -{ - typedef typename R::Less_x_3 Less_x_2; - typedef typename R::Less_y_3 Less_y_2; - typedef typename R::Compare_x_3 Compare_x_2; - typedef typename R::Compare_y_3 Compare_y_2; - typedef typename R::Equal_x_3 Equal_x_2; - typedef typename R::Equal_y_3 Equal_y_2; - static typename R::FT x(const typename R::Point_3& p) {return p.x();} - static typename R::FT y(const typename R::Point_3& p) {return p.y();} - static const int x_index=0; - static const int y_index=1; -}; - - - -template -class Orientation_projected_3 -{ -public: - typedef typename R::Point_3 Point; - typename R::FT x(const Point &p) const { return Projector::x(p); } - typename R::FT y(const Point &p) const { return Projector::y(p); } - - typename R::Point_2 project(const Point& p) const - { - return typename R::Point_2(x(p),y(p)); - } - - CGAL::Orientation operator()(const Point& p, - const Point& q, - const Point& r) const - { - return CGAL::orientation(project(p), project(q), project(r)); - } -}; - -template -class Side_of_oriented_circle_projected_3 -{ -public: - typedef typename R::Point_3 Point; - typename R::FT x(const Point &p) const { return Projector::x(p); } - typename R::FT y(const Point &p) const { return Projector::y(p); } - - - typename R::Point_2 project(const Point& p) const - { - return typename R::Point_2(x(p),y(p)); - } - CGAL::Oriented_side operator() (const Point &p, - const Point &q, - const Point &r, - const Point &s) const - { - return CGAL::side_of_oriented_circle(project(p),project(q),project(r),project(s) ); - } -}; - -template -class Side_of_bounded_circle_projected_3 -{ -public: - typedef typename R::Point_3 Point; - typename R::FT x(const Point &p) const { return Projector::x(p); } - typename R::FT y(const Point &p) const { return Projector::y(p); } - - - typename R::Point_2 project(const Point& p) const - { - return typename R::Point_2(x(p),y(p)); - } - CGAL::Bounded_side operator() (const Point &p, - const Point &q, - const Point &r, - const Point &s) const - { - return CGAL::side_of_bounded_circle(project(p),project(q),project(r),project(s) ); - } - - CGAL::Bounded_side operator() (const Point &p, - const Point &q, - const Point &r) const - { - return CGAL::side_of_bounded_circle(project(p),project(q),project(r)); - } -}; - -template -class Compare_distance_projected_3 -{ -public: - typedef typename R::Point_3 Point_3; - typedef typename R::Point_2 Point_2; - typedef typename R::FT RT; - typename R::FT x(const Point_3 &p) const { return Projector::x(p); } - typename R::FT y(const Point_3 &p) const { return Projector::y(p); } - - Point_2 project(const Point_3& p) const - { - return Point_2(x(p),y(p)); - } - - Comparison_result operator()(const Point_3& p,const Point_3& q,const Point_3& r) const - { - Point_2 p2 = project(p); - Point_2 q2 = project(q); - Point_2 r2 = project(r); - return compare_distance_to_point(p2,q2,r2); - } -}; - -template -class Squared_distance_projected_3 -{ -public: - typedef typename R::Point_3 Point_3; - typedef typename R::Point_2 Point_2; - typedef typename R::Line_3 Line_3; - typedef typename R::Line_2 Line_2; - typedef typename R::FT RT; - typename R::FT x(const Point_3 &p) const { return Projector::x(p); } - typename R::FT y(const Point_3 &p) const { return Projector::y(p); } - - Point_2 project(const Point_3& p) const - { - return Point_2(x(p),y(p)); - } - - RT operator()(const Line_3& l, const Point_3& p) const - { - Point_2 p2(project(p)); - Line_2 l2(project(l.point(0)), project(l.point(1))); - return squared_distance(p2, l2); - } -}; - -template -class Intersect_projected_3 -{ -public: - typedef typename R::Point_3 Point_3; - typedef typename R::Segment_3 Segment_3; - typedef typename R::Point_2 Point_2; - typedef typename R::Vector_2 Vector_2; - typedef typename R::Segment_2 Segment_2; - typedef typename R::FT FT; - - typename R::FT x(const Point_3 &p) const { return Projector::x(p); } - typename R::FT y(const Point_3 &p) const { return Projector::y(p); } - - Point_2 project(const Point_3& p) const - { - return Point_2(x(p),y(p)); - } - - FT alpha(const Point_2& p, const Point_2& source, const Point_2& target) const - { - FT dx = target.x() - source.x(); - FT dy = target.y() - source.y(); - return (CGAL::abs(dx)>CGAL::abs(dy)) ? ( p.x()-source.x() ) / dx : (p.y()-source.y() ) / dy; - } - - Object operator()(const Segment_3& s1, const Segment_3& s2) const - { - Point_2 s1_source = project(s1.source()); - Point_2 s1_target = project(s1.target()); - Point_2 s2_source = project(s2.source()); - Point_2 s2_target = project(s2.target()); - Segment_2 s1_2(s1_source, s1_target); - Segment_2 s2_2(s2_source, s2_target); - CGAL_precondition(!s1_2.is_degenerate()); - CGAL_precondition(!s2_2.is_degenerate()); - - //compute intersection points in projected plane - //We know that none of the segment is degenerate - Object o = intersection(s1_2,s2_2); - const Point_2* pi=CGAL::object_cast(&o); - if (pi==NULL) { //case of segment or empty - const Segment_2* si=CGAL::object_cast(&o); - if (si==NULL) return Object(); - FT src[3],tgt[3]; - //the third coordinate is the midpoint between the points on s1 and s2 - FT z1 = s1.source()[dim] + ( alpha(si->source(), s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); - FT z2 = s2.source()[dim] + ( alpha(si->source(), s2_source, s2_target) * ( s2.target()[dim] - s2.source()[dim] )); - src[dim] = (z1+z2) / FT(2); - - - z1 = s1.source()[dim] + ( alpha(si->target(), s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); - z2 = s2.source()[dim] + ( alpha(si->target(), s2_source, s2_target) * ( s2.target()[dim] - s2.source()[dim] )); - - tgt[dim] = (z1+z2) / FT(2); - - - src[Projector::x_index] = si->source().x(); - src[Projector::y_index] = si->source().y(); - tgt[Projector::x_index] = si->target().x(); - tgt[Projector::y_index] = si->target().y(); - return make_object( Segment_3( Point_3(src[0],src[1],src[2]),Point_3(tgt[0],tgt[1],tgt[2]) ) ); - } - FT coords[3]; - //compute the third coordinate of the projected intersection point onto 3D segments - FT z1 = s1.source()[dim] + ( alpha(*pi, s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); - FT z2 = s2.source()[dim] + ( alpha(*pi, s2_source, s2_target) * ( s2.target()[dim] - s2.source()[dim] )); - - coords[dim] = (z1+z2) / FT(2); - coords[Projector::x_index] = pi->x(); - coords[Projector::y_index] = pi->y(); - - Point_3 res(coords[0],coords[1],coords[2]); - CGAL_assertion(x(res)==pi->x() && y(res)==pi->y()); - return make_object(res); - } -}; - -template -class Circumcenter_center_projected -{ - typedef typename R::Point_3 Point_3; - typedef typename R::Point_2 Point_2; - - typename R::FT x(const Point_3 &p) const { return Projector::x(p); } - typename R::FT y(const Point_3 &p) const { return Projector::y(p); } - - Point_2 project(const Point_3& p) const - { - return Point_2(x(p),y(p)); - } - - Point_3 embed (const Point_2& p) const - { - typename R::FT coords[3]; - coords[Projector::x_index]=p.x(); - coords[Projector::y_index]=p.y(); - coords[dim]=typename R::FT(0); - return Point_3(coords[0],coords[1],coords[2]); - } - -public: - Point_3 operator() (const Point_3& p1,const Point_3& p2) const - { - return embed( circumcenter(project(p1),project(p2)) ); - } - - Point_3 operator() (const Point_3& p1,const Point_3& p2,const Point_3& p3) const - { - return embed( circumcenter(project(p1),project(p2),project(p3)) ); - } -}; - -template -class Compute_area_projected -{ - typedef typename R::Point_3 Point_3; - typedef typename R::Point_2 Point_2; - - typename R::FT x(const Point_3 &p) const { return Projector::x(p); } - typename R::FT y(const Point_3 &p) const { return Projector::y(p); } - - Point_2 project(const Point_3& p) const - { - return Point_2(x(p),y(p)); - } - - -public: - typename R::FT operator() (const Point_3& p1,const Point_3& p2,const Point_3& p3) const - { - return R().compute_area_2_object() ( project(p1),project(p2),project(p3) ); - } -}; - -template -class Compute_squared_radius_projected -{ - typedef typename R::Point_3 Point_3; - typedef typename R::Point_2 Point_2; - - typename R::FT x(const Point_3 &p) const { return Projector::x(p); } - typename R::FT y(const Point_3 &p) const { return Projector::y(p); } - - Point_2 project(const Point_3& p) const - { - return Point_2(x(p),y(p)); - } - - -public: - typename R::FT operator() (const Point_3& p1,const Point_3& p2,const Point_3& p3) const - { - return R().compute_squared_radius_2_object() ( project(p1),project(p2),project(p3) ); - } - typename R::FT operator() (const Point_3& p1,const Point_3& p2) const - { - return R().compute_squared_radius_2_object() ( project(p1),project(p2) ); - } - - typename R::FT operator() (const Point_3& p1) const - { - return R().compute_squared_radius_2_object() ( project(p1) ); - } -}; - -template < class R, int dim > -class Projection_traits_3 { -public: - typedef Projection_traits_3 Traits; - typedef R Rp; - typedef typename R::FT FT; - typedef typename Rp::Point_3 Point_2; - typedef typename Rp::Segment_3 Segment_2; - typedef typename Rp::Triangle_3 Triangle_2; - typedef typename Rp::Line_3 Line_2; - - typedef typename Projector::Less_x_2 Less_x_2; - typedef typename Projector::Less_y_2 Less_y_2; - typedef typename Projector::Compare_x_2 Compare_x_2; - typedef typename Projector::Compare_y_2 Compare_y_2; - typedef Orientation_projected_3 Orientation_2; - typedef Side_of_oriented_circle_projected_3 Side_of_oriented_circle_2; - typedef Side_of_bounded_circle_projected_3 Side_of_bounded_circle_2; - typedef Compare_distance_projected_3 Compare_distance_2; - typedef Squared_distance_projected_3 Compute_squared_distance_2; - typedef Intersect_projected_3 Intersect_2; - typedef Compute_squared_radius_projected Compute_squared_radius_2; - typedef typename Rp::Construct_segment_3 Construct_segment_2; - typedef typename Rp::Construct_triangle_3 Construct_triangle_2; - typedef typename Rp::Construct_line_3 Construct_line_2; - - struct Less_xy_2 { - typedef bool result_type; - bool operator()(const Point_2& p, const Point_2& q) const - { - Compare_x_2 cx; - Comparison_result crx = cx(p,q); - if(crx == SMALLER){ return true;} - if(crx == LARGER){return false;} - Less_y_2 ly; - return ly(p,q); - } - }; - - - struct Less_yx_2 { - typedef bool result_type; - bool operator()(const Point_2& p, const Point_2& q) const - { - Compare_y_2 cy; - Comparison_result cry = cy(p,q); - if(cry == SMALLER){ return true;} - if(cry == LARGER){return false;} - Less_x_2 lx; - return lx(p,q); - } - }; - - struct Equal_2 { - typedef bool result_type; - bool operator()(const Point_2& p, const Point_2& q) const - { - - Equal_x_2 eqx; - Equal_y_2 eqy; - return eqx(p,q) & eqy(p,q); - } - }; - - struct Left_turn_2 { - typedef bool result_type; - bool operator()(const Point_2& p, const Point_2& q, const Point_2& r) const - { - - Orientation_2 ori; - return ori(p,q,r) == LEFT_TURN; - } - }; - - //for natural_neighbor_coordinates_2 - typedef typename Projector::Equal_x_2 Equal_x_2; - typedef typename Projector::Equal_y_2 Equal_y_2; - typedef Circumcenter_center_projected Construct_circumcenter_2; - typedef Compute_area_projected Compute_area_2; - Construct_circumcenter_2 construct_circumcenter_2_object () const {return Construct_circumcenter_2();} - Compute_area_2 compute_area_2_object () const {return Compute_area_2();} - - - // for compatibility with previous versions - typedef Point_2 Point; - typedef Segment_2 Segment; - typedef Triangle_2 Triangle; - - Projection_traits_3(){} - Projection_traits_3( - const Projection_traits_3&){} - Projection_traits_3 &operator=( - const Projection_traits_3&){return *this;} - - typename Rp::FT x(const Point_2 &p) const { return Projector::x(p); } - typename Rp::FT y(const Point_2 &p) const { return Projector::y(p); } - - - Equal_2 - equal_2_object() const - { return Equal_2();} - - Left_turn_2 - left_turn_2_object() const - { return Left_turn_2();} - - Less_x_2 - less_x_2_object() const - { return Less_x_2();} - - Less_xy_2 - less_xy_2_object() const - { return Less_xy_2();} - - Less_yx_2 - less_yx_2_object() const - { return Less_yx_2();} - - Less_y_2 - less_y_2_object() const - { return Less_y_2();} - Compare_x_2 - compare_x_2_object() const - { return Compare_x_2();} - - Compare_y_2 - compare_y_2_object() const - { return Compare_y_2();} - - Orientation_2 - orientation_2_object() const - { return Orientation_2();} - - Side_of_oriented_circle_2 - side_of_oriented_circle_2_object() const - {return Side_of_oriented_circle_2();} - - Side_of_bounded_circle_2 - side_of_bounded_circle_2_object() const - {return Side_of_bounded_circle_2();} - - Compare_distance_2 - compare_distance_2_object() const - { - return Compare_distance_2(); - } - - Compute_squared_distance_2 - compute_squared_distance_2_object () const - { - return Compute_squared_distance_2(); - } - - Compute_squared_radius_2 - compute_squared_radius_2_object () const - { - return Compute_squared_radius_2(); - } - - Intersect_2 - intersect_2_object () const - { - return Intersect_2(); - } - - Construct_segment_2 construct_segment_2_object() const - {return Construct_segment_2();} - - Construct_triangle_2 construct_triangle_2_object() const - {return Construct_triangle_2();} - - Construct_line_2 construct_line_2_object() const - {return Construct_line_2();} - -}; - - -} } //namespace CGAL::internal - -#endif // CGAL_INTERNAL_PROJECTION_TRAITS_3_H +// Copyright (c) 1997-2010 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// 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$ +// $Id$ +// +// +// Author(s) : Mariette Yvinec, Sebastien Loriot + +#ifndef CGAL_INTERNAL_PROJECTION_TRAITS_3_H +#define CGAL_INTERNAL_PROJECTION_TRAITS_3_H + +#include + +#include +#include +#include + +#include + +namespace CGAL { + +namespace internal { + +//project Point_3 along coordinate dim +template +struct Projector; + +//project onto yz +template +struct Projector +{ + typedef typename R::Less_y_3 Less_x_2; + typedef typename R::Less_z_3 Less_y_2; + typedef typename R::Compare_y_3 Compare_x_2; + typedef typename R::Compare_z_3 Compare_y_2; + typedef typename R::Equal_y_3 Equal_x_2; + typedef typename R::Equal_z_3 Equal_y_2; + + static typename R::FT x(const typename R::Point_3& p) {return p.y();} + static typename R::FT y(const typename R::Point_3& p) {return p.z();} + static const int x_index=1; + static const int y_index=2; +}; +//project onto xz +template +struct Projector +{ + typedef typename R::Less_x_3 Less_x_2; + typedef typename R::Less_z_3 Less_y_2; + typedef typename R::Compare_x_3 Compare_x_2; + typedef typename R::Compare_z_3 Compare_y_2; + typedef typename R::Equal_x_3 Equal_x_2; + typedef typename R::Equal_z_3 Equal_y_2; + static typename R::FT x(const typename R::Point_3& p) {return p.x();} + static typename R::FT y(const typename R::Point_3& p) {return p.z();} + static const int x_index=0; + static const int y_index=2; +}; + +//project onto xy +template +struct Projector +{ + typedef typename R::Less_x_3 Less_x_2; + typedef typename R::Less_y_3 Less_y_2; + typedef typename R::Compare_x_3 Compare_x_2; + typedef typename R::Compare_y_3 Compare_y_2; + typedef typename R::Equal_x_3 Equal_x_2; + typedef typename R::Equal_y_3 Equal_y_2; + static typename R::FT x(const typename R::Point_3& p) {return p.x();} + static typename R::FT y(const typename R::Point_3& p) {return p.y();} + static const int x_index=0; + static const int y_index=1; +}; + + + +template +class Orientation_projected_3 +{ +public: + typedef typename R::Point_3 Point; + typename R::FT x(const Point &p) const { return Projector::x(p); } + typename R::FT y(const Point &p) const { return Projector::y(p); } + + typename R::Point_2 project(const Point& p) const + { + return typename R::Point_2(x(p),y(p)); + } + + CGAL::Orientation operator()(const Point& p, + const Point& q, + const Point& r) const + { + return CGAL::orientation(project(p), project(q), project(r)); + } +}; + +template +class Side_of_oriented_circle_projected_3 +{ +public: + typedef typename R::Point_3 Point; + typename R::FT x(const Point &p) const { return Projector::x(p); } + typename R::FT y(const Point &p) const { return Projector::y(p); } + + + typename R::Point_2 project(const Point& p) const + { + return typename R::Point_2(x(p),y(p)); + } + CGAL::Oriented_side operator() (const Point &p, + const Point &q, + const Point &r, + const Point &s) const + { + return CGAL::side_of_oriented_circle(project(p),project(q),project(r),project(s) ); + } +}; + +template +class Side_of_bounded_circle_projected_3 +{ +public: + typedef typename R::Point_3 Point; + typename R::FT x(const Point &p) const { return Projector::x(p); } + typename R::FT y(const Point &p) const { return Projector::y(p); } + + + typename R::Point_2 project(const Point& p) const + { + return typename R::Point_2(x(p),y(p)); + } + CGAL::Bounded_side operator() (const Point &p, + const Point &q, + const Point &r, + const Point &s) const + { + return CGAL::side_of_bounded_circle(project(p),project(q),project(r),project(s) ); + } + + CGAL::Bounded_side operator() (const Point &p, + const Point &q, + const Point &r) const + { + return CGAL::side_of_bounded_circle(project(p),project(q),project(r)); + } +}; + +template +class Compare_distance_projected_3 +{ +public: + typedef typename R::Point_3 Point_3; + typedef typename R::Point_2 Point_2; + typedef typename R::FT RT; + typename R::FT x(const Point_3 &p) const { return Projector::x(p); } + typename R::FT y(const Point_3 &p) const { return Projector::y(p); } + + Point_2 project(const Point_3& p) const + { + return Point_2(x(p),y(p)); + } + + Comparison_result operator()(const Point_3& p,const Point_3& q,const Point_3& r) const + { + Point_2 p2 = project(p); + Point_2 q2 = project(q); + Point_2 r2 = project(r); + return compare_distance_to_point(p2,q2,r2); + } +}; + +template +class Squared_distance_projected_3 +{ +public: + typedef typename R::Point_3 Point_3; + typedef typename R::Point_2 Point_2; + typedef typename R::Line_3 Line_3; + typedef typename R::Line_2 Line_2; + typedef typename R::FT RT; + typename R::FT x(const Point_3 &p) const { return Projector::x(p); } + typename R::FT y(const Point_3 &p) const { return Projector::y(p); } + + Point_2 project(const Point_3& p) const + { + return Point_2(x(p),y(p)); + } + + RT operator()(const Point_3& p, const Point_3& q) const + { + Point_2 p2(project(p)); + Point_2 q2(project(q)); + return squared_distance(p2, q2); + } + + RT operator()(const Line_3& l, const Point_3& p) const + { + Point_2 p2(project(p)); + Line_2 l2(project(l.point(0)), project(l.point(1))); + return squared_distance(p2, l2); + } +}; + +template +class Intersect_projected_3 +{ +public: + typedef typename R::Point_3 Point_3; + typedef typename R::Segment_3 Segment_3; + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Segment_2 Segment_2; + typedef typename R::FT FT; + + typename R::FT x(const Point_3 &p) const { return Projector::x(p); } + typename R::FT y(const Point_3 &p) const { return Projector::y(p); } + + Point_2 project(const Point_3& p) const + { + return Point_2(x(p),y(p)); + } + + FT alpha(const Point_2& p, const Point_2& source, const Point_2& target) const + { + FT dx = target.x() - source.x(); + FT dy = target.y() - source.y(); + return (CGAL::abs(dx)>CGAL::abs(dy)) ? ( p.x()-source.x() ) / dx : (p.y()-source.y() ) / dy; + } + + Object operator()(const Segment_3& s1, const Segment_3& s2) const + { + Point_2 s1_source = project(s1.source()); + Point_2 s1_target = project(s1.target()); + Point_2 s2_source = project(s2.source()); + Point_2 s2_target = project(s2.target()); + Segment_2 s1_2(s1_source, s1_target); + Segment_2 s2_2(s2_source, s2_target); + CGAL_precondition(!s1_2.is_degenerate()); + CGAL_precondition(!s2_2.is_degenerate()); + + //compute intersection points in projected plane + //We know that none of the segment is degenerate + Object o = intersection(s1_2,s2_2); + const Point_2* pi=CGAL::object_cast(&o); + if (pi==NULL) { //case of segment or empty + const Segment_2* si=CGAL::object_cast(&o); + if (si==NULL) return Object(); + FT src[3],tgt[3]; + //the third coordinate is the midpoint between the points on s1 and s2 + FT z1 = s1.source()[dim] + ( alpha(si->source(), s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); + FT z2 = s2.source()[dim] + ( alpha(si->source(), s2_source, s2_target) * ( s2.target()[dim] - s2.source()[dim] )); + src[dim] = (z1+z2) / FT(2); + + + z1 = s1.source()[dim] + ( alpha(si->target(), s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); + z2 = s2.source()[dim] + ( alpha(si->target(), s2_source, s2_target) * ( s2.target()[dim] - s2.source()[dim] )); + + tgt[dim] = (z1+z2) / FT(2); + + + src[Projector::x_index] = si->source().x(); + src[Projector::y_index] = si->source().y(); + tgt[Projector::x_index] = si->target().x(); + tgt[Projector::y_index] = si->target().y(); + return make_object( Segment_3( Point_3(src[0],src[1],src[2]),Point_3(tgt[0],tgt[1],tgt[2]) ) ); + } + FT coords[3]; + //compute the third coordinate of the projected intersection point onto 3D segments + FT z1 = s1.source()[dim] + ( alpha(*pi, s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); + FT z2 = s2.source()[dim] + ( alpha(*pi, s2_source, s2_target) * ( s2.target()[dim] - s2.source()[dim] )); + + coords[dim] = (z1+z2) / FT(2); + coords[Projector::x_index] = pi->x(); + coords[Projector::y_index] = pi->y(); + + Point_3 res(coords[0],coords[1],coords[2]); + CGAL_assertion(x(res)==pi->x() && y(res)==pi->y()); + return make_object(res); + } +}; + +template +class Circumcenter_center_projected +{ + typedef typename R::Point_3 Point_3; + typedef typename R::Point_2 Point_2; + + typename R::FT x(const Point_3 &p) const { return Projector::x(p); } + typename R::FT y(const Point_3 &p) const { return Projector::y(p); } + + Point_2 project(const Point_3& p) const + { + return Point_2(x(p),y(p)); + } + + Point_3 embed (const Point_2& p) const + { + typename R::FT coords[3]; + coords[Projector::x_index]=p.x(); + coords[Projector::y_index]=p.y(); + coords[dim]=typename R::FT(0); + return Point_3(coords[0],coords[1],coords[2]); + } + +public: + Point_3 operator() (const Point_3& p1,const Point_3& p2) const + { + return embed( circumcenter(project(p1),project(p2)) ); + } + + Point_3 operator() (const Point_3& p1,const Point_3& p2,const Point_3& p3) const + { + return embed( circumcenter(project(p1),project(p2),project(p3)) ); + } +}; + +template +class Compute_area_projected +{ + typedef typename R::Point_3 Point_3; + typedef typename R::Point_2 Point_2; + + typename R::FT x(const Point_3 &p) const { return Projector::x(p); } + typename R::FT y(const Point_3 &p) const { return Projector::y(p); } + + Point_2 project(const Point_3& p) const + { + return Point_2(x(p),y(p)); + } + + +public: + typename R::FT operator() (const Point_3& p1,const Point_3& p2,const Point_3& p3) const + { + return R().compute_area_2_object() ( project(p1),project(p2),project(p3) ); + } +}; + +template +class Compute_squared_radius_projected +{ + typedef typename R::Point_3 Point_3; + typedef typename R::Point_2 Point_2; + + typename R::FT x(const Point_3 &p) const { return Projector::x(p); } + typename R::FT y(const Point_3 &p) const { return Projector::y(p); } + + Point_2 project(const Point_3& p) const + { + return Point_2(x(p),y(p)); + } + + +public: + typename R::FT operator() (const Point_3& p1,const Point_3& p2,const Point_3& p3) const + { + return R().compute_squared_radius_2_object() ( project(p1),project(p2),project(p3) ); + } + typename R::FT operator() (const Point_3& p1,const Point_3& p2) const + { + return R().compute_squared_radius_2_object() ( project(p1),project(p2) ); + } + + typename R::FT operator() (const Point_3& p1) const + { + return R().compute_squared_radius_2_object() ( project(p1) ); + } +}; + +template < class R, int dim > +class Projection_traits_3 { +public: + typedef Projection_traits_3 Traits; + typedef R Rp; + typedef typename R::FT FT; + typedef typename Rp::Point_3 Point_2; + typedef typename Rp::Segment_3 Segment_2; + typedef typename Rp::Vector_3 Vector_2; + typedef typename Rp::Triangle_3 Triangle_2; + typedef typename Rp::Line_3 Line_2; + + typedef typename Projector::Less_x_2 Less_x_2; + typedef typename Projector::Less_y_2 Less_y_2; + typedef typename Projector::Compare_x_2 Compare_x_2; + typedef typename Projector::Compare_y_2 Compare_y_2; + typedef Orientation_projected_3 Orientation_2; + typedef typename Rp::Angle_3 Angle_2; + typedef Side_of_oriented_circle_projected_3 Side_of_oriented_circle_2; + typedef Side_of_bounded_circle_projected_3 Side_of_bounded_circle_2; + typedef Compare_distance_projected_3 Compare_distance_2; + typedef Squared_distance_projected_3 Compute_squared_distance_2; + typedef Intersect_projected_3 Intersect_2; + typedef Compute_squared_radius_projected Compute_squared_radius_2; + typedef typename Rp::Construct_segment_3 Construct_segment_2; + typedef typename Rp::Construct_translated_point_3 Construct_translated_point_2; + typedef typename Rp::Construct_midpoint_3 Construct_midpoint_2; + typedef typename Rp::Construct_vector_3 Construct_vector_2; + typedef typename Rp::Construct_scaled_vector_3 Construct_scaled_vector_2; + typedef typename Rp::Construct_triangle_3 Construct_triangle_2; + typedef typename Rp::Construct_line_3 Construct_line_2; + + struct Less_xy_2 { + typedef bool result_type; + bool operator()(const Point_2& p, const Point_2& q) const + { + Compare_x_2 cx; + Comparison_result crx = cx(p,q); + if(crx == SMALLER){ return true;} + if(crx == LARGER){return false;} + Less_y_2 ly; + return ly(p,q); + } + }; + + + struct Less_yx_2 { + typedef bool result_type; + bool operator()(const Point_2& p, const Point_2& q) const + { + Compare_y_2 cy; + Comparison_result cry = cy(p,q); + if(cry == SMALLER){ return true;} + if(cry == LARGER){return false;} + Less_x_2 lx; + return lx(p,q); + } + }; + + struct Equal_2 { + typedef bool result_type; + bool operator()(const Point_2& p, const Point_2& q) const + { + + Equal_x_2 eqx; + Equal_y_2 eqy; + return eqx(p,q) & eqy(p,q); + } + }; + + struct Left_turn_2 { + typedef bool result_type; + bool operator()(const Point_2& p, const Point_2& q, const Point_2& r) const + { + + Orientation_2 ori; + return ori(p,q,r) == LEFT_TURN; + } + }; + + //for natural_neighbor_coordinates_2 + typedef typename Projector::Equal_x_2 Equal_x_2; + typedef typename Projector::Equal_y_2 Equal_y_2; + typedef Circumcenter_center_projected Construct_circumcenter_2; + typedef Compute_area_projected Compute_area_2; + Construct_circumcenter_2 construct_circumcenter_2_object () const {return Construct_circumcenter_2();} + Compute_area_2 compute_area_2_object () const {return Compute_area_2();} + + + // for compatibility with previous versions + typedef Point_2 Point; + typedef Segment_2 Segment; + typedef Triangle_2 Triangle; + + Projection_traits_3(){} + Projection_traits_3( + const Projection_traits_3&){} + Projection_traits_3 &operator=( + const Projection_traits_3&){return *this;} + + typename Rp::FT x(const Point_2 &p) const { return Projector::x(p); } + typename Rp::FT y(const Point_2 &p) const { return Projector::y(p); } + + + Equal_2 + equal_2_object() const + { return Equal_2();} + + Left_turn_2 + left_turn_2_object() const + { return Left_turn_2();} + + Less_x_2 + less_x_2_object() const + { return Less_x_2();} + + Less_xy_2 + less_xy_2_object() const + { return Less_xy_2();} + + Less_yx_2 + less_yx_2_object() const + { return Less_yx_2();} + + Less_y_2 + less_y_2_object() const + { return Less_y_2();} + Compare_x_2 + compare_x_2_object() const + { return Compare_x_2();} + Angle_2 + angle_2_object() const { + return Angle_2(); + } + + Compare_y_2 + compare_y_2_object() const + { return Compare_y_2();} + + Orientation_2 + orientation_2_object() const + { return Orientation_2();} + + Side_of_oriented_circle_2 + side_of_oriented_circle_2_object() const + {return Side_of_oriented_circle_2();} + + Side_of_bounded_circle_2 + side_of_bounded_circle_2_object() const + {return Side_of_bounded_circle_2();} + + Compare_distance_2 + compare_distance_2_object() const + { + return Compare_distance_2(); + } + + Compute_squared_distance_2 + compute_squared_distance_2_object () const + { + return Compute_squared_distance_2(); + } + + Compute_squared_radius_2 + compute_squared_radius_2_object () const + { + return Compute_squared_radius_2(); + } + + Intersect_2 + intersect_2_object () const + { + return Intersect_2(); + } + + Construct_segment_2 construct_segment_2_object() const + {return Construct_segment_2();} + + Construct_translated_point_2 construct_translated_point_2_object() const + {return Construct_translated_point_2();} + + Construct_midpoint_2 construct_midpoint_2_object() const + {return Construct_midpoint_2();} + + Construct_vector_2 construct_vector_2_object() const + {return Construct_vector_2();} + + Construct_scaled_vector_2 construct_scaled_vector_2_object() const + {return Construct_scaled_vector_2();} + + Construct_triangle_2 construct_triangle_2_object() const + {return Construct_triangle_2();} + + Construct_line_2 construct_line_2_object() const + {return Construct_line_2();} + +}; + + +} } //namespace CGAL::internal + +#endif // CGAL_INTERNAL_PROJECTION_TRAITS_3_H diff --git a/Kernel_23/include/CGAL/kernel_basic.h b/Kernel_23/include/CGAL/kernel_basic.h index ee3f4b37973..8d1acee9f07 100644 --- a/Kernel_23/include/CGAL/kernel_basic.h +++ b/Kernel_23/include/CGAL/kernel_basic.h @@ -25,17 +25,7 @@ #ifndef CGAL_KERNEL_BASIC_H #define CGAL_KERNEL_BASIC_H -#ifndef CGAL_KERNEL_INLINE -# define CGAL_KERNEL_INLINE inline -#endif - -#ifndef CGAL_KERNEL_MEDIUM_INLINE -# define CGAL_KERNEL_MEDIUM_INLINE -#endif - -#ifndef CGAL_KERNEL_LARGE_INLINE -# define CGAL_KERNEL_LARGE_INLINE -#endif +#include #include #include diff --git a/Kernel_23/include/CGAL/kernel_config.h b/Kernel_23/include/CGAL/kernel_config.h new file mode 100644 index 00000000000..ebb23a61967 --- /dev/null +++ b/Kernel_23/include/CGAL/kernel_config.h @@ -0,0 +1,40 @@ +// Copyright (c) 1999,2003 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// 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$ +// $Id$ +// +// +// Author(s) : Stefan Schirra + +#ifndef CGAL_KERNEL_CONFIG_H +#define CGAL_KERNEL_CONFIG_H + +#ifndef CGAL_KERNEL_INLINE +# define CGAL_KERNEL_INLINE inline +#endif + +#ifndef CGAL_KERNEL_MEDIUM_INLINE +# define CGAL_KERNEL_MEDIUM_INLINE +#endif + +#ifndef CGAL_KERNEL_LARGE_INLINE +# define CGAL_KERNEL_LARGE_INLINE +#endif + +#endif // CGAL_KERNEL_CONFIG_H diff --git a/Kernel_23/include/CGAL/kernel_to_kernel.h b/Kernel_23/include/CGAL/kernel_to_kernel.h index ba9957759b1..5c3f8c84646 100644 --- a/Kernel_23/include/CGAL/kernel_to_kernel.h +++ b/Kernel_23/include/CGAL/kernel_to_kernel.h @@ -37,6 +37,11 @@ #endif #endif +#include +#include +#include +#include + namespace CGAL { template diff --git a/Kernel_23/include/CGAL/predicates/sign_of_determinant.h b/Kernel_23/include/CGAL/predicates/sign_of_determinant.h index 221f1e38571..3b3d1267131 100644 --- a/Kernel_23/include/CGAL/predicates/sign_of_determinant.h +++ b/Kernel_23/include/CGAL/predicates/sign_of_determinant.h @@ -27,6 +27,7 @@ #define CGAL_PREDICATES_SIGN_OF_DETERMINANT_H #include +#include namespace CGAL { diff --git a/Kernel_23/include/CGAL/rational_rotation.h b/Kernel_23/include/CGAL/rational_rotation.h index fd8a7e805d0..60d70926abb 100644 --- a/Kernel_23/include/CGAL/rational_rotation.h +++ b/Kernel_23/include/CGAL/rational_rotation.h @@ -27,6 +27,7 @@ #define CGAL_RATIONAL_ROTATION_H #include +#include namespace CGAL { diff --git a/Kernel_d/include/CGAL/constructions_d.h b/Kernel_d/include/CGAL/constructions_d.h index c1f44d5c152..c6733619149 100644 --- a/Kernel_d/include/CGAL/constructions_d.h +++ b/Kernel_d/include/CGAL/constructions_d.h @@ -55,7 +55,7 @@ Point_d midpoint(const Point_d& p, const Point_d& q) template Point_d center_of_sphere(Forward_iterator start, Forward_iterator end) -{ typename R::Center_of_sphereHd center; +{ typename R::Center_of_sphere_d center; return center(start,end); } template typename R::FT diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/Sort.h b/Kinetic_data_structures/include/CGAL/Kinetic/Sort.h index dd4a286f16a..d5e0a34ad57 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/Sort.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/Sort.h @@ -14,7 +14,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Daniel Russel @@ -54,7 +54,7 @@ template class Sort: typedef typename Traits::Active_points_1_table TTable; typedef typename Traits::Kinetic_kernel::Compare_x_1 KLess; typedef typename Traits::Instantaneous_kernel::Compare_x_1 IComp; - + //typedef typename Traits::Instantaneous_kernel::Compare_x_1 ILess; typedef Sort This; @@ -69,7 +69,7 @@ template class Sort: // STL algorithms want less rather than compare. So we need to convert. struct ILess { ILess(IComp ic): ic_(ic){} - + bool operator()(Object_key a, Object_key b) const { bool ret=( ic_(a,b) == CGAL::SMALLER); return ret; @@ -113,16 +113,16 @@ template class Sort: } Less less_; }*/ - + typedef Swap_event Event; friend class Swap_event; // Redirects the Simulator notifications to function calls CGAL_KINETIC_DECLARE_LISTENERS(typename Traits::Simulator, typename Active_objects_table) public: - + // Register this KDS with the MovingObjectTable and the Simulator - Sort(Traits tr, Visitor v=Visitor()/*, + Sort(Traits tr, Visitor v=Visitor()/*, typedef Active_objects_table::Handle aot, Kinetic_less kless=tr.kinetic_kernel_object().is_less_x_1_object(), Instantaneous_less iless*/): compare_(tr.kinetic_kernel_object().compare_x_1_object()), @@ -161,9 +161,9 @@ public: k, iless_); CGAL_LOG(Log::LOTS, "\nInserting " << k); if (it != sorted_.end()) { - CGAL_LOG(Log::LOTS, " before " << it->object() <object() <delete_event(n->event()); n->set_event(Event_key()); } - + it->swap(*n); - + CGAL_LOG(Log::LOTS, "Updating next certificate " << std::endl); if (n != sorted_.end()) { rebuild_certificate(n); @@ -241,14 +241,14 @@ public: } else { it->set_event(simulator_->null_event()); } - - + + CGAL_LOG(Log::LOTS, "Updating prev certificate " << std::endl); if (it != sorted_.begin()) { rebuild_certificate(prior(it)); } v_.post_swap(it, n); - + CGAL_LOG_WRITE(Log::LOTS, write(LOG_STREAM)); } @@ -261,18 +261,18 @@ public: std::cerr << "ERROR: objects " << it->object() << " and " << next(it)->object() << " are out of order.\n"; std::cerr << "Kinetic are " << aot_->at(it->object()) << " and " << aot_->at(*next(it)) << std::endl; - std::cerr << "Time is " << ik_.time() << std::endl; - /*std::cerr << "Static are " << ik_.current_coordinates_object()(it->object()) << " and " + std::cerr << "Time is " << ik_.time() << std::endl; + /*std::cerr << "Static are " << ik_.current_coordinates_object()(it->object()) << " and " << ik_.current_coordinates_object()(next(it)->object()) << std::endl;*/ std::cerr << "ERROR: order is "; #else if (warned_.find(*it) == warned_.end() || warned_[*it].find(*next(it)) == warned_[*it].end()) { - std::cerr << "WARNING: objects " << it->object() << " and " + std::cerr << "NUMERIC ISSUE: objects " << it->object() << " and " << next(it)->object() << " are out of order.\n"; std::cerr << aot_->at(it->object()) << " and " << aot_->at(next(it)->object()) << std::endl; - std::cerr << "Time is " << ik_.time() << std::endl; - std::cerr << "WARNING: order is "; + std::cerr << "Time is " << ik_.time() << std::endl; + std::cerr << "NUMERIC ISSUE: order is "; } #endif write(std::cerr); @@ -288,25 +288,25 @@ public: } } } - if (compare_.sign_at( aot_->at(it->object()), + if (compare_.sign_at( aot_->at(it->object()), aot_->at(next(it)->object()), simulator_->current_time()) == CGAL::LARGER) { #ifdef CGAL_KINETIC_CHECK_EXACTNESS std::cerr << "ERROR: kinetic objects " << it->object() << " and " << next(it)->object() << " are out of order.\n"; std::cerr << "Kinetic are " << aot_->at(it->object()) << " and " << aot_->at(*next(it)) << std::endl; - std::cerr << "Time is " <object()) << " and " + std::cerr << "Time is " <object()) << " and " << ik_.current_coordinates_object()(next(it)->object()) << std::endl;*/ std::cerr << "ERROR: order is "; #else if (warned_.find(*it) == warned_.end() || warned_[*it].find(*next(it)) == warned_[*it].end()) { - std::cerr << "WARNING: objects " << it->object() << " and " + std::cerr << "NUMERIC ISSUE: objects " << it->object() << " and " << next(it)->object() << " are out of order.\n"; std::cerr << aot_->at(it->object()) << " and " << aot_->at(next(it)->object()) << std::endl; - std::cerr << "Time is " <::const_iterator it = sorted_.begin(); it->object() != sorted_.back().object(); ++it) { @@ -371,7 +371,7 @@ public: //iterator it = std::equal_range(sorted_.begin(), sorted_.end(),k).first; CGAL_precondition(it != sorted_.end()); CGAL_precondition(it->object() == k); - + v_.pre_remove_vertex(it); if (next(it) != Iterator(end())) { simulator_->delete_event(it->event()); @@ -453,7 +453,7 @@ public: if (s_.will_fail()) out << " next is " << s_.failure_time(); else out << " out of failures"; } - void audit(typename Sort::Event_key + void audit(typename Sort::Event_key #ifndef NDEBUG tk #endif diff --git a/Kinetic_data_structures/test/Kinetic_data_structures/Delaunay_triangulation_2.cpp b/Kinetic_data_structures/test/Kinetic_data_structures/test_KDS_Delaunay_triangulation_2.cpp similarity index 100% rename from Kinetic_data_structures/test/Kinetic_data_structures/Delaunay_triangulation_2.cpp rename to Kinetic_data_structures/test/Kinetic_data_structures/test_KDS_Delaunay_triangulation_2.cpp diff --git a/Kinetic_data_structures/test/Polynomial_kernel/include/Check_solver.h b/Kinetic_data_structures/test/Polynomial_kernel/include/Check_solver.h index 23eb1a1c917..5dc41b49884 100644 --- a/Kinetic_data_structures/test/Polynomial_kernel/include/Check_solver.h +++ b/Kinetic_data_structures/test/Polynomial_kernel/include/Check_solver.h @@ -36,7 +36,7 @@ public: /*void time_estimate(const Fn &, const Rt& , False){ } - + void time_estimate(const Fn &q, const Rt& start, True){ Root_stack s= k_.root_stack_object(q, start, std::numeric_limits::infinity()); CGAL::Timer timer; @@ -92,7 +92,7 @@ public: if (reps==0 && verbose) { //comp.push_back(CGAL::to_double(r)); if (last_root > s.top()) { - std::cerr << "WARNING last root was " << last_root << " and current root is " + std::cerr << "NUMERIC ISSUE last root was " << last_root << " and current root is " << s.top() << std::endl; } CGAL_assertion(last_root<= s.top()); @@ -103,13 +103,13 @@ public: int i=0; }*/ roots.push_back(s.top()); - + std::cout << "<" << CGAL::to_double(s.top()); //if (iem(s.top())) { std::cout <<"E";} std::cout << "> " << std::flush; /*} else { - + }*/ } s.pop(); @@ -152,11 +152,11 @@ public: std::cout << std::endl; for (unsigned int i=0; i< taken_maple.size(); ++i) { if (!taken_maple[i]) - std::cerr << "WARNING Missing " << roots_b[i] << std::endl; + std::cerr << "NUMERIC ISSUE Missing " << roots_b[i] << std::endl; } for (unsigned int i=0; i< taken_solver.size(); ++i) { - if (!taken_solver[i]) std::cerr << "WARNING Extra " << roots[i] << std::endl; + if (!taken_solver[i]) std::cerr << "NUMERIC ISSUE Extra " << roots[i] << std::endl; } } diff --git a/Maintenance/git/authors-file.txt b/Maintenance/git/authors-file.txt index 5e3b0b9dce7..370b551e152 100644 --- a/Maintenance/git/authors-file.txt +++ b/Maintenance/git/authors-file.txt @@ -19,21 +19,22 @@ baruchzu = Baruch Zukerman bgalehouse = Ben Galehouse cbonetto = Carine Bonetto cdelage = Christophe Delage -cgal-web-admin = CGAL Web Admin +cgal-web-admin = CGAL Web Admin cggaurav = Gaurav Chandrashekar cjamin = ClÃĐment Jamin -cvs2svn = CVS2SVN tool +cvs2svn = CVS2SVN tool cwerner = Claudia Werner cwormser = Camille Wormser danha = Dan Halperin dave = David Millman dboltcheva = Dobrina Boltcheva dima = Dmitrii V Pasechnik +drorata = Dror Atariah drussel = Daniel Russel dtyagi = Devashish Tyagi efif = Efi Fogel elip = Eli Packer -eric = Eric Berberich +eric = Eric Berberich estere = Ester Ezra eug = Eugene Lipovetsky fcacciola = Fernando Cacciola @@ -91,7 +92,7 @@ naamamay = Naama Mayer nicokruithof = Nico Kruithof nmeskini = Naceur Meskini nsalman = Nader Salman -odevil = Olivier Devillers +odevil = Olivier Devillers olivierrouiller = Olivier Rouiller ophirset = Ophir Setter orenzalz = Oren Salzman @@ -100,12 +101,15 @@ ovgrig = Ovidiu Grigore palliez = Pierre Alliez penarand = Luis PeÃąaranda pivanov = Petar Ivanov +pgiannop = Panos Giannopoulos +philaris = Panagiotis Cheilaris pmachado = Pedro Machado Manhaes de Castro pmemari = Pooran Memari pmoeller = Philipp MÃķller rahul = Rahul Ray rchaine = RaphaÃŦlle Chaine reichel = Joachim Reichel +rlhemsley = Ross Hemsley rozapoga = Roza Pogalnikova rschindl = Ralf Schindlbeck rursu = Radu Ursu diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release index 379ad4c7383..5a5500543f9 100755 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release @@ -3,7 +3,14 @@ LC_ALL=POSIX; export LC_ALL -svn up "$1" +if [ -d "$1/.git" ]; then + pushd $1 + git pull + popd +else + svn up "$1" +fi + # Update the candidates branch, if any. [ -d "$2" ] && svn up "$2" diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index 7300c601801..7b37a666cb1 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -9,6 +9,8 @@ # | | | | | # * * * * * command to be executed +PATH=/bin:/usr/bin:/home/lrineau/bin +LC_CTYPE=en_US.UTF-8 # Update testsuite result pages 5,15,25,35,45,55 * * * * cd $HOME/CGAL/collect_and_public_testresults; ./treat_result_collection @@ -19,9 +21,9 @@ # "next" alone 0 21 * * Sat cd $HOME/CGAL/create_internal_release && $HOME/bin/create_release $HOME/CGAL/next --public --do-it # "next" + candidates -0 21 * * Mon,Tue,Wed,Thu cd $HOME/CGAL/create_internal_release && $HOME/bin/create_release $HOME/CGAL/next $HOME/CGAL/candidate-packages --public --do-it +0 21 * * Fri cd $HOME/CGAL/create_internal_release && $HOME/bin/create_release $HOME/CGAL/next $HOME/CGAL/candidate-packages --public --do-it # from branch 4.1 -0 21 * * Sun,Fri cd $HOME/CGAL/create_internal_release-4.1-branch && $HOME/bin/create_release $HOME/CGAL/CGAL-4.1-branch --public --do-it +0 21 * * Mon,Tue,Wed,Thu,Sun cd $HOME/CGAL/create_internal_release-4.1-branch && $HOME/bin/create_release $HOME/CGAL/CGAL-4.1-branch --public --do-it # Try to launch the test suite, every 10mn, from 21:00 to 22:50 @@ -30,6 +32,9 @@ # Manual Test suite, at 9:40pm 40 21 * * * cd $HOME/CGAL/releases-and-testsuites-with-cmake/CGAL-I/doc_tex; nice -19 $HOME/bin/cgal_manual -testsuite || true +# Doxygen Test suite, at 9:05pm +20 21 * * * time $HOME/CGAL/python-3.3/bin/python3 $HOME/CGAL/doxy-port-pmoeller/Documentation/testsuite.py --doxyassist $HOME/CGAL/doxyassist/doxyassist.py --doxygen $HOME/CGAL/doxygen-svn/bin/doxygen --documentation $HOME/CGAL/doxy-port-pmoeller/Documentation --publish /var/CGAL/www/Members/Doxygen_test/ --do-update --do-purge-rebuild + # Dump the crontab to SVN every hour at minute 18 18 * * * * $HOME/bin/dump_crontab diff --git a/Maintenance/public_release/announcement/CGAL-4.1 b/Maintenance/public_release/announcement/CGAL-4.1 new file mode 100644 index 00000000000..0210dc1ea41 --- /dev/null +++ b/Maintenance/public_release/announcement/CGAL-4.1 @@ -0,0 +1,64 @@ +Subject: CGAL 4.1 Released, Computational Geometry Algorithms Library +Body: + +The CGAL Open Source Project is pleased to announce the release 4.1 +of CGAL, the Computational Geometry Algorithms Library. + +Besides fixes to existing packages, the following has changed since +CGAL 4.1: + + o New compiler support + + The Apple Clang compiler versions 3.1 and 3.2 are now supported on + Mac OS X. + + +See http://www.cgal.org/releases.html for a complete list of changes. + + +Note that the release 4.1 of CGAL has known bugs that should be fixed soon +in a future release 4.1.1: + + - The packages "Triangulated Surface Mesh Simplification" and "CGAL and + the Boost Graph Library" do not compile with Boost versions 1.51 and + later. + + +The CGAL project is a collaborative effort to develop a robust, +easy-to-use, and efficient C++ software library of geometric data +structures and algorithms, like +- triangulations (2D constrained triangulations and Delaunay + triangulations in 2D and 3D, periodic triangulations), +- Voronoi diagrams (for 2D and 3D points, 2D additively weighted + Voronoi diagrams, and segment Voronoi diagrams), +- Boolean operations on polygons and polyhedra, +- regularized Boolean operations on polygons with curved arcs +- arrangements of curves, +- mesh generation (2D, 3D and surface mesh generation, + surface mesh subdivision and parametrization), +- alpha shapes (in 2D and 3D), +- convex hull algorithms (in 2D, 3D and dD), +- operations on polygons (straight skeleton and offset polygon), +- search structures (kd trees for nearest neighbor search, and + range and segment trees), +- interpolation (natural neighbor interpolation and placement of + streamlines), +- optimization algorithms (smallest enclosing sphere of points or + spheres, smallest enclosing ellipsoid of points, principal + component analysis), +- kinetic data structures + + + + +Some modules are distributed under the terms of the LGPL Open Source +license (GNU Lesser General Public License v3 or later versions). +Most modules are distributed under the terms of the GPL Open Source +license (GNU General Public License v3 or later versions). +If your intended usage does not meet the criteria of the +aforementioned licenses, a commercial license can be purchased from +GeometryFactory (http://www.geometryfactory.com/). + + +For further information and for downloading the library and its +documentation, please visit the CGAL web site: http://www.cgal.org/ diff --git a/Maintenance/public_release/announcement/where_to_announce b/Maintenance/public_release/announcement/where_to_announce index 965a16eb4b9..223152ccf70 100644 --- a/Maintenance/public_release/announcement/where_to_announce +++ b/Maintenance/public_release/announcement/where_to_announce @@ -6,17 +6,17 @@ and discuss lists. Mailing lists: ********************************************************************* - ** Note: add a Reply-To: cgal-discuss@lists-sop.inria.fr, to avoid ** + ** Note: add a Reply-To: cgal-discuss@inria.fr, to avoid ** ** cross-post replies. ** ********************************************************************* - cgal-develop@lists-sop.inria.fr (best sent as blind carbon copy) - cgal-discuss@lists-sop.inria.fr - cgal-announce@lists-sop.inria.fr + cgal-develop@inria.fr (best sent as blind carbon copy) + cgal-discuss@inria.fr + cgal-announce@inria.fr And only for feature releases (not bug-fixes): - compgeom-announce@lists-sop.inria.fr + compgeom-announce@inria.fr mesh@sandia.gov communaute@medicis.polytechnique.fr diff --git a/Maintenance/public_release/scripts/prepare_release b/Maintenance/public_release/scripts/prepare_release index 626db7922e6..0c149da5572 100755 --- a/Maintenance/public_release/scripts/prepare_release +++ b/Maintenance/public_release/scripts/prepare_release @@ -76,7 +76,7 @@ popd printf "Now use:\n" printf " cd ${DEST_DIR}\n" printf " mv cgal_manual.zip /var/CGAL/www/%s/Manual/\n" "${PUBLIC_RELEASE_NAME#CGAL-}" -printf " rsync --compress -av doc_html examples include %s:www.cgal.org/Manual/%s\n" \ +printf " rsync --compress -av doc_html examples include %s:/www/inf-websites/doc.cgal.org/Manual/%s\n" \ cgal@contact.mpi-inf.mpg.de \ "${PUBLIC_RELEASE_NAME#CGAL-}" diff --git a/Maintenance/test_handling/candidate_branches b/Maintenance/test_handling/candidate_branches index 02a044c49ac..1b26e37f438 100644 --- a/Maintenance/test_handling/candidate_branches +++ b/Maintenance/test_handling/candidate_branches @@ -2,3 +2,4 @@ Power_test_3-VC_64bit-GF unique_sqrt_extension-sloriot global_function_solve_1-hemmer Linear_cell_complex-gdamiand +Generator-Combination_enumerator-shornus diff --git a/Manual/doc_tex/Preliminaries/main.tex b/Manual/doc_tex/Preliminaries/main.tex index 9c9d10078f4..b614edd5a2d 100644 --- a/Manual/doc_tex/Preliminaries/main.tex +++ b/Manual/doc_tex/Preliminaries/main.tex @@ -99,13 +99,14 @@ to force its definition on the command line, and it is possible to prevent its d definition by setting \ccc{CGAL_HAS_NO_THREADS} from the command line. -\section{C++0x Support} +\section{C++11 Support} \cgal\ is based on the \CC\ standard released in 1998 (and later refined in 2003). -A new major version of this standard is being prepared, and is refered to as C++0x. +A new major version of this standard has been released, and is refered to as C++11. Some compilers and standard library implementations already provide some of the -functionality of this new standard, as a preview. For example, \gcc\ provides -a command-line switch \ccc{-std=c++0x} which enables some of those features. +functionality of this new standard. For example, \gcc\ provides +a command-line switch (\ccc{-std=c++0x} or \ccc{-std=c++11} depending on the compiler version) +which enables some of those features. \cgal\ attempts to support this mode progressively, and already makes use of some of these features if they are available, although no extensive support has diff --git a/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex b/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex index 3c885c9b2d5..68431ba10f3 100644 --- a/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex +++ b/Mesh_2/doc_tex/Mesh_2_ref/ConformingDelaunayTriangulationTraits_2.tex @@ -61,7 +61,8 @@ points on constrained edges. \ccMethod{Angle_2 angle_2_object();}{} \ccHasModels -Any model of \ccc{Kernel} concept. In particular, all \cgal\ kernels. +Any model of \ccc{Kernel} concept. In particular, all \cgal\ kernels.\\ +\ccc{Projection_traits_xy_3} \end{ccRefConcept} diff --git a/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex b/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex index ca26716fe5f..8fd1deecebc 100644 --- a/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex +++ b/Mesh_2/doc_tex/Mesh_2_ref/DelaunayMeshTraits_2.tex @@ -36,7 +36,8 @@ object \ccc{Construct_circumcenter_2}. \ccMethod{Compute_area_2 compute_area_2_object();}{} \ccHasModels -Any model of the \ccc{Kernel} concept. In particular, all \cgal\ kernels. +Any model of the \ccc{Kernel} concept. In particular, all \cgal\ kernels.\\ +\ccc{Projection_traits_xy_3} \end{ccRefConcept} diff --git a/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h b/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h index 9adf47aa3f2..f46096ddf12 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesh_criteria_2.h @@ -22,6 +22,7 @@ #define CGAL_DELAUNAY_MESH_CRITERIA_2_H #include +#include namespace CGAL { diff --git a/Mesh_2/include/CGAL/Filter_circulator.h b/Mesh_2/include/CGAL/Filter_circulator.h index 132bf2aeb8d..bf53f0d6db7 100644 --- a/Mesh_2/include/CGAL/Filter_circulator.h +++ b/Mesh_2/include/CGAL/Filter_circulator.h @@ -21,6 +21,9 @@ #ifndef CGAL_FILTRED_CIRCULATOR_H #define CGAL_FILTRED_CIRCULATOR_H +#include +#include + namespace CGAL { template diff --git a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h index 0ceb0ad7793..363bfefdb65 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Refine_edges.h @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include diff --git a/Mesh_2/include/CGAL/Mesher_level.h b/Mesh_2/include/CGAL/Mesher_level.h index 8e0c46ff335..5ba8f158ef2 100644 --- a/Mesh_2/include/CGAL/Mesher_level.h +++ b/Mesh_2/include/CGAL/Mesher_level.h @@ -21,6 +21,8 @@ #ifndef CGAL_MESHER_LEVEL_H #define CGAL_MESHER_LEVEL_H +#include + namespace CGAL { enum Mesher_level_conflict_status { diff --git a/Mesh_2/include/CGAL/Meshes/Triangulation_mesher_level_traits_3.h b/Mesh_2/include/CGAL/Meshes/Triangulation_mesher_level_traits_3.h index f8195ba3678..35dab457521 100644 --- a/Mesh_2/include/CGAL/Meshes/Triangulation_mesher_level_traits_3.h +++ b/Mesh_2/include/CGAL/Meshes/Triangulation_mesher_level_traits_3.h @@ -24,6 +24,7 @@ #include #include #include +#include namespace CGAL { diff --git a/Mesh_2/test/Mesh_2/test_mesh_terrain.cpp b/Mesh_2/test/Mesh_2/test_mesh_terrain.cpp new file mode 100644 index 00000000000..617e6945e90 --- /dev/null +++ b/Mesh_2/test/Mesh_2/test_mesh_terrain.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include +#include + +#include + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef CGAL::Projection_traits_xy_3 Gt; +typedef CGAL::Triangulation_vertex_base_2 Vb; +typedef CGAL::Delaunay_mesh_face_base_2 Fb; +typedef CGAL::Triangulation_data_structure_2 TDS; +typedef CGAL::Constrained_Delaunay_triangulation_2 Delaunay; +typedef CGAL::Delaunay_mesh_size_criteria_2 Criteria; + +typedef K::Point_3 Point; + +int main() +{ + Delaunay dt; + typedef Delaunay::Vertex_handle Vertex_handle; + Vertex_handle va = dt.insert(Point(-4,0, 0)); + Vertex_handle vb = dt.insert(Point(0,-1, 0)); + Vertex_handle vc = dt.insert(Point(4,0, 0)); + Vertex_handle vd = dt.insert(Point(0,1,0)); + dt.insert(Point(2, 0.6, 0)); + + dt.insert_constraint(va, vb); + dt.insert_constraint(vb, vc); + dt.insert_constraint(vc, vd); + dt.insert_constraint(vd, va); + + CGAL::refine_Delaunay_mesh_2(dt, Criteria(0.125, 0.5)); + // dt.insert(begin, end); + std::cout << dt.number_of_vertices() << std::endl; + return 0; +} diff --git a/Mesh_3/demo/Mesh_3/CMakeLists.txt b/Mesh_3/demo/Mesh_3/CMakeLists.txt index 5e595ec0643..a378373d890 100644 --- a/Mesh_3/demo/Mesh_3/CMakeLists.txt +++ b/Mesh_3/demo/Mesh_3/CMakeLists.txt @@ -43,6 +43,8 @@ find_package(OpenGL) # Find GLEW (for OpenGL-1.5 and OpenGL extensions) find_package(GLEW) +# Find everybodies darling +find_package(Boost COMPONENTS thread system) # Find QGLViewer if(QT4_FOUND) @@ -51,7 +53,7 @@ if(QT4_FOUND) endif(QT4_FOUND) -if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) +if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND AND Boost_FOUND) # Add directory containing implicit function plugin source files add_subdirectory("implicit_functions") @@ -131,7 +133,7 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) set(SCENE_SEGMENTED_IMAGE_ITEM_LIB "${MESH_3_LIB_PREFIX}scene_segmented_image_item") add_library(${SCENE_SEGMENTED_IMAGE_ITEM_LIB} SHARED Scene_segmented_image_item.cpp Scene_segmented_image_item.moc) - target_link_libraries(${SCENE_SEGMENTED_IMAGE_ITEM_LIB} ${SCENE_ITEM_LIB}) + target_link_libraries(${SCENE_SEGMENTED_IMAGE_ITEM_LIB} ${SCENE_ITEM_LIB} ${CGAL_LIBRARIES}) set_target_properties(${SCENE_SEGMENTED_IMAGE_ITEM_LIB} PROPERTIES DEFINE_SYMBOL scene_segmented_image_item_EXPORTS) if(GLEW_FOUND) @@ -141,19 +143,19 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) set(SCENE_POLYHEDRON_ITEM_LIB "${MESH_3_LIB_PREFIX}scene_polyhedron_item") add_library(${SCENE_POLYHEDRON_ITEM_LIB} SHARED Scene_polyhedron_item.cpp Scene_polyhedron_item.moc) - target_link_libraries(${SCENE_POLYHEDRON_ITEM_LIB} ${SCENE_ITEM_LIB}) + target_link_libraries(${SCENE_POLYHEDRON_ITEM_LIB} ${SCENE_ITEM_LIB} ${CGAL_LIBRARIES}) set_target_properties(${SCENE_POLYHEDRON_ITEM_LIB} PROPERTIES DEFINE_SYMBOL scene_polyhedron_item_EXPORTS) set(POLYGON_SOUP_LIB "${MESH_3_LIB_PREFIX}polygon_soup") add_library(${POLYGON_SOUP_LIB} SHARED Scene_polygon_soup.cpp Scene_polygon_soup.moc) - target_link_libraries(${POLYGON_SOUP_LIB} ${SCENE_ITEM_LIB}) + target_link_libraries(${POLYGON_SOUP_LIB} ${SCENE_ITEM_LIB} ${CGAL_LIBRARIES}) set_target_properties(${POLYGON_SOUP_LIB} PROPERTIES DEFINE_SYMBOL polygon_soup_EXPORTS) set(SCENE_C3T3_ITEM_LIB "${MESH_3_LIB_PREFIX}scene_c3t3_item") add_library(${SCENE_C3T3_ITEM_LIB} SHARED Scene_c3t3_item.cpp Scene_c3t3_item.moc) - target_link_libraries(${SCENE_C3T3_ITEM_LIB} ${SCENE_ITEM_LIB} ${QGLVIEWER_LIBRARIES} ${QT_LIBRARIES}) + target_link_libraries(${SCENE_C3T3_ITEM_LIB} ${SCENE_ITEM_LIB} ${QGLVIEWER_LIBRARIES} ${QT_LIBRARIES} ${CGAL_LIBRARIES} ${Boost_LIBRARIES}) set_target_properties(${SCENE_C3T3_ITEM_LIB} PROPERTIES DEFINE_SYMBOL scene_c3t3_item_EXPORTS) set(SCENE_IMPLICIT_FUNCTION_ITEM_LIB "${MESH_3_LIB_PREFIX}scene_implicit_function_item") @@ -289,7 +291,7 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) ${OPENGL_glu_LIBRARY}) -else (CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) +else (CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND AND Boost_FOUND) set(MESH_3_MISSING_DEPS "") @@ -309,9 +311,21 @@ else (CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) set(MESH_3_MISSING_DEPS "QGLViewer, ${MESH_3_MISSING_DEPS}") endif() + if(NOT QGLVIEWER_FOUND) + set(MESH_3_MISSING_DEPS "QGLViewer, ${MESH_3_MISSING_DEPS}") + endif() + + if(NOT QGLVIEWER_FOUND) + set(MESH_3_MISSING_DEPS "QGLViewer, ${MESH_3_MISSING_DEPS}") + endif() + + if(NOT Boost_FOUND) + set(MESH_3_MISSING_DEPS "Boost, ${MESH_3_MISSING_DEPS}") + endif() + message(STATUS "NOTICE: This demo requires ${MESH_3_MISSING_DEPS}and will not be compiled.") -endif (CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) +endif (CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND AND Boost_FOUND) diff --git a/Mesh_3/demo/Mesh_3/Io_c3t3_plugin.cpp b/Mesh_3/demo/Mesh_3/Io_c3t3_plugin.cpp index 38eefd06f89..3025ac10af1 100644 --- a/Mesh_3/demo/Mesh_3/Io_c3t3_plugin.cpp +++ b/Mesh_3/demo/Mesh_3/Io_c3t3_plugin.cpp @@ -29,9 +29,10 @@ Io_c3t3_plugin::nameFilters() const bool -Io_c3t3_plugin::canSave(const Scene_item*) +Io_c3t3_plugin::canSave(const Scene_item* item) { - return true; + const Scene_c3t3_item* c3t3_item = qobject_cast(item); + return c3t3_item != NULL; } bool diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index 6c3196201c9..6dd0cd0837f 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -36,16 +36,20 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "mesh_implicit_sphere_variable_size.cpp" ) create_single_source_cgal_program( "mesh_two_implicit_spheres_with_balls.cpp" ) # create_single_source_cgal_program( "mesh_implicit_domains.cpp" "implicit_functions.cpp" ) - if( CGAL_ImageIO_USE_ZLIB ) - create_single_source_cgal_program( "mesh_3D_image.cpp" ) - create_single_source_cgal_program( "mesh_3D_image_variable_size.cpp" ) - else() - message( STATUS "NOTICE: The example mesh_3D_image.cpp needs CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." ) - endif() - create_single_source_cgal_program( "mesh_polyhedral_domain.cpp" ) + create_single_source_cgal_program( "mesh_polyhedral_domain.cpp" ) create_single_source_cgal_program( "mesh_polyhedral_domain_with_features.cpp" ) - create_single_source_cgal_program( "mesh_optimization_example.cpp" ) - create_single_source_cgal_program( "mesh_optimization_lloyd_example.cpp" ) + if( WITH_CGAL_ImageIO ) + create_single_source_cgal_program( "mesh_optimization_example.cpp" ) + create_single_source_cgal_program( "mesh_optimization_lloyd_example.cpp" ) + if( CGAL_ImageIO_USE_ZLIB ) + create_single_source_cgal_program( "mesh_3D_image.cpp" ) + create_single_source_cgal_program( "mesh_3D_image_variable_size.cpp" ) + else() + message( STATUS "NOTICE: The examples mesh_3D_image.cpp and mesh_3D_image_variable_size.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." ) + endif() + else() + message( STATUS "NOTICE: Some examples need the CGAL_ImageIO library, and will not be compiled." ) + endif() # create_single_source_cgal_program( "mesh_polyhedral_implicit_function.cpp" ) # create_single_source_cgal_program( "mesh_polyhedral_surface_tolerance_region.cpp" ) # create_single_source_cgal_program( "mesh_polyhedral_edge_tolerance_region.cpp" ) diff --git a/Mesh_3/include/CGAL/IO/File_tetgen.h b/Mesh_3/include/CGAL/IO/File_tetgen.h new file mode 100644 index 00000000000..20abcf0e355 --- /dev/null +++ b/Mesh_3/include/CGAL/IO/File_tetgen.h @@ -0,0 +1,229 @@ +// Copyright (c) 2012 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// 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$ +// $Id$ +// +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_IO_FILE_TETGEN_H +#define CGAL_IO_FILE_TETGEN_H + +#include +#include +#include +#include +#include + +namespace CGAL { + +namespace Mesh_3 { + +template +void +output_to_tetgen(std::string filename, + const C3T3& c3t3) +{ +#ifdef CGAL_MESH_3_IO_VERBOSE + std::cerr << "Output to tetgen:\n"; +#endif + + typedef Medit_pmap_generator Generator; + typedef typename Generator::Cell_pmap Cell_pmap; + typedef typename Generator::Facet_pmap Facet_pmap; + typedef typename Generator::Facet_pmap_twice Facet_pmap_twice; + typedef typename Generator::Vertex_pmap Vertex_pmap; + + Cell_pmap cell_pmap(c3t3); + Facet_pmap facet_pmap(c3t3,cell_pmap); + Facet_pmap_twice facet_pmap_twice(c3t3,cell_pmap); + Vertex_pmap vertex_pmap(c3t3,cell_pmap,facet_pmap); + + output_to_tetgen(filename, + c3t3, + vertex_pmap, + facet_pmap, + cell_pmap, + facet_pmap_twice, + Generator().print_twice()); + +#ifdef CGAL_MESH_3_IO_VERBOSE + std::cerr << "done.\n"; +#endif +} + + + +template +void +output_to_tetgen(std::string filename, + const C3T3& c3t3, + const Vertex_index_property_map& vertex_pmap, + const Facet_index_property_map& facet_pmap, + const Cell_index_property_map& cell_pmap, + const Facet_index_property_map_twice& facet_twice_pmap = Facet_index_property_map_twice(), + const bool print_each_facet_twice = false) +{ + typedef typename C3T3::Triangulation Tr; + typedef typename C3T3::Facets_in_complex_iterator Facet_iterator; + typedef typename C3T3::Cells_in_complex_iterator Cell_iterator; + + typedef typename Tr::Finite_vertices_iterator Finite_vertices_iterator; + typedef typename Tr::Vertex_handle Vertex_handle; + typedef typename Tr::Cell_handle Cell_handle; + typedef typename Tr::Point Point_3; + typedef typename Tr::Facet Facet; + + const Tr& tr = c3t3.triangulation(); + + std::map V; + + //------------------------------------------------------- + // File output + //------------------------------------------------------- + + //------------------------------------------------------- + // nodes + //------------------------------------------------------- + + std::string node_filename = filename + ".node"; + std::ofstream node_stream(node_filename.c_str()); + + node_stream << std::setprecision(20); + node_stream << tr.number_of_vertices() << " 3 0 0" << std::endl; + + std::size_t vert_counter = 0; + for(Finite_vertices_iterator + vit = tr.finite_vertices_begin(), + end = tr.finite_vertices_end(); + vit != end; ++vit) + { + const Point_3& p = vit->point(); + const double x = CGAL::to_double(p.x()); + const double y = CGAL::to_double(p.y()); + const double z = CGAL::to_double(p.z()); + + V[vit] = ++vert_counter; + + node_stream << vert_counter << " " << x << " " << y << " " << z; + node_stream << std::endl; + } + node_stream.close(); + + + //------------------------------------------------------- + // Elements + //------------------------------------------------------- + + std::string elem_filename = filename + ".elem"; + std::ofstream elem_stream(elem_filename.c_str()); + + elem_stream << std::setprecision(20); + elem_stream << c3t3.number_of_cells_in_complex() << " 4 0" << std::endl; + + std::size_t cell_counter = 0; + for (Cell_iterator + cit = c3t3.cells_in_complex_begin(), + end = c3t3.cells_in_complex_end(); + cit != end; ++cit) + { + const Cell_handle ch = cit; + + elem_stream << ++cell_counter; + for (int i=3; i>=0; i--) + { + const Vertex_handle vh = ch->vertex(i); + elem_stream << " " << V[vh]; + } + elem_stream << std::endl; + } + elem_stream.close(); + + + //------------------------------------------------------- + // Face + //------------------------------------------------------- + + std::string face_filename = filename + ".face"; + std::ofstream face_stream(face_filename.c_str()); + + face_stream << std::setprecision(20); + face_stream << c3t3.number_of_facets_in_complex() << " 0" << std::endl; + + std::size_t facet_counter = 0; + for(Facet_iterator + fit = c3t3.facets_in_complex_begin(), + end = c3t3.facets_in_complex_end(); + fit != end; ++fit ) + { + const Facet& facet = *fit; + + Vertex_handle vh1 = facet.first->vertex((facet.second+1)%4); + Vertex_handle vh2 = facet.first->vertex((facet.second+2)%4); + Vertex_handle vh3 = facet.first->vertex((facet.second+3)%4); + + face_stream << ++facet_counter << " " << V[vh1] << " " << V[vh2] << " " << V[vh3] << std::endl; + } + face_stream.close(); + + //------------------------------------------------------- + // End + //------------------------------------------------------- +} // end output_to_tetgen(...) + +} // end namespace Mesh_3 + + + + +/** + * @brief outputs mesh to tetgen format + * @param os the stream + * @param c3t3 the mesh + * @param rebind if true, labels of cells are rebinded into [1..nb_of_labels] + * @param show_patches if true, patches are labeled with different labels than + * cells. If false, each surface facet is written twice, using label of + * each adjacent cell. + */ +template +void +output_to_tetgen(std::string filename, + const C3T3& c3t3, + bool rebind = false, + bool show_patches = false) +{ + if ( rebind ) + { + if ( show_patches ) + Mesh_3::output_to_tetgen(filename,c3t3); + else + Mesh_3::output_to_tetgen(filename,c3t3); + } + else + { + if ( show_patches ) + Mesh_3::output_to_tetgen(filename,c3t3); + else + Mesh_3::output_to_tetgen(filename,c3t3); + } +} + +} // end namespace CGAL + +#endif // CGAL_IO_FILE_TETGEN_H diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index 4605af80ba7..fb04217b162 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -355,7 +355,9 @@ insert_corners() nearest = (*it)->point(); } } - const FT nearest_sq_dist = CGAL::squared_distance( nearest, p); + typename Gt::Compute_squared_distance_3 squared_distance = + c3t3_.triangulation().geom_traits().compute_squared_distance_3_object(); + const FT nearest_sq_dist = squared_distance( nearest, p); w = (std::min)(w, nearest_sq_dist / FT(9)); } @@ -845,6 +847,12 @@ change_ball_size(const Vertex_handle& v, const FT size) c3t3_.remove_from_complex(v,vit->first); } + + // Store point data + Index index = v->index(); + int dim = v->in_dimension(); + Bare_point p = v->point().point(); + // Remove v from corners boost::optional corner_index; if ( c3t3_.is_in_complex(v) ) @@ -852,12 +860,6 @@ change_ball_size(const Vertex_handle& v, const FT size) corner_index = c3t3_.corner_index(v); c3t3_.remove_from_complex(v); } - - // Store point data - Index index = v->index(); - int dim = v->in_dimension(); - Bare_point p = v->point().point(); - // Change v size c3t3_.triangulation().remove(v); Vertex_handle new_v = insert_point(p, size*size, dim, index); diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h index 9592d6ff773..32cc3d0d456 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -31,6 +31,8 @@ #include #include +#include + #include #include #include @@ -692,6 +694,7 @@ compute_facet_properties(const Facet& facet) const // Functor typename Gt::Is_degenerate_3 is_degenerate = Gt().is_degenerate_3_object(); + typename Gt::Compare_xyz_3 compare_xyz = Gt().compare_xyz_3_object(); typename MD::Do_intersect_surface do_intersect_surface = r_oracle_.do_intersect_surface_object(); @@ -714,7 +717,7 @@ compute_facet_properties(const Facet& facet) const // Trick to have canonical vector : thus, we compute alwais the same // intersection Segment_3 segment = *p_segment; - if ( CGAL::compare_xyz(p_segment->source(),p_segment->target()) + if ( compare_xyz(p_segment->source(),p_segment->target()) == CGAL::LARGER ) { typename Gt::Construct_opposite_segment_3 opposite = @@ -764,7 +767,8 @@ compute_facet_properties(const Facet& facet) const // Trick to have canonical vector : thus, we compute alwais the same // intersection Line_3 line = *p_line; - if ( CGAL::compare_xyz(p_line->point(0),p_line->point(1)) + typename Gt::Compare_xyz_3 compare_xyz = Gt().compare_xyz_3_object(); + if ( compare_xyz(p_line->point(0),p_line->point(1)) == CGAL::LARGER ) { typename Gt::Construct_opposite_line_3 opposite = diff --git a/Mesh_3/include/CGAL/Mesh_3/dihedral_angle_3.h b/Mesh_3/include/CGAL/Mesh_3/dihedral_angle_3.h index 6e5869a2d0f..315d3275090 100644 --- a/Mesh_3/include/CGAL/Mesh_3/dihedral_angle_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/dihedral_angle_3.h @@ -57,8 +57,8 @@ dihedral_angle(const typename K::Point_3& a, const Vector_3 abad = cross_product(ab,ad); const double x = CGAL::to_double(scalar_product(cross_product(ab,ac), abad)); - const FT l_ab = CGAL::sqrt(sq_distance(a,b)); - const double y = CGAL::to_double(l_ab * scalar_product(ac,abad)); + const double l_ab = CGAL::sqrt(CGAL::to_double(sq_distance(a,b))); + const double y = l_ab * CGAL::to_double(scalar_product(ac,abad)); return FT(std::atan2(y, x) * 180 / CGAL_PI ); } diff --git a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h index a2dd88d7228..a5edf1429d2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h +++ b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_cell_criteria.h @@ -28,6 +28,9 @@ #include +#include // for CGAL::min +#include // for CGAL::square +#include namespace CGAL { diff --git a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h index 800e1768d5e..55244677029 100644 --- a/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h +++ b/Mesh_3/include/CGAL/Mesh_3/mesh_standard_facet_criteria.h @@ -27,7 +27,9 @@ #ifndef CGAL_MESH_3_MESH_STANDARD_FACET_CRITERIA_H #define CGAL_MESH_3_MESH_STANDARD_FACET_CRITERIA_H +#include // for to_double #include +#include namespace CGAL { diff --git a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h index a2fdb83fa93..27ad8e11564 100644 --- a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h +++ b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h @@ -35,6 +35,7 @@ #include #include +#include namespace CGAL { diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index f28d2e2a8fe..e71764534b7 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -29,6 +29,8 @@ #include #include #include +#include +#include namespace CGAL { diff --git a/Mesh_3/test/Mesh_3/test_c3t3.cpp b/Mesh_3/test/Mesh_3/test_c3t3.cpp index a5e66dbb24b..893f399a0c6 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3.cpp @@ -34,6 +34,7 @@ #include #include #include +#include @@ -366,6 +367,10 @@ struct Tester assert ( std::distance(patch_fit_bis,fend) == 1 ); assert ( c3t3.surface_patch_index(*patch_fit) == surface_patch_index ); assert ( c3t3.surface_patch_index(*patch_fit_bis) == surface_patch_index_bis ); + + std::ofstream out_medit("test-medit.mesh"); + CGAL::output_to_medit(out_medit, c3t3); + CGAL::output_to_tetgen("test-tetgen", c3t3); } }; diff --git a/Modular_arithmetic/package_info/Modular_arithmetic/maintainer b/Modular_arithmetic/package_info/Modular_arithmetic/maintainer index 004333ad859..291dcf918ae 100644 --- a/Modular_arithmetic/package_info/Modular_arithmetic/maintainer +++ b/Modular_arithmetic/package_info/Modular_arithmetic/maintainer @@ -1 +1 @@ -Michael Hemmer +Michael Hemmer diff --git a/Nef_2/test/Nef_2/point_location.cpp b/Nef_2/test/Nef_2/nef_2_point_location.cpp similarity index 100% rename from Nef_2/test/Nef_2/point_location.cpp rename to Nef_2/test/Nef_2/nef_2_point_location.cpp diff --git a/Number_types/include/CGAL/FPU.h b/Number_types/include/CGAL/FPU.h index 569bef2f848..383c2751b5d 100644 --- a/Number_types/include/CGAL/FPU.h +++ b/Number_types/include/CGAL/FPU.h @@ -25,7 +25,7 @@ #ifndef CGAL_FPU_H #define CGAL_FPU_H -#include +#include #ifndef __INTEL_COMPILER #include // for HUGE_VAL diff --git a/Number_types/include/CGAL/GMP/Gmpfr_type.h b/Number_types/include/CGAL/GMP/Gmpfr_type.h index 9aaa9ab54b2..9812771eee4 100644 --- a/Number_types/include/CGAL/GMP/Gmpfr_type.h +++ b/Number_types/include/CGAL/GMP/Gmpfr_type.h @@ -1010,7 +1010,7 @@ std::pair Gmpfr::to_integer_exp()const{ CGAL_postcondition_code(if(e>=0)) CGAL_postcondition( - (*this)==(Gmpfr(z,z.bit_size())*CGAL::ipower(Gmpfr(2),e))); + (*this)==(Gmpfr(z,(mpfr_prec_t)z.bit_size())*CGAL::ipower(Gmpfr(2),e))); CGAL_postcondition_code(else) CGAL_postcondition(((*this)*(Gmpz(1)<<(-e)))==z); diff --git a/Number_types/include/CGAL/IEEE_754_unions.h b/Number_types/include/CGAL/IEEE_754_unions.h index 3b3a96117f6..1dfdd924e39 100644 --- a/Number_types/include/CGAL/IEEE_754_unions.h +++ b/Number_types/include/CGAL/IEEE_754_unions.h @@ -26,6 +26,7 @@ #define CGAL_IEEE_754_UNIONS_H #include +#include union IEEE_754_double { diff --git a/Number_types/include/CGAL/Interval_nt.h b/Number_types/include/CGAL/Interval_nt.h index b1a4df0e85f..547e9a2a99a 100644 --- a/Number_types/include/CGAL/Interval_nt.h +++ b/Number_types/include/CGAL/Interval_nt.h @@ -40,9 +40,16 @@ // - test whether stopping constant propagation only in functions taking // double as arguments, improves performance. -#include +#include // for std::pair +#include +#include +#include +#include #include #include +#include +#include +#include #include namespace CGAL { diff --git a/Number_types/include/CGAL/MP_Float_impl.h b/Number_types/include/CGAL/MP_Float_impl.h index 1546d576835..bee61ba2b5b 100644 --- a/Number_types/include/CGAL/MP_Float_impl.h +++ b/Number_types/include/CGAL/MP_Float_impl.h @@ -19,10 +19,14 @@ // // Author(s) : Sylvain Pion +#ifndef CGAL_MP_FLOAT_IMPL_H +#define CGAL_MP_FLOAT_IMPL_H + #include #include #include #include +#include namespace CGAL { @@ -505,3 +509,5 @@ operator>> (std::istream & is, MP_Float &b) } } //namespace CGAL + +#endif // CGAL_MP_FLOAT_IMPL_H diff --git a/Number_types/include/CGAL/NT_converter.h b/Number_types/include/CGAL/NT_converter.h index 0f24dfa70af..495a11e6c3d 100644 --- a/Number_types/include/CGAL/NT_converter.h +++ b/Number_types/include/CGAL/NT_converter.h @@ -22,6 +22,8 @@ #define CGAL_NT_CONVERTER_H #include +#include +#include template class Interval_nt; diff --git a/Number_types/include/CGAL/Root_of_2.h b/Number_types/include/CGAL/Root_of_2.h index 3bca63d0c50..1f5cefa9259 100644 --- a/Number_types/include/CGAL/Root_of_2.h +++ b/Number_types/include/CGAL/Root_of_2.h @@ -21,6 +21,11 @@ #ifndef CGAL_ROOT_OF_2_H #define CGAL_ROOT_OF_2_H +#ifndef CGAL_NO_DEPRECATED_CODE + +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include #include #include #include @@ -1378,4 +1383,6 @@ inline const Root_of_2& max BOOST_PREVENT_MACRO_SUBSTITUTION #undef CGAL_int #undef CGAL_double +#endif //CGAL_NO_DEPRECATED_CODE + #endif // CGAL_ROOT_OF_2_H diff --git a/Number_types/include/CGAL/Root_of_traits_specializations.h b/Number_types/include/CGAL/Root_of_traits_specializations.h index 4c15d42464c..0aee70ad9ce 100644 --- a/Number_types/include/CGAL/Root_of_traits_specializations.h +++ b/Number_types/include/CGAL/Root_of_traits_specializations.h @@ -25,6 +25,7 @@ #define CGAL_ROOT_OF_TRAITS_SPECIALIZATIONS_H #include +#include namespace CGAL { diff --git a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h index e5c5ec41246..f4ed07f7742 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h +++ b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h @@ -40,6 +40,7 @@ #include #include #include +#include #define CGAL_int(T) typename First_if_different::Type @@ -672,6 +673,48 @@ Sqrt_extension square (const Sqrt_extension +struct NT_converter < Sqrt_extension , Sqrt_extension > + : public std::unary_function< NT1, NT2 > +{ + Sqrt_extension + operator()(const Sqrt_extension &a) const + { + if(!a.is_extended()) { + return Sqrt_extension(NT_converter()(a.a0())); + } else { + return Sqrt_extension + (NT_converter()(a.a0()), + NT_converter()(a.a1()), + NT_converter()(a.root())); + } + } +}; + +template +struct NT_converter < NT1 , Sqrt_extension > + : public std::unary_function< NT1, NT2 > +{ + Sqrt_extension + operator()(const NT1 &a) const + { + return Sqrt_extension(NT_converter()(a)); + } +}; + +//needed because it's a better match than the specialization +template +struct NT_converter < Sqrt_extension, Sqrt_extension > + : public std::unary_function< NT1, NT1 > +{ + const Sqrt_extension& + operator()(const Sqrt_extension &a) const + { + return a; + } +}; + // UNARY template Sqrt_extension operator + (const Sqrt_extension& p) { return p; } diff --git a/Number_types/include/CGAL/Sqrt_extension_fwd.h b/Number_types/include/CGAL/Sqrt_extension_fwd.h index 3864250b0b5..1b118f71bef 100644 --- a/Number_types/include/CGAL/Sqrt_extension_fwd.h +++ b/Number_types/include/CGAL/Sqrt_extension_fwd.h @@ -24,6 +24,8 @@ #ifndef CGAL_SQRT_EXTENSION_FWD_H #define CGAL_SQRT_EXTENSION_FWD_H +#include + namespace CGAL{ template diff --git a/Number_types/include/CGAL/double.h b/Number_types/include/CGAL/double.h index 88eb597c8c6..ff2ba81954a 100644 --- a/Number_types/include/CGAL/double.h +++ b/Number_types/include/CGAL/double.h @@ -25,8 +25,9 @@ #ifndef CGAL_DOUBLE_H #define CGAL_DOUBLE_H -#include - +#include +#include +#include #include #include #include // for nextafter diff --git a/Number_types/include/CGAL/float.h b/Number_types/include/CGAL/float.h index 5d172ff7e4c..75e5a49d669 100644 --- a/Number_types/include/CGAL/float.h +++ b/Number_types/include/CGAL/float.h @@ -26,7 +26,9 @@ #ifndef CGAL_FLOAT_H #define CGAL_FLOAT_H -#include +#include +#include +#include #include // std::sqrt, std::pow diff --git a/Number_types/include/CGAL/number_type_basic.h b/Number_types/include/CGAL/number_type_basic.h index ccaa4da08f6..bc71689703d 100644 --- a/Number_types/include/CGAL/number_type_basic.h +++ b/Number_types/include/CGAL/number_type_basic.h @@ -26,24 +26,7 @@ #ifndef CGAL_NUMBER_TYPE_BASIC_H #define CGAL_NUMBER_TYPE_BASIC_H -#include - -#define CGAL_PI 3.14159265358979323846 - - -#ifdef CGAL_USE_NTS_NAMESPACE - -#define CGAL_NTS_BEGIN_NAMESPACE namespace NTS { -#define CGAL_NTS_END_NAMESPACE } -#define CGAL_NTS ::CGAL::NTS:: - -#else - -#define CGAL_NTS_BEGIN_NAMESPACE -#define CGAL_NTS_END_NAMESPACE -#define CGAL_NTS ::CGAL:: - -#endif +#include #include @@ -71,9 +54,6 @@ #include #include -#include -#include - #include #include @@ -95,4 +75,7 @@ #endif // CGAL_USE_GMPXX #endif // CGAL_USE_GMP +#include +#include + #endif // CGAL_NUMBER_TYPE_BASIC_H diff --git a/Number_types/include/CGAL/number_type_config.h b/Number_types/include/CGAL/number_type_config.h new file mode 100644 index 00000000000..52312cca9bd --- /dev/null +++ b/Number_types/include/CGAL/number_type_config.h @@ -0,0 +1,47 @@ +// Copyright (c) 1999,2007,2012 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// 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$ +// $Id$ +// +// +// Author(s) : Stefan Schirra, Michael Hemmer + +#ifndef CGAL_NUMBER_TYPE_CONFIG_H +#define CGAL_NUMBER_TYPE_CONFIG_H + +#include + +#define CGAL_PI 3.14159265358979323846 + + +#ifdef CGAL_USE_NTS_NAMESPACE + +#define CGAL_NTS_BEGIN_NAMESPACE namespace NTS { +#define CGAL_NTS_END_NAMESPACE } +#define CGAL_NTS ::CGAL::NTS:: + +#else + +#define CGAL_NTS_BEGIN_NAMESPACE +#define CGAL_NTS_END_NAMESPACE +#define CGAL_NTS ::CGAL:: + +#endif + +#endif // CGAL_NUMBER_TYPE_CONFIG_H diff --git a/Number_types/include/CGAL/utils.h b/Number_types/include/CGAL/utils.h index 61faefbd217..4fbb0f90f65 100644 --- a/Number_types/include/CGAL/utils.h +++ b/Number_types/include/CGAL/utils.h @@ -21,7 +21,7 @@ #ifndef CGAL_UTILS_H #define CGAL_UTILS_H -#include +#include namespace CGAL { diff --git a/Number_types/include/CGAL/utils_classes.h b/Number_types/include/CGAL/utils_classes.h index 6358e17f0a5..d623bf1e2a5 100644 --- a/Number_types/include/CGAL/utils_classes.h +++ b/Number_types/include/CGAL/utils_classes.h @@ -17,7 +17,9 @@ #ifndef CGAL_UTILS_CLASSES_H #define CGAL_UTILS_CLASSES_H -#include + +#include +#include // for std::binary_function #ifdef CGAL_USE_SSE2_MAX #include diff --git a/Number_types/test/Number_types/CMakeLists.txt b/Number_types/test/Number_types/CMakeLists.txt index 72cf17b8246..a533cf60d24 100644 --- a/Number_types/test/Number_types/CMakeLists.txt +++ b/Number_types/test/Number_types/CMakeLists.txt @@ -81,7 +81,7 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "Gmpfi.cpp" ) create_single_source_cgal_program( "Gmpfr_bug.cpp" ) create_single_source_cgal_program( "Quotient_new.cpp" ) - create_single_source_cgal_program( "Coercion_traits.cpp" ) + create_single_source_cgal_program( "test_nt_Coercion_traits.cpp" ) else( CGAL_FOUND ) diff --git a/Number_types/test/Number_types/Sqrt_extension.cpp b/Number_types/test/Number_types/Sqrt_extension.cpp index e2a5fb1847b..52696fc389c 100644 --- a/Number_types/test/Number_types/Sqrt_extension.cpp +++ b/Number_types/test/Number_types/Sqrt_extension.cpp @@ -726,7 +726,20 @@ void sqrt_extension_test(){ scalar_factor_traits_test(); test_algebraic_extension_traits(); - test_get_arithmetic_kernel(); + test_get_arithmetic_kernel(); +} + +#include +void test_nt_converter() +{ + typedef CGAL::internal::Exact_type_selector::Type NT; + typedef CGAL::Sqrt_extension Source; + typedef CGAL::Sqrt_extension Target; + + CGAL::NT_converter converter; + + Source s; + Target t=converter(s); } int main(){ @@ -739,7 +752,8 @@ int main(){ sqrt_extension_test(); sqrt_extension_test(); #endif // CGAL_HAS_CORE_ARITHMETIC_KERNEL - return 0; + test_nt_converter(); + return 0; } diff --git a/Number_types/test/Number_types/Coercion_traits.cpp b/Number_types/test/Number_types/test_nt_Coercion_traits.cpp similarity index 100% rename from Number_types/test/Number_types/Coercion_traits.cpp rename to Number_types/test/Number_types/test_nt_Coercion_traits.cpp diff --git a/Optimisation_doc/dont_submit b/Optimisation_doc/dont_submit deleted file mode 100644 index 72c56ebad85..00000000000 --- a/Optimisation_doc/dont_submit +++ /dev/null @@ -1,3 +0,0 @@ -Makefile* -web -package diff --git a/Optimisation_doc/package_info/Optimisation_doc/copyright b/Optimisation_doc/package_info/Optimisation_doc/copyright deleted file mode 100644 index 28daf2dfbb7..00000000000 --- a/Optimisation_doc/package_info/Optimisation_doc/copyright +++ /dev/null @@ -1 +0,0 @@ - ETH Zurich (Switzerland). diff --git a/Optimisation_doc/package_info/Optimisation_doc/description.txt b/Optimisation_doc/package_info/Optimisation_doc/description.txt deleted file mode 100644 index 47b01e042fa..00000000000 --- a/Optimisation_doc/package_info/Optimisation_doc/description.txt +++ /dev/null @@ -1,2 +0,0 @@ -Geometric Optimisation: User Manual and Introduction to Reference Manual - diff --git a/Optimisation_doc/package_info/Optimisation_doc/maintainer b/Optimisation_doc/package_info/Optimisation_doc/maintainer deleted file mode 100644 index 6fe36bffe91..00000000000 --- a/Optimisation_doc/package_info/Optimisation_doc/maintainer +++ /dev/null @@ -1 +0,0 @@ -Michael Hoffmann diff --git a/Point_set_2/test/Point_set_2/range_search.cpp b/Point_set_2/test/Point_set_2/test_range_search.cpp similarity index 100% rename from Point_set_2/test/Point_set_2/range_search.cpp rename to Point_set_2/test/Point_set_2/test_range_search.cpp diff --git a/Point_set_processing_3/doc_tex/Point_set_processing_3/PkgDescription.tex b/Point_set_processing_3/doc_tex/Point_set_processing_3/PkgDescription.tex index f2785a7fa51..1750f5361dd 100644 --- a/Point_set_processing_3/doc_tex/Point_set_processing_3/PkgDescription.tex +++ b/Point_set_processing_3/doc_tex/Point_set_processing_3/PkgDescription.tex @@ -4,7 +4,7 @@ The input is an unorganized point set, possibly with normal attributes (unoriented or oriented). The point set can be analyzed to measure its average spacing, and processed through functions devoted to the simplification, outlier removal, smoothing, normal estimation and normal orientation.} -\ccPkgDependsOn{\ccThirdPartyLapack} +\ccPkgDependsOn{Solvers from \ccThirdPartyEigen} \ccPkgIntroducedInCGAL{3.5} \ccPkgLicense{\ccLicenseGPL} \ccPkgDemo{Surface Reconstruction}{surface_reconstruction_points_3.zip} diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index 8dd42f0d224..a08ca0c47db 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -100,6 +100,7 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) qt4_wrap_ui( remeshingUI_FILES Remeshing_dialog.ui) qt4_wrap_ui( meshingUI_FILES Meshing_dialog.ui Meshing_pause_widget.ui ) qt4_wrap_ui( cameraUI_FILES Camera_positions_list.ui ) + qt4_wrap_ui( PreferencesUI_FILES Preferences.ui ) include(AddFileDependencies) @@ -216,7 +217,7 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) # MainWindow_curvature_estimation.cpp MainWindow_moc.cpp # Viewer_moc.cpp - ${MainWindowUI_files} ${RESOURCE_FILES} ) + ${MainWindowUI_files} ${PreferencesUI_FILES} ${RESOURCE_FILES} ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyhedron_3 ) if(EIGEN3_FOUND OR TAUCS_FOUND) # add_executable( Polyhedron_3 Scene_tex_rendering.cpp Scene_tex_polyhedron_operations.cpp ) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 16503f1b714..73502aa0a9b 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include @@ -38,6 +40,7 @@ #include "Polyhedron_demo_io_plugin_interface.h" #include "ui_MainWindow.h" +#include "ui_Preferences.h" #include "Show_point_dialog.h" @@ -290,6 +293,8 @@ MainWindow::MainWindow(QWidget* parent) # endif #endif + readSettings(); // Among other things, the column widths are stored. + // Load plugins, and re-enable actions that need it. loadPlugins(); @@ -299,7 +304,6 @@ MainWindow::MainWindow(QWidget* parent) } ui->menuDockWindows->removeAction(ui->dummyAction); - readSettings(); // Among other things, the column widths are stored. #ifdef QT_SCRIPT_LIB // evaluate_script("print(plugins);"); @@ -417,14 +421,20 @@ void MainWindow::loadPlugins() qPrintable(pluginsDir.absolutePath())); Q_FOREACH (QString fileName, pluginsDir.entryList(QDir::Files)) { if(fileName.contains("plugin") && QLibrary::isLibrary(fileName)) { + //set plugin name + QString name = fileName; + name.remove(QRegExp("^lib")); + name.remove(QRegExp("\\..*")); + //do not load it if it is in the blacklist + if ( plugin_blacklist.contains(name) ){ + qDebug("### Ignoring plugin \"%s\".", qPrintable(fileName)); + continue; + } qDebug("### Loading \"%s\"...", qPrintable(fileName)); QPluginLoader loader; loader.setFileName(pluginsDir.absoluteFilePath(fileName)); QObject *obj = loader.instance(); if(obj) { - QString name = fileName; - name.remove(QRegExp("^lib")); - name.remove(QRegExp("\\..*")); obj->setObjectName(name); initPlugin(obj); initIOPlugin(obj); @@ -967,6 +977,9 @@ void MainWindow::readSettings() QSettings settings; // enable anti-aliasing ui->actionAntiAliasing->setChecked(settings.value("antialiasing", false).toBool()); + // read plugin blacklist + QStringList blacklist=settings.value("plugin_blacklist",QStringList()).toStringList(); + Q_FOREACH(QString name,blacklist){ plugin_blacklist.insert(name); } } this->readState("MainWindow", Size|State); } @@ -978,6 +991,11 @@ void MainWindow::writeSettings() QSettings settings; settings.setValue("antialiasing", ui->actionAntiAliasing->isChecked()); + //setting plugin blacklist + QStringList blacklist; + Q_FOREACH(QString name,plugin_blacklist){ blacklist << name; } + if ( !blacklist.isEmpty() ) settings.setValue("plugin_blacklist",blacklist); + else settings.remove("plugin_blacklist"); } std::cerr << "Write setting... done.\n"; } @@ -1174,6 +1192,58 @@ void MainWindow::on_actionSetPolyhedronB_triggered() int i = getSelectedSceneItemIndex(); scene->setItemB(i); } +void MainWindow::on_actionPreferences_triggered() +{ + QDialog dialog(this); + Ui::PreferencesDialog prefdiag; + prefdiag.setupUi(&dialog); + + + QStandardItemModel* iStandardModel = new QStandardItemModel(this); + //add blacklisted plugins + Q_FOREACH(QString name, plugin_blacklist) + { + QStandardItem* item = new QStandardItem(name); + item->setCheckable(true); + item->setCheckState(Qt::Checked); + iStandardModel->appendRow(item); + } + + //add operations plugins + Q_FOREACH(PluginNamePair pair,plugins){ + QStandardItem* item = new QStandardItem(pair.second); + item->setCheckable(true); + iStandardModel->appendRow(item); + } + + //add io-plugins + Q_FOREACH(Polyhedron_demo_io_plugin_interface* plugin, io_plugins) + { + QStandardItem* item = new QStandardItem(plugin->name()); + item->setCheckable(true); + if ( plugin_blacklist.contains(plugin->name()) ) item->setCheckState(Qt::Checked); + iStandardModel->appendRow(item); + } + + //Setting the model + prefdiag.listView->setModel(iStandardModel); + + dialog.exec(); + + if ( dialog.result() ) + { + plugin_blacklist.clear(); + for (int k=0,k_end=iStandardModel->rowCount();kitem(k); + if (item->checkState()==Qt::Checked) + plugin_blacklist.insert(item->text()); + } + } + + for (int k=0,k_end=iStandardModel->rowCount();kitem(k); + delete iStandardModel; +} void MainWindow::on_actionSetBackgroundColor_triggered() { diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index 54346cbbd5c..cc8fd1575be 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -12,6 +12,7 @@ #include #include #include +#include class Scene; class Viewer; @@ -19,7 +20,6 @@ class QTreeView; class QMenu; class Polyhedron_demo_io_plugin_interface; class Polyhedron_demo_plugin_interface; - class Scene_item; namespace Ui { @@ -123,6 +123,8 @@ protected slots: void on_actionSetPolyhedronA_triggered(); void on_actionSetPolyhedronB_triggered(); + //Preferences edition + void on_actionPreferences_triggered(); // save as... void on_actionSaveAs_triggered(); void save(QString filename, Scene_item* item); @@ -152,6 +154,9 @@ protected: private: QString strippedName(const QString &fullFileName); + /// plugin black-list + QSet plugin_blacklist; + Scene* scene; Viewer* viewer; QTreeView* sceneView; diff --git a/Polyhedron/demo/Polyhedron/MainWindow.ui b/Polyhedron/demo/Polyhedron/MainWindow.ui index fdc4646a7d4..82e34d9ea57 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.ui +++ b/Polyhedron/demo/Polyhedron/MainWindow.ui @@ -62,6 +62,7 @@ + @@ -633,6 +634,11 @@ Load &Script + + + &Preferences + + diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_camera_positions_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_camera_positions_plugin.cpp index adb4b84015c..a139e30f9c6 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_camera_positions_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_camera_positions_plugin.cpp @@ -19,7 +19,7 @@ public: void init(QMainWindow* mainWindow, Scene_interface* scene_interface); QList actions() const; - QString name() const { return "Polyhedron_demo_camera_positions_plugin"; } + QString name() const { return "camera_positions_plugin"; } QString nameFilters() const { return "Camera positions (*.camera.txt)"; } bool canLoad() const { return true; } Scene_item* load(QFileInfo fileinfo) { cpl->load(fileinfo.filePath()); return 0; } diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_gocad_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_gocad_plugin.cpp index 22ad63f6d98..abd8a7e2021 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_gocad_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_gocad_plugin.cpp @@ -117,7 +117,7 @@ class Polyhedron_demo_gocad_plugin : public: QString nameFilters() const; - QString name() const { return "Polyhedron_demo_gocad_plugin"; } + QString name() const { return "gocad_plugin"; } bool canLoad() const; Scene_item* load(QFileInfo fileinfo); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_io_nef_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_io_nef_plugin.cpp index 8138d9e5536..d5db71f7658 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_io_nef_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_io_nef_plugin.cpp @@ -12,7 +12,7 @@ class Polyhedron_demo_io_nef_plugin : public: QString nameFilters() const; - QString name() const { return "Polyhedron_demo_io_nef_plugin"; } + QString name() const { return "io_nef_plugin"; } bool canLoad() const; Scene_item* load(QFileInfo fileinfo); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp index b312fd627bb..44758bff0b8 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_plugin.cpp @@ -13,7 +13,7 @@ class Polyhedron_demo_off_plugin : Q_INTERFACES(Polyhedron_demo_io_plugin_interface) public: - QString name() const { return "Polyhedron_demo_off_plugin"; } + QString name() const { return "off_plugin"; } QString nameFilters() const { return "OFF files (*.off)"; } bool canLoad() const; Scene_item* load(QFileInfo fileinfo); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp index 263855ff58f..c16261c1b3e 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_nef_plugin.cpp @@ -12,7 +12,7 @@ class Polyhedron_demo_off_to_nef_plugin : Q_INTERFACES(Polyhedron_demo_io_plugin_interface) public: - QString name() const { return "Polyhedron_demo_off_to_nef_plugin"; } + QString name() const { return "off_to_nef_plugin"; } QString nameFilters() const { return "OFF files, into nef (*.off)"; } bool canLoad() const; Scene_item* load(QFileInfo fileinfo); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_xyz_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_xyz_plugin.cpp index 00e054eb0c1..188e07aefb1 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_xyz_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_off_to_xyz_plugin.cpp @@ -11,7 +11,7 @@ class Polyhedron_demo_off_to_xyz_plugin : Q_INTERFACES(Polyhedron_demo_io_plugin_interface) public: - QString name() const { return "Polyhedron_demo_off_to_xyz_plugin"; } + QString name() const { return "off_to_xyz_plugin"; } QString nameFilters() const { return "OFF files as Point set (*.off)"; } bool canLoad() const; Scene_item* load(QFileInfo fileinfo); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp index 25a086d383f..60a312124bc 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_orient_soup_plugin.cpp @@ -25,7 +25,8 @@ public: bool applicable() const { Q_FOREACH(Scene_interface::Item_id index, scene->selectionIndices()) { - if(qobject_cast(scene->item(index))) + if(qobject_cast(scene->item(index))|| + qobject_cast(scene->item(index))) return true; } return false; @@ -55,12 +56,12 @@ void Polyhedron_demo_orient_soup_plugin::init(QMainWindow* mainWindow, scene = scene_interface; mw = mainWindow; messages = m; - actionOrient = new QAction(tr("Orient polygon soup"), mainWindow); + actionOrient = new QAction(tr("&Orient polygon soup"), mainWindow); actionOrient->setObjectName("actionOrient"); connect(actionOrient, SIGNAL(triggered()), this, SLOT(orient())); - actionShuffle = new QAction(tr("Shuffle polygon soup"), mainWindow); + actionShuffle = new QAction(tr("&Shuffle polygon soup"), mainWindow); connect(actionShuffle, SIGNAL(triggered()), this, SLOT(shuffle())); @@ -110,9 +111,9 @@ void Polyhedron_demo_orient_soup_plugin::orient() scene->itemChanged(item); } } + QApplication::restoreOverrideCursor(); } } - QApplication::restoreOverrideCursor(); } void Polyhedron_demo_orient_soup_plugin::shuffle() diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_polylines_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_polylines_io_plugin.cpp index 1c34de1bf17..b96b840c940 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_polylines_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_polylines_io_plugin.cpp @@ -13,7 +13,7 @@ class Polyhedron_demo_polylines_io_plugin : Q_INTERFACES(Polyhedron_demo_io_plugin_interface) public: - QString name() const { return "Polyhedron_demo_polylines_io_plugin"; } + QString name() const { return "polylines_io_plugin"; } QString nameFilters() const { return "Polylines files (*.polylines.txt *.cgal)"; } bool canLoad() const; Scene_item* load(QFileInfo fileinfo); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_stl_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_stl_plugin.cpp index 4298517a472..e33c7195677 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_stl_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_stl_plugin.cpp @@ -134,7 +134,7 @@ class Polyhedron_demo_stl_plugin : public: QString nameFilters() const; - QString name() const { return "Polyhedron_demo_stl_plugin"; } + QString name() const { return "stl_plugin"; } bool canLoad() const; Scene_item* load(QFileInfo fileinfo); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_xyz_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_xyz_plugin.cpp index 447ef910190..f77ee9a6ad0 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_xyz_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_xyz_plugin.cpp @@ -15,7 +15,7 @@ class Polyhedron_demo_xyz_plugin : Q_INTERFACES(Polyhedron_demo_io_plugin_interface) public: - QString name() const { return "Polyhedron_demo_xyz_plugin"; } + QString name() const { return "xyz_plugin"; } QString nameFilters() const { return "XYZ as Point Set (*.xyz);;Point Set with Normal (*.pwn)"; } bool canLoad() const; diff --git a/Polyhedron/demo/Polyhedron/Preferences.ui b/Polyhedron/demo/Polyhedron/Preferences.ui new file mode 100644 index 00000000000..c623625068b --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Preferences.ui @@ -0,0 +1,94 @@ + + + PreferencesDialog + + + + 0 + 0 + 377 + 503 + + + + Dialog + + + + + 20 + 440 + 131 + 61 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 20 + 50 + 331 + 381 + + + + QAbstractItemView::NoSelection + + + + + + 30 + 10 + 321 + 31 + + + + Tick plugins you don't want to load at start up + + + + + + + buttonBox + accepted() + PreferencesDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + PreferencesDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index d1c3508fe8e..db11da5c6b7 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -27,7 +28,7 @@ struct Polygon_soup : typedef std::map, std::set > Edges_map; typedef boost::array Edge; typedef std::vector Polygons; - typedef std::vector Edges; + typedef std::set Edges; typedef Polygons::size_type size_type; Points points; Polygons polygons; @@ -82,7 +83,8 @@ struct Polygon_soup : Edge edge; edge[0] = i0; edge[1] = i1; - non_manifold_edges.push_back(edge); + if(i0 > i1) std::swap(edge[0], edge[1]); + non_manifold_edges.insert(edge); } } } @@ -296,6 +298,15 @@ Scene_polygon_soup_item::orient() const std::size_t& i1 = polygons[to_be_oriented_index][ih]; const std::size_t& i2 = polygons[to_be_oriented_index][ihp1]; + Polygon_soup::Edge edge; + edge[0] = i1; + edge[1] = i2; + if(i1 > i2) std::swap(edge[0], edge[1]); + + if(soup->non_manifold_edges.count(edge) > 0) { + continue; + } + // qDebug() << tr("edge %3-%4 (%1,%2)").arg(i1).arg(i2).arg(ih).arg(ihp1); // edge (i1,i2) Edges::iterator it_same_orient = edges.find(make_pair(i1, i2)); @@ -351,8 +362,14 @@ Scene_polygon_soup_item::orient() stack.push(index); } else { -// qDebug() << "else" << it_same_orient->second.size() << it_other_orient->second.size(); - success = false; // non-orientable + // qDebug() << "else" << it_same_orient->second.size() << + // (it_other_orient == edges.end() ? 0 : it_other_orient->second.size()); + if(it_same_orient->second.size() != 1 || + (it_other_orient != edges.end() && it_other_orient->second.size() > 0)) + { + // qDebug() << tr("non orientable"); + success = false; // non-orientable + } } } // end for on all edges of one } // end while loop on the polygons of the connected component @@ -478,13 +495,10 @@ Scene_polygon_soup_item::direct_draw() const { ::glColor3d(1., 0., 0.); // red ::glGetBooleanv(GL_LIGHTING, &lightning); ::glDisable(GL_LIGHTING); - - for(Polygon_soup::size_type - i = 0, - end = soup->non_manifold_edges.size(); - i < end; ++i) + + BOOST_FOREACH(const Polygon_soup::Edge& edge, + soup->non_manifold_edges) { - const Polygon_soup::Edge& edge = soup->non_manifold_edges[i]; const Point_3& a = soup->points[edge[0]]; const Point_3& b = soup->points[edge[1]]; ::glBegin(GL_LINES); diff --git a/Polynomial/dont_submit b/Polynomial/dont_submit index 7095bfc63e2..ead4a88c090 100644 --- a/Polynomial/dont_submit +++ b/Polynomial/dont_submit @@ -1,8 +1,6 @@ include/CGAL/Polynomial/polynomial_functions.h test/Polynomial/polynomial_functions.cpp -include/CGAL/Polynomial/polynomial_gcd_ntl.h - include/CGAL/Polynomial/wang.h include/CGAL/Polynomial/Wang_traits.h diff --git a/Polynomial/include/CGAL/Polynomial/polynomial_gcd_ntl.h b/Polynomial/include/CGAL/Polynomial/polynomial_gcd_ntl.h index 554e68091b2..691f6e92471 100644 --- a/Polynomial/include/CGAL/Polynomial/polynomial_gcd_ntl.h +++ b/Polynomial/include/CGAL/Polynomial/polynomial_gcd_ntl.h @@ -17,8 +17,9 @@ // // // Author(s) : Michael Kerber -// Dominik Huelse -// Michael Hemmer +// Dominik Huelse +// Michael Hemmer +// Eric Berberich // ============================================================================ /*! \file CGAL/Polynomial/polynomial_gcd_ntl.h @@ -28,38 +29,36 @@ #ifndef CGAL_POLYNOMIAL_GCD_NTL_H #define CGAL_POLYNOMIAL_GCD_NTL_H -#include +#include #ifndef CGAL_USE_NTL #warning This header file needs NTL installed in order to work properly. -#else // CGAL_USE_NTL - -#ifndef CGAL_USE_NTL_MODULAR_GCD -#define CGAL_USE_NTL_MODULAR_GCD 1 -#endif // CGAL_USE_NTL_MODULAR_GCD - -#if CGAL_USE_NTL_MODULAR_GCD - -#include -#include -#include - - -#include +#endif #ifdef CGAL_USE_LEDA -#include +#include #endif #ifdef CGAL_USE_CORE -#include +#include #endif +#include +#include +#include + +#include + +#include namespace CGAL{ template class Polynomial; // fwd + +template class Polynomial_traits_d; + } // namespace CGAL + // This part forms the bridge to NTL to use the modular gcd algorithm. If // NTL is not available, the usual strategy is applied. @@ -123,20 +122,27 @@ modular_NTL_gcd_for_univariate_integer_polynomials return g; } +template Polynomial +inline +canonical_modular_NTL_gcd_for_univariate_integer_polynomials + (Polynomial p1, Polynomial p2) { + // std::cout<<" NTL canonical GCD"< inline CGAL::Polynomial gcd_utcf_(const CGAL::Polynomial& p1, const CGAL::Polynomial& p2) { CGAL::Polynomial gcd = - internal::modular_NTL_gcd_for_univariate_integer_polynomials(p1,p2); - return CGAL::canonicalize(gcd); + internal::canonical_modular_NTL_gcd_for_univariate_integer_polynomials(p1,p2); + return gcd; } + template <> inline CGAL::Polynomial @@ -144,17 +150,20 @@ gcd_(const CGAL::Polynomial& p1, const CGAL::Polynomial& p2) { return internal::modular_NTL_gcd_for_univariate_integer_polynomials(p1,p2); } + #endif // CGAL_USE_LEDA #ifdef CGAL_USE_CORE + template <> inline Polynomial gcd_utcf_(const Polynomial& p1, const Polynomial& p2) { - Polynomial gcd = modular_NTL_gcd_for_univariate_integer_polynomials(p1,p2); - return CGAL::canonicalize(gcd); + Polynomial gcd = canonical_modular_NTL_gcd_for_univariate_integer_polynomials(p1,p2); + return gcd; } + template <> inline Polynomial @@ -162,19 +171,13 @@ gcd_(const Polynomial& p1, const Polynomial& p2) { return modular_NTL_gcd_for_univariate_integer_polynomials(p1,p2); } + #endif //CGAL_USE_CORE -//#endif //CGAL_USE_INTERNAL_MODULAR_GCD - - } // namespace internal } // namespace CGAL -#endif // CGAL_USE_NTL_MODULAR_GCD - -#endif // CGAL_USE_NTL - #endif // CGAL_POLYNOMIAL_GCD_NTL_H // EOF diff --git a/Polynomial/package_info/Polynomial/maintainer b/Polynomial/package_info/Polynomial/maintainer index 004333ad859..664ae558940 100644 --- a/Polynomial/package_info/Polynomial/maintainer +++ b/Polynomial/package_info/Polynomial/maintainer @@ -1 +1,2 @@ -Michael Hemmer +Michael Hemmer +Eric Berberich \ No newline at end of file diff --git a/Polynomial/test/Polynomial/Coercion_traits.cpp b/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp similarity index 100% rename from Polynomial/test/Polynomial/Coercion_traits.cpp rename to Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp diff --git a/Polynomial/test/Polynomial/Get_arithmetic_kernel.cpp b/Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp similarity index 100% rename from Polynomial/test/Polynomial/Get_arithmetic_kernel.cpp rename to Polynomial/test/Polynomial/test_polynomial_Get_arithmetic_kernel.cpp diff --git a/Polynomial/test/Polynomial/subresultants.cpp b/Polynomial/test/Polynomial/test_subresultants.cpp similarity index 100% rename from Polynomial/test/Polynomial/subresultants.cpp rename to Polynomial/test/Polynomial/test_subresultants.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/barycenter.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_barycenter.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/barycenter.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_barycenter.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/bounding_box.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_bounding_box.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/bounding_box.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_bounding_box.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_circles_2.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_circles_2.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_circles_2.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_circles_2.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_cuboids_3.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_cuboids_3.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_cuboids_3.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_cuboids_3.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_points_2.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_points_2.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_points_2.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_points_2.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_points_3.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_points_3.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_points_3.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_points_3.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_rectangles_2.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_rectangles_2.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_rectangles_2.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_rectangles_2.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_segments_2.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_2.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_segments_2.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_2.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_segments_3.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_3.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_segments_3.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_segments_3.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_spheres_3.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_spheres_3.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_spheres_3.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_spheres_3.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_tetrahedra_3.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_tetrahedra_3.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_tetrahedra_3.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_tetrahedra_3.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_triangles_2.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_2.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_triangles_2.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_2.cpp diff --git a/Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_triangles_3.cpp b/Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_3.cpp similarity index 100% rename from Principal_component_analysis/test/Principal_component_analysis/linear_least_squares_fitting_triangles_3.cpp rename to Principal_component_analysis/test/Principal_component_analysis/test_linear_least_squares_fitting_triangles_3.cpp diff --git a/STL_Extension/include/CGAL/Fourtuple.h b/STL_Extension/include/CGAL/Fourtuple.h index f96e8cb35f6..a4385679ef9 100644 --- a/STL_Extension/include/CGAL/Fourtuple.h +++ b/STL_Extension/include/CGAL/Fourtuple.h @@ -25,6 +25,8 @@ #ifndef CGAL_FOURTUPLE_H #define CGAL_FOURTUPLE_H +#include + #ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { diff --git a/STL_Extension/include/CGAL/Handle_for.h b/STL_Extension/include/CGAL/Handle_for.h index 8340f2359e8..fa589810da2 100644 --- a/STL_Extension/include/CGAL/Handle_for.h +++ b/STL_Extension/include/CGAL/Handle_for.h @@ -25,6 +25,8 @@ #ifndef CGAL_HANDLE_FOR_H #define CGAL_HANDLE_FOR_H +#include + #include #include #include diff --git a/STL_Extension/include/CGAL/Handle_for_virtual.h b/STL_Extension/include/CGAL/Handle_for_virtual.h index 1edc47ddd8d..34873917c85 100644 --- a/STL_Extension/include/CGAL/Handle_for_virtual.h +++ b/STL_Extension/include/CGAL/Handle_for_virtual.h @@ -26,7 +26,7 @@ #ifndef CGAL_HANDLE_FOR_VIRTUAL_H #define CGAL_HANDLE_FOR_VIRTUAL_H -#include +#include #include #include diff --git a/STL_Extension/include/CGAL/Iterator_project.h b/STL_Extension/include/CGAL/Iterator_project.h index 1c971a67bf7..7b2d8c9ef4d 100644 --- a/STL_Extension/include/CGAL/Iterator_project.h +++ b/STL_Extension/include/CGAL/Iterator_project.h @@ -27,6 +27,8 @@ #ifndef CGAL_ITERATOR_PROJECT_H #define CGAL_ITERATOR_PROJECT_H 1 +#include + namespace CGAL { // Relies on iterator traits. Quite simplified compared to earlier version. diff --git a/STL_Extension/include/CGAL/Multiset.h b/STL_Extension/include/CGAL/Multiset.h index 95eaca9a0e2..642bbcf1d15 100644 --- a/STL_Extension/include/CGAL/Multiset.h +++ b/STL_Extension/include/CGAL/Multiset.h @@ -25,6 +25,7 @@ #include #include #include +#include #include namespace CGAL { diff --git a/STL_Extension/include/CGAL/Sixtuple.h b/STL_Extension/include/CGAL/Sixtuple.h index a6fa181027c..c8c98c21697 100644 --- a/STL_Extension/include/CGAL/Sixtuple.h +++ b/STL_Extension/include/CGAL/Sixtuple.h @@ -25,6 +25,8 @@ #ifndef CGAL_SIXTUPLE_H #define CGAL_SIXTUPLE_H +#include + #ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { diff --git a/STL_Extension/include/CGAL/Threetuple.h b/STL_Extension/include/CGAL/Threetuple.h index a36e7fa6e6b..4dbe4920856 100644 --- a/STL_Extension/include/CGAL/Threetuple.h +++ b/STL_Extension/include/CGAL/Threetuple.h @@ -25,6 +25,8 @@ #ifndef CGAL_THREETUPLE_H #define CGAL_THREETUPLE_H +#include + #ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { diff --git a/STL_Extension/include/CGAL/Twotuple.h b/STL_Extension/include/CGAL/Twotuple.h index af5d834f753..4bfae8260ab 100644 --- a/STL_Extension/include/CGAL/Twotuple.h +++ b/STL_Extension/include/CGAL/Twotuple.h @@ -25,6 +25,8 @@ #ifndef CGAL_TWOTUPLE_H #define CGAL_TWOTUPLE_H +#include + #ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { diff --git a/STL_Extension/include/CGAL/array.h b/STL_Extension/include/CGAL/array.h index eee9d005fc0..59923661656 100644 --- a/STL_Extension/include/CGAL/array.h +++ b/STL_Extension/include/CGAL/array.h @@ -23,8 +23,6 @@ #include #ifndef CGAL_CFG_NO_CPP0X_ARRAY # include -#elif !defined CGAL_CFG_NO_TR1_ARRAY -# include #else # include #endif @@ -35,8 +33,6 @@ namespace cpp11 { #ifndef CGAL_CFG_NO_CPP0X_ARRAY using std::array; -#elif !defined CGAL_CFG_NO_TR1_ARRAY -using std::tr1::array; #else using boost::array; #endif diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index edad2e4b3d0..0470dfa2467 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -27,6 +27,8 @@ #ifndef CGAL_ASSERTIONS_H #define CGAL_ASSERTIONS_H +#include + // #include // for backward compatibility #ifndef CGAL_NO_ASSERTIONS diff --git a/STL_Extension/include/CGAL/function_objects.h b/STL_Extension/include/CGAL/function_objects.h index 3cabe354c14..aa2743a110d 100644 --- a/STL_Extension/include/CGAL/function_objects.h +++ b/STL_Extension/include/CGAL/function_objects.h @@ -29,6 +29,8 @@ #include +#include + namespace CGAL { template < class Value> diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 40f3d059cc5..5415c64fed8 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -1187,7 +1187,7 @@ filter_output_iterator(I e, const P& p) { return Filter_output_iterator< I, P >(e, p); } -#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES +#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_TUPLE) namespace internal { diff --git a/STL_Extension/include/CGAL/tuple.h b/STL_Extension/include/CGAL/tuple.h index d9b99013525..5755abe2c15 100644 --- a/STL_Extension/include/CGAL/tuple.h +++ b/STL_Extension/include/CGAL/tuple.h @@ -27,15 +27,11 @@ #ifndef CGAL_CFG_NO_CPP0X_TUPLE # include +#else +# include +# include +# include #endif -#ifndef CGAL_CFG_NO_TR1_TUPLE -# include -# include -#endif - -#include -#include -#include namespace CGAL { @@ -48,13 +44,6 @@ using std::tie; using std::get; using std::tuple_size; using std::tuple_element; -#elif !defined CGAL_CFG_NO_TR1_TUPLE -using std::tr1::tuple; -using std::tr1::make_tuple; -using std::tr1::tie; -using std::tr1::get; -using std::tr1::tuple_size; -using std::tr1::tuple_element; #else using boost::tuple; using boost::make_tuple; @@ -72,8 +61,8 @@ struct tuple_element: public boost::tuples::element{}; #endif -#if defined(CGAL_CFG_NO_CPP0X_TUPLE) && defined(CGAL_CFG_NO_TR1_TUPLE) -// If not TR1 or C++11 tuple, we need to add get(std::pair). +#if defined(CGAL_CFG_NO_CPP0X_TUPLE) +// If not C++11 tuple, we need to add get(std::pair). //////////////////////////////////////////////////////////// // // diff --git a/Scripts/developer_scripts/cgal_git_svn_clone b/Scripts/developer_scripts/cgal_git_svn_clone deleted file mode 100755 index 13eafddd243..00000000000 --- a/Scripts/developer_scripts/cgal_git_svn_clone +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/bash - -### Usage - -# TODO remove -g xor -c and replace by last argument? - -usage() -{ - echo "Usage: `basename $0` [-u userName] [-e userEmail] [-l userLogin] [-c cloneLocation] [-v] [-h] [-g gitname=cgal.git]" >&2 - echo >&2 - echo " -v the version" >&2 - echo " -h this info screen" >&2 - echo >&2 -} - -# TODO write cloneLocation to config(file) - -# echo " -m svnLocation -# echo " -r gives revision to start from. Other options than a number: LAST, BASE" >&2 -# echo " -f skip fetch" >&2 -# echo " -t skip tags" >&2 - -### Config - -userName="Eric Berberich" -userEmail=eric@mpi-inf.mpg.de -userLogin=eric -svnGforge=svn+ssh://$userLogin@scm.gforge.inria.fr/svn/cgal -#fromSvn=file://$HOME/CGAL/gforge/cgal-m -fromSvn=$svnGforge -fromRev=1 -gitName=cgal.git -skipTags=0 -skipFetch=0 -cloneLocation= - -# parse command line arguments -while getopts "u:e:l:r:m:g:c:fth" OPT; do - case "$OPT" in - -# for developers - u) userName=$OPTARG - ;; - - e) userEmail=$OPTARG - ;; - - l) userLogin=$OPTARG - ;; - - c) cloneLocation=$OPTARG - ;; - - g) gitName=$OPTARG - ;; - - h) usage - exit 0 - ;; - - v) echo "`basename $0` version 0.1" - exit 0 - ;; - -# for svn2git cloners - m) fromSvn=$OPTARG - ;; - - r) fromRev=$OPTARG - ;; - - f) skipFetch=1 - ;; - - t) skipTags=1 - ;; - -# for all - - \?) # getopts issues an error message - usage - exit 1 - ;; - esac -done - -#shift `expr $OPTIND - 1` - -if [ "$userName" = "" ]; then - echo "No username with -u parameter given" - exit 1 -fi - -if [ "$userEmail" = "" ]; then - echo "No useremail with -e parameter given" - exit 1 -fi - -if [ "$userLogin" = "" ]; then - echo "No userlogin with -l parameter given" - exit 1 -fi - -### Create repo - -echo "Create new directory $gitname" -rm -fr ./$gitName -mkdir ./$gitName -echo - -if [ "$cloneLocation" != "" ]; then - - echo "Cloning repo with svn-remotes from $cloneLocation" - git clone $cloneLocation $gitName - -fi - -cd $gitName - -# rewrite root -rewriteRoot=--rewrite-root=$svnGforge -#rewriteRoot= - - -# TODO tags; define behavior for developers, maybe as own svn-remote of git-remote that can be deleted and, if needed, reintegrated; OR: Convert to GIT tags? - -internalReleasesTags="--tags tags/internal-releases" -internalReleasesTags= - -debianTags="--tags tags/debian" -debianTags= - -# git svn init -echo "git svn init repository:" -git svn init $fromSvn $rewriteRoot --prefix=svn/next/ --trunk branches/next -git svn init $fromSvn $rewriteRoot --prefix=svn/ --trunk trunk -git svn init $fromSvn $rewriteRoot --prefix=svn/features/ --branches branches/features -git svn init $fromSvn $rewriteRoot --prefix=svn/releases/ --branches branches/releases -# rename refs -# TODO remove 'stable' for developers? -sed -e 's|next/trunk|next|g' -e 's|svn/trunk|svn/stable|g' -i "" .git/config -if [ $skipTags = 0 ]; then - git svn init $fromSvn $rewriteRoot --prefix=svn/tags/releases/ --tags tags/releases - sed -e 's|tags/releases/tags|tags/releases|g' -i "" .git/config - if [ "$internalReleasesTags" != "" ]; then - git svn init $fromSvn $rewriteRoot --prefix=svn/tags/internal-releases/ $internalReleasesTags - sed -e 's|tags/internal-releases/tags|tags/internal-releases|g' -i "" .git/config - fi - if [ "$debianTags" != "" ]; then - git svn init $fromSvn $rewriteRoot --prefix=svn/tags/debian/ $debianTags - sed -e 's|tags/debian/tags|tags/debian|g' -i "" .git/config - fi -fi -echo - -# add author -echo "Add author to $gitName/.git/config" -git config user.name "$userName" -git config user.email "$userEmail" -echo - -echo "Using config $gitName/.git/config:" -cat .git/config - -### git svn fetch - -if [ $skipFetch = 0 ]; then - - if [ "$cloneLocation" != "" ]; then - - # git config svn.authorsfile $(basename $(pwd))/git-authors - - echo "Rsyncing svn" - rsync -arpP --progress $cloneLocation/.git/svn .git/ - - echo "Fetching svn-branches" - git fetch $cloneLocation refs/remotes/svn/stable:refs/remotes/svn/stable refs/remotes/svn/next:refs/remotes/svn/next - for branch in `svn ls $fromSvn/branches/features`; do - git fetch $cloneLocation refs/remotes/svn/features/${branch%/}:refs/remotes/svn/features/${branch%/} - done; - - for branch in `svn ls $fromSvn/branches/releases`; do - git fetch $cloneLocation refs/remotes/svn/releases/${branch%/}:refs/remotes/svn/releases/${branch%/} - done; - - # TODO new tags! - - git remote rm origin # TODO remove line? - - git svn fetch # TODO --authors-file=/tmp/cgal-authors-file.txt - - git branch -a - git checkout master - git branch -D local-svn/next - - git svn rebase --all - - git checkout -b local-svn/next remotes/svn/next - git branch -D master - - git branch -a - - else - - ### Authors file - echo "Get authors file with svn" - svn cat $fromSvn/branches/next/Maintenance/git/authors-file.txt > /tmp/cgal-authors-file.txt - echo - - ### fetch from svn server - echo "Fetch from SVN repository: git svn fetch -r$fromRev:HEAD " - if [ "$fromRev" = "LAST" ]; then - # last revision on next - fromRev=$(svn info $fromSvn/branches/next | grep "Last Changed Rev: " | tr -d 'Last Changed Rev: ') - echo "Last Revision: $fromRev" - fi - git svn fetch --authors-file=/tmp/cgal-authors-file.txt -r$fromRev:HEAD - echo - - rm -f /tmp/cgal-authors-files.txt - - ### Tags - - # TODO - - - ### Branch names - - # rename master next - echo "Rename main branch to local/next" - git branch -m master local/next - - fi - -fi - -# What about? -### http://translate.org.za/blogs/wynand/en/content/changing-your-svn-repository-address-git-svn-setup -## unhandled.log (which lists all svn properties, such as svn:eol, that has not been converted). \ No newline at end of file diff --git a/Scripts/developer_scripts/create_new_release b/Scripts/developer_scripts/create_new_release index b0c262b30c9..10790f562a6 100755 --- a/Scripts/developer_scripts/create_new_release +++ b/Scripts/developer_scripts/create_new_release @@ -152,7 +152,13 @@ set -x cd ${TMPDIR} || return # Update the working copy -svn update ${SOURCES_DIR} +if [ -d "${SOURCES_DIR}/.git" ]; then + pushd "${SOURCES_DIR}" + git pull + popd +else + svn update ${SOURCES_DIR} +fi if [ -n "${CANDIDATES_DIR_HAS_BEEN_SET}" ]; then svn update ${CANDIDATES_DIR} fi diff --git a/SearchStructures/test/RangeSegmentTrees/segment_tree_set_2.cpp b/SearchStructures/test/RangeSegmentTrees/test_segment_tree_set_2.cpp similarity index 100% rename from SearchStructures/test/RangeSegmentTrees/segment_tree_set_2.cpp rename to SearchStructures/test/RangeSegmentTrees/test_segment_tree_set_2.cpp diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h index 622a17af7d0..7653f01bd9a 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Polygon_offset_builder_2_impl.h @@ -256,7 +256,7 @@ OutputIterator Polygon_offset_builder_2::TraceOffsetPolygon( mVisitor.on_offset_contour_started(); Halfedge_const_handle lHook = aSeed ; - + std::vector visited_hooks; do { CGAL_POLYOFFSET_TRACE(1,"STEP " << mStepID ) ; @@ -272,6 +272,8 @@ OutputIterator Polygon_offset_builder_2::TraceOffsetPolygon( CGAL_POLYOFFSET_TRACE(1,"B" << lLastHook->id() << " and B" << lHook->id() << " visited." ) ; lHook = lHook->opposite(); + + visited_hooks.push_back(lLastHook); } } @@ -287,6 +289,13 @@ OutputIterator Polygon_offset_builder_2::TraceOffsetPolygon( if ( lComplete ) *aOut++ = lPoly ; + else + { + for (std::size_t k=0;k +#include +#include +#include +#include +#include + +#include +#include + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; + +typedef Kernel::Point_2 Point_2; +typedef CGAL::Polygon_2 Contour; +typedef boost::shared_ptr ContourPtr; +typedef std::vector ContourSequence ; + +typedef CGAL::Straight_skeleton_2 Ss; + +typedef Ss::Halfedge_iterator Halfedge_iterator; +typedef Ss::Halfedge_handle Halfedge_handle; +typedef Ss::Vertex_handle Vertex_handle; + +typedef CGAL::Straight_skeleton_builder_traits_2 SsBuilderTraits; +typedef CGAL::Straight_skeleton_builder_2 SsBuilder; + +typedef CGAL::Polygon_offset_builder_traits_2 OffsetBuilderTraits; +typedef CGAL::Polygon_offset_builder_2 OffsetBuilder; + +int main() +{ + // A start-shaped polygon, oriented counter-clockwise as required for outer contours. + Point_2 pts[] = { Point_2(0,0), + Point_2(700,0), + Point_2(700,600), + Point_2(0,600), + Point_2(0,300), + Point_2(300,300), + Point_2(300,400), + Point_2(600,400), + Point_2(600,100), + Point_2(300,100), + Point_2(300,200), + Point_2(0,200) + } ; + + std::vector star(pts,pts+12); + + double offset = 50; // The offset distance + boost::optional margin = CGAL::compute_outer_frame_margin(star.begin(),star.end(),50.); + + // Proceed only if the margin was computed (an extremely sharp corner might cause overflow) + if ( margin ) + { + // Get the bbox of the polygon + CGAL::Bbox_2 bbox = CGAL::bbox_2(star.begin(),star.end()); + + // Compute the boundaries of the frame + double fxmin = bbox.xmin() - *margin ; + double fxmax = bbox.xmax() + *margin ; + double fymin = bbox.ymin() - *margin ; + double fymax = bbox.ymax() + *margin ; + + // Create the rectangular frame + Point_2 frame[4]= { Point_2(fxmin,fymin) + , Point_2(fxmax,fymin) + , Point_2(fxmax,fymax) + , Point_2(fxmin,fymax) + } ; + + SsBuilder ssb ; + + ssb.enter_contour(frame,frame+4); + ssb.enter_contour(star.rbegin(),star.rend()); + + boost::shared_ptr ss = ssb.construct_skeleton(); + + if ( ss ) + { + ContourSequence offset_contours ; + OffsetBuilder ob(*ss); + + ob.construct_offset_contours(offset, std::back_inserter(offset_contours)); + + if ( offset_contours.size()!=3 ) + { + std::cerr << "ERROR: invalid number of componant!\n"; + return 1; + } + } + } + + return 0; +} diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp index 0ca5ca63bf3..e19e615282d 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp @@ -491,7 +491,7 @@ void dump_skeleton_to_dxf( ISls const& aSkeleton , Color aContourBisectorColor , Color aSkeletonBisectorColor , Color aPeakBisectorColor - , Color aInfiniteBisectorColor + , Color /*aInfiniteBisectorColor*/ , string aLayer , DxfStream& rDXF ) diff --git a/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/EdgeProfile.tex b/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/EdgeProfile.tex index 45406680a3a..d1f2b05de35 100644 --- a/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/EdgeProfile.tex +++ b/Surface_mesh_simplification/doc_tex/Surface_mesh_simplification_ref/EdgeProfile.tex @@ -46,10 +46,10 @@ This profile is used by the stop, cost and placement policies. \ccGlue \ccMethod{vertex_descriptor v1() const;}{The other vertex of the edge to be collapsed.} \ccGlue - \ccMethod{edge_descriptor v0v1() const;}{One of the directed edges corresponding to the undirected + \ccMethod{edge_descriptor v0_v1() const;}{One of the directed edges corresponding to the undirected edge being collapsed.} \ccGlue - \ccMethod{edge_descriptor v1v0() const;}{The other directed edge corresponding to the undirected + \ccMethod{edge_descriptor v1_v0() const;}{The other directed edge corresponding to the undirected edge being collapsed.} \ccGlue \ccMethod{Point const& p0() const;}{The point of vertex $v0$.} @@ -60,11 +60,11 @@ This profile is used by the stop, cost and placement policies. {If $v0v1$ belongs to a finite face (is not a border edge) the third vertex of that triangular face, a {\em null descriptor} otherwise.} \ccGlue - \ccMethod{edge_descriptor v1vL() const;} + \ccMethod{edge_descriptor v_1vL() const;} {If $v0v1$ belongs to a finite face (is not a border edge) the directed edge from $v1$ to $vL$, a {\em null descriptor} otherwise.} \ccGlue - \ccMethod{edge_descriptor vLv0() const;} + \ccMethod{edge_descriptor vL_v0() const;} {If $v0v1$ belongs to a finite face (is not a border edge) the directed edge from $vL$ to $v0$, a {\em null descriptor} otherwise.} \ccGlue @@ -72,11 +72,11 @@ This profile is used by the stop, cost and placement policies. {If $v1v0$ belongs to a finite face (is not a border edge) the third vertex of that triangular face, a {\em null descriptor} otherwise.} \ccGlue - \ccMethod{edge_descriptor v0vR() const;} + \ccMethod{edge_descriptor v0_vR() const;} {If $v1v0$ belongs to a finite face (is not a border edge) the directed edge from $v0$ to $vR$, a {\em null descriptor} otherwise.} \ccGlue - \ccMethod{edge_descriptor vRv1() const;} + \ccMethod{edge_descriptor vR_v1() const;} {If $v1v0$ belongs to a finite face (is not a border edge) the directed edge from $vR$ to $v1$, a {\em null descriptor} otherwise.} \ccGlue diff --git a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt index 223cd96f064..86e1c27fd66 100644 --- a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt @@ -9,7 +9,7 @@ else() cmake_policy(VERSION 2.6) endif() -set(PACKAGE_ROOT ../..) +set(PACKAGE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) # Add several CGAL packages to the include and link paths, # if they lie in ${PACKAGE_ROOT}/. @@ -100,5 +100,9 @@ if ( CGAL_FOUND AND CGAL_Qt4_FOUND) message(STATUS "NOTICE: This demo needs libQGLViewer, and will not be compiled.") endif( QGLVIEWER_FOUND) else(CGAL_FOUND AND CGAL_Qt4_FOUND) + if(RUNNING_CGAL_AUTO_TEST) + # Just to avoid a warning from CMake if that variable is set on the command line... + endif() + message(STATUS "NOTICE: This demo needs Qt4, and will not be compiled.") endif(CGAL_FOUND AND CGAL_Qt4_FOUND) diff --git a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt index 3c0f833d148..ea0a7f36771 100644 --- a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt @@ -24,8 +24,11 @@ if ( CGAL_FOUND AND CGAL_ImageIO_FOUND ) create_single_source_cgal_program( "mesh_an_implicit_function.cpp" ) else() + if(RUNNING_CGAL_AUTO_TEST) + # Just to avoid a warning from CMake if that variable is set on the command line... + endif() - message(STATUS "NOTICE: This program requires the CGAL and CGAL ImageIO libraries, and will not be compiled.") + message(STATUS "NOTICE: This program requires the CGAL and CGAL ImageIO libraries, and will not be compiled.") endif() diff --git a/Testsuite/test/collect_cgal_testresults_from_cmake b/Testsuite/test/collect_cgal_testresults_from_cmake index 4cf57924b6e..918323d3cea 100755 --- a/Testsuite/test/collect_cgal_testresults_from_cmake +++ b/Testsuite/test/collect_cgal_testresults_from_cmake @@ -129,6 +129,7 @@ parse_lib_building_results() fi if [ -z "${configured}" ] ; then + y_or_no='r' echo "Not configured!" >> ${libname}_${shared_or_static}/$TEST_REPORT fi @@ -297,6 +298,9 @@ for DIR in $TEST_DIRECTORIES ; do echo " Test files from:" >> "$TEST_REPORT" cat .scm-urls >> "$TEST_REPORT" echo >> "$TEST_REPORT" + elif [ -f ../../.scm-branch ]; then + cat ../../.scm-branch >> "$TEST_REPORT" + echo >> "$TEST_REPORT" fi if [ ! -f ErrorOutput_${CGAL_TEST_PLATFORM} ] ; then diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h index c9e9d5a6852..9af5d0d8e69 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h @@ -24,7 +24,7 @@ #define CGAL_REGULAR_TRIANGULATION_CELL_BASE_3_H #include -#include +#include namespace CGAL { diff --git a/Triangulation_3/test/Triangulation_3/test_triangulation_tds.cpp b/Triangulation_3/test/Triangulation_3/test_triangulation_tds_3.cpp similarity index 100% rename from Triangulation_3/test/Triangulation_3/test_triangulation_tds.cpp rename to Triangulation_3/test/Triangulation_3/test_triangulation_tds_3.cpp