diff --git a/.gitattributes b/.gitattributes index 6fe87db0205..1f1e7e1fe1f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -177,6 +177,13 @@ Algebraic_kernel_d/include/CGAL/RS/sign_1.h -text Algebraic_kernel_d/include/CGAL/RS/sign_1_no_rs.h -text Algebraic_kernel_d/include/CGAL/RS/sign_1_rs.h -text Algebraic_kernel_d/include/CGAL/RS/ugcd.h -text +Algebraic_kernel_d/include/CGAL/RS/ugcd/crt.h -text +Algebraic_kernel_d/include/CGAL/RS/ugcd/inverse.h -text +Algebraic_kernel_d/include/CGAL/RS/ugcd/p.h -text +Algebraic_kernel_d/include/CGAL/RS/ugcd/pagealloc.h -text +Algebraic_kernel_d/include/CGAL/RS/ugcd/pp.h -text +Algebraic_kernel_d/include/CGAL/RS/ugcd/primes.h -text +Algebraic_kernel_d/include/CGAL/RS/ugcd/ugcd.h -text Algebraic_kernel_d/package_info/Algebraic_kernel_d/description.txt -text Algebraic_kernel_d/package_info/Algebraic_kernel_d/maintainer -text Algebraic_kernel_d/test/Algebraic_kernel_d/Algebraic_curve_kernel_2.cpp -text @@ -467,6 +474,7 @@ Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Bezier.dat -text Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Europe.dat -text Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp -text Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp -text +Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h -text Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_planar_vertical_decomposition.cpp -text Arrangement_on_surface_2/examples/Arrangement_on_surface_2/coll_points.dat -text Arrangement_on_surface_2/examples/Arrangement_on_surface_2/fan_grids.dat -text @@ -476,6 +484,16 @@ Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_d Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h -text Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_partition_traits_2.h -text Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_specified_points_generator.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h -text +Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h -text Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_on_sphere_transformation.h -text Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_transformation.h -text Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h -text @@ -501,6 +519,10 @@ Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_ren Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_1.h -text Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h -text Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/test/simple_models.h -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_test.h -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_dynamic_test.h -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_adaptor_test.h -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake eol=lf @@ -712,8 +734,25 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/spli Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/vertex -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/vertex.pt -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/linear/segments/xcurves -text -Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test02.txt -text -Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test02.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/curves/test01.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/ops/test01.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/queries/test01.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test01.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test03.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test04.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test01.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test02.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test01.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test02.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test03.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test04.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/xcurves/test02.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test02.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test01.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test10.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test02.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test10.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/xcurves/test10.txt -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/compare_y_at_x -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/compare_y_at_x.pt -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/polylines/compare_y_at_x.xcv -text @@ -824,6 +863,10 @@ Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_construction/te Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_observer/test01.txt -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_overlay/test01.txt -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/test_overlay/test02.txt -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_circle_segments.cmd -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic.cpp -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic_segments.cmd -text +Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_linear.cmd -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_equal.cpp -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_intersect.cpp -text Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_observer.cmd -text @@ -1424,9 +1467,12 @@ Convex_decomposition_3/examples/Convex_decomposition_3/list_of_convex_parts.cin Convex_decomposition_3/test/Convex_decomposition_3/check_decomposition.cin -text Convex_decomposition_3/test/Convex_decomposition_3/reflex_sedge.cpp -text Convex_decomposition_3/test/Convex_decomposition_3/star.nef3 -text +Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp -text Convex_hull_2/demo/Convex_hull_2/help/index.html svneol=native#text/html Convex_hull_2/doc_tex/Convex_hull_2/convex_hull.png -text Convex_hull_2/doc_tex/Convex_hull_2/saarhull.png -text svneol=unset#image/png +Convex_hull_2/examples/Convex_hull_2/iostream_convex_hull_2.cin -text +Convex_hull_2/test/Convex_hull_2/ch2_projection_3.cpp -text Convex_hull_3/benchmark/Convex_hull_3/compare_different_approach.cpp -text Convex_hull_3/benchmark/Convex_hull_3/is_on_positive_side.cpp -text Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt -text @@ -1724,7 +1770,6 @@ Installation/cmake/modules/CGAL_CheckCXXFileRuns.cmake -text Installation/cmake/modules/CGAL_Common.cmake -text Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake -text Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgramQt4.cmake -text -Installation/cmake/modules/CGAL_FindPackageHandleStandardArgs.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 @@ -1732,18 +1777,14 @@ Installation/cmake/modules/CGAL_SetupBoost.cmake -text Installation/cmake/modules/CGAL_SetupDependencies.cmake -text Installation/cmake/modules/CGAL_SetupFlags.cmake -text Installation/cmake/modules/CGAL_SetupGMP.cmake -text -Installation/cmake/modules/CGAL_SetupGMPXX.cmake -text -Installation/cmake/modules/CGAL_SetupLEDA.cmake -text -Installation/cmake/modules/CGAL_SetupMPFI.cmake -text -Installation/cmake/modules/CGAL_SetupNTL.cmake -text -Installation/cmake/modules/CGAL_SetupRS.cmake -text Installation/cmake/modules/CGAL_TweakFindBoost.cmake -text Installation/cmake/modules/CGAL_UseBLAS.cmake -text Installation/cmake/modules/CGAL_UseLAPACK.cmake -text +Installation/cmake/modules/CGAL_UseLEDA.cmake -text Installation/cmake/modules/CGAL_UseMKL.cmake -text Installation/cmake/modules/CGAL_UseMPFI.cmake -text -Installation/cmake/modules/CGAL_UseNTL.cmake -text Installation/cmake/modules/CGAL_UseRS.cmake -text +Installation/cmake/modules/CGAL_UseRS3.cmake -text Installation/cmake/modules/CGAL_UseTAUCS.cmake -text Installation/cmake/modules/CGAL_VersionUtils.cmake -text Installation/cmake/modules/FindBLAS.cmake -text @@ -1764,10 +1805,10 @@ Installation/cmake/modules/FindMPFI.cmake -text Installation/cmake/modules/FindMPFR.cmake -text Installation/cmake/modules/FindNTL.cmake -text Installation/cmake/modules/FindOpenGL.cmake -text -Installation/cmake/modules/FindPackageMessage.cmake -text Installation/cmake/modules/FindQGLViewer.cmake -text Installation/cmake/modules/FindQt3-patched.cmake -text Installation/cmake/modules/FindRS.cmake -text +Installation/cmake/modules/FindRS3.cmake -text Installation/cmake/modules/FindSuperLU.cmake -text Installation/cmake/modules/FindTAUCS.cmake -text Installation/cmake/modules/Qt3Macros-patched.cmake -text @@ -1814,7 +1855,7 @@ Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Line_3_intersec Intersections_3/test/Intersections_3/segment_segment.cpp -text Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp -text Interval_skip_list/doc_tex/Interval_skip_list/query.png -text -Interval_skip_list/examples/Interval_skip_list/isl_terrain.pts -text +Interval_skip_list/examples/Interval_skip_list/terrain.pts -text Interval_support/include/CGAL/Test/_test_bigfloat_interval_traits.h -text Interval_support/include/CGAL/Test/_test_convert_to_bfi.h -text Interval_support/package_info/Interval_support/description.txt -text @@ -1870,7 +1911,9 @@ Kernel_23/examples/Kernel_23/MyPointC2_iostream.h -text Kernel_23/examples/Kernel_23/cartesian_converter.cpp -text Kernel_23/include/CGAL/functions_on_enums.h -text Kernel_23/include/CGAL/internal/Projection_traits_3.h -text +Kernel_23/test/Kernel_23/include/CGAL/_Result_of_kernel.h -text Kernel_23/test/Kernel_23/overload_bug.cpp -text +Kernel_23/test/Kernel_23/test_result_of.cpp -text Kernel_d/doc_tex/Kernel_d/hypercube.png -text Kernel_d/doc_tex/Kernel_d_ref/Kernel_Compute_coordinate_d.tex -text Kernel_d/doc_tex/Kernel_d_ref/Kernel_Less_coordinate_d.tex -text @@ -1949,9 +1992,11 @@ Largest_empty_rect_2/doc_tex/Inscribed_areas_ref/ler-detail.png -text Largest_empty_rect_2/doc_tex/Inscribed_areas_ref/ler.png -text Largest_empty_rect_2/test/Largest_empty_rect_2/cgal_test eol=lf Largest_empty_rect_2/test/Largest_empty_rect_2/cgal_test_with_cmake eol=lf +Linear_cell_complex/demo/Linear_cell_complex/CreateMenger.ui -text Linear_cell_complex/demo/Linear_cell_complex/CreateMesh.ui -text Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3.qrc -text Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_subdivision.cpp -text +Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_pqq_subdivision.cpp -text Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui -text Linear_cell_complex/demo/Linear_cell_complex/about_Linear_cell_complex_3.html svneol=native#text/html Linear_cell_complex/doc_tex/Linear_cell_complex/Linear_cell_complex.tex -text @@ -2054,6 +2099,7 @@ Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_triangula Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_qt.h -text Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_viewer_vtk.h -text Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_colored_vertices.cpp -text +Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_mypoint.cpp -text Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_4.cpp -text Linear_cell_complex/examples/Linear_cell_complex/plane_graph_to_lcc_2.cpp -text Linear_cell_complex/examples/Linear_cell_complex/voronoi_2.cpp -text @@ -2141,6 +2187,7 @@ Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release -text Maintenance/infrastructure/cgal.geometryfactory.com/bin/dump_crontab -text Maintenance/infrastructure/cgal.geometryfactory.com/bin/update_manual_tools -text Maintenance/infrastructure/cgal.geometryfactory.com/crontab -text +Maintenance/infrastructure/cgal.geometryfactory.com/partition-table-sda.txt -text Maintenance/infrastructure/cgal.geometryfactory.com/reference-platforms/boostrap -text Maintenance/infrastructure/cgal.geometryfactory.com/reference-platforms/common-setup -text Maintenance/infrastructure/cgal.geometryfactory.com/reference-platforms/i686_Linux-2.6_g++-3.4.6_CentOS-5.1-O2/CMakeCache.txt -text @@ -2196,11 +2243,12 @@ Maintenance/public_release/announcement/CGAL-3.7 -text Maintenance/public_release/announcement/CGAL-3.7-beta1 -text Maintenance/public_release/announcement/CGAL-3.8 -text Maintenance/public_release/announcement/CGAL-3.8-beta -text -Maintenance/public_release/announcement/CGAL-3.8.1 -text Maintenance/public_release/announcement/CGAL-3.9 -text Maintenance/public_release/announcement/CGAL-3.9-beta1 -text Maintenance/public_release/announcement/CGAL-4.0 -text Maintenance/public_release/announcement/CGAL-4.0-beta1 -text +Maintenance/public_release/announcement/CGAL-4.0.1 -text +Maintenance/public_release/announcement/CGAL-4.0.2 -text Maintenance/public_release/scripts/precompiled_demos_zips -text Maintenance/public_release/scripts/prepare_release -text Maintenance/release_building/BUGFIX_NUMBER -text @@ -3146,7 +3194,11 @@ Polygon/doc_tex/Polygon/polygon.png -text Polyhedron/demo/Polyhedron/Deform_mesh.ui -text Polyhedron/demo/Polyhedron/MainWindow.ui -text Polyhedron/demo/Polyhedron/Polyhedron_3.qrc -text +Polyhedron/demo/Polyhedron/Polyhedron_demo_corefinement_plugin.cpp -text Polyhedron/demo/Polyhedron/Remeshing_dialog.ui -text +Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp -text +Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h -text +Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item_config.h -text Polyhedron/demo/Polyhedron/Show_point_dialog.ui -text Polyhedron/demo/Polyhedron/cgal_test_with_cmake eol=lf Polyhedron/demo/Polyhedron/data/anchor.off -text svneol=unset#application/octet-stream @@ -3226,12 +3278,17 @@ Polyhedron/doc_tex/Polyhedron_ref/fig/add_facet.pdf -text svneol=unset#applicati Polyhedron/doc_tex/Polyhedron_ref/fig/add_facet1.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/add_facet2.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/euler.pdf -text svneol=unset#application/pdf +Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg -text Polyhedron/doc_tex/Polyhedron_ref/fig/euler_center.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/euler_center.pdf -text svneol=unset#application/pdf Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.gif -text svneol=unset#image/gif +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf -text svneol=unset#application/pdf +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg -text Polyhedron/doc_tex/Polyhedron_ref/fig/euler_loop.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/euler_loop.pdf -text svneol=unset#application/pdf Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.gif -text svneol=unset#image/gif +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf -text svneol=unset#application/pdf +Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg -text Polyhedron/doc_tex/Polyhedron_ref/fig/halfedge.gif -text svneol=unset#image/gif Polyhedron/doc_tex/Polyhedron_ref/fig/halfedge.pdf -text svneol=unset#application/pdf Polyhedron/doc_tex/Polyhedron_ref/fig/halfedge_small.gif -text svneol=unset#image/gif @@ -3242,6 +3299,15 @@ Polyhedron/examples/Polyhedron/corner.off -text svneol=unset#application/octet-s Polyhedron/examples/Polyhedron/corner_with_hole.off -text svneol=unset#application/octet-stream Polyhedron/examples/Polyhedron/corner_with_sharp_edge.off -text svneol=unset#application/octet-stream Polyhedron/examples/Polyhedron/cross.off -text svneol=unset#application/octet-stream +Polyhedron/include/CGAL/corefinement_operations.h -text +Polyhedron/include/CGAL/internal/corefinement/Combinatorial_map_for_corefinement.h -text +Polyhedron/include/CGAL/internal/corefinement/Polyhedron_constness_types.h -text +Polyhedron/include/CGAL/internal/corefinement/Polyhedron_subset_extraction.h -text +Polyhedron/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h -text +Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h -text +Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h -text +Polyhedron/include/CGAL/intersection_of_Polyhedra_3.h -text +Polyhedron/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h -text Polynomial/doc_tex/Polynomial/Polynomial.png -text Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d_ConstructCoefficientConstIteratorRange.tex -text Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d_ConstructInnermostCoefficientConstIteratorRange.tex -text @@ -3488,10 +3554,14 @@ STL_Extension/include/CGAL/internal/boost/mutable_heap.hpp -text STL_Extension/include/CGAL/internal/boost/mutable_queue.hpp -text STL_Extension/test/STL_Extension/test_Modifiable_priority_queue.cpp -text STL_Extension/test/STL_Extension/test_Uncertain.cpp -text +STL_Extension/test/STL_Extension/test_namespaces.cpp -text STL_Extension/test/STL_Extension/test_type_traits.cpp -text Scripts/developer_scripts/autotest_cgal -text Scripts/developer_scripts/autotest_cgal_with_cmake -text Scripts/developer_scripts/cgal_build -text +Scripts/developer_scripts/cgal_generate_cmake_script -text +Scripts/developer_scripts/cgal_generate_cmake_script.cmake -text +Scripts/developer_scripts/cgal_git_svn_clone -text Scripts/developer_scripts/cgal_header_clean_up.py -text Scripts/developer_scripts/cgal_test_with_cmake eol=lf Scripts/developer_scripts/check_library_uses_no_gpl_files -text @@ -3518,6 +3588,8 @@ Scripts/developer_scripts/remove_package_files_from_build_tree.rb -text Scripts/developer_scripts/remove_package_files_from_build_tree_impl.rb -text Scripts/developer_scripts/replace_CGAL_NAMESPACE.py -text Scripts/developer_scripts/test_testsuite_submission -text +Scripts/developer_scripts/update_git_svn_clone -text +Scripts/scripts/cgal_create_CMakeLists -text Scripts/scripts/cgal_create_assertions.sh eol=lf Scripts/scripts/cgal_create_cmake_script -text Scripts/scripts/cgal_create_cmake_script_with_options -text @@ -4221,6 +4293,7 @@ Testsuite/test/Testsuite/cgal_test_with_cmake eol=lf Testsuite/test/collect_cgal_testresults_from_cmake -text Testsuite/test/makefile2 -text Testsuite/test/run_testsuite_with_cmake -text +Triangulation_2/benchmark/Triangulation_2/CDT_with_intersection_2.cpp -text Triangulation_2/benchmark/Triangulation_2/Delaunay_remove.cpp -text Triangulation_2/demo/Triangulation_2/qt3/help/cindex.html svneol=native#text/html Triangulation_2/demo/Triangulation_2/qt3/help/cinput_point_layer.gif -text svneol=unset#image/gif diff --git a/.gitignore b/.gitignore index 451529c1056..34ebe46c01c 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,7 @@ CGALimageIO/demo/CGALimageIO/cmake_install.cmake CGALimageIO/demo/CGALimageIO/image_to_vtk_viewer CGALimageIO/examples/CGALimageIO/*.exe CGALimageIO/examples/CGALimageIO/Makefile +CGALimageIO/examples/CGALimageIO/cgal_test_with_cmake CGALimageIO/examples/CGALimageIO/convert_raw_image_to_inr CGALimageIO/examples/CGALimageIO/makefile CGALimageIO/examples/CGALimageIO/test_imageio @@ -163,6 +164,17 @@ Installation/auxiliary/gdb/test Installation/cmake/modules/*.tmp Installation/test/Installation/cgal_test Installation/test/Installation/deprecation_warning +Interpolation/demo/Interpolation/cgal_test_with_cmake +Intersections_3/test/Intersections_3/CMakeLists.txt +Intersections_3/test/Intersections_3/bbox_other_do_intersect_test +Intersections_3/test/Intersections_3/cgal_test_with_cmake +Intersections_3/test/Intersections_3/circle_other +Intersections_3/test/Intersections_3/line_line +Intersections_3/test/Intersections_3/segment_segment +Intersections_3/test/Intersections_3/test_intersections_3 +Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection +Intersections_3/test/Intersections_3/triangle_other +Intersections_3/test/Intersections_3/triangle_other_intersection_test Jet_fitting_3/examples/Jet_fitting_3/*.exe Jet_fitting_3/examples/Jet_fitting_3/*.sln Jet_fitting_3/examples/Jet_fitting_3/*.vcproj @@ -504,6 +516,8 @@ Mesh_2/doc_tex/Mesh_2_ref/semantic.cache Mesh_2/doxygen Mesh_2/examples/Mesh_2/*.core Mesh_2/examples/Mesh_2/.*.deps +Mesh_2/examples/Mesh_2/CMakeLists.txt +Mesh_2/examples/Mesh_2/cgal_test_with_cmake Mesh_2/examples/Mesh_2/conform Mesh_2/examples/Mesh_2/conforming Mesh_2/examples/Mesh_2/depends @@ -570,6 +584,7 @@ Mesh_3/examples/Mesh_3/*.png Mesh_3/examples/Mesh_3/.*.deps Mesh_3/examples/Mesh_3/Makefile Mesh_3/examples/Mesh_3/applications +Mesh_3/examples/Mesh_3/cgal_test_with_cmake Mesh_3/examples/Mesh_3/cgal_to_medit Mesh_3/examples/Mesh_3/chair-after.mesh Mesh_3/examples/Mesh_3/chair-after.png @@ -585,6 +600,16 @@ Mesh_3/examples/Mesh_3/implicit_surfaces_mesher_3 Mesh_3/examples/Mesh_3/lanteri Mesh_3/examples/Mesh_3/lanteri_output_tet_mesh Mesh_3/examples/Mesh_3/medit_to_cgal +Mesh_3/examples/Mesh_3/mesh_3D_gray_image +Mesh_3/examples/Mesh_3/mesh_3D_image +Mesh_3/examples/Mesh_3/mesh_3D_image_variable_size +Mesh_3/examples/Mesh_3/mesh_implicit_sphere +Mesh_3/examples/Mesh_3/mesh_implicit_sphere_variable_size +Mesh_3/examples/Mesh_3/mesh_optimization_example +Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example +Mesh_3/examples/Mesh_3/mesh_polyhedral_domain +Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features +Mesh_3/examples/Mesh_3/mesh_two_implicit_spheres_with_balls Mesh_3/examples/Mesh_3/my_makefile Mesh_3/examples/Mesh_3/off_to_ghs Mesh_3/examples/Mesh_3/out*.mesh.* @@ -685,6 +710,8 @@ Min_ellipse_2/.tmp Min_ellipse_2/Makefile Min_ellipse_2/bin Min_ellipse_2/doc_ps +Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt +Minkowski_sum_3/test/Minkowski_sum_3/cgal_test_with_cmake Modular_arithmetic/doc_html Modular_arithmetic/doc_pdf Modular_arithmetic/doc_ps @@ -966,6 +993,28 @@ Ridges_3/test/Ridges_3/*.sln Ridges_3/test/Ridges_3/*.vcproj Ridges_3/test/Ridges_3/Makefile Ridges_3/test/Ridges_3/ridge_test +STL_Extension/test/STL_Extension/CMakeLists.txt +STL_Extension/test/STL_Extension/cgal_test_with_cmake +STL_Extension/test/STL_Extension/test_Cache +STL_Extension/test/STL_Extension/test_Compact_container +STL_Extension/test/STL_Extension/test_Concatenate_iterator +STL_Extension/test/STL_Extension/test_Flattening_iterator +STL_Extension/test/STL_Extension/test_Handle_with_policy +STL_Extension/test/STL_Extension/test_In_place_list +STL_Extension/test/STL_Extension/test_Modifiable_priority_queue +STL_Extension/test/STL_Extension/test_Nested_iterator +STL_Extension/test/STL_Extension/test_Uncertain +STL_Extension/test/STL_Extension/test_complexity_tags +STL_Extension/test/STL_Extension/test_composition +STL_Extension/test/STL_Extension/test_dispatch_output +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_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 Skin_surface_3/.cdtproject Skin_surface_3/.project Skin_surface_3/.settings @@ -978,6 +1027,8 @@ Skin_surface_3/test/Skin_surface_3/error.txt Skin_surface_3/test/Skin_surface_3/makefile Skin_surface_3/test/Skin_surface_3/msgs.txt Skin_surface_3/test/Skin_surface_3/subdivision_test +Spatial_sorting/test/Spatial_sorting/CMakeLists.txt +Spatial_sorting/test/Spatial_sorting/cgal_test_with_cmake Stream_lines_2/demo/Stream_lines_2/*.exe Stream_lines_2/demo/Stream_lines_2/*.sln Stream_lines_2/demo/Stream_lines_2/*.vcproj @@ -1186,12 +1237,17 @@ Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/error.txt Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/poisson_reconstruction_test Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/release Testsuite/test/myrun_testsuite_with_cmake +Triangulation_2/CMakeLists.txt +Triangulation_2/cgal_test_with_cmake Triangulation_2/demo/Triangulation_2/*.exe Triangulation_2/demo/Triangulation_2/Makefile Triangulation_2/demo/Triangulation_2/constrained Triangulation_2/demo/Triangulation_2/constrained_delaunay_triangulation_2 Triangulation_2/demo/Triangulation_2/delaunay_triangulation_2 Triangulation_2/demo/Triangulation_2/regular_triangulation_2 +Triangulation_2/examples/Triangulation_2/CMakeLists.txt +Triangulation_2/examples/Triangulation_2/cgal_test_with_cmake +Triangulation_2/examples/Triangulation_2/regular Triangulation_2/test/Triangulation_2/*.exe Triangulation_2/test/Triangulation_2/CMakeLists.txt Triangulation_2/test/Triangulation_2/Makefile @@ -1205,13 +1261,18 @@ Triangulation_2/test/Triangulation_2/test_const_triang_plus_2 Triangulation_2/test/Triangulation_2/test_constrained_triangulation_2 Triangulation_2/test/Triangulation_2/test_delaunay_hierarchy_2 Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_2 +Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_proj Triangulation_2/test/Triangulation_2/test_regular_hierarchy_2 Triangulation_2/test/Triangulation_2/test_regular_triangulation_2 +Triangulation_2/test/Triangulation_2/test_structural_filtering_traits Triangulation_2/test/Triangulation_2/test_triangulation_2 Triangulation_2/test/Triangulation_2/test_triangulation_2_bis Triangulation_2/test/Triangulation_2/test_triangulation_geom_traits Triangulation_2/test/Triangulation_2/test_triangulation_tds Triangulation_2/test/Triangulation_2/vrml_tds* +Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt +Triangulation_3/benchmark/Triangulation_3/cgal_test_with_cmake +Triangulation_3/benchmark/Triangulation_3/simple Triangulation_3/examples/Triangulation_3/*.exe Triangulation_3/examples/Triangulation_3/CMakeLists.txt Triangulation_3/examples/Triangulation_3/adding_handles_3 @@ -1247,6 +1308,7 @@ Triangulation_3/test/Triangulation_3/makefile Triangulation_3/test/Triangulation_3/test_delaunay_3 Triangulation_3/test/Triangulation_3/test_delaunay_hierarchy_3 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_remove_3 diff --git a/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex b/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex index 0be28c2830a..095f8f5a732 100644 --- a/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex +++ b/AABB_tree/doc_tex/AABB_tree_ref/AABBTraits.tex @@ -95,10 +95,10 @@ for which the class \ccc{AABB_tree} may receive a distance query. \ccMethod{Closest_point closest_point_object();}{Returns the closest point constructor.} \ccHasModels -\ccc{AABB_traits}. +\ccc{AABB_traits}. \ccSeeAlso -\ccc{AABB_traits}\\ +\ccc{AABB_traits}\\ \ccc{AABB_tree} \ccc{AABBPrimitive} diff --git a/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h b/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h index 39055e66dd0..e1182918432 100644 --- a/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h +++ b/Algebraic_foundations/include/CGAL/Scalar_factor_traits.h @@ -60,8 +60,8 @@ public: static Scalar scalar_factor(const NT& a, Field_tag) { return (a == NT(0)) ? NT(0) : NT(1); } - static Scalar scalar_factor(const NT& a, - const Scalar& d, + static Scalar scalar_factor(const NT& /* a */, + const Scalar& /* d */, Integral_domain_tag) { return Scalar(1); } diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt index e8df7b9ee6c..0845c7f8470 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt @@ -13,17 +13,13 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) endif() endif() -find_package(CGAL QUIET COMPONENTS Core) +find_package(CGAL QUIET COMPONENTS Core MPFI) if ( CGAL_FOUND ) include( ${CGAL_USE_FILE} ) include( CGAL_CreateSingleSourceCGALProgram ) include( CGAL_VersionUtils ) - find_package( MPFI ) - if( MPFI_FOUND ) - include( ${MPFI_USE_FILE} ) - endif( MPFI_FOUND ) include_directories (BEFORE ../../include) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h index becf51aa418..2e3cc7bf9a9 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h @@ -479,7 +479,6 @@ inline convert_to_bfi(const internal::Algebraic_real_d_1< Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1 >& x){ typedef typename Get_arithmetic_kernel::Arithmetic_kernel AT; typedef typename AT::Bigfloat_interval BFI; - typedef internal::Algebraic_real_d_1< Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1 > ALG; if (x.is_rational()) return convert_to_bfi(x.rational()); diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h index f5095fd53be..3bf27e2379f 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h @@ -1051,7 +1051,7 @@ public: * of the isolated polynomial * */ - virtual bool is_certainly_simple_root(int i) const { + virtual bool is_certainly_simple_root(int /* i */) const { return false; } @@ -1060,7 +1060,7 @@ public: * of the isolated polynomial * */ - virtual bool is_certainly_multiple_root(int i) const { + virtual bool is_certainly_multiple_root(int /* i */) const { return false; } @@ -1230,7 +1230,7 @@ public: * has at most one multiple root over the complex numbers, the roots are * certainly isolated with success. */ - Bitstream_descartes(M_k_descartes_tag , + Bitstream_descartes(M_k_descartes_tag /* t */, Polynomial f,int m,int k, Bitstream_descartes_rndl_tree_traits traits = Bitstream_descartes_rndl_tree_traits(), @@ -1244,7 +1244,7 @@ public: } - Bitstream_descartes(M_k_descartes_tag t, + Bitstream_descartes(M_k_descartes_tag /* t */, Polynomial f,int m,int k, Bitstream_tree tree, Bitstream_descartes_rndl_tree_traits traits @@ -1299,7 +1299,7 @@ public: * */ template - Bitstream_descartes(Vert_line_adapter_descartes_tag t, + Bitstream_descartes(Vert_line_adapter_descartes_tag /* t */, InputIterator begin, InputIterator end, Bitstream_descartes_rndl_tree_traits traits) diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h index 5453604a16a..3e26f0d5098 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h @@ -1405,7 +1405,7 @@ public: if (!is_certainly_zero) ub_log2 = Ceil_log2_abs()(x); return true; // reported bound is tight } - bool improve_upper_bound(NT x, long&, bool&) { return true; } + bool improve_upper_bound(NT, long&, bool&) { return true; } }; /*! \ingroup NiX_Bitstream_descartes_tree diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index 80a4499218e..a9c39bf9126 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -796,8 +796,6 @@ private: CGAL_precondition(x.is_rational()); Bound r = x.rational(); - typedef typename CGAL::Fraction_traits FT; - int k = degree_of_local_gcd(event_indices(i).fg,x); Polynomial_2 sres = subresultants(k); @@ -1957,7 +1955,7 @@ create_slice_from_slice_info(size_type id, switch(it->first) { case(CGAL::internal::FIRST_CURVE): { if(event_flag) { - arc_container.push_back(std::make_pair(0,it->second)); + arc_container.push_back(Arc_pair(0,it->second)); } else { int_container.push_back(0); } @@ -1965,7 +1963,7 @@ create_slice_from_slice_info(size_type id, } case(CGAL::internal::SECOND_CURVE): { if(event_flag) { - arc_container.push_back(std::make_pair(1,it->second)); + arc_container.push_back(Arc_pair(1,it->second)); } else { int_container.push_back(1); } @@ -1973,7 +1971,7 @@ create_slice_from_slice_info(size_type id, } case(CGAL::internal::INTERSECTION): { CGAL_assertion(event_flag); - arc_container.push_back(std::make_pair(2,it->second)); + arc_container.push_back(Arc_pair(2,it->second)); break; } case(CGAL::internal::CANDIDATE): { diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h index 08f1b9e035f..b332f71af2e 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h @@ -265,7 +265,6 @@ private: void intern_decompose( Polynomial P_, ::CGAL::Tag_true){ typename FT_poly::Decompose decompose; typedef typename FT_poly::Numerator_type Numerator_poly; - typedef typename Numerator_poly::NT Coeff; typename FT_poly::Numerator_type NumP; typename FT_poly::Denominator_type dummy; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h index b47a9b672ba..15bdd8b9b52 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Shear_transformation.h @@ -290,7 +290,7 @@ private: // X-coordinate of the shear of p Bound x_sheared(Point p,Integer sh) { - return p.first-s*p.second; + return p.first-sh*p.second; } Bound x_sheared(Bound x,Bound y,Integer sh) { return x-sh*y; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h index da6810668a3..d7b9cef2806 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h @@ -268,12 +268,16 @@ public: Algebraic_real_1 y() const { typedef std::vector< Algebraic_real_1 > Roots; - typedef typename Curve_analysis_2::Status_line_1 Key; - typedef Roots Data; - typedef std::map< Key, Data, CGAL::Handle_id_less_than< Key > > - Y_root_map; + // EBEB 2012-07-05 deactivated map for y-roots for not being used + // typedef typename Curve_analysis_2::Status_line_1 Key; + // EBEB 2012-07-05 deactivated map for y-roots for not being used + // typedef Roots Data; + // EBEB 2012-07-05 deactivated map for y-roots for not being used + // typedef std::map< Key, Data, CGAL::Handle_id_less_than< Key > > + // Y_root_map; - static Y_root_map y_root_map; + // EBEB 2012-07-05 deactivated map for y-roots for not being used + //static Y_root_map y_root_map; if (!this->ptr()->_m_y) { @@ -287,8 +291,9 @@ public: typename Curve_analysis_2::Status_line_1 line = curve().status_line_at_exact_x(x()); - typename Y_root_map::iterator yit = - y_root_map.find(line); + // EBEB 2012-07-05 deactivated map for y-roots for not being used + //typename Y_root_map::iterator yit = + // y_root_map.find(line); // TODO: Cache resultant computation // exacus-related code shouldn't be used here diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h index 6941968602f..dac4b2b3389 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/algebraic_curve_kernel_2_tools.h @@ -232,10 +232,6 @@ namespace for_zero_test_bivariate { template void cast_back_utcf(const Poly_coer_1& p,Polynomial_1& q) { // We can assume that both template arguments are polynomial types - typedef typename CGAL::Polynomial_traits_d::Coefficient_type - Coercion_type; - typedef typename CGAL::Polynomial_traits_d::Coefficient_type - Coefficient; typedef CGAL::Fraction_traits FT; CGAL_static_assertion((::boost::is_same::value)); @@ -275,8 +271,8 @@ template bool result; typedef typename AlgebraicCurveKernel_2::Polynomial_1 Polynomial_1; #if !CGAL_ACK_USE_NO_REDUCTION_MODULO_RESULTANT - - typedef typename AlgebraicCurveKernel_2::Algebraic_real_1 Algebraic_real_1; + + //typedef typename AlgebraicCurveKernel_2::Algebraic_real_1 Algebraic_real_1; typedef typename AlgebraicCurveKernel_2::Bound Bound; typedef typename AlgebraicCurveKernel_2::Coefficient Coefficient; typedef typename AlgebraicCurveKernel_2::Polynomial_2 Polynomial_2; @@ -285,8 +281,6 @@ template typedef typename Coercion::Type Coercion_type; typedef typename CGAL::Polynomial_traits_d ::template Rebind::Other::Type Poly_coer_1; - typedef typename CGAL::Polynomial_traits_d - ::template Rebind::Other::Type Poly_coer_2; typename Coercion::Cast cast; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h index 23a10bb43f3..4e7fb7a3802 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/refine_zero_against.h @@ -99,7 +99,6 @@ int descartes(Polynomial& p, const Field& low,const Field& high){ */ template bool refine_zero_against(Field& low, Field& high, Polynomial p, Polynomial q) { - typedef typename Polynomial::NT COEFF; typename Algebraic_structure_traits::Simplify simplify; CGAL_precondition(low < high); diff --git a/Algebraic_kernel_d/include/CGAL/RS/Algebraic_kernel_rs_1.h b/Algebraic_kernel_d/include/CGAL/RS/Algebraic_kernel_rs_1.h index c036cda77b6..c49dfc01e97 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/Algebraic_kernel_rs_1.h +++ b/Algebraic_kernel_d/include/CGAL/RS/Algebraic_kernel_rs_1.h @@ -24,7 +24,14 @@ #include #include -template +template struct Algebraic_kernel_rs_1{ typedef _C Coefficient; diff --git a/Algebraic_kernel_d/include/CGAL/RS/algebraic_1_comparisons.h b/Algebraic_kernel_d/include/CGAL/RS/algebraic_1_comparisons.h index b525c0e667a..de029659810 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/algebraic_1_comparisons.h +++ b/Algebraic_kernel_d/include/CGAL/RS/algebraic_1_comparisons.h @@ -25,11 +25,19 @@ namespace CGAL{ +#if CGAL_USE_RS3 inline bool operator<(const Algebraic_1 &n1,const Algebraic_1 &n2){ typedef CGAL::Rsgcd_1 Gcd; return(CGAL::RS_COMPARE::compare_1(n1,n2)==SMALLER); } +#else +inline +bool operator<(const Algebraic_1 &n1,const Algebraic_1 &n2){ + typedef CGAL::Cgalgcd_1 Gcd; + return(CGAL::RS_COMPARE::compare_1(n1,n2)==SMALLER); +} +#endif inline bool operator==(const Algebraic_1 &n1,const Algebraic_1 &n2){ diff --git a/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h b/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h index b5b24196bb6..4b81342a1f6 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h +++ b/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h @@ -19,13 +19,18 @@ #ifndef CGAL_RS_POLYNOMIAL_1_UTILS_H #define CGAL_RS_POLYNOMIAL_1_UTILS_H +#include #include -#include #include #include #include -#include +#ifdef CGAL_RS_USE_UGCD +#include +#endif #include +#ifdef CGAL_USE_RS3 +#include +#endif namespace CGAL{ @@ -64,6 +69,7 @@ public std::binary_function{ } }; +#ifdef CGAL_RS_USE_UGCD // my modular gcd algorithm struct Modgcd_1: public std::binary_function{ @@ -85,6 +91,7 @@ public std::binary_function{ return *result; } }; +#endif // CGAL_RS_USE_UGCD // Cont()(c,u) stores in c the gcd of the coefficients of u struct Cont: diff --git a/Algebraic_kernel_d/include/CGAL/RS/ugcd/crt.h b/Algebraic_kernel_d/include/CGAL/RS/ugcd/crt.h new file mode 100644 index 00000000000..4b9514605ce --- /dev/null +++ b/Algebraic_kernel_d/include/CGAL/RS/ugcd/crt.h @@ -0,0 +1,114 @@ +// Copyright (c) 2007 Inria Lorraine (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: Luis Peñaranda + +#ifndef CGAL_RS__CRT_H +#define CGAL_RS__CRT_H + +#include "pp.h" +#include +#include +#include + +namespace CGAL{ +namespace RS_MGCD{ + +class Crt:public Prime_polynomial{ + protected: + + // chinese remainder torture (GCL, page 180) + static + void cra(mpz_ptr r,CGALRS_PN * m,CGALRS_PN *u,int n){ + int k,i; + CGALRS_PN product,temp; + std::vector v(n); + + v[0]=u[0]; + for(k=1;k=0;--i) + //temp=p_add(p_convert(v[i]),p_mul(temp,p_convert(m[i]))); + temp=p_mulcaddc(temp,m[i],v[i]); + //v[k]=p_mul(p_sub(p_convert(u[k]),temp),p_inv(product)); + v[k]=p_convsubdiv(u[k],temp,product); + } + // step 3: operations are done in Zm, not in Z + CGALRS_mpz_set_spn(r,p_pntospn(v[n-1])); + for(k=n-2;k>=0;--k){ + CGALRS_mpz_mul_pn(r,r,m[k]); + CGALRS_mpz_add_pn(r,r,v[k]); + } + return; + }; + + // polynomial chinese remainder algorithm, it is the same: + // m are the modules, and m has size size_y, p is the residue + // vector and also has size size_y, but every one of its elements + // has size size_x (which will be de degree of the output + // polynomial); + // size_y is what is called n in the book + static + void pcra(mpz_t *r, + CGALRS_PN *m, + std::vector p, + int size_x, + int size_y){ + typedef boost::multi_array pn_matrix; + typedef pn_matrix::index pn_matrix_index; + pn_matrix v(boost::extents[size_x+1][size_y]); + pn_matrix_index i,j,k; + CGALRS_PN product,temp; + + for(j=0;j<=size_x;++j){ + v[j][0]=p[0][j]; + for(k=1;k=0;--i) + temp=p_mulcaddc(temp,m[i],v[j][i]); + v[j][k]=p_convsubdiv(p[k][j],temp,product); + } + } + // step 3 + // be careful: operations are done in Zm, not in Z + for(j=0;j<=size_x;++j){ + CGALRS_mpz_set_spn(r[j],p_pntospn(v[j][size_y-1])); + for(k=size_y-2;k>=0;--k){ + CGALRS_mpz_mul_pn(r[j],r[j],m[k]); + CGALRS_mpz_add_pn(r[j],r[j],v[j][k]); + } + } + }; + +}; // class Crt + +} // namespace RS_MGCD +} // namespace CGAL + +#endif // CGAL_RS__CRT_H diff --git a/Algebraic_kernel_d/include/CGAL/RS/ugcd/inverse.h b/Algebraic_kernel_d/include/CGAL/RS/ugcd/inverse.h new file mode 100644 index 00000000000..76dcb3eae68 --- /dev/null +++ b/Algebraic_kernel_d/include/CGAL/RS/ugcd/inverse.h @@ -0,0 +1,75 @@ +// Copyright (c) 2007-2008 Inria Lorraine (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: Luis Peñaranda + +#ifndef CGAL_RS__INVERSE_H +#define CGAL_RS__INVERSE_H + +#ifdef _MSC_VER +# define CGALRS_S64 __int64 +# define CGALRS_U64 unsigned __int64 +# define CGALRS_U32 unsigned __int32 +#else +# include +# define CGALRS_S64 int64_t +# define CGALRS_U64 uint64_t +# define CGALRS_U32 uint32_t +#endif + +namespace CGAL{ +namespace RS_MGCD{ + +#define CGALRS_N(A) (A<0?-A:A) +//#define CGALRS_U(A) (A<0?-1:1) +#define CGALRS_U(A,C) (A<0?(C<0?1:-1):(C<0?-1:1)) + +class Inverse{ + + protected: + // given a and b, returns s such that gcd(a,b)=s*a+t*b (GCL, page 36) + // s*a+t*q=1 => s is the inverse of a, mod q (pafe 173) + static CGALRS_S64 eea_s(CGALRS_U32 a,CGALRS_U32 b){ + CGALRS_S64 c1,d1,r1;//,c2,d2,r2,t,s; + CGALRS_U32 r,c,d;//,q; + // a and b are positive, so a=CGALRS_N(a) and b=CGALRS_N(b) + //c=CGALRS_N(a); d=CGALRS_N(b); + c=a; d=b; + c1=1; d1=0; + //c2=0; d2=1; + while(d){ + //q=c/d; + r=c%d; + r1=c1-d1*(c/d); //r2=c2-d2*q; + c=d; c1=d1; //c2=d2; + d=r; d1=r1; //d2=r2; + } + // gcd(a,b) is CGALRS_N(c) + //t=c2/(CGALRS_U(b)*CGALRS_U(c)); + // a and c are always positive, so s=c1/CGALRS_U(a,c) equals c1 + //s=c1/CGALRS_U(a,c); + //return s; + return c1; + }; +}; // class Inverse + +#undef CGALRS_N +#undef CGALRS_U + +} // namespace RS_MGCD +} // namespace CGAL + +#endif // CGAL_RS__INVERSE_H diff --git a/Algebraic_kernel_d/include/CGAL/RS/ugcd/p.h b/Algebraic_kernel_d/include/CGAL/RS/ugcd/p.h new file mode 100644 index 00000000000..0f6e878d369 --- /dev/null +++ b/Algebraic_kernel_d/include/CGAL/RS/ugcd/p.h @@ -0,0 +1,148 @@ +// Copyright (c) 2007-2008 Inria Lorraine (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: Luis Peñaranda + +#ifndef CGAL_RS__P_H +#define CGAL_RS__P_H + +#include +#include "inverse.h" + +namespace CGAL{ +namespace RS_MGCD{ + +// CGALRS_PN size is 32 bits, the sizes of CGALRS_LPN and CGALRS_SPN must be, +// at least, as twice as the size of CGALRS_PN +#define CGALRS_PN_BITS 32 +#define CGALRS_PN CGALRS_U32 // unsigned +#define CGALRS_LPN CGALRS_U64 // unsigned long long +#define CGALRS_SPN CGALRS_S64 // long long + +#define CGALRS_mpz_set_pn(A,PN) mpz_set_ui(A,(unsigned long)(PN)) +#define CGALRS_mpz_mul_pn(A,B,PN) mpz_mul_ui(A,B,(unsigned long)(PN)) +#define CGALRS_mpz_add_pn(A,B,PN) mpz_add_ui(A,B,(unsigned long)(PN)) +#define CGALRS_mpz_sub_pn(A,B,PN) mpz_sub_ui(A,B,(unsigned long)(PN)) +#define CGALRS_mpz_set_spn(A,SPN) mpz_set_si(A,(long)(SPN)) +#define CGALRS_mpz_add_spn(A,B,SPN) \ + (SPN<0?CGALRS_mpz_sub_pn(A,B,-(SPN)):CGALRS_mpz_add_pn(A,B,(SPN))) +#define CGALRS_mpz_mul_spn(A,B,SPN) mpz_mul_si(A,B,SPN) + +CGALRS_THREAD_ATTR CGALRS_PN prime; class Prime:public Inverse{ + protected: + static CGALRS_SPN p_pntospn(CGALRS_PN p){ + if(p>(prime-1)/2) + return (CGALRS_SPN)p-prime; + return (CGALRS_SPN)p; + }; + + static void p_set_prime(CGALRS_PN p){prime=p;}; + + static CGALRS_PN p_prime(){return prime;}; + + static CGALRS_PN p_add(CGALRS_PN a,CGALRS_PN b){ + CGALRS_LPN c=(CGALRS_LPN)a+b; + return (c>=1; + b=a; + while(i>>=1) + b=(i&n?p_mul3(b,b,a):p_mul(b,b)); + return b; + }; + + #define CGALRS_P_DIV(A,B) (p_mul(A,p_inv(B))) + + static CGALRS_PN p_gcd(CGALRS_PN a,CGALRS_PN b){ + if(!b) + return a; + return p_gcd(b,a%b); + }; + +}; // class Prime + +} // namespace RS_MGCD +} // namespace CGAL + +#endif // CGAL_RS__P_H diff --git a/Algebraic_kernel_d/include/CGAL/RS/ugcd/pagealloc.h b/Algebraic_kernel_d/include/CGAL/RS/ugcd/pagealloc.h new file mode 100644 index 00000000000..1e395f4b313 --- /dev/null +++ b/Algebraic_kernel_d/include/CGAL/RS/ugcd/pagealloc.h @@ -0,0 +1,169 @@ +// Copyright (c) 2007 Inria Lorraine (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: Luis Peñaranda + +#ifndef CGAL_RS__PAGEALLOC_H +#define CGAL_RS__PAGEALLOC_H + +#include +#include + +namespace CGAL{ +namespace RS_MGCD{ + +#define CGALRS_PAGESIZE 4194304 +#define CGALRS_TABLESIZE 2048 +#define CGALRS_PAGES 8 +#define CGALRS_VOIDSCAST unsigned long + +struct pinfo{ + void *start; + size_t size; +}; + +CGALRS_THREAD_ATTR void** pages_startptr; +CGALRS_THREAD_ATTR size_t pages_max;//=CGALRS_PAGES; +CGALRS_THREAD_ATTR size_t pages_allocated; +CGALRS_THREAD_ATTR size_t pages_current; + +CGALRS_THREAD_ATTR size_t page_remainingbytes; +CGALRS_THREAD_ATTR void* page_currentptr; + +CGALRS_THREAD_ATTR struct pinfo *nodes_allocated; +CGALRS_THREAD_ATTR size_t nodes_total; +CGALRS_THREAD_ATTR size_t nodes_assigned; + +class Page_alloc{ + + protected: + static + void* meminit(){ + pages_startptr=(void**)malloc(CGALRS_PAGES*sizeof(void*)); + pages_startptr[0]=malloc(CGALRS_PAGESIZE); + pages_allocated=1; + pages_current=0; + page_remainingbytes=CGALRS_PAGESIZE; + page_currentptr=pages_startptr[0]; + nodes_total=CGALRS_TABLESIZE; + nodes_allocated= + (struct pinfo*)malloc(CGALRS_TABLESIZE*sizeof(struct pinfo)); + nodes_assigned=0; + return page_currentptr; + }; + + static + void* newpage(){ + void *r; + if(pages_allocated>pages_current+1){ + ++pages_current; + r=pages_startptr[pages_current]; + page_currentptr=r; + page_remainingbytes=CGALRS_PAGESIZE; + return r; + } + // iso c++ forbids to initialize a static member (pages_max), + // so we have to start using pages_max when the amount of + // allocated pages reaches the value CGALRS_PAGES (this is not of + // course the cleanest way to do it) + if(pages_allocated==CGALRS_PAGES) + pages_max=2*CGALRS_PAGES; + else + pages_max=0; + if(pages_allocated==pages_max){ + pages_max*=2; + pages_startptr= + (void**)realloc(pages_startptr,pages_max*sizeof(void*)); + } + r=malloc(CGALRS_PAGESIZE); + pages_startptr[pages_allocated]=r; + page_currentptr=r; + ++pages_allocated; + page_remainingbytes=CGALRS_PAGESIZE; + return r; + }; + + // if they ask us to allocate a memory size bigger than the page, + // we are lost (we could in that case make a bigger page) + static + void* palloc(size_t size){ + void* r; + if(size>page_remainingbytes){ + newpage(); + return palloc(size); + } + if(nodes_assigned==nodes_total){ + nodes_total*=2; + nodes_allocated=(struct pinfo*)realloc + (nodes_allocated,nodes_total*sizeof(struct pinfo)); + } + page_remainingbytes-=size; + r=page_currentptr; + page_currentptr=(void*)((CGALRS_VOIDSCAST)page_currentptr+size); + // c++ does not support nodes_allocated[nodes_assigned]={r,s} + nodes_allocated[nodes_assigned].start=r; + nodes_allocated[nodes_assigned].size=size; + ++nodes_assigned; + return r; + }; + + static + void* prealloc(void *ptr,size_t size){ + void *dest; + size_t i=0; + while(nodes_allocated[i].start!=ptr) + ++i; + if(nodes_allocated[i].size + +#ifndef CGAL_RS__PP_H +#define CGAL_RS__PP_H + +#include +#include "p.h" +#include "pagealloc.h" +#include + +namespace CGAL{ +namespace RS_MGCD{ + +class Prime_polynomial:public Prime,public Page_alloc{ + protected: + static + int pp_from_poly(CGALRS_PN *pp,mpz_t *poly,int n){ + int i; + if(!(pp[n]=mpz_fdiv_ui(poly[n],p_prime()))) + return -1; + for(i=0;i=n + static + int pp_pdivrem(CGALRS_PN *r,CGALRS_PN *u,int m,CGALRS_PN *v,int n){ + int k,j; + for(k=0;k<=m;++k) + r[k]=u[k]; + // division p. 402 + //for(k=m-n;k>=0;--k) + // for(j=n+k-1;j>=k;--j) + // r[j]=p_sub(r[j],p_mul(qk,v[j-k])); + // pseudo-division, p. 407 + for(k=m-n;k>=0;--k) + for(j=n+k-1;j>=0;--j) + //r[j]=p_sub( + // p_mul(v[n],r[j]), + // p_mul(r[n+k],(j=db + static + int pp_gcd(CGALRS_PN *g,CGALRS_PN *a,int da,CGALRS_PN *b,int db){ + CGALRS_PN *r0,*r1,*r2; + int i,d0,d1,d2; + d0=da; + r0=(CGALRS_PN*)palloc((1+da)*sizeof(CGALRS_PN)); + //for(i=0;i<=da;++i) + // r0[i]=a[i]; + pp_pp(r0,a,da); + d1=db; + r1=(CGALRS_PN*)palloc((1+da)*sizeof(CGALRS_PN)); + //for(i=0;i<=db;++i) + // r1[i]=b[i]; + pp_pp(r1,b,db); + r2=(CGALRS_PN*)palloc((1+da)*sizeof(CGALRS_PN)); + d2=pp_pdivrem(r2,r0,d0,r1,d1); + while(d2){ + for(i=0;i<=d1;++i) + r0[i]=r1[i]; + d0=d1; + //for(i=0;i<=d2;++i) + // r1[i]=r2[i]; + pp_pp(r1,r2,d2); + d1=d2; + d2=pp_pdivrem(r2,r0,d0,r1,d1); + } + if(!r2[0]){ + //CGALRS_PN inv=p_inv(r1[d1]); + //g[d1]=1; + //for(i=0;i + +#ifndef CGAL_RS__PRIMES_H +#define CGAL_RS__PRIMES_H + +#include "crt.h" + +// I borrowed these numbers from Fabrice, this leaves us around 250000 primes +#define CGALRS_PR_MIN 2145338339 +#define CGALRS_PR_MAX 2147483647 + +//#define CGALRS_PR_IS_PRIME(N) (pr_fermat(N)?pr_is_prime_bruteforce(N):0) +#define CGALRS_PR_IS_PRIME(N) pr_mrj(N) + +#ifdef _MSC_VER +# define CGAL_RS_RANDOM rand +#else +# define CGAL_RS_RANDOM random +#endif + +namespace CGAL{ +namespace RS_MGCD{ + +CGALRS_THREAD_ATTR CGALRS_PN currentprime; + +class Primes:public Crt{ + private: + static int pr_is_prime_bruteforce(CGALRS_PN n){ + int i,sqrtn; + sqrtn=(CGALRS_PN)(sqrt((double)n)); + for(i=3;i<=sqrtn;++i) + if(!(n%i)) + return 0; + return 1; + } + + // vzGG, p. 507; returns 0 if n is composite + static int pr_fermat(CGALRS_PN n){ + p_set_prime(n); + return(p_pow(2+((CGALRS_PN)CGAL_RS_RANDOM())%(n-4),n-1)==1); + } + + // Solovay-Strassen + static int pr_ss(CGALRS_PN n){ + CGALRS_PN a,x; + p_set_prime(n); + a=1+(CGALRS_PN)CGAL_RS_RANDOM()%(n-2); + x=CGALRS_P_DIV(a,n); + return(!x||p_pow(a,n>>1)!=x); + } + + // Miller-Rabin + static int pr_mr(CGALRS_PN n){ + CGALRS_PN s,d,a,x,r; + s=1; + d=(n-1)>>1; + while(!(d&1)){ + ++s; + d=d>>1; + } + p_set_prime(n); + a=2+(CGALRS_PN)CGAL_RS_RANDOM()%(n-4); + x=p_pow(a,d); + if(x==1||x==n-1) + return 1; // pobably prime + for(r=1;r>1; + while(!(d&1)){ + ++s; + d=d>>1; + } + p_set_prime(n); + index=-1; + start_test: + ++index; + //if(index=3) + if(index==3) + return 1; // prime + if(p_pow(a[index],d)==1) + goto start_test; + for(r=0;r + +#ifndef CGAL_RS__UGCD_H +#define CGAL_RS__UGCD_H + +#include +#include "primes.h" + +// let's assume that 300 is enough for degree 500 gcds +#define CGALRS_MOD_QTY 300 + +namespace CGAL{ +namespace RS_MGCD{ + +class Ugcd:public Primes{ + public: + static int ugcd (mpz_t *gcd,mpz_t *Anp,int degA,mpz_t *Bnp,int degB){ + mpz_t *A,*B; + mpz_t lcgcd,cA,cB; + mpz_ptr m,bound; + // dG is initialized to zero only to avoid compiler complaints + int dA,dB,dG=0,maxd,i,maxA,maxB; + size_t modsize,modalloc; + std::vector p; + CGALRS_PN *mA,*mB,*mG,*mod; + CGALRS_PN lc=0,scaleG; + + if(degB>degA){ + if(!degA){ + mpz_set_ui(gcd[0],1); + return 0; + }else + return ugcd(gcd,Bnp,degB,Anp,degA); + } + if(!degB){ + mpz_set_ui(gcd[0],1); + return 0; + } + + // initialize the memory + meminit(); + + A=(mpz_t*)malloc((1+degA)*sizeof(mpz_t)); + B=(mpz_t*)malloc((1+degB)*sizeof(mpz_t)); + mpz_init_set(cA,Anp[degA]); + for(i=0;i0) + maxA=i; + maxB=degB; + for(i=0;i0) + maxB=i; + mpz_pow_ui(cA,A[maxA],2); + mpz_mul_ui(cA,cA,degA+1); + mpz_mul_2exp(cA,cA,2*degA); + mpz_sqrt(cA,cA); + mpz_pow_ui(cB,B[maxB],2); + mpz_mul_ui(cB,cB,degB+1); + mpz_mul_2exp(cB,cB,2*degB); + mpz_sqrt(cB,cB); + if(mpz_cmp(cA,cB)<0){ + bound=(mpz_ptr)cA; + m=(mpz_ptr)cB; + }else{ + bound=(mpz_ptr)cB; + m=(mpz_ptr)cA; + } + mpz_mul(bound,bound,lcgcd); + mpz_mul_2exp(bound,bound,1); + mpz_setbit(bound,0); + + mA=(CGALRS_PN*)palloc((1+degA)*sizeof(CGALRS_PN)); + mB=(CGALRS_PN*)palloc((1+degB)*sizeof(CGALRS_PN)); + maxd=degA; // we know that degA>=degB + mG=(CGALRS_PN*)palloc((1+maxd)*sizeof(CGALRS_PN)); + pr_init(); + mpz_set_ui(m,1); + mod=(CGALRS_PN*)palloc(CGALRS_MOD_QTY*sizeof(CGALRS_PN)); + modalloc=CGALRS_MOD_QTY; + modsize=0; + + while(mpz_cmp(m,bound)<=0){ + do{ + p_set_prime(pr_next()); + dA=pp_from_poly(mA,A,degA); + if(dA!=-1){ + dB=pp_from_poly(mB,B,degB); + if(dB!=-1) + lc=mpz_fdiv_ui(lcgcd,p_prime()); + // lc is the image of the principal coefficient + } + }while(dA==-1||dB==-1||!lc + ||mpz_divisible_ui_p(A[degA],p_prime()) + ||mpz_divisible_ui_p(B[degB],p_prime())); + // now we calculate the gcd mod p_prime + dG=pp_gcd(mG,mA,degA,mB,degB); + scaleG=CGALRS_P_DIV(lc,mG[dG]); + mG[dG]=lc; + for(i=0;i > ROOTS; ROOTS roots; Polynomial_1 p1 = (x-1)*(x-2)*(x-2); - std::back_insert_iterator biit = + // std::back_insert_iterator biit = solve_1(p1,std::back_inserter(roots)); Algebraic_real_1 ar = roots[1].first; Polynomial_1 p2 = compute_polynomial_1(ar); @@ -355,25 +355,21 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ ss>>CGAL::iformat(alg2); \ assert(alg1==alg2) - - const typename Algebraic_kernel_d_1::Construct_algebraic_real_1 construct_algreal_1 = - ak_1.construct_algebraic_real_1_object(); - Algebraic_real_1 alg1,alg2; std::stringstream ss; CGAL::set_ascii_mode(ss); // test construction from int, Coefficient and Bound - CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(int(2))); - CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(Coefficient(2))); - CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(Bound(2))); + CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(int(2))); + CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(Coefficient(2))); + CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(Bound(2))); // construction by index Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); // the monom x - CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(x*x-2,1)); + CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(x*x-2,1)); // construction by isolating interval - CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algreal_1(x*x-2,Bound(0),Bound(2))); + CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(x*x-2,Bound(0),Bound(2))); #undef CGAL_TEST_ALGEBRAIC_REAL_IO } } diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index 5a25c4ac152..e6cd230d74d 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -14,14 +14,16 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) endif() -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL QUIET COMPONENTS Core GMP MPFR MPFI) if ( CGAL_FOUND ) include( ${CGAL_USE_FILE} ) include( CGAL_VersionUtils ) - find_package( MPFI ) - IS_VERSION_LESS("${CGAL_GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) + + get_dependency_version( GMP ) + + IS_VERSION_LESS("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) include_directories(../../include) include_directories(include) diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_ack.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_ack.tex index fe7306d6b85..58847358abd 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_ack.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2/arr_ack.tex @@ -34,3 +34,11 @@ Version~3.9 introduced a new geometry-traits class that handles rational arcs. It was developed by Oren Salzman and Michael Hemmer. It replaced an old traits, which handled the same family of curves, developed by Ron Wein. + +Version~4.1 introduces a revised implementation of the point location class +via a randomized incremental construction of the trapezoidal map. +The old class was implemented by Oren Nechushtan, while the revamp +was done by Michal Kleinbort and Michael Hemmer. The new class adds support +for unbounded curves and can now guarantee logarithmic query time in all +cases. + 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 be4fc18d154..d42b57654bf 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 @@ -126,13 +126,14 @@ choosing points on a grid, are also available; see the Reference Manual for more details. % \item \ccc{Arr_trapezoid_ric_point_location} implements -Mulmuley's point-location algorithm~\cite{m-fppa-90} (see +a point location algorithm presented by Seidel~\cite{s-sfira-91}, which uses the +randomized incremental construction described by Mulmuley~\cite{m-fppa-90} (see also~\cite[Chapter~6]{bkos-cgaa-00}). The arrangement faces are decomposed into simpler cells of constant complexity known as {\em pseudo-trapezoids} and a search-structure (a directed acyclic graph) is constructed on top of these cells, allowing to locate the pseudo-trapezoid (hence the arrangement -cell) containing a query point in expected logarithmic time. +cell) containing a query point in logarithmic time. \end{itemize} The main advantage of the first two strategies is that they do not @@ -152,19 +153,35 @@ On the other hand, the landmarks and the trapezoid RIC strategies require auxiliary data structures on top of the arrangement, which they need to construct once they are attached to an arrangement object and need to keep up-to-date as this arrangement changes. -The data structures needed by both strategies can be constructed +The data structure needed by the landmarks strategy can be constructed in $O(N \log N)$ time (where $N$ is the overall number of edges in -the arrangement), -but the construction needed by the landmark algorithm is in -practice significantly faster. In addition, although both +the arrangement), whereas the construction of the data structure needed +by the trapezoid RIC strategy takes expected $O(N \log N)$, but +may require several rebuilds. As shown in~\cite{hkh-iiplgtds-12}, one can +expect only a small number of rebuilds. +In practice, the construction needed by the landmark algorithm is +significantly faster. +In addition, although both resulting data structures are asymptotically linear in size, the \kdtree\ that the landmark algorithm stores needs significantly -less memory. We note that Mulmuley's algorithm guarantees a -logarithmic query time, while the query time for the landmark -strategy is only logarithmic on average --- and we may have -scenarios where the query time can be linear. In practice however, +less memory. + +We note that the trapezoid RIC algorithm guarantees a +logarithmic query time for any scenario +making it advantageous comparing to other strategies. +The query time of the landmarks strategy, on the other hand, + is only logarithmic on average --- and we may have +scenarios where the query time can be linear. +In practice, in many scenarios the query times of both strategies are competitive. For a detailed -experimental comparison, see \cite{cgal:hh-eplca-05} +experimental comparison, see \cite{hh-esplp-08}. + +Another advantageous feature of the trapezoid RIC strategy +when compared with other methods +is the unbounded curves support. +Currently, this is the most efficient strategy +suitable for general unbounded subdivisions. + The main drawback in the current implementation of the landmark strategy, compared to the trapezoidal RIC strategy, is that while @@ -181,12 +198,14 @@ support these extra operations. It is therefore recommended to use the \ccc{Arr_landmarks_point_location} class when the application -frequently issues point-location queries on an -arrangement that only seldom changes. If the arrangement is more +frequently issues point-location queries on a bounded +arrangement that only seldom changes. If the arrangement +consists of unbounded curves or is more dynamic and is frequently going through changes, the \ccc{Arr_trapezoid_ric_point_location} class should be the selected point-location strategy. + \subsubsection{An Example\label{arr_sssec:pl_ex}} %~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -270,7 +289,7 @@ void vertical_ray_shooting_query typename Arrangement_on_surface_2::Halfedge_const_handle e; typename Arrangement_on_surface_2::Face_const_handle f; - std::cout << "Shooting up from " << q << " : "; + std::cout << "Shooting up from " << q << " : "; if (CGAL::assign (e, obj)) \{ // We hit an edge: std::cout << "hit an edge: " << e->curve() << std::endl; @@ -285,8 +304,8 @@ void vertical_ray_shooting_query else if (CGAL::assign (f, obj)) \{ // We did not hit anything: CGAL_assertion (f->is_unbounded()); - - std::cout << "hit nothing." << std::endl; + + std::cout << "hit nothing." << std::endl; \} else \{ CGAL_assertion_msg (false, "Invalid object."); diff --git a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_trapezoid_ric_point_location.tex b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_trapezoid_ric_point_location.tex index 202e78f0167..193a795b7ea 100644 --- a/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_trapezoid_ric_point_location.tex +++ b/Arrangement_on_surface_2/doc_tex/Arrangement_on_surface_2_ref/Arr_trapezoid_ric_point_location.tex @@ -18,11 +18,12 @@ The \ccRefName\ class implements the incremental randomized algorithm introduced by Mulmuley~\cite{m-fppa-90} as presented by Seidel~\cite{s-sfira-91} (see also~\cite[Chapter~6]{bkos-cgaa-00}). It subdivides each arrangement face to pseudo-trapezoidal cells, each -of constant complexity, and constructs and maintains a search +of constant complexity, and constructs and maintains a linear-size search structure on top of these cells, such that each query can be answered in $O(\log n)$ time, where $n$ is the complexity of the arrangement. -Constructing the search structures takes $O(n \log n)$ time, such that +Constructing the search structures takes $O(n \log n)$ expected time +and may require a small number of rebuilds~\cite{hkh-iiplgtds-12}. Therefore attaching a trapezoidal point-location object to an existing arrangement may incur some overhead in running times. In addition, the point-location object needs to keep its auxiliary data structures up-to-date as the @@ -31,12 +32,30 @@ to use this point-location strategy for static arrangements (or arrangement that do not alter frequently), and when the number of issued queries is relatively large. +This strategy supports arbitrary subdivisions, including unbounded ones. + \ccInclude{CGAL/Arr_trapezoid_ric_point_location.h} \ccIsModel \ccc{ArrangementPointLocation_2} \\ \ccc{ArrangementVerticalRayShoot_2} +\ccCreation +\ccCreationVariable{pl} +%--------------------- + +\ccConstructor{Arr_trapezoid_ric_point_location (bool with_guarantees = true);} +{If with\_guarantees is set to true, the cunstruction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time.} +\ccConstructor{Arr_trapezoid_ric_point_location (const Arrangement& arr, bool with_guarantees = true);} +{Constructs a point location search structure for the given arrangement. If with\_guarantees is set to true, the cunstruction performs rebuilds in order to guarantee a resulting structure with linear size and logarithmic query time. Otherwise the structure has expected linear size and expected logarithmic query time.} + +\ccModifiers +%=========== + +\ccMethod{void with_guarantees (bool with_guarantees);} + {If with\_guarantees is set to true, the structure will guarantee linear size and logarithmic query time, that is, this function may cause a reconstruction of the data structure. } + + \end{ccRefClass} \ccRefPageEnd diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h new file mode 100644 index 00000000000..d38181e0f33 --- /dev/null +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h @@ -0,0 +1,20 @@ +#ifndef ARR_INEXACT_CONSTRUCTION_SEGMENTS_H +#define ARR_INEXACT_CONSTRUCTION_SEGMENTS_H + +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::FT Number_type; + +typedef CGAL::Arr_non_caching_segment_traits_2 Traits; +typedef Traits::Point_2 Point; +typedef Traits::X_monotone_curve_2 Segment; + +typedef CGAL::Arrangement_2 Arrangement; +typedef Arrangement::Vertex_handle Vertex_handle; +typedef Arrangement::Halfedge_handle Halfedge_handle; +typedef Arrangement::Face_handle Face_handle; + +#endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp index dc509be0760..9568b33952f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/isolated_vertices.cpp @@ -1,62 +1,39 @@ //! \file examples/Arrangement_on_surface_2/isolated_vertices.cpp // Constructing an arrangement with isolated vertices. -#include -#include -#include - +#include "arr_inexact_construction_segments.h" #include "arr_print.h" -typedef int Number_type; -typedef CGAL::Simple_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::Arrangement_2 Arrangement_2; -typedef Arrangement_2::Vertex_handle Vertex_handle; -typedef Arrangement_2::Halfedge_handle Halfedge_handle; -typedef Arrangement_2::Face_handle Face_handle; - -int main () +int main() { - Arrangement_2 arr; + // Insert isolated points. + Arrangement arr; + Face_handle uf = arr.unbounded_face(); + arr.insert_in_face_interior(Point(3, 3), uf); + arr.insert_in_face_interior(Point(1, 5), uf); + arr.insert_in_face_interior(Point(5, 5), uf); - // Insert some isolated points: - Face_handle uf = arr.unbounded_face(); - Vertex_handle u1 = arr.insert_in_face_interior (Point_2 (3, 3), uf); - Vertex_handle u2 = arr.insert_in_face_interior (Point_2 (1, 5), uf); - Vertex_handle u3 = arr.insert_in_face_interior (Point_2 (5, 5), uf); + // Insert four segments that form a square-shaped face. + Point p1(1, 3), p2(3, 5), p3(5, 3), p4(3, 1); + Segment s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p1); - // Insert four segments that form a rectangular face: - Segment_2 s1 (Point_2 (1, 3), Point_2 (3, 5)); - Segment_2 s2 (Point_2 (3, 5), Point_2 (5, 3)); - Segment_2 s3 (Point_2 (5, 3), Point_2 (3, 1)); - Segment_2 s4 (Point_2 (3, 1), Point_2 (1, 3)); - - Halfedge_handle e1 = arr.insert_in_face_interior (s1, uf); + Halfedge_handle e1 = arr.insert_in_face_interior(s1, uf); Vertex_handle v1 = e1->source(); Vertex_handle v2 = e1->target(); - Halfedge_handle e2 = arr.insert_from_left_vertex (s2, v2); + Halfedge_handle e2 = arr.insert_from_left_vertex(s2, v2); Vertex_handle v3 = e2->target(); - Halfedge_handle e3 = arr.insert_from_right_vertex (s3, v3); + Halfedge_handle e3 = arr.insert_from_right_vertex(s3, v3); Vertex_handle v4 = e3->target(); - Halfedge_handle e4 = arr.insert_at_vertices (s4, v4, v1); + arr.insert_at_vertices(s4, v4, v1); // Remove the isolated vertices located in the unbounded face. - Arrangement_2::Vertex_iterator curr_v, next_v; - - for (curr_v = arr.vertices_begin(); - curr_v != arr.vertices_end(); curr_v = next_v) - { - // Store an iterator to the next vertex (as we may delete curr_v and - // invalidate the iterator). - next_v = curr_v; - ++next_v; - - if (curr_v->is_isolated() && curr_v->face() == uf) - arr.remove_isolated_vertex (curr_v); + Arrangement::Vertex_iterator curr, next = arr.vertices_begin(); + for (curr = next++; curr != arr.vertices_end(); curr = next++) { + // Keep an iterator to the next vertex, as curr might be deleted. + if (curr->is_isolated() && curr->face() == uf) + arr.remove_isolated_vertex(curr); } - print_arrangement (arr); + print_arrangement(arr); return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp index 21bba0feeb6..18dc7e4c201 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/special_edge_insertion.cpp @@ -1,46 +1,26 @@ //! \file examples/Arrangement_on_surface_2/special_edge_insertion.cpp // Constructing an arrangement using the specialized edge-insertion functions. -#include -#include -#include - +#include "arr_inexact_construction_segments.h" #include "arr_print.h" -typedef int Number_type; -typedef CGAL::Simple_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::Arrangement_2 Arrangement_2; -typedef Arrangement_2::Vertex_handle Vertex_handle; -typedef Arrangement_2::Halfedge_handle Halfedge_handle; - -int main () +int main() { - Arrangement_2 arr; + Point p0(3, 3), p1(1, 3), p2(3, 5), p3(5, 3), p4(3, 1); + Segment s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p1); + Segment s5(p1, p0), s6(p0, p3), s7(p4, p0), s8(p0, p2); - Point_2 p0 (3, 3); - Point_2 p1 (1, 3), p2 (3, 5), p3 (5, 3), p4 (3, 1); - Segment_2 s1 (p1, p2); - Segment_2 s2 (p2, p3); - Segment_2 s3 (p3, p4); - Segment_2 s4 (p4, p1); - Segment_2 s5 (p1, p0); - Segment_2 s6 (p0, p3); - Segment_2 s7 (p4, p0); - Segment_2 s8 (p0, p2); + Arrangement arr; + Vertex_handle v0 = arr.insert_in_face_interior(p0, arr.unbounded_face()); + Halfedge_handle e1 = arr.insert_in_face_interior(s1, arr.unbounded_face()); + Halfedge_handle e2 = arr.insert_from_left_vertex(s2, e1); + Halfedge_handle e3 = arr.insert_from_right_vertex(s3, e2); + Halfedge_handle e4 = arr.insert_at_vertices(s4, e3, e1->twin()); + Halfedge_handle e5 = arr.insert_at_vertices(s5, e1->twin(), v0); + Halfedge_handle e6 = arr.insert_at_vertices(s6, e5, e3->twin()); + arr.insert_at_vertices(s7, e4->twin(), e6->twin()); + arr.insert_at_vertices(s8, e5, e2->twin()); - Vertex_handle v0 = arr.insert_in_face_interior (p0, arr.unbounded_face()); - Halfedge_handle e1 = arr.insert_in_face_interior (s1, arr.unbounded_face()); - Halfedge_handle e2 = arr.insert_from_left_vertex (s2, e1); - Halfedge_handle e3 = arr.insert_from_right_vertex (s3, e2); - Halfedge_handle e4 = arr.insert_at_vertices (s4, e3, e1->twin()); - Halfedge_handle e5 = arr.insert_at_vertices (s5, e1->twin(), v0); - Halfedge_handle e6 = arr.insert_at_vertices (s6, e5, e3->twin()); - Halfedge_handle e7 = arr.insert_at_vertices (s7, e4->twin(), e6->twin()); - Halfedge_handle e8 = arr.insert_at_vertices (s8, e5, e2->twin()); - - print_arrangement (arr); + print_arrangement(arr); return 0; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index 6cd6fff05b1..750155471c6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -65,7 +65,7 @@ public: // Copy constructor - Arr_algebraic_segment_traits_2 (const Self& s) { /* No state...*/} + Arr_algebraic_segment_traits_2 (const Self& /* s */) { /* No state...*/} // Assignement operator const Self& operator= (const Self& s) @@ -312,21 +312,29 @@ public: segs.push_back(it_seg.trim(start.get(),end.get())); } if(left_on_arc && (!right_on_arc)) { - if(!it_seg.is_finite(CGAL::ARR_MAX_END) || - !equal(start.get(),right(it_seg))) { - X_monotone_curve_2 split1,split2; - it_seg.split(start.get(),split1,split2); - segs.push_back(split2); + if(!it_seg.is_finite(CGAL::ARR_MAX_END) || + !equal(start.get(),right(it_seg))) { + if(it_seg.is_finite(CGAL::ARR_MIN_END) && equal(start.get(),left(it_seg))) { + segs.push_back(it_seg); + } else { + X_monotone_curve_2 split1,split2; + it_seg.split(start.get(),split1,split2); + segs.push_back(split2); + } } } if((!left_on_arc) && right_on_arc) { if(!it_seg.is_finite(CGAL::ARR_MIN_END) || ! equal(left(it_seg),end.get())) { - X_monotone_curve_2 split1,split2; - it_seg.split(end.get(),split1,split2); - segs.push_back(split1); + if(it_seg.is_finite(CGAL::ARR_MAX_END) && equal(end.get(),right(it_seg))) { + segs.push_back(it_seg); + } else { + X_monotone_curve_2 split1,split2; + it_seg.split(end.get(),split1,split2); + segs.push_back(split1); + } } - } + } if( (!left_on_arc) && (!right_on_arc)) { segs.push_back(it_seg); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h index 88fbd6a6414..c5c76501e70 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_batched_point_location.h @@ -42,12 +42,12 @@ namespace CGAL { * and the value-type of OutputIterator is pair, where * the Object represents the arrangement feature containing the points. */ -template -OutputIterator locate - (const Arrangement_on_surface_2& arr, - PointsIterator points_begin, PointsIterator points_end, - OutputIterator oi) +template +OutputIterator +locate(const Arrangement_on_surface_2& arr, + PointsIterator points_begin, PointsIterator points_end, + OutputIterator oi) { // Arrangement types: typedef Arrangement_on_surface_2 Arr; @@ -68,41 +68,31 @@ OutputIterator locate // Go over all arrangement edges and collect their associated x-monotone // curves. To each curve we attach a halfedge handle going from right to // left. - std::vector xcurves_vec (arr.number_of_edges()); + std::vector xcurves_vec(arr.number_of_edges()); Edge_const_iterator eit; - Halfedge_const_handle he; unsigned int i = 0; - - for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit, ++i) - { + for (eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) { // Associate each x-monotone curve with the halfedge that represent it // that is directed from right to left. - if (eit->direction() == ARR_RIGHT_TO_LEFT) - he = eit; - else - he = eit->twin(); - - xcurves_vec[i] = Bpl_x_monotone_curve_2 (eit->curve(), he); + Halfedge_const_handle he = + (eit->direction() == ARR_RIGHT_TO_LEFT) ? eit : eit->twin(); + xcurves_vec[i++] = Bpl_x_monotone_curve_2(eit->curve(), he); } // Go over all isolated vertices and collect their points. To each point // we attach its vertex handle. - std::vector iso_pts_vec (arr.number_of_isolated_vertices()); + std::vector iso_pts_vec(arr.number_of_isolated_vertices()); Vertex_const_iterator vit; - Vertex_const_handle iso_v; - i = 0; - for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit, ++i) - { - if (vit->is_isolated()) - { - iso_v = vit; - iso_pts_vec[i] = Bpl_point_2 (vit->point(), iso_v); + for (vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) { + if (vit->is_isolated()) { + Vertex_const_handle iso_v = vit; + iso_pts_vec[i++] = Bpl_point_2(vit->point(), iso_v); } } // Obtain a extended traits-class object. - GeomTraits *geom_traits = const_cast (arr.geometry_traits()); + GeomTraits* geom_traits = const_cast(arr.geometry_traits()); /* We would like to avoid copy construction of the geometry traits class. * Copy construction is undesired, because it may results with data @@ -121,16 +111,16 @@ OutputIterator locate ex_traits(*geom_traits); // Define the sweep-line visitor and perform the sweep. - Bpl_visitor visitor (&arr, &oi); + Bpl_visitor visitor(&arr, &oi); Basic_sweep_line_2 - sweep_line (&ex_traits, &visitor); + sweep_line(&ex_traits, &visitor); - sweep_line.sweep (xcurves_vec.begin(), xcurves_vec.end(), // Curves. - iso_pts_vec.begin(), iso_pts_vec.end(), // Action points. - points_begin, points_end); // Query points. + sweep_line.sweep(xcurves_vec.begin(), xcurves_vec.end(), // Curves. + iso_pts_vec.begin(), iso_pts_vec.end(), // Action points. + points_begin, points_end); // Query points. return (oi); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h index 1b07127ac0e..4b0f75e5497 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_generator_base.h @@ -151,7 +151,7 @@ public: * arrangement (a vertex, halfedge, or face handle). * \return The nearest landmark point. */ - virtual Point_2 closest_landmark (Point_2 p, Object &obj) + virtual Point_2 closest_landmark (const Point_2& p, Object &obj) { CGAL_assertion(updated); return (nn.find_nearest_neighbor(p, obj)); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_random_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_random_generator.h index c73bf4900a1..a287a7f98ab 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_random_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_random_generator.h @@ -128,18 +128,14 @@ protected: // Create N random landmarks. If N was not given to the constructor, // set it to be the number of vertices in the arrangement. - CGAL::Random random; - double px, py; - unsigned int i; - if (num_landmarks == 0) num_landmarks = arr->number_of_vertices(); - for (i = 0; i < num_landmarks; i++) - { - px = random.get_double(x_min, x_max); - py = random.get_double(y_min, y_max); - points.push_back (Point_2 (px, py)); + CGAL::Random random; + for (unsigned int i = 0; i < num_landmarks; ++i) { + double px = (x_min == x_max) ? x_min : random.get_double(x_min, x_max); + double py = (y_min == y_max) ? y_min : random.get_double(y_min, y_max); + points.push_back(Point_2 (px, py)); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h index d5f8c94f20f..834c6699934 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h @@ -48,7 +48,7 @@ Object Arr_trapezoid_ric_point_location // typedef the Locate_type typename TD::Locate_type td_lt; - const X_curve_plus& cv = td.locate(p,td_lt).top(); + Td_map_item& tr = td.locate(p,td_lt); CGAL_TRAP_PRINT_DEBUG("after td.locate"); @@ -57,8 +57,10 @@ Object Arr_trapezoid_ric_point_location if (td_lt==TD::UNBOUNDED_TRAPEZOID) { CGAL_TRAP_PRINT_DEBUG("UNBOUNDED_TRAPEZOID"); + + Face_const_handle ubf = _get_unbounded_face(tr, p, Are_all_sides_oblivious_tag()); + //check isolated vertices - Face_const_handle ubf = this->arrangement()->unbounded_face(); Isolated_vertex_const_iterator iso_verts_it; for (iso_verts_it = ubf->isolated_vertices_begin(); iso_verts_it != ubf->isolated_vertices_end(); @@ -73,54 +75,48 @@ Object Arr_trapezoid_ric_point_location return (CGAL::make_object (ubf)); } - Halfedge_const_handle h = cv.get_parent(); - switch(td_lt) { case TD::POINT: { + //p is interior so it should fall on Td_active_vertex + Td_active_vertex& v (boost::get(tr)); CGAL_TRAP_PRINT_DEBUG("POINT"); - if (m_traits->equal_2_object()(h->target()->point(), p)) - { - Vertex_const_handle vh = h->target(); - return (CGAL::make_object (vh)); - } - if (m_traits->equal_2_object()(h->source()->point(), p)) - { - Vertex_const_handle vh = h->source(); - return (CGAL::make_object (vh)); - } - else - CGAL_error(); - break; + CGAL_assertion(!v.vertex()->is_at_open_boundary()); + return (CGAL::make_object(v.vertex())); } + break; case TD::CURVE: { + Td_active_edge& e (boost::get(tr)); + Halfedge_const_handle h = e.halfedge(); CGAL_TRAP_PRINT_DEBUG("CURVE"); - if ( m_traits->is_in_x_range_2_object()(cv,p) && - m_traits->compare_y_at_x_2_object()(p,cv) == EQUAL) - return (CGAL::make_object(h)); - else + if ( m_traits->is_in_x_range_2_object()(h->curve(),p) && + m_traits->compare_y_at_x_2_object()(p,h->curve()) == EQUAL) { - //ixx - std::cerr << "curve is: "<(tr)); + Halfedge_const_handle h = t.top(); CGAL_TRAP_PRINT_DEBUG("TRAPEZOID"); - if (!(((m_traits->is_in_x_range_2_object()(h->curve(),p)) && - (m_traits->compare_y_at_x_2_object()(p, h->curve()) == LARGER)) == - (m_traits->compare_x_2_object()(h->source()->point(), - h->target()->point()) == SMALLER) - )) + bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) + && (m_traits->compare_y_at_x_2_object() + (p, h->curve()) == LARGER) ; + bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT); + if (is_p_above_h != is_h_ltr) //if not, take the twin halfedge + { h = h->twin(); - Face_const_handle fh = h->face(); + } + Face_const_handle fh = h->face(); //check isolated vertices Isolated_vertex_const_iterator iso_verts_it; for (iso_verts_it = fh->isolated_vertices_begin(); @@ -135,6 +131,7 @@ Object Arr_trapezoid_ric_point_location return (CGAL::make_object(fh)); } + break; default: CGAL_TRAP_PRINT_DEBUG("DEFAULT"); CGAL_error(); @@ -145,6 +142,113 @@ Object Arr_trapezoid_ric_point_location return Object(); } + +/*! gets the unbounded face that contains the point when the trapezoid is unbounded + */ +template +typename Arr_trapezoid_ric_point_location::Face_const_handle +Arr_trapezoid_ric_point_location:: +_get_unbounded_face(const Td_map_item& item, const Point_2& p, + Arr_all_sides_oblivious_tag) const +{ + //there's only one unbounded face + return this->arrangement()->unbounded_faces_begin(); +} + + +/*! gets the unbounded face that contains the point when the trapezoid + * is unbounded + */ +template +typename Arr_trapezoid_ric_point_location::Face_const_handle +Arr_trapezoid_ric_point_location:: +_get_unbounded_face(const Td_map_item& item,const Point_2& p, + Arr_not_all_sides_oblivious_tag) const +{ + Td_active_trapezoid tr (boost::get(item)); + // Halfedge_const_handle h = tr.top(); + if (!tr.is_on_top_boundary() || !tr.is_on_bottom_boundary()) { + //if one of top or bottom edges is defined + Halfedge_const_handle h = + (!tr.is_on_top_boundary()) ? tr.top() : tr.bottom(); + bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) && + (m_traits->compare_y_at_x_2_object()(p, h->curve()) == LARGER); + bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT); + if (is_p_above_h != is_h_ltr) //if not, take the twin halfedge + h = h->twin(); + return h->face(); + } + else if (!tr.is_on_left_boundary()) { + //if top & bottom edges are not defined but the left() curve end is defined + + //there are different internal compiler errors if we + // typedef the Locate_type + typename TD::Locate_type td_lt; + + //locate the degenerate trapezoid containing tr.left() + Td_map_item& left_v_item = td.locate(tr.left(),td_lt); + CGAL_assertion(td_lt == TD::POINT); + Halfedge_const_handle he; + if (boost::get(&left_v_item) != NULL) { + Td_active_vertex v(boost::get(left_v_item)); + he = v.cw_he(); + } + else { + Td_active_fictitious_vertex + v(boost::get(left_v_item)); + he = v.cw_he(); + } + //cw_he() holds the "smallest" curve clockwise starting from 12 o'clock + + CGAL_assertion_code(Halfedge_const_handle invalid_he); + CGAL_assertion(he != invalid_he); + + //the Halfedge_handle source is left_ee. + // this way the face on it's left is the desired one + + //MICHAL: maybe add a verification that the above occures + return he->face(); + } + else if (!tr.is_on_right_boundary()) { + //if top, bottom, left edges are not defined but the right() curve end + // is defined + + //there are different internal compiler errors if we + // typedef the Locate_type + typename TD::Locate_type td_lt; + + //locate the degenerate trapezoid of tr.right(). + Td_map_item& right_v_item = td.locate(tr.right(),td_lt); + CGAL_assertion(td_lt == TD::POINT); + Halfedge_const_handle he; + if (boost::get(&right_v_item)!= NULL) { + Td_active_vertex v(boost::get(right_v_item)); + he = v.cw_he(); + } + else { + Td_active_fictitious_vertex + v(boost::get(right_v_item)); + he = v.cw_he(); + } + //its cw_he() holds the "smallest" curve clockwise starting from + // 12 o'clock + + CGAL_assertion_code(Halfedge_handle invalid_he); + CGAL_assertion(he != invalid_he); + + //the Halfedge_handle source is right_ee. + // this way the face on it's left is the desired one + + //MICHAL: maybe add a verification that the above occures + return he->face(); + } + + //else, on all boundaries (top, bottom, left, right - are not defined), + // this is the only trapezoid in the map + return this->arrangement()->unbounded_faces_begin(); +} + + //----------------------------------------------------------------------------- // Locate the arrangement feature which a vertical ray emanating from the // given point hits, considering isolated vertices. @@ -157,57 +261,58 @@ Object Arr_trapezoid_ric_point_location typename TD::Locate_type td_lt; Halfedge_const_handle invalid_he; - X_curve_plus cv = td.vertical_ray_shoot(p, td_lt, shoot_up); + Td_map_item& item = td.vertical_ray_shoot(p, td_lt, shoot_up); // treat special case, where trapezoid is unbounded. - // for then get_parent() is not defined if (td_lt==TD::UNBOUNDED_TRAPEZOID) { - return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up)); + return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up, item)); } - Halfedge_const_handle h = cv.get_parent(); - switch(td_lt) { case TD::POINT: - if (m_traits->equal_2_object()(h->target()->point(), p)) { - Vertex_const_handle vh = h->target(); - return (CGAL::make_object (vh)); + //p fell on Td_active_vertex + Td_active_vertex& v (boost::get(item)); + return (CGAL::make_object(v.vertex())); } - if (m_traits->equal_2_object()(h->source()->point(), p)) - { - Vertex_const_handle vh = h->source(); - return (CGAL::make_object (vh)); - } - else - CGAL_error(); break; - case TD::CURVE: - if ((shoot_up && h->direction() == ARR_LEFT_TO_RIGHT) || + { + Td_active_edge& e (boost::get(item)); + Halfedge_const_handle h = e.halfedge(); + + if ((shoot_up && h->direction() == ARR_LEFT_TO_RIGHT) || (!shoot_up && h->direction() == ARR_RIGHT_TO_LEFT)) - h=h->twin(); - - return (CGAL::make_object(h)); - + { + h=h->twin(); + } + return (CGAL::make_object(h)); + } + break; case TD::TRAPEZOID: - if (!(((m_traits->is_in_x_range_2_object()(h->curve(),p)) && - (m_traits->compare_y_at_x_2_object()(p, h->curve()) == LARGER)) == - (m_traits->compare_x_2_object()(h->source()->point(), - h->target()->point()) == SMALLER) - )) + { + Td_active_trapezoid trpz (boost::get(item)); + Halfedge_const_handle h = (shoot_up) ? trpz.top() : trpz.bottom(); + + bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p)) + && (m_traits->compare_y_at_x_2_object() + (p, h->curve()) == LARGER) ; + bool is_h_ltr = (h->direction() == ARR_LEFT_TO_RIGHT); + if (is_p_above_h != is_h_ltr) //if not, take the twin halfedge h = h->twin(); - - return (_check_isolated_for_vertical_ray_shoot(h, p, shoot_up)); - + return (_check_isolated_for_vertical_ray_shoot(h, p, shoot_up, item)); + } + break; default: + { CGAL_error(); + } break; } - return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up)); + return (_check_isolated_for_vertical_ray_shoot(invalid_he, p, shoot_up, item)); } //----------------------------------------------------------------------------- @@ -219,7 +324,8 @@ template Object Arr_trapezoid_ric_point_location:: _check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, const Point_2& p, - bool shoot_up) const + bool shoot_up, + const Td_map_item& tr) const { const Comparison_result point_above_under = (shoot_up ? SMALLER : LARGER); typename Geometry_traits_2::Compare_x_2 compare_x = @@ -238,7 +344,7 @@ _check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, // If the closest feature is a valid halfedge, take its incident face. // Otherwise, take the unbounded face. if (halfedge_found == invalid_he) - face = this->arrangement()->unbounded_face(); + face = _get_unbounded_face(tr, p, Are_all_sides_oblivious_tag()); else face = halfedge_found->face(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h index 582a98bfff4..2a65ab7351f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h @@ -17,6 +17,7 @@ // // // Author(s) : Oren Nechushtan +// updated by: Michal Balas #ifndef CGAL_TD_X_TRAPEZOID_H #define CGAL_TD_X_TRAPEZOID_H @@ -26,6 +27,9 @@ */ #include +#include +#include + #ifdef CGAL_TD_DEBUG #define CGAL_TD_INLINE @@ -36,40 +40,87 @@ namespace CGAL { /*! \class - * Implementation of a pseudo-trapezoid as two curves(top,bottom) - * and two points(left,right). - * Trapezoids are represented as two points called right and left and - * two curves called top and bottom. The points lie on the right and left - * boundaries of the trapezoid respectively and the curves bound the trapezoid - * from above and below. + * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) + * and two curve-ends(left,right). + * Trapezoids are represented as two curve-ends called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. * There exist degenerate trapezoids called infinite trapezoid; this happens - * when one of the four sides degenerates into a point/X_curve at infinity. + * when one of the four sides is on the parameter space boundary. * Trapezoids are created as active and become inactive when Remove() member * function called. * Each trapezoid has at most four neighbouring trapezoids. + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * edge-end (end point). */ template class Td_X_trapezoid : public Handle { - public: +public: + + //type of trapezoid type + enum Type + { + TD_TRAPEZOID, + TD_EDGE, + TD_VERTEX + }; + + //type of traits class typedef Td_traits_ Traits; + + //type of point (Point_2) typedef typename Traits::Point Point; - typedef typename Traits::X_curve X_curve; - typedef typename Traits::X_curve_ptr curve_pointer; - typedef typename Traits::X_curve_ref curve_ref; - typedef typename Traits::X_curve_const_ref curve_const_ref; - typedef typename Traits::X_trapezoid X_trapezoid; - typedef X_trapezoid Self; - typedef typename Traits::X_trapezoid_ptr pointer; - typedef typename Traits::X_trapezoid_ref ref; - typedef typename Traits::X_trapezoid_const_ref const_ref; - typedef Td_ninetuple Arr_parameter_space; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Trapezoid (Self) + typedef typename Traits::X_trapezoid Self; + + //type of Trapezoid parameter space + // Ninetuple which represents the Trapezoid: + // - for regular & edge trapezoids or active point trapezoids: + // left vertex, right vertex, bottom halfedge, top halfedge + // - for removed point trapezoids: + // point or X_monotone_curve_2+ cv end + // type flag + on boundaries flags, + // left-bottom neighbor trapezoid, left-top neighbor trapezoid, + // right-bottom neighbor trapezoid, right-top neighbor trapezoid + typedef Td_ninetuple, + boost::variant, + boost::variant >, + Halfedge_const_handle, + unsigned char, + Self*, Self*, + Self*, Self*> Trpz_parameter_space; + + //type of Trapezoidal decomposition typedef Trapezoidal_decomposition_2 TD; - typedef typename TD::Unbounded Unbounded; + + //type of Around point circulator typedef typename TD::Around_point_circulator Around_point_circulator; + + //type of In face iterator typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + + //friend class declarations: + friend class Trapezoidal_decomposition_2; #ifdef CGAL_PM_FRIEND_CLASS @@ -92,11 +143,11 @@ class Td_X_trapezoid : public Handle #endif #endif - typedef typename TD::Data_structure Data_structure; + private: - Arr_parameter_space* ptr() const {return (Arr_parameter_space*)(PTR);} + Trpz_parameter_space* ptr() const { return (Trpz_parameter_space*)(PTR); } #ifndef CGAL_TD_DEBUG @@ -109,274 +160,591 @@ class Td_X_trapezoid : public Handle public: #endif //CGAL_TD_DEBUG - Data_structure* node; + Dag_node* m_dag_node; //pointer to the search structure (DAG) node - CGAL_TD_INLINE void init_neighbours(pointer lb_ = 0, pointer lt_ = 0, - pointer rb_ = 0, pointer rt_ = 0) - {set_lb(lb_);set_lt(lt_);set_rb(rb_);set_rt(rt_);} - CGAL_TD_INLINE void set_node(Data_structure* p) {node=p; + /*! Initialize the trapezoid's neighbours. */ + CGAL_TD_INLINE void init_neighbours(Self* lb_ = 0, Self* lt_ = 0, + Self* rb_ = 0, Self* rt_ = 0) + { + set_lb(lb_); + set_lt(lt_); + set_rb(rb_); + set_rt(rt_); + } + + /*! Set the DAG node. */ + CGAL_TD_INLINE void set_dag_node(Dag_node* p) + { + m_dag_node = p; #ifdef CGAL_TD_DEBUG - CGAL_assertion(!p || **p==*this); + CGAL_assertion(!p || **p == *this); #endif } - CGAL_TD_INLINE void set_left(const Point& p) - {ptr()->e0=p;ptr()->e4&=~CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED;} - CGAL_TD_INLINE void set_right(const Point& p) - {ptr()->e1=p;ptr()->e4&=~CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED;} + /*! Set the trapezoid's left (Vertex_const_handle). */ + CGAL_TD_INLINE void set_left(Vertex_const_handle v) + { + CGAL_precondition(is_active()); + ptr()->e0 = v; + } - CGAL_TD_INLINE void set_bottom(const X_curve& cv) - {ptr()->e2=cv;ptr()->e4&=~CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED;} + /*! Set the trapezoid's right (Vertex_const_handle). */ + CGAL_TD_INLINE void set_right(Vertex_const_handle v) + { + CGAL_precondition(is_active()); + ptr()->e1 = v; + } - CGAL_TD_INLINE void set_top(const X_curve& cv) - {ptr()->e3=cv;ptr()->e4&=~CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED;} + /*! Set the trapezoid's bottom (Halfedge_const_handle). */ + CGAL_TD_INLINE void set_bottom(Halfedge_const_handle he) + { + CGAL_precondition(is_active()); + if (!is_on_bottom_boundary() && + bottom_unsafe()->direction() != he->direction()) + { + ptr()->e2 = he->twin(); + } + else + { + ptr()->e2 = he; + } + } - CGAL_TD_INLINE void set_left_unbounded() - {ptr()->e4|=CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED;} + /*! Set the trapezoid's top (Halfedge_const_handle). */ + CGAL_TD_INLINE void set_top(Halfedge_const_handle he) + { + CGAL_precondition(is_active()); + if (!is_on_top_boundary() && + top_unsafe()->direction() != he->direction()) + { + ptr()->e3 = he->twin(); + } + else + { + ptr()->e3 = he; + } + } - CGAL_TD_INLINE void set_right_unbounded() - {ptr()->e4|=CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED;} + CGAL_TD_INLINE void update_removed_trpz() + { + CGAL_precondition(is_active()); + + if (type() == TD_EDGE) + { + //ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(top()->curve())); + set_curve_for_rem_he(top()->curve()); + return; + } - CGAL_TD_INLINE void set_bottom_unbounded() - {ptr()->e4|=CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED;} + //else if (type() == TD_VERTEX) - CGAL_TD_INLINE void set_top_unbounded() - {ptr()->e4|=CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED;} + Curve_end v_ce(left()->curve_end()); + ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(v_ce.cv())); + //CGAL_assertion(boost::get>( &(ptr()->e2)) != NULL); - CGAL_TD_INLINE void set_lb(X_trapezoid* lb) {ptr()->e5=lb;} - CGAL_TD_INLINE void set_lt(X_trapezoid* lt) {ptr()->e6=lt;} - CGAL_TD_INLINE void set_rb(X_trapezoid* rb) {ptr()->e7=rb;} - CGAL_TD_INLINE void set_rt(X_trapezoid* rt) {ptr()->e8=rt;} + ptr()->e1 = (v_ce.ce() == ARR_MIN_END ) ? CGAL_TD_CV_MIN_END : CGAL_TD_CV_MAX_END; + + if (!is_on_boundaries()) + { //if the trapezoid respresents an inner vertex + ptr()->e0 = left()->point(); + } + } + + + /*! Set the x_monotone_curve_2 for removed edge degenerate trapezoid. */ + CGAL_TD_INLINE void set_curve_for_rem_he(const X_monotone_curve_2& cv) + { + CGAL_precondition (type() == TD_EDGE); + + ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(cv)); + } + + /*! Set the trapezoid's type flag (Trapezoid/Edge/Vertex). */ + CGAL_TD_INLINE void set_type(unsigned char obj_type) + { + ptr()->e4 &= ~CGAL_TD_TYPE_MASK; + ptr()->e4 |= obj_type; + } + + /*! Set is on left boundary flag. */ + CGAL_TD_INLINE void set_is_on_left_boundary(bool b) + { + if (b) + ptr()->e4 |= CGAL_TD_ON_LEFT_BOUNDARY; + else + ptr()->e4 &= ~CGAL_TD_ON_LEFT_BOUNDARY; + } + + /*! Set is on right boundary flag. */ + CGAL_TD_INLINE void set_is_on_right_boundary(bool b) + { + if (b) + ptr()->e4 |= CGAL_TD_ON_RIGHT_BOUNDARY; + else + ptr()->e4 &= ~CGAL_TD_ON_RIGHT_BOUNDARY; + } + + /*! Set is on bottom boundary flag. */ + CGAL_TD_INLINE void set_is_on_bottom_boundary(bool b) + { + if (b) + ptr()->e4 |= CGAL_TD_ON_BOTTOM_BOUNDARY; + else + ptr()->e4 &= ~CGAL_TD_ON_BOTTOM_BOUNDARY; + } + + /*! Set is on top boundary flag. */ + CGAL_TD_INLINE void set_is_on_top_boundary(bool b) + { + if (b) + ptr()->e4 |= CGAL_TD_ON_TOP_BOUNDARY; + else + ptr()->e4 &= ~CGAL_TD_ON_TOP_BOUNDARY; + } + + /*! Set left bottom neighbour. */ + CGAL_TD_INLINE void set_lb(Self* lb) { ptr()->e5 = lb; } + + /*! Set left top neighbour. */ + CGAL_TD_INLINE void set_lt(Self* lt) { ptr()->e6 = lt; } + + /*! Set right bottom neighbour. */ + CGAL_TD_INLINE void set_rb(Self* rb) { ptr()->e7 = rb; } + + /*! Set right top neighbour. */ + CGAL_TD_INLINE void set_rt(Self* rt) { ptr()->e8 = rt; } public: + /// \name Constructors. + //@{ + + /*! Default constructor. */ Td_X_trapezoid() { - PTR = new Arr_parameter_space - (Traits::point_at_left_top_infinity(), - Traits::point_at_right_bottom_infinity(), - Traits::curve_at_infinity(), - Traits::curve_at_infinity(), - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOTALLY_UNBOUNDED, + //define the initial trapezoid: left, right, btm, top are at infinity. + // its type is TD_TRAPEZOID ,it is on all boundaries, and has no neighbours + PTR = new Trpz_parameter_space + (Traits::vtx_at_left_infinity(), + Traits::vtx_at_right_infinity(), + Traits::he_at_bottom_infinity(), + Traits::he_at_top_infinity(), + CGAL_TD_TRAPEZOID | CGAL_TD_ON_ALL_BOUNDARIES , 0, 0, 0, 0); - node = 0; + + m_dag_node = 0; } - Td_X_trapezoid (const Point &l, const Point &r, - const X_curve &b, const X_curve &t, - unsigned char c = CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOUNDED, - X_trapezoid *lb = 0, X_trapezoid *lt = 0, - X_trapezoid *rb = 0, X_trapezoid *rt = 0, - Data_structure *p = 0) - { - PTR = new Arr_parameter_space(l, r, b, t, c, lb, lt, rb, rt); - node = p; - } + /*! Constructor given Vertex & Halfedge handles. */ + Td_X_trapezoid (Vertex_const_handle l, Vertex_const_handle r, + Halfedge_const_handle b, Halfedge_const_handle t, + Type tp = TD_TRAPEZOID, + unsigned char boundness_flag = CGAL_TD_INTERIOR, + Self* lb = 0, Self* lt = 0, + Self* rb = 0, Self* rt = 0, + Dag_node* node = 0) + { + + //build the type flag + unsigned char type_flag = 0; + if (tp == TD_TRAPEZOID) + type_flag |= CGAL_TD_TRAPEZOID; + else if (tp == TD_EDGE) + type_flag |= CGAL_TD_EDGE; + else //tp == TD_VERTEX + type_flag |= CGAL_TD_VERTEX; + + PTR = new Trpz_parameter_space + (l, r, b, t, type_flag | boundness_flag, lb, lt, rb, rt); + m_dag_node = node; + } - Td_X_trapezoid (const Point *l, const Point *r , - const X_curve *b, const X_curve *t, - X_trapezoid *lb = 0, X_trapezoid *lt = 0, - X_trapezoid *rb = 0, X_trapezoid *rt = 0, - Data_structure *p = 0) - { - PTR = new Arr_parameter_space - (l ? *l : Traits::point_at_left_top_infinity(), - r ? *r : Traits::point_at_right_bottom_infinity(), - b ? *b : Traits::curve_at_infinity(), - t ? *t : Traits::curve_at_infinity(), - ((l ? 0 : CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED) | - (r ? 0 : CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED) | - (b ? 0 : CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED) | - (t ? 0 : CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED)), + /*! Constructor given Pointers to Vertex & Halfedge handles. */ + Td_X_trapezoid (Vertex_const_handle* l, Vertex_const_handle* r , + Halfedge_const_handle* b, Halfedge_const_handle* t, + unsigned char type_flag, + bool on_left_bndry, + bool on_right_bndry, + bool on_bottom_bndry, + bool on_top_bndry, + Self* lb = 0, Self* lt = 0, + Self* rb = 0, Self* rt = 0, + Dag_node* node = 0) + { + PTR = new Trpz_parameter_space + (l ? *l : Traits::vtx_at_left_infinity(), + r ? *r : Traits::vtx_at_right_infinity(), + b ? *b : Traits::he_at_bottom_infinity(), + t ? *t : Traits::he_at_top_infinity(), + (type_flag | + (on_left_bndry ? CGAL_TD_ON_LEFT_BOUNDARY : 0) | + (on_right_bndry ? CGAL_TD_ON_RIGHT_BOUNDARY : 0) | + (on_bottom_bndry ? CGAL_TD_ON_BOTTOM_BOUNDARY : 0) | + (on_top_bndry ? CGAL_TD_ON_TOP_BOUNDARY : 0) ), lb, lt, rb, rt); - node = p; + m_dag_node = node; } - Td_X_trapezoid (const X_trapezoid &tr) : - Handle(tr) + /*! Copy constructor. */ + Td_X_trapezoid (const Self& tr) : Handle(tr) { - node = tr.node; + m_dag_node = tr.m_dag_node; } - /* - remark: - operator= should not copy node (or otherwise update - Data_structure::replace) + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) */ - CGAL_TD_INLINE X_trapezoid& operator= (const X_trapezoid& t2) + CGAL_TD_INLINE Self& operator= (const Self& t2) { Handle::operator=(t2); return *this; } - CGAL_TD_INLINE ref self() + + /*! Operator==. */ + CGAL_TD_INLINE bool operator== (const Self& t2) const + { + return CGAL::identical(*this,t2); + } + + /*! Operator!=. */ + CGAL_TD_INLINE bool operator!= (const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + CGAL_TD_INLINE Self& self() { return *this; } - CGAL_TD_INLINE const_ref self() const + + CGAL_TD_INLINE const Self& self() const { return *this; } - CGAL_TD_INLINE unsigned long id () const + + /*! Access the trapezoid id (PTR). */ + CGAL_TD_INLINE unsigned long id() const { return (unsigned long) PTR; } - CGAL_TD_INLINE bool operator== (const X_trapezoid& t2) const + /*! Access trapezoid left. */ + CGAL_TD_INLINE Vertex_const_handle left_unsafe() const { - return CGAL::identical(*this,t2); + CGAL_precondition(is_active()); + CGAL_assertion(boost::get(&(ptr()->e0)) != NULL); + return boost::get(ptr()->e0); } - CGAL_TD_INLINE bool operator!= (const X_trapezoid& t2) const + /*! Access trapezoid left. + * filters out the infinite case which returns predefined dummy values + */ + CGAL_TD_INLINE Vertex_const_handle left() const { - return !(operator==(t2)); + CGAL_precondition(is_active()); + if (is_on_left_boundary() && is_on_bottom_boundary() + && is_on_top_boundary()) + { + return Traits::vtx_at_left_infinity(); + } + //else + return left_unsafe(); } - CGAL_TD_INLINE const Point& left_unsafe () const + /*! Access trapezoid right. */ + CGAL_TD_INLINE Vertex_const_handle right_unsafe() const { - return ptr()->e0; + CGAL_precondition(is_active()); + CGAL_assertion(boost::get(&(ptr()->e1)) != NULL); + return boost::get(ptr()->e1); } - CGAL_TD_INLINE const Point& left () const + /*! Access trapezoid right. + * filters out the infinite case which returns predefined dummy values + */ + CGAL_TD_INLINE Vertex_const_handle right () const + { + CGAL_precondition(is_active()); + if (is_on_right_boundary() && is_on_bottom_boundary() + && is_on_top_boundary()) { - return !is_left_unbounded() ? - left_unsafe() : Traits::point_at_left_top_infinity(); + return Traits::vtx_at_right_infinity(); + } + //else + return right_unsafe(); + } + + /*! Access trapezoid bottom. */ + CGAL_TD_INLINE Halfedge_const_handle bottom_unsafe () const + { + CGAL_precondition(is_active()); + CGAL_assertion(boost::get(&(ptr()->e2)) != NULL); + return boost::get(ptr()->e2); } - CGAL_TD_INLINE const Point& right_unsafe () const + /*! Access trapezoid bottom. + * filters out the infinite case which returns predefined dummy values + */ + CGAL_TD_INLINE Halfedge_const_handle bottom () const { - return ptr()->e1; + CGAL_precondition(is_active()); + return !is_on_bottom_boundary() ? + bottom_unsafe() : Traits::he_at_bottom_infinity(); } - CGAL_TD_INLINE const Point& right () const + /*! Access trapezoid top. */ + CGAL_TD_INLINE Halfedge_const_handle top_unsafe () const { - return !is_right_unbounded() ? - right_unsafe() : Traits::point_at_right_bottom_infinity(); + CGAL_precondition(is_active()); + return ptr()->e3; } - // filters out the infinite case where at returns predefined dummy values - CGAL_TD_INLINE const X_curve& bottom_unsafe () const + /*! Access trapezoid top. + * filters out the infinite case which returns predefined dummy values + */ + CGAL_TD_INLINE Halfedge_const_handle top () const { - return ptr()->e2; + CGAL_precondition(is_active()); + return !is_on_top_boundary() ? + top_unsafe() : Traits::he_at_top_infinity(); } - // filters out the infinite case where at returns predefined dummy values - CGAL_TD_INLINE const X_curve& bottom () const + CGAL_TD_INLINE Point point_for_inner_rem_vtx() const { - return !is_bottom_unbounded() ? - bottom_unsafe() : Traits::curve_at_infinity(); + CGAL_precondition(!is_active()); + CGAL_precondition(type() == TD_VERTEX); + CGAL_precondition(!is_on_boundaries()); + + CGAL_assertion(boost::get( &(ptr()->e0)) != NULL); + return boost::get( ptr()->e0 ); } - CGAL_TD_INLINE const X_curve& top_unsafe () const + CGAL_TD_INLINE std::pair curve_end_pair_for_boundary_rem_vtx() const { - return ptr()->e3; + CGAL_precondition(!is_active()); + CGAL_precondition(type() == TD_VERTEX); + CGAL_precondition(is_on_boundaries()); + + CGAL_assertion(boost::get( &(ptr()->e1)) != NULL); + CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(cv_ptr != NULL); + + Arr_curve_end ce = + (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? + ARR_MIN_END : ARR_MAX_END; + + return std::make_pair(cv_ptr, ce); + } + + CGAL_TD_INLINE Curve_end curve_end_for_boundary_rem_vtx() const + { + CGAL_precondition(!is_active()); + CGAL_precondition(type() == TD_VERTEX); + CGAL_precondition(is_on_boundaries()); + + CGAL_assertion(boost::get( &(ptr()->e1)) != NULL); + CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(cv_ptr != NULL); + + Arr_curve_end ce = + (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? + ARR_MIN_END : ARR_MAX_END; + + return Curve_end(*cv_ptr, ce); + } + + CGAL_TD_INLINE Curve_end curve_end_for_rem_vtx() const + { + CGAL_precondition(!is_active()); + CGAL_precondition(type() == TD_VERTEX); + + CGAL_assertion(boost::get( &(ptr()->e1)) != NULL); + CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(cv_ptr != NULL); + + Arr_curve_end ce = + (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? + ARR_MIN_END : ARR_MAX_END; + + return Curve_end(*cv_ptr, ce); + } + + CGAL_TD_INLINE X_monotone_curve_2& curve_for_rem_he() const + { + CGAL_precondition(!is_active() && type() == TD_EDGE); + + CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(cv_ptr != NULL); + return *cv_ptr; + } + + /*! Access trapezoid type. */ + CGAL_TD_INLINE Type type() const + { + switch(ptr()->e4 & CGAL_TD_TYPE_MASK) + { + case CGAL_TD_TRAPEZOID: + return TD_TRAPEZOID; + case CGAL_TD_EDGE: + return TD_EDGE; + case CGAL_TD_VERTEX: + return TD_VERTEX; + default: + CGAL_assertion(false); + return TD_TRAPEZOID; + } } - CGAL_TD_INLINE const X_curve& top () const + /*! Access trapezoid type flag. */ + CGAL_TD_INLINE unsigned char type_flag() const { - return !is_top_unbounded() ? - top_unsafe() : Traits::curve_at_infinity(); + return (ptr()->e4 & CGAL_TD_TYPE_MASK); } - unsigned char boundedness() const {return ptr()->e4;} + /*! Access on boundaries flag. */ + CGAL_TD_INLINE unsigned char on_boundaries_flag() const + { + return (ptr()->e4 & CGAL_TD_ON_ALL_BOUNDARIES); + } - CGAL_TD_INLINE bool is_left_unbounded() const { - return (ptr()->e4&CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED)!=0;} - CGAL_TD_INLINE bool is_right_unbounded() const { - return (ptr()->e4&CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED)!=0;} - CGAL_TD_INLINE bool is_bottom_unbounded() const { - return (ptr()->e4&CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED)!=0;} - CGAL_TD_INLINE bool is_top_unbounded() const { - return (ptr()->e4&CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED)!=0;} - CGAL_TD_INLINE bool is_unbounded() const + /*! Access is on left boundary. */ + CGAL_TD_INLINE bool is_on_left_boundary() const { - CGAL_assertion(is_active()); - return (ptr()->e4&CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOTALLY_UNBOUNDED)!=0; + return (ptr()->e4 & CGAL_TD_ON_LEFT_BOUNDARY) != 0; } - CGAL_TD_INLINE bool is_top_curve_equal(const Self& t, - const Traits* traits) const { - if (is_top_unbounded()) return t.is_top_unbounded(); - else if (t.is_top_unbounded()) return false; - return traits->equal_2_object()(top_unsafe(),t.top_unsafe()); - } - CGAL_TD_INLINE bool is_bottom_curve_equal(const Self& t, - const Traits* traits) const { - if (is_bottom_unbounded()) return t.is_bottom_unbounded(); - else if (t.is_bottom_unbounded()) return false; - return traits->equal_2_object()(bottom_unsafe(),t.bottom_unsafe()); + /*! Access is on right boundary. */ + CGAL_TD_INLINE bool is_on_right_boundary() const + { + return (ptr()->e4 & CGAL_TD_ON_RIGHT_BOUNDARY) != 0; } - pointer get_lb() const {return ptr()->e5;} + /*! Access is on bottom boundary. */ + CGAL_TD_INLINE bool is_on_bottom_boundary() const + { + return (ptr()->e4 & CGAL_TD_ON_BOTTOM_BOUNDARY) != 0; + } + + /*! Access is on top boundary. */ + CGAL_TD_INLINE bool is_on_top_boundary() const + { + return (ptr()->e4 & CGAL_TD_ON_TOP_BOUNDARY) != 0; + } - pointer get_lt() const {return ptr()->e6;} + /*! Access is on at least one boundary. */ + CGAL_TD_INLINE bool is_on_boundaries() const + { + return (ptr()->e4 & CGAL_TD_ON_ALL_BOUNDARIES) != 0; + } - pointer get_rb() const {return ptr()->e7;} + /*! Access left bottom neighbour. */ + Self* lb() const { return ptr()->e5; } - pointer get_rt() const {return ptr()->e8;} + /*! Access left top neighbour. */ + Self* lt() const { return ptr()->e6; } - pointer left_bottom_neighbour() const {return get_lb();} + /*! Access right bottom neighbour. */ + Self* rb() const { return ptr()->e7; } - pointer left_top_neighbour() const {return get_lt();} + /*! Access right top neighbour. */ + Self* rt() const { return ptr()->e8; } - pointer right_bottom_neighbour() const {return get_rb();} + /*! Access DAG node. */ + Dag_node* dag_node() const {return m_dag_node;} - pointer right_top_neighbour() const {return get_rt();} - Data_structure* get_node() const {return node;} + //@} + /*! is trapezoid active */ bool is_active() const { - return right_bottom_neighbour()!= - (pointer)CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE; + return rb()!= + (Self*)CGAL_TD_DELETE_SIGNATURE; } - CGAL_TD_INLINE void remove(Data_structure* left=0) + /*! Removing this trapezoid (defining it as in-active) */ + CGAL_TD_INLINE void remove(Dag_node* left=0) { CGAL_precondition(is_active()); + // update vertex/edge trapezoid parameters after remove + if (type() != TD_TRAPEZOID) + update_removed_trpz(); + // mark trapezoid as deleted, - set_rb((pointer)CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE); + set_rb((Self*)CGAL_TD_DELETE_SIGNATURE); + + if (type() == TD_VERTEX) + curve_end_for_rem_vtx(); // resets left son in data structure depending on input. if (left) - node->set_left(*left); + m_dag_node->set_left_child(*left); } - /* precondition: - both trapezoidal are active and have the same + /* Merge this trapezoid with the input trapezoid. + Precondition: + both trapezoids are active and have the same bounding edges from above and below and the trapezoids are adjacent to one another with the first to the left - postcondition: + Postcondition: this trapezoid is the union of the old this trapezoid - and the input trapezoids + and the input trapezoid */ - CGAL_TD_INLINE void merge_trapezoid(X_trapezoid& right) + CGAL_TD_INLINE void merge_trapezoid( Self& right) { - CGAL_assertion(!is_right_unbounded()); + //precondition: both are of type trapezoid + CGAL_precondition((type() == TD_TRAPEZOID) && + (right.type() == TD_TRAPEZOID)); + //precondition: both are active + CGAL_precondition(is_active() && right.is_active()); + //precondition: the left trapezoid is not on the right boundary + CGAL_assertion(!is_on_right_boundary()); - bool right_unbounded = right.is_right_unbounded(); - *this=X_trapezoid (!is_left_unbounded() ? &left() : 0, - !right_unbounded ? &right.right() : 0, - !is_bottom_unbounded() ? &bottom() : 0, - !is_top_unbounded() ? &top() : 0, - left_bottom_neighbour(),left_top_neighbour(), - right.right_bottom_neighbour(), - right.right_top_neighbour()); + bool on_right_boundary = right.is_on_right_boundary(); - if (right_bottom_neighbour()) - right_bottom_neighbour()->set_lb(this); + *this = Self (!is_on_left_boundary() ? & left() : 0, + !on_right_boundary ? &right.right() : 0, + !is_on_bottom_boundary() ? &bottom() : 0, + !is_on_top_boundary() ? &top() : 0, + CGAL_TD_TRAPEZOID, + is_on_left_boundary(), on_right_boundary, + is_on_bottom_boundary(), is_on_top_boundary(), + lb(),lt(), + right.rb(), + right.rt()); + + if (rb()) + rb()->set_lb(this); + + if (rt()) + rt()->set_lt(this); - if (right_top_neighbour()) - right_top_neighbour()->set_lt(this); - - CGAL_assertion(is_right_unbounded()==right.is_right_unbounded()); + CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary()); } #ifdef CGAL_TD_DEBUG + //MICHAL: This method should not compile!! bool is_valid(const Traits* traits) const { Comparison_result t; @@ -393,7 +761,7 @@ class Td_X_trapezoid : public Handle CGAL_warning(**get_node()==*this); return false; } - if (!is_left_unbounded() && !is_right_unbounded() && + if (!is_on_left_boundary() && !is_on_right_boundary() && CGAL_POINT_IS_LEFT_LOW(right(),left())) { std::cerr << "\nthis="; @@ -402,13 +770,13 @@ class Td_X_trapezoid : public Handle return false; } - if (!is_bottom_unbounded()) + if (!is_on_bottom_boundary()) { - if (is_left_unbounded() || is_right_unbounded()) + if (is_on_left_boundary() || is_on_right_boundary()) { std::cerr << "\nthis="; write(std::cerr,*this,*traits,false) << std::flush; - CGAL_warning(!(is_left_unbounded() ||is_right_unbounded())); + CGAL_warning(!(is_on_left_boundary() ||is_on_right_boundary())); return false; } @@ -440,13 +808,13 @@ class Td_X_trapezoid : public Handle return false; } } - if (!is_top_unbounded()) + if (!is_on_top_boundary()) { - if (is_left_unbounded() || is_right_unbounded()) + if (is_on_left_boundary() || is_on_right_boundary()) { std::cerr << "\nthis="; write(std::cerr,*this,*traits,false) << std::flush; - CGAL_warning(!(is_left_unbounded() || is_right_unbounded())); + CGAL_warning(!(is_on_left_boundary() || is_on_right_boundary())); return false; } @@ -480,59 +848,59 @@ class Td_X_trapezoid : public Handle } if (!traits->is_degenerate(*this)) { - if (right_top_neighbour() && - (! is_top_curve_equal(*right_top_neighbour(), traits)) || - left_top_neighbour() && - (! is_top_curve_equal(*left_top_neighbour(), traits)) || - right_bottom_neighbour() && - (! is_bottom_curve_equal(*right_bottom_neighbour(), traits)) || - left_bottom_neighbour() && - (! is_bottom_curve_equal(*left_bottom_neighbour(), traits)) || - right_top_neighbour() && - traits->is_degenerate(*right_top_neighbour()) || - left_top_neighbour() && - traits->is_degenerate(*left_top_neighbour()) || - right_bottom_neighbour() && - traits->is_degenerate(*right_bottom_neighbour()) || - left_bottom_neighbour() && - traits->is_degenerate(*left_bottom_neighbour())) + if (rt() && + (! is_top_curve_equal(*rt(), traits)) || + lt() && + (! is_top_curve_equal(*lt(), traits)) || + rb() && + (! is_bottom_curve_equal(*rb(), traits)) || + lb() && + (! is_bottom_curve_equal(*lb(), traits)) || + rt() && + traits->is_degenerate(*rt()) || + lt() && + traits->is_degenerate(*lt()) || + rb() && + traits->is_degenerate(*rb()) || + lb() && + traits->is_degenerate(*lb())) { std::cerr << "\nthis="; write(std::cerr,*this,*traits,false) << std::flush; - CGAL_warning(!(right_top_neighbour() && - (! is_top_curve_equal(*right_top_neighbour(), traits)))); - CGAL_warning(!(left_top_neighbour() && - (! is_top_curve_equal(*left_top_neighbour(), traits)))); - CGAL_warning(!(right_bottom_neighbour() && - (! is_bottom_curve_equal(*right_bottom_neighbour(), traits)))); - CGAL_warning(!(left_bottom_neighbour() && - (! is_bottom_curve_equal(*left_bottom_neighbour(), traits)))); - CGAL_warning(!(right_top_neighbour() && - traits->is_degenerate(*right_top_neighbour()))); - CGAL_warning(!(left_top_neighbour() && - traits->is_degenerate(*left_top_neighbour()))); - CGAL_warning(!(right_bottom_neighbour() && - traits->is_degenerate(*right_bottom_neighbour()))); - CGAL_warning(!(left_bottom_neighbour() && - traits->is_degenerate(*left_bottom_neighbour()))); + CGAL_warning(!(rt() && + (! is_top_curve_equal(*rt(), traits)))); + CGAL_warning(!(lt() && + (! is_top_curve_equal(*lt(), traits)))); + CGAL_warning(!(rb() && + (! is_bottom_curve_equal(*rb(), traits)))); + CGAL_warning(!(lb() && + (! is_bottom_curve_equal(*lb(), traits)))); + CGAL_warning(!(rt() && + traits->is_degenerate(*rt()))); + CGAL_warning(!(lt() && + traits->is_degenerate(*lt()))); + CGAL_warning(!(rb() && + traits->is_degenerate(*rb()))); + CGAL_warning(!(lb() && + traits->is_degenerate(*lb()))); return false; } - if (right_top_neighbour()&&!right_top_neighbour()->is_active()|| - left_top_neighbour()&&!left_top_neighbour()->is_active()|| - right_bottom_neighbour()&&!right_bottom_neighbour()->is_active()|| - left_bottom_neighbour()&&!left_bottom_neighbour()->is_active()) + if (rt()&&!rt()->is_active()|| + lt()&&!lt()->is_active()|| + rb()&&!rb()->is_active()|| + lb()&&!lb()->is_active()) { std::cerr << "\nleft=" << left() << " right=" << right() << " bottom=" << bottom() << " top=" << top() << std::flush; - CGAL_warning(!(right_top_neighbour() && - !right_top_neighbour()->is_active())); - CGAL_warning(!(left_top_neighbour() && - !left_top_neighbour()->is_active())); - CGAL_warning(!(right_bottom_neighbour() && - !right_bottom_neighbour()->is_active())); - CGAL_warning(!(left_bottom_neighbour() && - !left_bottom_neighbour()->is_active())); + CGAL_warning(!(rt() && + !rt()->is_active())); + CGAL_warning(!(lt() && + !lt()->is_active())); + CGAL_warning(!(rb() && + !rb()->is_active())); + CGAL_warning(!(lb() && + !lb()->is_active())); return false; } } @@ -542,20 +910,20 @@ class Td_X_trapezoid : public Handle points should be on the top() and bottom() curves. In any case none of the geometric boundaries should be unbounded */ - if (is_bottom_unbounded()|| - is_top_unbounded()|| - is_left_unbounded()|| - is_right_unbounded() + if (is_on_bottom_boundary()|| + is_on_top_boundary()|| + is_on_left_boundary()|| + is_on_right_boundary() ) { std::cerr << "\nbottom()==" << bottom() << std::flush; std::cerr << "\ntop()==" << top() << std::flush; std::cerr << "\nleft()==" << left() << std::flush; std::cerr << "\nright()==" << right() << std::flush; - CGAL_warning((!is_bottom_unbounded())); - CGAL_warning((!is_top_unbounded())); - CGAL_warning((!is_left_unbounded())); - CGAL_warning((!is_right_unbounded())); + CGAL_warning((!is_on_bottom_boundary())); + CGAL_warning((!is_on_top_boundary())); + CGAL_warning((!is_on_left_boundary())); + CGAL_warning((!is_on_right_boundary())); return false; } if (!CGAL_IS_IN_X_RANGE(bottom(),left()) || @@ -598,86 +966,86 @@ class Td_X_trapezoid : public Handle } if (traits->is_degenerate_curve(*this)) { - if (right_top_neighbour()&&!right_top_neighbour()->is_active()|| - //!left_top_neighbour()||!left_top_neighbour()->is_active()|| - right_bottom_neighbour() && - !right_bottom_neighbour()->is_active()|| - left_bottom_neighbour() && !left_bottom_neighbour()->is_active() + if (rt()&&!rt()->is_active()|| + //!lt()||!lt()->is_active()|| + rb() && + !rb()->is_active()|| + lb() && !lb()->is_active() ) { - CGAL_warning(!right_top_neighbour() || - right_top_neighbour()->is_active()); - //CGAL_warning(!left_top_neighbour() || - //left_top_neighbour()->is_active()); - CGAL_warning(!right_bottom_neighbour() || - right_bottom_neighbour()->is_active()); - CGAL_warning(!left_bottom_neighbour() || - left_bottom_neighbour()->is_active()); + CGAL_warning(!rt() || + rt()->is_active()); + //CGAL_warning(!lt() || + //lt()->is_active()); + CGAL_warning(!rb() || + rb()->is_active()); + CGAL_warning(!lb() || + lb()->is_active()); return false; } if ( /* if trapezoid is end relative to supporting X_curve, that is adjacent(trapezoid's right end point,supporting X_curve right - end point) , right_top_neighbour() returns next such trapezoid + end point) , rt() returns next such trapezoid around right() point in clockwise oriented order adjacent(trapezoid's left end point,supporting X_curve left end - point), left_bottom_neighbour() returns next such trapezoid + point), lb() returns next such trapezoid around left() point in clockwise oriented order */ - /* right_bottom_neighbour() points to next trapezoid on + /* rb() points to next trapezoid on supporting X_curve, if such exist */ - right_top_neighbour() && - !traits->is_degenerate_curve(*right_top_neighbour())|| - // !left_top_neighbour() || - // !traits->is_degenerate_curve(*left_top_neighbour())|| - right_bottom_neighbour() && - !traits->is_degenerate_curve(*right_bottom_neighbour())|| - left_bottom_neighbour() && - !traits->is_degenerate_curve(*left_bottom_neighbour()) + rt() && + !traits->is_degenerate_curve(*rt())|| + // !lt() || + // !traits->is_degenerate_curve(*lt())|| + rb() && + !traits->is_degenerate_curve(*rb())|| + lb() && + !traits->is_degenerate_curve(*lb()) ) { - CGAL_warning(!right_top_neighbour() || - traits->is_degenerate_curve(*right_top_neighbour())); - //CGAL_warning(!left_top_neighbour() || - //!traits->is_degenerate_curve(*left_top_neighbour())); - CGAL_warning(!right_bottom_neighbour() || + CGAL_warning(!rt() || + traits->is_degenerate_curve(*rt())); + //CGAL_warning(!lt() || + //!traits->is_degenerate_curve(*lt())); + CGAL_warning(!rb() || traits-> - is_degenerate_curve(*right_bottom_neighbour())); - CGAL_warning(!left_bottom_neighbour() || + is_degenerate_curve(*rb())); + CGAL_warning(!lb() || traits-> - is_degenerate_curve(*left_bottom_neighbour())); + is_degenerate_curve(*lb())); return false; } } else if (traits->is_degenerate_point(*this)) { - if (right_top_neighbour() && - !traits->is_degenerate_curve(*right_top_neighbour())|| - left_bottom_neighbour() && - !traits->is_degenerate_curve(*left_bottom_neighbour()) + if (rt() && + !traits->is_degenerate_curve(*rt())|| + lb() && + !traits->is_degenerate_curve(*lb()) ) { - CGAL_warning(!right_top_neighbour() || - traits->is_degenerate_curve(*right_top_neighbour())); - CGAL_warning(!left_bottom_neighbour() || + CGAL_warning(!rt() || + traits->is_degenerate_curve(*rt())); + CGAL_warning(!lb() || traits-> - is_degenerate_curve(*left_bottom_neighbour())); + is_degenerate_curve(*lb())); return false; } - if (right_top_neighbour()&&!right_top_neighbour()->is_active()|| - left_bottom_neighbour()&&!left_bottom_neighbour()->is_active() + if (rt()&&!rt()->is_active()|| + lb()&&!lb()->is_active() ) { - CGAL_warning(!right_top_neighbour() || - right_top_neighbour()->is_active()); - CGAL_warning(!left_bottom_neighbour() || - left_bottom_neighbour()->is_active()); + CGAL_warning(!rt() || + rt()->is_active()); + CGAL_warning(!lb() || + lb()->is_active()); return false; } - if (!traits->equal_2_object()(left(),right())) + if (!traits->equal_curve_end_2_object()(left(),right())) { std::cerr << "\nleft()==" << left() << std::flush; std::cerr << "\nright()==" << right() << std::flush; - CGAL_warning(traits->equal_2_object()(left(),right())); + CGAL_warning(traits->equal_curve_end_2_object()(left(),right())); return false; } } @@ -691,10 +1059,20 @@ class Td_X_trapezoid : public Handle ptr(); bottom(); top(); + if (type() == TD_VERTEX && !is_active()) + { + if (!is_on_boundaries()) + point_for_inner_rem_vtx(); + else + curve_end_for_boundary_rem_vtx(); + } + else //MICHAL: this is problematic since left, right may not exist for inactive trapezoids as well + { left(); right(); } -#endif + } +#endif //CGAL_TD_DEBUG }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h new file mode 100644 index 00000000000..7a5de53d058 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -0,0 +1,292 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may uactivese this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h $ +// $Id: Td_active_edge.h 65793 2011-10-10 17:04:38Z balasmic $ +// +// +// Author(s) : Oren Nechushtan +// updated by: Michal Balas + +#ifndef CGAL_TD_ACTIVE_EDGE_H +#define CGAL_TD_ACTIVE_EDGE_H + +/*! \file + * Defintion of the Td_active_edge class. + */ + +#include +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) + * and two curve-ends(left,right). + * Trapezoids are represented as two curve-ends called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. + * There exist degenerate trapezoids called infinite trapezoid; this happens + * when one of the four sides is on the parameter space boundary. + * Trapezoids are created as active and become inactive when Remove() member + * function called. + * Each trapezoid has at most four neighbouring trapezoids. + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * edge-end (end point). + */ +template +class Td_active_edge : public Handle +{ +public: + + //type of traits class + typedef Td_traits_ Traits; + + //type of point (Point_2) + typedef typename Traits::Point Point; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Td_active_edge (Self) + typedef typename Traits::Td_active_edge Self; + + typedef typename Traits::Td_map_item Td_map_item; + + //type of Trapezoidal decomposition + typedef Trapezoidal_decomposition_2 TD; + + //type of In face iterator + typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + + //friend class declarations: + + friend class Trapezoidal_decomposition_2; + +#ifdef CGAL_PM_FRIEND_CLASS +#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) + friend class Trapezoidal_decomposition_2::In_face_iterator; +#elif defined(__GNUC__) + +#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))) + friend typename Trapezoidal_decomposition_2::In_face_iterator; +#else + friend class Trapezoidal_decomposition_2::In_face_iterator; +#endif + +#else + friend class In_face_iterator; +#endif +#endif + + /*! \class + * Inner class Data derived from Rep class + */ + class Data : public Rep + { + friend class Td_active_edge; + + public: + //c'tors + Data (Halfedge_const_handle _he, + const Td_map_item& _next, + Dag_node* _p_node) + : he(_he),next(_next),p_node(_p_node) + { } + + ~Data() { } + + protected: + Halfedge_const_handle he; + Td_map_item next; + Dag_node* p_node; + }; + + private: + + Data* ptr() const { return (Data*)(PTR); } + + +#ifndef CGAL_TD_DEBUG +#ifdef CGAL_PM_FRIEND_CLASS + protected: +#else + public: // workaround +#endif +#else //CGAL_TD_DEBUG + public: +#endif //CGAL_TD_DEBUG + + //Dag_node* m_dag_node; //pointer to the search structure (DAG) node + + /*! Initialize the trapezoid's neighbours. */ + inline void init_neighbours(boost::optional next) + { + set_next((next) ? *next : Td_map_item(0)); + } + + /*! Set the DAG node. */ + CGAL_TD_INLINE void set_dag_node(Dag_node* p) + { + ptr()->p_node = p; + //m_dag_node = p; + +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(!p || **p == *this); +// +//#endif + + } + + ///*! Set the trapezoid's bottom (Halfedge_const_handle). */ + CGAL_TD_INLINE void set_halfedge(Halfedge_const_handle he) + { + if (halfedge() != Traits::empty_he_handle() && + halfedge()->direction() != he->direction()) + { + ptr()->he = he->twin(); + } + else + { + ptr()->he = he; + } + } + + /*! Set next edge fragment. */ + inline void set_next( const Td_map_item& next) { ptr()->next = next; } + public: + + /// \name Constructors. + //@{ + + Td_active_edge () + { + + PTR = new Data + (Traits::empty_he_handle(), Td_map_item(0), NULL); + //m_dag_node = NULL; + } + /*! Constructor given Vertex & Halfedge handles. */ + Td_active_edge (Halfedge_const_handle he , + Dag_node* node = 0, + boost::optional next = boost::none) + { + + PTR = new Data(he, (next) ? *next : Td_map_item(0), node); + //m_dag_node = node; + } + + + /*! Copy constructor. */ + Td_active_edge(const Self& tr) : Handle(tr) + { +// m_dag_node = tr.m_dag_node; + } + + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) + */ + CGAL_TD_INLINE Self& operator= (const Self& t2) + { + Handle::operator=(t2); + return *this; + } + + /*! Operator==. */ + CGAL_TD_INLINE bool operator== (const Self& t2) const + { + return (ptr() == t2.ptr()); + } + + /*! Operator!=. */ + CGAL_TD_INLINE bool operator!= (const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + CGAL_TD_INLINE Self& self() + { + return *this; + } + + CGAL_TD_INLINE const Self& self() const + { + return *this; + } + + /*! Access the trapezoid id (PTR). */ + CGAL_TD_INLINE unsigned long id() const + { + return (unsigned long) PTR; + } + + + inline Halfedge_const_handle halfedge() const + { + return ptr()->he; + } + + /*! Access next edge fragment. */ + Td_map_item& next() const { return ptr()->next; } + + /*! Access DAG node. */ + Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;} + + + //@} + + + + + + +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h new file mode 100644 index 00000000000..eaaad1da7ca --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h @@ -0,0 +1,309 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h $ +// $Id: Td_active_fictitious_vertex.h 65793 2011-10-10 17:04:38Z balasmic $ +// +// +// Author(s) : Oren Nechushtan +// updated by: Michal Balas + +#ifndef CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H +#define CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H + +/*! \file + * Defintion of the Td_active_fictitious_vertex class. + */ + +#include +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) + * and two curve-ends(left,right). + * Trapezoids are represented as two curve-ends called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. + * There exist degenerate trapezoids called infinite trapezoid; this happens + * when one of the four sides is on the parameter space boundary. + * Trapezoids are created as active and become inactive when Remove() member + * function called. + * Each trapezoid has at most four neighbouring trapezoids. + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * edge-end (end point). + */ +template +class Td_active_fictitious_vertex : public Handle +{ +public: + + //type of traits class + typedef Td_traits_ Traits; + + //type of point (Point_2) + typedef typename Traits::Point Point; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Halfedge_around_vertex_const_circulator + typedef typename Traits::Halfedge_around_vertex_const_circulator + Halfedge_around_vertex_const_circulator; + + //type of Td_active_fictitious_vertex (Self) + typedef typename Traits::Td_active_fictitious_vertex Self; + + typedef typename Traits::Td_map_item Td_map_item; + + //type of Trapezoidal decomposition + typedef Trapezoidal_decomposition_2 TD; + + //type of In face iterator + typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + + //friend class declarations: + + friend class Trapezoidal_decomposition_2; + +#ifdef CGAL_PM_FRIEND_CLASS +#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) + friend class Trapezoidal_decomposition_2::In_face_iterator; +#elif defined(__GNUC__) + +#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))) + friend typename Trapezoidal_decomposition_2::In_face_iterator; +#else + friend class Trapezoidal_decomposition_2::In_face_iterator; +#endif + +#else + friend class In_face_iterator; +#endif +#endif + + /*! \class + * Inner class Data derived from Rep class + */ + class Data : public Rep + { + friend class Td_active_fictitious_vertex; + + public: + //c'tors + Data (Vertex_const_handle _v, + Halfedge_const_handle _cw_he, + Dag_node* _p_node) + : v(_v),cw_he(_cw_he),p_node(_p_node) + { } + + ~Data() { } + + protected: + Vertex_const_handle v; + Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock + Dag_node* p_node; + }; + + private: + + Data* ptr() const { return (Data*)(PTR); } + + Curve_end vtx_to_ce(Vertex_const_handle v) const + { + //the circulator is of incoming halfedges + Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); + //if the vertex is associated with a point on the bounded coords, + // we can take any incident halfedge. o/w if the vertex lies at infinity, + // it has 2 fictitious incident halfedges + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + + return Curve_end(he->curve(), + (he->direction() == ARR_RIGHT_TO_LEFT)? + ARR_MIN_END : ARR_MAX_END); + } + +#ifndef CGAL_TD_DEBUG +#ifdef CGAL_PM_FRIEND_CLASS + protected: +#else + public: // workaround +#endif +#else //CGAL_TD_DEBUG + public: +#endif //CGAL_TD_DEBUG + + + /*! Set the DAG node. */ + inline void set_dag_node(Dag_node* p) + { + ptr()->p_node = p; + } + + /*! Set the vertex handle (Vertex_const_handle). */ + inline void set_vertex(Vertex_const_handle v) + { + ptr()->v = v; + } + + /*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */ + inline void set_cw_he(Halfedge_const_handle he) + { + if (cw_he() != Traits::empty_he_handle() && + cw_he()->direction() != he->direction()) + { + ptr()->cw_he = he->twin(); + } + else + { + ptr()->cw_he = he; + } + } + + + public: + + /// \name Constructors. + //@{ + + Td_active_fictitious_vertex () + { + PTR = new Data + (Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL); + } + + /*! Constructor given Vertex & Halfedge handles. */ + Td_active_fictitious_vertex (Vertex_const_handle v, + Halfedge_const_handle cw_he, + Dag_node* node = 0) + + + { + PTR = new Data(v, cw_he, node); + } + + + /*! Copy constructor. */ + Td_active_fictitious_vertex (const Self& tr) : Handle(tr) + { + } + + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) + */ + inline Self& operator= (const Self& t2) + { + Handle::operator=(t2); + return *this; + } + + /*! Operator==. */ + inline bool operator== (const Self& t2) const + { + return (ptr() == t2.ptr()); + } + + /*! Operator!=. */ + inline bool operator!= (const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + inline Self& self() + { + return *this; + } + + inline const Self& self() const + { + return *this; + } + + /*! Access the trapezoid id (PTR). */ + inline unsigned long id() const + { + return (unsigned long) PTR; + } + + /*! Access trapezoid left. + * filters out the infinite case which returns predefined dummy values + */ + inline Vertex_const_handle vertex() const + { + return ptr()->v; + } + + Curve_end curve_end() const + { + return vtx_to_ce(vertex()); + } + + /*! Access the first he starting at 12 o'clock clockwise. + */ + inline Halfedge_const_handle cw_he () const + { + return ptr()->cw_he; + } + + + /*! Access DAG node. */ + Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;} + + + //@} + + + + + +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h new file mode 100644 index 00000000000..2eb41f82b00 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -0,0 +1,429 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +//trapezoid +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h $ +// $Id: Td_active_trapezoid.h 65793 2011-10-10 17:04:38Z balasmic $ +// +// +// Author(s) : Oren Nechushtan +// updated by: Michal Balas + +#ifndef CGAL_TD_ACTIVE_TRAPEZOID_H +#define CGAL_TD_ACTIVE_TRAPEZOID_H + +/*! \file + * Defintion of the Td_active_trapezoid class. + */ + +#include +#include + +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + * Implementation of an active trapezoid as two halfedges(top,bottom) + * and two vertices(left,right). + * Trapezoids are represented as two vertices called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. + * There exist degenerate trapezoids called infinite trapezoid; this happens + * when one of the four sides is on the parameter space boundary. + * Each trapezoid has at most four neighbouring trapezoids. + */ +template +class Td_active_trapezoid : public Handle +{ +public: + + //type of traits class + typedef Td_traits_ Traits; + + //type of point (Point_2) + typedef typename Traits::Point Point; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Td_active_trapezoid (Self) + typedef typename Traits::Td_active_trapezoid Self; + + typedef typename Traits::Td_map_item Td_map_item; + + //type of Trapezoidal decomposition + typedef Trapezoidal_decomposition_2 TD; + + //type of In face iterator + typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + //friend class declarations: + + friend class Trapezoidal_decomposition_2; + +#ifdef CGAL_PM_FRIEND_CLASS +#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) + friend class Trapezoidal_decomposition_2::In_face_iterator; +#elif defined(__GNUC__) + +#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))) + friend typename Trapezoidal_decomposition_2::In_face_iterator; +#else + friend class Trapezoidal_decomposition_2::In_face_iterator; +#endif + +#else + friend class In_face_iterator; +#endif +#endif + + protected: + + /*! \class + * Inner class Data derived from Rep class + */ + class Data : public Rep + { + friend class Td_active_trapezoid; + + public: + //c'tors + Data (Vertex_const_handle _left_v, + Vertex_const_handle _right_v, + Halfedge_const_handle _bottom_he, + Halfedge_const_handle _top_he, + const Td_map_item& _lb, + const Td_map_item& _lt, + const Td_map_item& _rb, + const Td_map_item& _rt, + Dag_node* _p_node) + : left_v(_left_v), right_v(_right_v), + bottom_he(_bottom_he), top_he(_top_he), + lb(_lb), lt(_lt), rb(_rb), rt(_rt), p_node(_p_node) + { } + + ~Data() { } + + protected: + Vertex_const_handle left_v; + Vertex_const_handle right_v; + Halfedge_const_handle bottom_he; + Halfedge_const_handle top_he; + Td_map_item lb; + Td_map_item lt; + Td_map_item rb; + Td_map_item rt; + Dag_node* p_node; + }; + + private: + + Data* ptr() const { return (Data*)(PTR); } + +#ifndef CGAL_TD_DEBUG +#ifdef CGAL_PM_FRIEND_CLASS +protected: +#else +public: // workaround +#endif +#else //CGAL_TD_DEBUG +public: +#endif //CGAL_TD_DEBUG + + //Dag_node* m_dag_node; //pointer to the search structure (DAG) node + + /*! Initialize the trapezoid's neighbours. */ + inline void init_neighbours(boost::optional lb, + boost::optional lt, + boost::optional rb, + boost::optional rt) + { + set_lb((lb) ? *lb : Td_map_item(0)); + set_lt((lt) ? *lt : Td_map_item(0)); + set_rb((rb) ? *rb : Td_map_item(0)); + set_rt((rt) ? *rt : Td_map_item(0)); + } + + /*! Set the DAG node. */ + inline void set_dag_node(Dag_node* p) + { + ptr()->p_node = p; +// m_dag_node = p; +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(!p || **p == *this); +// +//#endif + } + + /*! Set the trapezoid's left (Vertex_const_handle). */ + inline void set_left(Vertex_const_handle v) { ptr()->left_v = v; } + + /*! Set the trapezoid's right (Vertex_const_handle). */ + inline void set_right(Vertex_const_handle v) { ptr()->right_v = v; } + + /*! Set the trapezoid's bottom (Halfedge_const_handle). */ + inline void set_bottom(Halfedge_const_handle he) + { + if (!is_on_bottom_boundary() && (bottom()->direction() != he->direction())) + { + ptr()->bottom_he = he->twin(); + } + else + { + ptr()->bottom_he = he; + } + } + + /*! Set the trapezoid's top (Halfedge_const_handle). */ + inline void set_top(Halfedge_const_handle he) + { + if (!is_on_top_boundary() && (top()->direction() != he->direction())) + { + ptr()->top_he = he->twin(); + } + else + { + ptr()->top_he = he; + } + } + + + /*! Set left bottom neighbour. */ + inline void set_lb(const Td_map_item& lb) { ptr()->lb = lb; } + + /*! Set left top neighbour. */ + inline void set_lt(const Td_map_item& lt) { ptr()->lt = lt; } + + /*! Set right bottom neighbour. */ + inline void set_rb(const Td_map_item& rb) { ptr()->rb = rb; } + + /*! Set right top neighbour. */ + inline void set_rt(const Td_map_item& rt) { ptr()->rt = rt; } + + public: + + /// \name Constructors. + //@{ + + /*! Default constructor. */ + Td_active_trapezoid() + { + //define the initial trapezoid: left, right, btm, top are at infinity. + // has no neighbours + PTR = new Data(Traits::empty_vtx_handle(), + Traits::empty_vtx_handle(), + Traits::empty_he_handle(), + Traits::empty_he_handle(), + Td_map_item(0), Td_map_item(0) , + Td_map_item(0), Td_map_item(0), NULL); + + //m_dag_node = 0; + } + + /*! Constructor given Vertex & Halfedge handles. */ + Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r, + Halfedge_const_handle b, Halfedge_const_handle t, + boost::optional lb = boost::none, + boost::optional lt = boost::none, + boost::optional rb = boost::none, + boost::optional rt = boost::none, + Dag_node* node = 0) + { + PTR = new Data(l, r, b, t, (lb) ? *lb : Td_map_item(0), + (lt) ? *lt : Td_map_item(0), (rb) ? *rb : Td_map_item(0), + (rt) ? *rt : Td_map_item(0), node); + //m_dag_node = node; + } + + + /*! Copy constructor. */ + Td_active_trapezoid (const Self& tr) : Handle(tr) + { + //m_dag_node = tr.m_dag_node; + } + + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) + */ + inline Self& operator=(const Self& t2) + { + Handle::operator=(t2); + return *this; + } + + /*! Operator==. */ + inline bool operator==(const Self& t2) const + { + return (ptr() == t2.ptr()); + } + + /*! Operator!=. */ + inline bool operator!=(const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + inline Self& self() { return *this; } + + inline const Self& self() const { return *this; } + + /*! Access the trapezoid id (PTR). */ + inline unsigned long id() const { return (unsigned long) PTR; } + + /*! Access trapezoid left. + * filters out the infinite case which returns predefined dummy values + */ + inline Vertex_const_handle left() const { return ptr()->left_v; } + + /*! Access trapezoid right. + * filters out the infinite case which returns predefined dummy values + */ + inline Vertex_const_handle right() const { return ptr()->right_v; } + + /*! Access trapezoid bottom. + * filters out the infinite case which returns predefined dummy values + */ + inline Halfedge_const_handle bottom() const { return ptr()->bottom_he; } + + /*! Access trapezoid top. + * filters out the infinite case which returns predefined dummy values + */ + inline Halfedge_const_handle top() const { return ptr()->top_he; } + + /*! Access is on left boundary. */ + inline bool is_on_left_boundary() const + { return (left() == Traits::empty_vtx_handle()); } + + /*! Access is on right boundary. */ + inline bool is_on_right_boundary() const + { return (right() == Traits::empty_vtx_handle()); } + + /*! Access is on bottom boundary. */ + inline bool is_on_bottom_boundary() const + { return (bottom() == Traits::empty_he_handle()); } + + /*! Access is on top boundary. */ + inline bool is_on_top_boundary() const + { return (top() == Traits::empty_he_handle()); } + + /*! Access is on at least one boundary. */ + inline bool is_on_boundaries() const + { + return (is_on_left_boundary() || is_on_right_boundary() || + is_on_bottom_boundary() || is_on_top_boundary()); + } + + /*! Access left bottom neighbour. */ + Td_map_item& lb() const { return ptr()->lb; } + + /*! Access left top neighbour. */ + Td_map_item& lt() const { return ptr()->lt; } + + /*! Access right bottom neighbour. */ + Td_map_item& rb() const { return ptr()->rb; } + + /*! Access right top neighbour. */ + Td_map_item& rt() const { return ptr()->rt; } + + /*! Access DAG node. */ + Dag_node* dag_node() const {return ptr()->p_node; } + + void clear_neighbors() + { + set_lb(Td_map_item(0)); + set_lt(Td_map_item(0)); + set_rb(Td_map_item(0)); + set_rt(Td_map_item(0)); + } + + //@} + + + // Merge this trapezoid with the input trapezoid. + // Precondition: + // Both trapezoids are active and have the same bounding edges from + // above and below and the trapezoids are adjacent to one another + // with the first to the left. + // Postcondition: + // This trapezoid is the union of the old this trapezoid and the input + // trapezoid. + inline void merge_trapezoid(Self& right) + { + //precondition: the left trapezoid is not on the right boundary + CGAL_assertion(!is_on_right_boundary()); + + // bool on_right_boundary = right.is_on_right_boundary(); + + ptr()->left_v = left(); + ptr()->right_v = right.right(); + ptr()->bottom_he = bottom(); + ptr()->top_he = top(); + ptr()->lb = lb(); + ptr()->lt = lt(); + ptr()->rb = right.rb(); + ptr()->rt = right.rt(); + + Td_map_item item (*this); + + if (ptr()->rb.which() != 0) + { + Self tr(boost::get(rb())); + tr.set_lb(item); + } + if (ptr()->rt.which() != 0) + { + Self tr(boost::get(rt())); + tr.set_lt(item); + } + CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary()); + } +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h new file mode 100644 index 00000000000..1b3ac6bf7f7 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h @@ -0,0 +1,311 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h $ +// $Id: Td_active_vertex.h 65793 2011-10-10 17:04:38Z balasmic $ +// +// +// Author(s) : Oren Nechushtan +// updated by: Michal Balas + +#ifndef CGAL_TD_ACTIVE_VERTEX_H +#define CGAL_TD_ACTIVE_VERTEX_H + +/*! \file + * Defintion of the Td_active_vertex class. + */ + +#include +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) + * and two curve-ends(left,right). + * Trapezoids are represented as two curve-ends called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. + * There exist degenerate trapezoids called infinite trapezoid; this happens + * when one of the four sides is on the parameter space boundary. + * Trapezoids are created as active and become inactive when Remove() member + * function called. + * Each trapezoid has at most four neighbouring trapezoids. + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * edge-end (end point). + */ +template +class Td_active_vertex : public Handle +{ + public: + + //type of traits class + typedef Td_traits_ Traits; + + //type of point (Point_2) + typedef typename Traits::Point Point; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Halfedge_around_vertex_const_circulator + typedef typename Traits::Halfedge_around_vertex_const_circulator + Halfedge_around_vertex_const_circulator; + + //type of Td_active_vertex (Self) + typedef typename Traits::Td_active_vertex Self; + + typedef typename Traits::Td_map_item Td_map_item; + + //type of Trapezoidal decomposition + typedef Trapezoidal_decomposition_2 TD; + + //type of In face iterator + typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + + //friend class declarations: + + friend class Trapezoidal_decomposition_2; + +#ifdef CGAL_PM_FRIEND_CLASS +#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) + friend class Trapezoidal_decomposition_2::In_face_iterator; +#elif defined(__GNUC__) + +#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))) + friend typename Trapezoidal_decomposition_2::In_face_iterator; +#else + friend class Trapezoidal_decomposition_2::In_face_iterator; +#endif + +#else + friend class In_face_iterator; +#endif +#endif + + /*! \class + * Inner class Data derived from Rep class + */ + class Data : public Rep + { + friend class Td_active_vertex; + + public: + //c'tors + Data (Vertex_const_handle _v, + Halfedge_const_handle _cw_he, + Dag_node* _p_node) + : v(_v),cw_he(_cw_he),p_node(_p_node) + { } + + ~Data() { } + + protected: + Vertex_const_handle v; + Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock + Dag_node* p_node; + }; + + private: + + Data* ptr() const { return (Data*)(PTR); } + + Curve_end vtx_to_ce(Vertex_const_handle v) const + { + //the circulator is of incoming halfedges + Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); + //if the vertex is associated with a point on the bounded coords, + // we can take any incident halfedge. o/w if the vertex lies at infinity, + // it has 2 fictitious incident halfedges + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + + return Curve_end(he->curve(), + (he->direction() == ARR_RIGHT_TO_LEFT)? + ARR_MIN_END : ARR_MAX_END); + } + + +#ifndef CGAL_TD_DEBUG +#ifdef CGAL_PM_FRIEND_CLASS + protected: +#else + public: // workaround +#endif +#else //CGAL_TD_DEBUG + public: +#endif //CGAL_TD_DEBUG + + + + /*! Set the DAG node. */ + inline void set_dag_node(Dag_node* p) + { + ptr()->p_node = p; + } + + /*! Set the vertex handle (Vertex_const_handle). */ + inline void set_vertex(Vertex_const_handle v) + { + ptr()->v = v; + } + + /*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */ + inline void set_cw_he(Halfedge_const_handle he) + { + if (cw_he() != Traits::empty_he_handle() && + cw_he()->direction() != he->direction()) + { + ptr()->cw_he = he->twin(); + } + else + { + ptr()->cw_he = he; + } + } + + + public: + + /// \name Constructors. + //@{ + + Td_active_vertex () + { + PTR = new Data + (Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL); + } + + + /*! Constructor given Vertex & Halfedge handles. */ + Td_active_vertex (Vertex_const_handle v, + Halfedge_const_handle cw_he, + Dag_node* node = 0) + + { + PTR = new Data (v, cw_he, node); + } + + + /*! Copy constructor. */ + Td_active_vertex(const Self& tr) : Handle(tr) + { + } + + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) + */ + inline Self& operator= (const Self& t2) + { + Handle::operator=(t2); + return *this; + } + + /*! Operator==. */ + inline bool operator== (const Self& t2) const + { + return (ptr() == t2.ptr()); + } + + /*! Operator!=. */ + inline bool operator!= (const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + inline Self& self() + { + return *this; + } + + inline const Self& self() const + { + return *this; + } + + /*! Access the trapezoid id (PTR). */ + inline unsigned long id() const + { + return (unsigned long) PTR; + } + + inline Vertex_const_handle vertex() const + { + return ptr()->v; + } + + Curve_end curve_end() const + { + return vtx_to_ce(vertex()); + } + + inline const Point& point() const + { + return vertex()->point(); + } + + /*! Access the first he starting at 12 o'clock clockwise. + */ + inline Halfedge_const_handle cw_he () const + { + return ptr()->cw_he; + } + + /*! Access DAG node. */ + Dag_node* dag_node() const {return ptr()->p_node; } + + + //@} + + + + +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h new file mode 100644 index 00000000000..7e0237cb3a8 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag_node.h @@ -0,0 +1,582 @@ +// Author(s) : Michal Balas +// (based on old version by Iddo Hanniel & Oren Nechushtan) + +/* Directed acyclic binary graph template class */ + +#ifndef CGAL_TD_DAG_NODE_H +#define CGAL_TD_DAG_NODE_H + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +namespace CGAL { + +/*! \class + * Trapezoidal decomposition DAG node base class derived from Handle + */ +template +class Td_dag_node_base : public Handle +{ +protected: + void init() { PTR = 0; } //MICHAL: I think it is not used - so need to be removed + +public: + //c'tors + + Td_dag_node_base() { init(); } + + Td_dag_node_base(const Td_dag_node_base& x) : Handle(x) { } + + + //operators overloading + + Td_dag_node_base& operator=(const Td_dag_node_base & x) + { + Handle::operator=(x); + return *this; + } + + //bool operator!() const { return PTR == 0; } //MICHAL: maybe use ptr(), and also can change to is_null or something similar + bool is_null() const { return PTR == 0; } +protected: + Rep * ptr() const { return (Rep*) PTR; } + //Rep *& ptr() { return (Rep*) PTR; } + void set_ptr(Rep* rep) { PTR = rep; } + +}; + + + + +/*! \class + * Trapezoidal decomposition DAG node class derived from + * Td_dag_node_base class + */ +template +class Td_dag_node : public Td_dag_node_base +{ + +public: + //type of base class + typedef Td_dag_node_base Td_dag_node_handle; + typedef Td_dag_node_base Base; + + //type of Td_dag_node (Self) + typedef Td_dag_node Self; + + //type of td_map_item + typedef typename Traits::Td_map_item Td_map_item; + + //type of Td_active_trapezoid + typedef typename Traits::Td_active_trapezoid Td_active_trapezoid; + +#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2 + +public: + //using Td_dag_node_handle::PTR; + //using Td_dag_node_handle::operator!; + +#endif //CGAL_CFG_USING_BASE_MEMBER_BUG_2 + + + +protected: + + /*! \class + * Inner class Node derived from Rep class + */ + class Node : public Rep + { + friend class Td_dag_node; + + public: + + class clear_neighbors_visitor : public boost::static_visitor< void > + { + public: + void operator()(Td_active_trapezoid& t) const + { + t.clear_neighbors(); + } + + template < typename Tp > + void operator()(Tp& t) const + { + } + + }; + + //c'tors + Node(const Td_map_item& e,unsigned long depth=0) : + m_data(e), m_left_child(), m_right_child(), + m_depth(depth), m_visited(false) + {} + + Node(const Td_map_item& e, const Td_dag_node_handle& left, + const Td_dag_node_handle& right, unsigned long depth=0) : + m_data(e), m_left_child(left), m_right_child(right), + m_depth(depth), m_visited(false) + {} + + //d'tor + ~Node() + { + boost::apply_visitor(clear_neighbors_visitor(), m_data); + } + + bool is_inner_node() const //MICHAL: a node with only left child (like removed node) will be concidered as a leaf + { + //return !!m_left_child && !!m_right_child; + return (!m_left_child.is_null() && !m_right_child.is_null()); + } + + bool visited() const { return m_visited; } + + protected: + //protected data members + + //information stored in node + Td_map_item m_data; + + //left & right child nodes + Td_dag_node_handle m_left_child; + Td_dag_node_handle m_right_child; + + //depth of the node in the DAG + mutable unsigned long m_depth; + + //visited flag for traversing the DAG + mutable bool m_visited; + }; + + + +public: + //c'tors + + Td_dag_node() { } + + Td_dag_node(const Td_dag_node_handle& dag) : Td_dag_node_handle(dag) { } + + Td_dag_node(const Self& dag) : Td_dag_node_handle(dag) { } + + Td_dag_node(const Td_map_item& rootValue){ this->set_ptr(new Node(rootValue)); } + + Td_dag_node(const Td_map_item& rootValue, unsigned long depth) + { this->set_ptr(new Node(rootValue, depth)); } + + Td_dag_node(const Td_map_item& rootValue, const Self& left, const Self& right) + { + this->set_ptr(new Node( rootValue, left, right)); + depth_propagation(); + } + + Td_dag_node(const Td_map_item& rootValue, const Self& left, const Self& right, + unsigned long depth) + { + this->set_ptr(new Node( rootValue, left, right, depth)); + depth_propagation(); + } + + //d'tor + ~Td_dag_node() { } + + //information retrieval + + const Self& left_child() const + { + CGAL_precondition(!this->is_null()); + return *(const Self*)&this->node()->m_left_child; + } + + Self& left_child() + { + CGAL_precondition(!this->is_null()); + return (Self &)this->node()->m_left_child; + } + + const Self& right_child() const + { + CGAL_precondition(!this->is_null()); + return *(const Self*)&this->node()->m_right_child; + } + + Self& right_child() + { + CGAL_precondition(!this->is_null()); + return (Self &)this->node()->m_right_child; + } + + Td_map_item& get_data() const + { + CGAL_precondition(!this->is_null()); + return node()->m_data; + } + + Td_map_item& operator*() const + { + return this->get_data(); + } + + Td_map_item* data_ptr() const + { + CGAL_precondition(!this->is_null()); + return &operator*(); + } + + Td_map_item* operator->() const + { + return this->data_ptr(); + } + + bool is_inner_node() const + { + return !this->is_null() && this->node()->is_inner_node(); + } + + unsigned long size_inaccurate() const //exponential + { + init_visited(); + unsigned long res = recursive_size_inaccurate(); + init_visited(); + return res; + } + + unsigned long size() const + { + init_visited(); + unsigned long res = recursive_size(); + init_visited(); + return res; + } + + unsigned long rec_depth() const //exponential + { + init_visited(); + unsigned long res = recursive_depth(); + init_visited(); + return res; + } +#if 0 + unsigned long rec_check(unsigned long rec_bound) const //exponential + { + unsigned long res = recursive_check(1,rec_bound); + return res; + } +#endif //0 + unsigned long max_depth() const + { + init_visited(); + unsigned long res = rec_max_depth(); + init_visited(); + return res; + } + + const unsigned long& depth() const + { + return node()->m_depth; + } + + unsigned long& depth() + { + return node()->m_depth; + } + + bool operator==(const Self& b) const + { + return this->ptr() == b.ptr(); + } + + bool operator!=(const Self& b) const + { + return !operator==(b); + } + + //dynamic management: + + //Shallow copy + Self& operator=(const Self& b) + { + Handle::operator=(b); + return *this; + } + + void set_data(const Td_map_item& data) + { + if (!this->is_null()) + node()->m_data = data; + else + operator=(Self(data)); + } + + void set_left_child(Self& left) + { + CGAL_precondition(!this->is_null()); + node()->m_left_child = left; + if (left.depth() < depth()+1) + left.depth() = depth()+1; + left.depth_propagation(); + // does nothing if left is a leaf + } + + void set_right_child(Self& right) + { + CGAL_precondition(!this->is_null()); + node()->m_right_child = right; + if (right.depth() < depth()+1) + right.depth() = depth()+1; + right.depth_propagation(); + // does nothing if right is a leaf + } + + void replace(const Td_map_item& data, Self& left, Self& right) + { + set_data(data); + set_left_child(left); + set_right_child(right); + } + + // Td_dag implementation not thread safe! + void init_visited() const + { + if (this->is_null() || node()->m_visited == false) + return; + node()->m_visited = false; + left_child().init_visited(); + right_child().init_visited(); + } + + void visit_node() const + { + if (!this->is_null()) + node()->m_visited = true; + } + + /* -----output ---------------*/ +#ifdef CGAL_PRE_IN_POST_ORDER + + void preorder() const //exponential + { + if (!is_null()) + { + std::cout << operator*() << '\t'; + left_child().preorder(); + right_child().preorder(); + } + } + + void inorder() const //exponential + { + if (!is_null()) + { + left_child().inorder(); + std::cout << operator*() << '\t'; + right_child().inorder(); + } + } + + void postorder() const //exponential + { + if (!is_null()) + { + left_child().postorder(); + right_child().postorder(); + std::cout << operator*() << '\t'; + } + } + +#endif //CGAL_PRE_IN_POST_ORDER + + template + Container& filter(Container& c,const Predicate& pr) const + { + init_visited(); + Container& res = recursive_filter(c,pr); + init_visited(); + return res; + } + + + + +protected: + + // + //Propagating depth for left child & right child if they exist + // + void depth_propagation() //exponential + { + if (!is_inner_node()) + return; + + if (left_child().depth() < depth() + 1) + { + left_child().depth() = depth() + 1; + left_child().depth_propagation(); + } + if (right_child().depth() < depth() + 1) + { + right_child().depth() = depth() + 1; + right_child().depth_propagation(); + } + } + + unsigned long recursive_depth() const + { + if (this->is_null() || node()->visited()) + return 0; + return 1 + (std::max)(left_child().recursive_depth(), + right_child().recursive_depth()); + } +#if 0 + unsigned long recursive_check(unsigned long curr_rec_depth, unsigned long rec_bound) const + { + if (is_null()) + return 0; + //std::cout << curr_rec_depth << "," << std::flush; + if ( curr_rec_depth > rec_bound + 30) + { + std::cout << "passed " << rec_bound + 30 << ", stopping\n"; + return 0; + } + return 1 + (std::max)(left_child().recursive_check(curr_rec_depth + 1, rec_bound), + right_child().recursive_check(curr_rec_depth + 1, rec_bound)); + } +#endif //0 + + unsigned long rec_max_depth() const + { + if (this->is_null() || node()->visited()) + return 0; + visit_node(); + if (is_inner_node()) + return std::max(left_child().rec_max_depth(), + right_child().rec_max_depth()); + else + return depth(); + } + + unsigned long recursive_size_inaccurate() const + { + if (!this->is_null() && !node()->visited()) + return 1+ left_child().recursive_size_inaccurate() + right_child().recursive_size_inaccurate(); + return 0; + } + + unsigned long recursive_size() const + { + if (this->is_null() || node()->visited()) + return 0; + visit_node(); + return (1 + left_child().recursive_size() + right_child().recursive_size()); + } + + template + Container& recursive_filter(Container& c,const Predicate& pr) const + { + if (this->is_null() || node()->visited()) + return c; + if (pr(operator*())) + c.insert(c.end(),operator*()); + visit_node(); + left_child().recursive_filter(c, pr); + right_child().recursive_filter(c, pr); + return c; + } + +private: + + Node* node() const { return (Node*)Base::PTR; } + +}; + +/* +//io methods + +template +std::ostream& write (std::ostream& out, + const Td_dag_node& t, + const Traits& traits) +{ + static int depth; + int i; + if (!t.is_null()) + { + out << "\n"; + for(i=0; i"; + out << "Data="; + write(out,*t,traits); + { + depth++; + out << "\n"; + for(i=0; i"; + out << "left_child="; + write(out,t.left_child(),traits); + out << "\n"; + for(i=0; i"; + out << "right_child="; + write(out,t.right_child(),traits); + depth--; + } + } + else + { + out << "Empty"; + } + return out ; +} + +template +std::ostream& operator<< (std::ostream& out, + const Td_dag_node& t) +{ + static int depth; + int i; + if (!t.is_null()) + { + out << "\n"; + for(i=0; i"; + out << "Data=" << *t; + { + depth++; + out << "\n"; + for(i=0; i"; + out << "left_child=" << t.left_child(); + out << "\n"; + for(i=0; i"; + out << "right_child=" < +// updated by: Michal Balas + +#ifndef CGAL_TD_INACTIVE_EDGE_H +#define CGAL_TD_INACTIVE_EDGE_H + +/*! \file + * Defintion of the Td_inactive_edge class. + */ + +#include +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) + * and two curve-ends(left,right). + * Trapezoids are represented as two curve-ends called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. + * There exist degenerate trapezoids called infinite trapezoid; this happens + * when one of the four sides is on the parameter space boundary. + * Trapezoids are created as active and become inactive when Remove() member + * function called. + * Each trapezoid has at most four neighbouring trapezoids. + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * edge-end (end point). + */ +template +class Td_inactive_edge : public Handle +{ +public: + + //type of traits class + typedef Td_traits_ Traits; + + //type of point (Point_2) + typedef typename Traits::Point Point; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Td_inactive_edge (Self) + typedef typename Traits::Td_inactive_edge Self; + + typedef typename Traits::Td_map_item Td_map_item; + + //type of Trapezoidal decomposition + typedef Trapezoidal_decomposition_2 TD; + + //type of In face iterator + typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + + //friend class declarations: + + friend class Trapezoidal_decomposition_2; + +#ifdef CGAL_PM_FRIEND_CLASS +#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) + friend class Trapezoidal_decomposition_2::In_face_iterator; +#elif defined(__GNUC__) + +#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))) + friend typename Trapezoidal_decomposition_2::In_face_iterator; +#else + friend class Trapezoidal_decomposition_2::In_face_iterator; +#endif + +#else + friend class In_face_iterator; +#endif +#endif + + /*! \class + * Inner class Data derived from Rep class + */ + class Data : public Rep + { + friend class Td_inactive_edge; + + public: + //c'tors + Data (boost::shared_ptr& _cv, Dag_node* _p_node) + : cv(_cv), p_node(_p_node) //, lb(_lb),lt(_lt),rb(_rb),rt(_rt) + { } + + ~Data() { } + + protected: + boost::shared_ptr cv; + Dag_node* p_node; + }; + + private: + + Data* ptr() const { return (Data*)(PTR); } + + +#ifndef CGAL_TD_DEBUG +#ifdef CGAL_PM_FRIEND_CLASS + protected: +#else + public: // workaround +#endif +#else //CGAL_TD_DEBUG + public: +#endif //CGAL_TD_DEBUG + + /*! Set the DAG node. */ + inline void set_dag_node(Dag_node* p) + { + ptr()->p_node = p; + } + + /*! Set the x_monotone_curve_2 for removed edge degenerate trapezoid. */ + CGAL_TD_INLINE void set_curve(boost::shared_ptr& cv) + { + ptr()->cv = cv; + } + + public: + + /// \name Constructors. + //@{ + + /*! Constructor given Vertex & Halfedge handles. */ + Td_inactive_edge (boost::shared_ptr& cv, Dag_node* node = NULL) + { + PTR = new Data(cv,node); + } + + /*! Copy constructor. */ + Td_inactive_edge (const Self& tr) : Handle(tr) + { + } + + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) + */ + inline Self& operator= (const Self& t2) + { + Handle::operator=(t2); + return *this; + } + + /*! Operator==. */ + inline bool operator== (const Self& t2) const + { + return (ptr() == t2.ptr()); + } + + /*! Operator!=. */ + inline bool operator!= (const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + inline Self& self() + { + return *this; + } + + inline const Self& self() const + { + return *this; + } + + /*! Access the trapezoid id (PTR). */ + inline unsigned long id() const + { + return (unsigned long) PTR; + } + + inline X_monotone_curve_2& curve() const + { + X_monotone_curve_2* cv_ptr = (ptr()->cv).get(); + CGAL_assertion(cv_ptr != NULL); + return *cv_ptr; + } + + /*! Access DAG node. */ + Dag_node* dag_node() const {return ptr()->p_node; } + + + //@} + + + + +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h new file mode 100644 index 00000000000..fd72a5795e7 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h @@ -0,0 +1,275 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h $ +// $Id: Td_inactive_fictitious_vertex.h 65793 2011-10-10 17:04:38Z balasmic $ +// +// +// Author(s) : Oren Nechushtan +// updated by: Michal Balas + +#ifndef CGAL_TD_INACTIVE_FICTITIOUS_VERTEX_H +#define CGAL_TD_INACTIVE_FICTITIOUS_VERTEX_H + +/*! \file + * Defintion of the Td_inactive_fictitious_vertex class. + */ + +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) + * and two curve-ends(left,right). + * Trapezoids are represented as two curve-ends called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. + * There exist degenerate trapezoids called infinite trapezoid; this happens + * when one of the four sides is on the parameter space boundary. + * Trapezoids are created as active and become inactive when Remove() member + * function called. + * Each trapezoid has at most four neighbouring trapezoids. + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * edge-end (end point). + */ +template +class Td_inactive_fictitious_vertex : public Handle +{ +public: + + //type of traits class + typedef Td_traits_ Traits; + + //type of point (Point_2) + typedef typename Traits::Point Point; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Halfedge_around_vertex_const_circulator + typedef typename Traits::Halfedge_around_vertex_const_circulator + Halfedge_around_vertex_const_circulator; + + //type of Td_inactive_fictitious_vertex (Self) + typedef typename Traits::Td_inactive_fictitious_vertex Self; + + typedef typename Traits::Td_map_item Td_map_item; + + //type of Trapezoidal decomposition + typedef Trapezoidal_decomposition_2 TD; + + //type of In face iterator + typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + + //friend class declarations: + + friend class Trapezoidal_decomposition_2; + +#ifdef CGAL_PM_FRIEND_CLASS +#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) + friend class Trapezoidal_decomposition_2::In_face_iterator; +#elif defined(__GNUC__) + +#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))) + friend typename Trapezoidal_decomposition_2::In_face_iterator; +#else + friend class Trapezoidal_decomposition_2::In_face_iterator; +#endif + +#else + friend class In_face_iterator; +#endif +#endif + + /*! \class + * Inner class Data derived from Rep class + */ + class Data : public Rep + { + friend class Td_inactive_fictitious_vertex; + + public: + //c'tors + Data (const X_monotone_curve_2& _cv, + Arr_curve_end _ce, + Dag_node* _p_node): cv(_cv),ce(_ce),p_node(_p_node) + { } + + ~Data() { } + + protected: + X_monotone_curve_2 cv; + Arr_curve_end ce; + Dag_node* p_node; + }; + + private: + + Data* ptr() const { return (Data*)(PTR); } + + Curve_end vtx_to_ce(Vertex_const_handle v) const + { + //the circulator is of incoming halfedges + Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); + //if the vertex is associated with a point on the bounded coords, + // we can take any incident halfedge. o/w if the vertex lies at infinity, + // it has 2 fictitious incident halfedges + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + + return Curve_end(he->curve(), + (he->direction() == ARR_RIGHT_TO_LEFT)? + ARR_MIN_END : ARR_MAX_END); + } + +#ifndef CGAL_TD_DEBUG +#ifdef CGAL_PM_FRIEND_CLASS + protected: +#else + public: // workaround +#endif +#else //CGAL_TD_DEBUG + public: +#endif //CGAL_TD_DEBUG + + /*! Set the DAG node. */ + inline void set_dag_node(Dag_node* p) + { + ptr()->p_node = p; + } + + inline void set_curve_end(Vertex_const_handle v_before_rem) + { + Curve_end v_ce(vtx_to_ce(v_before_rem)); + ptr()->cv(v_ce.cv()); + ptr()->ce(v_ce.ce()); + } + + + + public: + + /// \name Constructors. + //@{ + + /*! Constructor given Vertex & Halfedge handles. */ + Td_inactive_fictitious_vertex (Vertex_const_handle v_before_rem, Dag_node* node = NULL) + { + Curve_end v_ce(vtx_to_ce(v_before_rem)); + + PTR = new Data( v_ce.cv(), v_ce.ce(), node); + + } + + /*! Copy constructor. */ + Td_inactive_fictitious_vertex (const Self& tr) : Handle(tr) + { + + } + + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) + */ + inline Self& operator= (const Self& t2) + { + Handle::operator=(t2); + return *this; + } + + /*! Operator==. */ + inline bool operator== (const Self& t2) const + { + return (ptr() == t2.ptr()); + } + + /*! Operator!=. */ + inline bool operator!= (const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + inline Self& self() + { + return *this; + } + + inline const Self& self() const + { + return *this; + } + + /*! Access the trapezoid id (PTR). */ + inline unsigned long id() const + { + return (unsigned long) PTR; + } + + + inline Curve_end curve_end() const + { + return Curve_end(ptr()->cv, ptr()->ce); + } + + + /*! Access DAG node. */ + Dag_node* dag_node() const + { + return ptr()->p_node; + } + + + //@} + + + + +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h new file mode 100644 index 00000000000..bef1d317b6a --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h @@ -0,0 +1,54 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_trapezoid.h $ +// $Id: Td_inactive_trapezoid.h 65793 2011-10-10 17:04:38Z balasmic $ +// +// +// Author(s) : Oren Nechushtan +// updated by: Michal Balas + +#ifndef CGAL_TD_INACTIVE_TRAPEZOID_H +#define CGAL_TD_INACTIVE_TRAPEZOID_H + +/*! \file + * Defintion of the Td_inactive_trapezoid class. + */ + +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + */ +class Td_inactive_trapezoid +{ +public: + /*! Operator==. */ + inline bool operator== (const Td_inactive_trapezoid& t2) const + { + return (this == &t2); + } +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h new file mode 100644 index 00000000000..99195e649d8 --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h @@ -0,0 +1,248 @@ +// Copyright (c) 2005,2006,2007,2009,2010,2011 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/branches/features/Arrangement_on_surface_2-RIC_pl_for_unbounded-balasmic/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h $ +// $Id: Td_inactive_vertex.h 65793 2011-10-10 17:04:38Z balasmic $ +// +// +// Author(s) : Oren Nechushtan +// updated by: Michal Balas + +#ifndef CGAL_TD_INACTIVE_VERTEX_H +#define CGAL_TD_INACTIVE_VERTEX_H + +/*! \file + * Defintion of the Td_inactive_vertex class. + */ + +#include +#include + + +#ifdef CGAL_TD_DEBUG +#define CGAL_TD_INLINE +#else +#define CGAL_TD_INLINE inline +#endif + +namespace CGAL { + +/*! \class + * Implementation of a pseudo-trapezoid as two halfedges(top,bottom) + * and two curve-ends(left,right). + * Trapezoids are represented as two curve-ends called right and left and + * two halfedges called top and bottom. The curve-ends (points) lie on the + * right and left boundaries of the trapezoid respectively and the halfedges + * bound the trapezoid from above and below. + * There exist degenerate trapezoids called infinite trapezoid; this happens + * when one of the four sides is on the parameter space boundary. + * Trapezoids are created as active and become inactive when Remove() member + * function called. + * Each trapezoid has at most four neighbouring trapezoids. + * X_trapezoid structure can represent a real trapezoid, a Td-edge or an + * edge-end (end point). + */ +template +class Td_inactive_vertex : public Handle +{ +public: + + //type of traits class + typedef Td_traits_ Traits; + + //type of point (Point_2) + typedef typename Traits::Point Point; + + //type of X_monotone_curve_2 + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of Halfedge_const_handle (trapezoid edge) + typedef typename Traits::Halfedge_const_handle Halfedge_const_handle; + + //type of Vertex_const_handle (trapezoid vertex) + typedef typename Traits::Vertex_const_handle Vertex_const_handle; + + //type of Td_inactive_vertex (Self) + typedef typename Traits::Td_inactive_vertex Self; + + typedef typename Traits::Td_map_item Td_map_item; + + //type of Trapezoidal decomposition + typedef Trapezoidal_decomposition_2 TD; + + //type of In face iterator + typedef typename TD::In_face_iterator In_face_iterator; + + //type of Trapezoidal map search structure + typedef typename TD::Dag_node Dag_node; + + + //friend class declarations: + + friend class Trapezoidal_decomposition_2; + +#ifdef CGAL_PM_FRIEND_CLASS +#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER) + friend class Trapezoidal_decomposition_2::In_face_iterator; +#elif defined(__GNUC__) + +#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))) + friend typename Trapezoidal_decomposition_2::In_face_iterator; +#else + friend class Trapezoidal_decomposition_2::In_face_iterator; +#endif + +#else + friend class In_face_iterator; +#endif +#endif + + /*! \class + * Inner class Data derived from Rep class + */ + class Data : public Rep + { + friend class Td_inactive_vertex; + + public: + //c'tors + Data (Point _p, Dag_node* _p_node): p(_p),p_node(_p_node) + { } + + ~Data() { } + + protected: + Point p; + Dag_node* p_node; + }; + + + private: + + Data* ptr() const { return (Data*)(PTR); } + + +#ifndef CGAL_TD_DEBUG +#ifdef CGAL_PM_FRIEND_CLASS + protected: +#else + public: // workaround +#endif +#else //CGAL_TD_DEBUG + public: +#endif //CGAL_TD_DEBUG + + + /*! Set the DAG node. */ + inline void set_dag_node(Dag_node* p) + { + ptr()->p_node = p; + } + + + inline void set_point(Vertex_const_handle v_before_rem) + { + ptr()->p = v_before_rem->point(); + } + + + public: + + /// \name Constructors. + //@{ + + /*! Constructor given Vertex & Halfedge handles. */ + Td_inactive_vertex (Vertex_const_handle v_before_rem, Dag_node* node = NULL) + { + PTR = new Data(v_before_rem->point(), node); + } + + + /*! Copy constructor. */ + Td_inactive_vertex (const Self& tr) : Handle(tr) + { + } + + //@} + + /// \name Operator overloading. + //@{ + + /*! Assignment operator. + * operator= should not copy m_dag_node (or otherwise update + * Dag_node::replace) + */ + inline Self& operator= (const Self& t2) + { + Handle::operator=(t2); + return *this; + } + + /*! Operator==. */ + inline bool operator== (const Self& t2) const + { + return (ptr() == t2.ptr()); + } + + /*! Operator!=. */ + inline bool operator!= (const Self& t2) const + { + return !(operator==(t2)); + } + + //@} + + + /// \name Access methods. + //@{ + + inline Self& self() + { + return *this; + } + + inline const Self& self() const + { + return *this; + } + + /*! Access the trapezoid id (PTR). */ + inline unsigned long id() const + { + return (unsigned long) PTR; + } + + inline Point& point() const + { + return ptr()->p; + } + + /*! Access DAG node. */ + Dag_node* dag_node() const + { + return ptr()->p_node; + } + + + //@} + + + +}; + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h index 0174b285f4e..1624f16f3be 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_predicates.h @@ -29,45 +29,45 @@ namespace CGAL { template < class Td_traits> class Trapezoidal_decomposition_2; -template -struct Td_active_trapezoid : public std::unary_function -{ - bool operator()(const X_trapezoid& tr) const - { - return tr.is_active(); - } -}; +////MICHAL: not in use +//template +//struct Td_active_map_item : public std::unary_function +//{ +// bool operator()(const map_item& item) const +// { +// return item.is_active(); +// } +//}; -template -struct Td_active_non_degenerate_trapezoid : -public std::unary_function -{ - Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {} - bool operator()(const X_trapezoid& tr) const - { - return tr.is_active() && !traits.is_degenerate(tr); - } -protected: - const Traits& traits; -}; +////MICHAL: not in use +//template +//struct Td_active_non_degenerate_trapezoid : +//public std::unary_function +//{ +// Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {} +// bool operator()(const X_trapezoid& tr) const +// { +// return tr.is_active() && !traits.is_degenerate(tr); +// } +//protected: +// const Traits& traits; +//}; -template -struct Td_active_right_degenerate_curve_trapezoid: - public std::unary_function +template +struct Td_active_edge_item: + public std::unary_function { - typedef const Traits& const_Traits_ref; - Td_active_right_degenerate_curve_trapezoid(const_Traits_ref t) : traits(t) {} - bool operator()(const X_trapezoid& tr) const + Td_active_edge_item(const Traits& t) : traits(t) {} + bool operator()(const map_item& item) const { - return tr.is_active() && traits.is_degenerate_curve(tr) && - !tr.right_bottom_neighbour(); + return traits.is_active(item) && traits.is_td_edge(item); } protected: const Traits& traits; }; template -struct Trapezoid_handle_less : public std::binary_function<_Tp, _Tp, bool> +struct Td_map_item_handle_less : public std::binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x->id() < __y->id(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h index 98bed0fda75..80c7eccc128 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits.h @@ -20,52 +20,874 @@ #ifndef CGAL_TD_TRAITS_H #define CGAL_TD_TRAITS_H -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace CGAL { -template class Td_traits : public Pm_traits_ +template +class Td_traits : public Pm_traits_ { public: - typedef Pm_traits_ Traits_base; - typedef X_curve_ X_curve; - typedef Td_traits Self; - typedef typename Traits_base::Point_2 Point; - typedef X_curve* X_curve_ptr; - typedef X_curve& X_curve_ref; - typedef const X_curve& X_curve_const_ref; - typedef Td_X_trapezoid X_trapezoid; - typedef X_trapezoid* X_trapezoid_ptr; - typedef X_trapezoid& X_trapezoid_ref; - typedef const X_trapezoid& X_trapezoid_const_ref; - - Td_traits(const Traits_base& t) - : Traits_base(t) + + //type of td map items type + enum Type { + NIL = 0, + TD_ACTIVE_TRAPEZOID, + TD_INACTIVE_TRAPEZOID, + TD_ACTIVE_EDGE, + TD_INACTIVE_EDGE, + TD_ACTIVE_VERTEX, + TD_ACTIVE_FICTITIOUS_VERTEX, + TD_INACTIVE_VERTEX, + TD_INACTIVE_FICTITIOUS_VERTEX + }; + + //! type of base class + typedef Pm_traits_ Traits_base; + + //! type of X_monotone_curve_2 + typedef typename Traits_base::X_monotone_curve_2 + X_monotone_curve_2; + + //! type of Arrangement_on_surface_2 + typedef Arrangement_ Arrangement_on_surface_2; + + //!type of Halfedge_handle + typedef typename Arrangement_on_surface_2::Halfedge_handle + Halfedge_handle; + //!type of Halfedge_const_handle + typedef typename Arrangement_on_surface_2::Halfedge_const_handle + Halfedge_const_handle; + //!type of Vertex_const_handle + typedef typename Arrangement_on_surface_2::Vertex_const_handle + Vertex_const_handle; + //!type of Halfedge_around_vertex_const_circulator + typedef typename + Arrangement_on_surface_2::Halfedge_around_vertex_const_circulator + Halfedge_around_vertex_const_circulator; + //!type of side tags + typedef typename Arrangement_on_surface_2::Left_side_category + Left_side_category; + typedef typename Arrangement_on_surface_2::Bottom_side_category + Bottom_side_category; + typedef typename Arrangement_on_surface_2::Top_side_category + Top_side_category; + typedef typename Arrangement_on_surface_2::Right_side_category + Right_side_category; + + //! myself + typedef Td_traits + Self; + //! type of point + typedef typename Traits_base::Point_2 Point; + + //! type of Td_active_trapezoid + typedef CGAL::Td_active_trapezoid Td_active_trapezoid; + + //! type of Td_inactive_trapezoid + typedef CGAL::Td_inactive_trapezoid Td_inactive_trapezoid; + + typedef int Td_nothing; + + //! type of Td_active_edge + typedef CGAL::Td_active_edge Td_active_edge; + + //! type of Td_inactive_edge + typedef CGAL::Td_inactive_edge Td_inactive_edge; + + //! type of Td_active_vertex + typedef CGAL::Td_active_vertex Td_active_vertex; + + //! type of Td_active_fictitious_vertex + typedef CGAL::Td_active_fictitious_vertex + Td_active_fictitious_vertex; + + //! type of Td_inactive_vertex + typedef CGAL::Td_inactive_vertex Td_inactive_vertex; + + //! type of Td_inactive_fictitious_vertex + typedef CGAL::Td_inactive_fictitious_vertex + Td_inactive_fictitious_vertex; + + //! type of td map item (Td_halfedge, Td_vertex or Td_trapezoid) + typedef boost::variant< Td_nothing, + Td_active_trapezoid, Td_inactive_trapezoid, + Td_active_edge, Td_inactive_edge, + Td_active_vertex, Td_active_fictitious_vertex, + Td_inactive_vertex, Td_inactive_fictitious_vertex > Td_map_item; + + //! type of Curve end pair + typedef std::pair + Curve_end_pair; + + + //!Curve_end class represents an X_monotone_curve_2 end + // (could be a point or an unbounded curve end) + // holds a pointer to the X_monotone_curve_2 and an indicator for the end (min/max) + class Curve_end + { + protected: + + //! pair of pointer to the X_monotone_curve_2 and an indicator + // for ARR_MIN_END or ARR_MAX_END + Curve_end_pair m_pair; + + public: + + //Constructor based on a Curve_end_pair + Curve_end(Curve_end_pair pr) : m_pair(pr) + { } + + //Constructor based on a Curve & a Curve-end + //Curve_end(const X_monotone_curve_2& cv, Arr_curve_end ce) : m_cv(cv), m_ce(ce) + Curve_end(const X_monotone_curve_2& cv, Arr_curve_end ce) + : m_pair(std::make_pair(&cv,ce)) + { } + + //Constructor based on a Halfedge & a Curve-end + //Curve_end(Halfedge_const_handle he, Arr_curve_end ce) : m_cv(he->curve()), m_ce(ce) + Curve_end(Halfedge_const_handle he, Arr_curve_end ce) + : m_pair(std::make_pair(&(he->curve()),ce)) + { } + + //access the X-monotone curve + const X_monotone_curve_2& cv() const { return *(m_pair.first); } + + //access the Curve-end + Arr_curve_end ce() const { return m_pair.second; } + + }; + + + /*! A functor that compares the x-coordinates of two edge ends + */ + class Compare_curve_end_x_2 { + protected: + typedef Traits_base Traits; + + /*! The traits (in case it has state) */ + const Traits* m_traits; + + /*! Constructor + * \param traits the traits (in case it has state) + * The constructor is declared private to allow only the functor + * obtaining function, which is a member of the nesting class, + * constructing it. + */ + Compare_curve_end_x_2(const Traits* traits) : m_traits(traits) {} + + //! Allow its functor obtaining function calling the private constructor. + friend class Td_traits; + + public: + + /*! + * Compare the x-coordinates of two edge ends. + * \param ee1 The first edge end + * \param ee2 The second edge end + * \return LARGER if x(ee1) > x(ee2); + * SMALLER if x(ee1) < x(ee2); + * EQUAL if x(ee1) = x(ee2). + */ + Comparison_result operator() (const Curve_end& ce1, + const Curve_end& ce2) const + { + Arr_parameter_space ce1_x_prm_spc = + m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()); + Arr_parameter_space ce1_y_prm_spc = + m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()); + Arr_parameter_space ce2_x_prm_spc = + m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()); + Arr_parameter_space ce2_y_prm_spc = + m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()); + + bool is_ce1_interior = (( ce1_x_prm_spc == ARR_INTERIOR) && + ( ce1_y_prm_spc == ARR_INTERIOR)); + bool is_ce2_interior = (( ce2_x_prm_spc == ARR_INTERIOR) && + ( ce2_y_prm_spc == ARR_INTERIOR)); + + //if both are interior + if (is_ce1_interior && is_ce2_interior) + { + return m_traits->compare_x_2_object() + ( ((ce1.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce1.cv()) : + m_traits->construct_max_vertex_2_object()(ce1.cv()) ), + ((ce2.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce2.cv()) : + m_traits->construct_max_vertex_2_object()(ce2.cv()) )); + } + + //if only ce1 is interior + if (is_ce1_interior) + return operator() + (((ce1.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce1.cv()) : + m_traits->construct_max_vertex_2_object()(ce1.cv()) ), + ce2); + + //if only ce2 is interior + if (is_ce2_interior) + return operator() + (ce1, + ((ce2.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce2.cv()) : + m_traits->construct_max_vertex_2_object()(ce2.cv()) )); + + //both are not interior: + + //if both are x-interior + // (then both are NOT y-interior, since both are not interior) + if ( (ce1_x_prm_spc == ARR_INTERIOR) && + (ce2_x_prm_spc == ARR_INTERIOR) ) + { + //both ce1 and ce2 are not y prm spc interior + Comparison_result res = m_traits->compare_x_at_limit_2_object() + (ce1.cv(),ce1.ce(), + ce2.cv(),ce2.ce()); + if (res != EQUAL) + return res; + //if equal need to compare near limit + + //if param space in y is not the same (one is top and one is bottom) + // the bottom is smaller than the top + if (ce1_y_prm_spc != ce2_y_prm_spc) + return (ce1_y_prm_spc == ARR_BOTTOM_BOUNDARY) ? SMALLER : LARGER; + + //if the Curve end is not the same the one with the MAX is smaller + if (ce1.ce() != ce2.ce()) + return (ce1.ce() == ARR_MIN_END) ? LARGER : SMALLER; + + //both have the same Curve end + return (m_traits->compare_x_near_limit_2_object() + (ce1.cv(),ce2.cv(),ce2.ce())); + } + + //not both are x-interior + + //set ind value according to the location : + // left-bndry = -1 + // interior = 0 + // right-bndry = 1 + // if (ind1 - ind2) ==0 ->EQUAL + // if (ind1 - ind2) < 0 ->SMALLER + // if (ind1 - ind2) > 0 ->LARGER + + int ind1 = (ce1_x_prm_spc == ARR_INTERIOR)? 0 + : ((ce1_x_prm_spc == ARR_LEFT_BOUNDARY) ? -1 : 1 ); + + int ind2 = (ce2_x_prm_spc == ARR_INTERIOR)? 0 + : ((ce2_x_prm_spc == ARR_LEFT_BOUNDARY) ? -1 : 1 ); + + int res = ind1 - ind2; + if (res == 0) + return EQUAL; + return ((res < 0) ? SMALLER : LARGER); + } + + /*! + * Compare the x-coordinates of a point and a curve end. + * \param p The point + * \param ce The curve end + * \return LARGER if x(p) > x(ce); + * SMALLER if x(p) < x(ce); + * EQUAL if x(p) = x(ce). + */ + Comparison_result operator() (const Point& p, + const Curve_end& ce) const + { + bool is_ce_interior = + ((m_traits->parameter_space_in_x_2_object() + (ce.cv(),ce.ce()) == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object() + (ce.cv(),ce.ce()) == ARR_INTERIOR)); + + //if curve end is interior + if (is_ce_interior) + { + return m_traits->compare_x_2_object() + ( p, + ((ce.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce.cv()) : + m_traits->construct_max_vertex_2_object()(ce.cv()) )); + } + + //if curve end is x-interior but not y-interior + if (m_traits->parameter_space_in_x_2_object() + (ce.cv(),ce.ce()) == ARR_INTERIOR) + { + //if curve end y prm space is not interior + return (m_traits->compare_x_at_limit_2_object() + (p,ce.cv(),ce.ce())); + } + + //if curve end is on the left or right boundaries + if (m_traits->parameter_space_in_x_2_object() + (ce.cv(),ce.ce()) == ARR_LEFT_BOUNDARY) + { + return LARGER; + } + return SMALLER; + } + + /*! + * Compare the x-coordinates of an curve end and a point + * \param ce The curve end + * \param p The point + * \return LARGER if x(ce) > x(p); + * SMALLER if x(ce) < x(p); + * EQUAL if x(ce) = x(p). + */ + Comparison_result operator() (const Curve_end& ce, + const Point& p) const + { + Comparison_result res = operator()(p, ce); + if (res == EQUAL) + return res; + return (res == LARGER) ? SMALLER : LARGER; + } + + }; + + /*! Obtain a Compare_y_at_x_2 functor object. */ + Compare_curve_end_x_2 compare_curve_end_x_2_object () const + { + return Compare_curve_end_x_2(this); } - Td_traits() + + + + /*! A functor that compares the y-coordinates of an edge end and a curve at + * the point x-coordinate + */ + class Compare_curve_end_y_at_x_2 { + + protected: + + typedef Td_traits Traits; + + /*! The traits (in case it has state) */ + const Traits* m_traits; + + /*! Constructor + * \param traits the traits (in case it has state) + * The constructor is declared private to allow only the functor + * obtaining function, which is a member of the nesting class, + * constructing it. + */ + Compare_curve_end_y_at_x_2(const Traits * traits) : m_traits(traits) {} + + //! Allow its functor obtaining function calling the private constructor. + friend class Td_traits; + + public: + + /*! + * Return the location of the given curve end with respect to the input + * Halfedge_const_handle. + * \param ce1 The curve end. + * \param he The Halfedge_const_handle. + * \pre ce1 is in the x-range of he. + * \return SMALLER if y(p) < cv(x(p)), i.e. the point is below the curve; + * LARGER if y(p) > cv(x(p)), i.e. the point is above the curve; + * EQUAL if p lies on the curve. + */ + Comparison_result operator() (const Curve_end& ce1, + Halfedge_const_handle he) const + { + CGAL_precondition_code(Halfedge_const_handle invalid_he); + CGAL_precondition(he != invalid_he); + return operator()(ce1,he->curve()); + } + + /*! + * Return the location of the given curve end with respect to the input cv. + * \param ce1 The curve end. + * \param cv The X_monotone_curve_2. + * \pre ce1 is in the x-range of cv. + * \return SMALLER if y(p) < cv(x(p)), i.e. the point is below the curve; + * LARGER if y(p) > cv(x(p)), i.e. the point is above the curve; + * EQUAL if p lies on the curve. + */ + Comparison_result operator() (const Curve_end& ce1, + const X_monotone_curve_2& cv2) const + { + //precondition: ce1 is in the x-range of cv2 + CGAL_precondition ( + (m_traits->compare_curve_end_x_2_object() + (ce1, Curve_end(cv2, ARR_MIN_END)) != SMALLER) + && + (m_traits->compare_curve_end_x_2_object() + (ce1, Curve_end(cv2, ARR_MAX_END)) != LARGER)); + + //get the curve end parameter space in x & y + Arr_parameter_space ce1_x_prm_spc = + m_traits->parameter_space_in_x_2_object()(ce1.cv(), ce1.ce()); + + Arr_parameter_space ce1_y_prm_spc = + m_traits->parameter_space_in_y_2_object()(ce1.cv(), ce1.ce()); + + + if (ce1_x_prm_spc != ARR_INTERIOR) + { + //assuming that the edge end is on the same boundary according to + // the precondition. + //comparing the curve that contains the given + // edge end and the curve cv2 + return m_traits->compare_y_near_boundary_2_object() + (ce1.cv(), cv2, ce1.ce()); + } + + //if ce1_x_prm_spc == ARR_INTERIOR + if (ce1_y_prm_spc == ARR_INTERIOR) + { + //ce1 is interior + return m_traits->compare_y_at_x_2_object() + (((ce1.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce1.cv()) : + m_traits->construct_max_vertex_2_object()(ce1.cv()) ), + cv2); + } + + //ce1 is an end point of a curve with a vertical asymptote. + + //if the other curve is also vertical or has a vertical asymptote + // at the x value of ep + + if ( ((m_traits->parameter_space_in_x_2_object() + (cv2, ARR_MIN_END) == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object() + (cv2, ARR_MIN_END) == ce1_y_prm_spc) && + (m_traits->compare_curve_end_x_2_object() + (ce1, Curve_end(cv2, ARR_MIN_END)) == EQUAL)) || + ((m_traits->parameter_space_in_x_2_object() + (cv2, ARR_MAX_END) == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object() + (cv2, ARR_MAX_END) == ce1_y_prm_spc) && + (m_traits->compare_curve_end_x_2_object() + (ce1, Curve_end(cv2, ARR_MAX_END)) == EQUAL)) ) + { + return EQUAL; + } + if (ce1_y_prm_spc == ARR_TOP_BOUNDARY) + return LARGER; + else //if ce1_y_prm_spc == ARR_BOTTOM_BOUNDARY + return SMALLER; + + + } + + }; + + /*! Obtain a Compare_y_at_x_2 functor object. */ + Compare_curve_end_y_at_x_2 compare_curve_end_y_at_x_2_object () const + { + return Compare_curve_end_y_at_x_2(this); } + + + class Equal_curve_end_2 + { + protected: + typedef Td_traits Traits; + + /*! The traits (in case it has state) */ + const Traits* m_traits; + const Traits_base* m_traits_base; //MICHAL: rational-upd + + /*! Constructor + * \param traits the traits (in case it has state) + * The constructor is declared private to allow only the functor + * obtaining function, which is a member of the nesting class, + * constructing it. + */ + //Equal_curve_end_2(const Traits* traits) : m_traits(traits) {}//MICHAL: rational-upd + Equal_curve_end_2(const Traits* traits) : m_traits(traits), m_traits_base(traits) {} + + //! Allow its functor obtaining function calling the private constructor. + friend class Td_traits; + + public: + + bool operator() (const Curve_end& ce1, + const Curve_end& ce2) const + { + //Kernel kernel; //MICHAL: rational-upd + + bool is_ce1_interior = + ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) + == ARR_INTERIOR)); + bool is_ce2_interior = + ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) + == ARR_INTERIOR)); + + if (is_ce1_interior && is_ce2_interior) //both edge-ends are interior + { + return m_traits_base->equal_2_object() + ( ((ce1.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce1.cv()) : + m_traits->construct_max_vertex_2_object()(ce1.cv()) ), + ((ce2.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce2.cv()) : + m_traits->construct_max_vertex_2_object()(ce2.cv()) )); + } + + + //at least one of the edge ends is on the parameter space boundaries + + //if not both are on the boundaries return false + if (is_ce1_interior || is_ce2_interior) + return false; + + //both are on the boundaries - so compare the edge ends + return ( m_traits->compare_curve_end_xy_2_object()(ce1,ce2) == EQUAL); + } + + bool operator() (const Point& p1, + const Point& p2) const + { + return m_traits_base->equal_2_object()(p1, p2); + } + + bool operator() (const Curve_end& ce, + const Point& p) const + { + return operator()(p, ce); + } + + bool operator() (const Point& p, + const Curve_end& ce) const + { + bool is_ce_interior = + ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce.cv(),ce.ce()) + == ARR_INTERIOR)); + + //if ce is on the parameter space boundaries - return false + // since p is interior + if (!is_ce_interior) + return false; + + //else - if ce is interior + return m_traits_base->equal_2_object() + ( p, + ((ce.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce.cv()) : + m_traits->construct_max_vertex_2_object()(ce.cv()) )); + } + + }; + + /*! Obtain an Equal_curve_end_2 functor object. */ + Equal_curve_end_2 equal_curve_end_2_object () const + { + return Equal_curve_end_2(this); + } + + /*! A functor that compares the coordinates of two edge ends */ + class Compare_curve_end_xy_2 + { + protected: + typedef Td_traits Traits; + + /*! The traits (in case it has state) */ + const Traits* m_traits; + + /*! Constructor + * \param traits the traits (in case it has state) + * The constructor is declared private to allow only the functor + * obtaining function, which is a member of the nesting class, + * constructing it. + */ + Compare_curve_end_xy_2(const Traits* traits) : m_traits(traits) {} + + //! Allow its functor obtaining function calling the private constructor. + friend class Td_traits; + + public: + /*! + * Compare two edge ends lexigoraphically: by x, then by y. + * \param cv1, cv1_end The first cv end. + * \param cv2, cv2_end The second cv end. + * \return LARGER if x(cv1-end) > x(cv2-end), + * or if x(cv1-end) = x(cv2-end) and y(cv1-end) > y(cv2-end); + * SMALLER if x(cv1-end) < x(cv2-end), + * or if x(cv1-end) = x(cv2-end) and y(cv1-end) < y(cv2-end); + * EQUAL if the two cv ends are equal. + */ + Comparison_result operator() (const Curve_end& ce1, + const Curve_end& ce2) const + { + Comparison_result res; + + bool is_ce1_interior = + ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) + == ARR_INTERIOR)); + bool is_ce2_interior = + ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) + == ARR_INTERIOR)); + + bool is_ce1_vertical = + ((m_traits->parameter_space_in_x_2_object()(ce1.cv(),ce1.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) + != ARR_INTERIOR)); + bool is_ce2_vertical = + ((m_traits->parameter_space_in_x_2_object()(ce2.cv(),ce2.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) + != ARR_INTERIOR)); + + //if the edge ends are parameter space interior on both x & y + if ( is_ce1_interior && is_ce2_interior ) + { + return m_traits->compare_xy_2_object() + ( ((ce1.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce1.cv()) : + m_traits->construct_max_vertex_2_object()(ce1.cv()) ), + ((ce2.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce2.cv()) : + m_traits->construct_max_vertex_2_object()(ce2.cv()) )); + } + + //at least one curve end is on the parameter space boundaries: + + //if the first curve end is interior + if ( is_ce1_interior ) + { + + //if the second curve end is of a curve with a vertical asymptote: + // x prm spc is interior, y prm spc is not interior + if ( is_ce2_vertical) + { + //res = m_traits->compare_x_near_boundary_2_object() + res = m_traits->compare_x_at_limit_2_object() + (((ce1.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce1.cv()) : + m_traits->construct_max_vertex_2_object()(ce1.cv()) ), + ce2.cv(), ce2.ce()); + + if (res != EQUAL) + return res; + else + return (m_traits->parameter_space_in_y_2_object() + (ce2.cv(),ce2.ce()) == ARR_TOP_BOUNDARY) ? SMALLER : LARGER; + } + else //the second curve end is of an unbounded cv which is not vertical + { + //we compare an interior curve end to a curve end on the left/right + // boundaries. the comparison is simply by the x-coord + return (ce2.ce() == ARR_MIN_END) ? LARGER : SMALLER; + } + + } + + //if the second curve end is interior + if ( is_ce2_interior ) + { + //if the first curve end is of a vertical line: + // x prm spc is interior, y prm spc is not interior + if ( is_ce1_vertical ) + { + //res = m_traits->compare_x_near_boundary_2_object() + res = m_traits->compare_x_at_limit_2_object() + ((( ce2.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()( ce2.cv()) : + m_traits->construct_max_vertex_2_object()( ce2.cv()) ), + ce1.cv(), ce1.ce()); + //need to return the opposite because the function recieved + // the curve ends in a reverse order + if (res != EQUAL) + return (res == SMALLER) ? LARGER : SMALLER; + else + return (m_traits->parameter_space_in_y_2_object() + (ce1.cv(),ce1.ce()) == ARR_TOP_BOUNDARY) ? LARGER : SMALLER; + } + else //the first curve end is of an unbounded cv which is not vertical + { + //we compare an interior curve end to an curve end on the left/right + // boundaries. the comparison is simply by the x-coord + return (ce1.ce() == ARR_MIN_END) ? SMALLER : LARGER; + } + + } + + //both curve ends are not interior + + //if both curve ends are of unbounded curves with a vertical asymptote + if ( is_ce1_vertical && is_ce2_vertical ) + { + Comparison_result res = m_traits->compare_x_at_limit_2_object() + (ce1.cv(),ce1.ce(), + ce2.cv(),ce2.ce()); + + if (res != EQUAL) + return res; + + //res == EQUAL + //if equal - need to compare near limit + + Arr_parameter_space ce1_y_prm_spc = + m_traits->parameter_space_in_y_2_object()(ce1.cv(),ce1.ce()) ; + Arr_parameter_space ce2_y_prm_spc = + m_traits->parameter_space_in_y_2_object()(ce2.cv(),ce2.ce()) ; + + //if param space in y is not the same (one is top and one is bottom) + // the bottom is smaller than the top + if (ce1_y_prm_spc != ce2_y_prm_spc) + return (ce1_y_prm_spc == ARR_BOTTOM_BOUNDARY) ? SMALLER : LARGER; + + //if the Curve end is not the same, the one with the MAX is smaller + if (ce1.ce() != ce2.ce()) + return (ce1.ce() == ARR_MIN_END) ? LARGER : SMALLER; + + //both have the same Curve end + return (m_traits->compare_x_near_limit_2_object() + (ce1.cv(),ce2.cv(),ce2.ce())); + } + + //if only the first curve end is of a curve with a vertical asymptote + if ( is_ce1_vertical ) + { + return (ce2.ce() == ARR_MIN_END) ? LARGER : SMALLER; + } + //if only the second curve end is of a curve with a vertical asymptote + if ( is_ce2_vertical ) + { + return (ce1.ce() == ARR_MIN_END) ? SMALLER : LARGER; + } + + //both curve ends are not of curves with a vertical asymptote: + + //if not both on left or both on right boundaries + if (ce1.ce() != ce2.ce()) + { + return (ce1.ce() == ARR_MIN_END) ? SMALLER : LARGER; + } + + //both on the same boundary, need to compare the y near the boundary + // (ce1.ce() == ce2.ce()) + return m_traits->compare_y_near_boundary_2_object() + (ce1.cv(), ce2.cv(), ce1.ce()); + } + + /*! + * Compare a point and a curve end lexigoraphically: by x, then by y. + * \param cv1, cv1_end The first cv end. + * \param cv2, cv2_end The second cv end. + * \return LARGER if x(p) > x(cv2-end), + * or if x(p) = x(cv2-end) and y(p) > y(cv2-end); + * SMALLER if x(p) < x(cv2-end), + * or if x(p) = x(cv2-end) and y(p) < y(cv2-end); + * EQUAL if the point and the cv end are equal. + */ + Comparison_result operator() (const Point& p, + const Curve_end& ce) const + { + Comparison_result res; + + bool is_ce_interior = + ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce.cv(),ce.ce()) + == ARR_INTERIOR)); + + bool is_ce_vertical = + ((m_traits->parameter_space_in_x_2_object()(ce.cv(),ce.ce()) + == ARR_INTERIOR) && + (m_traits->parameter_space_in_y_2_object()(ce.cv(),ce.ce()) + != ARR_INTERIOR)); + + //if the edge end is parameter space interior on both x & y + if ( is_ce_interior) + { + return m_traits->compare_xy_2_object() + ( p, + ((ce.ce() == ARR_MIN_END) ? + m_traits->construct_min_vertex_2_object()(ce.cv()) : + m_traits->construct_max_vertex_2_object()(ce.cv()) )); + } + + // edge end is on the parameter space boundaries: + + //if edge end is of a vertical line: + // x prm spc is interior, y prm spc is not interior + if ( is_ce_vertical) + { + res = m_traits->compare_x_at_limit_2_object() + (p, ce.cv(), ce.ce()); + + if (res != EQUAL) + return res; + else + return (m_traits->parameter_space_in_y_2_object() + (ce.cv(), ce.ce()) == ARR_TOP_BOUNDARY) ? SMALLER : LARGER; + } + else //edge end is of an unbounded cv which is not vertical + { + //we compare an interior point to an edge end on the left/right + // boundaries. the comparison is simply by the x-coord + return (ce.ce() == ARR_MIN_END) ? LARGER : SMALLER; + } + } + + Comparison_result operator() (const Curve_end& ce, + const Point& p) const + { + Comparison_result res = operator()(p,ce); + if (res == EQUAL) + return res; + return (res == SMALLER) ? LARGER : SMALLER; + } + + + Comparison_result operator() (const Point& p1, + const Point& p2) const + { + return m_traits->compare_xy_2_object()(p1,p2); + } + }; + + /*! Obtain a Compare_curve_end_xy_2 functor object. */ + Compare_curve_end_xy_2 compare_curve_end_xy_2_object () const + { + return Compare_curve_end_xy_2(this); + } + + + + + // Td_traits class ctors and dtor + + Td_traits(const Traits_base& t) : Traits_base(t) + { } + + Td_traits() + { } + ~Td_traits(void) { - if (POINT_AT_LEFT_TOP_INFINITY) { - delete POINT_AT_LEFT_TOP_INFINITY; - POINT_AT_LEFT_TOP_INFINITY = 0; - } - if (POINT_AT_RIGHT_BOTTOM_INFINITY) { - delete POINT_AT_RIGHT_BOTTOM_INFINITY; - POINT_AT_RIGHT_BOTTOM_INFINITY = 0; - } - if (CURVE_AT_INFINITY) { - delete CURVE_AT_INFINITY; - CURVE_AT_INFINITY = 0; - } } - -protected: - typedef X_trapezoid_const_ref const_ref; public: /* @@ -74,122 +896,262 @@ public: and planar, that is no two curves intersect in non degenerate curve. */ - inline bool curve_is_unbounded(const X_curve& cv) const { -/* compare curve with static unbounded curve */ - return cv.identical(CURVE_AT_INFINITY); - } - - inline bool trapezoid_bottom_curve_equal(X_trapezoid_const_ref left, - X_trapezoid_const_ref right) const - /* returns true if bottom curves of input are the same */ + /* returns true if bottom halfedges of input are the same */ + inline bool is_trpz_bottom_equal(Td_map_item& left_item, + Td_map_item& right_item) const { - if (left.is_bottom_unbounded()) - return (right.is_bottom_unbounded()); + CGAL_precondition(is_active(left_item) && is_active(right_item)); + CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item)); + + Td_active_trapezoid left (boost::get(left_item)); + Td_active_trapezoid right(boost::get(right_item)); + + if (left.is_on_bottom_boundary()) + return (right.is_on_bottom_boundary()); - if (right.is_bottom_unbounded()) + if (right.is_on_bottom_boundary()) return (false); - return (this->equal_2_object()(left.bottom(),right.bottom())); + return (left.bottom() == right.bottom() || + left.bottom()->twin() == right.bottom()); } - inline bool trapezoid_top_curve_equal(X_trapezoid_const_ref left, - X_trapezoid_const_ref right) const - /* returns true if top curves of input are the same */ + /* returns true if top halfedges of input are the same */ + inline bool is_trpz_top_equal(Td_map_item& left_item, + Td_map_item& right_item) const { - if (left.is_top_unbounded()) - return (right.is_top_unbounded()); + CGAL_precondition(is_active(left_item) && is_active(right_item)); + CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item)); - if (right.is_top_unbounded()) + Td_active_trapezoid left (boost::get(left_item)); + Td_active_trapezoid right(boost::get(right_item)); + + if (left.is_on_top_boundary()) + return (right.is_on_top_boundary()); + + if (right.is_on_top_boundary()) return (false); - return (this->equal_2_object()(left.top(),right.top())); + return (left.top() == right.top() || left.top()->twin() == right.top()); } - //returns true if the trapezoid is a point or a curve - bool is_degenerate(const_ref tr) const + /* returns true if bottom halfedges of input are the same */ + inline bool is_trapezoids_bottom_equal(const Td_active_trapezoid& left, + const Td_active_trapezoid& right) const { - return (is_degenerate_point(tr) || - (!tr.is_top_unbounded() && - !tr.is_bottom_unbounded() && - this->equal_2_object()(tr.bottom(),tr.top()))); - } + if (left.is_on_bottom_boundary()) + return (right.is_on_bottom_boundary()); - //returns true if the trapezoid is a point - bool is_degenerate_point(const_ref tr) const + if (right.is_on_bottom_boundary()) + return (false); + + return (left.bottom() == right.bottom() || + left.bottom()->twin() == right.bottom()); + } + + /* returns true if top halfedges of input are the same */ + inline bool is_trapezoids_top_equal(const Td_active_trapezoid& left, + const Td_active_trapezoid& right) const { - return (!tr.is_left_unbounded() && - !tr.is_right_unbounded() && - this->equal_2_object()(tr.left(),tr.right())); + if (left.is_on_top_boundary()) + return (right.is_on_top_boundary()); + + if (right.is_on_top_boundary()) + return (false); + + return (left.top() == right.top() || left.top()->twin() == right.top()); } //returns true if the trapezoid is a curve - bool is_degenerate_curve(const_ref tr) const + bool is_empty_item(const Td_map_item& tr) const { - return (!tr.is_top_unbounded() && - !tr.is_bottom_unbounded() && - this->equal_2_object()(tr.bottom(), tr.top()) && - !is_degenerate_point(tr)); + return (tr.which() == 0); + } + + //returns true if the trapezoid is a point or a curve + bool is_trapezoid(const Td_map_item& tr) const + { + switch (tr.which()) + { + case TD_ACTIVE_TRAPEZOID: + case TD_INACTIVE_TRAPEZOID: + return true; + default: + return false; + } + } + + //returns true if the map item is a vertex + bool is_td_vertex(const Td_map_item& tr) const + { + switch (tr.which()) + { + case TD_ACTIVE_VERTEX: + case TD_ACTIVE_FICTITIOUS_VERTEX: + case TD_INACTIVE_VERTEX: + case TD_INACTIVE_FICTITIOUS_VERTEX: + return true; + default: + return false; + } + } + + //returns true if the map item is an edge + bool is_td_edge(const Td_map_item& tr) const + { + switch (tr.which()) + { + case TD_ACTIVE_EDGE: + case TD_INACTIVE_EDGE: + return true; + default: + return false; + } + } + + //returns true if the map item is an edge + bool is_td_trapezoid(const Td_map_item& tr) const + { + switch (tr.which()) + { + case TD_ACTIVE_TRAPEZOID: + case TD_INACTIVE_TRAPEZOID: + return true; + default: + return false; + } + } + + //returns true if the trapezoid is a curve + bool is_fictitious_vertex(const Td_map_item& tr) const + { + switch (tr.which()) + { + case TD_ACTIVE_FICTITIOUS_VERTEX: + case TD_INACTIVE_FICTITIOUS_VERTEX: + return true; + default: + return false; + } + } + + //returns true if the trapezoid is a curve + bool is_active(const Td_map_item& tr) const + { + switch (tr.which()) + { + case TD_ACTIVE_TRAPEZOID: + case TD_ACTIVE_EDGE: + case TD_ACTIVE_VERTEX: + case TD_ACTIVE_FICTITIOUS_VERTEX: + return true; + default: + return false; + } } //returns true if the trapezoid is vertical - bool is_vertical(const_ref tr) const + bool is_vertical(Td_map_item& item) const { - return (!tr.is_left_unbounded() && - !tr.is_right_unbounded() && - (this->compare_x_2_object()(tr.left(),tr.right())== EQUAL)); + CGAL_precondition(is_td_edge(item)); + CGAL_precondition(is_active(item)); + //MICHAL: assumes item is of active edge item - also fails in case of a vertical asymptote + //MICHAL: check when this is used exactly + Td_active_edge& e (boost::get(item)); + Halfedge_const_handle he = e.halfedge(); + return (this->compare_curve_end_x_2_object() + (Curve_end(he,ARR_MIN_END), Curve_end(he,ARR_MAX_END))== EQUAL); } - /* Description: - returns whether point is inside trapezoid using lexicographic order */ - bool is_inside(const_ref tr,const Point& p) const + /* returns whether given edge end is inside the given trapezoid using + lexicographic order */ + bool is_inside (Td_map_item& item, const Curve_end& ce) const { + CGAL_precondition( is_active(item) ); + CGAL_precondition( is_td_trapezoid(item) ); + Td_active_trapezoid tr (boost::get(item)); + return - (tr.is_left_unbounded() || - (this->compare_xy_2_object()(tr.left(),p)==SMALLER)) && - (tr.is_right_unbounded() || - (this->compare_xy_2_object()(tr.right(),p)==LARGER)) && - (tr.is_bottom_unbounded() || - this->compare_y_at_x_2_object()(p, tr.bottom()) == LARGER) && - (tr.is_top_unbounded()|| - this->compare_y_at_x_2_object()(p, tr.top()) == SMALLER); + ( tr.is_on_left_boundary() || + (compare_curve_end_xy_2_object() + (vtx_to_ce(tr.left()),ce) == SMALLER) ) && + ( tr.is_on_right_boundary() || + (compare_curve_end_xy_2_object() + (vtx_to_ce(tr.right()),ce) == LARGER) ) && + ( tr.is_on_bottom_boundary() || + (compare_curve_end_y_at_x_2_object()(ce, tr.bottom()) == LARGER) ) && + ( tr.is_on_top_boundary() || + (compare_curve_end_y_at_x_2_object()(ce, tr.top()) == SMALLER) ); } - // returns true if the point is inside the closure of the trapezoid - // (inlcude all boundaries) - bool is_in_closure(const_ref tr,const Point& p) const + /*! returns true if the end point is inside the closure of the trapezoid + (inlcude all boundaries) */ + bool is_in_closure (const Td_active_trapezoid& tr, const Curve_end& ce ) const { // test left and right sides - if ((tr.is_left_unbounded()|| - !(this->compare_xy_2_object()(p,tr.left())==SMALLER)) && - (tr.is_right_unbounded()|| - !(this->compare_xy_2_object()(p,tr.right())==LARGER))) + if ((tr.is_on_left_boundary() || + (compare_curve_end_xy_2_object() + (ce,vtx_to_ce(tr.left())) != SMALLER)) && + (tr.is_on_right_boundary() || + (compare_curve_end_xy_2_object() + (ce,vtx_to_ce(tr.right())) != LARGER)) ) + { + // test bottom side + if (!tr.is_on_bottom_boundary() && + compare_curve_end_y_at_x_2_object()(ce,tr.bottom()) == SMALLER ) { - // test bottom side - if (!tr.is_bottom_unbounded()) - { - if (this->compare_y_at_x_2_object()(p, tr.bottom()) == SMALLER) - return false; - } - // test top side - if (!tr.is_top_unbounded()) - { - if (this->compare_y_at_x_2_object()(p, tr.top()) == LARGER) - return false; - } - return true; + return false; } + + // test top side + if (!tr.is_on_top_boundary() && + compare_curve_end_y_at_x_2_object()(ce,tr.top()) == LARGER) + { + return false; + } + + return true; + } return false; + } + /*! returns true if the end point is inside the closure of the trapezoid + (inlcude all boundaries) */ + bool is_in_closure (const Td_active_edge& e, const Curve_end& ce ) const + { + // test left and right sides + if (compare_curve_end_xy_2_object()(ce,Curve_end(e.halfedge(),ARR_MIN_END)) == SMALLER) + return false; + if (compare_curve_end_xy_2_object()(ce,Curve_end(e.halfedge(),ARR_MAX_END)) == LARGER) + return false; + return true; + } + + + Curve_end vtx_to_ce(Vertex_const_handle v) const + { + //the circulator is of incoming halfedges + Halfedge_around_vertex_const_circulator he = v->incident_halfedges(); + //if the vertex is associated with a point on the bounded coords, + // we can take any incident halfedge. o/w if the vertex lies at infinity, + // it has 2 fictitious incident halfedges + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he; + + return Curve_end(he->curve(), + (he->direction() == ARR_RIGHT_TO_LEFT)? + ARR_MIN_END : ARR_MAX_END); } - public: - static const Point& point_at_left_top_infinity(); - static const Point& point_at_right_bottom_infinity(); - static const X_curve& curve_at_infinity(); + + static Vertex_const_handle empty_vtx_handle() { return m_empty_vtx_handle; } + static Halfedge_const_handle empty_he_handle() { return m_empty_he_handle; } + private: - static Point * POINT_AT_LEFT_TOP_INFINITY; - static Point * POINT_AT_RIGHT_BOTTOM_INFINITY; - static X_curve * CURVE_AT_INFINITY; + + static Vertex_const_handle m_empty_vtx_handle; + static Halfedge_const_handle m_empty_he_handle; + }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits_functions.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits_functions.h index b615f65d541..fe8754ae5c1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits_functions.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_traits_functions.h @@ -23,58 +23,12 @@ namespace CGAL { -template -const typename Td_traits::Point& -Td_traits::point_at_left_top_infinity(){ - /* - static typename Td_traits::Point - Td_traits::POINT_AT_LEFT_TOP_INFINITY; - return Td_traits::POINT_AT_LEFT_TOP_INFINITY; - */ - // static Point POINT_AT_LEFT_TOP_INFINITY; - if (!POINT_AT_LEFT_TOP_INFINITY) - POINT_AT_LEFT_TOP_INFINITY = new Point(); - return *POINT_AT_LEFT_TOP_INFINITY; -} +template +typename Td_traits::Vertex_const_handle +Td_traits::m_empty_vtx_handle = Vertex_const_handle(); -template -const typename Td_traits::Point& -Td_traits::point_at_right_bottom_infinity(){ - /* - static typename Td_traits::Point - Td_traits::POINT_AT_RIGHT_BOTTOM_INFINITY; - return Td_traits::POINT_AT_RIGHT_BOTTOM_INFINITY; - */ - // static Point POINT_AT_RIGHT_BOTTOM_INFINITY; - if (!POINT_AT_RIGHT_BOTTOM_INFINITY) - POINT_AT_RIGHT_BOTTOM_INFINITY = new Point(); - return *POINT_AT_RIGHT_BOTTOM_INFINITY; -} - -template -const typename Td_traits::X_curve& -Td_traits::curve_at_infinity(){ - /* - static typename typename Traits::X_curveTraits::X_curve - Td_traits::CURVE_AT_INFINITY; - return Td_traits::CURVE_AT_INFINITY; - */ - // static X_curve CURVE_AT_INFINITY; - if (!CURVE_AT_INFINITY) - CURVE_AT_INFINITY = new X_curve(); - return *CURVE_AT_INFINITY; -} - -template -typename Td_traits::Point * -Td_traits::POINT_AT_LEFT_TOP_INFINITY = 0; - -template -typename Td_traits::Point * -Td_traits::POINT_AT_RIGHT_BOTTOM_INFINITY = 0; - -template -typename Td_traits::X_curve * -Td_traits::CURVE_AT_INFINITY = 0; +template +typename Td_traits::Halfedge_const_handle +Td_traits::m_empty_he_handle = Halfedge_const_handle(); } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index b1a5f479d83..9432e5a6912 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -22,10 +22,17 @@ #ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H #define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H +//#define CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION + +#include #include #include #include +#include +#include +#include + #include #include #include @@ -37,256 +44,320 @@ namespace CGAL { -#define CGAL_POINT_IS_LEFT_LOW(p,q) \ - (traits->compare_xy_2_object()((p),(q)) == SMALLER) -#define CGAL_POINT_IS_RIGHT_TOP(p,q) \ - (traits->compare_xy_2_object()((p),(q)) == LARGER) -#define CGAL_CURVE_IS_TO_RIGHT(cv,p) \ - (traits->equal_2_object()(traits->construct_min_vertex_2_object()((cv)), (p))) -#define CGAL_CURVE_COMPARE_Y_AT_X(p,cv) \ - (traits->compare_y_at_x_2_object()((p),(cv))) -/* ////////////////////////////////////////////////////////////////////////// - - class Trapezoidal_decomposition_2 - parameters Traits,X_curve - Description Implementation for a planar trapezoidal map also known as - trapezoidal decomposition and vertical decomposition. - - For requirements on Traits and X_curve classes see - Trapezoidal_decomposition_2 documentation. - - ////////////////////////////////////////////////////////////////////////// */ - +/*! \class Trapezoidal_decomposition_2 + * parameters Traits + * Description Implementation for a planar trapezoidal map also known as + * trapezoidal decomposition and vertical decomposition. + * + * For requirements on Traits and X_curve classes see + * Trapezoidal_decomposition_2 documentation. + */ template < class Td_traits> class Trapezoidal_decomposition_2 { public: - enum Locate_type {POINT=0,CURVE,TRAPEZOID,UNBOUNDED_TRAPEZOID=8} ; - class Base_trapezoid_iterator; + enum Locate_type { + POINT=0, + CURVE, + TRAPEZOID, + UNBOUNDED_TRAPEZOID=8 + }; + + //forward declarations & friend classes declarations + class Base_map_item_iterator; class In_face_iterator; friend class In_face_iterator; - class Around_point_circulator; - struct Unbounded {}; + + //type of trapezoidal decomposition traits typedef Td_traits Traits; - typedef const Traits& const_Traits_ref; - typedef const Traits* const_Traits_ptr; + + //type of the class itself typedef Trapezoidal_decomposition_2 Self; - typedef const Self& const_Self_ref; - typedef const Self* const_Self_ptr; + + //typedef of arrangement on surface + typedef typename Traits::Arrangement_on_surface_2 Arrangement_on_surface_2; + + //type of traits adaptor + typedef typename Traits::Arrangement_on_surface_2::Traits_adaptor_2 + Traits_adaptor_2; + + //type of point typedef typename Traits::Point Point; - typedef typename Traits::X_curve X_curve; - typedef typename Traits::X_curve_ptr curve_pointer; - typedef typename Traits::X_curve_ref curve_ref; - typedef typename Traits::X_curve_const_ref curve_const_ref; - typedef typename Traits::X_trapezoid X_trapezoid; - typedef typename Traits::X_trapezoid_ptr pointer; - typedef typename Traits::X_trapezoid_ref reference; - typedef typename Traits::X_trapezoid_const_ref const_ref; - typedef std::list list_container; - typedef std::vector vector_container; - typedef std::vector X_curve_container; - typedef In_face_iterator Iterator; - typedef class Base_trapezoid_iterator Base_trapezoid_circulator; - // friend class Td_traits::X_trapezoid; - typedef CGAL::Td_active_trapezoid Td_active_trapezoid; - typedef CGAL::Td_active_non_degenerate_trapezoid - Td_active_non_degenerate_trapezoid; - typedef CGAL::Td_active_right_degenerate_curve_trapezoid - Td_active_right_degenerate_curve_trapezoid; - typedef Td_dag< X_trapezoid> Data_structure; - typedef std::map map_nodes; - // typedef std::hash_map hash_map_tr_ptr; - typedef Trapezoid_handle_less Trapezoid_ptr_less; - typedef std::map - hash_map_tr_ptr; + //!type of Halfedge_handle + typedef typename Traits::Halfedge_handle + Halfedge_handle; + + //!type of Halfedge_const_handle + typedef typename Traits::Halfedge_const_handle + Halfedge_const_handle; - /* - * class Base_trapezoid_iterator + //!type of Vertex_const_handle + typedef typename Traits::Vertex_const_handle + Vertex_const_handle; + + //type of X_monotone_curve + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + + //type of Curve end: X_monotone_curve_2 ref & Arr_curve_end + typedef typename Traits::Curve_end Curve_end; + + //type of td_map_item + typedef typename Traits::Td_map_item Td_map_item; + + //type of Td_nothing + typedef typename Traits::Td_nothing Td_nothing; + + //type of Td_active_trapezoid + typedef typename Traits::Td_active_trapezoid Td_active_trapezoid; + + //type of Td_inactive_trapezoid + typedef typename Traits::Td_inactive_trapezoid Td_inactive_trapezoid; + + //type of Td_active_edge + typedef typename Traits::Td_active_edge Td_active_edge; + + //type of Td_inactive_edge + typedef typename Traits::Td_inactive_edge Td_inactive_edge; + + //type of Td_active_vertex + typedef typename Traits::Td_active_vertex Td_active_vertex; + + //type of Td_active_fictitious_vertex + typedef typename Traits::Td_active_fictitious_vertex + Td_active_fictitious_vertex; + + //type of Td_inactive_vertex + typedef typename Traits::Td_inactive_vertex Td_inactive_vertex; + + //type of Td_inactive_fictitious_vertex + typedef typename Traits::Td_inactive_fictitious_vertex + Td_inactive_fictitious_vertex; + + //type of Curve end pair + typedef typename Traits::Curve_end_pair Curve_end_pair; + + //type of Halfedge_const_handle-s' vector + typedef std::vector Halfedge_container; + + //predicates + //typedef CGAL::Td_active_map_item Td_active_map_item; + typedef CGAL::Td_active_edge_item Td_active_edge_item; + + //type of search structure DAG node + typedef Td_dag_node< Traits > Dag_node; + + //type of map of DAG nodes + typedef std::map< int,Dag_node > Nodes_map; + + //type of trapezoids comparison function - for the map + typedef Td_map_item_handle_less + Td_map_item_ptr_less; + + //type of trapezoids ptr map + typedef std::map + Td_map_item_ptr_map; + +public: + + /*! \class Base_map_item_iterator * member of Trapezoidal_decomposition_2 * Description Implements a basic Trapezoid iterator */ - - class Base_trapezoid_iterator + class Base_map_item_iterator { public: - Base_trapezoid_iterator() : traits(0),curr(0) {}; - Base_trapezoid_iterator(const_Traits_ptr traits_,pointer currt=0): - traits(traits_),curr(currt) {} - Base_trapezoid_iterator(const Base_trapezoid_iterator &it): - traits(it.traits),curr(it.curr){;} - Base_trapezoid_iterator & operator=(const Base_trapezoid_iterator &it) + //constructors + Base_map_item_iterator() : traits(0), m_cur_item(Td_map_item(0)){ } + + Base_map_item_iterator(const Traits* traits_, + boost::optional curr = boost::none) + :traits(traits_), m_cur_item((curr) ? *curr : Td_map_item(0) ) { } + + Base_map_item_iterator(const Base_map_item_iterator &it) + :traits(it.traits), m_cur_item(it.m_cur_item) { } + + //operator overloading + Base_map_item_iterator & operator=(const Base_map_item_iterator &it) { - traits=it.traits; - curr=it.curr; + traits = it.traits; + m_cur_item = it.m_cur_item; return *this; } - bool operator==(const Base_trapezoid_iterator &it) const + + bool operator==(const Base_map_item_iterator &it) const { - return (curr==it.curr ); + return (m_cur_item == it.m_cur_item); } - bool operator!=(const Base_trapezoid_iterator &it) const + + bool operator!=(const Base_map_item_iterator &it) const { return !operator==(it); } - reference operator*() const - { - CGAL_precondition(curr); - return *curr; - } - pointer operator->() const + Td_map_item& operator*() //const { - return curr; + CGAL_precondition(!traits->is_empty_item(m_cur_item)); + return m_cur_item; } + bool operator!() const { - return curr==0; + return traits->is_empty_item(m_cur_item);//!m_cur_item; } protected: - const_Traits_ptr traits; - pointer curr; + const Traits *traits; //pointer to the traits + Td_map_item m_cur_item; //the current map item (or none) }; - /* ********************************************************************* - - class In_face_iterator - member of Trapezoidal_decomposition_2 - Description Implements a Trapezoid iterator along a X_curve - - ********************************************************************* */ - - class In_face_iterator : public Base_trapezoid_iterator +/*! \class In_face_iterator + * member of Trapezoidal_decomposition_2 + * Derived from Base_map_item_iterator class + * Description Implements a Trapezoid iterator along a Halfedge + */ + class In_face_iterator : public Base_map_item_iterator { #ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2 - using Base_trapezoid_iterator::curr; - using Base_trapezoid_iterator::traits; + using Base_map_item_iterator::m_cur_item; + using Base_map_item_iterator::traits; #endif protected: - const X_curve& sep; + //reference to the seperating X_monotone_curve_2 + const X_monotone_curve_2& m_sep; public: - In_face_iterator(const_Traits_ptr traits_, - const X_curve& sepc,pointer currt=0) : - Base_trapezoid_iterator(traits_,currt),sep(sepc){} - In_face_iterator(const In_face_iterator &it) : - Base_trapezoid_iterator((Base_trapezoid_iterator&)it),sep(it.sep){} + //constructors + In_face_iterator(const Traits* traits_, Halfedge_const_handle sep, + boost::optional curr = boost::none) + :Base_map_item_iterator(traits_,curr), m_sep(sep->curve()) + { } + + In_face_iterator(const Traits* traits_, const X_monotone_curve_2& sep, + boost::optional curr = boost::none) + :Base_map_item_iterator(traits_,curr), m_sep(sep) + { } + + + In_face_iterator(const In_face_iterator &it) + :Base_map_item_iterator((Base_map_item_iterator&)it), + m_sep(it.m_sep) + { } + + //operatoror overloading bool operator==(const In_face_iterator &it) const { - return ( Base_trapezoid_iterator::operator==(it) && - traits->equal_2_object()(sep,it.sep) ); - + return ( Base_map_item_iterator::operator==(it) && + traits->equal_2_object()(m_sep,it.m_sep)); } /* destription: - advances curr to one of the right neighbours according to the relation - between the seperating X_curve and the right() trapezoid point. + advances m_cur_item to one of the right neighbours according to the relation + between the seperating Halfedge (m_sep) and the right() trapezoid point. precoditions: - sep doesn't intersect no existing edges except possibly on common end + m_sep doesn't intersect any existing edges except possibly on common end points. postconditions: - if the rightest trapezoid was traversed curr is set to NULL. + if the rightmost trapezoid was traversed m_cur_item is set to NULL. remark: if the seperator is vertical, using the precondition assumptions it - follows that - there is exactly one trapezoid to travel. + follows that there is exactly one trapezoid to travel. */ In_face_iterator& operator++() { - if (!curr) return *this;// end reached, do nothing! + if (traits->is_empty_item(m_cur_item)) + return *this;// end reached, do nothing! #ifndef CGAL_TD_DEBUG - - CGAL_warning(traits); - + CGAL_warning(traits != NULL); #else - - CGAL_assertion(traits); - + CGAL_assertion(traits != NULL); + CGAL_assertion(traits->is_active(m_cur_item)); + //m_cur_item should be a trapezoid or an edge + CGAL_assertion(!traits->is_td_vertex(m_cur_item)); #endif - Point right(curr->right()); - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(curr->is_active()); - CGAL_assertion(!traits->is_degenerate_point(*curr)); - -#endif - if (!traits->is_degenerate(*curr)) + if (traits->is_td_trapezoid(m_cur_item)) { -#ifndef NDEBUG + //if the map item is a trapezoid + Td_active_trapezoid tr (boost::get(m_cur_item)); + #ifndef CGAL_TD_DEBUG - CGAL_warning_code(Data_structure* tt=curr->get_node();) - CGAL_warning(!tt->is_inner_node()); + CGAL_warning_code(Dag_node* tt = tr.dag_node();) + CGAL_warning(!tt->is_inner_node()); #else - CGAL_assertion_code(Data_structure* tt=curr->get_node();) - CGAL_assertion(tt); + CGAL_assertion_code(Dag_node* tt = tr.dag_node();) + CGAL_assertion(tt); CGAL_assertion(!tt->is_inner_node()); -#endif #endif // handle degeneracies - if (!CGAL_POINT_IS_LEFT_LOW(curr->left(), - traits->construct_max_vertex_2_object()(sep))) - curr=0; + typename Traits::Compare_curve_end_xy_2 compare_xy = + traits->compare_curve_end_xy_2_object(); + if (compare_xy (traits->vtx_to_ce(tr.left()), + Curve_end(m_sep,ARR_MAX_END)) != SMALLER) + { + //if the trapezoid's left end point is equal to or larger from the + // max end of sep, we reached the end of the iterator + m_cur_item = Td_map_item(0); + } else { - switch(traits->compare_y_at_x_2_object()(right, sep)) + //if the trapezoid's left end point is smaller from the sep's max end + + //comparing the y value of the trapezoid's right end point and sep + // (at the trapezoid's right x value), in order to select the + // next trapezoid in the iterator + typename Traits::Compare_curve_end_y_at_x_2 compare_y_at_x = + traits->compare_curve_end_y_at_x_2_object(); + switch (compare_y_at_x (traits->vtx_to_ce(tr.right()), m_sep)) { case SMALLER: - curr = curr->right_top_neighbour(); + m_cur_item = tr.rt(); break; case LARGER: - curr = curr->right_bottom_neighbour(); + m_cur_item = tr.rb(); break; case EQUAL: // end reached - curr=0; + m_cur_item = Td_map_item(0); break; default: - curr=0; + m_cur_item = Td_map_item(0); break; } } } - else // pass along degenerate X_curve. + else { -#ifndef NDEBUG -#ifndef CGAL_TD_DEBUG - - CGAL_warning_code(Data_structure* tt=curr->get_node();) - CGAL_warning(tt); - CGAL_warning(tt->is_inner_node()); - -#else + //if the map item is an edge - CGAL_assertion_code(Data_structure* tt=curr->get_node();) - CGAL_assertion(tt); + Td_active_edge e (boost::get(m_cur_item)); + CGAL_assertion_code(Dag_node* tt = e.dag_node();) + CGAL_assertion(tt != NULL); CGAL_assertion(tt->is_inner_node()); -#endif -#endif - - curr=curr->right_bottom_neighbour(); - if (curr) + + //go to next() of the current edge. + // as long as there is an edge fragment of the same + // edge - next() exists. + // If next() does not exist we reached the last fragment of the edge + m_cur_item = e.next(); + if (!traits->is_empty_item(m_cur_item)) { - while(traits->is_degenerate_point(*curr)) - curr=curr->get_node()->left().operator->(); - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(traits->is_degenerate_curve(*curr)); - -#else - - CGAL_precondition(traits->is_degenerate_curve(*curr)); - -#endif + //if next() exists, find the next real edge fragment trapezoid + // (skip points) + while(traits->is_td_vertex(m_cur_item)) + { + Dag_node* node = + boost::apply_visitor(dag_node_visitor(),m_cur_item); + m_cur_item = node->left_child().get_data(); + } + //make sure we stopped in an edge + CGAL_warning(traits->is_td_edge(m_cur_item)); } } return *this; @@ -298,2043 +369,1187 @@ public: ++*this; return tmp; } - const X_curve& seperator() + + const X_monotone_curve_2& seperator() { - return sep; + return m_sep; } + + Td_active_trapezoid& trp() + { + CGAL_precondition (!traits->is_empty_item(m_cur_item)); + CGAL_precondition (traits->is_active(m_cur_item) && + traits->is_td_trapezoid(m_cur_item)); + return boost::get(m_cur_item); + } + + Td_active_edge& e() + { + CGAL_precondition (!traits->is_empty_item(m_cur_item)); + CGAL_precondition (traits->is_active(m_cur_item) && + traits->is_td_edge(m_cur_item)); + return boost::get(m_cur_item); + } + }; - /* - * class Around_point_circulator - * member of Trapezoidal_decomposition_2 - * Description Implements a Trapezoid circulator around a point - */ - class Around_point_circulator : public Base_trapezoid_circulator + /*! Visitors for accessing td map items methods */ + class rb_visitor : public boost::static_visitor { - -#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2 - using Base_trapezoid_circulator::curr; - using Base_trapezoid_circulator::traits; -#endif - - protected: - const Point& fixed; public: - -#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2 - using Base_trapezoid_circulator::operator!; -#endif - - Around_point_circulator(const_Traits_ptr traits_, const Point & fixedp, - pointer currt) : - Base_trapezoid_iterator(traits_,currt),fixed(fixedp) {}; - - Around_point_circulator(const Around_point_circulator &it) : - Base_trapezoid_iterator(it),fixed(it.fixed){}; - - Around_point_circulator &operator++() + Td_map_item operator()(Td_active_trapezoid& t) const { - if (operator!()) return *this; - -#ifndef CGAL_TD_DEBUG - - CGAL_warning((!curr->is_left_unbounded() && - traits->equal_2_object()(fixed,curr->left())) || - (!curr->is_right_unbounded() && - traits->equal_2_object()(fixed,curr->right()))); - -#else - - CGAL_precondition((!curr->is_left_unbounded() && - traits->equal_2_object()(fixed,curr->left())) || - (!curr->is_right_unbounded() && - traits->equal_2_object()(fixed,curr->right()))); - -#endif - - curr=operator->(); - return *this; - } - Around_point_circulator operator++(int) - { - Around_point_circulator tmp = *this; - ++*this; - return tmp; - } - pointer operator[](int i) const - { - Around_point_circulator c=*this; - while(i-->0) c++; - return c.curr; - } - /* returns reference to the next trapezoid - on a clockwise orientation rotation with centre - taken as the fixed point - preconditions: - ciruclator is not empty*/ - reference operator*() const - { - CGAL_precondition(!operator!()); - return *operator->(); - } - /* returns pointer to the next trapezoid - on a clockwise orientation rotation with centre - taken as the fixed point */ - pointer operator->() const - { - pointer cand; - if (operator!()) return curr; - cand=is_right_rotation() ? - curr->right_top_neighbour() : curr->left_bottom_neighbour(); - if (traits->is_degenerate_curve(*cand)) return cand; - // cand was splited by a point - while(traits->is_degenerate_point(*cand)) - cand=CGAL_POINT_IS_LEFT_LOW(cand->left(),fixed)? - // move right using data structure - cand->get_node()->right().operator->(): - // move left using data structure - cand->get_node()->left().operator->(); - return cand; - } - - bool is_valid() const - { - if ((!curr)|| - (!curr->is_left_unbounded() && - traits->equal_2_object()(fixed,curr->left())) || - (!curr->is_right_unbounded() && - traits->equal_2_object()(fixed,curr->right()))) { - return true; - } - else { -#ifdef CGAL_TD_DEBUG - std::cerr << "\nthis="; - write(std::cerr,*curr,*traits,false) << std::flush; - std::cerr << "\nfixed=" << fixed << std::flush; - CGAL_warning(!(curr && curr->is_left_unbounded() && - curr->is_right_unbounded())); -#endif - return false; - } + return t.rb(); } - /* description: - inserts the input trapezoid between the - current trapezoid and the next trapezoid - on a clockwise orientation rotation with - centre taken as the fixed point. - preconditions: - current trapezoid exist - input trapezoid is adjacent to fixed point - */ - void insert(reference tr) + template < typename T > + Td_map_item operator()(T& t) const { -#ifndef CGAL_TD_DEBUG - - CGAL_precondition(curr); - CGAL_warning((!tr.is_left_unbounded() && - traits->equal_2_object()(tr.left(), fixed)) || - (!tr.is_right_unbounded() && - traits->equal_2_object()(tr.right(), fixed))); - -#else - - CGAL_precondition(curr); - CGAL_precondition((!tr.is_left_unbounded() && - traits->equal_2_object()(tr.left(),fixed)) || - (!tr.is_right_unbounded() && - traits->equal_2_object()(tr.right(),fixed))); - -#endif - if (!tr.is_left_unbounded() && - traits->equal_2_object()(tr.left(),fixed)) - tr.set_lb(operator->()); - else - tr.set_rt(operator->()); - if (is_right_rotation()) - curr->set_rt(&tr); - else - curr->set_lb(&tr); - } - /* precondition: - curr!=NULL - */ - void remove() - { - -#ifndef CGAL_TD_DEBUG - - CGAL_precondition(curr); - CGAL_warning( ( !curr->is_left_unbounded() && - traits->equal_2_object()(curr->left(), fixed) ) || - ( !curr->is_right_unbounded() && - traits->equal_2_object()(curr->right(), fixed) ) ); - -#else - - CGAL_precondition(curr); - CGAL_warning( ( !curr->is_left_unbounded() && - traits->equal_2_object()(curr->left(),fixed) ) || - ( !curr->is_right_unbounded() && - traits->equal_2_object()(curr->right(),fixed) ) ); - -#endif - - Around_point_circulator old=*this; - old++; - pointer next=old.operator->(); - // handle 1-cycle and 2-cycles seperately - if (curr!=next) - { - } - // 2-cycle - else if (*this!=old) - { - next=curr; - } - // 1-cycle - else - { - if (is_right_rotation()) - curr->set_rt(0); - else - curr->set_lb(0); - curr=0; - return; - } - if (is_right_rotation()) - curr->set_rt(next); - else - curr->set_lb(next); - if (old.is_right_rotation()) - old[0]->set_rt(0); - else - old[0]->set_lb(0); - } - void replace(reference tr) - { - -#ifndef CGAL_TD_DEBUG - - CGAL_precondition(curr); - CGAL_warning((!curr->is_left_unbounded() && - traits->equal_2_object()(curr->left(),fixed)) || - (!curr->is_right_unbounded() && - traits->equal_2_object()(curr->right(),fixed))); - -#else - - CGAL_precondition(curr); - CGAL_precondition((!curr->is_left_unbounded() && - traits->equal_2_object()(curr->left(),fixed)) || - (!curr->is_right_unbounded() && - traits->equal_2_object()(curr->right(),fixed))); - -#endif - - Around_point_circulator old=*this; - old++; - pointer next=old.operator->(); - // handle 1-cycle and 2-cycles seperately - if (curr!=next) - { - } - // 2-cycle - else if (*this!=old) - { - next=curr; - } - // 1-cycle - else - { - curr=&tr; - if (is_right_rotation()) - curr->set_rt(curr); - else - curr->set_lb(curr); - return; - } - if (!tr.is_right_unbounded()&&traits->equal_2_object()(tr.right(),fixed)) - tr.set_rt(next); - else - tr.set_lb(next); - if (is_right_rotation()) - curr->set_rt(&tr); - else - curr->set_lb(&tr); - } - bool is_right_rotation() const - { - return !curr->is_right_unbounded() && - traits->equal_2_object()(curr->right(),fixed); - } - const Point& fixed_point() const - { - return fixed; + CGAL_assertion(false); + return Td_map_item(0); } }; + + class set_rb_visitor : public boost::static_visitor + { + public: + set_rb_visitor (const Td_map_item& rb) : m_rb(rb) {} + + + void operator()(Td_active_trapezoid& t) const + { + t.set_rb(m_rb); + } + + template < typename T > + void operator()(T& t) const + { + CGAL_assertion(false); + } + + private: + const Td_map_item& m_rb; + }; + + class rt_visitor : public boost::static_visitor + { + public: + Td_map_item operator()(Td_active_trapezoid& t) const + { + return t.rt(); + } + + template < typename T > + Td_map_item operator()(T& t) const + { + CGAL_assertion(false); + return Td_map_item(0); + } + }; + + class set_rt_visitor : public boost::static_visitor + { + public: + set_rt_visitor (const Td_map_item& rt) : m_rt(rt) {} + + void operator()(Td_active_trapezoid& t) const + { + t.set_rt(m_rt); + } + + template < typename T > + void operator()(T& t) const + { + CGAL_assertion(false); + } + + private: + const Td_map_item& m_rt; + }; + + class lb_visitor : public boost::static_visitor + { + public: + Td_map_item operator()(Td_active_trapezoid& t) const + { + return t.lb(); + } + + template < typename T > + Td_map_item operator()(T& t) const + { + CGAL_assertion(false); + return Td_map_item(0); + } + }; + + class set_lb_visitor : public boost::static_visitor + { + public: + set_lb_visitor (const Td_map_item& lb) : m_lb(lb) {} + + void operator()(Td_active_trapezoid& t) const + { + return t.set_lb(m_lb); + } + + template < typename T > + void operator()(T& t) const + { + CGAL_assertion(false); + } + + private: + const Td_map_item& m_lb; + }; + + class set_lt_visitor : public boost::static_visitor + { + public: + set_lt_visitor (const Td_map_item& lt) : m_lt(lt) {} + + void operator()(Td_active_trapezoid& t) const + { + t.set_lt(m_lt); + } + + template < typename T > + void operator()(T& t) const + { + CGAL_assertion(false); + } + + private: + const Td_map_item& m_lt; + }; + + class bottom_he_visitor : public boost::static_visitor + { + public: + Halfedge_const_handle operator()(Td_active_trapezoid& t) const + { + return t.bottom(); + } + + template < typename T > + Halfedge_const_handle operator()(T& t) const + { + CGAL_assertion(false); + return Halfedge_const_handle(); + } + }; + + class set_bottom_he_visitor : public boost::static_visitor< void > + { + public: + set_bottom_he_visitor (Halfedge_const_handle he) : m_bottom_he(he) {} + + void operator()(Td_active_trapezoid& t) const + { + t.set_bottom(m_bottom_he); + } + + template < typename T > + void operator()(T& t) const + { + CGAL_assertion(false); + } + private: + Halfedge_const_handle m_bottom_he; + }; + + class top_he_visitor : public boost::static_visitor + { + public: + Halfedge_const_handle operator()(Td_active_trapezoid& t) const + { + return t.top(); + } + + template < typename T > + Halfedge_const_handle operator()(T& t) const + { + CGAL_assertion(false); + return Halfedge_const_handle(); + } + }; + + class set_top_he_visitor : public boost::static_visitor + { + public: + set_top_he_visitor (Halfedge_const_handle he) : m_top_he(he) {} + + void operator()(Td_active_trapezoid& t) const + { + t.set_top(m_top_he); + } + + template < typename T > + void operator()(T& t) const + { + CGAL_assertion(false); + } + private: + Halfedge_const_handle m_top_he; + }; + + class cw_he_visitor : public boost::static_visitor< Halfedge_const_handle > + { + public: + Halfedge_const_handle operator()(Td_active_vertex& t) const + { + return t.cw_he(); + } + Halfedge_const_handle operator()(Td_active_fictitious_vertex& t) const + { + return t.cw_he(); + } + + template < typename T > + Halfedge_const_handle operator()(T& t) const + { + CGAL_assertion(false); + return Halfedge_const_handle(); + } + }; + + class set_cw_he_visitor : public boost::static_visitor + { + public: + set_cw_he_visitor (Halfedge_const_handle he) : m_cw_he(he) {} + + void operator()(Td_active_vertex& t) const + { + t.set_cw_he(m_cw_he); + } + void operator()(Td_active_fictitious_vertex& t) const + { + t.set_cw_he(m_cw_he); + } + + template < typename T > + void operator()(T& t) const + { + CGAL_assertion(false); + } + private: + Halfedge_const_handle m_cw_he; + }; + + class dag_node_visitor : public boost::static_visitor + { + public: + Dag_node* operator()(Td_nothing& t) const + { + CGAL_assertion(false); + return NULL; + } + Dag_node* operator()(Td_inactive_trapezoid& t) const + { + CGAL_assertion(false); + return NULL; + } + + template < typename T > + Dag_node* operator()(T& t) const + { + return t.dag_node(); + } + }; + + class set_dag_node_visitor : public boost::static_visitor + { + public: + set_dag_node_visitor(Dag_node* node):m_node(node) {} + + void operator()(Td_nothing& t) const + { + CGAL_assertion(false); + } + void operator()(Td_inactive_trapezoid& t) const + { + CGAL_assertion(false); + } + + template < typename T > + void operator()(T& t) const + { + t.set_dag_node(m_node); + } + + private: + Dag_node* m_node; + }; + + class curve_end_for_fict_vertex_visitor : + public boost::static_visitor > + { + public: + boost::optional operator()(Td_active_fictitious_vertex& t) const + { + return t.curve_end(); + } + + boost::optional + operator()(Td_inactive_fictitious_vertex& t) const + { + return t.curve_end(); + } + + template < typename T > + boost::optional operator()(T& t) const + { + CGAL_assertion(false); + return boost::none; + } + }; + + class point_for_vertex_visitor : public boost::static_visitor< Point > + { + public: + Point operator()(Td_active_vertex& t) const + { + return t.point(); + } + + Point operator()(Td_inactive_vertex& t) const + { + return t.point(); + } + + template < typename T > + Point operator()(T& t) const + { + CGAL_assertion(false); + return Point(); + } + }; + + class curve_end_for_active_vertex_visitor : + public boost::static_visitor > + { + public: + boost::optional operator()(Td_active_vertex& t) const + { + return t.curve_end(); + } + + boost::optional operator()(Td_active_fictitious_vertex& t) const + { + return t.curve_end(); + } + + template < typename T > + boost::optional operator()(T& t) const + { + CGAL_assertion(false); + return boost::none; + } + }; + + class vertex_for_active_vertex_visitor : + public boost::static_visitor + { + public: + Vertex_const_handle operator()(Td_active_vertex& t) const + { + return t.vertex(); + } + + Vertex_const_handle operator()(Td_active_fictitious_vertex& t) const + { + return t.vertex(); + } + + template < typename T > + Vertex_const_handle operator()(T& t) const + { + CGAL_assertion(false); + return Vertex_const_handle(); + } + }; + + class cv_for_edge_visitor : + public boost::static_visitor > + { + public: + boost::optional + operator()(Td_active_edge& t) const + { + return t.halfedge()->curve(); + } + + boost::optional + operator()(Td_inactive_edge& t) const + { + return t.curve(); + } + + template + boost::optional operator()(T& t) const + { + CGAL_assertion(false); + return boost::none; + } + }; + + ////MICHAL: currently not in use since split is implemented as removed and insert two + //struct Before_split_data + //{ + // X_monotone_curve_2 m_cv_before_split; + // Td_map_item* m_p_old_t; + // Td_map_item* m_p_t1; + // Td_map_item* m_p_t2; + // In_face_iterator* m_p_btm_it; + // In_face_iterator* m_p_mid_it; + // In_face_iterator* m_p_top_it; + // + //}; + ////////////////////////////////////////////// //Trapezoidal_decomposition_2 member functions: ////////////////////////////////////////////// - -#ifndef CGAL_TD_DEBUG - + + protected: - -#else - -public: - -#endif - - /* input: X_curve, - two Trapezoidal maps that corespond the - X_curve's source degenerate trapezoid and the - X_curve's target degenerate trapezoid - output: trapezoid iterator - - Description: - the output (trapezoid iterator) is initialized with - the leftmost and rightmost - (non degenerate) trapezoids in the trapezoid interval that corresponds - to the input from either the top side or the bottom side, - depending on the up flag. - preconditions: - There exist non degenerate trapezoids between the roots of the input D_S's - */ - In_face_iterator follow_curve(const Data_structure& left_end_point, - const X_curve& cv, - Comparison_result up) const + + /*! is_edge_to_right variants: + returning true if the given edge is on the right side + of the given point / curve-end */ + + bool is_edge_to_right(Halfedge_const_handle he, const Point& p) const { - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(traits); - CGAL_warning(traits->is_degenerate_point(*left_end_point)); - if (!(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(cv), - left_end_point->left()))) + typename Traits::Equal_curve_end_2 equal = + traits->equal_curve_end_2_object(); + //p is either min or max end of he + CGAL_precondition(equal(Curve_end(he,ARR_MIN_END), p) || + equal(Curve_end(he,ARR_MAX_END), p)); + + return equal(Curve_end(he,ARR_MIN_END), p); + } + + bool is_edge_to_right(Halfedge_const_handle he, const Curve_end& ce) const + { + typename Traits::Equal_curve_end_2 equal = + traits->equal_curve_end_2_object(); + //p is either min or max end of he + CGAL_precondition(equal(Curve_end(he,ARR_MIN_END), ce) || + equal(Curve_end(he,ARR_MAX_END), ce)); + + //if the curve end ce is on the right boundary - return false; + if (traits->parameter_space_in_x_2_object() + (ce.cv(), ce.ce()) == ARR_RIGHT_BOUNDARY) { - CGAL_warning(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(cv), - left_end_point->left())); + return false; } -#else + return equal(Curve_end(he,ARR_MIN_END), ce); + } - CGAL_assertion(traits); - CGAL_precondition(traits->is_degenerate_point(*left_end_point)); - CGAL_precondition(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(cv), - left_end_point->left())); + //returns true if the given curve is on the right side of the given point + bool is_curve_to_right(const X_monotone_curve_2& cv, const Point& p) const + { + typename Traits::Equal_curve_end_2 equal = + traits->equal_curve_end_2_object(); + //p is either min or max end of he + CGAL_precondition(equal(Curve_end(cv,ARR_MIN_END), p) || + equal(Curve_end(cv,ARR_MAX_END), p)); + + return equal(Curve_end(cv,ARR_MIN_END), p); + } -#endif + /*! is_end_point_left_low variants: + returning true if the first curve-end is left-low + of the second curve-end */ + bool is_end_point_left_low(const Point& p1, const Point& p2) const + { + return (traits->compare_xy_2_object()(p1, p2) == SMALLER); + } - const Point& p1=left_end_point->left(); - Data_structure left=left_end_point.right(); - search_using_data_structure(left,traits,p1,&cv,up); - return In_face_iterator(traits,cv,left.operator->()); + bool is_end_point_left_low(const Point& p, const Curve_end& ce) const + { + return (traits->compare_curve_end_xy_2_object()(p, ce) == SMALLER); + } + + bool is_end_point_left_low(const Curve_end& ce, const Point& p) const + { + return (traits->compare_curve_end_xy_2_object()(p, ce) == LARGER); + } + + bool is_end_point_left_low(const Curve_end& ce1, const Curve_end& ce2) const + { + return (traits->compare_curve_end_xy_2_object()(ce1, ce2) == SMALLER); } - /* - input: - X_trapezoid reference - X_trapezoid pointer - output: - bool - preconditions: - the referenced trapezoid is to the right of the pointered trapezoid - description: - if the two input Trapezoids can be merged they are , - with one copy destroyed(the right one). - postconfition: - The reference points to the right trapezoid - The returned value is true iff merging took place. - */ - bool merge_if_possible(pointer left,pointer right) + template + bool is_end_point_left_low(const T& t, const Dag_node& node) const { - if (left && right && - traits->trapezoid_top_curve_equal(*left,*right) && - traits->trapezoid_bottom_curve_equal(*left,*right) && - traits->equal_2_object()(left->right(),right->left())) + typename Traits::Compare_curve_end_xy_2 compare = + traits->compare_curve_end_xy_2_object(); + Td_map_item vtx_item (node.get_data()); + bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + if (is_fict_vtx) { + return (compare(t, + *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + vtx_item))) == SMALLER); + } + else { + return (compare(t, boost::apply_visitor(point_for_vertex_visitor(), + vtx_item)) == SMALLER); + } + } + + /*! is_end_point_right_top variants: + returning true if the first curve-end is right-top + of the second curve-end */ + bool is_end_point_right_top(const Point& p1, const Point& p2) const + { + return (traits->compare_xy_2_object()(p1, p2) == LARGER); + } + + bool is_end_point_right_top(const Point& p, const Curve_end& ce) const + { + return (traits->compare_curve_end_xy_2_object()(p, ce) == LARGER); + } + + bool is_end_point_right_top(const Curve_end& ce, const Point& p) const + { + return (traits->compare_curve_end_xy_2_object()(p, ce) == SMALLER); + } + + bool is_end_point_right_top(const Curve_end& ce1, const Curve_end& ce2) const + { + return (traits->compare_curve_end_xy_2_object()(ce1, ce2) == LARGER); + } + + template + bool is_end_point_right_top(const T& t, const Dag_node& node) const + { + typename Traits::Compare_curve_end_xy_2 compare = + traits->compare_curve_end_xy_2_object(); + Td_map_item vtx_item (node.get_data()); + bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + if (is_fict_vtx) { + return (compare(t, + *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + vtx_item))) == LARGER); + } + else { + return (compare(t, + boost::apply_visitor(point_for_vertex_visitor(), + vtx_item)) == LARGER); + } + } + + template + bool are_equal_end_points(const T& t, const Dag_node& node) const + { + typename Traits::Equal_curve_end_2 equal = + traits->equal_curve_end_2_object(); + Td_map_item vtx_item (node.get_data()); + bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item); + if (is_fict_vtx) { + return equal(t, + *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + vtx_item))); + } + else { + return equal(t, + boost::apply_visitor(point_for_vertex_visitor(), + vtx_item)); + } + } + + /*! + * finds the node of the leftmost trapezoid with respect to a curve. + * \param left_cv_end_node The dag node representing the left endpoint of + * the cv + * \param cv The curve + * \param cres SMALLER/EQUAL/LARGER (searching for the leftmost trapezoid + * which is below/on/above cv) + * \return The required DAG node + */ + Dag_node find_leftmost_dag_node_of_curve(const Dag_node& left_cv_end_node, + const X_monotone_curve_2& cv, + Comparison_result cres) const + { + CGAL_assertion(traits != NULL); + Td_map_item& item = left_cv_end_node.get_data(); + CGAL_precondition(traits->is_td_vertex(item)); + CGAL_precondition (are_equal_end_points(Curve_end(cv,ARR_MIN_END), + left_cv_end_node)); + + //if ( traits->is_fictitious_vertex(item) ) + //{ + // CGAL_precondition(traits->equal_curve_end_2_object() + // (Curve_end(cv,ARR_MIN_END), *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item)))); + //} + //else + //{ + // CGAL_precondition(traits->equal_curve_end_2_object() + // (Curve_end(cv,ARR_MIN_END), boost::apply_visitor(point_for_vertex_visitor(), item))); + //} + //find the node of the curve's leftmost trapezoid + Dag_node cv_leftmost_node(left_cv_end_node.right_child()); + if (traits->is_fictitious_vertex(item) ) { - left->merge_trapezoid(*right); + Curve_end ce( *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(), + item))); + search_using_dag_with_cv(cv_leftmost_node, traits, ce, &cv, cres); + } + else + { + Point p( boost::apply_visitor(point_for_vertex_visitor(), item)); + search_using_dag_with_cv(cv_leftmost_node, traits, p, &cv, cres); + } + return cv_leftmost_node; + } -#ifdef CGAL_TD_DEBUG - CGAL_assertion(left->is_right_unbounded()==right->is_right_unbounded()); -#endif + /*! + * follow_curve variants: + * follows trapezoids along a curve (below/on/above it) + * \param left_cv_end_node The dag node representing the left endpoint of + * the cv + * \param he/cv The halfedge / The curve + * \param cres SMALLER/EQUAL/LARGER (indicating the position with respect to the curve) + * \return An iterator for td map items along a curve + */ + In_face_iterator follow_curve(const Dag_node& left_cv_end_node, + Halfedge_const_handle he, + Comparison_result up) const + { + return follow_curve(left_cv_end_node, he->curve(), up); + } + + In_face_iterator follow_curve(const Dag_node& left_cv_end_node, + const X_monotone_curve_2& cv, + Comparison_result up) const + { + Dag_node cv_leftmost_node(find_leftmost_dag_node_of_curve(left_cv_end_node,cv,up)); + //return a trapezoid iterator that starts from this trapezoid + // and continues according to the curve cv + return In_face_iterator(traits, cv, cv_leftmost_node.get_data()); + } + + //----------------------------------------------------------------------------- + // Description: + // Input: pointer to left trapezoid, pointer to right trapezoid + // Output: true iff the merging took place + // If the two input trapezoids can be merged they are , + // with one copy destroyed(the right one). + // Preconditions: + // the right trapezoid is to the right of the left one + bool merge_if_possible(Td_map_item& left_item, Td_map_item& right_item) + { + CGAL_precondition(traits->is_empty_item(left_item) || + (traits->is_active(left_item) && + traits->is_td_trapezoid(left_item))); + CGAL_precondition(traits->is_empty_item(right_item) || + (traits->is_active(right_item) && + traits->is_td_trapezoid(right_item))); + + if (traits->is_empty_item(left_item) || traits->is_empty_item(right_item)) + return false; + + Td_active_trapezoid& left (boost::get(left_item)); + Td_active_trapezoid& right (boost::get(right_item)); + if (traits->is_trapezoids_top_equal(left,right) && + traits->is_trapezoids_bottom_equal(left,right) && + traits->equal_curve_end_2_object() + (traits->vtx_to_ce(left.right()), traits->vtx_to_ce(right.left()))) + { + left.merge_trapezoid(right); + //set the depth to be the max of the two merged nodes + left.dag_node()->depth() = std::max ( left.dag_node()->depth(), + right.dag_node()->depth()); + CGAL_postcondition( + left.is_on_right_boundary() == right.is_on_right_boundary()); + return true; } return false; } + + //--------------------------------------------------------------------------- + // Description: + // splits the trapezoid with vertical line through v + // assuming that he (the first cw halfedge starting at 12 o'clock) is in the + // desired direction, such that v is their source + // Precondition: + // The trapezoid is active and contains v in its closure + // + Dag_node& split_trapezoid_by_vertex(Dag_node& tt, + Vertex_const_handle v, + Halfedge_const_handle he); + + Td_map_item build_vertex_map_item(Vertex_const_handle v, + Halfedge_const_handle he, + Dag_node* node); + //--------------------------------------------------------------------------- + // Description: + // the opposite operation for spliting the trapezoid with + // vertical line through ce + // Precondition: + // The root trapezoid is degenerate point (ce) and is active + void undo_split_trapezoid_by_vertex(Dag_node& tr_node, const Curve_end& ce); + + void deactivate_trapezoid (Dag_node& trpz_node, Dag_node* active_node) const; + + void deactivate_vertex (Dag_node& vtx_node) const; + + void deactivate_edge (boost::shared_ptr& cv, Dag_node& edge_node) const; + + //----------------------------------------------------------------------------- + // Description: + // splits the trapezoid that corresponds to the root of the + // trapezoidal tree with an input halfedge he + // Precondition: + // The root trapezoid is active + // The root trapezoid is devided by he or is equal to it and is vertical. + Dag_node& split_trapezoid_by_halfedge(Dag_node& split_node, + Td_map_item& prev_e, + Td_map_item& prev_bottom_tr, + Td_map_item& prev_top_tr, + Halfedge_const_handle he); + + + //--------------------------------------------------------------------------- + // Description: + // update + // tr.bottom() + // vertical_ray_shoot downward from tr + // tr.top() + // vertical_ray_shoot upward from tr + // update all the curves incident to the vertex that there's a new curve + // starting from this vertex + // this point must be an interior point and not a point on the boundaries, + // since a point on the boundaries is related to one curve only + Td_map_item& + update_vtx_with_new_edge(Halfedge_const_handle he, + const Curve_end& ce, + Td_map_item& vtx_item, + const Locate_type& CGAL_precondition_code(lt)); - /* Description: - splits the trapezoid with vertical line through p */ - /* Precondition: - The trapezoid is active and contains p in its closure */ + Td_map_item& insert_curve_at_vtx_using_dag(Halfedge_const_handle he, + Vertex_const_handle v, + Td_map_item& tr, + const Locate_type& + CGAL_precondition_code(lt)); + + + //void set_trp_params_after_halfedge_update(Halfedge_const_handle old_he, + // Halfedge_const_handle new_he, + // Td_map_item& vtx_item); //MICHAL: not in use - Data_structure& split_trapezoid_by_point(Data_structure& tt, - const Point& p, - const X_curve& cv_bottom_ray_shoot, - const X_curve& cv_top_ray_shoot) - { - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(!!tt); - if (!tt) return tt; - -#else - - CGAL_precondition(!!tt); - -#endif - - reference curr=*tt; - pointer - lb=curr.left_bottom_neighbour(), - lt=curr.left_top_neighbour(), - rb=curr.right_bottom_neighbour(), - rt=curr.right_top_neighbour(); - -#ifndef CGAL_TD_DEBUG - CGAL_warning(curr.is_active()); - CGAL_warning(traits->is_in_closure(curr,p)); -#else - CGAL_precondition(curr.is_active()); - if (!traits->is_in_closure(curr,p)) - { - std::cout << "\ncurr="; - write(std::cout,curr,*traits) << "\tp=" << p; - } - CGAL_precondition(traits->is_in_closure(curr,p)); -#endif - - // left and right are set to the point itself, - // bottom and top are set to the ray shooting resulting curves at this - // stage. - X_trapezoid sep(p,p,cv_bottom_ray_shoot,cv_top_ray_shoot); - Data_structure leftDS = - Data_structure(X_trapezoid - (curr.left(), p, curr.bottom(), curr.top(), - curr.boundedness() & - (CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED | - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED | - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED))); - Data_structure rightDS = - Data_structure(X_trapezoid - (p, curr.right(), curr.bottom(),curr.top(), - curr.boundedness() & - (CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED | - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED | - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED))); - - reference left = *leftDS; - reference right = *rightDS; - -#ifndef CGAL_TD_DEBUG - CGAL_warning(traits->trapezoid_top_curve_equal(left,right)); - CGAL_warning(traits->trapezoid_bottom_curve_equal(left,right)); - CGAL_warning(left.is_left_unbounded()==curr.is_left_unbounded()); - CGAL_warning(right.is_right_unbounded()==curr.is_right_unbounded()); -#else - CGAL_warning(traits->trapezoid_top_curve_equal(left,right)); - CGAL_warning(traits->trapezoid_bottom_curve_equal(left,right)); - CGAL_assertion(left.is_left_unbounded()==curr.is_left_unbounded()); - CGAL_assertion(right.is_right_unbounded()==curr.is_right_unbounded()); -#endif - - if (!traits->is_degenerate_curve(curr)) - { - left.init_neighbours(lb,lt,&right,&right); - right.init_neighbours(&left,&left,rb,rt); - if (lb) lb->set_rb(&left); - if (lt) lt->set_rt(&left); - if (rb) rb->set_lb(&right); - if (rt) rt->set_lt(&right); - } - else - { - left.set_bottom(cv_bottom_ray_shoot); - left.set_top(cv_bottom_ray_shoot); - right.set_bottom(cv_top_ray_shoot); - right.set_top(cv_top_ray_shoot); - left.set_rt(&right); - left.set_lb(lb); - left.set_rb(0); - right.set_lb(&left); - right.set_rt(rt); - right.set_rb(rb); - } - tt.replace(sep,leftDS,rightDS); - const Data_structure - *leftPtr=&tt.left(), - *rightPtr=&tt.right(); - (*leftPtr)->set_node((Data_structure*)leftPtr); - (*rightPtr)->set_node((Data_structure*)rightPtr); - -#ifdef CGAL_TD_DEBUG - CGAL_assertion(&left==leftDS.operator->()); - CGAL_assertion(&right==rightDS.operator->()); - CGAL_assertion(left==*leftDS); - CGAL_assertion(right==*rightDS); - CGAL_assertion(left==*tt.left()); - CGAL_assertion(right==*tt.right()); - /* - CGAL_assertion(left.get_node()==&tt.left()); - CGAL_assertion(right.get_node()==&tt.right()); - */ - CGAL_assertion(**left.get_node()==left); - CGAL_assertion(**right.get_node()==right); -#endif - - return tt; - } + + void update_vtx_cw_he_after_merge(const X_monotone_curve_2& old_cv, + Halfedge_const_handle new_he, + Td_map_item& vtx_item); - /* Description: - the opposite operation for spliting the trapezoid with - vertical line through p */ - /* Precondition: - The root trapezoid is degenerate point (p) and is active */ + ////MICHAL: currently not in use since split is implemented as: remove and insert two + //void set_trp_params_after_split_halfedge_update(Halfedge_const_handle new_he, + // Td_map_item& vtx_item, + // Halfedge_const_handle he1, + // Halfedge_const_handle he2); - void remove_split_trapezoid_by_point(Data_structure& tt, const Point& p) - { - -#ifndef CGAL_TD_DEBUG - - if (!tt|| - !tt->is_active()|| - !traits->is_degenerate_point(*tt)|| - !traits->equal_2_object()(tt->left(),p)) - { - CGAL_warning(!!tt); - CGAL_warning(tt->is_active()); - CGAL_warning(traits->is_degenerate_point(*tt)); - CGAL_warning(traits->equal_2_object()(tt->left(),p)); - return; - } - -#else - - CGAL_precondition(!!tt); - CGAL_precondition(tt->is_active()); - CGAL_precondition(traits->is_degenerate_point(*tt)); - CGAL_precondition(traits->equal_2_object()(tt->left(),p)); - -#endif - - Data_structure - tt_left=tt.left(), - tt_right=tt.right(); - - search_using_data_structure(tt_left,traits,p,0); - search_using_data_structure(tt_right,traits,p,0); - -#ifndef CGAL_TD_DEBUG - merge_if_possible(&*tt_left,&*tt_right); - - CGAL_warning(!tt_left.is_inner_node()); - CGAL_warning(!tt_right.is_inner_node()); - CGAL_warning(tt_left->is_right_unbounded() == - tt_right->is_right_unbounded()); - -#else - std::cout << "\nremove_split_trapezoid_by_point(){"; - std::cout << "\ntt_left="; - write(std::cout,*tt_left,*traits); - std::cout << "\ntt_right="; - write(std::cout,*tt_right,*traits) << "}" << std::endl; - - bool merge_if_poss_left_right = merge_if_possible(&*tt_left,&*tt_right); - - std::cout << "\n->"; - write(std::cout,*tt_left,*traits) << std::endl; - - CGAL_postcondition(merge_if_poss_left_right); - CGAL_assertion(!tt_left.is_inner_node()); - CGAL_assertion(!tt_right.is_inner_node()); - CGAL_assertion(tt_left->is_right_unbounded() == - tt_right->is_right_unbounded()); - CGAL_assertion(**tt_left->get_node()==*tt_left); -#endif - - tt_right->remove(&tt_left); - // mark root as deleted - tt->remove(); - } + //----------------------------------------------------------------------------- + // Description: + // update map items traveled along an iterator till end reached + // with the new halfedge + // precondition: + // end==0 or end is on the path of the iterator + // postcondition: + // end is pointer to the last trapezoid encountered,if any + void update_map_items_after_merge(In_face_iterator& it, + Halfedge_const_handle old_he, + Halfedge_const_handle new_he, + Vertex_const_handle min_v, + Vertex_const_handle max_v, + Td_map_item& end); - /* Description: - splits the trapezoid that corresponds to the root of the - trapezoidal tree with an input edge cv*/ - /* Precondition: - The root trapezoid is active - cv is non degenerate - The root trapezoid is devided by cv or - is equal to it and is vertical. - */ - Data_structure& - split_trapezoid_by_curve(Data_structure& tt, - pointer& prev, - pointer& prev_bottom, - pointer& prev_top, - const X_curve& cv) - { - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(traits); - -#else - - CGAL_assertion(traits); - -#endif - - reference currt=*tt; - //Point p[2]; - //int i= CGAL_POINT_IS_LEFT_LOW( - // p[0]=traits->curve_source(cv), - // p[1]=traits->curve_target(cv) - // ) ? 0 : 1; - // - //// sets left and right accoring to curves source's and target's positions - //// sets bottom and top to X_curve itself - //X_trapezoid sep(p[i],p[1-i],cv,cv); - //IDIT: change this according to the new traits, we already know which - //point is left and which is right - X_trapezoid sep(traits->construct_min_vertex_2_object()(cv), - traits->construct_max_vertex_2_object()(cv), - cv, - cv); + //--------------------------------------------------------------------------- + // Description: + // advances input Data structure using data structure,input point p and + // possibly Halfedge p_he till + // p is found(if p_he hadn't been given) + // p_he is found(if p_he was given) + // or + // leaf node reached + // postcondition: + // output is the closest active trapezoid to ce/p_he + // remark: + // use this function with care! + Locate_type search_using_dag(Dag_node& curr_node, + const Traits* traits, + const Point& p, + Halfedge_const_handle he, + Comparison_result up = EQUAL) const; - /* - creates a one-way path for all the X_curve-degenerate - trapezoids that represent the X_curve. - right_bottom_neighbour() is used to retrieve the - next on path information - */ - Data_structure - topBT = Data_structure(X_trapezoid - (currt.left(), currt.right(), cv, currt.top(), - currt.boundedness() & - (CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED | - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED| - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED))), - bottomBT = Data_structure(X_trapezoid - (currt.left(),currt.right(), currt.bottom(), cv, - currt.boundedness() & - (CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED| - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED| - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED))); - reference bottom=*bottomBT; - reference top=*topBT; - top.init_neighbours(prev_top, currt.left_top_neighbour(), 0, - currt.right_top_neighbour()); - bottom.init_neighbours(currt.left_bottom_neighbour(), - prev_bottom,currt.right_bottom_neighbour(),0); - if (prev_bottom) prev_bottom->set_rt(&bottom); - if (prev_top) prev_top->set_rb(&top); - if (currt.left_bottom_neighbour()) - currt.left_bottom_neighbour()->set_rb(&bottom); - if (currt.left_top_neighbour()) - currt.left_top_neighbour()->set_rt(&top); - if (currt.right_bottom_neighbour()) - currt.right_bottom_neighbour()->set_lb(&bottom); - if (currt.right_top_neighbour()) currt.right_top_neighbour()->set_lt(&top); - tt.replace(sep,bottomBT,topBT); - const Data_structure - *bottomPtr=&tt.left(), - *topPtr=&tt.right(); - (*bottomPtr)->set_node((Data_structure*)bottomPtr); - (*topPtr)->set_node((Data_structure*)topPtr); - if (prev) prev->set_rb(tt.operator->()); - prev_bottom=(*bottomPtr).operator->(); - prev_top=(*topPtr).operator->(); - prev=tt.operator->(); - return tt; - } - - /* replace X_curve-point adjacency in the data structure with - a new one - precondition: - the X_curve represented by t is top-right - relative to the point represented by sep - if and only if top=true - */ - void replace_curve_at_point_using_geometry(reference t, reference sep, - bool cv_top_right=true) - { - Point p(sep.left()); - X_curve cv(t.top()); - Around_point_circulator circ(traits,p,cv_top_right ? - sep.right_top_neighbour() : - sep.left_bottom_neighbour()); - if (circ.operator->()) - { - if (cv_top_right) - while(traits->compare_cw_around_point_2_object () - (circ->top(), CGAL_CURVE_IS_TO_RIGHT(circ->top(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), p) != EQUAL) - circ++; - else - while(traits->compare_cw_around_point_2_object() - (circ->bottom(), CGAL_CURVE_IS_TO_RIGHT(circ->bottom(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), p, false) != EQUAL) - circ++; - circ.replace(t); - } - } - - void insert_curve_at_point_using_geometry(reference sep, reference end_point) - { + ////------------------------------------------------------------------------- + //// Description: + //// advances input Data structure using data structure,input point p and + //// possibly Halfedge p_he till + //// p is found(if p_he hadn't been given) + //// p_he is found(if p_he was given) + //// or + //// leaf node reached + //// postcondition: + //// output is the closest active trapezoid to ce/p_he + //// remark: + //// use this function with care! + //void search_and_print_using_dag (std::ostream& out, + // Dag_node& curr_node, + // const Traits* traits, + // const Point& p, + // Halfedge_const_handle he, + // Comparison_result up = EQUAL) const; -#ifndef CGAL_TD_DEBUG - - CGAL_warning(traits); - CGAL_warning(traits->is_degenerate_point(end_point)); - CGAL_warning(traits->is_degenerate_curve(sep)); - CGAL_warning(traits->equal_2_object()(end_point.left(),sep.right()) || - traits->equal_2_object()(end_point.left(),sep.left())); - -#else - - CGAL_assertion(traits); - CGAL_precondition(traits->is_degenerate_point(end_point)); - CGAL_precondition(traits->is_degenerate_curve(sep)); - CGAL_precondition(traits->equal_2_object()(end_point.left(),sep.right()) || - traits->equal_2_object()(end_point.left(),sep.left())); - -#endif - - /* update (in this order) - end_point.left_bottom_neighbour() - if no curves adjacent to the point eminating toward up - or right exist returns null, otherwise return - the first X_curve sweeped using a counter clockwise sweep - starting from up direction not including. - end_point.right_top_neighbour() - if no curves adjacent to the point eminating toward bottom - or left exist returns null, otherwise return - the first X_curve sweeped using a counter clockwise sweep - starting from bottom direction not including. - sep.right_top_neighbour() - next clockwise degenerate_curve around rightmost end_point (possibly - himself) - sep.left_bottom_neighbour() - next clockwise degenerate_curve around leftmost end_point (possibly - himself) - */ - const X_curve& cv=sep.top(); - const Point& p=end_point.left(); - pointer rt = end_point.right_top_neighbour(), - lb = end_point.left_bottom_neighbour(); - if(!traits->equal_2_object()(end_point.left(),sep.right())) - { - if (!rt && !lb) - // empty circulator - { - end_point.set_rt(&sep); - sep.set_lb(&sep); - } - else - { - /* set circ[0] to first X_curve on a counter clockwise - sweep starting at cv */ - Around_point_circulator circ(traits,p,rt ? rt : lb),stopper=circ; - // if !rt set circ to lb - // otherwise advance as required -#ifdef CGAL_TD_DEBUG - - Around_point_circulator first_circ(circ); - -#endif - - while (traits->compare_cw_around_point_2_object () - (circ->top(), CGAL_CURVE_IS_TO_RIGHT(circ->top(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), p) == SMALLER) - { - circ++; - if (circ==stopper) - break; - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(first_circ!=circ); - CGAL_assertion(circ->is_active()); - -#endif - - } - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->compare_cw_around_point_2_object() - (circ->top(), CGAL_CURVE_IS_TO_RIGHT(circ->top(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), p) != EQUAL); -#endif - - circ.insert(sep); - // set end_point.left_bottom_neighbour() - // set end_point.right_top_neighbour(); - if (lb) - { - Around_point_circulator lb_circ(traits,p,lb); - if (!rt) end_point.set_rt(lb); - if (lb_circ.operator->()==&sep) end_point.set_lb(&sep); - } - else - { - if (traits->compare_cw_around_point_2_object() - (rt->top(), CGAL_CURVE_IS_TO_RIGHT(rt->top(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), - p, false) == SMALLER) - end_point.set_rt(&sep); - } - } - } - else - { - if (!rt && !lb) - // empty circulator - { - end_point.set_lb(&sep); - sep.set_rt(&sep); - } - else - { - /* set circ[0] to first X_curve on a counter clockwise - sweep starting at cv */ - Around_point_circulator circ(traits,p,lb ? lb : rt),stopper=circ; - // if !lb set circ to rt - // otherwise advance as required - while (traits->compare_cw_around_point_2_object() - (circ->top(), CGAL_CURVE_IS_TO_RIGHT(circ->top(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), p, false) == SMALLER) - { - circ++; - if (circ==stopper) - break; - } - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->compare_cw_around_point_2_object() - (circ->top(), CGAL_CURVE_IS_TO_RIGHT(circ->top(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), p, false) != EQUAL); -#endif - - circ.insert(sep); - if (rt) - // set end_point.left_bottom_neighbour() - { - Around_point_circulator rt_circ(traits,p,rt); - if (!lb) end_point.set_lb(rt); - if (rt_circ.operator->()==&sep) end_point.set_rt(&sep); - } - else - { - // set end_point.right_top_neighbour(); - if(traits->compare_cw_around_point_2_object() - (lb->top(), CGAL_CURVE_IS_TO_RIGHT(lb->top(),p), - cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), p) ==SMALLER) - end_point.set_lb(&sep); - } - } - } - } - /* - description: - Update top(),bottom() for trapezoid - Update rt,lb - remarks: - The point degenerate trapezoid representing a point p holds as its top and - bottom curves - the output for a vertical ray shoot quiries immidiately below the point - toward up and - immediately above the point toward down respectively. - optimization: - Each degenerate X_curve trapezoid eminating from the point p holds a pointer - to the next - trapezoid in a clockwise sweep around p(possibly to itself). - This pointer is stored in rt or lb depending on the trapezoid is top right - or bottom left of p. - For the trapezoid representing p rt and lb hold the previous X_curve - degenerate trapezoid - in a clockwise sweep to the first top right and bottom left respectively. - */ - - void remove_curve_at_point_using_geometry(const_ref sep,reference end_point) - { - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(traits); - CGAL_warning(traits->is_degenerate_point(end_point)); - CGAL_warning(traits->is_degenerate_curve(sep)); - CGAL_warning(traits->equal_2_object()(end_point.left(),sep.right()) || - traits->equal_2_object()(end_point.left(),sep.left())); - CGAL_warning(end_point.is_active()); - CGAL_warning(sep.is_active()); - -#else - - CGAL_assertion(traits); - CGAL_precondition(traits->is_degenerate_point(end_point)); - CGAL_precondition(traits->is_degenerate_curve(sep)); - CGAL_precondition(traits->equal_2_object()(end_point.left(),sep.right()) || - traits->equal_2_object()(end_point.left(),sep.left())); - CGAL_precondition(end_point.is_active()); - CGAL_precondition(sep.is_active()); - -#endif - - /* update (in this order) - end_point.left_bottom_neighbour() - if no curves adjacent to the point eminating toward up - or right exist returns null, otherwise return - the first X_curve sweeped using a counter clockwise sweep - starting from up direction not including. - end_point.right_top_neighbour() - if no curves adjacent to the point eminating toward bottom - or left exist returns null, otherwise return - the first X_curve sweeped using a counter clockwise sweep - starting from bottom direction not including. - sep.right_top_neighbour() - next clockwise degenerate_curve around rightmost end_point (possibly - himself) - sep.left_bottom_neighbour() - next clockwise degenerate_curve around leftmost end_point (possibly - himself) - */ - const X_curve& cv=sep.top(); - const Point& p=end_point.left(); - Around_point_circulator - prev_top(traits,p,end_point.right_top_neighbour()), - prev_bottom(traits,p,end_point.left_bottom_neighbour()); - - // update bottom - if(traits->equal_2_object()(cv,end_point.bottom())) - { - Around_point_circulator bottom=(!!prev_bottom) ? prev_bottom : prev_top; - bottom++; + //--------------------------------------------------------------------------- + // Description: + // advances input Data structure using data structure,input point ce and + // possibly Halfedge p_he till + // ce is found(if p_he hadn't been given) + // p_he is found(if p_he was given) + // or + // leaf node reached + // postcondition: + // output is the closest active trapezoid to ce/p_he + // remark: + // use this function with care! + Locate_type search_using_dag (Dag_node& curr_node, + const Traits* traits, + const Curve_end& ce, + Halfedge_const_handle he, + Comparison_result up = EQUAL) const; -#ifdef CGAL_TD_DEBUG + //--------------------------------------------------------------------------- + // Description: + // advances input Data structure using data structure,input point ce and + // possibly X_monotone_curve_2 p_cv till + // ce is found(if p_cv hadn't been given) + // p_cv is found(if p_cv was given) + // or + // leaf node reached + // postcondition: + // output is the closest active trapezoid to ce/p_cv + // remark: + // use this function with care! + Locate_type search_using_dag_with_cv(Dag_node& curr_node, + const Traits* traits, + const Curve_end& ce, + const X_monotone_curve_2* p_cv, + Comparison_result up = EQUAL) const; - CGAL_assertion(!!bottom); + //--------------------------------------------------------------------------- + // Description: + // advances input Data structure using data structure,input point ce and + // possibly X_monotone_curve_2 p_cv till + // p is found(if p_cv hadn't been given) + // p_cv is found(if p_cv was given) + // or + // leaf node reached + // postcondition: + // output is the closest active trapezoid to ce/p_cv + // remark: + // use this function with care! + Locate_type search_using_dag_with_cv (Dag_node& curr_node, + const Traits* traits, + const Point& p, + const X_monotone_curve_2* p_cv, + Comparison_result up = EQUAL) const; -#endif - - if (!bottom->is_bottom_unbounded()) - end_point.set_bottom(bottom->bottom()); - else - end_point.set_bottom_unbounded(); - } - // update top - if(traits->equal_2_object()(cv,end_point.top())) - { - Around_point_circulator top=(!!prev_top) ? prev_top : prev_bottom; - top++; - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(!!top); - -#endif - - if (!top->is_top_unbounded()) - end_point.set_top(top->top()); - else - end_point.set_top_unbounded(); - } - //update right top neighbour and left bottom neighbour - bool b=CGAL_POINT_IS_LEFT_LOW(p,sep.right()); - Around_point_circulator circ(traits,p,b ? end_point.right_top_neighbour() : - end_point.left_bottom_neighbour()); + Dag_node container2dag(Nodes_map& ar, int left, int right, + int& num_of_new_nodes) const; -#ifdef CGAL_TD_DEBUG - - CGAL_precondition(!!circ); - -#endif - - while(*circ!=sep)circ++; - pointer removed=circ.operator->(); - circ.remove(); - if(!!circ) - { - pointer effective_curr=circ[0]; - if (end_point.right_top_neighbour()==removed) - end_point.set_rt(effective_curr); - if (end_point.left_bottom_neighbour()==removed) - end_point.set_lb(effective_curr); - Around_point_circulator rt_circ(traits, p, - end_point.right_top_neighbour()); - if (!!rt_circ) - { - rt_circ++; - if (rt_circ.is_right_rotation()) - end_point.set_rt(0); - } - Around_point_circulator lb_circ(traits, p, - end_point.left_bottom_neighbour()); - if (!!lb_circ) - { - lb_circ++; - if (!lb_circ.is_right_rotation()) - end_point.set_lb(0); - } - } - else - { - end_point.set_rt(0); - end_point.set_lb(0); - } - } + bool is_last_edge(Halfedge_const_handle he, Td_map_item& vtx_item); - /*update - tr.bottom() - vertical_ray_shoot downward from tr - tr.top() - vertical_ray_shoot upward from tr - */ - reference - insert_curve_at_point_using_geometry(const X_curve & cv, - const Point& p, - pointer & tr, - const Locate_type & - CGAL_precondition_code(lt)) - { - CGAL_assertion(traits); - CGAL_precondition(lt == POINT); - - if (traits->compare_cw_around_point_2_object() - (cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), - tr->top(), CGAL_CURVE_IS_TO_RIGHT(tr->top(),p), p) == SMALLER) - tr->set_top(cv); - if (traits->compare_cw_around_point_2_object() - (cv, CGAL_CURVE_IS_TO_RIGHT(cv,p), tr->bottom(), - CGAL_CURVE_IS_TO_RIGHT(tr->bottom(),p), p, false) == SMALLER) - tr->set_bottom(cv); - return *tr; - } - - reference - insert_curve_at_point_using_data_structure(const X_curve & cv, - const Point & p, - pointer & tr, - const Locate_type & - CGAL_precondition_code(lt)) - { - CGAL_precondition(lt==TRAPEZOID || lt==UNBOUNDED_TRAPEZOID); - - Data_structure *tt=tr->get_node(); - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(tr->get_node()); - -#endif - - return *split_trapezoid_by_point(*tt,p,cv,cv); - //return *tr; - } - - void replace_curve_at_point_using_geometry(const X_curve& old_cv, - const X_curve& new_cv, - reference sep) - { - -#ifdef CGAL_TD_DEBUG - - CGAL_precondition(traits->is_degenerate_point(sep)); - -#endif - - if (!sep.is_top_unbounded() && traits->equal_2_object()(sep.top(), old_cv)) - sep.set_top(new_cv); - if (!sep.is_bottom_unbounded() && - traits->equal_2_object()(sep.bottom(), old_cv)) sep.set_bottom(new_cv); - } - - /* update geometric boundary(top and bottom) for trapezoids - traveled along an iterator till end reached - precondition: - end==0 or end is on the path of the iterator - postcondition: - end is pointer to the last trapezoid encountered,if any - */ - void replace_curve_using_geometry(In_face_iterator & it, - const X_curve & old_cv, - const X_curve & new_cv,pointer & end) - { - pointer last=0; - while (it.operator->()!=end) - { - if (!it->is_top_unbounded() && - traits->equal_2_object()(it->top(), old_cv)) - it->set_top(new_cv); - if (!it->is_bottom_unbounded() && - traits->equal_2_object()(it->bottom(),old_cv)) - it->set_bottom(new_cv); - last=it.operator->(); - ++it; - } - end=last; - } - - /* - description: - advances input Data structure using data structure,input point p and - possibly X_curve cv till - p is found(if cv hadn't been given) - cv is found(if cv was given) - or - leaf node reached - postcondition: - output is the closest active trapezoid to p/cv - remark: - use this function with care! - */ - /*static */ - Locate_type search_using_data_structure(Data_structure& curr,const_Traits_ptr traits, - const Point& p,const X_curve* cv, - Comparison_result up = EQUAL) const - { - const Point* pp; - const X_curve* pc; - -#ifdef CGAL_TD_DEBUG - pointer old = NULL; -#endif - - while(true) - { -#ifdef CGAL_TD_DEBUG - // unbounded loop - CGAL_assertion(curr.operator->() != old); - old = curr.operator->(); -#endif - - if (traits->is_degenerate_point(*curr)) - // point node conditional (separation) - { - // extract point from trapezoid - pp = &curr->left(); - if (CGAL_POINT_IS_LEFT_LOW(p, *pp)) - { - curr = curr.left(); - continue; - } - else if (CGAL_POINT_IS_LEFT_LOW(*pp, p)) - { - curr = curr.right(); - continue; - } - else if (traits->equal_2_object()(*pp, p)) - { - if (!cv) - { - if ( up == EQUAL ) { // point found! - if (curr->is_active()) return POINT; - curr = curr.left(); - } - else if ( up == LARGER ) { // vertical ray shut up - curr = curr.right(); - } - else /*if ( up == SMALLER ) */ { - curr = curr.left(); // vertical ray shut down - } - continue; - } - else - { - -#ifndef CGAL_TD_DEBUG - CGAL_warning(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(*cv), p) || - traits->equal_2_object() - (traits->construct_max_vertex_2_object()(*cv), p)); -#else - CGAL_assertion(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(*cv), p) || - traits->equal_2_object() - (traits->construct_max_vertex_2_object()(*cv), p)); -#endif - curr = traits->equal_2_object() - (traits->construct_min_vertex_2_object()(*cv), p) ? - curr.right() : curr.left(); - // (Oren 14/4/02) ?? - - continue; - } - } - else - { - -#ifndef CGAL_TD_DEBUG - CGAL_warning(CGAL_POINT_IS_LEFT_LOW(p,*pp) || - CGAL_POINT_IS_LEFT_LOW(*pp,p) || - traits->equal_2_object()(*pp,p)); -#else - CGAL_assertion(CGAL_POINT_IS_LEFT_LOW(p,*pp) || - CGAL_POINT_IS_LEFT_LOW(*pp,p) || - traits->equal_2_object()(*pp,p)); -#endif - - return Locate_type(); - } - } - if (traits->is_degenerate_curve(*curr)) - { - // CURVE SEPRATION - pc = &curr->top(); - Comparison_result cres = traits->compare_y_at_x_2_object()(p, *pc); - if (cres == SMALLER) - { - curr = curr.left(); - continue; - } - else if (cres == LARGER) - { - curr = curr.right(); - continue; - } - else - { - // p on CURVE -#ifndef CGAL_TD_DEBUG - CGAL_warning((cres == EQUAL) && - !(traits->compare_x_2_object()(p, - traits->construct_max_vertex_2_object()(*pc)) == LARGER) && - !(traits->compare_x_2_object()(p, - traits->construct_min_vertex_2_object()(*pc)) == SMALLER)); -#else - - CGAL_postcondition((cres == EQUAL) && - !(traits->compare_x_2_object()(p, - traits->construct_max_vertex_2_object()(*pc)) == LARGER) && - !(traits->compare_x_2_object()(p, - traits->construct_min_vertex_2_object()(*pc)) == SMALLER)); -#endif - if (!cv) - { - // For a vertical curve, we always visit it after visiting - // one of its endpoints. - if ((up == EQUAL) || traits->is_vertical(*curr)) { - //std::cout << "EQUAL or VERTICAL" << std::endl; - if (curr->is_active()) return CURVE; - curr = curr.left(); - } - else if (up == LARGER) { - curr = curr.right(); - } - else /* if (up==SMALLER) */ { - curr = curr.left(); - } - continue; - } - else - { - -#ifndef CGAL_TD_DEBUG - CGAL_warning(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(*cv), - traits->construct_min_vertex_2_object()(*pc)) || - traits->equal_2_object() - (traits->construct_max_vertex_2_object()(*cv), - traits->construct_max_vertex_2_object()(*pc))); -#else - if (!(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(*cv), - traits->construct_min_vertex_2_object()(*pc))|| - traits->equal_2_object() - (traits->construct_max_vertex_2_object()(*cv), - traits->construct_max_vertex_2_object()(*pc)))) - { - std::cerr << "\npc " << *pc; - std::cerr << "\ncv " << *cv << std::endl; - CGAL_assertion(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(*cv), - traits->construct_min_vertex_2_object()(*pc)) || - traits->equal_2_object() - (traits->construct_max_vertex_2_object()(*cv), - traits->construct_max_vertex_2_object()(*pc))); - } -#endif - - Comparison_result res = - traits->equal_2_object() - (traits->construct_min_vertex_2_object()(*cv), - traits->construct_min_vertex_2_object()(*pc)) ? - traits->compare_cw_around_point_2_object() - (*pc, CGAL_CURVE_IS_TO_RIGHT(*pc,p), - *cv, CGAL_CURVE_IS_TO_RIGHT(*cv,p), p) : - traits->compare_cw_around_point_2_object() - (*cv, CGAL_CURVE_IS_TO_RIGHT(*cv,p), - *pc, CGAL_CURVE_IS_TO_RIGHT(*pc,p), p ,false); - - switch(res) - { - case LARGER: - curr = curr.right(); - break; - case SMALLER: - curr = curr.left(); - break; - case EQUAL: - switch(up) - { - case LARGER: - curr = curr.right(); - break; - case SMALLER: - curr = curr.left(); - break; - case EQUAL: - if (curr->is_active()) return CURVE; - curr = curr.left(); - break; - -#ifdef CGAL_TD_DEBUG - default: - CGAL_assertion(up==LARGER||up==SMALLER||up==EQUAL); - return Locate_type(); -#endif - } - break; - -#ifdef CGAL_TD_DEBUG - default: - CGAL_assertion(res == LARGER || res == SMALLER || res == EQUAL); - return Locate_type(); -#endif - - } - } - } - } - else - { - // !is_degenerate() - if (curr->is_active()) - return curr->is_unbounded() ? UNBOUNDED_TRAPEZOID : TRAPEZOID; - curr = curr.left(); - continue; - } - } - } - - Data_structure container2data_structure(map_nodes& ar, int left, - int right) const - { - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(traits); - -#else - - CGAL_assertion(traits); - -#endif - - if (right>left) - { - int d=(int)std::floor((double(right+left))/2); - // Replacing operator [] of map with find to please MSVC 7 - Point p = (ar.find(d)->second)->right(); - //Point p=ar[d]->right(); - Data_structure curr= - Data_structure(X_trapezoid(&p,&p,0,0), - container2data_structure(ar,left,d), - container2data_structure(ar,d+1,right)); - curr.left()->set_node((Data_structure*)&curr.left()); - curr.right()->set_node((Data_structure*)&curr.right()); - curr->set_node(&curr);// fake temporary node - curr->remove(); // mark as deleted - curr->set_node(0); - - return curr; - } - else - // Replacing operator [] of map with find to please MSVC 7 - return ar.find(left)->second; - //return ar[left]; - } - /*============================================== Trapezoidal_decomposition_2 public member functions ==============================================*/ public: - Trapezoidal_decomposition_2(bool rebuild = true) : - depth_threshold(CGAL_TD_DEFAULT_DEPTH_THRESHOLD), - size_threshold(CGAL_TD_DEFAULT_SIZE_THRESHOLD) + + Trapezoidal_decomposition_2(bool with_guarantees = true) : + m_largest_leaf_depth(0), + m_number_of_dag_nodes(1), + m_number_of_curves(0), + traits(0), + m_arr(0), + m_depth_threshold(CGAL_TD_DEFAULT_DEPTH_THRESHOLD), + m_size_threshold(CGAL_TD_DEFAULT_SIZE_THRESHOLD) { init(); - set_needs_update(rebuild); + set_with_guarantees(with_guarantees); } - - Trapezoidal_decomposition_2(const double& depth_th, const double& size_th) : - depth_threshold(depth_th), size_threshold(size_th) + + Trapezoidal_decomposition_2(const double& depth_th, const double& size_th, + bool with_guarantees = true) : + m_largest_leaf_depth(0), + m_number_of_curves(0), + m_number_of_dag_nodes(1), + traits(0), + m_arr(0), + m_depth_threshold(depth_th), + m_size_threshold(size_th) { init(); - set_needs_update(rebuild); + set_with_guarantees(with_guarantees); } - Trapezoidal_decomposition_2(const_Self_ref td) : - needs_update_(td.needs_update_), - number_of_curves_(td.number_of_curves_), - traits(td.traits), - last_cv(NULL), prev_cv(NULL), - depth_threshold(td.depth_threshold), - size_threshold(td.size_threshold) - { - hash_map_tr_ptr htr; - /*! \todo allocate hash_map size according to content. - * \todo change vector<> to in_place_list and pointer hash to trapezoidal - * hash.. - */ - vector_container vtr; - int sz; - Td_active_trapezoid pr; - sz=X_trapezoid_filter(vtr, &td.data_structure()); - //! \todo Reduce the 3 iterations to 1 (or 2) iterator. - // First iteration: filter out the active trapezoids. - typename vector_container::const_iterator it; - for (it=vtr.begin(); it!=vtr.end(); ++it) { - Data_structure* ds_copy=new Data_structure(*it); - const X_trapezoid* cur=&*it; - X_trapezoid* tr_copy=&*(*ds_copy); - tr_copy->set_node(ds_copy); - CGAL_assertion(&*(*tr_copy->get_node())==tr_copy); - ds_copy->set_depth(cur->get_node()->depth()); - // We cheat a little with the depth. - htr.insert(typename hash_map_tr_ptr::value_type(cur, tr_copy)); - // Second iteration: generate new copies of trapezoids and nodes. - } - for (it=vtr.begin(); it!=vtr.end(); ++it) { - const X_trapezoid* cur=&*it; - X_trapezoid* tr_copy=htr.find(cur)->second; - const Data_structure *child; - CGAL_assertion(tr_copy); - tr_copy->set_rt(cur->get_rt() ? - htr.find(cur->get_rt())->second : NULL); - tr_copy->set_rb(cur->get_rb() ? - htr.find(cur->get_rb())->second : NULL); - tr_copy->set_lt(cur->get_lt() ? - htr.find(cur->get_lt())->second : NULL); - tr_copy->set_lb(cur->get_lb() ? - htr.find(cur->get_lb())->second : NULL); - if (cur->get_node()->is_inner_node()) { - child=&cur->get_node()->right(); - while (child && child->is_inner_node() && - !pr(*(*child))) child=&child->left(); - tr_copy->get_node()->set_right(*child); - child=&cur->get_node()->left(); - while (child && child->is_inner_node() && - !pr(*(*child))) child=&child->left(); - tr_copy->get_node()->set_left(*child); - } - // Third iteration: generate links in-between trapezoids - // and in-between nodes . - } - D_S=htr.find(&*(*td.D_S))->second->get_node(); - } + //MICHAL: problematic, should not be used + //Trapezoidal_decomposition_2(const Self& td) + // : m_with_guarantees(td.m_with_guarantees), + // m_number_of_curves(td.m_number_of_curves), + // m_largest_leaf_depth(td.m_largest_leaf_depth), + // m_number_of_dag_nodes(td.m_number_of_dag_nodes), + // traits(td.traits), + // m_arr(td.m_arr), + // last_cv(Td_map_item(0)), prev_cv(Td_map_item(0)), + // m_depth_threshold(td.m_depth_threshold), + // m_size_threshold(td.m_size_threshold) + //{ + // Td_map_item_ptr_map htr; + // /*! \todo allocate hash_map size according to content. + // * \todo change vector<> to in_place_list and pointer hash to trapezoidal + // * hash.. + // */ + // //X_trapezoid_vector vtr; + // std::vector vtr; + // Td_active_map_item pr; + // int sz = Td_map_item_filter(vtr, &td.dag_root()); + // //! \todo Reduce the 3 iterations to 1 (or 2) iterator. + // // First iteration: filter out the active trapezoids. + // typename std::vector::const_iterator it; + // for (it = vtr.begin(); it != vtr.end(); ++it) + // { + // Dag_node* ds_copy = new Dag_node(*it); + // const Td_map_item* cur = &*it; + // Td_map_item* tr_copy = &*(*ds_copy); + // tr_copy->set_dag_node(ds_copy); + // CGAL_assertion(&*(*tr_copy->dag_node()) == tr_copy); + // ds_copy->depth() = cur->dag_node()->depth(); + // // We cheat a little with the depth. + // htr.insert(typename Td_map_item_ptr_map::value_type(cur, tr_copy)); + // // Second iteration: generate new copies of trapezoids and nodes. + // } + // + // for (it = vtr.begin(); it!=vtr.end(); ++it) + // { + // const Td_map_item* cur = &*it; + // Td_map_item* tr_copy = htr.find(cur)->second; + // const Dag_node* child; + // CGAL_assertion(tr_copy); + // tr_copy->set_rt(cur->rt() ? + // htr.find(cur->rt())->second : NULL); + // tr_copy->set_rb(cur->rb() ? + // htr.find(cur->rb())->second : NULL); + // tr_copy->set_lt(cur->lt() ? + // htr.find(cur->lt())->second : NULL); + // tr_copy->set_lb(cur->lb() ? + // htr.find(cur->lb())->second : NULL); + + // if (cur->dag_node()->is_inner_node()) + // { + // child = &cur->dag_node()->right_child(); + // while (child && child->is_inner_node() && !pr(*(*child))) + // child = &child->left_child(); + // tr_copy->dag_node()->set_right_child(*child); + // child = &cur->dag_node()->left_child(); + // while (child && child->is_inner_node() && !pr(*(*child))) + // child = &child->left_child(); + // tr_copy->dag_node()->set_left_child(*child); + // } + // // Third iteration: generate links in-between trapezoids + // // and in-between nodes . + // } + // m_dag_root = htr.find(&*(*td.m_dag_root))->second->dag_node(); + //} + // + /* TODO: Should we add another constructor with non const argument that rebuild the trapezoidal decomposition prior to copy construction? */ virtual ~Trapezoidal_decomposition_2() { + CGAL_warning(m_dag_root != NULL); + if (!m_dag_root) return; -#ifndef CGAL_TD_DEBUG + delete m_dag_root; - CGAL_warning(D_S); - if (!D_S) return; - -#else - - CGAL_assertion(D_S); - -#endif - - delete D_S; + if (traits) + delete traits; } - /* Input: - X_curve - Output: - if X_curve or twin already inserted the latter is returned. - otherwise the left-low most edge-degenerate trapezoid that represents - the input X_curve is returned - Remark: - Given an edge-degenerate trapezoid representing a X_curve, - all the other trapezoids representing the X_curve can be extracted - via moving continously to the left and right neighbours. - */ - X_trapezoid insert(curve_const_ref cv) - { -#ifdef CGAL_TD_DEBUG - *cv.get_parent(); -#endif - /* - Point tmp; - // maintaining some bounding box for future use. + //--------------------------------------------------------------------------- + // Description: + // if Halfedge or twin already inserted the latter is returned. + // otherwise the left-low most edge-degenerate trapezoid that represents the + // input Halfedge is returned + // Remark: + // Given an edge-degenerate trapezoid representing a Halfedge, + // all the other trapezoids representing the Halfedge can be extracted + // via moving continously to the left and right neighbours. + Td_map_item insert(Halfedge_const_handle he); - if (!number_of_curves_) - // give initiale values to bounding points when empty - { - POINT_AT_LEFT_TOP_INFINITY=POINT_AT_RIGHT_BOTTOM_INFINITY= - traits->curve_source(cv); - } - - if (!CGAL_POINT_IS_LEFT_LOW(POINT_AT_LEFT_TOP_INFINITY,tmp= - traits->construct_min_vertex_2_object()(cv))) - POINT_AT_LEFT_TOP_INFINITY=traits->point_to_left(tmp); - if (!traits->point_is_right_top(POINT_AT_RIGHT_BOTTOM_INFINITY,tmp= - traits->construct_max_vertex_2_object()(cv))) - POINT_AT_RIGHT_BOTTOM_INFINITY=traits->point_to_right(tmp); - */ - return insert_in_face_interior(cv); - } - /* Input: - X_curve - Output: - if X_curve or twin already inserted the latter is returned. - otherwise the left-low most edge-degenerate trapezoid that represents the - input X_curve is returned - Remark: - Given an edge-degenerate trapezoid representing a X_curve, - all the other trapezoids representing the X_curve can be extracted - via moving continously to the left and right neighbours. - */ - const X_trapezoid insert_in_face_interior(curve_const_ref cv) + //--------------------------------------------------------------------------- + // Description: + // inserts a range of halfedges into the Search structure. + // First it randomly shuffles the container and then it inserts the Halfedges + // according to the new order + // Precondition: the data structure is empty + template + void insert(Halfedge_iterator begin, Halfedge_iterator end) { -#ifdef CGAL_TD_DEBUG - *cv.get_parent(); -#endif -#ifdef CGAL_TDBB_DEBUG - std::cout << "\ninsert_in_face_interior(" << cv << ")" - << "\nBbox " << traits->bounding_box(); -#endif + //Precondition: the data structure is empty + CGAL_precondition(m_number_of_curves == 0); -#ifdef CGAL_TD_DEBUG - std::cout << "\nTD::insert_in_face_interior(" << cv << ") called with " - << (is_valid(*D_S) ? "valid" : "invalid") << " data structure" - << std::endl; - write(std::cout,*D_S,*traits) << std::endl; -#endif - - if (needs_update_) update(); - // locate the input X_curve end points in the X_trapezoid Dag - - CGAL_assertion(traits); - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(!traits->equal_2_object() - (traits->construct_min_vertex_2_object()(cv), - traits->construct_max_vertex_2_object()(cv))); - -#else - - CGAL_precondition(!traits->equal_2_object() - (traits->construct_min_vertex_2_object()(cv), - traits->construct_max_vertex_2_object()(cv))); - -#endif - - //Point p[2]; - - //int i= CGAL_POINT_IS_LEFT_LOW( - // p[0]=traits->curve_source(cv), - // p[1]=traits->curve_target(cv) - // ) ? 0 : 1; - - //IDIT: change this according to the new traits, we already know which - //point is left and which is right - Point p[2]; - p[0] = traits->construct_min_vertex_2_object()(cv); - p[1] = traits->construct_max_vertex_2_object()(cv); - int i = 0; - // - - Locate_type lt1,lt2; - pointer tr1,tr2; - -#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - - locate_optimization(p[i],tr1,lt1); - -#else - //location of the left endpoint of the curve we're inserting - tr1=&locate(traits->construct_min_vertex_2_object(),lt1); - -#endif - - //the inserted curve should not cut any existing curve - if (lt1==CURVE) - { - CGAL_precondition_msg(lt1!=CURVE,"Input is not planar as\ - one of the input point inside previously inserted X_curve."); - return X_trapezoid(); - } - - //if the curve starts at vertex, we should not insert it into the DAG, - //but we should update all the curves incident to the vertex. - //else if this is a new vertex- insert a node to the DAG that will represent the new vertex. - //the incident curves in this case is only the curve itself, and so it is a trivial operation. - reference t_p1= - (lt1==POINT) ? - insert_curve_at_point_using_geometry(cv,p[i],tr1,lt1) : - insert_curve_at_point_using_data_structure(cv,p[i],tr1,lt1); - -#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - - locate_optimization(p[1-i],tr2,lt2); - locate_opt_empty(); - -#else - // TODO(oren): locating the second endpoint. this is not necessary, - // and time consuming. - tr2=&locate(p[1-i],lt2); - -#endif - - if (lt2==CURVE) - { - CGAL_precondition_msg(lt2!=CURVE,"Input is not planar as\ - one of the input point inside previously inserted X_curve."); - return X_trapezoid(); - } - - reference t_p2= (lt2==POINT) ? - insert_curve_at_point_using_geometry(cv,p[1-i],tr2,lt2) : - insert_curve_at_point_using_data_structure(cv,p[1-i],tr2,lt2); - - // locate and insert end points of the input X_curve to the X_trapezoid - // Dag if needed - Data_structure tt_p1(*t_p1.get_node()); - Data_structure tt_p2(*t_p2.get_node()); - - // create the X_trapezoid iterator for traveling along the Trapezoids that - // intersect the input X_curve, using left-low to right-high order - In_face_iterator it=follow_curve(tt_p1,cv,LARGER); - pointer curr,prev=&t_p1,prev_bottom,prev_top; - pointer old_output = it.operator->(), old_top = 0, old_bottom = 0; - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(!traits->is_degenerate(*old_output)); - -#else - - CGAL_assertion(!traits->is_degenerate(*old_output)); - -#endif - - old_output=0; - Data_structure *tt; - bool first_time=true; - while(!!it) //this means as long as the iterator is valid - { - curr=it.operator->(); - prev_bottom=curr->left_bottom_neighbour(); - prev_top=curr->left_top_neighbour(); - // pass using it along cv - it++; //this is the logic of the iterator. - // the iterator goes to the next trapezoid right-high. - tt = curr->get_node(); - if(first_time) - { - -#ifndef CGAL_TD_DEBUG - - if(!curr->is_top_unbounded()&&traits->equal_2_object()(curr->top(),cv)) - { - CGAL_warning(!traits->equal_2_object()(curr->top(),cv)); - return X_trapezoid(); - } - -#else - - CGAL_precondition(curr->is_top_unbounded()|| - !traits->equal_2_object()(curr->top(),cv)); - -#endif - - } - split_trapezoid_by_curve(*tt,old_output, old_bottom, old_top, cv); - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->equal_2_object()((**tt).top(),cv)); - -#endif - - if(first_time) - { - insert_curve_at_point_using_geometry(*old_output,t_p1); - first_time=false; - } - if (tt->is_inner_node()) - { - // merge adjacent trapezoids on input X_curve's bottom side if possible - if(merge_if_possible(prev_bottom, - tt->left().operator->())) - { - tt->set_left(*(prev_bottom->get_node())); - old_bottom = prev_bottom; - } - // merge adjacent trapezoids on input X_curve's top side if possible - if(merge_if_possible(prev_top, - tt->right().operator->())) - { - tt->set_right(*(prev_top->get_node())); - old_top=prev_top; - } - - // update trapezoid's left/right neighbouring relations - if(!traits->is_degenerate(*prev) && - !traits->is_degenerate(*curr)) - { - curr->set_lb(prev); - curr->set_lt(prev); - prev->set_rb(curr); - prev->set_rt(curr); - } - } - else - { - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(curr->is_valid(traits)); - -#endif - - break; - } - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(curr->is_valid(traits)); - -#endif - - } - -#ifdef CGAL_TD_DEBUG - - CGAL_postcondition(traits->is_degenerate_curve(*old_output)); - CGAL_postcondition(traits->equal_2_object() - ((const X_curve)old_output->top(), - cv)); - -#endif - - insert_curve_at_point_using_geometry(*old_output,t_p2); - number_of_curves_++; - -#ifdef CGAL_TD_DEBUG - write(std::cout,*D_S,*traits) << std::endl; - std::cout << "\nTD::insert_in_face_interior() exited with data structure" - << is_valid(*D_S) << std::endl; -#endif - - return *old_output; - } - - // removal functions - - void remove(curve_const_ref cv) - // We assume here that the input curves are in planar position. - { - remove_in_face_interior(cv); - } - - template - void remove(curve_iterator begin, curve_iterator end) - { - if(begin == end) + if (begin == end) return; - std::random_shuffle(begin,end); + //insert the shuffled halfedges into the search structure - curve_iterator it=begin,next=it; - while(it!=end) {++next;remove(*it);it=next;} - } + //disable the rebuild check from within the halfedge insert and check here + // for rebuild + bool do_rebuild = set_with_guarantees(false); + + bool start_over = true; + while (start_over) + { + start_over = false; + //random_shuffle the range + std::random_shuffle(begin,end); + + Halfedge_const_handle he_cst; + Halfedge_iterator it = begin; + for (; it < end ; ++it) + { + if (do_rebuild && not_within_limits()) + { + std::cout << "starting over after " << number_of_curves() << std::flush; + start_over = true; + clear(); + break; + } + + he_cst = *it; + insert(he_cst); + } + if (it != end) + continue; + + //after inserting the last halfedge in the range + // perform another rebuild check + if (do_rebuild && not_within_limits()) //MICHAL: should I use needs_update() instead (with the random check)? + { + start_over = true; + clear(); + } + } + + //enable the rebuild from within the halfedge insert + set_with_guarantees(do_rebuild); + } + + + // removal functions + + //--------------------------------------------------------------------------- + // Description: + // + void remove(Halfedge_const_handle he); + + ////------------------------------------------------------------------------- + //// Description: + //// + //template + //void remove(curve_iterator begin, curve_iterator end) + //{ + // if(begin == end) + // return; + // + // std::random_shuffle(begin,end); + // + // curve_iterator it=begin,next=it; + // while(it!=end) + // { + // ++next; + // remove(*it); + // it=next; + // } + //} + void clear() { - delete D_S; + delete m_dag_root; init(); } + - void remove_in_face_interior(curve_const_ref cv) - // Assumes the map to be planar. +// //------------------------------------------------------------------------- +// // Description: +// // returns the active trapezoid representing the input point. +// // Precondition: +// // The trapezoidal tree is not empty +// // Postcondition: +// // the input locate type is set to the type of the output trapezoid. +// // Remark: +// // locate call may change the class +// Td_map_item& locate_and_print(std::ostream& out, const Point& p) const +// { +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(traits); +// CGAL_assertion(m_dag_root); +// +//#endif +// +// Dag_node curr = *m_dag_root; //MICHAL: is it ok to add &? +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_precondition(!!curr); +// +//#endif +// //the actual locate. curr is the DAG root, the traits, +// //the point to location, and 0 - indicates point location +// search_and_print_using_dag(out, curr,traits,p,Halfedge_const_handle());//m_empty_he_handle); +// +// +//#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION +// +// locate_opt_push(curr.get_data()); +// +//#endif +// +// return *curr; +// } + + //--------------------------------------------------------------------------- + // Description: + // returns the active trapezoid representing the input point. + // Precondition: + // The trapezoidal tree is not empty + // Postcondition: + // the input locate type is set to the type of the output trapezoid. + // Remark: + // locate call may change the class + Td_map_item& locate(const Point& p,Locate_type &t) const { - -#ifdef CGAL_TD_DEBUG - std::cout << "\nTD::remove_in_face_interior(" << cv << ") called with " - << (is_valid(*D_S) ? "valid" : "invalid") << " data structure" - << std::endl; - write(std::cout,*D_S,*traits) << std::endl; -#endif - - if (needs_update_) update(); - -#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - locate_opt_empty(); -#endif - -#ifndef CGAL_TD_DEBUG - CGAL_warning(traits); -#else - CGAL_assertion(traits); -#endif - - // calculating leftmost and rightmost points of X_curve cv - Point - leftmost=traits->construct_min_vertex_2_object()(cv), - rightmost=traits->construct_max_vertex_2_object()(cv); - Locate_type lt1,lt2; - reference - t1=locate(leftmost,lt1), - t2=locate(rightmost,lt2); - - CGAL_warning(lt1==POINT && lt2==POINT); - if (!(lt1==POINT && lt2==POINT)) return; - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(t1.get_node()); - CGAL_warning(t2.get_node()); - -#endif - - Data_structure - &tt1=*t1.get_node(), - &tt2=*t2.get_node(); - - /* calculate the immediate lower central and upper neighbourhood of - * the curve in the data structure - */ - In_face_iterator - bottom_it(follow_curve(tt1,cv,SMALLER)), - mid_it(follow_curve(tt1,cv,EQUAL)), - top_it(follow_curve(tt1,cv,LARGER)); - - bool bottom, old_bottom = false, end_reached; - map_nodes new_array; - int last_index[]={0,0}; - int sz=0; - Point left=bottom_it->left(),right; - pointer last_bottom,last_top,last=0,old; - -#ifndef CGAL_TD_DEBUG - CGAL_warning(traits->equal_2_object()(top_it->left(),left)); -#else - CGAL_precondition(traits->equal_2_object()(top_it->left(),left)); -#endif - - // remove adjacency at left end point - const_ref first=*mid_it; - //X_curve const * old_cv=&first.top(); - -#ifdef CGAL_TD_DEBUG - CGAL_assertion(traits->equal_2_object()(first.top(),cv)); - CGAL_assertion(traits->equal_2_object()(t1.left(),leftmost)); -#endif - - remove_curve_at_point_using_geometry(first,t1); - - do { - // which of bottom_it,top_it to advance. - bottom=CGAL_POINT_IS_LEFT_LOW(bottom_it->right(),top_it->right()); - Iterator& it = bottom ? bottom_it : top_it; - pointer& last_it = bottom ? last_bottom : last_top; - right=it->right(); - - // copy trapezoid's content and node pointer. - typename map_nodes::value_type - pair(sz, - Data_structure(X_trapezoid(&left, &right, - !bottom_it->is_bottom_unbounded() ? - &bottom_it->bottom() : 0, - !top_it->is_top_unbounded() ? - &top_it->top() : 0))); - new_array.insert(pair); - Data_structure & curr = (new_array.find(sz))->second; - ++sz; - curr->set_node(&curr); - curr->set_lb(bottom_it->left_bottom_neighbour()); - curr->set_lt(top_it->left_top_neighbour()); - if (last) - { - if (traits->trapezoid_top_curve_equal(*last,*curr)) - { - curr->set_lt(last); - } - - if (traits->trapezoid_bottom_curve_equal(*last,*curr)) - { - curr->set_lb(last); - } - } - if (curr->left_bottom_neighbour()) - curr->left_bottom_neighbour()->set_rb(curr.operator->()); - if (curr->left_top_neighbour()) - curr->left_top_neighbour()->set_rt(curr.operator->()); - last=curr.operator->(); - left=right; - last_bottom=bottom_it.operator->(); - last_top=top_it.operator->(); - -#ifdef CGAL_TD_DEBUG - CGAL_warning(last_bottom); - CGAL_warning(last_top); -#endif - - old=it.operator->(); - it++; - end_reached=!bottom_it||!top_it; - if (!bottom_it || - (bottom && !traits->trapezoid_bottom_curve_equal(*old,*it))) - { - pointer rb=old->right_bottom_neighbour(); - if (rb) {rb->set_lb(last);last->set_rb(rb);} - } - if (!top_it || (!bottom && !traits->trapezoid_top_curve_equal(*old,*it))) - { - pointer rt=old->right_top_neighbour(); - if (rt) {rt->set_lt(last);last->set_rt(rt);} - } - -#ifdef CGAL_TD_DEBUG - CGAL_assertion(last->get_node()); -#endif - - if (old_bottom != bottom) - { - Data_structure tmp = - container2data_structure(new_array, last_index[bottom ? 0 : 1], - sz-1); - -#ifdef CGAL_TD_DEBUG - std::cout << "\nremove_in_face_interior allocated "; - write(std::cout,tmp,*traits) << "\ninto "; - write(std::cout,*last_it,*traits,false) << std::endl; -#endif - - last_it->remove(&tmp); - last_index[bottom ? 0 : 1] = sz; - old_bottom = bottom; - } - else - { - Data_structure tmp=container2data_structure(new_array,sz-1,sz-1); - -#ifdef CGAL_TD_DEBUG - std::cout << "\nremove_in_face_interior allocated "; - write(std::cout,tmp,*traits) << "\ninto "; - write(std::cout,*last_it,*traits,false) << std::endl; -#endif - - last_it->remove(&tmp); - last_index[bottom ? 0 : 1] = sz; - } - const Data_structure *real=&last_it->get_node()->left(); - (*real)->set_node((Data_structure*)real); - } - while(!end_reached); - Iterator & it = !old_bottom ? bottom_it : top_it; - -#ifdef CGAL_TD_DEBUG - CGAL_warning(traits->equal_2_object()(it->right(),rightmost)); -#endif - - pointer rb=it->right_bottom_neighbour(),rt=it->right_top_neighbour(); - - Data_structure tmp=container2data_structure(new_array, - last_index[!bottom ? 0 : 1], - new_array.size()-1); - -#ifdef CGAL_TD_DEBUG - std::cout << "\nremove_in_face_interior allocated "; - write(std::cout,tmp,*traits) << "\ninto "; - write(std::cout,*it,*traits,false) << std::endl; -#endif - - it->remove(&tmp); - const Data_structure *real=&it->get_node()->left(); - - (*real)->set_node((Data_structure*)real); - if (rb) {last->set_rb(rb);rb->set_lb(last);} - if (rt) {last->set_rt(rt);rt->set_lt(last);} - - Base_trapezoid_iterator last_mid=mid_it; - while(!!++mid_it) - { - -#ifdef CGAL_TD_DEBUG - CGAL_warning(traits->is_degenerate_curve(*last_mid)); -#endif - - last_mid->remove(); - last_mid=mid_it; - } - - // remove adjacency at right end point - -#ifdef CGAL_TD_DEBUG - CGAL_assertion(traits->equal_2_object()(cv,last_mid->top())); - CGAL_assertion(traits->equal_2_object()(rightmost,t2.left())); -#endif - - remove_curve_at_point_using_geometry(*last_mid,t2); - last_mid->remove(); - - if (is_isolated_point(t1)) remove_split_trapezoid_by_point(tt1,leftmost); - if (is_isolated_point(t2)) remove_split_trapezoid_by_point(tt2,rightmost); - //freeing memory thasht was allocated for X_curve - //delete old_cv; - // reevaluating number of curves - number_of_curves_--; - -#ifdef CGAL_TD_DEBUG - std::cout << "\nTD::remove_in_face_interior() exited with data structure" - << is_valid(*D_S) << std::endl; - write(std::cout,*D_S,*traits) << std::endl; -#endif - - } - /* - output: - The active trapezoid representing the input point. - preconditions: - The trapezoidal tree is not empty - postcondition: - the input locate type is set to the type of the output trapezoid. - remarks: - locate call may change the class - */ - - reference locate(const Point& p,Locate_type &t) const - { - + //print_dag_addresses(*m_dag_root); #ifdef CGAL_TD_DEBUG CGAL_assertion(traits); - CGAL_assertion(D_S); + CGAL_assertion(m_dag_root); #endif - Data_structure curr=*D_S; + Dag_node curr = *m_dag_root; //MICHAL: is it ok to add &? #ifdef CGAL_TD_DEBUG @@ -2343,7 +1558,7 @@ public: #endif //the actual locate. curr is the DAG root, the traits, //the point to location, and 0 - indicates point location - t=search_using_data_structure(curr,traits,p,0); + t = search_using_dag(curr,traits,p,Halfedge_const_handle()); #ifdef CGAL_TD_DEBUG @@ -2354,767 +1569,155 @@ public: #ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - locate_opt_push(curr.operator->()); + locate_opt_push(curr.get_data()); #endif return *curr; } - - /* preconditions: - p is not on an edge or a vertex. - */ - - curve_const_ref vertical_ray_shoot(const Point & p,Locate_type & t, - const bool up_direction = true) const + + //--------------------------------------------------------------------------- + // Description: + // returns the active trapezoid representing the input point. + // Precondition: + // The trapezoidal tree is not empty + // Postcondition: + // the input locate type is set to the type of the output trapezoid. + // Remark: + // locate call may change the class + Td_map_item& locate(const Curve_end& ce, Locate_type& lt) const { + #ifdef CGAL_TD_DEBUG + CGAL_assertion(traits); -#endif - - // We replace the following locate with a direct call to - // search_using_data_structure because we need to deal - // with cases where the source of shoot is a point/curve. - // reference t_p = locate(p,t); + CGAL_assertion(m_dag_root); - Data_structure curr=*D_S; -#ifdef CGAL_TD_DEBUG - CGAL_precondition(!!curr); #endif - t = search_using_data_structure(curr, traits, p, NULL, - up_direction ? - CGAL::LARGER : CGAL::SMALLER); - reference t_p = *curr; + Dag_node curr = *m_dag_root; //MICHAL: is it ok to add &? - //std::cout << "t" << t << "\n"; + //the actual locate. curr is the DAG root, the traits, + //the end point to locate, + //and NULL as cv ptr - indicates point location + lt = search_using_dag (curr, traits, ce, Halfedge_const_handle()); #ifdef CGAL_TD_DEBUG - CGAL_warning(t_p.get_node()); + + CGAL_postcondition(lt == POINT || lt == CURVE || lt == TRAPEZOID || + lt == UNBOUNDED_TRAPEZOID); + #endif - reference tr = **t_p.get_node(); - - // std::cout << "tr" << tr << "\n"; - - // tr should be non degenerate trapezoid - /* using exact traits, it may happen that p is on the - right side of the trapezoid directly under its - right point(analogouly directly above its left point). - with the trapezoid extending to the left. - In this case vertical ray shoot upwards(downwards) - doesn't returns c as output. - - Example. - x---x - p - x------x - */ - - if ((up_direction && !tr.is_right_unbounded() && - (traits->compare_x_2_object()(p,tr.right()) == EQUAL) && - (tr.is_left_unbounded() || - !traits->equal_2_object()(tr.left(),tr.right()))) || - (!up_direction && !tr.is_left_unbounded() && - (traits->compare_x_2_object()(p,tr.left()) == EQUAL) && - (tr.is_right_unbounded() || - !traits->equal_2_object()(tr.left(),tr.right())))) - { - // recalculate vertical ray shoot using locate on point - return up_direction ? - locate(tr.right(),t).top() : locate(tr.left(),t).bottom(); - } - - curve_const_ref c = up_direction ? tr.top() : tr.bottom(); - if (up_direction ? tr.is_top_unbounded() : tr.is_bottom_unbounded()) - { - t=UNBOUNDED_TRAPEZOID; - } - else - { - // Now we know that the trapezoid is bounded on in the - // direction of the shoot. - t = (traits->equal_2_object() - (p,traits->construct_min_vertex_2_object()(c)) || - traits->equal_2_object() - (p,traits->construct_max_vertex_2_object()(c))) ? - POINT : CURVE; - } - return c; - } - - /* Input: - 1 whole curves - 2 partial curves - Output: - X_curve - precondition: - c - The first input X_curve is the union of the other two. - The intersection of the latter is a point inside the - interior of the former. - The latter are ordered from left-down to right-up - postcondition: - The first input X_curve is broken into two curves - corresponding to the input. - The output is the degenerate point trapezoid that - corresponds to the splitting point.*/ - - void split_edge(curve_const_ref cv,curve_const_ref cv1, curve_const_ref cv2) - { - -#ifdef CGAL_TD_DEBUG - std::cout << "\nTD::split_edge(" << cv << "," << cv1 << "," << cv2 - << ") called with " << (is_valid(*D_S) ? "valid" : "invalid") - << " data structure" << std::endl; - write(std::cout,*D_S,*traits) << std::endl; -#endif - - if (needs_update_) update(); #ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - locate_opt_empty(); + locate_opt_push(curr.get_data()); #endif -#ifndef CGAL_TD_DEBUG - - if (!traits) - { - CGAL_warning(traits); - return; - } - if (!traits->are_mergeable_2_object()(cv1,cv2)) - { - CGAL_warning(traits->are_mergeable_2_object()(cv1,cv2)); - return; - } - -#else - - if (!traits->are_mergeable_2_object()(cv1,cv2)) - { - std::cerr << "\ncv " << cv; - std::cerr << "\ncv1 " << cv1; - std::cerr << "\ncv2 " << cv2 << std::endl; - } + return curr.get_data(); + } + + //--------------------------------------------------------------------------- + // Description: + // returns the active trapezoid containing the point represented by vertex. + // Precondition: + // The trapezoidal tree is not empty + // Postcondition: + // the input locate type is set to the type of the output trapezoid. + // Remark: + // locate call may change the class + Td_map_item& locate( Vertex_const_handle v, Locate_type& lt) const + { CGAL_precondition(traits); - CGAL_precondition(traits->are_mergeable_2_object()(cv1,cv2)); - -#endif - - // spliting point - Point p = - traits->equal_2_object()(traits->construct_max_vertex_2_object()(cv1), - traits->construct_min_vertex_2_object()(cv2)) ? - traits->construct_max_vertex_2_object()(cv1) : - traits->construct_max_vertex_2_object()(cv2); - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(CGAL_POINT_IS_LEFT_LOW - (traits->construct_min_vertex_2_object()(cv),p)); - - CGAL_warning(CGAL_POINT_IS_RIGHT_TOP - (traits->construct_max_vertex_2_object()(cv),p)); - -#else - - CGAL_precondition(CGAL_POINT_IS_LEFT_LOW - (traits->construct_min_vertex_2_object()(cv),p)); - - CGAL_precondition(CGAL_POINT_IS_RIGHT_TOP - (traits->construct_max_vertex_2_object()(cv),p)); - -#endif - - // extremal points - Point - leftmost=traits->construct_min_vertex_2_object()(cv), - rightmost=traits->construct_max_vertex_2_object()(cv); - Locate_type lt1,lt2; - // representing trapezoids for extremal points - reference - t1=locate(leftmost,lt1), - t2=locate(rightmost,lt2); - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(lt1==POINT && lt2==POINT); - CGAL_warning(t1.is_active() && t2.is_active()); - -#else - - CGAL_precondition(lt1==POINT && lt2==POINT); - CGAL_precondition(t1.is_active() && t2.is_active()); - CGAL_warning(t1.get_node()); - CGAL_warning(t2.get_node()); - -#endif - - Data_structure - &tt1=*t1.get_node(); - In_face_iterator - bottom_it(follow_curve(tt1,cv,SMALLER)), - mid_it(follow_curve(tt1,cv,EQUAL)), - top_it(follow_curve(tt1,cv,LARGER)); - Locate_type lt; - reference old_t=locate(p,lt); - //X_curve const * old_cv=&old_t.top(); - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(lt==CURVE); - CGAL_precondition(old_t.is_active()); - CGAL_warning(old_t.get_node()); - -#endif - - Data_structure - &old_tt=*old_t.get_node(); - - // previous left and right sons of old_tt - const Data_structure - &old_left=old_tt.left(), - &old_right=old_tt.right(); - - X_curve left_cv,right_cv; - if (traits->equal_2_object()(traits->construct_min_vertex_2_object()(cv2),p)) - { - left_cv=cv1; - right_cv=cv2; - } - else - { - left_cv=cv2; - right_cv=cv1; - } - const Data_structure - &new_left_tt=Data_structure(X_trapezoid(old_t.left(), p, left_cv, - left_cv), old_left, old_right), - &new_right_tt=Data_structure(X_trapezoid(p, old_t.right(), right_cv, - right_cv), old_left, old_right), - &new_tt=Data_structure(X_trapezoid(p, p, left_cv, right_cv), new_left_tt, - new_right_tt); - reference - new_left_t=*new_left_tt, - new_right_t=*new_right_tt, - new_t=*new_tt; - - /* locate trapezoid trees that correspond to the closest - trapezoids above and below p */ - pointer - left_top_t=top_it.operator->(), - left_bottom_t=bottom_it.operator->(); - while(CGAL_POINT_IS_LEFT_LOW(left_top_t->right(),p)) - left_top_t=left_top_t->right_bottom_neighbour(); - while(CGAL_POINT_IS_LEFT_LOW(left_bottom_t->right(),p)) - left_bottom_t=left_bottom_t->right_top_neighbour(); - Data_structure - left_top=*left_top_t->get_node(), - left_bottom=*left_bottom_t->get_node(); - - replace_curve_at_point_using_geometry(cv,left_cv,t1); - replace_curve_at_point_using_geometry(cv,right_cv,t2); - // the point p belongs to cv interior - new_t.set_rt(&new_left_t); - new_t.set_lb(&new_right_t); - new_left_t.set_lb(old_t.left_bottom_neighbour() != &old_t ? - old_t.left_bottom_neighbour() : &new_left_t); - new_left_t.set_rt(&new_right_t); - new_right_t.set_lb(&new_left_t); - new_right_t.set_rt(old_t.right_top_neighbour() != &old_t ? - old_t.right_top_neighbour() : &new_right_t); - - // update geometric boundary for trapezoids representing cv - pointer prev=0; - while(*mid_it != old_t) { - mid_it->set_top(left_cv); - mid_it->set_bottom(left_cv); - mid_it->set_right(p); - prev=mid_it.operator->();mid_it++; - } - if (prev) - { - prev->set_rb(&new_left_t); - } - // new_left_t is leftmost representative for cv - else - { - replace_curve_at_point_using_geometry(new_left_t,t1); - } - if (t1.right_top_neighbour()==&old_t) t1.set_rt(&new_left_t); - if (t1.left_bottom_neighbour()==&old_t) t1.set_lb(&new_left_t); - mid_it++; - new_right_t.set_rb(mid_it.operator->()); - prev=0; - while(!!mid_it) { - mid_it->set_top(right_cv); - mid_it->set_bottom(right_cv); - mid_it->set_left(p); - prev=mid_it.operator->(); - mid_it++; - } - if (prev) - { - new_right_t.set_rb(old_t.right_bottom_neighbour()); - } - else - // new_right_t is rightmost representative for cv - { - replace_curve_at_point_using_geometry(new_right_t,t2,false); - } - if (t2.right_top_neighbour()==&old_t) t2.set_rt(&new_right_t); - if (t2.left_bottom_neighbour()==&old_t) t2.set_lb(&new_right_t); - - /* update geometric boundary for trapezoids below cv*/ - while (*bottom_it!=*left_bottom) - { - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->equal_2_object()(bottom_it->top() - ,cv)); - -#endif - - bottom_it->set_top(left_cv); - bottom_it++; - } - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(*bottom_it==*left_bottom); - -#endif - - Data_structure &bottom_tt=*bottom_it->get_node(); - bottom_it++; - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->is_in_closure(*bottom_tt,p)); - -#endif - - split_trapezoid_by_point(bottom_tt,p,left_cv,right_cv); - // set the splitting trapezoid to be the same one that splits the - // X_curve'like trapezoid - *bottom_tt=new_t; - // update top curves - bottom_tt.left()->set_top(left_cv); - bottom_tt.right()->set_top(right_cv); - // left and right are not neighbours. - bottom_tt.left()->set_rt(0); - bottom_tt.right()->set_lt(0); - while(!!bottom_it) - { - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->equal_2_object()(bottom_it->top(),cv)); - -#endif - - bottom_it->set_top(right_cv); - bottom_it++; - } - /* update geometric boundary for trapezoids above cv*/ - while (*top_it!=*left_top) - { - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->equal_2_object()(top_it->bottom(),cv)); - -#endif - - top_it->set_bottom(left_cv); - top_it++; - } - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(*top_it==*left_top); - -#endif - - Data_structure &top_tt=*top_it->get_node(); - top_it++; - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->is_in_closure(*bottom_tt,p)); - -#endif - - split_trapezoid_by_point(top_tt,p,left_cv,right_cv); - // set the splitting trapezoid to be the same one that splits the - // X_curve'like trapezoid - *top_tt=new_t; - // update bottom side - top_tt.left()->set_bottom(left_cv); - top_tt.right()->set_bottom(right_cv); - // left and right aren't neighbours - top_tt.left()->set_rb(0); - top_tt.right()->set_lb(0); - while(!!top_it) - { - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(traits->equal_2_object()(top_it->bottom(),cv)); - -#else - - if (!traits->equal_2_object()(top_it->bottom(),cv)) - std::cout << "\ntop_it->bottom() "<< top_it->bottom() << "\t cv= " - << cv; - CGAL_assertion(traits->equal_2_object()(top_it->bottom(),cv)); - -#endif - - top_it->set_bottom(right_cv); - top_it++; - } - // mark inactive trapezoids - old_t.remove((Data_structure*)&new_tt); - const Data_structure - *newPtr=&old_t.get_node()->left(), - *newleftPtr=&newPtr->left(), - *newrightPtr=&newPtr->right(), - *oldleftPtr=&newleftPtr->left(), - *oldrightPtr=&newleftPtr->right(); - (*newPtr)->set_node((Data_structure*)newPtr); - (*newleftPtr)->set_node((Data_structure*)newleftPtr); - (*newrightPtr)->set_node((Data_structure*)newrightPtr); - (*oldleftPtr)->set_node((Data_structure*)oldleftPtr); - (*oldrightPtr)->set_node((Data_structure*)oldrightPtr); - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(old_tt->is_valid(traits)); - CGAL_assertion(new_tt->is_valid(traits)); - CGAL_assertion((*newPtr)->is_valid(traits)); - CGAL_assertion((*newleftPtr)->is_valid(traits)); - CGAL_assertion((*newrightPtr)->is_valid(traits)); - CGAL_assertion((*oldleftPtr)->is_valid(traits)); - CGAL_assertion((*oldrightPtr)->is_valid(traits)); - CGAL_assertion(top_tt->is_valid(traits)); - CGAL_assertion(bottom_tt->is_valid(traits)); - CGAL_assertion(old_left->is_valid(traits)); - CGAL_assertion(old_right->is_valid(traits)); - CGAL_assertion(traits->is_degenerate_point(**newPtr)); - CGAL_assertion(traits->is_degenerate_curve(**newleftPtr)); - CGAL_assertion(traits->is_degenerate_curve(**newrightPtr)); - CGAL_assertion(traits->equal_2_object() - (traits->construct_min_vertex_2_object() - ((*newrightPtr)->bottom()), - (*newPtr)->right() - ) - ); - CGAL_assertion(traits->equal_2_object() - (traits->construct_max_vertex_2_object() - ((*newleftPtr)->top()), - (*newPtr)->left() - ) - ); -#endif - - // reevaluating number of curves - number_of_curves_++; - -#ifdef CGAL_TD_DEBUG - std::cout << "\nTD::split_edge() exited with data structure" - << is_valid(*D_S) << std::endl; - write(std::cout,*D_S,*traits) << std::endl; -#endif - + return locate(traits->vtx_to_ce(v), lt); } + + //--------------------------------------------------------------------------- + // Description: + // + // preconditions: + // p is not on an edge or a vertex. + Td_map_item& vertical_ray_shoot(const Point& p,Locate_type& t, + const bool up_direction = true) const; - void merge_edge( - curve_const_ref cv1 , - curve_const_ref cv2, - curve_const_ref cv) + + ////MICHAL: commented due to inefficient depth update, remove and insert instead + //void before_split_edge(const X_monotone_curve_2& cv, + // const X_monotone_curve_2& cv1, + // const X_monotone_curve_2& cv2); + + ////MICHAL: commented due to inefficient depth update, remove and insert instead + ////------------------------------------------------------------------------- + //// Description: + //// Input: + //// 1 whole curves + //// 2 partial halfedge_handle-s + //// precondition: + //// The two halfedges are valid + //// The first input curve is the union of the two halfedges. + //// The intersection of the latter is a point inside the + //// interior of the former. + //// The latter are ordered from left-down to right-up + //// postcondition: + //// The first input curve is broken into two halfedges + //// corresponding to the input. + //void split_edge(const X_monotone_curve_2& cv, Halfedge_const_handle he1, + // Halfedge_const_handle he2); + + + void merge_edge(Halfedge_const_handle he1, Halfedge_const_handle he2, + const X_monotone_curve_2& cv); + + + void after_merge_edge(Halfedge_const_handle merged_he, + Halfedge_const_handle before_mrg_he) { - -#ifdef CGAL_TD_DEBUG - std::cout << "\nTD::merge_edge(" << cv1 << "," << cv2 << "," << cv - << ") called with " << (is_valid(*D_S) ? "valid" : "invalid") - << " data structure" << std::endl; - write(std::cout,*D_S,*traits) << std::endl; -#endif - - if (needs_update_) update(); - -#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - - locate_opt_empty(); - -#endif - -#ifndef CGAL_TD_DEBUG - - if (!traits) - { - CGAL_warning(traits); - return; - } - if (!traits->are_mergeable_2_object()(cv1,cv2)) - { - CGAL_warning(traits->are_mergeable_2_object()(cv1,cv2)); - return; - } - -#else - if (!traits->are_mergeable_2_object()(cv1,cv2)) - { - std::cerr << "\ncv " << cv; - std::cerr << "\ncv1 " << cv1; - std::cerr << "\ncv2 " << cv2 << std::endl; - } - CGAL_assertion(traits); - CGAL_precondition(traits->are_mergeable_2_object()(cv1,cv2)); - -#endif - Point p= - // Calculate the common point of cv1 and cv2. - // There should be one! - traits->equal_2_object()(traits->construct_max_vertex_2_object()(cv1), - traits->construct_min_vertex_2_object()(cv2)) ? - traits->construct_max_vertex_2_object()(cv1) : - // [-- cv1 -->] p [-- cv2 -->] or [<-- cv2 --] p [<-- cv1 --] - traits->equal_2_object()(traits->construct_min_vertex_2_object()(cv1), - traits->construct_max_vertex_2_object()(cv2)) ? - // [<-- cv1 --] p [<-- cv2 --] or [-- cv2 -->] p [-- cv1 -->] - traits->construct_min_vertex_2_object()(cv1) : // - traits->equal_2_object()(traits->construct_min_vertex_2_object()(cv1), - traits->construct_min_vertex_2_object()(cv2)) ? - // [<-- cv1 --] p [-- cv2 -->] - traits->construct_min_vertex_2_object()(cv1) : - // [-- cv1 -->] p [<-- cv2 --] - traits->construct_max_vertex_2_object()(cv1); - -#ifdef CGAL_TD_DEBUG - // p is interior to the union curve - CGAL_precondition(CGAL_POINT_IS_LEFT_LOW - (traits->construct_min_vertex_2_object()(cv), p)); - CGAL_precondition(CGAL_POINT_IS_RIGHT_TOP - (traits->construct_max_vertex_2_object()(cv), p)); -#endif - - Point - leftmost=traits->construct_min_vertex_2_object()(cv), - rightmost=traits->construct_max_vertex_2_object()(cv); - Locate_type lt1,lt2,lt; - reference - t1=locate(leftmost,lt1), - t2=locate(rightmost,lt2), - t=locate(p,lt); - -#ifndef CGAL_TD_DEBUG - - CGAL_warning(t1.get_node()); - CGAL_warning(t2.get_node()); - CGAL_warning(t.get_node()); - -#else - - CGAL_precondition(lt1==POINT && lt2==POINT && lt==POINT); - CGAL_precondition(t1.is_active() && t2.is_active() && t.is_active()); - CGAL_assertion(t1.get_node()); - CGAL_assertion(t2.get_node()); - CGAL_assertion(t.get_node()); - -#endif - - X_curve left_cv,right_cv; - if (traits->equal_2_object()(traits->construct_min_vertex_2_object()(cv2),p)) - { - left_cv=cv1; - right_cv=cv2; - } - else - { - left_cv=cv2; - right_cv=cv1; - } - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(traits->equal_2_object()(t1.left(), leftmost)); - CGAL_assertion(traits->equal_2_object()(t2.right(), rightmost)); - CGAL_assertion(CGAL_POINT_IS_LEFT_LOW(leftmost, p)); - CGAL_assertion(CGAL_POINT_IS_LEFT_LOW(p, rightmost)); - CGAL_assertion(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(left_cv), - leftmost)); - CGAL_assertion(traits->equal_2_object() - (traits->construct_max_vertex_2_object()(left_cv), p)); - CGAL_assertion(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(right_cv), p)); - CGAL_assertion(traits->equal_2_object() - (traits->construct_max_vertex_2_object()(right_cv), - rightmost)); - CGAL_assertion(traits->equal_2_object() - (traits->construct_min_vertex_2_object()(cv), leftmost)); - CGAL_assertion(traits->equal_2_object() - (traits->construct_max_vertex_2_object()(cv), rightmost)); - -#endif - - Data_structure - &tt1=*t1.get_node(), - &tt=*t.get_node(); - In_face_iterator - bottom_left_it(follow_curve(tt1,left_cv,SMALLER)), - mid_left_it(follow_curve(tt1,left_cv,EQUAL)), - top_left_it(follow_curve(tt1,left_cv,LARGER)), - bottom_right_it(follow_curve(tt,right_cv,SMALLER)), - mid_right_it(follow_curve(tt,right_cv,EQUAL)), - top_right_it(follow_curve(tt,right_cv,LARGER)); - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(bottom_left_it.operator->()); - CGAL_assertion(mid_left_it.operator->()); - CGAL_assertion(top_left_it.operator->()); - CGAL_assertion(bottom_right_it.operator->()); - CGAL_assertion(mid_right_it.operator->()); - CGAL_assertion(top_right_it.operator->()); - CGAL_assertion(bottom_left_it->is_active()); - CGAL_assertion(mid_left_it->is_active()); - CGAL_assertion(top_left_it->is_active()); - CGAL_assertion(bottom_right_it->is_active()); - CGAL_assertion(mid_right_it->is_active()); - CGAL_assertion(top_right_it->is_active()); - -#endif - - pointer - left=mid_left_it.operator->(), - mid_left=0, - mid_right=mid_right_it.operator->(), - top_left=0, - top_right=top_right_it.operator->(), - bottom_left=0, - bottom_right=bottom_right_it.operator->(), - right=0, - dummy=0, - dummy2=0; - replace_curve_using_geometry(mid_left_it,left_cv,cv,mid_left); - replace_curve_using_geometry(mid_right_it,right_cv,cv,right); - replace_curve_using_geometry(top_left_it,left_cv,cv,top_left); - replace_curve_using_geometry(top_right_it,right_cv,cv,dummy); - replace_curve_using_geometry(bottom_left_it,left_cv,cv,bottom_left); - replace_curve_using_geometry(bottom_right_it,right_cv,cv,dummy2); - // merge trapezoids splited by the upward and downward - // vertical extensions from p - -#ifndef CGAL_TD_DEBUG - - merge_if_possible(top_left,top_right); - merge_if_possible(bottom_left,bottom_right); - -#else - - CGAL_warning(top_left); - CGAL_warning(top_right); - CGAL_warning(merge_if_possible(top_left,top_right)); - CGAL_warning(bottom_left); - CGAL_warning(bottom_right); - CGAL_warning(merge_if_possible(bottom_left,bottom_right)); - -#endif - - // mark older trapezoids as inactive - top_right->remove(top_left->get_node()); - bottom_right->remove(bottom_left->get_node()); - -#ifdef CGAL_TD_DEBUG - - CGAL_warning(mid_left); - CGAL_warning(mid_right); - CGAL_warning(tt->is_active()); - -#endif - - // make p's representative inactive - tt->remove(); - mid_left->set_rb(mid_right); - mid_left->set_right(mid_right->right()); - mid_right->set_left(mid_left->left()); - mid_left->set_rt(0); - mid_right->set_lb(0); - replace_curve_at_point_using_geometry(left_cv,cv,t1); - replace_curve_at_point_using_geometry(right_cv,cv,t2); - -#ifdef CGAL_TD_DEBUG - - CGAL_warning(left); - CGAL_warning(right); - -#endif - - replace_curve_at_point_using_geometry(*left,t1,true); - replace_curve_at_point_using_geometry(*right,t2,false); - // reevaluating number of curves - number_of_curves_--; - -#ifdef CGAL_TD_DEBUG - std::cout << "\nTD::merge_edge() exited with data structure" - << is_valid(*D_S) << std::endl; - write(std::cout,*D_S,*traits) << std::endl; -#endif - + //Precondition: + // the merge uses the suspected halfedge before the arrangement merge + CGAL_precondition(merged_he == before_mrg_he || + merged_he == before_mrg_he->twin()); } + unsigned long size() const { - return D_S->size(); - } - unsigned long depth() const - { - return D_S->depth(); - } - unsigned long number_of_curves() const - { - return number_of_curves_; - } - void init_traits(const_Traits_ptr t) - { - traits = t; - -#ifdef CGAL_TD_DEBUG - - CGAL_assertion(!!*D_S); - -#endif - + return m_dag_root->size(); } - /* update geometric boundary(top and bottom) for trapezoids - traveled along an iterator till end reached - precondition: - end==0 or end is on the path of the iterator - postcondition: - end is pointer to the last trapezoid encountered,if any - */ + unsigned long number_of_curves() const + { + return m_number_of_curves; + } + + void init_arrangement_and_traits(const Arrangement_on_surface_2* arr, + bool allocate_traits = true) + { + m_arr = arr; + m_trts_adaptor = + static_cast (arr->geometry_traits()); + + if (allocate_traits) + traits = new Td_traits(*m_trts_adaptor); + } + + + +#ifdef CGAL_TD_DEBUG /*------------------------------------------------------------------ description: returns whether the Trapezoidal Dag is valid */ - -#ifdef CGAL_TD_DEBUG - bool is_valid(const Data_structure& ds) const + bool is_valid(const Dag_node& ds) const { if ( !ds ) return true; - if (ds->is_valid(traits) && ds->get_node() && - is_valid(ds.left()) && is_valid(ds.right())) return true; + if (ds->is_valid(traits) && ds->dag_node() && + is_valid(ds.left_child()) && is_valid(ds.right_child())) + return true; CGAL_warning(ds->is_valid(traits)); - CGAL_warning(ds->get_node()); - CGAL_warning(is_valid(ds.left())); - CGAL_warning(is_valid(ds.right())); + CGAL_warning(ds->dag_node()); + CGAL_warning(is_valid(ds.left_child())); + CGAL_warning(is_valid(ds.right_child())); return false; } /*------------------------------------------------------------------ @@ -3123,15 +1726,15 @@ public: */ bool is_valid() const { - return is_valid(*D_S); - } - void debug() const - { - std::cout << "\nTrapezoidal_decomposition_2::debug()\n" << *this - << std::endl; - X_trapezoid x; - x.debug(); + return is_valid(*m_dag_root); } + //void debug() const + //{ + // std::cout << "\nTrapezoidal_decomposition_2::debug()\n" << *this + // << std::endl; + // Td_map_item x; + // x.debug(); //MICHAL: will not work! + //} #endif /*------------------------------------------------------------------ @@ -3145,38 +1748,46 @@ public: Self& rebuild() { #ifdef CGAL_TD_DEBUG - std::cout << "\nrebuild()" << std::flush; + std::cout << "\nrebuild! " << m_number_of_curves << std::endl + << std::flush; +#endif + + Halfedge_container container; + +#ifdef CGAL_TD_DEBUG + unsigned long rep = Halfedge_filter(container, &dag_root()); #endif - X_curve_container container; - unsigned long rep = X_curve_filter(container, &data_structure()); clear(); - // initialize container to point to curves in X_trapezoid Tree - if (rep>0) - { - bool o=set_needs_update(false); - typename std::vector::iterator it = container.begin(), - it_end = container.end(); - while(it!=it_end) - { - insert(*it); - ++it; - } - set_needs_update(o); - } - + //// initialize container to point to curves in Td_map_item Tree + //if (rep>0) + //{ + // bool o = set_with_guarantees(false); + // typename std::vector::iterator + // it = container.begin(), + // it_end = container.end(); + // while(it!=it_end) + // { + // insert(*it); + // ++it; + // } + // set_with_guarantees(o); + //} + + //insert the already inserted curves from scratch in order to build a + // search structure guaranteeing logarithmic query time and linear size + insert(container.begin(), container.end()); + #ifdef CGAL_TD_DEBUG - CGAL_assertion(is_valid()); - unsigned long sz=number_of_curves(); - if(sz!=rep) + unsigned long sz = number_of_curves(); + if (sz != rep) { std::cerr << "\nnumber_of_curves()=" << sz; std::cerr << "\nrepresentatives.size()=" << rep; - CGAL_assertion(number_of_curves()==rep); + CGAL_assertion(number_of_curves() == rep); } - #endif container.clear(); @@ -3185,45 +1796,46 @@ public: /* Input: - a list of pointers to X_trapezoids and a X_trapezoid boolean predicate. + a list of pointers to Td_map_items and a Td_map_item boolean predicate. Output: void Postcondition: - the list pointers correspond to all the X_trapezoids in the data + the list pointers correspond to all the Td_map_items in the data structure for which the predicate value is true. */ - template - void filter(Container& c, const Predicate& pr, - const Data_structure * ds) const + template + void filter(Container& c, const Predicate& pr, const Dag_node * ds) const { CGAL_assertion(ds); ds->filter(c,pr); } - template + template void filter(Container& c, const Predicate& pr) const { - filter(c, pr, &data_structure()); + filter(c, pr, &dag_root()); } - template - unsigned long X_trapezoid_filter(Container& container, - const Data_structure* ds) const - /* Return a container for all active trapeozoids */ - { - ds->filter(container, Td_active_trapezoid()); - return container.size(); - } - template - unsigned long X_curve_filter(X_curve_container& container, - const Data_structure* ds) const + ////MICHAL: not in use + //template + //unsigned long Td_map_item_filter(Container& container, + // const Dag_node* ds) const + ///* Return a container for all active map items */ + //{ + // ds->filter(container, Td_active_map_item()); + // return container.size(); + //} + + template + unsigned long Halfedge_filter(Halfedge_container& container, + const Dag_node* ds) const /* Return a container for all active curves */ { - unsigned long sz=number_of_curves(); - list_container representatives; - ds->filter(representatives, - Td_active_right_degenerate_curve_trapezoid(*traits)); + unsigned long sz = number_of_curves(); + std::list representatives; + //X_trapezoid_list representatives; + ds->filter(representatives, Td_active_edge_item(*traits)); #ifndef CGAL_TD_DEBUG @@ -3232,7 +1844,7 @@ public: #else unsigned long rep=representatives.size(); - if (sz!=rep) + if (sz != rep) { std::cerr << "\nnumber_of_curves()=" << sz; std::cerr << "\nrepresentatives.size()=" << rep; @@ -3241,13 +1853,16 @@ public: #endif - if (sz>0) + if (sz > 0) { - typename list_container::iterator it = representatives.begin(), + typename std::list::iterator it = representatives.begin(), it_end = representatives.end(); - while(it!=it_end) + //typename X_trapezoid_list::iterator it = representatives.begin(), + // it_end = representatives.end(); + while(!(it==it_end)) { - container.push_back(it->top()); + Td_active_edge e (boost::get(*it)); + container.push_back(e.halfedge()); //it represents an active trapezoid ++it; } } @@ -3260,10 +1875,8 @@ public: /*------------------------------------------------------------------ - Input: - None - Output: - bool + Input: None + Output: bool Description: determines according to pre defined conditions whether the current Trapezoidal_decomposition_2 needs update @@ -3273,20 +1886,22 @@ public: size is more then SizeThreshold times the log of the last count. */ - bool set_needs_update(bool u) + bool set_with_guarantees(bool u) { - bool old=needs_update_; - needs_update_=u; + bool old = m_with_guarantees; + m_with_guarantees = u; return old; } - bool needs_update() + //This method occasionaly(!) checks the guarantees + // It is currently not in use, since the guarantees are constantly checked in O(1) time + bool needs_update() { - unsigned long sz = number_of_curves(); + unsigned long num_of_cv = number_of_curves(); //to avoid signed / unsigned conversion warnings // rand() returns an int but a non negative one. if (static_cast(std::rand()) > - RAND_MAX / (sz+1)) + RAND_MAX / ( num_of_cv + 1)) return false; /* INTERNAL COMPILER ERROR overide #ifndef __GNUC__ @@ -3294,25 +1909,13 @@ public: #ifdef CGAL_TD_REBUILD_DEBUG std::cout << "\n|heavy!" << std::flush; #endif - return - depth()>(get_depth_threshold()*(std::log(double(sz+1)))) - || size()>(get_size_threshold()*(sz+1)); - /* - #else - // to avoid comparison between signed and unsigned - return ((depth()/10)>log(sz+1))||((size()/10)>(sz+1)); - //return ((((signed)depth())/10)>log(sz+1))|| - ((((signed)size())/10)>(sz+1)); - - #endif - */ + + return not_within_limits(); } /*------------------------------------------------------------------ - input: - None - output: - bool + input: None + output: bool Description: uses needs_update to determine whether the Trapezoidal_decomposition_2 needs update @@ -3322,80 +1925,128 @@ public: */ bool update() { -#ifdef CGAL_TD_REBUILD_DEBUG - std::cout << "\n|" << needs_update() << std::flush; -#endif - if (needs_update()) {rebuild();return true;} + //if the structure violates the guarantees - rebuild + if (not_within_limits()) //needs_update()) + { + rebuild(); + return true; + } return false; } + bool not_within_limits() + { + unsigned long num_of_cv = number_of_curves(); + + //Cond 1: Depth is greater than threshold*log(number of curves) + bool cond1 = largest_leaf_depth() > + (depth_threshold()*(std::log(double(num_of_cv+1)))); + //Cond 2: Number of nodes is greater than threshold*number of curves + bool cond2 = number_of_dag_nodes() > (size_threshold()*(num_of_cv + 1)); + + //return true if at least one of the conditions is true + return cond1 || cond2; + } + /* returns a reference to the internal data structure */ - const Data_structure& data_structure() const {return *D_S;} + const Dag_node& dag_root() const {return *m_dag_root;} /* returns a reference to the internal data structure */ - const_Traits_ref get_traits() const {return *traits;} + const Traits& get_traits() const {return *traits;} /* returns a reference to the internal depth threshold constant */ - const double& get_depth_threshold() const + const double& depth_threshold() const { - return depth_threshold; - } - /* returns a reference to the internal size threshold constant */ - const double& get_size_threshold() const - { - return size_threshold; + return m_depth_threshold; } + /* sets the internal depth threshold constant to the parameter and returns its reference */ - const double& set_depth_threshold(const double& depth_th) + void depth_threshold(const double& depth_th) { - return depth_threshold=depth_th; + m_depth_threshold = depth_th; + } + + /* returns a reference to the internal size threshold constant */ + const double& size_threshold() const + { + return m_size_threshold; } /* sets the internal size threshold constant to the parameter and returns its reference */ - const double& set_size_threshold(const double& size_th) + void size_threshold(const double& size_th) { - return size_threshold=size_th; + m_size_threshold = size_th; } + + void update_largest_leaf_depth( unsigned long depth ) + { + if(m_largest_leaf_depth < depth ) + m_largest_leaf_depth = depth; + } + + unsigned long largest_leaf_depth() + { + //CGAL_assertion((m_largest_leaf_depth + 1) == m_dag_root->rec_depth()); + return m_largest_leaf_depth; + } + + unsigned long number_of_dag_nodes() + { + //CGAL_assertion(m_number_of_dag_nodes == m_dag_root->size()); + return m_number_of_dag_nodes; + } + + unsigned long longest_query_path_length() + { + return longest_query_path_length_rec(true, *m_dag_root, + true, *m_dag_root, *m_dag_root); + } + + protected: - Data_structure* D_S; - bool needs_update_; - unsigned long number_of_curves_; - const_Traits_ptr traits; + //Trapezoidal Decomposition data members + Dag_node* m_dag_root; + unsigned long m_largest_leaf_depth; //holds the leargest depth of a leaf in the DAG + unsigned long m_number_of_dag_nodes; //holds the number of nodes in the DAG + bool m_with_guarantees; //whether the structure holds logarithmic query time and linear size guarantees //m_needs_update; + unsigned long m_number_of_curves; + const Traits* traits; + //Before_split_data m_before_split; + const Arrangement_on_surface_2* m_arr; + const Traits_adaptor_2* m_trts_adaptor; + + Halfedge_const_handle m_empty_he_handle; + private: #ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - mutable pointer last_cv,prev_cv; + mutable Td_map_item last_cv; + mutable Td_map_item prev_cv; #endif - + + unsigned long longest_query_path_length_rec(bool minus_inf, + Dag_node& min_node, + bool plus_inf, + Dag_node& max_node, + Dag_node& node); + void init() { // traits may be initialized later - D_S = new Data_structure(X_trapezoid()); - (*D_S)->set_node(D_S); + m_dag_root = new Dag_node(Td_active_trapezoid()); + //(*m_dag_root)->set_dag_node(m_dag_root); + boost::apply_visitor(set_dag_node_visitor(m_dag_root), + m_dag_root->get_data()); - - - /* Point tmp; - if (!CGAL_POINT_IS_LEFT_LOW(TD_X_trapezoid::POINT_AT_LEFT_TOP_INFINITY,tmp=TD_X_trapezoid::POINT_AT_RIGHT_BOTTOM_INFINITY)) - TD_X_trapezoid::POINT_AT_LEFT_TOP_INFINITY=traits->point_to_left(tmp); - */ - -#ifdef CGAL_TD_DEBUG - - CGAL_warning(!!*D_S); - -#endif - - number_of_curves_=0; + m_number_of_curves = 0; + m_largest_leaf_depth = 0; + m_number_of_dag_nodes = 1; //the root is the only node in the DAG #ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION @@ -3407,68 +2058,263 @@ private: #ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION - void locate_opt_push(pointer cv) const + void locate_opt_push(Td_map_item& cv_tr) const { - prev_cv=last_cv; - last_cv=cv; + prev_cv = last_cv; + last_cv = cv_tr; } void locate_opt_empty() const { - last_cv=prev_cv=0; + last_cv = Td_map_item(0); + prev_cv = Td_map_item(0); } - bool locate_opt_swap(pointer& cv) const + bool locate_opt_swap(Td_map_item& item) const { - cv=last_cv; - last_cv=prev_cv; - prev_cv=cv; - return (cv!=0); + item = last_cv; + last_cv = prev_cv; + prev_cv = item; + return (!traits->is_empty_item(item)); } - void locate_optimization(const Point& p,pointer& tr,Locate_type& lt) const + void locate_optimization(const Curve_end& ce, Td_map_item& item, + Locate_type& lt) const { + bool res = false; // optimization - if ((locate_opt_swap(tr) && tr->is_active() && - ((traits->is_degenerate_point(*tr) && - traits->equal_2_object()(tr->left(),p)) || - (!traits->is_degenerate(*tr) && traits->is_inside(*tr,p)))) || - (locate_opt_swap(tr) && tr->is_active() && - ((traits->is_degenerate_point(*tr) && - traits->equal_2_object()(tr->left(),p)) || - (!traits->is_degenerate(*tr) && traits->is_inside(*tr,p))))) - if (traits->is_degenerate_point(*tr)) lt=POINT; - else lt=tr->is_unbounded()?UNBOUNDED_TRAPEZOID:TRAPEZOID; + if (locate_opt_swap(item) && traits->is_active(item) ) + { + if (traits->is_td_vertex(item)) + res = are_equal_end_points(ce, item); + + //if (traits->is_td_vertex(item)) + //{ + // if ( traits->is_fictitious_vertex(item) ) + // { + // res = traits->equal_curve_end_2_object()(ce, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item))); + // } + // else + // { + // res = traits->equal_curve_end_2_object()(ce, boost::apply_visitor(point_for_vertex_visitor(), item)); + // } + //} + if (traits->is_td_trapezoid(item)) + res = traits->is_inside(item,ce); + } + if (!res && locate_opt_swap(item) && traits->is_active(item) ) + { + if (traits->is_td_vertex(item)) + res = are_equal_end_points(ce, item); + //if (traits->is_td_vertex(item)) + //{ + // if ( traits->is_fictitious_vertex(item) ) + // { + // res = traits->equal_curve_end_2_object()(ce, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item))); + // } + // else + // { + // res = traits->equal_curve_end_2_object()(ce, boost::apply_visitor(point_for_vertex_visitor(), item)); + // } + //} + if (traits->is_td_trapezoid(item)) + res = traits->is_inside(item,ce); + } + if (res) + { + if (traits->is_td_vertex(item)) + lt=POINT; + else + { + Td_active_trapezoid tr (boost::get(item)); + lt = tr.is_on_boundaries()? UNBOUNDED_TRAPEZOID : TRAPEZOID; + } + } else - tr=&locate(p,lt); + item = locate(ce,lt); } #endif -protected: - bool is_isolated_point(const_ref tr) const + + void print_cv_data(const X_monotone_curve_2& cv, + std::ostream& out = std::cout) const + { + out << "min end: " << std::endl; + print_ce_data(cv, ARR_MIN_END, out); + out << std::endl << "max end: " << std::endl; + print_ce_data(cv, ARR_MAX_END, out); + out << std::endl << std::endl ; + } + + void print_point_data(const Point& p, std::ostream& out = std::cout) const + { + out << "x: " << CGAL::to_double(p.x()) << ", y: " + << CGAL::to_double(p.y()) << std::endl; + } + + void print_ce_data(const X_monotone_curve_2& cv, Arr_curve_end ce, + std::ostream& out = std::cout) const + { + Arr_parameter_space ps_x = traits->parameter_space_in_x_2_object()(cv, ce); + Arr_parameter_space ps_y = traits->parameter_space_in_y_2_object()(cv, ce); + + if (ps_x == ARR_INTERIOR && ps_y == ARR_INTERIOR) + { + if (ce == ARR_MIN_END) + out << "x: " + << CGAL::to_double(traits->construct_min_vertex_2_object()(cv).x()) + << ", y: " + << CGAL::to_double(traits->construct_min_vertex_2_object()(cv).y()) + << std::endl; + else + out << "x: " + << CGAL::to_double(traits->construct_max_vertex_2_object()(cv).x()) + << ", y: " + << CGAL::to_double(traits->construct_max_vertex_2_object()(cv).y()) + << std::endl; + } + else if (ps_x == ARR_INTERIOR && ps_y != ARR_INTERIOR) + { + out << " vertical asymptote, " ; + if (ps_y == ARR_TOP_BOUNDARY) + out << " y -> +oo " << std::endl; + else + out << " y -> -oo " << std::endl; + } + else if (ps_x != ARR_INTERIOR && ps_y == ARR_INTERIOR) + { + out << " horizontal asymptote, " ; + if (ps_x == ARR_RIGHT_BOUNDARY) + out << " x -> +oo " << std::endl; + else + out << " x -> -oo " << std::endl; + } + else //both are not interior + { + if (ps_x == ARR_RIGHT_BOUNDARY) + out << " x -> +oo " ; + else + out << " x -> -oo " ; + if (ps_y == ARR_TOP_BOUNDARY) + out << " , y -> +oo " << std::endl; + else + out << " , y -> -oo " << std::endl; + + } + } + + + void print_dag_addresses(const Dag_node& curr) const { -#ifdef CGAL_TD_DEBUG + std::cout << "----------------- DAG ----------------" <is_degenerate_point(tr)); + print_dag_addresses_rec(curr, 0); + std::cout << "----------------- END OF DAG ----------------" <TRPZ : " << (void *)(curr.operator->()) + << std::endl; + + //curr is the current pointer to node in the data structure + //item holds the trapezoidal map item connected to curr. + Td_map_item item = curr.get_data(); + if (traits->is_td_vertex(item)) + { + out << " POINT : " ; + + // if the map item represents a fictitious vertex + if (traits->is_fictitious_vertex(item)) + { + const Curve_end left_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item))); + print_ce_data(left_ce.cv(), left_ce.ce(), out); + } + else // if the map item represents a vertex + { + Point p = boost::apply_visitor(point_for_vertex_visitor(),item); + print_point_data(p, out); + } + out << " (void *)left_child: " << (void*)(&(curr.left_child())) + << std::endl; + out << " (void *)right_child: " << (void*)(&(curr.right_child())) + << std::endl; + print_dag_addresses_rec(curr.left_child(), level+1, out); + print_dag_addresses_rec(curr.right_child(), level+1, out); + return; + } + if (traits->is_td_edge(item)) + { + bool is_active = traits->is_active(item); + // if the map item represents an edge + const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), item)); + + // so top() is a real Halfedge with a curve() if curr is active + // or curr holds the curve if curr is not active + out << " CURVE : " ; + print_cv_data(he_cv, out); + out << " (void *)left_child: " << (void*)(&(curr.left_child())) + << std::endl; + out << " (void *)right_child: " << (void*)(&(curr.right_child())) + << std::endl; + print_dag_addresses_rec(curr.left_child(), level+1, out); + print_dag_addresses_rec(curr.right_child(), level+1, out); + return; + } + else + { + // if ithe map item represents a trapezoid + if (traits->is_active(item)) + out << " TRAPEZOID \n"; + else //trapezoid is removed - may have a left child + { + out << " REMOVED TRAPEZOID \n"; + if (curr.left_child().is_null()) + return; + out << " (void *)left_child: " << (void*)(&(curr.left_child())) + << std::endl; + print_dag_addresses_rec(curr.left_child(), level+1, out); + } + } + } + +public: + void print_dag(std::ostream& out) const + { + + out << "----------------- DAG ----------------" << std::endl + << "--------------------------------------" << std::endl; + + print_dag_addresses_rec(*m_dag_root , 0, out); + out << "----------------- END OF DAG ----------------" << std::endl + << "---------------------------------------------" << std::endl; - return !tr.right_top_neighbour()&&!tr.left_bottom_neighbour(); } protected: - double depth_threshold,size_threshold; + double m_depth_threshold; + double m_size_threshold; }; } //namespace CGAL -#ifndef CGAL_TD_X_TRAPEZOID_H -#include -#endif +#include +#include +#include +#include +#include +#include +#include +#include -#ifdef CGAL_TD_DEBUG -#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_IOSTREAM_H -#include -#endif -#endif +// The member-function definitions can be found under: +#include #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h new file mode 100644 index 00000000000..9da8c6c388f --- /dev/null +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h @@ -0,0 +1,3098 @@ +// Copyright (c) 2005 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL: svn+ssh://balasmic@scm.gforge.inria.fr/svn/cgal/trunk/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h $ +// $Id: Arr_trapezoid_ric_pl_impl.h 56667 2010-06-09 07:37:13Z sloriot $ +// +// +// Author(s) : Michal Balas +// based on the methods implemented in Trapezoidal_decomposition.h by Oren Nechushtan + +#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_FUNCTIONS_H +#define CGAL_TRAPEZOIDAL_DECOMPOSITION_FUNCTIONS_H + +/*! \file +* Member-function definitions for the Trapezoidal_decomposition_2 +* class. +*/ + +namespace CGAL { + +//----------------------------------------------------------------------------- +// Description: +// splits the trapezoid with vertical line through v +// assuming that he_bottom_ray_shoot & he_top_ray_shoot are in the +// desired direction, such that v is their source +// Precondition: +// The trapezoid is active and contains v in its closure +// +template +typename Trapezoidal_decomposition_2::Dag_node & +Trapezoidal_decomposition_2 +::split_trapezoid_by_vertex(Dag_node& split_node, + Vertex_const_handle v, + Halfedge_const_handle he) +{ + CGAL_precondition(!split_node.is_null()); + if (split_node.is_null()) return split_node; + + + Td_map_item curr_item (split_node.get_data()); + CGAL_precondition(traits->is_active(curr_item)); + + Dag_node left_node, right_node; + + if (traits->is_td_trapezoid(curr_item)) + { + Td_active_trapezoid& tr (boost::get(curr_item)); + + CGAL_warning(traits->is_in_closure(tr, traits->vtx_to_ce(v))); + + left_node.set_data(Td_active_trapezoid + (tr.left(), v, tr.bottom(), tr.top())); + + right_node.set_data(Td_active_trapezoid + (v, tr.right(), tr.bottom(), tr.top())); + + Td_active_trapezoid& left_tr (boost::get(left_node.get_data())); + Td_active_trapezoid& right_tr (boost::get(right_node.get_data())); + + CGAL_warning(traits->is_trapezoids_top_equal(left_tr,right_tr)); + CGAL_warning(traits->is_trapezoids_bottom_equal(left_tr,right_tr)); + CGAL_warning(left_tr.is_on_left_boundary() == tr.is_on_left_boundary()); + CGAL_warning(right_tr.is_on_right_boundary() == tr.is_on_right_boundary()); + + left_tr.init_neighbours(tr.lb(),tr.lt(),right_node.get_data(),right_node.get_data()); + right_tr.init_neighbours(left_node.get_data(),left_node.get_data(),tr.rb(),tr.rt()); + if (!traits->is_empty_item(tr.lb())) + { + Td_active_trapezoid& lb(boost::get(tr.lb())); + lb.set_rb(left_node.get_data()); + } + if (!traits->is_empty_item(tr.lt())) + { + Td_active_trapezoid& lt(boost::get(tr.lt())); + lt.set_rt(left_node.get_data()); + } + if (!traits->is_empty_item(tr.rb())) + { + Td_active_trapezoid& rb(boost::get(tr.rb())); + rb.set_lb(right_node.get_data()); + } + if (!traits->is_empty_item(tr.rt())) + { + Td_active_trapezoid& rt(boost::get(tr.rt())); + rt.set_lt(right_node.get_data()); + } + + } + else //if the curr_item is an edge + { + Td_active_edge& e (boost::get(curr_item)); + + CGAL_warning(traits->is_in_closure(e, traits->vtx_to_ce(v))); + + left_node.set_data(Td_active_edge(e.halfedge())); + + right_node.set_data(Td_active_edge(e.halfedge())); + + Td_active_edge& left_e (boost::get(left_node.get_data())); + Td_active_edge& right_e (boost::get(right_node.get_data())); + + //CGAL_warning(left_e.is_on_left_boundary() == e.is_on_left_boundary()); + //CGAL_warning(right_e.is_on_right_boundary() == e.is_on_right_boundary()); + + left_e.init_neighbours(boost::none);//left_e.init_neighbours(e.lb(),e.lt(),Td_map_item(),right_node.get_data()); + right_e.init_neighbours(e.next());//right_e.init_neighbours(left_node.get_data(),left_node.get_data(),e.rb(),e.rt()); + + } + + // left and right are set to the point itself, + // bottom and top are set to the ray shooting resulting curves at this + // stage. + //need to define the boundaries flag before creating the trapezoid + Td_map_item vtx_item (build_vertex_map_item(v, he, &split_node)); + split_node.replace( vtx_item, left_node, right_node); //nodes depth are updated here + update_largest_leaf_depth( std::max(left_node.depth(), right_node.depth()) ); + m_number_of_dag_nodes += 2; + +#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION + if (last_cv == curr_item) + last_cv = vtx_item; + if (prev_cv == curr_item) + prev_cv = vtx_item; +#endif + + const Dag_node* left_ptr = &split_node.left_child(); + const Dag_node* right_ptr = &split_node.right_child(); + + boost::apply_visitor(set_dag_node_visitor((Dag_node*)left_ptr),left_ptr->get_data()); //(*left_ptr)->set_dag_node((Dag_node*)left_ptr); + boost::apply_visitor(set_dag_node_visitor((Dag_node*)right_ptr),right_ptr->get_data()); //(*right_ptr)->set_dag_node((Dag_node*)right_ptr); + + //print_dag_addresses(*m_dag_root); + + return split_node; +} + +template +typename Trapezoidal_decomposition_2::Td_map_item +Trapezoidal_decomposition_2 +::build_vertex_map_item(Vertex_const_handle v, + Halfedge_const_handle he, + Dag_node* node) +{ + Curve_end ce(traits->vtx_to_ce(v)); + if ((traits->parameter_space_in_x_2_object()(ce.cv(), ce.ce()) == ARR_INTERIOR) + && (traits->parameter_space_in_y_2_object()(ce.cv(), ce.ce()) == ARR_INTERIOR)) + { + Td_active_vertex vtx (v, he, node); + return vtx; + } + else + { + Td_active_fictitious_vertex vtx (v, he, node); + return vtx; + } +} + + +//----------------------------------------------------------------------------- +// Description: +// the opposite operation for spliting the trapezoid with +// vertical line through ce +// Precondition: +// tr_node data is a td vertex and is active +template +void Trapezoidal_decomposition_2 +::undo_split_trapezoid_by_vertex(Dag_node& tr_node, const Curve_end& ce) +{ + CGAL_precondition(!tr_node.is_null()); + Td_map_item item = tr_node.get_data(); + CGAL_precondition(traits->is_active(item)); + CGAL_precondition(traits->is_td_vertex(item)); + + //get the ds left child and right child nodes of + // tr_node (in the search structure) + Dag_node tr_left_node = tr_node.left_child(); + Dag_node tr_right_node = tr_node.right_child(); + + //advances the ds nodes until ce is found + search_using_dag(tr_left_node, traits, ce, m_empty_he_handle); + search_using_dag(tr_right_node, traits, ce, m_empty_he_handle); + + //make sure the trapezoids are active before merging them + //CGAL_assertion(traits->is_active(tr_left_node.get_data()) && traits->is_active(tr_right_node.get_data())); + + // bool mrg_res = + merge_if_possible(tr_left_node.get_data(), tr_right_node.get_data()); + + CGAL_warning(!tr_left_node.is_inner_node()); + CGAL_warning(!tr_right_node.is_inner_node()); + + + deactivate_trapezoid( tr_right_node, &tr_left_node); //tr_right_node->remove(&tr_left_node); + update_largest_leaf_depth( tr_left_node.depth()); //tr_left_node is not an inner node + // mark root as deleted + deactivate_vertex(tr_node); //tr_node->remove(); + //no need to update m_number_of_dag_nodes because the number of nodes did not change. + // removed nodes were only marked as removed +} + + +template +void Trapezoidal_decomposition_2 +::deactivate_trapezoid (Dag_node& trpz_node, Dag_node* active_node) const +{ + CGAL_precondition(traits->is_active(trpz_node.get_data())); + CGAL_precondition(traits->is_td_trapezoid(trpz_node.get_data())); + trpz_node.set_data(Td_inactive_trapezoid()); + if (active_node) + trpz_node.set_left_child(*active_node); +} + +template +void Trapezoidal_decomposition_2 +::deactivate_vertex (Dag_node& vtx_node) const +{ + CGAL_precondition(traits->is_active(vtx_node.get_data())); + CGAL_precondition(traits->is_td_vertex(vtx_node.get_data())); + if (traits->is_fictitious_vertex(vtx_node.get_data())) + { + Td_active_fictitious_vertex& v(boost::get(vtx_node.get_data())); + vtx_node.set_data(Td_inactive_fictitious_vertex(v.vertex(), &vtx_node)); + } + else + { + Td_active_vertex& v(boost::get(vtx_node.get_data())); + vtx_node.set_data(Td_inactive_vertex(v.vertex(), &vtx_node)); + } +} + +template +void Trapezoidal_decomposition_2 +::deactivate_edge (boost::shared_ptr& cv, Dag_node& edge_node) const +{ + CGAL_precondition(traits->is_active(edge_node.get_data())); + CGAL_precondition(traits->is_td_edge(edge_node.get_data())); + + edge_node.set_data(Td_inactive_edge(cv, &edge_node)); +} + + + +//----------------------------------------------------------------------------- +// Description: +// splits the trapezoid that corresponds to the root of the +// trapezoidal tree with an input halfedge he +// Precondition: +// The root trapezoid is active +// The root trapezoid is devided by he or is equal to it and is vertical. +template +typename Trapezoidal_decomposition_2::Dag_node & +Trapezoidal_decomposition_2 +::split_trapezoid_by_halfedge(Dag_node& split_node, + Td_map_item& prev_e, + Td_map_item& prev_bottom_tr, + Td_map_item& prev_top_tr, + Halfedge_const_handle he) +{ + + CGAL_warning(traits != NULL); + CGAL_precondition(traits->is_active(split_node.get_data())); + CGAL_precondition(traits->is_td_trapezoid(split_node.get_data())); + + Td_map_item curr_item (split_node.get_data()); + Td_active_trapezoid& split_tr = boost::get(curr_item); + + // sets left and right according to td_edge's source and target positions + // sets bottom and top to Halfedge itself + // no need to set the boundaries since its irrelevant for this trapezoid + // type (TD_EDGE) + Td_active_edge sep(he, &split_node); + + + //creates a one-way path for all the td edges + //that represent the Halfedge. + //rb() is used to retrieve the + //next on path information + + Dag_node top_node(Td_active_trapezoid + (split_tr.left(), split_tr.right(), he, split_tr.top())); + //Td_active_trapezoid::TD_TRAPEZOID, + //split_tr.on_boundaries_flag() & + // (CGAL_TD_ON_LEFT_BOUNDARY | + // CGAL_TD_ON_RIGHT_BOUNDARY | + // CGAL_TD_ON_TOP_BOUNDARY ))); + Dag_node bottom_node(Td_active_trapezoid + (split_tr.left(),split_tr.right(), split_tr.bottom(), he)); + //Td_active_trapezoid::TD_TRAPEZOID, + //split_tr.on_boundaries_flag() & + // (CGAL_TD_ON_LEFT_BOUNDARY | + // CGAL_TD_ON_RIGHT_BOUNDARY | + // CGAL_TD_ON_BOTTOM_BOUNDARY ))); + + Td_active_trapezoid& bottom = boost::get(bottom_node.get_data()); + Td_active_trapezoid& top = boost::get(top_node.get_data()); + + top.init_neighbours(prev_top_tr, split_tr.lt(), boost::none , split_tr.rt()); + bottom.init_neighbours(split_tr.lb(), prev_bottom_tr, split_tr.rb(), boost::none); + + if (!traits->is_empty_item(prev_bottom_tr)) + { + Td_active_trapezoid& prev_btm (boost::get(prev_bottom_tr)); + prev_btm.set_rt(bottom_node.get_data()); + } + if (!traits->is_empty_item(prev_top_tr)) + { + Td_active_trapezoid& prev_top (boost::get(prev_top_tr)); + prev_top.set_rb(top_node.get_data()); + } + if (!traits->is_empty_item(split_tr.lb())) + { + Td_active_trapezoid& lb (boost::get(split_tr.lb())); + lb.set_rb(bottom_node.get_data()); + } + if (!traits->is_empty_item(split_tr.lt())) + { + Td_active_trapezoid& lt (boost::get(split_tr.lt())); + lt.set_rt(top_node.get_data()); + } + if (!traits->is_empty_item(split_tr.rb())) + { + Td_active_trapezoid& rb (boost::get(split_tr.rb())); + rb.set_lb(bottom_node.get_data()); + } + if (!traits->is_empty_item(split_tr.rt())) + { + Td_active_trapezoid& rt (boost::get(split_tr.rt())); + rt.set_lt(top_node.get_data()); + } + split_node.replace(sep,bottom_node,top_node); //nodes depth are updated here + update_largest_leaf_depth( std::max(bottom_node.depth(), top_node.depth()) ); + m_number_of_dag_nodes += 2; //two new nodes were added to the DAG + +#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION + if (last_cv == curr_item) + last_cv = sep; + if (prev_cv == curr_item) + prev_cv = sep; +#endif + + const Dag_node* bottomPtr = &split_node.left_child(); + const Dag_node* topPtr = &split_node.right_child(); + + boost::apply_visitor(set_dag_node_visitor((Dag_node*)bottomPtr), + bottomPtr->get_data()); + boost::apply_visitor(set_dag_node_visitor((Dag_node*)topPtr), + topPtr->get_data()); + + // Td_active_edge& new_e = boost::get(split_node.get_data()); + if (!traits->is_empty_item(prev_e)) + { + Td_active_edge& e ( boost::get(prev_e)); + e.set_next(split_node.get_data()); + } + //update these trapezoids pointers. + // will be used for the next trapezoid that should be split + // by this Halfedge + prev_bottom_tr = bottomPtr->get_data(); //(*bottomPtr).operator->(); + prev_top_tr = topPtr->get_data(); //(*topPtr).operator->(); + prev_e = split_node.get_data(); //tt.operator->(); + + return split_node; +} + + +//----------------------------------------------------------------------------- +// Description: +// update +// tr.bottom() +// vertical_ray_shoot downward from tr +// tr.top() +// vertical_ray_shoot upward from tr +// update all the curves incident to the vertex that there's a new curve +// starting from this vertex +// this point must be an interior point and not a point on the boundaries, +// since a point on the boundaries is related to one curve only +template +typename Trapezoidal_decomposition_2::Td_map_item & +Trapezoidal_decomposition_2 +::update_vtx_with_new_edge(Halfedge_const_handle he, + const Curve_end& ce, + Td_map_item& vtx_item, + const Locate_type& + CGAL_precondition_code(lt)) +{ + CGAL_assertion(traits != NULL); + CGAL_precondition(lt == POINT); + CGAL_precondition(traits->is_active(vtx_item)); + + //ee is interior + CGAL_assertion((traits->parameter_space_in_x_2_object()(ce.cv(), ce.ce()) + == ARR_INTERIOR) && + (traits->parameter_space_in_y_2_object()(ce.cv(), ce.ce()) + == ARR_INTERIOR) ); + //the underlying point of ce + const Point& p = (ce.ce() == ARR_MIN_END) ? + traits->construct_min_vertex_2_object()(ce.cv()) : + traits->construct_max_vertex_2_object()(ce.cv()) ; + + //set cw to hold the halfedge whose source is p, + // which is clockwise "smallest" starting from top (12 o'clock) + Halfedge_const_handle cw_he (boost::apply_visitor(cw_he_visitor(), vtx_item)); + if (traits->compare_cw_around_point_2_object() + (he->curve(), is_edge_to_right(he,p), + cw_he->curve(), + is_edge_to_right(cw_he,p), p) == SMALLER) + { + boost::apply_visitor(set_cw_he_visitor(he),vtx_item);//v_tr->set_top(he); + } + + return vtx_item; +} + +//----------------------------------------------------------------------------- +// Description: +template +typename Trapezoidal_decomposition_2::Td_map_item & +Trapezoidal_decomposition_2 +::insert_curve_at_vtx_using_dag (Halfedge_const_handle he, + Vertex_const_handle v, + Td_map_item& item, + const Locate_type& + CGAL_precondition_code(lt)) +{ + CGAL_precondition(lt==TRAPEZOID || lt==UNBOUNDED_TRAPEZOID); + + Dag_node* node = boost::apply_visitor(dag_node_visitor(), item); + + CGAL_assertion(node != NULL); + CGAL_assertion (he != m_empty_he_handle); + + + //we need to use the halfedge whose source is v. //MICHAL: do we have to? + if (he->source() == v) + // if ((ce_pair.second == ARR_MIN_END && he->direction() == ARR_LEFT_TO_RIGHT) || + // (ce_pair.second == ARR_MAX_END && he->direction() == ARR_RIGHT_TO_LEFT) ) + { + return *split_trapezoid_by_vertex(*node, v, he); + } + else + { + return *split_trapezoid_by_vertex(*node, v, he->twin()); + } +} + +////----------------------------------------------------------------------------- +//// Description: +//template +//void Trapezoidal_decomposition_2 +//::set_trp_params_after_halfedge_update(Halfedge_const_handle old_he, +// Halfedge_const_handle new_he, +// Td_map_item& vtx_item) +//{ +// CGAL_precondition(old_he != m_empty_he_handle); +// CGAL_precondition(traits->is_td_vertex(vtx_item)); +// CGAL_precondition(traits->is_active(vtx_item)); +// +// Halfedge_const_handle cw_he (boost::apply_visitor(cw_he_visitor(), vtx_item)); +// +// //make sure the cw_he is added in same direction as before +// // such that vtx_item is the source (done inside the set methods) +// if (cw_he == old_he || cw_he->twin() == old_he) +// { +// boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item); +// } +//} + +//----------------------------------------------------------------------------- +// Description: +template +void Trapezoidal_decomposition_2 +::update_vtx_cw_he_after_merge (const X_monotone_curve_2& old_cv, + Halfedge_const_handle new_he, + Td_map_item& vtx_item) +{ + CGAL_precondition(traits->is_td_vertex(vtx_item)); + CGAL_precondition(traits->is_active(vtx_item)); + + Halfedge_const_handle cw_he (boost::apply_visitor(cw_he_visitor(), vtx_item)); + + //make sure the cw_he is added in same direction as before + // such that v_tr is the source (done inside the set methods) + if (traits->equal_2_object()(cw_he->curve(), old_cv)) + { + boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item); + } +} + +////MICHAL: currently not in use since split is implemented as removed and insert two +//// in case the split is done differenty - this method would have to be rewritten since it is obsolete +//template +//void Trapezoidal_decomposition_2 +//::set_trp_params_after_split_halfedge_update(Halfedge_const_handle new_he, +// Td_map_item& vtx_item, +// Halfedge_const_handle he1, +// Halfedge_const_handle he2) +//{ +// CGAL_precondition(traits->is_td_vertex(vtx_item)); +// CGAL_precondition(traits->is_active(vtx_item)); +// +// Halfedge_const_handle top_he (boost::apply_visitor(top_he_visitor(), vtx_item)); +// Halfedge_const_handle bottom_he (boost::apply_visitor(bottom_he_visitor(), vtx_item)); +// +// //make sure the top & bottom are added in same direction as before +// // such that sep is the source (done inside the set methods) +// if ((top_he == he1) || (top_he == he1->twin()) || +// (top_he == he2) || (top_he == he2->twin()) ) +// { +// boost::apply_visitor(set_top_he_visitor(new_he), vtx_item); //v_tr.set_top(new_he); +// } +// if ((bottom_he == he1) || (bottom_he == he1->twin()) || +// (bottom_he == he2) || (bottom_he == he2->twin()) ) +// { +// boost::apply_visitor(set_bottom_he_visitor(new_he), vtx_item); //v_tr.set_bottom(new_he); +// } +//} + +//----------------------------------------------------------------------------- +// Description: +// update geometric boundary(top and bottom) for trapezoids +// traveled along an iterator till end reached +// precondition: +// end==0 or end is on the path of the iterator +// postcondition: +// end is pointer to the last trapezoid encountered,if any +template +void Trapezoidal_decomposition_2 +::update_map_items_after_merge (In_face_iterator& it, + Halfedge_const_handle old_he, + Halfedge_const_handle new_he, + Vertex_const_handle min_v, + Vertex_const_handle max_v, + Td_map_item& end) +{ + Td_map_item last_item = Td_map_item(0); + + while (!!it && !(*it == end)) + { + Td_map_item curr_item = *it; + CGAL_assertion(traits->is_active(curr_item)); + + if (traits->is_td_edge(curr_item)) + { + Td_active_edge& e(boost::get(curr_item)); + if (e.halfedge() == old_he || e.halfedge() == old_he->twin()) + e.set_halfedge(new_he); + } + else if (traits->is_td_trapezoid(curr_item)) + { + Td_active_trapezoid& tr(boost::get(curr_item)); + if (tr.bottom() == old_he || tr.bottom() == old_he->twin()) + tr.set_bottom(new_he); + if (tr.top() == old_he || tr.top() == old_he->twin()) + tr.set_top(new_he); + } + else //if is_td_vertex + { + Halfedge_const_handle cw_he (boost::apply_visitor(cw_he_visitor(), curr_item)); + if (cw_he == old_he || cw_he == old_he->twin()) + boost::apply_visitor(set_cw_he_visitor(new_he), curr_item); + } + + last_item = *it; + ++it; + } + end = last_item; +} + +//----------------------------------------------------------------------------- +// Description: +// advances input Data structure using data structure,input point p and +// possibly Halfedge p_he till +// p is found(if p_he hadn't been given) +// p_he is found(if p_he was given) +// or +// leaf node reached +// postcondition: +// output is the closest active trapezoid to ce/p_he +// remark: +// use this function with care! +template +typename Trapezoidal_decomposition_2::Locate_type +Trapezoidal_decomposition_2 +::search_using_dag (Dag_node& curr_node, + const Traits* traits, + const Point& p, + Halfedge_const_handle he, + Comparison_result up /*=EQUAL*/) const +{ + + while(true) + { + //curr_node is the current pointer to node in the data structure + //curr_item is the curent Td_map_item held in curr_node + Td_map_item curr_item(curr_node.get_data()); + + if (traits->is_td_vertex(curr_item)) + { // if the curr_item represents a vertex + //bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); + //if ((is_fict_vtx && is_end_point_left_low(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || + // (!is_fict_vtx && is_end_point_left_low(p, boost::apply_visitor(point_for_vertex_visitor(), curr_item))) ) + if (is_end_point_left_low(p, curr_node)) + { + curr_node = curr_node.left_child(); + continue; + } + //else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || + // (!is_fict_vtx && is_end_point_right_top(p, boost::apply_visitor(point_for_vertex_visitor(), curr_item))) ) + else if (is_end_point_right_top(p, curr_node)) + { + curr_node = curr_node.right_child(); + continue; + } + //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + else if (are_equal_end_points(p, curr_node)) + { + if (he == m_empty_he_handle) //if he is the empty handle + { + if ( up == EQUAL ) + { // point found! + if (traits->is_active(curr_item)) + return POINT; + curr_node = curr_node.left_child(); + } + else if ( up == LARGER ) { // vertical ray shut up + curr_node = curr_node.right_child(); + } + else /*if ( up == SMALLER ) */ { + curr_node = curr_node.left_child(); // vertical ray shut down + } + continue; + } + else //if he was given + { + bool is_equal_to_he_min = traits->equal_curve_end_2_object() + (Curve_end(he,ARR_MIN_END), p); + bool is_equal_to_he_max = traits->equal_curve_end_2_object() + (Curve_end(he,ARR_MAX_END), p); + + CGAL_assertion( is_equal_to_he_min || is_equal_to_he_max ); + + curr_node = is_equal_to_he_min ? curr_node.right_child() : curr_node.left_child(); + continue; + } + } + else + { + CGAL_assertion(is_end_point_left_low(p,curr_node) || + is_end_point_right_top(p,curr_node) || + are_equal_end_points(p,curr_node)); + + //(is_fict_vtx && + // (is_end_point_left_low(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || + // is_end_point_right_top(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || + // traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),p))) || + // (!is_fict_vtx && + // (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || + // is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || + // traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p)))); + + return Locate_type(); + } + } + if (traits->is_td_edge(curr_item)) + { // if curr_item represents an edge, + // so top() is a real Halfedge with a curve() if curr_item is active + // or curr_item holds the curve if it is not active + const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); + + Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv); + if (cres == SMALLER) + { + curr_node = curr_node.left_child(); + continue; + } + else if (cres == LARGER) + { + curr_node = curr_node.right_child(); + continue; + } + else + { + // p is on the curve itself + CGAL_warning( + (cres == EQUAL) && + (traits->compare_curve_end_x_2_object() + (p, Curve_end(he_cv,ARR_MAX_END)) != LARGER) && + (traits->compare_curve_end_x_2_object() + (p, Curve_end(he_cv,ARR_MIN_END)) != SMALLER)); + + if (he == m_empty_he_handle) //if he was not given + { + // For a vertical curve, we always visit it after visiting + // one of its endpoints. + if ((up == EQUAL) || traits->is_vertical(curr_item)) + { + if (traits->is_active(curr_item)) + return CURVE; + curr_node = curr_node.left_child(); + } + else if (up == LARGER) + { + curr_node = curr_node.right_child(); + } + else + { // if (up==SMALLER) + curr_node = curr_node.left_child(); + } + continue; + } + else //if he was given + { + //p is a parameter space interior point + bool is_min_equal = traits->equal_curve_end_2_object() + (Curve_end(he,ARR_MIN_END), + Curve_end(he_cv,ARR_MIN_END)); + + bool is_max_equal = traits->equal_curve_end_2_object() + (Curve_end(he,ARR_MAX_END), + Curve_end(he_cv,ARR_MAX_END)); + + CGAL_warning (is_min_equal || is_max_equal); + + Comparison_result res = + is_min_equal ? + traits->compare_cw_around_point_2_object() + (he_cv, is_curve_to_right(he_cv,p), + he->curve(), is_edge_to_right(he,p), p) : + traits->compare_cw_around_point_2_object() + (he->curve(), is_edge_to_right(he,p), + he_cv, is_curve_to_right(he_cv,p), p ,false); + + switch(res) + { + case LARGER: + curr_node = curr_node.right_child(); + break; + case SMALLER: + curr_node = curr_node.left_child(); + break; + case EQUAL: + switch(up) + { + case LARGER: + curr_node = curr_node.right_child(); + break; + case SMALLER: + curr_node = curr_node.left_child(); + break; + case EQUAL: + if (traits->is_active(curr_item)) + return CURVE; + curr_node = curr_node.left_child(); + break; + } + break; + } + } + } + } + else + { + // if is_degenerate() == 0, meaning: curr_item is a real trapezoid + if (traits->is_active(curr_item)) + { + Td_active_trapezoid& tr = boost::get(curr_item); + return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID; + } + curr_node = curr_node.left_child(); + continue; + } + } +} + + + +////----------------------------------------------------------------------------- +//// Description: +//// advances input Data structure using data structure,input point p and +//// possibly Halfedge p_he till +//// p is found(if p_he hadn't been given) +//// p_he is found(if p_he was given) +//// or +//// leaf node reached +//// postcondition: +//// output is the closest active trapezoid to ce/p_he +//// remark: +//// use this function with care! +//template +//void +//Trapezoidal_decomposition_2 +//::search_and_print_using_dag (std::ostream& out, +// Dag_node& curr_node, +// const Traits* traits, +// const Point& p, +// Halfedge_const_handle he, +// Comparison_result up /*=EQUAL*/) const +//{ +// out << "QUERY: " << std::endl; +// out << "x: " << CGAL::to_double(p.x()) +// << ", y: " << CGAL::to_double(p.y()) << std::endl; +// +// +// +// while(true) +// { +// //curr_node is the current pointer to node in the data structure +// //curr_item is the curent Td_map_item held in curr_node +// Td_map_item curr_item(curr_node.get_data()); +// +// if (traits->is_td_vertex(curr_item)) +// { +// // if the map item represents a vertex +// +// out << " VERTEX : " ; +// if (traits->is_active(curr_item)) +// out << " (active) "; +// else +// out << " (inactive) "; +// +// // if the curr_item represents a vertex +// bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); +// if (is_fict_vtx) +// { +// Curve_end vtx_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))); +// print_ce_data(vtx_ce.cv(), vtx_ce.ce(), out); +// } +// else +// { +// print_point_data(boost::apply_visitor(point_for_vertex_visitor(),curr_item), out); +// } +// +// if ((is_fict_vtx && is_end_point_left_low(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || +// (!is_fict_vtx && is_end_point_left_low(p, boost::apply_visitor(point_for_vertex_visitor(),curr_item))) ) +// { +// out << " Going left " << std::endl; +// curr_node = curr_node.left_child(); +// continue; +// } +// else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) || +// (!is_fict_vtx && is_end_point_right_top(p, boost::apply_visitor(point_for_vertex_visitor(),curr_item))) ) +// { +// out << " Going right " << std::endl; +// curr_node = curr_node.right_child(); +// continue; +// } +// else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || +// (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(),curr_item), p)) ) +// { +// out << " Equal to query " << std::endl; +// if (he == m_empty_he_handle) //if he is the empty handle +// { +// if ( up == EQUAL ) +// { // point found! +// if (traits->is_active(curr_item)) +// { +// out << " Found active point! " << std::endl; +// return; +// } +// out << " (equal to inactive point) Going left " << std::endl; +// curr_node = curr_node.left_child(); +// } +// else if ( up == LARGER ) +// { // vertical ray shut up +// out << " Going right " << std::endl; +// curr_node = curr_node.right_child(); +// } +// else //if ( up == SMALLER ) +// { // vertical ray shut down +// out << " Going left " << std::endl; +// curr_node = curr_node.left_child(); +// } +// continue; +// } +// else //if he was given +// { +// //NOT GONNA HAPPEN +// } +// } +// else +// { +// out << " Problem - comparing to point" << std::endl; +// return; +// } +// } +// if (traits->is_td_edge(curr_item)) +// { +// // if curr_item represents an edge, +// // so top() is a real Halfedge with a curve() if curr_item is active +// // or curr_item holds the curve if it is not active +// const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); +// +// out << " EDGE : " ; +// if (traits->is_active(curr_item)) +// { +// out << " (active) "; +// if (traits->is_vertical(curr_item)) +// out << " (vertical) "; +// } +// else +// out << " (inactive) "; +// +// print_cv_data(he_cv, out); +// +// Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv); +// if (cres == SMALLER) +// { +// out << " Going left " << std::endl; +// curr_node = curr_node.left_child(); +// continue; +// } +// else if (cres == LARGER) +// { +// out << " Going right " << std::endl; +// curr_node = curr_node.right_child(); +// continue; +// } +// else +// { +// // p is on the CURVE (top_he = curr.top()) itself +// out << " query is on the curve " << std::endl; +// +// CGAL_assertion( +// (cres == EQUAL) && +// (traits->compare_curve_end_x_2_object() +// (p, Curve_end(he_cv,ARR_MAX_END)) != LARGER) && +// (traits->compare_curve_end_x_2_object() +// (p, Curve_end(he_cv,ARR_MIN_END)) != SMALLER)); +// if (he == m_empty_he_handle) //if he was not given +// { +// // For a vertical curve, we always visit it after visiting +// // one of its endpoints. +// if ((up == EQUAL) || traits->is_vertical(curr_item)) +// { +// if (traits->is_active(curr_item)) +// { +// out << " On active curve " << std::endl; +// return; +// } +// out << " (equal to inactive curve) Going left " << std::endl; +// curr_node = curr_node.left_child(); +// } +// else if (up == LARGER) { +// out << " Going right " << std::endl; +// curr_node = curr_node.right_child(); +// } +// else { // if (up==SMALLER) +// out << " Going left " << std::endl; +// curr_node = curr_node.left_child(); +// } +// continue; +// } +// else //if he was given +// { +// //NOT GONNA HAPPEN +// } +// } +// } +// else +// { +// // if item represents a trapezoid +// out << " TRAPEZOID : " ; +// if (traits->is_active(curr_item)) +// { +// out << " (active) "; +// Td_active_trapezoid tr = boost::get(curr_item); +// if (tr.is_on_boundaries()) +// out << " UNBOUNDED! "; +// else +// out << " BOUNDED! "; +// return; +// } +// else +// out << " (inactive) "; +// out << " (on inactive trapezoid) Going left " << std::endl; +// curr_node = curr_node.left_child(); +// continue; +// } +// } +//} + +//----------------------------------------------------------------------------- +// Description: +// advances input Data structure using data structure,input point ce and +// possibly Halfedge p_he till +// ce is found(if p_he hadn't been given) +// p_he is found(if p_he was given) +// or +// leaf node reached +// postcondition: +// output is the closest active trapezoid to ce/p_he +// remark: +// use this function with care! +template +typename Trapezoidal_decomposition_2::Locate_type +Trapezoidal_decomposition_2 +::search_using_dag (Dag_node& curr_node, + const Traits* traits, + const Curve_end& ce, + Halfedge_const_handle he, + Comparison_result up /*=EQUAL*/) const +{ + if (he == m_empty_he_handle) + return search_using_dag_with_cv (curr_node,traits,ce,NULL, up); + else + return search_using_dag_with_cv (curr_node,traits,ce,&he->curve(), up); +} + +//----------------------------------------------------------------------------- +// Description: +// advances input Data structure using data structure,input point ce and +// possibly X_monotone_curve_2 p_cv till +// ce is found(if p_cv hadn't been given) +// p_cv is found(if p_cv was given) +// or +// leaf node reached +// postcondition: +// output is the closest active trapezoid to ce/p_cv +// remark: +// use this function with care! +template +typename Trapezoidal_decomposition_2::Locate_type +Trapezoidal_decomposition_2 +::search_using_dag_with_cv (Dag_node& curr_node, + const Traits* traits, + const Curve_end& ce, + const X_monotone_curve_2* p_cv, + Comparison_result up /*=EQUAL*/) const +{ + while(true) + { + //curr_node is the current pointer to node in the data structure + //curr_item is the curent Td_map_item held in curr_node + Td_map_item curr_item(curr_node.get_data()); + + if (traits->is_td_vertex(curr_item)) + { // if the curr_item represents a vertex + //bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); + //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || + // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) ) + if (is_end_point_left_low(ce, curr_node)) + { + curr_node = curr_node.left_child(); + continue; + } + //else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || + // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) ) + else if (is_end_point_right_top(ce, curr_node)) + { + curr_node = curr_node.right_child(); + continue; + } + //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) || + // (!is_fict_vtx && traits->equal_curve_end_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) ) + else if (are_equal_end_points(ce, curr_node)) + { + if (!p_cv) //if p_cv was not given + { + if ( up == EQUAL ) + { // point found! + if (traits->is_active(curr_item)) + return POINT; + curr_node = curr_node.left_child(); + } + else if ( up == LARGER ) + { // vertical ray shut up + curr_node = curr_node.right_child(); + } + else + { // if ( up == SMALLER ) + curr_node = curr_node.left_child(); // vertical ray shut down + } + continue; + } + else //if p_cv was given + { + bool is_equal_to_he_min = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MIN_END), ce); + bool is_equal_to_he_max = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MAX_END), ce); + + CGAL_assertion( is_equal_to_he_min || is_equal_to_he_max ); + + curr_node = is_equal_to_he_min ? curr_node.right_child() : curr_node.left_child(); + + continue; + } + } + else + { + CGAL_assertion(is_end_point_left_low(ce, curr_node) || + is_end_point_right_top(ce, curr_node) || + are_equal_end_points(ce, curr_node)); + //(is_fict_vtx && + // (is_end_point_left_low(ce,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || + // is_end_point_right_top(ce,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || + // traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),ce))) || + // (!is_fict_vtx && + // (is_end_point_left_low(ce,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || + // is_end_point_right_top(ce,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || + // traits->equal_curve_end_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),ce)))); + return Locate_type(); + } + } + if (traits->is_td_edge(curr_item)) + { // if curr_item represents an edge, + // so top() is a real Halfedge with a curve() if curr_item is active + // or curr_item holds the curve if it is not active + + const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); + Comparison_result cres = traits->compare_curve_end_y_at_x_2_object()(ce, he_cv); + if (cres == SMALLER) + { + curr_node = curr_node.left_child(); + continue; + } + else if (cres == LARGER) + { + curr_node = curr_node.right_child(); + continue; + } + else + { + // ce is on the CURVE (he_cv = ce.cv()) itself + CGAL_warning( + (cres == EQUAL) && + (traits->compare_curve_end_x_2_object() + (ce, Curve_end(he_cv,ARR_MAX_END)) != LARGER) && + (traits->compare_curve_end_x_2_object() + (ce, Curve_end(he_cv,ARR_MIN_END)) != SMALLER)); + + if (!p_cv) //if p_cv was not given + { + // For a vertical curve, we always visit it after visiting + // one of its endpoints. + if ((up == EQUAL) || traits->is_vertical(curr_item)) + { + if (traits->is_active(curr_item)) + return CURVE; + curr_node = curr_node.left_child(); + } + else if (up == LARGER) + { + curr_node = curr_node.right_child(); + } + else + { // if (up==SMALLER) + curr_node = curr_node.left_child(); + } + continue; + } + else //if p_cv was given + { + Comparison_result res = EQUAL; + + if ((traits->parameter_space_in_x_2_object() + (ce.cv(), ce.ce()) == ARR_INTERIOR) && + (traits->parameter_space_in_y_2_object() + (ce.cv(), ce.ce()) == ARR_INTERIOR) ) + { + //if ce is interior then there might be more than one curve + // with ce as its endpoint + bool is_min_equal = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MIN_END), + Curve_end(he_cv,ARR_MIN_END)); + + bool is_max_equal = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MAX_END), + Curve_end(he_cv,ARR_MAX_END)); + + CGAL_warning (is_min_equal || is_max_equal); + + //the underlying point of ce + const Point& p = (ce.ce() == ARR_MIN_END) ? + traits->construct_min_vertex_2_object()(ce.cv()) : + traits->construct_max_vertex_2_object()(ce.cv()) ; + + res = is_min_equal ? + traits->compare_cw_around_point_2_object() + (he_cv, is_curve_to_right(he_cv,p), + *p_cv, is_curve_to_right(*p_cv,p), p) : + traits->compare_cw_around_point_2_object() + (*p_cv, is_curve_to_right(*p_cv,p), + he_cv, is_curve_to_right(he_cv,p), p ,false); + } + + switch(res) + { + case LARGER: + curr_node = curr_node.right_child(); + break; + case SMALLER: + curr_node = curr_node.left_child(); + break; + case EQUAL: + switch(up) + { + case LARGER: + curr_node = curr_node.right_child(); + break; + case SMALLER: + curr_node = curr_node.left_child(); + break; + case EQUAL: + if (traits->is_active(curr_item)) + return CURVE; + curr_node = curr_node.left_child(); + break; + } + break; + } + } + } + } + else + { + // if is_degenerate() == 0, meaning: curr_item is a real trapezoid + if (traits->is_active(curr_item)) + { + Td_active_trapezoid& tr = boost::get(curr_item); + return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID; + } + curr_node = curr_node.left_child(); + continue; + } + } +} + + + + + + +//----------------------------------------------------------------------------- +// Description: +// advances input Data structure using data structure,input point ce and +// possibly X_monotone_curve_2 p_cv till +// ce is found(if p_cv hadn't been given) +// p_cv is found(if p_cv was given) +// or +// leaf node reached +// postcondition: +// output is the closest active trapezoid to ce/p_cv +// remark: +// use this function with care! +template +typename Trapezoidal_decomposition_2::Locate_type +Trapezoidal_decomposition_2 +::search_using_dag_with_cv (Dag_node& curr_node, + const Traits* traits, + const Point& p, + const X_monotone_curve_2* p_cv, + Comparison_result up /*=EQUAL*/) const +{ + + while(true) + { + //curr_node is the current pointer to node in the data structure + //curr_item is the curent Td_map_item held in curr_node + Td_map_item curr_item(curr_node.get_data()); + + if (traits->is_td_vertex(curr_item)) + { // if the curr_item represents a vertex + //bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); + //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + if (is_end_point_left_low(p, curr_node)) + { + curr_node = curr_node.left_child(); + continue; + } + //else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + else if (is_end_point_right_top(p, curr_node)) + { + curr_node = curr_node.right_child(); + continue; + } + //else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) || + // (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) ) + else if (are_equal_end_points(p, curr_node)) + { + if (!p_cv) //if p_cv was not given + { + if ( up == EQUAL ) + { // point found! + if (traits->is_active(curr_item)) + return POINT; + curr_node = curr_node.left_child(); + } + else if ( up == LARGER ) + { // vertical ray shut up + curr_node = curr_node.right_child(); + } + else + { // if ( up == SMALLER ) + curr_node = curr_node.left_child(); // vertical ray shut down + } + continue; + } + else //if p_cv was given + { + bool is_equal_to_he_min = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MIN_END), p); + bool is_equal_to_he_max = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MAX_END), p); + + CGAL_assertion( is_equal_to_he_min || is_equal_to_he_max ); + + curr_node = is_equal_to_he_min ? curr_node.right_child() : curr_node.left_child(); + + continue; + } + } + else + { + CGAL_assertion(is_end_point_left_low(p, curr_node) || + is_end_point_right_top(p, curr_node) || + are_equal_end_points(p, curr_node)); + //CGAL_assertion((is_fict_vtx && + // (is_end_point_left_low(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || + // is_end_point_right_top(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) || + // traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),p))) || + // (!is_fict_vtx && + // (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || + // is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) || + // traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p)))); + return Locate_type(); + } + } + if (traits->is_td_edge(curr_item)) + { // if curr_item represents an edge, + // so top() is a real Halfedge with a curve() if curr_item is active + // or curr_item holds the curve if it is not active + const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item)); + Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv); + if (cres == SMALLER) + { + curr_node = curr_node.left_child(); + continue; + } + else if (cres == LARGER) + { + curr_node = curr_node.right_child(); + continue; + } + else + { + // p is on the CURVE itself + CGAL_warning( + (cres == EQUAL) && + (traits->compare_curve_end_x_2_object() + (p, Curve_end(he_cv,ARR_MAX_END)) != LARGER) && + (traits->compare_curve_end_x_2_object() + (p, Curve_end(he_cv,ARR_MIN_END)) != SMALLER)); + + if (!p_cv) //if p_cv was not given + { + // For a vertical curve, we always visit it after visiting + // one of its endpoints. + if ((up == EQUAL) || traits->is_vertical(curr_item)) + { + if (traits->is_active(curr_item)) + return CURVE; + curr_node = curr_node.left_child(); + } + else if (up == LARGER) + { + curr_node = curr_node.right_child(); + } + else + { // if (up==SMALLER) + curr_node = curr_node.left_child(); + } + continue; + } + else //if p_cv was given + { + Comparison_result res = EQUAL; + + //p is interior then there might be more than one curve + // with p as its endpoint + bool is_min_equal = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MIN_END), + Curve_end(he_cv,ARR_MIN_END)); + + bool is_max_equal = traits->equal_curve_end_2_object() + (Curve_end(*p_cv,ARR_MAX_END), + Curve_end(he_cv,ARR_MAX_END)); + + CGAL_warning (is_min_equal || is_max_equal); + + res = is_min_equal ? + traits->compare_cw_around_point_2_object() + (he_cv, is_curve_to_right(he_cv,p), + *p_cv, is_curve_to_right(*p_cv,p), p) : + traits->compare_cw_around_point_2_object() + (*p_cv, is_curve_to_right(*p_cv,p), + he_cv, is_curve_to_right(he_cv,p), p ,false); + + switch(res) + { + case LARGER: + curr_node = curr_node.right_child(); + break; + case SMALLER: + curr_node = curr_node.left_child(); + break; + case EQUAL: + switch(up) + { + case LARGER: + curr_node = curr_node.right_child(); + break; + case SMALLER: + curr_node = curr_node.left_child(); + break; + case EQUAL: + if (traits->is_active(curr_item)) + return CURVE; + curr_node = curr_node.left_child(); + break; + } + break; + } + } + } + } + else + { + // if is_degenerate() == 0, meaning: curr_item is a real trapezoid + if (traits->is_active(curr_item)) + { + Td_active_trapezoid& tr = boost::get(curr_item); + return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID; + } + curr_node = curr_node.left_child(); + continue; + } + } +} + + + + + +//----------------------------------------------------------------------------- +// Description: +// +template +typename Trapezoidal_decomposition_2::Dag_node +Trapezoidal_decomposition_2 +::container2dag (Nodes_map& ar, int left, int right, + int& num_of_new_nodes) const +{ + CGAL_warning(traits != NULL); + + if (right > left) + { + int d = (int)std::floor((double(right+left))/2); + Dag_node& node(ar.find(d)->second); + Td_map_item item(node.get_data()); + CGAL_assertion(traits->is_active(item)); + CGAL_assertion(traits->is_td_trapezoid(item)); + Dag_node& tr_node( ar.find(d)->second); + Td_active_trapezoid& tr( boost::get(tr_node.get_data())); + Vertex_const_handle v = tr.right(); + + Curve_end ce(traits->vtx_to_ce(v)); + bool is_interior = traits->parameter_space_in_x_2_object()(ce.cv(), ce.ce()) + && traits->parameter_space_in_y_2_object()(ce.cv(), ce.ce()); + + Dag_node curr_node; + Dag_node left_child (container2dag(ar,left,d,num_of_new_nodes)); + Dag_node right_child (container2dag(ar,d+1,right,num_of_new_nodes)); + if (is_interior) + { + curr_node.replace(Td_map_item(Td_active_vertex(v,m_empty_he_handle)),left_child, right_child); + } + else + { + curr_node.replace(Td_map_item(Td_active_fictitious_vertex(v,m_empty_he_handle)),left_child, right_child); + } + + num_of_new_nodes++; + boost::apply_visitor(set_dag_node_visitor((Dag_node*)&(curr_node.left_child())),curr_node.left_child().get_data()); + boost::apply_visitor(set_dag_node_visitor((Dag_node*)&(curr_node.right_child())),curr_node.right_child().get_data()); + boost::apply_visitor(set_dag_node_visitor((Dag_node*)&curr_node),curr_node.get_data()); + //curr_node.left_child()->set_dag_node(&curr_node.left_child()); + //curr_node.right_child()->set_dag_node(&curr_node.right_child()); + //curr_node->set_dag_node(&curr_node);// fake temporary node + deactivate_vertex(curr_node); //curr_node->remove(); // mark as deleted + boost::apply_visitor(set_dag_node_visitor((Dag_node*)NULL),curr_node.get_data());//curr_node->set_dag_node(0); + + return curr_node; + } + else + { + return ar.find(left)->second; + } +} + +template +bool Trapezoidal_decomposition_2 +::is_last_edge(Halfedge_const_handle he , Td_map_item& vtx_item) +{ + CGAL_precondition(traits->is_td_vertex(vtx_item)); + CGAL_precondition(traits->is_active(vtx_item)); + + Vertex_const_handle v (boost::apply_visitor(vertex_for_active_vertex_visitor(), vtx_item)); + + typename Arrangement_on_surface_2::Halfedge_around_vertex_const_circulator first, second; + first = second = v->incident_halfedges(); + ++second; + if (he->source() == v) + he = he->twin(); + CGAL_assertion(he == first); + if (second == first) //if he is the only halfedge around v -> return true + return true; + return false; +} + +//----------------------------------------------------------------------------- +// Description: +// if Halfedge or twin already inserted the latter is returned. +// otherwise the left-low most edge-degenerate trapezoid that represents the +// input Halfedge is returned +// Remark: +// Given an edge-degenerate trapezoid representing a Halfedge, +// all the other trapezoids representing the Halfedge can be extracted +// via moving continously to the left and right neighbours. +template +typename Trapezoidal_decomposition_2::Td_map_item +Trapezoidal_decomposition_2 +::insert(Halfedge_const_handle he) //::insert_in_face_interior(Halfedge_const_handle he) +{ + //print_cv_data(he->curve()); + if (m_with_guarantees) + update(); + + // locate the input Halfedge end points in the Td_map_item Dag + + CGAL_assertion(traits != NULL); + + //get the two vertices of the halfedge + Vertex_const_handle v1 = (he->direction() == ARR_LEFT_TO_RIGHT) ? he->source() : he->target(); + Vertex_const_handle v2 = (he->direction() == ARR_LEFT_TO_RIGHT) ? he->target() : he->source(); + + //define the Curve end points (curve end = vertex) + const Curve_end ce1(he, ARR_MIN_END); //MICHAL: to be removed? + const Curve_end ce2(he, ARR_MAX_END); //MICHAL: to be removed? + + // make sure that the two endpoints are not the same point + CGAL_precondition(!traits->equal_curve_end_2_object()(ce1, ce2)); + + Locate_type lt1,lt2; + + //should hold the trapezoids in which the edge endpoints should be located + Td_map_item item1; + Td_map_item item2; + +#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION + + locate_optimization(ce1,item1,lt1); + +#else + //location of the left endpoint of the edge we're inserting + item1 = locate(ce1,lt1); + +#endif + + + //the inserted edge should not cut any existing edge + if (lt1 == CURVE) + { + CGAL_precondition_msg(lt1 != CURVE, "Input is not planar as\ + one of the input point inside previously inserted Halfedge."); + return Td_map_item(0); + } + + //if the edge starts at vertex, we should not insert it into the DAG, + //but we should update all the edges incident to the vertex. + //else if this is a new vertex - insert a node to the DAG that will represent the new vertex. + //the incident edges in this case is only the edge itself, and so it is a trivial operation. + Td_map_item p1_item = (lt1 == POINT) ? + update_vtx_with_new_edge(he,ce1,item1,lt1) : + insert_curve_at_vtx_using_dag(he,v1,item1,lt1); + + +#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION + + locate_optimization(ce2,item2,lt2); + locate_opt_empty(); + +#else + // TODO(oren): locating the second endpoint. this is not necessary, + // and time consuming. + item2 = locate(ce2,lt2); + +#endif + + if (lt2==CURVE) + { + CGAL_precondition_msg(lt2!=CURVE,"Input is not planar as\ + one of the input point inside previously inserted Halfedge."); + return Td_map_item(0); + } + + Td_map_item p2_item = (lt2 == POINT) ? + update_vtx_with_new_edge(he,ce2,item2,lt2) : + insert_curve_at_vtx_using_dag(he,v2,item2,lt2); + + // locate and insert end points of the input halfedge to the Td_map_item + // Dag if needed + Dag_node p1_node(*(boost::apply_visitor(dag_node_visitor(), p1_item))); + //Dag_node p2_node(*(boost::apply_visitor(dag_node_visitor(), p2_item)));// Not in use + + // create the Td_map_item iterator for traveling along the Trapezoids that + // intersect the input Halfedge, using left-low to right-high order + In_face_iterator it = follow_curve(p1_node,he,LARGER); + boost::optional curr_trp = boost::none; + Td_map_item prev = p1_item; + Td_map_item prev_bottom_tr = Td_map_item(0); //active_tr + Td_map_item prev_top_tr = Td_map_item(0); //active_tr + Td_map_item old_e = Td_map_item(0); + Td_map_item old_top_tr = Td_map_item(0); //active_tr + Td_map_item old_bottom_tr = Td_map_item(0); //active_tr + + Dag_node* node = 0; + bool first_time = true; + + CGAL_assertion(!traits->is_empty_item(*it) && traits->is_td_trapezoid(*it)); + + while(!!it) //this means as long as the iterator is valid + { + curr_trp = it.trp(); + CGAL_assertion(curr_trp != boost::none); + prev_bottom_tr = (*curr_trp).lb(); + prev_top_tr = (*curr_trp).lt(); + + // pass using it along cv + it++; //this is the logic of the iterator. + // the iterator goes to the next trapezoid right-high. + node = (*curr_trp).dag_node(); + if(first_time) + { + Halfedge_const_handle top_he ((*curr_trp).top()); + if((top_he == he) || (top_he == he->twin())) { + CGAL_warning((top_he != he) && (top_he != he->twin())); + return Td_map_item(0); + } + } + first_time = false; + + CGAL_assertion(node != NULL); + split_trapezoid_by_halfedge (*node, old_e, old_bottom_tr, old_top_tr, he); + + + + if (node->is_inner_node()) + { + // merge adjacent trapezoids on input Halfedge's bottom side if possible + // make sure we try to merge active trapezoids + //node->left_child() is active + Td_map_item new_btm_item = node->left_child().get_data(); + CGAL_assertion(traits->is_td_trapezoid(new_btm_item) && traits->is_active(new_btm_item)); + if(merge_if_possible(prev_bottom_tr, new_btm_item)) + { + Dag_node* left_child_node = boost::apply_visitor(dag_node_visitor(),prev_bottom_tr); + node->set_left_child(*left_child_node); + old_bottom_tr = prev_bottom_tr; + m_number_of_dag_nodes--; //update number of nodes in the DAG after merge + } + + // merge adjacent trapezoids on input Halfedge's top side if possible + // make sure we try to merge active trapezoids + //node->right_child() is active + Td_map_item new_top_item = node->right_child().get_data(); + CGAL_assertion(traits->is_td_trapezoid(new_top_item) && traits->is_active(new_top_item)); + if(merge_if_possible(prev_top_tr, new_top_item)) + { + Dag_node* right_child_node = boost::apply_visitor(dag_node_visitor(), + prev_top_tr); + node->set_right_child(*right_child_node); + old_top_tr = prev_top_tr; + m_number_of_dag_nodes--; //update number of DAG nodes after merge + } + // update trapezoid's left/right neighbouring relations + //MICHAL: if the assertion below fails then we need to check why + CGAL_assertion(!traits->is_td_trapezoid(prev)); + if(traits->is_td_trapezoid(prev)) + { + //MICHAL: if we reach here ->then this need to be uncommented + // I thought that prev is always a degenerate point + //curr_trp->set_lb(prev); + //curr_trp->set_lt(prev); + //prev->set_rb(curr_trp); + //prev->set_rt(curr_trp); + } + } + else + { + +#ifdef CGAL_TD_DEBUG + + CGAL_assertion((*curr_trp).is_valid(traits)); + +#endif + + break; + } + + } + m_number_of_curves++; + +#ifdef CGAL_TD_DEBUG + write(std::cout,*m_dag_root,*traits) << std::endl; + std::cout << "\nTD::insert() exited with data structure" + << is_valid(*m_dag_root) << std::endl; +#endif + + return old_e; +} + + +//----------------------------------------------------------------------------- +// Description: +// +// Remark: +// Assumes the map to be planar. +template +void Trapezoidal_decomposition_2 +::remove(Halfedge_const_handle he) +{ + //print_dag_addresses(*m_dag_root); + + if (m_with_guarantees) + update(); + +#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION + locate_opt_empty(); +#endif + + CGAL_warning(traits != NULL); + + //calculating leftmost and rightmost curve ends of he + const Curve_end leftmost(he,ARR_MIN_END); + const Curve_end rightmost(he,ARR_MAX_END); + + //locating leftmost & rightmost curve ends + Locate_type lt1,lt2; + Td_map_item p1_item = locate(leftmost,lt1); + Td_map_item p2_item = locate(rightmost,lt2); + + //both should be located on a point degenerate trapezoid + CGAL_warning(lt1==POINT && lt2==POINT); + + if (lt1!=POINT || lt2!=POINT) + return; + + CGAL_warning(boost::apply_visitor(dag_node_visitor(), p1_item) != NULL); + CGAL_warning(boost::apply_visitor(dag_node_visitor(), p2_item) != NULL); + + //retrieve the Dag_nodes of the two point-degenerate trapezoid + Dag_node& p1_node = *(boost::apply_visitor(dag_node_visitor(), p1_item));//*t1.dag_node(); + Dag_node& p2_node = *(boost::apply_visitor(dag_node_visitor(), p2_item));//*t2.dag_node(); + + //calculate the immediate lower, central and upper neighbourhood of + // the curve in the data structure + //In_face_iterator btm_it(follow_curve(tt1,he,SMALLER)); + In_face_iterator btm_it(follow_curve(p1_node,he,SMALLER)); + In_face_iterator mid_it(follow_curve(p1_node,he,EQUAL)); + In_face_iterator top_it(follow_curve(p1_node,he,LARGER)); + + bool inc_btm = true; //true if btm_it should be be incremented (not top_it) + bool prev_inc_btm = false; //holds the inc_btm from previous iteration + bool end_reached = false; //true if this is the last iteration + + //define the map of new DAG nodes of the new trapezoids + Nodes_map new_array; + int last_index[] = {0,0}; + int sz = 0; + + Td_active_trapezoid& btm_it_tr (btm_it.trp()); + Td_active_trapezoid& top_it_tr (top_it.trp()); + Vertex_const_handle left_v = btm_it_tr.left(); + Vertex_const_handle right_v; + Td_map_item last_btm_tr_item = Td_map_item(0); //pointer to the last btm_it tr + Td_map_item last_top_tr_item = Td_map_item(0); //pointer to the last top_it tr + Td_map_item last_new_tr_item = Td_map_item(0); //last new trpz that was created + Td_map_item old_tr_item = Td_map_item(0); //old trpz on which the new is based + + + CGAL_warning((top_it.trp()).left() == left_v); + + //----------------------------------- + //1. remove adjacency at left end point + // first_cv_tr is the first trapezoid representing he (type TD_EDGE) + Td_map_item first_edge_fragment_item (*mid_it); + + //----------------------------------- + //2. update the map & the dag with new trapezoids which are merge of the + // trapezaoids above and below the removed halfedge. + do { + btm_it_tr = btm_it.trp(); + top_it_tr = top_it.trp(); + + // decide which of btm_it,top_it to increment + inc_btm = is_end_point_left_low(Curve_end(traits->vtx_to_ce(btm_it_tr.right())), + Curve_end(traits->vtx_to_ce(top_it_tr.right()))); + // the current iterator that should be incremented + In_face_iterator& curr_it = inc_btm ? btm_it : top_it; + Td_active_trapezoid& curr_it_tr (curr_it.trp()); + + // reference to the last curr_it tr + Td_map_item& last_tr_item (inc_btm ? last_btm_tr_item : last_top_tr_item); + + //set the new trpz right end + right_v = curr_it_tr.right(); + + // create a new trapezoid (the merge of top_it and btm_it) + typename Nodes_map::value_type + pair(sz, + Dag_node(Td_active_trapezoid(left_v, right_v, + btm_it_tr.bottom(),top_it_tr.top()), + std::max(btm_it_tr.dag_node()->depth(), + top_it_tr.dag_node()->depth()))); + new_array.insert(pair); + //copy trapezoid data from btm and top trapezoids + Dag_node& new_node = (new_array.find(sz))->second; + ++sz; + Td_active_trapezoid& tr(boost::get(new_node.get_data())); + tr.set_dag_node(&new_node); + tr.set_lb(btm_it_tr.lb()); + tr.set_lt(top_it_tr.lt()); + //new_node->set_dag_node(&new_node); + //new_node->set_lb(btm_it->lb()); + //new_node->set_lt(top_it->lt()); + if (!traits->is_empty_item(last_new_tr_item)) + { + if (traits->is_trpz_top_equal(last_new_tr_item, new_node.get_data())) + { + tr.set_lt(last_new_tr_item); //new_node->set_lt(last_new_tr); + } + + if (traits->is_trpz_bottom_equal(last_new_tr_item, new_node.get_data())) + { + tr.set_lb(last_new_tr_item); //new_node->set_lb(last_new_tr); + } + } + if (!traits->is_empty_item(tr.lb())) + { + Td_map_item lb_item = tr.lb(); + Td_active_trapezoid& lb_tr(boost::get(lb_item)); + lb_tr.set_rb(new_node.get_data()); + } + if (!traits->is_empty_item(tr.lt())) + { + Td_map_item lt_item = tr.lt(); + Td_active_trapezoid& lt_tr(boost::get(lt_item)); + lt_tr.set_rt(new_node.get_data()); + } + + last_new_tr_item = new_node.get_data(); //new_node.operator->(); //get the last new trapezoid created + + //update arguments for next iteration: + left_v = right_v; //new left is curr right + last_btm_tr_item = *btm_it; + last_top_tr_item = *top_it; + + old_tr_item = *curr_it; //the old trpz on which the new is based + curr_it++; //increment the iterator to the next trapezoid + //curr_it_tr = *(curr_it.trp()); + end_reached = !btm_it || !top_it; + + //copy neighbouring trapezoids in case top/btm are not the same for the old + // trapezoid and the next trapezoid after incrementing the old one + if (!btm_it || + (inc_btm && !traits->is_trpz_bottom_equal(old_tr_item,*curr_it))) + { + Td_map_item rb (boost::apply_visitor(rb_visitor(),old_tr_item)); + if (!traits->is_empty_item(rb)) + { + boost::apply_visitor(set_lb_visitor(last_new_tr_item),rb); //rb->set_lb(last_new_tr); + boost::apply_visitor(set_rb_visitor(rb),last_new_tr_item); //last_new_tr->set_rb(rb); + } + } + if (!top_it || + (!inc_btm && !traits->is_trpz_top_equal(old_tr_item,*curr_it))) + { + Td_map_item rt (boost::apply_visitor(rt_visitor(),old_tr_item)); + if (!traits->is_empty_item(rt)) + { + boost::apply_visitor(set_lt_visitor(last_new_tr_item),rt); //rt->set_lt(last_new_tr); + boost::apply_visitor(set_rt_visitor(rt),last_new_tr_item); //last_new_tr->set_rt(rt); + } + } + + //set the no longer relevant trapezoids as removed and add the new nodes + // as their replacement + + Dag_node* last_tr_node (boost::apply_visitor(dag_node_visitor(), last_tr_item)); + + if (prev_inc_btm != inc_btm) + { + int num_of_new_nodes = 0; + Dag_node tmp = + container2dag (new_array, last_index[inc_btm ? 0 : 1], + sz-1, num_of_new_nodes); + + deactivate_trapezoid( *last_tr_node, &tmp); //last_tr->remove(&tmp); + m_number_of_dag_nodes += num_of_new_nodes; //new vertex nodes (rooted at tmp) were added + m_number_of_dag_nodes += 1; //new node (tmp) was added + + last_index[inc_btm ? 0 : 1] = sz; + prev_inc_btm = inc_btm; //update for next iteration + //tmp is the root of a sub graph. + //The largest depth in this sub-graph may be the largest leaf depth + update_largest_leaf_depth( tmp.max_depth() ); + + } + else + { + int num_of_new_nodes = 0; + Dag_node tmp = container2dag (new_array, sz-1, sz-1, num_of_new_nodes); + + deactivate_trapezoid( *last_tr_node, &tmp); //last_tr->remove(&tmp); + m_number_of_dag_nodes += 1; //new node (tmp) was added + + last_index[inc_btm ? 0 : 1] = sz; + //tmp is a node with no children + update_largest_leaf_depth( tmp.max_depth() ); + } + + // update the dag node pointer in the trapezoid + const Dag_node* real = &last_tr_node->left_child(); + boost::apply_visitor(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real); + } + while(!end_reached); + + + // get the iterator (btm_it or top_it) that holds the trapezoid that was + // not removed in the last iteration + In_face_iterator& it = !prev_inc_btm ? btm_it : top_it; + Td_active_trapezoid& tr (it.trp()); + // remove the last trapezoid to remove and set the last new trapezoid + // created as its replacement. update the relevant data + Td_map_item rb = tr.rb(); + Td_map_item rt = tr.rt(); + + int num_of_new_nodes = 0; + Dag_node tmp = + container2dag(new_array, last_index[!inc_btm ? 0 : 1], + new_array.size()-1, num_of_new_nodes); + + deactivate_trapezoid( *(tr.dag_node()), &tmp); //it->remove(&tmp); + //tmp is the root of a sub graph. + //The largest depth in this sub-graph may be the largest leaf depth + update_largest_leaf_depth( tmp.depth() ); + m_number_of_dag_nodes += num_of_new_nodes; //new node (tmp) was added + + const Dag_node* real = &tr.dag_node()->left_child(); + boost::apply_visitor(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real); + + if (!traits->is_empty_item(rb)) + { + boost::apply_visitor(set_rb_visitor(rb),last_new_tr_item); //last_new_tr->set_rb(rb); + boost::apply_visitor(set_lb_visitor(last_new_tr_item),rb); //rb->set_lb(last_new_tr); + } + if (!traits->is_empty_item(rt)) + { + boost::apply_visitor(set_rt_visitor(rt),last_new_tr_item); //last_new_tr->set_rt(rt); + boost::apply_visitor(set_lt_visitor(last_new_tr_item),rt); //rt->set_lt(last_new_tr); + } + + //----------------------------------- + //3. remove the trapezoids that represent the removed halfedge + boost::shared_ptr removed_cv_ptr (new X_monotone_curve_2(he->curve())); + Base_map_item_iterator last_edge_fragment_it = mid_it;//Base_trapezoid_iterator last_mid = mid_it; + Dag_node* e_node = NULL; + while(!!++mid_it) + { + e_node = boost::apply_visitor(dag_node_visitor(),*last_edge_fragment_it); + deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove(); + last_edge_fragment_it = mid_it; + } + + //----------------------------------- + //4. remove adjacency at right end point + + //remove the final trapezoid representing the removed halfedge + e_node = boost::apply_visitor(dag_node_visitor(),*last_edge_fragment_it); + deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove(); + + //----------------------------------- + //5. if the halfedge vertices are now isolated, undo the split trapezoid + // by point(vtx) operation + if (is_last_edge(he ,p1_item)) + undo_split_trapezoid_by_vertex (p1_node, leftmost); + + if (is_last_edge(he ,p2_item)) + undo_split_trapezoid_by_vertex (p2_node, rightmost); + + //----------------------------------- + //6. reevaluating number of curves + m_number_of_curves--; +} + + +//----------------------------------------------------------------------------- +// Description: +// +// preconditions: +// p is not on an edge or a vertex. +template +typename Trapezoidal_decomposition_2::Td_map_item& +Trapezoidal_decomposition_2 +::vertical_ray_shoot(const Point & p,Locate_type & lt, + const bool up_direction /*=true*/) const +{ +#ifdef CGAL_TD_DEBUG + CGAL_assertion(traits); +#endif + + // We replace the following locate with a direct call to + // search_using_dag because we need to deal + // with cases where the source of shoot is a point/curve. + // reference t_p = locate(p,lt); + + Dag_node curr = *m_dag_root; + + lt = search_using_dag(curr, traits, p, m_empty_he_handle , + up_direction ? + CGAL::LARGER : CGAL::SMALLER); + + Td_map_item& item(curr.get_data()); + + if (traits->is_td_trapezoid(item)) + { + CGAL_assertion(traits->is_active(item)); + /* using exact traits, it may happen that p is on the + right side of the trapezoid directly under its + right point(analogouly directly above its left point). + with the trapezoid extending to the left. + In this case vertical ray shoot upwards(downwards) + doesn't returns c as output. + + Example. + x---x + p + x------x + */ + Td_active_trapezoid& tr (boost::get(item)); + + if ((up_direction && !tr.is_on_right_boundary() && + (traits->compare_curve_end_x_2_object() + (p,traits->vtx_to_ce(tr.right())) == EQUAL) && + (tr.is_on_left_boundary() || + !traits->equal_curve_end_2_object()(traits->vtx_to_ce(tr.left()), + traits->vtx_to_ce(tr.right())))) || + (!up_direction && !tr.is_on_left_boundary() && + (traits->compare_curve_end_x_2_object() + (p,traits->vtx_to_ce(tr.left())) == EQUAL) && + (tr.is_on_right_boundary() || + !traits->equal_curve_end_2_object()(traits->vtx_to_ce(tr.left()), + traits->vtx_to_ce(tr.right()))))) + { + // recalculate vertical ray shoot using locate on point + return up_direction ? + locate(traits->vtx_to_ce(tr.right()),lt) : locate(traits->vtx_to_ce(tr.left()),lt); + } + + if (up_direction ? tr.is_on_top_boundary() : tr.is_on_bottom_boundary()) + lt = UNBOUNDED_TRAPEZOID; + else + lt = TRAPEZOID; + + } + return item; +} + +//MICHAL: commented due to inefficient depth update, remove and insert instead +//----------------------------------------------------------------------------- +//// Description: +//// +//template +//void Trapezoidal_decomposition_2 +//::before_split_edge(const X_monotone_curve_2& cv, +// const X_monotone_curve_2& cv1, +// const X_monotone_curve_2& cv2) +//{ +//#ifdef MICHAL_DEBUG +// std::cout << "SPLITTING: --------------------------" << std::endl; +// std::cout << "cv before split" << std::endl; +// print_cv_data(cv); +// std::cout << "cv1 before split" << std::endl; +// print_cv_data(cv1); +// std::cout << "cv2 before split" << std::endl; +// print_cv_data(cv2); +//#endif +// +//#ifdef CGAL_TD_DEBUG +// std::cout << "\nTD::before_split_edge(" << cv << "," << cv1 << "," << cv2 +// << ") called with " +// << (is_valid(*m_dag_root) ? "valid" : "invalid") +// << " data structure" << std::endl; +// write(std::cout,*m_dag_root,*traits) << std::endl; +//#endif +// +// if (m_with_guarantees) update(); +// +//#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION +// +// locate_opt_empty(); +// +//#endif +// +//#ifndef CGAL_TD_DEBUG +// +// if (!traits) +// { +// CGAL_warning(traits != NULL); +// return; +// } +// if (!traits->are_mergeable_2_object()(cv1,cv2)) +// { +// CGAL_warning(traits->are_mergeable_2_object()(cv1,cv2)); +// return; +// } +// +//#else +// +// if (!traits->are_mergeable_2_object()(cv1,cv2)) +// { +// std::cerr << "\ncv " << cv; +// std::cerr << "\ncv1 " << cv1; +// std::cerr << "\ncv1 " << cv2 << std::endl; +// } +// CGAL_precondition(traits != NULL); +// CGAL_precondition(traits->are_mergeable_2_object()(cv1,cv2)); +// +//#endif +// +// // find the splitting point (curve end) +// Curve_end split_ce = +// traits->equal_curve_end_2_object()(Curve_end(cv1, ARR_MAX_END), +// Curve_end(cv2, ARR_MIN_END) ) ? +// Curve_end(cv1, ARR_MAX_END) : Curve_end(cv2, ARR_MAX_END); +// +// +// +//#ifndef CGAL_TD_DEBUG +// +// CGAL_warning( is_end_point_left_low(Curve_end(cv,ARR_MIN_END),split_ce) ); +// +// CGAL_warning( is_end_point_right_top(Curve_end(cv,ARR_MAX_END),split_ce) ); +// +//#else +// +// CGAL_precondition( is_end_point_left_low(Curve_end(cv,ARR_MIN_END),split_ce) ); +// +// CGAL_precondition( is_end_point_right_top(Curve_end(cv,ARR_MAX_END),split_ce) ); +// +//#endif +// +// // find extremal points +// const Curve_end leftmost = (traits->equal_curve_end_2_object() +// (Curve_end(cv1, ARR_MAX_END), +// Curve_end(cv2, ARR_MIN_END) ))? +// Curve_end(cv1,ARR_MIN_END) : +// Curve_end(cv2,ARR_MIN_END) ; +// +// const Curve_end rightmost = (traits->equal_curve_end_2_object() +// (Curve_end(cv1, ARR_MAX_END), +// Curve_end(cv2, ARR_MIN_END) ))? +// Curve_end(cv2,ARR_MAX_END) : +// Curve_end(cv1,ARR_MAX_END) ; +// +// CGAL_assertion(traits->equal_curve_end_2_object() +// (Curve_end(cv,ARR_MIN_END), leftmost)); +// CGAL_assertion(traits->equal_curve_end_2_object() +// (Curve_end(cv,ARR_MAX_END), rightmost)); +// +// //locate the trapezoids of the extremal points +// Locate_type lt1,lt2; +// +// // representing trapezoids for extremal points +// X_trapezoid& t1 = locate(leftmost,lt1); +// X_trapezoid& t2 = locate(rightmost,lt2); +// +//#ifndef CGAL_TD_DEBUG +// +// CGAL_warning(lt1==POINT && lt2==POINT); +// CGAL_warning(t1.is_active() && t2.is_active()); +// +//#else +// +// CGAL_precondition(lt1==POINT && lt2==POINT); +// CGAL_precondition(t1.is_active() && t2.is_active()); +// CGAL_warning(t1.dag_node() != NULL); +// CGAL_warning(t2.dag_node() != NULL); +// +//#endif +// m_before_split.m_cv_before_split = cv; +// //set iterators for below curve, on curve & above curve +// Dag_node& tt1 = *t1.dag_node(); +// m_before_split.m_p_btm_it = new In_face_iterator(follow_curve(tt1,m_before_split.m_cv_before_split,SMALLER)); +// m_before_split.m_p_mid_it = new In_face_iterator(follow_curve(tt1,m_before_split.m_cv_before_split,EQUAL)); +// m_before_split.m_p_top_it = new In_face_iterator(follow_curve(tt1,m_before_split.m_cv_before_split,LARGER)); +// //locate the splitting point in the trapezoidal map +// // should be found on a degenerate trapezoid representing a curve +// Locate_type lt; +// X_trapezoid& old_t = locate(split_ce,lt); +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(lt==CURVE); +// CGAL_precondition(old_t.is_active()); +// CGAL_warning(old_t.dag_node()); +// +//#endif +// //the DAG node of the curve trapezoid where the spiltting point is +// Dag_node& old_split_node = *old_t.dag_node(); +// +// CGAL_assertion(traits->equal_curve_end_2_object() +// (traits->vtx_to_ce(old_t.left()),leftmost)); +// +// CGAL_assertion(traits->equal_curve_end_2_object() +// (traits->vtx_to_ce(old_t.right()),rightmost)); +// +// +// +// m_before_split.m_p_old_t = &old_t; +// m_before_split.m_p_t1 = &t1; +// m_before_split.m_p_t2 = &t2; +// +//} + +//----------------------------------------------------------------------------- +// Description: +// Input: +// 1 whole curves +// 2 partial halfedge_handle-s +// precondition: +// The two halfedges are valid +// The first input curve is the union of the two halfedges. +// The intersection of the latter is a point inside the +// interior of the former. +// The latter are ordered from left-down to right-up +// postcondition: +// The first input curve is broken into two halfedges +// corresponding to the input. + + + + +//MICHAL: commented due to inefficient depth update, remove and insert instead +//template +//void Trapezoidal_decomposition_2 +//::split_edge(const X_monotone_curve_2& cv,Halfedge_const_handle he1, +// Halfedge_const_handle he2) +//{ +// //make sure both halfedges are valid +// CGAL_precondition_code(Halfedge_const_handle invalid_he); +// CGAL_precondition( he1 != invalid_he); +// CGAL_precondition( he2 != invalid_he); +// +//#ifdef CGAL_TD_DEBUG +// std::cout << "\nTD::split_edge(" << cv << "," << he1 << "," << he2 +// << ") called with " << (is_valid(*m_dag_root) ? "valid" : "invalid") +// << " data structure" << std::endl; +// write(std::cout,*m_dag_root,*traits) << std::endl; +//#endif +// +// +// // find the splitting point (vertex & curve end) +// Vertex_const_handle split_v = +// traits->equal_curve_end_2_object()(Curve_end(he1, ARR_MAX_END), +// Curve_end(he2, ARR_MIN_END) ) ? +// ((he1->direction()== ARR_LEFT_TO_RIGHT) ? +// he1->target() : he1->source()) +// :((he2->direction()== ARR_LEFT_TO_RIGHT) ? +// he2->target() : he2->source()); +// +// Curve_end ce(traits->vtx_to_ce(split_v)); +// +// // find extremal points +// const Curve_end leftmost = (traits->equal_curve_end_2_object() +// (Curve_end(he1, ARR_MAX_END), +// Curve_end(he2, ARR_MIN_END) ))? +// Curve_end(he1,ARR_MIN_END) : +// Curve_end(he2,ARR_MIN_END) ; +// +// const Curve_end rightmost = (traits->equal_curve_end_2_object() +// (Curve_end(he1, ARR_MAX_END), +// Curve_end(he2, ARR_MIN_END) ))? +// Curve_end(he2,ARR_MAX_END) : +// Curve_end(he1,ARR_MAX_END) ; +// +// +// //MICHAL: new +// X_trapezoid& t1 = *m_before_split.m_p_t1; +// X_trapezoid& t2 = *m_before_split.m_p_t2; +// X_trapezoid& old_t = *m_before_split.m_p_old_t; +// In_face_iterator& bottom_it = *m_before_split.m_p_btm_it; +// In_face_iterator& mid_it = *m_before_split.m_p_mid_it; +// In_face_iterator& top_it = *m_before_split.m_p_top_it; +// //MICHAL: new end +// +// //the DAG node of the curve trapezoid where the spiltting point is +// Dag_node& old_split_node = *old_t.dag_node(); +// +// +// // previous left and right sons of this DAG node +// const Dag_node& old_left = old_split_node.left_child(); +// const Dag_node& old_right= old_split_node.right_child(); +// +// //define the left halfedge and the right halfedge, according +// // to the splitting point +// //Halfedge_const_handle* p_left_he = NULL; +// //Halfedge_const_handle* p_right_he = NULL; +// Halfedge_const_handle left_he = he2; +// Halfedge_const_handle right_he = he1; +// +// if (traits->equal_curve_end_2_object() (Curve_end(he2,ARR_MIN_END), ce)) +// { +// left_he = he1; //p_left_he = &he1; +// right_he = he2; //p_right_he = &he2; +// } +// //else +// //{ +// // p_left_he = &he2; +// // p_right_he = &he1; +// //} +// +// CGAL_assertion(old_t.is_active()); +// +// //updating the data structure: +// // the cv trpz where the splitting point is located will hold the point +// // its new left will hold the left cv (left and right children as before) +// // its new right will hold the right cv (left and right children asa before) +// +// //defining the new left child node +// const Dag_node& new_left_node = +// Dag_node(X_trapezoid(old_t.left(), split_v, +// left_he, left_he, //*p_left_he, *p_left_he, +// X_trapezoid::TD_EDGE), +// old_left, old_right); +// +// //defining the new right child node +// const Dag_node& new_right_node = +// Dag_node(X_trapezoid(split_v, old_t.right(), +// right_he, right_he, //*p_right_he, *p_right_he, +// X_trapezoid::TD_EDGE), +// old_left, old_right); +// +// //defining the new parent node (which is the splitting point): +// +// //split_v is the ARR_MAX_END of left_te, and ARR_MIN_END of right_te. +// //need to send the halfedge whose source is split_v. +// Halfedge_const_handle btm_he = left_he; +// if (btm_he->direction() == ARR_LEFT_TO_RIGHT) +// btm_he = btm_he->twin(); +// //Halfedge_const_handle* p_btm = p_left_he; +// //if ((*p_btm)->direction() == ARR_LEFT_TO_RIGHT) +// // p_btm = &(*p_btm)->twin(); +// +// Halfedge_const_handle top_he = right_he; +// if (top_he->direction() == ARR_RIGHT_TO_LEFT) +// top_he = top_he->twin(); +// //Halfedge_const_handle* p_top = p_right_he; +// //if ((*p_top)->direction() == ARR_RIGHT_TO_LEFT) +// // p_top = &(*p_top)->twin(); +// +// +// const Dag_node& new_pnt_node = +// Dag_node(X_trapezoid(split_v, split_v, btm_he, top_he, //*p_btm, *p_top, +// X_trapezoid::TD_VERTEX), +// new_left_node, new_right_node); +// +// X_trapezoid& new_left_t = *new_left_node; +// X_trapezoid& new_right_t= *new_right_node; +// X_trapezoid& new_t = *new_pnt_node; +// +// // locate trapezoid trees that correspond to the closest +// // trapezoids above and below ce +// X_trapezoid* left_top_t = top_it.operator->(); +// X_trapezoid* left_bottom_t= bottom_it.operator->(); +// +// while(is_end_point_left_low(traits->vtx_to_ce(left_top_t->right()),ce)) +// left_top_t = left_top_t->rb(); +// +// while(is_end_point_left_low(traits->vtx_to_ce(left_bottom_t->right()),ce)) +// left_bottom_t = left_bottom_t->rt(); +// +// Dag_node left_top = *left_top_t->dag_node(); +// Dag_node left_bottom = *left_bottom_t->dag_node(); +// +// //replace the old curve cv with the new curves in the leftmost +// // and rightmost end points. +// //the curve end ce belongs to cv interior +// set_trp_params_after_split_halfedge_update (left_he , t1, he1, he2); +// set_trp_params_after_split_halfedge_update (right_he, t2, he1, he2); +// +// //set the point's lb() which is: +// // the first halfedge adjacent to the point emanating toward up +// // or right sweeped using a counter clockwise sweep +// // starting from up direction not including. +// //set the point's rt() which is: +// // the first halfedge adjacent to the point emanating toward bottom +// // or left sweeped using a counter clockwise sweep +// // starting from bottom direction not including. +// new_t.set_rt (&new_left_t); +// new_t.set_lb (&new_right_t); +// +// //set lb() and rt(0 of the two halfedges trapezoids +// // rt() is the next clockwise degenerate_curve around +// // rightmost end_point (possibly himself) +// // lb() is the next clockwise degenerate_curve around +// // leftmost end_point (possibly himself) +// new_left_t.set_lb ((old_t.lb() != &old_t) ? old_t.lb() : &new_left_t); +// new_left_t.set_rt (&new_right_t); +// new_right_t.set_lb(&new_left_t); +// new_right_t.set_rt((old_t.rt() != &old_t)? old_t.rt() : &new_right_t); +// +// // update geometric boundary for trapezoids representing cv +// // first update the trapezoids of the new left curve +// X_trapezoid* prev = 0; +// while(*mid_it != old_t) +// { +// mid_it->set_top(left_he); +// mid_it->set_bottom(left_he); +// mid_it->set_right(split_v); +// +// //MICHAL: added this assertion just to be sure: +// CGAL_assertion(mid_it->type() == X_trapezoid::TD_EDGE); //MICHAL: won't work, I removed the type() method +// +// //MICHAL: who is prev? +// prev = mid_it.operator->(); +// mid_it++; +// } +// if (prev) +// { +// prev->set_rb(&new_left_t); //MICHAL: I don't understand this +// } +// else // new_left_t is leftmost representative for he +// { +// //set_neighbours_after_split_halfedge_update (new_left_t, t1, he1, he2); //MICHAL: this method does nothing +// } +// if (t1.rt()==&old_t) t1.set_rt(&new_left_t); +// if (t1.lb()==&old_t) t1.set_lb(&new_left_t); +// mid_it++; +// new_right_t.set_rb(mid_it.operator->()); //MICHAL: what does it do? +// +// prev = 0; +// while(!!mid_it) +// { +// mid_it->set_top(right_he); +// mid_it->set_bottom(right_he); +// mid_it->set_left(split_v); +// +// //MICHAL: added this assertion just to be sure: +// CGAL_assertion(mid_it->type() == X_trapezoid::TD_EDGE); +// +// prev = mid_it.operator->(); +// mid_it++; +// } +// if (prev) +// { +// new_right_t.set_rb(old_t.rb()); //MICHAL: I don't understand this +// } +// else // new_right_t is rightmost representative for te +// { +// //set_neighbours_after_split_halfedge_update (new_right_t,t2,he1, he2,false); //MICHAL: this method does nothing +// } +// if (t2.rt()==&old_t) t2.set_rt(&new_right_t); +// if (t2.lb()==&old_t) t2.set_lb(&new_right_t); +// +// // update geometric boundary for trapezoids below te +// while (*bottom_it != *left_bottom) +// { +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion (traits->equal_2_object()(bottom_it->top()->curve(), cv)); +// +//#endif +// //MICHAL: added this assertion to see if it fails (if we reach an edge_end) +// CGAL_assertion (bottom_it->type() == X_trapezoid::TD_TRAPEZOID); +// +// bottom_it->set_top(left_he); +// bottom_it++; +// } +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion (*bottom_it==*left_bottom); +// +//#endif +// +// Dag_node& bottom_tt = *bottom_it->dag_node(); +// bottom_it++; +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(traits->is_in_closure (*bottom_tt, ce)); +// +//#endif +// +// split_trapezoid_by_vertex (bottom_tt, split_v, btm_he, top_he); //*p_btm, *p_top); +// // set the splitting trapezoid to be the same one that splits the +// // X_curve'like trapezoid +// *bottom_tt = new_t; +// // update top curves +// bottom_tt.left_child()->set_top(left_he); +// bottom_tt.right_child()->set_top(right_he); +// // left and right are not neighbours. +// bottom_tt.left_child()->set_rt(0); +// bottom_tt.right_child()->set_lt(0); +// +// +// while(!!bottom_it) +// { +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(traits->equal_2_object() (bottom_it->top()->curve(), cv)); +// +//#endif +// //MICHAL: added this assertion to see if it fails (if we reach an edge_end) +// CGAL_assertion(bottom_it->type() == X_trapezoid::TD_TRAPEZOID); +// +// bottom_it->set_top(right_he); +// bottom_it++; +// } +// +// // update geometric boundary for trapezoids above cv +// while (*top_it != *left_top) +// { +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(traits->equal_2_object() (top_it->bottom()->curve(), cv)); +// +//#endif +// //MICHAL: added this assertion to see if it fails (if we reach an edge_end) +// CGAL_assertion(top_it->type() == X_trapezoid::TD_TRAPEZOID); +// +// top_it->set_bottom(left_he); +// top_it++; +// } +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(*top_it == *left_top); +// +//#endif +// +// Dag_node &top_tt = *top_it->dag_node(); +// top_it++; +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion(traits->is_in_closure (*top_tt, ce)); +// +//#endif +// +// split_trapezoid_by_vertex (top_tt, split_v, btm_he, top_he);// left_he, right_he); +// // set the splitting trapezoid to be the same one that splits the +// // X_curve'like trapezoid +// *top_tt = new_t; +// // update bottom side +// top_tt.left_child()->set_bottom(left_he); +// top_tt.right_child()->set_bottom(right_he); +// // left and right aren't neighbours +// top_tt.left_child()->set_rb(0); +// top_tt.right_child()->set_lb(0); +// +// while(!!top_it) +// { +// +//#ifndef CGAL_TD_DEBUG +// +// CGAL_warning(traits->equal_2_object()(top_it->bottom()->curve(), cv)); +// +//#else +// +// if (!traits->equal_2_object()(top_it->bottom()->curve(), cv)) +// std::cout << "\ntop_it->bottom()->curve() "<< top_it->bottom()->curve() +// << "\t cv= " << cv; +// CGAL_assertion(traits->equal_2_object()(top_it->bottom()->curve() ,cv)); +// +//#endif +// //MICHAL: added this assertion to see if it fails (if we reach an edge_end) +// CGAL_assertion(top_it->type() == X_trapezoid::TD_TRAPEZOID); +// +// top_it->set_bottom(right_he); +// top_it++; +// } +// +// // mark inactive trapezoids +// // depth of new_pnt_node is updated here (in the remove operation) +// // and also depth of the sub-DAG rooted at it +// old_t.remove((Dag_node*)&new_pnt_node); +// update_largest_leaf_depth( new_pnt_node.max_depth() ); //MICHAL: this is a recursive call for the sub-DAG --EXPENSIVE! +// //adding nodes for the splitting-point and the two parts of the split curve +// m_number_of_dag_nodes += 3; +// old_t.set_curve_for_rem_he(m_before_split.m_cv_before_split); //MICHAL: added this so the trpz will hold the original curve before the split +// +// const Dag_node* p_new = &old_t.dag_node()->left_child(); +// const Dag_node* p_new_left = &p_new->left_child(); +// const Dag_node* p_new_right = &p_new->right_child(); +// const Dag_node* p_old_left = &p_new_left->left_child(); +// const Dag_node* p_old_right = &p_new_left->right_child(); +// +// (*p_new)->set_dag_node ((Dag_node*)p_new); +// (*p_new_left)->set_dag_node ((Dag_node*)p_new_left); +// (*p_new_right)->set_dag_node ((Dag_node*)p_new_right); +// (*p_old_left)->set_dag_node ((Dag_node*)p_old_left); +// (*p_old_right)->set_dag_node ((Dag_node*)p_old_right); +// +//#ifdef CGAL_TD_DEBUG +// +// CGAL_assertion (old_split_node->is_valid(traits)); +// CGAL_assertion (new_pnt_node->is_valid(traits)); +// CGAL_assertion ((*p_new)->is_valid(traits)); +// CGAL_assertion ((*p_new_left)->is_valid(traits)); +// CGAL_assertion ((*p_new_right)->is_valid(traits)); +// CGAL_assertion ((*p_old_left)->is_valid(traits)); +// CGAL_assertion ((*p_old_right)->is_valid(traits)); +// CGAL_assertion (top_tt->is_valid(traits)); +// CGAL_assertion (bottom_tt->is_valid(traits)); +// CGAL_assertion (old_left->is_valid(traits)); +// CGAL_assertion (old_right->is_valid(traits)); +// CGAL_assertion (traits->is_degenerate_point(**p_new)); +// CGAL_assertion (traits->is_degenerate_curve(**p_new_left)); +// CGAL_assertion (traits->is_degenerate_curve(**p_new_right)); +// CGAL_assertion (traits->equal_curve_end_2_object() +// (Curve_end((*p_new_right)->bottom(), ARR_MIN_END), +// (*p_new)->right()) ); +// CGAL_assertion (traits->equal_curve_end_2_object() +// (Curve_end((*p_new_left)->top(), ARR_MAX_END), +// (*p_new)->left()) ); +//#endif +// +// // reevaluating number of curves +// m_number_of_curves++; +// +//#ifdef CGAL_TD_DEBUG +// std::cout << "\nTD::split_edge() exited with data structure" +// << is_valid(*m_dag_root) << std::endl; +// write(std::cout,*m_dag_root,*traits) << std::endl; +//#endif +//} +// + + + +//----------------------------------------------------------------------------- +// Description: +// +template +void Trapezoidal_decomposition_2 +::merge_edge (Halfedge_const_handle he1, + Halfedge_const_handle he2, + const X_monotone_curve_2& cv) +{ + //make sure the halfedge is valid + CGAL_precondition_code(Halfedge_const_handle invalid_he); + CGAL_precondition( he1 != invalid_he); + CGAL_precondition( he2 != invalid_he); + +#ifdef CGAL_TD_DEBUG + std::cout << "\nTD::merge_edge(" << he1->curve() << "," << he2->curve() + << "," << cv + << ") called with " << (is_valid(*m_dag_root) ? "valid" : "invalid") + << " data structure" << std::endl; + write(std::cout,*m_dag_root,*traits) << std::endl; +#endif + + if (m_with_guarantees) + update(); + +#ifndef CGAL_NO_TRAPEZOIDAL_DECOMPOSITION_2_OPTIMIZATION + + locate_opt_empty(); + +#endif + + const X_monotone_curve_2& cv1 = he1->curve(); + const X_monotone_curve_2& cv2 = he2->curve(); + + if (!traits) + { + CGAL_warning(traits != NULL); + return; + } + if (!traits->are_mergeable_2_object() (cv1, cv2)) + { + CGAL_warning(traits->are_mergeable_2_object() (cv1, cv2)); + return; + } + + // Calculate the common/merged point (Curve_end) of cv1 and cv2. + // There should be one! + Curve_end ce = traits->equal_curve_end_2_object() + (Curve_end(cv1,ARR_MAX_END),Curve_end(cv2,ARR_MIN_END)) ? + Curve_end(cv1,ARR_MAX_END) : + // [-- cv1 -->] p [-- cv2 -->] or [<-- cv2 --] p [<-- cv1 --] + traits->equal_curve_end_2_object() + (Curve_end(cv1,ARR_MIN_END),Curve_end(cv2,ARR_MAX_END)) ? + // [<-- cv1 --] p [<-- cv2 --] or [-- cv2 -->] p [-- cv1 -->] + Curve_end(cv1,ARR_MIN_END) : // + traits->equal_curve_end_2_object() + (Curve_end(cv1,ARR_MIN_END),Curve_end(cv2,ARR_MIN_END)) ? + // [<-- cv1 --] p [-- cv2 -->] + Curve_end(cv1,ARR_MIN_END) : + // [-- cv1 -->] p [<-- cv2 --] + Curve_end(cv1,ARR_MAX_END); + + //find the halfedge that will contain the merged curve + // [<-- cv1 --] p [<-- cv2 --] or [<-- cv1 --] p [-- cv2 -->]-> he1->twin() + // [-- cv1 -->] p [-- cv2 -->] or [-- cv1 -->] p [<-- cv2 --]-> he1 + // Notice the curve cv is not yet updated + Halfedge_const_handle merged_he = + (traits->equal_curve_end_2_object() + (Curve_end(cv1, ARR_MIN_END), Curve_end(cv2, ARR_MAX_END)) || + traits->equal_curve_end_2_object() + (Curve_end(cv1, ARR_MIN_END), Curve_end(cv2, ARR_MIN_END)) ) + ? he1->twin() : he1; + +#ifdef CGAL_TD_DEBUG + // ce is interior to the union curve + CGAL_precondition( + is_end_point_left_low (Curve_end(cv, ARR_MIN_END), ce)); + CGAL_precondition( + is_end_point_right_top (Curve_end(cv, ARR_MAX_END), ce)); + +#endif + + //get the leftmost & rightmost Curve_end-s + + Curve_end leftmost (cv, ARR_MIN_END); + Curve_end rightmost (cv, ARR_MAX_END); + + //locate the leftmost, rightmost and the merged point in the data structure + Locate_type lt1,lt2,lt; + Td_map_item leftp_item = locate (leftmost, lt1); + Td_map_item rightp_item = locate (rightmost, lt2); + Td_map_item mrgp_item = locate (ce, lt); + + + //varifying that all trapezoids are not NULL and are of type POINT + CGAL_warning (boost::apply_visitor(dag_node_visitor(),leftp_item) != NULL); + CGAL_warning (boost::apply_visitor(dag_node_visitor(),rightp_item)!= NULL); + CGAL_warning (boost::apply_visitor(dag_node_visitor(),mrgp_item) != NULL); + + + + //define the left curve and the right curve, according + // to the common point (that is merged) + const X_monotone_curve_2* p_left_cv = &cv2; + const X_monotone_curve_2* p_right_cv = &cv1; + Halfedge_const_handle left_he = he2; + Halfedge_const_handle right_he = he1; + if (traits->equal_curve_end_2_object() (Curve_end (cv2, ARR_MIN_END), ce)) + { + p_left_cv = &cv1; + p_right_cv = &cv2; + left_he = he1; + right_he = he2; + } + +#ifdef CGAL_TD_DEBUG + + //CGAL_assertion (traits->equal_curve_end_2_object() + // (leftp_item.left(), leftmost)); + //CGAL_assertion (traits->equal_curve_end_2_object() + // (rightp_item.left(), rightmost)); + + CGAL_assertion (is_end_point_left_low(leftmost, ce)); + CGAL_assertion (is_end_point_left_low(ce, rightmost)); + //compare left cv min with leftmost + CGAL_assertion (traits->equal_curve_end_2_object() + (Curve_end(*p_left_cv, ARR_MIN_END), leftmost)); + //compare left cv max with ce + CGAL_assertion (traits->equal_curve_end_2_object() + (Curve_end(*p_left_cv, ARR_MAX_END), ce)); + //compare right cv min with ce + CGAL_assertion (traits->equal_curve_end_2_object() + (Curve_end(*p_right_cv, ARR_MIN_END), ce)); + //compare right cv max with rightmost + CGAL_assertion (traits->equal_curve_end_2_object() + (Curve_end(*p_right_cv, ARR_MAX_END), rightmost)); + +#endif + + //get the nodes of leftmost point and merge point + Dag_node& leftp_node = *(boost::apply_visitor(dag_node_visitor(),leftp_item)); + Dag_node& mrgp_node = *(boost::apply_visitor(dag_node_visitor(),mrgp_item)); + + //set iterators for below left curve, on left curve & above left curve + In_face_iterator + btm_left_it (follow_curve (leftp_node, *p_left_cv, SMALLER)), + mid_left_it (follow_curve (leftp_node, *p_left_cv, EQUAL)), + top_left_it (follow_curve (leftp_node, *p_left_cv, LARGER)); + + //set iterators for below right curve, on right curve & above right curve + In_face_iterator + btm_right_it (follow_curve (mrgp_node, *p_right_cv, SMALLER)), + mid_right_it (follow_curve (mrgp_node, *p_right_cv, EQUAL)), + top_right_it (follow_curve (mrgp_node, *p_right_cv, LARGER)); + + +#ifdef CGAL_TD_DEBUG + + CGAL_assertion (btm_left_it.operator->()); + CGAL_assertion (mid_left_it.operator->()); + CGAL_assertion (top_left_it.operator->()); + CGAL_assertion (btm_right_it.operator->()); + CGAL_assertion (mid_right_it.operator->()); + CGAL_assertion (top_right_it.operator->()); + CGAL_assertion (traits->is_active(*btm_left_it.operator->())); + CGAL_assertion (traits->is_active(*mid_left_it.operator->())); + CGAL_assertion (traits->is_active(*top_left_it.operator->())); + CGAL_assertion (traits->is_active(*btm_right_it.operator->())); + CGAL_assertion (traits->is_active(*mid_right_it.operator->())); + CGAL_assertion (traits->is_active(*top_right_it.operator->())); + +#endif + + //replacing old curves with the new merged halfedge + + Td_map_item left_cv_fraction_item = *mid_left_it; + Td_map_item on_cv_left = Td_map_item(0); + Td_map_item on_cv_right = *mid_right_it; + Td_map_item above_cv_left = Td_map_item(0); + Td_map_item above_cv_right = *top_right_it; + Td_map_item below_cv_left = Td_map_item(0); + Td_map_item below_cv_right = *btm_right_it; + Td_map_item right_cv_fraction_item= Td_map_item(0); + Td_map_item dummy1 = Td_map_item(0); + Td_map_item dummy2 = Td_map_item(0); + + Vertex_const_handle leftmost_v = + (left_he->direction() == ARR_LEFT_TO_RIGHT) ? left_he->source() : + left_he->target(); + Vertex_const_handle rightmost_v = + (right_he->direction() == ARR_LEFT_TO_RIGHT) ? right_he->target() : + right_he->source(); + //replacing the given curve with a new Halfedge_handle along the trapezoids + // starting at the iterator, until the end (last parameter) is reached. + // updating the last param as the last updated trapzoid + update_map_items_after_merge (mid_left_it, left_he, merged_he, + leftmost_v, rightmost_v, on_cv_left); + update_map_items_after_merge (mid_right_it, right_he, merged_he, + leftmost_v, rightmost_v, right_cv_fraction_item); + update_map_items_after_merge (top_left_it, left_he, merged_he, + leftmost_v, rightmost_v, above_cv_left); + update_map_items_after_merge (top_right_it, right_he, merged_he, + leftmost_v, rightmost_v, dummy1); + update_map_items_after_merge (btm_left_it, left_he, merged_he, + leftmost_v, rightmost_v, below_cv_left); + update_map_items_after_merge (btm_right_it, right_he, merged_he, + leftmost_v, rightmost_v, dummy2); + + + // merge trapezoids that were split by the upward and downward + // vertical extensions from ce (the merged point) + + // make sure only active trapezoids are merged + CGAL_assertion( traits->is_active(above_cv_left) && traits->is_active(above_cv_right) ); + CGAL_assertion( traits->is_active(below_cv_left) && traits->is_active(below_cv_right) ); + + merge_if_possible (above_cv_left, above_cv_right); + merge_if_possible (below_cv_left, below_cv_right); + + // mark older trapezoids as inactive - nodes depth are updated here + Dag_node* above_cv_right_node (boost::apply_visitor(dag_node_visitor(),above_cv_right)); + Dag_node* above_cv_left_node (boost::apply_visitor(dag_node_visitor(),above_cv_left)); + deactivate_trapezoid( *above_cv_right_node, above_cv_left_node); //above_cv_right->remove(above_cv_left->dag_node()); + Dag_node* below_cv_right_node (boost::apply_visitor(dag_node_visitor(),below_cv_right)); + Dag_node* below_cv_left_node (boost::apply_visitor(dag_node_visitor(),below_cv_left)); + deactivate_trapezoid( *below_cv_right_node, below_cv_left_node); //below_cv_right->remove(below_cv_left->dag_node()); + update_largest_leaf_depth(std::max(above_cv_left_node->depth(), + below_cv_left_node->depth())); + //no need to update m_number_of_dag_nodes because the number of nodes did not change. + + +#ifdef CGAL_TD_DEBUG + + CGAL_warning (!traits->is_empty_item(on_cv_left)); + CGAL_warning (!traits->is_empty_item(on_cv_right)); + +#endif + + // make the merged point's representative inactive + deactivate_vertex(mrgp_node); //mrgp_node->remove(); + + CGAL_assertion(traits->is_td_edge(on_cv_left) && traits->is_active(on_cv_left)); + + Td_active_edge& e_left (boost::get(on_cv_left)); + e_left.set_next(on_cv_right); + + CGAL_assertion(traits->is_td_edge(on_cv_right) && traits->is_active(on_cv_right)); + + //replacing the curve in the end points' trapezoids themselves (updating top/ bottom) + update_vtx_cw_he_after_merge (*p_left_cv, merged_he, leftp_item); + update_vtx_cw_he_after_merge (*p_right_cv, merged_he, rightp_item); //MICHAL: maybe I should pass the he1 & he2? + +#ifdef CGAL_TD_DEBUG + + CGAL_warning(!traits->is_empty_item(left_cv_fraction_item)); + CGAL_warning(!traits->is_empty_item(right_cv_fraction_item)); + +#endif + + // reevaluating number of curves + m_number_of_curves--; + +#ifdef CGAL_TD_DEBUG + std::cout << "\nTD::merge_edge() exited with data structure" + << is_valid(*m_dag_root) << std::endl; + write(std::cout,*m_dag_root,*traits) << std::endl; +#endif + +} + + +//----------------------------------------------------------------------------- +// Description: +// +template +unsigned long +Trapezoidal_decomposition_2 +::longest_query_path_length_rec(bool minus_inf, Dag_node& min_node, + bool plus_inf, Dag_node& max_node, + Dag_node& node) +{ + //if NULL + if (node.is_null()) + return 0; + + //if not valid range or empty return 0 + if (!minus_inf && !plus_inf) + { + Td_map_item min_node_item(min_node.get_data()); + if (traits->is_fictitious_vertex(min_node_item)) + { + const Curve_end min_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),min_node_item))); + + Td_map_item max_node_item(max_node.get_data()); + if (traits->is_fictitious_vertex(max_node_item)) + { + const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item))); + + //min-fict, max-fict + if (!is_end_point_left_low(min_ce, max_ce)) + return 0; + } + else + { + const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(),max_node_item)); + + //min-fict, max-pt + //if smaller than the point represented by min_node + if (!is_end_point_left_low(min_ce, max_p)) + return 0; + } + } + else + { + const Point& min_p(boost::apply_visitor(point_for_vertex_visitor(),min_node_item)); + + Td_map_item max_node_item(max_node.get_data()); + if (traits->is_fictitious_vertex(max_node_item)) + { + const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item))); + + //min-pt, max-fict + if (!is_end_point_left_low(min_p, max_ce)) + return 0; + } + else + { + const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(),max_node_item)); + + //min-pt, max-pt + //if smaller than the point represented by min_node + if (!is_end_point_left_low(min_p, max_p)) + return 0; + } + } + } + + + //if node represents a trapezoid + if (traits->is_td_trapezoid(node.get_data()) ) + return 1; + + //if node represents a curve + if (!traits->is_td_vertex(node.get_data()) ) + return (1 + std::max( + longest_query_path_length_rec(minus_inf, min_node, + plus_inf, max_node, + node.left_child()) , + longest_query_path_length_rec(minus_inf, min_node, + plus_inf, max_node, + node.right_child()) )); + + //if node represents a vertex + Td_map_item curr_item(node.get_data()); + bool is_fict_vtx = traits->is_fictitious_vertex(curr_item); + + //if node is smaller than min, use min in the next recursion min bound, otherwise use node + Dag_node new_min_node = node; + if (!minus_inf) + { + Td_map_item min_node_item(min_node.get_data()); + if (traits->is_fictitious_vertex(min_node_item)) + { + const Curve_end min_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),min_node_item))); + //if smaller than the point represented by min_node + //if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), min_ce)) || + // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), min_ce) )) + if (is_end_point_right_top(min_ce, node)) + { + new_min_node = min_node; + } + } + else + { + const Point& min_p(boost::apply_visitor(point_for_vertex_visitor(),min_node_item)); + //if smaller than the point represented by min_node + //if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), min_p)) || + // (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), min_p) )) + if (is_end_point_right_top(min_p, node)) + { + new_min_node = min_node; + } + } + } + + //if node is larger than max, use max in the next recursion max bound, otherwise use node + Dag_node new_max_node = node; + if (!plus_inf) + { + Td_map_item max_node_item(max_node.get_data()); + if (traits->is_fictitious_vertex(max_node_item)) + { + const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item))); + //if larger than the point represented by max_node + //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), max_ce)) || + // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), max_ce) )) + if (is_end_point_left_low(max_ce, node)) + { + new_max_node = max_node; + } + } + else + { + const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(),max_node_item)); + //if smaller than the point represented by min_node + //if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), max_p)) || + // (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), max_p) )) + if (is_end_point_left_low(max_p, node)) + { + new_max_node = max_node; + } + } + } + //o/w continue with updated parameters + return (1 + std::max( + longest_query_path_length_rec(minus_inf, min_node, + false, new_max_node, + node.left_child()) , + longest_query_path_length_rec(false, new_min_node, + plus_inf, max_node, + node.right_child()) )); + +} + + + +} //namespace CGAL + +#endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h index 310fd73f1e7..efc1b868cf4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_iostream.h @@ -47,7 +47,7 @@ template < class Traits> std::ostream& operator<<( std::ostream &out,const Trapezoidal_decomposition_2& td) { - return write(out,td.data_structure(),td.get_traits()); + return write(out,td.dag_root(),td.get_traits()); } template < class Traits> @@ -59,14 +59,16 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid& t, typedef X_trapezoid* pointer; bool pad=false; + //MICHAL: this may fail for inactive trapezoids + out << "("; - if (!t.is_left_unbounded()) out << t.left(); else out << "-oo"; + if (!t.is_on_left_boundary()) out << t.left(); else out << "-oo"; //MICHAL: this may fail for removed point out << ","; - if (!t.is_right_unbounded()) out << t.right(); else out << "+oo"; + if (!t.is_on_right_boundary()) out << t.right(); else out << "+oo"; out << "," << std::flush; - if (!t.is_bottom_unbounded()) out << t.bottom(); else out << "-oo"; + if (!t.is_on_bottom_boundary()) out << t.bottom(); else out << "-oo"; out << ","; - if (!t.is_top_unbounded()) out << t.top(); else out << "+oo"; + if (!t.is_on_top_boundary()) out << t.top(); else out << "+oo"; out << ",neighbours(" << std::flush; // debug neighbours equivalence relation @@ -76,11 +78,11 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid& t, X_trapezoid* value[] = { 0, - (X_trapezoid*)CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE, - t.left_bottom_neighbour(), - t.left_top_neighbour(), - t.right_bottom_neighbour(), - t.right_top_neighbour() + (X_trapezoid*)CGAL_TD_DELETE_SIGNATURE, + t.lb(), + t.lt(), + t.rb(), + t.rt() }; typedef char debug_string[256]; debug_string name[]= @@ -114,32 +116,32 @@ std::ostream& write(std::ostream &out,const Td_X_trapezoid& t, else pad=true; out << name[j]; // identify neighbours - if (traits.is_degenerate_point(t) && value[j]) + if (traits.is_td_vertex(t) && value[j]) out << "=" << value[j]->top(); } out << ")" << std::flush; if (t.is_active()) { - if (!traits.is_degenerate(t)) + if (traits.is_td_trapezoid(t)) { if (t.is_unbounded()) { out << ",U="; - if (t.is_left_unbounded()) out << ")"; - if (t.is_bottom_unbounded()) { - if (t.is_top_unbounded()) + if (t.is_on_left_boundary()) out << ")"; + if (t.is_on_bottom_boundary()) { + if (t.is_on_top_boundary()) out << "/\\/"; else out << "/\\"; } - else if (t.is_top_unbounded()) out << "\\/"; - if (t.is_right_unbounded()) out << "("; + else if (t.is_on_top_boundary()) out << "\\/"; + if (t.is_on_right_boundary()) out << "("; } else out << ",T"; } - else if (traits.is_degenerate_curve(t)) + else if (traits.is_td_edge(t)) out << ",C"; else // if (t.is_degenerate_point()) out << ",P"; @@ -170,14 +172,16 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid& t) typedef X_trapezoid* pointer; Traits traits; + //MICHAL: this may fail for inactive trapezoids + out << "("; - if (!t.is_left_unbounded()) out << t.left(); else out << "-oo"; + if (!t.is_on_left_boundary()) out << t.left(); else out << "-oo"; out << ","; - if (!t.is_right_unbounded()) out << t.right(); else out << "+oo"; + if (!t.is_on_right_boundary()) out << t.right(); else out << "+oo"; out << "," << std::flush; - if (!t.is_bottom_unbounded()) out << t.bottom(); else out << "-oo"; + if (!t.is_on_bottom_boundary()) out << t.bottom(); else out << "-oo"; out << ","; - if (!t.is_top_unbounded()) out << t.top(); else out << "+oo"; + if (!t.is_on_top_boundary()) out << t.top(); else out << "+oo"; out << ",neighbours(" << std::flush; // debug neighbours equivalence relation @@ -187,11 +191,11 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid& t) X_trapezoid* value[] = { 0, - (X_trapezoid*)CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE, - t.left_bottom_neighbour(), - t.left_top_neighbour(), - t.right_bottom_neighbour(), - t.right_top_neighbour() + (X_trapezoid*)CGAL_TD_DELETE_SIGNATURE, + t.lb(), + t.lt(), + t.rb(), + t.rt() }; typedef char debug_string[256]; debug_string name[]= @@ -223,7 +227,7 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid& t) { out << name[j]; // identify neighbours - if (traits.is_degenerate_point(t) && value[j]) + if (traits.is_td_vertex(t) && value[j]) out << "=" << value[j]->top(); out << " "; } @@ -231,24 +235,24 @@ std::ostream& operator<<(std::ostream &out,const Td_X_trapezoid& t) if (t.is_active()) { - if (!traits.is_degenerate(t)) + if (traits.is_td_trapezoid(t)) { if (t.is_unbounded()) { out << ",U"; - if (t.is_left_unbounded()) + if (t.is_on_left_boundary()) out << (char) 174; - if (t.is_bottom_unbounded()) + if (t.is_on_bottom_boundary()) out << (char) 25; - if (t.is_top_unbounded()) + if (t.is_on_top_boundary()) out << (char) 24; - if (t.is_right_unbounded()) + if (t.is_on_right_boundary()) out << (char) 175; } else out << ",T"; } - else if (traits.is_degenerate_curve(t)) + else if (traits.is_td_edge(t)) out << ",C"; else // if (t.is_degenerate_point()) out << ",P"; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h index 2f04836db32..f2e47dbbb4b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h @@ -21,31 +21,37 @@ #ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_MISC_H #define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_MISC_H -#ifndef CGAL_TD_TENTUPLE_H #include -#include -#endif #ifndef CGAL_TD_DAG_H -#include +#include #endif -#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_DELETE_SIGNATURE 0xffffffff -#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED 0x1 -#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED 0x2 -#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED 0x4 -#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED 0x8 -#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOTALLY_UNBOUNDED \ - (CGAL_TRAPEZOIDAL_DECOMPOSITION_2_LEFT_UNBOUNDED| \ - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_RIGHT_UNBOUNDED| \ - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOTTOM_UNBOUNDED| \ - CGAL_TRAPEZOIDAL_DECOMPOSITION_2_TOP_UNBOUNDED) -#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_BOUNDED 0 -#define CGAL_TD_DEFAULT_DEPTH_THRESHOLD 2 -#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 2 +//#define CGAL_TD_DELETE_SIGNATURE 0xffffffff +// +////type +//#define CGAL_TD_VERTEX 0 +//#define CGAL_TD_EDGE 0x1 +//#define CGAL_TD_TRAPEZOID 0x2 +//#define CGAL_TD_TYPE_MASK 0x3 +// +//#define CGAL_TD_ON_LEFT_BOUNDARY 0x4 +//#define CGAL_TD_ON_RIGHT_BOUNDARY 0x8 +//#define CGAL_TD_ON_BOTTOM_BOUNDARY 0x10 +//#define CGAL_TD_ON_TOP_BOUNDARY 0x20 +//#define CGAL_TD_ON_ALL_BOUNDARIES +// (CGAL_TD_ON_LEFT_BOUNDARY | CGAL_TD_ON_RIGHT_BOUNDARY | +// CGAL_TD_ON_BOTTOM_BOUNDARY| CGAL_TD_ON_TOP_BOUNDARY) +//#define CGAL_TD_INTERIOR 0 +// +//#define CGAL_TD_CV_MIN_END 0 +//#define CGAL_TD_CV_MAX_END 0x1 + +#define CGAL_TD_DEFAULT_DEPTH_THRESHOLD 60 +#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 12 #ifndef _MSC_VER -#if !defined __GNUC__ || __GNUC__>2 || __GNUC__==2 && __GNUC_MINOR__>=95 +#if !defined __GNUC__ || __GNUC__> 3 || ((__GNUC__== 3) && (__GNUC_MINOR__> 4)) #define CGAL_PM_FRIEND_CLASS #endif #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h index b2fd36247d5..1585c808c88 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h @@ -192,16 +192,19 @@ public: if(_rational_function.sign_at(_x_coordinate)==CGAL::ZERO) return std::make_pair(Bound(0),Bound(0)); - typename BFI_traits::Set_precision set_precision; typename BFI_polynomial_traits::Evaluate evaluate; + + typedef typename BFI_traits::Bound BF; + long precision = 16; - Rational error_bound = CGAL::ipower(Rational(1,2),r); - while (true) - { + set_precision(precision); + BF eps = CGAL::ipower(BF(1)/2,r); + + while (true){ set_precision(precision); BFI x_bfi(convert_to_bfi(_x_coordinate)); - + BFI_polynomial numer_bfi(convert_to_bfi_extended(_rational_function.numer())); BFI_polynomial @@ -213,11 +216,14 @@ public: if (CGAL::zero_in(y_denom_bfi) == false) { BFI y_bfi(y_numer_bfi/y_denom_bfi); - if (CGAL::compare(CGAL::width(y_bfi), - Rational(CGAL::lower(CGAL::abs(y_bfi))) * error_bound ) + + if (CGAL::compare( + CGAL::width(y_bfi), + CGAL::lower(CGAL::abs(y_bfi)) * eps) == SMALLER) - return std::make_pair(Bound(CGAL::lower(y_bfi)), - Bound(CGAL::upper(y_bfi))); + return std::make_pair( + Bound(CGAL::lower(y_bfi)), + Bound(CGAL::upper(y_bfi))); } else precision*=2; } @@ -258,7 +264,10 @@ private: { typename BFI_traits::Set_precision set_precision; typename BFI_polynomial_traits::Evaluate evaluate; - Rational error_bound = CGAL::ipower(Rational(1,2),a); + + typedef typename BFI_traits::Bound BF; + + BF eps = CGAL::ipower(BF(1)/2,a); while (true) { set_precision(precision); @@ -273,9 +282,11 @@ private: if (CGAL::zero_in(y_denom_bfi) == false) { BFI y_bfi(y_numer_bfi/y_denom_bfi); - if (Bound(CGAL::width(y_bfi)) < error_bound ) - return std::make_pair(Bound(CGAL::lower(y_bfi)), - Bound(CGAL::upper(y_bfi)) ); + if (CGAL::width(y_bfi) < eps ) + return std::make_pair( + Bound(CGAL::lower(y_bfi)), + Bound(CGAL::upper(y_bfi))); + } else precision*=2; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h index 612445215ba..7877cd716c6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h @@ -607,9 +607,7 @@ public: /*! */ template -#endif class T_Dcel = Arr_polyhedral_sgm_arr_dcel> class Arr_polyhedral_sgm : public Arr_spherical_gaussian_map_3 @@ -621,11 +619,7 @@ public: typedef typename Geometry_traits_2::Point_3 Point_3; typedef typename Geometry_traits_2::Vector_3 Vector_3; -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM typedef T_Dcel Dcel; -#else - typedef typename T_Dcel::template Dcel Dcel; -#endif // For some reason MSVC barfs on the friend statement below. Therefore, // we declare the Base to be public to overcome the problem. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h index 21331c8e902..3e8f798a1e4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_spherical_gaussian_map_3.h @@ -331,18 +331,12 @@ protected: * embedded on the sphere. */ template -#endif class T_Dcel = Arr_default_dcel> class Arr_spherical_gaussian_map_3 : public Arrangement_on_surface_2 -#else - typename T_Dcel::template Dcel -#endif > > { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h index a29ed99b21f..e488cb6d3b8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h @@ -33,59 +33,6 @@ namespace CGAL { -/*! - * \class - * Mapping of an x-monotone curve to the halfedge associated with it. - */ -template -class PL_X_curve_plus: public Arrangement_::X_monotone_curve_2 -{ -public: - - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; - typedef typename Arrangement_2::Traits_adaptor_2 Traits_adaptor_2; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; - -protected: - //Data members - Halfedge_handle parent; // The halfedge associated with the curve. - -public: - - /*! Default constructor. */ - PL_X_curve_plus() : - X_monotone_curve_2(), - parent() - {} - - /*! Constructor from a curve and a halfedge. */ - PL_X_curve_plus (const X_monotone_curve_2& cv, - const Halfedge_handle& p) : - X_monotone_curve_2(cv), - parent(p) - {} - - /*! Constrtuctor from a halfedge only. */ - PL_X_curve_plus(const Halfedge_handle& p) : - X_monotone_curve_2(p->curve()), - parent(p) - {} - - /*! Constrtuctor from a curve only. */ - PL_X_curve_plus(const X_monotone_curve_2 &cv) : - X_monotone_curve_2(cv), - parent() - {} - - /*! Get the parent halfedge. */ - Halfedge_handle get_parent() const - { - return (parent); - } -}; - /*! \class * A class that answers point-location and queries @@ -96,90 +43,167 @@ template class Arr_trapezoid_ric_point_location : public Arr_observer { public: + //type of arrangement on surface + typedef Arrangement_ Arrangement_on_surface_2; - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; - typedef typename Arrangement_2::Traits_adaptor_2 Traits_adaptor_2; - - typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arrangement_2::Face_const_handle Face_const_handle; - typedef typename Arrangement_2::Vertex_handle Vertex_handle; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - typedef typename Arrangement_2::Face_handle Face_handle; - typedef typename Arrangement_2::Halfedge_iterator Halfedge_iterator; - - typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; - typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; - typedef typename Arrangement_2::Hole_const_iterator Hole_const_iterator; - typedef typename Arrangement_2::Halfedge_const_iterator - Halfedge_const_iterator; - typedef typename Arrangement_2::Halfedge_around_vertex_const_circulator - Halfedge_around_vertex_const_circulator; - typedef typename Arrangement_2::Ccb_halfedge_const_circulator - Ccb_halfedge_const_circulator; - typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; - typedef typename Arrangement_2::Isolated_vertex_const_iterator + //type of geometry traits + typedef typename Arrangement_on_surface_2::Geometry_traits_2 + Geometry_traits_2; + //type of traits adaptor + typedef typename Arrangement_on_surface_2::Traits_adaptor_2 + Traits_adaptor_2; + //type of vertex handle + typedef typename Arrangement_on_surface_2::Vertex_handle + Vertex_handle; + //type of vertex const handle + typedef typename Arrangement_on_surface_2::Vertex_const_handle + Vertex_const_handle; + //type of halfedge handle + typedef typename Arrangement_on_surface_2::Halfedge_handle + Halfedge_handle; + //type of halfedge const handle + typedef typename Arrangement_on_surface_2::Halfedge_const_handle + Halfedge_const_handle; + //type of face const handle + typedef typename Arrangement_on_surface_2::Face_const_handle + Face_const_handle; + //type of edge const iterator + typedef typename Arrangement_on_surface_2::Edge_const_iterator + Edge_const_iterator; + //type of isolated vertex const iterator + typedef typename Arrangement_on_surface_2::Isolated_vertex_const_iterator Isolated_vertex_const_iterator; - + //type of point typedef typename Geometry_traits_2::Point_2 Point_2; - typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; - typedef std::list Edge_list; - typedef typename Edge_list::iterator Std_edge_iterator; - - typedef PL_X_curve_plus X_curve_plus; - - typedef CGAL::Td_traits Td_traits; - typedef Trapezoidal_decomposition_2 Trapezoidal_decomposition; - typedef std::vector Halfedge_handle_container; - typedef typename Halfedge_handle_container::iterator - Halfedge_handle_iterator; + //type of x-monotone curve + typedef typename Geometry_traits_2::X_monotone_curve_2 + X_monotone_curve_2; + + //type of trapezoidal decomposition traits class + typedef CGAL::Td_traits + Td_traits; + //type of trapezoidal decomposition class + typedef Trapezoidal_decomposition_2 + Trapezoidal_decomposition; + + //!types of Td_map_item-s + typedef typename Trapezoidal_decomposition::Td_map_item + Td_map_item; + typedef typename Trapezoidal_decomposition::Td_active_vertex + Td_active_vertex; + typedef typename Trapezoidal_decomposition::Td_active_fictitious_vertex + Td_active_fictitious_vertex; + typedef typename Trapezoidal_decomposition::Td_active_edge + Td_active_edge; + typedef typename Trapezoidal_decomposition::Td_active_trapezoid + Td_active_trapezoid; + //!type of side tags + typedef typename Traits_adaptor_2::Left_side_category + Left_side_category; + typedef typename Traits_adaptor_2::Bottom_side_category + Bottom_side_category; + typedef typename Traits_adaptor_2::Top_side_category + Top_side_category; + typedef typename Traits_adaptor_2::Right_side_category + Right_side_category; -protected: +protected: + //type of trapezoidal decomposition class typedef Trapezoidal_decomposition TD; + typedef typename Arr_are_all_sides_oblivious_tag< + Left_side_category, Bottom_side_category, + Top_side_category, Right_side_category >::result + Are_all_sides_oblivious_tag; + + + // Data members: - const Traits_adaptor_2 *m_traits; // Its associated traits object. - - TD td; // instance of trapezoidal decomposition - const Td_traits* td_traits;// instance of the TD traits - //for the notification functions - X_monotone_curve_2 m_curve_before_split; - X_monotone_curve_2 m_curve_before_merge1; - X_monotone_curve_2 m_curve_before_merge2; - + const Traits_adaptor_2 *m_traits; // Its associated traits object. + TD td; // instance of trapezoidal decomposition + bool m_with_guarantees; + //for the notification functions + X_monotone_curve_2 m_cv_before_split; + Halfedge_handle m_he_after_merge; + //X_monotone_curve_2 m_cv_before_merge1; + //X_monotone_curve_2 m_cv_before_merge2; public: /*! Default constructor. */ - Arr_trapezoid_ric_point_location (bool rebuild = true) : - m_traits (NULL), - td_traits(NULL) + Arr_trapezoid_ric_point_location (bool with_guarantees = true, + double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, + double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) + : m_traits (NULL), m_with_guarantees(with_guarantees) { - td.set_needs_update(rebuild); + td.set_with_guarantees(with_guarantees); + td.depth_threshold(depth_thrs); + td.size_threshold(size_thrs); } /*! Constructor given an arrangement. */ - Arr_trapezoid_ric_point_location (const Arrangement_2& arr) : - Arr_observer (const_cast(arr)) + Arr_trapezoid_ric_point_location (const Arrangement_on_surface_2& arr, + bool with_guarantees = true, + double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, + double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) : + Arr_observer + (const_cast(arr)), + m_with_guarantees(with_guarantees) { - m_traits = static_cast (arr.traits()); - td_traits = new Td_traits(*m_traits); - td.init_traits(td_traits); - - build_trapezoid_ric(); + m_traits = static_cast (arr.geometry_traits()); + td.set_with_guarantees(with_guarantees); + td.init_arrangement_and_traits(&arr); + td.depth_threshold(depth_thrs); + td.size_threshold(size_thrs); + _construct_td(); } /*! Destructor. */ - ~Arr_trapezoid_ric_point_location () + ~Arr_trapezoid_ric_point_location () { } + + /*! defines whether the underlying search structure guarantees logarithmic + * query time and linear size */ + void with_guarantees (bool with_guarantees) { - if (td_traits) - delete (td_traits); + //if with_guarantees was changed from false to true - reconstruct + // the search structure with guarantees + td.set_with_guarantees(with_guarantees); + if (with_guarantees && !m_with_guarantees) + { + td.clear(); + _construct_td(); + } + m_with_guarantees = with_guarantees; } - + + /*! returns the depth of the underlying search structure + * (the longest path in the DAG) + */ + unsigned long depth() //longest_dag_path() + { + return td.largest_leaf_depth() + 1; + } + + /*! returns the longest query path in the underlying search structure */ + unsigned long longest_query_path_length() + { + return td.longest_query_path_length(); + } + +#ifdef CGAL_TD_DEBUG + //void locate_and_print (std::ostream& out, const Point_2& p) const + //{ + // td.locate_and_print(out, p); + //} + + void print_dag(std::ostream& out) const + { + td.print_dag(out); + } +#endif + /*! * Locate the arrangement feature containing the given point. * \param p The query point. @@ -219,50 +243,48 @@ public: // base observer. //@{ - virtual void before_assign (const Arrangement_2& arr) + virtual void before_assign (const Arrangement_on_surface_2& arr) { - clear_trapezoid_ric(); - m_traits = static_cast (arr.traits()); + td.clear(); + m_traits = static_cast (arr.geometry_traits()); + td.init_arrangement_and_traits(&arr, false); } virtual void after_assign () { - build_trapezoid_ric(); + _construct_td(); } virtual void before_clear () { - clear_trapezoid_ric (); + td.clear(); } virtual void after_clear () { - build_trapezoid_ric(); + _construct_td(); } - virtual void before_attach (const Arrangement_2& arr) + virtual void before_attach (const Arrangement_on_surface_2& arr) { - clear_trapezoid_ric(); - m_traits = static_cast (arr.traits()); - td_traits = new Td_traits(*m_traits); - td.init_traits(td_traits); + td.clear(); + m_traits = static_cast (arr.geometry_traits()); + td.init_arrangement_and_traits(&arr); } virtual void after_attach () { - build_trapezoid_ric(); + _construct_td(); } virtual void before_detach () { - clear_trapezoid_ric(); + td.clear(); } virtual void after_create_edge (Halfedge_handle e) { - // Postcondition: h->curve() with a reference back to h - // is inserted into TD. - td.insert(X_curve_plus(e)); + td.insert(e); } //TODO IDIT OREN: what can be done in order to avoid the need @@ -271,96 +293,102 @@ public: //curve it lies on, which is the curve that was split, and then remove //this curve. virtual void before_split_edge (Halfedge_handle e, - Vertex_handle /* v */, - const X_monotone_curve_2& /* c1 */, - const X_monotone_curve_2& /* c2 */) + Vertex_handle /* v */, + const X_monotone_curve_2& cv1 , + const X_monotone_curve_2& cv2 ) { - //save this curve for the "after" function. - m_curve_before_split = e->curve(); + + ////MICHAL: commented due to inefficient depth update, remove and insert instead + ////save the curve for the "after" function. + //m_cv_before_split = e->curve(); + //td.before_split_edge(m_cv_before_split, cv1, cv2); + + td.remove(e); } virtual void after_split_edge (Halfedge_handle e1, Halfedge_handle e2) { - td.split_edge(X_curve_plus(m_curve_before_split), - X_curve_plus(e1), - X_curve_plus(e2)); + //MICHAL: commented due to inefficient depth update, remove and insert instead + //td.split_edge(m_cv_before_split,e1,e2); + + td.insert(e1); + td.insert(e2); } - //TODO IDIT OREN: create a merged X_curve_plus withput a halfedge, - // and in the "after" function update the halfedge. - // think ... virtual void before_merge_edge (Halfedge_handle e1, Halfedge_handle e2, - const X_monotone_curve_2& /* c */) + const X_monotone_curve_2& cv) { - //save the curves for the "after" function. - m_curve_before_merge1 = e1->curve(); - m_curve_before_merge2 = e2->curve(); + //save the halfedge handle for the "after" function. + m_he_after_merge = e1; + td.merge_edge (e1, e2, cv); } virtual void after_merge_edge (Halfedge_handle e) { - td.merge_edge(X_curve_plus(m_curve_before_merge1), - X_curve_plus(m_curve_before_merge2), - X_curve_plus(e)); + td.after_merge_edge(e, m_he_after_merge); } virtual void before_remove_edge (Halfedge_handle e) { //called before combinatoric deletion - td.remove(X_curve_plus(e)); + td.remove(e); } //@} public: -#ifdef CGAL_TD_DEBUG - void debug() - { - td.debug(); - } -#endif +//#ifdef CGAL_TD_DEBUG +// void debug() +// { +// td.debug(); +// } +//#endif protected: - /*! Clear the trapezoidal decomposition. */ - inline void clear_trapezoid_ric () - { - td.clear(); - } - /*! Construct the trapezoidal decomposition. */ - void build_trapezoid_ric () + void _construct_td () { td.clear(); - - Halfedge_handle_container c; - Edge_const_iterator eit; - Halfedge_const_handle hh; - Arrangement_2 *arr = this->arrangement(); - + + std::vector he_container; + Edge_const_iterator eit; + Halfedge_const_handle he_cst; + Arrangement_on_surface_2 *arr = this->arrangement(); + //collect the arrangement halfedges for (eit = arr->edges_begin(); eit != arr->edges_end(); ++eit) { - hh = eit; - c.push_back(hh); + he_cst = eit; + he_container.push_back(he_cst); } - - // Random shuffle of the halfedges. - std::random_shuffle (c.begin (), c.end ()); - - Halfedge_handle_iterator cit; - Halfedge_handle he; - - for (cit = c.begin(); cit < c.end(); cit++) - { - hh = *cit; - he = arr->non_const_handle(hh); - td.insert(X_curve_plus(he)); - } - + //container insertion + td.insert(he_container.begin(), he_container.end()); } + /*! gets the unbounded face that contains the point when the trapezoid is unbounded + * \param tr The unbounded trapezoid whose face we should get + * \param p The query point. + * \param Arr_all_sides_oblivious_tag + * \return A Face_const_handle representing the arrangement unbounded face in which + * the point p lies + */ + Face_const_handle _get_unbounded_face (const Td_map_item& tr, + const Point_2& p, + Arr_all_sides_oblivious_tag) const; + + /*! gets the unbounded face that contains the point when the trapezoid is unbounded + * \param tr The unbounded trapezoid whose face we should get + * \param p The query point. + * \param Arr_not_all_sides_oblivious_tag + * \return A Face_const_handle representing the arrangement unbounded face in which + * the point p lies + */ + Face_const_handle _get_unbounded_face (const Td_map_item& tr, + const Point_2& p, + Arr_not_all_sides_oblivious_tag) const; + /*! * Locate the arrangement feature which a vertical ray emanating from the * given point hits, considering isolated vertices. @@ -379,7 +407,8 @@ protected: */ Object _check_isolated_for_vertical_ray_shoot (Halfedge_const_handle halfedge_found, - const Point_2& p, bool shoot_up) const; + const Point_2& p, bool shoot_up, + const Td_map_item& tr) const; }; } //namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h index ca6d9194b21..d01efa3c953 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h @@ -1135,8 +1135,8 @@ public: } Comparison_result comp_x_on_bnd(const Point_2&, - const X_monotone_curve_2& xcv, - Arr_curve_end ce, + const X_monotone_curve_2& /* xcv */, + Arr_curve_end /* ce */, Arr_use_dummy_tag) const { CGAL_error(); @@ -1153,10 +1153,10 @@ public: return m_base->compare_x_on_boundary_2_object()(xcv1, ce1, xcv2, ce2); } - Comparison_result comp_x_on_bnd(const X_monotone_curve_2& - xcv1, Arr_curve_end ce1, - const X_monotone_curve_2& xcv2, - Arr_curve_end ce2, + Comparison_result comp_x_on_bnd(const X_monotone_curve_2& /* xcv1 */, + Arr_curve_end /* ce1 */, + const X_monotone_curve_2& /* xcv2 */, + Arr_curve_end /* ce2 */, Arr_use_dummy_tag) const { CGAL_error(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index 773fa664a48..b1da596b88c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -731,6 +731,7 @@ public: return (DFace_const_iter (Base::isolated_vertex()->face())); } + private: // Blocking access to inherited functions from the Dcel::Vertex. diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index 5c23fe56d47..8669bbc4f99 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -3234,7 +3234,7 @@ public: return is_equal(arc2); } -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__clang__) // befriending the kernel point friend typename Curved_kernel_via_analysis_2::Point_2; @@ -3246,19 +3246,19 @@ public: friend typename Curved_kernel_via_analysis_2::Z; \ friend typename Curved_kernel_via_analysis_2_Functors:: \ Z -#else +#else // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER) // befriending the kernel point - friend class Curved_kernel_via_analysis_2::Point_2; + //friend class Curved_kernel_via_analysis_2::Point_2; // befriending the kernel arc - friend class Curved_kernel_via_analysis_2::Arc_2; + //friend class Curved_kernel_via_analysis_2::Arc_2; // befriending the functors #define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \ - friend class Curved_kernel_via_analysis_2::Z; \ friend class Curved_kernel_via_analysis_2_Functors:: \ Z -#endif +#endif // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER) + //Curved_kernel_via_analysis_2_functors< // Curved_kernel_via_analysis_2> >; @@ -3348,8 +3348,8 @@ std::istream& operator>> ( CGAL_precondition(CGAL::is_ascii(is)); - typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; - typedef Rep_ Rep; + //typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; + //typedef Rep_ Rep; arc.read(is); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index 7bd8ef56691..d246380e242 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -1600,9 +1600,8 @@ public: CGAL_precondition(cv.compare_y_at_x(p) == CGAL::EQUAL); // check that p is not an end-point of the arc - CGAL_precondition_code( - cv._same_arc_compare_xy(cv._minpoint(), p) != CGAL::EQUAL && - cv._same_arc_compare_xy(cv._maxpoint(), p) != CGAL::EQUAL); + CGAL_precondition(cv._same_arc_compare_xy(cv._minpoint(), p) != CGAL::EQUAL); + CGAL_precondition(cv._same_arc_compare_xy(cv._maxpoint(), p) != CGAL::EQUAL); CERR("\nsplit\n"); c1 = cv._replace_endpoints( diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h index 46765905157..3a9dc9ea548 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_arc_2.h @@ -279,7 +279,7 @@ public: template std::ostream& operator << (std::ostream& os, - const Generic_arc_2& arc) { + const Generic_arc_2& arc) { os << arc.id() << "@"; if(arc.is_degenerate()) @@ -291,7 +291,7 @@ std::ostream& operator << (std::ostream& os, template std::istream& operator >> (std::istream& is, - Generic_arc_2& arc) { + Generic_arc_2& /* arc */) { std::cerr << "bogus >> call for generic_arc\n"; return is; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h index 02a4c99ccd0..fc899e5da6b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Generic_point_2.h @@ -200,7 +200,7 @@ public: template std::ostream& operator << (std::ostream& os, - const Generic_point_2& pt) { + const Generic_point_2& pt) { os << pt.id() << "@"; if(pt.is_finite()) @@ -213,7 +213,7 @@ std::ostream& operator << (std::ostream& os, template std::istream& operator >> (std::istream& is, - Generic_point_2& pt) { + Generic_point_2& /* pt */) { std::cerr << "bogus >> call for generic_point\n"; return is; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 66e323e4c76..52e3ca560b6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -784,15 +784,14 @@ public: // befriending the functors -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__clang__) #define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \ friend typename Curved_kernel_via_analysis_2::Z; \ friend typename Curved_kernel_via_analysis_2_Functors::Z< Curved_kernel_via_analysis_2 > -#else +#else // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER) #define CGAL_BEFRIEND_CKvA_2_FUNCTOR(Z) \ - friend class Curved_kernel_via_analysis_2::Z; \ friend class Curved_kernel_via_analysis_2_Functors::Z< Curved_kernel_via_analysis_2 > -#endif +#endif // defined(_MSC_VER) || defined(__clang__) || defined(__INTEL_COMPILER) CGAL_BEFRIEND_CKvA_2_FUNCTOR(Construct_point_2); CGAL_BEFRIEND_CKvA_2_FUNCTOR(Compare_x_2); @@ -824,8 +823,8 @@ std::istream& operator>> ( CGAL_precondition(CGAL::is_ascii(is)); - typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; - typedef Rep_ Rep; + //typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; + //typedef Rep_ Rep; pt.read(is); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h index 514e5435b40..186a43d6171 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h @@ -593,8 +593,9 @@ public: * lexicographic order of endpoints is ensured automatically, hence no * special handling is required */ - result_type operator()(const Arc_2& cv, const Point_2& p, - const Point_2& q) const { + result_type operator()(const Arc_2& cv, + const Point_2& /* p */, + const Point_2& /* q */) const { SCA_CERR("\n\nWARNING!! New_endpoints_opposite_2: cv: " << cv << "\n p: " << p << "\n q: " << q << std::endl); CGAL_error_msg("New_endpoints_opposite_2 deprecated and must not be \ diff --git a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h index f34e7549469..76b9601f05d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Basic_sweep_line_2_impl.h @@ -218,9 +218,12 @@ void Basic_sweep_line_2::_init_structures() { CGAL_assertion(m_queue->empty()); CGAL_assertion((m_statusLine.size() == 0)); - - // Allocate all of the Subcurve objects as one block. - m_subCurves = m_subCurveAlloc.allocate(m_num_of_subCurves); + + // Allocate all of the Subcurve objects as one block. Don't allocate + // anything when there are no subcurves. + if (m_num_of_subCurves > 0) { + m_subCurves = m_subCurveAlloc.allocate(m_num_of_subCurves); + } return; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h new file mode 100644 index 00000000000..4d4f31a958d --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_base_test.h @@ -0,0 +1,1309 @@ +#ifndef CGAL_IO_BASE_TEST_H +#define CGAL_IO_BASE_TEST_H + +template +class IO_base_test { +public: + typedef T_Traits Traits; + typedef typename Traits::Point_2 Point_2; + typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Traits::Curve_2 Curve_2; + + template + bool read_point(stream& is, Point_2&); + + template + bool read_xcurve(stream& is, X_monotone_curve_2&); + + template + bool read_curve(stream& is, Curve_2&); + +protected: + /*! An instance of the traits */ + Traits m_traits; +}; + +// Generic implementation +template +template +bool IO_base_test:: +read_point(stream& is, typename T_Traits::Point_2& p) +{ + Basic_number_type x, y; + is >> x >> y; + p = typename T_Traits::Point_2(x, y); + return true; +} + +template +template +bool IO_base_test:: +read_xcurve(stream& is, typename T_Traits::X_monotone_curve_2& xcv) +{ + Basic_number_type x1, y1, x2, y2; + is >> x1 >> y1 >> x2 >> y2; + Point_2 p1(x1, y1); + Point_2 p2(x2, y2); + CGAL_assertion(p1 != p2); + xcv = typename T_Traits::X_monotone_curve_2(p1, p2); + return true; +} + +template +template +bool +IO_base_test::read_curve(stream& is, typename T_Traits::Curve_2& cv) +{ + Basic_number_type x1, y1, x2, y2; + is >> x1 >> y1 >> x2 >> y2; + Point_2 p1(x1, y1); + Point_2 p2(x2, y2); + CGAL_assertion(p1 != p2); + cv = typename T_Traits::Curve_2(p1, p2); + return true; +} + +// Specialized implementations + +// Linear +#if TEST_TRAITS == LINEAR_TRAITS + +template <> +template +bool IO_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) +{ + is >> xcv; + return true; +} + +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + is >> cv; + return true; +} + +// Polyline +#elif TEST_TRAITS == POLYLINE_TRAITS || \ + TEST_TRAITS == NON_CACHING_POLYLINE_TRAITS + +template <> +template +bool +IO_base_test:: +read_xcurve(stream& is, Traits::X_monotone_curve_2& xcv) +{ + unsigned int num_points; + is >> num_points; + std::vector points; + points.clear(); + for (unsigned int j = 0; j < num_points; j++) { + Basic_number_type x, y; + is >> x >> y; + Point_2 p(x, y); + points.push_back(p); + } + xcv = + CGAL:: + Arr_polyline_traits_2::X_monotone_curve_2(points.begin(), + points.end()); + return true; +} + +template <> +template +bool IO_base_test::read_curve(stream& is, Traits::Curve_2& cv) +{ + unsigned int num_points; + is >> num_points; + std::vector points; + points.clear(); + for (unsigned int j = 0; j < num_points; j++) { + Basic_number_type x, y; + is >> x >> y; + Point_2 p(x, y); + points.push_back(p); + } + cv = CGAL::Arr_polyline_traits_2::Curve_2(points.begin(), + points.end()); + return true; +} + +// Circle segment +#elif TEST_TRAITS == CIRCLE_SEGMENT_TRAITS + +template +bool read_ort_point(stream& is, Point_2& p) +{ + bool is_rat; + typename Point_2::CoordNT ort_x, ort_y; + Number_type alpha,beta,gamma; + is >> is_rat; + if (is_rat) { + is >> alpha; + ort_x=Point_2::CoordNT(alpha); + } + else { + is >> alpha >> beta >> gamma; + ort_x=Point_2::CoordNT(alpha,beta,gamma); + } + is >> is_rat; + if (is_rat) { + is >> alpha; + ort_y=Point_2::CoordNT(alpha); + } + else { + is >> alpha >> beta >> gamma; + ort_y=Point_2::CoordNT(alpha,beta,gamma); + } + p = Point_2(ort_x, ort_y); + return true; +} + +/*! Read an x-monotone circle segment curve */ +template <> +template +bool IO_base_test::read_xcurve(stream& is,X_monotone_curve_2& xcv) +{ + bool ans = true; + char type; + is >> type; + if (type == 'z' || type == 'Z') { + Line_2 l; + Point_2 ps,pt; + is >> l; + ans &= read_ort_point(is, ps); + ans &= read_ort_point(is, pt); + xcv=X_monotone_curve_2(l, ps, pt); + return ans; + } + else if (type == 'y' || type == 'Y') { + Rat_point_2 ps,pt; + is >> ps >> pt; + xcv=X_monotone_curve_2(ps,pt); + return true; + } + else if (type == 'x' || type == 'X') { + Circle_2 c; + Point_2 ps,pt; + is >> c; + ans &= read_ort_point(is, ps); + ans &= read_ort_point(is, pt); + xcv=X_monotone_curve_2(c, ps, pt, c.orientation()); + return ans; + } + // If we reached here, we have an unknown conic type: + std::cerr << "Illegal circle segment type specification: " << type + << std::endl; + return false; +} + +/*! Read a general circle segment curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + bool ans = true; + char type; + is >> type; + if (type == 'a' || type == 'A') { + Rat_point_2 ps,pt; + is >> ps >> pt; + Segment_2 s(ps,pt); + cv = Curve_2(s); + return true; + } + else if (type == 'b' || type == 'B') { + Rat_point_2 ps,pt; + is >> ps >> pt; + cv = Curve_2(ps,pt); + return true; + } + else if (type == 'c' || type == 'C') { + Line_2 l; + Point_2 ps, pt; + is >> l; + ans &= read_ort_point(is, ps); + ans &= read_ort_point(is, pt); + cv = Curve_2(l, ps, pt); + return ans; + } + else if (type == 'd' || type == 'D') { + Circle_2 c; + is >> c; + cv = Curve_2(c); + return true; + } + else if (type == 'e' || type == 'E') { + Rat_point_2 p; + Rat_nt r; + int orient; + is >> p >> r >> orient; + cv = Curve_2(p,r,static_cast(orient)); + return true; + } + else if (type == 'f' || type == 'F') { + Circle_2 c; + Point_2 ps,pt; + is >> c; + ans &= read_ort_point(is, ps); + ans &= read_ort_point(is, pt); + cv = Curve_2(c,ps,pt); + return ans; + } + else if (type == 'g' || type == 'G') { + Rat_point_2 p; + Rat_nt r; + int orient; + Point_2 ps,pt; + is >> p >> r >> orient; + ans &= read_ort_point(is, ps); + ans &= read_ort_point(is, pt); + cv = Curve_2(p,r,static_cast(orient), ps, pt); + return ans; + } + else if (type == 'h' || type == 'H') { + Rat_point_2 ps,pm,pt; + is >> ps >> pm >> pt; + cv = Curve_2(ps, pm, pt); + return true; + } + // If we reached here, we have an unknown conic type: + std::cerr << "Illegal circle segment type specification: " << type + << std::endl; + return false; +} + +// Conic +#elif TEST_TRAITS == CORE_CONIC_TRAITS + +// conic traits and rational traits use same number +// type CORE:Expr so this code can be shared + +/*! Read a point */ + +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) +{ + Rational rat_x,rat_y; + is >> rat_x >> rat_y; + Basic_number_type x(rat_x), y(rat_y); + p = Point_2(x, y); + return true; +} + +/*! */ +template +bool read_orientation(stream& is, CGAL::Orientation& orient) +{ + int i_orient; + is >> i_orient; + orient = (i_orient > 0) ? CGAL::COUNTERCLOCKWISE : + (i_orient < 0) ? CGAL::CLOCKWISE : CGAL::COLLINEAR; + return true; +} + +/*! */ +template +bool read_app_point(stream& is, Point_2& p) +{ + double x, y; + is >> x >> y; + p = Point_2(Algebraic(x), Algebraic(y)); + return true; +} + +/*! */ +template +bool read_orientation_and_end_points(stream& is, CGAL::Orientation& orient, + Point_2& source, Point_2& target) +{ + // Read the orientation. + if (!read_orientation(is, orient)) return false; + + // Read the end points of the arc and create it. + if (!read_app_point(is, source)) return false; + if (!read_app_point(is, target)) return false; + return true; +} + +/*! Read a circle or an ellipse */ +template +bool read_ellipse(stream& is, bool& is_circle, Rat_circle& circle, + Rational& r, Rational& s, + Rational& t, Rational& u, Rational& v, Rational& w) +{ + // Read the ellipse (using the format "a b x0 y0"): + // 2 2 + // ( x - x0 ) ( y - y0 ) + // -------- + -------- = 1 + // a b + // + Rational a, b, x0, y0; + is >> a >> b >> x0 >> y0; + + if (a == b) { + is_circle = true; + circle = Rat_circle(Rat_point(x0, y0), a); + } + else { + r = 1/a; + s = 1/b; + t = 0; + u = -2*x0*b; + v = -2*y0*a; + w = x0*x0*b + y0*y0*a - a*b; + } + return true; +} + +/*! */ +template +bool read_partial_ellipse(stream& is, Curve& cv) +{ + bool is_circle; // Is this a circle. + Rat_circle circle; + Rational r, s, t, u, v, w; + if (!read_ellipse(is, is_circle, circle, r, s, t, u, v, w)) return false; + CGAL::Orientation orient; + Point_2 source, target; + if (!read_orientation_and_end_points(is, orient, source, target)) //!!! + return false; + + // Create the conic (or circular) arc. + cv = (is_circle) ? Curve(circle, orient, source, target) : + Curve(r, s, t, u, v, w, orient, source, target); + return true; +} + +/*! */ +template +bool read_full_ellipse(stream& is, Curve& cv) +{ + bool is_circle; // Is this a circle. + Rat_circle circle; + Rational r, s, t, u, v, w; + if (!read_ellipse(is, is_circle, circle, r, s, t, u, v, w)) + return false; + + // Create a full ellipse (or circle). + cv = (is_circle) ? Curve(circle) : Curve(r, s, t, u, v, w); + return true; +} + +/*! Read a hyperbola */ +template +bool read_hyperbola(stream& is, Curve& cv) +{ + // Read the hyperbola (using the format "a b x0 y0"): + // 2 2 + // ( x - x0 ) ( y - y0 ) + // -------- - -------- = 1 + // a b + // + Rational a, b, x0, y0; + is >> a >> b >> x0 >> y0; + + Rational r = b; + Rational s= -a; + Rational t = 0; + Rational u = -2*x0*b; + Rational v = 2*y0*a; + Rational w = x0*x0*b - y0*y0*a - a*b; + + CGAL::Orientation orient; + Point_2 source, target; + if (!read_orientation_and_end_points(is, orient, source, target)) //!!! + return false; + + // Create the conic (or circular) arc. + cv = Curve(r, s, t, u, v, w, orient, source, target); + return true; +} + +/*! Read a hyperbola */ +template +bool read_parabola(stream& is, Curve& cv) +{ + // Read the parabola (using the format "c x0 y0"): + // + // 2 + // (x - x0) = 4c*(y - y0) + // + Rational c, x0, y0; + is >> c >> x0 >> y0; + + Rational r = 1; + Rational s = 0; + Rational t = 0; + Rational u = -2*x0; + Rational v = -4*c; + Rational w = x0*x0 + 4*c*y0; + + CGAL::Orientation orient; + Point_2 source, target; + if (!read_orientation_and_end_points(is, orient, source, target)) + return false; + + // Create the conic (or circular) arc. + cv = Curve(r, s, t, u, v, w, orient, source, target); + return true; +} + +/*! */ +template +bool read_segment(stream& is, Curve& cv) +{ + + // Read a segment, given by its endpoints (x1,y1) and (x2,y2); + Rational x1, y1, x2, y2; + is >> x1 >> y1 >> x2 >> y2; + + Rat_point source(x1, y1); + Rat_point target(x2, y2); + Rat_segment segment(source, target); + + // Create the segment. + cv = Curve(segment); + return true; +} + +/*! */ +template +bool read_general_arc(stream& is, Curve& cv) +{ + // Read a general conic, given by its coefficients . + Rational r, s, t, u, v, w; // The conic coefficients. + is >> r >> s >> t >> u >> v >> w; + // Read the orientation. + int i_orient = 0; + is >> i_orient; + CGAL::Orientation orient = (i_orient > 0) ? CGAL::COUNTERCLOCKWISE : + (i_orient < 0) ? CGAL::CLOCKWISE : CGAL::COLLINEAR; + + // Read the approximated source, along with a general conic + // whose intersection with + // defines the source. + Point_2 app_source; + if (!read_app_point(is, app_source)) return false; + Rational r1, s1, t1, u1, v1, w1; + is >> r1 >> s1 >> t1 >> u1 >> v1 >> w1; + + // Read the approximated target, along with a general conic + // whose intersection with + // defines the target. + Point_2 app_target; + if (!read_app_point(is, app_target)) return false; + + Rational r2, s2, t2, u2, v2, w2; + is >> r2 >> s2 >> t2 >> u2 >> v2 >> w2; + + // Create the conic arc. + cv = Curve(r, s, t, u, v, w, orient, + app_source, r1, s1, t1, u1, v1, w1, + app_target, r2, s2, t2, u2, v2, w2); + return true; +} + +/*! */ +template +bool read_general_curve(stream& is, Curve& cv) +{ + Rational r, s, t, u, v, w; // The conic coefficients. + // Read a general conic, given by its coefficients . + is >> r >> s >> t >> u >> v >> w; + CGAL::Orientation orient; + Point_2 source, target; + if (!read_orientation_and_end_points(is, orient, source, target)) + return false; + + // Create the conic (or circular) arc. + cv = Curve(r, s, t, u, v, w, orient, source, target); + return true; +} + +/*! Read an x-monotone conic curve */ +template <> +template +bool IO_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) +{ + Curve_2 tmp_cv; + if (!read_curve(is,tmp_cv)) + return false; + xcv = X_monotone_curve_2(tmp_cv); + return true; +} + +/*! Read a general conic curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + // Get the arc type: + char type; + is >> type; + if (type == 'f' || type == 'F') + return read_full_ellipse(is, cv); + else if (type == 's' || type == 'S') + return read_segment(is, cv); + else if (type == 'i' || type == 'I') + return read_general_arc(is, cv); + else if (type == 'c' || type == 'C') { + // Read a general conic, given by its coefficients . + Rational r, s, t, u, v, w; + is >> r >> s >> t >> u >> v >> w; + // Create a full conic (should work only for ellipses). + cv = Curve_2(r, s, t, u, v, w); + return true; + } + else if (type == 'e' || type == 'E') + return read_partial_ellipse(is, cv); + else if (type == 'h' || type == 'H') + return read_hyperbola(is, cv); + else if (type == 'p' || type == 'P') + return read_parabola(is, cv); + else if (type == 'a' || type == 'A') + return read_general_curve(is, cv); + + // If we reached here, we have an unknown conic type: + std::cerr << "Illegal conic type specification: " << type << "." + << std::endl; + return false; +} + +// Rational arc +#elif TEST_TRAITS == RATIONAL_ARC_TRAITS +/*! Read a point */ + +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) +{ + Traits::Construct_point_2 construct_point_2 = + m_traits.construct_point_2_object(); + + Rational x, y; + is >> x >> y ; + p = construct_point_2(x, y); + return true; +} + +template +bool read_rational_to_real(stream& is, Algebraic_real_1& r) +{ + static Traits::Algebraic_kernel_d_1 algebraic_kernel; + Rational rat; + is >> rat; + r = algebraic_kernel.construct_algebraic_real_1_object()(rat); + return true; +} + +template +bool read_coefficients(stream& is, Rat_vector& coeffs) +{ + unsigned int num_coeffs; + Rational rat; + is >> num_coeffs; + coeffs.clear(); + for (unsigned int j = 0; j < num_coeffs; j++) { + is >> rat; + coeffs.push_back(rat); + } + return true; +} + +/*! Read a xcurve */ +template <> +template +bool IO_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) +{ + //curve constructor + const Traits::Construct_x_monotone_curve_2 + ctr_x_monotone_curve = + m_traits.construct_x_monotone_curve_2_object(); + + // Get the arc type: + Rat_vector p_coeffs, q_coeffs; + Algebraic_real_1 src, trg; + int dir = 0; + char type; + is >> type; + if (type == 'a' || type == 'A') { + //Default constructor + xcv = X_monotone_curve_2(); + return true; + } + else if (type == 'b' || type == 'B') { + //Constructor of a whole polynomial curve + if (read_coefficients(is,p_coeffs)) + xcv = ctr_x_monotone_curve(p_coeffs.begin(),p_coeffs.end()); + else + return false; + return true; + } + else if (type == 'c' || type == 'C') { + //Constructor of a polynomial ray + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + is >> dir; + xcv = ctr_x_monotone_curve(p_coeffs.begin(), p_coeffs.end(), + src, (dir == 0 ? false : true)); + return true; + } + else if (type == 'd' || type == 'D') { + //Constructor of a polynomial arc + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + if (!read_rational_to_real(is,trg)) + return false; + xcv = ctr_x_monotone_curve(p_coeffs.begin(),p_coeffs.end(), src, trg); + return true; + } + else if (type == 'e' || type == 'E') { + //Constructor of a whole rational function + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_coefficients(is,q_coeffs)) + return false; + xcv = ctr_x_monotone_curve(p_coeffs.begin(), p_coeffs.end(), + q_coeffs.begin(),q_coeffs.end()); + return true; + } + else if (type == 'f' || type == 'F') { + //Constructor of a ray of a rational function + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_coefficients(is,q_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + is >> dir; + xcv =ctr_x_monotone_curve(p_coeffs.begin(),p_coeffs.end(), + q_coeffs.begin(),q_coeffs.end(), + src, (dir == 0 ? false : true)); + return true; + } + else if (type == 'g' || type == 'G') { + //Constructor of a bounded rational arc + if (!read_coefficients(is, p_coeffs)) + return false; + if (!read_coefficients(is, q_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + if (!read_rational_to_real(is,trg)) + return false; + + xcv = ctr_x_monotone_curve( p_coeffs.begin(),p_coeffs.end(), + q_coeffs.begin(),q_coeffs.end(), + src, trg); + return true; + } + // If we reached here, we have an unknown rational arc type: + std::cerr << "Illegal rational arc type specification: " << type << "." + << std::endl; + return (false); +} + +/*! Read a curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + //curve constructor + const Traits::Construct_curve_2 construct_curve_2 = + m_traits.construct_curve_2_object(); + + // Get the arc type: + Rat_vector p_coeffs, q_coeffs; + Algebraic_real_1 src, trg; + int dir = 0; + char type; + is >> type; + if (type == 'a' || type == 'A') { + //Default constructor + cv = Curve_2(); + return true; + } + else if (type == 'b' || type == 'B') { + //Constructor of a whole polynomial curve + if (read_coefficients(is,p_coeffs)) + cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end()); + else + return false; + return true; + } + else if (type == 'c' || type == 'C') { + //Constructor of a polynomial ray + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + is >> dir; + cv = construct_curve_2(p_coeffs.begin(), p_coeffs.end(), src, + (dir == 0 ? false : true)); + return true; + } + else if (type == 'd' || type == 'D') { + //Constructor of a polynomial arc + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + if (!read_rational_to_real(is,trg)) + return false; + cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end(), src, trg); + return true; + } + else if (type == 'e' || type == 'E') { + //Constructor of a whole rational function + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_coefficients(is,q_coeffs)) + return false; + cv = construct_curve_2(p_coeffs.begin(), p_coeffs.end(), + q_coeffs.begin(), q_coeffs.end()); + return true; + } + else if (type == 'f' || type == 'F') { + //Constructor of a ray of a rational function + if (!read_coefficients(is,p_coeffs)) + return false; + if (!read_coefficients(is,q_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + is >> dir; + cv =construct_curve_2(p_coeffs.begin(),p_coeffs.end(), + q_coeffs.begin(),q_coeffs.end(), + src, (dir == 0 ? false : true)); + return true; + } + else if (type == 'g' || type == 'G') { + //Constructor of a bounded rational arc + if (!read_coefficients(is, p_coeffs)) + return false; + if (!read_coefficients(is, q_coeffs)) + return false; + if (!read_rational_to_real(is,src)) + return false; + if (!read_rational_to_real(is,trg)) + return false; + cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end(), + q_coeffs.begin(),q_coeffs.end(), + src, trg); + return true; + } + // If we reached here, we have an unknown rational arc type: + std::cerr << "Illegal rational arc type specification: " << type << "." + << std::endl; + return (false); +} + +// Bezier +#elif TEST_TRAITS == BEZIER_TRAITS + +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) +{ + Rational rat_x,rat_y; + is >> rat_x >> rat_y; + p = Point_2(rat_x, rat_y); + return true; +} + +/*! Read an x-monotone bezier curve */ + +template <> +template +bool IO_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) +{ + std::list x_objs; + std::list::const_iterator xoit; + Curve_2 tmp_cv; + is >> tmp_cv; + Rational B_psx = Rational(tmp_cv.control_point(0).x()); + Rational B_psy = Rational(tmp_cv.control_point(0).y()); + Rational B_ptx = + Rational(tmp_cv.control_point(tmp_cv.number_of_control_points()-1).x()); + Rational B_pty = + Rational(tmp_cv.control_point(tmp_cv.number_of_control_points()-1).y()); + Point_2 B_ps(B_psx, B_psy); + Point_2 B_pt(B_ptx, B_pty); + Traits::Make_x_monotone_2 make_x_monotone = + this->m_traits.make_x_monotone_2_object(); + make_x_monotone (tmp_cv, std::front_inserter (x_objs)); + xoit = x_objs.begin(); + if (CGAL::assign(xcv, *xoit)) + return true; + return false; +} + +/*! Read a general bezier curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + is >> cv; + return true; +} + +// Algebraic +#elif TEST_TRAITS == ALGEBRAIC_TRAITS + +#include + +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) { + Traits traits; + Traits::Construct_point_2 construct_point_2 = + traits.construct_point_2_object(); + char type; + is >> type; + switch(type) { + case 'i': { + int x=0,y=0; + is >> x >> y; + p = construct_point_2(x, y); + break; + } + case 'b': { + Traits::Bound x,y; + is >> x >> y; + p=construct_point_2(x, y); + break; + } + case 'c': { + Traits::Coefficient x, y; + is >> x >> y; + p = construct_point_2(x, y); + break; + } + case 'a': { + Traits::Algebraic_real_1 x, y; + is >> x >> y; + p = construct_point_2(x, y); + break; + } + case 's': { + Traits::Algebraic_real_1 x; + is >> x; + Traits::X_monotone_curve_2 xcv; + CGAL::swallow(is,'('); + CGAL_assertion_code(bool check=) + read_xcurve(is, xcv); + CGAL_assertion(check); + + CGAL::swallow(is,')'); + p = construct_point_2(x, xcv); + break; + } + case 'g': { + Traits::Algebraic_real_1 x; + is >> x; + Traits::Curve_2 c; + CGAL_assertion_code(bool check = ) + read_curve(is,c); + CGAL_assertion(check); + int arcno=0; + is >> arcno; + p = construct_point_2(x, c, arcno); + break; + } + default: { + std::cout << "Expected i, b, c, a, s, or g, but got \"" << type << "\"" + << std::endl; + return false; + } + } + return true; +} + +template <> +template +bool IO_base_test::read_xcurve(stream& is, + Traits::X_monotone_curve_2& xcv) +{ + Traits traits; + Traits::Construct_x_monotone_segment_2 construct_segment_2 = + traits.construct_x_monotone_segment_2_object(); + char type; + is >> type; + switch(type) { + case '1': { + Curve_2 cv; + Point_2 end_left,end_right; + CGAL_assertion_code(bool check=) + read_curve(is,cv); + CGAL_assertion(check); + CGAL::swallow(is,'('); + CGAL_assertion_code(check=) + read_point(is,end_left); + CGAL_assertion(check); + CGAL::swallow(is,')'); + CGAL::swallow(is,'('); + CGAL_assertion_code(check=) + read_point(is,end_right); + CGAL_assertion(check); + CGAL::swallow(is,')'); + std::vector xcvs; + construct_segment_2(cv, end_left, end_right, std::back_inserter(xcvs)); + CGAL_assertion(xcvs.size() == 1); + xcv = xcvs[0]; + break; + } + case '2': { + Curve_2 cv; + Point_2 p; + CGAL_assertion_code(bool check=) + read_curve(is,cv); + CGAL_assertion(check); + CGAL::swallow(is,'('); + CGAL_assertion_code(check=) + read_point(is,p); + CGAL_assertion(check); + CGAL::swallow(is,')'); + std::string site_of_p_string; + Traits::Site_of_point site_of_p; + is >> site_of_p_string; + if (site_of_p_string=="MIN_ENDPOINT") { + site_of_p=Traits::MIN_ENDPOINT; + } else if (site_of_p_string=="MAX_ENDPOINT") { + site_of_p=Traits::MAX_ENDPOINT; + } else { + CGAL_assertion(site_of_p_string=="POINT_IN_INTERIOR"); + site_of_p=Traits::POINT_IN_INTERIOR; + } + std::vector xcvs; + construct_segment_2(cv, p, site_of_p, std::back_inserter(xcvs)); + CGAL_assertion(xcvs.size() == 1); + xcv = xcvs[0]; + break; + } + default: { + std::cout << "Expected 1 or 2, but got \"" << type << "\"" << std::endl; + return false; + } + } + return true; +} + +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) { + Traits traits; + Traits::Polynomial_2 p; + Traits::Construct_curve_2 construct_curve_2 = + traits.construct_curve_2_object(); + is >> p; + cv = construct_curve_2(p); + return true; +} + +// Spherical arc +#elif TEST_TRAITS == SPHERICAL_ARC_TRAITS + +/*! Read a point */ + +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) +{ + Basic_number_type x, y, z; + is >> x >> y >> z; + p = Point_2(x, y, z); + return true; +} + +/*! Read a xcurve */ +template <> +template +bool IO_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) +{ + Point_2 p1,p2; + read_point(is, p1); + read_point(is, p2); + CGAL_assertion(p1 != p2); + xcv = X_monotone_curve_2(p1, p2); + return true; +} + +/*! Read a curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + Point_2 p1, p2; + read_point(is, p1); + read_point(is, p2); + CGAL_assertion(p1 != p2); + cv = Curve_2(p1, p2); + return true; +} + +// circular line arc +#elif TEST_TRAITS == LINE_ARC_TRAITS || \ + TEST_TRAITS == CIRCULAR_ARC_TRAITS || \ + TEST_TRAITS == CIRCULAR_LINE_ARC_TRAITS + +/*! Read an arc point */ +template +bool read_arc_point(stream& is, typename T_Traits::Point_2& p) +{ + Basic_number_type x, y; + is >> x >> y; + Circular_kernel::Point_2 lp(x, y); + p = typename T_Traits::Point_2(lp); + return true; +} + +bool is_deg_1(char c) +{ + return (c=='z' || c=='Z') || (c=='y' || c=='Y') || (c=='x' || c=='X') || + (c=='w' || c=='W') || (c=='v' || c=='V') || (c=='l' || c=='L'); +} + +bool is_deg_2(char c) +{ + return (c=='b' || c=='B') || (c=='c' || c=='C') || + (c=='d' || c=='D') || (c=='e' || c=='E'); +} + +#if TEST_TRAITS == LINE_ARC_TRAITS || \ + TEST_TRAITS == CIRCULAR_LINE_ARC_TRAITS + +template +Circular_kernel::Line_arc_2 read_line(char type, stream& is) +{ + if (type == 'z' || type == 'Z') { + Circular_kernel::Line_2 l_temp; + Circular_kernel::Circle_2 c_temp1,c_temp2; + bool b1,b2; + is >> l_temp >> c_temp1 >> b1 >> c_temp2 >> b2; + return Circular_kernel::Line_arc_2(l_temp,c_temp1,b1,c_temp2,b2); + } + else if (type == 'y' || type == 'Y') { + Circular_kernel::Line_2 l_temp,l_temp1,l_temp2; + is >> l_temp >> l_temp1 >> l_temp2; + return Circular_kernel::Line_arc_2(l_temp,l_temp1,l_temp2); + } + else if (type == 'x' || type == 'X') { + Circular_kernel::Line_2 l_temp; + Circular_kernel::Circular_arc_point_2 p0,p1; + is >> l_temp >> p0 >> p1; + //std::cout << "got here l_temp p0 p1 " << l_temp << " " << p0 << " " << p1 << std::endl; + return Circular_kernel::Line_arc_2(l_temp, p0, p1); + } + else if (type == 'w' || type == 'W' || type == 'l' || type == 'L') { + Circular_kernel::Point_2 p0,p1; + is >> p0 >> p1; + return Circular_kernel::Line_arc_2(p0,p1); + } + else if (type == 'v' || type == 'V') { + Circular_kernel::Segment_2 seg; + is >> seg; + return Circular_kernel::Line_arc_2(seg); + } + std::cout << "should never happen Line_arc_2 " << type < +Circular_kernel::Circular_arc_2 read_arc(char type,stream& is) +{ + if (type == 'b' || type == 'B') { + Circular_kernel::Circle_2 circle, circle1, circle2; + bool b1, b2; + is >> circle >> circle1 >> b1 >> circle2 >> b2; + + return Circular_kernel::Circular_arc_2(circle, circle1, b1, circle2, b2); + } + else if (type == 'c' || type == 'C') { + Circular_kernel::Circle_2 circle; + Circular_kernel::Circular_arc_point_2 p0, p1; + is >> circle >> p0 >> p1; + return Circular_kernel::Circular_arc_2(circle, p0, p1); + } + else if (type == 'd' || type == 'D') { + Circular_kernel::Circle_2 circle; + Circular_kernel::Line_2 line1, line2; + bool b1,b2; + is >> circle >> line1 >> b1 >> line2 >> b2; + return Circular_kernel::Circular_arc_2(circle, line1, b1, line2, b2); + } + else + CGAL_error_msg("Unrecognized constructor. Should never happen" \ + "Circular_arc_2"); + // else if (type == 'e' || type == 'E') + // { + // Circular_kernel::Circular_arc_2 arc; + // Circular_kernel::Circle_2 circle; + // bool b1, b2; + // is >> arc >> b1 >> circle >> b2; + // return Circular_kernel::Circular_arc_2(arc, b1, circle, b2); + // } + return Circular_kernel::Circular_arc_2(); //should never happen +} +#endif + +#if TEST_TRAITS == LINE_ARC_TRAITS + +/*! Read a line arc point */ +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) +{ + return read_arc_point(is, p); +} + +/*! Read an x-monotone line arc curve */ +template <> +template +bool IO_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) +{ + // Get the arc type: + char type; + is >> type; + if (is_deg_1(type)) { + xcv = read_line(type,is); + return true; + } + return false; +} + +/*! Read a general line arc curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + // Get the arc type: + char type; + is >> type; + if (is_deg_1(type)) { + cv = read_line(type,is); + return true; + } + return false; +} + +#endif + +#if TEST_TRAITS == CIRCULAR_ARC_TRAITS + +/*! Read a circular arc point */ +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) +{ + return read_arc_point(is, p); +} + +/*! Read an x-monotone circular arc curve */ +template <> +template +bool IO_base_test::read_xcurve(stream& is,X_monotone_curve_2& xcv) +{ + // Get the arc type: + char type; + is >> type; + if (is_deg_2(type)) { + xcv = read_arc(type, is); + return true; + } + return false; +} + +/*! Read a general circular curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + // Get the arc type: + char type; + is >> type; + if (type == 'a' || type == 'A') { + Circular_kernel::Circle_2 circle; + is >> circle; + cv = Circular_kernel::Circular_arc_2(circle); + return true; + } + else if (is_deg_2(type)) { + cv = read_arc(type, is); + return true; + } + return false; +} + +#endif + +#if TEST_TRAITS == CIRCULAR_LINE_ARC_TRAITS + +/*! Read a circular-line arc point */ +template <> +template +bool IO_base_test::read_point(stream& is, Point_2& p) +{ + return read_arc_point(is, p); +} + +/*! Read an x-monotone circular-line arc curve */ +template <> +template +bool IO_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) +{ + // Get the arc type: + char type; + is >> type; + if (is_deg_1(type)) { + xcv = read_line(type,is); + return true; + } + else if (is_deg_2(type)) { + xcv = X_monotone_curve_2(read_arc(type, is)); + return true; + } + return false; +} + +/*! Read a general circular-line curve */ +template <> +template +bool IO_base_test::read_curve(stream& is, Curve_2& cv) +{ + // Get the arc type: + char type; + is >> type; + if (type == 'a' || type == 'A') { + Circular_kernel::Circle_2 circle; + is >> circle; + cv=Curve_2(circle); + return true; + } + else if (is_deg_1(type)) { + cv = Curve_2(read_line(type, is)); + return true; + } + else if (is_deg_2(type)) { + cv = read_arc(type, is); + return true; + } + return false; + +} + +#endif + +#endif + +#endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_test.h new file mode 100644 index 00000000000..14ca8a2222d --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/IO_test.h @@ -0,0 +1,285 @@ +#ifndef CGAL_IO_TEST_H +#define CGAL_IO_TEST_H + +#include +#include +#include +#include + +#include "IO_base_test.h" + +template +class IO_test : public IO_base_test { +public: + typedef T_Traits Traits; + typedef IO_base_test Base; + + typedef typename Base::Point_2 Point_2; + typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Base::Curve_2 Curve_2; + + typedef typename std::vector Points_vector; + typedef typename std::vector Xcurves_vector; + typedef typename std::vector Curves_vector; + + /*! Constructor */ + IO_test(); + + /*! Destructor */ + virtual ~IO_test(); + + bool read_xcurves(const char* filename, Xcurves_vector& xcurves); + bool read_points(const char* filename, Points_vector& points); + bool read_curves(const char* filename, Curves_vector& curves); + + /*! Set the file names */ + void set_filenames(const char* points_filename, + const char* xcurves_filename, + const char* curves_filename); + + /*! Parse the command line */ + virtual bool parse(int argc, char* argv[]); + + /*! Initialize the data structure */ + virtual bool init(); + + /*! Clear the data structures */ + virtual void clear(); + +protected: + /*! Skip comments */ + std::istream& skip_comments(std::istream& is, std::string& line); + + /*! Remove blanks */ + std::string remove_blanks(char* str); + + /*! Print an error message */ + void print_error(const std::string& msg) + { std::cerr << "Error: " << msg.c_str() << std::endl; } + + /*! Print the end-of-line */ + void print_eol() + { + std::cout << std::endl; + m_eol_printed = true; + } + + /*! Print information */ + void print_info(std::string& info, + bool start_line = true, bool end_line = true) + { + if (start_line && !m_eol_printed) print_eol(); + std::cout << info.c_str(); + if (end_line) print_eol(); + } + + /*! Print final results */ + void print_result(bool result) + { + std::string result_str((result) ? "Passed" : "Failed"); + print_info(result_str, false); + } + + /*! Print expected answer and real answer */ + void print_answer(const std::string& exp, const std::string& real, + const std::string& str) + { + print_info(std::string("Expected ").append(str).append(": ").append(exp)); + print_info(std::string("Obtained ").append(str).append(": ").append(real)); + } + + /*! Indicates whether the end-of-line has been printed */ + bool m_eol_printed; + + /*! The input data file of points*/ + std::string m_filename_points; + + /*! The input data file of curves*/ + std::string m_filename_curves; + + /*! The input data file of xcurves*/ + std::string m_filename_xcurves; + + /*! The container of input points */ + Points_vector m_points; + + /*! The container of input curves */ + Curves_vector m_curves; + + /*! The container of x-monotone curves */ + Xcurves_vector m_xcurves; +}; + +/*! + * Constructor. + * Accepts test data file name. + */ +template +IO_test::IO_test() : m_eol_printed(true) {} + +/*! + * Destructor. + */ +template +IO_test::~IO_test() { clear(); } + +/*! Set the file names */ +template +void IO_test::set_filenames(const char* points_filename, + const char* xcurves_filename, + const char* curves_filename) +{ + m_filename_points.assign(points_filename); + m_filename_xcurves.assign(xcurves_filename); + m_filename_curves.assign(curves_filename); +} + +template +bool IO_test::parse(int argc, char* argv[]) +{ + if (argc < 4) { + print_info(std::string("Usage: ").append(argv[0]). + append(" points_file xcurves_file curves_file")); + return false; + } + + m_filename_points.assign(argv[1]); + m_filename_xcurves.assign(argv[2]); + m_filename_curves.assign(argv[3]); + return true; +} + +/*! Initialize the data structure */ +template +bool IO_test::init() +{ + if (!read_points(m_filename_points.c_str(), m_points)) return false; + if (!read_xcurves(m_filename_xcurves.c_str(), m_xcurves)) return false; + if (!read_curves(m_filename_curves.c_str(), m_curves)) return false; + return true; +} + +/*! Clear the data structures */ +template +void IO_test::clear() +{ + m_filename_points.clear(); + m_filename_xcurves.clear(); + m_filename_curves.clear(); + + m_points.clear(); + m_curves.clear(); + m_xcurves.clear(); +} + +/*! + * Skip comments. Comments start with the '#' character and extend to the + * end of the line + */ +template +std::istream& IO_test::skip_comments(std::istream& is, + std::string& line) +{ + while (std::getline(is, line)) + if ((line[0] != '#') && !line.empty()) break; + return is; +} + +/*! + */ +template +std::string IO_test::remove_blanks(char* str) +{ + std::string result = ""; + bool flag = false; + //only alphanumeric characters and underscores are allowed + for (; *str != '\0'; ++str) { + if ((*str >= '0' && *str <= '9') || //digits + (*str >= 'A' && *str <= 'Z') || //upper case letters + (*str >= 'a' && *str <= 'z') || //lower case letters + *str == '_') //underscores + { + if (!flag) + flag = true; + result += *str; + } + if (*str == ' ' && flag) break; + } + return result; +} + +/*! */ +template +bool IO_test::read_points(const char* filename, Points_vector& points) +{ + typedef T_Traits Traits; + + // read points from file into associative container + std::ifstream p_stream(filename); + if (!p_stream.is_open()) { + std::cerr << "Cannot open file " << filename << "!" << std::endl; + return false; + } + + std::string line; + while (skip_comments(p_stream, line)) { + std::istringstream line_stream(line); + typename Traits::Point_2 p; + this->read_point(line_stream, p); + points.push_back(p); + line_stream.clear(); + } + return true; +} + +/*! */ +template +bool +IO_test::read_xcurves(const char* filename, Xcurves_vector& xcurves) +{ + typedef T_Traits Traits; + + // read x-monotone curves from file into associative container + std::ifstream xcv_stream(filename); + if (!xcv_stream.is_open()) { + std::cerr << "Cannot open file " << filename << "!" << std::endl; + return false; + } + + std::string line; + while (skip_comments(xcv_stream, line)) { + std::istringstream line_stream(line); + typename Traits::X_monotone_curve_2 xcv; + this->read_xcurve(line_stream, xcv); + xcurves.push_back(xcv); + line_stream.clear(); + } + return true; +} + +/*! */ +template +bool +IO_test::read_curves(const char* filename, Curves_vector& curves) +{ + typedef T_Traits Traits; + + // Read curves from file into associative container + std::ifstream cv_stream(filename); + if (!cv_stream.is_open()) { + std::cerr << "Cannot open file " << filename << "!" << std::endl; + return false; + } + + std::string line; + while (skip_comments(cv_stream, line)) { + std::istringstream line_stream(line); + typename Traits::Curve_2 cv; + this->read_curve(line_stream, cv); + curves.push_back(cv); + line_stream.clear(); + } + return true; +} + +#endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_dynamic_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_dynamic_test.h new file mode 100644 index 00000000000..1d1d6b573c8 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_dynamic_test.h @@ -0,0 +1,150 @@ +#ifndef CGAL_POINT_LOCATION_DYNAMIC_TEST_H +#define CGAL_POINT_LOCATION_DYNAMIC_TEST_H + +#include + +#include "Point_location_test.h" + +/*! Point location test */ +template +class Point_location_dynamic_test : public Point_location_test { +private: + typedef T_Traits Traits; + typedef Point_location_test Base; + +public: + typedef typename Base::Point_2 Point_2; + typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Base::Curve_2 Curve_2; + + typedef typename Base::Arrangement_2 Arrangement_2; + + /*! Destructor */ + virtual ~Point_location_dynamic_test() + { + this->deallocate_arrangement(); + clear(); + this->deallocate_pl_strategies(); + } + + /*! Clear the data structures */ + virtual void clear(); + + void set_filenames(const char* points_filename, const char* xcurves_filename, + const char* curves_filename, const char* commands_filename, + const char* queries_filename) + { + Base::set_filenames(points_filename, xcurves_filename, + curves_filename, queries_filename); + m_filename_commands.assign(commands_filename); + } + + bool construct_arrangement(); + +private: + bool read_perform_opts(std::istream& is); + + bool remove(const X_monotone_curve_2& xcv); + + /*! The input data file of commands*/ + std::string m_filename_commands; +}; + +/*! Clear the data structures */ +template +void Point_location_dynamic_test::clear() +{ + Base::clear(); + m_filename_commands.clear(); +} + +template +bool Point_location_dynamic_test::construct_arrangement() +{ + std::ifstream in_com(this->m_filename_commands.c_str()); + if (!in_com.is_open()) { + this->print_error(std::string("cannot open file ").append(this->m_filename_commands)); + return false; + } + + if (!read_perform_opts(in_com)) { + in_com.close(); + return false; + } + in_com.close(); + + // Print the size of the arrangement. + std::cout << "V = " << this->m_arr->number_of_vertices() + << ", E = " << this->m_arr->number_of_edges() + << ", F = " << this->m_arr->number_of_faces() << std::endl; + + return true; +} + +template +bool Point_location_dynamic_test::read_perform_opts(std::istream& is) +{ + bool rc = true; + + CGAL::Timer timer; + timer.reset(); + timer.start(); + + std::string sline; + while (this->skip_comments(is, sline)) { + std::istringstream line(sline); + char cmd; + line >> cmd; + + if (cmd == 'a') { + // Insert all into the arrangement + CGAL::insert(*(this->m_arr), this->m_xcurves.begin(), this->m_xcurves.end()); + // insert(*(this->m_arr), m_points.begin(), m_points.end()); + CGAL::insert(*(this->m_arr), this->m_curves.begin(), this->m_curves.end()); + continue; + } + + unsigned int id; + line >> id; + if (id >= this->m_xcurves.size()) { + std::cerr << "Index of x-monotone curve " << id << " is out of range (" + << this->m_xcurves.size() << ") in " << "m_filename_commands" + << "!" << std::endl; + rc = false; + continue; + } + if (cmd == 'i') CGAL::insert(*(this->m_arr), this->m_xcurves[id]); + + if (cmd == 'd') { + if (!remove(this->m_xcurves[id])) rc = false; + } + } + timer.stop(); ///END + std::cout << "Arrangement aggregate construction took " + << timer.time() << std::endl; + + return rc; +} + +template +bool Point_location_dynamic_test::remove(const X_monotone_curve_2& xcv) +{ + typedef T_Traits Traits; + bool rc = false; // be pasimistic, assume nothing is removed. + + const Traits* traits = this->m_arr->geometry_traits(); + typename Traits::Equal_2 equal = traits->equal_2_object(); + + typename Arrangement_2::Edge_iterator eit; + for (eit = this->m_arr->edges_begin(); eit != this->m_arr->edges_end(); ++eit) { + const X_monotone_curve_2& xcv_arr = eit->curve(); + if (equal(xcv, xcv_arr)) { + this->m_arr->remove_edge(eit); + rc = true; // found a curve to remove. + break; + } + } + return rc; +} + +#endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h new file mode 100644 index 00000000000..be627e64b2c --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h @@ -0,0 +1,742 @@ +#ifndef CGAL_POINT_LOCATION_TEST_H +#define CGAL_POINT_LOCATION_TEST_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include + +#include "IO_test.h" + +/*! Point location test */ +template +class Point_location_test : public IO_test { +private: + typedef T_Traits Traits; + typedef IO_test Base; + +public: + typedef typename Base::Point_2 Point_2; + typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Base::Curve_2 Curve_2; + + typedef typename Base::Points_vector Points_vector; + typedef typename Base::Xcurves_vector Xcurves_vector; + typedef typename Base::Curves_vector Curves_vector; + + typedef CGAL::Arrangement_2 Arrangement_2; + + typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; + typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; + typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; + + typedef typename Points_vector::iterator Point_iterator; + typedef std::vector Objects_vector; + typedef Objects_vector::iterator Object_iterator; + +protected: + typedef typename CGAL::Arr_naive_point_location + Naive_point_location; + typedef typename CGAL::Arr_simple_point_location + Simple_point_location; + typedef typename CGAL::Arr_walk_along_line_point_location + Walk_point_location; + typedef typename CGAL::Arr_landmarks_point_location + Lm_point_location; + typedef typename CGAL::Arr_random_landmarks_generator + Random_lm_generator; + typedef typename CGAL::Arr_landmarks_point_location + Lm_random_point_location; + typedef typename CGAL::Arr_grid_landmarks_generator + Grid_lm_generator; + typedef typename CGAL::Arr_landmarks_point_location + Lm_grid_point_location; + typedef typename CGAL::Arr_halton_landmarks_generator + Halton_lm_generator; + typedef typename CGAL::Arr_landmarks_point_location + Lm_halton_point_location; + typedef typename CGAL::Arr_middle_edges_landmarks_generator + Middle_edges_generator; + typedef typename CGAL::Arr_landmarks_point_location + Lm_middle_edges_point_location; + typedef typename CGAL::Arr_landmarks_specified_points_generator + Specified_points_generator; + typedef typename CGAL::Arr_landmarks_point_location + Lm_specified_points_point_location; + typedef typename CGAL::Arr_trapezoid_ric_point_location + Trapezoid_ric_point_location; + + // typedef CGAL::Arr_triangulation_point_location + // Triangulation_point_location; + + // ===> Add new point location type here <=== + + Naive_point_location* m_naive_pl; // 0 + Simple_point_location* m_simple_pl; // 1 + Walk_point_location* m_walk_pl; // 2 + Lm_point_location* m_lm_pl; // 3 + Lm_random_point_location* m_random_lm_pl; // 4 + Lm_grid_point_location* m_grid_lm_pl; // 5 + Lm_halton_point_location* m_halton_lm_pl; // 6 + Lm_middle_edges_point_location* m_middle_edges_lm_pl; // 7 + Lm_specified_points_point_location* m_specified_points_lm_pl; // 8 + // Triangulation_point_location m_triangulation_pl; // 9 + Trapezoid_ric_point_location* m_trapezoid_ric_pl; // 10 + Trapezoid_ric_point_location* m_trapezoid_ric_no_grnt_pl; // 11 + + Random_lm_generator* m_random_g; + Grid_lm_generator* m_grid_g; + Halton_lm_generator* m_halton_g; + Middle_edges_generator* m_middle_edges_g; + Specified_points_generator* m_specified_points_g; + + // // ===> Change the number of point-location startegies + // // when a new point location is added. <=== + #define MAX_NUM_POINT_LOCATION_STRATEGIES 11 + +public: + /*! Constructor */ + Point_location_test(); + + /*! Destructor */ + virtual ~Point_location_test() + { + deallocate_arrangement(); + clear(); + deallocate_pl_strategies(); + } + + void set_filenames(const char* points_filename, const char* xcurves_filename, + const char* curves_filename, const char* queries_filename); + + /*! Initialize the data structures */ + virtual bool init(); + + /*! Perform the test */ + virtual bool perform(); + + /*! Clear the data structures */ + virtual void clear(); + + bool allocate_arrangement(); + + void deallocate_arrangement(); + + bool construct_arrangement(); + + void clear_arrangement(); + + bool allocate_pl_strategies(); + + bool construct_pl_strategies(); + + bool attach_pl_strategies(); + + void deallocate_pl_strategies(); + + template + void query(Point_location& pl, const char* type, + InputIterator begin, InputIterator end, OutputIterator oi) + { + typedef InputIterator Input_iterator; + + CGAL::Timer timer; + timer.reset(); timer.start(); + Input_iterator piter; + for (piter = begin; piter != end; ++piter) { + Point_2 q = (*piter); + CGAL::Object obj = pl.locate(q); + *oi++ = obj; + } + timer.stop(); + std::cout << type << " location took " << timer.time() << std::endl; + } + + /*! The arrangement */ + Arrangement_2* m_arr; + +private: + /*! The input data file of the query points*/ + std::string m_filename_queries; + + /*! The query points */ + Points_vector m_query_points; +}; + +/*! + * Constructor. + * Accepts test data file name. + */ +template +Point_location_test::Point_location_test() : + m_naive_pl(NULL), + m_simple_pl(NULL), + m_walk_pl(NULL), + m_lm_pl(NULL), + m_random_lm_pl(NULL), + m_grid_lm_pl(NULL), + m_halton_lm_pl(NULL), + m_middle_edges_lm_pl(NULL), + m_specified_points_lm_pl(NULL), + // m_triangulation_pl(NULL), + m_trapezoid_ric_pl(NULL), + m_trapezoid_ric_no_grnt_pl(NULL), + m_random_g(NULL), + m_grid_g(NULL), + m_halton_g(NULL), + m_middle_edges_g(NULL), + m_specified_points_g(NULL), + m_arr(NULL) +{} + +/*! Set the file names */ +template +void Point_location_test::set_filenames(const char* points_filename, + const char* xcurves_filename, + const char* curves_filename, + const char* queries_filename) +{ + Base::set_filenames(points_filename, xcurves_filename, curves_filename); + m_filename_queries.assign(queries_filename); +} + +/*! Initialize the data structures */ +template +bool Point_location_test::init() +{ + if (!Base::init()) return false; + + // Read the query points + if (!this->read_points(m_filename_queries.c_str(), m_query_points)) + return false; + + return true; +} + +/*! Clear the data structures */ +template +void Point_location_test::clear() +{ + Base::clear(); + m_query_points.clear(); + m_filename_queries.clear(); +} + +/*! Clear the data structures */ +template +void Point_location_test::deallocate_pl_strategies() +{ + if (m_naive_pl) { + delete m_naive_pl; + m_naive_pl = NULL; + } + if (m_simple_pl) { + delete m_simple_pl; + m_simple_pl = NULL; + } + if (m_walk_pl) { + delete m_walk_pl; + m_walk_pl = NULL; + } + +#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS) + if (m_lm_pl) { + delete m_lm_pl; + m_lm_pl = NULL; + } + if (m_random_lm_pl) { + delete m_random_lm_pl; + m_random_lm_pl = NULL; + } + if (m_grid_lm_pl) { + delete m_grid_lm_pl; + m_grid_lm_pl = NULL; + } + if (m_halton_lm_pl) { + delete m_halton_lm_pl; + m_halton_lm_pl = NULL; + } + if (m_middle_edges_lm_pl) { + delete m_middle_edges_lm_pl; + m_middle_edges_lm_pl = NULL; + } + if (m_specified_points_lm_pl) { + delete m_specified_points_lm_pl; + m_specified_points_lm_pl = NULL; + } + + // Free Generators + if (m_random_g) { + delete m_random_g; + m_random_g = NULL; + } + if (m_grid_g) { + delete m_grid_g; + m_grid_g = NULL; + } + if (m_halton_g) { + delete m_halton_g; + m_halton_g = NULL; + } + if (m_middle_edges_g) { + delete m_middle_edges_g; + m_middle_edges_g = NULL; + } + if (m_specified_points_g) { + delete m_specified_points_g; + m_specified_points_g = NULL; + } +#endif + + // if (m_triangulation_pl) { + // delete m_triangulation_pl; + // m_triangulation_pl = NULL; + // } + if (m_trapezoid_ric_pl) { + delete m_trapezoid_ric_pl; + m_trapezoid_ric_pl = NULL; + } + if (m_trapezoid_ric_no_grnt_pl) { + delete m_trapezoid_ric_no_grnt_pl; + m_trapezoid_ric_no_grnt_pl = NULL; + } +} + +template +bool Point_location_test::allocate_arrangement() +{ + if (!(m_arr = new Arrangement_2())) return false; + return true; +} + +template +void Point_location_test::deallocate_arrangement() +{ + if (m_arr) { + delete m_arr; + m_arr = NULL; + } +} + +template +bool Point_location_test::construct_arrangement() +{ + // Insert all into the arrangement + CGAL::insert(*m_arr, this->m_xcurves.begin(), this->m_xcurves.end()); + // insert(*m_arr, m_points.begin(), m_points.end()); + CGAL::insert(*m_arr, this->m_curves.begin(), this->m_curves.end()); + + // Print the size of the arrangement. + std::cout << "V = " << m_arr->number_of_vertices() + << ", E = " << m_arr->number_of_edges() + << ", F = " << m_arr->number_of_faces() << std::endl; + + return true; +} + +template +void Point_location_test::clear_arrangement() +{ + if (m_arr) m_arr->clear(); +} + +template +bool Point_location_test::allocate_pl_strategies() +{ + // Allocate all point location strategies. + if (!(m_naive_pl = new Naive_point_location())) return false; + if (!(m_simple_pl = new Simple_point_location())) return false; + if (!(m_walk_pl = new Walk_point_location())) return false; + +#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS) + + if (!(m_lm_pl = new Lm_point_location())) return false; + if (!(m_random_lm_pl = new Lm_random_point_location())) return false; + if (!(m_grid_lm_pl = new Lm_grid_point_location())) return false; + if (!(m_halton_lm_pl = new Lm_halton_point_location())) return false; + if (!(m_middle_edges_lm_pl = new Lm_middle_edges_point_location())) + return false; + if (!(m_specified_points_lm_pl = new Lm_specified_points_point_location())) + return false; + + // if (!(m_triangulation_pl = new Triangulation_point_location())) + // return false; + +#endif + + if (!(m_trapezoid_ric_pl = new Trapezoid_ric_point_location())) return false; + if (!(m_trapezoid_ric_no_grnt_pl = new Trapezoid_ric_point_location())) + return false; + + // ===> Add new point location instance here. <=== + return true; +} + +template +bool Point_location_test::construct_pl_strategies() +{ + typedef T_Traits Traits; + + // Initialize all point location strategies. + CGAL::Timer timer; + + m_naive_pl = new Naive_point_location(*m_arr); // 0 + m_simple_pl = new Simple_point_location(*m_arr); // 1 + m_walk_pl = new Walk_point_location(*m_arr); // 2 + +#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS) + + timer.reset(); timer.start(); + m_lm_pl = new Lm_point_location(*m_arr); // 3 + timer.stop(); + std::cout << "Lm (vert) construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_random_g = new Random_lm_generator(*m_arr); + m_random_lm_pl = new Lm_random_point_location(*m_arr, m_random_g); // 4 + timer.stop(); + std::cout << "Random lm construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_grid_g = new Grid_lm_generator(*m_arr); + m_grid_lm_pl = new Lm_grid_point_location(*m_arr, m_grid_g); // 5 + timer.stop(); + std::cout << "Grid lm construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_halton_g = new Halton_lm_generator(*m_arr); + m_halton_lm_pl = new Lm_halton_point_location(*m_arr, m_halton_g); // 6 + timer.stop(); + std::cout << "Halton lm construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_middle_edges_g = new Middle_edges_generator(*m_arr); + m_middle_edges_lm_pl = + new Lm_middle_edges_point_location(*m_arr, m_middle_edges_g); // 7 + timer.stop(); + std::cout << "Middle edges lm construction took " << timer.time() + << std::endl; + + timer.reset(); timer.start(); + m_specified_points_g = new Specified_points_generator(*m_arr); + m_specified_points_lm_pl = + new Lm_specified_points_point_location(*m_arr, m_specified_points_g); // 8 + timer.stop(); + std::cout << "Specified_points lm construction took " + << timer.time() << std::endl; + + // timer.reset(); timer.start(); + // m_triangulation_pl = new Triangulation_point_location(*m_arr); // 9 + // timer.stop(); + // std::cout << "Triangulation lm construction took " + // << timer.time() << std::endl; + +#endif + + timer.reset(); timer.start(); + m_trapezoid_ric_pl = new Trapezoid_ric_point_location(*m_arr); // 10 + timer.stop(); + std::cout << "Trapezoid RIC construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_trapezoid_ric_no_grnt_pl = + new Trapezoid_ric_point_location(*m_arr, false); // 11 + timer.stop(); + std::cout << "Trapezoid RIC without-guarantees construction took " + << timer.time() << std::endl; + + std::cout << std::endl; + + // ===> Add new point location instance here. <=== + return true; +} + +template +bool Point_location_test::attach_pl_strategies() +{ + typedef T_Traits Traits; + + // Initialize all point location strategies. + CGAL::Timer timer; + + m_naive_pl->attach(*m_arr); + m_simple_pl->attach(*m_arr); + m_walk_pl->attach(*m_arr); + +#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS) + + timer.reset(); timer.start(); + m_lm_pl->attach(*m_arr); + timer.stop(); + std::cout << "Lm (vert) construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_random_g = new Random_lm_generator(*m_arr); + m_random_lm_pl->attach(*m_arr, m_random_g); + timer.stop(); + std::cout << "Random lm construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_grid_g = new Grid_lm_generator(*m_arr); + m_grid_lm_pl->attach(*m_arr, m_grid_g); + timer.stop(); + std::cout << "Grid lm construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_halton_g = new Halton_lm_generator(*m_arr); + m_halton_lm_pl->attach(*m_arr, m_halton_g); + timer.stop(); + std::cout << "Halton lm construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_middle_edges_g = new Middle_edges_generator(*m_arr); + m_middle_edges_lm_pl->attach(*m_arr, m_middle_edges_g); + timer.stop(); + std::cout << "Middle edges lm construction took " << timer.time() + << std::endl; + + timer.reset(); timer.start(); + m_specified_points_g = new Specified_points_generator(*m_arr); + m_specified_points_lm_pl->attach(*m_arr, m_specified_points_g); + timer.stop(); + std::cout << "Specified_points lm construction took " + << timer.time() << std::endl; + + // timer.reset(); timer.start(); + // m_location triangulation_lm_pl->attach(*m_arr); + // timer.stop(); + // std::cout << "Triangulation lm construction took " + // << timer.time() << std::endl; + +#endif + + timer.reset(); timer.start(); + m_trapezoid_ric_pl->attach(*m_arr); + timer.stop(); + std::cout << "Trapezoid RIC construction took " << timer.time() << std::endl; + + timer.reset(); timer.start(); + m_trapezoid_ric_no_grnt_pl->with_guarantees(false); + m_trapezoid_ric_no_grnt_pl->attach(*m_arr); + + timer.stop(); + std::cout << "Trapezoid RIC without-guarantees construction took " + << timer.time() << std::endl; + + std::cout << std::endl; + + // ===> Add new point location instance here. <=== + return true; +} + +// Perform the test +template +bool Point_location_test::perform() +{ + Objects_vector objs[MAX_NUM_POINT_LOCATION_STRATEGIES]; + typename Arrangement_2::Vertex_const_handle vh_ref, vh_curr; + typename Arrangement_2::Halfedge_const_handle hh_ref, hh_curr; + typename Arrangement_2::Face_const_handle fh_ref, fh_curr; + + // Locate the points in the list using all point location strategies. + + // std::cout << "Time in seconds" << std::endl; + std::cout << std::endl; + + unsigned int pl_index = 0; + + query(*m_naive_pl, "Naive", m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Naive + + query(*m_simple_pl, "Simple", m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Simple + + query(*m_walk_pl, "Walk", m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Walk + +#if (TEST_TRAITS == SEGMENT_TRAITS) || (TEST_TRAITS == LINEAR_TRAITS) + + query(*m_lm_pl, "Landmarks (vertices)", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Landmarks (vertices) + + query(*m_random_lm_pl, "Landmarks random", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Landmarks random + + query(*m_grid_lm_pl, "Landmarks grid", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Landmarks grid + + query(*m_halton_lm_pl, "Landmarks Halton", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Landmarks Halton + + query(*m_middle_edges_lm_pl, "Landmarks middle edges", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Landmarks middle edges + + query(*m_specified_points_lm_pl, "Landmarks specified points", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Landmarks specified points + + // Triangulation + // query(*m_triangulation_pl, "Triangulation", + // m_query_points.begin(), m_query_points.end(), + // std::back_inserter(objs[pl_index++])); // Triangulation + +#endif + + query(*m_trapezoid_ric_pl, "Trapezoidal RIC", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); // Trapezoidal RIC + + // Trapezoidal RIC without guarantees + query(*m_trapezoid_ric_no_grnt_pl, "Trapezoidal RIC without guarantees", + m_query_points.begin(), m_query_points.end(), + std::back_inserter(objs[pl_index++])); + + std::cout << std::endl; + + // ===> Add a call to operate the new point location. <=== + + // Number of point location strategies used. + unsigned int pls_num = pl_index; + std::cout << "Number of strategies is " << pls_num << std::endl; + + // End Location + + int result = 0; + + //init all obejct iterators + Object_iterator ob_iter[MAX_NUM_POINT_LOCATION_STRATEGIES]; + for (pl_index = 0; pl_index < pls_num; ++pl_index) + ob_iter[pl_index] = objs[pl_index].begin(); + + // get size of objects + unsigned int size = objs[0].size(); + std::cout << "size is " << size << std::endl; + + for (pl_index = 0; pl_index < pls_num; ++pl_index) { + if (size != objs[pl_index].size()) { + std::cout << "Error: size of pl number " << pl_index << " is " + << objs[pl_index].size() << std::endl; + result = -1; + } + } + + // Assign and check results + unsigned int qi; //qi is the query point index + for (qi = 0; qi < size; ++qi) { + // Assign object to a face + if (CGAL::assign(fh_ref, ob_iter[0][qi])) { + for (unsigned int pl_index = 1; pl_index < pls_num; ++pl_index) { + if (! CGAL::assign(fh_curr, ob_iter[pl_index][qi])) { + std::cout << "Error in point location number " << pl_index; + if (CGAL::assign(fh_curr, ob_iter[pl_index][qi])) { + std::cout << ", an halfedge returned instead of a face" + << std::endl; + } + else if (CGAL::assign(hh_curr, ob_iter[pl_index][qi])) { + std::cout << ", a vertex returned instead of a face" + << std::endl; + } + else { + std::cout << ", an unknowen object returned instead of a face" + << std::endl; + } + result = -1; + } + else if (fh_curr != fh_ref) { + std::cout << "Error: point location number " + << pl_index << " return a different face" << std::endl; + result = -1; + } + } + //if (fh_ref->is_unbounded()) + // std::cout << "Unbounded face." << std::endl; + //else + // std::cout << "Face." << std::endl; + } + + // Assign object to a halfedge + else if (CGAL::assign (hh_ref, ob_iter[0][qi])) { + std::cout << "Halfedge: " << hh_ref->curve() << std::endl; + for (unsigned int pl_index = 1; pl_index < pls_num; ++pl_index) { + if (! CGAL::assign(hh_curr, ob_iter[pl_index][qi])) { + std::cout << "Error in point location number " << pl_index; + if (CGAL::assign(fh_curr, ob_iter[pl_index][qi])) { + std::cout << ", a face returned instead of an halfedge" + << std::endl; + } + else if (CGAL::assign(hh_curr, ob_iter[pl_index][qi])) { + std::cout << ", a vertex returned instead of an halfedge" + << std::endl; + } + else { + std::cout << ", an unknowen object returned instead of an halfedge" + << std::endl; + } + result = -1; + } + else if ((hh_curr != hh_ref) && (hh_curr->twin() != hh_ref)) { + std::cout << "Error: point location number " + << pl_index << " return a different halfedge" << std::endl; + std::cout << "Halfedge (curr): " << hh_curr->curve() << std::endl; + result = -1; + } + } + } + + // Assign object to a vertex + else if (CGAL::assign(vh_ref, ob_iter[0][qi])) { + for (unsigned int pl_index = 1; pl_index < pls_num; ++pl_index) { + if (! CGAL::assign(vh_curr, ob_iter[pl_index][qi])) { + std::cout << "Error in point location number " << pl_index; + if (CGAL::assign(fh_curr, ob_iter[pl_index][qi])) { + std::cout << ", a face returned instead of a vertex"<< std::endl; + } + else if (CGAL::assign(hh_curr, ob_iter[pl_index][qi])) { + std::cout << ", an halfedge returned instead of a vertex" + << std::endl; + } + else { + std::cout << ", an unknown object returned instead of a vertex" + << std::endl; + } + result = -1; + } + else if (vh_curr != vh_ref) { + std::cout << "Error: point location number " + << pl_index << " return a different vertex"<< std::endl; + result = -1; + } + } + std::cout << "Vertex: "<< vh_ref->point() << std::endl; + } + + else { + std::cout << "Illegal point-location result." << std::endl; + result = -1; + } + } + return (result == 0); +} + +#endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h index e4606b1f795..cf8a81bd108 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Segment_reader.h @@ -8,11 +8,8 @@ #include template -class Segment_reader -{ - +class Segment_reader { public: - typedef typename Traits::Kernel Kernel; typedef typename Kernel::FT NT; typedef typename Traits::Point_2 Point_2; @@ -20,8 +17,8 @@ public: typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; template - int read_data(const char * filename, OutputIterator curves_out, - CGAL::Bbox_2 & bbox) + int read_data(const char* filename, OutputIterator curves_out, + CGAL::Bbox_2& bbox) { std::ifstream inp(filename); if (!inp.is_open()) { @@ -35,8 +32,7 @@ public: NT x1, y1, x2, y2; int i; - for (i = 0; i < count; i++) - { + for (i = 0; i < count; i++) { inp >> x1 >> y1 >> x2 >> y2; //std::cout << "x1 ="< +template class Traits_adaptor_test : public Traits_base_test { private: /*! A map between (strings) commands and (member functions) operations */ typedef bool (Traits_adaptor_test::* Wrapper)(std::istringstream &); - typedef std::map Wrapper_map; - typedef typename Wrapper_map::iterator Wrapper_iter; + typedef std::map Wrapper_map; + typedef typename Wrapper_map::iterator Wrapper_iter; Wrapper_map m_wrappers; virtual bool exec(std::istringstream & str_stream, @@ -49,7 +49,7 @@ private: public: /*! Constructor */ - Traits_adaptor_test(int argc, char * argv[]); + Traits_adaptor_test(); /*! Destructor */ virtual ~Traits_adaptor_test(); @@ -59,9 +59,8 @@ public: * Constructor. * Accepts test data file name. */ -template -Traits_adaptor_test::Traits_adaptor_test(int argc, char * argv[]) : - Traits_base_test(argc, argv) +template +Traits_adaptor_test::Traits_adaptor_test() { typedef T_Traits Traits; @@ -85,10 +84,10 @@ Traits_adaptor_test::Traits_adaptor_test(int argc, char * argv[]) : * Destructor. * Declares as virtual. */ -template +template Traits_adaptor_test::~Traits_adaptor_test() {} -template +template bool Traits_adaptor_test:: ta_compare_y_at_x_left_wrapper(std::istringstream & str_stream) { @@ -96,15 +95,15 @@ ta_compare_y_at_x_left_wrapper(std::istringstream & str_stream) return ta_compare_y_at_x_left_wrapper_imp(str_stream, Has_left_category()); } -template +template bool Traits_adaptor_test:: -ta_compare_y_at_x_left_wrapper_imp (std::istringstream &, CGAL::Tag_false) +ta_compare_y_at_x_left_wrapper_imp(std::istringstream &, CGAL::Tag_false) { CGAL_error(); return false; } -template +template bool Traits_adaptor_test:: ta_compare_y_at_x_left_wrapper_imp(std::istringstream & str_stream, @@ -124,7 +123,7 @@ ta_compare_y_at_x_left_wrapper_imp(std::istringstream & str_stream, return this->compare(exp_answer, real_answer); } -template +template bool Traits_adaptor_test:: ta_is_in_x_range_wrapper(std::istringstream & str_stream) { @@ -149,7 +148,7 @@ ta_is_in_x_range_wrapper(std::istringstream & str_stream) return this->compare(exp_answer, real_answer); } -template +template bool Traits_adaptor_test:: ta_compare_y_position_wrapper(std::istringstream & str_stream) { @@ -165,7 +164,7 @@ ta_compare_y_position_wrapper(std::istringstream & str_stream) return this->compare(exp_answer, real_answer); } -template +template bool Traits_adaptor_test:: ta_is_between_cw_wrapper(std::istringstream & str_stream) { @@ -192,7 +191,7 @@ ta_is_between_cw_wrapper(std::istringstream & str_stream) return this->compare(exp_answer, real_answer); } -template +template bool Traits_adaptor_test:: ta_compare_cw_around_point_wrapper(std::istringstream & str_stream) { @@ -218,7 +217,7 @@ ta_compare_cw_around_point_wrapper(std::istringstream & str_stream) return this->compare(exp_answer, real_answer); } -template +template bool Traits_adaptor_test:: ta_are_mergeable_wrapper(std::istringstream & str_stream) { @@ -226,7 +225,7 @@ ta_are_mergeable_wrapper(std::istringstream & str_stream) return ta_are_mergeable_wrapper_imp(str_stream, Has_merge_category()); } -template +template bool Traits_adaptor_test:: ta_are_mergeable_wrapper_imp(std::istringstream &, CGAL::Tag_false) @@ -235,7 +234,7 @@ ta_are_mergeable_wrapper_imp(std::istringstream &, CGAL::Tag_false) return false; } -template +template bool Traits_adaptor_test:: ta_are_mergeable_wrapper_imp (std::istringstream & str_stream, CGAL::Tag_true) { @@ -251,7 +250,7 @@ ta_are_mergeable_wrapper_imp (std::istringstream & str_stream, CGAL::Tag_true) return this->compare(exp_answer, real_answer); } -template +template bool Traits_adaptor_test::ta_merge_wrapper (std::istringstream & str_stream) { @@ -259,19 +258,19 @@ bool Traits_adaptor_test::ta_merge_wrapper return ta_merge_wrapper_imp(str_stream, Has_merge_category()); } -template +template bool Traits_adaptor_test:: -ta_merge_wrapper_imp (std::istringstream &, CGAL::Tag_false) +ta_merge_wrapper_imp(std::istringstream &, CGAL::Tag_false) { CGAL_error(); return false; } -template +template bool Traits_adaptor_test:: -ta_merge_wrapper_imp (std::istringstream & str_stream, CGAL::Tag_true) +ta_merge_wrapper_imp(std::istringstream & str_stream, CGAL::Tag_true) { typedef T_Traits Traits; typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h index 2b5d0ea3a8d..44c4efab1b2 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_base_test.h @@ -16,6 +16,9 @@ #include #include #include +#include + +#include "IO_test.h" /* The test test_traits has a global configuration flag, abort_on_error. * It determines what happens when an unexpected CGAL assertion, pre-condition, @@ -46,14 +49,20 @@ * --------------------------------------------------------------------------- */ -template -class Traits_base_test { +template +class Traits_base_test : public IO_test { protected: typedef T_Traits Traits; - typedef typename Traits::Point_2 Point_2; - typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; - typedef typename Traits::Curve_2 Curve_2; + typedef IO_test Base; + typedef typename Base::Point_2 Point_2; + typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Base::Curve_2 Curve_2; + + typedef typename Base::Points_vector Points_vector; + typedef typename Base::Xcurves_vector Xcurves_vector; + typedef typename Base::Curves_vector Curves_vector; + enum Exception_type {EXPECTED_CONTINUE, EXPECTED_ABORT, UNEXPECTED_CONTINUE, @@ -64,40 +73,14 @@ protected: ASSERTION, WARNING}; - enum Read_object_type {POINT, CURVE, XCURVE}; - enum Enum_type {NUMBER, SIGN, CURVE_END, BOUNDARY, PARAMETER_SPACE}; - /*! The input data file of points*/ - std::string m_filename_points; - - /*! The input data file of curves*/ - std::string m_filename_curves; - - /*! The input data file of xcurves*/ - std::string m_filename_xcurves; - /*! The input data file of commands*/ std::string m_filename_commands; /*! The traits type */ std::string m_traitstype; - /*! An instance of the traits */ - Traits m_traits; - - /*! The container of input points */ - std::vector m_points; - - /*! The container of input curves */ - std::vector m_curves; - - /*! The container of x-monotone curves */ - std::vector m_xcurves; - - /*! Indicates whether the end-of-line has been printed */ - bool m_eol_printed; - /*! Indicates whether abort after the first failure or to continue */ bool m_abort_on_error; @@ -110,23 +93,12 @@ protected: //indicates if precondition or postcondition or //assertion or warning violation is tested Violation_type m_violation_tested; - - /*! Collect the data depending on obj_t */ - bool read_input(std::ifstream& is, Read_object_type obj_t); /*! Execute a command */ virtual bool exec(std::istringstream& str_stream, const std::string& str_command, bool& result) = 0; - /*! Perform the test */ - bool perform(std::ifstream& is); - - /*! Skip comments */ - void skip_comments(std::ifstream& is, char* one_line); - - std::string remove_blanks(char* str); - bool get_expected_boolean(std::istringstream& str_stream); unsigned int get_expected_enum(std::istringstream& str_stream); @@ -143,56 +115,17 @@ protected: /*! Print curve-end string */ const char* curve_end_str(CGAL::Arr_curve_end cv_end) const - { - return (cv_end == CGAL::ARR_MIN_END) ? "MIN_END" : "MAX_END"; - } + { return (cv_end == CGAL::ARR_MIN_END) ? "MIN_END" : "MAX_END"; } - /*! Print an error message */ - void print_error(const std::string& msg) - { - std::cerr << "Error: " << msg.c_str() << std::endl; - } - - /*! Print the end-of-line */ - void print_eol() - { - std::cout << std::endl; - m_eol_printed = true; - } - - /*! Print information */ - void print_info(std::string& info, - bool start_line = true, bool end_line = true) - { - if (start_line && !m_eol_printed) print_eol(); - std::cout << info.c_str(); - if (end_line) print_eol(); - } - - /*! Print final results */ - void print_result(bool result) - { - std::string result_str((result) ? "Passed" : "Failed"); - print_info(result_str, false); - } - - /*! Print expected answer and real answer */ - void print_answer(const std::string& exp, const std::string& real, - const std::string& str) - { - print_info(std::string("Expected ").append(str).append(": ").append(exp)); - print_info(std::string("Obtained ").append(str).append(": ").append(real)); - } - /*! Compare two points */ bool compare_points(const Point_2& exp_answer, const Point_2& real_answer) { - typename Traits::Equal_2 equal = m_traits.equal_2_object(); + typename Traits::Equal_2 equal = this->m_traits.equal_2_object(); if (equal(exp_answer, real_answer)) return true; std::string exp_answer_str = boost::lexical_cast(exp_answer); std::string real_answer_str = boost::lexical_cast(real_answer); - print_answer(exp_answer_str, real_answer_str, "point"); + this->print_answer(exp_answer_str, real_answer_str, "point"); return false; } @@ -200,12 +133,12 @@ protected: bool compare_curves(const X_monotone_curve_2& exp_answer, const X_monotone_curve_2& real_answer) { - typename Traits::Equal_2 equal = m_traits.equal_2_object(); + typename Traits::Equal_2 equal = this->m_traits.equal_2_object(); if (equal(exp_answer, real_answer)) return true; std::string exp_answer_str = boost::lexical_cast(exp_answer); std::string real_answer_str = boost::lexical_cast(real_answer); - print_answer(exp_answer_str, real_answer_str, "x-monotone curve"); + this->print_answer(exp_answer_str, real_answer_str, "x-monotone curve"); return false; } @@ -217,197 +150,25 @@ protected: if (exp_answer == real_answer) return true; std::string exp_answer_str = boost::lexical_cast(exp_answer); std::string real_answer_str = boost::lexical_cast(real_answer); - print_answer(exp_answer_str, real_answer_str, str); + this->print_answer(exp_answer_str, real_answer_str, str); return false; } - template - bool read_point(stream& is, Point_2&); - - template - bool read_xcurve(stream& is, X_monotone_curve_2&); - - template - bool read_curve(stream& is, Curve_2&); - - //@{ - - /*! Test Compare_x_2 - */ - bool compare_x_wrapper(std::istringstream& ); - - /*! Test Compare_x_near_limit_2 - */ - bool compare_x_near_limit_wrapper(std::istringstream& ); - bool compare_x_near_limit_wrapper_imp(std::istringstream&, - CGAL::Arr_use_dummy_tag); - bool compare_x_near_limit_wrapper_imp(std::istringstream&, - CGAL::Arr_use_traits_tag); - - /*! Test Compare_x_at_limit_2 - */ - bool compare_x_at_limit_wrapper(std::istringstream& ); - bool compare_x_at_limit_wrapper_imp(std::istringstream&, - CGAL::Arr_use_dummy_tag); - bool compare_x_at_limit_wrapper_imp(std::istringstream&, - CGAL::Arr_use_traits_tag); - - /*! Test Compare_x_near_boundary_2 - */ - bool compare_x_near_boundary_wrapper(std::istringstream& ); - bool compare_x_near_boundary_wrapper_imp(std::istringstream&, - CGAL::Arr_use_dummy_tag); - bool compare_x_near_boundary_wrapper_imp(std::istringstream&, - CGAL::Arr_use_traits_tag); - - /*! Test Compare_x_on_boundary_2 - */ - bool compare_x_on_boundary_wrapper(std::istringstream& ); - bool compare_x_on_boundary_wrapper_imp(std::istringstream&, - CGAL::Arr_use_dummy_tag); - bool compare_x_on_boundary_wrapper_imp(std::istringstream&, - CGAL::Arr_use_traits_tag); - - /*! Test Compare_y_near_boundary_2 - */ - bool compare_y_near_boundary_wrapper(std::istringstream& ); - bool compare_y_near_boundary_wrapper_imp(std::istringstream&, - CGAL::Arr_use_dummy_tag); - bool compare_y_near_boundary_wrapper_imp(std::istringstream&, - CGAL::Arr_use_traits_tag); - - /*! Test Parameter_space_in_x_2 - */ - bool parameter_space_in_x_wrapper(std::istringstream& ); - bool parameter_space_in_x_wrapper_imp(std::istringstream&, - CGAL::Arr_use_dummy_tag); - bool parameter_space_in_x_wrapper_imp(std::istringstream&, - CGAL::Arr_use_traits_tag); - - /*! Test Parameter_space_in_y_2 - */ - bool parameter_space_in_y_wrapper(std::istringstream& ); - bool parameter_space_in_y_wrapper_imp(std::istringstream&, - CGAL::Arr_use_dummy_tag); - bool parameter_space_in_y_wrapper_imp(std::istringstream&, - CGAL::Arr_use_traits_tag); - - /*! Compare_xy_2 - */ - bool compare_xy_wrapper(std::istringstream& line); - - /*! Tests Construct_min_vertex_2. - * Degenerate case: vertical curve. - */ - bool min_vertex_wrapper(std::istringstream& line); - - /*! Tests Construct_max_vertex_2. - * Degenerate case: vertical curve. - */ - bool max_vertex_wrapper(std::istringstream& line); - - bool is_vertical_wrapper(std::istringstream& line); - - /*! Tests Compare_y_at_x_2. - * Return the location of the given point with respect to the input curve. - * Degenerate cases: The point is an endpoint of the curve. - * The curve is vertical. - */ - bool compare_y_at_x_wrapper(std::istringstream& line); - - /*! Tests Compare_y_at_x_left_2. - * Compare the y value of two x-monotone curves immediately to the left - * (resp. right) of their intersection point. - * Degenerate cases: The curves coincide. - * The curves coincide and vertical. - * One of the curves is vertical. - */ - bool compare_y_at_x_left_wrapper(std::istringstream& line); - bool compare_y_at_x_left_wrapper_imp(std::istringstream& line, - CGAL::Tag_false); - bool compare_y_at_x_left_wrapper_imp(std::istringstream& line, - CGAL::Tag_true); - - /*! Tests Compare_y_at_x_right_2. - * Compare the y value of two x-monotone curves immediately to the right - * (resp. right) of their intersection point. - * Degenerate cases: The curves coincide. - * The curves coincide and vertical. - * One of the curves is vertical. - */ - bool compare_y_at_x_right_wrapper(std::istringstream& line); - - /*! Tests Equal_2::operator()(Point_2, Point_2). - * Check whether two points are the same. - */ - bool equal_points_wrapper(std::istringstream& line); - - /*! Tests Equal_2::operator()(X_monotone_curve_2, X_monotone_curve_2). - * Check whether two x-monotone curves are the same. - */ - bool equal_curves_wrapper(std::istringstream& line); - - /*! Tests Make_x_monotone_2. - * Cut the given curve into x-monotone subcurves and insert them into the - * given output iterator. - * Degenerate cases for polylines: The first segment is vertical. The last - * segment is vertical. Both firt and last are vertical. An internal segment - * is vertical. - */ - bool make_x_monotone_wrapper(std::istringstream& line); - - /*! Tests Intersect_2. - * Find the intersections of the two given curves and insert them into the - * given output iterator. - * Degenerate cases for polylines: The most right (resp. left) endpoints of - * the two curves coincide. Both endpoints coincide. The most right (resp. - * left) endpoint of one curve and the first (resp. last) segment of the - * other coincide. - */ - bool intersect_wrapper(std::istringstream& line); - - /*! Tests Split_2. - * Split a given x-monotone curve at a given point into two sub-curves. - * Degenerate cases for polylines: the point and a polyline internal point - * coincides. - */ - bool split_wrapper(std::istringstream& line); - - /*! Tests Are_mergeable_2. - * Check whether it is possible to merge two given x-monotone curves. - */ - bool are_mergeable_wrapper(std::istringstream& line); - bool are_mergeable_wrapper_imp(std::istringstream& line, CGAL::Tag_false); - bool are_mergeable_wrapper_imp(std::istringstream& line, CGAL::Tag_true); - - /*! Tests Merge_2. - * Merge two given x-monotone curves into a single curve. - */ - bool merge_wrapper(std::istringstream& line); - bool merge_wrapper_imp(std::istringstream& line, CGAL::Tag_false); - bool merge_wrapper_imp(std::istringstream& line, CGAL::Tag_true); - - /*! Tests Approximate_2. - * Return an approximation of a point coordinate. - */ - bool approximate_wrapper(std::istringstream& line); - - /*! tests Construct_x_monotone_curve_2. - * Return an x-monotone curve connecting the two given endpoints. - */ - bool construct_x_monotone_curve_wrapper(std::istringstream& line); - - //@} - public: /*! Constructor */ - Traits_base_test(int argc, char* argv[]); + Traits_base_test(); /*! Destructor */ virtual ~Traits_base_test(); - /*! Entry point */ - bool start(); + /*! Parse the command line */ + virtual bool parse(int argc, char* argv[]); + + /*! Perform the test */ + virtual bool perform(); + + /*! Clear the data structures */ + virtual void clear(); }; /*! @@ -415,155 +176,74 @@ public: * Accepts test data file name. */ template -Traits_base_test::Traits_base_test(int argc, char* argv[]) : - m_eol_printed(true), +Traits_base_test::Traits_base_test() : m_abort_on_error(false) // run all tests { - if (argc != 6) { - print_info(std::string("Usage: ").append(argv[0]). - append(" points_file xcurves_file curves_file commands_file traits_type_name")); - return; - } - - typedef T_Traits Traits; m_violation_map[PRECONDITION] = std::string("precondition"); m_violation_map[POSTCONDITION] = std::string("postcondition"); m_violation_map[ASSERTION] = std::string("assertion"); m_violation_map[WARNING] = std::string("warning"); - - m_filename_points = argv[1]; - m_filename_xcurves = argv[2]; - m_filename_curves = argv[3]; - m_filename_commands = argv[4]; - m_traitstype = argv[5]; } /*! * Destructor. */ template -Traits_base_test::~Traits_base_test() -{ - m_filename_points.clear(); - m_filename_xcurves.clear(); - m_filename_curves.clear(); - m_filename_commands.clear(); - m_points.clear(); - m_curves.clear(); - m_xcurves.clear(); -} - -/*! - * Test entry point - */ -template -bool Traits_base_test::start() -{ - std::ifstream in_pt(m_filename_points.c_str()); - std::ifstream in_xcv(m_filename_xcurves.c_str()); - std::ifstream in_cv(m_filename_curves.c_str()); - std::ifstream in_com(m_filename_commands.c_str()); - if (!in_pt.is_open()) { - print_error(std::string("cannot open file ").append(m_filename_points)); - return false; - } - if (!in_xcv.is_open()) { - print_error(std::string("cannot open file ").append(m_filename_xcurves)); - return false; - } - if (!in_cv.is_open()) { - print_error(std::string("cannot open file ").append(m_filename_curves)); - return false; - } - if (!in_com.is_open()) { - print_error(std::string("cannot open file ").append(m_filename_commands)); - return false; - } - if (!read_input(in_pt, POINT)) { - in_pt.close(); - return false; - } - if (!read_input(in_xcv, XCURVE)) { - in_xcv.close(); - return false; - } - if (!read_input(in_cv,CURVE)) { - in_cv.close(); - return false; - } - if (!perform(in_com)) { - in_com.close(); - return false; - } - return true; -} +Traits_base_test::~Traits_base_test() { clear(); } template -bool Traits_base_test::read_input(std::ifstream& is, - Read_object_type obj_t) +bool Traits_base_test::parse(int argc, char* argv[]) { - char one_line[1024]; - skip_comments(is, one_line); - std::istringstream str_stream(one_line, std::istringstream::in); - try { - for (int i = 0; !is.eof() ; ++i) { - switch (obj_t) { - case POINT : - m_points.resize(m_points.size()+1); - if (!read_point(str_stream, m_points[i])) { - print_error(std::string("failed to read point!")); - return false; - } - break; - case CURVE : - m_curves.resize(m_curves.size()+1); - if (!read_curve(str_stream, m_curves[i])) { - print_error(std::string("failed to read curve!")); - return false; - } - break; - case XCURVE : - m_xcurves.resize(m_xcurves.size()+1); - if (!read_xcurve(str_stream, m_xcurves[i])) { - print_error(std::string("failed to read xcurve!")); - return false; - } - break; - } - str_stream.clear(); - skip_comments(is, one_line); - str_stream.str(one_line); - } - } - catch (std::exception e) { - print_error(std::string("exception!")); - is.close(); + Base::parse(argc, argv); + + if (argc != 6) { + this->print_info(std::string("Usage: ").append(argv[0]). + append(" points_file xcurves_file curves_file commands_file traits_type_name")); return false; } + + m_filename_commands.assign(argv[4]); + m_traitstype.assign(argv[5]); + return true; } +/*! Clear the data structures */ +template +void Traits_base_test::clear() +{ + Base::clear(); + m_filename_commands.clear(); +} + /*! * Command dispatcher. Retrieves a line from the input file and performes * some action. See comments for suitable function in order to know specific * command arguments. */ template -bool Traits_base_test::perform(std::ifstream& is) +bool Traits_base_test::perform() { + std::ifstream is(m_filename_commands.c_str()); + if (!is.is_open()) { + this->print_error(std::string("cannot open file ").append(m_filename_commands)); + return false; + } + bool test_result = true; - std::cout << "Performing test : traits type is " << m_traitstype - << ", input files are " << m_filename_points << " " - << m_filename_xcurves << " " << m_filename_curves << " " + std::cout << "Performing test: traits type is " << m_traitstype + << ", input files are " + << this->m_filename_points << " " + << this->m_filename_xcurves << " " + << this->m_filename_curves << " " << m_filename_commands << std::endl; - m_eol_printed = true; - char one_line[1024]; + this->m_eol_printed = true; + std::string line; char buff[1024]; - bool abort = false; + // bool abort = false; int counter = 0; - while (!(is.eof() || abort)) { - skip_comments(is, one_line); - std::istringstream str_stream(one_line, std::istringstream::in); + while (this->skip_comments(is, line)) { + std::istringstream str_stream(line, std::istringstream::in); buff[0] = '\0'; str_stream.getline(buff, 1024, ' '); std::string str_command(buff); @@ -609,78 +289,41 @@ bool Traits_base_test::perform(std::ifstream& is) { //violation is expected but it did not occur result = false; - if (m_abort_on_error) abort = true; + // if (m_abort_on_error) abort = true; } - print_result(result); + this->print_result(result); test_result &= result; } catch (CGAL::Precondition_exception /* e */) { if (m_violation_tested != PRECONDITION) { test_result = false; - if (m_abort_on_error) abort = true; + // if (m_abort_on_error) abort = true; } } catch (CGAL::Postcondition_exception /* e */) { if (m_violation_tested != POSTCONDITION) { test_result = false; - if (m_abort_on_error) abort = true; + // if (m_abort_on_error) abort = true; } } catch (CGAL::Warning_exception /* e */) { if (m_violation_tested != WARNING) { test_result = false; - if (m_abort_on_error) abort = true; + // if (m_abort_on_error) abort = true; } } catch (CGAL::Assertion_exception /* e */) { if (m_violation_tested != ASSERTION) { test_result = false; - if (m_abort_on_error) abort = true; + // if (m_abort_on_error) abort = true; } } } + + is.close(); return test_result; } -/*! - * Skip comments. Comments start with the '#' character and extend to the - * end of the line - */ -template -void Traits_base_test::skip_comments(std::ifstream& is, - char* one_line) -{ - while (!is.eof()) { - is.getline(one_line, 1024); - if (one_line[0] != '#') break; - } -} - -/*! - */ -template -std::string Traits_base_test::remove_blanks(char* str) -{ - std::string result = ""; - bool flag = false; - //only alphanumeric characters and underscores are allowed - for (; *str != '\0'; ++str) - { - if ((*str >= '0' && *str <= '9') || //digits - (*str >= 'A' && *str <= 'Z') || //upper case letters - (*str >= 'a' && *str <= 'z') || //lower case letters - *str == '_') //underscores - { - if (!flag) - flag=true; - result += *str; - } - if (*str == ' ' && flag) - break; - } - return result; -} - /*! */ template @@ -760,7 +403,7 @@ get_expected_boolean(std::istringstream& str_stream) char buff[1024]; str_stream.getline( buff, 1024, '.'); buff[str_stream.gcount()] = '\0'; - std::string str_expres = remove_blanks(buff); + std::string str_expres = this->remove_blanks(buff); return translate_boolean(str_expres); } @@ -773,7 +416,7 @@ Traits_base_test::get_expected_enum(std::istringstream& str_stream) char buff[1024]; str_stream.getline(buff, 1024, '.'); buff[str_stream.gcount()] = '\0'; - std::string str_expres = remove_blanks(buff); + std::string str_expres = this->remove_blanks(buff); return translate_enumerator(str_expres); } @@ -788,1363 +431,8 @@ Traits_base_test::get_next_input(std::istringstream& str_stream) str_stream.getline(buff, 1024, ' '); } while (str_stream.gcount() == 1); buff[str_stream.gcount()] = '\0'; - std::string str_expres = remove_blanks(buff); + std::string str_expres = this->remove_blanks(buff); return translate_int_or_text(str_expres); } -template -template -bool Traits_base_test:: -read_point(stream& is, typename T_Traits::Point_2& p) -{ - Basic_number_type x, y; - is >> x >> y; - p = typename T_Traits::Point_2(x, y); - return true; -} - -template -template -bool Traits_base_test:: -read_xcurve(stream& is, typename T_Traits::X_monotone_curve_2& xcv) -{ - Basic_number_type x1, y1, x2, y2; - is >> x1 >> y1 >> x2 >> y2; - Point_2 p1(x1, y1); - Point_2 p2(x2, y2); - CGAL_assertion(p1 != p2); - xcv = typename T_Traits::X_monotone_curve_2(p1, p2); - return true; -} - -template -template -bool -Traits_base_test::read_curve(stream& is, - typename T_Traits::Curve_2& cv) -{ - Basic_number_type x1, y1, x2, y2; - is >> x1 >> y1 >> x2 >> y2; - Point_2 p1(x1, y1); - Point_2 p2(x2, y2); - CGAL_assertion(p1 != p2); - cv = typename T_Traits::Curve_2(p1, p2); - return true; -} - -#if TEST_TRAITS == CORE_CONIC_TRAITS - -// conic traits and rational traits use same number -// type CORE:Expr so this code can be shared - -/*! Read a point */ - -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) -{ - Rational rat_x,rat_y; - is >> rat_x >> rat_y; - Basic_number_type x(rat_x), y(rat_y); - p = Point_2(x, y); - return true; -} - -#endif - -#if TEST_TRAITS == SPHERICAL_ARC_TRAITS - -/*! Read a point */ - -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) -{ - Basic_number_type x, y, z; - is >> x >> y >> z; - p = Point_2(x, y, z); - return true; -} - -/*! Read a xcurve */ -template <> -template -bool -Traits_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) -{ - Point_2 p1,p2; - read_point(is, p1); - read_point(is, p2); - CGAL_assertion(p1 != p2); - xcv = X_monotone_curve_2(p1, p2); - return true; -} - -/*! Read a curve */ -template <> -template -bool -Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - Point_2 p1, p2; - read_point(is, p1); - read_point(is, p2); - CGAL_assertion(p1 != p2); - cv = Curve_2(p1, p2); - return true; -} - -#endif - -#if TEST_TRAITS == RATIONAL_ARC_TRAITS -/*! Read a point */ - -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) -{ - Traits::Construct_point_2 construct_point_2 = m_traits.construct_point_2_object(); - - Rational x, y; - is >> x >> y ; - p = construct_point_2(x, y); - return true; -} - -template -bool read_rational_to_real(stream& is, Algebraic_real_1& r) -{ - static Traits::Algebraic_kernel_d_1 algebraic_kernel; - Rational rat; - is >> rat; - r = algebraic_kernel.construct_algebraic_real_1_object()(rat); - return true; -} - - -template -bool read_coefficients(stream& is, Rat_vector& coeffs) -{ - unsigned int num_coeffs; - Rational rat; - is >> num_coeffs; - coeffs.clear(); - for (unsigned int j = 0; j < num_coeffs; j++) { - is >> rat; - coeffs.push_back(rat); - } - return true; -} - -/*! Read a xcurve */ -template <> -template -bool -Traits_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) -{ - //curve constructor - const Traits::Construct_x_monotone_curve_2 construct_x_monotone_curve_2 - = m_traits.construct_x_monotone_curve_2_object(); - - // Get the arc type: - Rat_vector p_coeffs, q_coeffs; - Algebraic_real_1 src, trg; - int dir = 0; - char type; - is >> type; - if (type == 'a' || type == 'A') - { - //Default constructor - xcv = X_monotone_curve_2(); - return true; - } - else if (type == 'b' || type == 'B') - { - //Constructor of a whole polynomial curve - if (read_coefficients(is,p_coeffs)) - xcv = construct_x_monotone_curve_2(p_coeffs.begin(),p_coeffs.end()); - else - return false; - return true; - } - else if (type == 'c' || type == 'C') - { - //Constructor of a polynomial ray - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - is >> dir; - xcv = construct_x_monotone_curve_2(p_coeffs.begin(),p_coeffs.end(), src, (dir == 0 ? false : true)); - return true; - } - else if (type == 'd' || type == 'D') - { - //Constructor of a polynomial arc - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - if (!read_rational_to_real(is,trg)) - return false; - xcv = construct_x_monotone_curve_2(p_coeffs.begin(),p_coeffs.end(), src, trg); - return true; - } - else if (type == 'e' || type == 'E') - { - //Constructor of a whole rational function - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_coefficients(is,q_coeffs)) - return false; - xcv = construct_x_monotone_curve_2(p_coeffs.begin(),p_coeffs.end(), q_coeffs.begin(),q_coeffs.end()); - return true; - } - else if (type == 'f' || type == 'F') - { - //Constructor of a ray of a rational function - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_coefficients(is,q_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - is >> dir; - xcv =construct_x_monotone_curve_2(p_coeffs.begin(),p_coeffs.end(), - q_coeffs.begin(),q_coeffs.end(), - src, (dir == 0 ? false : true)); - return true; - } - else if (type == 'g' || type == 'G') - { - //Constructor of a bounded rational arc - if (!read_coefficients(is, p_coeffs)) - return false; - if (!read_coefficients(is, q_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - if (!read_rational_to_real(is,trg)) - return false; - - xcv = construct_x_monotone_curve_2( p_coeffs.begin(),p_coeffs.end(), - q_coeffs.begin(),q_coeffs.end(), - src, trg); - return true; - } - // If we reached here, we have an unknown rational arc type: - std::cerr << "Illegal rational arc type specification: " << type << "." - << std::endl; - return (false); -} - -/*! Read a curve */ -template <> -template -bool Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - //curve constructor - const Traits::Construct_curve_2 construct_curve_2 = m_traits.construct_curve_2_object(); - - // Get the arc type: - Rat_vector p_coeffs, q_coeffs; - Algebraic_real_1 src, trg; - int dir = 0; - char type; - is >> type; - if (type == 'a' || type == 'A') - { - //Default constructor - cv = Curve_2(); - return true; - } - else if (type == 'b' || type == 'B') - { - //Constructor of a whole polynomial curve - if (read_coefficients(is,p_coeffs)) - cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end()); - else - return false; - return true; - } - else if (type == 'c' || type == 'C') - { - //Constructor of a polynomial ray - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - is >> dir; - cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end(), src, (dir == 0 ? false : true)); - return true; - } - else if (type == 'd' || type == 'D') - { - //Constructor of a polynomial arc - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - if (!read_rational_to_real(is,trg)) - return false; - cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end(), src, trg); - return true; - } - else if (type == 'e' || type == 'E') - { - //Constructor of a whole rational function - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_coefficients(is,q_coeffs)) - return false; - cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end(), q_coeffs.begin(),q_coeffs.end()); - return true; - } - else if (type == 'f' || type == 'F') - { - //Constructor of a ray of a rational function - if (!read_coefficients(is,p_coeffs)) - return false; - if (!read_coefficients(is,q_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - is >> dir; - cv =construct_curve_2(p_coeffs.begin(),p_coeffs.end(), - q_coeffs.begin(),q_coeffs.end(), - src, (dir == 0 ? false : true)); - return true; - } - else if (type == 'g' || type == 'G') - { - //Constructor of a bounded rational arc - if (!read_coefficients(is, p_coeffs)) - return false; - if (!read_coefficients(is, q_coeffs)) - return false; - if (!read_rational_to_real(is,src)) - return false; - if (!read_rational_to_real(is,trg)) - return false; - cv = construct_curve_2(p_coeffs.begin(),p_coeffs.end(), - q_coeffs.begin(),q_coeffs.end(), - src, trg); - return true; - } - // If we reached here, we have an unknown rational arc type: - std::cerr << "Illegal rational arc type specification: " << type << "." - << std::endl; - return (false); -} - -#endif - -#if TEST_TRAITS == POLYLINE_TRAITS || TEST_TRAITS == NON_CACHING_POLYLINE_TRAITS - -template <> -template -bool -Traits_base_test:: -read_xcurve(stream& is, Traits::X_monotone_curve_2& xcv) -{ - unsigned int num_points; - is >> num_points; - std::vector points; - points.clear(); - for (unsigned int j = 0; j < num_points; j++) { - Basic_number_type x, y; - is >> x >> y; - Point_2 p(x, y); - points.push_back(p); - } - xcv = - CGAL:: - Arr_polyline_traits_2::X_monotone_curve_2(points.begin(), - points.end()); - return true; -} - -template <> -template -bool -Traits_base_test::read_curve(stream& is, Traits::Curve_2& cv) -{ - unsigned int num_points; - is >> num_points; - std::vector points; - points.clear(); - for (unsigned int j = 0; j < num_points; j++) { - Basic_number_type x, y; - is >> x >> y; - Point_2 p(x, y); - points.push_back(p); - } - cv = CGAL::Arr_polyline_traits_2::Curve_2(points.begin(), - points.end()); - return true; -} - -#elif TEST_TRAITS == LINEAR_TRAITS - -template <> -template -bool -Traits_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) -{ - is >> xcv; - return true; -} - -template <> -template -bool -Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - is >> cv; - return true; -} - -#elif TEST_TRAITS == CORE_CONIC_TRAITS - -/*! */ -template -bool read_orientation(stream& is, CGAL::Orientation& orient) -{ - int i_orient; - is >> i_orient; - orient = (i_orient > 0) ? CGAL::COUNTERCLOCKWISE : - (i_orient < 0) ? CGAL::CLOCKWISE : CGAL::COLLINEAR; - return true; -} - -/*! */ -template -bool read_app_point(stream& is, Point_2& p) -{ - double x, y; - is >> x >> y; - p = Point_2(Algebraic(x), Algebraic(y)); - return true; -} - -/*! */ -template -bool read_orientation_and_end_points(stream& is, CGAL::Orientation& orient, - Point_2& source, Point_2& target) -{ - // Read the orientation. - if (!read_orientation(is, orient)) return false; - - // Read the end points of the arc and create it. - if (!read_app_point(is, source)) return false; - if (!read_app_point(is, target)) return false; - return true; -} - -/*! Read a circle or an ellipse */ -template -bool read_ellipse(stream& is, bool& is_circle, Rat_circle& circle, - Rational& r, Rational& s, - Rational& t, Rational& u, Rational& v, Rational& w) -{ - // Read the ellipse (using the format "a b x0 y0"): - // 2 2 - // ( x - x0 ) ( y - y0 ) - // -------- + -------- = 1 - // a b - // - Rational a, b, x0, y0; - is >> a >> b >> x0 >> y0; - - if (a == b) { - is_circle = true; - circle = Rat_circle (Rat_point (x0, y0), a); - } - else { - r = 1/a; - s = 1/b; - t = 0; - u = -2*x0*b; - v = -2*y0*a; - w = x0*x0*b + y0*y0*a - a*b; - } - return true; -} - -/*! */ -template -bool read_partial_ellipse(stream& is, Curve& cv) -{ - bool is_circle; // Is this a circle. - Rat_circle circle; - Rational r, s, t, u, v, w; - if (!read_ellipse(is, is_circle, circle, r, s, t, u, v, w)) return false; - CGAL::Orientation orient; - Point_2 source, target; - if (!read_orientation_and_end_points(is, orient, source, target)) //!!! - return false; - - // Create the conic (or circular) arc. - cv = (is_circle) ? Curve (circle, orient, source, target) : - Curve (r, s, t, u, v, w, orient, source, target); - return true; -} - -/*! */ -template -bool read_full_ellipse(stream& is, Curve& cv) -{ - bool is_circle; // Is this a circle. - Rat_circle circle; - Rational r, s, t, u, v, w; - if (!read_ellipse(is, is_circle, circle, r, s, t, u, v, w)) - return false; - - // Create a full ellipse (or circle). - cv = (is_circle) ? Curve (circle) : Curve (r, s, t, u, v, w); - return true; -} - -/*! Read a hyperbola */ -template -bool read_hyperbola(stream& is, Curve& cv) -{ - // Read the hyperbola (using the format "a b x0 y0"): - // 2 2 - // ( x - x0 ) ( y - y0 ) - // -------- - -------- = 1 - // a b - // - Rational a, b, x0, y0; - is >> a >> b >> x0 >> y0; - - Rational r = b; - Rational s= -a; - Rational t = 0; - Rational u = -2*x0*b; - Rational v = 2*y0*a; - Rational w = x0*x0*b - y0*y0*a - a*b; - - CGAL::Orientation orient; - Point_2 source, target; - if (!read_orientation_and_end_points(is, orient, source, target)) //!!! - return false; - - // Create the conic (or circular) arc. - cv = Curve (r, s, t, u, v, w, orient, source, target); - return true; -} - -/*! Read a hyperbola */ -template -bool read_parabola(stream& is, Curve& cv) -{ - // Read the parabola (using the format "c x0 y0"): - // - // 2 - // (x - x0) = 4c*(y - y0) - // - Rational c, x0, y0; - is >> c >> x0 >> y0; - - Rational r = 1; - Rational s = 0; - Rational t = 0; - Rational u = -2*x0; - Rational v = -4*c; - Rational w = x0*x0 + 4*c*y0; - - CGAL::Orientation orient; - Point_2 source, target; - if (!read_orientation_and_end_points(is, orient, source, target)) - return false; - - // Create the conic (or circular) arc. - cv = Curve (r, s, t, u, v, w, orient, source, target); - return true; -} - -/*! */ -template -bool read_segment(stream& is, Curve& cv) -{ - - // Read a segment, given by its endpoints (x1,y1) and (x2,y2); - Rational x1, y1, x2, y2; - is >> x1 >> y1 >> x2 >> y2; - - Rat_point source (x1, y1); - Rat_point target (x2, y2); - Rat_segment segment (source, target); - - // Create the segment. - cv = Curve (segment); - return true; -} - -/*! */ -template -bool read_general_arc(stream& is, Curve& cv) -{ - // Read a general conic, given by its coefficients . - Rational r, s, t, u, v, w; // The conic coefficients. - is >> r >> s >> t >> u >> v >> w; - // Read the orientation. - int i_orient = 0; - is >> i_orient; - CGAL::Orientation orient = (i_orient > 0) ? CGAL::COUNTERCLOCKWISE : - (i_orient < 0) ? CGAL::CLOCKWISE : CGAL::COLLINEAR; - - // Read the approximated source, along with a general conic - // whose intersection with - // defines the source. - Point_2 app_source; - if (!read_app_point(is, app_source)) return false; - Rational r1, s1, t1, u1, v1, w1; - is >> r1 >> s1 >> t1 >> u1 >> v1 >> w1; - - // Read the approximated target, along with a general conic - // whose intersection with - // defines the target. - Point_2 app_target; - if (!read_app_point(is, app_target)) return false; - - Rational r2, s2, t2, u2, v2, w2; - is >> r2 >> s2 >> t2 >> u2 >> v2 >> w2; - - // Create the conic arc. - cv = Curve (r, s, t, u, v, w, orient, - app_source, r1, s1, t1, u1, v1, w1, - app_target, r2, s2, t2, u2, v2, w2); - return true; -} - -/*! */ -template -bool read_general_curve(stream& is, Curve& cv) -{ - Rational r, s, t, u, v, w; // The conic coefficients. - // Read a general conic, given by its coefficients . - is >> r >> s >> t >> u >> v >> w; - CGAL::Orientation orient; - Point_2 source, target; - if (!read_orientation_and_end_points(is, orient, source, target)) - return false; - - // Create the conic (or circular) arc. - cv = Curve (r, s, t, u, v, w, orient, source, target); - return true; -} - -/*! Read an x-monotone conic curve */ -template <> -template -bool -Traits_base_test:: -read_xcurve(stream& is, X_monotone_curve_2& xcv) -{ - Curve_2 tmp_cv; - if (!read_curve(is,tmp_cv)) - return false; - xcv=X_monotone_curve_2(tmp_cv); - return true; -} - -/*! Read a general conic curve */ -template <> -template -bool -Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - // Get the arc type: - char type; - is >> type; - if (type == 'f' || type == 'F') - { - return read_full_ellipse(is, cv); - } - else if (type == 's' || type == 'S') - { - return read_segment(is, cv); - } - else if (type == 'i' || type == 'I') - { - return read_general_arc(is, cv); - } - else if (type == 'c' || type == 'C') - { - // Read a general conic, given by its coefficients . - Rational r, s, t, u, v, w; - is >> r >> s >> t >> u >> v >> w; - // Create a full conic (should work only for ellipses). - cv = Curve_2(r, s, t, u, v, w); - return (true); - } - else if (type == 'e' || type == 'E') - { - return read_partial_ellipse(is, cv); - } - else if (type == 'h' || type == 'H') - { - return read_hyperbola(is, cv); - } - else if (type == 'p' || type == 'P') - { - return read_parabola(is, cv); - } - else if (type == 'a' || type == 'A') - { - return read_general_curve(is, cv); - } - - // If we reached here, we have an unknown conic type: - std::cerr << "Illegal conic type specification: " << type << "." - << std::endl; - return (false); -} - -#elif TEST_TRAITS == CIRCLE_SEGMENT_TRAITS - -template -bool read_ort_point(stream& is, Point_2& p) -{ - bool is_rat; - typename Point_2::CoordNT ort_x, ort_y; - Number_type alpha,beta,gamma; - is >> is_rat; - if (is_rat) - { - is >> alpha; - ort_x=Point_2::CoordNT(alpha); - } - else - { - is >> alpha >> beta >> gamma; - ort_x=Point_2::CoordNT(alpha,beta,gamma); - } - is >> is_rat; - if (is_rat) - { - is >> alpha; - ort_y=Point_2::CoordNT(alpha); - } - else - { - is >> alpha >> beta >> gamma; - ort_y=Point_2::CoordNT(alpha,beta,gamma); - } - p = Point_2(ort_x, ort_y); - return true; -} - -/*! Read an x-monotone circle segment curve */ -template <> -template -bool -Traits_base_test::read_xcurve(stream& is,X_monotone_curve_2& xcv) -{ - bool ans=true; - char type; - is >> type; - if (type == 'z' || type == 'Z') - { - Line_2 l; - Point_2 ps,pt; - is >> l; - ans &= read_ort_point(is, ps); - ans &= read_ort_point(is, pt); - xcv=X_monotone_curve_2(l, ps, pt); - return ans; - } - else if (type == 'y' || type == 'Y') - { - Rat_point_2 ps,pt; - is >> ps >> pt; - xcv=X_monotone_curve_2(ps,pt); - return true; - } - else if (type == 'x' || type == 'X') - { - Circle_2 c; - Point_2 ps,pt; - is >> c; - ans &= read_ort_point(is, ps); - ans &= read_ort_point(is, pt); - xcv=X_monotone_curve_2(c, ps, pt, c.orientation()); - return ans; - } - // If we reached here, we have an unknown conic type: - std::cerr << "Illegal circle segment type specification: " << type - << std::endl; - return false; -} - -/*! Read a general circle segment curve */ -template <> -template -bool -Traits_base_test::read_curve(stream& is,Curve_2& cv) -{ - bool ans=true; - char type; - is >> type; - if (type == 'a' || type == 'A') - { - Rat_point_2 ps,pt; - is >> ps >> pt; - Segment_2 s(ps,pt); - cv=Curve_2(s); - return true; - } - else if (type == 'b' || type == 'B') - { - Rat_point_2 ps,pt; - is >> ps >> pt; - cv=Curve_2(ps,pt); - return true; - } - else if (type == 'c' || type == 'C') - { - Line_2 l; - Point_2 ps,pt; - is >> l; - ans &= read_ort_point(is, ps); - ans &= read_ort_point(is, pt); - cv=Curve_2(l,ps,pt); - return ans; - } - else if (type == 'd' || type == 'D') - { - Circle_2 c; - is >> c; - cv=Curve_2(c); - return true; - } - else if (type == 'e' || type == 'E') - { - Rat_point_2 p; - Rat_nt r; - int orient; - is >> p >> r >> orient; - cv=Curve_2(p,r,static_cast(orient)); - return true; - } - else if (type == 'f' || type == 'F') - { - Circle_2 c; - Point_2 ps,pt; - is >> c; - ans &= read_ort_point(is, ps); - ans &= read_ort_point(is, pt); - cv=Curve_2(c,ps,pt); - return ans; - } - else if (type == 'g' || type == 'G') - { - Rat_point_2 p; - Rat_nt r; - int orient; - Point_2 ps,pt; - is >> p >> r >> orient; - ans &= read_ort_point(is, ps); - ans &= read_ort_point(is, pt); - cv=Curve_2(p,r,static_cast(orient),ps,pt); - return ans; - } - else if (type == 'h' || type == 'H') - { - Rat_point_2 ps,pm,pt; - is >> ps >> pm >> pt; - cv=Curve_2(ps,pm,pt); - return true; - } - // If we reached here, we have an unknown conic type: - std::cerr << "Illegal circle segment type specification: " << type - << std::endl; - return false; -} - -#elif TEST_TRAITS == BEZIER_TRAITS - -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) -{ - Rational rat_x,rat_y; - is >> rat_x >> rat_y; - p = Point_2(rat_x, rat_y); - return true; -} - -/*! Read an x-monotone bezier curve */ - -template <> -template -bool -Traits_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) -{ - std::list x_objs; - std::list::const_iterator xoit; - Curve_2 tmp_cv; - is >> tmp_cv; - Rational B_psx = Rational(tmp_cv.control_point(0).x()); - Rational B_psy = Rational(tmp_cv.control_point(0).y()); - Rational B_ptx = - Rational(tmp_cv.control_point(tmp_cv.number_of_control_points()-1).x()); - Rational B_pty = - Rational(tmp_cv.control_point(tmp_cv.number_of_control_points()-1).y()); - Point_2 B_ps(B_psx, B_psy); - Point_2 B_pt(B_ptx, B_pty); - Traits::Make_x_monotone_2 make_x_monotone = - this->m_traits.make_x_monotone_2_object(); - make_x_monotone (tmp_cv, std::front_inserter (x_objs)); - xoit = x_objs.begin(); - if (CGAL::assign (xcv, *xoit)) - return true; - return false; -} - -/*! Read a general bezier curve */ -template <> -template -bool -Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - is >> cv; - return true; -} - -#elif TEST_TRAITS == LINE_ARC_TRAITS || \ - TEST_TRAITS == CIRCULAR_ARC_TRAITS || \ - TEST_TRAITS == CIRCULAR_LINE_ARC_TRAITS - -/*! Read an arc point */ -template -bool read_arc_point(stream& is, typename T_Traits::Point_2& p) -{ - Basic_number_type x, y; - is >> x >> y; - Circular_kernel::Point_2 lp(x, y); - p = typename T_Traits::Point_2(lp); - return true; -} - -bool is_deg_1(char c) -{ - return (c=='z' || c=='Z') || (c=='y' || c=='Y') || (c=='x' || c=='X') || - (c=='w' || c=='W') || (c=='v' || c=='V') || (c=='l' || c=='L'); -} - -bool is_deg_2(char c) -{ - return (c=='b' || c=='B') || (c=='c' || c=='C') || - (c=='d' || c=='D') || (c=='e' || c=='E'); -} - -#if TEST_TRAITS == LINE_ARC_TRAITS || \ - TEST_TRAITS == CIRCULAR_LINE_ARC_TRAITS - -template -Circular_kernel::Line_arc_2 read_line(char type, stream& is) -{ - if (type == 'z' || type == 'Z') - { - Circular_kernel::Line_2 l_temp; - Circular_kernel::Circle_2 c_temp1,c_temp2; - bool b1,b2; - is >> l_temp >> c_temp1 >> b1 >> c_temp2 >> b2; - return Circular_kernel::Line_arc_2(l_temp,c_temp1,b1,c_temp2,b2); - } - else if (type == 'y' || type == 'Y') - { - Circular_kernel::Line_2 l_temp,l_temp1,l_temp2; - is >> l_temp >> l_temp1 >> l_temp2; - return Circular_kernel::Line_arc_2(l_temp,l_temp1,l_temp2); - } - else if (type == 'x' || type == 'X') - { - Circular_kernel::Line_2 l_temp; - Circular_kernel::Circular_arc_point_2 p0,p1; - is >> l_temp >> p0 >> p1; - //std::cout << "got here l_temp p0 p1 " << l_temp << " " << p0 << " " << p1 << std::endl; - return Circular_kernel::Line_arc_2(l_temp, p0, p1); - } - else if (type == 'w' || type == 'W' || type == 'l' || type == 'L') - { - Circular_kernel::Point_2 p0,p1; - is >> p0 >> p1; - return Circular_kernel::Line_arc_2(p0,p1); - } - else if (type == 'v' || type == 'V') - { - Circular_kernel::Segment_2 seg; - is >> seg; - return Circular_kernel::Line_arc_2(seg); - } - std::cout << "should never happen Line_arc_2 " << type < -Circular_kernel::Circular_arc_2 read_arc(char type,stream& is) -{ - if (type == 'b' || type == 'B') - { - Circular_kernel::Circle_2 circle, circle1, circle2; - bool b1, b2; - is >> circle >> circle1 >> b1 >> circle2 >> b2; - - return Circular_kernel::Circular_arc_2(circle, circle1, b1, circle2, b2); - } - else if (type == 'c' || type == 'C') - { - Circular_kernel::Circle_2 circle; - Circular_kernel::Circular_arc_point_2 p0, p1; - is >> circle >> p0 >> p1; - return Circular_kernel::Circular_arc_2(circle, p0, p1); - } - else if (type == 'd' || type == 'D') - { - Circular_kernel::Circle_2 circle; - Circular_kernel::Line_2 line1, line2; - bool b1,b2; - is >> circle >> line1 >> b1 >> line2 >> b2; - return Circular_kernel::Circular_arc_2(circle, line1, b1, line2, b2); - } - else - CGAL_error_msg("Unrecognized constructor. Should never happen" \ - "Circular_arc_2"); - // else if (type == 'e' || type == 'E') - // { - // Circular_kernel::Circular_arc_2 arc; - // Circular_kernel::Circle_2 circle; - // bool b1, b2; - // is >> arc >> b1 >> circle >> b2; - // return Circular_kernel::Circular_arc_2(arc, b1, circle, b2); - // } - return Circular_kernel::Circular_arc_2(); //should never happen -} -#endif - -#if TEST_TRAITS == LINE_ARC_TRAITS - -/*! Read a line arc point */ -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) -{ - return read_arc_point(is, p); -} - -/*! Read an x-monotone line arc curve */ -template <> -template -bool -Traits_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) -{ - // Get the arc type: - char type; - is >> type; - if (is_deg_1(type)) - { - xcv=read_line(type,is); - return true; - } - return false; - -} - -/*! Read a general line arc curve */ -template <> -template -bool -Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - // Get the arc type: - char type; - is >> type; - if (is_deg_1(type)) - { - cv=read_line(type,is); - return true; - } - return false; -} - -#elif TEST_TRAITS == CIRCULAR_ARC_TRAITS - -/*! Read a circular arc point */ -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) -{ - return read_arc_point(is, p); -} - -/*! Read an x-monotone circular arc curve */ -template <> -template -bool -Traits_base_test::read_xcurve(stream& is,X_monotone_curve_2& xcv) -{ - // Get the arc type: - char type; - is >> type; - if (is_deg_2(type)) - { - xcv=read_arc(type, is); - return true; - } - return false; -} - -/*! Read a general circular curve */ -template <> -template -bool -Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - // Get the arc type: - char type; - is >> type; - if (type == 'a' || type == 'A') - { - Circular_kernel::Circle_2 circle; - is >> circle; - cv=Circular_kernel::Circular_arc_2(circle); - return true; - } - else if (is_deg_2(type)) - { - cv=read_arc(type, is); - return true; - } - return false; -} - -#elif TEST_TRAITS == CIRCULAR_LINE_ARC_TRAITS - -/*! Read a circular-line arc point */ -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) -{ - return read_arc_point(is, p); -} - -/*! Read an x-monotone circular-line arc curve */ -template <> -template -bool -Traits_base_test::read_xcurve(stream& is, X_monotone_curve_2& xcv) -{ - // Get the arc type: - char type; - is >> type; - if (is_deg_1(type)) { - xcv = read_line(type,is); - return true; - } - else if (is_deg_2(type)) { - xcv = X_monotone_curve_2(read_arc(type, is)); - return true; - } - return false; -} - -/*! Read a general circular-line curve */ -template <> -template -bool Traits_base_test::read_curve(stream& is, Curve_2& cv) -{ - // Get the arc type: - char type; - is >> type; - if (type == 'a' || type == 'A') { - Circular_kernel::Circle_2 circle; - is >> circle; - cv=Curve_2(circle); - return true; - } - else if (is_deg_1(type)) { - cv = Curve_2(read_line(type, is)); - return true; - } - else if (is_deg_2(type)) { - cv = read_arc(type, is); - return true; - } - return false; - -} - -#endif - -#endif - -#if TEST_TRAITS == ALGEBRAIC_TRAITS - -#include - -template <> -template -bool -Traits_base_test::read_point(stream& is, Point_2& p) { - Traits traits; - Traits::Construct_point_2 construct_point_2 - = traits.construct_point_2_object(); - char type; - is >> type; - switch(type) { - case 'i': { - int x=0,y=0; - is >> x >> y; - p=construct_point_2(x, y); - break; - } - case 'b': { - Traits::Bound x,y; - is >> x >> y; - p=construct_point_2(x, y); - break; - } - case 'c': { - Traits::Coefficient x, y; - is >> x >> y; - p=construct_point_2(x, y); - break; - } - case 'a': { - Traits::Algebraic_real_1 x, y; - is >> x >> y; - p=construct_point_2(x, y); - break; - } - case 's': { - Traits::Algebraic_real_1 x; - is >> x; - Traits::X_monotone_curve_2 xcv; - CGAL::swallow(is,'('); - CGAL_assertion_code(bool check=) - read_xcurve(is, xcv); - CGAL_assertion(check); - - CGAL::swallow(is,')'); - p=construct_point_2(x, xcv); - break; - } - case 'g': { - Traits::Algebraic_real_1 x; - is >> x; - Traits::Curve_2 c; - CGAL_assertion_code(bool check = ) - read_curve(is,c); - CGAL_assertion(check); - int arcno=0; - is >> arcno; - p=construct_point_2(x, c, arcno); - break; - } - default: { - std::cout << "Expected i, b, c, a, s, or g, but got \"" << type << "\"" - << std::endl; - return false; - } - } - return true; -} - -template <> -template -bool Traits_base_test::read_xcurve(stream& is, - Traits::X_monotone_curve_2& xcv) -{ - Traits traits; - Traits::Construct_x_monotone_segment_2 construct_segment_2 - = traits.construct_x_monotone_segment_2_object(); - char type; - is >> type; - switch(type) { - case '1': { - Curve_2 cv; - Point_2 end_left,end_right; - CGAL_assertion_code(bool check=) - read_curve(is,cv); - CGAL_assertion(check); - CGAL::swallow(is,'('); - CGAL_assertion_code(check=) - read_point(is,end_left); - CGAL_assertion(check); - CGAL::swallow(is,')'); - CGAL::swallow(is,'('); - CGAL_assertion_code(check=) - read_point(is,end_right); - CGAL_assertion(check); - CGAL::swallow(is,')'); - std::vector xcvs; - construct_segment_2(cv, end_left, end_right, std::back_inserter(xcvs)); - CGAL_assertion(xcvs.size() == 1); - xcv = xcvs[0]; - break; - } - case '2': { - Curve_2 cv; - Point_2 p; - CGAL_assertion_code(bool check=) - read_curve(is,cv); - CGAL_assertion(check); - CGAL::swallow(is,'('); - CGAL_assertion_code(check=) - read_point(is,p); - CGAL_assertion(check); - CGAL::swallow(is,')'); - std::string site_of_p_string; - Traits::Site_of_point site_of_p; - is >> site_of_p_string; - if (site_of_p_string=="MIN_ENDPOINT") { - site_of_p=Traits::MIN_ENDPOINT; - } else if (site_of_p_string=="MAX_ENDPOINT") { - site_of_p=Traits::MAX_ENDPOINT; - } else { - CGAL_assertion(site_of_p_string=="POINT_IN_INTERIOR"); - site_of_p=Traits::POINT_IN_INTERIOR; - } - std::vector xcvs; - construct_segment_2(cv, p, site_of_p, std::back_inserter(xcvs)); - CGAL_assertion(xcvs.size() == 1); - xcv = xcvs[0]; - break; - } - default: { - std::cout << "Expected 1 or 2, but got \"" << type << "\"" << std::endl; - return false; - } - } - return true; -} - -template <> -template -bool Traits_base_test::read_curve(stream& is, Curve_2& cv) { - Traits traits; - Traits::Polynomial_2 p; - Traits::Construct_curve_2 construct_curve_2 - = traits.construct_curve_2_object(); - is >> p; - cv = construct_curve_2(p); - return true; -} - -#endif - #endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h index f1cd4ca7924..ec73f8d4281 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Traits_test.h @@ -237,7 +237,7 @@ private: public: /*! Constructor */ - Traits_test(int argc, char * argv[]); + Traits_test(); /*! Destructor */ ~Traits_test(); @@ -248,8 +248,7 @@ public: * Accepts test data file name. */ template -Traits_test::Traits_test(int argc, char * argv[]) : - Traits_base_test(argc, argv) +Traits_test::Traits_test() { typedef T_Traits Traits; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base index 454700a3cfb..a95145e32e5 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base @@ -186,8 +186,8 @@ run_trapped_test() else run_test $1 $2 $3 $4 $5 $6 & WPID=$! - trap "kill -HUP $WPID" INT - (sleep 1200; kill -HUP $WPID) > /dev/null 2>&1 & + trap "kill -9 $WPID" INT + (sleep 1200; kill -9 $WPID) > /dev/null 2>&1 & SPID=$! wait $WPID > /dev/null 2>&1 # RES=$? @@ -707,6 +707,126 @@ test_spherical_arcs_traits_adaptor() clean_tests } +#---------------------------------------------------------------------# +# point location with segments +#---------------------------------------------------------------------# +test_point_location_segments() +{ + compile_test point_location $CGAL_GMPQ_NT $CARTESIAN_KERNEL $SEGMENT_TRAITS point_location_segments + if [ ${res} -eq 0 ] ; then + echo " ERROR: not executed point location of segments" >> $ERRORFILE + else + OUTPUTFILE=ProgramOutput.point_location_segments.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./point_location" + if [ -f point_location_segments.cmd ] ; then + COMMAND="$COMMAND `cat point_location_segments.cmd`" + fi + if [ -f point_location_segments.cin ] ; then + COMMAND="cat point_location_segments.cin | $COMMAND" + fi + echo "Executing point location of segments ..." + echo + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of point location of segments" >> $ERRORFILE + else + echo " ERROR: execution of point location of segments" >> $ERRORFILE + fi + fi + clean_tests +} + +#---------------------------------------------------------------------# +# point location with segments +#---------------------------------------------------------------------# +test_point_location_dynamic_segments() +{ + compile_test point_location_dynamic $CGAL_GMPQ_NT $CARTESIAN_KERNEL $SEGMENT_TRAITS point_location_dynamic_segments + if [ ${res} -eq 0 ] ; then + echo " ERROR: not executed point location of segments" >> $ERRORFILE + else + OUTPUTFILE=ProgramOutput.point_location_dynamic_segments.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./point_location_dynamic" + if [ -f point_location_dynamic_segments.cmd ] ; then + COMMAND="$COMMAND `cat point_location_dynamic_segments.cmd`" + fi + if [ -f point_location_dynamic_segments.cin ] ; then + COMMAND="cat point_location_dynamic_segments.cin | $COMMAND" + fi + echo "Executing point location of segments ..." + echo + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of point location of segments" >> $ERRORFILE + else + echo " ERROR: execution of point location of segments" >> $ERRORFILE + fi + fi + clean_tests +} + +#---------------------------------------------------------------------# +# point location with circle segments +#---------------------------------------------------------------------# +test_point_location_circle_segments() +{ + compile_test point_location $CGAL_GMPQ_NT $CARTESIAN_KERNEL $CIRCLE_SEGMENT_TRAITS point_location_circle_segments + if [ ${res} -eq 0 ] ; then + echo " ERROR: not executed point_location of circle segments" >> $ERRORFILE + else + OUTPUTFILE=ProgramOutput.point_location_circle_segments.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./point_location" + if [ -f point_location_circle_segments.cmd ] ; then + COMMAND="$COMMAND `cat point_location_circle_segments.cmd`" + fi + if [ -f point_location_circle_segments.cin ] ; then + COMMAND="cat point_location_circle_segments.cin | $COMMAND" + fi + echo "Executing point_location of circle segments ..." + echo + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of point_location of circle segments" >> $ERRORFILE + else + echo " ERROR: execution of point_location of circle segments" >> $ERRORFILE + fi + fi + clean_tests +} + +#---------------------------------------------------------------------# +# point location with linear objects +#---------------------------------------------------------------------# +test_point_location_linear() +{ + compile_test point_location $CGAL_GMPQ_NT $CARTESIAN_KERNEL $LINEAR_TRAITS point_location_linear + if [ ${res} -eq 0 ] ; then + echo " ERROR: not executed point_location of linear objects" >> $ERRORFILE + else + OUTPUTFILE=ProgramOutput.point_location_linear.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./point_location" + if [ -f point_location_linear.cmd ] ; then + COMMAND="$COMMAND `cat point_location_linear.cmd`" + fi + if [ -f point_location_linear.cin ] ; then + COMMAND="cat point_location_linear.cin | $COMMAND" + fi + echo "Executing point_location of linear objects ..." + echo + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of point_location of linear objects" >> $ERRORFILE + else + echo " ERROR: execution of point_location of linear objects" >> $ERRORFILE + fi + fi + clean_tests +} + #---------------------------------------------------------------------# # segment traits #---------------------------------------------------------------------# @@ -1118,7 +1238,6 @@ if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then configure fi - if [ "${TEST_WITH_CMAKE}" != "FALSE" ]; then compile_and_run construction_test_suite_generator fi @@ -1145,19 +1264,21 @@ test_algebraic_traits_core test_algebraic_traits_gmp test_algebraic_traits_leda - compile_and_run test_insertion compile_and_run test_unbounded_rational_insertion compile_and_run test_rational_function_traits_2 compile_and_run test_removal compile_and_run test_iso_verts -compile_and_run test_iso_verts compile_and_run test_vert_ray_shoot_vert_segments compile_and_run test_construction compile_and_run test_overlay -compile_and_run point_location +test_point_location_segments +test_point_location_circle_segments +test_point_location_linear + +test_point_location_dynamic_segments compile_and_run test_dual compile_and_run test_do_intersect diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test01.txt deleted file mode 100644 index 007dc038bdf..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test01.txt +++ /dev/null @@ -1,2 +0,0 @@ -1 -0/1 0/1 1/1 1/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test06.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test06.txt deleted file mode 100644 index 8d161c78860..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test06.txt +++ /dev/null @@ -1,34 +0,0 @@ -33 -0/1 0/1 1000000/1 0/1 -0/1 1/1 1000000/1 1/1 -0/1 2/1 1000000/1 2/1 -0/1 3/1 1000000/1 3/1 -0/1 4/1 1000000/1 4/1 -0/1 5/1 1000000/1 5/1 -0/1 6/1 1000000/1 6/1 -0/1 7/1 1000000/1 7/1 -0/1 8/1 1000000/1 8/1 -0/1 9/1 1000000/1 9/1 -0/1 10/1 1000000/1 10/1 -0/1 0/1 0/1 1/1 -0/1 1/1 0/1 2/1 -0/1 2/1 0/1 3/1 -0/1 3/1 0/1 4/1 -0/1 4/1 0/1 5/1 -0/1 5/1 0/1 6/1 -0/1 6/1 0/1 7/1 -0/1 7/1 0/1 8/1 -0/1 8/1 0/1 9/1 -0/1 9/1 0/1 10/1 -1000000/1 0/1 1000000/1 1/1 -1000000/1 1/1 1000000/1 2/1 -1000000/1 2/1 1000000/1 3/1 -1000000/1 3/1 1000000/1 4/1 -1000000/1 4/1 1000000/1 5/1 -1000000/1 5/1 1000000/1 6/1 -1000000/1 6/1 1000000/1 7/1 -1000000/1 7/1 1000000/1 8/1 -1000000/1 8/1 1000000/1 9/1 -1000000/1 9/1 1000000/1 10/1 -0/1 10/1 500000/1 11/1 -500000/1 11/1 1000000/1 10/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test07.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test07.txt deleted file mode 100644 index 6e21fa6bfd0..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test07.txt +++ /dev/null @@ -1,18 +0,0 @@ -16 -0/1 0/1 10/1 0/1 -10/1 0/1 10/1 10/1 -10/1 10/1 0/1 10/1 -0/1 10/1 0/1 0/1 -4/1 4/1 5/1 5/1 -5/1 5/1 6/1 4/1 -6/1 4/1 4/1 4/1 -7/1 4/1 5/1 5/1 -5/1 5/1 7/1 6/1 -7/1 6/1 7/1 4/1 -6/1 8/1 5/1 5/1 -5/1 5/1 4/1 8/1 -4/1 8/1 6/1 8/1 -3/1 6/1 5/1 5/1 -5/1 5/1 3/1 4/1 -3/1 4/1 3/1 6/1 - diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test09.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test09.txt deleted file mode 100644 index 672c41bc05a..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test09.txt +++ /dev/null @@ -1,10 +0,0 @@ -9 --1/1 0/1 0/1 1/1 -0/1 1/1 1/1 0/1 -1/1 0/1 0/1 -1/1 -0/1 -1/1 -1/1 0/1 -0/1 2/1 2/1 0/1 -2/1 0/1 0/1 -2/1 -0/1 -2/1 -2/1 0/1 --2/1 0/1 -5/9 1/2 --5/9 1/2 0/1 2/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test01.txt deleted file mode 100644 index c6a6f7fa644..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test01.txt +++ /dev/null @@ -1,2 +0,0 @@ -1 -1/2 1/2 \ No newline at end of file diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test03.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test03.txt deleted file mode 100644 index 02c9528b397..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test03.txt +++ /dev/null @@ -1,2 +0,0 @@ -1 -0/1 0/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test05.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test05.txt deleted file mode 100644 index 2d638f9cf75..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test05.txt +++ /dev/null @@ -1,2 +0,0 @@ -1 -5/1 5/1 \ No newline at end of file diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test08.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test08.txt deleted file mode 100644 index 32c9e68dade..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test08.txt +++ /dev/null @@ -1,2 +0,0 @@ -1 -1/1 -1/10 \ No newline at end of file diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/curves/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/curves/test01.txt new file mode 100644 index 00000000000..1b10dd82734 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/curves/test01.txt @@ -0,0 +1 @@ +d 0 0 1 1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/ops/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/ops/test01.txt new file mode 100644 index 00000000000..78981922613 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/ops/test01.txt @@ -0,0 +1 @@ +a diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/queries/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/queries/test01.txt new file mode 100644 index 00000000000..6e8183b72e5 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_circle_segments/queries/test01.txt @@ -0,0 +1 @@ +0 1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test01.txt new file mode 100644 index 00000000000..e90924f13af --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test01.txt @@ -0,0 +1,2 @@ +L 1 0 0 +L 0 1 0 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test03.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test03.txt new file mode 100644 index 00000000000..bbd0234a9e1 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test03.txt @@ -0,0 +1,4 @@ +S 0/1 0/1 0/1 1/1 +S 0/1 1/1 1/1 1/1 +S 1/1 1/1 1/1 0/1 +S 1/1 0/1 0/1 0/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test04.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test04.txt new file mode 100644 index 00000000000..4ee6cd4598d --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/curves/test04.txt @@ -0,0 +1,3 @@ +L 1 0 1 +L 1 0 0 +L 1 0 -1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test01.txt new file mode 100644 index 00000000000..78981922613 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test01.txt @@ -0,0 +1 @@ +a diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test02.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test02.txt new file mode 100644 index 00000000000..a04ac23e4ef --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/ops/test02.txt @@ -0,0 +1,5 @@ +i 0 +i 1 +i 2 +i 3 +d 0 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test01.txt new file mode 100644 index 00000000000..f0747116789 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test01.txt @@ -0,0 +1,4 @@ +1 1 +1 -1 +-1 1 +-1 -1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test02.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test02.txt new file mode 100644 index 00000000000..e1743d24028 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test02.txt @@ -0,0 +1,8 @@ +-2 10 +5 20 +2 5 +2 -1 +7 5 +9 -1 +14 -1 +22 10 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test03.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test03.txt new file mode 100644 index 00000000000..59be80fa56c --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test03.txt @@ -0,0 +1,3 @@ +1/1 -1/10 +1/1 1/2 +1/2 1/2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test04.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test04.txt new file mode 100644 index 00000000000..a170e9535dd --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/queries/test04.txt @@ -0,0 +1,9 @@ +7 +-2/1 0/1 +-1/1 0/1 +-1/2 0/1 +0/1 0/1 +1/2 0/1 +1/1 0/1 +2/1 0/1 + diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/xcurves/test02.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/xcurves/test02.txt new file mode 100644 index 00000000000..51b8b4e9364 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_linear/xcurves/test02.txt @@ -0,0 +1,4 @@ +S 0 10 6 8 +S 10 5 20 5 +S 12 0 18 0 +S 4 2 8 2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test01.txt new file mode 100644 index 00000000000..0cf0ee603ad --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test01.txt @@ -0,0 +1 @@ +0 0 1 1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test02.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test02.txt similarity index 97% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test02.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test02.txt index 4b1b08e4044..08deb0ee401 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test02.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test02.txt @@ -1,4 +1,3 @@ -4 0/1 10/1 10/1 10/1 4/1 4/1 5/1 5/1 5/1 5/1 6/1 4/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test03.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test03.txt similarity index 94% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test03.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test03.txt index 587aca90897..bf19d7e079b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test03.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test03.txt @@ -1,3 +1,2 @@ -2 -1/1 -1/1 1/1 1/1 -1/1 1/1 1/1 -1/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test04.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test04.txt similarity index 97% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test04.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test04.txt index 0d9dd159c8c..f9d369bad3b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test04.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test04.txt @@ -1,4 +1,3 @@ -5 0/1 0/1 0/1 1/1 0/1 1/1 1/1 1/1 1/1 1/1 1/1 0/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test05.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test05.txt similarity index 98% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test05.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test05.txt index b5e2aa4c84b..9dfcb09b2e6 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test05.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test05.txt @@ -1,4 +1,3 @@ -8 0/1 0/1 0/1 10/1 0/1 10/1 5/1 10/1 5/1 10/1 10/1 10/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test06.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test06.txt new file mode 100644 index 00000000000..82b02c054f5 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test06.txt @@ -0,0 +1,33 @@ +0 0 1000000 0 +0 1 1000000 1 +0 2 1000000 2 +0 3 1000000 3 +0 4 1000000 4 +0 5 1000000 5 +0 6 1000000 6 +0 7 1000000 7 +0 8 1000000 8 +0 9 1000000 9 +0 10 1000000 10 +0 0 0 1 +0 1 0 2 +0 2 0 3 +0 3 0 4 +0 4 0 5 +0 5 0 6 +0 6 0 7 +0 7 0 8 +0 8 0 9 +0 9 0 10 +1000000 0 1000000 1 +1000000 1 1000000 2 +1000000 2 1000000 3 +1000000 3 1000000 4 +1000000 4 1000000 5 +1000000 5 1000000 6 +1000000 6 1000000 7 +1000000 7 1000000 8 +1000000 8 1000000 9 +1000000 9 1000000 10 +0 10 500000 11 +500000 11 1000000 10 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test07.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test07.txt new file mode 100644 index 00000000000..c7ee7b412a5 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test07.txt @@ -0,0 +1,16 @@ +0 0 10 0 +10 0 10 10 +10 10 0 10 +0 10 0 0 +4 4 5 5 +5 5 6 4 +6 4 4 4 +7 4 5 5 +5 5 7 6 +7 6 7 4 +6 8 5 5 +5 5 4 8 +4 8 6 8 +3 6 5 5 +5 5 3 4 +3 4 3 6 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test08.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test08.txt similarity index 73% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test08.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test08.txt index 3a65280f901..d7eefb7f2b5 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/curves/test08.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test08.txt @@ -1,5 +1,4 @@ -4 0/1 0/1 0/1 1/1 0/1 1/1 1/1 1/1 1/1 1/1 1/1 0/1 -1/1 0/1 0/1 0/1 \ No newline at end of file +1/1 0/1 0/1 0/1 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test09.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test09.txt new file mode 100644 index 00000000000..3e2d8c7a3c7 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/curves/test09.txt @@ -0,0 +1,9 @@ +-1 0 0 1 +0 1 1 0 +1 0 0 -1 +0 -1 -1 0 +0 2 2 0 +2 0 0 -2 +0 -2 -2 0 +-2 0 -5/9 1/2 +-5/9 1/2 0 2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test01.txt new file mode 100644 index 00000000000..78981922613 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test01.txt @@ -0,0 +1 @@ +a diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test10.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test10.txt new file mode 100644 index 00000000000..a04ac23e4ef --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/ops/test10.txt @@ -0,0 +1,5 @@ +i 0 +i 1 +i 2 +i 3 +d 0 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test01.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test01.txt new file mode 100644 index 00000000000..c11a1f37216 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test01.txt @@ -0,0 +1 @@ +1/2 1/2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test02.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test02.txt similarity index 73% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test02.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test02.txt index cb24f6ec954..d320310070b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test02.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test02.txt @@ -1,5 +1,4 @@ -4 5/1 5/1 51/10 51/10 5/1 49/10 -5/1 51/10 \ No newline at end of file +5/1 51/10 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test03.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test03.txt new file mode 100644 index 00000000000..b748e2dcfcb --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test03.txt @@ -0,0 +1 @@ +0 0 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test04.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test04.txt similarity index 80% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test04.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test04.txt index 41c503f3666..f1383e5c72a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test04.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test04.txt @@ -1,2 +1 @@ -1 1/2 1/2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test05.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test05.txt new file mode 100644 index 00000000000..299a71f3fe4 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test05.txt @@ -0,0 +1 @@ +5 5 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test06.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test06.txt similarity index 94% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test06.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test06.txt index fb21c9c5933..f83d1477bae 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test06.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test06.txt @@ -1,4 +1,3 @@ -23 500000/1 -1/1 500000/1 0/1 500000/1 1/2 @@ -21,4 +20,4 @@ 500000/1 18/2 500000/1 19/2 500000/1 20/2 -500000/1 21/2 \ No newline at end of file +500000/1 21/2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test07.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test07.txt similarity index 73% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test07.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test07.txt index cb24f6ec954..d320310070b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test07.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test07.txt @@ -1,5 +1,4 @@ -4 5/1 5/1 51/10 51/10 5/1 49/10 -5/1 51/10 \ No newline at end of file +5/1 51/10 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test08.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test08.txt new file mode 100644 index 00000000000..59be80fa56c --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test08.txt @@ -0,0 +1,3 @@ +1/1 -1/10 +1/1 1/2 +1/2 1/2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test09.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test09.txt similarity index 90% rename from Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test09.txt rename to Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test09.txt index d96339f397c..91378e9af0b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location/queries/test09.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test09.txt @@ -1,3 +1,2 @@ -2 0/1 0/1 -1/2 -1/2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test10.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test10.txt new file mode 100644 index 00000000000..e1743d24028 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/queries/test10.txt @@ -0,0 +1,8 @@ +-2 10 +5 20 +2 5 +2 -1 +7 5 +9 -1 +14 -1 +22 10 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/xcurves/test10.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/xcurves/test10.txt new file mode 100644 index 00000000000..fb2d9ee6ab9 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/point_location_segments/xcurves/test10.txt @@ -0,0 +1,4 @@ +0 10 6 8 +10 5 20 5 +12 0 18 0 +4 2 8 2 diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location.cmd b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location.cmd deleted file mode 100644 index cc534379081..00000000000 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location.cmd +++ /dev/null @@ -1,9 +0,0 @@ -./data/point_location/curves/test01.txt ./data/point_location/queries/test01.txt -./data/point_location/curves/test02.txt ./data/point_location/queries/test02.txt -./data/point_location/curves/test03.txt ./data/point_location/queries/test03.txt -./data/point_location/curves/test04.txt ./data/point_location/queries/test04.txt -./data/point_location/curves/test05.txt ./data/point_location/queries/test05.txt -./data/point_location/curves/test06.txt ./data/point_location/queries/test06.txt -./data/point_location/curves/test07.txt ./data/point_location/queries/test07.txt -./data/point_location/curves/test08.txt ./data/point_location/queries/test08.txt -./data/point_location/curves/test09.txt ./data/point_location/queries/test09.txt diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location.cpp index c1d10345848..1a74700cf7a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location.cpp @@ -1,510 +1,213 @@ +#include + +#include "test_configuration.h" + #include -#ifdef CGAL_USE_GMP +#if ((TEST_TRAITS == CORE_CONIC_TRAITS) || \ + (TEST_TRAITS == BEZIER_TRAITS) || \ + (TEST_TRAITS == RATIONAL_ARC_TRAITS)) && !defined(CGAL_USE_CORE) - #include - - typedef CGAL::Gmpq Number_type; - -#else - #include - #include - - typedef CGAL::Quotient Number_type; - -#endif - -#include -#include -#include -#include - -#include -#include "Segment_reader.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include - -typedef CGAL::Cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; - -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::Curve_2 Curve_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arrangement_2 Arrangement_2; -typedef Arrangement_2::Halfedge_handle Halfedge_handle; -typedef Arrangement_2::Edge_const_iterator Edge_const_iterator; -typedef Arrangement_2::Vertex_const_iterator Vertex_const_iterator; - -typedef CGAL::Arr_naive_point_location - Naive_point_location; -typedef CGAL::Arr_simple_point_location - Simple_point_location; -typedef CGAL::Arr_walk_along_line_point_location - Walk_point_location; -typedef CGAL::Arr_landmarks_point_location - Lm_point_location; -typedef CGAL::Arr_random_landmarks_generator - Random_lm_generator; -typedef CGAL::Arr_landmarks_point_location - Lm_random_point_location; -typedef CGAL::Arr_grid_landmarks_generator - Grid_lm_generator; -typedef CGAL::Arr_landmarks_point_location - Lm_grid_point_location; -typedef CGAL::Arr_halton_landmarks_generator - Halton_lm_generator; -typedef CGAL::Arr_landmarks_point_location - Lm_halton_point_location; -typedef CGAL::Arr_middle_edges_landmarks_generator - Middle_edges_generator; -typedef CGAL::Arr_landmarks_point_location - Lm_middle_edges_point_location; - -typedef CGAL::Arr_landmarks_specified_points_generator - Specified_points_generator; -typedef CGAL::Arr_landmarks_point_location - Lm_specified_points_point_location; - -//typedef CGAL::Arr_triangulation_point_location -// Lm_triangulation_point_location; - -// ===> Add new point location type here <=== - -typedef std::list Points_list; -typedef Points_list::iterator Point_iterator; -typedef std::list Curve_list; -typedef std::vector Objects_vector; -typedef Objects_vector::iterator Object_iterator; - -// ===> Change the number of point-location startegies -// when a new point location is added. <=== -#define NUM_OF_POINT_LOCATION_STRATEGIES 9 - -/*! */ -int check_point_location (Arrangement_2 &arr, Points_list &plist) +int main() { - //init - all point locations - CGAL::Timer timer; - - Naive_point_location naive_pl (arr); // 0 - - Simple_point_location simple_pl (arr); // 1 - Walk_point_location walk_pl (arr); // 2 - - timer.reset(); timer.start(); - Lm_point_location lm_pl (arr); // 3 - timer.stop(); - std::cout << "Lm (vert) construction took " << timer.time() < Add new point location instance here. <=== - - CGAL::Object obj; - Objects_vector objs[NUM_OF_POINT_LOCATION_STRATEGIES]; - Object_iterator ob_iter[NUM_OF_POINT_LOCATION_STRATEGIES]; - Arrangement_2::Vertex_const_handle vh_ref, vh_curr; - Arrangement_2::Halfedge_const_handle hh_ref, hh_curr; - Arrangement_2::Face_const_handle fh_ref, fh_curr; - - Point_2 q; - Point_iterator piter; - - //LOCATE the points in the list using all PL strategies - - //std::cout << "Time in seconds" < Add a call to operate the the new point location. <=== - - //END LOCATION - int pls_num = NUM_OF_POINT_LOCATION_STRATEGIES; - int pl_index; - int result = 0; - - //init all obejct iterators - for (pl_index=0; pl_indexis_unbounded()) - // std::cout << "Unbounded face." << std::endl; - //else - // std::cout << "Face." << std::endl; - } - - //assign object to a halfedge - else if (CGAL::assign (hh_ref, ob_iter[0][qi])) - { - std::cout << "Halfedge: "<< hh_ref->curve() << std::endl; - for (int pl_index=1; pl_indextwin() != hh_ref)) - { - std::cout << "Error: point location number " - << pl_index << " return a different halfedge"<< std::endl; - std::cout << "Halfedge (curr): "<< hh_curr->curve() << std::endl; - result = -1; - } - } - } - - //assign object to a vertex - else if (CGAL::assign (vh_ref, ob_iter[0][qi])) - { - for (int pl_index=1; pl_indexpoint() << std::endl; - } - - else - { - std::cout << "Illegal point-location result." << std::endl; - result = -1; - } - } - return (result); +// bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; + std::cout << std::endl + << "NOTE: Core is not installed, " + << "skipping the test ..." + << std::endl; + return 0; } +#elif (TEST_TRAITS == ALGEBRAIC_TRAITS) && \ + (TEST_NT == LEDA_INT_NT || TEST_NT == LEDA_RAT_NT) && \ + (! CGAL_USE_LEDA) -/*! */ -int read_points(const char * points_filename, Points_list &plist) +int main() { - //read points from file into list - std::ifstream inp_pnt_file(points_filename); - if (!inp_pnt_file.is_open()) - { - std::cerr << "Cannot open file " << points_filename << "!" << std::endl; - return (-1); - } - - int points_count = 0; - inp_pnt_file >> points_count; - - for (int i = 0; i < points_count; i++) { - Number_type x, y; - inp_pnt_file >> x >> y; - Point_2 pnt(x, y); - plist.push_back(pnt); - } - +// bool UNTESTED_TRAITS_AS_LEDA_IS_NOT_INSTALLED; + std::cout << std::endl + << "NOTE: LEDA is not installed, " + << "skipping the test ..." + << std::endl; return 0; } -bool test(const char* curves_filename, const char* points_filename) +#elif (TEST_TRAITS == ALGEBRAIC_TRAITS) && \ + (TEST_NT == CGAL_GMPZ_NT || TEST_NT == CGAL_GMPQ_NT) && \ + ! (CGAL_USE_GMP && CGAL_USE_MPFI) + +int main() { - //read curves and insert them into the arrangement - Segment_reader reader; - CGAL::Bbox_2 bbox; - Curve_list curve_list; - reader.read_data(curves_filename, std::back_inserter(curve_list), bbox); - - //insert all curves into the arrangement - CGAL::Timer timer; - timer.reset(); - timer.start(); //START - Arrangement_2 arr; - insert (arr, curve_list.begin(), curve_list.end()); - timer.stop(); ///END - std::cout << "Arrangement aggregate construction took " - << timer.time() < pl_test; + pl_test.set_filenames(points_filename, xcurves_filename, + curves_filename, queries_filename); + + if (!pl_test.allocate_arrangement()) return false; + if (!pl_test.construct_pl_strategies()) return false; + if (!pl_test.init()) return false; + + if (!pl_test.construct_arrangement()) return false; + if (!pl_test.perform()) return false; + + pl_test.clear(); + pl_test.deallocate_arrangement(); + pl_test.deallocate_pl_strategies(); + + return true; +} + +bool test2(Point_location_test& pl_test) +{ + if (!pl_test.init()) return false; + + if (!pl_test.construct_arrangement()) return false; + if (!pl_test.perform()) return false; + + pl_test.clear(); + pl_test.clear_arrangement(); + + return true; +} + +bool test3(const char* points_filename, const char* xcurves_filename, + const char* curves_filename, const char* queries_filename) +{ + Point_location_test pl_test; + pl_test.set_filenames(points_filename, xcurves_filename, + curves_filename, queries_filename); + + if (!pl_test.allocate_pl_strategies()) return false; + if (!pl_test.init()) return false; + + if (!pl_test.allocate_arrangement()) return false; + if (!pl_test.construct_arrangement()) return false; + if (!pl_test.attach_pl_strategies()) return false; + if (!pl_test.perform()) return false; + + pl_test.clear(); + pl_test.deallocate_arrangement(); + pl_test.deallocate_pl_strategies(); + + return true; +} + +int main(int argc, char* argv[]) +{ +#if TEST_TRAITS == ALGEBRAIC_TRAITS + CGAL::set_pretty_mode(std::cout); + CGAL::set_pretty_mode(std::cerr); +#endif + + if (argc < 4) { + std::cout << "Usage: " << argv[0] + << " point-file xcurve-file curve-file query-file" << std::endl; + std::cout << "point-file - the input point file" << std::endl; + std::cout << "xcurve-file - the input x-monotone curves file" << std::endl; + std::cout << "curve-file - the input curve file" << std::endl; + return -1; + } + + int success = 0; + + // Test 1 + for (int i = 1; i < argc; i += 4) { + const char* points_filename = argv[i]; + const char* xcurves_filename = argv[i+1]; + const char* curves_filename = argv[i+2]; + const char* queries_filename = argv[i+3]; + + if (!test1(points_filename, xcurves_filename, + curves_filename, queries_filename)) { - std::cout<<"ERROR : "< pl_test; + if (!pl_test.allocate_arrangement()) { + std::cout << "ERROR : allocating arrangement!" << std::endl; + return -1; + } + if (!pl_test.construct_pl_strategies()) { + std::cout << "ERROR : allocating point location strategies!" << std::endl; + return -1; + } + for (int i = 1; i < argc; i += 4) { + const char* points_filename = argv[i]; + const char* xcurves_filename = argv[i+1]; + const char* curves_filename = argv[i+2]; + const char* queries_filename = argv[i+3]; + + pl_test.set_filenames(points_filename, xcurves_filename, + curves_filename, queries_filename); + + if (!test2(pl_test)) { + std::cout << "ERROR : " << argv[0] << " " << points_filename << " " + << xcurves_filename << " " << curves_filename + << " " << queries_filename << std::endl; + success = -1; + } + } + pl_test.deallocate_arrangement(); + pl_test.deallocate_pl_strategies(); +#endif + +#if TEST_TRAITS == SEGMENT_TRAITS + // Test 3 + for (int i = 1; i < argc; i += 4) { + const char* points_filename = argv[i]; + const char* xcurves_filename = argv[i+1]; + const char* curves_filename = argv[i+2]; + const char* queries_filename = argv[i+3]; + + if (!test3(points_filename, xcurves_filename, + curves_filename, queries_filename)) + { + std::cout << "ERROR : " << argv[0] << " " << points_filename << " " + << xcurves_filename << " " << curves_filename + << " " << queries_filename << std::endl; + success = -1; + } + } +#endif + + return success; } + +#endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_circle_segments.cmd b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_circle_segments.cmd new file mode 100644 index 00000000000..747790e2376 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_circle_segments.cmd @@ -0,0 +1 @@ +./data/empty.zero ./data/empty.zero ./data/point_location_circle_segments/curves/test01.txt ./data/point_location_circle_segments/queries/test01.txt diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic.cpp new file mode 100644 index 00000000000..ab889d70a6c --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic.cpp @@ -0,0 +1,130 @@ +#include + +#include "test_configuration.h" + +#include + +#if ((TEST_TRAITS == CORE_CONIC_TRAITS) || \ + (TEST_TRAITS == BEZIER_TRAITS) || \ + (TEST_TRAITS == RATIONAL_ARC_TRAITS)) && !defined(CGAL_USE_CORE) + +int main() +{ +// bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; + std::cout << std::endl + << "NOTE: Core is not installed, " + << "skipping the test ..." + << std::endl; + return 0; +} +#elif (TEST_TRAITS == ALGEBRAIC_TRAITS) && \ + (TEST_NT == LEDA_INT_NT || TEST_NT == LEDA_RAT_NT) && \ + (! CGAL_USE_LEDA) + +int main() +{ +// bool UNTESTED_TRAITS_AS_LEDA_IS_NOT_INSTALLED; + std::cout << std::endl + << "NOTE: LEDA is not installed, " + << "skipping the test ..." + << std::endl; + return 0; +} + +#elif (TEST_TRAITS == ALGEBRAIC_TRAITS) && \ + (TEST_NT == CGAL_GMPZ_NT || TEST_NT == CGAL_GMPQ_NT) && \ + ! (CGAL_USE_GMP && CGAL_USE_MPFI) + +int main() +{ + +// bool UNTESTED_TRAITS_AS_GMP_OR_MPFI_IS_NOT_INSTALLED; + std::cout << std::endl + << "NOTE: GMP and/or MPFI are not installed, " + << "skipping the test ..." + << std::endl; + return 0; +} + +#elif (TEST_TRAITS == ALGEBRAIC_TRAITS) && \ + (TEST_NT == CORE_INT_NT) && \ + !CGAL_USE_CORE + +int main() +{ +// bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; + std::cout << std::endl + << "NOTE: CORE is not installed, " + << "skipping the test ..." + << std::endl; + return 0; +} + + +#else + +#include "test_traits.h" +#include "Point_location_dynamic_test.h" + +bool test1(const char* points_filename, const char* xcurves_filename, + const char* curves_filename, const char* commands_filename, + const char* queries_filename) +{ + Point_location_dynamic_test pl_test; + pl_test.set_filenames(points_filename, xcurves_filename, curves_filename, + commands_filename, queries_filename); + + if (!pl_test.allocate_arrangement()) return false; + if (!pl_test.construct_pl_strategies()) return false; + if (!pl_test.init()) return -1; + if (!pl_test.construct_arrangement()) return false; + if (!pl_test.perform()) return -1; + + pl_test.clear(); + pl_test.deallocate_arrangement(); + pl_test.deallocate_pl_strategies(); + + return true; +} + +int main(int argc, char * argv[]) +{ +#if TEST_TRAITS == ALGEBRAIC_TRAITS + CGAL::set_pretty_mode(std::cout); + CGAL::set_pretty_mode(std::cerr); +#endif + + if (argc < 5) { + std::cout << "Usage: " << argv[0] + << " point-file xcurve-file curve-file command-file query-file" + << std::endl; + std::cout << "point-file - the input point file" << std::endl; + std::cout << "xcurve-file - the input x-monotone curves file" << std::endl; + std::cout << "command-file - the command file" << std::endl; + std::cout << "curve-file - the input curve file" << std::endl; + return -1; + } + + int success = 0; + + // Test 1 + for (int i = 1; i < argc; i += 5) { + const char* points_filename = argv[i]; + const char* xcurves_filename = argv[i+1]; + const char* curves_filename = argv[i+2]; + const char* commands_filename = argv[i+3]; + const char* queries_filename = argv[i+4]; + + if (!test1(points_filename, xcurves_filename, + curves_filename, commands_filename, queries_filename)) + { + std::cout << "ERROR : " << argv[0] << " " << points_filename << " " + << xcurves_filename << " " << curves_filename << " " + << commands_filename << " " << queries_filename << std::endl; + success = -1; + } + } + return success; +} + +#endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic_segments.cmd b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic_segments.cmd new file mode 100644 index 00000000000..f545bac9303 --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_dynamic_segments.cmd @@ -0,0 +1 @@ +./data/empty.zero ./data/point_location_segments/xcurves/test10.txt ./data/empty.zero ./data/point_location_segments/ops/test10.txt ./data/point_location_segments/queries/test10.txt diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_linear.cmd b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_linear.cmd new file mode 100644 index 00000000000..fdbe9cf954a --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_linear.cmd @@ -0,0 +1,3 @@ +./data/empty.zero ./data/empty.zero ./data/point_location_linear/curves/test01.txt ./data/point_location_linear/queries/test01.txt +./data/empty.zero ./data/point_location_linear/xcurves/test02.txt ./data/empty.zero ./data/point_location_linear/queries/test02.txt +./data/empty.zero ./data/empty.zero ./data/point_location_linear/curves/test03.txt ./data/point_location_linear/queries/test03.txt diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_segments.cmd b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_segments.cmd new file mode 100644 index 00000000000..65cfde10e8a --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/point_location_segments.cmd @@ -0,0 +1,9 @@ +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test01.txt ./data/point_location_segments/queries/test01.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test02.txt ./data/point_location_segments/queries/test02.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test03.txt ./data/point_location_segments/queries/test03.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test04.txt ./data/point_location_segments/queries/test04.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test05.txt ./data/point_location_segments/queries/test05.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test06.txt ./data/point_location_segments/queries/test06.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test07.txt ./data/point_location_segments/queries/test07.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test08.txt ./data/point_location_segments/queries/test08.txt +./data/empty.zero ./data/empty.zero ./data/point_location_segments/curves/test09.txt ./data/point_location_segments/queries/test09.txt diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp index 6ba223f4fe0..f92538c969b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_rational_function_traits_2.cpp @@ -1,13 +1,27 @@ +#include + #include -#include //NT +#if !defined(CGAL_USE_CORE) +int main() +{ +// bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; + std::cout << std::endl + << "NOTE: Core is not installed, " + << "skipping the test ..." + << std::endl; + return 0; +} +#else + +#include #include //Algebraic Kernel #include //Traits #include //Arrangement #include #include -typedef CORE::BigInt Number_type; +typedef CGAL::CORE_arithmetic_kernel::Integer Number_type; typedef CGAL::Algebraic_kernel_d_1 AK1; typedef CGAL::Arr_rational_function_traits_2 Traits_2; typedef CGAL::Arrangement_2 Arrangement_2; @@ -296,3 +310,5 @@ int main(int argc, char* argv[]) } return 0; } + +#endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp index 937b5fd0df0..57bbb41c9d6 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp @@ -61,9 +61,6 @@ int main () #else -#include -#include - #include "test_traits.h" #include "Traits_test.h" @@ -74,9 +71,11 @@ int main (int argc, char * argv[]) CGAL::set_pretty_mode(std::cerr); #endif - Traits_test test(argc, argv); - bool rc = test.start(); - return (rc) ? 0 : -1; + Traits_test test; + if (!test.parse(argc, argv)) return -1; + if (!test.init()) return -1; + if (!test.perform()) return -1; + return 0; } #endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_adaptor.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_adaptor.cpp index da67e5570a3..21bd12917b5 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_adaptor.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits_adaptor.cpp @@ -10,7 +10,9 @@ int main (int argc, char * argv[]) { - Traits_adaptor_test test(argc, argv); - bool rc = test.start(); - return (rc) ? 0 : -1; + Traits_adaptor_test test; + if (!test.parse(argc, argv)) return -1; + if (!test.init()) return -1; + if (!test.perform()) return -1; + return 0; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp index 14cb6ed62d8..64120e97803 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vert_ray_shoot_vert_segments.cpp @@ -3,6 +3,7 @@ #include #include #include +#include template void vertical_ray_shooting_query @@ -62,6 +63,7 @@ typedef Traits_2::X_monotone_curve_2 Segment_2; typedef CGAL::Arrangement_2 Arrangement_2; typedef CGAL::Arr_simple_point_location Simple_pl; typedef CGAL::Arr_walk_along_line_point_location Walk_pl; +typedef CGAL::Arr_trapezoid_ric_point_location RIC_pl; int main () { @@ -69,6 +71,7 @@ int main () Arrangement_2 arr; Simple_pl simple_pl (arr); Walk_pl walk_pl (arr); + RIC_pl ric_pl (arr); insert (arr, Segment_2 (Point_2 (0, 0), Point_2 (0, 1))); insert (arr, Segment_2 (Point_2 (0, 3), Point_2 (0, 4))); @@ -82,25 +85,31 @@ int main () vertical_ray_shooting_query (simple_pl, true, q1); vertical_ray_shooting_query (walk_pl, true, q1); + vertical_ray_shooting_query (ric_pl, true, q1); vertical_ray_shooting_query (simple_pl, false, q1); vertical_ray_shooting_query (walk_pl, false, q1); + vertical_ray_shooting_query (ric_pl, false, q1); Point_2 q2 (0, 1); vertical_ray_shooting_query (simple_pl, true, q2); vertical_ray_shooting_query (walk_pl, true, q2); + vertical_ray_shooting_query (ric_pl, true, q2); vertical_ray_shooting_query (simple_pl, false, q2); vertical_ray_shooting_query (walk_pl, false, q2); - + vertical_ray_shooting_query (ric_pl, false, q2); + Point_2 q3 (0, 3); vertical_ray_shooting_query (simple_pl, true, q3); vertical_ray_shooting_query (walk_pl, true, q3); + vertical_ray_shooting_query (ric_pl, true, q3); vertical_ray_shooting_query (simple_pl, false, q3); vertical_ray_shooting_query (walk_pl, false, q3); + vertical_ray_shooting_query (ric_pl, false, q3); // Insert additional curves and perform the ray-shooting queries again. insert (arr, Segment_2 (Point_2 (-1, 0), Point_2 (1, 0))); @@ -110,21 +119,27 @@ int main () vertical_ray_shooting_query (simple_pl, true, q1); vertical_ray_shooting_query (walk_pl, true, q1); + vertical_ray_shooting_query (ric_pl, true, q1); vertical_ray_shooting_query (simple_pl, false, q1); vertical_ray_shooting_query (walk_pl, false, q1); + vertical_ray_shooting_query (ric_pl, false, q1); vertical_ray_shooting_query (simple_pl, true, q2); vertical_ray_shooting_query (walk_pl, true, q2); + vertical_ray_shooting_query (ric_pl, true, q2); vertical_ray_shooting_query (simple_pl, false, q2); vertical_ray_shooting_query (walk_pl, false, q2); - + vertical_ray_shooting_query (ric_pl, false, q2); + vertical_ray_shooting_query (simple_pl, true, q3); vertical_ray_shooting_query (walk_pl, true, q3); + vertical_ray_shooting_query (ric_pl, true, q3); vertical_ray_shooting_query (simple_pl, false, q3); vertical_ray_shooting_query (walk_pl, false, q3); + vertical_ray_shooting_query (ric_pl, false, q3); return (0); } diff --git a/BGL/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h b/BGL/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h index 3bae9465832..9b6e37fe93f 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_Polyhedron_3.h @@ -24,12 +24,7 @@ #include -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM -# define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS -#else -# define CGAL_HDS_PARAM_ class HDS -#endif - +#define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS // // NOTE: The BGL algorithms are NOT const-correct: i.e., they take a "G const&" diff --git a/BGL/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h b/BGL/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h index d03eaa8d53b..6707078bdad 100644 --- a/BGL/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h +++ b/BGL/include/CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h @@ -26,11 +26,7 @@ #include #include -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM -# define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS -#else -# define CGAL_HDS_PARAM_ class HDS -#endif +#define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS // // NOTE: The BGL algorithms are NOT const-correct: i.e., they take a "G const&" diff --git a/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h b/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h index 03b4540e0dd..9e606e605f1 100644 --- a/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h +++ b/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h @@ -24,11 +24,7 @@ #include #include -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM -# define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS -#else -# define CGAL_HDS_PARAM_ class HDS -#endif +#define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS namespace CGAL { diff --git a/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h b/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h index 4c3a94f4d40..12517fdfe0e 100644 --- a/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h +++ b/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h @@ -287,7 +287,7 @@ split_points( RandomAccessIter begin, RandomAccessIter end, template< class ForwardIter, class Traits > -void dump_points( ForwardIter begin, ForwardIter end, Traits traits, +void dump_points( ForwardIter begin, ForwardIter end, Traits /* traits */, int dim ) { while( begin != end ) { std::cout << Traits::min_coord( *begin, dim ) << " "; @@ -297,7 +297,7 @@ void dump_points( ForwardIter begin, ForwardIter end, Traits traits, } template< class ForwardIter, class Traits > -void dump_intervals( ForwardIter begin, ForwardIter end, Traits traits, +void dump_intervals( ForwardIter begin, ForwardIter end, Traits /* traits */, int dim ) { while( begin != end ) { std::cout << "[" << Traits::min_coord( *begin, dim ) << "," @@ -308,7 +308,7 @@ void dump_intervals( ForwardIter begin, ForwardIter end, Traits traits, } template< class ForwardIter, class Traits > -void dump_box_numbers( ForwardIter begin, ForwardIter end, Traits traits ) { +void dump_box_numbers( ForwardIter begin, ForwardIter end, Traits /* traits */ ) { while( begin != end ) { std::cout << Traits::id( *begin ) << " "; ++begin; diff --git a/Box_intersection_d/include/CGAL/box_intersection_d.h b/Box_intersection_d/include/CGAL/box_intersection_d.h index 99e5d900683..22b1e01bc7b 100644 --- a/Box_intersection_d/include/CGAL/box_intersection_d.h +++ b/Box_intersection_d/include/CGAL/box_intersection_d.h @@ -347,7 +347,7 @@ void box_intersection_all_pairs_d( // - make all default parameters explicit overloads (workaround) template< class ForwardIter, class Callback, class BoxTraits > void box_self_intersection_all_pairs_d( - ForwardIter begin1, ForwardIter end1, Callback callback, BoxTraits traits) + ForwardIter begin1, ForwardIter end1, Callback callback, BoxTraits /* traits */) { typedef Box_intersection_d::Predicate_traits_d Traits; Box_intersection_d::all_pairs( begin1, end1, callback, Traits()); diff --git a/Box_intersection_d/test/Box_intersection_d/automated_test.cpp b/Box_intersection_d/test/Box_intersection_d/automated_test.cpp index 5a8a9baa4dd..13f1b975434 100644 --- a/Box_intersection_d/test/Box_intersection_d/automated_test.cpp +++ b/Box_intersection_d/test/Box_intersection_d/automated_test.cpp @@ -52,7 +52,7 @@ operator()( const char* filename1, const char* filename2 ) std::cout << std::endl; typename Uti1::Counter_callback callback0; - typename Uti1::template Storage_callback<> + typename Uti1::template Storage_callback callback1( result_all_pairs ), callback2( result_scan ), callback3( result_tree ); diff --git a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt index 5f45072801d..a2e2a902c19 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt @@ -7,25 +7,89 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) endif() endif() +macro( remove_leading_zero var ) + string(SUBSTRING "${${var}}" 0 1 ONECHAR) + string(COMPARE EQUAL "${ONECHAR}" "0" ISZERO) + if (${ISZERO}) + string(SUBSTRING "${${var}}" 1 1 ONECHAR) + set(${var} ${ONECHAR}) + endif() +endmacro() + + #path where to build libraries set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") -find_package(CGAL QUIET COMPONENTS Core ) set( IPE_VERSION "AUTODETECT" CACHE STRING "The version of Ipe. Only 6 and 7 are supported.") +set ( IPELET_INSTALL_DIR ${IPELET_INSTALL_DIR} CACHE STRING "The folder where ipelets will be installed, relative to CMAKE_INSTALL_PREFIX" ) + +find_package(CGAL QUIET COMPONENTS Core IPE) if ( CGAL_FOUND ) include( ${CGAL_USE_FILE} ) - find_package(IPE) + + if ( IPE_FOUND ) + #check IPE version + if (${IPE_VERSION} STREQUAL "AUTODETECT") + FILE(READ "${IPE_INCLUDE_DIR}/ipebase.h" IPEBASE_H) + STRING(REGEX MATCH "IPELIB_VERSION[ ]*=[ ]*([67])([0-9][0-9])([0-9][0-9]);" found_ipe_version "${IPEBASE_H}") + if (found_ipe_version) + set(IPE_VERSION ${CMAKE_MATCH_1}) + set(IPE_MINOR_VERSION_1 ${CMAKE_MATCH_2}) + set(IPE_MINOR_VERSION_2 ${CMAKE_MATCH_3}) + endif() + endif() + if (${IPE_VERSION} EQUAL "7") + set(WITH_IPE_7 ON) + elseif(${IPE_VERSION} EQUAL "6") + set(WITH_IPE_7 OFF) + else() + message("-- Error: ${IPE_VERSION} is not a supported version of IPE (only 6 and 7 are).") + set(IPE_FOUND FALSE) + endif() + endif() + + if ( IPE_FOUND ) - include_directories(BEFORE ../../include) - include_directories(include/CGAL_ipelets) - include_directories(${IPE_INCLUDE_DIR}) - link_directories( ${IPE_LIBRARY_DIR} ) - if (WITH_IPE_7) add_definitions(-DCGAL_USE_IPE_7) endif() + + message("-- Using IPE version ${IPE_VERSION} compatibility.") + + #setting installation directory + get_filename_component(IPE_LIBRARY_DIR ${IPE_LIBRARIES} PATH) + if (IPE_FOUND AND NOT IPELET_INSTALL_DIR) + if (WITH_IPE_7) + remove_leading_zero(IPE_MINOR_VERSION_1) + remove_leading_zero(IPE_MINOR_VERSION_2) + set(INSTALL_PATHS ${INSTALL_PATHS} "${IPE_LIBRARY_DIR}/ipe/7.${IPE_MINOR_VERSION_1}.${IPE_MINOR_VERSION_2}/ipelets/") + find_path(IPELET_INSTALL_DIR + NAMES libgoodies.lua goodies.lua + PATHS ${INSTALL_PATHS} + ENV IPELETPATH + ) + else() + foreach (VER RANGE 28 40) + string(REPLACE XX ${VER} PATHC "${IPE_LIBRARY_DIR}/ipe/6.0preXX/ipelets/" ) + set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) + endforeach() + set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) + set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib64/ipe/6.0/ipelets) + set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib/ipe/6.0/ipelets) + + + find_library(IPELET_INSTALL_DIR_FILES + NAMES align + PATHS ${INSTALL_PATHS} + ENV IPELETPATH + ) + if (IPELET_INSTALL_DIR_FILES) + get_filename_component(IPELET_INSTALL_DIR ${IPELET_INSTALL_DIR_FILES} PATH) + endif() + endif() + endif() set(CGAL_IPELETS ${CGAL_IPELETS}) set(CGAL_IPELETS ${CGAL_IPELETS} alpha_shapes) @@ -44,12 +108,11 @@ if ( CGAL_FOUND ) set(CGAL_IPELETS ${CGAL_IPELETS} skeleton) set(CGAL_IPELETS ${CGAL_IPELETS} triangulation) - foreach(IPELET ${CGAL_IPELETS}) add_library(CGAL_${IPELET} MODULE ${IPELET}.cpp) add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_${IPELET}) - target_link_libraries( CGAL_${IPELET} ipe) if ( IPELET_INSTALL_DIR ) + message(STATUS "Set Ipelets install dir: ${IPELET_INSTALL_DIR}") install(TARGETS CGAL_${IPELET} DESTINATION ${IPELET_INSTALL_DIR}) if (WITH_IPE_7) install(FILES ./lua/libCGAL_${IPELET}.lua DESTINATION ${IPELET_INSTALL_DIR}) #only for ipe 7 @@ -58,14 +121,11 @@ if ( CGAL_FOUND ) endforeach(IPELET) #example in doc not installed add_library(simple_triangulation MODULE simple_triangulation.cpp) - target_link_libraries( simple_triangulation ipe ) add_to_cached_list(CGAL_EXECUTABLE_TARGETS simple_triangulation) else() message(STATUS "NOTICE: This program requires the Ipe include files and library, and will not be compiled.") endif() else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - endif() diff --git a/CGAL_ipelets/doc_tex/CGAL_ipelets/cgal_ipelets.tex b/CGAL_ipelets/doc_tex/CGAL_ipelets/cgal_ipelets.tex index fb1250ff14d..dc9e18b6398 100644 --- a/CGAL_ipelets/doc_tex/CGAL_ipelets/cgal_ipelets.tex +++ b/CGAL_ipelets/doc_tex/CGAL_ipelets/cgal_ipelets.tex @@ -45,7 +45,7 @@ the demo directory of this package. To install them you need to go to the demo directory of the package and run cmake. The compilation of these demo requires the source tree and the library of Ipe. If your Ipe installation is not detected you need to set the cmake -variables \ccc{IPE_INCLUDE_DIR} and \ccc{IPE_LIBRARY_DIR}. If you want +variables \ccc{IPE_INCLUDE_DIR} and \ccc{IPE_LIBRARIES}. If you want to install ipelets automatically (using \ccc{make install} for example) you also need to set the cmake variable \ccc{IPELET_INSTALL_DIR}, if the ipelet installation path has not already been detected. diff --git a/CGALimageIO/examples/CGALimageIO/convert_raw_image_to_inr.cpp b/CGALimageIO/examples/CGALimageIO/convert_raw_image_to_inr.cpp index b6fa0846604..941ff31d4f6 100644 --- a/CGALimageIO/examples/CGALimageIO/convert_raw_image_to_inr.cpp +++ b/CGALimageIO/examples/CGALimageIO/convert_raw_image_to_inr.cpp @@ -2,7 +2,7 @@ #include #include #include -#include \ +#include #define SHOW(attribut) "\n "#attribut": " << image->attribut #define SHOWENUM(enumitem) #enumitem"=" << enumitem diff --git a/CGALimageIO/include/CGAL/Image_3.h b/CGALimageIO/include/CGAL/Image_3.h index c726062decc..bf897af6228 100644 --- a/CGALimageIO/include/CGAL/Image_3.h +++ b/CGALimageIO/include/CGAL/Image_3.h @@ -247,7 +247,7 @@ Image_3::trilinear_interpolation(const Coord_type& x, lz < 0 || lz >= dimz-1 || ly >= dimy-1 || - lz >= dimx-1) + lx >= dimx-1) { return transform(value_outside); } diff --git a/CGALimageIO/include/CGAL/export/ImageIO.h b/CGALimageIO/include/CGAL/export/ImageIO.h old mode 100755 new mode 100644 diff --git a/CGALimageIO/src/CGALImageIO/CMakeLists.txt b/CGALimageIO/src/CGALImageIO/CMakeLists.txt index 342fd815730..c5aa26e526b 100644 --- a/CGALimageIO/src/CGALImageIO/CMakeLists.txt +++ b/CGALimageIO/src/CGALImageIO/CMakeLists.txt @@ -1,25 +1,7 @@ -project (CGAL_ImageIO) - -# Minimal version of CMake: -cmake_minimum_required(VERSION 2.6.2) +message("Configuring libCGAL_ImageIO") -# Tested version: -if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) - if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) - cmake_policy(VERSION 2.8.4) - else() - cmake_policy(VERSION 2.6) - endif() -endif() - -if ( NOT CGAL_FOUND ) - find_package(CGAL REQUIRED) -endif() - -include(${CGAL_USE_FILE}) - -find_package(ZLIB) -find_package(OpenGL) +find_package( OpenGL ) +find_package( ZLIB ) #option(WITH_VTK "Add VTK support to the CGAL ImageIO library." OFF) @@ -28,8 +10,6 @@ if(WITH_VTK) endif(WITH_VTK) if(OPENGL_FOUND) - get_dependency_version(OPENGL OpenGL) - message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" ) message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" ) @@ -38,8 +18,6 @@ if(OPENGL_FOUND) if(ZLIB_FOUND) get_dependency_version(ZLIB) - message( STATUS "ZLib include: ${ZLIB_INCLUDE_DIR}" ) - message( STATUS "ZLib libraries: ${ZLIB_LIBRARY}" ) cache_set(CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ) cache_set(CGAL_ImageIO_3RD_PARTY_LIBRARIES ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ${ZLIB_LIBRARY} ) cache_set(CGAL_ImageIO_3RD_PARTY_DEFINITIONS "-DCGAL_USE_ZLIB") @@ -68,9 +46,13 @@ if(OPENGL_FOUND) add_config_flag( CGAL_HAS_IMAGEIO ) endif() + use_essential_libs() + include_directories( ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS} ) - build_cgal_library( CGAL_ImageIO CGALImageIO "") + link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + + collect_cgal_library( CGAL_ImageIO CGALImageIO "") add_dependencies( CGAL_ImageIO CGAL ) @@ -78,6 +60,8 @@ if(OPENGL_FOUND) target_link_libraries( CGAL_ImageIO ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_ImageIO_3RD_PARTY_LIBRARIES} ) +message("libCGAL_ImageIO is configured") + else(OPENGL_FOUND) message( STATUS "CGAL_ImageIO needs OpenGL, cannot be configured.") endif(OPENGL_FOUND) @@ -85,3 +69,4 @@ endif(OPENGL_FOUND) if(NOT ZLIB_FOUND) message( STATUS "NOTICE: CGAL_ImageIO needs ZLib to read compressed files. That feature will not be activated.") endif(NOT ZLIB_FOUND) + diff --git a/CMakeLists.txt b/CMakeLists.txt index 966b29cdc85..f8c4637b0b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ # Top level CMakeLists.txt for CGAL-branchbuild -project(CGAL CXX) +message( "== CMake setup ==" ) +project(CGAL CXX C) # Minimal version of CMake: if(WIN32) @@ -94,6 +95,7 @@ endif() # 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) +message( "== CMake setup (DONE) ==\n" ) # and finally start actual build add_subdirectory( Installation ) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 7f3e1f30e60..e0dbe23b017 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -988,36 +988,35 @@ namespace CartesianKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; public: - typedef FT result_type; + template + struct result { + typedef FT type; + }; + + template + struct result { + typedef const FT& type; + }; - const result_type& + const FT& operator()( const Circle_2& c) const { return c.rep().squared_radius(); } - result_type + FT operator()( const Point_2& /*p*/) const { return FT(0); } - result_type + FT operator()( const Point_2& p, const Point_2& q) const { return squared_radiusC2(p.x(), p.y(), q.x(), q.y()); } - result_type + FT operator()( const Point_2& p, const Point_2& q, const Point_2& r) const { return squared_radiusC2(p.x(), p.y(), q.x(), q.y(), r.x(), r.y()); } }; } //namespace CartesianKernelFunctors -#ifndef CGAL_CFG_DONT_OVERLOAD_TOO_MUCH -template < typename K> -struct Qualified_result_of, - typename K::Circle_2> -{ - typedef typename K::FT const & type; -}; -#endif - // For the non specialized template will do the right thing, // namely return a copy of an FT @@ -1104,22 +1103,22 @@ namespace CartesianKernelFunctors { template - class Compute_x_2 : Has_qrt + class Compute_x_2 { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_2& p) const { return p.rep().x(); } - const result_type & + result_type operator()(const Vector_2& v) const { return v.rep().x(); @@ -1127,22 +1126,22 @@ namespace CartesianKernelFunctors { }; template - class Compute_x_3 : Has_qrt + class Compute_x_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().x(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().x(); @@ -1151,22 +1150,22 @@ namespace CartesianKernelFunctors { template - class Compute_y_2 : Has_qrt + class Compute_y_2 { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_2& p) const { return p.rep().y(); } - const result_type & + result_type operator()(const Vector_2& v) const { return v.rep().y(); @@ -1175,22 +1174,22 @@ namespace CartesianKernelFunctors { template - class Compute_y_3 : Has_qrt + class Compute_y_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().y(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().y(); @@ -1198,22 +1197,22 @@ namespace CartesianKernelFunctors { }; template - class Compute_z_3 : Has_qrt + class Compute_z_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().z(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().z(); @@ -1223,15 +1222,15 @@ namespace CartesianKernelFunctors { template - class Compute_dx_2 : public Has_qrt + class Compute_dx_2 { typedef typename K::FT FT; - typedef typename K::Direction_2 Direction_2; + typedef typename K::Direction_2 Direction_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Direction_2& d) const { return d.rep().dx(); @@ -1239,15 +1238,15 @@ namespace CartesianKernelFunctors { }; template - class Compute_dx_3 : public Has_qrt + class Compute_dx_3 { typedef typename K::FT FT; - typedef typename K::Direction_3 Direction_3; + typedef typename K::Direction_3 Direction_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Direction_3& d) const { return d.rep().dx(); @@ -1255,15 +1254,15 @@ namespace CartesianKernelFunctors { }; template - class Compute_dy_2 : public Has_qrt + class Compute_dy_2 { typedef typename K::FT FT; - typedef typename K::Direction_2 Direction_2; + typedef typename K::Direction_2 Direction_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Direction_2& d) const { return d.rep().dy(); @@ -1271,15 +1270,15 @@ namespace CartesianKernelFunctors { }; template - class Compute_dy_3 : public Has_qrt + class Compute_dy_3 { typedef typename K::FT FT; - typedef typename K::Direction_3 Direction_3; + typedef typename K::Direction_3 Direction_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Direction_3& d) const { return d.rep().dy(); @@ -1287,15 +1286,15 @@ namespace CartesianKernelFunctors { }; template - class Compute_dz_3 : public Has_qrt + class Compute_dz_3 { typedef typename K::FT FT; typedef typename K::Direction_3 Direction_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Direction_3& d) const { return d.rep().dz(); @@ -1303,68 +1302,68 @@ namespace CartesianKernelFunctors { }; template - class Compute_hx_2 : public Has_qrt - { - typedef typename K::FT FT; - typedef typename K::Point_2 Point_2; - typedef typename K::Vector_2 Vector_2; - - public: - typedef FT result_type; - - const result_type & - operator()(const Point_2& p) const - { - return p.rep().hx(); - } - - const result_type & - operator()(const Vector_2& v) const - { - return v.rep().hx(); - } - }; - - template - class Compute_hx_3 : public Has_qrt - { - typedef typename K::FT FT; - typedef typename K::Point_3 Point_3; - typedef typename K::Vector_3 Vector_3; - - public: - typedef FT result_type; - - const result_type & - operator()(const Point_3& p) const - { - return p.rep().hx(); - } - - const result_type & - operator()(const Vector_3& v) const - { - return v.rep().hx(); - } - }; - - template - class Compute_hy_2 : public Has_qrt + class Compute_hx_2 { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type + operator()(const Point_2& p) const + { + return p.rep().hx(); + } + + result_type + operator()(const Vector_2& v) const + { + return v.rep().hx(); + } + }; + + template + class Compute_hx_3 + { + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; + typedef typename K::Vector_3 Vector_3; + + public: + typedef const FT& result_type; + + result_type + operator()(const Point_3& p) const + { + return p.rep().hx(); + } + + result_type + operator()(const Vector_3& v) const + { + return v.rep().hx(); + } + }; + + template + class Compute_hy_2 + { + typedef typename K::FT FT; + typedef typename K::Point_2 Point_2; + typedef typename K::Vector_2 Vector_2; + + public: + typedef const FT& result_type; + + result_type operator()(const Point_2& p) const { return p.rep().hy(); } - const result_type & + result_type operator()(const Vector_2& v) const { return v.rep().hy(); @@ -1372,22 +1371,22 @@ namespace CartesianKernelFunctors { }; template - class Compute_hy_3 : public Has_qrt + class Compute_hy_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().hy(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().hy(); @@ -1395,22 +1394,22 @@ namespace CartesianKernelFunctors { }; template - class Compute_hz_3 : public Has_qrt + class Compute_hz_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().hz(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().hz(); @@ -1418,22 +1417,22 @@ namespace CartesianKernelFunctors { }; template - class Compute_hw_2 : public Has_qrt + class Compute_hw_2 { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_2& p) const { return p.rep().hw(); } - const result_type & + result_type operator()(const Vector_2& v) const { return v.rep().hw(); @@ -1441,22 +1440,22 @@ namespace CartesianKernelFunctors { }; template - class Compute_hw_3 : public Has_qrt + class Compute_hw_3 { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().hw(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().hw(); @@ -1465,15 +1464,15 @@ namespace CartesianKernelFunctors { template - class Compute_xmin_2 : public Has_qrt + class Compute_xmin_2 { typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Iso_rectangle_2& r) const { return (r.min)().x(); @@ -1481,15 +1480,15 @@ namespace CartesianKernelFunctors { }; template - class Compute_xmax_2 : public Has_qrt + class Compute_xmax_2 { typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Iso_rectangle_2& r) const { return (r.max)().x(); @@ -1497,15 +1496,15 @@ namespace CartesianKernelFunctors { }; template - class Compute_ymin_2 : public Has_qrt + class Compute_ymin_2 { typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Iso_rectangle_2& r) const { return (r.min)().y(); @@ -1513,15 +1512,15 @@ namespace CartesianKernelFunctors { }; template - class Compute_ymax_2 : public Has_qrt + class Compute_ymax_2 { typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef FT result_type; + typedef const FT& result_type; - const result_type & + result_type operator()(const Iso_rectangle_2& r) const { return (r.max)().y(); @@ -3346,7 +3345,15 @@ namespace CartesianKernelFunctors { typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Triangle_2 Triangle_2; public: - typedef Point_2 result_type; + template + struct result { + typedef const Point_2& type; + }; + + template + struct result { + typedef Point_2 type; + }; const Point_2 & operator()( const Segment_2& s, int i) const @@ -3370,22 +3377,6 @@ namespace CartesianKernelFunctors { } //namespace CartesianKernelFunctors -#ifndef CGAL_CFG_DONT_OVERLOAD_TOO_MUCH -template < typename K> -struct Qualified_result_of, typename K::Segment_2, int > -{ - typedef typename K::Point_2 const & type; -}; - -template < typename K> -struct Qualified_result_of, typename K::Triangle_2, int > -{ - typedef typename K::Point_2 const & type; -}; -#endif - -// For Iso_rectangle the non specialized template will do the right thing, namely return a copy of a point - namespace CartesianKernelFunctors { template diff --git a/Circular_kernel_2/include/CGAL/Circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_arc_2.h index 6385d19eee7..067a6058e4f 100644 --- a/Circular_kernel_2/include/CGAL/Circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_arc_2.h @@ -110,33 +110,25 @@ public: {} - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & + typename boost::result_of::type source() const { return typename R::Construct_circular_source_vertex_2()(*this); } - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & + typename boost::result_of::type target() const { return typename R::Construct_circular_target_vertex_2()(*this); } - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & + typename boost::result_of::type left() const { return typename R::Construct_circular_min_vertex_2()(*this); } - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & + typename boost::result_of::type right() const { return typename R::Construct_circular_max_vertex_2()(*this); @@ -152,25 +144,19 @@ public: return typename R::Is_y_monotone_2()(*this); } - typename Qualified_result_of - ::type - // const Circle_2 & + typename boost::result_of::type supporting_circle() const { return typename R::Construct_circle_2()(*this); } - typename Qualified_result_of - ::type - // const Point_2 & + typename boost::result_of::type center() const { return typename R::Construct_center_2()(*this); } - typename Qualified_result_of - ::type - // const FT & + typename boost::result_of::type squared_radius() const { return typename R::Compute_squared_radius_2()(*this); diff --git a/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h b/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h index 778bc28e71c..356198f1aa9 100644 --- a/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_arc_point_2.h @@ -73,17 +73,15 @@ public: : RCircular_arc_point_2(typename R::Construct_circular_arc_point_2()(p)) {} - typename Qualified_result_of - ::type - //const Root_of_2 & + typename + boost::result_of::type x() const { return typename R::Compute_circular_x_2()(*this); } - typename Qualified_result_of - ::type - //const Root_of_2 & + typename + boost::result_of::type y() const { return typename R::Compute_circular_y_2()(*this); diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_on_circle_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_on_circle_2.h index 7657c0afd34..ded5728096b 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_on_circle_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_on_circle_2.h @@ -36,41 +36,33 @@ namespace CGAL { namespace CircularFunctors { template < class CK > - class Construct_circle_2 : public CK::Linear_kernel::Construct_circle_2 + class Construct_circle_2 : public CK::Linear_kernel::Construct_circle_2 { - public: - - typedef typename CK::Circular_arc_2 Circular_arc_2; - typedef typename CK::Linear_kernel::Construct_circle_2::result_type - result_type; + typedef typename CK::Linear_kernel::Construct_circle_2 Base_functor; - using CK::Linear_kernel::Construct_circle_2::operator(); + typedef typename CK::FT FT; + typedef typename CK::Linear_kernel::Point_2 Point_2; + public: + typedef typename Base_functor::result_type result_type; + + using Base_functor::operator(); + + typedef typename CK::Circular_arc_2 Circular_arc_2; result_type - operator() ( const typename CK::Polynomial_for_circles_2_2 &eq ) - { - return construct_circle_2(eq); - } + operator() ( const typename CK::Polynomial_for_circles_2_2 &eq ) { + return construct_circle_2(eq); + } - const result_type& - operator() (const Circular_arc_2 & a) const - { - return (a.rep().supporting_circle()); - } + result_type + operator() (const Circular_arc_2 & a) const { + return (a.rep().supporting_circle()); + } }; } // namespace CircularFunctors -#ifndef CGAL_CFG_DONT_OVERLOAD_TOO_MUCH - template < typename K> - struct Qualified_result_of, - typename K::Circular_arc_2> - { - typedef const typename K::Circle_2 & type; - }; -#endif - } // namespace CGAL #endif // CGAL_CIRCULAR_KERNEL_FUNCTION_OBJECTS_ON_CIRCLE_2_H diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h index 70084c4cea3..eed5c7a4d01 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/function_objects_polynomial_circular.h @@ -830,17 +830,15 @@ namespace CircularFunctors { template - class Compute_circular_x_2: Has_qrt + class Compute_circular_x_2 { typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Root_of_2 Root_of_2; public: + typedef const Root_of_2& result_type; - typedef Root_of_2 result_type; - typedef const result_type & qualified_result_type; - - qualified_result_type operator() (const Circular_arc_point_2 & a) const + result_type operator() (const Circular_arc_point_2 & a) const { return (a.rep().x()); } @@ -848,17 +846,16 @@ namespace CircularFunctors { template - class Compute_circular_y_2: Has_qrt - { + class Compute_circular_y_2 + { typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Root_of_2 Root_of_2; public: - typedef Root_of_2 result_type; - typedef const result_type & qualified_result_type; + typedef const Root_of_2& result_type; - qualified_result_type operator() (const Circular_arc_point_2 & a) const + result_type operator() (const Circular_arc_point_2 & a) const { return (a.rep().y()); } @@ -866,27 +863,21 @@ namespace CircularFunctors { template - class Construct_circular_min_vertex_2 : Has_qrt + class Construct_circular_min_vertex_2 { typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; public: + typedef const Circular_arc_point_2 & result_type; - typedef Circular_arc_point_2 result_type; - typedef const result_type & qualified_result_type; - - qualified_result_type operator() (const Circular_arc_2 & a) const + result_type operator() (const Circular_arc_2 & a) const { -// if (a.rep().Cache_minmax == 't') -// return (a.rep().source()); -// if (a.rep().Cache_minmax == 's') -// return (a.rep().target()); return (a.rep().left()); } - qualified_result_type operator() (const Line_arc_2 & a) const + result_type operator() (const Line_arc_2 & a) const { return (a.rep().left()); } @@ -894,7 +885,7 @@ namespace CircularFunctors { }; template - class Construct_circular_max_vertex_2: Has_qrt + class Construct_circular_max_vertex_2 { typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Line_arc_2 Line_arc_2; @@ -902,19 +893,14 @@ namespace CircularFunctors { public: - typedef Circular_arc_point_2 result_type; - typedef const result_type & qualified_result_type; + typedef const Circular_arc_point_2& result_type; - qualified_result_type operator() (const Circular_arc_2 & a) const + result_type operator() (const Circular_arc_2 & a) const { -// if (a.rep().Cache_minmax == 's') -// return (a.rep().source()); -// if (a.rep().Cache_minmax == 't') -// return (a.rep().target()); return (a.rep().right()); } - qualified_result_type operator() (const Line_arc_2 & a) const + result_type operator() (const Line_arc_2 & a) const { return (a.rep().right()); } @@ -922,7 +908,7 @@ namespace CircularFunctors { }; template - class Construct_circular_source_vertex_2: Has_qrt + class Construct_circular_source_vertex_2 { typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Line_arc_2 Line_arc_2; @@ -930,20 +916,19 @@ namespace CircularFunctors { public: - typedef Circular_arc_point_2 result_type; - typedef const result_type & qualified_result_type; + typedef const Circular_arc_point_2& result_type; - qualified_result_type operator() (const Circular_arc_2 & a) const + result_type operator() (const Circular_arc_2 & a) const { return a.rep().source(); } - qualified_result_type operator() (const Line_arc_2 & a) const + result_type operator() (const Line_arc_2 & a) const { return a.rep().source();} }; template - class Construct_circular_target_vertex_2: Has_qrt + class Construct_circular_target_vertex_2 { typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Line_arc_2 Line_arc_2; @@ -951,13 +936,12 @@ namespace CircularFunctors { public: - typedef Circular_arc_point_2 result_type; - typedef const result_type & qualified_result_type; + typedef const Circular_arc_point_2& result_type; - qualified_result_type operator() (const Circular_arc_2 & a) const + result_type operator() (const Circular_arc_2 & a) const { return a.rep().target();} - qualified_result_type operator() (const Line_arc_2 & a) const + result_type operator() (const Line_arc_2 & a) const { return a.rep().target();} }; @@ -1195,7 +1179,7 @@ namespace CircularFunctors { #ifndef CGAL_NO_DEPRECATED_CODE template - class Construct_supporting_circle_2: Has_qrt + class Construct_supporting_circle_2 { typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circle_2 Circle_2; @@ -1212,7 +1196,7 @@ namespace CircularFunctors { template - class Construct_supporting_line_2: Has_qrt + class Construct_supporting_line_2 { typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_2 Line_2; @@ -1233,32 +1217,27 @@ namespace CircularFunctors { class Construct_center_2 #ifndef CGAL_CFG_MATCHING_BUG_6 : public CK::Linear_kernel::Construct_center_2 - #else - : public Has_qrt #endif { typedef typename CK::Circular_arc_2 Circular_arc_2; - public: - - #ifndef CGAL_CFG_MATCHING_BUG_6 - typedef typename CK::Linear_kernel::Construct_center_2::result_type result_type; - using CK::Linear_kernel::Construct_center_2::operator(); - #else + public: + typedef typename CK::Linear_kernel::Construct_center_2::result_type result_type; +#ifndef CGAL_CFG_MATCHING_BUG_6 + using CK::Linear_kernel::Construct_center_2::operator(); +#else typedef typename CK::Linear_kernel LK; typedef typename LK::Construct_center_2 LK_Construct_center_2; - typedef typename CK::Point_2 Point_2; - typedef typename CK::Circle_2 Circle_2; - public: - typedef Point_2 result_type; + typedef typename CK::Point_2 Point_2; + typedef typename CK::Circle_2 Circle_2; - const result_type& - operator()( const Circle_2& c) const - { return LK_Construct_center_2()(c); } - - #endif - - const result_type& + public: + result_type + operator()( const Circle_2& c) const + { return LK_Construct_center_2()(c); } + +#endif + result_type operator()(const Circular_arc_2& c) const { return c.rep().center(); } @@ -1266,75 +1245,55 @@ namespace CircularFunctors { template class Compute_squared_radius_2 -#ifndef CGAL_CFG_MATCHING_BUG_6 - : public CK::Linear_kernel::Compute_squared_radius_2 -#endif { + + private: typedef typename CK::Circular_arc_2 Circular_arc_2; - public: - -#ifndef CGAL_CFG_MATCHING_BUG_6 - typedef typename CK::Linear_kernel::Compute_squared_radius_2::result_type result_type; - using CK::Linear_kernel::Compute_squared_radius_2::operator(); -#else - typedef typename CK::Linear_kernel LK; typedef typename LK::Compute_squared_radius_2 LK_Compute_squared_radius_2; typedef typename CK::FT FT; typedef typename CK::Point_2 Point_2; typedef typename CK::Circle_2 Circle_2; + typedef FT forwarded_result_type; public: - typedef FT result_type; + template + struct result { + typedef forwarded_result_type type; + }; + + template + struct result { + typedef const forwarded_result_type& type; + }; + + template + struct result { + typedef const forwarded_result_type& type; + }; - const result_type& + const forwarded_result_type& operator()( const Circle_2& c) const { return LK_Compute_squared_radius_2()(c); } - result_type + forwarded_result_type operator()( const Point_2& p) const { return LK_Compute_squared_radius_2()(p); } - result_type + forwarded_result_type operator()( const Point_2& p, const Point_2& q) const { return LK_Compute_squared_radius_2()(p, q); } - result_type + forwarded_result_type operator()( const Point_2& p, const Point_2& q, const Point_2& r) const { return LK_Compute_squared_radius_2()(p, q, r); } -#endif - - const result_type& + const forwarded_result_type& operator()(const Circular_arc_2& c) const { return c.rep().squared_radius(); } }; } // namespace CircularFunctors - -#ifndef CGAL_CFG_DONT_OVERLOAD_TOO_MUCH - template < typename K> - struct Qualified_result_of, - typename K::Circular_arc_2> - { - typedef typename K::Point_2 const & type; - }; - - template < typename K> - struct Qualified_result_of, - typename K::Circular_arc_2> - { - typedef typename K::FT const & type; - }; - - template < typename K> - struct Qualified_result_of, - typename K::Circle_2> - { - typedef typename K::FT const & type; - }; -#endif - } // namespace CGAL #endif // CGAL_CIRCULAR_KERNEL_FUNCTION_OBJECTS_POLYNOMIAL_CIRCULAR_H diff --git a/Circular_kernel_2/include/CGAL/Line_arc_2.h b/Circular_kernel_2/include/CGAL/Line_arc_2.h index d6904caf8b3..071c4aeb4b9 100644 --- a/Circular_kernel_2/include/CGAL/Line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Line_arc_2.h @@ -93,33 +93,25 @@ public: : RLine_arc_2(a) {} - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & + typename boost::result_of< typename R::Construct_circular_source_vertex_2(Line_arc_2)>::type source() const { return typename R::Construct_circular_source_vertex_2()(*this); } - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & + typename boost::result_of< typename R::Construct_circular_target_vertex_2(Line_arc_2)>::type target() const { return typename R::Construct_circular_target_vertex_2()(*this); } - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & left() const + typename boost::result_of< typename R::Construct_circular_min_vertex_2(Line_arc_2)>::type left() const { return typename R::Construct_circular_min_vertex_2()(*this); } - typename Qualified_result_of - ::type - //const Circular_arc_point_2 & right() const + typename boost::result_of< typename R::Construct_circular_max_vertex_2(Line_arc_2)>::type right() const { return typename R::Construct_circular_max_vertex_2()(*this); diff --git a/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/SphericalKernel.tex b/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/SphericalKernel.tex index 5b8504c517b..e553065f435 100644 --- a/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/SphericalKernel.tex +++ b/Circular_kernel_3/doc_tex/Circular_kernel_3_ref/SphericalKernel.tex @@ -130,9 +130,9 @@ constructions and other functionalities. \ccGlue \ccNestedType{Compute_circular_z_3}{Model of \ccc{SphericalKernel::ComputeCircularZ_3}.} -\ccNestedType{ComputeApproximateSquaredLength_3}{Model of \ccc{SphericalKernel::ComputeApproximateSquaredLength_3}.} +\ccNestedType{Compute_approximate_squared_length_3}{Model of \ccc{SphericalKernel::ComputeApproximateSquaredLength_3}.} \ccGlue -\ccNestedType{ComputeApproximateAngle_3}{Model of \ccc{SphericalKernel::ComputeApproximateAngle_3}.} +\ccNestedType{Compute_approximate_angle_3}{Model of \ccc{SphericalKernel::ComputeApproximateAngle_3}.} \ccHeading{Link with the algebraic kernel} diff --git a/Circular_kernel_3/include/CGAL/Circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_arc_3.h index 29862577adb..97b4631c342 100644 --- a/Circular_kernel_3/include/CGAL/Circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_arc_3.h @@ -120,22 +120,19 @@ namespace CGAL { : RCircular_arc_3(a) {} - typename Qualified_result_of - ::type + typename boost::result_of::type source() const { return typename R::Construct_circular_source_vertex_3()(*this); } - typename Qualified_result_of - ::type + typename boost::result_of::type target() const { return typename R::Construct_circular_target_vertex_3()(*this); } - typename Qualified_result_of - ::type + typename boost::result_of::type supporting_circle() const { return typename R::Construct_circle_3()(*this); diff --git a/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h b/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h index 6bc00d08866..2fb83aea446 100644 --- a/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_arc_point_3.h @@ -197,18 +197,15 @@ public: - typename Qualified_result_of::type - //const Root_of_2 & + typename boost::result_of::type x() const { return typename R::Compute_circular_x_3()(*this);} - typename Qualified_result_of::type - //const Root_of_2 & + typename boost::result_of::type y() const { return typename R::Compute_circular_y_3()(*this);} - typename Qualified_result_of::type - //const Root_of_2 & + typename boost::result_of::type z() const { return typename R::Compute_circular_z_3()(*this);} diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h index bfdc46386f9..d4d25291b50 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h @@ -107,47 +107,44 @@ template < class SK > \ CGAL_SPHERICAL_KERNEL_MACRO_FUNCTOR_COMPARE_(xyz) template - class Compute_circular_x_3: Has_qrt + class Compute_circular_x_3 { typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; - typedef typename SK::Root_of_2 Root_of_2; + typedef typename SK::Root_of_2 Root_of_2; public: - typedef Root_of_2 result_type; - typedef const result_type & qualified_result_type; + typedef const Root_of_2& result_type; - qualified_result_type operator() (const Circular_arc_point_3 & a) const + result_type operator() (const Circular_arc_point_3 & a) const { return (a.rep().x()); } }; template - class Compute_circular_y_3: Has_qrt + class Compute_circular_y_3 { typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; typedef typename SK::Root_of_2 Root_of_2; public: - typedef Root_of_2 result_type; - typedef const result_type & qualified_result_type; + typedef const Root_of_2& result_type; - qualified_result_type operator() (const Circular_arc_point_3 & a) const + result_type operator() (const Circular_arc_point_3 & a) const { return (a.rep().y()); } }; template - class Compute_circular_z_3: Has_qrt + class Compute_circular_z_3 { typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; typedef typename SK::Root_of_2 Root_of_2; public: - typedef Root_of_2 result_type; - typedef const result_type & qualified_result_type; + typedef const Root_of_2& result_type; - qualified_result_type operator() (const Circular_arc_point_3 & a) const + result_type operator() (const Circular_arc_point_3 & a) const { return (a.rep().z()); } }; @@ -415,25 +412,18 @@ template < class SK > \ template < class SK > class Construct_sphere_3 -#ifndef CGAL_CFG_MATCHING_BUG_6 - : public SK::Linear_kernel::Construct_sphere_3 -#endif { - typedef typename SK::Circular_arc_3 Circular_arc_3; - - public: - - typedef typename SK::Linear_kernel::Construct_sphere_3::result_type result_type; -#ifndef CGAL_CFG_MATCHING_BUG_6 - using SK::Linear_kernel::Construct_sphere_3::operator(); -#else + typedef typename SK::Circular_arc_3 Circular_arc_3; typedef typename SK::Linear_kernel LK; typedef typename LK::Point_3 Point_3; typedef typename LK::Circle_3 Circle_3; typedef typename LK::Sphere_3 Sphere_3; typedef typename LK::Construct_sphere_3 LK_Construct_sphere_3; typedef typename LK::FT FT; - + + public: + + typedef typename SK::Linear_kernel::Construct_sphere_3::result_type result_type; result_type operator()( Return_base_tag tag, const Point_3& center, const FT& squared_radius, @@ -496,11 +486,6 @@ template < class SK > \ operator() (const Circle_3 & c) const { return LK_Construct_sphere_3()(c); } - - - -#endif - result_type operator() ( const typename SK::Polynomial_for_spheres_2_3 &eq ) { return SphericalFunctors::construct_sphere_3(eq); } @@ -512,19 +497,8 @@ template < class SK > \ template < class SK > class Construct_plane_3 -#ifndef CGAL_CFG_MATCHING_BUG_6 - : public SK::Linear_kernel::Construct_plane_3 -#endif { - typedef typename SK::Circular_arc_3 Circular_arc_3; - - public: - - typedef typename SK::Linear_kernel::Construct_plane_3::result_type result_type; - -#ifndef CGAL_CFG_MATCHING_BUG_6 - using SK::Linear_kernel::Construct_plane_3::operator(); -#else + typedef typename SK::Circular_arc_3 Circular_arc_3; typedef typename SK::Linear_kernel LK; typedef typename LK::Construct_plane_3 LK_Construct_plane_3; typedef typename LK::RT RT; @@ -537,6 +511,10 @@ template < class SK > \ typedef typename LK::Plane_3 Plane_3; typedef typename LK::Circle_3 Circle_3; + public: + + typedef typename SK::Linear_kernel::Construct_plane_3::result_type result_type; + public: result_type @@ -603,8 +581,6 @@ template < class SK > \ operator()(const Circle_3 & c) const { return this->operator()(Return_base_tag(), c); } -#endif - result_type operator() ( const typename SK::Polynomial_1_3 &eq ) { return SphericalFunctors::construct_plane_3(eq); } @@ -617,32 +593,18 @@ template < class SK > \ template class Construct_line_3 -#ifndef CGAL_CFG_MATCHING_BUG_6 - - : public SK::Linear_kernel::Construct_line_3 -#endif { typedef typename SK::Line_arc_3 Line_arc_3; typedef typename SK::Line_3 Line_3; - - public: - - typedef typename SK::Linear_kernel::Construct_line_3::result_type - result_type; - - typedef const result_type & qualified_result_type; - -#ifndef CGAL_CFG_MATCHING_BUG_6 - using SK::Linear_kernel::Construct_line_3::operator(); -#else - typedef typename SK::Point_3 Point_3; typedef typename SK::Direction_3 Direction_3; typedef typename SK::Vector_3 Vector_3; typedef typename SK::Segment_3 Segment_3; typedef typename SK::Ray_3 Ray_3; + public: typedef typename SK::Linear_kernel::Construct_line_3 LK_Construct_line_3; - + typedef typename LK_Construct_line_3::result_type result_type; + result_type operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { return LK_Construct_line_3()(p, Vector_3(p, q)); } @@ -684,9 +646,8 @@ template < class SK > \ operator()(const Ray_3& r) const { return this->operator()(Return_base_tag(), r); } - -#endif - qualified_result_type operator() (const Line_arc_3 & a) const + const result_type& + operator() (const Line_arc_3 & a) const { return (a.rep().supporting_line()); } result_type @@ -696,10 +657,10 @@ template < class SK > \ }; template < class SK > - class Construct_circle_3 : public SK::Linear_kernel::Construct_circle_3 + class Construct_circle_3 { - public: - + typedef typename SK::Linear_kernel::Construct_circle_3 Extended; + typedef typename Extended::result_type forwarded_result_type; typedef typename SK::FT FT; typedef typename SK::Point_3 Point_3; typedef typename SK::Plane_3 Plane_3; @@ -710,17 +671,61 @@ template < class SK > \ typedef typename SK::Circular_arc_3 Circular_arc_3; typedef typename SK::Kernel_base::Circle_3 RCircle_3; typedef typename Circle_3::Rep Rep; + public: + template + struct result { + typedef forwarded_result_type type; + }; + + template + struct result { + typedef const forwarded_result_type& type; + }; - typedef typename SK::Linear_kernel::Construct_circle_3::result_type result_type; - typedef const result_type & qualified_result_type; + forwarded_result_type + operator()(const Point_3& p, const FT& sr, + const Plane_3& plane) const + { return Extended()(p, sr, plane); } - using SK::Linear_kernel::Construct_circle_3::operator(); + forwarded_result_type + operator() (const Point_3& p, const FT& sr, + const Vector_3& v) const + { return Extended()(p, sr, v); } - result_type + forwarded_result_type + operator() (const Point_3& p, const FT& sr, + const Direction_3& d) const + { return Extended()(p, sr, d); } + + forwarded_result_type + operator() (const Sphere_3& s1, const Sphere_3& s2) const + { return Extended()(s1, s2); } + + forwarded_result_type + operator() (const Plane_3& p, const Sphere_3& s) const + { return Extended()(p, s); } + + forwarded_result_type + operator() (const Sphere_3& s, const Plane_3& p) const + { return Extended()(p, s); } + + forwarded_result_type + operator() (const Plane_3& p, const Sphere_3& s, int a) const + { return Extended()(p, s, a); } + + forwarded_result_type + operator() (const Sphere_3& s, const Plane_3& p, int a) const + { return Extended()(p, s, a); } + + forwarded_result_type + operator()( const Point_3& p1, const Point_3& p2, const Point_3& p3) const + { return Extended()(p1, p2, p3); } + + forwarded_result_type operator() ( const typename SK::Polynomials_for_circle_3 &eq ) { return Rep(construct_circle_3(eq)); } - qualified_result_type + const forwarded_result_type& operator() (const Circular_arc_3 & a) const { return (a.rep().supporting_circle()); } @@ -882,39 +887,37 @@ template < class SK > \ }; template - class Construct_circular_min_vertex_3 : Has_qrt + class Construct_circular_min_vertex_3 { typedef typename SK::Line_arc_3 Line_arc_3; typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; public: - typedef Circular_arc_point_3 result_type; - typedef const result_type & qualified_result_type; + typedef const Circular_arc_point_3& result_type; - qualified_result_type operator() (const Line_arc_3 & a) const + result_type operator() (const Line_arc_3 & a) const { return (a.rep().lower_xyz_extremity()); } }; template - class Construct_circular_max_vertex_3 : Has_qrt + class Construct_circular_max_vertex_3 { typedef typename SK::Line_arc_3 Line_arc_3; typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; public: - typedef Circular_arc_point_3 result_type; - typedef const result_type & qualified_result_type; + typedef const Circular_arc_point_3& result_type; - qualified_result_type operator() (const Line_arc_3 & a) const + result_type operator() (const Line_arc_3 & a) const { return (a.rep().higher_xyz_extremity()); } }; template - class Construct_circular_source_vertex_3 : Has_qrt + class Construct_circular_source_vertex_3 { typedef typename SK::Line_arc_3 Line_arc_3; typedef typename SK::Circular_arc_3 Circular_arc_3; @@ -922,19 +925,18 @@ template < class SK > \ public: - typedef Circular_arc_point_3 result_type; - typedef const result_type & qualified_result_type; + typedef const Circular_arc_point_3& result_type; - qualified_result_type operator() (const Line_arc_3 & a) const + result_type operator() (const Line_arc_3 & a) const { return (a.rep().source()); } - qualified_result_type operator() (const Circular_arc_3 & a) const + result_type operator() (const Circular_arc_3 & a) const { return (a.rep().source()); } }; template - class Construct_circular_target_vertex_3 : Has_qrt + class Construct_circular_target_vertex_3 { typedef typename SK::Line_arc_3 Line_arc_3; typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; @@ -942,13 +944,12 @@ template < class SK > \ public: - typedef Circular_arc_point_3 result_type; - typedef const result_type & qualified_result_type; + typedef const Circular_arc_point_3& result_type; - qualified_result_type operator() (const Line_arc_3 & a) const + result_type operator() (const Line_arc_3 & a) const { return (a.rep().target()); } - qualified_result_type operator() (const Circular_arc_3 & a) const + result_type operator() (const Circular_arc_3 & a) const { return (a.rep().target()); } }; @@ -1845,20 +1846,6 @@ template < class SK > \ } // namespace SphericalFunctors -template < typename K > -struct Qualified_result_of, - typename K::Line_arc_3> -{ - typedef typename K::Line_3 const & type; -}; - -template < typename K > -struct Qualified_result_of, - typename K::Circular_arc_3> -{ - typedef typename K::Circle_3 const & type; -}; - } // namespace CGAL #endif // CGAL_SPHERICAL_KERNEL_FUNCTION_OBJECTS_POLYNOMIAL_SPHERE_H diff --git a/Circular_kernel_3/include/CGAL/Line_arc_3.h b/Circular_kernel_3/include/CGAL/Line_arc_3.h index 1cee87bbe3a..70cd6ebfe17 100644 --- a/Circular_kernel_3/include/CGAL/Line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Line_arc_3.h @@ -122,37 +122,32 @@ namespace CGAL { Line_arc_3(const RLine_arc_3 &a) : RLine_arc_3(a) {} - - typename Qualified_result_of - ::type + + typename boost::result_of::type source() const { return typename R::Construct_circular_source_vertex_3()(*this); } - typename Qualified_result_of - ::type + typename boost::result_of::type target() const { return typename R::Construct_circular_target_vertex_3()(*this); } - typename Qualified_result_of - ::type + typename boost::result_of::type lower_xyz_extremity() const { return typename R::Construct_circular_min_vertex_3()(*this); } - typename Qualified_result_of - ::type + typename boost::result_of::type higher_xyz_extremity() const { return typename R::Construct_circular_max_vertex_3()(*this); } - typename Qualified_result_of - ::type + typename boost::result_of::type supporting_line() const { return typename R::Construct_line_3()(*this); diff --git a/Combinatorial_map/include/CGAL/Cell_iterators.h b/Combinatorial_map/include/CGAL/Cell_iterators.h index 9704d74f527..aa6f20b7886 100644 --- a/Combinatorial_map/include/CGAL/Cell_iterators.h +++ b/Combinatorial_map/include/CGAL/Cell_iterators.h @@ -149,8 +149,8 @@ namespace CGAL { } /// Postfix ++ operator. - void operator++(int) - { operator++(); } + Self operator++(int) + { Self res=*this; operator ++(); return res; } private: /// A mark used to mark treated cells. @@ -237,8 +237,8 @@ namespace CGAL { } /// Postfix ++ operator. - void operator++(int) - { operator++(); } + Self operator++(int) + { Self res=*this; operator ++(); return res; } /// Prefix ++ operator. Self& operator++() @@ -339,8 +339,8 @@ namespace CGAL { } /// Postfix ++ operator. - void operator++(int) - { operator++(); } + Self operator++(int) + { Self res=*this; operator ++(); return res; } /// Prefix ++ operator. Self& operator++() diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 214cfcf959a..84d2be3af77 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -51,12 +51,6 @@ namespace CGAL { class Alloc_=CGAL_ALLOCATOR(int) > class Combinatorial_map_base { - template - friend struct internal::sew_functor; - - template - friend struct internal::unsew_functor; - template friend struct Remove_cell_functor; @@ -225,8 +219,45 @@ namespace CGAL { * is unmarked for all the marks. * @return a Dart_handle on the new dart. */ +#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES + template < typename... Args > + Dart_handle create_dart(const Args&... args) + { return mdarts.emplace(mmask_marks, args...); } +#else Dart_handle create_dart() { return mdarts.emplace(mmask_marks); } + template < typename T1 > + Dart_handle create_dart(const T1 &t1) + { return mdarts.emplace(mmask_marks, t1); } + template < typename T1, typename T2 > + Dart_handle create_dart(const T1 &t1, const T2 &t2) + { return mdarts.emplace(mmask_marks, t1, t2); } + template < typename T1, typename T2, typename T3 > + Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3) + { return mdarts.emplace(mmask_marks, t1, t2, t3); } + template < typename T1, typename T2, typename T3, typename T4 > + Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) + { return mdarts.emplace(mmask_marks, t1, t2, t3, t4); } + template < typename T1, typename T2, typename T3, typename T4, typename T5 > + Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5) + { return mdarts.emplace(mmask_marks, t1, t2, t3, t4, t5); } + template < typename T1, typename T2, typename T3, typename T4, typename T5, + typename T6 > + Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5, const T6 &t6) + { return mdarts.emplace(mmask_marks, t1, t2, t3, t4, t5, t6); } + template < typename T1, typename T2, typename T3, typename T4, typename T5, + typename T6, typename T7 > + Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5, const T6 &t6, const T7 &t7) + { return mdarts.emplace(mmask_marks, t1, t2, t3, t4, t5, t6, t7); } + template < typename T1, typename T2, typename T3, typename T4, typename T5, + typename T6, typename T7, typename T8 > + Dart_handle create_dart(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) + { return mdarts.emplace(mmask_marks, t1, t2, t3, t4, t5, t6, t7, t8); } +#endif /** Erase a dart from the list of darts. * @param adart the dart to erase. @@ -272,6 +303,47 @@ namespace CGAL { Dart_const_handle dart_handle(const Dart& adart) const { return mdarts.iterator_to(adart); } + /// @return the betas of ADart (beta are used in the same order than + /// they are given as parameters) +#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES + template + Dart_handle beta(Dart_handle ADart, Betas... betas) const + { return internal::Beta_functor:: + run(ADart, betas...); } + template + Dart_const_handle beta(Dart_const_handle ADart, Betas... betas) const + { return internal::Beta_functor:: + run(ADart, betas...); } +#else + Dart_handle beta(Dart_handle ADart, int B1) + { return internal::Beta_functor::run(ADart, B1); } + Dart_handle beta(Dart_handle ADart, int B1, int B2) + { return internal::Beta_functor::run(ADart, B1, B2); } + Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3) + { return internal::Beta_functor::run(ADart, B1, B2, B3); } + Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, int B4) + { return internal::Beta_functor::run(ADart, B1, B2, B3, B4); } + Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, int B4, int B5) + { return internal::Beta_functor::run(ADart, B1, B2, B3, B4, + B5); } + Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, int B4, int B5, + int B6) + { return internal::Beta_functor::run(ADart, B1, B2, B3, B4, B5, + B6); } + Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, int B4, int B5, + int B6, int B7) + { return internal::Beta_functor::run(ADart, B1, B2, B3, B4, B5, + B6, B7); } + Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, int B4, int B5, + int B6, int B7, int B8) + { return internal::Beta_functor::run(ADart, B1, B2, B3, B4, B5, + B6, B7, B8); } + Dart_handle beta(Dart_handle ADart, int B1, int B2, int B3, int B4, int B5, + int B6, int B7, int B8, int B9) + { return internal::Beta_functor::run(ADart, B1, B2, B3, B4, B5, + B6, B7, B8, B9); } +#endif + /** Count the number of used marks. * @return the number of used marks. */ @@ -773,25 +845,106 @@ namespace CGAL { /// Create a new attribute. /// @return a handle on the new attribute. +#ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES + template + typename Attribute_handle::type create_attribute(const Args&... args) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(args...); + } +#else template - typename Attribute_handle::type create_attribute() + typename Attribute_handle::type + create_attribute() { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "create_attribute but i-attributes are disabled"); return CGAL::cpp0x::get::value> (mattribute_containers).emplace(); } - - /// Create a new attribute by copy. - /// @return a handle on the new attribute. - template - typename Attribute_handle::type create_attribute(const A&a) - { + template + typename Attribute_handle::type + create_attribute(const T1 &t1) + { CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, "create_attribute but i-attributes are disabled"); return CGAL::cpp0x::get::value> - (mattribute_containers).emplace(a); + (mattribute_containers).emplace(t1); } + template + typename Attribute_handle::type + create_attribute(const T1 &t1, const T2 &t2) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(t1, t2); + } + template + typename Attribute_handle::type + create_attribute(const T1 &t1, const T2 &t2, const T3 &t3) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(t1, t2, t3); + } + template + typename Attribute_handle::type + create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(t1, t2, t3, t4); + } + template + typename Attribute_handle::type + create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(t1, t2, t3, t4, t5); + } + template + typename Attribute_handle::type + create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5, const T6 &t6) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6); + } + template + typename Attribute_handle::type + create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5, const T6 &t6, const T7 &t7) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7); + } + template + typename Attribute_handle::type + create_attribute(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, + const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) + { + CGAL_static_assertion_msg(Helper::template Dimension_index::value>=0, + "create_attribute but i-attributes are disabled"); + return CGAL::cpp0x::get::value> + (mattribute_containers).emplace(t1, t2, t3, t4, t5, t6, t7, t8); + } +#endif /// Erase an attribute. /// @param h a handle to the attribute to erase. @@ -834,6 +987,38 @@ namespace CGAL { (mattribute_containers); } + /** Double link a dart with beta 0 to a second dart. + * \em adart1 is 0-linked to \em adart2 and \em adart2 is 1-linked + * with \em adart1. Attributes are not updated, thus we can obtain + * a non-valid map with darts belonging to a same orbit and having + * different attributes. + * @param adart1 a first dart. + * @param adart2 a second dart. + */ + void basic_link_beta_0(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion(adart1 != NULL && adart2 != NULL); + CGAL_assertion(adart1 != null_dart_handle && adart2 != null_dart_handle); + adart1->basic_link_beta(adart2, 0); + adart2->basic_link_beta(adart1, 1); + } + + /** Double link a dart with beta 0 to a second dart. + * \em adart1 is 0-linked to \em adart2 and \em adart2 is 1-linked + * with \em adart1. Attributes are not updated, thus we can obtain + * a non-valid map with darts belonging to a same orbit and having + * different attributes. + * @param adart1 a first dart. + * @param adart2 a second dart. + */ + void basic_link_beta_1(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion(adart1 != NULL && adart2 != NULL); + CGAL_assertion(adart1 != null_dart_handle && adart2 != null_dart_handle); + adart1->basic_link_beta(adart2, 1); + adart2->basic_link_beta(adart1, 0); + } + /** Double link a dart with beta i to a second dart, when i>=2. * \em adart1 is i-linked to \em adart2 and \em adart2 is i-linked * with \em adart1. Attributes are not updated, thus we can obtain @@ -841,9 +1026,10 @@ namespace CGAL { * different attributes. * @param adart1 a first dart. * @param adart2 a second dart. - * @param i the dimension of the beta + * @param i the dimension of the beta. */ - void basic_link_beta(Dart_handle adart1, Dart_handle adart2, unsigned int i) + void basic_link_beta_for_involution(Dart_handle adart1, Dart_handle adart2, + unsigned int i) { CGAL_assertion( i>=2 && i<=dimension ); CGAL_assertion(adart1 != NULL && adart2 != NULL && adart1!=adart2); @@ -862,34 +1048,81 @@ namespace CGAL { */ template void basic_link_beta(Dart_handle adart1, Dart_handle adart2) - { internal::basic_link_beta_functor::run(*this,adart1,adart2); } - - /** Double unlink a dart with beta0. - * beta0(\em adart) is 1-unlinked and \em adart is 0-unlinked. - * The attributes are not updated, thus we can obtain a non-valid map - * with darts belonging to different orbits and having the same - * attributes. - * @param adart a dart. - */ - template - void unlink_beta(Dart_handle adart) - { internal::unlink_beta_functor::run(*this,adart); } - - /** Double unlink a dart with beta i, for i>=2. - * betai(\em adart) is i-unlinked and \em adart is i-unlinked. - * The attributes are not updated, thus we can obtain a non-valid map - * with darts belonging to different orbits and having the same - * attributes. - * @param adart a dart. - * @param i the dimension of the beta - */ - void unlink_beta(Dart_handle adart, unsigned int i) { - CGAL_assertion(adart!=NULL && adart!=null_dart_handle && - !adart->is_free(i)); - CGAL_assertion(2<=i && i<=dimension); - adart->beta(i)->unlink_beta(i); - adart->unlink_beta(i); + if ( i==0 ) basic_link_beta_0(adart1, adart2); + else if ( i==1 ) basic_link_beta_1(adart1, adart2); + else basic_link_beta_for_involution(adart1, adart2, i); + } + void basic_link_beta(Dart_handle adart1, Dart_handle adart2, + unsigned int i) + { + if ( i==0 ) basic_link_beta_0(adart1, adart2); + else if ( i==1 ) basic_link_beta_1(adart1, adart2); + else basic_link_beta_for_involution(adart1, adart2, i); + } + + /** Double link two darts, and update the NULL attributes. + * \em adart1 is 0-linked to \em adart2 and \em adart2 is 1-linked + * with \em adart1. The NULL attributes of \em adart1 are updated to + * non NULL attributes associated to \em adart2, and vice-versa. + * We can obtain a non-valid map with darts belonging to a same cell + * and having different attributes. + * @param adart1 a first dart. + * @param adart2 a second dart. + */ + void link_beta_0(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion(adart1 != NULL && adart2 != NULL); + CGAL_assertion(adart1 != null_dart_handle && adart2 != null_dart_handle); + Helper::template Foreach_enabled_attributes + >:: + run(this,adart1,adart2,0); + adart1->basic_link_beta(adart2, 0); + adart2->basic_link_beta(adart1, 1); + } + + /** Double link two darts, and update the NULL attributes. + * \em adart1 is 1-linked to \em adart2 and \em adart2 is 0-linked + * with \em adart1. The NULL attributes of \em adart1 are updated to + * non NULL attributes associated to \em adart2, and vice-versa. + * We can obtain a non-valid map with darts belonging to a same cell + * and having different attributes. + * @param adart1 a first dart. + * @param adart2 a second dart. + */ + void link_beta_1(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion(adart1 != NULL && adart2 != NULL); + CGAL_assertion(adart1 != null_dart_handle && adart2 != null_dart_handle); + Helper::template Foreach_enabled_attributes + >:: + run(this,adart1,adart2,1); + adart1->basic_link_beta(adart2, 1); + adart2->basic_link_beta(adart1, 0); + } + + /** Double link two darts, and update the NULL attributes. + * \em adart1 is i-linked to \em adart2 and \em adart2 is i^-1-linked + * with \em adart1. The NULL attributes of \em adart1 are updated to + * non NULL attributes associated to \em adart2, and vice-versa. + * We can obtain a non-valid map with darts belonging to a same cell + * and having different attributes. + * @param adart1 a first dart. + * @param adart2 a second dart. + * @param i the dimension of the beta. + * @pre 2<=i<=dimension. + */ + void link_beta_for_involution(Dart_handle adart1, Dart_handle adart2, + unsigned int i) + { + CGAL_assertion(adart1 != NULL && adart2 != NULL && adart1!=adart2 ); + CGAL_assertion(adart1 != null_dart_handle && adart2 != null_dart_handle); + CGAL_assertion( 2<=i && i<=dimension ); + Helper::template Foreach_enabled_attributes + >:: + run(this,adart1,adart2,i); + adart1->basic_link_beta(adart2, i); + adart2->basic_link_beta(adart1, i); } /** Double link two darts, and update the NULL attributes. @@ -903,29 +1136,16 @@ namespace CGAL { */ template void link_beta(Dart_handle adart1, Dart_handle adart2) - { internal::link_beta_functor::run(*this,adart1,adart2); } - - /** Double link two darts, and update the NULL attributes. - * \em adart1 is i-linked to \em adart2 and \em adart2 is i^-1-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa. - * We can obtain a non-valid map with darts belonging to a same cell - * and having different attributes. - * @param adart1 a first dart. - * @param adart2 a second dart. - * @param i the dimension of the beta. - * @pre 2<=i<=dimension - */ + { + if ( i==0 ) link_beta_0(adart1, adart2); + else if ( i==1 ) link_beta_1(adart1, adart2); + else link_beta_for_involution(adart1, adart2, i); + } void link_beta(Dart_handle adart1, Dart_handle adart2, unsigned int i) { - CGAL_assertion(adart1 != NULL && adart2 != NULL && adart1!=adart2 ); - CGAL_assertion(adart1 != null_dart_handle && adart2 != null_dart_handle); - CGAL_assertion( 2<=i && i<=dimension ); - adart1->basic_link_beta(adart2, i); - adart2->basic_link_beta(adart1, i); - Helper::template Foreach_enabled_attributes - >:: - run(this,adart1,adart2,i); + if ( i==0 ) link_beta_0(adart1, adart2); + else if ( i==1 ) link_beta_1(adart1, adart2); + else link_beta_for_involution(adart1, adart2, i); } /** Double link a dart with betai to a second dart. @@ -935,7 +1155,7 @@ namespace CGAL { * if update_attributes==true. * @param adart1 a first dart. * @param adart2 a second dart. - * @param update_attributes a boolean to update the enabled attributes + * @param update_attributes a boolean to update the enabled attributes. */ template void link_beta(Dart_handle adart1, Dart_handle adart2, @@ -945,6 +1165,167 @@ namespace CGAL { else basic_link_beta(adart1, adart2); } + /** Double unlink a dart with beta 0. + * beta0(\em adart) is 1-unlinked and \em adart is 0-unlinked. + * The attributes are not updated, thus we can obtain a non-valid map + * with darts belonging to different orbits and having the same + * attributes. + * @param adart a dart. + */ + void unlink_beta_0(Dart_handle adart) + { + CGAL_assertion(adart != NULL && !adart->is_free(0)); + adart->beta(0)->unlink_beta(1); + adart->unlink_beta(0); + } + + /** Double unlink a dart with beta 1. + * beta1(\em adart) is 0-unlinked and \em adart is 1-unlinked. + * The attributes are not updated, thus we can obtain a non-valid map + * with darts belonging to different orbits and having the same + * attributes. + * @param adart a dart. + */ + void unlink_beta_1(Dart_handle adart) + { + CGAL_assertion(adart != NULL && !adart->is_free(1)); + adart->beta(1)->unlink_beta(0); + adart->unlink_beta(1); + } + + /** Double unlink a dart with beta i, for i>=2. + * betai(\em adart) is i-unlinked and \em adart is i-unlinked. + * The attributes are not updated, thus we can obtain a non-valid map + * with darts belonging to different orbits and having the same + * attributes. + * @param adart a dart. + * @param i the dimension of the beta. + */ + void unlink_beta_for_involution(Dart_handle adart, unsigned int i) + { + CGAL_assertion(adart!=NULL && adart!=null_dart_handle && + !adart->is_free(i)); + CGAL_assertion(2<=i && i<=dimension); + adart->beta(i)->unlink_beta(i); + adart->unlink_beta(i); + } + + /** Double unlink a dart with beta i. + * betai(\em adart) is i-1-unlinked and \em adart is i-unlinked. + * The attributes are not updated, thus we can obtain a non-valid map + * with darts belonging to different orbits and having the same + * attributes. + * @param adart a dart. + * @param i the dimension of the beta. + */ + template + void unlink_beta(Dart_handle adart) + { + if ( i==0 ) unlink_beta_0(adart); + else if ( i==1 ) unlink_beta_1(adart); + else unlink_beta_for_involution(adart, i); + } + void unlink_beta(Dart_handle adart, unsigned int i) + { + if ( i==0 ) unlink_beta_0(adart); + else if ( i==1 ) unlink_beta_1(adart); + else unlink_beta_for_involution(adart, i); + } + + /** Test if it is possible to sew by beta1 the two given darts + * @param adart1 the first dart. + * @param adart2 the second dart. + * @return true iff \em adart1 can be 1-sewn with \em adart2. + */ + bool is_sewable_1(Dart_const_handle adart1, Dart_const_handle adart2) const + { + CGAL_assertion(adart1!=NULL && adart2!=NULL); + + if ( !adart1->is_free(1) || !adart2->is_free(0) ) + return false; + + if ( adart1 == adart2 ) return true; + + CMap_dart_const_iterator_of_involution I1(*this, adart1); + CMap_dart_const_iterator_of_involution_inv I2(*this, adart2); + bool res = true; + while (res && I1.cont() && I2.cont()) + { + // We can remove this constraint which is not required for + // combinatorial map definition, but which imposes quite "normal" + // configurations + if ( I1==adart2 || I2==adart1 ) res=false; + + for (unsigned int j=3;res && j<=Self::dimension; ++j) + { + if ( I1->is_free(j)!=I2->is_free(j) ) + { + res = false; + } + } + ++I1; ++I2; + } + if (I1.cont() != I2.cont()) + res = false; + + return res; + } + + /** Test if it is possible to sew by beta0 the two given darts + * @param adart1 the first dart. + * @param adart2 the second dart. + * @return true iff \em adart1 can be 0-sewn with \em adart2. + */ + bool is_sewable_0(Dart_const_handle adart1, Dart_const_handle adart2) const + { return is_sewable_1(adart2, adart1); } + + /** Test if it is possible to sew by betai the two given darts + * for 2<=i<=dimension. + * @param adart1 the first dart. + * @param adart2 the second dart. + * @return true iff \em adart1 can be 1-sewn with \em adart2. + */ + template + bool is_sewable_for_involution(Dart_const_handle adart1, + Dart_const_handle adart2) const + { + CGAL_assertion(2<=i && i<=Self::dimension); + CGAL_assertion(adart1!=NULL && adart2!=NULL); + + if ( !adart1->is_free(i) || !adart2->is_free(i) || adart1==adart2 ) + return false; + + CMap_dart_const_iterator_of_involution I1(*this, adart1); + CMap_dart_const_iterator_of_involution_inv I2(*this, adart2); + bool res = true; + while (res && I1.cont() && I2.cont()) + { + // We can remove this constraint which is not required for + // combinatorial map definition, but which is quite "normal" + if ( I1==adart2 || I2==adart1 ) res=false; + + // Special case to consider beta0 and beta1 + if ( i>2 ) + { + if ( I1->is_free(0)!=I2->is_free(1) ) res = false; + else if ( I1->is_free(1)!=I2->is_free(0) ) res = false; + } + + // General case + for (unsigned int j=2;res && j<=Self::dimension; ++j) + { + if ( j+1!=i && j!=i && j!=i+1 && + I1->is_free(j)!=I2->is_free(j) ) + { res = false; } + } + ++I1; ++I2; + } + if (I1.cont() != I2.cont()) + res = false; + + return res; + } + /** Test if it is possible to sew by betai the two given darts * @param adart1 the first dart. * @param adart2 the second dart. @@ -952,9 +1333,84 @@ namespace CGAL { */ template bool is_sewable(Dart_const_handle adart1, Dart_const_handle adart2) const - { return internal::is_sewable_functor::run(*this,adart1,adart2); } + { + if ( i==0 ) return is_sewable_0(adart1, adart2); + else if ( i==1 ) return is_sewable_1(adart1, adart2); + else return is_sewable_for_involution(adart1, adart2); + } - /** Topological sew by betai the two given darts plus all the required darts + /** Topological sew by beta1 the two given darts plus all the required darts + * to satisfy the combinatorial map validity: but do not update attributes + * thus the map can be non valid. + * @param adart1 the first dart. + * @param adart2 the second dart. + * @pre is_sewable_1(adart1, adart2). + */ + void topo_sew_1(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion( (is_sewable_1(adart1,adart2)) ); + + int m = get_new_mark(); + std::vector dartv; + for (CMap_dart_iterator_basic_of_cell it(*this,adart1,m); + it.cont(); ++it) + { + mark(it,m); + dartv.push_back(it); + } + + CMap_dart_iterator_of_involution I1(*this, adart1); + CMap_dart_iterator_of_involution_inv I2(*this, adart2); + while ( I1.cont() ) + { + if ( is_marked(I1,m) ) + basic_link_beta_1(I1, I2); + else + basic_link_beta_0(I1, I2); + ++I1; ++I2; + } + + for (typename std::vector::iterator + it=dartv.begin(); it!=dartv.end(); ++it) + { unmark(*it,m); } + CGAL_assertion( is_whole_map_unmarked(m) ); + free_mark(m); + } + + /** Topological sew by beta0 two given darts plus all the required darts + * to satisfy the combinatorial map validity: but do not update attributes + * thus the map can be non valid. + * @param adart1 the first dart. + * @param adart2 the second dart. + * @pre is_sewable_0(adart1, adart2). + */ + void topo_sew_0(Dart_handle adart1, Dart_handle adart2) + { topo_sew_1(adart2, adart1); } + + /** Topological sew by betai two given darts plus all the required darts + * to satisfy the combinatorial map validity: but do not update attributes + * thus the map can be non valid. + * @param adart1 the first dart. + * @param adart2 the second dart. + * @pre 2<=i<=dimension. + * @pre is_sewable_for_involution(adart1, adart2). + */ + template + void topo_sew_for_involution(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion(2<=i && i<=Self::dimension); + CGAL_assertion( (is_sewable_for_involution(adart1,adart2)) ); + + CMap_dart_iterator_of_involution I1(*this, adart1); + CMap_dart_iterator_of_involution_inv I2(*this, adart2); + while ( I1.cont() ) + { + basic_link_beta_for_involution(I1, I2, i); + ++I1; ++I2; + } + } + + /** Topological sew by betai two given darts plus all the required darts * to satisfy the combinatorial map validity: but do not update attributes * thus the map can be non valid. * @param adart1 the first dart. @@ -963,7 +1419,136 @@ namespace CGAL { */ template void topo_sew(Dart_handle adart1, Dart_handle adart2) - { return internal::topo_sew_functor::run(*this,adart1,adart2); } + { + if ( i==0 ) topo_sew_0(adart1, adart2); + else if ( i==1 ) topo_sew_1(adart1, adart2); + else topo_sew_for_involution(adart1, adart2); + } + + /** Sew by beta0 the two given darts plus all the required darts + * to satisfy the combinatorial map validity, and updates enabled + * attributes when necessary so that the final map is valid. + * @param adart1 the first dart. + * @param adart2 the second dart. + * @pre is_sewable_0(adart1, adart2). + * @post is_valid() + */ + void sew_0(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion( (is_sewable_0(adart1,adart2)) ); + + int m = get_new_mark(); + std::vector dartv; + for (CMap_dart_iterator_basic_of_cell it(*this,adart1,m); + it.cont(); ++it) + { + mark(it,m); + dartv.push_back(it); + } + + CMap_dart_iterator_of_involution I1(*this, adart1); + CMap_dart_iterator_of_involution_inv I2(*this, adart2); + while ( I1.cont() ) + { + Dart_handle od1=I1->other_extremity(); + Dart_handle od2=I2->other_extremity(); + if (od1!=NULL && od2!=NULL) + group_all_attributes_except(od1, od2, 1); + ++I1; ++I2; + } + + I1.rewind(); I2.rewind(); + while ( I1.cont() ) + { + if ( is_marked(I1,m) ) + basic_link_beta_0(I1, I2); + else + basic_link_beta_1(I1, I2); + ++I1; ++I2; + } + + for (typename std::vector::iterator + it=dartv.begin(); it!=dartv.end(); ++it) + { unmark(*it,m); } + CGAL_assertion( is_whole_map_unmarked(m) ); + free_mark(m); + } + + /** Sew by beta1 the two given darts plus all the required darts + * to satisfy the combinatorial map validity, and updates enabled + * attributes when necessary so that the final map is valid. + * @param adart1 the first dart. + * @param adart2 the second dart. + * @pre is_sewable_1(adart1, adart2). + * @post is_valid() + */ + void sew_1(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion( (is_sewable_1(adart1,adart2)) ); + int m = get_new_mark(); + std::vector dartv; + for (CMap_dart_iterator_basic_of_cell it(*this,adart1,m); + it.cont(); ++it) + { + mark(it,m); + dartv.push_back(it); + } + + CMap_dart_iterator_of_involution I1(*this, adart1); + CMap_dart_iterator_of_involution_inv I2(*this, adart2); + while ( I1.cont() ) + { + group_all_attributes_except(I1,I2,1); + ++I1; ++I2; + } + + I1.rewind(); I2.rewind(); + while ( I1.cont() ) + { + if ( is_marked(I1,m) ) + basic_link_beta_1(I1, I2); + else + basic_link_beta_0(I1, I2); + ++I1; ++I2; + } + + for (typename std::vector::iterator + it=dartv.begin(); it!=dartv.end(); ++it) + { unmark(*it,m); } + CGAL_assertion( is_whole_map_unmarked(m) ); + free_mark(m); + } + + /** Sew by betai the two given darts plus all the required darts + * to satisfy the combinatorial map validity, and updates enabled + * attributes when necessary so that the final map is valid. + * @param adart1 the first dart. + * @param adart2 the second dart. + * @pre is_sewable(adart1, adart2). + * @pre 2<=i<=dimension. + * @post is_valid() + */ + template + void sew_for_involution(Dart_handle adart1, Dart_handle adart2) + { + CGAL_assertion(2<=i && i<=dimension); + CGAL_assertion( (is_sewable_for_involution(adart1,adart2)) ); + + CMap_dart_iterator_of_involution I1(*this, adart1); + CMap_dart_iterator_of_involution_inv I2(*this, adart2); + while ( I1.cont() ) + { + group_all_attributes_except(I1,I2,i); + ++I1; ++I2; + } + + I1.rewind(); I2.rewind(); + while ( I1.cont() ) + { + basic_link_beta_for_involution(I1, I2, i); + ++I1; ++I2; + } + } /** Sew by betai the two given darts plus all the required darts * to satisfy the combinatorial map validity, and updates enabled @@ -975,7 +1560,11 @@ namespace CGAL { */ template void sew(Dart_handle adart1, Dart_handle adart2) - { return internal::sew_functor::run(*this,adart1,adart2); } + { + if ( i==0 ) sew_0(adart1, adart2); + else if ( i==1 ) sew_1(adart1, adart2); + else sew_for_involution(adart1, adart2); + } /** Sew by betai the two given darts plus all the required darts * to satisfy the combinatorial map validity. Enabled attributes @@ -988,8 +1577,77 @@ namespace CGAL { template void sew(Dart_handle adart1, Dart_handle adart2, bool update_attributes) { - if ( update_attributes ) sew(adart1, adart2); - else topo_sew(adart1, adart2); + if ( update_attributes ) sew(adart1, adart2); + else topo_sew(adart1, adart2); + } + + /** Topological unsew by beta1 the given dart plus all the required darts + * to satisfy the combinatorial map validity: but do not update attributes + * thus the map can be non valid + * @param adart first dart. + * @pre !adart->is_free(1). + */ + void topo_unsew_1(Dart_handle adart) + { + CGAL_assertion( adart!=NULL && !adart->is_free(1) ); + + int m = get_new_mark(); + std::vector dartv; + for (CMap_dart_iterator_basic_of_cell it(*this,adart,m); + it.cont(); ++it) + { + mark(*it,m); + dartv.push_back(*it); + } + + { + CMap_dart_iterator_of_involution it(*this, adart); + while ( it.cont() ) + { + if ( is_marked(*it,m) ) basic_unlink_beta_1(*it); + else basic_unlink_beta_0(*it); + ++it; + } + } + + for (typename std::vector::iterator + it=dartv.begin(); it!=dartv.end(); ++it) + { unmark(*it,m); } + CGAL_assertion( is_whole_map_unmarked(m) ); + free_mark(m); + } + + /** Topological unsew by beta0 the given dart plus all the required darts + * to satisfy the combinatorial map validity: but do not update attributes + * thus the map can be non valid + * @param adart first dart. + * @pre !adart->is_free(0). + */ + void topo_unsew_0(Dart_handle adart) + { + CGAL_assertion( adart!=NULL && !adart->is_free(0) ); + topo_unsew_1(adart->beta(0)); + } + + /** Topological unsew by betai the given dart plus all the required darts + * to satisfy the combinatorial map validity: but do not update attributes + * thus the map can be non valid + * @param adart first dart. + * @pre !adart->is_free(i). + * @pre 2<=i<=dimension. + */ + template + void topo_unsew_for_involution(Dart_handle adart) + { + CGAL_assertion( adart!=NULL && !adart->is_free(i) ); + CGAL_assertion(2<=i && i<=Self::dimension); + + CMap_dart_iterator_of_involution it(*this, adart); + while ( it.cont() ) + { + unlink_beta(*it, i); + ++it; + } } /** Topological unsew by betai the given dart plus all the required darts @@ -1000,7 +1658,140 @@ namespace CGAL { */ template void topo_unsew(Dart_handle adart) - { return internal::topo_unsew_functor::run(*this,adart); } + { + if ( i==0 ) topo_unsew_0(adart); + else if ( i==1 ) topo_unsew_1(adart); + else topo_unsew_for_involution(adart); + } + + /** Unsew by beta0 the given dart plus all the required darts + * to satisfy the combinatorial map validity, and update enabled + * attributes when necessary so that the final map is valid. + * @param adart first dart. + * @pre !adart->is_free(0). + * @post is_valid() + */ + void unsew_0(Dart_handle adart) + { + CGAL_assertion( adart!=NULL && !adart->is_free(0) ); + Dart_handle d2 = NULL; + + int m = get_new_mark(); + std::vector dartv; + for (CMap_dart_iterator_basic_of_cell it(*this,adart,m); + it.cont(); ++it) + { + mark(it,m); + dartv.push_back(it); + } + + { + CMap_dart_iterator_of_involution it(*this, adart); + while ( it.cont() ) + { + if ( is_marked(it,m) ) + { + d2 = it->beta(0); + unlink_beta_0(it); + } + else + { + d2 = it->beta(1); + unlink_beta_1(it); + } + + // TODO do the degroup after the loop (cf unsew_for_involution) + Dart_handle od1=it->other_extremity(); + Dart_handle od2=d2->other_extremity(); + if ( od1!=NULL && od2!=NULL ) + degroup_all_attributes_except(od1,od2,1); + + ++it; + } + } + + for (typename std::vector::iterator + it=dartv.begin(); it!=dartv.end(); ++it) + { unmark(*it,m); } + + CGAL_assertion( is_whole_map_unmarked(m) ); + free_mark(m); + } + + /** Unsew by beta1 the given dart plus all the required darts + * to satisfy the combinatorial map validity, and update enabled + * attributes when necessary so that the final map is valid. + * @param adart first dart. + * @pre !adart->is_free(1). + * @post is_valid() + */ + void unsew_1(Dart_handle adart) + { + CGAL_assertion( adart!=NULL && !adart->is_free(1) ); + Dart_handle d2 = NULL; + + int m = get_new_mark(); + std::vector dartv; + for (CMap_dart_iterator_basic_of_cell it(*this,adart,m); + it.cont(); ++it) + { + mark(it,m); + dartv.push_back(it); + } + + { + CMap_dart_iterator_of_involution it(*this, adart); + while ( it.cont() ) + { + if ( is_marked(it,m) ) + { d2 = it->beta(1); unlink_beta_1(it); } + else + { d2 = it->beta(0); unlink_beta_0(it); } + // TODO do the degroup after the loop (cf unsew_for_involution) + degroup_all_attributes_except(it,d2,1); + ++it; + } + } + + for (typename std::vector::iterator + it=dartv.begin(); it!=dartv.end(); ++it) + { unmark(*it,m); } + CGAL_assertion( is_whole_map_unmarked(m) ); + free_mark(m); + } + + /** Unsew by betai the given dart plus all the required darts + * to satisfy the combinatorial map validity, and update enabled + * attributes when necessary so that the final map is valid. + * @param adart first dart. + * @pre !adart->is_free(i). + * @post is_valid() + * @pre 2<=i<=dimension + */ + template + void unsew_for_involution(Dart_handle adart) + { + CGAL_assertion(2<=i && i<=Self::dimension); + CGAL_assertion( adart!=NULL && !adart->is_free(i) ); + + std::stack > todegroup; + + CMap_dart_iterator_of_involution it(*this, adart); + while ( it.cont() ) + { + todegroup.push(internal::Couple_dart_and_dim + (it,it->beta(i),i)); + unlink_beta_for_involution(it,i); + ++it; + } + + while (!todegroup.empty() ) + { + internal::Couple_dart_and_dim c=todegroup.top(); + todegroup.pop(); + degroup_all_attributes_except(c.d1,c.d2,c.dim); + } + } /** Unsew by betai the given dart plus all the required darts * to satisfy the combinatorial map validity, and update enabled @@ -1011,7 +1802,11 @@ namespace CGAL { */ template void unsew(Dart_handle adart) - { return internal::unsew_functor::run(*this,adart); } + { + if ( i==0 ) unsew_0(adart); + else if ( i==1 ) unsew_1(adart); + else unsew_for_involution(adart); + } /** Unsew by betai the given dart plus all the required darts * to satisfy the combinatorial map validity. Enabled attributes @@ -1023,8 +1818,8 @@ namespace CGAL { template void unsew(Dart_handle adart, bool update_attributes) { - if ( update_attributes ) unsew(adart); - else topo_unsew(adart); + if ( update_attributes ) unsew(adart); + else topo_unsew(adart); } /** Count the marked cells (at least one marked dart). @@ -1298,10 +2093,24 @@ namespace CGAL { // If the two attributes are equal, nothing to do. if ( a1 == a2 ) return; - if ( a1==NULL ) - set_attribute_of_dart(dh1, a2); - else - set_attribute_of_dart(dh2, a1); + if ( a1==NULL ) set_attribute_of_dart(dh1, a2); + else set_attribute_of_dart(dh2, a1); + } + + /** Group all the dart attributes of adart1 and adart2, except the + * adim-cell attribute. + * @param adart1 the first dart. + * @param adart1 the second dart. + * @param adim the dimension to not group (-1 to group all dimensions). + * note that 0-attr are always grouped if adart1-> other_extremity()!=NULL. + */ + void group_all_dart_attributes_except(Dart_handle adart1, + Dart_handle adart2, int adim) + { + CGAL_assertion( adim==-1 || (1<=adim && (unsigned int)adim<=dimension) ); + Helper::template Foreach_enabled_attributes + >:: + run(this,adart1,adart2,adim); } /** Group all the cells attributes of adart1 and adart2, except the @@ -1309,6 +2118,7 @@ namespace CGAL { * @param adart1 the first dart. * @param adart1 the second dart. * @param adim the dimension to not group (-1 to group all dimensions). + * note that 0-attr are always grouped if adart1-> other_extremity()!=NULL. */ void group_all_attributes_except(Dart_handle adart1, Dart_handle adart2, int adim) @@ -1455,6 +2265,7 @@ namespace CGAL { " are disabled"); if ( is_marked(adart, amark) ) return true; bool valid = true; + bool found_dart = false; typename Attribute_const_handle::type a=adart->template attribute(); @@ -1466,6 +2277,8 @@ namespace CGAL { if ( it->template attribute() != a ) valid = false; + if ( a!=NULL && it==a->dart() ) found_dart = true; + mark(it, amark); ++nb; } @@ -1473,6 +2286,9 @@ namespace CGAL { if ( a!=NULL && a->get_nb_refs()!=nb ) valid = false; + if ( a!=NULL && a->dart()!=NULL && !found_dart ) + valid = false; + return valid; } @@ -1520,7 +2336,7 @@ namespace CGAL { decrease_attribute_ref_counting(adart); - adart->set_attribute(ah); + adart->template set_attribute(ah); ah->set_dart(adart); } @@ -1542,7 +2358,7 @@ namespace CGAL { if ( it->template attribute()!=ah ) { decrease_attribute_ref_counting(it); - it->set_attribute(ah); + it->template set_attribute(ah); } } ah->set_dart(adart); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h b/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h index b78836b8468..19d2edba896 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h @@ -36,7 +36,7 @@ namespace CGAL { { typename Map::Dart_handle d1 = amap.create_dart(); typename Map::Dart_handle d2 = amap.create_dart(); - amap.template basic_link_beta<2>(d1, d2); + amap.basic_link_beta_for_involution(d1, d2, 2); return d1; } @@ -56,11 +56,11 @@ namespace CGAL { for ( unsigned int nb=1; nb(prev, cur); + amap.basic_link_beta_1(prev, cur); prev=cur; } - amap.template basic_link_beta<1>(prev, start); + amap.basic_link_beta_1(prev, start); return start; } @@ -80,12 +80,12 @@ namespace CGAL { typename Map::Dart_handle d3, typename Map::Dart_handle d4) { - amap.basic_link_beta(d1, d2, 2); - amap.basic_link_beta(d3, d2->beta(0), 2); - amap.basic_link_beta(d1->beta(1), d3->beta(0), 2); - amap.basic_link_beta(d4, d2->beta(1), 2); - amap.basic_link_beta(d4->beta(0), d3->beta(1), 2); - amap.basic_link_beta(d4->beta(1), d1->beta(0), 2); + amap.basic_link_beta_for_involution(d1, d2, 2); + amap.basic_link_beta_for_involution(d3, d2->beta(0), 2); + amap.basic_link_beta_for_involution(d1->beta(1), d3->beta(0), 2); + amap.basic_link_beta_for_involution(d4, d2->beta(1), 2); + amap.basic_link_beta_for_involution(d4->beta(0), d3->beta(1), 2); + amap.basic_link_beta_for_involution(d4->beta(1), d1->beta(0), 2); return d1; } @@ -125,21 +125,33 @@ namespace CGAL { typename Map::Dart_handle d5, typename Map::Dart_handle d6) { - amap.basic_link_beta(d1, d4->beta(1)->beta(1), 2); - amap.basic_link_beta(d1->beta(1), d6->beta(0) , 2); - amap.basic_link_beta(d1->beta(1)->beta(1), d2 , 2); - amap.basic_link_beta(d1->beta(0), d5 , 2); + amap.basic_link_beta_for_involution(d1, + d4->beta(1)->beta(1), 2); + amap.basic_link_beta_for_involution(d1->beta(1), + d6->beta(0) , 2); + amap.basic_link_beta_for_involution(d1->beta(1)->beta(1), + d2 , 2); + amap.basic_link_beta_for_involution(d1->beta(0), + d5 , 2); - amap.basic_link_beta(d3, d2->beta(1)->beta(1), 2); - amap.basic_link_beta(d3->beta(1), d6->beta(1) , 2); - amap.basic_link_beta(d3->beta(1)->beta(1), d4 , 2); - amap.basic_link_beta(d3->beta(0), d5->beta(1)->beta(1), 2); + amap.basic_link_beta_for_involution(d3, + d2->beta(1)->beta(1), 2); + amap.basic_link_beta_for_involution(d3->beta(1), + d6->beta(1) , 2); + amap.basic_link_beta_for_involution(d3->beta(1)->beta(1), + d4 , 2); + amap.basic_link_beta_for_involution(d3->beta(0), + d5->beta(1)->beta(1), 2); - amap.basic_link_beta(d6, d4->beta(1) , 2); - amap.basic_link_beta(d6->beta(1)->beta(1), d2->beta(1) , 2); + amap.basic_link_beta_for_involution(d6, + d4->beta(1) , 2); + amap.basic_link_beta_for_involution(d6->beta(1)->beta(1), + d2->beta(1) , 2); - amap.basic_link_beta(d5->beta(0), d4->beta(0) , 2); - amap.basic_link_beta(d5->beta(1), d2->beta(0) , 2); + amap.basic_link_beta_for_involution(d5->beta(0), + d4->beta(0) , 2); + amap.basic_link_beta_for_involution(d5->beta(1), + d2->beta(0) , 2); return d1; } diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h index bc8f54ac4fc..a3a733dc85e 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h @@ -128,8 +128,8 @@ namespace CGAL { Self& operator--() { return *this; } /// operator -- in private to invalidate the base operator. - void operator--(int) - {} + Self operator--(int) + { return *this; } protected: /// test if adart->beta(ai) exists and is not marked for amark @@ -388,8 +388,8 @@ namespace CGAL { using Base::operator++; /// Postfix ++ operator. - void operator++(int) - { operator ++(); } + Self operator++(int) + { Self res=*this; operator ++(); return res; } protected: /// Unmark all the marked darts during the iterator. diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h index 21cb39a7dd7..6457c94fa49 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h @@ -84,22 +84,22 @@ namespace CGAL { if (!cur->is_free(0)) { n1 = amap.create_dart(); - amap.template link_beta<0>(cur, n1); + amap.link_beta_0(cur, n1); } else n1 = NULL; if (!cur->is_free(1)) { n2 = amap.create_dart(); - amap.template link_beta<1>(cur, n2); + amap.link_beta_1(cur, n2); } else n2 = NULL; if (n1 != NULL && n2 != NULL) - amap.template link_beta<0>(n1, n2); + amap.link_beta_0(n1, n2); if (n1 != NULL && prev != NULL) - amap.link_beta(prev, n1, 2); + amap.link_beta_for_involution(prev, n1, 2); for (unsigned int dim=3; dim<=Map::dimension; ++dim) { @@ -110,24 +110,24 @@ namespace CGAL { if (n1!=NULL) { nn1=amap.create_dart(); - amap.template link_beta<1>(cur->beta(dim), nn1); - amap.link_beta(n1, nn1, dim); + amap.link_beta_1(cur->beta(dim), nn1); + amap.link_beta_for_involution(n1, nn1, dim); } else nn1=NULL; if (n2!=NULL) { nn2=amap.create_dart(); - amap.template link_beta<0>(cur->beta(dim), nn2); - amap.link_beta(n2, nn2, dim); + amap.link_beta_0(cur->beta(dim), nn2); + amap.link_beta_for_involution(n2, nn2, dim); } else nn2=NULL; if (nn1 != NULL && nn2 != NULL) - amap.template basic_link_beta<1>(nn1, nn2); + amap.basic_link_beta_1(nn1, nn2); if (nn1 != NULL && prev != NULL) - amap.link_beta(nn1, prev->beta(dim), 2); + amap.link_beta_for_involution(nn1, prev->beta(dim), 2); amap.mark(cur->beta(dim), treated); tounmark.push(cur->beta(dim)); @@ -135,9 +135,9 @@ namespace CGAL { else { if ( n1!=NULL ) - amap.link_beta(n1, cur->beta(dim)->beta(1), dim); + amap.link_beta_for_involution(n1, cur->beta(dim)->beta(1), dim); if ( n2!=NULL ) - amap.link_beta(n2, cur->beta(dim)->beta(0), dim); + amap.link_beta_for_involution(n2, cur->beta(dim)->beta(0), dim); } } } @@ -147,12 +147,12 @@ namespace CGAL { if (n2 != NULL) { - amap.link_beta(first->beta(0), n2, 2); + amap.link_beta_for_involution(first->beta(0), n2, 2); for (unsigned int dim=3; dim<=Map::dimension; ++dim) { if ( !adart->is_free(dim) ) { - amap.link_beta(first->beta(0)->beta(dim), n2->beta(dim), 2); + amap.link_beta_for_involution(first->beta(0)->beta(dim), n2->beta(dim), 2); } } } @@ -282,7 +282,8 @@ namespace CGAL { { if ( !d1->is_free(i) ) { - todegroup.push(Dart_pair(d1, d1->beta(i))); + if ( !amap.is_marked(d1->beta(i), mark) ) + todegroup.push(Dart_pair(d1, d1->beta(i))); d1->unlink_beta(i); } } @@ -291,7 +292,8 @@ namespace CGAL { { if ( !d2->is_free(CGAL_BETAINV(i)) ) { - todegroup.push(Dart_pair(d2, d2->beta_inv(i))); + if ( !amap.is_marked(d2->beta_inv(i), mark) ) + todegroup.push(Dart_pair(d2, d2->beta_inv(i))); d2->unlink_beta(CGAL_BETAINV(i)); } } @@ -301,7 +303,8 @@ namespace CGAL { d1 = (*it)->beta(i); if ( !d1->is_free(CGAL_BETAINV(i)) ) { - todegroup.push(Dart_pair(d1, d1->beta_inv(i))); + if ( !amap.is_marked(d1->beta_inv(i), mark)) + todegroup.push(Dart_pair(d1, d1->beta_inv(i))); d1->unlink_beta(CGAL_BETAINV(i)); } } @@ -372,7 +375,7 @@ namespace CGAL { if ( !(*it)->is_free(Map::dimension) ) { todegroup.push(Dart_pair(*it, (*it)->beta(Map::dimension))); - amap.unlink_beta(*it,Map::dimension); + amap.unlink_beta_for_involution(*it,Map::dimension); } } @@ -607,8 +610,6 @@ namespace CGAL { if (!(*it)->is_free(1)) { amap.template basic_link_beta<1>(d1, (*it)->beta(1)); } - - amap.template link_beta<1>(*it, d1); for ( unsigned int dim = 2; dim<=Map::dimension; ++dim ) { @@ -618,7 +619,10 @@ namespace CGAL { amap.basic_link_beta(*it, (*it)->beta(dim)->beta(1), dim); } } - + + amap.template basic_link_beta<1>(*it, d1); + amap.group_all_dart_attributes_except(*it, d1, 1); + amap.mark(*it, mark); } @@ -628,8 +632,6 @@ namespace CGAL { amap.free_mark(mark); amap.template degroup_attribute<1>(adart, adart->beta(1)); - - // CGAL_postcondition(amap.is_valid()); return adart->beta(1); } @@ -689,16 +691,17 @@ namespace CGAL { amap.template basic_link_beta<1>(d1,d2); } - amap.link_beta(d1, d2, 2); + amap.link_beta_for_involution(d1, d2, 2); for ( unsigned int dim=3; dim<=Map::dimension; ++dim) { if ( !it1->is_free(dim) && amap.is_marked(it1->beta(dim), treated) ) { - amap.basic_link_beta(it1->beta(dim)->beta_inv(s1), d1, dim); - amap.basic_link_beta(it1->beta(dim)->beta_inv(s1)->beta(2), - d2, dim); + amap.basic_link_beta_for_involution(it1->beta(dim)->beta_inv(s1), d1, + dim); + amap.basic_link_beta_for_involution + (it1->beta(dim)->beta_inv(s1)->beta(2), d2, dim); } } @@ -778,36 +781,37 @@ namespace CGAL { if ( !it1->is_free(s1) ) { - if ( s1==0 ) amap.template basic_link_beta<1>(it1->beta(0), d2); - else amap.template link_beta<0>(it1->beta(1), d2); + if ( s1==0 ) amap.basic_link_beta_1(it1->beta(0), d2); + else amap.link_beta_0(it1->beta(1), d2); } if ( !it2->is_free(s1) ) { - if ( s1==0 ) amap.template basic_link_beta<1>(it2->beta(0), d1); - else amap.template link_beta<0>(it2->beta(1), d1); + if ( s1==0 ) amap.basic_link_beta_1(it2->beta(0), d1); + else amap.link_beta_0(it2->beta(1), d1); } if ( s1==0 ) { - amap.template link_beta<0>(it1, d1); - amap.template link_beta<0>(it2, d2); + amap.link_beta_0(it1, d1); + amap.link_beta_0(it2, d2); } else { - amap.template basic_link_beta<1>(it1, d1); - amap.template basic_link_beta<1>(it2, d2); + amap.basic_link_beta_1(it1, d1); + amap.basic_link_beta_1(it2, d2); } - amap.link_beta(d2, d1, 2); + amap.link_beta_for_involution(d2, d1, 2); for ( unsigned int dim=3; dim<=CMap::dimension; ++dim) { if ( !it1->is_free(dim) && amap.is_marked(it1->beta(dim), treated) ) { - amap.basic_link_beta(it1->beta(dim)->beta_inv(s1), d1, dim); - amap.basic_link_beta(it1->beta(dim)->beta_inv(s1)->beta(2), - d2, dim); + amap.basic_link_beta_for_involution + (it1->beta(dim)->beta_inv(s1), d1, dim); + amap.basic_link_beta_for_involution + (it1->beta(dim)->beta_inv(s1)->beta(2), d2, dim); } } @@ -875,7 +879,7 @@ namespace CGAL { if (withBeta3) { dd = amap.create_dart(); - amap.basic_link_beta(d, dd, 3); + amap.basic_link_beta_for_involution(d, dd, 3); } if (prec != NULL) @@ -886,9 +890,9 @@ namespace CGAL { else first = d; if (!(*it)->is_free(2)) - amap.link_beta((*it)->beta(2), dd, 2); + amap.link_beta_for_involution((*it)->beta(2), dd, 2); - amap.link_beta(*it, d, 2); + amap.link_beta_for_involution(*it, d, 2); prec = d; } @@ -911,19 +915,19 @@ namespace CGAL { it.cont(); ++it ) { d = amap.create_dart(); - amap.link_beta(it->beta(2),d,dim); + amap.link_beta_for_involution(it->beta(2),d,dim); if ( withBeta3 ) { dd = amap.create_dart(); - amap.link_beta(it->beta(2)->beta(3),dd,dim); - amap.basic_link_beta(d, dd, 3); + amap.link_beta_for_involution(it->beta(2)->beta(3),dd,dim); + amap.basic_link_beta_for_involution(d, dd, 3); } if ( prec!=NULL ) { - amap.template link_beta<0>(prec,d); + amap.link_beta_0(prec,d); if ( withBeta3 ) { - amap.template link_beta<1>(prec->beta(3),dd); + amap.link_beta_1(prec->beta(3),dd); } } else first2 = prec; @@ -934,11 +938,12 @@ namespace CGAL { { if ( !it->is_free(dim2) && it->beta(dim2)->is_free(dim) ) - amap.basic_link_beta(it->beta(dim2)->beta(dim), d, dim2); + amap.basic_link_beta_for_involution(it->beta(dim2)->beta(dim), + d, dim2); if ( withBeta3 && !it->beta(3)->is_free(dim2) && it->beta(3)->beta(dim2)->is_free(dim) ) - amap.basic_link_beta(it->beta(3)->beta(dim2)->beta(dim), - dd, dim2); + amap.basic_link_beta_for_involution + (it->beta(3)->beta(dim2)->beta(dim), dd, dim2); } } prec = d; diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h index cba87c1d3b3..6deaac48151 100644 --- a/Combinatorial_map/include/CGAL/Dart.h +++ b/Combinatorial_map/include/CGAL/Dart.h @@ -67,15 +67,9 @@ namespace CGAL { template friend struct Remove_cell_functor; - template - friend struct internal::basic_link_beta_functor; - template friend struct internal::link_beta_functor; - template - friend struct internal::unlink_beta_functor; - public: typedef Dart Self; typedef typename Refs::Dart_handle Dart_handle; diff --git a/Combinatorial_map/include/CGAL/Dart_iterators.h b/Combinatorial_map/include/CGAL/Dart_iterators.h index 8f59b9a7ad3..3acc93c54bf 100644 --- a/Combinatorial_map/include/CGAL/Dart_iterators.h +++ b/Combinatorial_map/include/CGAL/Dart_iterators.h @@ -1891,8 +1891,8 @@ namespace CGAL { Base(amap, adart), mmark_number(amark) { - CGAL_static_assertion( d>=3 && d<=Map::dimension ); - CGAL_static_assertion( i>=3 && i<=Map::dimension ); + CGAL_assertion( d>=3 && d<=Map::dimension ); + CGAL_assertion( i>=3 && i<=Map::dimension ); if (adart!=NULL) this->mmap->mark(adart, mmark_number); } @@ -1913,7 +1913,7 @@ namespace CGAL { Dart_handle nd = NULL; - for ( unsigned int k=0; k<2; ++k ) + for ( int k=0; k<2; ++k ) { if ( this->is_unmarked((*this), k, mmark_number) ) { @@ -1932,7 +1932,7 @@ namespace CGAL { } } - for ( unsigned int k=2; k<=d; ++k ) + for ( int k=2; k<=d; ++k ) { if ( k!=i-1 && k!=i && k!=i+1 && this->is_unmarked((*this), k, mmark_number) ) @@ -2011,7 +2011,7 @@ namespace CGAL { Base(amap, adart), mmark_number(amark) { - CGAL_static_assertion( i>=3 && i<=Map::dimension ); + CGAL_assertion( i>=3 && i<=Map::dimension ); if (adart!=NULL) this->mmap->mark(adart, mmark_number); } @@ -2050,7 +2050,7 @@ namespace CGAL { } } } - for ( unsigned int k=2; k<=d; ++k ) + for ( int k=2; k<=d; ++k ) { if ( k!=i-1 && k!=i && k!=i+1 && this->is_unmarked((*this), k, mmark_number) ) diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_functors.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_functors.h index 1189dc0c1da..8834628ad8e 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_functors.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_functors.h @@ -42,520 +42,6 @@ namespace CGAL { int dim; }; - - /// Functor used to test if it is possible to i-sew two darts, - /// 2<=i<=dimension - template - struct is_sewable_functor{ - static bool run(const Map& amap, - typename Map::Dart_const_handle adart1, - typename Map::Dart_const_handle adart2) - { - CGAL_static_assertion(2<=i && i<=Map::dimension); - CGAL_assertion(adart1!=NULL && adart2!=NULL); - - if ( !adart1->is_free(i) || !adart2->is_free(i) || adart1==adart2 ) - return false; - - CMap_dart_const_iterator_of_involution I1(amap, adart1); - CMap_dart_const_iterator_of_involution_inv I2(amap, adart2); - bool res = true; - while (res && I1.cont() && I2.cont()) - { - // We can remove this constraint which is not required for - // combinatorial map definition, but which is quite "normal" - if ( I1==adart2 || I2==adart1 ) res=false; - - // Special case to consider beta0 and beta1 - if ( i>2 ) - { - if ( I1->is_free(0)!=I2->is_free(1) ) res = false; - else if ( I1->is_free(1)!=I2->is_free(0) ) res = false; - } - - // General case - for (unsigned int j=2;res && j<=Map::dimension; ++j) - { - if ( j+1!=i && j!=i && j!=i+1 && - I1->is_free(j)!=I2->is_free(j) ) - { res = false; } - } - ++I1; ++I2; - } - if (I1.cont() != I2.cont()) - res = false; - - return res; - } - }; - - /// Functor used to test if it is possible to 1-sew two darts. - template - struct is_sewable_functor{ - static bool run(const Map& amap, - typename Map::Dart_const_handle adart1, - typename Map::Dart_const_handle adart2) - { - CGAL_assertion(adart1!=NULL && adart2!=NULL); - - if ( !adart1->is_free(1) || !adart2->is_free(0) ) - return false; - - if ( adart1 == adart2 ) return true; - - CMap_dart_const_iterator_of_involution I1(amap, adart1); - CMap_dart_const_iterator_of_involution_inv I2(amap, adart2); - bool res = true; - while (res && I1.cont() && I2.cont()) - { - // We can remove this constraint which is not required for - // combinatorial map definition, but which imposes quite "normal" - // configurations - if ( I1==adart2 || I2==adart1 ) res=false; - - for (unsigned int j=3;res && j<=Map::dimension; ++j) - { - if ( I1->is_free(j)!=I2->is_free(j) ) - { - res = false; - } - } - ++I1; ++I2; - } - if (I1.cont() != I2.cont()) - res = false; - - return res; - } - }; - - /// Functor used to test if it is possible to 0-sew two darts. - template - struct is_sewable_functor{ - static bool run(const Map& amap, - typename Map::Dart_const_handle adart1, - typename Map::Dart_const_handle adart2) - { return is_sewable_functor::run(amap,adart2,adart1); } - }; - - /// Functor used to i-topo_sew two darts, 2<=i<=dimension. - template - struct topo_sew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_static_assertion(2<=i && i<=Map::dimension); - CGAL_assertion( (is_sewable_functor::run(amap,adart1,adart2)) ); - - CMap_dart_iterator_of_involution I1(amap, adart1); - CMap_dart_iterator_of_involution_inv I2(amap, adart2); - while ( I1.cont() ) - { - amap.basic_link_beta(I1, I2, i); - ++I1; ++I2; - } - } - }; - - /// Functor used to 1-topo_sew two darts. - template - struct topo_sew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion( (is_sewable_functor::run(amap,adart1,adart2)) ); - - int mark = amap.get_new_mark(); - std::vector dartv; - for (CMap_dart_iterator_basic_of_cell it(amap,adart1,mark); - it.cont(); ++it) - { - amap.mark(*it,mark); - dartv.push_back(*it); - } - - CMap_dart_iterator_of_involution I1(amap, adart1); - CMap_dart_iterator_of_involution_inv I2(amap, adart2); - while ( I1.cont() ) - { - if ( amap.is_marked(*I1,mark) ) - amap.template basic_link_beta<1>(*I1, *I2); - else - amap.template basic_link_beta<0>(*I1, *I2); - ++I1; ++I2; - } - - for (typename std::vector::iterator - it=dartv.begin(); it!=dartv.end(); ++it) - { amap.unmark(*it,mark); } - CGAL_assertion( amap.is_whole_map_unmarked(mark) ); - amap.free_mark(mark); - } - }; - - /// Functor used to 0-topo_sew two darts. - template - struct topo_sew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { topo_sew_functor::run(amap,adart2,adart1); } - }; - - /// Functor used to i-sew two darts, 2<=i<=dimension. - template - struct sew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_static_assertion(2<=i && i<=Map::dimension); - CGAL_assertion( (is_sewable_functor::run(amap,adart1,adart2)) ); - - CMap_dart_iterator_of_involution I1(amap, adart1); - CMap_dart_iterator_of_involution_inv I2(amap, adart2); - while ( I1.cont() ) - { - amap.group_all_attributes_except(I1,I2,i); - ++I1; ++I2; - } - - I1.rewind(); I2.rewind(); - while ( I1.cont() ) - { - amap.basic_link_beta(I1, I2, i); - ++I1; ++I2; - } - } - }; - - /// Functor used to 0-sew two darts. - template - struct sew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion( (is_sewable_functor::run(amap,adart1,adart2)) ); - - int mark = amap.get_new_mark(); - std::vector dartv; - for (CMap_dart_iterator_basic_of_cell it(amap,adart1,mark); - it.cont(); ++it) - { - amap.mark(it,mark); - dartv.push_back(it); - } - - CMap_dart_iterator_of_involution I1(amap, adart1); - CMap_dart_iterator_of_involution_inv I2(amap, adart2); - while ( I1.cont() ) - { - typename Map::Dart_handle od1=I1->other_extremity(); - typename Map::Dart_handle od2=I2->other_extremity(); - if (od1!=NULL && od2!=NULL) - amap.group_all_attributes_except(od1, od2, 1); - ++I1; ++I2; - } - - I1.rewind(); I2.rewind(); - while ( I1.cont() ) - { - if ( amap.is_marked(I1,mark) ) - amap.template basic_link_beta<0>(I1, I2); - else - amap.template basic_link_beta<1>(I1, I2); - ++I1; ++I2; - } - - for (typename std::vector::iterator - it=dartv.begin(); it!=dartv.end(); ++it) - { amap.unmark(*it,mark); } - CGAL_assertion( amap.is_whole_map_unmarked(mark) ); - amap.free_mark(mark); - } - }; - - /// Functor used to 1-sew two darts. - template - struct sew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion( (is_sewable_functor::run(amap,adart1,adart2)) ); - int mark = amap.get_new_mark(); - std::vector dartv; - for (CMap_dart_iterator_basic_of_cell it(amap,adart1,mark); - it.cont(); ++it) - { - amap.mark(it,mark); - dartv.push_back(it); - } - - CMap_dart_iterator_of_involution I1(amap, adart1); - CMap_dart_iterator_of_involution_inv I2(amap, adart2); - while ( I1.cont() ) - { - amap.group_all_attributes_except(I1,I2,1); - ++I1; ++I2; - } - - I1.rewind(); I2.rewind(); - while ( I1.cont() ) - { - if ( amap.is_marked(I1,mark) ) - amap.template basic_link_beta<1>(I1, I2); - else - amap.template basic_link_beta<0>(I1, I2); - ++I1; ++I2; - } - - for (typename std::vector::iterator - it=dartv.begin(); it!=dartv.end(); ++it) - { amap.unmark(*it,mark); } - CGAL_assertion( amap.is_whole_map_unmarked(mark) ); - amap.free_mark(mark); - } - }; - - /// Functor used to i-topo_unsew one dart, 2<=i<=dimension. - template - struct topo_unsew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart) - { - CGAL_assertion( adart!=NULL && !adart->is_free(i) ); - CGAL_static_assertion(2<=i && i<=Map::dimension); - - CMap_dart_iterator_of_involution it(amap, adart); - while ( it.cont() ) - { - amap.unlink_beta(*it, i); - ++it; - } - } - }; - - /// Functor used to 1-topo_unsew one dart. - template - struct topo_unsew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart) - { - CGAL_assertion( adart!=NULL && !adart->is_free(1) ); - - int mark = amap.get_new_mark(); - std::vector dartv; - for (CMap_dart_iterator_basic_of_cell it(amap,adart,mark); - it.cont(); ++it) - { - amap.mark(*it,mark); - dartv.push_back(*it); - } - - { - CMap_dart_iterator_of_involution it(amap, adart); - while ( it.cont() ) - { - if ( amap.is_marked(*it,mark) ) amap.unlink_beta<1>(*it); - else amap.unlink_beta<0>(*it); - ++it; - } - } - - for (typename std::vector::iterator - it=dartv.begin(); it!=dartv.end(); ++it) - { amap.unmark(*it,mark); } - CGAL_assertion( amap.is_whole_map_unmarked(mark) ); - amap.free_mark(mark); - } - }; - - /// Functor used to 1-topo_unsew one dart. - template - struct topo_unsew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart) - { - CGAL_assertion( adart!=NULL && !adart->is_free(0) ); - topo_unsew_functor::run(adart->beta(0)); - } - }; - - /// Functor used to i-unsew one dart, 2<=i<=dimension. - template - struct unsew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart) - { - CGAL_static_assertion(2<=i && i<=Map::dimension); - CGAL_assertion( adart!=NULL && !adart->is_free(i) ); - - std::stack > todegroup; - - CMap_dart_iterator_of_involution it(amap, adart); - while ( it.cont() ) - { - todegroup.push(Couple_dart_and_dim - (it,it->beta(i),i)); - amap.unlink_beta(it, i); - ++it; - } - - while (!todegroup.empty() ) - { - Couple_dart_and_dim c=todegroup.top(); - todegroup.pop(); - amap.degroup_all_attributes_except(c.d1,c.d2,c.dim); - } - } - }; - - /// Functor used to 1-unsew one dart. - template - struct unsew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart) - { - CGAL_assertion( adart!=NULL && !adart->is_free(1) ); - typename Map::Dart_handle d2 = NULL; - - int mark = amap.get_new_mark(); - std::vector dartv; - for (CMap_dart_iterator_basic_of_cell it(amap,adart,mark); - it.cont(); ++it) - { - amap.mark(it,mark); - dartv.push_back(it); - } - - { - CMap_dart_iterator_of_involution it(amap, adart); - while ( it.cont() ) - { - if ( amap.is_marked(it,mark) ) - { d2 = it->beta(1); amap.template unlink_beta<1>(it); } - else - { d2 = it->beta(0); amap.template unlink_beta<0>(it); } - amap.degroup_all_attributes_except(it,d2,1); - ++it; - } - } - - for (typename std::vector::iterator - it=dartv.begin(); it!=dartv.end(); ++it) - { amap.unmark(*it,mark); } - CGAL_assertion( amap.is_whole_map_unmarked(mark) ); - amap.free_mark(mark); - } - }; - - /// Functor used to 0-unsew one dart. - template - struct unsew_functor{ - static void run(Map& amap,typename Map::Dart_handle adart) - { - CGAL_assertion( adart!=NULL && !adart->is_free(0) ); - typename Map::Dart_handle d2 = NULL; - - int mark = amap.get_new_mark(); - std::vector dartv; - for (CMap_dart_iterator_basic_of_cell it(amap,adart,mark); - it.cont(); ++it) - { - amap.mark(it,mark); - dartv.push_back(it); - } - - { - CMap_dart_iterator_of_involution it(amap, adart); - while ( it.cont() ) - { - if ( amap.is_marked(it,mark) ) - { d2 = it->beta(0); amap.template unlink_beta<0>(it); } - else - { d2 = it->beta(1); amap.template unlink_beta<1>(it); } - - typename Map::Dart_handle od1=it->other_extremity(); - typename Map::Dart_handle od2=d2->other_extremity(); - if ( od1!=NULL && od2!=NULL ) - amap.degroup_all_attributes_except(od1,od2,1); - - ++it; - } - } - - for (typename std::vector::iterator - it=dartv.begin(); it!=dartv.end(); ++it) - { amap.unmark(*it,mark); } - CGAL_assertion( amap.is_whole_map_unmarked(mark) ); - amap.free_mark(mark); - } - }; - - /// Functor used to i-link two darts, 2<=i<=dimension. - template - struct basic_link_beta_functor{ - static void run(Map&,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion(adart1 != NULL && adart2 != NULL && adart1!=adart2); - CGAL_static_assertion( i>=2 && i<=Map::dimension ); - adart1->basic_link_beta(adart2, i); - adart2->basic_link_beta(adart1, i); - } - }; - - /// Functor used to 0-link two darts. - template - struct basic_link_beta_functor{ - static void run(Map&,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion(adart1 != NULL && adart2 != NULL ); - adart1->basic_link_beta(adart2, 0); - adart2->basic_link_beta(adart1, 1); - } - }; - - /// Functor used to 1-link two darts. - template - struct basic_link_beta_functor{ - static void run(Map& ,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion(adart1 != NULL && adart2 != NULL); - adart1->basic_link_beta(adart2, 1); - adart2->basic_link_beta(adart1, 0); - } - }; - - /// Functor used to i-unlink one dart. - template - struct unlink_beta_functor{ - static void run(Map&,typename Map::Dart_handle adart) - { - CGAL_assertion(adart != NULL && !adart->is_free(i)); - CGAL_static_assertion(2<=i && i<=Map::dimension); - adart->beta(i)->unlink_beta(i); - adart->unlink_beta(i); - } - }; - - /// Functor used to 0-unlink one dart. - template - struct unlink_beta_functor{ - static void run(Map&,typename Map::Dart_handle adart) - { - CGAL_assertion(adart != NULL && !adart->is_free(0)); - adart->beta(0)->unlink_beta(1); - adart->unlink_beta(0); - } - }; - - /// Functor used to 1-unlink one dart. - template - struct unlink_beta_functor{ - static void run(Map&,typename Map::Dart_handle adart) - { - CGAL_assertion(adart != NULL && !adart->is_free(1)); - adart->beta(1)->unlink_beta(0); - adart->unlink_beta(1); - } - }; - // Functor used to group one attribute of two given darts template struct Group_one_attribute_functor @@ -855,7 +341,7 @@ namespace CGAL { { CGAL_assertion( adim==-1 || (0<=adim && (unsigned int)adim<=CMap::dimension) ); - + // todo ASSERT (1<=adim && ...) ??? if ( adim!=0 ) { typename CMap::Dart_handle od = dh1->other_extremity(); @@ -897,49 +383,6 @@ namespace CGAL { } }; - /// Functor used to i-link two darts, 2<=i<=dimension. - template - struct link_beta_functor{ - static void run(CMap& amap,typename CMap::Dart_handle adart1, - typename CMap::Dart_handle adart2) - { - CGAL_assertion(adart1 != NULL && adart2 != NULL && adart1!=adart2 ); - CGAL_static_assertion( 2<=i && i<=CMap::dimension ); - adart1->basic_link_beta(adart2, i); - adart2->basic_link_beta(adart1, i); - CMap::Helper::template Foreach_enabled_attributes - >::run(&amap,adart1,adart2,i); - } - }; - - /// Functor used to 0-link two darts. - template - struct link_beta_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion(adart1 != NULL && adart2 != NULL); - adart1->basic_link_beta(adart2,0); - adart2->basic_link_beta(adart1, 1); - Map::Helper::template Foreach_enabled_attributes - >::run(&amap,adart1,adart2,0); - } - }; - - /// Functor used to 1-link two darts. - template - struct link_beta_functor{ - static void run(Map& amap,typename Map::Dart_handle adart1, - typename Map::Dart_handle adart2) - { - CGAL_assertion(adart1 != NULL && adart2 != NULL); - adart1->basic_link_beta(adart2,1); - adart2->basic_link_beta(adart1,0); - Map::Helper::template Foreach_enabled_attributes - >::run(&amap,adart1,adart2,1); - } - }; - // Functor used to call the On_split functor between the two given darts. template + struct Beta_functor; + + template + struct Beta_functor + { + static Dart_handle run(Dart_handle ADart, int B, Betas... betas) + { return Beta_functor::run(ADart->beta(B), betas...); } + }; + + template + struct Beta_functor + { + static Dart_handle run(Dart_handle ADart, int B) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B); + } + }; +#endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES + } // namespace internal } // namespace CGAL diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h index 7fdcc663e72..fc0f77d8cf4 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_utility_novariadic.h @@ -1634,7 +1634,75 @@ struct Foreach_static_restricted,n>{ static void run(const T1&,const T2&,const T3&,const T4&,const T5&,const T6&, const T7&,const T8&,const T9&){} }; - + +template +struct Beta_functor +{ + static Dart_handle run(Dart_handle ADart, int B) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2, int B3) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2)->beta(B3); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2, int B3, int B4) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2)->beta(B3)->beta(B4); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2, int B3, int B4, + int B5) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2)->beta(B3)->beta(B4)->beta(B5); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2, int B3, int B4, + int B5, int B6) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2)->beta(B3)->beta(B4)->beta(B5)-> + beta(B6); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2, int B3, int B4, + int B5, int B6, int B7) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2)->beta(B3)->beta(B4)->beta(B5)-> + beta(B6)->beta(B7); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2, int B3, int B4, + int B5, int B6, int B7, int B8) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2)->beta(B3)->beta(B4)->beta(B5)-> + beta(B6)->beta(B7)->beta(B8); + } + + static Dart_handle run(Dart_handle ADart, int B1, int B2, int B3, int B4, int B5, int B6, + int B7, int B8, int B9) + { + CGAL_assertion( ADart!=NULL ); + return ADart->beta(B1)->beta(B2)->beta(B3)->beta(B4)->beta(B5)-> + beta(B6)->beta(B7)->beta(B8)->beta(B9); + } +}; + + #endif //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES #endif //CGAL_INTERNAL_COMBINATORIAL_MAP_UTILITY_NOVARIADIC_H diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_2_test.h b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_2_test.h index 84d41ffa051..9b4ec1a37db 100644 --- a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_2_test.h +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_2_test.h @@ -252,7 +252,7 @@ void test2D() ( map, map.first_dart(), mark); nbc = 0; - for ( typename Map::template One_dart_per_incident_cell_range<0,3>::iterator + for ( typename Map::template One_dart_per_incident_cell_range<0,3, Map::dimension>::iterator it1 ( map, map.first_dart() ); it1.cont(); ++it1 ) { ++nbc; @@ -431,7 +431,7 @@ void test2D() std::vector V; { - for ( typename Map::template Dart_of_cell_range<0>::iterator it = + for ( typename Map::template Dart_of_cell_range<0, Map::dimension>::iterator it = map.template darts_of_cell<0>( d1 ).begin(); it != map.template darts_of_cell<0>( d1 ).end(); ++it ) V.push_back ( it ); diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h index c64015f1386..2b0dddd51ff 100644 --- a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_3_test.h @@ -1002,6 +1002,8 @@ template d2 = make_combinatorial_hexahedron(map); map.template sew<3>(d1,d2); d3 = d1->beta(2); + d4 = map.beta(d1, 1,3,1,2); + CGAL_assertion(d4==d1->beta(1)->beta(3)->beta(1)->beta(2)); map.display_characteristics(cout) << ", valid=" << map.is_valid() << endl; cout << "remove facet4: " << flush; CGAL::remove_cell(map,d1); map.display_characteristics(cout) << ", valid=" << map.is_valid() << endl; @@ -1012,8 +1014,8 @@ template map.clear(); v.clear(); cout << "***************************** TEST INSERT FACET 3D DONE." - << endl; - + << endl; + /* cout << "***************************** TEST EDGE CONTRACTION 3D:" << endl; diff --git a/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp b/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp new file mode 100644 index 00000000000..8dd3d98795c --- /dev/null +++ b/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp @@ -0,0 +1,101 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + + +#define bench(METHOD,CONTAINER) \ +{\ + std::size_t previous=0;\ + unsigned run=0;\ + CGAL::Timer time;\ + do{\ + result.clear();\ + time.start();\ + METHOD( CONTAINER.begin(), CONTAINER.end(), std::back_inserter(result) );\ + time.stop();\ + if( previous!=0 && previous!=result.size()) std::cerr << "error got different result" << std::endl;\ + previous=result.size();\ + }while(++run Points; +typedef CGAL::Creator_uniform_2 Creator; + +int main(int argc, char** argv) +{ + unsigned nbpts=100000; + unsigned repeat=0; + unsigned seed=0; + + if (argc>1) nbpts=atoi(argv[1]); + + if (argc>2) repeat=atoi(argv[2]); + if (argc>3) seed=atoi(argv[3]); + + Points points, result; + + CGAL::Random r(seed); + CGAL::Random_points_in_disc_2 g( 150.0,r); + CGAL::cpp0x::copy_n( g, nbpts, std::back_inserter(points)); + + //the following code is for testing when there is only two extreme points, affine hull is 2D + /* + CGAL::Bbox_2 bbox=points.begin()->bbox(); + for (Points::iterator it=points.begin();it!=points.end();++it) + bbox=bbox+it->bbox(); + + points.push_back( Point_2(bbox.xmin()-1,bbox.ymin()-1) ); + points.push_back( Point_2(bbox.xmax()+1,bbox.ymax()+1) ); + */ + + //the following code is for testing when there is only three extreme points + /* + CGAL::Bbox_2 bbox=points.begin()->bbox(); + for (Points::iterator it=points.begin();it!=points.end();++it) + bbox=bbox+it->bbox(); + + points.push_back( Point_2(bbox.xmin()-1,bbox.ymin()-1) ); + points.push_back( Point_2(bbox.xmax()+1,bbox.ymax()+1) ); + points.push_back( Point_2(bbox.xmax(),bbox.ymax()+2) ); + */ + + //the following code is for testing when there is only two extreme points, affine hull is 1D + /* + points.clear(); + for (unsigned i=0;i pt_list; + std::copy(points.begin(),points.end(),std::back_inserter(pt_list)); + std::cout << "Using list" << std::endl; + bench(CGAL::convex_hull_2,pt_list) + } +} diff --git a/Convex_hull_2/dont_submit b/Convex_hull_2/dont_submit index efd261bf795..1cfbb78f2b0 100644 --- a/Convex_hull_2/dont_submit +++ b/Convex_hull_2/dont_submit @@ -1 +1,2 @@ -demo \ No newline at end of file +demo +benchmark diff --git a/Convex_hull_2/examples/Convex_hull_2/iostream_convex_hull_2.cin b/Convex_hull_2/examples/Convex_hull_2/iostream_convex_hull_2.cin new file mode 100644 index 00000000000..1aba31c842d --- /dev/null +++ b/Convex_hull_2/examples/Convex_hull_2/iostream_convex_hull_2.cin @@ -0,0 +1,500 @@ +5887 415 +3001 7410 +1424 5645 +152 4513 +3309 92 +2056 5013 +2867 5103 +2130 2112 +1175 6885 +5961 1334 +6698 1687 +1697 6506 +2314 413 +6748 3033 +2999 6466 +4108 1497 +7058 4673 +2722 2660 +5650 7834 +6133 6758 +3437 5836 +5105 6980 +4859 7847 +661 5558 +7217 4971 +3914 8121 +2335 7065 +7768 5448 +788 6284 +435 5097 +2081 6371 +7561 3193 +7162 5054 +7192 1834 +613 5359 +6277 6713 +5133 4829 +2662 6455 +3016 430 +2142 3057 +4580 8102 +4023 3026 +5238 889 +285 2713 +6821 4910 +4476 6977 +7789 4847 +7146 6828 +925 2001 +5976 743 +796 3028 +3013 2308 +3259 7382 +6164 6374 +194 4727 +1465 7214 +3907 2634 +6618 7097 +7321 6129 +1004 6739 +6022 974 +6673 3219 +7622 4192 +5190 538 +3362 5537 +7109 6405 +3804 3786 +6490 3234 +6537 1970 +3981 4339 +4068 2563 +5859 786 +1909 7558 +5583 7876 +7884 5617 +6019 3225 +3833 1376 +2944 5302 +5985 5130 +6577 1577 +4222 8106 +2508 1459 +1300 7061 +6999 4506 +3372 8095 +7729 4514 +2606 2035 +4955 3001 +493 2389 +6837 3086 +1445 2160 +4987 5290 +7734 3466 +7663 2721 +406 5869 +6155 4289 +5652 3638 +2799 7406 +6218 3448 +1205 1578 +910 6660 +3581 5926 +899 3226 +4711 8048 +7154 5459 +139 5011 +7924 4481 +2386 6534 +6551 6706 +3970 3804 +3322 1252 +221 5229 +6917 7037 +4904 4789 +6047 6939 +1408 1784 +7278 4252 +4978 6220 +3934 6489 +6418 4256 +7919 5067 +6686 6448 +7967 3366 +7201 6764 +5898 747 +1906 2521 +3554 1386 +3490 7235 +6420 3292 +3545 3232 +6992 6850 +2924 5246 +2925 5579 +5371 1375 +3114 7794 +7 3861 +756 6438 +1125 3570 +7914 2782 +156 5153 +124 3792 +8028 5212 +3243 7377 +4643 6666 +7624 2363 +39 3540 +7116 5850 +5492 7943 +1726 6801 +4614 8158 +3510 6369 +4942 7139 +8053 5151 +707 4269 +1337 4824 +1155 6936 +3706 527 +4092 6932 +3614 364 +1389 3831 +5281 5182 +4315 7519 +1556 6863 +3610 668 +8051 3906 +32 4395 +4139 6410 +3193 7994 +519 5682 +509 6045 +3852 405 +87 3630 +4239 4694 +172 5208 +7361 4978 +6645 6246 +2817 4623 +7028 3898 +5314 4602 +7665 5467 +5663 1090 +3144 5935 +3168 8052 +2937 5645 +1413 2424 +2050 7610 +1584 4625 +1157 5450 +1493 5679 +3957 2665 +7686 3408 +2113 7498 +1080 3224 +1280 1476 +416 2608 +1589 2904 +3181 1172 +5319 327 +1655 815 +2750 1856 +5194 227 +3690 88 +3158 110 +1939 1895 +1959 678 +4290 3233 +8174 4474 +7020 6558 +3487 58 +6739 1346 +5285 6976 +1864 868 +4549 7895 +6127 582 +7725 2371 +4724 260 +5313 7499 +2653 3268 +4859 261 +4940 7249 +37 3593 +5038 4715 +739 2328 +1931 7258 +4702 3719 +214 2814 +2343 7707 +2242 2768 +2617 3520 +1417 5126 +7126 4971 +7518 3994 +3750 811 +2348 659 +3655 8063 +5576 4351 +7712 5908 +7549 5586 +608 4468 +897 4757 +7289 6329 +3402 2683 +6318 5202 +6192 1653 +7181 1465 +4559 42 +5303 7744 +7742 3505 +1414 6945 +5829 2677 +2445 364 +5822 6436 +594 2235 +2704 1660 +756 3301 +2068 3952 +7622 2111 +1056 4184 +6878 1379 +2472 4005 +7637 2051 +7234 1587 +1304 7087 +8020 2942 +1320 2042 +903 1666 +4207 1633 +6504 7081 +3191 7117 +2083 5272 +5412 3493 +1262 3960 +1408 6935 +4113 8111 +1896 4070 +2951 4895 +3896 3293 +2327 2823 +1040 6593 +168 3957 +3153 7837 +4515 8130 +938 4262 +3569 6276 +1285 5931 +4958 7424 +1735 5690 +2510 4100 +2258 2174 +6693 4939 +2856 7251 +4800 1983 +4923 1181 +7262 1539 +7629 6167 +6026 4578 +2421 7824 +863 6315 +7298 2459 +6243 769 +7914 3218 +5075 947 +4031 3880 +7417 5501 +3740 7138 +499 3554 +7040 4680 +644 4803 +6879 2086 +7750 2400 +7090 5971 +2715 4008 +5157 993 +401 4780 +469 3191 +247 3081 +2626 5305 +7831 3323 +2439 3379 +2217 3054 +3477 158 +2619 7619 +2092 2313 +806 4004 +3859 7956 +1902 7258 +7075 1306 +1584 4628 +606 4183 +7604 2746 +7725 5980 +5352 6531 +925 4829 +519 3517 +4510 6815 +3939 1583 +5587 1879 +962 2440 +3374 8056 +384 3233 +16 3750 +4294 23 +806 5983 +810 2210 +7812 5808 +3600 7564 +1672 801 +4902 1100 +2166 864 +3947 386 +1744 2375 +809 3229 +2818 7959 +2458 370 +1132 2452 +6678 2040 +8026 4273 +1752 7320 +562 3332 +5823 3949 +6820 4267 +7783 5877 +4444 2849 +4525 738 +1629 5442 +6568 4432 +6496 1497 +5229 7991 +6846 5155 +1495 7247 +270 4290 +6504 4747 +4356 8170 +7655 5576 +629 2217 +5201 7777 +1472 4426 +6273 2818 +450 5821 +538 4480 +3235 118 +4710 7913 +5357 7992 +5885 7663 +228 4242 +7840 5496 +2711 7939 +4810 96 +5888 5734 +7788 2428 +7202 5711 +6928 1142 +2411 7824 +1406 7055 +1549 894 +2250 3013 +2449 1048 +1915 640 +3065 7903 +6362 7371 +2035 6607 +2465 3099 +193 3209 +5665 3774 +3614 831 +6038 495 +1916 7336 +3753 7265 +1394 1607 +2338 1205 +1004 1462 +6195 3779 +3420 8123 +7148 5301 +2529 4608 +3574 281 +1582 2050 +601 1962 +6667 2847 +4947 359 +3245 7872 +579 4940 +2642 269 +2703 853 +912 2854 +4765 972 +6048 499 +2933 1020 +8065 3113 +4376 7932 +4678 5484 +4769 7467 +7963 5276 +7280 1548 +455 2598 +3200 3714 +7063 4333 +7967 3726 +6918 1380 +541 2072 +839 6554 +3168 4672 +7050 6858 +366 5697 +6994 5928 +7759 5807 +3523 392 +4744 53 +6376 3289 +2111 5838 +7743 5008 +3704 8171 +3707 2431 +7656 4869 +591 2448 +5981 7731 +1312 2434 +2616 521 +2282 6225 +6557 1734 +3811 1702 +1471 6985 +3270 2142 +619 5511 +64 3965 +4097 2438 +2298 7773 +5160 8035 +7463 5250 +1530 5996 +3933 1260 +1976 3259 +290 4058 +1571 7216 +1077 1464 +1643 7366 +3461 7728 +7200 3490 +5862 7720 +3034 4119 +6112 566 +1954 7443 +3793 6048 +8014 3305 +2283 7576 +7210 4879 +847 6503 +562 2637 +4350 7957 +4795 974 +4095 1188 +1271 4802 +6696 4009 +2965 7334 +3261 5206 +2671 6041 +7562 2516 +2497 4139 +2737 806 +2378 5325 diff --git a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h index 3ce12f0bf92..14069d8e69c 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_2/ch_akl_toussaint_impl.h @@ -31,9 +31,195 @@ #include #include #include +#include +#include +#include namespace CGAL { + +namespace internal{ + +template +inline +cpp0x::tuple +ch_nswe_point_with_order( ForwardIterator first, ForwardIterator last, + ForwardIterator& n, + ForwardIterator& s, + ForwardIterator& w, + ForwardIterator& e, + const Traits& ch_traits, + std::forward_iterator_tag ) +{ + typename Traits::Less_xy_2 + lexicographically_xy_smaller = ch_traits.less_xy_2_object(); + typename Traits::Less_yx_2 + lexicographically_yx_smaller = ch_traits.less_yx_2_object(); + n = s = w = e = first; + unsigned i=0; + //array use to track the position of w,e,n,s in the range. first is for the position, second to track + //the original position after sorting + std::pair positions[4]={ + std::make_pair(0,0), + std::make_pair(0,1), + std::make_pair(0,2), + std::make_pair(0,3) }; + + while ( first != last ) + { + if ( lexicographically_xy_smaller( *first, *w )) { w = first; positions[0].first=i; } + if ( lexicographically_xy_smaller( *e, *first )) { e = first; positions[1].first=i; } + if ( lexicographically_yx_smaller( *n, *first )) { n = first; positions[2].first=i; } + if ( lexicographically_yx_smaller( *first, *s )) { s = first; positions[3].first=i; } + ++first; + ++i; + } + ForwardIterator iterators[4]={w,e,n,s}; + std::sort(positions,positions+4); + + return cpp0x::make_tuple( + iterators[positions[0].second], + iterators[positions[1].second], + iterators[positions[2].second], + iterators[positions[3].second] + ); +} + + +template +inline +cpp0x::tuple +ch_nswe_point_with_order( RandomAccessIterator first, RandomAccessIterator last, + RandomAccessIterator& n, + RandomAccessIterator& s, + RandomAccessIterator& w, + RandomAccessIterator& e, + const Traits& ch_traits, + std::random_access_iterator_tag) +{ + ch_nswe_point(first,last,n,s,w,e,ch_traits); + RandomAccessIterator iterators[4]={w,e,n,s}; + std::sort(iterators,iterators+4); + + return cpp0x::make_tuple( + iterators[0], + iterators[1], + iterators[2], + iterators[3] + ); +} + +//this function does the same as ch_nswe_point but return the iterators n,s,w,e +//sorted according to their positions in the range [first,last] +template +inline +cpp0x::tuple +ch_nswe_point_with_order( ForwardIterator first, ForwardIterator last, + ForwardIterator& n, + ForwardIterator& s, + ForwardIterator& w, + ForwardIterator& e, + const Traits& ch_traits) +{ + return ch_nswe_point_with_order(first,last,n,s,w,e,ch_traits,typename std::iterator_traits::iterator_category()); +} + +template +inline +void ch_akl_toussaint_assign_points_to_regions(ForwardIterator first, ForwardIterator last, + const typename Traits::Left_turn_2& left_turn, + ForwardIterator e, + ForwardIterator w, + ForwardIterator n, + ForwardIterator s, + std::vector< typename Traits::Point_2 >& region1, + std::vector< typename Traits::Point_2 >& region2, + std::vector< typename Traits::Point_2 >& region3, + std::vector< typename Traits::Point_2 >& region4, + const Traits&) +{ + for ( ; first != last; ++first ) + { + if ( left_turn(*e, *w, *first ) ) + { + if ( left_turn( *s, *w, *first ) ) region1.push_back( *first ); + else if ( left_turn( *e, *s, *first ) ) region2.push_back( *first ); + } + else + { + if ( left_turn( *n, *e, *first ) ) region3.push_back( *first ); + else if ( left_turn( *w, *n, *first ) ) region4.push_back( *first ); + } + } +} + +template +inline +void ch_akl_toussaint_assign_points_to_regions_deg(ForwardIterator first, ForwardIterator last, + const typename Traits::Left_turn_2& left_turn, + ForwardIterator e, + ForwardIterator w, + ForwardIterator n, + ForwardIterator s, + std::vector< typename Traits::Point_2 >& region1, + std::vector< typename Traits::Point_2 >& region2, + std::vector< typename Traits::Point_2 >& region3, + std::vector< typename Traits::Point_2 >& region4, + int duplicated_exteme_points, + const Traits& traits) +{ + std::vector< typename Traits::Point_2 >& r1 = (s==w?region2:region1); + std::vector< typename Traits::Point_2 >& r3 = (n==e?region4:region3); + switch(duplicated_exteme_points){ + case 2: + { + typename Traits::Orientation_2 orient = traits.orientation_2_object(); + for ( ; first != last; ++first ) + { + switch( orient(*e,*w,*first) ){ + case LEFT_TURN: + r1.push_back( *first ); + break; + case RIGHT_TURN: + r3.push_back( *first ); + break; + default: + break; + } + } + break; + } + default: //this is case 1 + if (s==w || s==e){ + for ( ; first != last; ++first ) + { + if ( left_turn(*e, *w, *first ) ) + r1.push_back( *first ); + else + { + if ( left_turn( *n, *e, *first ) ) region3.push_back( *first ); + else if ( left_turn( *w, *n, *first ) ) region4.push_back( *first ); + } + } + } + else{ + for ( ; first != last; ++first ) + { + //note that e!=w and s!=n except if the convex hull is a point (they are lexicographically sorted) + if ( left_turn(*e, *w, *first ) ) + { + if (s!=w && left_turn( *s, *w, *first ) ) region1.push_back( *first ); + else if (e!=s && left_turn( *e, *s, *first ) ) region2.push_back( *first ); + } + else + r3.push_back( *first ); + } + } + } +} + +}//namespace internal + template OutputIterator ch_akl_toussaint(ForwardIterator first, ForwardIterator last, @@ -52,7 +238,9 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last, if (first == last) return result; ForwardIterator n, s, e, w; - ch_nswe_point( first, last, n, s, w, e, ch_traits); + cpp0x::tuple ranges= + internal::ch_nswe_point_with_order( first, last, n, s, w, e, ch_traits); + if (equal_points(*n, *s) ) { *result = *w; ++result; @@ -73,21 +261,35 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last, region4.push_back( *n); CGAL_ch_postcondition_code( ForwardIterator save_first = first; ) - - for ( ; first != last; ++first ) + + int duplicated_exteme_points = (cpp0x::get<0>(ranges)==cpp0x::get<1>(ranges)?1:0) + + (cpp0x::get<1>(ranges)==cpp0x::get<2>(ranges)?1:0) + + (cpp0x::get<2>(ranges)==cpp0x::get<3>(ranges)?1:0); + + //several calls to avoid filter failures when using n,s,e,w + if (duplicated_exteme_points) { - if ( left_turn(*e, *w, *first ) ) - { - if ( left_turn( *s, *w, *first ) ) region1.push_back( *first ); - else if ( left_turn( *e, *s, *first ) ) region2.push_back( *first ); - } - else - { - if ( left_turn( *n, *e, *first ) ) region3.push_back( *first ); - else if ( left_turn( *w, *n, *first ) ) region4.push_back( *first ); - } + internal::ch_akl_toussaint_assign_points_to_regions_deg(first,cpp0x::get<0>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,duplicated_exteme_points,ch_traits); + + if ( cpp0x::get<0>(ranges)!=cpp0x::get<1>(ranges) ) + internal::ch_akl_toussaint_assign_points_to_regions_deg(cpp0x::next(cpp0x::get<0>(ranges)),cpp0x::get<1>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,duplicated_exteme_points,ch_traits); + + if ( cpp0x::get<1>(ranges)!=cpp0x::get<2>(ranges) ) + internal::ch_akl_toussaint_assign_points_to_regions_deg(cpp0x::next(cpp0x::get<1>(ranges)),cpp0x::get<2>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,duplicated_exteme_points,ch_traits); + + if ( cpp0x::get<2>(ranges)!=cpp0x::get<3>(ranges) ) + internal::ch_akl_toussaint_assign_points_to_regions_deg(cpp0x::next(cpp0x::get<2>(ranges)),cpp0x::get<3>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,duplicated_exteme_points,ch_traits); + + internal::ch_akl_toussaint_assign_points_to_regions_deg(cpp0x::next(cpp0x::get<3>(ranges)),last,left_turn,e,w,n,s,region1,region2,region3,region4,duplicated_exteme_points,ch_traits); } - + else{ + internal::ch_akl_toussaint_assign_points_to_regions(first,cpp0x::get<0>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,ch_traits); + internal::ch_akl_toussaint_assign_points_to_regions(cpp0x::next(cpp0x::get<0>(ranges)),cpp0x::get<1>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,ch_traits); + internal::ch_akl_toussaint_assign_points_to_regions(cpp0x::next(cpp0x::get<1>(ranges)),cpp0x::get<2>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,ch_traits); + internal::ch_akl_toussaint_assign_points_to_regions(cpp0x::next(cpp0x::get<2>(ranges)),cpp0x::get<3>(ranges),left_turn,e,w,n,s,region1,region2,region3,region4,ch_traits); + internal::ch_akl_toussaint_assign_points_to_regions(cpp0x::next(cpp0x::get<3>(ranges)),last,left_turn,e,w,n,s,region1,region2,region3,region4,ch_traits); + } + #if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ || defined(NDEBUG) OutputIterator res(result); diff --git a/Convex_hull_2/include/CGAL/Convex_hull_projective_xy_traits_2.h b/Convex_hull_2/include/CGAL/Convex_hull_projective_xy_traits_2.h index fcca94e6510..52974f77ec6 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_projective_xy_traits_2.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_projective_xy_traits_2.h @@ -21,6 +21,11 @@ #ifndef CGAL_CONVEX_HULL_PROJECTIVE_XY_TRAITS_2_H #define CGAL_CONVEX_HULL_PROJECTIVE_XY_TRAITS_2_H + +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + #include namespace CGAL { diff --git a/Convex_hull_2/include/CGAL/Convex_hull_projective_xz_traits_2.h b/Convex_hull_2/include/CGAL/Convex_hull_projective_xz_traits_2.h index ec5af11ec69..ec8c7e93ec5 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_projective_xz_traits_2.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_projective_xz_traits_2.h @@ -21,6 +21,10 @@ #ifndef CGAL_CONVEX_HULL_PROJECTIVE_XZ_TRAITS_2_H #define CGAL_CONVEX_HULL_PROJECTIVE_XZ_TRAITS_2_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + #include #include #include diff --git a/Convex_hull_2/include/CGAL/Convex_hull_projective_yz_traits_2.h b/Convex_hull_2/include/CGAL/Convex_hull_projective_yz_traits_2.h index 8ad48b2a044..ab0061b3120 100644 --- a/Convex_hull_2/include/CGAL/Convex_hull_projective_yz_traits_2.h +++ b/Convex_hull_2/include/CGAL/Convex_hull_projective_yz_traits_2.h @@ -21,6 +21,10 @@ #ifndef CGAL_CONVEX_HULL_PROJECTIVE_YZ_TRAITS_2_H #define CGAL_CONVEX_HULL_PROJECTIVE_YZ_TRAITS_2_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + #include namespace CGAL { diff --git a/Convex_hull_2/test/Convex_hull_2/ch2_projection_3.cpp b/Convex_hull_2/test/Convex_hull_2/ch2_projection_3.cpp new file mode 100644 index 00000000000..fa5859fc22c --- /dev/null +++ b/Convex_hull_2/test/Convex_hull_2/ch2_projection_3.cpp @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef CGAL::Projection_traits_xy_3 Traits; +typedef Traits::Point_2 Point_2; + +int main(){ + std::vector points; + std::ifstream input("data/CD500"); + + double x,y; + while (input >> x >> y){ + points.push_back(Point_2(x,y,3.)); + } + + std::vector ch2; + + CGAL::convex_hull_2(points.begin(),points.end(),std::back_inserter(ch2),Traits()); + + std::cout << ch2.size() << std::endl; +} diff --git a/Core/include/CGAL/CORE/poly/Sturm.h b/Core/include/CGAL/CORE/poly/Sturm.h index 5459543139e..8332d67a514 100644 --- a/Core/include/CGAL/CORE/poly/Sturm.h +++ b/Core/include/CGAL/CORE/poly/Sturm.h @@ -125,7 +125,7 @@ public: // various support methods in BigFloat.h (exact_div, gcd, etc). // Constructor from a BigFloat polynomial // Need the fake argument to avoid compiler overloading errors - Sturm(Polynomial pp, bool fake) : NEWTON_DIV_BY_ZERO(false) { + Sturm(Polynomial pp, bool /* fake */) : NEWTON_DIV_BY_ZERO(false) { len = pp.getTrueDegree(); if (len <= 0) return; // hence, seq is not defined in these cases seq = new Polynomial [len+1]; diff --git a/Core/include/CGAL/export/CORE.h b/Core/include/CGAL/export/CORE.h old mode 100755 new mode 100644 diff --git a/Core/src/CGALCore/CMakeLists.txt b/Core/src/CGALCore/CMakeLists.txt index 9c880bc888a..1494ae5b374 100644 --- a/Core/src/CGALCore/CMakeLists.txt +++ b/Core/src/CGALCore/CMakeLists.txt @@ -1,29 +1,18 @@ -project (CGAL_Core) - -# Minimal version of CMake: -cmake_minimum_required(VERSION 2.6.2) +message("Configuring libCGAL_Core") + +use_essential_libs() -# Tested version: -if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) - if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) - cmake_policy(VERSION 2.8.4) - else() - cmake_policy(VERSION 2.6) - endif() -endif() +include_directories (${CGAL_3RD_PARTY_INCLUDE_DIRS}) -if ( NOT CGAL_FOUND ) - find_package(CGAL REQUIRED) -endif() +add_definitions(${CGAL_3RD_PARTY_DEFINITIONS}) -include(${CGAL_USE_FILE}) +link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) -include_directories( ${CGAL_3RD_PARTY_INCLUDE_DIRS} ) - -build_cgal_library(CGAL_Core CGALCore "") +collect_cgal_library(CGAL_Core CGALCore "") + +target_link_libraries( CGAL_Core ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ) add_dependencies( CGAL_Core CGAL ) -add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ) - -target_link_libraries( CGAL_Core ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ) +message("libCGAL_Core is configured") + diff --git a/Developers_manual/doc_tex/Developers_manual.tex b/Developers_manual/doc_tex/Developers_manual.tex index 7c1fb8f39d7..c71d3077dbc 100644 --- a/Developers_manual/doc_tex/Developers_manual.tex +++ b/Developers_manual/doc_tex/Developers_manual.tex @@ -10,10 +10,6 @@ \lcTex{\usepackage{color}} \usepackage{nonlinkedpath} -% This will be the public edition of the developers manual. -\newcommand{\InternalOnly}[1]{} -\newcommand{\ExternalOnly}[1]{#1} - \makeindex \begin{document} diff --git a/Developers_manual/doc_tex/Developers_manual/addresses.tex b/Developers_manual/doc_tex/Developers_manual/addresses.tex deleted file mode 100644 index f0293ab2c7b..00000000000 --- a/Developers_manual/doc_tex/Developers_manual/addresses.tex +++ /dev/null @@ -1,70 +0,0 @@ -% ============================================================================= -% The CGAL Developers' Manual -% Chapter: Mailing Lists and Addresses -% ----------------------------------------------------------------------------- -% file : addresses.tex -% authors: Susan Hert -% ----------------------------------------------------------------------------- -% $Id$ -% $Date$ -% ============================================================================= - -\chapter{Mailing Lists and Addresses\label{chap:addresses}} -\ccChapterRelease{Chapter Version: 1.0} -\ccChapterAuthor{Susan Hert ({\tt hert@mpi-sb.mpg.de})} -\ccIndexMainItemBegin{email addresses} -\ccIndexMainItemBegin{mailing lists} - -There are a number of mailing lists and email addresses that have been set -up to communicate with various subsets of the \cgal\ community. The -addresses that should be of interest to \cgal\ developers are as follows. -The up-to-date addresses and archives can be found on the web site. - -\begin{description} -\item[{\tt cgal-develop}] - \index{cgal_develop mailing list@{\tt cgal-develop} mailing list} - This list is intended for discussing detailed matters - about implementation and development issues. All developers should - subscribe to this list. - -\item[\ccAnchor{mailto:cgal-commits@lists.gforge.inria.fr}{{\tt cgal-commits@lists.gforge.inria.fr}}] - \index{cgal-commits mailing list@{\tt cgal-commits} mailing list} - This list is read-only. It collects all automatic mails sent by - the SVN server, one per commit, with the log messages and the URLS - pointing to the corresponding diffs. - Developers can subscribe to this list from - \ccAnchor{https://gforge.inria.fr/mail/?group_id=52}{\cgal\ mailing lists page}. - An \ccAnchor{http://lists.gforge.inria.fr/cgi-bin/mailman/private/cgal-commits}{archive} - of this mailing list is maintained% - \begin{ccTexOnly} - at \nonlinkedpath|http://lists.gforge.inria.fr/cgi-bin/mailman/private/cgal-commits| - \end{ccTexOnly}. To enter this archive, use your email address and InriaGForge - password. - -\item[{\tt cgal-discuss}] - \index{cgal-discuss mailing list@{\tt cgal-discuss} mailing list} - Users of \cgal\ post questions and discuss issues - related to \cgal\ on this list. All developers should subscribe to this - list so they can answer questions relevant to their packages and monitor - the input from the users provided here. - -\item[{\tt cgal-announce}] - \index{cgal-announce mailing list@{\tt cgal-announce} mailing list} - Announcements of new releases, bug fixes, special courses, etc. are posted - to this list. The list is moderated (meaning every message posted needs - to be approved) to keep the traffic low. - -\item[{\tt cgal-editorial-board}] - \index{cgal-editorial-board mailing list@{\tt cgal-editorial-board} mailing list} - This is the email address to which you should - send proposed design specifications (Chapter~\ref{chap:specification}) - for approval by the editorial - board (Section~\ref{sec:editorial_board}). Anyone can do that - at any time about any \cgal\ design issues. -\end{description} - -The mailing lists at \texttt{lists.gforge.inria.fr} and -\texttt{lists-sop.inria.fr} are currently maintained by -Sylvain Pion, Mariette Yvinec, Monique Teillaud. -\ccIndexMainItemEnd{email addresses} -\ccIndexMainItemEnd{mailing lists} diff --git a/Developers_manual/doc_tex/Developers_manual/chapters.tex b/Developers_manual/doc_tex/Developers_manual/chapters.tex index 873923bc826..351d9cc5251 100644 --- a/Developers_manual/doc_tex/Developers_manual/chapters.tex +++ b/Developers_manual/doc_tex/Developers_manual/chapters.tex @@ -15,11 +15,6 @@ \input{Developers_manual/index_see} \include{Developers_manual/intro} -\InternalOnly{ -\include{Developers_manual/specification} -%\include{Developers_manual/directory_structure} -\include{Developers_manual/tools} -} \include{Developers_manual/code_format} \include{Developers_manual/kernels} \include{Developers_manual/traits_classes} @@ -31,16 +26,6 @@ \include{Developers_manual/iterators_and_circulators} \include{Developers_manual/robustness} \include{Developers_manual/portability} -%\InternalOnly{ -%\include{Developers_manual/testing} -%} \include{Developers_manual/debugging} -%\InternalOnly{ -%\include{Developers_manual/examples_and_demos} -%} \include{Developers_manual/submission_process} -\InternalOnly{ -\include{Developers_manual/releases} -\include{Developers_manual/addresses} -} \include{Developers_manual/information_sources} diff --git a/Developers_manual/doc_tex/Developers_manual/code_format.tex b/Developers_manual/doc_tex/Developers_manual/code_format.tex index 5c21924982b..dfd7d608a6d 100644 --- a/Developers_manual/doc_tex/Developers_manual/code_format.tex +++ b/Developers_manual/doc_tex/Developers_manual/code_format.tex @@ -338,6 +338,32 @@ The first list of items are meant as rules, \ie,~you should follow them. ... #endif // CGAL_THIS_IS_AN_EXAMPLE_H \end{verbatim} + \item Support the + \ccAnchor{http://www.boost.org/doc/libs/release/libs/utility/utility.htm#result_of}{result\_of} + protocol whenever your functors have more than one return type + otherwise provide a \ccStyle{result_type} member typedef. + + An example for this is a C++03 style \ccStyle{identity} + functor: + + \begin{cprog} + struct Identity { + template + T& operator()(T& t) { return t; } + template + const T& operator()(const T& t) { return t; } + template + struct result; + template + struct result { + typedef T& type; + }; + template + struct result { + typedef const T& type; + }; + }; + \end{cprog} \end{itemize} The following items can be seen as recommendations diff --git a/Developers_manual/doc_tex/Developers_manual/directory_structure.tex b/Developers_manual/doc_tex/Developers_manual/directory_structure.tex deleted file mode 100644 index b086f4c5961..00000000000 --- a/Developers_manual/doc_tex/Developers_manual/directory_structure.tex +++ /dev/null @@ -1,436 +0,0 @@ -% ============================================================================= -% The CGAL Developers' Manual -% Chapter: Directory Structure for Packages -% ----------------------------------------------------------------------------- -% file : directory_structure.tex -% authors: Geert-Jan Giezeman & Susan Hert -% ----------------------------------------------------------------------------- -% $Id$ -% $Date$ -% ============================================================================= - -\chapter{Directory Structure for Packages\label{chap:directory_structure}} -\ccIndexMainItemBegin{directory structure} -\ccIndexSubitemBegin{submitting}{directory structure for} -\ccChapterRelease{Chapter Version: 1.1} -\ccChapterAuthor{Geert-Jan Giezeman ({\tt geert@cs.uu.nl})\\ - Susan Hert ({\tt hert@mpi-sb.mpg.de})\\ - Sylvain Pion} - -In order for code, demos, documentation, {\em etc.} developed for \cgal\ to -be included in an automated way into the internal (and public) releases of the -library, the files must be organized in a specific directory structure, which -we describe here. We describe the entire directory structure for a package. -Not every package will have all the parts described here. Only the files -{\tt maintainer} and {\tt description.txt} -are obligatory. -\index{maintainer file@{\tt maintainer} file} -\ccIndexMainItem{\tt description.txt} -Submissions should not contain files in other places than described here. -It is possible to have some under SVN, but they need to be listed in the -\ccc{dont_submit} file to avoid being submitted. -Make sure your package does not have any file clashing with any other packages -(for example two files named {\tt simple\_example.cpp} in the example directories of -two different packages will clash in the target names of cmake). - - -The directory structure of a package named Package should be as follows: - -\begin{verbatim} - +--- dont_submit - | - +--- include/CGAL/ - | - +--- src/{CGAL|CGALQt|...}/ - | - +--- test// - | - +--- doc_tex/ - | - +--- examples// - | - +--- demo// - | - +--- benchmark// - | - +--- auxiliary/ - | - +--- scripts/ - | - +--- developer_scripts/ - | - +--- package_info/Package/ - | - +- description.txt - | - +- long_description.txt - | - +- maintainer -\end{verbatim} - - -\begin{description} - \item[{\tt include/CGAL}]\index{include/CGAL directory@{\tt include/CGAL} directory} - \index{source\ files!{\tt .h} files} - contains the {\tt .h} files for the package. - \item[{\tt src}]\index{src directory@{\tt src} directory} - \index{source\ files!{\tt .cpp} files} - contains the {\tt .cpp} files (if any) for the package. - They are gathered in subdirectories corresponding to each - library (be it static or shared). - \item[{\tt test}]\index{test directory@{\tt test} directory!for - packages} contains the test suite code for the package. See - Section~\ref{sec:test_subdirectory} for a detailed description. - \item[{\tt doc\_tex}]\index{doc_tex directory@{\tt doc\_tex} directory} - \ccIndexSubitem{source files}{documentation} - contains the documentation for the user and reference manuals. - These are the files used to produce the manuals for public releases and - to run the internal release reference manual test suite. - See Section~\ref{sec:doc_tex_subdirectory} for a detailed description - of this subdirectory. - See Chapter~\ref{chap:specification} for guidelines for producing - the documentation. - \item[{\tt examples}]\index{examples directory@{\tt examples} directory} - contains the example programs for the package. - See Section~\ref{sec:examples_subdirectory} for a detailed - description of this subdirectory. - \item[{\tt demo}]\index{demo directory@{\tt demo} directory} - contains the demo programs for the package. - Contrary to example programs, demo programs are not expected to be - usable on all platforms. Demo programs may depend on platform-specific - software and may require user interaction. They are compiled but not - run in the test suite. See Section~\ref{sec:demo_subdirectory} for a - more detailed description of this subdirectory. - \item[{\tt benchmark}]\index{benchmark directory@{\tt benchmark} directory} - contains the benchmark programs for the package. - See Section~\ref{sec:benchmark_subdirectory} for a detailed - description of this subdirectory. - \item[{\tt auxiliary}]\index{auxiliary directory@{\tt auxiliary} - directory} contains auxiliary software for CGAL. For - instance, GMP goes here when using the Windows installer. - The average package won't have this directory. - \item[{\tt scripts}]\index{scripts directory@{\tt scripts} - directory} contains scripts that are of interest to \cgal\ users. - \item[{\tt developer\_scripts}]\index{developers\_scripts - directory@{\tt developers\_scripts} directory} contains - scripts that are of interest to \cgal\ developers. This directory - is included in internal releases only, not in public releases. - \item[{\tt dont\_submit}]% - \ccIndexMainItem{\tt dont\_submit} specifies files and directories - that are to be excluded from the release, for example: - \begin{verse} - TODO\\ - include/CGAL/my\_internal\_file.h\\ - benchmark - \end{verse} - \item[{\tt package\_info/Package/description.txt}]% - \ccIndexMainItem{\tt description.txt} - should give a very short description of the contents of the package. - \item[{\tt long\_description.txt}]% - \ccIndexMainItem[c]{\tt package\_info/Package/long\_description.txt} - may be added with more detailed information about the package. - \item[\ccAnchor{maintainer}{{\tt package\_info/Package/maintainer}}]% - \index{maintainer file@{\tt maintainer} file} - should be used to name the maintainers of the package. The file should - have for each maintainer a line with the following format: - \begin{verse} - {\it name} $<${\it email address}$>$\\ - \end{verse} - For example: - \begin{verse} - {\it Susan Hert} $<$hert@mpi-sb.mpg.de$>$\\ - {\it Sylvain Pion} $<$Sylvain.Pion@sophia.inria.fr$>$\\ - \end{verse} -\end{description} - - -A package has a name, which identifies it. This name should obey the same -rules as for C identifiers: it consists of letters, digits and underscores and -it does not start with a digit. Choose a name that is descriptive, yet not -too long (under 25 characters). If a package deals with objects of a -particular dimension, then use the suffixes \_2, \_3, and \_d, especially if -there exists (or may exist in the future) a package with similar -functionality in different dimensions. Examples of good package names are -\texttt{Triangulation\_2} for a package dealing with triangulations of points -in the plane and \texttt{Min\_ellipse\_2}, which contains an algorithm that -finds the minimal enclosing ellipse of a set of points in the plane. The -package names \texttt{pm} and \texttt{arr} are a bit too terse. -\texttt{Planar\_map} and \texttt{Arrangement} (or -\texttt{Arrangement\_2}) are better. - -\section{{\tt test} subdirectory} -\label{sec:test_subdirectory} -\index{test directory@{\tt test} directory|(} -\ccIndexMainItemBegin{test suite} - -This directory contains the test suite for the package. Here we just -briefly list the files contained in such a directory. For more -detailed information about testsuites for \cgal\ packages refer to -Chapter~\ref{chap:testing}. - -\begin{verbatim} - test/ - +--- data/ - | - +--- include/ - | - |- CMakeLists.txt - | - |- cgal_test - | - |- *.cpp - | - |- *.cin -\end{verbatim} -where the directory \verb|| has a name that corresponds to the package -name. - -\begin{description} - \item[{\tt data/}] is a subdirectory that contains local data files for the - test suite\index{data directory@{\tt data} directory}. - \item[{\tt include/}] is a subdirectory that contains local include files for - the test suite. - \item[{\tt cgal\_test}]\index{cgal_test script@{\tt cgal\_test} - script|(} is the script that will be called when the entire - test suite is run. As this file is created automatically - during the release process, submitting it is error-prone and - thus {\bf strongly discouraged}. - - For testing purposes, such a script can be created using the - {\tt create\_cgal\_test}% - \index{create_cgal_test script@{\tt create\_cgal\_test} script} - script (Section~\ref{sec:create_cgal_test}). - \index{cgal_test script@{\tt cgal\_test} script|)} - - \item[{\tt CMakeLists.txt}]\ccIndexSubitem{\tt CMakeLists.txt}{test suite} - is the CMake configuration file for the test programs. It is created - automatically, just like {\tt cgal\_test}. Submitting it is - {\bf strongly discouraged}, and the only reason for submitting one is - when the automatic generation script cannot produce a working CMake - configuration file. - - Such a {\tt CMakeLists.txt} can be created using the script - {\tt cgal\_create\_cmake\_script}% - \index{cgal_create_cmake_script script@{\tt cgal\_create\_cmake\_script} script} - with the argument {\tt -t} - (Section~\ref{sec:cgal_create_cmake_script}). - \item[{\tt *.cpp}] source code for the test programs. - \ccIndexSubitem{source files}{test suite} - - When a test program runs correctly, it should return - \ccIndexSubsubitem{test suite}{program}{return value} the - value zero, or, more precisely, the value \verb|EXIT_SUCCESS| - defined in \verb||. - Test programs may not be graphical and they may not require any user - interaction.\ccIndexSubitem{test suite}{program} - \item[{\tt *.cin}] files containing command-line input for - \index{test\ suite!input!from {\tt cin}} - test programs. These files are necessary for only those programs - that require command-line input (which can usually be avoided). - If a file \texttt{program.cin} is - present in the test directory, then, when the test suite is run, - \texttt{program} will be executed using the command - \begin{verbatim} - ./program < program.cin - \end{verbatim} -\end{description} - -\section{{\tt doc\_tex} subdirectory} -\label{sec:doc_tex_subdirectory} -\index{doc_tex directory@{\tt doc\_tex} directory|(} -\ccIndexSubitemBegin{manuals}{source files} -\ccIndexSubitemBegin{source files}{documentation} - -As described in Chapter~\ref{chap:specification}, the \cgal\ documentation is -organized in subdirectories for each package and the different manuals -are assembled from these packages. Contained in these -subdirectories are the files required for producing a package's contributions -to the different reference and users' manuals. The users' manual input -files are located in the package's directory; the reference manual files are -be located in a directory named $${\tt \_ref} -\index{ref directory@{\tt \_ref} directory}. -For both the users' manual and reference manual parts, the input can be -split into more than one file (In fact, this is necessary for the reference -manual in order to support conversion to HTML; -see Section~\ref{sec:ref_manual}.), but there must be a file called -{\tt main.tex} in both the user and reference manual directories that inputs -all the other files for that manual part. -({\bf Note}: You should use the \verb|\input| command and NOT the -\verb|\include| command to input other source files in this file, and -they have to include their files using relative paths starting in the -\texttt{doc\_tex} directory.) - -For example, the optimisation package of -the basic library can have the following documentation. -\begin{verbatim} - doc_tex/Optimisation - |--- main.tex - | - |--- *.tex - | - +--- *.((pdf)|(gif)|(jpg)|(png)) - - doc_tex/Optimisation_ref/ - |--- main.tex - | - |--- intro.tex - | - |--- *.tex - | - +--- *.((pdf)|(gif)|(jpg)|(png)) - -\end{verbatim} - -\begin{description} - \item[{\tt main.tex}]% - \ccIndexMainItem{\tt main.tex}\ccIndexSubitem{users' manual}{\tt - main.tex} must contain one chapter. It must NOT - contain a preamble (so no {\tt documentclass}, {\tt usepackage}, - \verb|\begin{document}| or \verb|\end{document}| commands). - If you want more than one chapter in the documentation of this - package you have to put each chapter in its own \LaTeX\ file, - and include those files in \texttt{main.tex} using the \verb|\input| - macro. - \item[{\tt intro.tex}]% - \ccIndexMainItem{\tt intro.tex}% - \ccIndexSubitem{reference manual}{\tt intro.tex} - is not mandatory but common for reference manual chapter. It - contains a brief introduction to the package (one paragraph) and - lists the different concepts, classes, functions, etc. that are - contained in this package in a systematic way. - \item[{\tt *.tex}] -- the source files for the Users' and Reference - Manual that are input by {\tt main.tex} - \item[{\tt *.pdf}] -- the PDF pictures included in - the PDF documentation. - \item[{\tt *.((gif)|(jpg)|(png))}] -- the raster images included in - the HTML documentation. -\end{description} -\ccIndexSubitemEnd{source files}{documentation} -\ccIndexSubitemEnd{manuals}{source files} -\index{doc_tex directory@{\tt doc\_tex} directory|)} - - -\section{{\tt examples} subdirectory} -\label{sec:examples_subdirectory} -\index{examples directory@{\tt examples} directory|(} -\ccIndexSubitemBegin{example programs}{submitting} - -Example programs (Chapter~\ref{chap:examples_and_demos}) for a package should -be placed in a subdirectory of the directory {\tt examples}. -The subdirectory name, \verb||, will usually correspond to the -package name, but this is not a requirement. -To make sure that the examples will be tested% -\ccIndexSubitem{test suite}{examples in}, -a directory with examples -should be submitted in exactly the same way as a test directory -(Section~\ref{sec:test_subdirectory}). - -The structure of an example directory should be as follows: -\begin{verbatim} - examples/ - +--- data/ - | - +--- include/ - | - |- README - | - |- cgal_test - | - |- CMakeLists.txt - | - |- *.cpp -\end{verbatim} - -\ccIndexSubitem{source files}{examples} -The file {\tt README} should contain information about what the programs do -and how to compile them. -See the rules for a test directory for an explanation of the other files -and subdirectories. -\ccIndexSubitemEnd{example programs}{submitting} -\index{examples directory@{\tt examples} directory|)} - - -\section{{\tt demo} subdirectory} -\label{sec:demo_subdirectory} -\index{demo directory@{\tt demo} directory|(} -\ccIndexMainItem{demo programs} -\ccIndexSubitemBegin{demo programs}{submitting} - -The {\tt demo} directory (Chapter~\ref{chap:examples_and_demos}) contains -programs with graphical interfaces or programs requiring user input. These -programs will be compiled but not run by the test suite. -\ccIndexSubitem{test suite}{demos in} -The structure of this directory should be as follows: -\begin{verbatim} - demo/ - +--- data/ - | - +--- include/ - | - |- README - | - |- CMakeLists.txt - | - |- *.cpp -\end{verbatim} -where \verb|| is a name that corresponds (at least in part) to -the package for which it is a demo. -\ccIndexSubitem{source files}{demos} - -The file {\tt README} should contain information about what the program does, -and how to compile it ({\it i.e.}, what graphical libraries are needed, -{\it etc.}). Note that, in contrast to example and test programs, -demo programs more often need to submit a {\tt CMakeLists.txt} -\ccIndexSubitem{\tt CMakeLists.txt}{demo programs} since -different demos will require different libraries and thus the {\tt CMakeLists.txt} -for these programs will be somewhat dissimilar. -\ccIndexMainItem{demo programs} -\ccIndexSubitemEnd{demo programs}{submitting} -\index{demo directory@{\tt demo} directory|)} - - -\section{{\tt benchmark} subdirectory} -\label{sec:benchmark_subdirectory} -\index{benchmark directory@{\tt benchmark} directory|(} -\ccIndexSubitemBegin{benchmark programs}{submitting} - -Benchmark programs for a package should be placed in a subdirectory of the directory {\tt benchmark}. -The subdirectory name, \verb||, will usually correspond to the -package name, but this is not a requirement. - -Benchmark programs are currently not subject to any automatic treatment in the -test-suite, although they could evolve into an automatic benchmark-suite at -some point. We suggest at directory organization similar to the one of -\verb||. - -Some data sets can be placed under the {\tt data} subdirectory of \verb||, -but we recommend that only a small number of small files go there. Extensive -benchmarks data sets should probably be gathered elsewhere, so as not to bloat -the SVN server. - -\index{benchmark directory@{\tt benchmark} directory|)} - - -\ccIndexSubitemEnd{submitting}{directory structure for} -\ccIndexMainItemEnd{directory structure} - -\InternalOnly{ - -\section{Requirements and recommendations\label{sec:directories_req_and_rec}} - -\noindent -Requirements: -\begin{itemize} - \item The directory structure outlined here must be followed exactly. -\end{itemize} - -\noindent -Recommendations: -\begin{itemize} - \item Do not submit {\tt CMakeLists.txt}s for example programs and test suite - programs. - \item Do not submit the script {\tt cgal\_test} used to compile and test - your test suite programs. -\end{itemize} - -} diff --git a/Developers_manual/doc_tex/Developers_manual/examples_and_demos.tex b/Developers_manual/doc_tex/Developers_manual/examples_and_demos.tex deleted file mode 100644 index f26245e699a..00000000000 --- a/Developers_manual/doc_tex/Developers_manual/examples_and_demos.tex +++ /dev/null @@ -1,196 +0,0 @@ -\chapter{Example and Demo Programs\label{chap:examples_and_demos}} -\ccIndexMainItemBegin{example programs} -\ccIndexMainItemBegin{demo programs} - -{\HUGE This page is no longer maintained. The content has been moved to - -https://cgal.geometryfactory.com/CGAL/Members/wiki/Examples_and_Demo_Programs} - -The best way to illustrate the functionality provided by the library -is through programs that users can compile, run, copy and modify to -their hearts' content. Thus every package should contain some of -these programs. In \cgal\ we distinguish between two types of -programs: those that provided graphical output (demos) and those that -do not (examples). - -In this chapter we provide guidelines for the development -of these programs and their inclusion in the documentation. See -Sections~\ref{sec:examples_subdirectory} and~\ref{sec:demo_subdirectory} -for a description of the directory structure required for example and -demo programs, respectively. Note in particular that each directory -should contain a \texttt{README} file that explains what the programs do and -how one interacts with them. - -\section{Coding conventions\label{sec:ex_and_demo_coding}} -\ccIndexSubitem{example programs}{coding conventions} -\ccIndexSubitem{demo programs}{coding conventions} - -Remember that these programs are likely to be a user's first introduction -to the library, so you should be careful to follow our coding conventions -(Chapter~\ref{chap:code_format}) and good programming practice in these -programs. In particular: - -\begin{itemize} - \item Do \textbf{not} use the statements - \begin{verbatim} - using namespace CGAL; - using namespace std; - \end{verbatim} - \ccIndexSubitem{\tt using}{in examples and demos} - We discourage the use of these as they introduce more names than - are necessary and may lead to more conflicts than are necessary. - \item As of release 2.3, you can include only the kernel include file - (\eg, \texttt{Cartesian.h} or \texttt{Homogeneous.h}) to get all - kernel classes as well as the \texttt{basic.h} file. All example - and demo programs should do this. For example, you should have - simply: - \begin{verbatim} - #include - \end{verbatim} - instead of: - \begin{verbatim} - #include - #include - #include - #include - #include - // etc. - \end{verbatim} - \item Types should be declared using the following syntax: - \begin{verbatim} - typedef CGAL::Cartesian Kernel; - typedef Kernel::Point_2 Point_2; - typedef Kernel::Triangle_3 Triangle_3; - \end{verbatim} - instead of this syntax: - \begin{verbatim} - typedef CGAL::Cartesian Kernel; - typedef Point_2 Point_2; - typedef Triangle_3 Triangle_3; - \end{verbatim} - Although both will work, the former is to be preferred since - it reflects that the types are actually part of the kernel and - also reflects the new (as of release 2.3) kernel design that allows - types to be easily exchanged and adapted. - - Note also that the typedef used above is - \begin{verbatim} - typedef CGAL::Cartesian Kernel; - \end{verbatim} - instead of - \begin{verbatim} - typedef CGAL::Cartesian R; // for representation - \end{verbatim} - This also reflects the new design, where the kernel classes are - kernels containing objects and predicates not just representation - classes for the objects. -\end{itemize} - -\section{The Programs\label{sec:ex_and_demo_content}} -\ccIndexSubitem{example programs}{content} -\ccIndexSubitem{demo programs}{content} - -The following guidelines should be followed to the greatest extent possible -when writing the example and demo programs. -\begin{itemize} - \item Provide simple programs with which a beginner can get started. - \item Provide more involved programs that illustrate the power of the - software. - \item Provide programs that truly exercise the data structure. Though you - may have some canned programs that work on fixed data sets to - illustrate specific things, you should also have one (or more) - programs that work on - \ccAnchor{http://www.cgal.org/Manual/doc_html/support_lib/Generator/Chapter_generators.html}{randomly generated} or user-generated data. - This illustrates confidence in the software (and can also build - confidence by highlighting bugs). - \item Take some care to design a good interface to the program; - the packaging of a product does make a difference. -\end{itemize} - -\section{Including programs in documentation\label{sec:programs_in_doc}} -\ccIndexSubitem{example programs}{in manuals} - -All programs included in the documentation should be included in either -the \texttt{examples} or the \texttt{demo} directory to ensure that: -\begin{itemize} - \item[(a)] the programs will be included in the test suite and - \item[(b)] the user can more easily use the example program -\end{itemize} -The macro to do this inclusion is \verb|\ccIncludeExampleCode|. -See Chapter~\ref{chap:specification} and the documentation of the -\ccAnchor{http://www.cgal.org/Members/Manual_tools}{Manual tools} for more -details. - -The reverse statement, that all programs in the \texttt{examples} -and \texttt{demo} directory should be included in the documentation, -is not necessarily true. Ideally the programs included in the documentation -will be a proper (non-empty) subset of the programs included in the -distribution. - -Please make sure that your example programs do not have too lengthy lines -as they are copied verbatim in the manual, which can trigger overflows -in the PDF manual. - -\section{Demo programs on the web\label{sec:demos_web_page}} -\ccIndexSubitem{demo programs}{on the web} - -Demo programs for some packages are accessible from the -\ccAnchor{http://www.cgal.org/Manual/latest/doc_html/cgal_manual/packages.html}{package overview} -web page \lcTex{ (\path|http://www.cgal.org/Manual/latest/doc\_html/cgal\_manual/packages.html|)}. -For each demo on the page, we have a precompiled executable for the -Windows platform. - -If you have other demos you would like to add to the page (and the more -here the better), you should do the following: -\begin{enumerate} -\item Compile the demo and create a screen shot (as a \texttt{.gif} or - \texttt{.jpg} file) and then create a smaller version of this - (approx $235 \times 280$) that can be used as a ``thumbnail'' - (admittedly for a rather large thumb) on the page. These names of - the image files should be as follows: - \centerline{\ccc{_}\texttt{[big|small].[gif|jpg]}}, - where \textit{$<$prog\_name$>$} is the name of the program from which - the screen shots were made (an nice mnemonic name like - \ccc{alpha_shapes_2} or \ccc{hull_of_int_points_2}). - -\item Create the \texttt{.exe} file for use under Windows (probably with the - compiler optimization flags turned on) -\item \texttt{gzip} the \texttt{.exe} file -\item Package these together with the source code using the following structure: - \begin{verbatim} - images/demo/_big.[gif|jpg] - demo/.exe - demo//.cpp - \end{verbatim} - where \ccc{} is the name of the subdirectory in which the program - is (or will be) found in the distribution. \ccc{} should be a - name that is self-explanatory (\eg, \texttt{demo.cpp} is a bad name here). - -\item Send the package to \ccAnchor{mailto:ameyer@mpi-sb.mpg.de}{the web page - maintainer} together with a one-paragraph description similar to the - ones on the page already. -\end{enumerate} - -\InternalOnly{ - -\section{Requirements and recommendations\label{sec:ex_and_demos_req_and_rec}} - -\noindent -Requirements: -\begin{itemize} - \item Follow the coding conventions outlined in - Section~\ref{sec:ex_and_demo_coding}. - \item Include all example and demo programs from the documentation in - the \texttt{examples} or \texttt{demo} directories. -\end{itemize} - -\noindent -Recommendations: -\begin{itemize} - \item Place a demo of your package on the web site. -\end{itemize} - -} - -\ccIndexMainItemEnd{example programs} -\ccIndexMainItemEnd{demo programs} diff --git a/Developers_manual/doc_tex/Developers_manual/intro.tex b/Developers_manual/doc_tex/Developers_manual/intro.tex index a7dca68ee36..411d3e6bb92 100644 --- a/Developers_manual/doc_tex/Developers_manual/intro.tex +++ b/Developers_manual/doc_tex/Developers_manual/intro.tex @@ -52,10 +52,6 @@ Work on \cgal\ has been supported in the past by {\sc esprit iv} projects 21957 (CGAL) and 28155 (GALIA). -\InternalOnly{ -\input{Developers_manual/manual_organization} -} - \input{Developers_manual/philosophy} \input{Developers_manual/overall_design} diff --git a/Developers_manual/doc_tex/Developers_manual/manual_organization.tex b/Developers_manual/doc_tex/Developers_manual/manual_organization.tex deleted file mode 100644 index 215d75e370b..00000000000 --- a/Developers_manual/doc_tex/Developers_manual/manual_organization.tex +++ /dev/null @@ -1,39 +0,0 @@ -\section{Manual organization\label{sec:manual_org}} - -This manual is meant to be a resource for developers who wish to contribute -to the \cgal\ library either by designing new packages or maintaining -or enhancing existing ones. The manual is organized roughly in the order in -which a developer will need the information in order to produce a package -for the library. We begin in this chapter with a description -of the design goals of \cgal\ and the overall design, which should be kept -in mind during all stages of development. The remaining chapters describe -in more concrete terms the requirements and recommendations for documentation, -code writing, and testing that are derived from these goals. We also describe -a number of tools that have been created to help in the development process -and give pointers to other sources of information. - -A description of how the specification -for a package should be documented is provided along with information about -the tools available to help produce the documentation -in Chapter~\ref{chap:specification}. -Chapter~\ref{chap:svn} discusses the SVN server on which all \cgal\ source -code is kept. -Chapter~\ref{chap:directory_structure} describes the directory structure -required for a package and Chapter~\ref{chap:tools} describes a set of tools -that may be used to create or modify various files required within this -directory structure. Chapters~\ref{chap:code_format} -through~\ref{chap:robustness} -discuss issues related to the writing of code that is in keeping with -the goals of \cgal. Chapter~\ref{chap:portability} describes issues -related to the configuration of \cgal\ and -discusses portability issues for various platforms. -Chapter~\ref{chap:debugging} consists of various hints for debugging. -Information -about how to submit a package's specification to the editorial board -for approval and the implementation (and documentation) for inclusion in -internal releases is presented in Chapter~\ref{chap:submission}. -Chapter~\ref{chap:releases} gives information about the creation of the -internal, public, and bug-fix releases. -Chapters~\ref{chap:addresses} and Chapter~\ref{chap:info} -provide information about mailing lists and other information -resources developers might find useful. diff --git a/Developers_manual/doc_tex/Developers_manual/releases.tex b/Developers_manual/doc_tex/Developers_manual/releases.tex deleted file mode 100644 index 0e7d5a06eec..00000000000 --- a/Developers_manual/doc_tex/Developers_manual/releases.tex +++ /dev/null @@ -1,37 +0,0 @@ -\chapter{Making Releases\label{chap:releases}} - -This chapter is going to be replaced by the technical feature of Eric et al. -That is the branching stuff. - -\section{Internal Releases\label{sec:internal_releases}} -\ccIndexSubitem{releases}{internal} - -Internal releases are currently created daily from a script run -at GeometryFactory. This script packages together the current versions of all -packages into a tar file and publish a tarball at -\path'http://cgal.geometryfactory.com/CGAL/Members/Releases/'. -People responsible for running the test suite can pick it up automatically -using the {\tt autotest\_cgal} script (Section~\ref{sec:autotest_cgal}). - -\section{Public Releases\label{sec:public_releases}} -\ccIndexSubitem{releases}{public} - -A public release can be created from an internal release by following the -steps detailed in the -\texttt{README} file in the package \texttt{Release} on the SVN server. -\index{SVN server!Release package@\texttt{Release} package} -This file describes how to create the code, the documentation and the -updated web pages for a new release. - -Each public release is tagged on the SVN server with a tag in the following -format \texttt{CGAL\_N\_release}, where \texttt{N} is the release number -with all `.'s replaced by `\_'s (\eg, for release 3.0, the tag is -\texttt{CGAL\_3\_0\_release}. There is also a branch created for -each release with the name \texttt{CGAL\_N\_branch}, where \texttt{N} is -the release number as before. This facilitates the creation of bug fix -releases. - -%\section{Bug Fix Releases} -%\label{sec:bug_fix_releases} -%\ccIndexSubitem{releases}{bug fix} -%\ccIndexMainItem{bug fixe} diff --git a/Developers_manual/doc_tex/Developers_manual/specification.tex b/Developers_manual/doc_tex/Developers_manual/specification.tex index 5313dd250b6..9675bfde82f 100644 --- a/Developers_manual/doc_tex/Developers_manual/specification.tex +++ b/Developers_manual/doc_tex/Developers_manual/specification.tex @@ -39,8 +39,6 @@ \chapter{Specification Documentation\label{chap:specification}} -This chapter is going to be moved to the wiki by Luis and Laurent. - \ccChapterRelease{Chapter Version: 2.0} \ccChapterAuthor{Susan Hert ({\tt hert@mpi-sb.mpg.de})\\ Lutz Kettner ({\tt kettner@mpi-sb.mpg.de}) } @@ -57,7 +55,7 @@ is to make it so complicated that there are no obvious deficiencies. \cgal\ is physically structured into packages\ccIndexMainItem{package}, which is reflected in the SVN -repository structure, see Chapter~\ref{chap:svn}. Generally, each +repository structure. Generally, each package in the library will contribute some chapters to the manuals, some might only contribute a section to some larger chapter. @@ -136,8 +134,7 @@ organization. \ccIndexSubitem{directory structure}{for documentation} It is required that the documentation submitted with a package be organized -according to a specific directory structure, which is described more -completely in Section~\ref{sec:doc_tex_subdirectory}. In summary, all +according to a specific directory structure. In summary, all {\tt .tex} source files and corresponding figures are kept in a \texttt{doc\_tex} subdirectory of the package. The following rules describe the details: @@ -194,8 +191,7 @@ describe the details: contain a short introductory section, give an overview of the reference pages contained in this chapter, and mention optionally with a non-numbered section labeled \textbf{Assertions} - the string used in the package-specific assertion macros - (Section~\ref{sec:checks_controlling}). + the string used in the package-specific assertion macros. \end{itemize} This is all that is needed for a package manual and the @@ -1498,8 +1494,7 @@ Requirements: \item There must be a {\tt main.tex} file for both the users' manual and reference manual parts of the documentation. \item Files must be organized according to the directory structure - outlined in Section~\ref{sec:files_required} and further detailed - in Section~~\ref{sec:doc_tex_subdirectory}. + outlined in Section~\ref{sec:files_required}. \item Indexing commands must be placed in the text to achieve the goals listed in Section~\ref{sec:indexing}. \item Example programs included in the manual should also be distributed diff --git a/Developers_manual/doc_tex/Developers_manual/submission_process.tex b/Developers_manual/doc_tex/Developers_manual/submission_process.tex index c9e61c5635c..52d3e26bc6e 100644 --- a/Developers_manual/doc_tex/Developers_manual/submission_process.tex +++ b/Developers_manual/doc_tex/Developers_manual/submission_process.tex @@ -9,19 +9,7 @@ % $Date$ % ============================================================================= -% \InternalOnly{ -% \chapter{Submitting Packages\label{chap:submission}} -% \ccChapterRelease{Chapter Version: 1.0} -% \ccChapterAuthor{Geert-Jan Giezeman\\ %({\tt geert@cs.uu.nl})\\ -% Susan Hert\\ %({\tt hert@mpi-sb.mpg.de})\\ -% Monique Teillaud ({\tt Monique.Teillaud@inria.fr})} - -% \section{Editorial board\label{sec:editorial_board}} -% } - -%\ExternalOnly{ \chapter{Editorial Board\label{chap:submission}\label{sec:editorial_board}} -%} \ccIndexMainItemBegin{editorial board} @@ -69,8 +57,7 @@ due to the recommendations of the board. % However, since it can take some time for the board to process % submissions, packages that are to become part of the library % can be submitted -% \InternalOnly{as detailed in -% Section~\ref{sec:electronic_submission}} before approval. +% before approval. % Inclusion in an internal release does not ensure inclusion in a public % release. Only after approval by the board will packages be included in new @@ -78,65 +65,3 @@ public releases and then only if they pass the test suite, of course. The current list of members of the editorial board can be found on the \ccAnchor{http://www.cgal.org/people.html}{web site}. - -% \InternalOnly{ -% \section{Electronic submission\label{sec:electronic_submission}} -% \ccIndexMainItemBegin{submitting} - -% Whether you produce library code, demos, documentation or something else, -% if you want it to become part of \cgal, you'll have to submit it in -% the form of a wiki page on the -% \ccAnchor{https://cgal.geometryfactory.com/CGAL/Members/wiki/Features}{Feature page} -% or on the -% \ccAnchor{https://cgal.geometryfactory.com/CGAL/Members/wiki/Features/Small_Features}{Small Features page}, -% and announce it by email to the -% \ccAnchor{mailto:cgal-editorial-board@lists-sop.inria.fr}{board} -% \lcTex{(\texttt{cgal-editorial-board@lists-sop.inria.fr})}. - -% The package itself has to be a folder under SVN experimental -% packages. -% The directory structure required for a package is described in -% Chapter~\ref{chap:directory_structure}. - -%Here we focus on how to submit a package. - -% \ccIndexSubitem{naming scheme}{package} -% A package has a name, which identifies it. This name should obey the same -% rules as for C identifiers: it consists of letters, digits and underscores and -% it does not start with a digit. Choose a name that is descriptive, yet not -% too long (under 25 characters). If a package deals with objects of a -% particular dimension, then use the suffixes \_2, \_3, and \_d, especially if -% there exists (or may exist in the future) a package with similar -% functionality in different dimensions. Examples of good package names are -% \texttt{Triangulation\_2} for a package dealing with triangulations of points -% in the plane and \texttt{Min\_ellipse\_2}, which contains an algorithm that -% finds the minimal enclosing ellipse of a set of points in the plane. The -% package names \texttt{pm} and \texttt{arr} are a bit too terse. -% \texttt{Planar\_map} and \texttt{Arrangement} (or -% \texttt{Arrangement\_2}) are better. - -% Make sure your package does not have any file clashing with any other packages. -% Please also make sure the information such as the maintainer email adress is -% up to date under the \texttt{package\_info} directory. -% \ccIndexSubitem{submitting}{file for} - -% \ccIndexMainItemEnd{submitting} - - -% Monique: I would just remove this section -% \section{Requirements and recommendations\label{sec:submission_req_and_rec}} - -% \noindent -% Requirements: -% \begin{itemize} -% \item Submit specifications to the editorial board. -% \item Obey the directory structure outlined in Chapter~\ref{chap:directory_structure}. -% \end{itemize} - -% \noindent -% Recommendations: -% \begin{itemize} -% \item Wait for approval from the editorial board before submitting packages -% for internal releases. -% \end{itemize} -%} diff --git a/Developers_manual/doc_tex/Developers_manual/testing.tex b/Developers_manual/doc_tex/Developers_manual/testing.tex deleted file mode 100644 index 92f5af20563..00000000000 --- a/Developers_manual/doc_tex/Developers_manual/testing.tex +++ /dev/null @@ -1,403 +0,0 @@ -% ============================================================================= -% The CGAL Developers' Manual -% Chapter: Testing -% ----------------------------------------------------------------------------- -% file : testing.tex -% authors: Mathair Baeskin -% ----------------------------------------------------------------------------- -% $Id$ -% $Date$ -% ============================================================================= - -\chapter{Testing\label{chap:testing}} -\ccChapterRelease{Chapter Version: 1.2} -\ccChapterAuthor{Matthias B\"asken} -\ccChapterAuthor{Yves Brise ({\tt ybrise@inf.ethz.ch})} -\ccIndexMainItemBegin{test suite} - -%\section{Introduction} -{\HUGE This page is no longer maintained. The content has been moved to - -https://cgal.geometryfactory.com/CGAL/Members/wiki/Testing} - -The \cgal\ test suite is a way to test the compilation and execution of \cgal\ -programs automatically (\ie, without user interaction) on a number of -different platforms. Developers should, of course, thoroughly test their -code on their own development platform(s) \textbf{before} submitting it. -The test suite serves as a way to test on additional platforms not available -to the developer. - -\section{What a test suite for a package should contain\label{sec:whats_in_test_suite}} - -The test suite helps the developer(s) of a package to -\begin{itemize} -\item detect compilation problems on the various platforms -\item detect runtime problems -\item check the correctness of the algorithms in the package -\end{itemize} - -That does not mean that the test suite is a platform for initial testing of -code. New code should be tested on different platforms by the developer -before submission. - -It is strongly recommended for a test suite of a package to -\begin {itemize} -\item Cover the complete code of the package; every (member) function - should be called at least once. (See Section~\ref{sec:gcov} for - a description of a tool you can use to test for code coverage.) -\item Use more than one instantiation of templated functions or classes. -\item A lot of classes in \cgal\ can be parametrized by traits classes, so - that they are usable with different kernels. In such cases more than one - kernel should be used for testing. -\item Use pre- and postcondition checkers wherever it is possible in the - main code. In the test-suite code itself, the macro \ccc{assert} - should be used in place of \ccc{CGAL_assertion} to check - all conditions, since \ccc{assert} is not disabled by \ccc{CGAL_NDEBUG}. -\end {itemize} - -\section{Using the code coverage tool \texttt{gcov}} -\label{sec:gcov} - -The tool {\tt gcov} can be used together with the GNU C++ compiler to test -for code coverage in your programs and may be helpful when you create your -\cgal\ test suite programs. You can find a complete guide to this tool -in the GNU on-line documentation at -\path|http://gcc.gnu.org/onlinedocs/gcc-2.95.2/gcc_6.html|. -If you want to use the code coverage tool {\tt gcov}, you have to compile -your programs with the options \texttt{-fprofile-arcs} and -\texttt{-ftest-coverage}. This generates a file called -\texttt{your\_program.gcda}. Then you run the program, which generates a file -\texttt{your\_program.gcno}. Finally, you can run \texttt{gcov your\_program.cpp}. -This will generate a number of files with the ending \texttt{.gcov} which contain -human readable information. View it in a text editor. -Here is a simple example:\\ -\begin{verbatim} - #include - - using namespace std; - - void fu(int val) - { - int w,v=0; - if (val==0) { - cout << "val == 0!\n"; - for(w=0;w<100;w++) v=v+w; - } - else { - cout << "val != 0!\n"; - for(w=0;w<10;w++) v=v+w; - } - - cout << "v:" << v << "\n"; - } - - int main() - { - fu(0); - return 0; - } -\end{verbatim} -First you have to compile the example program \texttt{test.cpp} with the special -options. Then you have to execute it, and, after this, \texttt{gcov} can be -used. -\begin{verbatim} - g++ -fprofile-arcs -ftest-coverage -o test test.cpp - test - gcov test.cpp -\end{verbatim} -\texttt{gcov} will create a file \texttt{test.cpp.gcov} containing output -from \texttt{gcov}: -\begin{verbatim} - #include - - using namespace std; - - void fu(int val) - 1 { - 1 int w,v=0; - 1 if (val==0) { - 1 cout << "val == 0!\n"; - 1 for(w=0;w<100;w++) v=v+w; - } - ###### else { - ###### cout << "val != 0!\n"; - ###### for(w=0;w<10;w++) v=v+w; - } - - 1 cout << "v:" << v << "\n"; - } - - int main() - 1 { - 1 fu(0); - 1 return 0; - } -\end{verbatim} -The lines that were not executed will be marked with \verb|######|, -so you will see what should be added in the (\cgal) test suite programs. - -There are a few pitfalls when using CMake and \texttt{gcov} together. -First note, that with CMake you can add compiler flags using the \texttt{CGAL\_CXX\_FLAGS} variable. See the -\ccAnchor{http://www.cgal.org/Manual/latest/doc_html/installation_manual/Chapter_installation_manual.html#Subsection_8.2}{\cgal Installation Manual} to get more information on that. Typing \texttt{make your\_program} to compile your program is straightforward, as is running it. But then, the \texttt{.gcda} -and \texttt{.gcno} are created within the directory \texttt{CMakeFiles/your\_program.dir/} relative to your project path. You first have to copy them to the same folder where \texttt{your\_program.cpp} resides. -If you don't do that, running \texttt{gcov your\_program.cpp} will give an error -message. - - -\section{Test suite directory\label{sec:test_suite_directory}} - -The test suite is located in the directory {\tt test} of the internal -releases of \cgal. This directory is not part of external releases. The -directory {\tt test}\index{test directory@{\tt test} directory!for test suite} -contains: -\begin{itemize} - \item a script {\tt run\_testsuite} - \index{run_testsuite script@{\tt run\_testsuite} script} - that is (not surprisingly) used to run the test suite. - \item a subdirectory for every package included in the internal release. - These subdirectories are created from the {\tt test} directories - of the packages by copying the source, include, and input files from - these directories and adding makefiles and {\tt cgal\_test} scripts - where needed. See Section~\ref{sec:test_subdirectory} for more - information about the proper structure of the {\tt test} directory - for a package. - \index{test directory@{\tt test} directory!for packages} - \item a subdirectory with a name that ends in {\tt \_Examples} for every - package that was submitted with an {\tt examples} directory - (Section~\ref{sec:examples_subdirectory}) - \index{examples directory@{\tt examples} directory} - \ccIndexSubitem{test suite}{examples in} - \ccIndexSubitem{example programs}{in test suite} - \item a subdirectory with a name that ends in {\tt \_Demo} for every - package that was submitted with a {\tt demo} directory - (Section~\ref{sec:demo_subdirectory}) - \index{demo directory@{\tt demo} directory} - \ccIndexSubitem{test suite}{demos in} - \ccIndexSubitem{demo programs}{in test suite} -\end{itemize} - -The test suite will attempt to compile all the programs in the -subdirectories of {\tt test} and to run all except -the demo programs (which usually require user interaction) by using the -{\tt cgal\_test} scripts -(Sections~\ref{sec:test_subdirectory} and~\ref{sec:create_cgal_test}) -\index{cgal_test script@{\tt cgal\_test} script} -and will save the results in files in the package subdirectories -(Section~\ref{sec:test_suite_output}). -Even if a program fails to compile or run, the test suite will continue. - - -\section{Test suite input\label{sec:test_suite_input}} -\ccIndexSubitemBegin{test suite}{input} - -Input to programs in the test suite can be supplied in three different -ways: -\begin{description} - \item[data files in the {\tt data} directory] - \index{data directory@{\tt data} directory} - \ccIndexSubsubitem{test suite}{input}{from files} - As described in Section~\ref{sec:test_subdirectory}, a package's - {\tt test} directory may contain a subdirectory {\tt data} that - contains input files for the test programs. - \item[{\tt *.cin} files] - \index{test\ suite!input!from {\tt cin}} - If a test program \texttt{program.cpp} requires input from standard - input (\ie, {\tt cin}), you should put a file called - \texttt{program.cin} in the test directory. - The test suite will then execute the program using the command - \begin{verbatim} - ./program < program.cin - \end{verbatim} - \item[command-line arguments supplied in the {\tt cgal\_test} script] - \ccIndexSubsubitem{test suite}{input}{from command-line} - {\em You are discouraged from using this option to give input values - to your programs} since it requires you to edit and submit a - {\tt cgal\_test} script; see Section~\ref{sec:create_cgal_test}. - - \index{cgal_test script@{\tt cgal\_test} script} - However, if a test program \texttt{program.cpp} absolutely requires - command-line parameters, you should do the following. Use - \texttt{create\_cgal\_test} to create the script \texttt{cgal\_test}. - This file contains an entry of the form - \begin{verbatim} - compile_and_run program - \end{verbatim} - Just put the command-line - parameters for \texttt{program} at the end of this line: - \begin{verbatim} - compile_and_run program arg1 arg2 .. - \end{verbatim} - The test suite will then execute the program using the command - - \begin{verbatim} - ./program ... - \end{verbatim} -\end{description} -\ccIndexSubitemEnd{test suite}{input} - - -\section{Running the test suite\label{sec:running_test_suite}} -\index{run_testsuite script@{\tt run\_testsuite} script|(} - -The test suite is run using the {\tt run\_testsuite} script that is distributed -with every internal release in the {\tt test} directory. There are several -ways you can customize this script to meet you needs: - -\begin{itemize} -\item Add additional compiler and linker flags by setting the variables - {\tt TESTSUITE\_CXXFLAGS}% - \index{TESTSUITE_CXXFLAGS variable@{\tt TESTSUITE\_CXXFLAGS} variable} - and {\tt TESTSUITE\_LDFLAGS} - \index{TESTSUITE_LDFLAGS variable@{\tt TESTSUITE\_LDFLAGS} variable} - \ccIndexSubitem{header files}{overriding} - at the top of the - script. These variables are prepended to {\tt CXX\_FLAGS} and - {\tt LDFLAGS}, respectively, in the test suite makefiles. So, for - example, if you have a directory \verb|experimental/include/CGAL| - containing new or experimental \cgal\ files, you can do the following: - \begin{center} - \verb|TESTSUITE_CXXFLAGS="-Iexperimental/include"| - \end{center} - and in this way test with your new files without overwriting - the originals. - -\item Export additional environment variables by adding lines to the - \ccIndexSubitem{environment variables}{test suite} - \ccIndexSubitem{test suite}{environment variables} - {\tt run\_testsuite} script. As an example, it will be demonstrated - how to export the {\tt LD\_LIBRARY\_PATH} by editing \texttt{run\_testsuite}.% - \index{LD_LIBRARY_PATH variable@{\tt LD\_LIBRARY\_PATH} variable} - \begin{enumerate} - \item Add the line - \begin{center} - \verb|LD_LIBRARY_PATH=| - \end{center} - to the script. - \item Append {\tt LD\_LIBRARY\_PATH} to the line - \begin{center} - \verb|export PLATFORM CGAL_MAKEFILE TESTSUITE_CXXFLAGS TESTSUITE_LDFLAGS| - \end{center} - in the script. - \end{enumerate} - - After this, the programs from the test suite will be run using the - {\tt LD\_LIBRARY\_PATH} that was specified in step 1. - -\item Run the test suite on more than one platform by adding a line at the - bottom of the script of the form - \begin{verbatim} - run_testsuite - \end{verbatim} - for every platform that you wish to test. Just substitute for - \verb|| the appropriate include makefiles that - were generated during installation. (Don't forgot to use the - full path name for the makefile!) By default, the last line in the - file is - \begin{verbatim} - run_testsuite $CGAL_MAKEFILE - \end{verbatim} - so you need not make any changes if you run the testsuite on only one - platform and have set the {\tt CGAL\_MAKEFILE} environment variable - properly.% - \index{CGAL_MAKEFILE variable@{\tt CGAL\_MAKEFILE} variable!and test suite} -\end{itemize} - -After these steps you are ready to run the test suite. It can be run in two -different ways: -\begin{verbatim} -./run_testsuite -\end{verbatim} - -The test suite will run the tests from all test directories. This may take a -considerable amount of time. - -\begin{verbatim} -./run_testsuite ... -\end{verbatim} - -The test suite will run only the test programs in the test directories -\begin{verbatim} ... \end{verbatim} -\index{run_testsuite script@{\tt run\_testsuite} script|)} - -To run an entire \cgal\ test suite automatically, including downloading of -an internal release, configuration, and installation of the library, you -can use the {\tt autotest\_cgal} script described in -Section~\ref{sec:autotest_cgal}. - - -\section{Files generated by the test suite\label{sec:test_suite_output}} -\ccIndexSubitemBegin{test suite}{output files} - -The testsuite will generate the following output files: - -\begin{itemize} -\item \verb|/ErrorOutput_| -\index{ErrorOutput files@{\tt ErrorOutput} files} - -This file contains two lines for every program that was tested on -platform \texttt{} in the test directory \texttt{}. -The first line -tells if the compilation was successful and the second line tells if -the execution was successful (\ie, the program returned the value 0). -(See Section~\ref{sec:test_subdirectory} for more details.) - -\item \verb|/ProgramOutput..| -\index{ProgramOutput files@{\tt ProgramOutput} files} - -This file contains the console output from the test program -\texttt{} run on platform \texttt{}. - -\item \verb|/CompilerOutput_| -\index{CompilerOutput files@{\tt CompilerOutput} files} - -This file contains the compiler output from platform -\texttt{} for all programs. - -\item \verb|error.txt| -\index{error.txt@{\tt error.txt}} - -This is just a concatenation of all the \texttt{ErrorOutput} files that were -generated during the last run of the test suite. -\end{itemize} -\ccIndexSubitemEnd{test suite}{output files} - - -\section{Test suite results\label{sec:test_suite_results}} -\ccIndexSubitemBegin{test suite}{results} -The results of test suites run on the various supported or soon-to-be-supported -platforms are posted on the -\ccAnchor{http://cgal.geometryfactory.com/CGAL/Members/testsuite/}% -{test suite results} -page -\lcTex{(\path|http://cgal.geometryfactory.com/CGAL/Members/testsuite/|)}. -\ccIndexSubitemEnd{test suite}{results} - -\section{Requirements and recommendations\label{sec:testing_req_and_rec}} - -\noindent -Requirements: -\begin{itemize} - \item Test your code thoroughly \textbf{before} submitting it. - \item Obey the directory structure detailed in Section~\ref{sec:test_subdirectory} - \item Check the test suite results for your package regularly. -\end{itemize} - -\noindent -Recommendations: -\begin{itemize} - \item Write test suite programs that use more than one instantiation of - templated functions and classes, call every member function at least - once, and use more than one kernel. - \item Use pre- and postcondition checkers. - \item Use \texttt{gcov} to test your code for coverage. - \item Don't submit a makefile for your test suite unless you need to do - something very special to compile or link your program. If you find - you want to do something very special in your makefile, think long - and hard about whether it's really necessary or not. - \item Don't submit the script \texttt{cgal\_test} with your package. -\end{itemize} - - -\ccIndexMainItemEnd{test suite} - - diff --git a/Developers_manual/doc_tex/Developers_internal_manual.tex b/Developers_manual/doc_tex/Writing_your_manual.tex similarity index 77% rename from Developers_manual/doc_tex/Developers_internal_manual.tex rename to Developers_manual/doc_tex/Writing_your_manual.tex index 4a2fc5db8f6..67527febd73 100644 --- a/Developers_manual/doc_tex/Developers_internal_manual.tex +++ b/Developers_manual/doc_tex/Writing_your_manual.tex @@ -5,15 +5,11 @@ \documentclass{book} \usepackage{Manual/cgal_manual} -\gdef\lciManualTitle{CGAL Developers Manual} +\gdef\lciManualTitle{Writing your CGAL Manual} \lcHtml{\lcOneColumnToc} \lcTex{\usepackage{color}} \usepackage{nonlinkedpath} -% This will be the internal edition of the developers manual. -\newcommand{\InternalOnly}[1]{#1} -\newcommand{\ExternalOnly}[1]{} - \makeindex \begin{document} @@ -29,7 +25,7 @@ \pagenumbering{arabic} \cgalColumnLayout -\input{Developers_manual/chapters} +\input{Developers_manual/specification} \bibliographystyle{alpha} \bibliography{Manual/cgal_manual,Manual/geom} diff --git a/Distance_2/include/CGAL/squared_distance_2_1.h b/Distance_2/include/CGAL/squared_distance_2_1.h index 17590b17369..9851623ab28 100644 --- a/Distance_2/include/CGAL/squared_distance_2_1.h +++ b/Distance_2/include/CGAL/squared_distance_2_1.h @@ -32,10 +32,6 @@ #include -#include -#include -#include -#include #include #include #include diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h index 573888d395c..3acb28c4290 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h @@ -33,16 +33,14 @@ namespace CGAL { // template void Envelope_divide_and_conquer_2:: -_construct_envelope_non_vertical (Curve_pointer_iterator begin, - Curve_pointer_iterator end, - Envelope_diagram_1& out_d) +_construct_envelope_non_vertical(Curve_pointer_iterator begin, + Curve_pointer_iterator end, + Envelope_diagram_1& out_d) { out_d.clear(); if (begin == end) - { return; - } // Check if the range contains just a single curve. Curve_pointer_iterator iter = begin; @@ -51,7 +49,7 @@ _construct_envelope_non_vertical (Curve_pointer_iterator begin, if (iter == end) { // Construct a singleton diagram, which matches a single curve. - _construct_singleton_diagram (*(*begin), out_d); + _construct_singleton_diagram(*(*begin), out_d); } else { @@ -65,13 +63,11 @@ _construct_envelope_non_vertical (Curve_pointer_iterator begin, Envelope_diagram_1 d1; Envelope_diagram_1 d2; - _construct_envelope_non_vertical (begin, div_it, - d1); + _construct_envelope_non_vertical(begin, div_it, d1); - _construct_envelope_non_vertical (div_it, end, - d2); + _construct_envelope_non_vertical(div_it, end, d2); - _merge_envelopes (d1, d2, out_d); + _merge_envelopes(d1, d2, out_d); // Print the minimization diagram. /* RWRW: @@ -103,20 +99,20 @@ _construct_envelope_non_vertical (Curve_pointer_iterator begin, // template void Envelope_divide_and_conquer_2:: -_construct_singleton_diagram (const X_monotone_curve_2& cv, - Envelope_diagram_1& out_d) +_construct_singleton_diagram(const X_monotone_curve_2& cv, + Envelope_diagram_1& out_d) { - CGAL_assertion (out_d.leftmost() == out_d.rightmost()); - CGAL_assertion (out_d.leftmost()->is_empty()); + CGAL_assertion(out_d.leftmost() == out_d.rightmost()); + CGAL_assertion(out_d.leftmost()->is_empty()); // Check if the given curve is bounded from the left and from the right. - if (traits->parameter_space_in_x_2_object() (cv, ARR_MIN_END) != ARR_INTERIOR) + if (traits->parameter_space_in_x_2_object()(cv, ARR_MIN_END) != ARR_INTERIOR) { - if (traits->parameter_space_in_x_2_object() (cv, ARR_MAX_END) != ARR_INTERIOR) + if (traits->parameter_space_in_x_2_object()(cv, ARR_MAX_END) != ARR_INTERIOR) { // The curve is defined over (-oo, oo), so its diagram contains // only a single edge. - out_d.leftmost()->add_curve (cv); + out_d.leftmost()->add_curve(cv); return; } @@ -124,47 +120,47 @@ _construct_singleton_diagram (const X_monotone_curve_2& cv, // The curve is defined over (-oo, x], where x is finite. // Create a vertex and associate it with the right endpoint of cv. CGAL_precondition - (traits->parameter_space_in_y_2_object() (cv, ARR_MAX_END) == ARR_INTERIOR); + (traits->parameter_space_in_y_2_object()(cv, ARR_MAX_END) == ARR_INTERIOR); - Vertex_handle v = - out_d.new_vertex (traits->construct_max_vertex_2_object() (cv)); - Edge_handle e_right = out_d.new_edge(); + Vertex_handle v = + out_d.new_vertex(traits->construct_max_vertex_2_object()(cv)); + Edge_handle e_right = out_d.new_edge(); - v->add_curve (cv); - v->set_left (out_d.leftmost()); - v->set_right (e_right); + v->add_curve(cv); + v->set_left(out_d.leftmost()); + v->set_right(e_right); // The leftmost edge is associated with cv, and the rightmost is empty. - out_d.leftmost()->add_curve (cv); - out_d.leftmost()->set_right (v); + out_d.leftmost()->add_curve(cv); + out_d.leftmost()->set_right(v); - e_right->set_left (v); - out_d.set_rightmost (e_right); + e_right->set_left(v); + out_d.set_rightmost(e_right); return; } - if (traits->parameter_space_in_x_2_object() (cv, ARR_MAX_END) != ARR_INTERIOR) + if (traits->parameter_space_in_x_2_object()(cv, ARR_MAX_END) != ARR_INTERIOR) { // The curve is defined over [x, +oo), where x is finite. // Create a vertex and associate it with the left endpoint of cv. CGAL_precondition - (traits->parameter_space_in_y_2_object() (cv, ARR_MIN_END) == ARR_INTERIOR); + (traits->parameter_space_in_y_2_object()(cv, ARR_MIN_END) == ARR_INTERIOR); Vertex_handle v = - out_d.new_vertex (traits->construct_min_vertex_2_object() (cv)); + out_d.new_vertex(traits->construct_min_vertex_2_object()(cv)); Edge_handle e_left = out_d.new_edge(); - v->add_curve (cv); - v->set_left (e_left); - v->set_right (out_d.rightmost()); + v->add_curve(cv); + v->set_left(e_left); + v->set_right(out_d.rightmost()); // The rightmost edge is associated with cv, and the leftmost is empty. - out_d.rightmost()->add_curve (cv); - out_d.rightmost()->set_left (v); + out_d.rightmost()->add_curve(cv); + out_d.rightmost()->set_left(v); - e_left->set_right (v); - out_d.set_leftmost (e_left); + e_left->set_right(v); + out_d.set_leftmost(e_left); return; } @@ -176,35 +172,35 @@ _construct_singleton_diagram (const X_monotone_curve_2& cv, // -oo -------------(+)============(+)------------ +oo // CGAL_precondition - (traits->parameter_space_in_y_2_object() (cv, ARR_MIN_END) == ARR_INTERIOR); + (traits->parameter_space_in_y_2_object()(cv, ARR_MIN_END) == ARR_INTERIOR); CGAL_precondition - (traits->parameter_space_in_y_2_object() (cv, ARR_MAX_END) == ARR_INTERIOR); + (traits->parameter_space_in_y_2_object()(cv, ARR_MAX_END) == ARR_INTERIOR); Vertex_handle v1 = - out_d.new_vertex (traits->construct_min_vertex_2_object() (cv)); + out_d.new_vertex(traits->construct_min_vertex_2_object()(cv)); Vertex_handle v2 = - out_d.new_vertex (traits->construct_max_vertex_2_object() (cv)); + out_d.new_vertex(traits->construct_max_vertex_2_object()(cv)); Edge_handle e_left = out_d.new_edge(); Edge_handle e_right = out_d.new_edge(); Edge_handle e = out_d.leftmost(); - v1->add_curve (cv); - v1->set_left (e_left); - v1->set_right (e); + v1->add_curve(cv); + v1->set_left(e_left); + v1->set_right(e); - v2->add_curve (cv); - v2->set_left (e); - v2->set_right (e_right); + v2->add_curve(cv); + v2->set_left(e); + v2->set_right(e_right); - e->add_curve (cv); - e->set_left (v1); - e->set_right (v2); + e->add_curve(cv); + e->set_left(v1); + e->set_right(v2); - e_left->set_right (v1); - e_right->set_left (v2); + e_left->set_right(v1); + e_right->set_left(v2); - out_d.set_leftmost (e_left); - out_d.set_rightmost (e_right); + out_d.set_leftmost(e_left); + out_d.set_rightmost(e_right); return; } @@ -214,9 +210,9 @@ _construct_singleton_diagram (const X_monotone_curve_2& cv, // template void Envelope_divide_and_conquer_2:: -_merge_envelopes (const Envelope_diagram_1& d1, - const Envelope_diagram_1& d2, - Envelope_diagram_1& out_d) +_merge_envelopes(const Envelope_diagram_1& d1, + const Envelope_diagram_1& d2, + Envelope_diagram_1& out_d) { Edge_const_handle e1 = d1.leftmost(); bool is_leftmost1 = true; @@ -262,7 +258,7 @@ _merge_envelopes (const Envelope_diagram_1& d1, { v1 = e1->right(); v2 = e2->right(); - res_v = _compare_vertices (v1, v2, same_x); + res_v = _compare_vertices(v1, v2, same_x); next_v = (res_v == SMALLER) ? v1 : v2; } @@ -270,43 +266,36 @@ _merge_envelopes (const Envelope_diagram_1& d1, if (! e1->is_empty() && ! e2->is_empty()) { // Both edges are not empty, and there are curves defined on them. - _merge_two_intervals (e1, is_leftmost1, - e2, is_leftmost2, - next_v, next_exists, - res_v, out_d); + _merge_two_intervals(e1, is_leftmost1, e2, is_leftmost2, + next_v, next_exists, res_v, out_d); } else if (! e1->is_empty() && e2->is_empty()) { // e1 is not empty but e2 is empty: - _merge_single_interval (e1, e2, - next_v, next_exists, - res_v, - out_d); + _merge_single_interval(e1, e2, next_v, next_exists, res_v, out_d); } else if (e1->is_empty() && ! e2->is_empty()) { // e1 is empty and e2 is not empty: - _merge_single_interval (e2, e1, - next_v, next_exists, - CGAL::opposite(res_v), - out_d); + _merge_single_interval(e2, e1, next_v, next_exists, + CGAL::opposite(res_v), out_d); } else { // Both edges are empty: append an empty edge to out_d: if (next_exists) { - Vertex_handle new_v = _append_vertex (out_d, next_v->point(), e1); + Vertex_handle new_v = _append_vertex(out_d, next_v->point(), e1); switch(res_v) { case SMALLER: - new_v->add_curves (v1->curves_begin(), v1->curves_end()); break; + new_v->add_curves(v1->curves_begin(), v1->curves_end()); break; case LARGER: - new_v->add_curves (v2->curves_begin(), v2->curves_end()); break; + new_v->add_curves(v2->curves_begin(), v2->curves_end()); break; case EQUAL: - new_v->add_curves (v1->curves_begin(), v1->curves_end()); - new_v->add_curves (v2->curves_begin(), v2->curves_end()); + new_v->add_curves(v1->curves_begin(), v1->curves_end()); + new_v->add_curves(v2->curves_begin(), v2->curves_end()); break; } } @@ -359,12 +348,12 @@ _merge_envelopes (const Envelope_diagram_1& d1, // template Comparison_result Envelope_divide_and_conquer_2:: -_compare_vertices (Vertex_const_handle v1, - Vertex_const_handle v2, - bool& same_x) const +_compare_vertices(Vertex_const_handle v1, + Vertex_const_handle v2, + bool& same_x) const { - Comparison_result res = traits->compare_x_2_object() (v1->point(), - v2->point()); + Comparison_result res = + traits->compare_x_2_object()(v1->point(), v2->point()); if (res != EQUAL) { @@ -377,12 +366,11 @@ _compare_vertices (Vertex_const_handle v1, } // In case the x-coordinates of the two vertices are equal: - res = traits->compare_xy_2_object() (v1->point(), - v2->point()); + res = traits->compare_xy_2_object()(v1->point(), v2->point()); // In case of upper envlope we take the opposite result if (env_type == UPPER) - return CGAL::opposite (res); + return CGAL::opposite(res); return res; } @@ -392,16 +380,16 @@ _compare_vertices (Vertex_const_handle v1, // template void Envelope_divide_and_conquer_2:: -_merge_single_interval (Edge_const_handle e, Edge_const_handle other_edge, - Vertex_const_handle v, bool v_exists, - Comparison_result origin_of_v, - Envelope_diagram_1& out_d) +_merge_single_interval(Edge_const_handle e, Edge_const_handle other_edge, + Vertex_const_handle v, bool v_exists, + Comparison_result origin_of_v, + Envelope_diagram_1& out_d) { if (! v_exists) { // The non-empty edge e is unbounded from the right, so we simply have // to update the rightmost edge in out_d. - out_d.rightmost()->add_curves (e->curves_begin(), e->curves_end()); + out_d.rightmost()->add_curves(e->curves_begin(), e->curves_end()); return; } @@ -410,37 +398,37 @@ _merge_single_interval (Edge_const_handle e, Edge_const_handle other_edge, if (origin_of_v == SMALLER) { // The non-empty edge ends at v, so we simply insert it to out_d. - new_v = _append_vertex (out_d, v->point(), e); - new_v->add_curves (v->curves_begin(), v->curves_end()); + new_v = _append_vertex(out_d, v->point(), e); + new_v->add_curves(v->curves_begin(), v->curves_end()); return; } if (origin_of_v == EQUAL) // the edges have vertices at the same place. { - new_v = _append_vertex (out_d, v->point(), e); - new_v->add_curves (e->right()->curves_begin(), e->right()->curves_end()); - new_v->add_curves (other_edge->right()->curves_begin(), - other_edge->right()->curves_end()); + new_v = _append_vertex(out_d, v->point(), e); + new_v->add_curves(e->right()->curves_begin(), e->right()->curves_end()); + new_v->add_curves(other_edge->right()->curves_begin(), + other_edge->right()->curves_end()); return; } // If v is not on e, we should insert it to the merged diagram only if it // is below (or above, in case of an upper envelope) the curves of e. - Comparison_result res = traits->compare_y_at_x_2_object() (v->point(), - e->curve()); + Comparison_result res = + traits->compare_y_at_x_2_object()(v->point(), e->curve()); if ((res == EQUAL) || (env_type == LOWER && res == SMALLER) || (env_type == UPPER && res == LARGER)) { - new_v = _append_vertex (out_d, v->point(), e); - new_v->add_curves (v->curves_begin(), v->curves_end()); + new_v = _append_vertex(out_d, v->point(), e); + new_v->add_curves(v->curves_begin(), v->curves_end()); if (res == EQUAL) { // In case of equality, append e's curves to those of the new vertex. - new_v->add_curves (e->curves_begin(), e->curves_end()); + new_v->add_curves(e->curves_begin(), e->curves_end()); } } } @@ -463,41 +451,39 @@ _merge_single_interval (Edge_const_handle e, Edge_const_handle other_edge, template Comparison_result Envelope_divide_and_conquer_2:: compare_y_at_end(const X_monotone_curve_2& xcv1, - const X_monotone_curve_2& xcv2, - Arr_curve_end curve_end) const + const X_monotone_curve_2& xcv2, + Arr_curve_end curve_end) const { - CGAL_precondition (traits->is_in_x_range_2_object() (xcv1, xcv2)); + CGAL_precondition(traits->is_in_x_range_2_object()(xcv1, xcv2)); typedef typename Traits::Compare_xy_2 Compare_xy_2; typedef typename Traits::Compare_y_at_x_2 Compare_y_at_x_2; typedef typename Traits::Construct_min_vertex_2 Construct_min_vertex_2; typedef typename Traits::Construct_max_vertex_2 Construct_max_vertex_2; - Compare_y_at_x_2 compare_y_at_x = traits->compare_y_at_x_2_object(); + Compare_y_at_x_2 compare_y_at_x = traits->compare_y_at_x_2_object(); Construct_min_vertex_2 min_vertex = traits->construct_min_vertex_2_object(); Construct_max_vertex_2 max_vertex = traits->construct_max_vertex_2_object(); // First check whether any of the curves is defined at x boundary. - const Arr_parameter_space ps_x1 = traits->parameter_space_in_x_2_object() - (xcv1, curve_end); - const Arr_parameter_space ps_x2 = traits->parameter_space_in_x_2_object() - (xcv2, curve_end); + const Arr_parameter_space ps_x1 = + traits->parameter_space_in_x_2_object()(xcv1, curve_end); + const Arr_parameter_space ps_x2 = + traits->parameter_space_in_x_2_object()(xcv2, curve_end); Comparison_result res; - if (ps_x1 != ARR_INTERIOR) - { - if (ps_x2 != ARR_INTERIOR) - { + if (ps_x1 != ARR_INTERIOR) { + if (ps_x2 != ARR_INTERIOR) { // Compare the relative position of the curves at x boundary. - return (traits->compare_y_near_boundary_2_object() - (xcv1, xcv2, curve_end)); + return (traits->compare_y_near_boundary_2_object()(xcv1, xcv2, + curve_end)); } // Check if the left end of xcv2 lies at y boundary. - const Arr_parameter_space ps_y2 = traits->parameter_space_in_y_2_object() - (xcv2, curve_end); + const Arr_parameter_space ps_y2 = + traits->parameter_space_in_y_2_object()(xcv2, curve_end); if (ps_y2 == ARR_BOTTOM_BOUNDARY) return (LARGER); // xcv2 is obviously below xcv1. @@ -506,16 +492,14 @@ compare_y_at_end(const X_monotone_curve_2& xcv1, // Compare the position of the left end of xcv2 (which is a normal // point) to xcv1. - if (curve_end == ARR_MIN_END) - res = compare_y_at_x (min_vertex (xcv2), xcv1); - else - res = compare_y_at_x (max_vertex (xcv2), xcv1); + res = (curve_end == ARR_MIN_END) ? + compare_y_at_x(min_vertex(xcv2), xcv1) : + compare_y_at_x(max_vertex(xcv2), xcv1); // Swap the result. return CGAL::opposite(res); } - else if (ps_x2 != ARR_INTERIOR) - { + else if (ps_x2 != ARR_INTERIOR) { // Check if the left end of xcv1 lies at y boundary. const Arr_parameter_space ps_y1 = traits->parameter_space_in_y_2_object() (xcv1, curve_end); @@ -527,39 +511,35 @@ compare_y_at_end(const X_monotone_curve_2& xcv1, // Compare the position of the left end of xcv1 (which is a normal // point) to xcv2. - if (curve_end == ARR_MIN_END) - res = compare_y_at_x (min_vertex (xcv1), xcv2); - else - res = compare_y_at_x (max_vertex (xcv1), xcv2); - + res = (curve_end == ARR_MIN_END) ? + compare_y_at_x(min_vertex(xcv1), xcv2) : + compare_y_at_x(max_vertex(xcv1), xcv2); return (res); } // Check if the left curve end lies at y = +/- oo. - const Arr_parameter_space ps_y1 = traits->parameter_space_in_y_2_object() - (xcv1, curve_end); - const Arr_parameter_space ps_y2 = traits->parameter_space_in_y_2_object() - (xcv2, curve_end); + const Arr_parameter_space ps_y1 = + traits->parameter_space_in_y_2_object()(xcv1, curve_end); + const Arr_parameter_space ps_y2 = + traits->parameter_space_in_y_2_object()(xcv2, curve_end); Comparison_result l_res; - if (ps_y1 != ARR_INTERIOR) - { - if (ps_y2 != ARR_INTERIOR) - { + if (ps_y1 != ARR_INTERIOR) { + if (ps_y2 != ARR_INTERIOR) { // The curve ends have boundary conditions with oposite signs in y, // we readily know their relative position (recall that they do not // instersect). - if (ps_y1 == ARR_BOTTOM_BOUNDARY && ps_y2 == ARR_TOP_BOUNDARY) + if ((ps_y1 == ARR_BOTTOM_BOUNDARY) && (ps_y2 == ARR_TOP_BOUNDARY)) return (SMALLER); - else if (ps_y1 == ARR_TOP_BOUNDARY && ps_y2 == ARR_BOTTOM_BOUNDARY) + else if ((ps_y1 == ARR_TOP_BOUNDARY) && (ps_y2 == ARR_BOTTOM_BOUNDARY)) return (LARGER); // Both curves have vertical asymptotes with the same sign in y. // Check which asymptote is the rightmost. Note that in this case // the vertical asymptotes cannot be equal. - l_res = traits->compare_x_curve_ends_2_object() - (xcv1, curve_end, xcv2, curve_end); - CGAL_assertion (l_res != EQUAL); + l_res = traits->compare_x_curve_ends_2_object()(xcv1, curve_end, + xcv2, curve_end); + CGAL_assertion(l_res != EQUAL); if (ps_y1 == ARR_TOP_BOUNDARY) return (l_res); @@ -569,46 +549,34 @@ compare_y_at_end(const X_monotone_curve_2& xcv1, // xcv1 has a vertical asymptote and xcv2 has a normal left endpoint. // Compare the x-positions of this endpoint and the asymptote. - const Point_2& left2 = + const Point_2& left2 = (curve_end == ARR_MIN_END) ? min_vertex(xcv2) : max_vertex(xcv2); - l_res = traits->compare_x_point_curve_end_2_object() - (left2, xcv1, curve_end); + l_res = + traits->compare_x_point_curve_end_2_object()(left2, xcv1, curve_end); - if (l_res == LARGER) - { + if (l_res == LARGER) { // left2 lies in the x-range of xcv1, so it is safe to compare: - res = compare_y_at_x (left2, xcv1); - + res = compare_y_at_x(left2, xcv1); return CGAL::opposite(res); } else - { - if (ps_y1 == ARR_BOTTOM_BOUNDARY) - return (SMALLER); // xcv1 is obviously below xcv2. - else - return (LARGER); // xcv2 is obviously above xcv1. - } + // xcv1 is below or above xcv2. + return ((ps_y1 == ARR_BOTTOM_BOUNDARY) ? SMALLER : LARGER); } - else if (ps_y2 != ARR_INTERIOR) - { + else if (ps_y2 != ARR_INTERIOR) { // xcv2 has a vertical asymptote and xcv1 has a normal left endpoint. // Compare the x-positions of this endpoint and the asymptote. const Point_2& left1 = (curve_end == ARR_MIN_END) ? min_vertex(xcv1) : max_vertex(xcv1); - l_res = traits->compare_x_point_curve_end_2_object() - (left1, xcv2, curve_end); + l_res = + traits->compare_x_point_curve_end_2_object()(left1, xcv2, curve_end); - if (l_res == LARGER) - { - // left1 lies in the x-range of xcv2, so it is safe to compare: - return (compare_y_at_x (left1, xcv2)); - } - else - { - return (ps_y2 == ARR_BOTTOM_BOUNDARY) ? LARGER : SMALLER; - } + return ((l_res == LARGER) ? + // left1 lies in the x-range of xcv2, so it is safe to compare: + (compare_y_at_x(left1, xcv2)) : + ((ps_y2 == ARR_BOTTOM_BOUNDARY) ? LARGER : SMALLER)); } // In this case we compare two normal points. @@ -622,18 +590,13 @@ compare_y_at_end(const X_monotone_curve_2& xcv1, // Locate the rightmost point of left1 and left2 and compare its position // to the other curve. - l_res = compare_xy (left1, left2); + l_res = compare_xy(left1, left2); - if (l_res != SMALLER) - { + return ((l_res != SMALLER) ? // left1 is in the x-range of xcv2: - return compare_y_at_x (left1, xcv2); - } - else - { + compare_y_at_x(left1, xcv2) : // left2 is in the x-range of xcv1: - return CGAL::opposite(compare_y_at_x (left2, xcv1)); - } + CGAL::opposite(compare_y_at_x(left2, xcv1))); } /*@}*/ @@ -642,11 +605,11 @@ compare_y_at_end(const X_monotone_curve_2& xcv1, // template void Envelope_divide_and_conquer_2:: -_merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, - Edge_const_handle e2, bool is_leftmost2, - Vertex_const_handle v, bool v_exists, - Comparison_result origin_of_v, - Envelope_diagram_1& out_d) +_merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, + Edge_const_handle e2, bool is_leftmost2, + Vertex_const_handle v, bool v_exists, + Comparison_result origin_of_v, + Envelope_diagram_1& out_d) { typedef std::pair Intersection_point; @@ -658,28 +621,26 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, current_res = compare_y_at_end(e1->curve(), e2->curve(), ARR_MIN_END); // Flip the result in case of an upper envelope. if (env_type == UPPER) - current_res = CGAL::opposite (current_res); + current_res = CGAL::opposite(current_res); - // Use the current rightmost of the two left vertices as a reference point. // This is the rightmost vertex in the current minimization diagram (out_d). // The intersection points/curves that interest us are the ones in // [v_leftmost, v]. - boost::optional v_leftmost; + boost::optional v_leftmost = + boost::optional(); - if (is_leftmost1 == true) - { + if (is_leftmost1 == true) { if (is_leftmost2 == false) v_leftmost = e2->left(); } - else - { + else { if (is_leftmost2 == true) v_leftmost = e1->left(); else { - if ((traits->compare_xy_2_object() (e1->left()->point(), - e2->left()->point()) == LARGER)) + if ((traits->compare_xy_2_object()(e1->left()->point(), + e2->left()->point()) == LARGER)) v_leftmost = e1->left(); else v_leftmost = e2->left(); @@ -694,17 +655,16 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, const X_monotone_curve_2* intersection_curve; const Intersection_point* intersection_point; - traits->intersect_2_object() (e1->curve(), e2->curve(), - std::back_inserter(objects)); + traits->intersect_2_object()(e1->curve(), e2->curve(), + std::back_inserter(objects)); - while (! objects.empty()) - { + while (! objects.empty()) { // Pop the xy-lexicographically smallest intersection object. obj = objects.front(); objects.pop_front(); - if ((intersection_point = CGAL::object_cast(&obj)) - != NULL) + if ((intersection_point = CGAL::object_cast(&obj)) != + NULL) { // We have a simple intersection point. bool is_in_x_range = true; // true if the intersection point is to the @@ -722,8 +682,7 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, // check if we arrived at the rightmost point (stop if indeed we are // there). - if (is_in_x_range && v_exists) - { + if (is_in_x_range && v_exists) { Comparison_result res = traits->compare_xy_2_object() (intersection_point->first, v->point()); @@ -738,24 +697,19 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, // Create a new vertex in the output diagram that corrsponds to the // current intersection point. - if (is_in_x_range) - { - Vertex_handle new_v; - + if (is_in_x_range) { CGAL_assertion(current_res != EQUAL); - if (current_res == SMALLER) - new_v = _append_vertex (out_d, intersection_point->first, e1); - else - new_v = _append_vertex (out_d, intersection_point->first, e2); + Vertex_handle new_v = (current_res == SMALLER) ? + _append_vertex(out_d, intersection_point->first, e1) : + _append_vertex(out_d, intersection_point->first, e2); // if we are at v, then this is a special case that is handled after // the loop. We need to add the curves from the original vertices. - if (equal_at_v == false) - { + if (equal_at_v == false) { // Note that the new vertex is incident to all curves in e1 and in e2. - new_v->add_curves (e1->curves_begin(), e1->curves_end()); - new_v->add_curves (e2->curves_begin(), e2->curves_end()); + new_v->add_curves(e1->curves_begin(), e1->curves_end()); + new_v->add_curves(e2->curves_begin(), e2->curves_end()); } // Update the handle to the rightmost vertex in the output diagram. @@ -769,34 +723,31 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, // Get the curve order immediately to the right of the intersection // point. Note that in case of even (non-zero) multiplicity the order // remains the same. - if (current_res != EQUAL && intersection_point->second % 2 == 1) - { + if ((current_res != EQUAL) && (intersection_point->second % 2 == 1)) { // Odd multiplicity: flip the current comparison result. - current_res = CGAL::opposite (current_res); + current_res = CGAL::opposite(current_res); } // if we are at v, then we may not be able to call compare_y_at_x_right_2. - else if ((intersection_point->second == 0 || current_res == EQUAL) - && equal_at_v == false) + else if (((intersection_point->second == 0) || (current_res == EQUAL)) && + (equal_at_v == false)) { // The multiplicity is unknown, so we have to compare the curves to // the right of their intersection point. - current_res = traits->compare_y_at_x_right_2_object() - (e1->curve(), - e2->curve(), - intersection_point->first); + current_res = + traits->compare_y_at_x_right_2_object()(e1->curve(), e2->curve(), + intersection_point->first); // Flip the result in case of an upper envelope. if (env_type == UPPER) current_res = CGAL::opposite (current_res); } } - else - { + else { // We have an x-monotone curve representing an overlap of the two // curves. intersection_curve = CGAL::object_cast(&obj); if (intersection_curve == NULL) - CGAL_error_msg ("unrecognized intersection object."); + CGAL_error_msg("unrecognized intersection object."); // Get the endpoints of the overlapping curves. const bool has_left = @@ -808,16 +759,16 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, Point_2 p_left, p_right; if (has_left) - p_left = traits->construct_min_vertex_2_object() (*intersection_curve); + p_left = traits->construct_min_vertex_2_object()(*intersection_curve); if (has_right) - p_right = traits->construct_max_vertex_2_object() (*intersection_curve); + p_right = traits->construct_max_vertex_2_object()(*intersection_curve); bool is_in_x_range = true; // Check if the overlapping curve is not relevant to our range. if (v_leftmost && has_right && - traits->compare_xy_2_object() (p_right, - (*v_leftmost)->point()) != LARGER) + (traits->compare_xy_2_object()(p_right, (*v_leftmost)->point()) != + LARGER)) { // The right point of the overlappinf curve is to the left of the // current rightmost vertex in out_d, so we skip it and continue @@ -826,16 +777,13 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, is_in_x_range = false; } - if (is_in_x_range && v_exists && has_left) - { - Comparison_result res = traits->compare_xy_2_object() (p_left, - v->point()); + if (is_in_x_range && v_exists && has_left) { + Comparison_result res = + traits->compare_xy_2_object()(p_left, v->point()); // v is an intersection points, so both curves are equal there: if (res == EQUAL) - { equal_at_v = true; - } // We passed the next vertex, so we can stop here. if (res == LARGER) @@ -845,28 +793,24 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, // There is an overlap between the range [u, v] and intersection_curve. if (is_in_x_range && has_left && (! v_leftmost || - traits->compare_xy_2_object() (p_left, - (*v_leftmost)->point()) == LARGER)) + (traits->compare_xy_2_object()(p_left, (*v_leftmost)->point()) == + LARGER))) { // Create an output edge that represent the portion of [u, v] to the // left of the overlapping curve. - Vertex_handle new_v; + CGAL_assertion(current_res != EQUAL); - CGAL_assertion (current_res != EQUAL); - - if (current_res == SMALLER) - new_v = _append_vertex (out_d, p_left, e1); - else - new_v = _append_vertex (out_d, p_left, e2); + Vertex_handle new_v = (current_res == SMALLER) ? + _append_vertex(out_d, p_left, e1) : + _append_vertex(out_d, p_left, e2); // if we are at v, then this is a special case that is handled after // the loop. We need to add the curves from the original vertices. - if (equal_at_v == false) - { + if (equal_at_v == false) { // Note that the new vertex is incident to all curves in e1 and // in e2. - new_v->add_curves (e1->curves_begin(), e1->curves_end()); - new_v->add_curves (e2->curves_begin(), e2->curves_end()); + new_v->add_curves(e1->curves_begin(), e1->curves_end()); + new_v->add_curves(e2->curves_begin(), e2->curves_end()); } // Update the handle to the rightmost vertex in the output diagram. @@ -875,39 +819,33 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, if (is_in_x_range && has_right && (! v_exists || - traits->compare_xy_2_object() (p_right, - v->point()) == SMALLER)) + (traits->compare_xy_2_object()(p_right, v->point()) == SMALLER))) { // Create an edge that represents the overlapping curve. - Vertex_handle new_v; + Vertex_handle new_v = _append_vertex(out_d, p_right, e1); + new_v->left()->add_curves(e2->curves_begin(), e2->curves_end()); - new_v = _append_vertex (out_d, p_right, e1); - new_v->left()->add_curves (e2->curves_begin(), e2->curves_end()); - - // We are not at v becuase p_right is smaller than v. // The special case that we are at v is handled in the next // condition. // If we were at v, then this was a special case that is handled // later. - CGAL_assertion (equal_at_v == false); - new_v->add_curves (e1->curves_begin(), e1->curves_end()); - new_v->add_curves (e2->curves_begin(), e2->curves_end()); + CGAL_assertion(equal_at_v == false); + new_v->add_curves(e1->curves_begin(), e1->curves_end()); + new_v->add_curves(e2->curves_begin(), e2->curves_end()); // Update the handle to the rightmost vertex in the output diagram. v_leftmost = new_v; } if (has_right == false || - (v_exists && traits->compare_xy_2_object() (p_right, - v->point()) != SMALLER)) + (v_exists && traits->compare_xy_2_object()(p_right, v->point()) != + SMALLER)) { // The overlapping curves reaches v. - if (v_exists) - { - Vertex_handle new_v; - new_v = _append_vertex (out_d, v->point(), e1); - new_v->left()->add_curves (e2->curves_begin(), e2->curves_end()); + if (v_exists) { + Vertex_handle new_v = _append_vertex(out_d, v->point(), e1); + new_v->left()->add_curves(e2->curves_begin(), e2->curves_end()); } equal_at_v = true; @@ -918,21 +856,19 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, // We arrive here only if we are not at v and the overlap has a right // endpoint. // Compare the curves to the right of p_right. - current_res = traits->compare_y_at_x_right_2_object() (e1->curve(), - e2->curve(), - p_right); + current_res = + traits->compare_y_at_x_right_2_object()(e1->curve(), e2->curve(), + p_right); // Flip the result in case of an upper envelope. if (env_type == UPPER) current_res = CGAL::opposite (current_res); } - } // End of the traversal over the intersection objects. // Handle the portion after the intersection objects. - if (equal_at_v) - { + if (equal_at_v) { CGAL_assertion (v_exists); // v_leftmost should be our vertex at v. @@ -941,17 +877,15 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, Vertex_handle v_to_be_updated = out_d.rightmost()->left(); - if (origin_of_v == EQUAL) - { + if (origin_of_v == EQUAL) { // If the vertices of the edge are the same, we have to get the // curves from there: - v_to_be_updated->add_curves (e1->right()->curves_begin(), - e1->right()->curves_end()); - v_to_be_updated->add_curves (e2->right()->curves_begin(), - e2->right()->curves_end()); + v_to_be_updated->add_curves(e1->right()->curves_begin(), + e1->right()->curves_end()); + v_to_be_updated->add_curves(e2->right()->curves_begin(), + e2->right()->curves_end()); } - else - { + else { // We add the curves from the original vertex and from the edge of the // other diagram. Edge_const_handle e = (origin_of_v == SMALLER) ? e2 : e1; @@ -963,21 +897,20 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, return; } - if (! v_exists) - { + if (! v_exists) { // Both edges are unbounded from the right, so we simply have // to update the rightmost edge in out_d. switch (current_res) { case SMALLER: - out_d.rightmost()->add_curves (e1->curves_begin(), e1->curves_end()); + out_d.rightmost()->add_curves(e1->curves_begin(), e1->curves_end()); return; case LARGER: - out_d.rightmost()->add_curves (e2->curves_begin(), e2->curves_end()); + out_d.rightmost()->add_curves(e2->curves_begin(), e2->curves_end()); return; case EQUAL: - out_d.rightmost()->add_curves (e1->curves_begin(), e1->curves_end()); - out_d.rightmost()->add_curves (e2->curves_begin(), e2->curves_end()); + out_d.rightmost()->add_curves(e1->curves_begin(), e1->curves_end()); + out_d.rightmost()->add_curves(e2->curves_begin(), e2->curves_end()); return; default: CGAL_error_msg("should not reach here."); @@ -994,90 +927,79 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, // Second diagram of the two segments: [(0, 0), (1, 1)], [(1, 0), (2, 1)] // Check if we need to insert v into the diagram. - if (current_res == SMALLER) - { + if (current_res == SMALLER) { // The final part of the interval is taken from e1. Vertex_handle new_v; - if (origin_of_v == SMALLER) - { + if (origin_of_v == SMALLER) { // In case v is also from e1, append it to the merged diagram. - new_v = _append_vertex (out_d, v->point(), e1); - new_v->add_curves (v->curves_begin(), v->curves_end()); + new_v = _append_vertex(out_d, v->point(), e1); + new_v->add_curves(v->curves_begin(), v->curves_end()); } - else - { + else { // if origin_of_v is EQUAL then the two diagram have a vertex at // exact same place. - if (origin_of_v == EQUAL) - { - new_v = _append_vertex (out_d, v->point(), e1); - new_v->add_curves (v->curves_begin(), v->curves_end()); + if (origin_of_v == EQUAL) { + new_v = _append_vertex(out_d, v->point(), e1); + new_v->add_curves(v->curves_begin(), v->curves_end()); // adding the curves of the vertex of the first diagram (vertices are // equal...) - new_v->add_curves (e1->right()->curves_begin(), - e1->right()->curves_end()); + new_v->add_curves(e1->right()->curves_begin(), + e1->right()->curves_end()); } - else - { + else { // If v is from e2, check if it below (or above, in case of an upper // envelope) cv1 to insert it. const Comparison_result res = - traits->compare_y_at_x_2_object() (v->point(), - e1->curve()); + traits->compare_y_at_x_2_object()(v->point(), e1->curve()); if (res == EQUAL || - (env_type == LOWER && res == SMALLER) || - (env_type == UPPER && res == LARGER)) + ((env_type == LOWER) && (res == SMALLER)) || + ((env_type == UPPER) && (res == LARGER))) { - new_v = _append_vertex (out_d, v->point(), e1); - new_v->add_curves (v->curves_begin(), v->curves_end()); + new_v = _append_vertex(out_d, v->point(), e1); + new_v->add_curves(v->curves_begin(), v->curves_end()); if (res == EQUAL) - new_v->add_curves (e1->curves_begin(), e1->curves_end()); + new_v->add_curves(e1->curves_begin(), e1->curves_end()); } } } } - else - { + else { // The final part of the interval is taken from e2. Vertex_handle new_v; - if (origin_of_v != SMALLER) - { + if (origin_of_v != SMALLER) { // In case v is also from e2, append it to the merged diagram. - new_v = _append_vertex (out_d, v->point(), e2); - new_v->add_curves (v->curves_begin(), v->curves_end()); + new_v = _append_vertex(out_d, v->point(), e2); + new_v->add_curves(v->curves_begin(), v->curves_end()); // if origin_of_v is EQUAL then the two diagram have a vertex at // exact same place. - if (origin_of_v == EQUAL) - { + if (origin_of_v == EQUAL) { // adding the curves of the vertex of the first diagram (vertices are // equal...) - new_v->add_curves (e1->right()->curves_begin(), - e1->right()->curves_end()); + new_v->add_curves(e1->right()->curves_begin(), + e1->right()->curves_end()); } } - else - { + else { // If v is from e1, check if it below (or above, in case of an upper // envelope) cv2 to insert it. const Comparison_result res = - traits->compare_y_at_x_2_object() (v->point(), - e2->curve()); + traits->compare_y_at_x_2_object()(v->point(), e2->curve()); if (res == EQUAL || - (env_type == LOWER && res == SMALLER) || - (env_type == UPPER && res == LARGER)) + ((env_type == LOWER) && (res == SMALLER)) || + ((env_type == UPPER) && (res == LARGER))) { - new_v = _append_vertex (out_d, v->point(), e2); - new_v->add_curves (v->curves_begin(), v->curves_end()); + new_v = _append_vertex(out_d, v->point(), e2); + new_v->add_curves(v->curves_begin(), v->curves_end()); if (res == EQUAL) - new_v->add_curves (e2->curves_begin(), e2->curves_end()); + new_v->add_curves(e2->curves_begin(), e2->curves_end()); } } } @@ -1090,36 +1012,34 @@ _merge_two_intervals (Edge_const_handle e1, bool is_leftmost1, // template typename Envelope_divide_and_conquer_2::Vertex_handle -Envelope_divide_and_conquer_2::_append_vertex - (Envelope_diagram_1& diag, - const Point_2& p, Edge_const_handle e) +Envelope_divide_and_conquer_2:: +_append_vertex(Envelope_diagram_1& diag, + const Point_2& p, Edge_const_handle e) { // Create the new vertex and the new edge. - Vertex_handle new_v = diag.new_vertex (p); + Vertex_handle new_v = diag.new_vertex(p); Edge_handle new_e = diag.new_edge(); if (! e->is_empty()) - new_e->add_curves (e->curves_begin(), e->curves_end()); + new_e->add_curves(e->curves_begin(), e->curves_end()); // Connect the new vertex. - new_v->set_left (new_e); - new_v->set_right (diag.rightmost()); + new_v->set_left(new_e); + new_v->set_right(diag.rightmost()); - if (diag.leftmost() != diag.rightmost()) - { + if (diag.leftmost() != diag.rightmost()) { // The diagram is not empty. Connect the new edge to the left of the // rightmost edge of the diagram. - new_e->set_right (new_v); - new_e->set_left (diag.rightmost()->left()); - diag.rightmost()->left()->set_right (new_e); - diag.rightmost()->set_left (new_v); + new_e->set_right(new_v); + new_e->set_left(diag.rightmost()->left()); + diag.rightmost()->left()->set_right(new_e); + diag.rightmost()->set_left(new_v); } - else - { + else { // The diagram is empty: Make the new edge the leftmost. - new_e->set_right (new_v); - diag.set_leftmost (new_e); - diag.rightmost()->set_left (new_v); + new_e->set_right(new_v); + diag.set_leftmost(new_e); + diag.rightmost()->set_left(new_v); } return (new_v); @@ -1131,26 +1051,26 @@ Envelope_divide_and_conquer_2::_append_vertex // template void Envelope_divide_and_conquer_2:: -_merge_vertical_segments (Curve_pointer_vector& vert_vec, - Envelope_diagram_1& out_d) +_merge_vertical_segments(Curve_pointer_vector& vert_vec, + Envelope_diagram_1& out_d) { // Sort the vertical segments by their increasing x-coordinate. - Less_vertical_segment les_vert (traits); + Less_vertical_segment les_vert(traits); - std::sort (vert_vec.begin(), vert_vec.end(), les_vert); + std::sort(vert_vec.begin(), vert_vec.end(), les_vert); // Proceed on the diagram and on the sorted sequence of vertical segments // and merge them into the diagram. typename Traits_adaptor_2::Compare_x_2 comp_x = - traits->compare_x_2_object(); + traits->compare_x_2_object(); typename Traits_adaptor_2::Compare_xy_2 comp_xy = - traits->compare_xy_2_object(); + traits->compare_xy_2_object(); typename Traits_adaptor_2::Compare_y_at_x_2 comp_y_at_x = - traits->compare_y_at_x_2_object(); + traits->compare_y_at_x_2_object(); typename Traits_adaptor_2::Construct_min_vertex_2 min_vertex = - traits->construct_min_vertex_2_object(); + traits->construct_min_vertex_2_object(); typename Traits_adaptor_2::Construct_max_vertex_2 max_vertex = - traits->construct_max_vertex_2_object(); + traits->construct_max_vertex_2_object(); Edge_handle e = out_d.leftmost(); Vertex_handle v = Vertex_handle(); @@ -1161,22 +1081,19 @@ _merge_vertical_segments (Curve_pointer_vector& vert_vec, bool on_v; Point_2 p; - while (iter != vert_vec.end()) - { + while (iter != vert_vec.end()) { // Check if the current vertical segment is on the x-range of the current // edge. - if (e != out_d.rightmost()) - { + if (e != out_d.rightmost()) { // The current edge is not the rightmost one: we compare the x-coordinate // of the vertical segment to its right vertex. v = e->right(); - res = comp_x (min_vertex (**iter), v->point()); + res = comp_x(min_vertex(**iter), v->point()); in_e_range = (res != LARGER); on_v = (res == EQUAL); } - else - { + else { // This is the rightmost edge, so the vertical segment must lie on its // x-range. in_e_range = true; @@ -1185,8 +1102,7 @@ _merge_vertical_segments (Curve_pointer_vector& vert_vec, // If the current vertical segment is not in the x-range of the current // edge, we proceed to the next edge. - if (! in_e_range) - { + if (! in_e_range) { e = v->right(); continue; } @@ -1196,44 +1112,38 @@ _merge_vertical_segments (Curve_pointer_vector& vert_vec, // we construct an upper envelope). std::list env_cvs; - env_cvs.push_back (**iter); + env_cvs.push_back(**iter); next = iter; ++next; - while (next != vert_vec.end() && - comp_x (min_vertex (**iter), min_vertex (**next)) == EQUAL) + while ((next != vert_vec.end()) && + (comp_x(min_vertex(**iter), min_vertex(**next)) == EQUAL)) { - if (env_type == LOWER) - { + if (env_type == LOWER) { // Compare the lower endpoints of both curves. - res = comp_xy (min_vertex (env_cvs.front()), min_vertex (**next)); + res = comp_xy(min_vertex(env_cvs.front()), min_vertex(**next)); // Update the list of vertical segments with minimal endpoints as // necessary. - if (res == EQUAL) - { - env_cvs.push_back (**next); + if (res == EQUAL) { + env_cvs.push_back(**next); } - if (res == LARGER) - { + if (res == LARGER) { env_cvs.clear(); - env_cvs.push_back (**next); + env_cvs.push_back(**next); } } - else - { + else { // Compare the upper endpoints of both curves. - res = comp_xy (max_vertex (env_cvs.front()), max_vertex (**next)); + res = comp_xy(max_vertex(env_cvs.front()), max_vertex(**next)); // Update the list of vertical segments with maximal endpoints as // necessary. - if (res == EQUAL) - { - env_cvs.push_back (**next); + if (res == EQUAL) { + env_cvs.push_back(**next); } - if (res == SMALLER) - { + if (res == SMALLER) { env_cvs.clear(); - env_cvs.push_back (**next); + env_cvs.push_back(**next); } } @@ -1241,27 +1151,23 @@ _merge_vertical_segments (Curve_pointer_vector& vert_vec, } // Compare the endpoint to the diagram feature. - if (env_type == LOWER) - p = min_vertex (env_cvs.front()); - else - p = max_vertex (env_cvs.front()); + p = (env_type == LOWER) ? + min_vertex(env_cvs.front()) : max_vertex(env_cvs.front()); - if (on_v) - { + if (on_v) { // Compare p to the current vertex. - res = comp_xy (p, v->point()); + res = comp_xy(p, v->point()); - if (res == EQUAL) - { + if (res == EQUAL) { // Add curves to the current vertex. - v->add_curves (env_cvs.begin(), env_cvs.end()); + v->add_curves(env_cvs.begin(), env_cvs.end()); } else if ((env_type == LOWER && res == SMALLER) || (env_type == UPPER && res == LARGER)) { // Replace the list of curves associated with the vertex. v->clear_curves(); - v->add_curves (env_cvs.begin(), env_cvs.end()); + v->add_curves(env_cvs.begin(), env_cvs.end()); } } else @@ -1269,26 +1175,24 @@ _merge_vertical_segments (Curve_pointer_vector& vert_vec, // p lies in the interior of the current edge. Vertex_handle new_v; - if (e->is_empty()) - { + if (e->is_empty()) { // Split the empty edge and associate the new vertex with the // vertical segments. - new_v = _split_edge (out_d, p, e); - new_v->add_curves (env_cvs.begin(), env_cvs.end()); + new_v = _split_edge(out_d, p, e); + new_v->add_curves(env_cvs.begin(), env_cvs.end()); } - else - { + else { // Compare p with the current curve. - res = comp_y_at_x (p, e->curve()); + res = comp_y_at_x(p, e->curve()); - if ((env_type == LOWER && res != LARGER) || - (env_type == UPPER && res != SMALLER)) + if (((env_type == LOWER) && (res != LARGER)) || + ((env_type == UPPER) && (res != SMALLER))) { - new_v = _split_edge (out_d, p, e); - new_v->add_curves (env_cvs.begin(), env_cvs.end()); + new_v = _split_edge(out_d, p, e); + new_v->add_curves(env_cvs.begin(), env_cvs.end()); if (res == EQUAL) - new_v->add_curve (e->curve()); + new_v->add_curve(e->curve()); } } } @@ -1305,29 +1209,28 @@ _merge_vertical_segments (Curve_pointer_vector& vert_vec, // template typename Envelope_divide_and_conquer_2::Vertex_handle -Envelope_divide_and_conquer_2::_split_edge - (Envelope_diagram_1& diag, - const Point_2& p, Edge_handle e) +Envelope_divide_and_conquer_2:: +_split_edge(Envelope_diagram_1& diag, const Point_2& p, Edge_handle e) { // Create the new vertex and the new edge. - Vertex_handle new_v = diag.new_vertex (p); + Vertex_handle new_v = diag.new_vertex(p); Edge_handle new_e = diag.new_edge(); // Duplicate the curves container associated with e. if (! e->is_empty()) - new_e->add_curves (e->curves_begin(), e->curves_end()); + new_e->add_curves(e->curves_begin(), e->curves_end()); // Connect the new vertex between e and new_e. - new_v->set_left (e); - new_v->set_right (new_e); + new_v->set_left(e); + new_v->set_right(new_e); - new_e->set_left (new_v); + new_e->set_left(new_v); if (e != diag.rightmost()) - new_e->set_right (e->right()); + new_e->set_right(e->right()); else - diag.set_rightmost (new_e); + diag.set_rightmost(new_e); - e->set_right (new_v); + e->set_right(new_v); // Return the new vertex. return (new_v); diff --git a/Envelope_3/include/CGAL/Env_plane_traits_3.h b/Envelope_3/include/CGAL/Env_plane_traits_3.h index 561408b04ce..2f123fe7bc5 100644 --- a/Envelope_3/include/CGAL/Env_plane_traits_3.h +++ b/Envelope_3/include/CGAL/Env_plane_traits_3.h @@ -40,8 +40,8 @@ public: typedef typename Kernel::FT FT; typedef Arr_linear_traits_2 Base; typedef Env_plane_traits_3 Self; - typedef unsigned int Multiplicity; + typedef typename Base::Multiplicity Multiplicity; typedef typename Base::Point_2 Point_2; typedef typename Base::Curve_2 Curve_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; diff --git a/Envelope_3/include/CGAL/Env_sphere_traits_3.h b/Envelope_3/include/CGAL/Env_sphere_traits_3.h index 5ec8d3d382f..0cea40d1cd2 100644 --- a/Envelope_3/include/CGAL/Env_sphere_traits_3.h +++ b/Envelope_3/include/CGAL/Env_sphere_traits_3.h @@ -42,6 +42,7 @@ public: typedef typename Traits_2::Point_2 Point_2; typedef typename Traits_2::Curve_2 Curve_2; typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Traits_2::Multiplicity Multiplicity; typedef typename Traits_2::Rat_kernel Rat_kernel; typedef typename Traits_2::Alg_kernel Alg_kernel; @@ -62,7 +63,6 @@ public: // here we refer to the lower part of the sphere only typedef Surface_3 Xy_monotone_surface_3; - typedef unsigned int Multiplicity; protected: typedef std::pair Intersection_curve; @@ -481,13 +481,17 @@ public: return o; } + // EBEB 2012/06/29: Added because of + // no matching function for call to 'compare(CGAL::Env_sphere_traits_3::Rational&, int) + Rational zero(0); + // if (a1==a2) and (b1==b2) (*) is a plane parallel to the xy-plane // and either all ellipse (which should be a circle) is the // intersection - in which case lc >= 0 // or there is no intersection at all between the 2 half spheres - // in which case lc < 0 - if (CGAL_NTS compare(a_diff, 0) == EQUAL && - CGAL_NTS compare(b_diff, 0) == EQUAL) + if (CGAL_NTS compare(a_diff, zero) == EQUAL && + CGAL_NTS compare(b_diff, zero) == EQUAL) { Sign sign_lc = CGAL_NTS sign(lc); if (sign_lc != NEGATIVE) @@ -505,7 +509,7 @@ public: // R*x^2 + S*y^2 + T*xy + U*x + V*y + W = 0 Alg_point_2 source, target, pmid; int n_inter_points; - if (CGAL_NTS compare(lb, 0) != EQUAL) + if (CGAL_NTS compare(lb, zero) != EQUAL) { // Find the x-coordinates of the intersection points of the conic // curve and the line y = -(la*x + lc) / lb: @@ -550,24 +554,23 @@ public: CGAL_precondition(x_mid_n_y_points > 0); Algebraic y1 = x_mid_y_points[0].y(), y2 = x_mid_y_points[1].y(); - if (CGAL_NTS compare ( - Algebraic(la)*x_mid + Algebraic(lb)*y1 + Algebraic(lc), - 0) == LARGER) - { + if (CGAL_NTS compare(Algebraic(la)*x_mid + Algebraic(lb)*y1 + Algebraic(lc), + Algebraic(0) + ) == LARGER) + { pmid = Alg_point_2(x_mid, y1); } else { - CGAL_assertion(CGAL_NTS compare - (Algebraic(la)*x_mid + Algebraic(lb)*y2 + Algebraic(lc), - 0) == LARGER); + CGAL_assertion(CGAL_NTS compare(Algebraic(la)*x_mid + Algebraic(lb)*y2 + Algebraic(lc), + Algebraic(0)) == LARGER); pmid = Alg_point_2(x_mid, y2); } } } else { // lb == 0 - CGAL_assertion(CGAL_NTS compare(la, 0) != EQUAL); + CGAL_assertion(CGAL_NTS compare(la, zero) != EQUAL); // Find the intersection of the vertical line x = -lc / la: Rational inter_x = -lc/la; @@ -610,7 +613,7 @@ public: Algebraic x1 = y_mid_x_points[0].x(), x2 = y_mid_x_points[1].x(); if (CGAL_NTS compare( Algebraic(la)*x1 + Algebraic(lb)*y_mid + Algebraic(lc), - 0) == LARGER) + Algebraic(0)) == LARGER) { pmid = Alg_point_2(x1, y_mid); } @@ -618,8 +621,8 @@ public: { CGAL_assertion(CGAL_NTS compare ( Algebraic(la)*x2 + Algebraic(lb)*y_mid + Algebraic(lc), - 0) == LARGER); - pmid = Alg_point_2(x2, y_mid); + Algebraic(0)) == LARGER); + pmid = Alg_point_2(x2, Algebraic(y_mid)); } } } diff --git a/Envelope_3/include/CGAL/Env_triangle_traits_3.h b/Envelope_3/include/CGAL/Env_triangle_traits_3.h index d4b3978dcf5..17cf063cc6d 100644 --- a/Envelope_3/include/CGAL/Env_triangle_traits_3.h +++ b/Envelope_3/include/CGAL/Env_triangle_traits_3.h @@ -46,12 +46,12 @@ public: typedef Arr_segment_traits_2 Traits_2; typedef typename Traits_2::Point_2 Point_2; typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2; + typedef typename Traits_2::Multiplicity Multiplicity; typedef Kernel_ Kernel; typedef Env_triangle_traits_3 Self; typedef typename Kernel::Point_3 Point_3; - typedef unsigned int Multiplicity; /*! * \class Representation of a 3d triangle with cached data. diff --git a/Filtered_kernel/dont_submit b/Filtered_kernel/dont_submit index ab973d00ed1..4235b37d5e9 100644 --- a/Filtered_kernel/dont_submit +++ b/Filtered_kernel/dont_submit @@ -1,3 +1,3 @@ TODO_static_filters Makefile -lazykernel.cpp + diff --git a/Filtered_kernel/examples/Filtered_kernel/lazykernel.cpp b/Filtered_kernel/examples/Filtered_kernel/lazykernel.cpp deleted file mode 100644 index 739575ffc14..00000000000 --- a/Filtered_kernel/examples/Filtered_kernel/lazykernel.cpp +++ /dev/null @@ -1,117 +0,0 @@ -#define CGAL_INTERSECT_WITH_ITERATORS_2 1 -#include -#include -#include -#include -#include -#include "Cartesian_I.h" - - -typedef CGAL::Cartesian_I SC; -typedef CGAL::Lazy_kernel > K; - -typedef K::FT FT; -typedef K::Point_2 Point_2; -typedef K::Vector_2 Vector_2; -typedef K::Segment_2 Segment_2; -typedef K::Circle_2 Circle_2; - -typedef CGAL::Bbox_2 Bbox_2; -typedef CGAL::Object Object; - - -int main() -{ - CGAL::Lazy_exact_nt nt = 1; - nt = nt + nt * nt; - - K::Intersect_with_iterators_2 iwi; - - CGAL::set_pretty_mode(std::cout); - K::Intersect_with_iterators_2 intersect; - - Segment_2 s1(Point_2(0,1), Point_2(2,1)); - Segment_2 s2(Point_2(1,0), Point_2(1,2)); - - std::list intersections; - intersect(s1, s2, std::back_inserter(intersections)); - for(std::list::iterator it = intersections.begin(); it != intersections.end(); it++){ - if(const Point_2 *ip = CGAL::object_cast(&*it)){ - std::cout << "intersection at " << *ip << std::endl; - } - } - - FT ft = 3.1415; - std::cout << "ft = " << ft << std::endl; - - ft *= ft; - std::cout << "ft^2 = " << ft << std::endl; - std::cout << "ft^2.depth() = " << ft.depth() << std::endl; - std::cout << "ft^2.exact() = " << ft.exact() << std::endl; - Point_2 p(ft, 2.22); - Point_2 q(9,9); - - CGAL::Bbox_2 bb = p.bbox(); - - Segment_2 s(p,q); - - Segment_2 s3(Point_2(0,1), Point_2(2,1)); - Segment_2 s4(Point_2(1,0), Point_2(1,2)); - - CGAL::Object o = intersection(s3,s4); - - if(const Point_2 *rp = CGAL::object_cast(&o)){ - std::cout << "Intersection is a point:" << std::endl; - std::cout << *rp; - } - - - Point_2 r = K::Construct_vertex_2()(s,0); - assert(r == s.source()); - std::cout << r << std::endl; - - - Point_2 mp = midpoint(p,q); - - - FT rx = r.x(); - - std::cout << rx << std::endl; - - - Vector_2 v1(1,1), v2(1,1); - - v1 = p - q; - - v1 = mp - CGAL::ORIGIN; - - q = CGAL::ORIGIN + v1; - - std::cout << q << std::endl; - - if(v1 == v2){} - - if(K::Compare_distance_2()(p,q,r)== CGAL::SMALLER) - { - std::cout << "smaller" << std::endl; - } - - Circle_2 circ(CGAL::ORIGIN, p, q); - std::cout << "\nCircle:\n " << circ << std::endl; - - Point_2 center = circ.center(); - FT sr = circ.squared_radius(); - std::cout << "\nCenter = " << center << "\nSquared radius = " << sr << std::endl; - - sr += 7812; - std::cout << "squared radius + 7812 = " << sr << std::endl; - - - circ.exact(); - std::cout << "\nCircle after circ.exaxt():\n " << circ << std::endl; - std::cout << "\nCenter = " << center << "\nSquared radius = " << sr << std::endl; - - std::cout << "Done" << std::endl; - - return 0; -} diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 86ac1f0018e..c41589af468 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -38,6 +38,16 @@ # include #endif +#include + +#include +#include +#include +#include +#include +#include + + namespace CGAL { template class Lazy; @@ -98,7 +108,7 @@ CGAL_LAZY_FORWARD(Orientation) CGAL_LAZY_FORWARD(Bbox_2) CGAL_LAZY_FORWARD(Bbox_3) - +#undef CGAL_LAZY_FORWARD #ifdef CGAL_LAZY_KERNEL_DEBUG template @@ -208,10 +218,10 @@ public: mutable ET *et; Lazy_rep () - : at(), et(NULL) {} + : at(), et(NULL){} Lazy_rep (const AT& a) - : at(a), et(NULL) {} + : at(a), et(NULL){} Lazy_rep (const AT& a, const ET& e) : at(a), et(new ET(e)) {} @@ -270,7 +280,6 @@ public: //____________________________________________________________ // The rep for the leaf node -// FIXME TODO : Factorize all the Lazy_rep_[0-8] !!! template class Lazy_rep_0 : public Lazy_rep @@ -304,16 +313,25 @@ public: } }; +// Macro helpers to build the kernel objects +#define CGAL_TYPEMAP_AC(z, n, t) typedef typename Type_mapper< t##n, LK, AK >::type A##n; +#define CGAL_TYPEMAP_EC(z, n, t) typedef typename Type_mapper< t##n, LK, EK >::type E##n; +#define CGAL_LEXACT(z,n,t) CGAL::exact( l##n ) +#define CGAL_LARGS(z, n, t) L##n const& l##n + +#define CGAL_TMAP(z, n, d) typename Type_mapper< L##n, d##K, LK >::type +#define CGAL_PRUNE_TREE(z, n, d) l##n = L##n (); +#define CGAL_LINIT(z, n, d) l##n(l##n) +#define CGAL_LN(z, n, d) d(l##n) +#define CGAL_MLIST(z, n, d) mutable L##n l##n; //____________________________________________________________ -template +template class Lazy_rep_1 - : public Lazy_rep + : public Lazy_rep , private EC { - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; typedef Lazy_rep Base; mutable L1 l1_; @@ -351,485 +369,34 @@ public: }; - -//____________________________________________________________ - -template -class Lazy_rep_2 - : public Lazy_rep - , private EC -{ - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_rep Base; - - mutable L1 l1_; - mutable L2 l2_; - - const EC& ec() const { return *this; } - -public: - - void - update_exact() const - { - this->et = new ET(ec()(CGAL::exact(l1_), CGAL::exact(l2_))); - this->at = E2A()(*(this->et)); - // Prune lazy tree - l1_ = L1(); - l2_ = L2(); - } - - Lazy_rep_2(const AC& ac, const EC& /*ec*/, const L1& l1, const L2& l2) - : Lazy_rep(ac(CGAL::approx(l1), CGAL::approx(l2))), - l1_(l1), l2_(l2) - { - this->set_depth(max_n(CGAL::depth(l1_), CGAL::depth(l2_)) + 1); - } - -#ifdef CGAL_LAZY_KERNEL_DEBUG - void - print_dag(std::ostream& os, int level) const - { - this->print_at_et(os, level); - if(this->is_lazy()){ - CGAL::msg(os, level, "DAG with two child nodes:"); - CGAL::print_dag(l1_, os, level+1); - CGAL::print_dag(l2_, os, level+1); - } - } -#endif +#define CGAL_LAZY_REP(z, n, d) \ + template< typename AT, typename ET, typename AC, typename EC, typename E2A, BOOST_PP_ENUM_PARAMS(n, typename L)> \ +class Lazy_rep_##n :public Lazy_rep< AT, \ + ET, \ + E2A >, \ + private EC \ +{ \ + BOOST_PP_REPEAT(n, CGAL_MLIST, _) \ + const EC& ec() const { return *this; } \ +public: \ + void update_exact() const { \ + this->et = new ET(ec()( BOOST_PP_ENUM(n, CGAL_LEXACT, _) ) ); \ + this->at = E2A()(*(this->et)); \ + BOOST_PP_REPEAT(n, CGAL_PRUNE_TREE, _) \ + } \ + Lazy_rep_##n(const AC& ac, const EC&, BOOST_PP_ENUM(n, CGAL_LARGS, _)) \ + : Lazy_rep(ac( BOOST_PP_ENUM(n, CGAL_LN, CGAL::approx) )), BOOST_PP_ENUM(n, CGAL_LINIT, _) \ + { this->set_depth(max_n( BOOST_PP_ENUM(n, CGAL_LN, CGAL::depth) ) + 1); } \ }; +BOOST_PP_REPEAT_FROM_TO(2, 9, CGAL_LAZY_REP, _) -//____________________________________________________________ - -template -class Lazy_rep_3 - : public Lazy_rep - , private EC -{ - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_rep Base; - - mutable L1 l1_; - mutable L2 l2_; - mutable L3 l3_; - - const EC& ec() const { return *this; } - -public: - - void - update_exact() const - { - this->et = new ET(ec()(CGAL::exact(l1_), CGAL::exact(l2_), - CGAL::exact(l3_))); - this->at = E2A()(*(this->et)); - // Prune lazy tree - l1_ = L1(); - l2_ = L2(); - l3_ = L3(); - } - - Lazy_rep_3(const AC& ac, const EC& /*ec*/, - const L1& l1, const L2& l2, const L3& l3) - : Lazy_rep(ac(CGAL::approx(l1), CGAL::approx(l2), - CGAL::approx(l3))), - l1_(l1), l2_(l2), l3_(l3) - { - this->set_depth(max_n(CGAL::depth(l1_), - CGAL::depth(l2_), - CGAL::depth(l3_)) + 1); - } - -#ifdef CGAL_LAZY_KERNEL_DEBUG - void - print_dag(std::ostream& os, int level) const - { - this->print_at_et(os, level); - if(this->is_lazy()){ - CGAL::msg(os, level, "DAG with three child nodes:"); - CGAL::print_dag(l1_, os, level+1); - CGAL::print_dag(l2_, os, level+1); - CGAL::print_dag(l3_, os, level+1); - } - } -#endif -}; - - -//____________________________________________________________ - -template -class Lazy_rep_4 - : public Lazy_rep - , private EC -{ - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_rep Base; - - mutable L1 l1_; - mutable L2 l2_; - mutable L3 l3_; - mutable L4 l4_; - - const EC& ec() const { return *this; } - -public: - - void - update_exact() const - { - this->et = new ET(ec()(CGAL::exact(l1_), CGAL::exact(l2_), - CGAL::exact(l3_), CGAL::exact(l4_))); - this->at = E2A()(*(this->et)); - // Prune lazy tree - l1_ = L1(); - l2_ = L2(); - l3_ = L3(); - l4_ = L4(); - } - - Lazy_rep_4(const AC& ac, const EC& /*ec*/, - const L1& l1, const L2& l2, const L3& l3, const L4& l4) - : Lazy_rep(ac(CGAL::approx(l1), CGAL::approx(l2), - CGAL::approx(l3), CGAL::approx(l4))), - l1_(l1), l2_(l2), l3_(l3), l4_(l4) - { - this->set_depth(max_n(CGAL::depth(l1_), - CGAL::depth(l2_), - CGAL::depth(l3_), - CGAL::depth(l4_)) + 1); - } - -#ifdef CGAL_LAZY_KERNEL_DEBUG - void - print_dag(std::ostream& os, int level) const - { - this->print_at_et(os, level); - - if(this->is_lazy()){ - CGAL::msg(os, level, "DAG with four child nodes:"); - CGAL::print_dag(l1_, os, level+1); - CGAL::print_dag(l2_, os, level+1); - CGAL::print_dag(l3_, os, level+1); - CGAL::print_dag(l4_, os, level+1); - } - } -#endif -}; - -//____________________________________________________________ - - -template -class Lazy_rep_5 - : public Lazy_rep - , private EC -{ - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_rep Base; - - mutable L1 l1_; - mutable L2 l2_; - mutable L3 l3_; - mutable L4 l4_; - mutable L5 l5_; - - const EC& ec() const { return *this; } - -public: - - void - update_exact() const - { - this->et = new ET(ec()(CGAL::exact(l1_), CGAL::exact(l2_), - CGAL::exact(l3_), CGAL::exact(l4_), - CGAL::exact(l5_))); - this->at = E2A()(*(this->et)); - // Prune lazy tree - l1_ = L1(); - l2_ = L2(); - l3_ = L3(); - l4_ = L4(); - l5_ = L5(); - } - - Lazy_rep_5(const AC& ac, const EC& /*ec*/, - const L1& l1, const L2& l2, const L3& l3, const L4& l4, - const L5& l5) - : Lazy_rep(ac(CGAL::approx(l1), CGAL::approx(l2), - CGAL::approx(l3), CGAL::approx(l4), - CGAL::approx(l5))), - l1_(l1), l2_(l2), l3_(l3), l4_(l4), l5_(l5) - { - this->set_depth(max_n(CGAL::depth(l1_), - CGAL::depth(l2_), - CGAL::depth(l3_), - CGAL::depth(l4_), - CGAL::depth(l5_)) + 1); - } - -#ifdef CGAL_LAZY_KERNEL_DEBUG - void - print_dag(std::ostream& os, int level) const - { - this->print_at_et(os, level); - - if(this->is_lazy()){ - CGAL::msg(os, level, "DAG with five child nodes:"); - CGAL::print_dag(l1_, os, level+1); - CGAL::print_dag(l2_, os, level+1); - CGAL::print_dag(l3_, os, level+1); - CGAL::print_dag(l4_, os, level+1); - CGAL::print_dag(l5_, os, level+1); - } - } -#endif -}; - -template -class Lazy_rep_6 - : public Lazy_rep - , private EC -{ - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_rep Base; - - mutable L1 l1_; - mutable L2 l2_; - mutable L3 l3_; - mutable L4 l4_; - mutable L5 l5_; - mutable L6 l6_; - - const EC& ec() const { return *this; } - -public: - - void - update_exact() const - { - this->et = new ET(ec()(CGAL::exact(l1_), CGAL::exact(l2_), - CGAL::exact(l3_), CGAL::exact(l4_), - CGAL::exact(l5_), CGAL::exact(l6_))); - this->at = E2A()(*(this->et)); - // Prune lazy tree - l1_ = L1(); - l2_ = L2(); - l3_ = L3(); - l4_ = L4(); - l5_ = L5(); - l6_ = L6(); - } - - Lazy_rep_6(const AC& ac, const EC& /*ec*/, - const L1& l1, const L2& l2, const L3& l3, const L4& l4, - const L5& l5, const L6& l6) - : Lazy_rep(ac(CGAL::approx(l1), CGAL::approx(l2), - CGAL::approx(l3), CGAL::approx(l4), - CGAL::approx(l5), CGAL::approx(l6))), - l1_(l1), l2_(l2), l3_(l3), l4_(l4), l5_(l5), l6_(l6) - { - this->set_depth(max_n(CGAL::depth(l1_), - CGAL::depth(l2_), - CGAL::depth(l3_), - CGAL::depth(l4_), - CGAL::depth(l5_), - CGAL::depth(l6_)) + 1); - } - -#ifdef CGAL_LAZY_KERNEL_DEBUG - void - print_dag(std::ostream& os, int level) const - { - this->print_at_et(os, level); - - if(this->is_lazy()){ - CGAL::msg(os, level, "DAG with 6 child nodes:"); - CGAL::print_dag(l1_, os, level+1); - CGAL::print_dag(l2_, os, level+1); - CGAL::print_dag(l3_, os, level+1); - CGAL::print_dag(l4_, os, level+1); - CGAL::print_dag(l5_, os, level+1); - CGAL::print_dag(l6_, os, level+1); - } - } -#endif -}; - -template -class Lazy_rep_7 - : public Lazy_rep - , private EC -{ - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_rep Base; - - mutable L1 l1_; - mutable L2 l2_; - mutable L3 l3_; - mutable L4 l4_; - mutable L5 l5_; - mutable L6 l6_; - mutable L7 l7_; - - const EC& ec() const { return *this; } - -public: - - void - update_exact() const - { - this->et = new ET(ec()(CGAL::exact(l1_), CGAL::exact(l2_), - CGAL::exact(l3_), CGAL::exact(l4_), - CGAL::exact(l5_), CGAL::exact(l6_), - CGAL::exact(l7_))); - this->at = E2A()(*(this->et)); - // Prune lazy tree - l1_ = L1(); - l2_ = L2(); - l3_ = L3(); - l4_ = L4(); - l5_ = L5(); - l6_ = L6(); - l7_ = L7(); - } - - Lazy_rep_7(const AC& ac, const EC& /*ec*/, - const L1& l1, const L2& l2, const L3& l3, const L4& l4, - const L5& l5, const L6& l6, const L7& l7) - : Lazy_rep(ac(CGAL::approx(l1), CGAL::approx(l2), - CGAL::approx(l3), CGAL::approx(l4), - CGAL::approx(l5), CGAL::approx(l6), - CGAL::approx(l7))), - l1_(l1), l2_(l2), l3_(l3), l4_(l4), l5_(l5), l6_(l6), l7_(l7) - { - this->set_depth(max_n(CGAL::depth(l1_), - CGAL::depth(l2_), - CGAL::depth(l3_), - CGAL::depth(l4_), - CGAL::depth(l5_), - CGAL::depth(l6_), - CGAL::depth(l7_)) + 1); - } - -#ifdef CGAL_LAZY_KERNEL_DEBUG - void - print_dag(std::ostream& os, int level) const - { - this->print_at_et(os, level); - - if(this->is_lazy()){ - CGAL::msg(os, level, "DAG with 7 child nodes:"); - CGAL::print_dag(l1_, os, level+1); - CGAL::print_dag(l2_, os, level+1); - CGAL::print_dag(l3_, os, level+1); - CGAL::print_dag(l4_, os, level+1); - CGAL::print_dag(l5_, os, level+1); - CGAL::print_dag(l6_, os, level+1); - CGAL::print_dag(l7_, os, level+1); - } - } -#endif -}; - -template -class Lazy_rep_8 - : public Lazy_rep - , private EC -{ - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_rep Base; - - mutable L1 l1_; - mutable L2 l2_; - mutable L3 l3_; - mutable L4 l4_; - mutable L5 l5_; - mutable L6 l6_; - mutable L7 l7_; - mutable L8 l8_; - - const EC& ec() const { return *this; } - -public: - - void - update_exact() const - { - this->et = new ET(ec()(CGAL::exact(l1_), CGAL::exact(l2_), - CGAL::exact(l3_), CGAL::exact(l4_), - CGAL::exact(l5_), CGAL::exact(l6_), - CGAL::exact(l7_), CGAL::exact(l8_))); - this->at = E2A()(*(this->et)); - // Prune lazy tree - l1_ = L1(); - l2_ = L2(); - l3_ = L3(); - l4_ = L4(); - l5_ = L5(); - l6_ = L6(); - l7_ = L7(); - l8_ = L8(); - } - - Lazy_rep_8(const AC& ac, const EC& /*ec*/, - const L1& l1, const L2& l2, const L3& l3, const L4& l4, - const L5& l5, const L6& l6, const L7& l7, const L8& l8) - : Lazy_rep(ac(CGAL::approx(l1), CGAL::approx(l2), - CGAL::approx(l3), CGAL::approx(l4), - CGAL::approx(l5), CGAL::approx(l6), - CGAL::approx(l7), CGAL::approx(l8))), - l1_(l1), l2_(l2), l3_(l3), l4_(l4), l5_(l5), l6_(l6), l7_(l7), l8_(l8) - { - this->set_depth(max_n(CGAL::depth(l1_), - CGAL::depth(l2_), - CGAL::depth(l3_), - CGAL::depth(l4_), - CGAL::depth(l5_), - CGAL::depth(l6_), - CGAL::depth(l7_), - CGAL::depth(l8_)) + 1); - } - -#ifdef CGAL_LAZY_KERNEL_DEBUG - void - print_dag(std::ostream& os, int level) const - { - this->print_at_et(os, level); - - if(this->is_lazy()){ - CGAL::msg(os, level, "DAG with 8 child nodes:"); - CGAL::print_dag(l1_, os, level+1); - CGAL::print_dag(l2_, os, level+1); - CGAL::print_dag(l3_, os, level+1); - CGAL::print_dag(l4_, os, level+1); - CGAL::print_dag(l5_, os, level+1); - CGAL::print_dag(l6_, os, level+1); - CGAL::print_dag(l7_, os, level+1); - CGAL::print_dag(l8_, os, level+1); - } - } -#endif -}; - +#undef CGAL_TMAP +#undef CGAL_PRUNE_TREE +#undef CGAL_LINIT +#undef CGAL_LAZY_REP +#undef CGAL_LN +#undef CGAL_MLIST template < typename K1, typename K2 > struct Approx_converter @@ -1184,10 +751,6 @@ private: Self_rep * ptr() const { return (Self_rep*) PTR; } }; - - - - // The magic functor for Construct_bbox_[2,3], as there is no Lazy template @@ -1217,6 +780,7 @@ struct Lazy_construction_bbox } }; + template struct Lazy_construction_nt { @@ -1225,82 +789,49 @@ struct Lazy_construction_nt { typedef typename LK::Approximate_kernel AK; typedef typename LK::Exact_kernel EK; typedef typename LK::E2A E2A; - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy_exact_nt result_type; AC ac; EC ec; - template - result_type operator()(const L1& l1) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return new Lazy_rep_1, L1>(ac, ec, l1); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return new Lazy_rep_0 >(ec(CGAL::exact(l1))); - } - } + template + struct result { }; - template - result_type operator()(const L1& l1, const L2& l2) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return new Lazy_rep_2, L1,L2>(ac, ec, l1,l2); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2))); - } - } +#define CGAL_RESULT_NT(z, n, d) \ + template< typename F, BOOST_PP_ENUM_PARAMS(n, class T) > \ + struct result { \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_EC, T) \ + typedef Lazy_exact_nt< \ + typename boost::remove_cv< typename boost::remove_reference < \ + typename boost::result_of::type >::type >::type > type; \ + }; - template - result_type operator()(const L1& l1, const L2& l2, const L3& l3) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return new Lazy_rep_3, L1,L2,L3>(ac, ec, l1,l2,l3); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3))); - } - } + BOOST_PP_REPEAT_FROM_TO(1, 6, CGAL_RESULT_NT, _) - template - result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return new Lazy_rep_4, L1,L2,L3,L4>(ac, ec, l1,l2,l3,l4); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4))); - } - } +#define CGAL_NT_OPERATOR(z, n, d) \ + template \ + typename boost::result_of::type \ + operator()( BOOST_PP_ENUM(n, CGAL_LARGS, _) ) const { \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_EC, L) \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_AC, L) \ + typedef typename boost::remove_cv< typename boost::remove_reference < \ + typename boost::result_of< EC(BOOST_PP_ENUM_PARAMS(n, E)) >::type >::type >::type ET; \ + typedef typename boost::remove_cv< typename boost::remove_reference < \ + typename boost::result_of< AC(BOOST_PP_ENUM_PARAMS(n, A)) >::type >::type >::type AT; \ + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \ + Protect_FPU_rounding P; \ + try { \ + return new Lazy_rep_##n, BOOST_PP_ENUM_PARAMS(n, L) >(ac, ec, BOOST_PP_ENUM_PARAMS(n, l)); \ + } catch (Uncertain_conversion_exception) { \ + CGAL_BRANCH_PROFILER_BRANCH(tmp); \ + Protect_FPU_rounding P2(CGAL_FE_TONEAREST); \ + return new Lazy_rep_0 >(ec( BOOST_PP_ENUM(n, CGAL_LEXACT, _) )); \ + } \ + } \ - template - result_type operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return new Lazy_rep_5, L1,L2,L3,L4,L5>(ac, ec, l1,l2,l3,l4,l5); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return new Lazy_rep_0 >(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5))); - } - } + BOOST_PP_REPEAT_FROM_TO(1, 6, CGAL_NT_OPERATOR, _) + +#undef INTERVAL_OPERATOR +#undef CGAL_RESULT_NT }; @@ -1558,8 +1089,8 @@ public: typedef Lazy, std::pair, EFT, E2A> Lazy_pair; Lazy_pair lv(new Lazy_rep_2_2(ac, ec, l1, l2)); // lv->approx() is a std::pair; - r1 = R1(Handle_1(new Lazy_rep_1 >, First >, E2A, Lazy_pair>(First >(), First >(), lv))); - r2 = R2(Handle_2(new Lazy_rep_1 >, Second >, E2A, Lazy_pair>(Second >(), Second >(), lv))); + r1 = R1(Handle_1(new Lazy_rep_1 >, First >, E2A, Lazy_pair>(First >(), First >(), lv))); + r2 = R2(Handle_2(new Lazy_rep_1 >, Second >, E2A, Lazy_pair>(Second >(), Second >(), lv))); } catch (Uncertain_conversion_exception) { CGAL_BRANCH_PROFILER_BRANCH(tmp); Protect_FPU_rounding P2(CGAL_FE_TONEAREST); @@ -1606,7 +1137,7 @@ public: for (unsigned int i = 0; i < lv.approx().size(); i++) { // FIXME : I'm not sure how this work... #define CGAL_Kernel_obj(X) if (object_cast(& (lv.approx()[i]))) { \ - *it++ = make_object(typename LK::X(new Lazy_rep_1, \ + *it++ = make_object(typename LK::X(new Lazy_rep_1, \ Ith, E2A, Lazy_vector> \ (Ith(i), Ith(i), lv))); \ continue; \ @@ -1679,14 +1210,14 @@ public: CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Protect_FPU_rounding P; try { - Lazy_object lo(new Lazy_rep_1(ac, ec, l1)); + Lazy_object lo(new Lazy_rep_1(ac, ec, l1)); if(lo.approx().is_empty()) return Object(); #define CGAL_Kernel_obj(X) \ if (object_cast(& (lo.approx()))) { \ - typedef Lazy_rep_1, Object_cast, E2A, Lazy_object> Lcr; \ + typedef Lazy_rep_1< typename AK::X, typename EK::X, Object_cast, Object_cast, E2A, Lazy_object> Lcr; \ Lcr * lcr = new Lcr(Object_cast(), Object_cast(), lo); \ return make_object(typename LK::X(lcr)); \ } @@ -1712,14 +1243,14 @@ public: CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Protect_FPU_rounding P; try { - Lazy_object lo(new Lazy_rep_2(ac, ec, l1, l2)); + Lazy_object lo(new Lazy_rep_2(ac, ec, l1, l2)); if(lo.approx().is_empty()) return Object(); #define CGAL_Kernel_obj(X) \ if (object_cast(& (lo.approx()))) { \ - typedef Lazy_rep_1, Object_cast, E2A, Lazy_object> Lcr; \ + typedef Lazy_rep_1, Object_cast, E2A, Lazy_object> Lcr; \ Lcr * lcr = new Lcr(Object_cast(), Object_cast(), lo); \ return make_object(typename LK::X(lcr)); \ } @@ -1735,8 +1266,8 @@ public: std::vector V;\ V.resize(v_ptr->size()); \ for (unsigned int i = 0; i < v_ptr->size(); i++) { \ - V[i] = typename LK::X(new Lazy_rep_1, \ - Ith_for_intersection, E2A, Lazy_object> \ + V[i] = typename LK::X(new Lazy_rep_1, \ + Ith_for_intersection, E2A, Lazy_object> \ (Ith_for_intersection(i), Ith_for_intersection(i), lo)); \ } \ return make_object(V); \ @@ -1766,14 +1297,14 @@ CGAL_Kernel_obj(Point_3) CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); Protect_FPU_rounding P; try { - Lazy_object lo(new Lazy_rep_3(ac, ec, l1, l2, l3)); + Lazy_object lo(new Lazy_rep_3(ac, ec, l1, l2, l3)); if(lo.approx().is_empty()) return Object(); #define CGAL_Kernel_obj(X) \ if (object_cast(& (lo.approx()))) { \ - typedef Lazy_rep_1, Object_cast, E2A, Lazy_object> Lcr; \ + typedef Lazy_rep_1, Object_cast, E2A, Lazy_object> Lcr; \ Lcr * lcr = new Lcr(Object_cast(), Object_cast(), lo); \ return make_object(typename LK::X(lcr)); \ } @@ -1797,10 +1328,75 @@ CGAL_Kernel_obj(Point_3) //____________________________________________________________ -// The magic functor that has Lazy as result type +// The magic functor that has Lazy as result type. +// Two versions are distinguished: one that needs to fiddle +// with result_of and another that can forward the result types. -template -struct Lazy_construction +namespace internal { + BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type) +} + +template::value && internal::has_result_type::value > +struct Lazy_construction; + + +// we have a result type, low effort +template +struct Lazy_construction { + static const bool Protection = true; + + typedef typename LK::Approximate_kernel AK; + typedef typename LK::Exact_kernel EK; + typedef typename boost::remove_cv< + typename boost::remove_reference < typename AC::result_type >::type >::type AT; + typedef typename boost::remove_cv< + typename boost::remove_reference < typename EC::result_type >::type >::type ET; + + typedef typename EK::FT EFT; + typedef typename Default::Get::type E2A; + + typedef typename Type_mapper::type result_type; + + AC ac; + EC ec; + +#define CGAL_CONSTRUCTION_OPERATOR(z, n, d ) \ + template \ + result_type \ + operator()( BOOST_PP_ENUM(n, CGAL_LARGS, _) ) const { \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_EC, L) \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_AC, L) \ + typedef Lazy< AT, ET, EFT, E2A> Handle; \ + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \ + Protect_FPU_rounding P; \ + try { \ + return result_type( Handle(new Lazy_rep_##n(ac, ec, BOOST_PP_ENUM_PARAMS(n, l)))); \ + } catch (Uncertain_conversion_exception) { \ + CGAL_BRANCH_PROFILER_BRANCH(tmp); \ + Protect_FPU_rounding P2(CGAL_FE_TONEAREST); \ + return result_type( Handle(new Lazy_rep_0(ec( BOOST_PP_ENUM(n, CGAL_LEXACT, _) ))) ); \ + } \ + } + + // arity 1-8 + BOOST_PP_REPEAT_FROM_TO(1, 9, CGAL_CONSTRUCTION_OPERATOR, _) + + // nullary + result_type + operator()() const + { + typedef Lazy Handle; + return result_type( Handle(new Lazy_rep_0()) ); + } + +#undef CGAL_CONSTRUCTION_OPERATOR + +}; + + +template +struct Lazy_construction { static const bool Protection = true; @@ -1808,144 +1404,71 @@ struct Lazy_construction typedef typename LK::Exact_kernel EK; typedef typename EK::FT EFT; typedef typename Default::Get::type E2A; - typedef typename AC::result_type AT; - typedef typename EC::result_type ET; - typedef Lazy Handle; - typedef typename Type_mapper::type result_type; + + template + struct result { + // this does not default, if you want to make a lazy lazy-kernel, + // you are on your own + }; AC ac; EC ec; -public: + // acquire the result_type of the approximate kernel, map it back to the lazy kernel object +#define CGAL_RESULT(z, n, d) \ +template< typename F, BOOST_PP_ENUM_PARAMS(n, class T) > \ +struct result { \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_AC, T) \ + typedef typename Type_mapper< typename boost::result_of::type, AK, LK>::type type; \ +}; - result_type + BOOST_PP_REPEAT_FROM_TO(1, 9, CGAL_RESULT, _) + +#define CGAL_CONSTRUCTION_OPERATOR(z, n, d) \ + template \ + typename boost::result_of::type \ + operator()( BOOST_PP_ENUM(n, CGAL_LARGS, _) ) { \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_EC, L) \ + BOOST_PP_REPEAT(n, CGAL_TYPEMAP_AC, L) \ + typedef typename boost::remove_cv< typename boost::remove_reference < \ + typename boost::result_of< EC(BOOST_PP_ENUM_PARAMS(n, E)) >::type >::type >::type ET; \ + typedef typename boost::remove_cv< typename boost::remove_reference < \ + typename boost::result_of< AC(BOOST_PP_ENUM_PARAMS(n, A)) >::type >::type >::type AT; \ + typedef Lazy< AT, ET, EFT, E2A> Handle; \ + typedef typename boost::result_of::type result_type; \ + CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \ + Protect_FPU_rounding P; \ + try { \ + return result_type( Handle(new Lazy_rep_##n(ac, ec, BOOST_PP_ENUM_PARAMS(n, l)))); \ + } catch (Uncertain_conversion_exception) { \ + CGAL_BRANCH_PROFILER_BRANCH(tmp); \ + Protect_FPU_rounding P2(CGAL_FE_TONEAREST); \ + return result_type( Handle(new Lazy_rep_0(ec( BOOST_PP_ENUM(n, CGAL_LEXACT, _) ))) ); \ + } \ + } + + // arity 1-8 + BOOST_PP_REPEAT_FROM_TO(1, 9, CGAL_CONSTRUCTION_OPERATOR, _) + + // nullary + typename Type_mapper< typename boost::result_of::type ,AK, LK>::type operator()() const { + typedef typename boost::result_of::type AT; + typedef typename boost::result_of::type ET; + typedef Lazy Handle; + typedef typename Type_mapper< typename boost::result_of::type ,AK, LK>::type result_type; + return result_type( Handle(new Lazy_rep_0()) ); } - - template - result_type - operator()(const L1& l1) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_1(ac, ec, l1)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1)))) ); - } - } - - template - result_type - operator()(const L1& l1, const L2& l2) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_2(ac, ec, l1, l2)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2)))) ); - } - } - - template - result_type - operator()(const L1& l1, const L2& l2, const L3& l3) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_3(ac, ec, l1, l2, l3)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3)))) ); - } - } - - template - result_type - operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_4(ac, ec, l1, l2, l3, l4)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4)))) ); - } - } - - template - result_type - operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_5(ac, ec, l1, l2, l3, l4, l5)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5)))) ); - } - } - - template - result_type - operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5, const L6& l6) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_6(ac, ec, l1, l2, l3, l4, l5, l6)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5), CGAL::exact(l6)))) ); - } - } - - template - result_type - operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5, const L6& l6, const L7& l7) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_7(ac, ec, l1, l2, l3, l4, l5, l6, l7)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5), CGAL::exact(l6), CGAL::exact(l7)))) ); - } - } - - template - result_type - operator()(const L1& l1, const L2& l2, const L3& l3, const L4& l4, const L5& l5, const L6& l6, const L7& l7, const L8& l8) const - { - CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); - Protect_FPU_rounding P; - try { - return result_type( Handle(new Lazy_rep_8(ac, ec, l1, l2, l3, l4, l5, l6, l7, l8)) ); - } catch (Uncertain_conversion_exception) { - CGAL_BRANCH_PROFILER_BRANCH(tmp); - Protect_FPU_rounding P2(CGAL_FE_TONEAREST); - return result_type( Handle(new Lazy_rep_0(ec(CGAL::exact(l1), CGAL::exact(l2), CGAL::exact(l3), CGAL::exact(l4), CGAL::exact(l5), CGAL::exact(l6), CGAL::exact(l7), CGAL::exact(l8)))) ); - } - } - }; } //namespace CGAL +#undef CGAL_TYPEMAP_AC +#undef CGAL_TYPEMAP_EC +#undef CGAL_LEXACT +#undef CGAL_LARGS + + #endif // CGAL_LAZY_H diff --git a/Filtered_kernel/include/CGAL/Lazy_kernel.h b/Filtered_kernel/include/CGAL/Lazy_kernel.h index aab2d57d2cd..b18fc340d01 100644 --- a/Filtered_kernel/include/CGAL/Lazy_kernel.h +++ b/Filtered_kernel/include/CGAL/Lazy_kernel.h @@ -31,10 +31,70 @@ #include #include #include + #include +#include +#include + namespace CGAL { +namespace internal { + +// SFINAE way to detect result_type typedefs. +template +class Has_result_type_helper +{ + typedef char one; + typedef struct { char arr[2]; } two; + + template + struct Wrapper {}; + + template + static one test(Wrapper*); + + template + static two test(...); + +public: + static const bool value = sizeof(test(0)) == 1; +}; + +template +struct Has_result_type + : boost::integral_constant< bool, + Has_result_type_helper< typename boost::remove_cv::type>::value> +{}; + +template +struct Maybe_result_type { + // This is incredibly evil. It relies on the fact that we always + // have a type in the primary result template but it looks like the + // only way out given the current design. + typedef typename F::template result::type type; +}; + +template +struct Maybe_result_type { + typedef typename F::result_type type; +}; + +// goes through the standard process of selecting the right +// Lazy_something after the kind of the return type has been +// determined +template +struct Standard_pick { + typedef typename boost::remove_cv< typename boost::remove_reference< typename T::type >::type >::type T_; + typedef typename boost::mpl::if_< boost::is_same< T_, typename AK::FT >, + Lazy_construction_nt, + typename boost::mpl::if_< boost::is_same< T_, Object >, + Lazy_construction_object, + Lazy_construction >::type + >::type type; +}; +} // internal + // Exact_kernel = exact kernel that will be made lazy // Kernel = lazy kernel @@ -46,6 +106,7 @@ class Lazy_kernel_generic_base // TODO : Static_filters_base too ? Check performance { public: + typedef AK_ Approximate_kernel; typedef EK_ Exact_kernel; typedef E2A_ E2A; @@ -128,7 +189,6 @@ public: typedef Filtered_predicate P; \ P Pf() const { return P(); } - // We change the constructions. #ifdef CGAL_INTERSECT_WITH_ITERATORS_2 #define CGAL_Kernel_cons(C, Cf) \ @@ -147,18 +207,15 @@ public: intersect_with_iterators_2_object) #else #define CGAL_Kernel_cons(C, Cf) \ - typedef typename boost::mpl::if_< boost::is_same,\ - Lazy_construction_nt,\ - typename boost::mpl::if_,\ - Lazy_construction_object,\ - Lazy_construction >::type >::type C; \ - C Cf() const { return C(); } + typedef typename internal::Standard_pick< internal::Maybe_result_type< internal::Has_result_type< typename Approximate_kernel::C >::value, \ + typename Approximate_kernel::C >, \ + Approximate_kernel, Exact_kernel, Kernel, typename Approximate_kernel::C, typename Exact_kernel::C \ + >::type C; \ + C Cf() const { return C(); } #endif //CGAL_INTERSECT_WITH_ITERATORS_2 - #include - }; template < typename EK_, typename AK_, typename E2A_, typename Kernel_ > diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h index 544d51929f9..667d65aff34 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h @@ -28,7 +28,10 @@ #include #include #include -#include + +#include +// for CGAL::internal::do_intersect_bbox_segment_aux + #include // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf @@ -111,9 +114,6 @@ public: const Point_3& q = s.target(); double px, py, pz, qx, qy, qz; - double bxmin = b.xmin(), bymin = b.ymin(), bzmin = b.zmin(), - bxmax = b.xmax(), bymax = b.ymax(), bzmax = b.zmax(); - if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) && fit_in_double(get_approx(p).z(), pz) && fit_in_double(get_approx(q).x(), qx) && fit_in_double(get_approx(q).y(), qy) && @@ -121,178 +121,18 @@ public: { CGAL_BRANCH_PROFILER_BRANCH_1(tmp); - // ----------------------------------- - // treat x coord - // ----------------------------------- - double dmin, dmax, tmin, tmax; - if ( qx >= px ) // this is input and needs no epsilon - { - if(px > bxmax) return false; // segment on the right of bbox - if(qx < bxmin) return false; // segment on the left of bbox + const Uncertain ub = + do_intersect_bbox_segment_aux + // do use static filters + (px, py, pz, + qx, qy, qz, + b); - tmax = bxmax - px; - - dmax = qx - px; - if ( bxmin < px ) // tmin < 0 means px is in the x-range of bbox - { - tmin = 0; - dmin = 1; - } else { - tmin = bxmin - px; - dmin = dmax; - } - } - else - { - if(qx > bxmax) return false; // segment on the right of bbox - if(px < bxmin) return false; // segment on the left of bbox - - tmax = px - bxmin; - - dmax = px - qx; - if ( px < bxmax ) // tmin < 0 means px is in the x-range of bbox - { - tmin = 0; - dmin = 1; - } else { - tmin = px - bxmax; - dmin = dmax; - } - } - - double m = CGAL::abs(tmin), m2; - m2 = CGAL::abs(tmax); if(m2 > m) { m = m2; } - m2 = CGAL::abs(dmin); if(m2 > m) { m = m2; } - - if(m < 7e-294) { - // underflow in the computation of 'error' - return Base::operator()(s,b); - } - - const double EPS_1 = 3.55618e-15; - - double error = EPS_1 * m; - - switch(sign_with_error( tmax - dmax, error)) { - case POSITIVE: - tmax = 1; - dmax = 1; - break; - case NEGATIVE: - break; - default: - // ambiguity of the comparison tmax > dmin - // let's call the exact predicate - return Base::operator()(s,b); - } - - // ----------------------------------- - // treat y coord - // ----------------------------------- - double d_, tmin_, tmax_; - if ( qy >= py ) // this is input and needs no epsilon - { - tmin_ = bymin - py; - tmax_ = bymax - py; - d_ = qy - py; - } - else - { - tmin_ = py - bymax; - tmax_ = py - bymin; - d_ = py - qy; - } - - m2 = CGAL::abs(tmin_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(tmax_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(d_); if(m2 > m) { m = m2; } - - if(m < 3e-147) { - // underflow in the computation of 'error' - return Base::operator()(s,b); - } - - error = EPS_1 * m * m; - - if(m > 1e153) { /* sqrt(max_double [hadamard]/2) */ - // potential overflow on the computation of 'sign1' and 'sign2' - return Base::operator()(s,b); - } - Sign sign1 = sign_with_error( (d_*tmin) - (dmin*tmax_) , error); - Sign sign2 = sign_with_error( (dmax*tmin_) - (d_*tmax) , error); - - if(sign1 == POSITIVE || sign2 == POSITIVE) - return false; // We are *sure* the segment is outside the box, on one - // side or the other. - if(sign1 == ZERO || sign2 == ZERO) { - return Base::operator()(s,b); // We are *unsure*: one *may be* - // positive. - } - - // Here we are sure the two signs are negative. We can continue with - // the rest of the function... - - // epsilons needed - switch(sign_with_error((dmin*tmin_) - (d_*tmin) , error)) { - case POSITIVE: - tmin = tmin_; - dmin = d_; - break; - case NEGATIVE: - break; - default: // uncertainty - return Base::operator()(s,b); - } - - // epsilons needed - switch(sign_with_error((d_*tmax) - (dmax*tmax_) , error)) { - case POSITIVE: - tmax = tmax_; - dmax = d_; - case NEGATIVE: - break; - default: // uncertainty - return Base::operator()(s,b); - } - - // ----------------------------------- - // treat z coord - // ----------------------------------- - if ( qz >= pz ) // this is input and needs no epsilon - { - tmin_ = bzmin - pz; - tmax_ = bzmax - pz; - d_ = qz - pz; - } - else - { - tmin_ = pz - bzmax; - tmax_ = pz - bzmin; - d_ = pz - qz; - } - - m2 = CGAL::abs(tmin_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(tmax_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(d_); if(m2 > m) { m = m2; } - - // m may have changed - error = EPS_1 * m * m; - - if(m > 1e153) { /* sqrt(max_double [hadamard]/2) */ - // potential overflow on the computation of 'sign1' and 'sign2' - return Base::operator()(s,b); - } - sign1 = sign_with_error( (dmin*tmax_) - (d_*tmin) , error); - sign2 = sign_with_error( (d_*tmax) - (dmax*tmin_) , error); - if(sign1 == NEGATIVE || sign2 == NEGATIVE) { - return false; // We are *sure* the segment is outside the box, on one - // side or the other. - } - if(sign1 == ZERO || sign2 == ZERO) { - return Base::operator()(s,b); // We are *unsure*: one *may be* - // negative. - } - return true; // We are *sure* the two signs are positive. + if(is_indeterminate(ub)) return Base::operator()(s,b); + else return ub.sup(); } return Base::operator()(s,b); } @@ -317,9 +157,6 @@ public: const Point_3& q = r.second_point(); double px, py, pz, qx, qy, qz; - double bxmin = b.xmin(), bymin = b.ymin(), bzmin = b.zmin(), - bxmax = b.xmax(), bymax = b.ymax(), bzmax = b.zmax(); - if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) && fit_in_double(get_approx(p).z(), pz) && fit_in_double(get_approx(q).x(), qx) && fit_in_double(get_approx(q).y(), qy) && @@ -327,155 +164,18 @@ public: { CGAL_BRANCH_PROFILER_BRANCH_1(tmp); - // ----------------------------------- - // treat x coord - // ----------------------------------- - double dmin, dmax, tmin, tmax; - if ( qx >= px ) // this is input and needs no epsilon - { - if(px > bxmax) return false; // if tmax < 0, ray on the right of bbox - tmax = bxmax - px; - - dmax = qx - px; - if ( bxmin < px ) // tmin < 0 means px is in the x-range of bbox - { - tmin = 0; - dmin = 1; - } else { - if( px == qx ) return false; // if dmin == 0 - tmin = bxmin - px; - dmin = dmax; - } - } - else - { - if(px < bxmin) return false; // if tmax < 0, ray on the left of bbox - tmax = px - bxmin; + const Uncertain ub = + do_intersect_bbox_segment_aux + // do use static filters + (px, py, pz, + qx, qy, qz, + b); - dmax = px - qx; - if ( px < bxmax ) // tmin < 0 means px is in the x-range of bbox - { - tmin = 0; - dmin = 1; - } else { - if( px == qx ) return false; // if dmin == 0 - tmin = px - bxmax; - dmin = dmax; - } - } - - // ----------------------------------- - // treat y coord - // ----------------------------------- - double d_, tmin_, tmax_; - if ( qy >= py ) // this is input and needs no epsilon - { - tmin_ = bymin - py; - tmax_ = bymax - py; - d_ = qy - py; - } - else - { - tmin_ = py - bymax; - tmax_ = py - bymin; - d_ = py - qy; - } - - double m = CGAL::abs(tmin), m2; - m2 = CGAL::abs(tmax); if(m2 > m) { m = m2; } - m2 = CGAL::abs(dmin); if(m2 > m) { m = m2; } - m2 = CGAL::abs(tmin_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(tmax_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(d_); if(m2 > m) { m = m2; } - - if(m < 3e-147) { - // underflow in the computation of 'error' - return Base::operator()(r,b); - } - - const double EPS_1 = 3.55618e-15; - - double error = EPS_1 * m * m; - - if(m > 1e153) { /* sqrt(max_double [hadamard]/2) */ - // potential overflow on the computation of 'sign1' and 'sign2' - return Base::operator()(r,b); - } - Sign sign1 = sign_with_error( (d_*tmin) - (dmin*tmax_) , error); - Sign sign2 = sign_with_error( (dmax*tmin_) - (d_*tmax) , error); - - if(sign1 == POSITIVE || sign2 == POSITIVE) - return false; // We are *sure* the ray is outside the box, on one - // side or the other. - if(sign1 == ZERO || sign2 == ZERO) { - return Base::operator()(r,b); // We are *unsure*: one *may be* - // positive. - } - - // Here we are sure the two signs are negative. We can continue with - // the rest of the function... - - // epsilons needed - switch(sign_with_error((dmin*tmin_) - (d_*tmin) , error)) { - case POSITIVE: - tmin = tmin_; - dmin = d_; - break; - case NEGATIVE: - break; - default: // uncertainty - return Base::operator()(r,b); - } - - // epsilons needed - switch(sign_with_error((d_*tmax) - (dmax*tmax_) , error)) { - case POSITIVE: - tmax = tmax_; - dmax = d_; - case NEGATIVE: - break; - default: // uncertainty - return Base::operator()(r,b); - } - - // ----------------------------------- - // treat z coord - // ----------------------------------- - if ( qz >= pz ) // this is input and needs no epsilon - { - tmin_ = bzmin - pz; - tmax_ = bzmax - pz; - d_ = qz - pz; - } - else - { - tmin_ = pz - bzmax; - tmax_ = pz - bzmin; - d_ = pz - qz; - } - - m2 = CGAL::abs(tmin_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(tmax_); if(m2 > m) { m = m2; } - m2 = CGAL::abs(d_); if(m2 > m) { m = m2; } - - // m may have changed - error = EPS_1 * m * m; - - if(m > 1e153) { /* sqrt(max_double [hadamard]/2) */ - // potential overflow on the computation of 'sign1' and 'sign2' - return Base::operator()(r,b); - } - sign1 = sign_with_error( (dmin*tmax_) - (d_*tmin) , error); - sign2 = sign_with_error( (d_*tmax) - (dmax*tmin_) , error); - if(sign1 == NEGATIVE || sign2 == NEGATIVE) { - return false; // We are *sure* the ray is outside the box, on one - // side or the other. - } - if(sign1 == ZERO || sign2 == ZERO) { - return Base::operator()(r,b); // We are *unsure*: one *may be* - // negative. - } - return true; // We are *sure* the two signs are positive. + if(is_indeterminate(ub)) return Base::operator()(r,b); + else return ub.sup(); } return Base::operator()(r,b); } diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Equal_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Equal_3.h old mode 100755 new mode 100644 diff --git a/Geomview/demo/Geomview/gv_terrain.cpp b/Geomview/demo/Geomview/gv_terrain.cpp index e618c1791f2..25d2b566b43 100644 --- a/Geomview/demo/Geomview/gv_terrain.cpp +++ b/Geomview/demo/Geomview/gv_terrain.cpp @@ -36,7 +36,7 @@ int main() #include #include // for sleep() -#include +#include #include #include @@ -50,7 +50,7 @@ int main() typedef CGAL::Cartesian K; typedef K::Point_2 Point2; -typedef CGAL::Triangulation_euclidean_traits_xy_3 Gt3; +typedef CGAL::Projection_traits_xy_3 Gt3; typedef Gt3::Point Point3; typedef CGAL::Delaunay_triangulation_2 Delaunay; diff --git a/Geomview/src/CGAL/Geomview_stream.cpp b/Geomview/src/CGAL/Geomview_stream.cpp index b1554c615d0..a34af8ceabc 100644 --- a/Geomview/src/CGAL/Geomview_stream.cpp +++ b/Geomview/src/CGAL/Geomview_stream.cpp @@ -145,7 +145,8 @@ void Geomview_stream::setup_geomview(const char *machine, const char *login) *this << "(echo \"CGAL-3D\")"; char inbuf[10]; - (void)::read(in, inbuf, 7); + std::size_t retread=::read(in, inbuf, 7); + (void)retread; if (std::strncmp(inbuf, "started", 7) == 0) { @@ -154,7 +155,8 @@ void Geomview_stream::setup_geomview(const char *machine, const char *login) // << "compulsory anymore, since CGAL 2.3" << std::endl; // Then the next one is supposed to be CGAL-3D. - (void)::read(in, inbuf, 7); + retread=::read(in, inbuf, 7); + (void)retread; if (std::strncmp(inbuf, "CGAL-3D", 7) != 0) std::cerr << "Unexpected string from Geomview !" << std::endl; } @@ -172,7 +174,8 @@ void Geomview_stream::setup_geomview(const char *machine, const char *login) // Old original version char inbuf[10]; // Waits for "started" from the .geomview file. - (void)::read(in, inbuf, 7); + retread=::read(in, inbuf, 7); + (void)retread; #endif std::cout << "done." << std::endl; @@ -230,7 +233,8 @@ Geomview_stream::operator<<(int i) // we write raw binary data to the stream. int num = i; I_swap_to_big_endian(num); - (void)::write(out, (char*)&num, sizeof(num)); + std::size_t retwrite=::write(out, (char*)&num, sizeof(num)); + (void)retwrite; trace(i); } else { // transform the int in a character sequence and put whitespace around @@ -250,7 +254,8 @@ Geomview_stream::operator<<(unsigned int i) // we write raw binary data to the stream. unsigned int num = i; I_swap_to_big_endian(num); - (void)::write(out, (char*)&num, sizeof(num)); + std::size_t retwrite=::write(out, (char*)&num, sizeof(num)); + (void)retwrite; trace(i); } else { // transform the int in a character sequence and put whitespace around @@ -281,7 +286,8 @@ Geomview_stream::operator<<(double d) if (get_binary_mode()) { float num = d; I_swap_to_big_endian(num); - (void)::write(out, (char*)&num, sizeof(num)); + std::size_t retwrite= ::write(out, (char*)&num, sizeof(num)); + (void)retwrite; trace(f); } else { // 'copy' the float in a string and append a blank @@ -468,13 +474,15 @@ Geomview_stream::operator>>(char *expr) { // Skip whitespaces do { - (void)::read(in, expr, 1); + std::size_t retread=::read(in, expr, 1); + (void)retread; } while (expr[0] != '('); int pcount = 1; int i = 1; while (1) { - (void)::read(in, &expr[i], 1); + std::size_t retread=::read(in, &expr[i], 1); + (void)retread; if (expr[i] == ')'){ pcount--; } else if (expr[i] == '('){ diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h index 7de84781b27..8876127bad7 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/L1_voronoi_traits_2.h @@ -40,8 +40,8 @@ public: typedef typename Kernel::FT FT; typedef Arr_linear_traits_2 Base; typedef L1_voronoi_traits_2 Self; - typedef std::size_t Multiplicity; + typedef typename Base::Multiplicity Multiplicity; typedef typename Base::Point_2 Point_2; typedef typename Base::Curve_2 Curve_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index 59b8a9b3076..cdec3735b98 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -12,7 +12,7 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) endif() endif() -find_package(CGAL COMPONENTS Qt4 Core) +find_package(CGAL COMPONENTS Qt4 Core GMP MPFR) include(${CGAL_USE_FILE}) @@ -21,7 +21,7 @@ set( QT_USE_QTMAIN TRUE ) set( QT_USE_QTSCRIPT TRUE ) set( QT_USE_QTOPENGL TRUE ) -find_package(Qt4) +#find_package(Qt4) include_directories (BEFORE ../../include) @@ -44,16 +44,22 @@ if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND ) # use the Qt MOC preprocessor on classes that derives from QObject qt4_generate_moc( Polygon_2.cpp "${CMAKE_CURRENT_BINARY_DIR}/Polygon_2.moc" ) +# add_library( CGAL SHARED IMPORTED ) +# SET_PROPERTY(TARGET CGAL PROPERTY IMPORTED_LOCATION ${CGAL_LIBRARY} ) + # The executable itself. add_executable ( Polygon_2 Polygon_2.cpp Polygon_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polygon_2 ) + # Link with Qt libraries target_link_libraries( Polygon_2 ${QT_LIBRARIES} ) # And with CGAL libraries target_link_libraries( Polygon_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + add_dependencies( Polygon_2 ${CGAL_LIBRARY} ) + else() message(STATUS "NOTICE: This demo requires CGAL, CGAL_Core, and Qt4, and will not be compiled.") diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index d7f40624c5e..8717b488708 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -22,13 +22,13 @@ set( QT_USE_QTSCRIPT TRUE ) set( QT_USE_QTOPENGL TRUE ) -find_package(Qt4) +#find_package(Qt4) + include_directories (BEFORE ../../include) include_directories (BEFORE ./include) - include_directories (BEFORE ../../../Number_types/include) - - include_directories (BEFORE ../../../Triangulation_2/include) +include_directories (BEFORE ../../../Number_types/include) +include_directories (BEFORE ../../../Triangulation_2/include) if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND ) diff --git a/GraphicsView/include/CGAL/export/Qt4.h b/GraphicsView/include/CGAL/export/Qt4.h old mode 100755 new mode 100644 diff --git a/GraphicsView/src/CGALQt4/CMakeLists.txt b/GraphicsView/src/CGALQt4/CMakeLists.txt index 7998ada995d..eb26cc59492 100644 --- a/GraphicsView/src/CGALQt4/CMakeLists.txt +++ b/GraphicsView/src/CGALQt4/CMakeLists.txt @@ -1,22 +1,4 @@ -project (CGAL_Qt4) - -# Minimal version of CMake: -cmake_minimum_required(VERSION 2.6.2) - -# Tested version: -if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) - if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) - cmake_policy(VERSION 2.8.4) - else() - cmake_policy(VERSION 2.6) - endif() -endif() - -if ( NOT CGAL_FOUND ) - find_package(CGAL REQUIRED) -endif() - -include(${CGAL_USE_FILE}) +message("Configuring libCGAL_Qt4") set( QT_USE_QTMAIN TRUE ) set( QT_USE_QTOPENGL TRUE ) @@ -32,7 +14,7 @@ if( QT4_FOUND ) include(${QT_USE_FILE}) - get_dependency_version(OPENGL OpenGL) + get_dependency_version(OPENGL) get_dependency_version(QT4 QT) @@ -75,20 +57,26 @@ if( QT4_FOUND ) # message(STATUS "Additional input files: ${additional_files}") - build_cgal_library( CGAL_Qt4 CGALQt4 "${additional_files}") + use_essential_libs() - if ( NOT CGAL_IS_CURRENT_SCRIPT_TOP_LEVEL ) - add_dependencies( CGAL_Qt4 CGAL ) - endif() + include_directories( ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt4_3RD_PARTY_INCLUDE_DIRS} ) + + link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + + collect_cgal_library( CGAL_Qt4 CGALQt4 "${additional_files}") + + add_dependencies( CGAL_Qt4 CGAL ) target_link_libraries( CGAL_Qt4 ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${CGAL_Qt4_3RD_PARTY_LIBRARIES} ) - add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ) + add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt4_3RD_PARTY_DEFINITIONS} ) if($ENV{CGAL_FAKE_PUBLIC_RELEASE}) add_definitions( -DCGAL_FAKE_PUBLIC_RELEASE ) endif() + message("libCGAL_Qt4 is configured") + else() message( STATUS "CGAL_Qt4 needs OpenGL, cannot be configured.") endif() diff --git a/GraphicsView/src/CGALQt4/resources.cpp b/GraphicsView/src/CGALQt4/resources.cpp index 6444dd937ff..e15cc66b861 100644 --- a/GraphicsView/src/CGALQt4/resources.cpp +++ b/GraphicsView/src/CGALQt4/resources.cpp @@ -19,6 +19,7 @@ // Author(s) : Laurent Rineau #include +#include // cannot use namespaces because of the Q_INIT_RESOURCE macro void CGAL_Qt4_init_resources() { diff --git a/HalfedgeDS/doc_tex/HalfedgeDS/main.tex b/HalfedgeDS/doc_tex/HalfedgeDS/main.tex index c3f509db26c..33a6d005949 100644 --- a/HalfedgeDS/doc_tex/HalfedgeDS/main.tex +++ b/HalfedgeDS/doc_tex/HalfedgeDS/main.tex @@ -254,12 +254,6 @@ One can later resize the data structure with further calls to the \ccc{reserve()} member function, but only if the data structure is in a consistent, i.e., {\em valid}, state. -Unfortunately this example has also to expose the workaround necessary -for compilers that do not support templates as template parameters. -The workaround is necessary if the symbolic constant -\verb|CGAL_CFG_NO_TMPL_IN_TMPL_PARAM| is set. It uses a member -template instead of the class template. - \ccIncludeExampleCode{HalfedgeDS/hds_prog_vector.cpp} diff --git a/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS.tex b/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS.tex index 091d09732f8..25f5e75b63b 100644 --- a/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS.tex +++ b/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS.tex @@ -21,16 +21,6 @@ \ccCreationVariable{hds} \ccTagFullDeclarations -% +-----------------------------------+ -\ccHeading{Release Note} - -Beginning with \cgal\ R2.3, this package has a new design. The old -design is still available for backwards compatibility and to support -older compiler, such as MSVC++6.0. However its use is deprecated and -the manual pages are not converted into this new manual -format. Instead, see its old documentation in the manual of -deprecated packages. The two designs are not interchangeable. - % +-----------------------------------+ \ccDefinition @@ -500,40 +490,6 @@ a halfedge. There is no automatic update required. \ccRefIdfierPage{CGAL::HalfedgeDS_decorator}\\ \ccRefIdfierPage{CGAL::HalfedgeDS_const_decorator} -% +-----------------------------------+ -\ccImplementation - -Classes parameterized with a halfedge data structure, such as -\ccc{CGAL::Polyhedron_3}, need to declare a class template as one of its -template parameters for the \ccRefName. For compilers not supporting -this (i.e.~the flag \ccc{CGAL_CFG_NO_TMPL_IN_TMPL_PARAM} is set), the -following workaround is required, which defines a \ccRefName\ as a -normal class that contains a member class template named \ccc{HDS}, -which is the actual halfedge data structure as defined here. The -following program fragment illustrates this workaround: - -\begin{ccExampleCode} -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM - template - class HalfedgeDS { - public: - typedef HalfedgeDS Self; - HalfedgeDS_vector(); // constructors -#else - struct HalfedgeDS { - template - class HDS { - public: - typedef HDS Self; - HDS(); // constructors -#endif - // ... further member functions. Self denotes the HalfedgeDS. - }; -#ifdef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM - }; -#endif -\end{ccExampleCode} - \ccTagDefaults \end{ccRefConcept} diff --git a/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS_default.tex b/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS_default.tex index 48df5d8145b..4b7ae180eae 100644 --- a/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS_default.tex +++ b/HalfedgeDS/doc_tex/HalfedgeDS_ref/HalfedgeDS_default.tex @@ -61,7 +61,6 @@ removal. \ccRefIdfierPage{CGAL::HalfedgeDS_decorator}\\ \ccRefIdfierPage{CGAL::HalfedgeDS_const_decorator} - \ccImplementation Currently, \ccRefName\ is derived from \ccc{CGAL::HalfedgeDS_list}. @@ -70,25 +69,6 @@ $n$ the total number of vertices, halfedges, and faces. The former suboptimal implementation with an $O(n \log n)$ runtime has been replaced with a faster implementation based on hashing for the pointer lookup. -Due to a workaround for the flag \ccc{CGAL_CFG_NO_TMPL_IN_TMPL_PARAM}, -a halfedge data structure cannot be instantiated directly. For the -\ccRefName\ a macro simplifies its direct use. However, when using a -halfedge data structure as an argument for another class template, -the class template name \ccc{HalfedgeDS_default} must be used, not -the macro. - -\begin{ccExampleCode} -// The macro definition. -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM - #define CGAL_HALFEDGEDS_DEFAULT ::CGAL::HalfedgeDS_default -#else - #define CGAL_HALFEDGEDS_DEFAULT ::CGAL::HalfedgeDS_default::HDS -#endif - -// The direct instantiation of the default HalfedgeDS given a Traits class. -typedef CGAL_HALFEDGEDS_DEFAULT HDS; -\end{ccExampleCode} - \end{ccRefClass} % +------------------------------------------------------------------------+ diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_default.h b/HalfedgeDS/include/CGAL/HalfedgeDS_default.h index c325485f332..1f7c37112c9 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_default.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_default.h @@ -31,8 +31,6 @@ namespace CGAL { -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM - template class HalfedgeDS_default @@ -47,26 +45,6 @@ public: }; #define CGAL_HALFEDGEDS_DEFAULT ::CGAL::HalfedgeDS_default -#else // CGAL_CFG_NO_TMPL_IN_TMPL_PARAM // - -struct HalfedgeDS_default { - template - class HDS : public HalfedgeDS_list::HDS { - public: - typedef Traits_ Traits; - typedef HalfedgeDS_list::HDS D_S; - typedef typename D_S::size_type size_type; - HDS() {} - HDS( size_type v, size_type h, size_type f) - : HalfedgeDS_list::HDS(v,h,f) {} - }; -}; - -#define CGAL_HALFEDGEDS_DEFAULT ::CGAL::HalfedgeDS_default::HDS - -#endif // CGAL_CFG_NO_TMPL_IN_TMPL_PARAM // - } //namespace CGAL #endif // CGAL_HALFEDGEDS_DEFAULT_H // // EOF // diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_list.h b/HalfedgeDS/include/CGAL/HalfedgeDS_list.h index 2250c3714e0..d17d890bed8 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_list.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_list.h @@ -181,21 +181,12 @@ public: } }; -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class Traits_, class HalfedgeDSItems, class Alloc = CGAL_ALLOCATOR(int)> class HalfedgeDS_list : public HalfedgeDS_list_types { public: typedef HalfedgeDS_list Self; -#else -struct HalfedgeDS_list { -template < class Traits_, class HalfedgeDSItems, - class Alloc = CGAL_ALLOCATOR(int)> -class HDS : public HalfedgeDS_list_types { -public: - typedef HDS Self; -#endif public: typedef HalfedgeDS_list_types Types; typedef typename Types::Traits Traits; @@ -374,7 +365,6 @@ private: } public: -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM HalfedgeDS_list() : nb_border_halfedges(0), nb_border_edges(0) {} // the empty polyhedron `P'. @@ -389,13 +379,6 @@ public: ~HalfedgeDS_list() { clear(); } HalfedgeDS_list( const Self& hds) -#else - HDS() : nb_border_halfedges(0), nb_border_edges(0) {} - HDS( size_type, size_type, size_type) - : nb_border_halfedges(0), nb_border_edges(0) {} - ~HDS() { clear(); } - HDS( const Self& hds) -#endif // CGAL_CFG_NO_TMPL_IN_TMPL_PARAM // : vertices( hds.vertices), //halfedges( hds.halfedges), faces( hds.faces), @@ -688,9 +671,6 @@ public: border_halfedges = i; } }; -#ifdef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM -}; -#endif // #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h b/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h index f6cf04b215d..c61e09aef01 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h @@ -143,21 +143,12 @@ public: }; -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class Traits_, class HalfedgeDSItems, class Alloc = CGAL_ALLOCATOR(int)> class HalfedgeDS_vector : public HalfedgeDS_vector_types { public: typedef HalfedgeDS_vector Self; -#else -struct HalfedgeDS_vector { -template < class Traits_, class HalfedgeDSItems, - class Alloc = CGAL_ALLOCATOR(int)> -class HDS : public HalfedgeDS_vector_types { -public: - typedef HDS Self; -#endif typedef HalfedgeDS_vector_types Types; typedef typename Types::Traits Traits; typedef typename Types::Items Items; @@ -292,7 +283,6 @@ private: public: -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM HalfedgeDS_vector() : nb_border_halfedges(0), nb_border_edges(0) {} // empty halfedge data structure. @@ -308,16 +298,6 @@ public: } HalfedgeDS_vector( const Self& hds) -#else - HDS() : nb_border_halfedges(0), nb_border_edges(0) {} - HDS( size_type v, size_type h, size_type f) - : nb_border_halfedges(0), nb_border_edges(0) { - vertices.reserve(v); - halfedges.reserve(h); - faces.reserve(f); - } - HDS( const Self& hds) -#endif // CGAL_CFG_NO_TMPL_IN_TMPL_PARAM // : vertices( hds.vertices), halfedges( hds.halfedges), faces( hds.faces), @@ -669,9 +649,6 @@ public: } } }; -#ifdef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM -}; -#endif } //namespace CGAL diff --git a/HalfedgeDS/test/HalfedgeDS/test_hds.cpp b/HalfedgeDS/test/HalfedgeDS/test_hds.cpp index 3131796c522..6055f20bf90 100644 --- a/HalfedgeDS/test/HalfedgeDS/test_hds.cpp +++ b/HalfedgeDS/test/HalfedgeDS/test_hds.cpp @@ -108,13 +108,8 @@ void test_HalfedgeDS_default() { void test_HalfedgeDS_vector() { // Instantiation of the halfedge data structure using vector // and maximal bases for polyhedral surfaces. -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM typedef CGAL::HalfedgeDS_vector< Dummy_traits_3, CGAL::Polyhedron_items_3> HDS; -#else - typedef CGAL::HalfedgeDS_vector::HDS< Dummy_traits_3, - CGAL::Polyhedron_items_3> HDS; -#endif typedef HDS::Halfedge Halfedge; typedef Halfedge::Base HBase; typedef HDS::Face_handle Face_handle; @@ -152,13 +147,8 @@ void test_HalfedgeDS_vector() { void test_HalfedgeDS_vector_min() { // Instantiation of the halfedge data structure using vector // and minimal bases as for an undirected graph. -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM typedef CGAL::HalfedgeDS_vector< Empty_traits, CGAL::HalfedgeDS_min_items> HDS; -#else - typedef CGAL::HalfedgeDS_vector::HDS< Empty_traits, - CGAL::HalfedgeDS_min_items> HDS; -#endif typedef HDS::Halfedge Halfedge; typedef Halfedge::Base HBase; diff --git a/HalfedgeDS/test/HalfedgeDS/test_hds_decorator.cpp b/HalfedgeDS/test/HalfedgeDS/test_hds_decorator.cpp index 61ed8bc0ab3..5b1eb944178 100644 --- a/HalfedgeDS/test/HalfedgeDS/test_hds_decorator.cpp +++ b/HalfedgeDS/test/HalfedgeDS/test_hds_decorator.cpp @@ -150,13 +150,8 @@ struct Dummy_traits_3 { void test_HalfedgeDS_decorator2() { // Instantiation of the halfedge data structure using vector // with max-bases for a polyhedral surface. -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM typedef CGAL::HalfedgeDS_vector< Dummy_traits_3, CGAL::Polyhedron_items_3> HDS; -#else - typedef CGAL::HalfedgeDS_vector::HDS< Dummy_traits_3, - CGAL::Polyhedron_items_3> HDS; -#endif typedef CGAL::HalfedgeDS_decorator Decorator; typedef HDS::Halfedge_handle Halfedge_handle; typedef HDS::Face_handle Face_handle; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index fe7292d5051..70a180afd92 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -1560,15 +1560,15 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_dx_2 : public Has_qrt + class Compute_dx_2 { typedef typename K::RT RT; typedef typename K::Direction_2 Direction_2; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Direction_2& d) const { return d.rep().dx(); @@ -1576,15 +1576,15 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_dx_3 : public Has_qrt + class Compute_dx_3 { typedef typename K::RT RT; typedef typename K::Direction_3 Direction_3; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Direction_3& d) const { return d.rep().dx(); @@ -1592,15 +1592,15 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_dy_2 : public Has_qrt + class Compute_dy_2 { typedef typename K::RT RT; typedef typename K::Direction_2 Direction_2; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Direction_2& d) const { return d.rep().dy(); @@ -1608,15 +1608,15 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_dy_3 : public Has_qrt + class Compute_dy_3 { typedef typename K::RT RT; typedef typename K::Direction_3 Direction_3; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Direction_3& d) const { return d.rep().dy(); @@ -1624,15 +1624,15 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_dz_3 : public Has_qrt + class Compute_dz_3 { typedef typename K::RT RT; typedef typename K::Direction_3 Direction_3; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Direction_3& d) const { return d.rep().dz(); @@ -1640,7 +1640,7 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_hx_2 : public Has_qrt + class Compute_hx_2 { typedef typename K::FT FT; typedef typename K::RT RT; @@ -1648,15 +1648,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_2 Vector_2; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Point_2& p) const { return p.rep().hx(); } - const result_type & + result_type operator()(const Vector_2& v) const { return v.rep().hx(); @@ -1664,7 +1664,7 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_hx_3 : public Has_qrt + class Compute_hx_3 { typedef typename K::FT FT; typedef typename K::RT RT; @@ -1672,15 +1672,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_3 Vector_3; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().hx(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().hx(); @@ -1688,7 +1688,7 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_hy_2 : public Has_qrt + class Compute_hy_2 { typedef typename K::FT FT; typedef typename K::RT RT; @@ -1696,15 +1696,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_2 Vector_2; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Point_2& p) const { return p.rep().hy(); } - const result_type & + result_type operator()(const Vector_2& v) const { return v.rep().hy(); @@ -1712,7 +1712,7 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_hy_3 : public Has_qrt + class Compute_hy_3 { typedef typename K::FT FT; typedef typename K::RT RT; @@ -1720,15 +1720,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_3 Vector_3; public: - typedef RT result_type; + typedef const RT & result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().hy(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().hy(); @@ -1736,7 +1736,7 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_hz_3 : public Has_qrt + class Compute_hz_3 { typedef typename K::FT FT; typedef typename K::RT RT; @@ -1744,15 +1744,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_3 Vector_3; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().hz(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().hz(); @@ -1760,7 +1760,7 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_hw_2 : public Has_qrt + class Compute_hw_2 { typedef typename K::FT FT; typedef typename K::RT RT; @@ -1768,15 +1768,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_2 Vector_2; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Point_2& p) const { return p.rep().hw(); } - const result_type & + result_type operator()(const Vector_2& v) const { return v.rep().hw(); @@ -1784,7 +1784,7 @@ namespace HomogeneousKernelFunctors { }; template - class Compute_hw_3 : public Has_qrt + class Compute_hw_3 { typedef typename K::FT FT; typedef typename K::RT RT; @@ -1792,15 +1792,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_3 Vector_3; public: - typedef RT result_type; + typedef const RT& result_type; - const result_type & + result_type operator()(const Point_3& p) const { return p.rep().hw(); } - const result_type & + result_type operator()(const Vector_3& v) const { return v.rep().hw(); @@ -3517,7 +3517,15 @@ namespace HomogeneousKernelFunctors { typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Triangle_2 Triangle_2; public: - typedef Point_2 result_type; + template + struct result { + typedef const Point_2& type; + }; + + template + struct result { + typedef Point_2 type; + }; const Point_2 & operator()( const Segment_2& s, int i) const @@ -3527,7 +3535,7 @@ namespace HomogeneousKernelFunctors { operator()( const Triangle_2& t, int i) const { return t.rep().vertex(i); } - const Point_2 + Point_2 operator()( const Iso_rectangle_2& r, int i) const { switch (i%4) { @@ -3547,22 +3555,6 @@ namespace HomogeneousKernelFunctors { } //namespace HomogeneousKernelFunctors -#ifndef CGAL_CFG_DONT_OVERLOAD_TOO_MUCH -template < typename K> -struct Qualified_result_of, typename K::Segment_2, int > -{ - typedef typename K::Point_2 const & type; -}; - -template < typename K> -struct Qualified_result_of, typename K::Triangle_2, int > -{ - typedef typename K::Point_2 const & type; -}; -#endif - -// For Iso_rectangle the non specialized template will do the right thing, namely return a copy of a point - namespace HomogeneousKernelFunctors { template diff --git a/Installation/CHANGES b/Installation/CHANGES index 60b94dd11de..c9b69f9350e 100644 --- a/Installation/CHANGES +++ b/Installation/CHANGES @@ -1,4 +1,126 @@ +-------------------------------- Release 4.1 -------------------------------- + +Release date: + + +* Installation + + - CGAL-4.1 no longer supports the Intel Compiler version 11.0. The Intel + Compiler version 12.0 is supported instead. + + - Improved configuration for essential and optional external third party + software + + - Added more general script to create CMakeLists.txt files: + cgal_create_CMakeLists + + - Availability tests for C++11 features are now performed with the help of + Boost.Config. A Boost version of 1.40.0 or higher is needed to use C++11 + features. + + +* 2D Convex Hulls and Extreme Points + + - Speed up the preprocessing stage of the Akl-Toussaint implementation (used + by the free function convex_hull_2 when forward iterators are provided as + input). + + +* Combinatorial Maps + + - Minor bugfix; replace some functors by methods. + + +* Linear Cell Complex + + - Improve the demo: add a widget showing all the volumes and an operation to + create a Menger sponge. + + +* Kernels + + - All Kernel functors now support the result_of protocol. + + +* STL_Extensions for CGAL + + - The namespace cpp0x has been renamed cpp11. The old name is still available + for backward compatibility. + + +-------------------------------- Release 4.0.2 -------------------------------- + +Release date: Jul 2012 + +This is a bug fix release. It fixes a bug in the CMakeLists.txt for CGAL-4.0.1, +that prevented even building the libraries. + + +-------------------------------- Release 4.0.1 -------------------------------- + +Release date: Jul 2012 + +This is a bug fix release. Apart various minor fixes in the documentation, the +following has been changed since CGAL-4.0: + + +* 2D Voronoi Diagram Adaptor (re-added) + + - The package 2D Voronoi Diagram Adaptor was temporarily removed from the + CGAL distribution because of license issues. That package is now back into + CGAL. + + +* 2D and 3D Geometry Kernel + + - Fix a bug in the Segment_3-Triangle_3 intersection function in the case the + segment is collinear with a triangle edge. + + +* Algebraic Kernel + + - Avoid the linking error "duplicate symbols" when two compilation units + using the algebraic kernel are linked. + + +* 3D Boolean Operations on Nef Polygons Embedded on the Sphere + + - Fix a memory leak due to the usage of an internal mechanism that has been + replaced by boost::any. This also influences the packages 2D Boolean + Operations on Nef Polygons, 3D Boolean Operations on Nef Polyhedra, Convex + Decomposition of Polyhedra, and 3D Minkowski Sum of Polyhedra. + + +* 2D Arrangement + + - Fix several memory leaks. + + +* 2D Mesh Generation + + - Fix a compilation error in the header + when g++ version 4.7 is used. + + +* Surface Mesh Generation and 3D Mesh Generation + + - Fix an important bug in the CGAL_ImageIO library, that could lead to wrong + result when meshing from a 3D image. + + - Fix the compilation of the demo in demo/Surface_mesher, when Boost version + 1.48 or 1.49 is used. + + +* Surface Mesh Parameterization + + - Fix a memory leak. + + - Fix a compatibility issue with Eigen-3.1 of Eigen_solver_traits. This fix + also affects the usage of that class in the package Surface Reconstruction + from Point Sets. + + -------------------------------- Release 4.0 -------------------------------- Release date: March 2012 diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 3f2582a4c23..bcaf389805d 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -3,7 +3,7 @@ # refer to the root source directory of the project as ${CMAKE_SOURCE_DIR} or # ${CMAKE_SOURCE_DIR} and to the root binary directory of the project as # ${CMAKE_BINARY_DIR} or ${CMAKE_BINARY_DIR}. -project(CGAL CXX) +project(CGAL CXX C) # Minimal version of CMake: if(WIN32) @@ -27,6 +27,8 @@ endif() # #-------------------------------------------------------------------------------------------------- +message( "== Setting paths ==" ) + if ( CGAL_BRANCH_BUILD ) message( STATUS "Build CGAL from ${CGAL_SCM_NAME}-branch: ${CGAL_SCM_BRANCH_NAME}" ) @@ -80,7 +82,7 @@ else ( CGAL_BRANCH_BUILD ) string(REGEX REPLACE "^/" "" CMAKE_SOURCE_DDIR ${CMAKE_SOURCE_CDIR}) string(REPLACE "/" ";" CMAKE_SOURCE_PDIR ${CMAKE_SOURCE_DDIR}) list(GET CMAKE_SOURCE_PDIR -1 CGAL_RELEASE_NAME) - message( STATUS "Build CGAL from release: ${CGAL_RELEASE_NAME}" ) + message( STATUS "Build CGAL from release in directory ${CGAL_RELEASE_NAME}" ) set(CGAL_CONFIGURED_PACKAGES_NAMES ${CGAL_RELEASE_NAME}) @@ -98,6 +100,9 @@ endif (CGAL_BRANCH_BUILD ) list(SORT CGAL_CONFIGURED_PACKAGES_NAMES) message(STATUS "Packagenames: ${CGAL_CONFIGURED_PACKAGES_NAMES}") +message( "== Setting paths (DONE) ==\n" ) + +message( "== Generate version files ==") if ( CGAL_BRANCH_BUILD ) @@ -110,8 +115,6 @@ if ( CGAL_BRANCH_BUILD ) file(STRINGS "${CGAL_MAINTENANCE_PACKAGE_DIR}/release_building/BUGFIX_NUMBER" CGAL_BUGFIX_VERSION REGEX "[0-9]*") set(CGAL_BUILD_VERSION 900) - - message( STATUS "Generate VERSION file") file(REMOVE ${CMAKE_BINARY_DIR}/VERSION) if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") @@ -119,15 +122,12 @@ if ( CGAL_BRANCH_BUILD ) set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") endif() - # TODO set number of internal release (replace "000") + # TODO EBEB set number of internal release (replace "900") set(CGAL_CREATED_VERSION "${CGAL_CREATED_VERSION_NUM}-I-${CGAL_BUILD_VERSION}") set(CGAL_VERSION "${CGAL_CREATED_VERSION_NUM}-I-${CGAL_BUILD_VERSION}") file(WRITE "${CMAKE_BINARY_DIR}/VERSION" "${CGAL_CREATED_VERSION_NUM}") - message( STATUS "Generate version.h file") - - #define CGAL_VERSION 3.5-I-135 message(STATUS "CGAL_VERSION is ${CGAL_CREATED_VERSION}") set(CGAL_FULL_VERSION ${CGAL_CREATED_VERSION}) @@ -166,7 +166,7 @@ if ( CGAL_BRANCH_BUILD ) if ( ${CGAL_SCM_NAME} STREQUAL "git" ) - ### TODO GIT_NR? + ### TODO EBEB GIT_NR? set(CGAL_GIT_HASH "n/a") message(STATUS "CGAL_GIT_HASH is ${CGAL_GIT_HASH}") @@ -181,7 +181,7 @@ if ( CGAL_BRANCH_BUILD ) if (CGAL_REPORT_DUPLICATE_FILES) - message(STATUS "Searching for duplicate files") + message("== Searching for duplicate files ==") foreach (package ${CGAL_CONFIGURED_PACKAGES}) @@ -238,6 +238,11 @@ else() # file( READ "${CMAKE_SOURCE_DIR}/VERSION" CGAL_VERSION ) + # Comment from Laurent Rineau, 2012/06/28: + # file(READ ..) should be replace by file(STRINGS ..), and then we take + # the first line. That would avoid parsing errors when the VERSION file + # contains a CR character! + set(CGAL_FULL_VERSION ${CGAL_VERSION}) string( REPLACE "-" "." CGAL_VERSION_TOKENS1 ${CGAL_VERSION} ) string( REPLACE "." ";" CGAL_VERSION_TOKENS ${CGAL_VERSION_TOKENS1} ) @@ -252,10 +257,29 @@ else() list( GET CGAL_VERSION_TOKENS 1 CGAL_MINOR_VERSION ) endif() - if ( CGAL_VERSION_TOKENS_LEN GREATER 3 ) - list( GET CGAL_VERSION_TOKENS 3 CGAL_BUGFIX_VERSION ) - elseif( CGAL_VERSION_TOKENS_LEN GREATER 2 ) + if ( CGAL_VERSION_TOKENS_LEN GREATER 2 ) list( GET CGAL_VERSION_TOKENS 2 CGAL_BUGFIX_VERSION ) + + # The following condition will be true the token #2 is not a number (if + # it is for example "I" or "Ic"): + if(NOT CGAL_BUGFIX_VERSION GREATER 0 AND NOT CGAL_BUGFIX_VERSION EQUAL 0) + set(CGAL_BUGFIX_VERSION 0) + if( CGAL_VERSION_TOKENS_LEN GREATER 3 ) + list( GET CGAL_VERSION_TOKENS 3 CGAL_BUILD_VERSION ) + endif() + else() + if( CGAL_VERSION_TOKENS_LEN GREATER 4 ) + list( GET CGAL_VERSION_TOKENS 4 CGAL_BUILD_VERSION ) + endif() + endif() + # If CGAL_BUILD_VERSION is not a strictly positive number, error + if(NOT CGAL_BUILD_VERSION GREATER 0) + message(WARNING + "Error parsing VERSION file: CGAL_BUILD_VERSION is not a number.\n" + "The content of the VERSION file is:\n${CGAL_VERSION}\n" + "CGAL_BUILD_VERSION was set to:\n${CGAL_BUILD_VERSION}") + set(CGAL_BUILD_VERSION 1000) + endif() endif() if(NOT CGAL_BUGFIX_VERSION) @@ -273,6 +297,9 @@ endif() message( STATUS "CGAL_MAJOR_VERSION=${CGAL_MAJOR_VERSION}" ) message( STATUS "CGAL_MINOR_VERSION=${CGAL_MINOR_VERSION}" ) message( STATUS "CGAL_BUGFIX_VERSION=${CGAL_BUGFIX_VERSION}" ) +if(CGAL_BUILD_VERSION LESS 1000) + message( STATUS "CGAL_BUILD_VERSION=${CGAL_BUILD_VERSION}" ) +endif() # SONAME, SOVERSION # @@ -339,7 +366,26 @@ if ( RUNNING_CGAL_AUTO_TEST ) CGAL_PDB_BINARY_DIR CGAL_PDB_SOURCE_DIR CGAL_Qt3_SOURCE_DIR + CGAL_BINARY_DIR CGAL_SOURCE_DIR) +# message("List of cache variables:") + + ## The following lines removes nasty loaded cache values. We do not + ## want that the current build tree depends on binaries that were + ## build in the reference build tree. + get_property(cache_variables DIRECTORY PROPERTY CACHE_VARIABLES) + foreach(var ${cache_variables}) +# get_property(var_value CACHE ${var} PROPERTY VALUE) +# get_property(type CACHE ${var} PROPERTY TYPE) + string(REGEX MATCH "^CGAL(_.*_(DEPENDS|BINARY_DIR)|_.*LIBRARY)$" var_name_matches ${var}) + if(var_name_matches) + unset(${var} CACHE) +# else() +# message("${var}:${var_type}=${var_value}") + endif() + endforeach() + + endif() endif() endif() @@ -435,8 +481,80 @@ if ( CMAKE_COMPILER_IS_GNUCXX ) endif() +message( "== Generate version files (DONE) ==\n") + +#-------------------------------------------------------------------------------------------------- +# +# -= External libraries =- +# +#-------------------------------------------------------------------------------------------------- + +message("== Detect external libraries ==") + include(CGAL_SetupFlags) +macro( add_config_flag flag ) + + if ( ${flag} ) + file( APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "#define ${flag} 1\n\n") + else() + file( APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//#define ${flag} 1\n\n") + endif() + +endmacro() + +# this is the place to tell which external libs are supporting +# Remarks: +# External libs Qt3 and Qt34are configured when Qt3 or Qt4 as lib of cgal are required +# Coin is used in KDS, but no FindCoin or FindCOIN exists +# There exists FindF2C, FindIPE, FindMKL, but they are only used to support supporting libs +list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 0 GMP MPFR ZLIB OpenGL LEDA MPFI RS RS3 OpenNL TAUCS Eigen3 BLAS LAPACK QGLViewer ESBTL Coin3D NTL IPE) +if (NOT WIN32) + # GMPXX is not supported on WIN32 machines + list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 1 GMPXX) +endif() + +# Where CMake is run several times, to avoid duplicates +list(REMOVE_DUPLICATES CGAL_SUPPORTING_3RD_PARTY_LIBRARIES) +hide_variable(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES) + +# set some to have special prefix +macro( set_special_prefix library prefix) +set(SPECIAL_PREFIXES "${SPECIAL_PREFIXES}set(CGAL_EXT_LIB_${library}_PREFIX \"${prefix}\")\n") +set(CGAL_EXT_LIB_${library}_PREFIX ${prefix}) +endmacro() + +set_special_prefix(Qt4 QT) +set_special_prefix(Eigen3 EIGEN3) +set_special_prefix(QGLViewer QGLVIEWER) +set_special_prefix(Coin3D COIN3D) + +# some libraries are essential (stl and Boost.Thread are treated in another way) +list (INSERT CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES 0 GMP MPFR) +hide_variable(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) + +foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) + + # set standard prefix + if(NOT DEFINED CGAL_EXT_LIB_${lib}_PREFIX) + set(CGAL_EXT_LIB_${lib}_PREFIX ${lib}) + endif() + hide_variable(CGAL_EXT_LIB_${lib}_PREFIX) + + # add option + list( FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION ) + if ( "${POSITION}" STRGREATER "-1" ) # if lib is essential + option(WITH_${lib} "Select external library ${lib}" ON) + else() + option(WITH_${lib} "Select external library ${lib}" OFF) + endif() + + if (WITH_${lib}) + add_config_flag( ${CGAL_EXT_LIB_${lib}_PREFIX} ) + endif() + +endforeach() + #-------------------------------------------------------------------------------------------------- # # -= DEPENDENCIES =- @@ -448,13 +566,26 @@ include(CGAL_SetupFlags) # But they are not intended to persist from run to run as normal cache variables. # Similar variables are created when a library is detected. # +cache_set(CGAL_3RD_PARTY_PRECONFIGURED "" ) + cache_set(CGAL_3RD_PARTY_DEFINITIONS "" ) cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS "" ) cache_set(CGAL_3RD_PARTY_LIBRARIES "" ) cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS "" ) +# default is on, but some use-cases need to set it to off, e.g., debian packages +option( CGAL_ENABLE_PRECONFIG "Select to allow to preconfiguration of external libraries" ON) +# additional info: some header files in CGAL add additional code if +# certain optional libs are installed, and some examples/tests rely on +# this; e.g. in MPFI/RS in Algebraic_kernel_d. For these cases CGAL +# and the example/test must be configured with MPFI (just one is not sufficient) + +option( CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT "Select to allow to use all preconfigured external libraries" OFF) + include(CGAL_SetupDependencies) +message("== Detect external libraries (DONE) ==\n") + #-------------------------------------------------------------------------------------------------- # # -= Generation of compiler_config.h =- @@ -465,22 +596,14 @@ include(CGAL_SetupDependencies) # Note: CMake will not notice when files are added or removed # but this is probably OK for the installation procedure. +message("== Write compiler_config.h ==") + file(GLOB all_config_tests "${CGAL_INSTALLATION_PACKAGE_DIR}/config/testfiles/*.cpp") list( SORT all_config_tests ) file( WRITE ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//\n// compiler_config.h is included by CGAL headers to load the needed compiler settings.\n//\n// DO NOT EDIT compiler_config.h. It is generated by CMake.\n//\n\n") -macro( add_config_flag flag ) - - if ( ${flag} ) - file( APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "#define ${flag} 1\n\n") - else() - file( APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//#define ${flag} 1\n\n") - endif() - -endmacro() - cache_get(CONFIG_CXX_FLAGS) foreach(config_test_cpp ${all_config_tests}) @@ -516,7 +639,11 @@ add_config_flag( CGAL_USE_RS ) add_config_flag( CGAL_USE_NTL ) add_config_flag( CGAL_BUILD_SHARED_LIBS ) -set(CGAL_USE_CORE ${CGAL_USE_GMP}) +if (NOT ${WITH_CGAL_Core}) + set(CGAL_USE_CORE FALSE) +else() + set(CGAL_USE_CORE ${CGAL_USE_GMP}) +endif() add_config_flag( CGAL_USE_CORE ) # ^^ there is CGAL_USE_CORE and not CGAL_HAS_CORE, as CORE is considered # as external lib and not as CGAL component (EBEB: 24 Jan 2012) @@ -555,12 +682,16 @@ set ( CGAL_INSTALL_MAN_DIR "share/man/man1" CACHE STRING "The folder where manual pages for CGAL scripts will be installed, relative to CMAKE_INSTALL_PREFIX" ) +message("== Write compiler_config.h (DONE) ==\n") + #-------------------------------------------------------------------------------------------------- # # -= Build =- # #-------------------------------------------------------------------------------------------------- +message("== Generating build files ==") + set(CGAL_LIBRARIES_DIR ${CMAKE_BINARY_DIR}/lib) set(CGAL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include) @@ -571,22 +702,29 @@ endforeach() include_directories (${CGAL_INCLUDE_DIRS}) -add_subdirectory(src) - cache_get(CGAL_LIBRARY) +cache_get(CGAL_3RD_PARTY_PRECONFIGURED ) + cache_get(CGAL_3RD_PARTY_DEFINITIONS ) cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS ) cache_get(CGAL_3RD_PARTY_LIBRARIES ) cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS) +add_subdirectory(src) + +hide_variable(EXECUTABLE_OUTPUT_PATH) +hide_variable(LIBRARY_OUTPUT_PATH) # # Repeat some problems # +message("== Generating build files (DONE) ==\n") if (CGAL_BRANCH_BUILD AND CGAL_REPORT_DUPLICATE_FILES ) - if (CGAL_DUPLICATE_HEADER_FILES) + message( STATUS "Problems: ") + + if (CGAL_DUPLICATE_HEADER_FILES) message(WARNING "WARNING: Duplicate header files") foreach(hfile ${CGAL_DUPLICATE_HEADER_FILES}) message(STATUS " File '${hfile}' multiply found in ") diff --git a/Installation/INSTALL b/Installation/INSTALL index f35323a25a2..1fd98730bc9 100644 --- a/Installation/INSTALL +++ b/Installation/INSTALL @@ -11,7 +11,7 @@ are for the most common use cases, and cover the command line tools. For further information, or in case of problems, please see the detailed installation instructions, which can be found in this distribution in the file ./doc_html/index.html or on the CGAL website -http://www.cgal.org/Manual/beta/doc_html/cgal_manual/Installation/Chapter_main.html +http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Installation/Chapter_main.html The documentation of CGAL is available in PDF and HTML formats. It is not bundled with the software but can be downloaded separately @@ -27,7 +27,7 @@ PREREQUISITES ============= To install CGAL, you need 'cmake' and several third-party libraries. -Some are mandatory for entire CGAL, some are mandatory for particular +Some are essential for entire CGAL, some are mandatory for particular CGAL packages, some are only needed for demos. * CMake (>= 2.6.2), the build system used by CGAL @@ -36,7 +36,7 @@ CGAL packages, some are only needed for demos. * Boost (>= 1.39) Required for building CGAL and for applications using CGAL - Required compiled Boost library: Boost.Threads + Required compiled Boost library: Boost.Thread, Boost.System Optional compiled Boost library: Boost.Program_options http://www.boost.org/ or http://www.boostpro.com/products/free/ You need the former if you plan to compile the boost libraries yourself, diff --git a/Installation/changes.html b/Installation/changes.html index 2155232a57c..a92e174b2e2 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -59,6 +59,9 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -218,37 +267,29 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
4.1  (September 2012) +
4.0.2  (July 2012) +
4.0.1  (July 2012)
4.0  (March 2012)
3.9  (September 2011)
3.8  (April 2011) @@ -100,6 +103,124 @@ David A. Wheeler's 'SLOCCount', restricted to the include/CGAL/
+

Release 4.1

+
+

Release date:

+ +

Installation

+
    +
  • CGAL-4.1 no longer supports the Intel Compiler version 11.0. The Intel + Compiler version 12.0 is supported instead.
  • +
  • Improved configuration for essential and optional external third party software
  • +
  • Added more general script to create CMakeLists.txt files: cgal_create_CMakeLists
  • +
  • Availability tests for C++11 features are now performed with the help of Boost.Config. A Boost version of 1.40.0 or higher is needed to use C++11 features.
  • +
+ +

2D Convex Hulls and Extreme Points

+
    +
  • Speed up the preprocessing stage of the Akl-Toussaint implementation (used by the free function convex_hull_2 when forward iterators are provided as input).
  • +
+ +

Combinatorial Maps

+
    +
  • Minor bugfix; replace some functors by methods.
  • +
+ +

Linear Cell Complex

+
    +
  • Improve the demo: add a widget showing all the volumes and an operation to create a Menger sponge.
  • +
+ +

Kernels

+
    +
  • All Kernel functors now support the result_of protocol.
  • +
+ +

STL_Extensions for CGAL

+
    +
  • The namespace cpp0x has been renamed cpp11. The old name is still available for backward compatibility.
  • +
+ +
+ +

Release 4.0.2

+
+

Release date: Jul 2012

+ +

+This is a bug fix release. It fixes a bug in +the CMakeLists.txt for CGAL-4.0.1, that prevented even +building the libraries. +

+ +
+ +

Release 4.0.1

+ +
+

Release date: Jul 2012

+ +

+This is a bug fix release. Apart various minor fixes in the documentation, +the following has been changed since CGAL-4.0:

+ +

2D Voronoi Diagram Adaptor (re-added)

+
    +
  • The package 2D Voronoi Diagram Adaptor was temporarily + removed from the CGAL distribution because of license issues. That + package is now back into CGAL. +
  • +
+ +

2D and 3D Geometry Kernel

+
    +
  • Fix a bug in the Segment_3-Triangle_3 intersection function in the case the segment is collinear with a triangle edge.
  • +
+ +

Algebraic Kernel

+
    +
  • Avoid the linking error "duplicate symbols" when two compilation units + using the algebraic kernel are linked.
  • +
+ +

3D Boolean Operations on Nef Polygons Embedded on the Sphere

+
    +
  • Fix a memory leak due to the usage of an internal mechanism that has + been replaced by boost::any. This also influences the + packages 2D Boolean Operations on Nef Polygons, 3D Boolean Operations on + Nef Polyhedra, Convex Decomposition of Polyhedra, and 3D Minkowski Sum of + Polyhedra.
  • +
+ +

2D Arrangement

+
    +
  • Fix several memory leaks.
  • +
+ +

2D Mesh Generation

+
    +
  • Fix a compilation error in the + header <CGAL/Mesh_2/Do_not_refine_edges.h> when g++ + version 4.7 is used.
  • +
+ +

Surface Mesh Generation and 3D Mesh Generation

+
    +
  • Fix an important bug in the CGAL_ImageIO library, that + could lead to wrong result when meshing from a 3D image.
  • +
  • Fix the compilation of the demo in demo/Surface_mesher, + when Boost version 1.48 or 1.49 is used.
  • +
+ +

Surface Mesh Parameterization

+
    +
  • Fix a memory leak.
  • +
  • Fix a compatibility issue with Eigen-3.1 of Eigen_solver_traits. This fix also affects the usage of +that class in the package Surface Reconstruction from Point Sets.
  • +
+ +
+

Release 4.0

Release date: March 2012

diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index c54c76906b9..dbea688da31 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -71,11 +71,12 @@ set(CGAL_Qt4_3RD_PARTY_DEFINITIONS "@CGAL_Qt4_3RD_PARTY_DEFINITIONS@" ) set(CGAL_Qt4_3RD_PARTY_LIBRARIES_DIRS "@CGAL_Qt4_3RD_PARTY_LIBRARIES_DIRS@" ) set(CGAL_Qt4_3RD_PARTY_LIBRARIES "@CGAL_Qt4_3RD_PARTY_LIBRARIES@" ) -set(CGAL_VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUILD_VERSION}") -set(CGAL_GMP_VERSION "@GMP_VERSION@") -set(CGAL_MPFR_VERSION "@MPFR_VERSION@") -set(CGAL_USE_FILE "${CGAL_MODULES_DIR}/UseCGAL.cmake" ) +set(CGAL_VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUILD_VERSION}") + +set(CGAL_USE_FILE "${CGAL_MODULES_DIR}/UseCGAL.cmake" ) + +set(CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT "@CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT@") if ( CGAL_FIND_REQUIRED ) set( CHECK_CGAL_COMPONENT_MSG_ON_ERROR TRUE ) @@ -91,34 +92,48 @@ else() endif() endif() +set(CGAL_CONFIGURED_LIBRARIES "@CGAL_CONFIGURED_LIBRARIES@") + macro(check_cgal_component COMPONENT) set( CGAL_LIB CGAL${COMPONENT} ) - if ( WITH_${CGAL_LIB} ) + if ( "${CGAL_LIB}" STREQUAL "CGAL" ) set( ${CGAL_LIB}_FOUND TRUE ) - else() - set( ${CGAL_LIB}_FOUND FALSE ) - endif() - - if ( "${COMPONENT}" STREQUAL "" ) set( CHECK_${CGAL_LIB}_ERROR_TAIL "" ) - else() + else() + if ( WITH_${CGAL_LIB} ) + set( ${CGAL_LIB}_FOUND TRUE ) + else() + set( ${CGAL_LIB}_FOUND FALSE ) + endif() set( CHECK_${CGAL_LIB}_ERROR_TAIL " Please configure CGAL using WITH_${CGAL_LIB}=ON." ) - endif() - + endif() + if ( NOT ${CGAL_LIB}_FOUND AND CHECK_CGAL_COMPONENT_MSG_ON_ERROR ) message( ${CHECK_CGAL_COMPONENT_ERROR_TYPE} "${CHECK_CGAL_COMPONENT_ERROR_TITLE} The ${CGAL_LIB} library was not configured.${CHECK_${CGAL_LIB}_ERROR_TAIL}" ) endif() endmacro() -check_cgal_component("") +check_cgal_component("") # for CGAL itself foreach( CGAL_COMPONENT ${CGAL_FIND_COMPONENTS} ) - check_cgal_component("_${CGAL_COMPONENT}") + + list (FIND CGAL_CONFIGURED_LIBRARIES "${CGAL_COMPONENT}" POSITION) + if ("${POSITION}" STRGREATER "-1") # means: CGAL_COMPONENT is contained in list + check_cgal_component("_${CGAL_COMPONENT}") +# TODO EBEB do something for supporting lib in check_component? + endif() + endforeach() # Starting with cmake 2.6.3, CGAL_FIND_COMPONENTS is cleared out when find_package returns. # But we need it within UseCGAL.cmake, so we save it aside into another variable set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} ) + +# for preconfigured libs +set(CGAL_ENABLE_PRECONFIG "@CGAL_ENABLE_PRECONFIG@") +set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@") +set(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "@CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES@") + diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index 61ad3d6e899..df6515bfaf2 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -73,11 +73,11 @@ set(CGAL_Qt4_3RD_PARTY_LIBRARIES_DIRS "@CGAL_Qt4_3RD_PARTY_LIBRARIES_DIRS@" ) set(CGAL_Qt4_3RD_PARTY_LIBRARIES "@CGAL_Qt4_3RD_PARTY_LIBRARIES@" ) set(CGAL_VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUILD_VERSION}") -set(CGAL_GMP_VERSION "@GMP_VERSION@") -set(CGAL_MPFR_VERSION "@MPFR_VERSION@") set(CGAL_USE_FILE "${CGAL_MODULES_DIR}/UseCGAL.cmake" ) +set(CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT "@CGAL_ALLOW_ALL_PRECONFIGURED_LIBS_COMPONENT@") + if ( CGAL_FIND_REQUIRED ) set( CHECK_CGAL_COMPONENT_MSG_ON_ERROR TRUE ) set( CHECK_CGAL_COMPONENT_ERROR_TYPE FATAL_ERROR ) @@ -92,34 +92,48 @@ else() endif() endif() +set(CGAL_CONFIGURED_LIBRARIES "@CGAL_CONFIGURED_LIBRARIES@") + macro(check_cgal_component COMPONENT) set( CGAL_LIB CGAL${COMPONENT} ) - if ( WITH_${CGAL_LIB} ) + if ( "${CGAL_LIB}" STREQUAL "CGAL" ) set( ${CGAL_LIB}_FOUND TRUE ) - else() - set( ${CGAL_LIB}_FOUND FALSE ) - endif() - - if ( "${COMPONENT}" STREQUAL "" ) set( CHECK_${CGAL_LIB}_ERROR_TAIL "" ) - else() + else() + if ( WITH_${CGAL_LIB} ) + set( ${CGAL_LIB}_FOUND TRUE ) + else() + set( ${CGAL_LIB}_FOUND FALSE ) + endif() set( CHECK_${CGAL_LIB}_ERROR_TAIL " Please configure CGAL using WITH_${CGAL_LIB}=ON." ) - endif() - + endif() + if ( NOT ${CGAL_LIB}_FOUND AND CHECK_CGAL_COMPONENT_MSG_ON_ERROR ) message( ${CHECK_CGAL_COMPONENT_ERROR_TYPE} "${CHECK_CGAL_COMPONENT_ERROR_TITLE} The ${CGAL_LIB} library was not configured.${CHECK_${CGAL_LIB}_ERROR_TAIL}" ) endif() endmacro() -check_cgal_component("") +check_cgal_component("") # for CGAL itself foreach( CGAL_COMPONENT ${CGAL_FIND_COMPONENTS} ) - check_cgal_component("_${CGAL_COMPONENT}") + + list (FIND CGAL_CONFIGURED_LIBRARIES "${CGAL_COMPONENT}" POSITION) + if ("${POSITION}" STRGREATER "-1") # means: CGAL_COMPONENT is contained in list + check_cgal_component("_${CGAL_COMPONENT}") +# TODO EBEB do something for supporting lib in check_component? + endif() + endforeach() # Starting with cmake 2.6.3, CGAL_FIND_COMPONENTS is cleared out when find_package returns. # But we need it within UseCGAL.cmake, so we save it aside into another variable set( CGAL_REQUESTED_COMPONENTS ${CGAL_FIND_COMPONENTS} ) + +# for preconfigured libs +set(CGAL_ENABLE_PRECONFIG "@CGAL_ENABLE_PRECONFIG@") +set(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES "@CGAL_SUPPORTING_3RD_PARTY_LIBRARIES@") +set(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "@CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES@") + diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index e27419f8680..6b1cba9d72e 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -53,5 +53,8 @@ if( NOT CGAL_COMMON_FILE_INCLUDED ) endif() set(CMAKE_COLORMAKEFILE ON) + + # set minimal version of some optional libraries: + set( Eigen3_FIND_VERSION "3.1.0") endif() diff --git a/Installation/cmake/modules/CGAL_FindPackageHandleStandardArgs.cmake b/Installation/cmake/modules/CGAL_FindPackageHandleStandardArgs.cmake deleted file mode 100644 index ebb8e90e94e..00000000000 --- a/Installation/cmake/modules/CGAL_FindPackageHandleStandardArgs.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... ) -# This macro is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and -# it also sets the _FOUND variable. -# The package is found if all variables listed are TRUE. -# Example: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) -# -# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. -# If it is not found and REQUIRED was used, it fails with FATAL_ERROR, -# independent whether QUIET was used or not. -# If it is found, the location is reported using the VAR1 argument, so -# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out. -# If the second argument is DEFAULT_MSG, the message in the failure case will -# be "Could NOT find LibXml2", if you don't like this message you can specify -# your own custom failure message there. - -macro(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) - - if("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - set(_FAIL_MESSAGE "Could NOT find ${_NAME}") - else() - set(_FAIL_MESSAGE "${_FAIL_MSG}") - endif() - - string(TOUPPER ${_NAME} _NAME_UPPER) - - set(${_NAME_UPPER}_FOUND TRUE) - if(NOT ${_VAR1}) - set(${_NAME_UPPER}_FOUND FALSE) - endif() - - foreach(_CURRENT_VAR ${ARGN}) - if(NOT ${_CURRENT_VAR}) - set(${_NAME_UPPER}_FOUND FALSE) - endif() - endforeach() - - if (${_NAME_UPPER}_FOUND) - if (NOT ${_NAME}_FIND_QUIETLY) - message(STATUS "Found ${_NAME}: ${${_VAR1}}") - endif() - else() - if (${_NAME}_FIND_REQUIRED) - message(FATAL_ERROR "${_FAIL_MESSAGE}") - else() - if (NOT ${_NAME}_FIND_QUIETLY) - message(STATUS "${_FAIL_MESSAGE}") - endif() - endif() - endif() - -endmacro() diff --git a/Installation/cmake/modules/CGAL_Macros.cmake b/Installation/cmake/modules/CGAL_Macros.cmake index 62d048533f1..340ea3abcea 100644 --- a/Installation/cmake/modules/CGAL_Macros.cmake +++ b/Installation/cmake/modules/CGAL_Macros.cmake @@ -81,7 +81,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) set( ${var} "NOTFOUND" ) endif() endmacro() - + macro( found_in_list item_list item result ) set( ${result} "FALSE" ) foreach( element ${${item_list}} ) @@ -90,7 +90,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endif() endforeach() endmacro() - + macro( uniquely_add_flags target_var ) if ( "${ARGC}" GREATER "1" ) set( target_list "${${target_var}}" ) @@ -204,6 +204,161 @@ if( NOT CGAL_MACROS_FILE_INCLUDED ) endmacro() + macro( use_lib ) + + set (lib "${ARGV0}") + + set (vlib ${CGAL_EXT_LIB_${lib}_PREFIX} ) + + if ( ${vlib}_FOUND AND (NOT TARGET CGAL OR WITH_${lib})) + + if ( NOT ${vlib}_SETUP ) # avoid double usage + + if ( "${ARGC}" EQUAL "2" ) + + set (usefile "${ARGV1}") + + include( ${usefile} ) + message (STATUS "Configured ${lib} from UseLIB-file: ${usefile}") + + # UseLIB-file has to set ${vlib}_SETUP to TRUE + # TODO EBEB what about Qt4, Qt3, zlib? + + else() + + ####message( STATUS "${lib} include: ${${vlib}_INCLUDE_DIR}" ) + include_directories ( ${${vlib}_INCLUDE_DIR} ) + + # TODO EBEB remove definitions? + ####message( STATUS "${lib} definitions: ${${vlib}_DEFINITIONS}" ) + add_definitions( ${${vlib}_DEFINITIONS} "-DCGAL_USE_${vlib}" ) + + if ( ${vlib}_LIBRARIES ) + ####message( STATUS "${lib} libraries: ${${vlib}_LIBRARIES}" ) + link_libraries( ${${vlib}_LIBRARIES} ) + endif() + + ####message (STATUS "Configured ${lib} in standard way") + + set( ${vlib}_SETUP TRUE ) + + endif() + + endif() + + if (NOT ${vlib}_SETUP ) + + message( WARNING "${vlib} has not been set up" ) + + endif() + + else() + + if ( WITH_${lib} ) + message( SEND_ERROR "Try to use ${lib} that is not found") + endif() + + endif() + + endmacro() + + + macro( use_component component) + + message (STATUS "Requested component: ${component}") + + if(WITH_CGAL_${component}) + if(TARGET CGAL_${component}) + add_to_list( CGAL_LIBRARIES CGAL_${component} ) + else() + 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") + find_package( OpenGL ) + find_package( ZLIB ) + endif() + + if (${component} STREQUAL "Qt3") + find_package( OpenGL ) + find_package( Qt3-patched ) + endif() + + if (${component} STREQUAL "Qt4") + find_package( OpenGL ) + find_package( Qt4 ) + endif() + + else(WITH_CGAL_${component}) + + # now we are talking about 3rd party libs + + if ( ${component} STREQUAL "ALL_PRECONFIGURED_LIBS" ) + + 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) + 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}) + 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() + + endif() + + endif(WITH_CGAL_${component}) + + endmacro() + + macro( use_essential_libs ) + + # Comment: This is subject to be changed in the future + # - either more specific (giving precise include_dir- and link-order) + # - or even less specific if order becomes less relevant + # Eric Berberich 2012/06/29 + + use_component( MPFR ) + if (GMPXX_FOUND) + use_component( GMPXX ) + endif() + use_component( GMP ) + + endmacro() + + function( cgal_setup_module_path ) # Avoid to modify the modules path twice if(NOT CGAL_MODULE_PATH_IS_SET) @@ -237,11 +392,46 @@ 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}") + + 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") + file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_FOUND \"${${vlib}_FOUND}\" )\n") + file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_USE_FILE \"${${vlib}_USE_FILE}\" )\n") + file( APPEND ${CMAKE_BINARY_DIR}/CGALConfig.cmake " set( ${vlib}_INCLUDE_DIR \"${${vlib}_INCLUDE_DIR}\" )\n") + 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") + file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_USE_FILE \"${${vlib}_USE_FILE}\" )\n") + file( APPEND ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake " set( ${vlib}_INCLUDE_DIR \"${${vlib}_INCLUDE_DIR}\" )\n") + 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() + + endforeach() + endmacro() macro ( fetch_env_var VAR ) @@ -459,8 +649,6 @@ endif() function(process_CGAL_subdirectory entry subdir type_name) # For example, subdir can be "examples", type_name "example", and entry "Mesh_2" - message( STATUS "Configuring ${subdir} in ${entry}" ) - if ( CGAL_BRANCH_BUILD ) string( REGEX REPLACE "${CMAKE_SOURCE_DIR}/.*/${subdir}/" "" ENTRY_DIR_NAME "${entry}" ) else() @@ -482,12 +670,14 @@ function(process_CGAL_subdirectory entry subdir type_name) if(dont_submit_grep) set(ADD_SUBDIR FALSE) endif() - file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${subdir}") + file(STRINGS ${entry}/../../dont_submit dont_submit_grep REGEX "^${subdir}/?\$") if(dont_submit_grep) set(ADD_SUBDIR FALSE) endif() endif() + if(ADD_SUBDIR) + message("\n-- Configuring ${subdir} in ${subdir}/${ENTRY_DIR_NAME}") if(EXISTS ${entry}/CMakeLists.txt) add_subdirectory( ${entry} ${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME} ) else() @@ -496,7 +686,7 @@ function(process_CGAL_subdirectory entry subdir type_name) execute_process( COMMAND bash ${CGAL_CREATE_CMAKE_SCRIPT} ${type_name} --source_dir "${entry}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}" - RESULT_VARIABLE RESULT_VAR) + RESULT_VARIABLE RESULT_VAR OUTPUT_QUIET) if(NOT RESULT_VAR) # message("Subdir ${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") add_subdirectory( "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}" "${CMAKE_BINARY_DIR}/${subdir}/${ENTRY_DIR_NAME}") diff --git a/Installation/cmake/modules/CGAL_SetupBoost.cmake b/Installation/cmake/modules/CGAL_SetupBoost.cmake index fc3dc11f4c3..3d3351b9dc1 100644 --- a/Installation/cmake/modules/CGAL_SetupBoost.cmake +++ b/Installation/cmake/modules/CGAL_SetupBoost.cmake @@ -3,7 +3,7 @@ if ( NOT CGAL_Boost_Setup ) include(CGAL_TweakFindBoost) # In the documentation, we say we require Boost-1.39, but technically we # require 1.33.1. Some packages may require more recent versions, though. - find_package( Boost 1.33.1 REQUIRED thread ) + find_package( Boost 1.33.1 REQUIRED thread system ) message( STATUS "Boost include: ${Boost_INCLUDE_DIRS}" ) message( STATUS "Boost libraries: ${Boost_LIBRARIES}" ) diff --git a/Installation/cmake/modules/CGAL_SetupDependencies.cmake b/Installation/cmake/modules/CGAL_SetupDependencies.cmake index c40deb88b46..0475cb40b1b 100644 --- a/Installation/cmake/modules/CGAL_SetupDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupDependencies.cmake @@ -1,32 +1,85 @@ -option( WITH_GMP "Use the GMP number types if available." ON ) -if ( WITH_GMP ) - include(CGAL_SetupGMPXX) - include(CGAL_SetupGMP) -endif( WITH_GMP ) +include(CGAL_Macros) + +message ( STATUS "External libraries supported: ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}") + +foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) + + # Part 1: Try to find lib + + set (vlib "${CGAL_EXT_LIB_${lib}_PREFIX}") + + # Check whether lib is essential or WITH_ is given: + + list(FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION) + + if ("${POSITION}" STRGREATER "-1" OR WITH_${lib}) + + # In both cases CGAL_USE_ will be finally set. + + #message (STATUS "With ${lib} given or essential: pos=${POSITION}") + + if ( CGAL_ENABLE_PRECONFIG ) + message (STATUS "Preconfiguring library: ${lib} ...") + else() + message (STATUS "Configuring library: ${lib} ...") + endif() + + find_package( ${lib} ) + + if ( ${vlib}_FOUND ) + if ( CGAL_ENABLE_PRECONFIG ) + message( STATUS "${lib} has been preconfigured:") + message( STATUS " CGAL_Use${lib}-file: ${${vlib}_USE_FILE}") + message( STATUS " ${lib} include: ${${vlib}_INCLUDE_DIR}" ) + message( STATUS " ${lib} libraries: ${${vlib}_LIBRARIES}" ) + message( STATUS " ${lib} definitions: ${${vlib}_DEFINITIONS}" ) + else() + message( STATUS "${lib} has been configured") + use_lib( ${vlib} "{${vlib}_USE_FILE}") + endif() + + # TODO EBEB what about Qt3, Qt4, zlib etc? + set ( CGAL_USE_${vlib} TRUE ) + + + # Part 2: Add some lib-specific definitions or obtain version + + if (${lib} STREQUAL "GMP") + get_dependency_version(GMP) + endif() + + if (${lib} STREQUAL "MPFR") + set( MPFR_DEPENDENCY_INCLUDE_DIR ${GMP_INCLUDE_DIR} ) + set( MPFR_DEPENDENCY_LIBRARIES ${GMP_LIBRARIES} ) + get_dependency_version(MPFR) + endif() + + if (${lib} STREQUAL "LEDA") + # special case for LEDA - add a flag + message( STATUS "$LEDA cxx flags: ${LEDA_CXX_FLAGS}" ) + uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} ) + endif() + + else() + + if ("${POSITION}" STRGREATER "-1") # if lib is essential + message( FATAL_ERROR "CGAL requires ${lib} to be found" ) + endif() + + endif() + + endif() + +endforeach() + +if( (GMP_FOUND AND NOT MPFR_FOUND) OR (NOT GMP_FOUND AND MPFR_FOUND) ) + message( FATAL_ERROR "CGAL needs for its full functionality both GMP and MPFR.") +endif() if( NOT GMP_FOUND ) set(CGAL_NO_CORE ON) message( STATUS "CGAL_Core needs GMP, cannot be configured.") endif( NOT GMP_FOUND ) -option ( WITH_LEDA "Use the LEDA number types if available." OFF ) -if ( WITH_LEDA ) - include(CGAL_SetupLEDA) -endif( WITH_LEDA ) - -option ( WITH_MPFI "Use MPFI if available." OFF ) -if ( WITH_MPFI ) - include(CGAL_SetupMPFI) -endif( WITH_MPFI ) - -option ( WITH_RS "Use RS if available." OFF ) -if ( WITH_RS ) - include(CGAL_SetupRS) -endif( WITH_RS ) - -option ( WITH_NTL "Use NTL if available." OFF ) -if ( WITH_NTL ) - include(CGAL_SetupNTL) -endif( WITH_NTL ) - +# finally setup Boost include(CGAL_SetupBoost) diff --git a/Installation/cmake/modules/CGAL_SetupGMPXX.cmake b/Installation/cmake/modules/CGAL_SetupGMPXX.cmake deleted file mode 100644 index 3a535b624d9..00000000000 --- a/Installation/cmake/modules/CGAL_SetupGMPXX.cmake +++ /dev/null @@ -1,28 +0,0 @@ -if ( NOT WIN32 AND NOT CGAL_GMPXX_SETUP ) - - option( WITH_GMPXX "Search for GMPXX" ON ) - - if ( WITH_GMPXX ) - - find_package( GMPXX QUIET ) - - if ( GMPXX_FOUND ) - - message( STATUS "GMPXX include: ${GMPXX_INCLUDE_DIR}" ) - message( STATUS "GMPXX libraries: ${GMPXX_LIBRARIES}" ) - - set ( CGAL_USE_GMPXX 1 ) - - include(CGAL_Macros) - - add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${GMPXX_INCLUDE_DIR} ) - add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${GMPXX_LIBRARIES} ) - - endif() - - endif() - - set( CGAL_GMPXX_SETUP TRUE ) - -endif() - diff --git a/Installation/cmake/modules/CGAL_SetupLEDA.cmake b/Installation/cmake/modules/CGAL_SetupLEDA.cmake deleted file mode 100644 index b2da6cb58d5..00000000000 --- a/Installation/cmake/modules/CGAL_SetupLEDA.cmake +++ /dev/null @@ -1,27 +0,0 @@ -if ( NOT CGAL_LEDA_SETUP ) - - find_package( LEDA ) - - if ( LEDA_FOUND ) - - message( STATUS "LEDA include: ${LEDA_INCLUDE_DIR}" ) - message( STATUS "LEDA libraries: ${LEDA_LIBRARIES}" ) - message( STATUS "LEDA definitions: ${LEDA_DEFINITIONS}" ) - - set ( CGAL_USE_LEDA 1 ) - - include(CGAL_Macros) - - add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${LEDA_INCLUDE_DIR} ) - add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS ${LEDA_DEFINITIONS} ) - add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${LEDA_LIBRARIES} - ${LEDA_LINKER_FLAGS}) - - uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} ) - - endif() - - - set ( CGAL_LEDA_SETUP TRUE ) - -endif() diff --git a/Installation/cmake/modules/CGAL_SetupMPFI.cmake b/Installation/cmake/modules/CGAL_SetupMPFI.cmake deleted file mode 100644 index de907407460..00000000000 --- a/Installation/cmake/modules/CGAL_SetupMPFI.cmake +++ /dev/null @@ -1,27 +0,0 @@ -if ( NOT CGAL_MPFI_SETUP ) - - find_package( MPFI ) - - if ( MPFI_FOUND ) - - message( STATUS "MPFI include: ${MPFI_INCLUDE_DIR}" ) - message( STATUS "MPFI libraries: ${MPFI_LIBRARIES}" ) - message( STATUS "MPFI definitions: ${MPFI_DEFINITIONS}" ) - - set ( CGAL_USE_MPFI TRUE ) - - include(CGAL_Macros) - - add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${MPFI_INCLUDE_DIR} ) - add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS ${MPFI_DEFINITIONS} ) - add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${MPFI_LIBRARIES} - ${MPFI_LINKER_FLAGS}) - - uniquely_add_flags( CMAKE_CXX_FLAGS ${MPFI_CXX_FLAGS} ) - - endif() - - - set ( CGAL_MPFI_SETUP TRUE ) - -endif() diff --git a/Installation/cmake/modules/CGAL_SetupNTL.cmake b/Installation/cmake/modules/CGAL_SetupNTL.cmake deleted file mode 100644 index 30ef5c3abf7..00000000000 --- a/Installation/cmake/modules/CGAL_SetupNTL.cmake +++ /dev/null @@ -1,27 +0,0 @@ -if ( NOT CGAL_NTL_SETUP ) - - find_package( NTL ) - - if ( NTL_FOUND ) - - message( STATUS "NTL include: ${NTL_INCLUDE_DIR}" ) - message( STATUS "NTL libraries: ${NTL_LIBRARIES}" ) - message( STATUS "NTL definitions: ${NTL_DEFINITIONS}" ) - - set ( CGAL_USE_NTL TRUE ) - - include(CGAL_Macros) - - add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${NTL_INCLUDE_DIR} ) - add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS ${NTL_DEFINITIONS} ) - add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${NTL_LIBRARIES} - ${NTL_LINKER_FLAGS}) - - uniquely_add_flags( CMAKE_CXX_FLAGS ${NTL_CXX_FLAGS} ) - - endif() - - - set ( CGAL_NTL_SETUP TRUE ) - -endif() diff --git a/Installation/cmake/modules/CGAL_SetupRS.cmake b/Installation/cmake/modules/CGAL_SetupRS.cmake deleted file mode 100644 index d88eb42af53..00000000000 --- a/Installation/cmake/modules/CGAL_SetupRS.cmake +++ /dev/null @@ -1,63 +0,0 @@ -if ( NOT CGAL_RS_SETUP ) - - find_package( RS ) - - if ( RS_FOUND ) - - message( STATUS "RS include: ${RS_INCLUDE_DIR}" ) - message( STATUS "RS libraries: ${RS_LIBRARIES}" ) - message( STATUS "RS definitions: ${RS_DEFINITIONS}" ) - - if( APPLE AND CMAKE_COMPILER_IS_GNUCXX ) - include( CGAL_VersionUtils ) - EXEC_PROGRAM( ${CMAKE_CXX_COMPILER} - ARGS -dumpversion - OUTPUT_VARIABLE RS_GXX_VERSION ) - VERSION_DECOMPOSE( ${RS_GXX_VERSION} GXX_MAJ GXX_MIN GXX_PAT GXX_TWE ) - IS_VERSION_LESS( "${GXX_MAJ}.${GXX_MIN}" "4.3" IS_OLD_GXX ) - if( IS_OLD_GXX ) - message( STATUS "TLS is not supported by g++<4.3 on Mac OS X" ) - add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS "-DCGAL_RS_NO_TLS" ) - endif( IS_OLD_GXX ) - endif( APPLE AND CMAKE_COMPILER_IS_GNUCXX ) - - set ( CGAL_USE_RS 1 ) - - include(CGAL_Macros) - - add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${RS_INCLUDE_DIR} ) - add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS ${RS_DEFINITIONS} "-DCGAL_USE_RS" ) - add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${RS_LIBRARIES} - ${RS_LINKER_FLAGS}) - - uniquely_add_flags( CMAKE_CXX_FLAGS ${RS_CXX_FLAGS} ) - - endif() - - # add rs3 parameters, if necessary (rs3 must be always after rsexport) - if( RS3_FOUND ) - - message( STATUS "RS3 include: ${RS3_INCLUDE_DIR}" ) - message( STATUS "RS3 definitions: ${RS3_DEFINITIONS}" ) - message( STATUS "RS3 libraries: ${RS3_LIBRARIES}" ) - - set ( CGAL_USE_RS3 1 ) - - include(CGAL_Macros) - - add_to_cached_list(CGAL_3RD_PARTY_INCLUDE_DIRS ${RS3_INCLUDE_DIR} ) - add_to_cached_list(CGAL_3RD_PARTY_DEFINITIONS ${RS3_DEFINITIONS} "-DCGAL_USE_RS3" ) - add_to_cached_list(CGAL_3RD_PARTY_LIBRARIES ${RS3_LIBRARIES} - ${RS3_LINKER_FLAGS}) - - uniquely_add_flags( CMAKE_CXX_FLAGS ${RS3_CXX_FLAGS} ) - - endif( RS3_FOUND ) - - - - - - set ( CGAL_RS_SETUP TRUE ) - -endif() diff --git a/Installation/cmake/modules/CGAL_UseBLAS.cmake b/Installation/cmake/modules/CGAL_UseBLAS.cmake index 9e3bd72a4c6..37de5468bc5 100644 --- a/Installation/cmake/modules/CGAL_UseBLAS.cmake +++ b/Installation/cmake/modules/CGAL_UseBLAS.cmake @@ -1,8 +1,9 @@ # This module setups the compiler for the BLAS libraries. # It assumes that find_package(BLAS) was already called. -if ( BLAS_FOUND AND NOT CGAL_BLAS_SETUP ) +if ( BLAS_FOUND AND NOT BLAS_SETUP ) + message( STATUS "UseBLAS" ) message( STATUS "BLAS include: ${BLAS_INCLUDE_DIR}" ) include_directories ( ${BLAS_INCLUDE_DIR} ) @@ -29,7 +30,7 @@ if ( BLAS_FOUND AND NOT CGAL_BLAS_SETUP ) endif() # Setup is done - set ( CGAL_BLAS_SETUP TRUE ) + set ( BLAS_SETUP TRUE ) endif() diff --git a/Installation/cmake/modules/CGAL_UseLAPACK.cmake b/Installation/cmake/modules/CGAL_UseLAPACK.cmake index 024ef03a32c..b88f53e151f 100644 --- a/Installation/cmake/modules/CGAL_UseLAPACK.cmake +++ b/Installation/cmake/modules/CGAL_UseLAPACK.cmake @@ -1,8 +1,9 @@ # This module setups the compiler for the LAPACK libraries. # It assumes that find_package(LAPACK) was already called. -if ( LAPACK_FOUND AND NOT CGAL_LAPACK_SETUP ) +if ( LAPACK_FOUND AND NOT LAPACK_SETUP ) + message( STATUS "UseLAPACK" ) message( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIR}" ) include_directories ( ${LAPACK_INCLUDE_DIR} ) @@ -32,7 +33,7 @@ if ( LAPACK_FOUND AND NOT CGAL_LAPACK_SETUP ) include( ${BLAS_USE_FILE} ) # Setup is done - set ( CGAL_LAPACK_SETUP TRUE ) + set ( LAPACK_SETUP TRUE ) add_definitions(-DCGAL_LAPACK_ENABLED) diff --git a/Installation/cmake/modules/CGAL_UseLEDA.cmake b/Installation/cmake/modules/CGAL_UseLEDA.cmake new file mode 100644 index 00000000000..d16bfb12565 --- /dev/null +++ b/Installation/cmake/modules/CGAL_UseLEDA.cmake @@ -0,0 +1,31 @@ +# This module setups the compiler for the LEDA libraries. +# It assumes that find_package(LEDA) was already called. + +if ( LEDA_FOUND AND NOT LEDA_SETUP ) + + message( STATUS "UseLEDA" ) + message( STATUS "LEDA include: ${LEDA_INCLUDE_DIR}" ) + include_directories ( ${LEDA_INCLUDE_DIR} ) + + message( STATUS "LEDA definitions: ${LEDA_DEFINITIONS}" ) + add_definitions( ${LEDA_DEFINITIONS} ) + if ( "${LEDA_DEFINITIONS}" MATCHES ".*LEDA_USE_F2C.*" ) + add_definitions( "-DCGAL_USE_F2C" ) + endif() + + if (LEDA_LIBRARIES_DIR) + message( STATUS "LEDA library directories: ${LEDA_LIBRARIES_DIR}" ) + link_directories( ${LEDA_LIBRARIES_DIR} ) + endif() + if (LEDA_LIBRARIES) + message( STATUS "LEDA libraries: ${LEDA_LIBRARIES}" ) + link_libraries( ${LEDA_LIBRARIES} ) + endif() + + uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} ) + + # Setup is done + set ( LEDA_SETUP TRUE ) + +endif() + diff --git a/Installation/cmake/modules/CGAL_UseMPFI.cmake b/Installation/cmake/modules/CGAL_UseMPFI.cmake index 26455ac14bc..17692545ea5 100644 --- a/Installation/cmake/modules/CGAL_UseMPFI.cmake +++ b/Installation/cmake/modules/CGAL_UseMPFI.cmake @@ -1,10 +1,11 @@ # This module setups the compiler for the MPFI library. # It assumes that find_package(MPFI) was already called. -if( NOT CGAL_MPFI_SETUP ) +if( MPFI_FOUND AND NOT MPFI_SETUP ) - if( MPFI_FOUND ) + if (GMP_FOUND AND MPFR_FOUND) + message( STATUS "UseMPFI" ) message( STATUS "MPFI include: ${MPFI_INCLUDE_DIR}" ) message( STATUS "MPFI libraries: ${MPFI_LIBRARIES}" ) message( STATUS "MPFI definitions: ${MPFI_DEFINITIONS}" ) @@ -14,12 +15,12 @@ if( NOT CGAL_MPFI_SETUP ) "${CMAKE_BINARY_DIR}" "${CGAL_MODULES_DIR}/test_MPFI.cpp" CMAKE_FLAGS - "-DINCLUDE_DIRECTORIES: - STRING=${MPFI_INCLUDE_DIR};${CGAL_3RD_PARTY_INCLUDE_DIRS}" + "-DINCLUDE_DIRECTORIES: + STRING=${MPFI_INCLUDE_DIR};${GMP_INCLUDE_DIR};${MPFR_INCLUDE_DIR}" "-DLINK_LIBRARIES: - STRING=${MPFI_LIBRARIES};${CGAL_3RD_PARTY_LIBRARIES}" - "-DLINK_DIRECTORIES: - STRING=${MPFI_LIBRARIES_DIR};${CGAL_3RD_PARTY_LIBRARIES_DIRS}" + STRING=${MPFI_LIBRARIES};${GMP_LIBRARIES};${MPFR_LIBRARIES}" + "-DLINK_DIRECTORIES: + STRING=${MPFI_LIBRARIES_DIR};${GMP_LIBRARIES_DIRS};${MPFR_LIBRARIES}" COMPILE_OUTPUT_VARIABLE MPFI_TEST_COMPILATION_OUTPUT ) @@ -29,14 +30,23 @@ if( NOT CGAL_MPFI_SETUP ) add_definitions( ${MPFI_DEFINITIONS} "-DCGAL_USE_MPFI" ) link_libraries( ${MPFI_LIBRARIES} ) else( COMPILED_MPFI_TEST AND MPFI_TEST_RESULT EQUAL 0) - message( STATUS "MPFI was incorrectly configured on this system" ) + if (CGAL_ENABLE_PRECONFIG) + message( STATUS "MPFI is incorrectly configured with CGAL" ) + else() + message( STATUS "MPFI is incorrectly configured on this system" ) + endif() message( STATUS "Output of the failed MPFI test was:\n${MPFI_TEST_COMPILATION_OUTPUT}" ) message( STATUS "End of the MPFI test output" ) endif( COMPILED_MPFI_TEST AND MPFI_TEST_RESULT EQUAL 0) - endif( MPFI_FOUND ) + set( MPFI_SETUP TRUE ) - set( CGAL_MPFI_SETUP TRUE ) + else() + + message( STATUS "MPFI needs GMP and MPFR" ) + + endif() + +endif( MPFI_FOUND AND NOT MPFI_SETUP ) -endif( NOT CGAL_MPFI_SETUP ) diff --git a/Installation/cmake/modules/CGAL_UseNTL.cmake b/Installation/cmake/modules/CGAL_UseNTL.cmake deleted file mode 100644 index 960073afe82..00000000000 --- a/Installation/cmake/modules/CGAL_UseNTL.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# This module setups the compiler for the NTL library. -# It assumes that find_package(NTL) was already called. - -if( NOT CGAL_NTL_SETUP ) - - if( NTL_FOUND ) - - message( STATUS "NTL include: ${NTL_INCLUDE_DIR}" ) - message( STATUS "NTL definitions: ${NTL_DEFINITIONS}" ) - message( STATUS "NTL libraries: ${NTL_LIBRARIES}" ) - - include_directories ( ${NTL_INCLUDE_DIRS} ) - add_definitions( ${NTL_DEFINITIONS} "-DCGAL_USE_NTL" ) - link_libraries( ${NTL_LIBRARIES} ) - - set( CGAL_NTL_SETUP TRUE ) - - endif( NTL_FOUND ) - - -endif( NOT CGAL_NTL_SETUP ) diff --git a/Installation/cmake/modules/CGAL_UseRS.cmake b/Installation/cmake/modules/CGAL_UseRS.cmake index 32162b90773..80b92790093 100644 --- a/Installation/cmake/modules/CGAL_UseRS.cmake +++ b/Installation/cmake/modules/CGAL_UseRS.cmake @@ -1,10 +1,9 @@ # This module setups the compiler for the RS library. # It assumes that find_package(RS) was already called. -if( NOT CGAL_RS_SETUP ) - - if( RS_FOUND ) +if( RS_FOUND AND NOT RS_SETUP ) + message( STATUS "UseRS" ) message( STATUS "RS include: ${RS_INCLUDE_DIR}" ) message( STATUS "RS definitions: ${RS_DEFINITIONS}" ) message( STATUS "RS libraries: ${RS_LIBRARIES}" ) @@ -26,46 +25,6 @@ if( NOT CGAL_RS_SETUP ) add_definitions( ${RS_DEFINITIONS} "-DCGAL_USE_RS" ) link_libraries( ${RS_LIBRARIES} ) - # add rs3 parameters, if necessary (rs3 must be always after rsexport) - if( RS3_FOUND ) + set (RS_SETUP TRUE) - message( STATUS "RS3 include: ${RS3_INCLUDE_DIR}" ) - message( STATUS "RS3 definitions: ${RS3_DEFINITIONS}" ) - message( STATUS "RS3 libraries: ${RS3_LIBRARIES}" ) - - include_directories ( ${RS3_INCLUDE_DIR} ) - add_definitions( ${RS_DEFINITIONS} "-DCGAL_USE_RS3" ) - link_libraries( ${RS3_LIBRARIES} ) - - # extract RS3 version from the file rsversion.h (based on Fernando - # Cacciola's code for FindBoost.cmake) - if( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) - FILE(READ "${RS3_INCLUDE_DIR}/rsversion.h" _rsversion_h_CONTENTS) - STRING(REGEX REPLACE ".*#define[ \t]+rs_major[ \t]+([0-9]+).*" - "\\1" RS3_MAJOR "${_rsversion_h_CONTENTS}") - STRING(REGEX REPLACE ".*#define[ \t]+rs_middle[ \t]+([0-9]+).*" - "\\1" RS3_MIDDLE "${_rsversion_h_CONTENTS}") - STRING(REGEX REPLACE ".*#define[ \t]+rs_minor[ \t]+([0-9]+).*" - "\\1" RS3_MINOR "${_rsversion_h_CONTENTS}") - SET( RS3_LIB_VERSION "${RS3_MAJOR}.${RS3_MIDDLE}.${RS3_MINOR}" ) - IS_VERSION_LESS( "${RS3_MAJOR}.${RS3_MIDDLE}" "3.1" RS_OLD_INCLUDES ) - else( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) - # rsversion.h did not exist in old versions - SET( RS3_LIB_VERSION "unknown" ) - SET( RS_OLD_INCLUDES TRUE ) - endif( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) - - message( STATUS "RS version is ${RS3_LIB_VERSION}" ) - - if( RS_OLD_INCLUDES ) - add_definitions( "-DCGAL_RS_OLD_INCLUDES" ) - message( STATUS "Using old RS signatures" ) - endif( RS_OLD_INCLUDES ) - - endif( RS3_FOUND ) - - endif( RS_FOUND ) - - set( CGAL_RS_SETUP TRUE ) - -endif( NOT CGAL_RS_SETUP ) +endif( RS_FOUND AND NOT RS_SETUP ) diff --git a/Installation/cmake/modules/CGAL_UseRS3.cmake b/Installation/cmake/modules/CGAL_UseRS3.cmake new file mode 100644 index 00000000000..27cd09c1267 --- /dev/null +++ b/Installation/cmake/modules/CGAL_UseRS3.cmake @@ -0,0 +1,45 @@ +# This module setups the compiler for the RS3 library. +# It assumes that find_package(RS3) was already called. + +if( RS3_FOUND AND NOT RS3_SETUP ) + + include( CGAL_UseRS ) + + # add rs3 parameters, if necessary (rs3 must be always after rsexport) + message( STATUS "UseRS3" ) + message( STATUS "RS3 include: ${RS3_INCLUDE_DIR}" ) + message( STATUS "RS3 definitions: ${RS3_DEFINITIONS}" ) + message( STATUS "RS3 libraries: ${RS3_LIBRARIES}" ) + + include_directories ( ${RS3_INCLUDE_DIR} ) + add_definitions( ${RS3_DEFINITIONS} "-DCGAL_USE_RS3" ) + link_libraries( ${RS3_LIBRARIES} ) + + # extract RS3 version from the file rsversion.h (based on Fernando + # Cacciola's code for FindBoost.cmake) + if( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) + FILE(READ "${RS3_INCLUDE_DIR}/rsversion.h" _rsversion_h_CONTENTS) + STRING(REGEX REPLACE ".*#define[ \t]+rs_major[ \t]+([0-9]+).*" + "\\1" RS3_MAJOR "${_rsversion_h_CONTENTS}") + STRING(REGEX REPLACE ".*#define[ \t]+rs_middle[ \t]+([0-9]+).*" + "\\1" RS3_MIDDLE "${_rsversion_h_CONTENTS}") + STRING(REGEX REPLACE ".*#define[ \t]+rs_minor[ \t]+([0-9]+).*" + "\\1" RS3_MINOR "${_rsversion_h_CONTENTS}") + SET( RS3_LIB_VERSION "${RS3_MAJOR}.${RS3_MIDDLE}.${RS3_MINOR}" ) + IS_VERSION_LESS( "${RS3_MAJOR}.${RS3_MIDDLE}" "3.1" RS3_OLD_INCLUDES ) + else( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) + # rsversion.h did not exist in old versions + SET( RS3_LIB_VERSION "unknown" ) + SET( RS3_OLD_INCLUDES TRUE ) + endif( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) + + message( STATUS "RS3 version is ${RS3_LIB_VERSION}" ) + + if( RS3_OLD_INCLUDES ) + add_definitions( "-DCGAL_RS_OLD_INCLUDES" ) + message( STATUS "Using old RS signatures" ) + endif( RS3_OLD_INCLUDES ) + + set (RS3_SETUP TRUE) + + endif( RS3_FOUND AND NOT RS3_SETUP ) diff --git a/Installation/cmake/modules/CGAL_UseTAUCS.cmake b/Installation/cmake/modules/CGAL_UseTAUCS.cmake index 2bea35c7c3a..3a3035ca411 100644 --- a/Installation/cmake/modules/CGAL_UseTAUCS.cmake +++ b/Installation/cmake/modules/CGAL_UseTAUCS.cmake @@ -1,8 +1,9 @@ # This module setups the compiler for the TAUCS libraries. # It assumes that find_package(TAUCS) was already called. -if ( TAUCS_FOUND AND NOT CGAL_TAUCS_SETUP ) +if ( TAUCS_FOUND AND NOT TAUCS_SETUP ) + message( STATUS "UseTAUCS" ) message( STATUS "TAUCS include: ${TAUCS_INCLUDE_DIR}" ) include_directories ( ${TAUCS_INCLUDE_DIR} ) @@ -22,7 +23,7 @@ if ( TAUCS_FOUND AND NOT CGAL_TAUCS_SETUP ) include( ${LAPACK_USE_FILE} ) # Setup is done - set ( CGAL_TAUCS_SETUP TRUE ) + set ( TAUCS_SETUP TRUE ) add_definitions(-DCGAL_TAUCS_ENABLED) diff --git a/Installation/cmake/modules/FindCGAL.cmake b/Installation/cmake/modules/FindCGAL.cmake index b7cfa5bc170..75be66de3dc 100644 --- a/Installation/cmake/modules/FindCGAL.cmake +++ b/Installation/cmake/modules/FindCGAL.cmake @@ -78,6 +78,12 @@ if ( CGAL_DIR ) set( CGAL_FOUND TRUE ) endif() + find_library(CGAL_Qt4_LIBRARY CGAL_Qt4 ${CGAL_DIR}/lib}) + if (CGAL_Qt4_LIBRARY) + set( CGAL_Qt4_FOUND TRUE ) + endif() + + endif() if( NOT CGAL_FOUND) diff --git a/Installation/cmake/modules/FindCGAL_CORE.cmake b/Installation/cmake/modules/FindCGAL_CORE.cmake index 946af735ef7..b2578b306e1 100644 --- a/Installation/cmake/modules/FindCGAL_CORE.cmake +++ b/Installation/cmake/modules/FindCGAL_CORE.cmake @@ -7,7 +7,7 @@ # CORE needs GMP -include(CGAL_FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) if(GMP_FOUND) diff --git a/Installation/cmake/modules/FindCORE.cmake b/Installation/cmake/modules/FindCORE.cmake index 05a0ef3aae4..6effa1d5e52 100644 --- a/Installation/cmake/modules/FindCORE.cmake +++ b/Installation/cmake/modules/FindCORE.cmake @@ -6,7 +6,7 @@ # TODO: support Windows and MacOSX # CORE needs GMP -include(CGAL_FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) if(GMP_FOUND) if (CORE_INCLUDE_DIR AND CORE_LIBRARIES) diff --git a/Installation/cmake/modules/FindESBTL.cmake b/Installation/cmake/modules/FindESBTL.cmake index ca0a6316517..acb4fc3f6ae 100644 --- a/Installation/cmake/modules/FindESBTL.cmake +++ b/Installation/cmake/modules/FindESBTL.cmake @@ -26,5 +26,4 @@ endif() if(ESBTL_FOUND) message(STATUS "Found ESBTL: ${ESBTL_INCLUDE_DIR}") - set(ESBTL_USE_FILE "UseESBTL") endif() diff --git a/Installation/cmake/modules/FindGMP.cmake b/Installation/cmake/modules/FindGMP.cmake index 76ad2d9770f..797099912ef 100644 --- a/Installation/cmake/modules/FindGMP.cmake +++ b/Installation/cmake/modules/FindGMP.cmake @@ -7,7 +7,7 @@ # TODO: support MacOSX -include(CGAL_FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) include(CGAL_GeneratorSpecificSettings) if(GMP_INCLUDE_DIR) diff --git a/Installation/cmake/modules/FindGMPXX.cmake b/Installation/cmake/modules/FindGMPXX.cmake index 333cd1d44b6..babde0630ce 100644 --- a/Installation/cmake/modules/FindGMPXX.cmake +++ b/Installation/cmake/modules/FindGMPXX.cmake @@ -9,7 +9,7 @@ find_package( GMP QUIET ) -if(GMP_FOUND) +if(WITH_GMP AND GMP_FOUND) if (GMPXX_INCLUDE_DIR AND GMPXX_LIBRARIES) # Already in cache, be silent @@ -26,8 +26,12 @@ if(GMP_FOUND) DOC "Path to the GMPXX library" ) - include(CGAL_FindPackageHandleStandardArgs) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GMPXX "DEFAULT_MSG" GMPXX_LIBRARIES GMPXX_INCLUDE_DIR ) +else() + + message( FATAL_ERROR "GMPXX needs GMP") + endif() diff --git a/Installation/cmake/modules/FindIPE.cmake b/Installation/cmake/modules/FindIPE.cmake index a5e98915c54..2b87c5fa86d 100644 --- a/Installation/cmake/modules/FindIPE.cmake +++ b/Installation/cmake/modules/FindIPE.cmake @@ -4,96 +4,31 @@ # IPE_FOUND - system has Ipe # IPE_INCLUDE_DIR - the Ipe include directory # IPE_LIBRARIES - Link these to use Ipe -# WITH_IPE_7 - indicates if the compatibility with the version 7 of IPE must be used # -macro( remove_leading_zero var ) - string(SUBSTRING "${${var}}" 0 1 ONECHAR) - string(COMPARE EQUAL "${ONECHAR}" "0" ISZERO) - if (${ISZERO}) - string(SUBSTRING "${${var}}" 1 1 ONECHAR) - set(${var} ${ONECHAR}) - endif() -endmacro() - # Is it already configured? -if (IPE_INCLUDE_DIR AND IPE_LIBRARY_DIR ) +if (IPE_INCLUDE_DIR AND IPE_LIBRARIES ) set(IPE_FOUND TRUE) else() - find_path(IPE_INCLUDE_DIR NAMES ipelib.h PATHS /usr/include /usr/local/include ) - find_library(IPE_LIBRARY + find_library(IPE_LIBRARIES NAMES ipe PATHS /usr/lib /usr/local/lib /usr/lib64 ) - if(IPE_INCLUDE_DIR AND IPE_LIBRARY) + if(IPE_INCLUDE_DIR AND IPE_LIBRARIES) set(IPE_FOUND TRUE) - if (${IPE_VERSION} STREQUAL "AUTODETECT") - FILE(READ "${IPE_INCLUDE_DIR}/ipebase.h" IPEBASE_H) - STRING(REGEX MATCH "IPELIB_VERSION[ ]*=[ ]*([67])([0-9][0-9])([0-9][0-9]);" found_ipe_version "${IPEBASE_H}") - if (found_ipe_version) - set(IPE_VERSION ${CMAKE_MATCH_1}) - set(IPE_MINOR_VERSION_1 ${CMAKE_MATCH_2}) - set(IPE_MINOR_VERSION_2 ${CMAKE_MATCH_3}) - endif() - endif() - if (${IPE_VERSION} EQUAL "7") - set(WITH_IPE_7 ON) - elseif(${IPE_VERSION} EQUAL "6") - set(WITH_IPE_7 OFF) - else() - message("-- Error: ${IPE_VERSION} is not a supported version of IPE (only 6 and 7 are).") - set(IPE_FOUND FALSE) - endif() - endif() - get_filename_component(IPE_LIBRARY_DIR ${IPE_LIBRARY} PATH) -endif() - -if (IPE_FOUND AND NOT IPELET_INSTALL_DIR) - message("-- Using IPE version ${IPE_VERSION} compatibility.") - if (WITH_IPE_7) - remove_leading_zero(IPE_MINOR_VERSION_1) - remove_leading_zero(IPE_MINOR_VERSION_2) - set(INSTALL_PATHS ${INSTALL_PATHS} "${IPE_LIBRARY_DIR}/ipe/7.${IPE_MINOR_VERSION_1}.${IPE_MINOR_VERSION_2}/ipelets/") - find_path(IPELET_INSTALL_DIR - NAMES libgoodies.lua goodies.lua - PATHS ${INSTALL_PATHS} - ENV IPELETPATH - ) - else() - foreach (VER RANGE 28 40) - string(REPLACE XX ${VER} PATHC "${IPE_LIBRARY_DIR}/ipe/6.0preXX/ipelets/" ) - set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) - endforeach() - set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) - set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib64/ipe/6.0/ipelets) - set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib/ipe/6.0/ipelets) - - - find_library(IPELET_INSTALL_DIR_FILES - NAMES align - PATHS ${INSTALL_PATHS} - ENV IPELETPATH - ) - if (IPELET_INSTALL_DIR_FILES) - get_filename_component(IPELET_INSTALL_DIR ${IPELET_INSTALL_DIR_FILES} PATH) - endif() endif() endif() if(IPE_FOUND) - message(STATUS "Found Ipe: ${IPE_INCLUDE_DIR} ${IPE_LIBRARY_DIR}") - if (IPELET_INSTALL_DIR) - set ( IPELET_INSTALL_DIR ${IPELET_INSTALL_DIR} CACHE STRING "The folder where ipelets will be installed, relative to CMAKE_INSTALL_PREFIX" ) - message(STATUS "Set Ipelets install dir: ${IPELET_INSTALL_DIR}") - endif() + message(STATUS "Found Ipe: ${IPE_INCLUDE_DIR} ${IPE_LIBRARIES}") endif() diff --git a/Installation/cmake/modules/FindLEDA.cmake b/Installation/cmake/modules/FindLEDA.cmake index a825fad0824..7350ce01c21 100644 --- a/Installation/cmake/modules/FindLEDA.cmake +++ b/Installation/cmake/modules/FindLEDA.cmake @@ -83,5 +83,6 @@ endif() if ( LEDA_INCLUDE_DIR AND LEDA_LIBRARIES) set(LEDA_FOUND TRUE) + set(LEDA_USE_FILE "CGAL_UseLEDA") endif() diff --git a/Installation/cmake/modules/FindMPFI.cmake b/Installation/cmake/modules/FindMPFI.cmake index b9975a77a7a..113ae900312 100644 --- a/Installation/cmake/modules/FindMPFI.cmake +++ b/Installation/cmake/modules/FindMPFI.cmake @@ -7,12 +7,18 @@ if( GMP_FOUND ) endif( MPFI_INCLUDE_DIR AND MPFI_LIBRARIES ) find_path(MPFI_INCLUDE_DIR NAMES mpfi.h - PATHS ${GMP_INCLUDE_DIR_SEARCH} ENV MPFI_INC_DIR + HINTS + $ENV{MPFI_INC_DIR} + PATHS + ${GMP_INCLUDE_DIR_SEARCH} DOC "The directory containing the MPFI header files" ) find_library(MPFI_LIBRARIES NAMES mpfi - PATHS ${GMP_LIBRARIES_DIR_SEARCH} ENV MPFI_LIB_DIR + HINTS + $ENV{MPFI_LIB_DIR} + PATHS + ${GMP_LIBRARIES_DIR_SEARCH} DOC "Directory containing the MPFI library" ) @@ -24,7 +30,7 @@ if( GMP_FOUND ) include( MPFIConfig OPTIONAL ) endif( NOT MPFI_INCLUDE_DIR OR NOT MPFI_LIBRARIES_DIR ) - include(CGAL_FindPackageHandleStandardArgs) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MPFI "DEFAULT_MSG" MPFI_LIBRARIES MPFI_INCLUDE_DIR ) diff --git a/Installation/cmake/modules/FindMPFR.cmake b/Installation/cmake/modules/FindMPFR.cmake index 2453f66fc03..94f41f9d9a6 100644 --- a/Installation/cmake/modules/FindMPFR.cmake +++ b/Installation/cmake/modules/FindMPFR.cmake @@ -7,7 +7,7 @@ # TODO: support MacOSX -include(CGAL_FindPackageHandleStandardArgs) +include(FindPackageHandleStandardArgs) include(CGAL_GeneratorSpecificSettings) if(MPFR_INCLUDE_DIR) diff --git a/Installation/cmake/modules/FindNTL.cmake b/Installation/cmake/modules/FindNTL.cmake index d6d43e1cb1c..cbbf5ca34a2 100644 --- a/Installation/cmake/modules/FindNTL.cmake +++ b/Installation/cmake/modules/FindNTL.cmake @@ -3,48 +3,39 @@ find_package( GMP REQUIRED ) -if( NOT GMP_FOUND ) +if( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND ) - message( ERROR "NTL requires GMP" ) + message( FATAL_ERROR "NTL requires GMP" ) set( NTL_FOUND FALSE ) -else( NOT GMP_FOUND ) +else( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND ) include( CGAL_VersionUtils ) + get_dependency_version( GMP ) + IS_VERSION_LESS("${GMP_VERSION}" "3.1.1" _IS_GMP_VERSION_TOO_LOW) if( _IS_GMP_VERSION_TOO_LOW ) - message( ERROR, "NTL needs GMP>=3.1.1. Your GMP version is ${CGAL_GMP_VERSION}." ) + message( FATAL_ERROR, "NTL needs GMP>=3.1.1. Your GMP version is ${GMP_VERSION}." ) else( _IS_GMP_VERSION_TOO_LOW ) find_path(NTL_INCLUDE_DIR - NAMES NTL/ZZX.h - PATHS ENV NTL_INC_DIR + NAMES NTL/ZZ.h + HINTS + $ENV{NTL_INC_DIR} DOC "The directory containing the NTL include files" - NO_DEFAULT_PATH ) find_library(NTL_LIBRARY NAMES ntl - PATHS ENV NTL_LIB_DIR + HINTS + $ENV{NTL_LIB_DIR} DOC "Path to the NTL library" - NO_DEFAULT_PATH ) - # TODO if NTL_INC_DIR is given you should not search in default path - -# find_library(NTL_LIBRARY -# NAMES ntl -# PATHS ENV NTL_LIB_DIR -# DOC "Path to the NTL library" -# ) - -# message( STATUS "NTL_INCLUDE_DIR = '${NTL_INCLUDE_DIR}'" ) -# message( STATUS "NTL_LIBRARY = '${NTL_LIBRARY}'" ) - if ( NTL_INCLUDE_DIR AND NTL_LIBRARY ) #check version @@ -80,7 +71,7 @@ else( NOT GMP_FOUND ) get_filename_component(NTL_LIBRARIES_DIR ${NTL_LIBRARIES} PATH CACHE ) - include(CGAL_FindPackageHandleStandardArgs) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args( NTL DEFAULT_MSG @@ -96,10 +87,9 @@ else( NOT GMP_FOUND ) endif( _IS_GMP_VERSION_TOO_LOW ) -endif( NOT GMP_FOUND ) +endif( (TARGET CGAL AND NOT WITH_GMP) OR NOT GMP_FOUND ) if ( NTL_FOUND ) - set( NTL_USE_FILE "CGAL_UseNTL" ) # if ( NOT NTL_FIND_QUIETLY ) # message(STATUS "Found NTL: ${NTL_LIBRARY}") # endif (NOT NTL_FIND_QUIETLY ) diff --git a/Installation/cmake/modules/FindOpenGL.cmake b/Installation/cmake/modules/FindOpenGL.cmake index bdf1a80584c..49121fd6717 100644 --- a/Installation/cmake/modules/FindOpenGL.cmake +++ b/Installation/cmake/modules/FindOpenGL.cmake @@ -28,4 +28,4 @@ if ( NOT FIND_OPENGL_WRAPPER ) set(CMAKE_MODULE_PATH ${SAVED_CMAKE_MODULE_PATH} ) -endif() \ No newline at end of file +endif() diff --git a/Installation/cmake/modules/FindPackageMessage.cmake b/Installation/cmake/modules/FindPackageMessage.cmake deleted file mode 100644 index b7e51b0ad7b..00000000000 --- a/Installation/cmake/modules/FindPackageMessage.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# FIND_PACKAGE_MESSAGE( "message for user" "find result details") -# -# This macro is intended to be used in FindXXX.cmake modules files. -# It will print a message once for each unique find result. -# This is useful for telling the user where a package was found. -# The first argument specifies the name (XXX) of the package. -# The second argument specifies the message to display. -# The third argument lists details about the find result so that -# if they change the message will be displayed again. -# The macro also obeys the QUIET argument to the find_package command. -# -# Example: -# -# IF(X11_FOUND) -# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}" -# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]") -# ELSE(X11_FOUND) -# ... -# ENDIF(X11_FOUND) - -macro(FIND_PACKAGE_MESSAGE pkg msg details) - # Avoid printing a message repeatedly for the same find result. - IF(NOT ${pkg}_FIND_QUIETLY) - SET(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg}) - IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}") - # The message has not yet been printed. - MESSAGE(STATUS "${msg}") - - # Save the find details in the cache to avoid printing the same - # message again. - SET("${DETAILS_VAR}" "${details}" - CACHE INTERNAL "Details about finding ${pkg}") - ENDIF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}") - ENDIF(NOT ${pkg}_FIND_QUIETLY) -endmacro(FIND_PACKAGE_MESSAGE) diff --git a/Installation/cmake/modules/FindRS.cmake b/Installation/cmake/modules/FindRS.cmake index b17b2c0b2dd..a44d333cb41 100644 --- a/Installation/cmake/modules/FindRS.cmake +++ b/Installation/cmake/modules/FindRS.cmake @@ -1,48 +1,41 @@ # RS needs GMP 4.2 or newer, this script will fail if an old version is # detected -find_package( GMP ) -find_package( MPFI ) +if( NOT GMP_FOUND ) + find_package( GMP ) +endif() + +if( NOT MPFI_FOUND ) + find_package( MPFI ) +endif() if( MPFI_FOUND ) - include( ${MPFI_USE_FILE} ) include( CGAL_VersionUtils ) + include( ${MPFI_USE_FILE} ) find_path(RS_INCLUDE_DIR NAMES rs_exports.h - PATHS ENV RS_INC_DIR + HINTS + $ENV{RS_INC_DIR} DOC "The directory containing the RS include files" ) - find_path(RS3_INCLUDE_DIR - NAMES rs3_fncts.h - PATHS ENV RS_INC_DIR - DOC "The directory containing the RS3 include files" - ) - find_library(RS_LIBRARIES NAMES rsexport_rs - PATHS ENV RS_LIB_DIR + HINTS + $ENV{RS_LIB_DIR} DOC "Path to the RS library" ) + + get_dependency_version( GMP ) - find_library(RS3_LIBRARIES - NAMES rs3 - PATHS ENV RS_LIB_DIR - DOC "Path to the RS3 library" - ) - - if ( NOT CGAL_GMP_VERSION ) - set ( CGAL_GMP_VERSION ${GMP_VERSION} ) - endif() - - IS_VERSION_LESS("${CGAL_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) message( STATUS - "RS needs GMP>=4.2. Your GMP version is ${CGAL_GMP_VERSION}." ) + "RS needs GMP>=4.2. Your GMP version is ${GMP_VERSION}." ) else(_IS_GMP_VERSION_TO_LOW) @@ -50,19 +43,11 @@ if( MPFI_FOUND ) set(RS_FOUND TRUE) endif( RS_INCLUDE_DIR AND RS_LIBRARIES ) - if( RS3_INCLUDE_DIR AND RS3_LIBRARIES ) - set(RS3_FOUND TRUE) - endif( RS3_INCLUDE_DIR AND RS3_LIBRARIES ) - if( RS_LIBRARIES ) get_filename_component(RS_LIBRARIES_DIR ${RS_LIBRARIES} PATH CACHE ) endif( RS_LIBRARIES ) - if( NOT RS_INCLUDE_DIR OR NOT RS_LIBRARIES_DIR ) - include( RSConfig OPTIONAL ) - endif( NOT RS_INCLUDE_DIR OR NOT RS_LIBRARIES_DIR ) - - include(CGAL_FindPackageHandleStandardArgs) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args( RS "DEFAULT_MSG" diff --git a/Installation/cmake/modules/FindRS3.cmake b/Installation/cmake/modules/FindRS3.cmake new file mode 100644 index 00000000000..802cdc0c8f4 --- /dev/null +++ b/Installation/cmake/modules/FindRS3.cmake @@ -0,0 +1,80 @@ +# RS needs GMP 4.2 or newer, this script will fail if an old version is +# detected + +find_package( GMP ) +find_package( MPFI ) +find_package( RS ) + +if ( RS_FOUND ) + +if( MPFI_FOUND ) + + include( ${MPFI_USE_FILE} ) + include( ${RS_USE_FILE} ) + include( CGAL_VersionUtils ) + + find_path(RS3_INCLUDE_DIR + NAMES rs3_fncts.h + HINTS + $ENV{RS_INC_DIR} +# TODO uses the same environment variable + 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 + DOC "Path to the RS3 library" + ) + + get_dependency_version( GMP ) + + IS_VERSION_LESS("$GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) + + if(_IS_GMP_VERSION_TO_LOW) + + message( STATUS + "RS3 needs GMP>=4.2. Your GMP version is ${GMP_VERSION}." ) + + else(_IS_GMP_VERSION_TO_LOW) + + if( RS3_INCLUDE_DIR AND RS3_LIBRARIES ) + set(RS3_FOUND TRUE) + endif( RS3_INCLUDE_DIR AND RS3_LIBRARIES ) + + if( RS3_LIBRARIES ) + get_filename_component(RS3_LIBRARIES_DIR ${RS3_LIBRARIES} PATH CACHE ) + endif( RS3_LIBRARIES ) + + if( NOT RS3_INCLUDE_DIR OR NOT RS3_LIBRARIES_DIR ) + include( RS3Config OPTIONAL ) + endif( NOT RS3_INCLUDE_DIR OR NOT RS3_LIBRARIES_DIR ) + + include(FindPackageHandleStandardArgs) + + find_package_handle_standard_args( RS3 + "DEFAULT_MSG" + RS3_LIBRARIES + RS3_INCLUDE_DIR ) + + endif(_IS_GMP_VERSION_TO_LOW) + +else( MPFI_FOUND ) + + message( STATUS "RS3 requires MPFI" ) + set( RS3_FOUND FALSE ) + +endif( MPFI_FOUND ) + +else( RS3_FOUND ) + + message( STATUS "RS3 requires MPFI" ) + set( RS3_FOUND FALSE ) + +endif( RS_FOUND ) + +if(RS3_FOUND) + set(RS3_USE_FILE "CGAL_UseRS3") +endif(RS3_FOUND) diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index 0f134c1c3d0..1a18a69bf33 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -5,10 +5,10 @@ # The variables used here are defined in the CGALConfig.cmake generated when CGAL was installed. # # - set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) + cgal_setup_module_path() if(NOT USE_CGAL_FILE_INCLUDED) @@ -21,20 +21,11 @@ if(NOT USE_CGAL_FILE_INCLUDED) set( CGAL_LIBRARIES ) - foreach ( CGAL_COMPONENT ${CGAL_REQUESTED_COMPONENTS} ) - if(WITH_CGAL_${CGAL_COMPONENT}) - if(TARGET CGAL_${CGAL_COMPONENT}) - add_to_list( CGAL_LIBRARIES CGAL_${CGAL_COMPONENT} ) - else() - add_to_list( CGAL_LIBRARIES ${CGAL_${CGAL_COMPONENT}_LIBRARY} ) - endif() - add_to_list( CGAL_3RD_PARTY_LIBRARIES ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES} ) - - add_to_list( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_INCLUDE_DIRS} ) - add_to_list( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_DEFINITIONS} ) - add_to_list( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES_DIRS} ) - endif() + foreach ( component ${CGAL_REQUESTED_COMPONENTS} ) + use_component( ${component} ) endforeach() + + use_essential_libs() include_directories( "${CMAKE_CURRENT_BINARY_DIR}" ) diff --git a/Installation/cmake/modules/UseEigen3.cmake b/Installation/cmake/modules/UseEigen3.cmake index d1c51789cc1..88892219b3d 100644 --- a/Installation/cmake/modules/UseEigen3.cmake +++ b/Installation/cmake/modules/UseEigen3.cmake @@ -5,3 +5,5 @@ include_directories( ${EIGEN3_INCLUDE_DIR} ) add_definitions(-DCGAL_EIGEN3_ENABLED) + +set (EIGEN3_SETUP TRUE) diff --git a/Installation/config/testfiles/CGAL_CFG_DENORMALS_COMPILE_BUG.cpp b/Installation/config/testfiles/CGAL_CFG_DENORMALS_COMPILE_BUG.cpp index 3a698f0e7a9..514e30a7153 100644 --- a/Installation/config/testfiles/CGAL_CFG_DENORMALS_COMPILE_BUG.cpp +++ b/Installation/config/testfiles/CGAL_CFG_DENORMALS_COMPILE_BUG.cpp @@ -24,6 +24,8 @@ //| This flag is set if the compiler bugs when handling denormal values at //| compile time. At least PGCC 7.1-2 has the bug. +//| +//| Laurent Rineau, 2012/06/14: no supported platform has the bug now. #undef NDEBUG #include diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index c8b64157107..b68c7281df9 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -23,6 +23,7 @@ if(NOT CGAL_BUILDING_LIBS) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) endif() +message("== Generating build files for demos ==") foreach( entry ${list} ) if (NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry} ) @@ -30,11 +31,12 @@ foreach( entry ${list} ) file(GLOB files "${entry}/*.cpp") # If there is no .cpp files, ignore the sub-directory - if(files) - process_CGAL_subdirectory("${entry}" demo demo) + if(files) + process_CGAL_subdirectory("${entry}" demo demo) # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() + endif() endif() endforeach() +message("== Generating build files for demos (DONE) ==\n") diff --git a/Installation/doc_tex/Installation/appendix.tex b/Installation/doc_tex/Installation/appendix.tex deleted file mode 100644 index 3e710712171..00000000000 --- a/Installation/doc_tex/Installation/appendix.tex +++ /dev/null @@ -1,68 +0,0 @@ -%% -%% *** CGAL Installation Guide *** -%% -%% file: appendix.tex -%% -%% authors: Michael Hoffmann, Dima Pasechnik and Wieger Wesselink -%% -%% $Id$ -%% - - -\section{Compiler Workarounds} -\index{compilers!workarounds}\index{workaround flags} - -A number of boolean flags are used to workaround compiler bugs and -limitations. They all start -with the prefix \texttt{CGAL\_CFG}. These flags are used to work -around compiler bugs and limitations. For example, the flag -\texttt{CGAL\_CFG\_NO\_CPP0X\_LONG\_LONG} denotes that the compiler does not -know the type \texttt{long long}. - -For each compiler a file \texttt{} -\index{files!\texttt{compiler\_config.h}} is defined, with the correct -settings of all flags. This file is generated automatically by -\cmake, and it is located in the \texttt{include} directory of -where you run \cmake. For an in-source configuration this means -\texttt{CGAL-3.x/include}. - -The test programs used to generate the \texttt{compiler\_config.h} -file can be found in \texttt{config/testfiles}. -\index{directories!config/testfiles@\texttt{config/testfiles}} Both -\texttt{compiler\_config.h} and the test programs contain a short -description of the problem. In case of trouble with one of the -\texttt{CGAL\_CFG} flags, it is a good idea to take a look at it. - -The file \texttt{CGAL/compiler\_config.h} is included from -\texttt{}.\index{files!\texttt{config.h}} -which is included by all \cgal\ header files. - -\section{Compiler Optimizations\label{sec:compiler-optimisations}} -\index{compilers!optimization} -\index{optimization compiler flags} - -By default \cmake\ generates makefiles for Release mode, with -optimization flags switched on, and vcproj files for Release -and Debug modes. - - - -\section{Scripts} - -\subsection{\texttt{cgal\_create\_cmake\_script\label{sec:create_cgal_cmake_script}}} -\TTindex{cgal\_create\_cmake\_script}\index{scripts!\texttt{cgal\_create\_cmake\_script}} - -The Bourne-shell script \texttt{cgal\_create\_cmake\_script} is contained in the -\texttt{\cgalrel/scripts} directory. It can be used to create -\texttt{CmakeLists.txt} files for compiling \cgal\ applications. Executing -\texttt{cgal\_create\_cmake\_script} in an application directory creates a -\texttt{CMakeLists.txt} containing rules for every \texttt{*.cpp} file -there. Currently, that script only works for applications that only need -the \cgal\ and CGALCore libraries. - - -%% -%% EOF -%% - - diff --git a/Installation/doc_tex/Installation/cmakerun.txt b/Installation/doc_tex/Installation/cmakerun.txt new file mode 100644 index 00000000000..438f620c4e7 --- /dev/null +++ b/Installation/doc_tex/Installation/cmakerun.txt @@ -0,0 +1,185 @@ +-- The CXX compiler identification is GNU +-- The C compiler identification is GNU +-- Check for working CXX compiler: /usr/bin/g++-4.4 +-- Check for working CXX compiler: /usr/bin/g++-4.4 -- works +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working C compiler: /usr/bin/gcc-4.4 +-- Check for working C compiler: /usr/bin/gcc-4.4 -- works +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +== Setting paths == +== Build CGAL from release: CGAL-4.1 == +-- Packagenames: CGAL-4.1 +== Setting paths (DONE) == + +== Generate version files == +-- CGAL_MAJOR_VERSION=4 +-- CGAL_MINOR_VERSION=1 +-- CGAL_BUGFIX_VERSION=0 +-- CGAL_SONAME_VERSION=10 +-- CGAL_SOVERSION =10.0.0 +-- CGAL_REFERENCE_CACHE_DIR= +-- Building shared libraries +-- Targetting Unix Makefiles +-- Using /usr/bin/g++-4.4 compiler. +-- USING CMake version: 2.8.5 +-- System: Linux +-- USING GCC_VERSION = '4.4.5' +-- Using gcc version 4 or later. Adding -frounding-math +== Generate version files (DONE) == + +== Detect external libraries == +-- Build type: Release +-- USING CXXFLAGS = ' -frounding-math -O3 -DNDEBUG' +-- USING LDFLAGS = ' ' +-- External libraries supported: GMP;GMPXX;MPFR;zlib;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;TAUCS;EIGEN3;BLAS;LAPACK;QGLViewer;ESBTL;NTL +-- Preconfiguring library: GMP ... +-- GMP has been preconfigured: +-- CGAL_UseGMP-file: +-- GMP include: /usr/include/ +-- GMP libraries: /usr/lib/libgmp.so +-- GMP definitions: +-- USING GMP_VERSION = '4.3.2' +-- Preconfiguring library: GMPXX ... +-- GMPXX has been preconfigured: +-- CGAL_UseGMPXX-file: +-- GMPXX include: /usr/include +-- GMPXX libraries: /usr/lib/libgmpxx.so +-- GMPXX definitions: +-- Preconfiguring library: MPFR ... +-- MPFR has been preconfigured: +-- CGAL_UseMPFR-file: +-- MPFR include: /usr/include/ +-- MPFR libraries: /usr/lib/libmpfr.so +-- MPFR definitions: +-- USING MPFR_VERSION = '3.0.0' +-- Boost version: 1.39.0 +-- Found the following Boost libraries: +-- thread +-- Boost include: /usr/include/boost_1_39_0/include/boost-1_39 +-- Boost libraries: /usr/lib/libboost_thread-mt.so;pthread +-- Boost definitions: +-- USING BOOST_VERSION = '1.39.0' +== Detect external libraries (DONE) == + +== Write compiler_config.h == +-- Performing Test CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG - Success +-- Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Success +-- Performing Test CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG - Success +-- Performing Test CGAL_CFG_IEEE_754_BUG - Success +-- Performing Test CGAL_CFG_ISTREAM_INT_BUG - Success +-- Performing Test CGAL_CFG_LONGNAME_BUG - Success +-- Performing Test CGAL_CFG_MATCHING_BUG_5 - Success +-- Performing Test CGAL_CFG_MATCHING_BUG_6 - Success +-- Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Success +-- Performing Test CGAL_CFG_NO_CPP0X_ARRAY - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_AUTO - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_COPY_N - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_DECLTYPE - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_DELEGATING_CONSTRUCTORS - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS - Success +-- Performing Test CGAL_CFG_NO_CPP0X_INITIALIZER_LISTS - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_ISFINITE - Success +-- Performing Test CGAL_CFG_NO_CPP0X_LAMBDAS - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_LONG_LONG - Success +-- Performing Test CGAL_CFG_NO_CPP0X_NEXT_PREV - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_STATIC_ASSERT - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_TUPLE - Failed +-- Performing Test CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - Failed +-- Performing Test CGAL_CFG_NO_LIMITS - Success +-- Performing Test CGAL_CFG_NO_LOGICAL_OPERATORS_ALTERNATIVES - Success +-- Performing Test CGAL_CFG_NO_MESSAGE_PRAGMA_BUG - Success +-- Performing Test CGAL_CFG_NO_NEXTAFTER - Success +-- Performing Test CGAL_CFG_NO_STATEMENT_EXPRESSIONS - Success +-- Performing Test CGAL_CFG_NO_STL - Success +-- Performing Test CGAL_CFG_NO_TR1_ARRAY - Success +-- Performing Test CGAL_CFG_NO_TR1_TUPLE - Success +-- Performing Test CGAL_CFG_NO_WARNING_CPP_DIRECTIVE_BUG - Success +-- Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Success +-- Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Success +-- Performing Test CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG - Success +-- Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Success +-- Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Success +== Write compiler_config.h (DONE) == + +== Generating build files == +-- Configure libCGAL +-- GMP include: /usr/include/ +-- GMP definitions: +-- GMP libraries: /usr/lib/libgmp.so +-- Configured GMP in standard way +-- MPFR include: /usr/include/ +-- MPFR definitions: +-- MPFR libraries: /usr/lib/libmpfr.so +-- Configured MPFR in standard way +-- libCGAL is configured +-- Sources for CGAL component library 'Core' detected +-- Configure libCGALCore +-- GMP include: /usr/include/ +-- GMP definitions: +-- GMP libraries: /usr/lib/libgmp.so +-- Configured GMP in standard way +-- MPFR include: /usr/include/ +-- MPFR definitions: +-- MPFR libraries: /usr/lib/libmpfr.so +-- Configured MPFR in standard way +-- libCGALCore is configured +-- Sources for CGAL component library 'Qt3' detected +-- Sources for CGAL component library 'Qt4' detected +-- Configure libCGALQt4 +-- Looking for Q_WS_X11 +-- Looking for Q_WS_X11 - found +-- Looking for Q_WS_WIN +-- Looking for Q_WS_WIN - not found. +-- Looking for Q_WS_QWS +-- Looking for Q_WS_QWS - not found. +-- Looking for Q_WS_MAC +-- Looking for Q_WS_MAC - not found. +-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so +-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found +-- Looking for gethostbyname +-- Looking for gethostbyname - found +-- Looking for connect +-- Looking for connect - found +-- Looking for remove +-- Looking for remove - found +-- Looking for shmat +-- Looking for shmat - found +-- Looking for IceConnectionNumber in ICE +-- Looking for IceConnectionNumber in ICE - found +-- Found X11: /usr/lib/libX11.so +-- USING QT4_VERSION = '4.6.3' +-- OpenGL include: /usr/include +-- OpenGL libraries: /usr/lib/libGLU.so;/usr/lib/libGL.so;/usr/lib/libSM.so;/usr/lib/libICE.so;/usr/lib/libX11.so;/usr/lib/libXext.so +-- OpenGL definitions: +-- Qt4 include: /usr/include/qt4 +-- Qt4 libraries: /usr/lib/libQtOpenGL.so;/usr/lib/libQtGui.so;/usr/lib/libQtCore.so +-- Qt4 definitions: +-- moc executable: /usr/bin/moc-qt4 +-- uic executable: /usr/bin/uic-qt4 +-- GMP include: /usr/include/ +-- GMP definitions: +-- GMP libraries: /usr/lib/libgmp.so +-- Configured GMP in standard way +-- MPFR include: /usr/include/ +-- MPFR definitions: +-- MPFR libraries: /usr/lib/libmpfr.so +-- Configured MPFR in standard way +-- libCGALQt4 is configured +-- Sources for CGAL component library 'ImageIO' detected +-- Configure libCGALImageIO +-- Found OpenGL: /usr/lib/libGL.so +-- Found ZLIB: /usr/lib/libz.so (found version "1.2.3.4") +-- OpenGL include: /usr/include +-- OpenGL libraries: /usr/lib/libGLU.so;/usr/lib/libGL.so;/usr/lib/libSM.so;/usr/lib/libICE.so;/usr/lib/libX11.so;/usr/lib/libXext.so +-- USING ZLIB_VERSION = '1.2.3.4' +-- libCGALImageIO is configured +-- Sources for CGAL component libraries 'CGAL;Core;ImageIO;Qt3;Qt4' detected +== Generating build files (DONE) == + +-- Configuring done +-- Generating done +-- Build files have been written to: /home/user/CGAL/4.1/ diff --git a/Installation/doc_tex/Installation/installation.tex b/Installation/doc_tex/Installation/installation.tex index 8ca75cf2ba5..f42e9bda662 100644 --- a/Installation/doc_tex/Installation/installation.tex +++ b/Installation/doc_tex/Installation/installation.tex @@ -1,9 +1,9 @@ -%% +% %% *** CGAL Installation Guide *** %% %% file: installation.tex %% -%% authors: Michael Hoffmann, Dima Pasechnik and Wieger Wesselink +%% authors: Eric Berberich, Michael Hoffmann, Dima Pasechnik and Wieger Wesselink %% %% $Id$ %% @@ -54,303 +54,93 @@ This document describes how to install \cgal\ on Windows, Unix-like systems, and MacOS X. -Ideally, installing \cgal\ amounts to: +Ideally, setting up \cgal\ amounts to: + +\begin{alltt} + cd \cgalrel # go to \cgal\ directory + cmake . # configure \cgal + make # build the \cgal\ libraries +\end{alltt} +%% $ This dollar is there to trick syntax highlighting in emacs + +Compiling an example shipped with \cgal\ is similar simple: \begin{alltt} - cd \cgalrel # go to CGAL directory - cmake . # configure CGAL - make # build the CGAL libraries cd examples/Straight_skeleton_2 # go to an example directory cmake -DCGAL_DIR=$HOME/\cgalrel . # configure the examples make # build the examples \end{alltt} %% $ This dollar is there to trick syntax highlighting in emacs +Compiling an own non-shipped program is also close: + +\begin{alltt} +cd /path/to/program +cgal_create_CMakeLists -s executable +cmake -DCGAL_DIR=$HOME/\cgalrel . +make +\end{alltt} +%% $ This dollar is there to trick syntax highlighting in emacs + +where the second line creates a \texttt{CMakeLists.txt} file (check +its options in Section~\ref{sec:create_cgal_CMakeLists} for various details). + + In a less ideal world, you probably have to install \cmake, a makefile -generator, and third party libraries. That's what this manual is about. +generator, and third party libraries. That is what this manual is about. -\section{Supported Compilers} +\section{Prerequisites\label{sec:prerequisites}} -In order to build the \cgal\ libraries, you need a \CC\ compiler. -\cgal~\cgalversionnumber is supported for the following compilers/operating systems: +Installing \cgal\ requires a few components to be installed ahead: a +supported compiler (see Section~\ref{sec:compilers}, \cmake, \boost, and at least \gmp, and \mpfr; see +Section~\ref{sec:essential3rdpartysoftware} for more details on +essential third party software. -\begin{center}\index{compilers!supported}\index{supported compilers} - \renewcommand{\arraystretch}{1.3} - \gdef\lcTabularBorder{2} - \begin{tabular}{|l|l|} \hline - \textbf{compiler} & \textbf{operating system}\\\hline\hline - \Gcc{3.4 or later} \footnotemark[1] - & Linux / MacOS X - \\ & \mswin\ 95/98/2000/XP/NT4\\\hline - \icl{11.0 or later}\footnotemark[2] & Linux \\\hline - \msvc{9.0, 10.0} (\textsc{Visual Studio 2008 and 2010})\footnotemark[3] - & \mswin\ 95/98/2000/XP/NT4/Vista/7\\\hline - \end{tabular} -\end{center} -\footnotetext[1]{\gccurl}\addtocounter{footnote}{1} -\footnotetext[2]{\iclurl}\addtocounter{footnote}{1} -\footnotetext[3]{\msvcurl}\addtocounter{footnote}{1} +\section{OS-shipped \cgal\ \label{sec:shippedcgal}} -\section{CMake} +Some operating systems with package managers offer \cgal\ and its +essential third party software through the manager, +for instance, Mac OS X, or some Linux distribution (e.g.~Debian). -In order to configure, build, and install the \cgal\ libraries, examples and -demos, you need \cmake, a cross-platform ``makefile generator''. -If \cmake\ is not installed already you can obtain it from \cmakepage. -\cmake\ version~2.6.2 or higher is required. On Windows, \cmake{} -version~2.8.6 or higher is required, for a proper support of DLLs -generation. +\subsection{\cgal\ on MAC OS X\label{ssec:cgalmacosx}} +For instance, use macports in the following way: +\begin{alltt} + sudo port install cgal +\end{alltt} -\section{Third Party Software\label{sec:prerequisites}} +or if Qt4 demos are desired -The focus of \cgal\ is at geometry, and we rely on other -highly specialized libraries and software for non-geometric issues, -e.g., numeric solvers or visualization. +\begin{alltt} + sudo port install cgal +qt4 +universal +demos +\end{alltt} -Note that there is no need to first install all the software -listed below. Only the \stl\ and \boost\ are required by all -\cgal\ packages. +The setup is similar for homebrew. -\subsection{Standard Template Library \label{thirdparty:stl}} +\subsection{\cgal\ on Linux\label{ssec:cgaldebian}} -\cgal\ heavily uses the \stl, and in particular adopted -many of its design ideas. You can find online -documentation for the \stl\ at various web sites, e.g., -\path+http://www.sgi.com/tech/stl/+, \path+http://www.cplusplus.com/reference/+, -or \path+http://msdn.microsoft.com/en-us/library/1fe2x6kt(VS.100).aspx+. +For instance in debian/Ubuntu, use apt-get in the following way: -The \stl\ comes with the compiler, so there is nothing to install. +\begin{alltt} + sudo apt-get install libcgal-dev +\end{alltt} +To get the demos use -\subsection{Boost \label{thirdparty:Boost}} +\begin{alltt} + sudo apt-get install libcgal-demo +\end{alltt} -The \boost\ libraries are a set of portable C++ source libraries. Most of -\boost\ libraries are header-only, but a few of them need to be compiled or -installed as binaries. - -\cgal\ requires the \boost\ libraries. In particular the header files -and the threading library (\texttt{Boost.Thread} binaries. Version 1.39 (or -higher) are needed. - -On Windows, as auto-linking is used, you also need the binaries of -\texttt{Boost.Serialization} and \texttt{Boost.DateTime}, but the -dependency is artificial and used only at link-time: the CGAL libraries do -not depend on the DLLs of those two libraries. - -In \cgal\ some demos also depend on \texttt{Boost.Program\_options}. - -In case the \boost\ libraries are not installed on your system already, you -can obtain them from \boostpage. For Windows you can download an -installer from \boostprodownloadpage. -Since \texttt{Boost.Thread} is required, make sure to either install the precompiled -libraries for your compiler or build \texttt{libboost-thread}. - -As on Windows there is no canonical directory for where to find \boost, we recommend that you define the environment variable \ccc{BOOST_ROOT} and set it -to where you have installed \boost, e.g., \path|C:\boost\boost_1_41_0|. - -\subsection{GMP and MPFR \label{thirdparty:GMP} \label{thirdparty:MPFR}} - -\gmp\ and \mpfr\ are libraries for multi precision integers and rational numbers, -and for multi precision floating point numbers. - -\cgal\ combines floating point arithmetic with exact arithmetic, -in order to be efficient and reliable. \cgal\ has a built-in -number type for that, but \gmp\ and \mpfr\ provide a faster -solution, and we recommend to use them. - -Having \gmp\ version 4.2 or higher and \mpfr\ version 2.2.1 or higher -installed is recommended. These libraries can be obtained from -\gmppage\ and \mpfrpage, respectively. - -As Visual \CC\ is not properly -supported by the \gmp\ and \mpfr\ projects, we provide precompiled versions -of \gmp\ and \mpfr, which can be downloaded with the installer -\texttt{\cgalrel-Setup.exe}. - -\subsection{CORE \label{thirdparty:Core}} - -\core\ is a library that provides a number type for computing with real -numbers; that is, it allows to represent expressions with square roots -involved. This package is useful when dealing with curved objects. - -\core\ is needed by the \cgal\ kernel that deals with algebraic -numbers. - -\core\ can be downloaded from \corepage', -but we recommend to use the version of \core\ that is distributed -with \cgal. - -\subsection{Leda \label{thirdparty:Leda}} - -\leda\ is a library of efficient data structures and -algorithms. Like \core, \leda\ offers a real number data type. - -In \cgal\ this library is optional, and its number types can -be used as an alternative to \gmp, \mpfr, and \core . - -Free and commercial editions of \leda\ are available from \ledapage. - - - -\subsection{RS \label{thirdparty:RS}} - -\rs{} (Real Solutions) is devoted to the study of the real -roots of polynomial systems with a finite number of complex roots -(including univariate polynomials). - -In \cgal\ \rs{} is used by one model of the \ccRef[Algebraic Kernel]{Pkg:AlgebraicKerneld}. - -\rs{} is freely distributable for non-commercial use. You can download it -from \rspage{}. The library \rs\ needs \mpfi, which can be downloaded from \mpfipage. -Version 1.4 or higher is recommended. - - - -\subsection{OpenNL \label{thirdparty:OpenNL}} - -OpenNL (Open Numerical Library) is a library used to easily construct and solve -sparse linear systems. - -In \cgal\ it is the default solver for the -\ccRef[Surface Mesh Parameterization]{Pkg:SurfaceParameterization} package. - -The OpenNL's main Web page is \opennlpage. -\cgal\ includes a version of OpenNL in C++ made especially for \cgal\ by Bruno L\'evy. - -\subsection{Eigen \label{thirdparty:Eigen}} -\eigen\ is a \texttt{C++} template library for linear algebra. \eigen\ supports all - matrix sizes, various matrix decomposition methods and sparse linear solvers. - - 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}} - -\taucs\ is a library of sparse linear solvers. - -In \cgal, \taucs\ can be used by the -\ccRef[Surface Reconstruction from Point Sets]{Pkg:SurfaceReconstructionFromPointSets} -package, and by the \ccRef[Planar Parameterization of Triangulated Surface Meshes]{Pkg:SurfaceParameterization} -package. Note that since \cgal\ 4.0, \eigen\ is recommended over \taucs. - -The \taucs\ website is \taucspage.\\ -The latest official version is \taucs\ version 2.2, September 4, 2003. -Copyright (c) 2001, 2002, 2003 by Sivan Toledo, Tel-Aviv University, -stoledo@tau.ac.il. All Rights Reserved.\\ -See \taucspage{} for the license and the availability note.\\ -Used by permission of Sivan Toledo. - -The \cgal\ project provides a modified version of \taucs\ in the download -section of \cgalhomepage. This version fixes some bugs, -supports 64-bit platforms, and allows a simplified installation process. -It also contains a complete \lapack\ implementation. - -As Visual~\CC\ is not properly -supported by the \taucs\ project, we provide a precompiled version of -\taucs, which can be downloaded with the installer -\texttt{\cgalrel-Setup.exe}. - -\emph{CAUTION:} Since version 3.3.1, \cgal\ is no longer compatible with the official -release of \taucs\ (currently 2.2). Make sure to use the modified -version provided in the download section. - -\subsection{Blas \label{thirdparty:Blas}} - -\blas\ (Basic Linear Algebra Subprograms) is a library of -basic vector and matrix operations. - - -In \cgal, \blas\ can be used by the packages -\ccRef[Estimation of Local Differential Properties]{Pkg:Jet_fitting_3} -and \ccRef[Approximation of Ridges and Umbilics]{Pkg:Ridges_3} only. -Note that if \eigen\ is available on the system, \blas\ is not -required anymore. - - -You can download the official release from \blaspage. -Alternatively, installing \taucs\ customized for \cgal\ provides \blas. - - -\subsection{Lapack \label{thirdparty:Lapack}} - -\lapack\ provides routines for solving systems of simultaneous linear equations, -least-squares solutions of linear systems of equations, eigenvalue problems, -and singular value problems. - -In \cgal, \lapack\ can be used by the packages -\ccRef[Estimation of Local Differential Properties]{Pkg:Jet_fitting_3} -and \ccRef[Approximation of Ridges and Umbilics]{Pkg:Ridges_3} only. -Note that if \eigen\ is available on the system, \lapack\ is not -required anymore. - -You can download the official release from \lapackpage. -Alternatively, installing \taucs\ customized for \cgal\ provides \lapack. - - -\subsection{Qt \label{thirdparty:Qt}} - -Qt is a cross-platform application and UI framework. - -Most \cgal\ demos use Qt3 or Qt4. -Having Qt4 version 4.3.0 or higher is recommended. - -In case Qt is not yet installed on your system, you can download -it from \qtpage. - -\subsection{libQGLViewer \label{thirdparty:libQGLViewer}} - -libQGLViewer is a 3D widget based on \qt~4's \ccc{QGLWidget}. - -In \cgal\ some 3D demos are based on libQGLViewer. - -It can be downloaded from \libqglviewerpage. - - -\subsection{Coin \label{thirdparty:Coin}} - -Coin is an implementation of Open Inventor. - -In \cgal, Coin is used in the demo -of the \ccRef[Kinetic Data Structures]{Pkg:Kds} package. - -You can download it from \coinpage. - - -\subsection{zlib \label{thirdparty:zlib}} - -zlib is a data compression library. - -In \cgal\ this library is used in the examples of the \ccRef[Surface Mesh Generation]{Pkg:SurfaceMesher3} package. - -If it is not already on your system, -e.g., on Windows, you can download it from \zlibpage. - - -\subsection{ESTBL \label{thirdparty:ESTBL}} - -The \textsc{Esbtl} (Easy Structural Biology Template Library) is a library that allows -the handling of \textsc{Pdb} data. - -In \cgal\ the \textsc{Esbtl} is used in an example of the -\ccRef[3D Skin Surface Meshing]{Pkg:SkinSurface3} package. - -It can be downloaded from \esbtlpage. +Check the \cgal-FAQ for source repository of newest releases. +On other distributions, please consult your package manager documentation. \section{Downloading \cgal\label{sec:gettingcgal}} \index{CGAL@\cgal!getting}\index{getting \cgal} -The \cgal\ library can be downloaded from \cgaldownloadpage. +You can obtain the \cgal\ library from \cgaldownloadpage\ and +install it yourself. After you have downloaded the file \texttt{\cgalrel.tar.gz} containing the \cgal\ sources, you have to unpack it. Under a Unix-like shell, use the @@ -360,7 +150,6 @@ command: tar xzf \cgalrel.tar.gz \end{alltt} - When you are on Windows you may download and run \texttt{\cgalrel-Setup.exe}. It is a self extracting executable that installs the \cgal\ source, and that allows you to select and download some precompiled third party libraries. @@ -373,15 +162,15 @@ 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{config} & configuration files for install script\\\hline + \texttt{auxiliary} & precompiled \gmp, \mpfr\ and \taucs\ 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 \texttt{doc\_html} & documentation (HTML)\\\hline - \texttt{doc\_pdf} & documentation (PDF)\\\hline +% \texttt{doc\_pdf} & documentation (PDF)\\\hline \texttt{examples} & example programs\\\hline \texttt{include} & header files\\\hline - \texttt{scripts} & some useful scripts (e.g. for creating CMakeLists.txt files)\\\hline + \texttt{scripts} & some useful scripts (e.g.~for creating CMakeLists.txt files)\\\hline \texttt{src} & source files\\\hline \end{tabular} \end{center} @@ -391,83 +180,107 @@ distribution of the \core\ library\footnote{\corepage} version~1.7 for dealing with algebraic numbers. \core\ is not part of \cgal\ and has its own license. +The directory \texttt{include/CGAL/OpenNL} contains a distribution of the +Open Numerical Library which provides solvers for sparse linear systems, +especially designed for the Computer Graphics community. \opennl\ is not part +of \cgal\ and has its own license. + The only documentation shipped with \cgal{} sources is the present installation manual. The \cgal{} manual must be downloaded separately from \cgaldownloadpage. -The directory \texttt{include/CGAL/OpenNL} contains a distribution of the -Open Numerical Library which provides solvers for sparse linear systems, -especially designed for the Computer Graphics community. OpenNL is not part -of \cgal\ and has its own license. +\section{Supported Compilers\label{sec:compilers}} -\section{Configuring \cgal} +In order to build the \cgal\ libraries, you need a \CC\ compiler. +\cgal~\cgalversionnumber\ is supported for the following compilers/operating systems: +\begin{center}\index{compilers!supported}\index{supported compilers} + \renewcommand{\arraystretch}{1.3} + \gdef\lcTabularBorder{2} + \begin{tabular}{|l|l|} \hline + \textbf{compiler} & \textbf{operating system}\\\hline\hline + \Gcc{3.4 or later}\footnotemark[1] + & Linux / MacOS X + \\ & \mswin\ 95/98/2000/XP/NT4\\\hline + \icl{11.0 or later}\footnotemark[2] & Linux \\\hline + \msvc{9.0, 10.0} (\textsc{Visual Studio 2008 and 2010})\footnotemark[3] + & \mswin\ 95/98/2000/XP/NT4/Vista/7\\\hline + \end{tabular} +\end{center} +\footnotetext[1]{\gccurl}\addtocounter{footnote}{1} +\footnotetext[2]{\iclurl}\addtocounter{footnote}{1} +\footnotetext[3]{\msvcurl}\addtocounter{footnote}{1} + + +\section{Configuring \cgal\ with CMake\label{sec:configwithcmake}} + +In order to configure, build, and install the \cgal\ libraries, examples and +demos, you need \cmake, a cross-platform ``makefile generator''. +If \cmake\ is not installed already you can obtain it from \cmakepage. +\cmake\ version~2.6.2 or higher is required. On Windows, \cmake{} +version~2.8.6 or higher is required, for a proper support of DLL's +generation. +This manual explains only those features of +\cmake\ which are needed in order to build \cgal. Please refer to the +\cmake\ documentation at \cmakepage\ for further details. + Before building \cgal\ you have to choose the compiler/linker, set compiler and linker flags, specify which third-party libraries you want to use and where they can be found, and which \cgal\ libraries you want to build. Gathering all this information is called \emph{configuration}. - -The configuration uses \cmake, a -cross-platform build system generator that can generate makefiles, or IDE -project files. This manual explains only those features of -\cmake\ which are needed in order to build \cgal. Please refer to the \cmake{} -documentation at \cmakepage\ for further details. - -The \cmake\ configuration process generates a makefile or a Visual \CC{} -solution and project file that you can use to build \cgal. +The end of the process is marked by the generation of a makefile or a +Visual \CC\ solution and project file that you can use to build \cgal. \subsection{Configuring \cgal{} with the \cmake{} \textsc{Gui} } The simplest way to start the configuration is to run the graphical user interface of \cmake. We recommend to use \texttt{cmake-gui}. It -is available on all platforms since \cmake\ version~2.6. You must pass as +is available on many platforms as of \cmake\ version~2.6. You must pass as argument the root directory of \cgal. For example: -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} cd \cgalrel cmake-gui . # Notice the dot to indicate the current directory. \end{alltt} } -Once \texttt{cmake-gui} has started up, you must press 'Configure'. -A dialog will pop up and you will have to choose what shall get generated. -After you have made your choice and pressed 'ok', you will see -the output of configuration tests in the lower window of the application. +After \texttt{cmake-gui} opens, press 'Configure'. +A dialog will pop up and you will have to choose what shall gets generated. +After you have made your choice and pressed 'Finish', you will see +the output of configuration tests in the lower portion of the application. When these tests are done, you will see many -red entries in the upper window. Just ignore them and press once again 'Configure'. +red entries in the upper portion of the application. Just ignore them and press 'Configure'. By now \cmake\ should have found many libraries and have initialized variables. -If you still find red entries you have to provide the necessary information. +If you still find red entries, you have to provide the necessary information. This typically happens if you have installed software at non-standard locations. Providing information and pressing 'Configure' goes on until all entries are grayed. You are now ready to press 'Generate'. Once this is done, you can quit \texttt{cmake-gui}. - - \subsection{Configuring \cgal{} with the cmake command-line tool } Alternatively, you can run the command-line tool called \texttt{cmake}. You pass as argument the root directory of \cgal. For example: -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} cd \cgalrel cmake . # Notice the dot to indicate the current directory. \end{alltt} } - The very first thing \cmake\ does is to detect the compiler to use. This -detection is performed by a special \cmake\ module called a {\em - generator}. A \cmake\ generator understands the build requirements for a +detection is performed by a special \cmake\ module called a +\emph{generator}. +A \cmake\ generator understands the build requirements for a particular compiler/linker and generates the necessary files for that. For -example, the \emph{UNIX Makefiles} generator understands the GNU toolchain -(g++, gcc, ld etc.) and produces makefiles, which can be used to build a +example, the \emph{UNIX Makefiles} generator understands the GNU chain +of tools (\gcc, ld etc.) and produces makefiles, which can be used to build a target by a simple call to \texttt{make}. Likewise, the \emph{Visual Studio - 2005} generator produces solution and project files and can be manually + 2010} generator produces solution and project files and can be manually launched in the VS IDE to build the target. Each platform has a default generator, so you only need to select one when @@ -476,34 +289,35 @@ possible to generate \emph{NMakefiles} instead of Visual Studio project files in order to build the library with \texttt{nmake}. Running \texttt{cmake} with no parameters in a command-line prints the list of available generators supported by your platform and \cmake\ version. If the -generator you need is not listed there, you can try a newer \cmake{} -version, as generators are hardcoded into \cmake, and additional +generator you need is not listed there, you can try a newer +\cmake\ version, as generators are hardcoded into \cmake, and additional generators are added with each release. Since the choice of the generator determines the type of build files to generate, in some cases you choose a particular generator as a mean to choose a specific compiler (because they use different -build files). For example, the following generates solution files for use in Visual \CC\ 9.0: +build files). For example, the following generates solution files for +use in Visual \CC\ 11.0 on a 64bit machine: -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} cd \cgalrel - cmake -G"Visual Studio 9 2008" . + cmake -G"Visual Studio 11 Win64" . \end{alltt} } -In other cases, however, the generator doesn't directly identify a specific compiler but a tool chain. +In other cases, however, the generator doesn't directly identify a +specific compiler but a chain of tools. For example, the \texttt{UNIX Makefiles} generator produces \texttt{makefiles} that call some auto-detected -command-line compiler, like \texttt{gcc}. If you need the makefiles to use a different compiler, you need to +command-line compiler, like \gcc. If you need the makefiles to use a different compiler, you need to specify the desired compiler in the call to \cmake{}, as in this example: -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} cd \cgalrel - cmake -DCMAKE_CXX_COMPILER:FILEPATH=g++-3.4 . + cmake -DCMAKE_CXX_COMPILER:FILEPATH=g++-4.7 . \end{alltt} } - \cmake\ maintains configuration parameters in so-called \emph{cmake variables}, like the \texttt{CMAKE\_CXX\_COMPILER} in the example above. These variables \emph{are not environment variables} but \emph{\cmake\ variables}. Some of the \cmake{} variables represent user choices, such as \texttt{WITH\_examples} or \texttt{CMAKE\_BUILD\_TYPE=Release}, while others @@ -525,53 +339,50 @@ The configuration process not only determines the location of the required depen \texttt{CGALConfig.cmake}, which is used to build programs using \cgal. The purpose of this file is explained below. -\subsection{\cgal\ Libraries} +\section{\cgal\ Libraries\label{sec:libraries}} -\cgal\ is split into six libraries. During configuration, you can select the libraries that -you would like to build by setting a \cmake\ variable of the form {\tt WITH\_}. By default all -are switched \texttt{ON}. +\cgal\ is split into five libraries. During configuration, you can select the libraries that +you would like to build by setting a \cmake\ variable of the form \texttt{WITH\_}. By default all +are switched \texttt{ON}. All activated libraries are build after +configuration; see~\ref{sec:building} + +We next list the libraries and essential 3rd party software +(see~\ref{sec:essential3rdpartysoftware}) for each library: \begin{center}\index{cgal!libraries}\index{cgal libraries} \renewcommand{\arraystretch}{1.3} \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|l|} \hline \textbf{library} & \textbf{\cmake\ variable} & \textbf{functionality} & \textbf{dependencies}\\\hline\hline - \texttt{CGAL} & \emph{none} & Main library & GMP, MPFR, Boost (headers)\\ + \texttt{CGAL} & \emph{none} & Main library & \gmp, \mpfr, \boost\ (headers)\\ & & & and Boost.Thread (library)\\\hline - \texttt{CGAL\_Core} & \texttt{WITH\_CGAL\_Core} & The CORE library for algebraic numbers.\footnotemark[15] & GMP and MPFR\\\hline - \texttt{CGAL\_Qt3} & \texttt{WITH\_CGAL\_Qt3} & \ccc{CGAL::Qt_widget} used by Qt3-based demos & Qt3 and OpenGL\\\hline - \texttt{CGAL\_Qt4} & \texttt{WITH\_CGAL\_Qt4} & \ccc{QGraphicsView} support for Qt4-based demos & Qt4 and OpenGL\\\hline - \texttt{CGAL\_ImageIO} & \texttt{WITH\_CGAL\_ImageIO} & Utilities to read and write image files & OpenGL, ZLib, VTK (optional)\\\hline - \end{tabular} + \texttt{CGAL\_Core} & \texttt{WITH\_CGAL\_Core} & The CORE library for algebraic numbers.\footnotemark[15] & \gmp\ and \mpfr\\\hline + \texttt{CGAL\_ImageIO} & \texttt{WITH\_CGAL\_ImageIO} & Utilities to read and write image files & \opengl, \zlib, \vtk (optional)\\\hline + \texttt{CGAL\_Qt3} & \texttt{WITH\_CGAL\_Qt3} & \ccc{CGAL::Qt_widget} used by \qt3-based demos & \qt3 and \opengl\\\hline + \texttt{CGAL\_Qt4} & \texttt{WITH\_CGAL\_Qt4} & \ccc{QGraphicsView} support for \qt4-based demos & \qt4 and \opengl\\\hline + \end{tabular} \end{center} -\footnotetext[15]{CGAL-core++ is not part of \cgal, it is a custom version the CORE library distributed +\footnotetext[15]{CGAL\_Core is not part of \cgal, it is a custom version the \core\ library distributed by \cgal\ for the user convenience and it has it's own license.}\addtocounter{footnote}{1} -If you turn off the configuration of a library, you can still configure it manually from the source directory: +% Remark EBEB: Removed the following. Just reconfigure while CGAL if a library +% was missing -{\ccTexHtml{\scriptsize}{} -\begin{alltt} - cd \cgalrel/src/CGALQt4 - cmake . # configures only the CGAL_Qt4 library -\end{alltt} -} +%If you turn off the configuration of a library, you can still configure it manually from the source directory: -\subsection{Examples and Demos} - -\cgal\ is distributed with a large collection of examples and demos. By default, these are NOT configured along with -the \cgal\ libraries, unless you set the variables {\tt WITH\_examples=ON} and/or {\tt WITH\_demos=ON}. - -Nevertheless, even when configured with \cgal, they are not automatically built along with the libraries. -You must build the \texttt{examples} or \texttt{demos} make targets (or IDE projects) explicitly. +%{\ccTexHtml{}{} +%\begin{alltt} +% cd \cgalrel/src/CGALQt4 +% cmake . # configures only the CGAL_Qt4 library +%\end{alltt} +%} \subsection{Debug vs.\ Release} -The \cmake\ variable \texttt{CMAKE\_BUILD\_TYPE} to indicate how to build +The \cmake\ variable \texttt{CMAKE\_BUILD\_TYPE} indicates how to build the libraries. It accepts the values \texttt{Release} or -\texttt{Debug}. The default depends on the platform, so it is recommended -that you always indicate the build type explicitly. For performance -reasons, you should always use \texttt{Release}, unless you want to debug +\texttt{Debug}. The default is \texttt{Release} and should be kept, unless you want to debug your program. This is not an issue for solution/project files, as there the user selects the build type from within the IDE. @@ -579,57 +390,331 @@ This is not an issue for solution/project files, as there the user selects the b \subsection{Static vs.\ Shared Libraries } Shared libraries, also called \emph{dynamic-link libraries}, are built by default -({\tt .dll} on Windows, {\tt .so} on Linux, {\tt .dylib} on MacOS). You +(\texttt{.dll} on Windows, \texttt{.so} on Linux, \texttt{.dylib} on MacOS). You can choose to produce static libraries instead by setting the \cmake{} variable \texttt{BUILD\_SHARED\_LIBS} to \texttt{FALSE}. If you use -\texttt{cmake-gui}, that variable appears as a checkable option in the -graphical user interface. +\texttt{cmake-gui}, a tick box for that variable is available to set it. -\subsection{Multiple Variants of makefiles}\label{sec:cmake-out-of-source} +These setting affect the variants of third-party libraries (see next +section) selected whenever the choice is available. -While you can choose between release or debug builds, and shared or static libraries, -it is not possible to generate different variants during a single configuration. You need to run \cmake\ in a -different directory for each variant you are interested in, each with its own selection of configuration parameters. +\section{Essential Third Party Libraries\label{sec:essential3rdpartysoftware}} -\cmake\ stores the resulting makefiles and project files, along with several temporary and auxiliary files such -as the variables cache, in the directory where it is executed, called \texttt{CMAKE\_BINARY\_DIR}, but it -takes the source files and configuration scripts from -\texttt{CMAKE\_SOURCE\_DIR}. +The focus of \cgal\ is on geometry, and we rely on other +highly specialized libraries and software for non-geometric issues, +for instance, for numeric solvers, or visualization. We first list software +that is essential to build (all) libraries of \cgal, that is, +this software must be found during the configuration of \cgal\ for an +actived library of \cgal\ (i.e.~\texttt{WITH\_=ON}); +see \ref{sec:3partysoftwareconfig} to specify the location of 3rd +party software. -The binary and source directories do not need to be the same. Thus, you can configure multiple variants by creating a -distinct directory for each configuration and by running \cmake\ from there. This is known in \cmake\ terminology -as \emph{out-of-source configuration}, as opposite to an \emph{in-source - configuration}, as showed in the previous sections. +The libraries \stl\ (shipped with any compiler) and \boost\ are essential to all components (i.e.~libCGAL, +libCGAL\_Core, libCGAL\_imageIO, libCGAL\_Qt3 and libCGAL\_Qt4). -You can, for example, generate subdirectories \cgalrel{}\texttt{/cmake/platforms/debug} and -\cgalrel{}\texttt{/cmake/platforms/release} for two configurations, respectively: +\subsection{Standard Template Library (\stl) \label{thirdparty:stl}} -{\ccTexHtml{\scriptsize}{} -\begin{alltt} -mkdir \cgalrel/cmake/platforms/debug -cd \cgalrel/cmake/platforms/debug -cmake -DCMAKE_BUILD_TYPE=Debug ../../.. +\cgal\ heavily uses the \stl, and in particular adopted +many of its design ideas. You can find online +documentation for the \stl\ at various web sites, for instance, +\path+http://www.sgi.com/tech/stl/+, \path+http://www.cplusplus.com/reference/+, +or \path+http://msdn.microsoft.com/en-us/library/1fe2x6kt(VS.100).aspx+. -mkdir \cgalrel/cmake/platforms/release -cd \cgalrel/cmake/platforms/release -cmake -DCMAKE_BUILD_TYPE=Release ../../.. -\end{alltt} -} +The \stl\ comes with the compiler, so there is nothing to install. -\section{Building \cgal\ Libraries} +\subsection{\boost \label{thirdparty:Boost}} -%If configuration succeeded there will be certain \emph{build files} ready -%to build the libraries. -The results of a successful configuration are build file that control the build step. +The \boost\ libraries are a set of portable C++ source libraries. Most of +\boost\ libraries are header-only, but a few of them need to be compiled or +installed as binaries. + +\cgal\ requires the \boost\ libraries. In particular the header files +and the threading library (\texttt{Boost.Thread} and +\texttt{Boost.System} binaries). Version 1.39 (or higher) are needed. + +On Windows, as auto-linking is used, you also need the binaries of +\texttt{Boost.Serialization} and \texttt{Boost.DateTime}, but the +dependency is artificial and used only at link-time: the CGAL libraries do +not depend on the DLL's of those two libraries. + +In \cgal\ some demos and examples depend on \texttt{Boost.Program\_options}. + +In case the \boost\ libraries are not installed on your system already, you +can obtain them from \boostpage. For Windows you can download an +installer from \boostprodownloadpage. +Since \texttt{Boost.Thread} is required, make sure to either install the precompiled +libraries for your compiler or build \texttt{libboost-thread} and \texttt{libboost-system}. + +As on Windows there is no canonical directory for where to find \boost, we recommend that you define the environment variable \ccc{BOOST_ROOT} and set it +to where you have installed \boost, e.g., \path|C:\boost\boost_1_41_0|. + +\subsection{\gmp\ and \mpfr\ \label{thirdparty:GMP} \label{thirdparty:MPFR}} + +The components libCGAL, libCGAL\_Core, libCGAL\_Qt3 and libCGAL\_Qt4 require +\gmp\ and \mpfr\ which are libraries for multi precision integers and rational numbers, +and for multi precision floating point numbers. + +\cgal\ combines floating point arithmetic with exact arithmetic, +in order to be efficient and reliable. \cgal\ has a built-in +number type for that, but \gmp\ and \mpfr\ provide a faster +solution, and we recommend to use them. + +Having \gmp\ version 4.2 or higher and \mpfr\ version 2.2.1 or higher +installed is recommended. These libraries can be obtained from +\gmppage\ and \mpfrpage, respectively. + +As Visual \CC\ is not properly +supported by the \gmp\ and \mpfr\ projects, we provide precompiled versions +of \gmp\ and \mpfr, which can be downloaded with the installer +\texttt{\cgalrel-Setup.exe}. + +\subsection{\zlib \label{thirdparty:zlib}} + +\zlib\ is a data compression library, and is essential for the component libCGAL\_ImageIO. + +In \cgal\ this library is used in the examples of the \ccRef[Surface Mesh Generation]{Pkg:SurfaceMesher3} package. + +If it is not already on your system, +for instance, on Windows, you can download it from \zlibpage. + +\subsection{\opengl \label{thirdparty:OpenGL}} + +\opengl\ (Open Graphics Library) provides an API for applications that +produce 2D and 3D computer graphics. + +In \cgal\ the library is essential for the components libCGAL\_Qt3 and +libCGAL\_Qt4, as well as libCGAL\_ImageIO and for various demos. + +Typically, \opengl\ is preinstalled on systems; if not, it can be +downloaded from \openglpage. + +\subsection{\qt3\ and \qt4\label{thirdparty:Qt3}\label{thirdparty:Qt4}\label{thirdparty:Qt}} + +Qt is a cross-platform application and UI framework. + +The component libCGAL\_Qt3 requires \qt3\ installed on your system, while +the component libCGAL\_Qt4 requires \qt4\ installed on your system. +In case \qt\ is not yet installed on your system, you can download +it from \qtpage. + +Older demos of \cgal use libCGAL\_Qt3 and \qt3, while newer and newly +developed demos require libCGAL\_Qt4 and \qt4. + +Having \qt4\ version 4.3.0 or higher is recommended. + +\section{\cgal\ Examples and Demos} + +\cgal\ is distributed with a large collection of examples and demos. By default, these are \textbf{not} configured along with +the \cgal\ libraries, unless you set the variables \texttt{WITH\_examples=ON} and/or \texttt{WITH\_demos=ON}. + +Nevertheless, even when configured with \cgal, they are not automatically built along with the libraries. +You must build the \texttt{examples} or \texttt{demos} targets (or IDE projects) explicitly. + +If you do not plan to compile any demos, you might skip some of the essential libraries (as \qt\ or +\opengl), as the corresponding \cgal-libraries are not linked. But for +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 +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 +are available when using \cgal. + +% EBEB: I removed CORE. We actually do not encourage at this point to +% use non-shipped CORE. This might change with CORE v2.0 + +%\subsection{CORE \label{thirdparty:Core}} +% +%\core\ is a library that provides a number type for computing with real +%numbers; that is, it allows to represent expressions with square roots +%involved. This package is useful when dealing with curved objecs. +% +%\core\ is needed by the \cgal\ kernel that deals with algebraic +%numbers. +% +%\core\ can be downloaded from \corepage', +%but we recommend to use the version of \core\ that is distributed +%with \cgal. + +\subsection{\leda\ \label{thirdparty:Leda}} + +\leda\ is a library of efficient data structures and +algorithms. Like \core, \leda\ offers a real number data type. + +In \cgal\ this library is optional, and its number types can +be used as an alternative to \gmp, \mpfr, and \core. + +Free and commercial editions of \leda\ are available from \ledapage. + +\subsection{\mpfi\ \label{thirdparty:MPFI}} + +\mpfi\ provide arbitrary precision interval arithmetic with intervals +represented using \mpfr\ reliable floating-point numbers. +It is based on the \gmp\ library and on the \mpfr\ library. +In the setting of \cgal\ it is mainly used in sync with \rs. +The library is optional and needed in certain algebraic +kernels. + +\mpfi\ can be downloaded from \mpfipage. Version 1.4 or higher is recommended. + +\subsection{\rs\ and \rs3\label{thirdparty:RS}\label{thirdparty:RS3}} + +\rs{} (Real Solutions) is devoted to the study of the real +roots of polynomial systems with a finite number of complex roots +(including univariate polynomials). + +In \cgal, \rs{} is used by one model of the \ccRef[Algebraic Kernel]{Pkg:AlgebraicKerneld}. + +\rs{} is freely distributable for non-commercial use. You can download it +from \rspage{}. The library \rs\ needs \mpfi, which can be downloaded from \mpfipage. +Version 1.4 or higher is recommended. + +The successor of \rs\ is called \rs3. It less restrictive when it comes +to licencing and also contains improved and more efficient interfaces. +Mainly parts in \cgal's algebraic kernel require \rs3. + +\subsection{\ntl \label{thirdparty:NTL}} + +\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. + +\ntl\ can be downloaded from \ntlpage. Version 5.1 or higher is recommended. + +% \subsection{\opennl \label{thirdparty:OpenNL}} + +% SL: As for Core, OpenNL is distributed by CGAL and the online version is not compatible. +% \opennl\ (Open Numerical Library) is a library used to easily construct and solve +% sparse linear systems. +% +% In \cgal\ it is the default solver for the +% \ccRef[Surface Mesh Parameterization]{Pkg:SurfaceParameterization} package. +% +% The \opennl's main website is \opennlpage. +% \cgal\ includes a version of OpenNL in C++ made especially for \cgal\ by Bruno L\'evy. + +\subsection{\eigen \label{thirdparty:Eigen}} +\eigen\ is a \texttt{C++} template library for linear algebra. \eigen\ supports all + matrix sizes, various matrix decomposition methods and sparse linear solvers. + + 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}} + +% \taucs\ is a library of sparse linear solvers. + +% In \cgal, \taucs\ can be used by the +% \ccRef[Surface Reconstruction from Point Sets]{Pkg:SurfaceReconstructionFromPointSets} +% package, and by the \ccRef[Planar Parameterization of Triangulated Surface Meshes]{Pkg:SurfaceParameterization} +% package. Note that since \cgal\ 4.0, \eigen\ is recommended over \taucs. + +% The \taucs\ website is \taucspage.\\ +% The latest official version is \taucs\ version 2.2, September 4, 2003. +% Copyright (c) 2001, 2002, 2003 by Sivan Toledo, Tel-Aviv University, +% stoledo@tau.ac.il. All Rights Reserved.\\ +% See \taucspage{} for the license and the availability note.\\ +% Used by permission of Sivan Toledo. + +% The \cgal\ project provides a modified version of \taucs\ in the download +% section of \cgalhomepage. This version fixes some bugs, +% supports 64-bit platforms, and allows a simplified installation process. +% It also contains a complete \lapack\ implementation. + +% As Visual~\CC\ is not properly +% supported by the \taucs\ project, we provide a precompiled version of +% \taucs, which can be downloaded with the installer +% \texttt{\cgalrel-Setup.exe}. + +% \emph{CAUTION:} Since version 3.3.1, \cgal\ is no longer compatible with the official +% release of \taucs\ (currently 2.2). Make sure to use the modified +% version provided in the download section. + +% \subsection{\blas \label{thirdparty:Blas}} + +% \blas\ (Basic Linear Algebra Subprograms) is a library of +% basic vector and matrix operations. + + +% In \cgal, \blas\ can be used by the packages +% \ccRef[Estimation of Local Differential Properties]{Pkg:Jet_fitting_3} +% and \ccRef[Approximation of Ridges and Umbilics]{Pkg:Ridges_3} only. +% Note that if \eigen\ is available on the system, \blas\ is not +% required anymore. + + +% You can download the official release from \blaspage. +% Alternatively, installing \taucs\ customized for \cgal\ provides \blas. + +% \subsection{\lapack \label{thirdparty:Lapack}} + +% \lapack\ provides routines for solving systems of simultaneous linear equations, +% least-squares solutions of linear systems of equations, eigenvalue problems, +% and singular value problems. + +% In \cgal, \lapack\ can be used by the packages +% \ccRef[Estimation of Local Differential Properties]{Pkg:Jet_fitting_3} +% and \ccRef[Approximation of Ridges and Umbilics]{Pkg:Ridges_3} only. +% Note that if \eigen\ is available on the system, \lapack\ is not +% required anymore. + +% You can download the official release from \lapackpage. +% Alternatively, installing \taucs\ customized for \cgal\ provides \lapack. + +\subsection{libQGLViewer \label{thirdparty:libQGLViewer}} + +libQGLViewer is a 3D widget based on \qt~4's \ccc{QGLWidget}. + +In \cgal\ some 3D demos are based on libQGLViewer. + +It can be downloaded from \libqglviewerpage. + +\subsection{\coin \label{thirdparty:Coin}} + +\coin\ is an implementation of Open Inventor. + +In \cgal, \coin\ is used in the demo +of the \ccRef[Kinetic Data Structures]{Pkg:Kds} package. + +You can download it from \coinpage. + +\subsection{\esbtl \label{thirdparty:ESBTL}} + +The \esbtl\ (Easy Structural Biology Template Library) is a library that allows +the handling of \textsc{Pdb} data. + +In \cgal\ the \esbtl\ is used in an example of the +\ccRef[3D Skin Surface Meshing]{Pkg:SkinSurface3} package. + +It can be downloaded from \esbtlpage. + +\section{Building \cgal \label{sec:building}} + +The results of a successful configuration are build files that control the build step. The nature of the build files depends on the generator used during configuration, but in all cases they -contain several \emph{targets}, one per library, and a default global target corresponding +contain several \emph{targets}, one per library, and a default global target corresponding to all the libraries. -For example, in a UNIX-like environment the default generator produces +For example, in a \textsc{Unix}-like environment the default generator produces makefiles. You can use the \texttt{make} command-line tool for the succeeding build step as follows: -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} cd \cgalrel @@ -638,18 +723,13 @@ cd \cgalrel make - -# build just the libraries needed for the Surface mesher demo - -make CGAL CGAL_ImageIO CGAL_Qt4 - \end{alltt} } -The resulting are placed in the subdirectory {\tt lib} under {\tt } +The resulting libraries are placed in the subdirectory \texttt{lib} under \texttt{} (which is \cgalrel\ in case you run an in-source-configuration). -With generators other than {\tt UNIX Makefiles} the resulting build files +With generators other than \texttt{UNIX Makefiles} the resulting build files are solution and project files which should be launched in an \textsc{Ide}, such as Visual Studio or KDevelop3. They will contain the targets described above, which you can manually build as with any other solution/project within your \textsc{Ide}. @@ -657,7 +737,7 @@ above, which you can manually build as with any other solution/project within yo Alternatively, you can build it with the command line version of the \textsc{Visual Studio Ide}: -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} devenv CGAL.sln /Build Debug @@ -682,7 +762,8 @@ file in-place and VS will prompt you to reload it. \end{ccAdvanced} -If you have turned on the configuration of examples and/or demos, there will be additional +If you have turned on the configuration of examples +(\texttt{-DWITH\_examples=ON}) and/or demos (\texttt{-DWITH\_demos=ON}), there will be additional targets named \texttt{examples} and \texttt{demos}, plus one target for each example and each demo in the build files. None of these targets are included by default, so you need to build them explicitly @@ -690,7 +771,8 @@ None of these targets are included by default, so you need to build them explici The targets \texttt{examples} and \texttt{demos} include themselves all the targets for examples and demos respectively. -{\ccTexHtml{\scriptsize}{} +{ +\ccTexHtml{}{} \begin{alltt} # build all examples at once @@ -710,7 +792,7 @@ When using \texttt{UNIX Makefiles} you can find out the exact name of the exampl of a particular package by typing \texttt{make help | grep }. \end{ccAdvanced} -\section{Installing \cgal\ Libraries} +\section{Installing \cgal \label{sec:installing}} % prevent links to /usr/include and /usr/lib (\path commands) \ccHtmlLinksOff% @@ -727,7 +809,7 @@ postprocessing step after the build step. The following example shows a typical session from configuration to installation in a \textsc{Unix}-like environment: -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} cd \cgalrel @@ -745,7 +827,7 @@ If you use a generator that produces IDE files (for Visual Studio for instance) \begin{ccAdvanced} The files are copied into a directory tree relative to the \emph{installation directory} determined by the -\cmake\ variable \texttt{CMAKE\_INSTALL\_PREFIX}. This variable defaults to {\tt /usr/local} under UNIX-like operating systems +\cmake\ variable \texttt{CMAKE\_INSTALL\_PREFIX}. This variable defaults to \texttt{/usr/local} under \textsc{Unix}-like operating systems and \path'C:\Program Files' under Windows. If you want to install to a different location, you must override that \cmake{} variable explicitly \emph{at the configuration time} and not when executing the install step. @@ -754,87 +836,62 @@ variable explicitly \emph{at the configuration time} and not when executing the The file \texttt{CGALConfig.cmake} is installed by default in \texttt{\$CMAKE\_INSTALLED\_PREFIX/lib/\cgalrel}. +\section{Example Configuration} -\section{Configuring and Building Programs Using \cgal} +Below is an example output on a linux machine with g++4.4 installed, using \cmake\ 2.8.5, +and the following command-line call to \texttt{cmake}: -\cmake\ can be used to configure and build user programs as well via a \cmake{} -script ({\tt CMakeLists.txt}). All the examples and -demos contain such \cmake\ scripts. - -During configuration of the \cgal\ libraries a file named {\tt -CGALConfig.cmake} is generated in the binary directory. This file -contains the definitions of several \cmake\ variable that summarize the -configuration of \cgal. In order to configure a user program, you need -to indicate the location of that config file in the \cmake\ variable -\texttt{CGAL\_DIR}: - -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} - -cd \cgalrel/examples/Straight_skeleton_2 -cmake -DCGAL_DIR=$HOME/\cgalrel . -make - +cmake -DWITH_examples=OFF -DWITH_demos=OFF -DCMAKE_BUILD_TYPE=Release + /path/to/unpacked/CGAL-tarball/ \end{alltt} } -\texttt{CGAL\_DIR} can also be an environment variable. -If you have installed CGAL, \texttt{CGAL\_DIR} must afterward be set to -\texttt{\$CMAKE\_INSTALLED\_PREFIX/lib/CGAL}. - -\subsection{Custom flags in the programs using \cgal} - -Normally, programs linked with \cgal\ must be compiled with the same flags -used by the compilation of \cgal{} -libraries. For this reason, the \emph{very first} time -a program is configured, all the flags given by the \cmake\ variables \texttt{CMAKE\_*\_FLAGS} -are \emph{locked} in the sense that the values recorded in \texttt{CGALConfig.cmake} -are used to override any values given by \cmake\ itself or yourself. - -This does not apply to the additional flags that can be given via \texttt{CGAL\_*\_FLAGS}. - -Such \emph{inherited} values are then recorded in the current \cmake\ cache for the program. -The flags are then \emph{unlocked} in the sense that at any subsequent configuration you can -provide your own flags and this time they will not be overridden. - -When using the interactive \texttt{cmake-gui} the first press on \texttt{Configure} unlocks -the flags, so that you can edit them as needed. - -\begin{ccAdvanced} -The locking of flags is controlled by the variable {\tt CGAL\_DONT\_OVERRIDE\_CMAKE\_FLAGS} -which starts out FALSE and is toggled right after the flags have been loaded from -\texttt{CGALConfig.cmake}. - -If you use the command line tool you can specify flags \emph{directly} by setting the -controlling variable right up front: - -{\ccTexHtml{\scriptsize}{} +{\ccTexHtml{}{} \begin{alltt} - -cd \cgalrel - -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-g . - -cd \cgalrel/examples/Straight_skeleton_2 - -cmake -DCGAL_DIR=\cgalrel -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-O2 -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=TRUE . - +\input{Installation/cmakerun.txt} \end{alltt} } -\end{ccAdvanced} + +%$ % <- added to close non-correct "math" enviroment ("HOME"), DO NOT DELETE + +\section{Multiple Variants of makefiles (out-of-source build)}\label{sec:cmake-out-of-source} + +While you can choose between release or debug builds, and shared or static libraries, +it is not possible to generate different variants during a single configuration. You need to run \cmake\ in a +different directory for each variant you are interested in, each with its own selection of configuration parameters. + +\cmake\ stores the resulting makefiles and project files, along with several temporary and auxiliary files such +as the variables cache, in the directory where it is executed, called \texttt{CMAKE\_BINARY\_DIR}, but it +takes the source files and configuration scripts from +\texttt{CMAKE\_SOURCE\_DIR}. + +The binary and source directories do not need to be the same. Thus, you can configure multiple variants by creating a +distinct directory for each configuration and by running \cmake\ from there. This is known in \cmake\ terminology +as \emph{out-of-source configuration}, as opposite to an \emph{in-source + configuration}, as showed in the previous sections. + +You can, for example, generate subdirectories \cgalrel{}\texttt{/cmake/platforms/debug} and +\cgalrel{}\texttt{/cmake/platforms/release} for two configurations, respectively: + +{\ccTexHtml{}{} +\begin{alltt} +mkdir \cgalrel/cmake/platforms/debug +cd \cgalrel/cmake/platforms/debug +cmake -DCMAKE_BUILD_TYPE=Debug ../../.. + +mkdir \cgalrel/cmake/platforms/release +cd \cgalrel/cmake/platforms/release +cmake -DCMAKE_BUILD_TYPE=Release ../../.. +\end{alltt} +} + +\input{Installation/usage} -\subsection{Creating a cmake script for a program using \cgal} - -For relatively simple programs the Bourne-shell script \texttt{cgal\_create\_cmake\_script} can be used -(a short description of this file is provided in Appendix \ref{sec:create_cgal_cmake_script}). -More generally, within a cmake script, once \cgal\ has been found using \texttt{find\_package} -the variable \texttt{CGAL\_USE\_FILE} is set to a compilation environment CMake file. Including -this file within a cmake script sets up include paths and libraries to link with of \cgal\ and third party libraries. - - -\section{Summary of Configuration Variables} +\section{Summary of \cgal's Configuration Variables} Most configuration variables are not environment variables but \emph{\cmake\ variables}. They are given in the command line to \cmake\ via the \texttt{-D} option, or passed from the interactive interface of \texttt{cmake-gui}. Unless @@ -929,12 +986,12 @@ defined by cmake. } \index{cgal!general-config-cmake-vars-dep}\index{cgal configuration cmake variables - dependencies} -\subsection{Variables providing information about 3rd-party libraries} +\subsection{Variables providing information about 3rd-party libraries}\label{sec:3partysoftwareconfig} The following variables provide information about the availability and location of the 3rd party libraries used by \cgal. \cmake\ automatically -searches for dependencies so you need to specify these variables if \cmake{} -was unable to locate something. This is indicated by a value ending in +searches for dependencies so you need to specify these variables if +\cmake\ was unable to locate something. This is indicated by a value ending in \texttt{NOTFOUND}. Since 3rd-party libraries are system wide, many of the \cmake\ variables listed below can alternatively @@ -942,21 +999,21 @@ be given as similarly-named environment variables instead. Keep in mind that you other but never both. \index{cgal!general-config-cmake-vars-dep-boost}\index{cgal configuration cmake variables - dependencies - boost} -\subsubsection{Boost libraries} +\subsubsection{\boost\ libraries} -In most cases, if boost is not automatically found, setting the \texttt{BOOST\_ROOT} +In most cases, if \boost\ is not automatically found, setting the \texttt{BOOST\_ROOT} variable is enough. If it is not, you can specify the header and library directories individually. You can also provide the full pathname to a specific compiled library if it cannot be found in the library directory or its name is non-standard. -By default, when Boost binary libraries are needed, the shared versions of -them are used, if present. You can set the variable +By default, when \boost\ binary libraries are needed, the shared versions +are used if present. You can set the variable \texttt{CGAL\_Boost\_USE\_STATIC\_LIBS} to \texttt{ON} if you want to link with static versions explicitly. -On Windows, if you link with Boost shared libraries, you must ensure that -the \texttt{.dll} files are found by the dynamic linker, at run time. You -can, for example, add the path to the Boost \texttt{.dll} to the +On Windows, if you link with \boost\ shared libraries, you must ensure that +the \texttt{.dll} files are found by the dynamic linker, at run time. +For example, you can add the path to the \boost\ \texttt{.dll} to the \texttt{PATH} environment variable. {\ccTexHtml{\small}{} @@ -964,49 +1021,48 @@ can, for example, add the path to the Boost \texttt{.dll} to the \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline - \texttt{BOOST\_ROOT}\footnotemark[16] & Root directory of your boost installation & Either CMake or Environment\\\hline + \texttt{BOOST\_ROOT}\footnotemark[16] & Root directory of your \boost\ installation & Either CMake or Environment\\\hline \texttt{Boost\_INCLUDE\_DIR} & Directory containing the \texttt{boost/version.hpp} file & CMake\\\hline \texttt{BOOST\_INCLUDEDIR} & Idem & Environment\\\hline - \texttt{Boost\_LIBRARY\_DIRS} & Directory containing the compiled boost libraries & CMake\\\hline + \texttt{Boost\_LIBRARY\_DIRS} & Directory containing the compiled \boost\ libraries & CMake\\\hline \texttt{BOOST\_LIBRARYDIR} & Idem & Environment\\\hline - \texttt{Boost\_\emph{(xyz)}\_LIBRARY\_RELEASE} & Full pathname to a release build of the compiled 'xyz' boost library & CMake\\\hline - \texttt{Boost\_\emph{(xyz)}\_LIBRARY\_DEBUG} & Full pathname to a debug build of the compiled 'xyz' boost library & CMake\\\hline - \texttt{CGAL\_Boost\_USE\_STATIC\_LIBS} & Link with static Boost libraries (Boolean) & CMake\\\hline + \texttt{Boost\_\emph{(xyz)}\_LIBRARY\_RELEASE} & Full pathname to a release build of the compiled 'xyz' \boost\ library & CMake\\\hline + \texttt{Boost\_\emph{(xyz)}\_LIBRARY\_DEBUG} & Full pathname to a debug build of the compiled 'xyz' \boost\ library & CMake\\\hline \end{tabular} } \footnotetext[16]{The environment variable can be spelled either \texttt{BOOST\_ROOT} or \texttt{BOOSTROOT}}\addtocounter{footnote}{1} \index{cgal!general-config-cmake-vars-dep-gmp-mpfr}\index{cgal configuration cmake variables - dependencies - gmp, mpfr} -\subsubsection{GMP and MPFR libraries} +\subsubsection{\gmp\ and \mpfr\ libraries} Under Windows, auto-linking is used, so only the \emph{directory} containing the libraries is needed and you would specify \texttt{GMP|MPFR\_LIBRARY\_DIR} rather than \texttt{GMP|MPFR\_LIBRARIES}. On the other hand, under Linux the actual library filename is needed. Thus you would specify \texttt{GMP|MPFR\_LIBRARIES}. In no case you need to specify both. -\cgal\ uses both gmp and mpfr, so both need to be supported. If either of them is unavailable the -usage of gmp and of mpfr will be disabled. +\cgal\ uses both \gmp\ and \mpfr\, so both need to be supported. If either of them is unavailable the +usage of \gmp\ and of \mpfr\ will be disabled. {\ccTexHtml{\small}{} \renewcommand{\arraystretch}{1.3} \gdef\lcTabularBorder{2} \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{WITH\_GMP} & Indicates whether to search and use \gmp\/\mpfr\ or not & CMake\\\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 + \texttt{GMP\_LIBRARIES\_DIR} & Directory containing the compiled \gmp\ library & CMake\\\hline \texttt{GMP\_LIB\_DIR} & Idem & Environment\\\hline - \texttt{GMP\_LIBRARIES} & Full pathname of the compiled gmp library & CMake\\\hline + \texttt{GMP\_LIBRARIES} & Full pathname of the compiled \gmp\ library & CMake\\\hline \texttt{MPFR\_INCLUDE\_DIR} & Directory containing the \texttt{mpfr.h} file & CMake\\\hline \texttt{MPFR\_INC\_DIR} & Idem & Environment\\\hline - \texttt{MPFR\_LIBRARIES\_DIR} & Directory containing the compiled mpfr library & CMake\\\hline + \texttt{MPFR\_LIBRARIES\_DIR} & Directory containing the compiled \mpfr\ library & CMake\\\hline \texttt{MPFR\_LIB\_DIR} & Idem & Environment\\\hline - \texttt{MPFR\_LIBRARIES} & Full pathname of the compiled mpfr library & CMake\\\hline + \texttt{MPFR\_LIBRARIES} & Full pathname of the compiled \mpfr\ library & CMake\\\hline \end{tabular} } -Under Linux, the GMPXX is also searched for, and you may specify the following variables: +Under Linux, the \gmpxx\ is also searched for, and you may specify the following variables: {\ccTexHtml{\small}{} \renewcommand{\arraystretch}{1.3} @@ -1014,37 +1070,66 @@ Under Linux, the GMPXX is also searched for, and you may specify the following v \begin{tabular}{|l|l|l|} \hline \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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 + \texttt{GMPXX\_LIBRARIES} & Full pathname of the compiled \gmpxx\ library & CMake\\\hline \end{tabular} } -\index{cgal!general-config-cmake-vars-dep-mpfi}\index{cgal configuration cmake variables - dependencies - mpfi} -\subsubsection{MPFI library} +% TODO EBEB zlib, OpenGL? -\cgal\ provides a number type based on this library, but the \cgal\ library -itself does not depend on MPFI. This means that this library must be -configured when compiling an application that uses the above number type. +\index{cgal!general-config-cmake-vars-dep-qt3}\index{cgal configuration cmake variables - dependencies - qt3} +\subsubsection{\qt3\ library} -When MPFI files are not on the standard path, the locations of the headers -and library files must be specified by using environment variables. +In most cases, if \qt3\ is not automatically found, setting the \texttt{QTDIR} +environment variable is sufficient. If it is not, you can specify the directory containing +the header files and the full pathnames of the \qt3\ libraries. {\ccTexHtml{\small}{} \renewcommand{\arraystretch}{1.3} \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline - \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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 - \texttt{MPFI\_LIB\_DIR} & Idem & Environment\\\hline - \texttt{MPFI\_LIBRARIES} & Full pathname of the compiled mpfi library & CMake\\\hline + \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{QTDIR} & Root directory of the \qt3\ library & Environment\\\hline + \texttt{QT3\_INCLUDE\_DIR} & Directory containing the \texttt{qt.h} file & CMake\\\hline + \texttt{QT3\_QT\_LIBRARY} & Full pathname to the qt library of \qt3\ & CMake\\\hline + \texttt{QT3\_QTMAIN\_LIBRARY} & Full pathname to the qtmain library of \qt3\ & CMake\\\hline + \texttt{QT3\_QASSISTANTCLIENT\_LIBRARY} & Full pathname to the qassistantclient library of \qt3\ & CMake\\\hline + \texttt{QT3\_MOC\_EXECUTABLE} & Full pathname to the moc executable of \qt3\ & CMake\\\hline + \texttt{QT3\_UIC\_EXECUTABLE} & Full pathname to the uic executable of \qt3\ & CMake\\\hline \end{tabular} } -\index{cgal!general-config-cmake-vars-dep-leda}\index{cgal configuration cmake variables - dependencies - leda} -\subsubsection{LEDA library} +\index{cgal!general-config-cmake-vars-dep-qt4}\index{cgal configuration cmake variables - dependencies - qt4} +\subsubsection{\qt4\ library} -When the LEDA libraries are not automatically found, yet they are installed on the system +The \cmake\ scripts that search for \qt4\ can use the introspection feature +of the tool \texttt{qmake} included in \qt4\ distributions. If \qt4\ is not +automatically found, it is sufficient to set the \texttt{PATH} +environment variable, so that \qt4\ \texttt{qmake} tool is in the path, and +before \qt3\ \texttt{qmake} if that one exists. One can alternatively set the +\cmake\ variable \texttt{QT\_QMAKE\_EXECUTABLE}. The following variables +should be then assigned automatically by \cmake{}. +{\ccTexHtml{\small}{} +\renewcommand{\arraystretch}{1.3} +\gdef\lcTabularBorder{2} +\begin{tabular}{|l|l|l|} \hline + \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline + \texttt{QT\_INCLUDE\_DIR} & Directory containing the \texttt{QtCore/qglobal.h} file & CMake\\\hline + \texttt{QT\_LIBRARY\_DIR} & Directory containing the compiled \qt4\ libraries & CMake\\\hline + \texttt{QT\_\emph{(xyz)}\_LIBRARY} & Full pathname to the compiled 'xyz' \qt4\ library\footnotemark[17] & CMake\\\hline + \texttt{QT\_QMAKE\_EXECUTABLE} & Full pathname to the qmake executable of \qt4\ & CMake\\\hline + \texttt{QT\_MOC\_EXECUTABLE} & Full pathname to the moc executable of \qt4\ & CMake\\\hline + \texttt{QT\_UIC\_EXECUTABLE} & Full pathname to the uic executable of \qt4\ & CMake\\\hline +\end{tabular} +} +\footnotetext[17]{If both release and debug versions are available, this variable contains a list +of the following form: '\texttt{optimized;;debug;}', where +the '\texttt{optimized}' and '\texttt{debug}' tags should appear verbatim.}\addtocounter{footnote}{1} + + +\index{cgal!general-config-cmake-vars-dep-leda}\index{cgal configuration cmake variables - dependencies - leda} +\subsubsection{\leda\ library} + +When the \leda\ libraries are not automatically found, yet they are installed on the system with base names 'leda' and 'ledaD' (for the release and debug versions resp.), it might be sufficient to just indicate the library directory via the \texttt{LEDA\_LIBRARY\_DIRS} variable. If that doesn't work because, for example, the names are different, you can provide the full pathnames of each variant @@ -1057,171 +1142,44 @@ The variables specifying definitions and flags can be left undefined if they are \gdef\lcTabularBorder{2} \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{WITH\_LEDA} & Indicates whether to search and use \leda\ or not & CMake\\\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\_LIBRARIES} & Directory containing the compiled \leda\ libraries & CMake\\\hline \texttt{LEDA\_INC\_DIR} & Directory containing the file \texttt{LEDA/system/basic.h} & Environment\\\hline - \texttt{LEDA\_LIB\_DIR} & Directory containing the compiled LEDA libraries & Environment\\\hline - \texttt{LEDA\_LIBRARY\_RELEASE} & Full pathname to a release build of the LEDA library & Either CMake\\\hline - \texttt{LEDA\_LIBRARY\_DEBUG} & Full pathname to a debug build of the LEDA library & Either CMake\\\hline + \texttt{LEDA\_LIB\_DIR} & Directory containing the compiled \leda\ libraries & Environment\\\hline + \texttt{LEDA\_LIBRARY\_RELEASE} & Full pathname to a release build of the \leda\ library & Either CMake\\\hline + \texttt{LEDA\_LIBRARY\_DEBUG} & Full pathname to a debug build of the \leda\ library & Either CMake\\\hline \texttt{LEDA\_DEFINITIONS} & Preprocessor definitions & Either CMake\\\hline \texttt{LEDA\_CXX\_FLAGS} & Compiler flags & Either CMake\\\hline \texttt{LEDA\_LINKER\_FLAGS} & Linker flags & Either CMake\\\hline \end{tabular} } -\index{cgal!general-config-cmake-vars-dep-qt3}\index{cgal configuration cmake variables - dependencies - qt3} -\subsubsection{Qt3 library} +\index{cgal!general-config-cmake-vars-dep-mpfi}\index{cgal configuration cmake variables - dependencies - mpfi} +\subsubsection{\mpfi\ library} -In most cases, if Qt3 is not automatically found, setting the \texttt{QTDIR} -environment variable is sufficient. If it is not, you can specify the directory containing -the header files and the full pathnames of the Qt3 libraries. +\cgal\ provides a number type based on this library, but the \cgal\ library +itself does not depend on \mpfi. This means that this library must be +configured when compiling an application that uses the above number type. + +When \mpfi\ files are not on the standard path, the locations of the headers +and library files must be specified by using environment variables. {\ccTexHtml{\small}{} \renewcommand{\arraystretch}{1.3} \gdef\lcTabularBorder{2} \begin{tabular}{|l|l|l|} \hline - \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline - \texttt{QTDIR} & Root directory of the Qt3 library & Environment\\\hline - \texttt{QT3\_INCLUDE\_DIR} & Directory containing the \texttt{qt.h} file & CMake\\\hline - \texttt{QT3\_QT\_LIBRARY} & Full pathname to the qt library of Qt3 & CMake\\\hline - \texttt{QT3\_QTMAIN\_LIBRARY} & Full pathname to the qtmain library of Qt3 & CMake\\\hline - \texttt{QT3\_QASSISTANTCLIENT\_LIBRARY} & Full pathname to the qassistantclient library of Qt3 & CMake\\\hline - \texttt{QT3\_MOC\_EXECUTABLE} & Full pathname to the moc executable of Qt3 & CMake\\\hline - \texttt{QT3\_UIC\_EXECUTABLE} & Full pathname to the uic executable of Qt3 & CMake\\\hline -\end{tabular} -} - -\index{cgal!general-config-cmake-vars-dep-qt4}\index{cgal configuration cmake variables - dependencies - qt4} -\subsubsection{Qt4 library} - -The \cmake\ scripts that search for Qt4 can use the introspection feature -of the tool \texttt{qmake} included in Qt4 distributions. If Qt4 is not -automatically found, it is sufficient to set the \texttt{PATH} -environment variable, so that Qt4 \texttt{qmake} tool is in the path, and -before Qt3 \texttt{qmake} if that one exists. One can alternatively set the -\cmake\ variable \texttt{QT\_QMAKE\_EXECUTABLE}. The following variables -should be then assigned automatically by \cmake{}. -{\ccTexHtml{\small}{} -\renewcommand{\arraystretch}{1.3} -\gdef\lcTabularBorder{2} -\begin{tabular}{|l|l|l|} \hline - \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline - \texttt{QT\_INCLUDE\_DIR} & Directory containing the \texttt{QtCore/qglobal.h} file & CMake\\\hline - \texttt{QT\_LIBRARY\_DIR} & Directory containing the compiled Qt4 libraries & CMake\\\hline - \texttt{QT\_\emph{(xyz)}\_LIBRARY} & Full pathname to the compiled 'xyz' Qt4 library\footnotemark[17] & CMake\\\hline - \texttt{QT\_QMAKE\_EXECUTABLE} & Full pathname to the qmake executable of Qt4 & CMake\\\hline - \texttt{QT\_MOC\_EXECUTABLE} & Full pathname to the moc executable of Qt4 & CMake\\\hline - \texttt{QT\_UIC\_EXECUTABLE} & Full pathname to the uic executable of Qt4 & CMake\\\hline -\end{tabular} -} -\footnotetext[17]{If both release and debug versions are available, this variable contains a list -of the following form: '\texttt{optimized;;debug;}', where -the '\texttt{optimized}' and '\texttt{debug}' tags should appear verbatim.}\addtocounter{footnote}{1} - -\index{cgal!general-config-cmake-vars-dep-qglviewer}\index{cgal configuration cmake variables - dependencies - qglviewer} -\subsubsection{QGLViewer library} - -Some demos require the GLViewer library. - -In most cases, if QGLViewer is not automatically found, setting the \texttt{QGLVIEWERROOT} -environment variable is sufficient. If it is not, you can specify the directory containing -the header files and the full pathnames of the release and debug libraries - -{\ccTexHtml{\small}{} -\renewcommand{\arraystretch}{1.3} -\gdef\lcTabularBorder{2} -\begin{tabular}{|l|l|l|} \hline - \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline - \texttt{QGLVIEWERROOT} & Root directory of the QGViewer 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 -\end{tabular} -} - - -\index{cgal!general-config-cmake-vars-dep-eigen}\index{cgal configuration cmake variables - dependencies - eigen} -\subsubsection{Eigen library} - -\eigen\ is a header-only template library. -Only the {\em directory} containing the header files of \eigen\ 3.1 (or greater) is needed. - -{\ccTexHtml{\small}{} -\renewcommand{\arraystretch}{1.3} -\gdef\lcTabularBorder{2} -\begin{tabular}{|l|l|l|} \hline - \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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} -} - -\index{cgal!general-config-cmake-vars-dep-taucs}\index{cgal configuration cmake variables - dependencies - taucs} -\subsubsection{TAUCS and METIS libraries} - -Some demos require the TAUCS and METIS libraries. If any of the two is not -found, the TAUCS support is disabled. - -Under Windows, auto-linking is used, so only the \emph{directory} -containing the libraries is needed, and you would specify \texttt{TAUCS\_LIBRARY\_DIR} rather than -\texttt{TAUCS\_LIBRARIES}. On the other hand, under Linux the actual library filename is needed. -Thus you would specify \texttt{TAUCS\_LIBRARIES}. In no case you need to specify both. - -\cgal\ uses both TAUCS and METIS so both need to be supported. If either of them is unavailable the -usage of TAUCS-METIS will be disabled. - -{\ccTexHtml{\small}{} -\renewcommand{\arraystretch}{1.3} -\gdef\lcTabularBorder{2} -\begin{tabular}{|l|l|l|} \hline - \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline - \texttt{TAUCS\_INCLUDE\_DIR} & Directory containing the \texttt{taucs.h} file & CMake\\\hline - \texttt{TAUCS\_INC\_DIR} & Idem & Environment\\\hline - \texttt{TAUCS\_LIBRARIES\_DIR} & Directory containing the compiled taucs library & CMake\\\hline - \texttt{TAUCS\_LIB\_DIR} & Idem & Environment\\\hline - \texttt{TAUCS\_LIBRARY} & Full pathname of the compiled taucs library & CMake\\\hline - \texttt{METIS\_LIBRARY} & Full pathname of the compiled metis library & CMake\\\hline -\end{tabular} -} - -\index{cgal!general-config-cmake-vars-dep-blas}\index{cgal configuration cmake variables - dependencies - blas} -\subsubsection{BLAS and LAPACK libraries} - -A few demos require some BLAS and LAPACK functions. There are several -implementations by different vendors that contains the required functions, -and \cmake\ searches for most of them. - -If they are not found, you can indicate the directory containing the libraries, or provide a -semi-colon separated list of pathnames to the libraries which collectively implement the functions. - -Many of the libraries implementing BLAS and LAPACK require the F2C library for Fortran-to-C convertion. -If this is needed and not found, you may specify the fullpath of the library in the \texttt{F2C\_LIBRARIES} -variable. You do not need to provide this, if the BLAS|LAPACK libraries do not need f2c. - -{\ccTexHtml{\small}{} -\renewcommand{\arraystretch}{1.3} -\gdef\lcTabularBorder{2} -\begin{tabular}{|l|l|l|} \hline - \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline - \texttt{BLAS\_INCLUDE\_DIR} & Directory containing blas header files & CMake\\\hline - \texttt{BLAS\_LIBRARIES\_DIR} & Directory containing the compiled libraries implementing BLAS & Environment\\\hline - \texttt{BLAS\_LIB\_DIR} & Idem & Environment\\\hline - \texttt{BLAS\_LIBRARIES} & Semi-colon separated list of library pathnames implementing the BLAS functions & CMake\\\hline - \texttt{BLAS\_LINKER\_FLAGS} & Linker flags & CMake\\\hline - \texttt{BLAS\_DEFINITIONS} & Preprocessor definitions & CMake\\\hline - \texttt{LAPACK\_INCLUDE\_DIR} & Directory containing blas header files & CMake\\\hline - \texttt{LAPACK\_LIBRARIES\_DIR} & Directory containing the compiled libraries implementing LAPACK & Environment\\\hline - \texttt{LAPACK\_LIB\_DIR} & Idem & Environment\\\hline - \texttt{LAPACK\_LIBRARIES} & Semi-colon separated list of library pathnames implementing the LAPACK functions & CMake\\\hline - \texttt{LAPACK\_LINKER\_FLAGS} & Linker flags & CMake\\\hline - \texttt{LAPACK\_DEFINITIONS} & Preprocessor definitions & CMake\\\hline - \texttt{F2C\_LIBRARIES} & Full pathname to the f2c library & CMake\\\hline + \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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 + \texttt{MPFI\_LIB\_DIR} & Idem & Environment\\\hline + \texttt{MPFI\_LIBRARIES} & Full pathname of the compiled \mpfi\ library & CMake\\\hline \end{tabular} } \index{cgal!general-config-cmake-vars-dep-rs}\index{cgal configuration cmake variables - dependencies - rs} -\subsubsection{RS library} +\subsubsection{\rs\ and \rs3\ library} As said before, only the \cgal{} univariate algebraic kernel depends on the library \rs. As the algebraic kernel is not compiled as a part of the \cgal{} @@ -1241,17 +1199,158 @@ related to the latter library may also need to be defined. \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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 + \texttt{RS\_LIBRARIES\_DIR} & Directory containing the compiled \rs\ library & CMake\\\hline \texttt{RS\_LIB\_DIR} & Idem & Environment\\\hline - \texttt{RS\_LIBRARIES} & Full pathname of the compiled rs library & CMake\\\hline + \texttt{RS\_LIBRARIES} & Full pathname of the compiled \rs\ library & CMake\\\hline +\end{tabular} +} + +Similar variables exist for \rs3. + +{\ccTexHtml{\small}{} +\renewcommand{\arraystretch}{1.3} +\gdef\lcTabularBorder{2} +\begin{tabular}{|l|l|l|} \hline + \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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 + \texttt{RS3\_LIB\_DIR} & Idem & Environment\\\hline + \texttt{RS3\_LIBRARIES} & Full pathname of the compiled \rs\ library & CMake\\\hline \end{tabular} } +\index{cgal!general-config-cmake-vars-dep-ntl}\index{cgal configuration cmake variables - dependencies - ntl} +\subsubsection{\ntl\ library} + +Some polynomial computations in \cgal's algebraic kernel +are speed up when \ntl\ is available. +As the algebraic kernel is not compiled as a part of the \cgal{} +library, this library is not detected nor configured at installation time. + +\cmake{} will try to find \ntl{} in the standard header and library +directories. When it is not automatically detected, the locations of the +headers and library files must be specified using environment variables. + +{\ccTexHtml{\small}{} +\renewcommand{\arraystretch}{1.3} +\gdef\lcTabularBorder{2} +\begin{tabular}{|l|l|l|} \hline + \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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 + \texttt{NTL\_LIB\_DIR} & Idem & Environment\\\hline + \texttt{NTL\_LIBRARIES} & Full pathname of the compiled \ntl\ library & CMake\\\hline +\end{tabular} +} + +\index{cgal!general-config-cmake-vars-dep-eigen}\index{cgal configuration cmake variables - dependencies - eigen} +\subsubsection{\eigen{} library} + +\eigen\ is a header-only template library. +Only the {\em directory} containing the header files of \eigen\ 3.1 (or greater) is needed. + +{\ccTexHtml{\small}{} +\renewcommand{\arraystretch}{1.3} +\gdef\lcTabularBorder{2} +\begin{tabular}{|l|l|l|} \hline + \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\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} +} + +% \index{cgal!general-config-cmake-vars-dep-taucs}\index{cgal configuration cmake variables - dependencies - taucs} +% \subsubsection{\taucs\ and METIS libraries} + +% Some demos require the \taucs\ and METIS libraries. If any of the two is not +% found, the \taucs\ support is disabled. + +% Under Windows, auto-linking is used, so only the \emph{directory} +% containing the libraries is needed, and you would specify \texttt{TAUCS\_LIBRARY\_DIR} rather than +% \texttt{TAUCS\_LIBRARIES}. On the other hand, under Linux the actual library filename is needed. +% Thus you would specify \texttt{TAUCS\_LIBRARIES}. In no case you need to specify both. + +% \cgal\ uses both \taucs\ and METIS so both need to be supported. If either of them is unavailable the +% usage of \taucs-METIS will be disabled. + +% {\ccTexHtml{\small}{} +% \renewcommand{\arraystretch}{1.3} +% \gdef\lcTabularBorder{2} +% \begin{tabular}{|l|l|l|} \hline +% \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline +% \texttt{TAUCS\_INCLUDE\_DIR} & Directory containing the \texttt{taucs.h} file & CMake\\\hline +% \texttt{TAUCS\_INC\_DIR} & Idem & Environment\\\hline +% \texttt{TAUCS\_LIBRARIES\_DIR} & Directory containing the compiled \taucs\ library & CMake\\\hline +% \texttt{TAUCS\_LIB\_DIR} & Idem & Environment\\\hline +% \texttt{TAUCS\_LIBRARY} & Full pathname of the compiled \taucs\ library & CMake\\\hline +% \texttt{METIS\_LIBRARY} & Full pathname of the compiled metis library & CMake\\\hline +% \end{tabular} +% } + +% \index{cgal!general-config-cmake-vars-dep-blas}\index{cgal configuration cmake variables - dependencies - blas} +% \subsubsection{\blas\ and \lapack\ libraries} + +% A few demos require some \blas\ and \lapack\ functions. There are several +% implementations by different vendors that contains the required functions, +% and \cmake\ searches for most of them. + +% If they are not found, you can indicate the directory containing the libraries, or provide a +% semi-colon separated list of pathnames to the libraries which collectively implement the functions. + +% Many of the libraries implementing \blas\ and \lapack\ require the \ftoc\ library for Fortran-to-C conversion. +% If this is needed and not found, you may specify the fullpath of the library in the \texttt{F2C\_LIBRARIES} +% variable. You do not need to provide this, if the \blas\ \lapack\ libraries do not need \ftoc. + +% {\ccTexHtml{\small}{} +% \renewcommand{\arraystretch}{1.3} +% \gdef\lcTabularBorder{2} +% \begin{tabular}{|l|l|l|} \hline +% \textbf{Variable} & \textbf{Description} & \textbf{Type}\\\hline\hline +% \texttt{BLAS\_INCLUDE\_DIR} & Directory containing \blas\ header files & CMake\\\hline +% \texttt{BLAS\_LIBRARIES\_DIR} & Directory containing the compiled libraries implementing \blas\ & Environment\\\hline +% \texttt{BLAS\_LIB\_DIR} & Idem & Environment\\\hline +% \texttt{BLAS\_LIBRARIES} & Semi-colon separated list of library pathnames implementing the \blas\ functions & CMake\\\hline +% \texttt{BLAS\_LINKER\_FLAGS} & Linker flags & CMake\\\hline +% \texttt{BLAS\_DEFINITIONS} & Preprocessor definitions & CMake\\\hline +% \texttt{LAPACK\_INCLUDE\_DIR} & Directory containing \blas\ header files & CMake\\\hline +% \texttt{LAPACK\_LIBRARIES\_DIR} & Directory containing the compiled libraries implementing \lapack\ & Environment\\\hline +% \texttt{LAPACK\_LIB\_DIR} & Idem & Environment\\\hline +% \texttt{LAPACK\_LIBRARIES} & Semi-colon separated list of library pathnames implementing the \lapack\ functions & CMake\\\hline +% \texttt{LAPACK\_LINKER\_FLAGS} & Linker flags & CMake\\\hline +% \texttt{LAPACK\_DEFINITIONS} & Preprocessor definitions & CMake\\\hline +% \texttt{F2C\_LIBRARIES} & Full pathname to the \ftoc library & CMake\\\hline +% \end{tabular} +% } + + +\index{cgal!general-config-cmake-vars-dep-qglviewer}\index{cgal configuration cmake variables - dependencies - qglviewer} +\subsubsection{QGLViewer library} + +Some demos require the GLViewer library. + +In most cases, if QGLViewer is not automatically found, setting the \texttt{QGLVIEWERROOT} +environment variable is sufficient. If it is not, you can specify the directory containing +the header files and the full pathnames of the release and debug libraries + +{\ccTexHtml{\small}{} +\renewcommand{\arraystretch}{1.3} +\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{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 +\end{tabular} +} + \index{cgal!general-config-cmake-vars-dep-esbtl}\index{cgal configuration cmake variables - dependencies - esbtl} \subsubsection{ESBTL library} -One skin surface example requires the ESBTL library in order to read PDB files. +One skin surface example requires the ESBTL library in order to read \textsc{Pdb} files. If ESBTL is not automatically found, setting the \texttt{ESBTL\_INC\_DIR} environment variable is sufficient. @@ -1266,117 +1365,40 @@ environment variable is sufficient. \end{tabular} } +\section{Compiler Workarounds} +\index{compilers!workarounds}\index{workaround flags} -\section{Example} +A number of boolean flags are used to workaround compiler bugs and +limitations. They all start with the prefix \texttt{CGAL\_CFG}. These +flags are used to work around compiler bugs and limitations. For +example, the flag \texttt{CGAL\_CFG\_NO\_CPP0X\_LONG\_LONG} denotes +that the compiler does not know the type \texttt{long long}. -Below is an example output on a Windows machine with VC8 installed, using \cmake\ 2.6, -and the following command-line call to \texttt{cmake}: +For each installation a file \texttt{} +\index{files!\texttt{compiler\_config.h}} is defined, with the correct +settings of all flags. This file is generated automatically by \cmake, +and it is located in the \texttt{include} directory of where you run +\cmake. For an in-source configuration this means +\texttt{CGAL-x.y/include}. -{\ccTexHtml{\scriptsize}{} -\begin{alltt} -cmake -DWITH_examples=false - -DWITH_demos=false - -DCMAKE_BUILD_TYPE=Release - ../../.. -\end{alltt} -} +The test programs used to generate the \texttt{compiler\_config.h} +file can be found in \texttt{config/testfiles}. +\index{directories!config/testfiles@\texttt{config/testfiles}} Both +\texttt{compiler\_config.h} and the test programs contain a short +description of the problem. In case of trouble with one of the +\texttt{CGAL\_CFG} flags, it is a good idea to take a look at it. +The file \texttt{CGAL/compiler\_config.h} is included from +\texttt{}.\index{files!\texttt{config.h}} +which is included by all \cgal\ header files. -{\ccTexHtml{\scriptsize}{} -\begin{alltt} --- Check for working C compiler: cl --- Check for working C compiler: cl -- works --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working CXX compiler: cl --- Check for working CXX compiler: cl -- works --- Detecting CXX compiler ABI info --- Detecting CXX compiler ABI info - done --- CGAL_REFERENCE_CACHE_DIR= --- Building static libraries --- Targetting Visual Studio 8 2005 --- Target build environment supports auto-linking --- Using VC80 compiler. --- Build type: Release --- Generator uses intermediate configuration directory: $(OutDir) --- CMake version: 2.6.1 --- System: Windows --- CGAL_MAJOR_VERSION=3 --- CGAL_MINOR_VERSION=4 --- CGAL_BUILD_VERSION=442 --- CGAL_SONAME_VERSION=3 --- CGAL_SOVERSION =3.0.0 --- Boost version: 1.35.0 --- Found the following Boost libraries: --- thread --- Boost include: C:/Program Files/boost/boost_1_35_0 --- Boost libraries: --- Boost definitions: --- USING BOOST_VERSION = '1.35.0' --- Could NOT find GMP --- Could NOT find MPFR --- Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Success --- Performing Test CGAL_CFG_IEEE_754_BUG - Success --- Performing Test CGAL_CFG_ISTREAM_INT_BUG - Success --- Performing Test CGAL_CFG_LONGNAME_BUG - Failed --- Performing Test CGAL_CFG_MATCHING_BUG_5 - Success --- Performing Test CGAL_CFG_MATCHING_BUG_6 - Failed --- Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed --- Performing Test CGAL_CFG_NET2003_MATCHING_BUG - Failed --- Performing Test CGAL_CFG_NO_CPP0X_ARRAY - Failed --- Performing Test CGAL_CFG_NO_CPP0X_DECLTYPE - Failed --- Performing Test CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES - Failed --- Performing Test CGAL_CFG_NO_CPP0X_DELEGATING_CONSTRUCTORS - Failed --- Performing Test CGAL_CFG_NO_CPP0X_ISFINITE - Failed --- Performing Test CGAL_CFG_NO_CPP0X_LONG_LONG - Success --- Performing Test CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE - Failed --- Performing Test CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES - Failed --- Performing Test CGAL_CFG_NO_LIMITS - Success --- Performing Test CGAL_CFG_NO_NEXTAFTER - Failed --- Performing Test CGAL_CFG_NO_STATEMENT_EXPRESSIONS - Failed --- Performing Test CGAL_CFG_NO_STL - Success --- Performing Test CGAL_CFG_NO_TMPL_IN_TMPL_PARAM - Success --- Performing Test CGAL_CFG_NO_TR1_ARRAY - Failed --- Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Success --- Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Success --- Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Failed --- Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Success --- CMAKE_INSTALL_PREFIX=C:/Program Files/CGAL --- USING CUSTOM_CXXFLAGS = ' -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_SECURE_SCL=0' --- USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /MD /O2 /Ob2 /D NDEBUG' --- USING CUSTOM_LDFLAGS = ' ' --- USING LDFLAGS = ' ' --- USING CUSTOM_EXEFLAGS = ' ' --- USING EXEFLAGS = ' /MANIFEST /STACK:10000000 /machine:I386 /INCREMENTAL:NO' --- Configuring CGALCore. Set WITH_CGALCore to FALSE to unselect it. --- CGAL-core++ needs GMP and MPFR, cannot be configured. --- Configuring CGALimageIO. Set WITH_CGALimageIO to FALSE to unselect it. --- Could NOT find ZLIB --- CGAL-ImageIO needs ZLib and OpenGL, cannot be configured. --- Configuring CGALQt. Set WITH_CGALQt to FALSE to unselect it. --- CGAL-Qt3 needs Qt3, cannot be configured. --- Configuring CGALQt4. Set WITH_CGALQt4 to FALSE to unselect it. --- Looking for Q_WS_X11 --- Looking for Q_WS_X11 - not found. --- Looking for Q_WS_WIN --- Looking for Q_WS_WIN - found --- Looking for Q_WS_QWS --- Looking for Q_WS_QWS - not found. --- Looking for Q_WS_MAC --- Looking for Q_WS_MAC - not found. --- OpenGL include: --- OpenGL libraries: glu32;opengl32 --- OpenGL definitions: --- Qt4 include: C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/include --- Qt4 libraries: optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/qtmain.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/qtmaind.lib;optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtOpenGL4.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtOpenGLd4.lib;opengl32.lib glu32.lib gdi32.lib user32.lib;optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtGui4.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtGuid4.lib;imm32;winmm;optimized;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtCore4.lib;debug;C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/lib/QtCored4.lib;ws2_32 --- Qt4 definitions: -DQT_DLL --- moc executable: C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/bin/moc.exe --- uic executable: C:/Work/Downloaded/Libraries/qt-win-opensource-src-4.4.1/bin/uic.exe --- Configuring done --- Generating done --- Build files have been written to: C:/Work/Active/GeometryFactory/CGAL/Autotest/\cgalrel/cmake/platforms/a -\end{alltt} -} +\section{Compiler Optimizations\label{sec:compiler-optimisations}} +\index{compilers!optimization} +\index{optimization compiler flags} + +By default \cmake\ generates makefiles for Release mode, with +optimization flags switched on, and vcproj files for Release +and Debug modes. %% diff --git a/Installation/doc_tex/Installation/main.tex b/Installation/doc_tex/Installation/main.tex index 0133228f698..010c3126b2b 100644 --- a/Installation/doc_tex/Installation/main.tex +++ b/Installation/doc_tex/Installation/main.tex @@ -1,10 +1,8 @@ \chapter{Installation \label{chapter-Installation}} -\ccChapterAuthor{Joachim Reichel \and Fernando Cacciola} +\ccChapterAuthor{Eric Berberich \and Joachim Reichel \and Fernando Cacciola} \input{Installation/PkgDescription} \minitoc \input{Installation/installation.tex} - -\input{Installation/appendix.tex} diff --git a/Installation/doc_tex/Installation/usage.tex b/Installation/doc_tex/Installation/usage.tex new file mode 100644 index 00000000000..af9e392dde0 --- /dev/null +++ b/Installation/doc_tex/Installation/usage.tex @@ -0,0 +1,177 @@ +\section{Configuring and Building Programs Using \cgal} + + +Ideally, configuring and compiling a demo/example/program amounts to + +{\ccTexHtml{}{} +\begin{alltt} + +cd \cgalrel/examples/Straight_skeleton_2 +cmake -DCGAL_DIR=$HOME/\cgalrel . +make + +\end{alltt} +} + +%$ % <- added to close non-correct "math" enviroment ("HOME"), DO NOT DELETE + +In this ideal world, as for all shipped examples and demos of \cgal, the +required \texttt{CMakeLists.txt} is already provided. + +\cmake\ can also be used to configure and build user programs via such +\cmake-scripts. In this less ideal world, one has to provide the +\texttt{CMakeLists.txt} script either manually, or with the help of a +shell-script that is introduced below. + +For a user program \texttt{executable.cpp}, the ideal world looks like this: + +{\ccTexHtml{}{} +\begin{alltt} +cd /path/to/program +cgal_create_CMakeLists -s executable +cmake -DCGAL_DIR=$HOME/\cgalrel . +make +\end{alltt} +} + +%$ % <- added to close non-correct "math" enviroment ("HOME"), DO NOT DELETE + +In both examples we specify the \texttt{CGAL\_DIR}: +During configuration of the \cgal\ libraries a file named {\tt +CGALConfig.cmake} is generated in \cgal's root directory (in contrast +to \cgal's source directory that has been used for installation). This file +contains the definitions of several \cmake\ variable that summarize the +configuration of \cgal. In order to configure a program, you need +to indicate the location of that config file in the \cmake\ variable +\texttt{CGAL\_DIR} (as indicated in the example above). +\texttt{CGAL\_DIR} can also be an environment variable. Setting +\texttt{CGAL\_DIR} makes particular sense if having multiple +out-of-source builds of \cgal\ as in Section~\ref{sec:cmake-out-of-source}. + +If you have installed CGAL, \texttt{CGAL\_DIR} must afterwards be set to +\texttt{\$CMAKE\_INSTALLED\_PREFIX/lib/CGAL}. Note that \cgal\ is +recommended to be installed in release mode when using it to build programs. + +\subsection{Creating a cmake script for a program using \cgal} + +For compiling a non-shipped program, it is +recommended, to also rely on a \cmake-supported configuration using a +\texttt{CMakeLists.txt} used for configuration. + +Use the following Bourne-shell script for programs that are relatively +simple to configure: + +\subsubsection{\texttt{cgal\_create\_CMakeLists\label{sec:create_cgal_CMakeLists}}} +\TTindex{cgal\_create\_CMakeLists.txt}\index{scripts!\texttt{cgal\_create\_CMakeLists}} + +The Bourne-shell script \texttt{cgal\_create\_CMakeLists.txt} resides in the +\texttt{\cgalrel/scripts} directory. It can be used to create +\texttt{CMakeLists.txt} files for compiling \cgal\ applications. Executing +\texttt{cgal\_create\_CMakeLists.txt} in an application directory creates a +\texttt{CMakeLists.txt} containing rules to build the contained +application(s). Three command line options determine details of the +configuration. + +\begin{description} +\item [\texttt{-s source}] If this parameter is given the script will + create \textbf{a single executable} for 'source' linked with + compilations of all other source files (\texttt{*.cpp}). This + 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''. + +\end{description} + +This options should suffice to create \texttt{CMakeLists.txt} script +for most directories containing programs. However, in some special +cases, it might still be required to create the script manually, for +instance, if some source files/executables need a different linking than +other source files. + +\begin{ccDeprecated} +\subsubsection{\texttt{cgal\_create\_cmake\_script\label{sec:create_cgal_cmake_script}}} +\TTindex{cgal\_create\_cmake\_script}\index{scripts!\texttt{cgal\_create\_cmake\_script}} + +For backward-compatibility we still provide the +Bourne-shell script \texttt{cgal\_create\_cmake\_script} that +is contained in the +\texttt{\cgalrel/scripts} directory. It can be used to create +\texttt{CMakeLists.txt} files for compiling \cgal\ applications. Executing +\texttt{cgal\_create\_cmake\_script} in an application directory creates a +\texttt{CMakeLists.txt} containing rules for every \texttt{*.cpp} file +there. The script is deprecated, as it only works for applications +with a single course file that only need libCGAL and libCGAL\_Core. +\end{ccDeprecated} + +Such a shell-script simply creates a \cmake\ script. Processing it +with \cmake, searches for \cgal\ using \texttt{find\_package}. If found, +the variable \texttt{CGAL\_USE\_FILE} is set to a compilation environment \cmake\ file. Including +this file within a \cmake\ script sets up include paths and libraries to +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} +without calling the script (manual creation). + + +\subsection{Custom flags in the programs using \cgal} + +Normally, programs linked with \cgal\ must be compiled with the same flags +used by the compilation of \cgal\ +libraries. For this reason, the \emph{very first} time +a program is configured, all the flags given by the \cmake\ variables \texttt{CMAKE\_*\_FLAGS} +are \emph{locked} in the sense that the values recorded in \texttt{CGALConfig.cmake} +are used to override any values given by \cmake\ itself or yourself. + +This does not apply to the additional flags that can be given via \texttt{CGAL\_*\_FLAGS}. + +Such \emph{inherited} values are then recorded in the current \cmake\ cache for the program. +The flags are then \emph{unlocked} in the sense that at any subsequent configuration you can +provide your own flags and this time they will not be overridden. + +When using the interactive \texttt{cmake-gui} the first press on \texttt{Configure} unlocks +the flags, so that you can edit them as needed. + +\begin{ccAdvanced} +The locking of flags is controlled by the variable {\tt CGAL\_DONT\_OVERRIDE\_CMAKE\_FLAGS} +which starts out FALSE and is toggled right after the flags have been loaded from +\texttt{CGALConfig.cmake}. + +If you use the command line tool you can specify flags \emph{directly} by setting the +controlling variable right up front: + +{\ccTexHtml{}{} +\begin{alltt} + +cd \cgalrel + +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-g . + +cd \cgalrel/examples/Straight_skeleton_2 + +cmake -DCGAL_DIR=\cgalrel -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-O2 -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=TRUE . + +\end{alltt} +} +\end{ccAdvanced} + + + + +%% +%% EOF +%% + + diff --git a/Installation/doc_tex/installation_manual.tex b/Installation/doc_tex/installation_manual.tex index 3ba877d69ea..255a8f72d30 100644 --- a/Installation/doc_tex/installation_manual.tex +++ b/Installation/doc_tex/installation_manual.tex @@ -39,6 +39,7 @@ \newcommand{\myownfrontmatter}{ \section*{Authors} +Eric Berberich\\ Joachim Reichel\\ Fernando Cacciola @@ -60,8 +61,7 @@ Fernando Cacciola \myownfrontmatter } \input{Installation/installation} -\appendix -\input{Installation/appendix} +\input{Installation/usage} \bibliographystyle{alpha} \bibliography{Manual/cgal_manual,Manual/geom} diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index 3efe921d26e..ace7a8c86b9 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -23,6 +23,7 @@ if(NOT CGAL_BUILDING_LIBS) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) endif() +message("== Generating build files for examples ==") foreach( entry ${list} ) if (NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry} ) @@ -31,10 +32,11 @@ foreach( entry ${list} ) # If there is no .cpp files, ignore the sub-directory if(files) - process_CGAL_subdirectory("${entry}" examples example) + process_CGAL_subdirectory("${entry}" examples example) # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() + endif() endif() endforeach() +message("== Generating build files for examples (DONE) ==\n") diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 9318947dba2..0df55caceb1 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -53,6 +53,7 @@ // The following header file defines among other things BOOST_PREVENT_MACRO_SUBSTITUTION #include +#include #include @@ -69,12 +70,61 @@ #include //----------------------------------------------------------------------// -// Enable C++0x features with GCC -std=c++0x (even when not specified at build time) -//----------------------------------------------------------------------// +// Detect features at compile-time. Some macros have only been +// introduced as of Boost 1.40. In that case, we simply say that the +// feature is not available, even if that is wrong. +// ----------------------------------------------------------------------// -#if defined __GNUC__ && defined __GXX_EXPERIMENTAL_CXX0X__ -# include +#if defined(BOOST_NO_0X_HDR_ARRAY) || BOOST_VERSION < 104000 +#define CGAL_CFG_NO_CPP0X_ARRAY 1 #endif +#if defined(BOOST_NO_DECLTYPE) +#define CGAL_CFG_NO_CPP0X_DECLTYPE 1 +#endif +#if defined(BOOST_NO_DELETED_FUNCTIONS) || defined(BOOST_NO_DEFAULTED_FUNCTIONS) +#define CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS 1 +#endif +#if defined(BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS) +#define CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES 1 +#endif +#if defined(BOOST_NO_INITIALIZER_LISTS) +#define CGAL_CFG_NO_CPP0X_INITIALIZER_LISTS 1 +#endif +#if defined(_MSC_VER) && _MSC_VER <= 1600 +#define CGAL_CFG_NO_CPP0X_ISFINITE 1 +#endif +#if defined(BOOST_NO_LONG_LONG) +#define CGAL_CFG_NO_CPP0X_LONG_LONG 1 +#endif +#if defined(BOOST_NO_LAMBDAS) || BOOST_VERSION < 104000 +#define CGAL_CFG_NO_CPP0X_LAMBDAS 1 +#endif +#if defined(BOOST_NO_RVALUE_REFERENCES) +#define CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE 1 +#endif +#if defined(BOOST_NO_STATIC_ASSERT) +#define CGAL_CFG_NO_CPP0X_STATIC_ASSERT 1 +#endif +#if defined(BOOST_NO_0X_HDR_TUPLE) || (BOOST_VERSION < 104000) +#define CGAL_CFG_NO_CPP0X_TUPLE 1 +#endif +#if defined(BOOST_NO_VARIADIC_TEMPLATES) +#define CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES 1 +#endif +#if !defined(BOOST_HAS_TR1_ARRAY) +#define CGAL_CFG_NO_TR1_ARRAY 1 +#endif +#if !defined(BOOST_HAS_TR1_TUPLE) +#define CGAL_CFG_NO_TR1_TUPLE 1 +#endif +#if !defined(__GNUC__) +#define CGAL_CFG_NO_STATEMENT_EXPRESSIONS 1 +#endif +#if __cplusplus < 201103L && !(_MSC_VER >= 1600) +#define CGAL_CFG_NO_CPP0X_COPY_N 1 +#define CGAL_CFG_NO_CPP0X_NEXT_PREV 1 +#endif + //----------------------------------------------------------------------// // auto-link the CGAL library on platforms that support it @@ -173,11 +223,6 @@ # ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC # error "CGAL does not support SunPRO with the old Rogue Wave STL: use STLPort." # endif - -// Sun CC has an issue with templates that means overloading -// Qualified_result_of does not work so well. -# define CGAL_CFG_DONT_OVERLOAD_TOO_MUCH 1 - #endif #ifdef __SUNPRO_CC diff --git a/Installation/include/CGAL/export/CGAL.h b/Installation/include/CGAL/export/CGAL.h old mode 100755 new mode 100644 diff --git a/Installation/src/CGAL/CMakeLists.txt b/Installation/src/CGAL/CMakeLists.txt index 366c0fa0142..8bef65a6f11 100644 --- a/Installation/src/CGAL/CMakeLists.txt +++ b/Installation/src/CGAL/CMakeLists.txt @@ -1,10 +1,15 @@ +message("Configuring libCGAL") + +use_essential_libs() + include_directories (${CGAL_3RD_PARTY_INCLUDE_DIRS}) add_definitions(${CGAL_3RD_PARTY_DEFINITIONS}) link_directories(${CGAL_3RD_PARTY_LIBRARIES_DIRS}) -build_cgal_library(CGAL CGAL "") +collect_cgal_library(CGAL CGAL "") target_link_libraries(CGAL ${CGAL_3RD_PARTY_LIBRARIES}) +message("libCGAL is configured") diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index c9f9f209be8..baa3a22f7ef 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -1,4 +1,4 @@ -function (build_cgal_library LIBRARY_NAME LIBRARY_DIR_NAME ADDITIONAL_FILES) +function (collect_cgal_library LIBRARY_NAME LIBRARY_DIR_NAME ADDITIONAL_FILES) # IMPORTANT: First delete all_files.cpp if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp) file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp) @@ -41,7 +41,6 @@ function (build_cgal_library LIBRARY_NAME LIBRARY_DIR_NAME ADDITIONAL_FILES) ${rc_file} ${ADDITIONAL_FILES}) # add_library (${LIBRARY_NAME} ${CGAL_LIBRARY_SOURCE_FILES} ${rc_file} ${ADDITIONAL_FILES}) # builing not creating temporary all_files.cpp - if(CGAL_SOVERSION AND CGAL_SONAME_VERSION) set_target_properties(${LIBRARY_NAME} PROPERTIES VERSION "${CGAL_SOVERSION}" @@ -122,7 +121,7 @@ foreach(package ${CGAL_CONFIGURED_PACKAGES}) string(REPLACE "CGAL" "" CGAL_CONFIGURED_LIBRARY_NAME ${CGAL_CONFIGURED_LIBRARY_SUBDIR}) - message(STATUS "Library config detected: ${CGAL_CONFIGURED_LIBRARY_NAME}") + message(STATUS "Sources for CGAL component library '${CGAL_CONFIGURED_LIBRARY_NAME}' detected") list(APPEND CGAL_CONFIGURED_LIBRARIES ${CGAL_CONFIGURED_LIBRARY_NAME}) #message(STATUS "Library config detected: ${CGAL_CONFIGURED_LIBRARIES}") @@ -159,12 +158,12 @@ foreach(package ${CGAL_CONFIGURED_PACKAGES}) endforeach() if (NOT CGAL_CONFIGURED_LIBRARIES) - message(FATAL_ERROR "No library in configured packages found. Please fix package-file.") + message(FATAL_ERROR "No component library in configured packages found. Please fix package-file.") endif() list(REMOVE_DUPLICATES CGAL_CONFIGURED_LIBRARIES) list(SORT CGAL_CONFIGURED_LIBRARIES) cache_set(CGAL_CONFIGURED_LIBRARIES "${CGAL_CONFIGURED_LIBRARIES}") -message(STATUS "Library configs detected: ${CGAL_CONFIGURED_LIBRARIES}") +message(STATUS "Sources for CGAL component libraries '${CGAL_CONFIGURED_LIBRARIES}' detected") diff --git a/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h b/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h index b420e87cd7f..33231b775fa 100644 --- a/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h +++ b/Intersections_3/include/CGAL/Intersections_3/intersection_3_1_impl.h @@ -673,7 +673,7 @@ inline bool do_intersect(const typename K::Sphere_3 &s, const typename K::Plane_3 &p, - const K& k) + const K&) { return do_intersect(p,s); } diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h index bc189388db9..249264aca74 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h @@ -25,105 +25,15 @@ #include #include +#include +// for CGAL::internal::do_intersect_bbox_segment_aux + // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf namespace CGAL { namespace internal { - template - inline - bool - bbox_ray_do_intersect_aux(const FT& px, const FT& py, const FT& pz, - const FT& qx, const FT& qy, const FT& qz, - const FT& bxmin, const FT& bymin, const FT& bzmin, - const FT& bxmax, const FT& bymax, const FT& bzmax) - { - // (px, py, pz) is the source - // ----------------------------------- - // treat x coord - // ----------------------------------- - FT dmin, tmin, tmax; - if ( qx >= px ) - { - tmin = bxmin - px; - tmax = bxmax - px; - dmin = qx - px; - if ( tmax < FT(0) ) - return false; - } - else - { - tmin = px - bxmax; - tmax = px - bxmin; - dmin = px - qx; - if ( tmax < FT(0) ) - return false; - } - - FT dmax = dmin; - if ( tmin > FT(0) ) - { - if ( dmin == FT(0) ) - return false; - } - else - { - tmin = FT(0); - dmin = FT(1); - } - - // ----------------------------------- - // treat y coord - // ----------------------------------- - FT d_, tmin_, tmax_; - if ( qy >= py ) - { - tmin_ = bymin - py; - tmax_ = bymax - py; - d_ = qy - py; - } - else - { - tmin_ = py - bymax; - tmax_ = py - bymin; - d_ = py - qy; - } - - if ( (dmin*tmax_) < (d_*tmin) || (dmax*tmin_) > (d_*tmax) ) - return false; - - if( (dmin*tmin_) > (d_*tmin) ) - { - tmin = tmin_; - dmin = d_; - } - - if( (dmax*tmax_) < (d_*tmax) ) - { - tmax = tmax_; - dmax = d_; - } - - // ----------------------------------- - // treat z coord - // ----------------------------------- - if ( qz >= pz ) - { - tmin_ = bzmin - pz; - tmax_ = bzmax - pz; - d_ = qz - pz; - } - else - { - tmin_ = pz - bzmax; - tmax_ = pz - bzmin; - d_ = pz - qz; - } - - return ( (dmin*tmax_) >= (d_*tmin) && (dmax*tmin_) <= (d_*tmax) ); - } - template bool do_intersect(const typename K::Ray_3& ray, const CGAL::Bbox_3& bbox, @@ -135,11 +45,16 @@ namespace internal { const Point_3& source = ray.source(); const Point_3& point_on_ray = ray.second_point(); - return bbox_ray_do_intersect_aux( - source.x(), source.y(), source.z(), - point_on_ray.x(), point_on_ray.y(), point_on_ray.z(), - FT(bbox.xmin()), FT(bbox.ymin()), FT(bbox.zmin()), - FT(bbox.xmax()), FT(bbox.ymax()), FT(bbox.zmax()) ); + return do_intersect_bbox_segment_aux + // do not use static filters + ( + source.x(), source.y(), source.z(), + point_on_ray.x(), point_on_ray.y(), point_on_ray.z(), + bbox + ); } } // namespace internal diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h index 43e6052e9ad..92fd6c3041e 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h @@ -1,5 +1,4 @@ -// Copyright (c) 2008 ETH Zurich (Switzerland) -// Copyright (c) 2008-2009 INRIA Sophia-Antipolis (France) +// Copyright (c) 2012 GeometryFactory Sarl (France) // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -17,7 +16,7 @@ // $Id$ // // -// Author(s) : Camille Wormser, Jane Tournois, Pierre Alliez, Stephane Tayeb +// Author(s) : Laurent Rineau #ifndef CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_SEGMENT_3_DO_INTERSECT_H @@ -25,104 +24,374 @@ #include #include +#include +#include +#include // inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf +// This algorithm intersects the line with the x-, y-, and z-slabs of the +// bounding box, and computes the interval [t1, t2], in the +// parameterization of the line given by the segment (for t=0, that is the +// source of the segment, and for t=1 that is its target), where the line +// intersects the three slabs of the bounding box. + +// For a segment, the intersection is non-empty iff +// [t1, t2] intersects [0, 1]. + namespace CGAL { namespace internal { - template + template + struct Do_intersect_bbox_segment_aux_is_greater + { + typedef typename Same_uncertainty::type result_type; + + void register_new_input_values(const FT&, const FT&) {} + void compute_new_error_bound() {} + bool bound_overflow() { return false; } + bool value_might_underflow() { return false; } + + static result_type uncertain() { + return true; + } + + result_type operator()(const FT& a, const FT& b) const { + return a > b; + } + }; // end struct template Do_intersect_bbox_segment_aux_is_greater + + template + class Do_intersect_bbox_segment_aux_is_greater + { + double error; + double tmax; + double dmax; + + public: + CGAL_static_assertion((boost::is_same::value)); + + Do_intersect_bbox_segment_aux_is_greater() : error(0.), tmax(0.), dmax(0.) {} + + void register_new_input_values(const double& t, const double& d) { + if(bounded_0) { + if(t > tmax) tmax = t; + if(d > dmax) dmax = d; + } else { + const double at = CGAL::abs(t); + const double ad = CGAL::abs(d); + if(at > tmax) tmax = at; + if(ad > dmax) dmax = ad; + } + } + + void compute_new_error_bound() { + const double EPS = 8.8872057372592798e-16; + error = tmax * dmax * EPS; + } + + bool bound_overflow() { + const double OVERF = 1e153; + return dmax > OVERF || tmax > OVERF; + } + + bool value_might_underflow() { + const double UNDERF = 1e-146; + return dmax < UNDERF || tmax < UNDERF; + } + + typedef Uncertain result_type; + + static result_type uncertain() { + return result_type::indeterminate(); + } + + result_type operator()(const FT& a, const FT& b) const { + const FT x = a - b; + if(x > error) return true; + else if(x < -error) return false; + else return uncertain(); + } + + }; // end specialization Do_intersect_bbox_segment_aux_is_greater + + template inline - bool + typename Do_intersect_bbox_segment_aux_is_greater + < + FT, + bounded_0, + use_static_filters + >::result_type do_intersect_bbox_segment_aux( const FT& px, const FT& py, const FT& pz, const FT& qx, const FT& qy, const FT& qz, - const FT& bxmin, const FT& bymin, const FT& bzmin, - const FT& bxmax, const FT& bymax, const FT& bzmax) + const Bbox_3& bbox) { + const double& bxmin = bbox.xmin(); + const double& bymin = bbox.ymin(); + const double& bzmin = bbox.zmin(); + const double& bxmax = bbox.xmax(); + const double& bymax = bbox.ymax(); + const double& bzmax = bbox.zmax(); + + // The following code encode t1 and t2 by: + // t1 = tmin/dmin + // t2 = tmax/dmax + // For the first lines, dmax==dmin and is not explicitly defined. + // ----------------------------------- // treat x coord // ----------------------------------- - FT dmin, tmin, tmax; + FT dmin, tmin, tmax, dmax; if ( qx >= px ) { + if(bounded_0 && px > bxmax) return false; // segment on the right of bbox + if(bounded_1 && qx < bxmin) return false; // segment on the left of bbox + + if(bounded_1 && bxmax > qx) { + tmax = 1; + dmax = 1; + } else { + tmax = bxmax - px; + dmax = qx - px; + } + tmin = bxmin - px; - tmax = bxmax - px; dmin = qx - px; } else { + if(bounded_1 && qx > bxmax) return false; // segment on the right of bbox + if(bounded_0 && px < bxmin) return false; // segment on the left of bbox + + if(bounded_1 && bxmin < qx) { + tmax = 1; + dmax = 1; + } else { + tmax = px - bxmin; + dmax = px - qx; + } + tmin = px - bxmax; - tmax = px - bxmin; dmin = px - qx; } - if ( tmax < FT(0) || tmin > dmin ) - return false; + if(bounded_0) tmin = (CGAL::max)(FT(0), tmin); - FT dmax = dmin; - if ( tmin < FT(0) ) + // If the query is vertical for x, then check its x-coordinate is in + // the x-slab. + if( (px == qx) && // <=> (dmin == 0) + (! (bounded_0 && bounded_1) ) ) // do not check for a segment { - tmin = FT(0); - dmin = FT(1); + if(px > bxmax || px < bxmin) return false; + // Note: for a segment the condition has already been tested by the two + // previous tests tmax<0 || tmin>dmin (with dmin==0). } - if ( tmax > dmax ) - { - tmax = FT(1); - dmax = FT(1); + // If dmin == 0, at this point, [t1, t2] == ]-inf, +inf[, or t1 or t2 + // is a NaN. But the case with NaNs is treated as if the interval + // [t1, t2] was ]-inf, +inf[. + + CGAL_assertion(dmin >= 0); + CGAL_assertion(dmax >= 0); + if(bounded_0) { + CGAL_assertion(tmin >= 0); + CGAL_assertion(tmax >= 0); } + // ----------------------------------- // treat y coord // ----------------------------------- - FT d_, tmin_, tmax_; + FT dymin, tymin, tymax, dymax; if ( qy >= py ) { - tmin_ = bymin - py; - tmax_ = bymax - py; - d_ = qy - py; + if(bounded_0 && py > bymax) return false; // segment on the right of bbox + if(bounded_1 && qy < bymin) return false; // segment on the left of bbox + + if(bounded_1 && bymax > qy) { + tymax = 1; + dymax = 1; + } else { + tymax = bymax - py; + dymax = qy - py; + } + + tymin = bymin - py; + dymin = qy - py; } else { - tmin_ = py - bymax; - tmax_ = py - bymin; - d_ = py - qy; + if(bounded_1 && qy > bymax) return false; // segment on the right of bbox + if(bounded_0 && py < bymin) return false; // segment on the left of bbox + + if(bounded_1 && bymin < qy) { + tymax = 1; + dymax = 1; + } else { + tymax = py - bymin; + dymax = py - qy; + } + + tymin = py - bymax; + dymin = py - qy; } - if ( (dmin*tmax_) < (d_*tmin) || (dmax*tmin_) > (d_*tmax) ) - return false; + if(bounded_0) tymin = (CGAL::max)(FT(0), tymin); - if( (dmin*tmin_) > (d_*tmin) ) + // If the query is vertical for y, then check its y-coordinate is in + // the y-slab. + if( (py == qy) && // <=> (dmin == 0) + (! (bounded_0 && bounded_1) ) ) // do not check for a segment { - tmin = tmin_; - dmin = d_; + if(py > bymax || py < bymin) return false; } - if( (dmax*tmax_) < (d_*tmax) ) - { - tmax = tmax_; - dmax = d_; + // If dmin == 0, at this point, [t1, t2] == ]-inf, +inf[, or t1 or t2 + // is a NaN. But the case with NaNs is treated as if the interval + // [t1, t2] was ]-inf, +inf[. + + CGAL_assertion(dymin >= 0); + CGAL_assertion(dymax >= 0); + if(bounded_0) { + CGAL_assertion(tymin >= 0); + CGAL_assertion(tymax >= 0); } + // ----------------------------------- // treat z coord // ----------------------------------- + FT dzmin, tzmin, tzmax, dzmax; if ( qz >= pz ) { - tmin_ = bzmin - pz; - tmax_ = bzmax - pz; - d_ = qz - pz; + if(bounded_0 && pz > bzmax) return false; // segment on the right of bbox + if(bounded_1 && qz < bzmin) return false; // segment on the left of bbox + + if(bounded_1 && bzmax > qz) { + tzmax = 1; + dzmax = 1; + } else { + tzmax = bzmax - pz; + dzmax = qz - pz; + } + + tzmin = bzmin - pz; + dzmin = qz - pz; } else { - tmin_ = pz - bzmax; - tmax_ = pz - bzmin; - d_ = pz - qz; + if(bounded_1 && qz > bzmax) return false; // segment on the right of bbox + if(bounded_0 && pz < bzmin) return false; // segment on the left of bbox + + if(bounded_1 && bzmin < qz) { + tzmax = 1; + dzmax = 1; + } else { + tzmax = pz - bzmin; + dzmax = pz - qz; + } + + tzmin = pz - bzmax; + dzmin = pz - qz; } - return ( (dmin*tmax_) >= (d_*tmin) && (dmax*tmin_) <= (d_*tmax) ); + if(bounded_0) tzmin = (CGAL::max)(FT(0), tzmin); + + // If the query is vertical for z, then check its z-coordinate is in + // the z-slab. + if( (pz == qz) && // <=> (dmin == 0) + (! (bounded_0 && bounded_1) ) ) // do not check for a segment + { + if(pz > bzmax || pz < bzmin) return false; + } + + // If dmin == 0, at this point, [t1, t2] == ]-inf, +inf[, or t1 or t2 + // is a NaN. But the case with NaNs is treated as if the interval + // [t1, t2] was ]-inf, +inf[. + + CGAL_assertion(dzmin >= 0); + CGAL_assertion(dzmax >= 0); + if(bounded_0) { + CGAL_assertion(tzmin >= 0); + CGAL_assertion(tzmax >= 0); + } + + + typedef Do_intersect_bbox_segment_aux_is_greater + Is_greater; + typedef typename Is_greater::result_type Is_greater_value; + Is_greater is_greater; + + is_greater.register_new_input_values(tmin, dmin); + is_greater.register_new_input_values(tymin, dymin); + is_greater.register_new_input_values(tmax, dmax); + is_greater.register_new_input_values(tymax, dymax); + + is_greater.compute_new_error_bound(); + if(is_greater.bound_overflow() || is_greater.value_might_underflow()) + return Is_greater::uncertain(); + + // If t1 > tymax/dymax || tymin/dymin > t2, return false. + if( py != qy && px != qx ) { // dmin > 0, dymax >0, dmax > 0, dymin > 0 + const Is_greater_value b1 = is_greater(dymax* tmin, dmin*tymax); + if(possibly(b1)) return !b1; // if(is_greater) return false; // or uncertain + const Is_greater_value b2 = is_greater( dmax*tymin, dymin* tmax); + if(possibly(b2)) return !b2; + } + + Is_greater_value b = Is_greater_value(); + // If tymin/dymin > t1, set t1 = tymin/dymin. + if( (px == qx) || // <=> (dmin == 0) + ( (py != qy) && // <=> (dymin > 0) + certainly(b = is_greater( dmin*tymin, dymin* tmin)) ) ) + { + tmin = tymin; + dmin = dymin; + } + if(is_indeterminate(b)) return b; // Note that the default-constructed + // Is_greater_value cannot be + // indeterminate. + + // If tymax/dymax < t2, set t2 = tymax/dymax. + if( (px == qx) || // <=> (dmax > 0) + ( (py != qy) && // <=> dymax > 0 + certainly(b = is_greater(dymax* tmax, dmax*tymax)) ) ) + { + tmax = tymax; + dmax = dymax; + } + if(is_indeterminate(b)) return b; + + CGAL_assertion(dmin >= 0); + CGAL_assertion(dmax >= 0); + + // If t1 > tzmax || tzmin > t2, return false. + if( (px != qx || + py != qy ) && + (pz != qz) ) // dmin > 0, dmax > 0, dzmax > 0, dzmin > 0 + { + is_greater.register_new_input_values(tzmin, dzmin); + is_greater.register_new_input_values(tzmax, dzmax); + + is_greater.compute_new_error_bound(); + if(is_greater.bound_overflow() || is_greater.value_might_underflow()) + return Is_greater::uncertain(); + + const Is_greater_value b1 = is_greater(dzmax* tmin, dmin*tzmax); + if(possibly(b1)) return !b1; // if(is_greater) return false; // or uncertain + const Is_greater_value b2 = is_greater( dmax*tzmin, dzmin* tmax); + if(possibly(b2)) return !b2; // if(is_greater) return false; // or uncertain + } + return true; } template @@ -136,11 +405,10 @@ namespace internal { const Point_3& source = segment.source(); const Point_3& target = segment.target(); - return do_intersect_bbox_segment_aux( + return do_intersect_bbox_segment_aux( source.x(), source.y(), source.z(), target.x(), target.y(), target.z(), - FT(bbox.xmin()), FT(bbox.ymin()), FT(bbox.zmin()), - FT(bbox.xmax()), FT(bbox.ymax()), FT(bbox.zmax()) ); + bbox); } template diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h index 86c83351dfe..841499dd6c1 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h @@ -156,26 +156,36 @@ t3s3_intersection_collinear_aux(const typename K::Point_3& a, typename K::Equal_3 equals = k.equal_3_object(); - // possible orders: [p,a,b,q], [p,a,q,b], [a,p,b,q], [a,p,q,b] - if ( collinear_ordered(p,a,q) ) + // possible orders: [p,a,b,q], [p,a,q,b], [p,q,a,b], [a,p,b,q], [a,p,q,b], [a,b,p,q] + if ( collinear_ordered(p,a,b) ) { // p is before a - if ( collinear_ordered(p,b,q) ) - return make_object(segment(a,b)); - else - return equals(a,q)? - make_object(a): - make_object(segment(a,q)); + //possible orders: [p,a,b,q], [p,a,q,b], [p,q,a,b] + if ( collinear_ordered(a,b,q) ) + return make_object(segment(a,b)); //[p,a,b,q] + else{ + if ( collinear_ordered(q,a,b) ) + return equals(a,q)? //[p,q,a,b] + make_object(a): + Object(); + return make_object(segment(a,q)); //[p,a,q,b] + } } else { // p is after a + //possible orders: [a,p,b,q], [a,p,q,b], [a,b,p,q] if ( collinear_ordered(p,b,q) ) - return equals(p,b)? + return equals(p,b)? // [a,p,b,q] make_object(p): make_object(segment(p,b)); - else - return make_object(segment(p,q)); + else{ + if ( collinear_ordered(a,b,p) ) + return equals(p,b)? // [a,b,p,q] + make_object(p): + Object(); + return make_object(segment(p,q)); // [a,p,q,b] + } } } diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 936afd1b6ed..3a0586e41e9 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -37,6 +37,7 @@ #include +#include // for nextafter double random_in(const double a, @@ -61,17 +62,211 @@ template bool test_aux(const T& t, const std::string& name, const CGAL::Bbox_3& bbox, - bool expected) + bool expected, bool exact_predicates = false) { bool b = CGAL::do_intersect(t,bbox); if ( b != expected ) - std::cout << "ERROR: do_intersect(" << name + std::cerr << "ERROR: do_intersect(" << name << ") did not answer the expected result !" << std::endl; return (b == expected); } +template +bool test_case(const FT& px, const FT& py, const FT& pz, + const FT& qx, const FT& qy, const FT& qz, + FT bxmin, FT bymin, FT bzmin, + FT bxmax, FT bymax, FT bzmax, + const bool expected, + const bool exact_k = false, + const bool exactness_issue = false, + const bool change_signs = true, + const bool swap_coords = true, + const bool opposite_seg = true, + const bool translate = true, + const bool scale = true) +{ + bool b = true; + if(change_signs) { + b &= test_case( px, py, pz, + qx, qy, qz, + bxmin, bymin, bzmin, + bxmax, bymax, bzmax, expected, exact_k, exactness_issue, false); + b &= test_case(-px, py, pz, + -qx, qy, qz, + -bxmin, bymin, bzmin, + -bxmax, bymax, bzmax, expected, exact_k, exactness_issue, false); + b &= test_case( px, -py, pz, + qx, -qy, qz, + bxmin, -bymin, bzmin, + bxmax, -bymax, bzmax, expected, exact_k, exactness_issue, false); + b &= test_case( px, py, -pz, + qx, qy, -qz, + bxmin, bymin, -bzmin, + bxmax, bymax, -bzmax, expected, exact_k, exactness_issue, false); + b &= test_case(-px, -py, pz, + -qx, -qy, qz, + -bxmin, -bymin, bzmin, + -bxmax, -bymax, bzmax, expected, exact_k, exactness_issue, false); + b &= test_case( px, -py, -pz, + qx, -qy, -qz, + bxmin, -bymin, -bzmin, + bxmax, -bymax, -bzmax, expected, exact_k, exactness_issue, false); + b &= test_case(-px, py, -pz, + -qx, qy, -qz, + -bxmin, bymin, -bzmin, + -bxmax, bymax, -bzmax, expected, exact_k, exactness_issue, false); + b &= test_case(-px, -py, -pz, + -qx, -qy, -qz, + -bxmin, -bymin, -bzmin, + -bxmax, -bymax, -bzmax, expected, exact_k, exactness_issue, false); + } else if(swap_coords) { + // xyz + b &= test_case( px, py, pz, + qx, qy, qz, + bxmin, bymin, bzmin, + bxmax, bymax, bzmax, expected, exact_k, exactness_issue, + false, false); + // xzy + b &= test_case( px, pz, py, + qx, qz, qy, + bxmin, bzmin, bymin, + bxmax, bzmax, bymax, expected, exact_k, exactness_issue, + false, false); + // yxz + b &= test_case( py, px, pz, + qy, qx, qz, + bymin, bxmin, bzmin, + bymax, bxmax, bzmax, expected, exact_k, exactness_issue, + false, false); + // zxy + b &= test_case( pz, px, py, + qz, qx, qy, + bzmin, bxmin, bymin, + bzmax, bxmax, bymax, expected, exact_k, exactness_issue, + false, false); + + // yzx + b &= test_case( py, pz, px, + qy, qz, qx, + bymin, bzmin, bxmin, + bymax, bzmax, bxmax, expected, exact_k, exactness_issue, + false, false); + // zyx + b &= test_case( pz, py, px, + qz, qy, qx, + bzmin, bymin, bxmin, + bzmax, bymax, bxmax, expected, exact_k, exactness_issue, + false, false); + } else if(opposite_seg) { + b &= test_case(px, py, pz, + qx, qy, qz, + bxmin, bymin, bzmin, + bxmax, bymax, bzmax, expected, exact_k, exactness_issue, + false, false, false); + b &= test_case(qx, qy, qz, + px, py, pz, + bxmin, bymin, bzmin, + bxmax, bymax, bzmax, expected, exact_k, exactness_issue, + false, false, false); + } else if(translate) { + b &= test_case(px, py, pz, + qx, qy, qz, + bxmin, bymin, bzmin, + bxmax, bymax, bzmax, expected, exact_k, exactness_issue, + false, false, false, false); + FT dx = 10, dy = 20, dz = 30; + b &= test_case(dx + px, dy + py, dz + pz, + dx + qx, dy + qy, dz + qz, + dx + bxmin, dy + bymin, dz + bzmin, + dx + bxmax, dy + bymax, dz + bzmax, expected, exact_k, exactness_issue, + false, false, false, false); + dx = (1 >> 10), dy = dx, dz = dx; + b &= test_case(dx + px, dy + py, dz + pz, + dx + qx, dy + qy, dz + qz, + dx + bxmin, dy + bymin, dz + bzmin, + dx + bxmax, dy + bymax, dz + bzmax, expected, exact_k, exactness_issue, + false, false, false, false); + dx = -(1 >> 10), dy = dx, dz = dx; + b &= test_case(dx + px, dy + py, dz + pz, + dx + qx, dy + qy, dz + qz, + dx + bxmin, dy + bymin, dz + bzmin, + dx + bxmax, dy + bymax, dz + bzmax, expected, exact_k, exactness_issue, + false, false, false, false); + } else if(scale) { + b &= test_case(px, py, pz, + qx, qy, qz, + bxmin, bymin, bzmin, + bxmax, bymax, bzmax, expected, exact_k, exactness_issue, + false, false, false, false, false); + FT delta = 9; + b &= test_case(delta * qx, delta * qy, delta * qz, + delta * px, delta * py, delta * pz, + delta * bxmin, delta * bymin, delta * bzmin, + delta * bxmax, delta * bymax, delta * bzmax, expected, exact_k, exactness_issue, + false, false, false, false, false); + delta = (1 << 10); + b &= test_case(delta * qx, delta * qy, delta * qz, + delta * px, delta * py, delta * pz, + delta * bxmin, delta * bymin, delta * bzmin, + delta * bxmax, delta * bymax, delta * bzmax, expected, exact_k, exactness_issue, + false, false, false, false, false); + delta = (1 << 10); + delta = 1/delta; + b &= test_case(delta * qx, delta * qy, delta * qz, + delta * px, delta * py, delta * pz, + delta * bxmin, delta * bymin, delta * bzmin, + delta * bxmax, delta * bymax, delta * bzmax, expected, exact_k, exactness_issue, + false, false, false, false, false); + delta = 7; + delta /= 2; + b &= test_case(delta * qx, delta * qy, delta * qz, + delta * px, delta * py, delta * pz, + delta * bxmin, delta * bymin, delta * bzmin, + delta * bxmax, delta * bymax, delta * bzmax, expected, exact_k, exactness_issue, + false, false, false, false, false); + delta = 1; + delta /= 8; + b &= test_case(delta * qx, delta * qy, delta * qz, + delta * px, delta * py, delta * pz, + delta * bxmin, delta * bymin, delta * bzmin, + delta * bxmax, delta * bymax, delta * bzmax, expected, exact_k, exactness_issue, + false, false, false, false, false); + } else { + using CGAL::do_intersect; + using CGAL::Bbox_3; + typedef typename K::Point_3 Point_3; + typedef typename K::Segment_3 Segment_3; + if(bxmin > bxmax) std::swap(bxmin, bxmax); + if(bymin > bymax) std::swap(bymin, bymax); + if(bzmin > bzmax) std::swap(bzmin, bzmax); + if(do_intersect(Bbox_3(bxmin, bymin, bzmin, + bxmax, bymax, bzmax), + Segment_3(Point_3(px, py, pz), + Point_3(qx, qy, qz))) != expected) + { + if(!exactness_issue || exact_k) { + b = false; + CGAL::set_pretty_mode(std::cerr); + std::cerr.precision(17); + std::cerr << "Wrong result for do_intersect(" + << Bbox_3(bxmin, bymin, bzmin, + bxmax, bymax, bzmax) + << ",\n" + << " " + << Segment_3(Point_3(px, py, pz), + Point_3(qx, qy, qz)) + << ")\n" + << " it should have been " << std::boolalpha << expected + << std::endl; + } + } + } + return b; +} + template void speed(const std::string& name) { @@ -100,7 +295,7 @@ void speed(const std::string& name) CGAL::Timer timer; timer.start(); std::size_t success = 0; - while ( timer.time() < 0.1 ) + while ( timer.time() < 5. ) { for ( typename std::vector::iterator it = segment_vector.begin(); it != segment_vector.end() ; ++it ) @@ -132,7 +327,50 @@ void test_speed() } template -bool test() +bool intensive_test(bool exact_predicates = true) +{ + bool b = true; + + // Test vertical segments + for(double x = 4.; x <= 7.; x+=1.) + for(double ymin = 0.; ymin <= 7.; ymin+=1.) + for(double ymax = ymin; ymax <= 7.; ymax+=1.) + { + const bool expected = + x >= -5. && x<= 5. && + ymin <= 5. && ymax >= -5; + b &= test_case(x, ymin, 0., + x, ymax, 0., + -5., -5., -5., 5., 5., 5., expected, exact_predicates); + } + // Test slanted segments + for(double x = -7.; x <= 6.; x+=1.) + for(double y = -1.; y <= 6.; y+=1.) + { + const bool expected = + x >= -6. && x <= 5. && + y >= -6. && y <= 5. && + y <= x + 10. && y >= x - 10.; + b &= test_case(x, y, 0., + x + 1., y + 1., 0., + -5., -5., -5., 5., 5., 5., expected, exact_predicates); + } + for(double x = -9.; x <= 6.; x+=1.) + for(double y = -3.; y <= 6.; y+=1.) + { + const bool expected = + x >= -8. && x <= 5. && + y >= -7. && y <= 5. && + 3 * y <= 2 * x + 25. && 3 * y >= 2 * x - 25.; + b &= test_case(x, y, 0., + x + 3., y + 2., 0., + -5., -5., -5., 5., 5., 5., expected, exact_predicates); + } + return b; +} + +template +bool test(bool exact_kernel = false) { // types typedef typename K::FT FT; @@ -188,8 +426,48 @@ bool test() b &= test_aux(sBC,"sBC",bbox,true); b &= test_aux(sCE,"sCE",bbox,false); b &= test_aux(sEC,"sEC",bbox,false); + + CGAL::Bbox_3 bbox_elem_1834(2, 1.81818, 0.166666, + 2.18182, 2.18182, 0.333333); + Point source_1834(2, 2, 1); + Point target_1834(2, 2, 0.75); + Segment segment_query_1834( source_1834, target_1834 ); + Point source_1834a(2, 2, 0.5); + Point target_1834a(2, 2, 0.75); + Segment segment_query_1834a( source_1834a, target_1834a ); + + b &= test_aux(segment_query_1834, + "segment_query_1834", bbox_elem_1834, false); + b &= test_aux(segment_query_1834.opposite(), + "segment_query_1834.opposite()", bbox_elem_1834, false); + b &= test_aux(segment_query_1834a, + "segment_query_1834a", bbox_elem_1834, false); + b &= test_aux(segment_query_1834a.opposite(), + "segment_query_1834a.opposite()", bbox_elem_1834, false); + b &= test_case(2., 2., 1., + 2., 2., 0.75, + 1.81818, 2., 0., + 2., 2.18182, 0.333333, false); + b &= test_case(2., 2., 0.5, + 2., 2., 0.75, + 1.81818, 2., 0., + 2., 2.18182, 0.333333, false); + + CGAL::Bbox_3 bbox_elem_1834b(1.81818, 2, 0, + 2, 2.18182, 0.333333); + Segment segment_query_1834b(Point(2, 2, 1), + Point(2, 2, 0.75)); + b &= test_aux(segment_query_1834b, + "segment_query_1834b", bbox_elem_1834b, false); + b &= test_aux(segment_query_1834b.opposite(), + "segment_query_1834b.opposite()", bbox_elem_1834b, false); + b &= test_case(2., 2., 1., + 2., 2., 0.75, + 1.81818, 2., 0., + 2., 2.18182, 0.333333, false); + Ray r12(p1,p2); Ray r13(p1,p3); Ray r14(p1,p4); @@ -309,22 +587,85 @@ bool test() Line line3(seg3); Line line4(seg4); - test_aux(seg2, "seg2", bbox2, false); - test_aux(seg3, "seg3", bbox3, true); - test_aux(seg4, "seg4", bbox4, false); + b &= test_aux(seg2, "seg2", bbox2, false); + b &= test_aux(seg3, "seg3", bbox3, true); + b &= test_aux(seg4, "seg4", bbox4, false); - test_aux(ray2, "ray2", bbox2, false); - test_aux(ray3, "ray3", bbox3, true); - test_aux(ray4, "ray4", bbox4, false); + b &= test_aux(ray2, "ray2", bbox2, false); + b &= test_aux(ray3, "ray3", bbox3, true); + b &= test_aux(ray4, "ray4", bbox4, false); - test_aux(line2, "line2", bbox2, false); - test_aux(line3, "line3", bbox3, true); - test_aux(line4, "line4", bbox4, false); + b &= test_aux(line2, "line2", bbox2, false); + b &= test_aux(line3, "line3", bbox3, true); + b &= test_aux(line4, "line4", bbox4, false); // Use do_intersect(bbox,bbox) CGAL::do_intersect(bbox2,bbox4); - return b; + b &= test_case(1., 1., 0., + 1., 1., 1., + 0., 0., 0., + 1., 1., 1., true); + b &= test_case(0.5, 0.5, -0.5, + 0.5, 0.5, 0.5, + -0.5, -0.5, -0.5, + 0.5, 0.5, 0.5, true); + float f = 0.5f; + double d = boost::math::nextafter(f, f+1); + double d2 = boost::math::nextafter(f, f-1); + b &= test_case(d, 0.5, -0.5, + d, 0.5, 0.5, + -0.5, -0.5, -0.5, + 0.5, 0.5, 0.5, false, exact_kernel, true, + false, false, false, false, false); + b &= test_case(d2, 0.5, -0.5, + d, 0.5, 0.5, + -0.5, -0.5, -0.5, + 0.5, 0.5, 0.5, true, exact_kernel, true, + false, false, false, false, false); + + b &= test_case(1., 1., 0., + 2., 2., 2., + 0., 0., 0., + 1., 1., 1., true); + b &= test_case(1., 1., 1., + 1., 1., 1., + 0., 0., 0., + 1., 1., 1., true); + b &= test_case(0.9, 0.9, 0.9, + 0.9, 0.9, 0.9, + 0., 0., 0., + 1., 1., 1., true); + b &= test_case(0., 0., 0., + 0., 0., 0., + 0., 0., 0., + 1., 1., 1., true); + b &= test_case(0.1, 0., 0.1, + 0.1, 0., 0.1, + 0., 0., 0., + 1., 1., 1., true); + b &= test_case(0.1, -0.1, 0.1, + 0.1, -0.1, 0.1, + 0., 0., 0., + 1., 1., 1., false); + b &= test_case(0.1, 0.1, 0.1, + 0.1, 0.1, 0.1, + 0., 0., 0., + 1., 1., 1., true); + b &= test_case(1., 1., 1.1, + 1., 1., 1.1, + 0., 0., 0., + 1., 1., 1., false); + return b; +} + +template +bool test_kernel(bool exact_predicates = true, K k = K()) +{ + bool b = test(exact_predicates) && + intensive_test(exact_predicates); + test_speed(); + return b; } int main() @@ -332,38 +673,31 @@ int main() srand(0); std::cout << std::setprecision(5); + bool b; std::cout << "Testing with Simple_cartesian..." << std::endl ; - bool b = test >(); - test_speed >(); + b = test_kernel >(false); std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(true); std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(true); std::cout << std::endl << "Testing with Cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(false); std::cout << std::endl << "Testing with Cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(true); std::cout << std::endl << "Testing with Filtered_kernel > without static filters..." << std::endl ; typedef CGAL::Filtered_kernel, false> Fk_no_static; - b &= test(); - test_speed(); + b &= test_kernel(); std::cout << std::endl << "Testing with Exact_predicates_inexact_constructions_kernel..." << std::endl ; - b &= test(); - test_speed(); + b &= test_kernel(); std::cout << std::endl << "Testing with Exact_predicates_exact_constructions_kernel..." << std::endl ; - b &= test(); - test_speed(); + b &= test_kernel(); if ( b ) return EXIT_SUCCESS; diff --git a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp index 57036f2e574..6f29a180e18 100644 --- a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp +++ b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp @@ -216,15 +216,20 @@ void random_test() // Precomputed results test // ----------------------------------- template -bool test_aux(const Triangle t, +bool test_aux(bool is_kernel_exact, + const Triangle t, const Query& q, const std::string& name, - const Result& expected) + const Result& expected, + double sq_espilon = 1e-20) { CGAL::Object object = CGAL::intersection(t,q); const Result* pr = CGAL::object_cast(&object); - if ( (NULL != pr) && (expected == *pr) ) + if ( (NULL != pr) && + (is_kernel_exact ? + (expected == *pr) : + CGAL::to_double(CGAL::squared_distance(expected, *pr)) < sq_espilon ) ) { return true; } @@ -243,7 +248,7 @@ bool test_aux(const Triangle t, } template -bool test() +bool test(bool is_kernel_exact = true) { // types typedef typename K::FT FT; @@ -281,10 +286,10 @@ bool test() Segment s32(p3,p2); Segment s31(p3,p1); - bool b = test_aux(t,s12,"t-s12",s12); - b &= test_aux(t,s21,"t-s21",s21); - b &= test_aux(t,s13,"t-s13",s13); - b &= test_aux(t,s23,"t-s23",s23); + bool b = test_aux(is_kernel_exact,t,s12,"t-s12",s12); + b &= test_aux(is_kernel_exact,t,s21,"t-s21",s21); + b &= test_aux(is_kernel_exact,t,s13,"t-s13",s13); + b &= test_aux(is_kernel_exact,t,s23,"t-s23",s23); // Inside points Point p4(FT(0.5), FT(0.5), FT(0.)); @@ -318,30 +323,30 @@ bool test() Segment s78(p7,p8); Segment s87(p8,p7); - b &= test_aux(t,s14,"t-s14",s14); - b &= test_aux(t,s41,"t-s41",s41); - b &= test_aux(t,s24,"t-s24",s24); - b &= test_aux(t,s42,"t-s42",s42); - b &= test_aux(t,s15,"t-s15",s15); - b &= test_aux(t,s25,"t-s25",s25); - b &= test_aux(t,s34,"t-s34",s34); - b &= test_aux(t,s35,"t-s35",s35); - b &= test_aux(t,s36,"t-s36",s36); - b &= test_aux(t,s45,"t-s45",s45); - b &= test_aux(t,s16,"t-s16",s16); - b &= test_aux(t,s26,"t-s26",s26); - b &= test_aux(t,s62,"t-s62",s62); - b &= test_aux(t,s46,"t-s46",s46); - b &= test_aux(t,s65,"t-s65",s65); - b &= test_aux(t,s64,"t-s64",s64); - b &= test_aux(t,s48,"t-s48",s48); - b &= test_aux(t,s56,"t-s56",s56); - b &= test_aux(t,s17,"t-t17",s17); - b &= test_aux(t,s67,"t-t67",s67); - b &= test_aux(t,s68,"t-s68",s68); - b &= test_aux(t,s86,"t-s86",s86); - b &= test_aux(t,s78,"t-t78",s78); - b &= test_aux(t,s87,"t-t87",s87); + b &= test_aux(is_kernel_exact,t,s14,"t-s14",s14); + b &= test_aux(is_kernel_exact,t,s41,"t-s41",s41); + b &= test_aux(is_kernel_exact,t,s24,"t-s24",s24); + b &= test_aux(is_kernel_exact,t,s42,"t-s42",s42); + b &= test_aux(is_kernel_exact,t,s15,"t-s15",s15); + b &= test_aux(is_kernel_exact,t,s25,"t-s25",s25); + b &= test_aux(is_kernel_exact,t,s34,"t-s34",s34); + b &= test_aux(is_kernel_exact,t,s35,"t-s35",s35); + b &= test_aux(is_kernel_exact,t,s36,"t-s36",s36); + b &= test_aux(is_kernel_exact,t,s45,"t-s45",s45); + b &= test_aux(is_kernel_exact,t,s16,"t-s16",s16); + b &= test_aux(is_kernel_exact,t,s26,"t-s26",s26); + b &= test_aux(is_kernel_exact,t,s62,"t-s62",s62); + b &= test_aux(is_kernel_exact,t,s46,"t-s46",s46); + b &= test_aux(is_kernel_exact,t,s65,"t-s65",s65); + b &= test_aux(is_kernel_exact,t,s64,"t-s64",s64); + b &= test_aux(is_kernel_exact,t,s48,"t-s48",s48); + b &= test_aux(is_kernel_exact,t,s56,"t-s56",s56); + b &= test_aux(is_kernel_exact,t,s17,"t-t17",s17); + b &= test_aux(is_kernel_exact,t,s67,"t-t67",s67); + b &= test_aux(is_kernel_exact,t,s68,"t-s68",s68); + b &= test_aux(is_kernel_exact,t,s86,"t-s86",s86); + b &= test_aux(is_kernel_exact,t,s78,"t-t78",s78); + b &= test_aux(is_kernel_exact,t,s87,"t-t87",s87); // Outside points (in triangle plane) Point pA(FT(-0.5), FT(1.), FT(0.5)); @@ -362,17 +367,17 @@ bool test() Segment s1F(p1,pF); Segment sF6(pF,p6); - b &= test_aux(t,sAB,"t-sAB",p2); - b &= test_aux(t,sBC,"t-sBC",s46); - b &= test_aux(t,s2E,"t-s2E",s26); - b &= test_aux(t,sE2,"t-sE2",s62); - b &= test_aux(t,s2A,"t-s2A",p2); - b &= test_aux(t,s6E,"t-s6E",p6); - b &= test_aux(t,sB8,"t-sB8",s48); - b &= test_aux(t,sC8,"t-sC8",s68); - b &= test_aux(t,s8C,"t-s8C",s86); - b &= test_aux(t,s1F,"t-s1F",s13); - b &= test_aux(t,sF6,"t-sF6",s36); + b &= test_aux(is_kernel_exact,t,sAB,"t-sAB",p2); + b &= test_aux(is_kernel_exact,t,sBC,"t-sBC",s46); + b &= test_aux(is_kernel_exact,t,s2E,"t-s2E",s26); + b &= test_aux(is_kernel_exact,t,sE2,"t-sE2",s62); + b &= test_aux(is_kernel_exact,t,s2A,"t-s2A",p2); + b &= test_aux(is_kernel_exact,t,s6E,"t-s6E",p6); + b &= test_aux(is_kernel_exact,t,sB8,"t-sB8",s48); + b &= test_aux(is_kernel_exact,t,sC8,"t-sC8",s68); + b &= test_aux(is_kernel_exact,t,s8C,"t-s8C",s86); + b &= test_aux(is_kernel_exact,t,s1F,"t-s1F",s13); + b &= test_aux(is_kernel_exact,t,sF6,"t-sF6",s36); // Outside triangle plane Point pa(FT(0.), FT(0.), FT(0.)); @@ -386,11 +391,11 @@ bool test() Segment sa8(pa,p8); Segment sb2(pb,p2); - b &= test_aux(t,sab,"t-sab",p1); - b &= test_aux(t,sac,"t-sac",p6); - b &= test_aux(t,sae,"t-sae",p8); - b &= test_aux(t,sa8,"t-sa8",p8); - b &= test_aux(t,sb2,"t-sb2",p2); + b &= test_aux(is_kernel_exact,t,sab,"t-sab",p1); + b &= test_aux(is_kernel_exact,t,sac,"t-sac",p6); + b &= test_aux(is_kernel_exact,t,sae,"t-sae",p8); + b &= test_aux(is_kernel_exact,t,sa8,"t-sa8",p8); + b &= test_aux(is_kernel_exact,t,sb2,"t-sb2",p2); // ----------------------------------- // ray queries @@ -401,10 +406,10 @@ bool test() Ray r13(p1,p3); Ray r23(p2,p3); - b &= test_aux(t,r12,"t-r12",s12); - b &= test_aux(t,r21,"t-r21",s21); - b &= test_aux(t,r13,"t-r13",s13); - b &= test_aux(t,r23,"t-r23",s23); + b &= test_aux(is_kernel_exact,t,r12,"t-r12",s12); + b &= test_aux(is_kernel_exact,t,r21,"t-r21",s21); + b &= test_aux(is_kernel_exact,t,r13,"t-r13",s13); + b &= test_aux(is_kernel_exact,t,r23,"t-r23",s23); // In triangle Point p9_(FT(0.), FT(0.5), FT(0.5)); @@ -432,26 +437,26 @@ bool test() Ray r68(p6,p8); Segment r89_res(p8,p9_); - b &= test_aux(t,r14,"t-r14",s12); - b &= test_aux(t,r41,"t-r41",s41); - b &= test_aux(t,r24,"t-r24",s21); - b &= test_aux(t,r42,"t-r42",s42); - b &= test_aux(t,r15,"t-r15",s15); - b &= test_aux(t,r25,"t-r25",s23); - b &= test_aux(t,r34,"t-r34",s34); - b &= test_aux(t,r35,"t-r35",s32); - b &= test_aux(t,r36,"t-r36",s31); - b &= test_aux(t,r45,"t-r45",s45); - b &= test_aux(t,r16,"t-r16",s13); - b &= test_aux(t,r26,"t-r26",s26); - b &= test_aux(t,r62,"t-r62",s62); - b &= test_aux(t,r46,"t-r46",s46); - b &= test_aux(t,r48,"t-r48",s46); - b &= test_aux(t,r56,"t-r56",s56); - b &= test_aux(t,r47,"t-r47",s45); - b &= test_aux(t,r89,"t-t89",r89_res); - b &= test_aux(t,r68,"t-r68",s64); - b &= test_aux(t,r86,"t-r86",s86); + b &= test_aux(is_kernel_exact,t,r14,"t-r14",s12); + b &= test_aux(is_kernel_exact,t,r41,"t-r41",s41); + b &= test_aux(is_kernel_exact,t,r24,"t-r24",s21); + b &= test_aux(is_kernel_exact,t,r42,"t-r42",s42); + b &= test_aux(is_kernel_exact,t,r15,"t-r15",s15); + b &= test_aux(is_kernel_exact,t,r25,"t-r25",s23); + b &= test_aux(is_kernel_exact,t,r34,"t-r34",s34); + b &= test_aux(is_kernel_exact,t,r35,"t-r35",s32); + b &= test_aux(is_kernel_exact,t,r36,"t-r36",s31); + b &= test_aux(is_kernel_exact,t,r45,"t-r45",s45); + b &= test_aux(is_kernel_exact,t,r16,"t-r16",s13); + b &= test_aux(is_kernel_exact,t,r26,"t-r26",s26); + b &= test_aux(is_kernel_exact,t,r62,"t-r62",s62); + b &= test_aux(is_kernel_exact,t,r46,"t-r46",s46); + b &= test_aux(is_kernel_exact,t,r48,"t-r48",s46); + b &= test_aux(is_kernel_exact,t,r56,"t-r56",s56); + b &= test_aux(is_kernel_exact,t,r47,"t-r47",s45); + b &= test_aux(is_kernel_exact,t,r89,"t-t89",r89_res); + b &= test_aux(is_kernel_exact,t,r68,"t-r68",s64); + b &= test_aux(is_kernel_exact,t,r86,"t-r86",s86); // Outside points (in triangre prane) @@ -467,17 +472,17 @@ bool test() Ray r1F(p1,pF); Ray rF6(pF,p6); - b &= test_aux(t,rAB,"t-rAB",p2); - b &= test_aux(t,rBC,"t-rBC",s46); - b &= test_aux(t,r2E,"t-r2E",s26); - b &= test_aux(t,rE2,"t-rE2",s62); - b &= test_aux(t,r2A,"t-r2A",p2); - b &= test_aux(t,r6E,"t-r6E",p6); - b &= test_aux(t,rB8,"t-rB8",s46); - b &= test_aux(t,rC8,"t-rC8",s64); - b &= test_aux(t,r8C,"t-r8C",s86); - b &= test_aux(t,r1F,"t-r1F",s13); - b &= test_aux(t,rF6,"t-rF6",s31); + b &= test_aux(is_kernel_exact,t,rAB,"t-rAB",p2); + b &= test_aux(is_kernel_exact,t,rBC,"t-rBC",s46); + b &= test_aux(is_kernel_exact,t,r2E,"t-r2E",s26); + b &= test_aux(is_kernel_exact,t,rE2,"t-rE2",s62); + b &= test_aux(is_kernel_exact,t,r2A,"t-r2A",p2); + b &= test_aux(is_kernel_exact,t,r6E,"t-r6E",p6); + b &= test_aux(is_kernel_exact,t,rB8,"t-rB8",s46); + b &= test_aux(is_kernel_exact,t,rC8,"t-rC8",s64); + b &= test_aux(is_kernel_exact,t,r8C,"t-r8C",s86); + b &= test_aux(is_kernel_exact,t,r1F,"t-r1F",s13); + b &= test_aux(is_kernel_exact,t,rF6,"t-rF6",s31); // Outside triangle plane Ray rab(pa,pb); @@ -486,11 +491,11 @@ bool test() Ray ra8(pa,p8); Ray rb2(pb,p2); - b &= test_aux(t,rab,"t-rab",p1); - b &= test_aux(t,rac,"t-rac",p6); - b &= test_aux(t,rae,"t-rae",p8); - b &= test_aux(t,ra8,"t-ra8",p8); - b &= test_aux(t,rb2,"t-rb2",p2); + b &= test_aux(is_kernel_exact,t,rab,"t-rab",p1); + b &= test_aux(is_kernel_exact,t,rac,"t-rac",p6); + b &= test_aux(is_kernel_exact,t,rae,"t-rae",p8); + b &= test_aux(is_kernel_exact,t,ra8,"t-ra8",p8); + b &= test_aux(is_kernel_exact,t,rb2,"t-rb2",p2); // ----------------------------------- // Line queries @@ -501,10 +506,10 @@ bool test() Line l13(p1,p3); Line l23(p2,p3); - b &= test_aux(t,l12,"t-l12",s12); - b &= test_aux(t,l21,"t-l21",s21); - b &= test_aux(t,l13,"t-l13",s13); - b &= test_aux(t,l23,"t-l23",s23); + b &= test_aux(is_kernel_exact,t,l12,"t-l12",s12); + b &= test_aux(is_kernel_exact,t,l21,"t-l21",s21); + b &= test_aux(is_kernel_exact,t,l13,"t-l13",s13); + b &= test_aux(is_kernel_exact,t,l23,"t-l23",s23); // In triangle Line l14(p1,p4); @@ -530,26 +535,26 @@ bool test() Segment l89_res(p1,p9_); - b &= test_aux(t,l14,"t-l14",s12); - b &= test_aux(t,l41,"t-l41",s21); - b &= test_aux(t,l24,"t-l24",s21); - b &= test_aux(t,l42,"t-l42",s12); - b &= test_aux(t,l15,"t-l15",s15); - b &= test_aux(t,l25,"t-l25",s23); - b &= test_aux(t,l34,"t-l34",s34); - b &= test_aux(t,l35,"t-l35",s32); - b &= test_aux(t,l36,"t-l36",s31); - b &= test_aux(t,l45,"t-l45",s45); - b &= test_aux(t,l16,"t-l16",s13); - b &= test_aux(t,l26,"t-l26",s26); - b &= test_aux(t,l62,"t-l62",s62); - b &= test_aux(t,l46,"t-l46",s46); - b &= test_aux(t,l48,"t-l48",s46); - b &= test_aux(t,l56,"t-l56",s56); - b &= test_aux(t,l47,"t-l47",s45); - b &= test_aux(t,l89,"t-t89",l89_res); - b &= test_aux(t,l68,"t-l68",s64); - b &= test_aux(t,l86,"t-l86",s46); + b &= test_aux(is_kernel_exact,t,l14,"t-l14",s12); + b &= test_aux(is_kernel_exact,t,l41,"t-l41",s21); + b &= test_aux(is_kernel_exact,t,l24,"t-l24",s21); + b &= test_aux(is_kernel_exact,t,l42,"t-l42",s12); + b &= test_aux(is_kernel_exact,t,l15,"t-l15",s15); + b &= test_aux(is_kernel_exact,t,l25,"t-l25",s23); + b &= test_aux(is_kernel_exact,t,l34,"t-l34",s34); + b &= test_aux(is_kernel_exact,t,l35,"t-l35",s32); + b &= test_aux(is_kernel_exact,t,l36,"t-l36",s31); + b &= test_aux(is_kernel_exact,t,l45,"t-l45",s45); + b &= test_aux(is_kernel_exact,t,l16,"t-l16",s13); + b &= test_aux(is_kernel_exact,t,l26,"t-l26",s26); + b &= test_aux(is_kernel_exact,t,l62,"t-l62",s62); + b &= test_aux(is_kernel_exact,t,l46,"t-l46",s46); + b &= test_aux(is_kernel_exact,t,l48,"t-l48",s46); + b &= test_aux(is_kernel_exact,t,l56,"t-l56",s56); + b &= test_aux(is_kernel_exact,t,l47,"t-l47",s45); + b &= test_aux(is_kernel_exact,t,l89,"t-t89",l89_res); + b &= test_aux(is_kernel_exact,t,l68,"t-l68",s64); + b &= test_aux(is_kernel_exact,t,l86,"t-l86",s46); // Outside points (in triangle plane) @@ -565,17 +570,17 @@ bool test() Line l1F(p1,pF); Line lF6(pF,p6); - b &= test_aux(t,lAB,"t-lAB",p2); - b &= test_aux(t,lBC,"t-lBC",s46); - b &= test_aux(t,l2E,"t-l2E",s26); - b &= test_aux(t,lE2,"t-lE2",s62); - b &= test_aux(t,l2A,"t-l2A",p2); - b &= test_aux(t,l6E,"t-l6E",s26); - b &= test_aux(t,lB8,"t-lB8",s46); - b &= test_aux(t,lC8,"t-lC8",s64); - b &= test_aux(t,l8C,"t-l8C",s46); - b &= test_aux(t,l1F,"t-l1F",s13); - b &= test_aux(t,lF6,"t-lF6",s31); + b &= test_aux(is_kernel_exact,t,lAB,"t-lAB",p2); + b &= test_aux(is_kernel_exact,t,lBC,"t-lBC",s46); + b &= test_aux(is_kernel_exact,t,l2E,"t-l2E",s26); + b &= test_aux(is_kernel_exact,t,lE2,"t-lE2",s62); + b &= test_aux(is_kernel_exact,t,l2A,"t-l2A",p2); + b &= test_aux(is_kernel_exact,t,l6E,"t-l6E",s26); + b &= test_aux(is_kernel_exact,t,lB8,"t-lB8",s46); + b &= test_aux(is_kernel_exact,t,lC8,"t-lC8",s64); + b &= test_aux(is_kernel_exact,t,l8C,"t-l8C",s46); + b &= test_aux(is_kernel_exact,t,l1F,"t-l1F",s13); + b &= test_aux(is_kernel_exact,t,lF6,"t-lF6",s31); // Outside triangle plane Line lab(pa,pb); @@ -584,11 +589,11 @@ bool test() Line la8(pa,p8); Line lb2(pb,p2); - b &= test_aux(t,lab,"t-lab",p1); - b &= test_aux(t,lac,"t-lac",p6); - b &= test_aux(t,lae,"t-lae",p8); - b &= test_aux(t,la8,"t-la8",p8); - b &= test_aux(t,lb2,"t-lb2",p2); + b &= test_aux(is_kernel_exact,t,lab,"t-lab",p1); + b &= test_aux(is_kernel_exact,t,lac,"t-lac",p6); + b &= test_aux(is_kernel_exact,t,lae,"t-lae",p8); + b &= test_aux(is_kernel_exact,t,la8,"t-la8",p8); + b &= test_aux(is_kernel_exact,t,lb2,"t-lb2",p2); return b; @@ -606,23 +611,28 @@ int main() // ----------------------------------- std::cout << "Test precomputed intersection results" << std::endl; std::cout << "\tTesting with Simple_cartesian..." << std::endl ; - bool b = test(); + bool b = test(false); std::cout << "\tTesting with Simple_cartesian..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Cartesian..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Cartesian..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Exact_predicates_inexact_constructions_kernel..." << std::endl ; - b &= test(); + b &= test(false); std::cout << "\tTesting with Exact_predicates_exact_constructions_kernel..." << std::endl ; - b &= test(); - + b &= test(true); + //test with a coplanar segment + b &= CGAL::intersection( + Epec::Segment_3(Epec::Point_3(0.125, 0, -0.125),Epec::Point_3(0.25, 0, -0.125) ), + Epec::Triangle_3( Epec::Point_3(0.2500001, 0, -0.125), + Epec::Point_3(1.0278171, 0, -0.125) /* vertex 10*/, + Epec::Point_3(1.0278171, 0, -0.250001) /* vertex 9*/ ) ).empty(); // ----------------------------------- // Test random intersection // ----------------------------------- diff --git a/Interval_skip_list/examples/Interval_skip_list/isl_terrain.cpp b/Interval_skip_list/examples/Interval_skip_list/isl_terrain.cpp index 23aae11b1d6..17e3dd6515d 100644 --- a/Interval_skip_list/examples/Interval_skip_list/isl_terrain.cpp +++ b/Interval_skip_list/examples/Interval_skip_list/isl_terrain.cpp @@ -1,14 +1,14 @@ #include #include -#include +#include #include #include #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel EIK; +typedef CGAL::Exact_predicates_inexact_constructions_kernel EIK; typedef EIK::Point_3 Point_3; -typedef CGAL::Triangulation_euclidean_traits_xy_3 K; +typedef CGAL::Projection_traits_xy_3 K; typedef CGAL::Delaunay_triangulation_2 Delaunay; typedef Delaunay::Face_handle Face_handle; typedef Delaunay::Finite_faces_iterator Finite_faces_iterator; diff --git a/Interval_skip_list/examples/Interval_skip_list/isl_terrain.pts b/Interval_skip_list/examples/Interval_skip_list/terrain.pts similarity index 100% rename from Interval_skip_list/examples/Interval_skip_list/isl_terrain.pts rename to Interval_skip_list/examples/Interval_skip_list/terrain.pts diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index e140f9d937e..510ebe2ff23 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -22,7 +22,7 @@ if ( CGAL_FOUND ) include( CGAL_CreateSingleSourceCGALProgram ) # use either Eigen or BLAS/LAPACK - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) find_package(LAPACK) if(LAPACK_FOUND) diff --git a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt index a4980f48440..16fb14ac289 100644 --- a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt @@ -22,7 +22,7 @@ if ( CGAL_FOUND ) include( CGAL_CreateSingleSourceCGALProgram ) # use either Eigen or BLAS/LAPACK - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) find_package(LAPACK) if(LAPACK_FOUND) diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex index 0ce9097582a..03c4bf3d933 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex @@ -198,6 +198,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}: \ccNestedType{Compute_squared_radius_2}{a model of \ccc{Kernel::ComputeSquaredRadius_2}} \ccGlue \ccNestedType{Compute_area_2}{a model of \ccc{Kernel::ComputeArea_2}} +\ccGlue +\ccNestedType{Compute_determinant_2}{a model of \ccc{Kernel::ComputeDeterminant_2}} \ccHeading{Generalized Predicates} @@ -225,7 +227,7 @@ If the result type is a number type, the prefix is \ccc{Compute_}: \ccGlue \ccNestedType{Compare_xy_2}{a model of \ccc{Kernel::CompareXY_2}} \ccGlue -\ccNestedType{Compare_xy_2}{a model of \ccc{Kernel::CompareYX_2}} +\ccNestedType{Compare_yx_2}{a model of \ccc{Kernel::CompareYX_2}} \ccGlue \ccNestedType{Compare_y_at_x_2}{a model of \ccc{Kernel::CompareYAtX_2}} \ccGlue @@ -443,6 +445,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}: \ccGlue \ccNestedType{Compute_approximate_area_3}{a model of \ccc{Kernel::ComputeApproximateArea_3}} \ccGlue +\ccNestedType{Compute_determinant_3}{a model of \ccc{Kernel::ComputeDeterminant_3}} +\ccGlue \ccNestedType{Compute_squared_distance_3}{a model of \ccc{Kernel::ComputeSquaredDistance_3}} \ccGlue \ccNestedType{Compute_squared_length_3}{a model of \ccc{Kernel::ComputeSquaredLength_3}} diff --git a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex index 8cd6320dbdd..0e6ddab751e 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/intersection.tex @@ -37,27 +37,48 @@ following: \hline type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ \hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Iso_rectangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Iso_rectangle_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \\ \ccStyle{Triangle_2} + \\ \ccStyle{std::vector} + \vspace{1 mm}} \\ +\hline \ccStyle{Line_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Line_2} \vspace{1 mm}} \\ \hline -\ccStyle{Segment_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Segment_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Ray_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Line_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Ray_2} \vspace{1 mm}} \\ \hline -\ccStyle{Ray_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Line_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Line_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ @@ -68,17 +89,22 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ \\ \ccStyle{Ray_2} \vspace{1 mm}} \\ \hline -\ccStyle{Triangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Ray_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ \hline -\ccStyle{Triangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Ray_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ \hline -\ccStyle{Triangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Segment_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Segment_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_2} \\ \ccStyle{Segment_2} \vspace{1 mm}} \\ @@ -90,25 +116,6 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ \\ \ccStyle{std::vector} \vspace{1 mm}} \\ \hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Point_2} - \\ \ccStyle{Segment_2} - \vspace{1 mm}} \\ -\hline -\ccStyle{Iso_rectangle_2} & \ccStyle{Iso_rectangle_2} & \parbox{4 cm}{\vspace{1 mm} - \ccStyle{Iso_rectangle_2} - \vspace{1 mm}} \\ -\hline {\ccStyle{Line_3}} & {\ccStyle{Line_3}} & \parbox{4 cm}{\vspace{1 mm} \ccStyle{Point_3} \\ \ccStyle{Line_3} @@ -209,6 +216,48 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
type B return type
Iso_rectangle_2 Iso_rectangle_2 + +
Iso_rectangle_2
Iso_rectangle_2 Line_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Ray_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Segment_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Triangle_2 + + + + +
Point_2
Segment_2
Triangle_2
std::vector<Point_2>
Line_2 Line_2
- Segment_2 Line_2 - - - -
Point_2
Segment_2
- - - Segment_2 - Segment_2 - - - -
Point_2
Segment_2
- - Ray_2 - Line_2
Point_2
Ray_2
- Ray_2 + Line_2 Segment_2
Point_2
Segment_2
+ + Line_2 + Triangle_2 + + + +
Point_2
Segment_2
+ Ray_2 Ray_2 @@ -259,15 +300,7 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ - Triangle_2 - Line_2 - - - -
Point_2
Segment_2
- - - Triangle_2 + Ray_2 Segment_2 @@ -275,8 +308,24 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
Point_2
- Triangle_2 Ray_2 + Triangle_2 + + + +
Point_2
Segment_2
+ + + Segment_2 + Segment_2 + + + +
Point_2
Segment_2
+ + + Segment_2 + Triangle_2 @@ -292,37 +341,6 @@ type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\
Point_2
Segment_2
std::vector<Point_2>
- - Iso_rectangle_2 - Line_2 - - - -
Point_2
Segment_2
- - - Iso_rectangle_2 - Segment_2 - - - -
Point_2
Segment_2
- - - Iso_rectangle_2 - Ray_2 - - - -
Point_2
Segment_2
- - - Iso_rectangle_2 - Iso_rectangle_2 - - -
Iso_rectangle_2
- Line_3 Line_3 diff --git a/Kernel_23/doc_tex/Kernel_23_ref/main.tex b/Kernel_23/doc_tex/Kernel_23_ref/main.tex index 113fad7f3c1..c03ce6ff8a4 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/main.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/main.tex @@ -228,6 +228,7 @@ in the kernel. \clearpage \section{Kernel Geometric Object Concepts} \input{Kernel_23_ref/Kernel_Circle_2.tex} +\input{Kernel_23_ref/Kernel_Circle_3.tex} \input{Kernel_23_ref/Kernel_Direction_2.tex} \input{Kernel_23_ref/Kernel_Direction_3.tex} \input{Kernel_23_ref/Kernel_IsoCuboid_3.tex} @@ -266,7 +267,6 @@ in the kernel. \input{Kernel_23_ref/Kernel_Assign_3.tex} \input{Kernel_23_ref/Kernel_BoundedSide_2.tex} \input{Kernel_23_ref/Kernel_BoundedSide_3.tex} -\input{Kernel_23_ref/Kernel_Circle_3.tex} \input{Kernel_23_ref/Kernel_CollinearAreOrderedAlongLine_2.tex} \input{Kernel_23_ref/Kernel_CollinearAreOrderedAlongLine_3.tex} \input{Kernel_23_ref/Kernel_CollinearAreStrictlyOrderedAlongLine_2.tex} diff --git a/Kernel_23/include/CGAL/Circle_2.h b/Kernel_23/include/CGAL/Circle_2.h index 6bfe2864d03..e8279ff6dc1 100644 --- a/Kernel_23/include/CGAL/Circle_2.h +++ b/Kernel_23/include/CGAL/Circle_2.h @@ -95,13 +95,13 @@ public: Circle_2(const Point_2 & center) : RCircle_2(typename R::Construct_circle_2()(Return_base_tag(), center, FT(0), COUNTERCLOCKWISE)) {} - typename Qualified_result_of::type + typename boost::result_of::type center() const { return R().construct_center_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type squared_radius() const { return R().compute_squared_radius_2_object()(*this); diff --git a/Kernel_23/include/CGAL/Circle_3.h b/Kernel_23/include/CGAL/Circle_3.h index 0f82025e592..846a6791b02 100644 --- a/Kernel_23/include/CGAL/Circle_3.h +++ b/Kernel_23/include/CGAL/Circle_3.h @@ -101,8 +101,8 @@ public: Circle_3(const Rep& r) : Rep(r) {} - typename Qualified_result_of - ::type + typename boost::result_of + ::type diametral_sphere() const { return typename R::Construct_sphere_3()(*this); @@ -118,8 +118,8 @@ public: return typename R::Construct_sphere_3()(*this).squared_radius(); } - typename Qualified_result_of - ::type + typename boost::result_of + ::type supporting_plane() const { return typename R::Construct_plane_3()(*this); diff --git a/Kernel_23/include/CGAL/Direction_2.h b/Kernel_23/include/CGAL/Direction_2.h index 3ca857319ab..3b8d5533caf 100644 --- a/Kernel_23/include/CGAL/Direction_2.h +++ b/Kernel_23/include/CGAL/Direction_2.h @@ -98,19 +98,19 @@ public: return R().construct_perpendicular_direction_2_object()(*this,o); } - typename Qualified_result_of::type + typename boost::result_of::type dx() const { return R().compute_dx_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type dy() const { return R().compute_dy_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type delta(int i) const { CGAL_kernel_precondition( ( i == 0 ) || ( i == 1 ) ); diff --git a/Kernel_23/include/CGAL/Direction_3.h b/Kernel_23/include/CGAL/Direction_3.h index 1fb9410f8f1..511eebb48cb 100644 --- a/Kernel_23/include/CGAL/Direction_3.h +++ b/Kernel_23/include/CGAL/Direction_3.h @@ -104,25 +104,25 @@ public: Vector_3 vector() const { return to_vector(); } - typename Qualified_result_of::type + typename boost::result_of::type dx() const { return R().compute_dx_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type dy() const { return R().compute_dy_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type dz() const { return R().compute_dz_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type delta(int i) const { CGAL_kernel_precondition( i >= 0 && i <= 2 ); diff --git a/Kernel_23/include/CGAL/Iso_cuboid_3.h b/Kernel_23/include/CGAL/Iso_cuboid_3.h index 95bb36bf89f..5c7102f124f 100644 --- a/Kernel_23/include/CGAL/Iso_cuboid_3.h +++ b/Kernel_23/include/CGAL/Iso_cuboid_3.h @@ -90,75 +90,67 @@ public: : Rep(typename R::Construct_iso_cuboid_3()(Return_base_tag(), min_hx, min_hy, min_hz, max_hx, max_hy, max_hz)) {} -// TODO FIXME : why is Qrt not working here ? -// TODO : the Cartesian and Homogeneous functors should be split here -// given that the Qrt differs. -// (or is the Homogeneous optimization simply not worth it ?) - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_min_vertex_3_object()(*this); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_max_vertex_3_object()(*this); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type vertex(int i) const { return R().construct_vertex_3_object()(*this,i); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type operator[](int i) const { return R().construct_vertex_3_object()(*this,i); } - typename Qualified_result_of::type + typename boost::result_of::type xmin() const { return R().compute_xmin_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type xmax() const { return R().compute_xmax_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type ymin() const { return R().compute_ymin_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type ymax() const { return R().compute_ymax_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type zmin() const { return R().compute_zmin_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type zmax() const { return R().compute_zmax_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type min_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 || i == 2 ); @@ -170,7 +162,7 @@ public: return zmin(); } - typename Qualified_result_of::type + typename boost::result_of::type max_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 || i == 2 ); @@ -218,7 +210,7 @@ public: return R().is_degenerate_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type volume() const { return R().compute_volume_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Iso_rectangle_2.h b/Kernel_23/include/CGAL/Iso_rectangle_2.h index f13381a12e3..5dea113923b 100644 --- a/Kernel_23/include/CGAL/Iso_rectangle_2.h +++ b/Kernel_23/include/CGAL/Iso_rectangle_2.h @@ -87,13 +87,13 @@ public: : Rep(typename R::Construct_iso_rectangle_2()(Return_base_tag(), min_hx, min_hy, max_hx, max_hy, hw)) {} - typename Qualified_result_of::type + typename boost::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_min_vertex_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return R().construct_max_vertex_2_object()(*this); @@ -112,43 +112,43 @@ public: } - typename Qualified_result_of::type + typename boost::result_of::type vertex(int i) const { return R().construct_vertex_2_object()(*this,i); } - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const { return R().construct_vertex_2_object()(*this,i); } - typename Qualified_result_of::type + typename boost::result_of::type xmin() const { return R().compute_xmin_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type xmax() const { return R().compute_xmax_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type ymin() const { return R().compute_ymin_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type ymax() const { return R().compute_ymax_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type min_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 ); @@ -158,7 +158,7 @@ public: return ymin(); } - typename Qualified_result_of::type + typename boost::result_of::type max_coord(int i) const { CGAL_kernel_precondition( i == 0 || i == 1 ); diff --git a/Kernel_23/include/CGAL/Kernel/Type_mapper.h b/Kernel_23/include/CGAL/Kernel/Type_mapper.h index 0fc8f6e7334..ac217612db9 100644 --- a/Kernel_23/include/CGAL/Kernel/Type_mapper.h +++ b/Kernel_23/include/CGAL/Kernel/Type_mapper.h @@ -26,28 +26,38 @@ #define CGAL_KERNEL_TYPE_MAPPER_H #include +#include +#include namespace CGAL { +namespace internal { + template + struct Type_mapper_impl { + typedef T type; + }; + +// Then we specialize for all kernel objects. +#define CGAL_Kernel_obj(X) \ + template < typename K1, typename K2 > \ + struct Type_mapper_impl < typename K1::X, K1, K2 > \ + { typedef typename K2::X type; }; + +#include + +} // internal + // This is a tool to obtain the K2::Point_2 from K1 and K1::Point_2. // Similarly for other kernel types. // TODO : add more specializations ? Use a different mechanism ? template < typename T, typename K1, typename K2 > -struct Type_mapper -{ - typedef T type; // By default, assume same type (e.g. Object). -}; - -// Then we specialize for all kernel objects. - -#define CGAL_Kernel_obj(X) \ - template < typename K1, typename K2 > \ - struct Type_mapper < typename K1::X, K1, K2 > \ - { typedef typename K2::X type; }; - -#include +struct Type_mapper : + internal::Type_mapper_impl< typename boost::remove_cv< + typename boost::remove_reference < T >::type + >::type, K1, K2 > +{ }; } //namespace CGAL diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index b80d4045b50..8939078661f 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -766,32 +766,32 @@ namespace CommonKernelFunctors { }; template - class Construct_center_2 : Has_qrt + class Construct_center_2 { typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; public: - typedef Point_2 result_type; + typedef const Point_2& result_type; - const Point_2 & + result_type operator()(const Circle_2& c) const { return c.rep().center(); } }; template - class Construct_center_3 : Has_qrt + class Construct_center_3 { typedef typename K::Point_3 Point_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Circle_3 Circle_3; public: - typedef Point_3 result_type; + typedef const Point_3& result_type; - const Point_3 & + result_type operator()(const Sphere_3& s) const { return s.rep().center(); } - const Point_3 & + result_type operator()(const Circle_3& c) const { return c.rep().center(); } @@ -1064,38 +1064,38 @@ namespace CommonKernelFunctors { }; template - class Construct_max_vertex_2 : Has_qrt + class Construct_max_vertex_2 { typedef typename K::Point_2 Point_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef Point_2 result_type; + typedef const Point_2& result_type; - const Point_2& + result_type operator()(const Iso_rectangle_2& r) const { return (r.rep().max)(); } - const Point_2& + result_type operator()(const Segment_2& s) const { return (s.max)(); } }; template - class Construct_min_vertex_2 : Has_qrt + class Construct_min_vertex_2 { typedef typename K::Point_2 Point_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef Point_2 result_type; + typedef const Point_2& result_type; - const Point_2& + result_type operator()(const Iso_rectangle_2& r) const { return (r.rep().min)(); } - const Point_2& + result_type operator()(const Segment_2& s) const { return (s.min)(); } }; @@ -1109,13 +1109,13 @@ namespace CommonKernelFunctors { typedef typename K::Segment_3 Segment_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; public: - typedef Point_3 result_type; + typedef const Point_3& result_type; - Point_3 + result_type operator()(const Iso_cuboid_3& r) const { return (r.rep().max)(); } - const Point_3& + result_type operator()(const Segment_3& s) const { return (s.rep().max)(); } }; @@ -1127,13 +1127,13 @@ namespace CommonKernelFunctors { typedef typename K::Segment_3 Segment_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; public: - typedef Point_3 result_type; + typedef const Point_3& result_type; - Point_3 + result_type operator()(const Iso_cuboid_3& r) const { return (r.rep().min)(); } - const Point_3& + result_type operator()(const Segment_3& s) const { return (s.rep().min)(); } }; @@ -1633,83 +1633,83 @@ namespace CommonKernelFunctors { template - class Construct_source_2 : Has_qrt + class Construct_source_2 { typedef typename K::Segment_2 Segment_2; typedef typename K::Ray_2 Ray_2; typedef typename K::Point_2 Point_2; public: - typedef Point_2 result_type; + typedef const Point_2& result_type; - const result_type& + result_type operator()(const Segment_2& s) const { return s.rep().source(); } - const result_type& + result_type operator()(const Ray_2& r) const { return r.rep().source(); } }; template - class Construct_source_3 : Has_qrt + class Construct_source_3 { typedef typename K::Segment_3 Segment_3; typedef typename K::Ray_3 Ray_3; typedef typename K::Point_3 Point_3; public: - typedef Point_3 result_type; + typedef const Point_3& result_type; - const result_type& + result_type operator()(const Segment_3& s) const { return s.rep().source(); } - const result_type& + result_type operator()(const Ray_3& r) const { return r.rep().source(); } }; template - class Construct_target_2 : Has_qrt + class Construct_target_2 { typedef typename K::Segment_2 Segment_2; typedef typename K::Point_2 Point_2; public: - typedef Point_2 result_type; + typedef const Point_2& result_type; - const result_type& + result_type operator()(const Segment_2& s) const { return s.rep().target(); } }; template - class Construct_target_3 : Has_qrt + class Construct_target_3 { typedef typename K::Segment_3 Segment_3; typedef typename K::Point_3 Point_3; public: - typedef Point_3 result_type; + typedef const Point_3& result_type; - const result_type& + result_type operator()(const Segment_3& s) const { return s.rep().target(); } }; template - class Construct_second_point_2 : Has_qrt + class Construct_second_point_2 { typedef typename K::Ray_2 Ray_2; typedef typename K::Point_2 Point_2; public: - typedef Point_2 result_type; + typedef const Point_2& result_type; - const result_type& + result_type operator()(const Ray_2& r) const { return r.rep().second_point(); } }; template - class Construct_second_point_3 // : Has_qrt + class Construct_second_point_3 { typedef typename K::Ray_3 Ray_3; typedef typename K::Point_3 Point_3; @@ -1881,7 +1881,7 @@ namespace CommonKernelFunctors { }; template - class Construct_vertex_3 : Has_qrt + class Construct_vertex_3 { typedef typename K::Point_3 Point_3; typedef typename K::Segment_3 Segment_3; @@ -1889,21 +1889,29 @@ namespace CommonKernelFunctors { typedef typename K::Triangle_3 Triangle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; public: - typedef Point_3 result_type; + template + struct result { + typedef const Point_3& type; + }; - const Point_3 & + template + struct result { + typedef Point_3 type; + }; + + const Point_3& operator()( const Segment_3& s, int i) const { return s.rep().vertex(i); } - const Point_3 & + const Point_3& operator()( const Triangle_3& t, int i) const { return t.rep().vertex(i); } Point_3 operator()( const Iso_cuboid_3& r, int i) const - { return r.rep().vertex(i); } + { return r.rep().vertex(i); } - const Point_3 & + const Point_3& operator()( const Tetrahedron_3& t, int i) const { return t.rep().vertex(i); } }; @@ -2755,12 +2763,6 @@ namespace CommonKernelFunctors { }; } // namespace CommonKernelFunctors - - template - struct Qualified_result_of,Iso_cuboid_3 > : - qrt_or_not,false> - {}; - } //namespace CGAL #endif // CGAL_KERNEL_FUNCTION_OBJECTS_H diff --git a/Kernel_23/include/CGAL/Kernel_checker.h b/Kernel_23/include/CGAL/Kernel_checker.h index bed6cdab64c..5b1f2d00ffb 100644 --- a/Kernel_23/include/CGAL/Kernel_checker.h +++ b/Kernel_23/include/CGAL/Kernel_checker.h @@ -236,7 +236,7 @@ public: struct dont_check_equal { template < typename T1, typename T2 > - bool operator()(const T1 &t1, const T2 &t2) const + bool operator()(const T1 & /* t1 */, const T2 &/*t2*/) const { return true; } template < typename T > bool operator()(const T &t1, const T &t2) const diff --git a/Kernel_23/include/CGAL/Kernel_traits.h b/Kernel_23/include/CGAL/Kernel_traits.h index 065b32dd94a..2ab73d5a12a 100644 --- a/Kernel_23/include/CGAL/Kernel_traits.h +++ b/Kernel_23/include/CGAL/Kernel_traits.h @@ -31,6 +31,7 @@ template struct Kernel_traits { typedef typename T::R Kernel; + typedef Kernel type; }; } // end namespace CGAL diff --git a/Kernel_23/include/CGAL/Plane_3.h b/Kernel_23/include/CGAL/Plane_3.h index 39018b2e12c..a7e76834688 100644 --- a/Kernel_23/include/CGAL/Plane_3.h +++ b/Kernel_23/include/CGAL/Plane_3.h @@ -113,25 +113,25 @@ public: return Direction_3(a(), b(), c()); } - typename Qualified_result_of::type + typename boost::result_of::type a() const { return R().compute_a_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type b() const { return R().compute_b_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type c() const { return R().compute_c_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type d() const { return R().compute_d_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Point_2.h b/Kernel_23/include/CGAL/Point_2.h index a7c53ee5a05..fde20f8c606 100644 --- a/Kernel_23/include/CGAL/Point_2.h +++ b/Kernel_23/include/CGAL/Point_2.h @@ -85,26 +85,26 @@ public: : RPoint_2(typename R::Construct_point_2()(Return_base_tag(), hx, hy, hw)) {} - typename Qualified_result_of::type + typename boost::result_of::type x() const { return typename R::Compute_x_2()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type y() const { return typename R::Compute_y_2()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) ); return (i==0) ? x() : y(); } - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const { return cartesian(i); @@ -122,19 +122,19 @@ public: - typename Qualified_result_of::type + typename boost::result_of::type hx() const { return typename R::Compute_hx_2()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hy() const { return typename R::Compute_hy_2()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hw() const { return typename R::Compute_hw_2()(*this); @@ -145,7 +145,7 @@ public: return 2; } - typename Qualified_result_of::type + typename boost::result_of::type homogeneous(int i) const { CGAL_kernel_precondition( (i >= 0) || (i <= 2) ); diff --git a/Kernel_23/include/CGAL/Point_3.h b/Kernel_23/include/CGAL/Point_3.h index c18a1e5ec5c..82ee3090254 100644 --- a/Kernel_23/include/CGAL/Point_3.h +++ b/Kernel_23/include/CGAL/Point_3.h @@ -31,7 +31,6 @@ #include #include #include -#include #include namespace CGAL { @@ -85,49 +84,49 @@ public: : Rep(typename R::Construct_point_3()(Return_base_tag(), hx, hy, hz, hw)) {} - typename Qualified_result_of::type + typename boost::result_of::type x() const { return typename R::Compute_x_3()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type y() const { return typename R::Compute_y_3()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type z() const { return typename R::Compute_z_3()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hx() const { return R().compute_hx_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hy() const { return R().compute_hy_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hz() const { return R().compute_hz_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hw() const { return R().compute_hw_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) || (i == 2) ); @@ -146,7 +145,7 @@ public: return hw(); } - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const { return cartesian(i); diff --git a/Kernel_23/include/CGAL/Ray_2.h b/Kernel_23/include/CGAL/Ray_2.h index f78ebcc189c..a0a988c55ba 100644 --- a/Kernel_23/include/CGAL/Ray_2.h +++ b/Kernel_23/include/CGAL/Ray_2.h @@ -86,13 +86,13 @@ public: : RRay_2(typename R::Construct_ray_2()(Return_base_tag(), sp, l)) {} - typename Qualified_result_of::type + typename boost::result_of::type source() const { return R().construct_source_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type second_point() const { return R().construct_second_point_2_object()(*this); @@ -116,7 +116,7 @@ public: } - typename Qualified_result_of::type + typename boost::result_of::type start() const { return source(); diff --git a/Kernel_23/include/CGAL/Ray_3.h b/Kernel_23/include/CGAL/Ray_3.h index d1241cb9d00..b53b37ad516 100644 --- a/Kernel_23/include/CGAL/Ray_3.h +++ b/Kernel_23/include/CGAL/Ray_3.h @@ -105,25 +105,25 @@ public: bool collinear_has_on(const Point_3 &p) const; */ - Point_3 point(int i) const // TODO : use Qrt + typename boost::result_of::type + point(int i) const // TODO : use Qrt { return R().construct_point_on_3_object()(*this, i); } - // FIXME : Use Qrt - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type source() const { return R().construct_source_3_object()(*this); } - Point_3 second_point() const // TODO : use Qrt + typename boost::result_of::type + second_point() const { return R().construct_second_point_3_object()(*this); } - Point_3 // FIXME : Use Qrt + typename boost::result_of::type start() const { return source(); diff --git a/Kernel_23/include/CGAL/Segment_2.h b/Kernel_23/include/CGAL/Segment_2.h index f44f67c63f9..4cae9992148 100644 --- a/Kernel_23/include/CGAL/Segment_2.h +++ b/Kernel_23/include/CGAL/Segment_2.h @@ -76,44 +76,44 @@ public: Segment_2(const Point_2 &sp, const Point_2 &ep) : RSegment_2(typename R::Construct_segment_2()(Return_base_tag(), sp,ep)) {} - typename Qualified_result_of::type + typename boost::result_of::type source() const { return R_().construct_source_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type target() const { return R_().construct_target_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type start() const { return source(); } - typename Qualified_result_of::type + typename boost::result_of::type end() const { return target(); } - typename Qualified_result_of::type + typename boost::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const; - typename Qualified_result_of::type + typename boost::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const; - typename Qualified_result_of::type + typename boost::result_of::type vertex(int i) const; - typename Qualified_result_of::type + typename boost::result_of::type point(int i) const; - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const; bool is_horizontal() const; @@ -178,7 +178,7 @@ public: template < class R_ > CGAL_KERNEL_INLINE -typename Qualified_result_of >::type +typename boost::result_of )>::type Segment_2::min BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xy_2 less_xy; @@ -187,7 +187,7 @@ Segment_2::min BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -typename Qualified_result_of >::type +typename boost::result_of )>::type Segment_2::max BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xy_2 less_xy; @@ -196,7 +196,7 @@ Segment_2::max BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -typename Qualified_result_of, int >::type +typename boost::result_of, int )>::type Segment_2::vertex(int i) const { return (i%2 == 0) ? source() : target(); @@ -204,7 +204,7 @@ Segment_2::vertex(int i) const template < class R_ > inline -typename Qualified_result_of, int >::type +typename boost::result_of, int )>::type Segment_2::point(int i) const { return vertex(i); @@ -212,7 +212,7 @@ Segment_2::point(int i) const template < class R_ > inline -typename Qualified_result_of, int >::type +typename boost::result_of, int )>::type Segment_2::operator[](int i) const { return vertex(i); diff --git a/Kernel_23/include/CGAL/Segment_3.h b/Kernel_23/include/CGAL/Segment_3.h index 2d8fa6008be..3777752ec64 100644 --- a/Kernel_23/include/CGAL/Segment_3.h +++ b/Kernel_23/include/CGAL/Segment_3.h @@ -74,54 +74,44 @@ public: Segment_3(const Point_3& sp, const Point_3& ep) : Rep(typename R::Construct_segment_3()(Return_base_tag(), sp, ep)) {} -// FIXME TODO : Use Qrt here ! - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type source() const { return R_().construct_source_3_object()(*this); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type target() const { return R_().construct_target_3_object()(*this); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type start() const { return source(); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type end() const { return target(); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type min BOOST_PREVENT_MACRO_SUBSTITUTION () const; - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type max BOOST_PREVENT_MACRO_SUBSTITUTION () const; - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type vertex(int i) const; - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type point(int i) const { return vertex(i); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type operator[](int i) const { return vertex(i); } @@ -179,8 +169,7 @@ public: template < class R_ > CGAL_KERNEL_INLINE -//typename Qualified_result_of >::type -typename R_::Point_3 +typename boost::result_of ) >::type Segment_3::min BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xyz_3 less_xyz; @@ -189,8 +178,7 @@ Segment_3::min BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -//typename Qualified_result_of >::type -typename R_::Point_3 +typename boost::result_of ) >::type Segment_3::max BOOST_PREVENT_MACRO_SUBSTITUTION () const { typename R_::Less_xyz_3 less_xyz; @@ -199,8 +187,7 @@ Segment_3::max BOOST_PREVENT_MACRO_SUBSTITUTION () const template < class R_ > CGAL_KERNEL_INLINE -//typename Qualified_result_of, int >::type -typename R_::Point_3 +typename boost::result_of, int ) >::type Segment_3::vertex(int i) const { return (i%2 == 0) ? source() : target(); diff --git a/Kernel_23/include/CGAL/Sphere_3.h b/Kernel_23/include/CGAL/Sphere_3.h index 621189239bd..0ff186ce44b 100644 --- a/Kernel_23/include/CGAL/Sphere_3.h +++ b/Kernel_23/include/CGAL/Sphere_3.h @@ -94,9 +94,7 @@ public: Sphere_3 orthogonal_transform(const Aff_transformation_3 &t) const; - // FIXME : why doesn't Qrt work here ? We loose optimization ! - //typename Qualified_result_of::type - Point_3_ + typename boost::result_of::type center() const { return R().construct_center_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Tetrahedron_3.h b/Kernel_23/include/CGAL/Tetrahedron_3.h index 06c87448f04..d03ae1d5088 100644 --- a/Kernel_23/include/CGAL/Tetrahedron_3.h +++ b/Kernel_23/include/CGAL/Tetrahedron_3.h @@ -78,16 +78,13 @@ public: t.transform(this->vertex(3))); } - // FIXME TODO : Why doesn't Qrt work here ??? - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type vertex(int i) const { return R().construct_vertex_3_object()(*this,i); } - //typename Qualified_result_of::type - Point_3 + typename boost::result_of::type operator[](int i) const { return vertex(i); @@ -139,7 +136,7 @@ public: return R().has_on_unbounded_side_3_object()(*this, p); } - typename Qualified_result_of::type + typename boost::result_of::type volume() const { return R().compute_volume_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Triangle_2.h b/Kernel_23/include/CGAL/Triangle_2.h index 94d903f8a3f..46251f19b5d 100644 --- a/Kernel_23/include/CGAL/Triangle_2.h +++ b/Kernel_23/include/CGAL/Triangle_2.h @@ -107,13 +107,13 @@ public: return !(*this == t); } - typename Qualified_result_of::type + typename boost::result_of::type vertex(int i) const { return R().construct_vertex_2_object()(*this,i); } - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const { return vertex(i); diff --git a/Kernel_23/include/CGAL/Triangle_3.h b/Kernel_23/include/CGAL/Triangle_3.h index 9ec2cd25500..ee1dc80d86f 100644 --- a/Kernel_23/include/CGAL/Triangle_3.h +++ b/Kernel_23/include/CGAL/Triangle_3.h @@ -90,13 +90,13 @@ public: } - typename Qualified_result_of::type + typename boost::result_of::type vertex(int i) const { return R().construct_vertex_3_object()(*this, i); } - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const { return vertex(i); diff --git a/Kernel_23/include/CGAL/Vector_2.h b/Kernel_23/include/CGAL/Vector_2.h index 8c11272e5ff..80b7ee70001 100644 --- a/Kernel_23/include/CGAL/Vector_2.h +++ b/Kernel_23/include/CGAL/Vector_2.h @@ -99,26 +99,26 @@ public: : RVector_2(typename R::Construct_vector_2()(Return_base_tag(), x,y,w)) {} - typename Qualified_result_of::type + typename boost::result_of::type x() const { return R().compute_x_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type y() const { return R().compute_y_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) ); return (i==0) ? x() : y(); } - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const { return cartesian(i); @@ -134,26 +134,26 @@ public: return typename R::Construct_cartesian_const_iterator_2()(*this,2); } - typename Qualified_result_of::type + typename boost::result_of::type hx() const { return R().compute_hx_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hy() const { return R().compute_hy_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hw() const { return R().compute_hw_2_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type homogeneous(int i) const { CGAL_kernel_precondition( (i >= 0) || (i <= 2) ); diff --git a/Kernel_23/include/CGAL/Vector_3.h b/Kernel_23/include/CGAL/Vector_3.h index c4a17994f55..fe1c2b865a9 100644 --- a/Kernel_23/include/CGAL/Vector_3.h +++ b/Kernel_23/include/CGAL/Vector_3.h @@ -133,49 +133,49 @@ public: return R().construct_divided_vector_3_object()(*this,c); } - typename Qualified_result_of::type + typename boost::result_of::type x() const { return R().compute_x_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type y() const { return R().compute_y_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type z() const { return R().compute_z_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hx() const { return R().compute_hx_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hy() const { return R().compute_hy_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hz() const { return R().compute_hz_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type hw() const { return R().compute_hw_3_object()(*this); } - typename Qualified_result_of::type + typename boost::result_of::type cartesian(int i) const { CGAL_kernel_precondition( (i == 0) || (i == 1) || (i == 2) ); @@ -184,7 +184,7 @@ public: return z(); } - typename Qualified_result_of::type + typename boost::result_of::type homogeneous(int i) const { CGAL_kernel_precondition( (i >= 0) || (i <= 3) ); @@ -199,7 +199,7 @@ public: return 3; } - typename Qualified_result_of::type + typename boost::result_of::type operator[](int i) const { return cartesian(i); @@ -215,7 +215,7 @@ public: return typename R::Construct_cartesian_const_iterator_3()(*this,3); } - typename Qualified_result_of::type + typename boost::result_of::type squared_length() const { return R().compute_squared_length_3_object()(*this); diff --git a/Kernel_23/include/CGAL/basic.h b/Kernel_23/include/CGAL/basic.h index 275cecdfc94..e05c6e3b28a 100644 --- a/Kernel_23/include/CGAL/basic.h +++ b/Kernel_23/include/CGAL/basic.h @@ -31,6 +31,14 @@ #include #include +// This cannot be disabled for now until we have a clear idea which +// compilers implement N3276. + +// #if !defined(CGAL_CFG_NO_CPP0X_DECLTYPE) +// #define BOOST_RESULT_OF_USE_DECLTYPE +// #endif +#include + #include #include #include diff --git a/Kernel_23/include/CGAL/internal/Projection_traits_3.h b/Kernel_23/include/CGAL/internal/Projection_traits_3.h index 4d152acda3e..8aa46bca30b 100644 --- a/Kernel_23/include/CGAL/internal/Projection_traits_3.h +++ b/Kernel_23/include/CGAL/internal/Projection_traits_3.h @@ -225,6 +225,13 @@ public: 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()); @@ -244,15 +251,15 @@ public: const Segment_2* si=CGAL::object_cast(&o); if (si==NULL) return Object(); FT src[3],tgt[3]; - tgt[dim] = src[dim] = FT(0); //the third coordinate is the midpoint between the points on s1 and s2 - - FT z1 = s1.source()[dim] + ( si->source().x()-s1_source.x() ) / (s1_target.x() - s1_source.x()) * ( s1.target()[dim] - s1.source()[dim] ); - FT z2 = s2.source()[dim] + ( si->source().x()-s2_source.x() ) / (s2_target.x() - s2_source.x()) * ( s2.target()[dim] - s2.source()[dim] ); + //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] + ( si->target().x()-s1_source.x() ) / (s1_target.x() - s1_source.x()) * ( s1.target()[dim] - s1.source()[dim] ); - z2 = s2.source()[dim] + ( si->target().x()-s2_source.x() ) / (s2_target.x() - s2_source.x()) * ( s2.target()[dim] - s2.source()[dim] ); + 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); @@ -264,8 +271,8 @@ public: } FT coords[3]; //compute the third coordinate of the projected intersection point onto 3D segments - FT z1 = s1.source()[dim] + ( pi->x()-s1_source.x() ) / (s1_target.x() - s1_source.x()) * ( s1.target()[dim] - s1.source()[dim] ); - FT z2 = s2.source()[dim] + ( pi->x()-s2_source.x() ) / (s2_target.x() - s2_source.x()) * ( s2.target()[dim] - s2.source()[dim] ); + 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(); diff --git a/Kernel_23/include/CGAL/kernel_basic.h b/Kernel_23/include/CGAL/kernel_basic.h index d89730f47e2..ee3f4b37973 100644 --- a/Kernel_23/include/CGAL/kernel_basic.h +++ b/Kernel_23/include/CGAL/kernel_basic.h @@ -41,7 +41,6 @@ #include #include #include -#include #include #endif // CGAL_KERNEL_BASIC_H diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_Result_of_kernel.h b/Kernel_23/test/Kernel_23/include/CGAL/_Result_of_kernel.h new file mode 100644 index 00000000000..aa50b7eb781 --- /dev/null +++ b/Kernel_23/test/Kernel_23/include/CGAL/_Result_of_kernel.h @@ -0,0 +1,204 @@ +#ifndef CGAL_RESULT_OF_KERNEL_H +#define CGAL_RESULT_OF_KERNEL_H + +#include + +#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_STATIC_ASSERT) + +#define CGAL_RESULT_OF_KERNEL 1 + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + + +// Unfortunately this test is only an approximation. At this point +// boost::result_of behaves as C++11 result_of and we cannot force it +// back into an old mode thanks to the include guards. We instead use +// a TR1 implementation of result_of to compare the types. This is the +// best we can go for. + +namespace CGAL { + // avoid crashes with what we already have in namespace internal + namespace result_of_kernel { + // required for smooth wrapping of the functors + BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type) + BOOST_MPL_HAS_XXX_TRAIT_DEF(Rep) + + template + struct Lazy_is_same { + typedef boost::is_same type; + }; + + // trickery to get rid of the inequality that appears with the + // return_base_tag versions of construct calls + template, + typename + boost::mpl::eval_if< has_Rep, + Lazy_is_same, + boost::false_type >::type + >::value > + struct Rep_equal; + + template + struct Rep_equal : boost::true_type {}; + template + struct Rep_equal : boost::false_type {}; + } + + // This functor can wrap any DefaultConstructible functor. Iff there + // is a result_type typedef it needs to be forwarded. In all other + // cases boost::result_of is necessary to determine the return type. + template::value > + struct AnyFunctor; + + template + struct AnyFunctor { + typedef typename F::result_type result_type; + + template + auto operator()(Args&&... args) const -> typename std::result_of::type { + F f; + // check the equality of a c++03 std::tr1::result_of and a c++11 result_of + typedef typename std::result_of::type c11_return_type; + typedef typename F::result_type c03_return_type; + + static_assert((result_of_kernel::Rep_equal::value), + "Type difference between actual return type and boost::result_of<>::type"); + + return f(std::forward(args)...); + } + }; + + template + struct AnyFunctor { + template + struct result; + + template + struct result { + typedef typename boost::result_of::type type; + }; + + // same as above + template + auto operator()(Args&&... args) const -> typename std::result_of::type { + F f; + typedef typename std::result_of::type c11_return_type; + typedef typename std::tr1::result_of::type + >::type ... + )>::type c03_return_type; + + static_assert((result_of_kernel::Rep_equal::value), + "Type difference between actual return type and boost::result_of<>::type"); + + return f(std::forward(args)...); + } + }; + + // usual copy pasta from simple_cartesian and cartesian plus an + // template template parameter to inject the true base + template < typename RT_, typename FT_, typename Kernel_, template class Inject> + struct Result_of_base + : public Inject< RT_, FT_, Kernel_> + { + typedef RT_ RT; + typedef FT_ FT; + + // The mechanism that allows to specify reference-counting or not. + template < typename T > + struct Handle { typedef T type; }; + + template < typename Kernel2 > + struct Base { typedef Result_of_base Type; }; + }; + + // alias cartesian to something similar to Homogeneous. Requires gcc 4.7. + // NB. Kernel is either last of first argument to add a little more confusion. + + // template + // using Cartesian_base_3 = Cartesian_base; + + // hack instead + template + struct Cartesian_base_3 : public Cartesian_base { }; + + template < typename FT_, typename Kernel_ > + struct Result_of_cartesian_base : public Result_of_base + { + typedef Kernel_ K; + + #define CGAL_Kernel_pred(Y,Z) typedef CartesianKernelFunctors::Y Y; \ + Y Z() const { return Y(); } + #define CGAL_Kernel_cons(Y,Z) CGAL_Kernel_pred(Y,Z) + + #include + }; + + template < typename RT_, typename FT_, typename Kernel_ > + struct Result_of_homogeneous_base : public Result_of_base + { + typedef Kernel_ K; + + #define CGAL_Kernel_pred(Y,Z) typedef HomogeneousKernelFunctors::Y Y; \ + Y Z() const { return Y(); } + #define CGAL_Kernel_cons(Y,Z) CGAL_Kernel_pred(Y,Z) + + #include + }; + + template < typename FT_ > + struct Result_of_cartesian + : public Type_equality_wrapper< + Result_of_cartesian_base >, + Result_of_cartesian > + { + // this has to be delayed until here as AnyFunctor will + // instantiate its arguments and only here lookup for all the + // typedefs inside the functor will be possible + typedef Result_of_cartesian K; + #define CGAL_Kernel_pred(Y,Z) typedef AnyFunctor< CartesianKernelFunctors::Y > Y; \ + Y Z() const { return Y(); } + #define CGAL_Kernel_cons(Y,Z) CGAL_Kernel_pred(Y,Z) + + #include + }; + + // same as above + template < typename RT_, typename FT_ > + struct Result_of_homogeneous + : public Type_equality_wrapper< + Result_of_homogeneous_base >, + Result_of_homogeneous > + { + typedef Result_of_homogeneous K; + #define CGAL_Kernel_pred(Y,Z) typedef AnyFunctor< HomogeneousKernelFunctors::Y > Y; \ + Y Z() const { return Y(); } + #define CGAL_Kernel_cons(Y,Z) CGAL_Kernel_pred(Y,Z) + + #include + }; +} + +#endif /* C++11 GUARD */ +#endif /* CGAL_RESULT_OF_KERNEL_H */ diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_iso_cuboid_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_iso_cuboid_3.h index d36687a5b49..c1e911ff2c4 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_iso_cuboid_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_iso_cuboid_3.h @@ -100,6 +100,7 @@ _test_cls_iso_cuboid_3(const R& ) assert( (r2.max)() == p3 ); assert( r1.vertex(0) == p1 ); + assert( r1[0] == p1 ); assert( r1.vertex(1) == p5 ); assert( r1.vertex(2) == p10); assert( r1.vertex(3) == p11); diff --git a/Kernel_23/test/Kernel_23/test_Projection_traits_xy_3_Intersect_2.cpp b/Kernel_23/test/Kernel_23/test_Projection_traits_xy_3_Intersect_2.cpp new file mode 100644 index 00000000000..cebb0fe760a --- /dev/null +++ b/Kernel_23/test/Kernel_23/test_Projection_traits_xy_3_Intersect_2.cpp @@ -0,0 +1,41 @@ +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Epik; +typedef CGAL::Projection_traits_xy_3 K; + +typedef K::Orientation_2 Orientation_2; +typedef K::Intersect_2 Intersect_2; + +typedef K::Point_2 Point_2; +typedef K::Segment_2 Segment_2; +typedef CGAL::Object Object; + +int main() +{ + Point_2 p(0,0,0), q(1,1,1), r(1,0,0), s(0,1,1), t(0,1,0), u(0,1,-1); + Point_2 v(0.5, 0, 0), w(0.5,1,0); + + Segment_2 pq(p,q), rs(r,s), rt(r,t), ru(r,u), vw(v,w); + + Point_2 pqrs, pqrt, pqru, pqvw; + + Object o = Intersect_2()(pq,rs); + assert(assign(pqrs,o)); + assert(pqrs == Point_2(0.5, 0.5, 0.5)); + + o = Intersect_2()(pq,rt); + assert(assign(pqrt,o)); + assert(pqrt == Point_2(0.5, 0.5, 0.25)); + + o = Intersect_2()(pq,ru); + assert(assign(pqru,o)); + assert(pqru == Point_2(0.5, 0.5, 0)); + + o = Intersect_2()(pq,vw); + assert(assign(pqvw,o)); + assert(pqvw == Point_2(0.5, 0.5, 0.25)); + + std::cerr << "done" << std::endl; + return 0; +} diff --git a/Kernel_23/test/Kernel_23/test_result_of.cpp b/Kernel_23/test/Kernel_23/test_result_of.cpp new file mode 100644 index 00000000000..db467ed8452 --- /dev/null +++ b/Kernel_23/test/Kernel_23/test_result_of.cpp @@ -0,0 +1,48 @@ +// Copyright (c) 2011 GeometryFactory (France). All rights reserved. +// All rights reserved. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// 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; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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) : Philipp Moeller + +#include +#include +#include + +#include "CGAL/_Result_of_kernel.h" +#include "CGAL/_test_2.h" +#include "CGAL/_test_3.h" + +#include + +#include "CGAL/Precise_numbers.h" + +template +bool test(const K& k) { + return _test_2(k) && _test_3(k); +} + +int main() +{ +#if defined(CGAL_RESULT_OF_KERNEL) + typedef CGAL::Result_of_cartesian< CGAL::Quotient > A; + typedef CGAL::Result_of_homogeneous< Precise_integer, CGAL::Quotient > B; + + test( A() ); + test( B() ); +#endif + return 0; +} diff --git a/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex b/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex index 00116ee1002..4dde1fb02a4 100644 --- a/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex +++ b/Kernel_d/doc_tex/Kernel_d_ref/Kernel.tex @@ -53,6 +53,12 @@ replacing operators, especially for equality testing. \ccHeading{Constructions} +\ccNestedType{Barycentric_coordinates_d}{} +\ccGlue +\ccNestedType{Center_of_sphere_d}{a model of \ccc{Kernel::Center_of_sphere_d}} +\ccGlue +\ccNestedType{Compute_coordinate_d}{a model of \ccc{Kernel::Compute_coordinate_d}} +\ccGlue \ccNestedType{Construct_point_d}{} \ccGlue \ccNestedType{Construct_vector_d}{} @@ -73,78 +79,72 @@ replacing operators, especially for equality testing. \ccGlue \ccNestedType{Construct_aff_transformation_d}{} \ccGlue -\ccNestedType{Construct_cartesian_const_iterator_d}{} +\ccNestedType{Construct_cartesian_const_iterator_d}{a model of \ccc{Kernel::ConstructCartesianConstIterator_d}} +\ccGlue +\ccNestedType{Intersect_d}{a model of \ccc{Kernel::Intersect_d}} +\ccGlue +\ccNestedType{Lift_to_paraboloid_d}{a model of \ccc{Kernel::Lift_to_paraboloid_d}} +\ccGlue +\ccNestedType{Linear_base_d}{a model of \ccc{Kernel::Linear_base_d}} +\ccGlue +\ccNestedType{Midpoint_d}{a model of \ccc{Kernel::Midpoint_d}} +\ccGlue +\ccNestedType{Orthogonal_vector_d}{a model of \ccc{Kernel::Orthogonal_vector_d}} +\ccGlue +\ccNestedType{Point_of_sphere_d}{a model of \ccc{Kernel::Point_of_sphere_d}} +\ccGlue +\ccNestedType{Point_to_vector_d}{a model of \ccc{Kernel::Point_to_vector_d}} +\ccGlue +\ccNestedType{Project_along_d_axis_d}{a model of \ccc{Kernel::Project_along_d_axis_d}} +\ccGlue +\ccNestedType{Squared_distance_d}{a model of \ccc{Kernel::Squared_distance_d}} +\ccGlue +\ccNestedType{Value_at_d}{a model of \ccc{Kernel::Value_at_d}} +\ccGlue +\ccNestedType{Vector_to_point_d}{a model of \ccc{Kernel::Vector_to_point_d}} \ccGlue \ccHeading{Generalized Predicates} -\ccNestedType{Affine_rank_d}{} +\ccNestedType{Affine_rank_d}{a model of \ccc{Kernel::Affine_rank_d}} \ccGlue -\ccNestedType{Affinely_independent_d}{} +\ccNestedType{Affinely_independent_d}{a model of \ccc{Kernel::Affinely_independent_d}} \ccGlue -\ccNestedType{Barycentric_coordinates_d}{} +\ccNestedType{Compare_lexicographically_d}{a model of \ccc{Kernel::Compare_lexicographically_d}} \ccGlue -\ccNestedType{Center_of_sphere_d}{} +\ccNestedType{Component_accessor_d}{a model of \ccc{Kernel::Component_accessor_d}} \ccGlue -\ccNestedType{Compare_lexicographically_d}{} +\ccNestedType{Contained_in_affine_hull_d}{a model of \ccc{Kernel::Contained_in_affine_hull_d}} \ccGlue -\ccNestedType{Component_accessor_d}{} +\ccNestedType{Contained_in_linear_hull_d}{a model of \ccc{Kernel::Contained_in_linear_hull_d}} \ccGlue -\ccNestedType{Compute_coordinate_d}{} +\ccNestedType{Contained_in_simplex_d}{a model of \ccc{Kernel::Contained_in_simplex_d}} \ccGlue -\ccNestedType{Contained_in_affine_hull_d}{} +\ccNestedType{Equal_d}{a model of \ccc{Kernel::Equal_d}} \ccGlue -\ccNestedType{Contained_in_linear_hull_d}{} +\ccNestedType{Has_on_positive_side_d}{a model of \ccc{Kernel::Has_on_positive_side_d}} \ccGlue -\ccNestedType{Contained_in_simplex_d}{} +\ccNestedType{Less_coordinate_d}{a model of \ccc{Kernel::Less_coordinate_d}} \ccGlue -\ccNestedType{Equal_d}{} +\ccNestedType{Less_lexicographically_d}{a model of \ccc{Kernel::Less_lexicographically_d}} \ccGlue -\ccNestedType{Has_on_positive_side_d}{} +\ccNestedType{Less_or_equal_lexicographically_d}{a model of \ccc{Kernel::Less_or_equal_lexicographically_d}} \ccGlue -\ccNestedType{Intersect_d}{} +\ccNestedType{Linear_rank_d}{a model of \ccc{Kernel::Linear_rank_d}} \ccGlue -\ccNestedType{Less_lexicographically_d}{} +\ccNestedType{Linearly_independent_d}{a model of \ccc{Kernel::Linearly_independent_d}} \ccGlue -\ccNestedType{Less_or_equal_lexicographically_d}{} +\ccNestedType{Orientation_d}{a model of \ccc{Kernel::Orientation_d}} \ccGlue -\ccNestedType{Less_coordinate_d}{} +\ccNestedType{Oriented_side_d}{a model of \ccc{Kernel::Oriented_side_d}} \ccGlue -\ccNestedType{Lift_to_paraboloid_d}{} -\ccGlue -\ccNestedType{Linear_base_d}{} -\ccGlue -\ccNestedType{Linear_rank_d}{} -\ccGlue -\ccNestedType{Linearly_independent_d}{} -\ccGlue -\ccNestedType{Midpoint_d}{} -\ccGlue -\ccNestedType{Orientation_d}{} -\ccGlue -\ccNestedType{Oriented_side_d}{} -\ccGlue -\ccNestedType{Orthogonal_vector_d}{} -\ccGlue -\ccNestedType{Point_dimension_d}{} -\ccGlue -\ccNestedType{Point_of_sphere_d}{} -\ccGlue -\ccNestedType{Point_to_vector_d}{} +\ccNestedType{Point_dimension_d}{a model of \ccc{Kernel::Point_dimension_d}} \ccGlue \ccNestedType{Position_on_line_d}{} \ccGlue -\ccNestedType{Project_along_d_axis_d}{} +\ccNestedType{Side_of_bounded_sphere_d}{a model of \ccc{Kernel::Side_of_bounded_sphere_d}} \ccGlue -\ccNestedType{Side_of_bounded_sphere_d}{} -\ccGlue -\ccNestedType{Side_of_oriented_sphere_d}{} -\ccGlue -\ccNestedType{Squared_distance_d}{} -\ccGlue -\ccNestedType{Value_at_d}{} -\ccGlue -\ccNestedType{Vector_to_point_d}{} +\ccNestedType{Side_of_oriented_sphere_d}{a model of \ccc{Kernel::Side_of_oriented_sphere_d}} \ccGlue \ccOperations diff --git a/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Center_of_sphere_d.tex b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Center_of_sphere_d.tex index 8e347aaf78c..2e02c8079e1 100644 --- a/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Center_of_sphere_d.tex +++ b/Kernel_d/doc_tex/Kernel_d_ref/Kernel_Center_of_sphere_d.tex @@ -4,9 +4,10 @@ A model for this must provide: \ccCreationVariable{fo} \ccMemberFunction{template Kernel::Point_d - operator()(ForwardIterator first, ForwardIterator last);}{computes - the affine rank of the points in \ccc{A = tuple [first,last)}. - \ccPrecond The objects are of the same dimension. \ccRequire The - value type of \ccc{ForwardIterator} is \ccc{Kernel::Point_d}.} + operator()(ForwardIterator first, ForwardIterator last);}{returns the + center of the sphere spanned by the points in \ccc{A = tuple + [first,last)}. \ccPrecond $A$ contains $d+1$ affinely independent + points of dimension $d$. \ccRequire The value type of + \ccc{ForwardIterator} is \ccc{Kernel::Point_d}.} \end{ccRefFunctionObjectConcept} diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index a36fb0a315a..2e74a45f7ac 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -37,8 +37,11 @@ include(${QT_USE_FILE}) include_directories(${QGLVIEWER_INCLUDE_DIR}) include_directories(BEFORE . ../../include/) +# Option allowing to profile each operation of the demo. +add_definitions(-DCGAL_PROFILE_LCC_DEMO) + # ui file, created wih Qt Designer -qt4_wrap_ui(uis MainWindow.ui CreateMesh.ui) +qt4_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui) # qrc files (resources files, that contain icons, at least) qt4_add_resources (RESOURCE_FILES ./Linear_cell_complex_3.qrc) @@ -48,6 +51,7 @@ qt4_automoc(MainWindow.cpp Viewer.cpp) add_executable(Linear_cell_complex_3_demo Linear_cell_complex_3_demo.cpp MainWindow.cpp Viewer.cpp Linear_cell_complex_3_subdivision.cpp + Linear_cell_complex_pqq_subdivision.cpp ${uis} ${RESOURCE_FILES} ) add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CreateMenger.ui b/Linear_cell_complex/demo/Linear_cell_complex/CreateMenger.ui new file mode 100644 index 00000000000..3ee4051775d --- /dev/null +++ b/Linear_cell_complex/demo/Linear_cell_complex/CreateMenger.ui @@ -0,0 +1,106 @@ + + + createMenger + + + + 0 + 0 + 227 + 76 + + + + Dialog + + + + + -142 + 40 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 150 + 10 + 51 + 27 + + + + false + + + false + + + 0 + + + 6 + + + 0 + + + + + + 23 + 15 + 121 + 17 + + + + Menger Complexity + + + + + + + buttonBox + accepted() + createMenger + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + createMenger + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CreateMesh.ui b/Linear_cell_complex/demo/Linear_cell_complex/CreateMesh.ui index 664fec1c299..683560d4eea 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CreateMesh.ui +++ b/Linear_cell_complex/demo/Linear_cell_complex/CreateMesh.ui @@ -6,7 +6,7 @@ 0 0 - 220 + 230 65 @@ -18,13 +18,13 @@ - 220 + 230 65 - 220 + 230 65 @@ -37,8 +37,8 @@ - 20 - 30 + 33 + 34 171 32 @@ -56,8 +56,8 @@ - 0 - 0 + 6 + 2 221 31 diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_demo.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_demo.cpp index da3737a51ed..52a205c5053 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_demo.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_3_demo.cpp @@ -21,10 +21,15 @@ #include "typedefs.h" #include #include +#include + +// Global random +CGAL::Random myrandom; int main(int argc, char** argv) { - std::cout<<"Size of dart: "<is_free (2)); + CGAL_assertion ( d!=NULL && !d->is_free(2) ); + CGAL_assertion ( !d->is_free(1) && !d->is_free(0) ); + CGAL_assertion ( !d->beta(2)->is_free(0) && !d->beta(2)->is_free(1) ); + + if (!CGAL::is_removable(m,d)) return NULL; - if (!CGAL::is_removable(m,d)) - return NULL; + Dart_handle d1 = d->beta(1); + Dart_handle d2 = d->beta(2)->beta(0); - Dart_handle d2 = d->beta(1)->beta(1); - CGAL::remove_cell(m, d); + CGAL_assertion ( !d1->is_free(1) && !d2->is_free(0) ); - insert_cell_1_in_cell_2(m, d2, d2->beta(1)->beta(1)); + Dart_handle d3 = d1->beta(1); + Dart_handle d4 = d2->beta(0); - return d2->beta (0); + // We isolated the edge + m.basic_link_beta_1(d->beta(0), d->beta(2)->beta(1)); + m.basic_link_beta_0(d->beta(1), d->beta(2)->beta(0)); + if ( !d->is_free(3) ) + { + m.basic_link_beta_0(d->beta(0)->beta(3), d->beta(2)->beta(1)->beta(3)); + m.basic_link_beta_1(d->beta(1)->beta(3), d->beta(2)->beta(0)->beta(3)); + } + + // Then we push the two extremities. + m.basic_link_beta_0(d3, d); + m.basic_link_beta_0(d2, d->beta(2)); + m.link_beta_1(d4, d); + m.link_beta_1(d1, d->beta(2)); + + if ( !d->is_free(3) ) + { + m.basic_link_beta_0(d4->beta(3), d->beta(3)); + m.basic_link_beta_0(d1->beta(3), d->beta(2)->beta(3)); + m.link_beta_1(d3->beta(3), d->beta(3)); + m.link_beta_1(d2->beta(3), d->beta(2)->beta(3)); + } + + // CGAL::remove_cell(m, d); + // insert_cell_1_in_cell_2(m, d1, d1->beta(1)->beta(1)); + + return d; } // Subdivide each facet of the lcc by using sqrt(3)-subdivision. @@ -156,9 +186,8 @@ subdivide_lcc_3 (LCC & m) (m.is_marked(d2->beta(3), mark) && m.is_marked(d2->beta(2)->beta(3), mark)))) { - m.negate_mark (mark); // thus new darts will be marked flip_edge (m, d2); - m.negate_mark (mark); + m.mark(d2, mark); } else m.mark (d2, mark); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_pqq_subdivision.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_pqq_subdivision.cpp new file mode 100644 index 00000000000..ed03726ac16 --- /dev/null +++ b/Linear_cell_complex/demo/Linear_cell_complex/Linear_cell_complex_pqq_subdivision.cpp @@ -0,0 +1,329 @@ +// Copyright (c) 2011 CNRS and LIRIS' Establishments (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) : Guillaume Damiand +// Jérémy Girerd-Rey +// +#include "typedefs.h" + +// Smooth a vertex depending on the vertices of its incidents facets. +class Smooth_edge_pqq +{ +public: + /** Constructor. + * @param alcc is the lcc to smooth + * @param amark is a mark designing old darts (i.e. darts not created during + * the subdivision step) + */ + Smooth_edge_pqq (LCC & alcc, unsigned int o):mlcc (alcc), old(o) + { + } + + Vertex operator () (Vertex & v) const + { + Dart_handle d = v.dart (); + CGAL_assertion (d != NULL); + + // Old points aren't concerned. + if (mlcc.is_marked(d, old)) + { + return v; + } + + std::vector facetsPoints; + facetsPoints.resize(0); + + // We search barycenter point of incidents facets. + for (LCC::One_dart_per_incident_cell_range<1,0>::iterator it = + mlcc.one_dart_per_incident_cell<1,0>(d).begin(); + it != mlcc.one_dart_per_incident_cell<1,0>(d).end(); ++it) + { + // If the vertex is on a border. + if (it->is_free (2)) + { + return v; + } + // If we found barycenter of a facet. + if (!mlcc.is_marked(it->opposite(), old)) + { + facetsPoints.push_back(LCC::point(it->opposite())); + } + } + + // If we found more than two points we are on a vertice barycenter of a facet. + // They aren't concerned. + if (facetsPoints.size() > 2 || facetsPoints.size() < 2) + { + return v; + } + + // Average. + LCC::Vector averageFacetsV = LCC::Traits::Construct_vector() + ( CGAL::ORIGIN, LCC::Point(0,0,0) ); + + for (unsigned int i=0; i < facetsPoints.size(); i++) + { + averageFacetsV = LCC::Traits::Construct_sum_of_vectors() + (averageFacetsV, + LCC::Traits::Construct_vector() (CGAL::ORIGIN, facetsPoints[i])); + } + + averageFacetsV = LCC::Traits::Construct_scaled_vector() + ( averageFacetsV, (1.0f/facetsPoints.size()) ); + + // Barycenter point. + LCC::Vector barycenterV = LCC::Traits::Construct_sum_of_vectors() + ( LCC::Traits::Construct_vector() (CGAL::ORIGIN, v.point()), averageFacetsV ); + + barycenterV = LCC::Traits::Construct_scaled_vector() + ( barycenterV, (1.0f/2.0f) ); + + Vertex res = LCC::Traits::Construct_translated_point() (CGAL::ORIGIN, barycenterV); + res.set_dart (d); + + return res; + } +private: + LCC & mlcc; + unsigned int old; +}; + +// Smooth an old vertex depending on the vertices of its incident facet and edge. +class Smooth_vertex_pqq +{ +public: + /** Constructor. + * @param alcc is the lcc to smooth + * @param amark is a mark designing old darts (i.e. darts not created during + * the triangulation step) + */ + Smooth_vertex_pqq (LCC & alcc, unsigned int o):mlcc (alcc), old(o) + { + } + + Vertex operator () (Vertex & v) const + { + Dart_handle d = v.dart (); + CGAL_assertion (d != NULL); + + // Just old points are concerned. + if (!mlcc.is_marked(d, old)) + { + return v; + } + + unsigned int degree = 0; + std::vector edgesPoints; + edgesPoints.resize(0); + + std::vector facetsPoints; + facetsPoints.resize(0); + + // We search barycenter point of incidents facets, and incidents edges points. + for (LCC::One_dart_per_incident_cell_range<1,0>::iterator it = + mlcc.one_dart_per_incident_cell<1,0>(d).begin(); + it != mlcc.one_dart_per_incident_cell<1,0>(d).end(); ++it) + { + // If the vertex is on a border + if (it->is_free (2)) + { + return v; + } + // If incident isn't an old point, it's an edge point. + if (!mlcc.is_marked(it->opposite(), old)) + { + edgesPoints.push_back (LCC::point(it->opposite())); + } + // We go find the "facet point" of incidents facet (barycenter of a facet). + facetsPoints.push_back (LCC::point(it->opposite()->beta_inv(1))); + ++degree; + } + + CGAL_assertion (facetsPoints.size() != 0 && edgesPoints.size() != 0); + + if (facetsPoints.size() < 3 || edgesPoints.size() < 3 ) + { + return v; + } + + // Average of incidents "edge points". + LCC::Vector averageEdgesV = LCC::Traits::Construct_vector() + (CGAL::ORIGIN, LCC::Point(0,0,0)); + + for (unsigned int i=0; i < edgesPoints.size(); i++) + { + averageEdgesV = LCC::Traits::Construct_sum_of_vectors() + ( averageEdgesV, + LCC::Traits::Construct_vector() (CGAL::ORIGIN, edgesPoints[i])); + } + + averageEdgesV = LCC::Traits::Construct_scaled_vector() + ( averageEdgesV, 1.0f/ (LCC::FT) edgesPoints.size() ); + + // Average of incidents "facet points". + LCC::Vector averageFacetsV = LCC::Traits::Construct_vector() + (CGAL::ORIGIN, LCC::Point(0,0,0)); + + for (unsigned int i=0; i < facetsPoints.size(); i++) + { + averageFacetsV = LCC::Traits::Construct_sum_of_vectors() + ( averageFacetsV, + LCC::Traits::Construct_vector() (CGAL::ORIGIN, facetsPoints[i])); + } + + averageFacetsV = LCC::Traits::Construct_scaled_vector() + ( averageFacetsV, (1.0f/ (LCC::FT) facetsPoints.size()) ); + + // COEFFICIENTS of PQQ - Catmull–Clark subdivision : + // point = ( averageFacets + 2*averageEdges + point*(degree-3) )/degree + + averageFacetsV = LCC::Traits::Construct_scaled_vector() + ( averageFacetsV, 1.0f/ (LCC::FT) degree); + + averageEdgesV = LCC::Traits::Construct_scaled_vector() + ( averageEdgesV, 2.0f/ (LCC::FT) degree); + + LCC::Vector pointV = LCC::Traits::Construct_scaled_vector() + ( LCC::Traits::Construct_vector() (CGAL::ORIGIN, v.point() ), + (LCC::FT) (degree-3)/ (LCC::FT) degree ); + + // New position of the old point. + LCC::Vector newPosition = LCC::Traits::Construct_sum_of_vectors() + ( averageFacetsV, averageEdgesV); + + newPosition = LCC::Traits::Construct_sum_of_vectors() + ( newPosition, pointV); + + Vertex res = LCC::Traits::Construct_translated_point() (CGAL::ORIGIN, newPosition); + res.set_dart (d); + + return res; + } +private: + LCC & mlcc; + unsigned int old; +}; + + +// Subdivide each facet of the lcc by using pqq-subdivision. +void +subdivide_lcc_pqq (LCC & m) +{ + if (m.number_of_darts () == 0) + return; + + unsigned int old = m.get_new_mark (); + unsigned int treated = m.get_new_mark (); + m.negate_mark (old); // All the old darts are marked in O(1). + + // 1) We subdivide each edge. + m.negate_mark (treated); // All the darts are marked in O(1). + + for (LCC::Dart_range::iterator it (m.darts().begin ()); + m.number_of_marked_darts (treated) > 0; ++it) + { + if (m.is_marked (it, treated)) + { + // We unmark the darts of the facet to process only once dart/facet. + CGAL::unmark_cell < LCC, 1 > (m, it, treated); + + // We insert barycenter in the middle of the edge. + m.insert_barycenter_in_cell<1>(it); + } + } + + // 2) We create a barycenter point for each facets. + Dart_handle dc; + std::vector remove; + remove.resize(0); + + m.negate_mark (treated); // All the darts are marked in O(1). + for (LCC::Dart_range::iterator it (m.darts().begin ()); + m.number_of_marked_darts (treated) > 0; ++it) + { + if (m.is_marked (it, treated)) + { + // We unmark the darts of the facet to process only once dart/facet. + CGAL::unmark_cell < LCC, 2 > (m, it, treated); + // We insert barycenter of the facet. + dc = m.insert_barycenter_in_cell<2>(it); + + // We remove useless edges. + for (LCC::One_dart_per_incident_cell_range<1,0>::iterator it2 = + m.one_dart_per_incident_cell<1,0>(dc).begin(); + it2 != m.one_dart_per_incident_cell<1,0>(dc).end(); ++it2) + { + // If the edge join the center and a corner. + // We remove the edge. + if( m.is_marked(it2->beta(1), old) ) + { + remove.push_back(it2); + } + } + + // Remove edges. + for (std::vector ::iterator dit = remove.begin (); + dit != remove.end (); ++dit) + { + CGAL_assertion( (CGAL::is_removable(m,*dit)) ); + CGAL::remove_cell(m, *dit); + CGAL_assertion( m.is_valid() ); + } + remove.resize(0); + + } + } + + m.negate_mark (treated); + CGAL_assertion (m.is_whole_map_marked (treated)); + m.free_mark (treated); + + // 3) Smooth old points. + std::vector < Vertex > old_vertices; // smooth the old vertices. + old_vertices.reserve (m.number_of_attributes<0> ()); // get intermediate space. + std::transform (m.vertex_attributes().begin (), + m.vertex_attributes().end (), + std::back_inserter (old_vertices), + Smooth_vertex_pqq (m, old)); + + // Update. + for (std::vector < Vertex >::iterator vit = old_vertices.begin (); + vit != old_vertices.end (); ++vit) + { + LCC::point(vit->dart())=vit->point(); + } + + // 4) Smooth new edges points. + std::vector < Vertex > vertices; // smooth the old vertices. + vertices.reserve (m.number_of_attributes<0> ()); // get intermediate space. + std::transform (m.vertex_attributes().begin (), + m.vertex_attributes().end (), + std::back_inserter (vertices), + Smooth_edge_pqq (m, old)); + + // Update. + for (std::vector < Vertex >::iterator vit = vertices.begin (); + vit != vertices.end (); ++vit) + { + LCC::point(vit->dart())=vit->point(); + } + + m.unmark_all (old); + m.free_mark (old); + CGAL_postcondition ( m.is_valid ()); +} + diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp index d348f9750de..ad959b29f9a 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp @@ -21,82 +21,57 @@ #include "MainWindow.h" #include #include +#include "MainWindow.moc" +#include // Function defined in Linear_cell_complex_3_subivision.cpp void subdivide_lcc_3 (LCC & m); +// Function defined in Linear_cell_complex_pqq_subivision.cpp +void subdivide_lcc_pqq (LCC & m); + #define DELAY_STATUSMSG 1500 -bool isVisibleAndFilled(char property) -{ return (property & LCC_DEMO_FILLED) && (property & LCC_DEMO_VISIBLE); } - -bool isVisible(char property) -{ return (property & LCC_DEMO_VISIBLE); } - -bool isFilled(char property) -{ return (property & LCC_DEMO_FILLED); } - -char setVisible(char property) -{ return property | LCC_DEMO_VISIBLE; } - -char setHidden(char property) -{ - if ( !isVisible(property) ) return property; - return property ^ LCC_DEMO_VISIBLE; -} - -char setFilled(char property) -{ return property | LCC_DEMO_FILLED; } - -char setWireframe(char property) -{ - if ( !isFilled(property) ) return property; - return property ^ LCC_DEMO_FILLED; -} - -char setVisibleAndFilled(char property) -{ return property | LCC_DEMO_FILLED | LCC_DEMO_VISIBLE; } - -char negateVisible(char property) -{ return property ^ LCC_DEMO_VISIBLE; } - -char negateFilled(char property) -{ return property ^ LCC_DEMO_FILLED; } - - MainWindow::MainWindow (QWidget * parent):CGAL::Qt::DemosMainWindow (parent), - nbcube (0), - dialogmesh(this), - volumeUid(1) + nbcube (0), + dialogmesh (this), + dialogmenger(this) { setupUi (this); + scene.lcc = new LCC; volumeListDock = new QDockWidget(QString(tr("Volume List")),this); volumeListDock->setAllowedAreas(Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea); - volumeList = new QTableWidget(0,3,volumeListDock); + volumeList = new QTableWidget(0,4,volumeListDock); volumeList->verticalHeader()->hide(); + volumeList->setColumnHidden(3,true); QObject::connect(this->volumeList, SIGNAL(cellChanged(int,int)), this, SLOT(onCellChanged(int,int))); - QStringList labels(QString(tr("Volume"))); + QStringList labels(QString(tr("Color"))); labels.append(QString(tr("Filled"))); labels.append(QString(tr("Hidden"))); volumeList->setHorizontalHeaderLabels(labels); - // volumeList->resizeColumnsToContents(); - volumeList->setFixedWidth(170); + //volumeList->resizeColumnsToContents(); + volumeList->setFixedWidth(200); +/* volumeList->setColumnWidth(0,85); + volumeList->setColumnWidth(1,35); + volumeList->setColumnWidth(2,35);*/ volumeList->horizontalHeader()->setResizeMode(QHeaderView::Stretch); - volumeList->setSelectionMode(QAbstractItemView::SingleSelection); - volumeList->setSelectionBehavior(QAbstractItemView::SelectRows); + volumeList->setSelectionMode(QAbstractItemView::NoSelection); + //volumeList->setSelectionBehavior(QAbstractItemView::SelectRows); volumeListDock->setWidget(volumeList); addDockWidget(Qt::RightDockWidgetArea,volumeListDock); menuView->addAction(volumeListDock->toggleViewAction()); - this->viewer->setScene (&scene); - this->viewer->setVectorPointers(&volumeDartIndex,&volumeProperties); + QObject::connect(&dialogmesh, SIGNAL(accepted()), + this, SLOT(onCreateMeshOk())); + + this->viewer->setScene(&scene); - connectActions (); + connect_actions (); this->addAboutDemo (":/cgal/help/about_Linear_cell_complex_3.html"); this->addAboutCGAL (); @@ -105,79 +80,47 @@ MainWindow::MainWindow (QWidget * parent):CGAL::Qt::DemosMainWindow (parent), this, SLOT (load_off (QString))); statusMessage = new QLabel - ("Darts: 0, Vertices: 0 (Points: 0), Edges: 0, Facets: 0," - " Volume: 0 (Vol color: 0), Connected components: 0"); + ("Darts: 0, Vertices: 0 (Points: 0), Edges: 0, Facets: 0," + " Volume: 0 (Vol color: 0), Connected components: 0"); statusBar ()->addWidget (statusMessage); } -void MainWindow::connectActions () -{ - QObject::connect (this->actionImportOFF, SIGNAL (triggered ()), - this, SLOT (import_off ())); - - QObject::connect (this->actionAddOFF, SIGNAL (triggered ()), - this, SLOT (add_off ())); - - QObject::connect (this->actionCompute_Voronoi_3D, SIGNAL (triggered ()), - this, SLOT (voronoi_3 ())); - - QObject::connect (this->actionImport3DTDS, SIGNAL (triggered ()), - this, SLOT (import_3DTDS ())); - +void MainWindow::connect_actions () +{ QObject::connect (this->actionQuit, SIGNAL (triggered ()), qApp, SLOT (quit ())); - QObject::connect (this->actionSubdivide, SIGNAL (triggered ()), - this, SLOT (subdivide ())); - - QObject::connect (this->actionCreate_cube, SIGNAL (triggered ()), - this, SLOT (create_cube ())); - - QObject::connect (this->actionCreate_mesh, SIGNAL (triggered ()), - this, SLOT (create_mesh ())); - - QObject::connect (this->actionCreate3Cubes, SIGNAL (triggered ()), - this, SLOT (create_3cubes ())); - - QObject::connect (this->actionCreate2Volumes, SIGNAL (triggered ()), - this, SLOT (create_2volumes ())); - QObject::connect (this, SIGNAL (sceneChanged ()), this, SLOT (onSceneChanged ())); - QObject::connect (this->actionClear, SIGNAL (triggered ()), - this, SLOT (clear ())); - - QObject::connect (this->actionDual_3, SIGNAL (triggered ()), - this, SLOT (dual_3 ())); - - QObject::connect (this->actionClose_volume, SIGNAL (triggered ()), - this, SLOT (close_volume ())); - - QObject::connect (this->actionRemove_filled_volumes, SIGNAL (triggered ()), - this, SLOT (remove_filled_volumes ())); - - QObject::connect (this->actionRemove_selected_volume, SIGNAL (triggered ()), - this, SLOT (remove_selected_volume ())); - - QObject::connect (this->actionSew3_same_facets, SIGNAL (triggered ()), - this, SLOT (sew3_same_facets ())); - - QObject::connect (this->actionUnsew3_all, SIGNAL (triggered ()), - this, SLOT (unsew3_all ())); - - QObject::connect (this->actionTriangulate_all_facets, SIGNAL (triggered ()), - this, SLOT (triangulate_all_facets ())); - - QObject::connect (this->actionExtend_filled_volumes, SIGNAL (triggered ()), - this, SLOT (extendFilledVolumes())); - QObject::connect (this->actionExtend_hidden_volumes, SIGNAL (triggered ()), - this, SLOT (extendHiddenVolumes())); - QObject::connect(this->volumeList->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(onHeaderClicked(int))); + + QObject::connect(dialogmenger.mengerLevel, SIGNAL(valueChanged(int)), + this, SLOT(onMengerChange(int))); + QObject::connect(&dialogmenger, SIGNAL(accepted()), + this, SLOT(onMengerOk())); + QObject::connect(&dialogmenger, SIGNAL(rejected()), + this, SLOT(onMengerCancel())); +} + +void MainWindow::connectVolumeListHandlers() +{ + QObject::connect(this->volumeList, SIGNAL(cellChanged(int,int)), + this, SLOT(onCellChanged(int,int))); +} + +void MainWindow::update_operations_entries(bool show) +{ + actionImportOFF->setEnabled(show); + actionAddOFF->setEnabled(show); + actionImport3DTDS->setEnabled(show); + actionCompute_Voronoi_3D->setEnabled(show); + actionClear->setEnabled(show); + menuCreations->setEnabled(show); + menuOperations->setEnabled(show); } void MainWindow::onSceneChanged () @@ -198,12 +141,12 @@ void MainWindow::onSceneChanged () os << "Darts: " << scene.lcc->number_of_darts () << ", Vertices:" << res[0] <<", (Points:"<number_of_attributes<0>()<<")" - << ", Edges:" << res[1] - << ", Facets:" << res[2] - << ", Volumes:" << res[3] - <<", (Vol color:"<number_of_attributes<3>()<<")" - << ", Connected components:" << res[4] - <<", Valid:"<<(scene.lcc->is_valid()?"true":"FALSE"); + << ", Edges:" << res[1] + << ", Facets:" << res[2] + << ", Volumes:" << res[3] + <<", (Vol color:"<number_of_attributes<3>()<<")" + << ", Connected components:" << res[4] + <<", Valid:"<<(scene.lcc->is_valid()?"true":"FALSE"); scene.lcc->negate_mark (mark); scene.lcc->free_mark (mark); @@ -213,7 +156,32 @@ void MainWindow::onSceneChanged () statusMessage->setText (os.str().c_str ()); } -void MainWindow::import_off () +void MainWindow::clear_all() +{ + scene.lcc->clear(); + nbcube=0; + + volumeList->clearContents(); + volumeList->setRowCount(0); +} + +void MainWindow::on_new_volume(Dart_handle adart) +{ + assert( adart->attribute<3>()==NULL); + scene.lcc->set_attribute<3>(adart,scene.lcc->create_attribute<3>()); + update_volume_list_add(adart->attribute<3>()); +} + +void MainWindow::init_all_new_volumes() +{ + for (LCC::One_dart_per_cell_range<3>::iterator + it(scene.lcc->one_dart_per_cell<3>().begin()); + it.cont(); ++it) + if ( it->attribute<3>()==NULL ) + { on_new_volume(it); } +} + +void MainWindow::on_actionImportOFF_triggered () { QString fileName = QFileDialog::getOpenFileName (this, tr ("Import OFF"), @@ -226,7 +194,7 @@ void MainWindow::import_off () } } -void MainWindow::import_3DTDS () +void MainWindow::on_actionImport3DTDS_triggered () { QString fileName = QFileDialog::getOpenFileName (this, tr ("Import 3DTDS"), @@ -241,7 +209,7 @@ void MainWindow::import_3DTDS () } } -void MainWindow::add_off () +void MainWindow::on_actionAddOFF_triggered() { QString fileName = QFileDialog::getOpenFileName (this, tr ("Add OFF"), @@ -257,14 +225,25 @@ void MainWindow::add_off () void MainWindow::load_off (const QString & fileName, bool clear) { QApplication::setOverrideCursor (Qt::WaitCursor); + + if (clear) this->clear_all(); - if (clear) - this->clear(false); - +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + std::ifstream ifs (qPrintable (fileName)); CGAL::import_from_polyhedron_3_flux < LCC > (*scene.lcc, ifs); - initAllNewVolumes(); + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to load off "<addToRecentFiles (fileName); QApplication::restoreOverrideCursor (); @@ -278,30 +257,16 @@ void MainWindow::load_off (const QString & fileName, bool clear) emit (sceneChanged ()); } -void MainWindow::onNewVolume(Dart_handle adart) -{ - scene.lcc->set_attribute<3>(adart,scene.lcc->create_attribute<3> - (CGAL::Color(random.get_int(0,256), - random.get_int(0,256), - random.get_int(0,256)))); - update_volume_list_add(adart); -} - -void MainWindow::initAllNewVolumes() -{ - for (LCC::One_dart_per_cell_range<3>::iterator - it(scene.lcc->one_dart_per_cell<3>().begin()); - it.cont(); ++it) - if ( it->attribute<3>()==NULL ) - { onNewVolume(it); } -} - void MainWindow::load_3DTDS (const QString & fileName, bool clear) { QApplication::setOverrideCursor (Qt::WaitCursor); - if (clear) - this->clear(false); + if (clear) this->clear_all(); + +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif typedef CGAL::Delaunay_triangulation_3 < LCC::Traits > Triangulation; Triangulation T; @@ -311,7 +276,16 @@ void MainWindow::load_3DTDS (const QString & fileName, bool clear) T.insert (begin, end); CGAL::import_from_triangulation_3 < LCC, Triangulation >(*scene.lcc, T); - initAllNewVolumes(); + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to import the 3DTDS from "<showMessage (QString ("Cube created"),DELAY_STATUSMSG); emit (sceneChanged ()); + + return d; } -void MainWindow::create_3cubes () +void MainWindow::on_actionCreate3Cubes_triggered () { Dart_handle d1 = make_iso_cuboid (Point_3 (nbcube, nbcube, nbcube),1); Dart_handle d2 = make_iso_cuboid (Point_3 (nbcube + 1, nbcube, nbcube),1); Dart_handle d3 = make_iso_cuboid (Point_3 (nbcube, nbcube + 1, nbcube), 1); - onNewVolume(d1); - onNewVolume(d2); - onNewVolume(d3); + on_new_volume(d1); + on_new_volume(d2); + on_new_volume(d3); scene.lcc->sew<3> (d1->beta(1)->beta(1)->beta(2), d2->beta(2)); scene.lcc->sew<3> (d1->beta(2)->beta(1)->beta(1)->beta(2), d3); @@ -372,7 +348,7 @@ void MainWindow::create_3cubes () emit (sceneChanged ()); } -void MainWindow::create_2volumes () +void MainWindow::on_actionCreate2Volumes_triggered () { Dart_handle d1 = make_iso_cuboid(Point_3(nbcube, nbcube, nbcube),1); Dart_handle d2 = make_iso_cuboid(Point_3(nbcube + 1, nbcube, nbcube), 1); @@ -388,62 +364,99 @@ void MainWindow::create_2volumes () CGAL::remove_cell(*scene.lcc, d3); CGAL::remove_cell(*scene.lcc, d2->beta (2)); - onNewVolume(d1); - onNewVolume(d4); + on_new_volume(d1); + on_new_volume(d4); ++nbcube; statusBar ()->showMessage (QString ("2 volumes were created"), DELAY_STATUSMSG); + emit (sceneChanged()); +} + +void MainWindow::on_actionCreate_mesh_triggered () +{ + dialogmesh.show(); +} + +void MainWindow::onCreateMeshOk() +{ +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + + for (int x=0; xshowMessage (QString ("mesh created"),DELAY_STATUSMSG); + emit (sceneChanged ()); } -void MainWindow::create_mesh () +void MainWindow::on_actionSubdivide_triggered () { - if ( dialogmesh.exec()==QDialog::Accepted ) - { - for (int x=0; xshowMessage (QString ("mesh created"),DELAY_STATUSMSG); - - emit (sceneChanged ()); - } -} +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif -void MainWindow::subdivide () -{ subdivide_lcc_3 (*(scene.lcc)); + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to subdivide the current LCC: " + <showMessage (QString ("Objects were subdivided"), - DELAY_STATUSMSG); + DELAY_STATUSMSG); } -void MainWindow::clear (bool msg) +void MainWindow::on_actionSubdivide_pqq_triggered () { - scene.lcc->clear (); - volumeUid = 1; - nbcube=0; - if (msg) - { - statusBar ()->showMessage (QString ("Scene was cleared"), DELAY_STATUSMSG); - emit (sceneChanged ()); - } - - volumeDartIndex.clear(); - volumeProperties.clear(); - volumeList->clearContents(); - volumeList->setRowCount(0); +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + + subdivide_lcc_pqq (*(scene.lcc)); + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to subdivide the current LCC: " + <showMessage (QString ("Objects were subdivided"), + DELAY_STATUSMSG); } -void MainWindow::voronoi_3 () + +void MainWindow::on_actionClear_triggered() +{ + clear_all(); + statusBar ()->showMessage (QString ("Scene cleared"), DELAY_STATUSMSG); + emit (sceneChanged ()); +} + +void MainWindow::on_actionCompute_Voronoi_3D_triggered () { QString fileName = QFileDialog::getOpenFileName (this, tr ("Voronoi 3D"), @@ -452,7 +465,13 @@ void MainWindow::voronoi_3 () if (fileName.isEmpty ()) return; - this->clear(false); + this->clear_all(); + +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + typedef CGAL::Delaunay_triangulation_3 < LCC::Traits > Triangulation; Triangulation T; @@ -464,10 +483,10 @@ void MainWindow::voronoi_3 () T.insert (begin, end); std::map vol_to_dart; + LCC::Dart_handle > vol_to_dart; dh = CGAL::import_from_triangulation_3 < LCC, Triangulation > - (delaunay_lcc, T, &vol_to_dart); + (delaunay_lcc, T, &vol_to_dart); Dart_handle ddh=delaunay_lcc.dual(*scene.lcc, dh); @@ -485,15 +504,15 @@ void MainWindow::voronoi_3 () // We update the geometry of dual_lcc by using the std::map face_to_dart. for ( std::map - ::iterator it=vol_to_dart.begin(), itend=vol_to_dart.end(); + ::iterator it=vol_to_dart.begin(), itend=vol_to_dart.end(); it!=itend; ++it) { - vol_to_dart[it->first]=dual[it->second]; - if ( !T.is_infinite(it->first) ) - scene.lcc->set_vertex_attribute - (it->second,scene.lcc->create_vertex_attribute(T.dual(it->first))); - /* else - alcc.set_vertex_attribute(it->second,alcc.create_vertex_attribute());*/ + vol_to_dart[it->first]=dual[it->second]; + if ( !T.is_infinite(it->first) ) + scene.lcc->set_vertex_attribute + (it->second,scene.lcc->create_vertex_attribute(T.dual(it->first))); + /* else + alcc.set_vertex_attribute(it->second,alcc.create_vertex_attribute());*/ } } @@ -504,8 +523,8 @@ void MainWindow::voronoi_3 () toremove.push(ddh); CGAL::mark_cell(*scene.lcc, ddh, mark_toremove); for (LCC::Dart_of_cell_range<3>::iterator - it=scene.lcc->darts_of_cell<3>(ddh).begin(), - itend=scene.lcc->darts_of_cell<3>(ddh).end(); it!=itend; ++it) + it=scene.lcc->darts_of_cell<3>(ddh).begin(), + itend=scene.lcc->darts_of_cell<3>(ddh).end(); it!=itend; ++it) { if ( !scene.lcc->is_marked(it->beta(3), mark_toremove) ) { @@ -521,241 +540,373 @@ void MainWindow::voronoi_3 () CGAL_assertion(scene.lcc->is_whole_map_unmarked(mark_toremove)); scene.lcc->free_mark(mark_toremove); } + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to compute Voronor 3D from "<showMessage (QString ("Voronoi 3D of points in ") + fileName, DELAY_STATUSMSG); } -void MainWindow::dual_3 () +void MainWindow::on_actionDual_3_triggered () { if ( !scene.lcc->is_without_boundary(3) ) { statusBar()->showMessage - (QString ("Dual impossible: the lcc has some 3-boundary"), - DELAY_STATUSMSG); + (QString ("Dual impossible: the lcc has some 3-boundary"), + DELAY_STATUSMSG); return; } +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + LCC* duallcc = new LCC; scene.lcc->dual_points_at_barycenter(*duallcc); - this->clear(false); +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to compute the dual: " + <clear_all(); delete scene.lcc; scene.lcc = duallcc; this->viewer->setScene(&scene); - initAllNewVolumes(); + init_all_new_volumes(); statusBar ()->showMessage (QString ("Dual_3 computed"), DELAY_STATUSMSG); emit (sceneChanged ()); } -void MainWindow::close_volume() +void MainWindow::on_actionClose_volume_triggered() { +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + if ( scene.lcc->close(3) > 0 ) - { - initAllNewVolumes(); - statusBar ()->showMessage (QString ("Volume are closed"), DELAY_STATUSMSG); + { + init_all_new_volumes(); + statusBar ()->showMessage (QString ("All volume(s) closed"), + DELAY_STATUSMSG); emit (sceneChanged ()); } else statusBar ()->showMessage - (QString ("LCC already 3-closed"), DELAY_STATUSMSG); + (QString ("LCC already 3-closed"), DELAY_STATUSMSG); + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to 3-close the current lcc: " + <sew3_same_facets() > 0 ) + int mymark = scene.lcc->get_new_mark(); + mark_all_filled_and_visible_volumes(mymark); + +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + + if ( scene.lcc->sew3_same_facets(mymark) > 0 ) { statusBar()->showMessage - (QString ("Same facets are 3-sewn"), DELAY_STATUSMSG); + (QString ("Same facets of visible and filled volume(s) are 3-sewn"), + DELAY_STATUSMSG); emit (sceneChanged ()); } else statusBar()->showMessage (QString ("No facets 3-sewn"), DELAY_STATUSMSG); - // timer.stop(); - // std::cout<<"sew3_same_facets in "<free_mark(mymark); + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to sew3 all same facets: " + <darts().begin(); it!=scene.lcc->darts().end(); ++it) { - if ( !it->is_free(3) ) + if ( !it->is_free(3) && + it->attribute<3>()->info().is_filled_and_visible() && + it->beta(3)->attribute<3>()->info().is_filled_and_visible()) { scene.lcc->unsew<3>(it); ++nb; } } +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to unsew3 all filled volumes: " + < 0 ) { statusBar()->showMessage - (QString ("All darts are 3-unsewn"), DELAY_STATUSMSG); + (QString ("Darts between visible and filled volume(s) are 3-unsewn"), + DELAY_STATUSMSG); emit (sceneChanged ()); } else statusBar()->showMessage (QString ("No dart 3-unsewn"), DELAY_STATUSMSG); } -void MainWindow::remove_filled_volumes() +void MainWindow::on_actionRemove_filled_volumes_triggered() { +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + unsigned int count = 0; - if(volumeDartIndex.size() > 0) + for (LCC::Attribute_range<3>::type::iterator + it=scene.lcc->attributes<3>().begin(), + itend=scene.lcc->attributes<3>().end(); it!=itend; ) { - for(unsigned int i = 0; i < volumeDartIndex.size();) + LCC::Attribute_handle<3>::type cur = it++; + if( cur->info().is_filled_and_visible() ) { - if( isVisibleAndFilled(volumeProperties[i]) ) - { - CGAL::remove_cell(*scene.lcc,volumeDartIndex[i].second); - update_volume_list_remove(i); - ++count; - } - else - { - i++; - } + CGAL::remove_cell(*scene.lcc,cur->dart()); + ++count; } - emit(sceneChanged()); } + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to remove all filled volumes: " + <showMessage - (QString::number(count)+QString(" visible volume(s) removed"), - DELAY_STATUSMSG); + (QString::number(count)+QString("Visible and filled volume(s) removed"), + DELAY_STATUSMSG); } -void MainWindow::remove_selected_volume() +void MainWindow::on_actionTriangulate_all_facets_triggered() { - bool nothingSelected = true; - int row = 0; - for(; row < volumeList->rowCount(); row++) - { - if(volumeList->item(row,0)->isSelected()) - { - nothingSelected = false; - break; - } - } +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif - if(nothingSelected) - statusBar()->showMessage (QString("Nothing Selected"), DELAY_STATUSMSG); - else - { - if(::isVisible(volumeProperties[row])) - { - CGAL::remove_cell(*scene.lcc,volumeDartIndex[row].second); - update_volume_list_remove(row); - emit(sceneChanged()); - } - else - { - statusBar()->showMessage (QString("Volume is hidden"), DELAY_STATUSMSG); - } - } -} - -void MainWindow::triangulate_all_facets() -{ std::vector v; - for (LCC::One_dart_per_cell_range<2>::iterator - it(scene.lcc->one_dart_per_cell<2>().begin()); it.cont(); ++it) + for (LCC::One_dart_per_cell_range<2>::iterator + it(scene.lcc->one_dart_per_cell<2>().begin()); it.cont(); ++it) { - v.push_back(it); + if ( it->attribute<3>()->info().is_filled_and_visible() ) + v.push_back(it); } for (std::vector::iterator itv(v.begin()); itv!=v.end(); ++itv) scene.lcc->insert_barycenter_in_cell<2>(*itv); +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to triangulate all filled faces: " + <showMessage - (QString ("All facets were triangulated"), DELAY_STATUSMSG); + (QString ("Facets of visible and filled volume(s) triangulated"), + DELAY_STATUSMSG); } -void MainWindow::update_volume_list_add(Dart_handle it) +void MainWindow::on_actionMerge_all_volumes_triggered() { - volumeDartIndex.push_back(std::pair(volumeUid,it)); - volumeProperties.push_back(setVisibleAndFilled(0)); +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + + Dart_handle prev = NULL; + for (LCC::Dart_range::iterator it(scene.lcc->darts().begin()), + itend=scene.lcc->darts().end(); it!=itend; ) + { + if ( !it->is_free(3) && + it->attribute<3>()->info().is_filled_and_visible() && + it->beta(3)->attribute<3>()->info().is_filled_and_visible() ) + { + CGAL::remove_cell(*scene.lcc,it); + itend=scene.lcc->darts().end(); + if ( prev==NULL ) it=scene.lcc->darts().begin(); + else { it=prev; if ( it!=itend ) ++it; } + } + else + ++it; + } + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to unsew3merge all filled volumes: " + <showMessage + (QString ("All volume(s) merged"), DELAY_STATUSMSG); +} + +bool MainWindow::is_volume_in_list(LCC::Attribute_handle<3>::type ah) +{ + for(int row=0; row < volumeList->rowCount(); ++row) + { + LCC::Attribute_type<3>::type* ptr= + reinterpret_cast::type*> + ( volumeList->item(row,3)->data(Qt::UserRole).value() ); + + if(ptr==&*ah) return true; + } + + return false; +} + +void MainWindow::update_volume_list_add(LCC::Attribute_handle<3>::type ah) +{ + assert( !is_volume_in_list(ah) ); + + volumeList->disconnect(this); + int newRow = volumeList->rowCount(); volumeList->setRowCount(newRow+1); - volumeList->disconnect(this); - - QTableWidgetItem* volumeLabel = - new QTableWidgetItem(QString::number(volumeUid)); + QTableWidgetItem* volumeLabel = new QTableWidgetItem + (QString(ah->info().color_name().c_str())); volumeLabel->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); volumeLabel->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); volumeList->setItem(newRow,0,volumeLabel); - + QTableWidgetItem* fillCB = new QTableWidgetItem; fillCB->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); - fillCB->setCheckState(Qt::Checked); + if ( ah->info().is_filled() ) fillCB->setCheckState(Qt::Checked); + else fillCB->setCheckState(Qt::Unchecked); volumeList->setItem(newRow,1, fillCB); - + QTableWidgetItem* hiddenCB = new QTableWidgetItem(); hiddenCB->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); - hiddenCB->setCheckState(Qt::Unchecked); + if ( ah->info().is_visible() ) hiddenCB->setCheckState(Qt::Unchecked); + else hiddenCB->setCheckState(Qt::Checked); volumeList->setItem(newRow,2,hiddenCB); - - volumeUid++; + + QTableWidgetItem* attribHandle = new QTableWidgetItem; + attribHandle->setData + (Qt::UserRole, reinterpret_cast(&*(ah))); + + volumeList->setItem(newRow,3,attribHandle); connectVolumeListHandlers(); - -} - -void MainWindow::connectVolumeListHandlers() -{ - QObject::connect(this->volumeList, SIGNAL(cellChanged(int,int)), - this, SLOT(onCellChanged(int,int))); - QObject::connect(this->volumeList, SIGNAL(itemSelectionChanged()), - this, SLOT(onItemSelectionChanged())); - - } void MainWindow::update_volume_list_remove(int i) -{ - volumeDartIndex.erase(volumeDartIndex.begin()+i); - volumeProperties.erase(volumeProperties.begin()+i); +{ + assert(irowCount()); volumeList->removeRow(i); +} - this->viewer->setSelectedVolumeIndex(-1); - if(volumeList->rowCount() > i) - volumeList->item(i,0)->setSelected(false); +void MainWindow::update_volume_list_remove(LCC::Attribute_handle<3>::type ah) +{ + for(int row=0; row < volumeList->rowCount(); ++row) + { + LCC::Attribute_type<3>::type* ptr= + reinterpret_cast::type*> + ( volumeList->item(row,3)->data(Qt::UserRole).value() ); + if(ptr==&*ah) + { + update_volume_list_remove(row); + return; + } + } +} + +void MainWindow::update_volume_list_all_ckeckstates() +{ + volumeList->disconnect(this); + + for(int row=0; row < volumeList->rowCount(); ++row) + { + LCC::Attribute_type<3>::type* ptr= + reinterpret_cast::type*> + ( volumeList->item(row,3)->data(Qt::UserRole).value() ); + + if ( ptr->info().is_filled() ) + volumeList->item(row,1)->setCheckState(Qt::Checked); + else + volumeList->item(row,1)->setCheckState(Qt::Unchecked); + + if ( !ptr->info().is_visible() ) + volumeList->item(row,2)->setCheckState(Qt::Checked); + else + volumeList->item(row,2)->setCheckState(Qt::Unchecked); + } + + connectVolumeListHandlers(); +} + +void MainWindow::recreate_whole_volume_list() +{ + volumeList->clearContents(); + volumeList->setRowCount(0); + + for (LCC::Attribute_range<3>::type::iterator + it=scene.lcc->attributes<3>().begin(), + itend=scene.lcc->attributes<3>().end(); it!=itend; ++it) + update_volume_list_add(it); } void MainWindow::onCellChanged(int row, int col) { + LCC::Attribute_type<3>::type* ptr= + reinterpret_cast::type*> + ( volumeList->item(row,3)->data(Qt::UserRole).value() ); - volumeProperties[row] = - (volumeList->item(row,2)->checkState() == Qt::Unchecked ? ::setVisible(0) : 0) | - (volumeList->item(row,1)->checkState() == Qt::Checked ? ::setFilled(0) : 0 ); - - // Change selection when toggling any checkbox? - // volumeList->item(row,0)->setSelected(true); - - emit(sceneChanged()); -} - -void MainWindow::onItemSelectionChanged() -{ - // This gives a QList index out of range assert fail if volumeUid is selected - // and some other volume checkbox is clicked - // QItemSelectionModel* selectionModel = volumeList->selectionModel(); - // QModelIndexList selectedRow = selectionModel->selectedIndexes(); - - int row = 0; - for(; row < volumeList->rowCount(); row++) + if ( col==1 ) { - if(volumeList->item(row,0)->isSelected()) - break; + ptr->info().negate_filled(); + } + else if ( col==2 ) + { + ptr->info().negate_visible(); + if ( !ptr->info().is_visible() ) + volumeList->item(row,1)->setFlags + (volumeList->item(row,1)->flags()^Qt::ItemIsEnabled); + else + volumeList->item(row,1)->setFlags + (volumeList->item(row,1)->flags()|Qt::ItemIsEnabled); } - this->viewer->setSelectedVolumeIndex(row); emit(sceneChanged()); - // statusBar()->showMessage (QString::number(row)+QString(" is selected"), DELAY_STATUSMSG); } void MainWindow::onHeaderClicked(int col) @@ -764,28 +915,51 @@ void MainWindow::onHeaderClicked(int col) { volumeList->disconnect(this); - for(unsigned int i = 0; i < volumeProperties.size(); i++) + for(int i = 0; i < volumeList->rowCount(); ++i) { + LCC::Attribute_type<3>::type* ptr= + reinterpret_cast::type*> + ( volumeList->item(i,3)->data(Qt::UserRole).value() ); + switch(qApp->keyboardModifiers()) { case(Qt::ShiftModifier): - volumeProperties[i] = - (col == 1 ? ::setWireframe(volumeProperties[i]) : - ::setVisible(volumeProperties[i])); - volumeList->item(i,col)->setCheckState( Qt::Unchecked); + if (col==1) ptr->info().set_filled(false); + else if (col==2) + { + ptr->info().set_visible(true); + volumeList->item(i,1)->setFlags + (volumeList->item(i,1)->flags()|Qt::ItemIsEnabled); + } + volumeList->item(i,col)->setCheckState(Qt::Unchecked); break; case(Qt::ControlModifier): - volumeProperties[i] = - ( col == 1 ? ::negateFilled(volumeProperties[i]) : - ::negateVisible(volumeProperties[i])); + if (col==1) ptr->info().negate_filled(); + else if (col==2) + { + ptr->info().negate_visible(); + if ( !ptr->info().is_visible() ) + volumeList->item(i,1)->setFlags + (volumeList->item(i,1)->flags()^Qt::ItemIsEnabled); + else + volumeList->item(i,1)->setFlags + (volumeList->item(i,1)->flags()|Qt::ItemIsEnabled); + } volumeList->item(i,col)-> - setCheckState(volumeList->item(i,col)->checkState() ? - Qt::Unchecked: Qt::Checked); + setCheckState(volumeList->item(i,col)->checkState() ? + Qt::Unchecked: Qt::Checked); break; default: - volumeProperties[i] = - (col == 1 ? ::setFilled(volumeProperties[i]) : - ::setHidden(volumeProperties[i])); + if (col==1) ptr->info().set_filled(true); + else if (col==2) + { + if ( ptr->info().is_visible() ) + { + ptr->info().set_visible(false); + volumeList->item(i,1)->setFlags + (volumeList->item(i,1)->flags()^Qt::ItemIsEnabled); + } + } volumeList->item(i,col)->setCheckState(Qt::Checked); break; } @@ -796,63 +970,664 @@ void MainWindow::onHeaderClicked(int col) } } -void MainWindow::extendVolumesSatisfying(char amask, char negatemask) +void MainWindow::mark_all_filled_and_visible_volumes(int amark) +{ + for (LCC::Attribute_range<3>::type::iterator + it=scene.lcc->attributes<3>().begin(), + itend=scene.lcc->attributes<3>().end(); it!=itend; ++it) + { + if ( it->info().is_filled_and_visible() && + !scene.lcc->is_marked(it->dart(), amark) ) + CGAL::mark_cell(*scene.lcc, it->dart(), amark); + } +} + +void MainWindow::on_actionExtend_filled_volumes_triggered() { - bool changed = false; - volumeList->disconnect(this); - int mark_volume = scene.lcc->get_new_mark(); + std::vector::type> tofill; - for(unsigned int i = 0; i < volumeProperties.size(); i++) + int mark_volume = scene.lcc->get_new_mark(); + bool already_tofill; + + for (LCC::Attribute_range<3>::type::iterator + it=scene.lcc->attributes<3>().begin(), + itend=scene.lcc->attributes<3>().end(); it!=itend; ++it) { - if ( ((volumeProperties[i] & amask) == amask) && - ((volumeProperties[i] & negatemask) ==0 ) ) + if ( !scene.lcc->is_marked(it->dart(), mark_volume) ) { - for (LCC::Dart_of_cell_range<3>::iterator - it=scene.lcc->darts_of_cell<3>(volumeDartIndex[i].second).begin(), - itend=scene.lcc->darts_of_cell<3>(volumeDartIndex[i].second).end(); - it!=itend; ++it ) + if ( !it->info().is_filled() ) { - scene.lcc->mark(it, mark_volume); - if ( !it->is_free(3) && - !scene.lcc->is_marked( it->beta(3), mark_volume) ) + already_tofill = false; + for (LCC::Dart_of_cell_basic_range<3>::iterator it2= + scene.lcc->darts_of_cell_basic<3>(it->dart(), mark_volume).begin(); + it2.cont(); ++it2 ) { - CGAL::mark_cell(*scene.lcc, it->beta(3), mark_volume); - changed = true; + scene.lcc->mark(it2, mark_volume); + if ( !it2->is_free(3) && + it2->beta(3)->attribute<3>()->info().is_filled() && + !already_tofill) + { + tofill.push_back(it2->attribute<3>()); + already_tofill = true; + } } } + else + CGAL::mark_cell(*scene.lcc, it->dart(), mark_volume); + } + } + + CGAL_assertion( scene.lcc->is_whole_map_marked(mark_volume) ); + scene.lcc->free_mark(mark_volume); + + if ( tofill.size()>0 ) + { + for ( std::vector::type>::iterator + it=tofill.begin(), itend=tofill.end(); it!=itend; ++it ) + { + (*it)->info().set_filled(true); + } + + update_volume_list_all_ckeckstates(); + emit(sceneChanged()); + } + + connectVolumeListHandlers(); +} + +void MainWindow::on_actionExtend_hidden_volumes_triggered() +{ + volumeList->disconnect(this); + + std::vector::type> tohide; + + int mark_volume = scene.lcc->get_new_mark(); + bool already_tohide; + + for (LCC::Attribute_range<3>::type::iterator + it=scene.lcc->attributes<3>().begin(), + itend=scene.lcc->attributes<3>().end(); it!=itend; ++it) + { + if ( !scene.lcc->is_marked(it->dart(), mark_volume) ) + { + if ( it->info().is_visible() ) + { + already_tohide = false; + for (LCC::Dart_of_cell_basic_range<3>::iterator it2= + scene.lcc->darts_of_cell_basic<3>(it->dart(), mark_volume).begin(); + it2.cont(); ++it2 ) + { + scene.lcc->mark(it2, mark_volume); + if ( !it2->is_free(3) && + !it2->beta(3)->attribute<3>()->info().is_visible() && + !already_tohide) + { + tohide.push_back(it2->attribute<3>()); + already_tohide = true; + } + } + } + else + CGAL::mark_cell(*scene.lcc, it->dart(), mark_volume); + } + } + + CGAL_assertion( scene.lcc->is_whole_map_marked(mark_volume) ); + scene.lcc->free_mark(mark_volume); + + if ( tohide.size()>0 ) + { + for ( std::vector::type>::iterator + it=tohide.begin(), itend=tohide.end(); it!=itend; ++it ) + { + (*it)->info().set_visible(false); + } + + update_volume_list_all_ckeckstates(); + emit(sceneChanged()); + } + + connectVolumeListHandlers(); +} + +void MainWindow::on_actionCreate_Menger_Sponge_triggered () +{ + dialogmenger.mengerLevel->disconnect(this); + + dialogmenger.mengerLevel->setValue(0); + mengerLevel=0; + assert( mengerVolumes.empty() ); + mengerVolumes.push_back(on_actionCreate_cube_triggered()); + update_operations_entries(false); + + QObject::connect(dialogmenger.mengerLevel, SIGNAL(valueChanged(int)), + this, SLOT(onMengerChange(int))); + + dialogmenger.show(); +} + +void MainWindow::onMengerCancel() +{ + for(std::vector::iterator it=mengerVolumes.begin(); + it!=mengerVolumes.end(); ++it) + { + CGAL::remove_cell(*scene.lcc, *it); + } + + recreate_whole_volume_list(); + mengerVolumes.clear(); + emit(sceneChanged()); +} + +void MainWindow::onMengerOk() +{ + update_operations_entries(true); + mengerVolumes.clear(); +} + +void MainWindow::onMengerChange(int newLevel) +{ + while ( newLevel > mengerLevel ) onMengerInc(); + while ( newLevel < mengerLevel ) onMengerDec(); +} + +void MainWindow::onMengerInc() +{ +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + + this->mengerLevel++; + + std::vector edges; + std::vector faces; + unsigned int nbvolinit = (unsigned int)mengerVolumes.size(); + + int markEdges = (scene.lcc)->get_new_mark(); + int markFaces = (scene.lcc)->get_new_mark(); + int markVols = (scene.lcc)->get_new_mark(); + + for(std::vector::iterator itvol=mengerVolumes.begin(); + itvol!=mengerVolumes.end(); ++itvol) + { + assert( !(scene.lcc)->is_marked(*itvol, markVols) ); + for (LCC::Dart_of_cell_basic_range<3>::iterator + it=(scene.lcc)->darts_of_cell_basic<3>(*itvol, markVols).begin(), + itend=(scene.lcc)->darts_of_cell_basic<3>(*itvol, markVols).end(); + it!=itend; ++it) + { + if ( !(scene.lcc)->is_marked(it, markEdges) ) + { + edges.push_back(it); + CGAL::mark_cell(*(scene.lcc), it, markEdges); + } + if ( !(scene.lcc)->is_marked(it, markFaces) ) + { + faces.push_back(it); + CGAL::mark_cell(*(scene.lcc), it, markFaces); + } } } - for(unsigned int i = 0; i < volumeProperties.size(); i++) + (scene.lcc)->negate_mark(markVols); + for(std::vector::iterator itvol=mengerVolumes.begin(); + itvol!=mengerVolumes.end(); ++itvol) { - if ( scene.lcc->is_marked(volumeDartIndex[i].second, mark_volume) ) + for (LCC::Dart_of_cell_basic_range<3>::iterator + it=(scene.lcc)->darts_of_cell_basic<3>(*itvol, markVols).begin(), + itend=(scene.lcc)->darts_of_cell_basic<3>(*itvol, markVols).end(); + it!=itend; ++it) { - volumeProperties[i] |= amask; - volumeProperties[i] ^= (volumeProperties[i] & negatemask); - CGAL::unmark_cell(*scene.lcc, volumeDartIndex[i].second, - mark_volume); - - volumeList->item(i,1)->setCheckState - ( (::isFilled(volumeProperties[i])? Qt::Checked : Qt::Unchecked) ); - volumeList->item(i,2)->setCheckState - ( (::isVisible(volumeProperties[i])? Qt::Unchecked: Qt::Checked) ); + (scene.lcc)->unmark(it, markEdges); + (scene.lcc)->unmark(it, markFaces); } } - CGAL_assertion( scene.lcc->is_whole_map_unmarked(mark_volume) ); - scene.lcc->free_mark(mark_volume); - - connectVolumeListHandlers(); - if ( changed ) emit(sceneChanged()); + (scene.lcc)->negate_mark(markVols); + assert( (scene.lcc)->is_whole_map_unmarked(markVols) ); + assert( (scene.lcc)->is_whole_map_unmarked(markFaces) ); + assert( (scene.lcc)->is_whole_map_unmarked(markEdges) ); + + (scene.lcc)->free_mark(markEdges); + (scene.lcc)->free_mark(markFaces); + (scene.lcc)->free_mark(markVols); + + for(unsigned int i = 0; i < (unsigned int)edges.size(); i++) + { + split_edge_in_three(edges[i]); + } + edges.clear(); + + for(unsigned int i = 0; i < (unsigned int)faces.size(); i++) + { + split_face_in_nine(faces[i]); + } + faces.clear(); + + for(unsigned int i = 0; i < nbvolinit; i++) + { + split_vol_in_twentyseven(mengerVolumes[i]); + } + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to increase the level of menger sponge (" + <mengerLevel-1<<" -> "<mengerLevel<<"): " + <is_valid() ); + + emit(sceneChanged()); +} + +void MainWindow::split_edge_in_three(Dart_handle dh) +{ + LCC::Point p1 = LCC::point(dh); + LCC::Point p2 = LCC::point(dh->other_extremity()); + + LCC::Vector v1 = LCC::Traits::Construct_vector() (p1,p2); + LCC::Vector v2 = LCC::Traits::Construct_scaled_vector() (v1,1.0/3); + LCC::Vector v3 = LCC::Traits::Construct_scaled_vector() (v1,2.0/3); + + LCC::Point p3 = LCC::Traits::Construct_translated_point() (p1,v2); + LCC::Point p4 = LCC::Traits::Construct_translated_point() (p1,v3); + + (scene.lcc)->insert_point_in_cell<1>(dh,p4); + (scene.lcc)->insert_point_in_cell<1>(dh,p3); +} + +void MainWindow::split_face_in_three(Dart_handle dh) +{ + CGAL::insert_cell_1_in_cell_2(*(scene.lcc),dh->beta(1)->beta(1)->beta(1), + dh->beta(0)->beta(0)); + CGAL::insert_cell_1_in_cell_2(*(scene.lcc),dh->beta(1)->beta(1),dh->beta(0)); +} + +void MainWindow::split_face_in_nine(Dart_handle dh) +{ + Dart_handle d2 = dh->beta(1)->beta(1)->beta(1)->beta(1) + ->beta(1)->beta(1)->beta(1); + + Dart_handle e2= CGAL::insert_cell_1_in_cell_2(*(scene.lcc), + dh->beta(1)->beta(1),d2); + Dart_handle e1= CGAL::insert_cell_1_in_cell_2(*(scene.lcc), + dh->beta(1),d2->beta(1)); + + split_edge_in_three(e1); + split_edge_in_three(e2); + + split_face_in_three(dh); + split_face_in_three(d2); + split_face_in_three(e2->beta(0)); +} + +void MainWindow::split_vol_in_three(Dart_handle dh, bool removecenter) +{ + std::vector edges1; + std::vector edges2; + + Dart_handle curd = dh->beta(2)->beta(1)->beta(1)->beta(2); + for (unsigned int i=0;i<4;++i) + { + edges1.push_back(curd); + curd=curd->beta(1)->beta(2)->beta(1); + } + assert( curd==dh->beta(2)->beta(1)->beta(1)->beta(2) ); + + curd = curd->beta(1)->beta(1)->beta(2); + for (unsigned int i=0;i<4;++i) + { + edges2.push_back(curd); + curd=curd->beta(1)->beta(2)->beta(1); + } + assert( curd== + dh->beta(2)->beta(1)->beta(1)->beta(2)->beta(1)->beta(1)->beta(2) ); + + Dart_handle f1= + insert_cell_2_in_cell_3(*(scene.lcc),edges1.begin(),edges1.end()); + + Dart_handle f2= + insert_cell_2_in_cell_3(*(scene.lcc),edges2.begin(),edges2.end()); + + f1->attribute<3>()->info().color()= + (CGAL::Color(myrandom.get_int(0,256), + myrandom.get_int(0,256), + myrandom.get_int(0,256))); + f2->attribute<3>()->info().color()= + (CGAL::Color(myrandom.get_int(0,256), + myrandom.get_int(0,256), + myrandom.get_int(0,256))); + + update_volume_list_add(dh->attribute<3>()); + + if ( removecenter ) + CGAL::remove_cell(*scene.lcc,f1); + else + { + mengerVolumes.push_back(f1); + update_volume_list_add(f1->attribute<3>()); + } + + mengerVolumes.push_back(f2); +} + +void MainWindow::split_vol_in_nine(Dart_handle dh, bool removecenter) +{ + std::vector edges1; + std::vector edges2; + + Dart_handle curd = dh->beta(1)->beta(2); + for (unsigned int i=0;i<8;++i) + { + edges1.push_back(curd); + curd=curd->beta(1)->beta(2)->beta(1); + } + assert( curd==dh->beta(1)->beta(2) ); + + curd = curd->beta(1)->beta(1)->beta(2); + for (unsigned int i=0;i<8;++i) + { + edges2.push_back(curd); + curd=curd->beta(1)->beta(2)->beta(1); + } + assert( curd==dh->beta(1)->beta(2)->beta(1)->beta(1)->beta(2) ); + + Dart_handle f1= + insert_cell_2_in_cell_3(*(scene.lcc),edges1.begin(),edges1.end()); + + Dart_handle f2= + insert_cell_2_in_cell_3(*(scene.lcc),edges2.begin(),edges2.end()); + + f1->attribute<3>()->info().color()= + (CGAL::Color(myrandom.get_int(0,256), + myrandom.get_int(0,256), + myrandom.get_int(0,256))); + f2->attribute<3>()->info().color()= + (CGAL::Color(myrandom.get_int(0,256), + myrandom.get_int(0,256), + myrandom.get_int(0,256))); + + update_volume_list_add(dh->attribute<3>()); + if ( !removecenter) + update_volume_list_add(f1->attribute<3>()); + + split_face_in_three(f1); + split_face_in_three(f2); + + split_vol_in_three(dh,removecenter); + + mengerVolumes.push_back(f2->beta(2)->beta(1)); + split_vol_in_three(f2->beta(2)->beta(1),removecenter); + + if ( removecenter ) + CGAL::remove_cell(*scene.lcc,f1); + else + { + mengerVolumes.push_back(f1->beta(2)->beta(1)); + split_vol_in_three(f1->beta(2)->beta(1),true); + } +} + +void MainWindow::split_vol_in_twentyseven(Dart_handle dh) +{ + std::vector edges1; + std::vector edges2; + + Dart_handle curd = dh->beta(1)->beta(1)->beta(2); + for (unsigned int i=0;i<12;++i) + { + edges1.push_back(curd); + curd=curd->beta(1)->beta(2)->beta(1); + } + assert( curd==dh->beta(1)->beta(1)->beta(2) ); + + curd = curd->beta(1)->beta(1)->beta(2); + for (unsigned int i=0;i<12;++i) + { + edges2.push_back(curd); + curd=curd->beta(1)->beta(2)->beta(1); + } + assert( curd==dh->beta(1)->beta(1)->beta(2)->beta(1)->beta(1)->beta(2) ); + + Dart_handle f1= + insert_cell_2_in_cell_3(*(scene.lcc),edges1.begin(),edges1.end()); + + Dart_handle f2= + insert_cell_2_in_cell_3(*(scene.lcc),edges2.begin(),edges2.end()); + + f1->attribute<3>()->info().color()= + (CGAL::Color(myrandom.get_int(0,256), + myrandom.get_int(0,256), + myrandom.get_int(0,256))); + f2->attribute<3>()->info().color()= + (CGAL::Color(myrandom.get_int(0,256), + myrandom.get_int(0,256), + myrandom.get_int(0,256))); + + update_volume_list_add(dh->attribute<3>()); + update_volume_list_add(f1->attribute<3>()); + + mengerVolumes.push_back(f1->beta(2)); + mengerVolumes.push_back(f2->beta(2)); + + split_face_in_nine(f1->beta(1)); + split_face_in_nine(f2->beta(1)); + + split_vol_in_nine(dh,false); + split_vol_in_nine(f1->beta(2),true); + split_vol_in_nine(f2->beta(2),false); +} + +void MainWindow::process_full_slice(Dart_handle init, + std::vector& faces, + int markVols) +{ + Dart_handle d[12]; + d[0]=init->beta(1)->beta(2); + d[1]=d[0]->beta(3)->beta(1)->beta(2)->beta(1); + d[2]=d[1]->beta(1)->beta(2)->beta(1); + d[3]=d[2]->beta(3)->beta(1)->beta(2)->beta(1); + + d[4]=init->beta(1)->beta(1)->beta(2); + d[5]=d[4]->beta(3)->beta(0)->beta(2)->beta(0); + d[6]=d[5]->beta(0)->beta(2)->beta(0); + + d[7]=d[6]->beta(3)->beta(0)->beta(2)->beta(0); + d[8]=d[7]->beta(3)->beta(0)->beta(2)->beta(0); + d[9]=d[8]->beta(0)->beta(2)->beta(0); + + d[10]=d[9]->beta(3)->beta(0)->beta(2)->beta(0); + d[11]=d[10]->beta(3)->beta(0)->beta(2)->beta(0); + + for (unsigned int j=0; j<12; ++j) + { + if ( !(scene.lcc)->is_marked(d[j], markVols) ) + { + CGAL::mark_cell(*(scene.lcc), d[j], markVols); + } + faces.push_back(d[j]); + } +} + +void MainWindow::process_inter_slice(Dart_handle init, + std::vector& faces, + int markVols) +{ + Dart_handle d[24]; + d[0]=init; + d[1]=d[0]->beta(0)->beta(2)->beta(3)->beta(2)->beta(0); + d[2]=d[1]->beta(0)->beta(2)->beta(3)->beta(2)->beta(0); + d[3]=d[2]->beta(1)->beta(1)->beta(2)->beta(3)->beta(2); + d[4]=d[3]->beta(1)->beta(1)->beta(2)->beta(3)->beta(2); + d[5]=d[0]->beta(1)->beta(1)->beta(2)->beta(3)->beta(2); + d[6]=d[5]->beta(1)->beta(1)->beta(2)->beta(3)->beta(2); + d[7]=d[6]->beta(0)->beta(2)->beta(3)->beta(2)->beta(0); + + init = init->beta(3)->beta(2)->beta(1)->beta(1)->beta(2); + d[8]=init; + d[9]=d[8]->beta(3)->beta(1)->beta(2)->beta(3)->beta(2)->beta(1); + d[10]=d[9]->beta(1)->beta(2)->beta(3)->beta(2)->beta(1)->beta(3); + d[11]=d[10]->beta(3)->beta(0)->beta(0)->beta(2)->beta(3)->beta(2); + d[12]=d[11]->beta(0)->beta(0)->beta(2)->beta(3)->beta(2)->beta(3); + d[13]=d[8]->beta(3)->beta(0)->beta(0)->beta(2)->beta(3)->beta(2); + d[14]=d[13]->beta(0)->beta(0)->beta(2)->beta(3)->beta(2)->beta(3); + d[15]=d[14]->beta(3)->beta(1)->beta(2)->beta(3)->beta(2)->beta(1); + + d[16]=d[0]->beta(3)->beta(1)->beta(2); + d[17]=d[0]->beta(3)->beta(1)->beta(1)->beta(2); + + d[18]=d[4]->beta(3)->beta(2); + d[19]=d[4]->beta(3)->beta(0)->beta(2); + + d[20]=d[2]->beta(3)->beta(0)->beta(2); + d[21]=d[2]->beta(3)->beta(1)->beta(1)->beta(2); + + d[22]=d[6]->beta(3)->beta(2); + d[23]=d[6]->beta(3)->beta(1)->beta(2); + + for (unsigned int j=0; j<24; ++j) + { + assert( d[j]!=LCC::null_dart_handle ); + if ( !(scene.lcc)->is_marked(d[j], markVols) ) + { + CGAL::mark_cell(*(scene.lcc), d[j], markVols); + } + faces.push_back(d[j]); + } +} + +void MainWindow::onMengerDec() +{ +#ifdef CGAL_PROFILE_LCC_DEMO + CGAL::Timer timer; + timer.start(); +#endif + + this->mengerLevel--; + + // We know here the number of Menger volume: 20^mengerLevel + // thus we can directly "cut" the std::vector to the correct size. + mengerVolumes.resize(CGAL::ipower(20,mengerLevel)); + + int markVols = (scene.lcc)->get_new_mark(); + int markVertices = (scene.lcc)->get_new_mark(); + + std::vector faces; + std::vector edges; + std::vector vertices; + + // First we remove faces. + for ( std::vector::iterator itvol=mengerVolumes.begin(); + itvol!=mengerVolumes.end(); ++itvol) + { + if ( !(scene.lcc)->is_marked(*itvol, markVols) ) + { + Dart_handle init=*itvol; + CGAL::mark_cell(*(scene.lcc), init, markVols); + process_full_slice(init, faces, markVols); + init=init->beta(2)->beta(1)->beta(1)->beta(2); + process_inter_slice(init, faces, markVols); + init=init->beta(3)->beta(2)->beta(1)->beta(1)->beta(2)->beta(3); + process_full_slice(init, faces, markVols); + } + } + + for(unsigned int i = 0; i < faces.size(); i++) + { + CGAL::remove_cell(*scene.lcc, faces[i]); + } + faces.clear(); + + // Now we remove edges. + for ( std::vector::iterator itvol=mengerVolumes.begin(); + itvol!=mengerVolumes.end(); ++itvol) + { + if ( (scene.lcc)->is_marked(*itvol, markVols) ) + CGAL::unmark_cell(*(scene.lcc), *itvol, markVols); + + for (LCC::Dart_of_cell_range<3>::iterator + it=scene.lcc->darts_of_cell<3>(*itvol).begin(), + itend=scene.lcc->darts_of_cell<3>(*itvol).end(); + it!=itend; ++it) + { + if ( it->is_free(2) && ( it->is_free(3) || &*it<&*it->beta(3) ) ) + edges.push_back(it); + } + } + + assert( (scene.lcc)->is_whole_map_unmarked(markVols) ); + + for(unsigned int i = 0; i < edges.size(); i++) + { + CGAL::remove_cell(*scene.lcc, edges[i]->beta(0)); + CGAL::remove_cell(*scene.lcc, edges[i]->beta(1)); + CGAL::remove_cell(*scene.lcc, edges[i]); + } + edges.clear(); + + // Lastly we remove vertices. + for ( std::vector::iterator itvol=mengerVolumes.begin(); + itvol!=mengerVolumes.end(); ++itvol) + { + for (LCC::Dart_of_cell_basic_range<3>::iterator + it=(scene.lcc)->darts_of_cell_basic<3> + (*itvol, markVols).begin(), + itend=(scene.lcc)->darts_of_cell_basic<3> + (*itvol, markVols).end(); it!=itend; ++it) + { + if ( !(scene.lcc)->is_marked(it, markVertices) ) + { + if ( CGAL::is_removable(*scene.lcc, it) ) + vertices.push_back(it); + CGAL::mark_cell(*scene.lcc, it, markVertices); + } + } + } + + (scene.lcc)->negate_mark(markVols); + for ( std::vector::iterator itvol=mengerVolumes.begin(); + itvol!=mengerVolumes.end(); ++itvol) + { + for (LCC::Dart_of_cell_basic_range<3>::iterator + it=(scene.lcc)->darts_of_cell_basic<3> + (*itvol, markVols).begin(), + itend=(scene.lcc)->darts_of_cell_basic<3> + (*itvol, markVols).end(); it!=itend; ++it) + { + if ( (scene.lcc)->is_marked(it, markVertices) ) + CGAL::unmark_cell(*scene.lcc, it, markVertices); + } + } + + (scene.lcc)->negate_mark(markVols); + assert( (scene.lcc)->is_whole_map_unmarked(markVols) ); + assert( (scene.lcc)->is_whole_map_unmarked(markVertices) ); + + for(unsigned int i = 0; i < vertices.size(); i++) + { + CGAL::remove_cell(*scene.lcc, vertices[i]); + } + vertices.clear(); + + (scene.lcc)->free_mark(markVols); + (scene.lcc)->free_mark(markVertices); + +#ifdef CGAL_PROFILE_LCC_DEMO + timer.stop(); + std::cout<<"Time to decrease the level of menger sponge (" + <mengerLevel+1<<" -> "<mengerLevel<<"): " + <showMessage (QString ("Menger Dec"),DELAY_STATUSMSG); + emit(sceneChanged()); } -void MainWindow::extendFilledVolumes() -{ extendVolumesSatisfying( LCC_DEMO_VISIBLE | LCC_DEMO_FILLED, 0 ); } -void MainWindow::extendHiddenVolumes() -{ extendVolumesSatisfying( 0, LCC_DEMO_VISIBLE ); } #undef DELAY_STATUSMSG - -#include "MainWindow.moc" diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h index e56516824f6..921e790e55f 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h @@ -24,9 +24,9 @@ #include "typedefs.h" #include "ui_MainWindow.h" #include "ui_CreateMesh.h" +#include "ui_CreateMenger.h" #include -#include #include #include @@ -39,21 +39,27 @@ class QWidget; -class DialogMesh : public QDialog, private Ui::createMesh +class DialogMesh : public QDialog, public Ui::createMesh { Q_OBJECT public: - DialogMesh(QWidget* parent) - { - setupUi (this); - } + DialogMesh(QWidget* /*parent*/) + { setupUi (this); } int getX() { return xvalue->value(); } int getY() { return yvalue->value(); } int getZ() { return zvalue->value(); } }; +class DialogMenger : public QDialog, public Ui::createMenger +{ + Q_OBJECT + +public: + DialogMenger(QWidget* /*parent*/) + { setupUi(this); } +}; class MainWindow : public CGAL::Qt::DemosMainWindow, private Ui::MainWindow { @@ -63,72 +69,100 @@ public: MainWindow(QWidget* parent = 0); public slots: - void import_off(); - void add_off(); - void load_off(const QString& fileName, bool clear=true); - - void import_3DTDS(); - void load_3DTDS(const QString& fileName, bool clear=true); + // File menu + void on_actionImportOFF_triggered(); + void on_actionAddOFF_triggered(); + void on_actionImport3DTDS_triggered(); + void on_actionCompute_Voronoi_3D_triggered(); + void on_actionClear_triggered(); - void clear(bool msg=true); + // Creations menu + Dart_handle on_actionCreate_cube_triggered(); + void on_actionCreate3Cubes_triggered(); + void on_actionCreate2Volumes_triggered(); + void on_actionCreate_mesh_triggered(); + void on_actionCreate_Menger_Sponge_triggered(); - void create_cube(); - void create_3cubes(); - void create_2volumes(); - void create_mesh(); + // Operations menu + void on_actionSubdivide_triggered(); + void on_actionSubdivide_pqq_triggered(); + void on_actionDual_3_triggered(); + void on_actionClose_volume_triggered(); + void on_actionTriangulate_all_facets_triggered(); + void on_actionSew3_same_facets_triggered(); + void on_actionUnsew3_all_triggered(); + void on_actionMerge_all_volumes_triggered(); + void on_actionRemove_filled_volumes_triggered(); - void subdivide(); - void dual_3(); - void voronoi_3(); - void close_volume(); - void remove_filled_volumes(); - void remove_selected_volume(); - void sew3_same_facets(); - void unsew3_all(); - void triangulate_all_facets(); + // View menu + void on_actionExtend_filled_volumes_triggered(); + void on_actionExtend_hidden_volumes_triggered(); - void onSceneChanged(); + // Other slots + void load_off(const QString& fileName, bool clear=true); + void load_3DTDS(const QString& fileName, bool clear=true); + + void onSceneChanged(); void connectVolumeListHandlers(); void onCellChanged(int, int); - void onItemSelectionChanged(); void onHeaderClicked(int); - void extendVolumesSatisfying(char amask, char negatemask); - void extendFilledVolumes(); - void extendHiddenVolumes(); + void onCreateMeshOk(); - + void onMengerInc(); + void onMengerDec(); + void onMengerChange(int); + void onMengerOk(); + void onMengerCancel(); + signals: void sceneChanged(); protected: - void onNewVolume(Dart_handle adart); - void onDeleteVolume(Dart_handle adart); - void initAllNewVolumes(); - + void clear_all(); + void on_new_volume(Dart_handle adart); + void on_delete_volume(Dart_handle adart); + void init_all_new_volumes(); + void mark_all_filled_and_visible_volumes(int amark); + Dart_handle make_iso_cuboid(const Point_3 basepoint, LCC::FT lg); - void connectActions(); + void connect_actions(); + void update_operations_entries(bool show); - void update_volume_list(); - void update_volume_list_add(Dart_handle); + bool is_volume_in_list(LCC::Attribute_handle<3>::type ah); + void recreate_whole_volume_list(); + void update_volume_list_all_ckeckstates(); + void update_volume_list_add(LCC::Attribute_handle<3>::type ah); void update_volume_list_remove(int); + void update_volume_list_remove(LCC::Attribute_handle<3>::type ah); + void split_edge_in_three (Dart_handle dh); + void split_face_in_three (Dart_handle dh); + void split_face_in_nine (Dart_handle dh); + void split_vol_in_three (Dart_handle dh, bool removecenter); + void split_vol_in_nine (Dart_handle dh, bool removecenter); + void split_vol_in_twentyseven(Dart_handle dh); + void process_full_slice(Dart_handle init, + std::vector& faces, + int markVols); + void process_inter_slice(Dart_handle init, + std::vector& faces, + int markVols); + Scene scene; - Timer timer; unsigned int nbcube; - QLabel* statusMessage; - DialogMesh dialogmesh; - CGAL::Random random; + QLabel* statusMessage; + DialogMesh dialogmesh; + DialogMenger dialogmenger; + + int mengerLevel; + std::vector mengerVolumes; QDockWidget* volumeListDock; QTableWidget* volumeList; - - int volumeUid; - std::vector< std::pair > volumeDartIndex; - std::vector< char > volumeProperties; }; #endif diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui index 4934037987b..74e113a34b3 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.ui @@ -54,15 +54,16 @@ &Operations - - - - - + + + + + + @@ -72,6 +73,7 @@ + @@ -105,7 +107,12 @@ - &Subdivide + &Subdivide all volumes + + + + + &Subdivide all volumes - by Pqq @@ -118,11 +125,6 @@ Import 3D&TS - - - Display info - - &Clear @@ -140,7 +142,7 @@ - &Close volumes + &Close all volumes @@ -150,7 +152,7 @@ - S&ew3 same facets + S&ew3 all same facets @@ -158,24 +160,24 @@ Create &mesh + + + Create Menger Sponge + + - &Remove filled volumes + &Remove volumes - &Triangulate all facets + &Triangulate facets - &Unsew3 all - - - - - Remove selected &volume + &Unsew3 volumes @@ -191,11 +193,6 @@ Extend &filled volumes - - - Extend &wireframe volumes - - Extend &hidden volumes @@ -206,6 +203,11 @@ Compute Voronoi 3D + + + &Merge volumes + + @@ -214,8 +216,6 @@
Viewer.h
- - - + diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp index 31560097106..953aa895ee7 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.cpp @@ -28,23 +28,25 @@ CGAL::Bbox_3 Viewer::bbox() { CGAL::Bbox_3 bb; - if ( scene->lcc->is_empty() ) + bool empty = true; + for (LCC::Attribute_range<3>::type::iterator + it=scene->lcc->attributes<3>().begin(), + itend=scene->lcc->attributes<3>().end(); it!=itend; ++it ) + { + if ( it->info().is_visible() ) + { + empty = false; + for( LCC::Dart_of_cell_range<3>::iterator + it2=scene->lcc->darts_of_cell<3>(it->dart()).begin(); + it2.cont(); ++it2) + bb = bb + LCC::point(it2).bbox(); + } + } + + if ( empty ) { bb = LCC::Point(CGAL::ORIGIN).bbox(); - } - else - { - for(unsigned int i = 0; i < pVolumeDartIndex->size(); i++) - { - if( ::isVisible((*pVolumeProperties)[i])) - { - for( LCC::Dart_of_cell_range<3>::iterator - it=scene->lcc->darts_of_cell<3>((*pVolumeDartIndex)[i].second).begin(), - itend=scene->lcc->darts_of_cell<3>((*pVolumeDartIndex)[i].second).end(); - it.cont(); ++it) - bb = bb + LCC::point(it).bbox(); - } - } + bb = bb + LCC::Point(1,1,1).bbox(); // To avoid a warning from Qglviewer } return bb; @@ -73,14 +75,14 @@ void Viewer::drawFacet(Dart_const_handle ADart) assert( ADart->attribute<3>()!=NULL ); // double r = (double)ADart->attribute<3>()->info().r()/255.0; - double r = (double)ADart->attribute<3>()->info().r()/255.0; - double g = (double)ADart->attribute<3>()->info().g()/255.0; - double b = (double)ADart->attribute<3>()->info().b()/255.0; + double r = (double)ADart->attribute<3>()->info().color().r()/255.0; + double g = (double)ADart->attribute<3>()->info().color().g()/255.0; + double b = (double)ADart->attribute<3>()->info().color().b()/255.0; if ( !ADart->is_free(3) ) { - r += (double)ADart->beta(3)->attribute<3>()->info().r()/255.0; - g += (double)ADart->beta(3)->attribute<3>()->info().g()/255.0; - b += (double)ADart->beta(3)->attribute<3>()->info().b()/255.0; + r += (double)ADart->beta(3)->attribute<3>()->info().color().r()/255.0; + g += (double)ADart->beta(3)->attribute<3>()->info().color().g()/255.0; + b += (double)ADart->beta(3)->attribute<3>()->info().color().b()/255.0; r /= 2; g /= 2; b /= 2; } @@ -142,8 +144,7 @@ void Viewer::draw_one_vol(Dart_const_handle adart, bool filled) it.cont(); ++it) { drawFacet(it); - if(edges) drawEdges(it); - + if (edges) drawEdges(it); } } else @@ -171,21 +172,23 @@ void Viewer::draw() if ( m.is_empty() ) return; - for(unsigned int i = 0; i < pVolumeDartIndex->size(); i++) + for (LCC::Attribute_range<3>::type::iterator + it=m.attributes<3>().begin(), + itend=m.attributes<3>().end(); it!=itend; ++it ) { - if( ::isVisible((*pVolumeProperties)[i])) + if ( it->info().is_visible() ) { - if(selectedVolumeIndex == (int)i) glLineWidth(5.0f); - draw_one_vol((*pVolumeDartIndex)[i].second, - ::isFilled((*pVolumeProperties)[i])); - if(selectedVolumeIndex == (int)i) glLineWidth(1.4f); + // TODO allow to select one volume ? + // if(selectedVolumeIndex == (int)i) glLineWidth(5.0f); + draw_one_vol(it->dart(), it->info().is_filled()); + // if(selectedVolumeIndex == (int)i) glLineWidth(1.4f); if(vertices) { for( LCC::One_dart_per_incident_cell_range<0,3>::iterator - it(m, (*pVolumeDartIndex)[i].second); it.cont(); ++it) + it2(m, it->dart()); it2.cont(); ++it2) { - LCC::Point p = m.point(it); + LCC::Point p = m.point(it2); glBegin(GL_POINTS); glColor3f(.6f,.2f,.8f); glVertex3f( p.x(),p.y(),p.z()); @@ -209,8 +212,6 @@ void Viewer::init() setKeyDescription(Qt::Key_F, "Toggles flat shading display"); setKeyDescription(Qt::Key_E, "Toggles edges display"); setKeyDescription(Qt::Key_V, "Toggles vertices display"); - setKeyDescription(Qt::Key_Z, "Next mode filled facet"); - setKeyDescription(Qt::Key_R, "Select next volume, used for filled facet"); // Light default parameters ::glLineWidth(1.4f); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 93ffeee7424..6569a10547e 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -24,7 +24,6 @@ #include "typedefs.h" #include #include -#include class Viewer : public QGLViewer { @@ -36,20 +35,15 @@ class Viewer : public QGLViewer bool flatShading; bool edges; bool vertices; - unsigned int modeFilledFacet; - int selectedVolumeIndex; typedef LCC::Dart_handle Dart_handle; typedef LCC::Dart_const_handle Dart_const_handle; - std::vector >* pVolumeDartIndex; - std::vector* pVolumeProperties; - public: Viewer(QWidget* parent) : QGLViewer(parent), wireframe(false), flatShading(true), - edges(true), vertices(true), modeFilledFacet(0), selectedVolumeIndex(-1) + edges(true), vertices(true) {} void setScene(Scene* scene_) @@ -57,18 +51,6 @@ public: scene = scene_; } - void setVectorPointers(std::vector >* v1, - std::vector* v2) - { - pVolumeDartIndex = v1; - pVolumeProperties = v2; - } - - void setSelectedVolumeIndex(int index) - { - selectedVolumeIndex = index; - } - public: void draw(); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h b/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h index 14b6ae8c23a..d047a95fe5a 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -35,17 +36,66 @@ #include #include -template -struct Average_functor : public std::binary_function +// Global random +extern CGAL::Random myrandom; + +// Use to define properties on volumes. +#define LCC_DEMO_VISIBLE 1 // if not visible => hidden +#define LCC_DEMO_FILLED 2 // if not filled, wireframe + +class Volume_info { - void operator()(Cell& acell1,Cell& acell2) - { - acell1.attribute()= - CGAL::Color((acell1.attribute().r()+acell2.attribute().r())/2, - (acell1.attribute().g()+acell2.attribute().g())/2, - (acell1.attribute().b()+acell2.attribute().b())/2); +public: + Volume_info() : m_color(CGAL::Color(myrandom.get_int(0,256), + myrandom.get_int(0,256), + myrandom.get_int(0,256))), + m_status( LCC_DEMO_VISIBLE | LCC_DEMO_FILLED ) + {} + + CGAL::Color& color() + { return m_color; } + const CGAL::Color& color() const + { return m_color; } + + std::string color_name() const + { + std::ostringstream ss; + ss< Dart; typedef CGAL::Cell_attribute_with_point< Refs > Vertex_attrib; - typedef CGAL::Cell_attribute< Refs, CGAL::Color > Volume_attrib; + typedef CGAL::Cell_attribute< Refs, Volume_info> Volume_attrib; typedef CGAL::cpp0x::tuple Attributes; @@ -78,19 +128,4 @@ struct Scene { LCC* lcc; }; -// Use to define properties on volumes. -#define LCC_DEMO_VISIBLE 1 // if not visible => hidden -#define LCC_DEMO_FILLED 2 // if not filled, wireframe - -bool isVisibleAndFilled(char property); -bool isVisible(char property); -bool isFilled(char property); -char setVisible(char property); -char setHidden(char property); -char setFilled(char property); -char setWireframe(char property); -char setVisibleAndFilled(char property); -char negateVisible(char property); -char negateFilled(char property); - #endif diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index f27a2cb40be..560ffee3e61 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -32,6 +32,8 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "linear_cell_complex_4.cpp" ) create_single_source_cgal_program( "linear_cell_complex_3_with_colored_vertices.cpp" ) + create_single_source_cgal_program( + "linear_cell_complex_3_with_mypoint.cpp" ) create_single_source_cgal_program("plane_graph_to_lcc_2.cpp") diff --git a/Linear_cell_complex/examples/Linear_cell_complex/README.txt b/Linear_cell_complex/examples/Linear_cell_complex/README.txt index c8cd56f2391..4001f29b2e1 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/README.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/README.txt @@ -27,3 +27,8 @@ Examples for Linear_cell_complex package: * voronoi_3.cpp Example showing how to compute 3D voronoi diagram of a set of 3D points. + + +* linear_cell_complex_3_with_mypoint.cpp + + Example showing how to customize the type of points used in LCC. diff --git a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_triangulation.cpp b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_triangulation.cpp index 344074854b0..8805c22db94 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_triangulation.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_triangulation.cpp @@ -103,8 +103,7 @@ void constrained_delaunay_triangulation(LCC_3 &lcc, Dart_handle d1) //inserting the constraints edge by edge LCC_3::Dart_of_orbit_range<1>::iterator - it(lcc.darts_of_orbit<1>(d1).begin()), - itbegin(lcc.darts_of_orbit<1>(d1).begin()); + it(lcc.darts_of_orbit<1>(d1).begin()); CDT::Vertex_handle previous=NULL, first=NULL, vh=NULL; diff --git a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_mypoint.cpp b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_mypoint.cpp new file mode 100644 index 00000000000..40b052eafcf --- /dev/null +++ b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_mypoint.cpp @@ -0,0 +1,90 @@ +#include +#include +#include +#include + +template +struct mypoint : public K::Point_3 +{ + typedef typename K::Point_3 Base; + + mypoint() : mtype('a') + {} + + mypoint(const Base& apoint) : Base(apoint), + mtype('b') + {} + + mypoint(const mypoint& apoint) : Base(apoint), + mtype('c') + {} + + mypoint(typename K::FT a, typename K::FT b, typename K::FT c) : Base(a,b,c), + mtype('d') + {} + + char type() const + { return mtype; } + +private: + char mtype; +}; + +template +struct mytraits: public CGAL::Linear_cell_complex_traits<3, K> +{ + typedef mypoint Point; +}; + +typedef mytraits Traits; + +typedef CGAL::Linear_cell_complex<3,3, Traits> LCC_3; +typedef LCC_3::Dart_handle Dart_handle; +typedef LCC_3::Point Point; +typedef LCC_3::FT FT; + +Dart_handle make_iso_cuboid(LCC_3& lcc, const Point& basepoint, FT lg) +{ + return lcc.make_hexahedron(basepoint, + Traits::Construct_translated_point() + (basepoint,Traits::Vector(lg,0,0)), + Traits::Construct_translated_point() + (basepoint,Traits::Vector(lg,lg,0)), + Traits::Construct_translated_point() + (basepoint,Traits::Vector(0,lg,0)), + Traits::Construct_translated_point() + (basepoint,Traits::Vector(0,lg,lg)), + Traits::Construct_translated_point() + (basepoint,Traits::Vector(0,0,lg)), + Traits::Construct_translated_point() + (basepoint,Traits::Vector(lg,0,lg)), + Traits::Construct_translated_point() + (basepoint,Traits::Vector(lg,lg,lg))); +} + +int main() +{ + LCC_3 lcc; + + // Create two iso_cuboids. + Dart_handle d1 = make_iso_cuboid(lcc, Point(-2, 0, 0), 1); + Dart_handle d2 = make_iso_cuboid(lcc, Point(0, 0, 0), 1); + + // 3-Sew the two cubes along one facet. + lcc.sew<3>(d1->beta(1)->beta(1)->beta(2), d2->beta(2)); + + // Barycentric triangulation of the facet between the two cubes. + lcc.insert_barycenter_in_cell<2>(d2->beta(2)); + + // Display all the vertices of the map. + for (LCC_3::Vertex_attribute_range::iterator + it=lcc.vertex_attributes().begin(), + itend=lcc.vertex_attributes().end(); + it!=itend; ++it) + { + std::cout<<"point: "<point()<<", "<<"type: "<point().type() + <darts().begin()), itend(this->darts().end()); it!=itend; ++it ) { - if ( !this->is_marked(it, mymark) ) + if ( !this->is_marked(it, mymark) && this->is_marked(it, AMark) ) { Point min_point=point(it); Dart_handle min_dart = it; @@ -264,6 +265,8 @@ namespace CGAL { } one_dart_per_facet[min_point].push_back(min_dart); } + else + this->mark(it, mymark); } // Second we run through the map: candidates for sew3 have necessary the diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h index ed4dc6cbb39..ea9381f0c60 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_operations.h @@ -38,7 +38,7 @@ namespace CGAL { */ template typename LCC::Vector compute_normal_of_cell_2 - (const LCC& amap, typename LCC::Dart_const_handle adart) + (const LCC& /*amap*/, typename LCC::Dart_const_handle adart) { // TODO Better approximation by using Newell's method // Nx += (Vy - V'y) * (Vz + V'z); diff --git a/Maintenance/git/authors-file.txt b/Maintenance/git/authors-file.txt index 5aa965657c5..ca2ae575ec4 100644 --- a/Maintenance/git/authors-file.txt +++ b/Maintenance/git/authors-file.txt @@ -1,22 +1,27 @@ abru = Antoine Bru afabri = Andreas Fabri -ameyer = Andreas Meyer -andreasfabri = Andreas Fabri akobel = Alexander Kobel +algerbya = Yacine Bouzidi amebarki = Abdelkrim Mebarki +ameyer = Andreas Meyer ameyer = Andreas Meyer amitgupta = Amit Gupta analekta = Costas Tsirogiannis +andreasfabri = Andreas Fabri andyslj = Le-Jeng Shiue asafpor = Asaf Porat asm = Pavel Emeliyanenko +atsui = Alex Tsui avaxman = Amir Vaxman baesken = Matthias Bäsken +balasmic = Michal Kleinbort baruchzu = Baruch Zukerman bgalehouse = Ben Galehouse cbonetto = Carine Bonetto cdelage = Christophe Delage cgal-web-admin = CGAL Web Admin +cggaurav = Gaurav Chandrashekar +cjamin = Clément Jamin cvs2svn = CVS2SVN tool cwormser = Camille Wormser danha = Dan Halperin @@ -24,6 +29,7 @@ dave = David Millman dboltcheva = Dobrina Boltcheva dima = Dmitrii V Pasechnik drussel = Daniel Russel +dtyagi = Devashish Tyagi efif = Efi Fogel elip = Eli Packer eric = Eric Berberich @@ -58,23 +64,28 @@ hert = Susan Hert hervebronnimann = Hervé Brönnimann hoffmann = Michael Hoffmann isuslov = Ilya Suslov +iyaz = Ílker Yaz jeanmoug = Marc Jeanmougin jflotott = Julia Flötotto jhazebro = Julien Hazebrouck jlenorma = Jacques Le Normand jtournoi = Jane Tournois +jzhou = Jin Zhou kacper_rzepecki = Kacper Rzepecki kettner = Lutz Kettner +klshi = Kanle Shi leiserow = Eran Leiserowitz lrineau = Laurent Rineau lsaboret = Laurent Saboret marc = Marc Scherfenberg +markblome = Mark Blome mbogdanov = Mikhail Bogdanov mcaroli = Manuel Caroli mconstan = Mihaela Constantinescu mkaravel = Menelaos Karavelas mkerber = Michael Kerber mpouget = Marc Pouget +mschmitt = Mathieu Schmitt naamamay = Naama Mayer nicokruithof = Nico Kruithof nmeskini = Naceur Meskini @@ -87,7 +98,9 @@ osbild = Ralf Osbild ovgrig = Ovidiu Grigore palliez = Pierre Alliez penarand = Luis Peñaranda +pivanov = Petar Ivanov pmachado = Pedro Machado Manhaes de Castro +pmemari = Pooran Memari pmoeller = Philipp Möller rahul = Rahul Ray rchaine = Raphaëlle Chaine @@ -98,6 +111,7 @@ rursu = Radu Ursu sabath = Niv Sabath sccode = Fei (Sophie) Che seel = Michael Seel +sgiraudo = Simon Giraudot shaihi = Shai Hirsch shornus = Samuel Hornus singler = Johannes Singler @@ -106,6 +120,7 @@ sloriot = Sébastien Loriot soudot = Steve Oudot spion = Sylvain Pion spostoll = Stéphane Postollec +sradhak = Sandhyaa Radhakrishnan sschaeff = Sarah Schäffer stayeb = Stéphane Tayeb sven = Sven Schönherr @@ -113,8 +128,12 @@ talizvi = Tali Zvi teillaud = Monique Teillaud tgeorgiou = Teo Georgiou trung = Trung Nguyen +vfisikop = Vissarion Fisikopoulos +vgagrani = Vinayak Gagrani +vlopez = Victor Lopez wein = Ron Wein wenzlaff = Patrick Wenzlaff ybrise = Yves Brise yuchen = Yuanmi Chen yvinec = Mariette Yvinec +yzju = Yin Xu diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index 8933715e931..05d89edf5ab 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -15,20 +15,19 @@ # Create internal release # The script also updates the manual tools. + + +# SPECIAL TEST: test Script-improve_create_cmake-eric instead of next +#0 21 * * Tue,Wed,Thu,Fri cd $HOME/CGAL/create_internal_release && $HOME/bin/create_release $HOME/CGAL/branches/Script-improve_create_cmake-eric $HOME/CGAL/candidate-packages --public --do-it + + # "next" alone -#0 21 * * Mon,Tue,Wed,Thu,Fri,Sun cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/next --public --do-it - -#0 21 * * Fri cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/next --public --do-it +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,Sun cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/next $HOME/CGAL/candidate-packages --public --do-it +0 21 * * Mon,Tue,Wed,Thu,Fri cd $HOME/CGAL/create_internal_release && $HOME/bin/create_release $HOME/CGAL/next $HOME/CGAL/candidate-packages --public --do-it +# - from branch 4.0 +0 21 * * Sun cd $HOME/CGAL/create_internal_release-4.0-branch && $HOME/bin/create_release $HOME/CGAL/CGAL-4.0-branch --public --do-it -# - on trunk -#0 21 * * Sat cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/trunk --public --do-it -# - from branch 3.9 -#0 21 * * Sat cd $HOME/CGAL/create_internal_release-3.9-branch; $HOME/bin/create_release $HOME/CGAL/CGAL-3.9-branch --public --do-it - -# A test that does not work -#30 21 * * * grep 'conflicts with' $HOME/CGAL/create_internal_release/create_release.log.`date '+%Y-%m-%d'`* --no-filename # Try to launch the test suite, every 10mn, from 21:00 to 22:50 */10 21-22 * * * $HOME/CGAL/Scripts/developer_scripts/autotest_cgal_with_cmake @@ -39,11 +38,23 @@ # Dump the crontab to SVN every hour at minute 18 18 * * * * $HOME/bin/dump_crontab -# Old stuff + +#################################### +# Old stuff +#################################### + # - from branch 3.4 #0 21 * * Sat cd $HOME/CGAL/create_internal_release-3.4-branch; $HOME/bin/create_release $HOME/CGAL/CGAL-3.4-branch --public --do-it # - from branch 3.7 #0 21 * * Fri cd $HOME/CGAL/create_internal_release-3.7-branch; $HOME/bin/create_release $HOME/CGAL/CGAL-3.7-branch --public --do-it +# - from branch 3.9 +#0 21 * * Sat cd $HOME/CGAL/create_internal_release-3.9-branch; $HOME/bin/create_release $HOME/CGAL/CGAL-3.9-branch --public --do-it +# - on trunk +#0 21 * * Sat cd $HOME/CGAL/create_internal_release; $HOME/bin/create_release $HOME/CGAL/trunk --public --do-it # Check the links of http://www.cgal.org/projects.html every sunday at 17:42 #42 17 * * Sun linklint -host www.cgal.org -http /projects.html -net -no_anchors -quiet -silent -error + +# A test that does not work +#30 21 * * * grep 'conflicts with' $HOME/CGAL/create_internal_release/create_release.log.`date '+%Y-%m-%d'`* --no-filename + diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/partition-table-sda.txt b/Maintenance/infrastructure/cgal.geometryfactory.com/partition-table-sda.txt new file mode 100644 index 00000000000..7ba18c16b03 --- /dev/null +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/partition-table-sda.txt @@ -0,0 +1,12 @@ +# partition table of /dev/sda +unit: sectors + +/dev/sda1 : start= 63, size= 20482812, Id=fd, bootable +/dev/sda2 : start= 20482875, size= 16383174, Id=fd +/dev/sda3 : start= 36866049, size=2893406016, Id= f +/dev/sda4 : start= 0, size= 0, Id= 0 +/dev/sda5 : start= 36866050, size=2893406015, Id=fd +# +# Restore with: +# sfdisk --force /dev/sda < partition-table-sda.txt +# diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/reference-platforms/common-setup b/Maintenance/infrastructure/cgal.geometryfactory.com/reference-platforms/common-setup index fa626e94f81..00269c3bdcf 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/reference-platforms/common-setup +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/reference-platforms/common-setup @@ -11,5 +11,5 @@ LD_LIBRARY_PATH=/usr/local/packages/qt4.7/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH -ESBTL_INC_DIR=$HOME/CGAL/esbtl/include +ESBTL_INC_DIR=$HOME/CGAL/esbtl/trunk/include export ESBTL_INC_DIR diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/boost/README.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/README.txt new file mode 100644 index 00000000000..b84e9664d2a --- /dev/null +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/README.txt @@ -0,0 +1,16 @@ +user-config.jam + Copy to tools/build/v2/ + +compile-boost + Shell script to launch the compilation of Boost libraries with + several configurations (different ABI). + + +The configurations are: + - in stage/ for all g++ compilers with default options, gcc>=4.5, + - in stage-intel/ for the Intel compilers, + - in stage-cxxdebug/ for the g++ compilers with the STL debug mode + (different ABI), for gcc>=4.6. + +In addition, there is a configuration in stage-4.1/ for the g++-4.1 +compiler (the one used on the Linux distribution RHEL 5). diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/boost/compile-boost b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/compile-boost index 07f4ef4fa3b..3fc552d4281 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/boost/compile-boost +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/compile-boost @@ -1,6 +1,16 @@ -./bjam toolset=gcc-4.6.2 -./bjam toolset=gcc-cxxdebug --stagedir=stage-cxxdebug +#!/bin/sh + +OPTS="-j4 --layout=tagged link=shared variant=release threading=multi" +OPTS="$OPTS --without-python --without-test --without-mpi --without-wave --without-graph_parallel" + +BJAM=./bjam +if [ ! -x $BJAM ]; then + BJAM=bjam +fi + +"$BJAM" --stagedir=stage-4.1 $OPTS toolset=gcc-4.1 +"$BJAM" $OPTS toolset=gcc-4.5.4 +"$BJAM" --stagedir=stage-cxxdebug $OPTS toolset=gcc-cxxdebug source ~/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/setup -./bjam toolset=intel --stagedir=stage-intel cxxflags="-D__SIZEOF_LONG__=8 -D__SIZEOF_LONG_LONG__=8" - +"$BJAM" --stagedir=stage-intel $OPTS toolset=intel cxxflags="-D__SIZEOF_LONG__=8 -D__SIZEOF_LONG_LONG__=8" diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam index 3462424b5f1..60d4ad326c3 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/boost/user-config.jam @@ -44,6 +44,8 @@ # Configure specific gcc version, giving alternative name to use. # using gcc : 3.2 : g++-3.2 ; +# G++ 4.5 +using gcc : : /usr/local/packages/gcc-4.5/bin/g++ ; # ------------------- # MSVC configuration. @@ -93,6 +95,12 @@ using gcc : cxxdebug - : "/usr/lib64/ccache/g++" # your path to the C++0x compiler + : "/usr/lib64/ccache/g++" # your path to the C++ compiler : -D_GLIBCXX_DEBUG ; + +using gcc + : 4.1 + : "/usr/local/bin/g++41" + : + ; diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/CMakeCache.txt index 38aacb0608a..5fd5eab8fcb 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/CMakeCache.txt @@ -17,6 +17,9 @@ //Build shared libraries BUILD_SHARED_LIBS:BOOL=ON +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch @@ -24,13 +27,13 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so +//Boost thread library (release) +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so //Value Computed by CMake CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi @@ -51,7 +54,7 @@ CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86 CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -97,7 +100,7 @@ CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/ CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO @@ -106,7 +109,7 @@ CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -118,7 +121,7 @@ CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 @@ -130,7 +133,7 @@ CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16-strict-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -993,6 +996,12 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include @@ -1177,8 +1186,8 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104900 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/boost-release-branch -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib //ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=1 @@ -1363,7 +1372,7 @@ CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=6 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 //Path to CMake executable. @@ -1490,7 +1499,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 -CONFIG_CXX_FLAGS:INTERNAL=-D__SIZEOF_LONG__=8 -D__SIZEOF_LONG_LONG__=8 -fp-model strict -strict-ansi -DBOOST_NO_HASH -diag-disable 980 -diag-disable 11 -w1 -O3 +CONFIG_CXX_FLAGS:INTERNAL=-D__SIZEOF_LONG__=8 -D__SIZEOF_LONG_LONG__=8 -fp-model strict -strict-ansi -DBOOST_NO_HASH -diag-disable 980 -diag-disable 11 -diag-disable 1292 -diag-disable 279 -diag-disable 2536 -w1 -O3 //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1988,6 +1997,10 @@ X11_SM_LIB-ADVANCED:INTERNAL=1 X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XSync_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/CMakeCache.txt index 81a59e476e1..beb8c651235 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/CMakeCache.txt @@ -17,6 +17,9 @@ //Build shared libraries BUILD_SHARED_LIBS:BOOL=ON +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch @@ -24,13 +27,13 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so +//Boost thread library (release) +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so //Value Computed by CMake CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16 @@ -51,7 +54,7 @@ CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86 CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -97,7 +100,7 @@ CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/ CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO @@ -106,7 +109,7 @@ CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -118,7 +121,7 @@ CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 @@ -130,7 +133,7 @@ CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_IntelCompiler-12.0-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -993,6 +996,12 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include @@ -1177,8 +1186,8 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104900 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/boost-release-branch -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage-intel/lib //ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=1 @@ -1363,7 +1372,7 @@ CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=6 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 //Path to CMake executable. @@ -1490,7 +1499,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 -CONFIG_CXX_FLAGS:INTERNAL=-D__SIZEOF_LONG__=8 -D__SIZEOF_LONG_LONG__=8 -fp-model strict -DBOOST_NO_HASH -diag-disable 980 -diag-disable 11 -w1 -O3 +CONFIG_CXX_FLAGS:INTERNAL=-D__SIZEOF_LONG__=8 -D__SIZEOF_LONG_LONG__=8 -fp-model strict -DBOOST_NO_HASH -diag-disable 980 -diag-disable 11 -diag-disable 1292 -diag-disable 279 -diag-disable 2536 -w1 -O3 //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1988,6 +1997,10 @@ X11_SM_LIB-ADVANCED:INTERNAL=1 X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XSync_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/CMakeCache.txt index 69f54188f2a..b9212e3748f 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16 +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16 # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.44-beta1/include @@ -21,16 +27,19 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.44-beta1/include Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so //Path to a library. Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND //Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16 +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16 + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF //Directory containing the Maintenance package CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -39,13 +48,13 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING= -std=c++0x -frounding-math //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -85,43 +94,46 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/ImageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so + //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/Qt3 +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/Qt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -203,6 +215,9 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/usr/local @@ -1037,6 +1052,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=/usr/lib64/libICE.so +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=/usr/lib64/libSM.so @@ -1046,9 +1064,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1127,6 +1154,12 @@ X11_Xinput_LIB:FILEPATH=/usr/lib64/libXi.so //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1218,8 +1251,10 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104400 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/1.44-beta1/include -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.44-beta1/lib;/home/lrineau/CGAL/boost/1.44-beta1/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.44-beta1/lib +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=TRUE @@ -1253,6 +1288,9 @@ CGAL_CFG_NO_CPP0X_ARRAY_COMPILED:INTERNAL=TRUE CGAL_CFG_NO_CPP0X_AUTO:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_AUTO_COMPILED:INTERNAL=TRUE +CGAL_CFG_NO_CPP0X_COPY_N:INTERNAL=0 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_COPY_N_COMPILED:INTERNAL=TRUE CGAL_CFG_NO_CPP0X_DECLTYPE:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_DECLTYPE_COMPILED:INTERNAL=TRUE @@ -1277,6 +1315,9 @@ CGAL_CFG_NO_CPP0X_LAMBDAS_COMPILED:INTERNAL=TRUE CGAL_CFG_NO_CPP0X_LONG_LONG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_LONG_LONG_COMPILED:INTERNAL=TRUE +CGAL_CFG_NO_CPP0X_NEXT_PREV:INTERNAL=0 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_NEXT_PREV_COMPILED:INTERNAL=TRUE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE_COMPILED:INTERNAL=TRUE @@ -1335,7 +1376,7 @@ CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE //Variable hidden from user -CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so //Variable hidden from user CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 @@ -1357,8 +1398,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_Qt3_3RD_PARTY_DEFINITIONS:INTERNAL=-DQT_SHARED;-DQT_NO_DEBUG;-DQT_THREAD_SUPPORT;-D_REENTRANT @@ -1392,13 +1433,13 @@ CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //MODIFIED property for variable: CMAKE_BUILD_TYPE CMAKE_BUILD_TYPE-MODIFIED:INTERNAL=1 //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16 +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_CXX0X-F16 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1453,6 +1494,8 @@ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Unix Makefiles //Have function connect @@ -1525,6 +1568,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +CONFIG_CXX_FLAGS:INTERNAL=-std=c++0x -frounding-math //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1532,9 +1576,9 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib64/libGL.so][v()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB -FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/include][/usr/lib64/libz.so][v1.2.5()] +FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE GCC_COMPILE_RES:INTERNAL=TRUE //Result of TRY_RUN @@ -2060,14 +2104,22 @@ X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2120,6 +2172,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/CMakeCache.txt index 38a7513fa9a..6aff88e6843 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16 +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16 # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.45/include @@ -21,16 +27,19 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.45/include Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/1.45/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so +//Boost thread library (release) +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16 +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16 + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF //Directory containing the Maintenance package CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -39,13 +48,13 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING= -frounding-math //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -85,19 +94,22 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/ImageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so + //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -115,25 +127,25 @@ CGAL_PDB_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platform CGAL_PDB_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALPDB //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/Qt3 +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/Qt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so;general;/home/lrineau/next/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -215,6 +227,9 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/usr/local @@ -1058,6 +1073,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=/usr/lib64/libICE.so +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=/usr/lib64/libSM.so @@ -1067,9 +1085,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1148,6 +1175,12 @@ X11_Xinput_LIB:FILEPATH=/usr/lib64/libXi.so //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1239,8 +1272,10 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104500 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/1.45/include -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.45/lib;/home/lrineau/CGAL/boost/1.45/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.45/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.45/lib +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=TRUE @@ -1274,6 +1309,9 @@ CGAL_CFG_NO_CPP0X_ARRAY_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_AUTO:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_AUTO_COMPILED:INTERNAL=FALSE +CGAL_CFG_NO_CPP0X_COPY_N:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_COPY_N_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_DECLTYPE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_DECLTYPE_COMPILED:INTERNAL=FALSE @@ -1298,6 +1336,9 @@ CGAL_CFG_NO_CPP0X_LAMBDAS_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_LONG_LONG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_LONG_LONG_COMPILED:INTERNAL=TRUE +CGAL_CFG_NO_CPP0X_NEXT_PREV:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_NEXT_PREV_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE_COMPILED:INTERNAL=FALSE @@ -1356,7 +1397,7 @@ CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE //Variable hidden from user -CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so //Variable hidden from user CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 @@ -1378,8 +1419,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_PDB_3RD_PARTY_DEFINITIONS:INTERNAL= @@ -1419,13 +1460,13 @@ CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 //What is the target build tool cmake is generating for. CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16 +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.5-branch_Release-F16 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1480,6 +1521,8 @@ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Unix Makefiles //Have function connect @@ -1552,6 +1595,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +CONFIG_CXX_FLAGS:INTERNAL= -frounding-math //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1559,9 +1603,9 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib64/libGL.so][v()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB -FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/include][/usr/lib64/libz.so][v1.2.5()] +FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE GCC_COMPILE_RES:INTERNAL=TRUE //Result of TRY_RUN @@ -2091,14 +2135,22 @@ X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2151,6 +2203,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/CMakeCache.txt index 559545efd90..0d644ae102a 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/CMakeCache.txt @@ -17,6 +17,9 @@ //Build shared libraries BUILD_SHARED_LIBS:BOOL=ON +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch @@ -24,13 +27,13 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so +//Boost thread library (release) +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so //Value Computed by CMake CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG @@ -51,7 +54,7 @@ CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86 CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -97,7 +100,7 @@ CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/ CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO @@ -106,7 +109,7 @@ CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -118,7 +121,7 @@ CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 @@ -130,7 +133,7 @@ CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-CXXDEBUG/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -378,16 +381,16 @@ QT_PHONONWIDGETS_PLUGIN_DEBUG:FILEPATH=QT_PHONONWIDGETS_PLUGIN_DEBUG-NOTFOUND QT_PHONONWIDGETS_PLUGIN_RELEASE:FILEPATH=/usr/lib64/qt4/plugins/designer/libphononwidgets.so //Path to a file. -QT_PHONON_INCLUDE_DIR:PATH=QT_PHONON_INCLUDE_DIR-NOTFOUND +QT_PHONON_INCLUDE_DIR:PATH=/usr/include/phonon //The Qt PHONON library -QT_PHONON_LIBRARY:STRING= +QT_PHONON_LIBRARY:STRING=/usr/lib64/libphonon.so //Path to a library. QT_PHONON_LIBRARY_DEBUG:FILEPATH=QT_PHONON_LIBRARY_DEBUG-NOTFOUND //Path to a library. -QT_PHONON_LIBRARY_RELEASE:FILEPATH=QT_PHONON_LIBRARY_RELEASE-NOTFOUND +QT_PHONON_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libphonon.so //Path to a library. QT_PHONON_QT7_PLUGIN_DEBUG:FILEPATH=QT_PHONON_QT7_PLUGIN_DEBUG-NOTFOUND @@ -983,6 +986,12 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include @@ -1162,8 +1171,8 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104900 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/boost-release-branch -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage-cxxdebug/lib //ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=0 @@ -1346,7 +1355,7 @@ CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=6 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 //Path to CMake executable. @@ -1955,6 +1964,10 @@ X11_SM_LIB-ADVANCED:INTERNAL=1 X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XSync_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/CMakeCache.txt index 515c3cf996e..91237708694 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6 +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6 # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.44-beta1/include @@ -21,16 +27,19 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.44-beta1/include Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so //Path to a library. Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND //Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6 +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6 + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF //Directory containing the Maintenance package CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -39,13 +48,13 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING= -frounding-math -DCGAL_CFG_MATCHING_BUG_6 //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -85,43 +94,46 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/ImageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so + //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/Qt3 +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/Qt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -203,6 +215,9 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/usr/local @@ -1037,6 +1052,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=/usr/lib64/libICE.so +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=/usr/lib64/libSM.so @@ -1046,9 +1064,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1127,6 +1154,12 @@ X11_Xinput_LIB:FILEPATH=/usr/lib64/libXi.so //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1218,8 +1251,10 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104400 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/1.44-beta1/include -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.44-beta1/lib;/home/lrineau/CGAL/boost/1.44-beta1/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.44-beta1/lib +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=TRUE @@ -1253,6 +1288,9 @@ CGAL_CFG_NO_CPP0X_ARRAY_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_AUTO:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_AUTO_COMPILED:INTERNAL=FALSE +CGAL_CFG_NO_CPP0X_COPY_N:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_COPY_N_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_DECLTYPE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_DECLTYPE_COMPILED:INTERNAL=FALSE @@ -1277,6 +1315,9 @@ CGAL_CFG_NO_CPP0X_LAMBDAS_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_LONG_LONG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_LONG_LONG_COMPILED:INTERNAL=TRUE +CGAL_CFG_NO_CPP0X_NEXT_PREV:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_NEXT_PREV_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE_COMPILED:INTERNAL=FALSE @@ -1335,7 +1376,7 @@ CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE //Variable hidden from user -CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so //Variable hidden from user CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 @@ -1357,8 +1398,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_Qt3_3RD_PARTY_DEFINITIONS:INTERNAL=-DQT_SHARED;-DQT_NO_DEBUG;-DQT_THREAD_SUPPORT;-D_REENTRANT @@ -1392,13 +1433,13 @@ CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //MODIFIED property for variable: CMAKE_BUILD_TYPE CMAKE_BUILD_TYPE-MODIFIED:INTERNAL=1 //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6 +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-MATCHING-BUG-6 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1453,6 +1494,8 @@ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Unix Makefiles //Have function connect @@ -1522,6 +1565,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +CONFIG_CXX_FLAGS:INTERNAL= -frounding-math -DCGAL_CFG_MATCHING_BUG_6 //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1529,9 +1573,9 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib64/libGL.so][v()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB -FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/include][/usr/lib64/libz.so][v1.2.5()] +FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE GCC_COMPILE_RES:INTERNAL=TRUE //Result of TRY_RUN @@ -2057,14 +2101,22 @@ X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2117,6 +2169,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/CMakeCache.txt index 0f1afd538c9..3b56ae96d09 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/usr/include @@ -23,29 +29,29 @@ Boost_LIBRARY_DIRS:FILEPATH=/usr/lib64 //The Boost THREAD library Boost_THREAD_LIBRARY:FILEPATH=/usr/lib64/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND - -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/usr/lib64/libboost_thread-mt.so - //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF + +//Directory containing the Core package +CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //User-defined flags CGAL_CXX_FLAGS:STRING= -frounding-math -std=c++98 -Wall -pedantic-errors -Wno-long-long -fdiagnostics-show-option //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/CGALCore +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so; //Value Computed by CMake -CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-3.8.1-I/src/CGALCore +CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore //Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS. // When this is FALSE, all the CMAKE_*_FLAGS flags are overriden @@ -54,6 +60,9 @@ CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-3.8.1-I/src/CGALCore // TRUE. CGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=TRUE +//Directory containing the Installation package +CGAL_INSTALLATION_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I + //The folder where CGAL user-side scripts will be installed, relative // to CMAKE_INSTALL_PREFIX CGAL_INSTALL_BIN_DIR:STRING=bin @@ -64,7 +73,7 @@ CGAL_INSTALL_CMAKE_DIR:STRING=lib/CGAL //The folder where CGAL documentation and license files will be // installed, relative to CMAKE_INSTALL_PREFIX -CGAL_INSTALL_DOC_DIR:STRING=share/doc/CGAL-3.8.1-I +CGAL_INSTALL_DOC_DIR:STRING=share/doc/CGAL-I //The folder where CGAL header files will be installed, relative // to CMAKE_INSTALL_PREFIX @@ -79,20 +88,26 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/CGALimageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake -CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-3.8.1-I/src/CGALimageIO +CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO + +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so //Dependencies for the target CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so; +//Directory containing the Maintenance package +CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I + //Value Computed by CMake CGAL_PDB_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/CGALPDB @@ -103,37 +118,37 @@ CGAL_PDB_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.ge CGAL_PDB_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so; //Value Computed by CMake -CGAL_PDB_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-3.8.1-I/src/CGALPDB +CGAL_PDB_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALPDB //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/CGALQt +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake -CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-3.8.1-I/src/CGALQt +CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/CGALQt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/usr/lib64/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake -CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-3.8.1-I/src/CGALQt4 +CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 //soname-version CGAL_SONAME_VERSION:STRING=3 //Value Computed by CMake -CGAL_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-3.8.1-I +CGAL_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I //soversion CGAL_SOVERSION:STRING=3.0.0 @@ -206,6 +221,9 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/usr/local @@ -1034,6 +1052,15 @@ WITH_GMPXX:BOOL=ON //Use the LEDA number types if available. WITH_LEDA:BOOL=OFF +//Use MPFI if available. +WITH_MPFI:BOOL=OFF + +//Use NTL if available. +WITH_NTL:BOOL=OFF + +//Use RS if available. +WITH_RS:BOOL=OFF + //Select demos WITH_demos:BOOL=OFF @@ -1046,6 +1073,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=/usr/lib64/libICE.so +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=/usr/lib64/libSM.so @@ -1055,9 +1085,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1136,6 +1175,12 @@ X11_Xinput_LIB:FILEPATH=/usr/lib64/libXi.so //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1214,21 +1259,19 @@ Boost_INCLUDE_DIR-ADVANCED:INTERNAL=1 //ADVANCED property for variable: Boost_LIBRARY_DIRS Boost_LIBRARY_DIRS-ADVANCED:INTERNAL=1 //The library version string for boost libraries -Boost_LIB_VERSION:INTERNAL=1_37 +Boost_LIB_VERSION:INTERNAL=1_47 //Whether the Boost THREAD library found Boost_THREAD_FOUND:INTERNAL=ON //ADVANCED property for variable: Boost_THREAD_LIBRARY Boost_THREAD_LIBRARY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: Boost_THREAD_LIBRARY_DEBUG -Boost_THREAD_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: Boost_THREAD_LIBRARY_RELEASE -Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 //The version number for boost libraries -Boost_VERSION:INTERNAL=103700 +Boost_VERSION:INTERNAL=104700 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/usr/include CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/usr/lib64/libboost_thread-mt.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/usr/lib64;/usr/lib64 +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/usr/lib64 +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=FALSE @@ -1265,6 +1308,9 @@ CGAL_CFG_NO_CPP0X_ARRAY_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_AUTO:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_AUTO_COMPILED:INTERNAL=FALSE +CGAL_CFG_NO_CPP0X_COPY_N:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_COPY_N_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_DECLTYPE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_DECLTYPE_COMPILED:INTERNAL=FALSE @@ -1289,9 +1335,15 @@ CGAL_CFG_NO_CPP0X_LAMBDAS_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_LONG_LONG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_LONG_LONG_COMPILED:INTERNAL=TRUE +CGAL_CFG_NO_CPP0X_NEXT_PREV:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_NEXT_PREV_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE_COMPILED:INTERNAL=FALSE +CGAL_CFG_NO_CPP0X_STATIC_ASSERT:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_STATIC_ASSERT_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_TUPLE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_TUPLE_COMPILED:INTERNAL=FALSE @@ -1334,12 +1386,20 @@ CGAL_CFG_NUMERIC_LIMITS_BUG_COMPILED:INTERNAL=TRUE CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG_COMPILED:INTERNAL=TRUE +CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG:INTERNAL=0 +//Result of TRY_COMPILE +CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG_COMPILED:INTERNAL=TRUE CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG_COMPILED:INTERNAL=TRUE CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE +//Variable hidden from user +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so +//Variable hidden from user +CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so +CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 CGAL_Core_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_Core_3RD_PARTY_INCLUDE_DIRS:INTERNAL= CGAL_Core_3RD_PARTY_LIBRARIES:INTERNAL= @@ -1358,8 +1418,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_PDB_3RD_PARTY_DEFINITIONS:INTERNAL= @@ -1399,13 +1459,13 @@ CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 //What is the target build tool cmake is generating for. CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-ansi //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1460,6 +1520,8 @@ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Unix Makefiles //Have function connect @@ -1478,7 +1540,7 @@ CMAKE_HAVE_REMOVE:INTERNAL=1 CMAKE_HAVE_SHMAT:INTERNAL=1 //Start directory with the top level CMakeLists.txt file for this // project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/lrineau/CGAL/CGAL-3.8.1-I +CMAKE_HOME_DIRECTORY:INTERNAL=/home/lrineau/CGAL/CGAL-I //Install .so files without execute permission. CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0 //Have library ICE @@ -1525,13 +1587,14 @@ CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 CMAKE_STRIP-ADVANCED:INTERNAL=1 //Suppress Warnings that are meant for the author of the CMakeLists.txt // files. -CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=TRUE +CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE //uname command CMAKE_UNAME:INTERNAL=/bin/uname //ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +CONFIG_CXX_FLAGS:INTERNAL= -frounding-math -std=c++98 -ansi -Wall -pedantic -Wno-long-long -pedantic-errors -fdiagnostics-show-option //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1539,9 +1602,9 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib64/libGL.so][v()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB -FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/include][/usr/lib64/libz.so][v1.2.5()] +FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE GCC_COMPILE_RES:INTERNAL=TRUE //Result of TRY_RUN @@ -2056,31 +2119,39 @@ Q_WS_WIN:INTERNAL= //Have symbol Q_WS_X11 Q_WS_X11:INTERNAL=1 //hide this -Qt_help_window_h:INTERNAL=/home/lrineau/CGAL/CGAL-3.8.1-I/include/CGAL/IO/Qt_help_window.h +Qt_help_window_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_help_window.h //hide this -Qt_widget_OpenGL_h:INTERNAL=/home/lrineau/CGAL/CGAL-3.8.1-I/include/CGAL/IO/Qt_widget_OpenGL.h +Qt_widget_OpenGL_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget_OpenGL.h //hide this -Qt_widget_h:INTERNAL=/home/lrineau/CGAL/CGAL-3.8.1-I/include/CGAL/IO/Qt_widget.h +Qt_widget_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget.h //hide this -Qt_widget_history_h:INTERNAL=/home/lrineau/CGAL/CGAL-3.8.1-I/include/CGAL/IO/Qt_widget_history.h +Qt_widget_history_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget_history.h //hide this -Qt_widget_layer_h:INTERNAL=/home/lrineau/CGAL/CGAL-3.8.1-I/include/CGAL/IO/Qt_widget_layer.h +Qt_widget_layer_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget_layer.h //hide this -Qt_widget_standard_toolbar_h:INTERNAL=/home/lrineau/CGAL/CGAL-3.8.1-I/include/CGAL/IO/Qt_widget_standard_toolbar.h +Qt_widget_standard_toolbar_h:INTERNAL=/home/lrineau/CGAL/CGAL-I/include/CGAL/IO/Qt_widget_standard_toolbar.h //ADVANCED property for variable: X11_ICE_INCLUDE_PATH X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_ICE_LIB X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2133,6 +2204,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/CMakeCache.txt index 241a9f51c29..3dc9295413d 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32 +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32 # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/usr/include @@ -23,14 +29,17 @@ Boost_LIBRARY_DIRS:FILEPATH=/usr/lib //The Boost THREAD library Boost_THREAD_LIBRARY:FILEPATH=/usr/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/usr/lib/libboost_thread-mt.so -//Path to a library. +//Boost thread library (release) Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/usr/lib/libboost_thread-mt.so //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32 +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32 + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF //Directory containing the Maintenance package CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -39,13 +48,13 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING=-m32 -frounding-math //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -85,17 +94,20 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/ImageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so;general;/usr/lib/libz.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so;general;/usr/lib/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so + //Dependencies for the target CGAL_LIB_DEPENDS:STATIC=general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so; @@ -103,25 +115,25 @@ CGAL_LIB_DEPENDS:STATIC=general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/Qt3 +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/usr/lib/qt-3.3/lib/libqassistantclient.a;general;/usr/lib/qt-3.3/lib/libqt-mt.so;general;dl;general;-lpthread;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/usr/lib/qt-3.3/lib/libqassistantclient.a;general;/usr/lib/qt-3.3/lib/libqt-mt.so;general;dl;general;-lpthread;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/Qt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so;general;/usr/lib/libgmpxx.so;general;/usr/lib/libmpfr.so;general;/usr/lib/libgmp.so;general;/usr/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib/libGLU.so;general;/usr/lib/libGL.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -962,6 +974,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=X11_ICE_LIB-NOTFOUND +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=X11_SM_LIB-NOTFOUND @@ -971,9 +986,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=X11_X11_LIB-NOTFOUND +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1052,6 +1076,12 @@ X11_Xinput_LIB:FILEPATH=X11_Xinput_LIB-NOTFOUND //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1130,7 +1160,7 @@ Boost_INCLUDE_DIR-ADVANCED:INTERNAL=1 //ADVANCED property for variable: Boost_LIBRARY_DIRS Boost_LIBRARY_DIRS-ADVANCED:INTERNAL=1 //The library version string for boost libraries -Boost_LIB_VERSION:INTERNAL=1_41 +Boost_LIB_VERSION:INTERNAL=1_47 //Whether the Boost THREAD library found Boost_THREAD_FOUND:INTERNAL=ON //ADVANCED property for variable: Boost_THREAD_LIBRARY @@ -1140,11 +1170,13 @@ Boost_THREAD_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: Boost_THREAD_LIBRARY_RELEASE Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 //The version number for boost libraries -Boost_VERSION:INTERNAL=104100 +Boost_VERSION:INTERNAL=104700 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/usr/include CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib/libgmpxx.so;/usr/lib/libmpfr.so;/usr/lib/libgmp.so;/usr/lib/libboost_thread-mt.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib;/usr/lib;/usr/lib;/usr/lib +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib;/usr/lib;/usr/lib +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=TRUE @@ -1267,7 +1299,7 @@ CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE //Variable hidden from user -CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so //Variable hidden from user CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 @@ -1289,8 +1321,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_Qt3_3RD_PARTY_DEFINITIONS:INTERNAL=-DQT_SHARED;-DQT_NO_DEBUG;-DQT_THREAD_SUPPORT;-D_REENTRANT @@ -1322,13 +1354,13 @@ CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 //What is the target build tool cmake is generating for. CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32 +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16-m32 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=5 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1370,7 +1402,7 @@ CMAKE_DETERMINE_CXX_ABI_COMPILED:INTERNAL=TRUE //Result of TRY_COMPILE CMAKE_DETERMINE_C_ABI_COMPILED:INTERNAL=TRUE //Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake +CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/cmake-gui //Executable file format CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS @@ -1450,7 +1482,7 @@ CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 CMAKE_STRIP-ADVANCED:INTERNAL=1 //Suppress Warnings that are meant for the author of the CMakeLists.txt // files. -CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=TRUE +CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE //uname command CMAKE_UNAME:INTERNAL=/bin/uname //ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS @@ -1951,14 +1983,22 @@ X11_LIB_DNET_HAS_DNET_NTOA:INTERNAL= X11_LIB_DNET_STUB_HAS_DNET_NTOA:INTERNAL= //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL= +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2011,6 +2051,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/CMakeCache.txt index 6af71c2bec2..49d4f161c06 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16 +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16 # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.44-beta1/include @@ -21,16 +27,19 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.44-beta1/include Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so //Path to a library. Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND //Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16 +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16 + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF //Directory containing the Maintenance package CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -39,13 +48,13 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING= -frounding-math //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -85,43 +94,46 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/ImageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so + //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/Qt3 +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/Qt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-3.5-I-140/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -203,6 +215,9 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/usr/local @@ -1037,6 +1052,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=/usr/lib64/libICE.so +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=/usr/lib64/libSM.so @@ -1046,9 +1064,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1127,6 +1154,12 @@ X11_Xinput_LIB:FILEPATH=/usr/lib64/libXi.so //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1218,8 +1251,10 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104400 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/1.44-beta1/include -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.44-beta1/lib;/home/lrineau/CGAL/boost/1.44-beta1/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.44-beta1/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.44-beta1/lib +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=TRUE @@ -1253,6 +1288,9 @@ CGAL_CFG_NO_CPP0X_ARRAY_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_AUTO:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_AUTO_COMPILED:INTERNAL=FALSE +CGAL_CFG_NO_CPP0X_COPY_N:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_COPY_N_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_DECLTYPE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_DECLTYPE_COMPILED:INTERNAL=FALSE @@ -1277,6 +1315,9 @@ CGAL_CFG_NO_CPP0X_LAMBDAS_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_LONG_LONG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_LONG_LONG_COMPILED:INTERNAL=TRUE +CGAL_CFG_NO_CPP0X_NEXT_PREV:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_NEXT_PREV_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE_COMPILED:INTERNAL=FALSE @@ -1335,7 +1376,7 @@ CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE //Variable hidden from user -CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so //Variable hidden from user CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 @@ -1357,8 +1398,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_Qt3_3RD_PARTY_DEFINITIONS:INTERNAL=-DQT_SHARED;-DQT_NO_DEBUG;-DQT_THREAD_SUPPORT;-D_REENTRANT @@ -1392,13 +1433,13 @@ CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //MODIFIED property for variable: CMAKE_BUILD_TYPE CMAKE_BUILD_TYPE-MODIFIED:INTERNAL=1 //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16 +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_F16 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1453,6 +1494,8 @@ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Unix Makefiles //Have function connect @@ -1522,6 +1565,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +CONFIG_CXX_FLAGS:INTERNAL= -frounding-math //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1529,9 +1573,9 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib64/libGL.so][v()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB -FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/include][/usr/lib64/libz.so][v1.2.5()] +FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE GCC_COMPILE_RES:INTERNAL=TRUE //Result of TRY_RUN @@ -2057,14 +2101,22 @@ X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2117,6 +2169,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/CMakeCache.txt index cae934b7b15..5cddaea0f2c 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16 +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16 # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.42/include @@ -21,16 +27,19 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.42/include Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/1.42/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so +//Boost thread library (release) +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16 +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16 + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF //Directory containing the Maintenance package CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -39,13 +48,13 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING=-I/home/lrineau/CGAL/boost/1.42/include -frounding-math //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -85,19 +94,22 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/ImageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so + //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -109,31 +121,31 @@ CGAL_PDB_BINARY_DIR:STATIC=/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_ CGAL_PDB_LIBRARY:STRING=/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_PDB.so //Dependencies for the target -CGAL_PDB_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so; +CGAL_PDB_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so; //Value Computed by CMake CGAL_PDB_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALPDB //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/Qt3 +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/Qt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;general;/home/lrineau/CGAL/CGAL-I-REF/cmake/platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -215,6 +227,9 @@ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=/usr/local @@ -1052,6 +1067,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=/usr/lib64/libICE.so +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=/usr/lib64/libSM.so @@ -1061,9 +1079,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1142,6 +1169,12 @@ X11_Xinput_LIB:FILEPATH=/usr/lib64/libXi.so //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1233,8 +1266,10 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104200 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/1.42/include -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.42/lib;/home/lrineau/CGAL/boost/1.42/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.42/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.42/lib +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=FALSE @@ -1271,6 +1306,9 @@ CGAL_CFG_NO_CPP0X_ARRAY_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_AUTO:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_AUTO_COMPILED:INTERNAL=FALSE +CGAL_CFG_NO_CPP0X_COPY_N:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_COPY_N_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_DECLTYPE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_DECLTYPE_COMPILED:INTERNAL=FALSE @@ -1295,6 +1333,9 @@ CGAL_CFG_NO_CPP0X_LAMBDAS_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_LONG_LONG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_LONG_LONG_COMPILED:INTERNAL=TRUE +CGAL_CFG_NO_CPP0X_NEXT_PREV:INTERNAL=1 +//Result of TRY_COMPILE +CGAL_CFG_NO_CPP0X_NEXT_PREV_COMPILED:INTERNAL=FALSE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE:INTERNAL=1 //Result of TRY_COMPILE CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE_COMPILED:INTERNAL=FALSE @@ -1353,7 +1394,7 @@ CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE //Variable hidden from user -CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so //Variable hidden from user CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 @@ -1375,8 +1416,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_PDB_3RD_PARTY_DEFINITIONS:INTERNAL= @@ -1416,13 +1457,13 @@ CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 //What is the target build tool cmake is generating for. CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16 +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-4.6.2_Release-F16 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 //Path to CMake executable. @@ -1475,6 +1516,8 @@ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Unix Makefiles //Have function connect @@ -1547,6 +1590,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +CONFIG_CXX_FLAGS:INTERNAL= -frounding-math -I/home/lrineau/CGAL/boost/1.42/include //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1556,9 +1600,9 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenSSL:INTERNAL=[/usr/lib64/libssl.so;/usr/lib64/l //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB -FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/include][/usr/lib64/libz.so][v1.2.5()] +FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE GCC_COMPILE_RES:INTERNAL=TRUE //Result of TRY_RUN @@ -2086,14 +2130,22 @@ X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2146,6 +2198,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/CMakeCache.txt index 7c74ce1bc6e..05dfe7ecd33 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/CMakeCache.txt @@ -1,5 +1,5 @@ # This is the CMakeCache file. -# For build in directory: /home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16 +# For build in directory: /home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16 # It was generated by CMake: /usr/bin/cmake # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. @@ -14,6 +14,12 @@ # EXTERNAL cache entries ######################## +//Build shared libraries +BUILD_SHARED_LIBS:BOOL=ON + +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.48/include @@ -21,16 +27,19 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/1.48/include Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/1.48/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so +//Boost thread library (release) +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so //Value Computed by CMake -CGAL_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16 +CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16 + +//Link with static Boost libraries +CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF //Directory containing the Maintenance package CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -39,13 +48,13 @@ CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I CGAL_CXX_FLAGS:STRING= -frounding-math -std=c++11 //Value Computed by CMake -CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/Core +CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/Core //The CGAL_Core library -CGAL_Core_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_Core.so +CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -85,43 +94,46 @@ CGAL_INSTALL_LIB_DIR:STRING=lib CGAL_INSTALL_MAN_DIR:STRING=share/man/man1 //Value Computed by CMake -CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/ImageIO +CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/ImageIO //The CGAL_ImageIO library -CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_ImageIO.so +CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO +//The CGAL library +CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so + //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //Value Computed by CMake -CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/Qt3 +CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/Qt3 //The CGAL_Qt3 library -CGAL_Qt3_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_Qt3.so +CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 //Value Computed by CMake -CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/Qt4 +CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/src/Qt4 //The CGAL_Qt4 library -CGAL_Qt4_LIBRARY:STRING=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_Qt4.so +CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;general;/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -1046,6 +1058,9 @@ X11_ICE_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_ICE_LIB:FILEPATH=/usr/lib64/libICE.so +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + //Path to a library. X11_SM_LIB:FILEPATH=/usr/lib64/libSM.so @@ -1055,9 +1070,18 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + //Path to a file. X11_XTest_INCLUDE_PATH:PATH=/usr/include @@ -1136,6 +1160,12 @@ X11_Xinput_LIB:FILEPATH=/usr/lib64/libXi.so //Path to a file. X11_Xkb_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=X11_Xkbfile_LIB-NOTFOUND + //Path to a file. X11_Xkblib_INCLUDE_PATH:PATH=/usr/include @@ -1227,8 +1257,10 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104800 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/1.48/include -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.48/lib;/home/lrineau/CGAL/boost/1.48/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/1.48/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/1.48/lib +//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS +CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG_COMPILED:INTERNAL=TRUE @@ -1350,7 +1382,7 @@ CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=0 //Result of TRY_COMPILE CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE //Variable hidden from user -CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so +CGAL_CGAL_LIBRARY:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so //Variable hidden from user CGAL_CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL;Core;ImageIO;Qt3;Qt4 @@ -1372,8 +1404,8 @@ CGAL_ImageIO_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_ImageIO_LIBRARY_NAME:INTERNAL=libCGAL_ImageIO.so CGAL_ImageIO_USE_ZLIB:INTERNAL=ON -//Variable hidden from user -CGAL_LIBRARY:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16/lib/libCGAL.so +//ADVANCED property for variable: CGAL_LIBRARY +CGAL_LIBRARY-ADVANCED:INTERNAL=1 //Variable hidden from user CGAL_LIBRARY_NAME:INTERNAL=libCGAL.so CGAL_Qt3_3RD_PARTY_DEFINITIONS:INTERNAL=-DQT_SHARED;-DQT_NO_DEBUG;-DQT_THREAD_SUPPORT;-D_REENTRANT @@ -1405,13 +1437,13 @@ CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 //What is the target build tool cmake is generating for. CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake //This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/trunk/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16 +CMAKE_CACHEFILE_DIR:INTERNAL=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_g++-trunk_CXX0X-F16 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=5 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=7 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1548,7 +1580,7 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib64/libGL.so][v()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE @@ -2080,14 +2112,22 @@ X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_ICE_LIB-ADVANCED:INTERNAL=1 //Have library /usr/lib64/libX11.so;/usr/lib64/libXext.so X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_SM_LIB X11_SM_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_INCLUDE_PATH X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_INCLUDE_PATH X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XTest_LIB @@ -2140,6 +2180,10 @@ X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xinput_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkb_INCLUDE_PATH X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH diff --git a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/CMakeCache.txt b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/CMakeCache.txt index d5895df0f3e..4941675c641 100644 --- a/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/CMakeCache.txt +++ b/Maintenance/infrastructure/renoir.geometryfactory.com/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/CMakeCache.txt @@ -17,6 +17,9 @@ //Build shared libraries BUILD_SHARED_LIBS:BOOL=ON +//The directory containing a CMake configuration file for Boost. +Boost_DIR:PATH=Boost_DIR-NOTFOUND + //Path to a file. Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch @@ -24,13 +27,13 @@ Boost_INCLUDE_DIR:PATH=/home/lrineau/CGAL/boost/boost-release-branch Boost_LIBRARY_DIRS:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage/lib //The Boost THREAD library -Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so +Boost_THREAD_LIBRARY:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_DEBUG:FILEPATH=Boost_THREAD_LIBRARY_DEBUG-NOTFOUND +//Boost thread library (debug) +Boost_THREAD_LIBRARY_DEBUG:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so -//Path to a library. -Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so +//Boost thread library (release) +Boost_THREAD_LIBRARY_RELEASE:FILEPATH=/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so //Value Computed by CMake CGAL_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16 @@ -42,7 +45,7 @@ CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF CGAL_CORE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I //User-defined flags -CGAL_CXX_FLAGS:STRING=--std=c++11 -fno-strict-aliasing -DCGAL_FPU_HAS_EXCESS_PRECISION -Wall +CGAL_CXX_FLAGS:STRING=--std=c++11 -fno-strict-aliasing -Wall //Value Computed by CMake CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/src/Core @@ -51,7 +54,7 @@ CGAL_Core_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86 CGAL_Core_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL_Core.so //Dependencies for the target -CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so; +CGAL_Core_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so; //Value Computed by CMake CGAL_Core_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALCore @@ -97,7 +100,7 @@ CGAL_ImageIO_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/ CGAL_ImageIO_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL_ImageIO.so //Dependencies for the target -CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; +CGAL_ImageIO_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;/usr/lib64/libz.so; //Value Computed by CMake CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO @@ -106,7 +109,7 @@ CGAL_ImageIO_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALImageIO CGAL_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so //Dependencies for the target -CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so; +CGAL_LIB_DEPENDS:STATIC=general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so; //Directory containing the Maintenance package CGAL_MAINTENANCE_PACKAGE_DIR:PATH=/home/lrineau/CGAL/CGAL-I @@ -130,7 +133,7 @@ CGAL_Qt3_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt3_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL_Qt3.so //Dependencies for the target -CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt3_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so;general;/usr/lib64/qt-3.3/lib/libqassistantclient.a;general;/usr/lib64/qt-3.3/lib/libqt-mt.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so;general;dl;general;-lpthread;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt3_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt3 @@ -142,7 +145,7 @@ CGAL_Qt4_BINARY_DIR:STATIC=/home/lrineau/infrastructure/reference-platforms/x86- CGAL_Qt4_LIBRARY:STRING=/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL_Qt4.so //Dependencies for the target -CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; +CGAL_Qt4_LIB_DEPENDS:STATIC=general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so;general;/home/lrineau/infrastructure/reference-platforms/x86-64_Linux-2.6_llvm-clang-with-g++-4.6.2_F16/lib/libCGAL.so;general;/usr/lib64/libgmpxx.so;general;/usr/lib64/libmpfr.so;general;/usr/lib64/libgmp.so;general;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so;optimized;/usr/lib64/libQtOpenGL.so;debug;/usr/lib64/libQtOpenGL_debug.so;optimized;/usr/lib64/libQtGui.so;debug;/usr/lib64/libQtGui_debug.so;optimized;/usr/lib64/libQtCore.so;debug;/usr/lib64/libQtCore_debug.so;general;/usr/lib64/libGLU.so;general;/usr/lib64/libGL.so;general;/usr/lib64/libSM.so;general;/usr/lib64/libICE.so;general;/usr/lib64/libX11.so;general;/usr/lib64/libXext.so; //Value Computed by CMake CGAL_Qt4_SOURCE_DIR:STATIC=/home/lrineau/CGAL/CGAL-I/src/CGALQt4 @@ -173,7 +176,7 @@ CMAKE_COLOR_MAKEFILE:BOOL=ON CMAKE_CXX_COMPILER:FILEPATH=/usr/local/packages/llvm-trunk/bin/clang++ //User-defined flags -CMAKE_CXX_FLAGS:STRING=--std=c++11 -fno-strict-aliasing -DCGAL_FPU_HAS_EXCESS_PRECISION -Wall +CMAKE_CXX_FLAGS:STRING=--std=c++11 -fno-strict-aliasing -Wall //Flags used by the compiler during debug builds. CMAKE_CXX_FLAGS_DEBUG:STRING= @@ -281,6 +284,10 @@ CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + //If set, runtime paths are not added when using shared libraries. CMAKE_SKIP_RPATH:BOOL=OFF @@ -1073,6 +1080,12 @@ X11_X11_INCLUDE_PATH:PATH=/usr/include //Path to a library. X11_X11_LIB:FILEPATH=/usr/lib64/libX11.so +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=X11_XRes_LIB-NOTFOUND + //Path to a file. X11_XShm_INCLUDE_PATH:PATH=/usr/include @@ -1169,6 +1182,12 @@ X11_Xkblib_INCLUDE_PATH:PATH=/usr/include //Path to a file. X11_Xlib_INCLUDE_PATH:PATH=/usr/include +//Path to a file. +X11_Xmu_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xmu_LIB:FILEPATH=X11_Xmu_LIB-NOTFOUND + //Path to a file. X11_Xpm_INCLUDE_PATH:PATH=/usr/include @@ -1214,6 +1233,9 @@ X11_Xv_LIB:FILEPATH=/usr/lib64/libXv.so //Path to a library. X11_Xxf86misc_LIB:FILEPATH=/usr/lib64/libXxf86misc.so +//Path to a library. +X11_Xxf86vm_LIB:FILEPATH=X11_Xxf86vm_LIB-NOTFOUND + //Path to a file. X11_dpms_INCLUDE_PATH:PATH=/usr/include @@ -1254,8 +1276,8 @@ Boost_THREAD_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 Boost_VERSION:INTERNAL=104900 CGAL_3RD_PARTY_DEFINITIONS:INTERNAL= CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=/usr/include;/usr/include;/usr/include;/home/lrineau/CGAL/boost/boost-release-branch -CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread.so -CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib +CGAL_3RD_PARTY_LIBRARIES:INTERNAL=/usr/lib64/libgmpxx.so;/usr/lib64/libmpfr.so;/usr/lib64/libgmp.so;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib/libboost_thread-mt.so +CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=/usr/lib64;/usr/lib64;/home/lrineau/CGAL/boost/boost-release-branch/stage/lib //ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1 CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG:INTERNAL=1 @@ -1448,7 +1470,7 @@ CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 //Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=6 +CMAKE_CACHE_PATCH_VERSION:INTERNAL=8 //Major version of cmake used to create the current loaded cache CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 4 //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE @@ -1511,6 +1533,8 @@ CMAKE_GENERATOR:INTERNAL=Unix Makefiles CMAKE_HAVE_CONNECT:INTERNAL=1 //Have function gethostbyname CMAKE_HAVE_GETHOSTBYNAME:INTERNAL=1 +//Have symbol pthread_create +CMAKE_HAVE_LIBC_CREATE:INTERNAL= //Have library pthreads CMAKE_HAVE_PTHREADS_CREATE:INTERNAL= //Have library pthread @@ -1564,6 +1588,8 @@ CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SKIP_RPATH CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STRIP @@ -1577,7 +1603,7 @@ CMAKE_UNAME:INTERNAL=/bin/uname CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 -CONFIG_CXX_FLAGS:INTERNAL=--std=c++11 -fno-strict-aliasing -DCGAL_FPU_HAS_EXCESS_PRECISION -Wall +CONFIG_CXX_FLAGS:INTERNAL=--std=c++11 -fno-strict-aliasing -Wall //Variable hidden from user EXECUTABLE_OUTPUT_PATH:INTERNAL= //Details about finding OpenGL @@ -1585,7 +1611,7 @@ FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib64/libGL.so][v()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 -FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] +FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib64/libX11.so][/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include;/usr/include] //Details about finding ZLIB FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.5()] //Result of TRY_COMPILE @@ -2121,6 +2147,10 @@ X11_SM_LIB-ADVANCED:INTERNAL=1 X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_X11_LIB X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XShm_INCLUDE_PATH X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_XSync_INCLUDE_PATH @@ -2185,6 +2215,10 @@ X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xlib_INCLUDE_PATH X11_Xlib_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xmu_INCLUDE_PATH +X11_Xmu_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xmu_LIB +X11_Xmu_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xpm_INCLUDE_PATH X11_Xpm_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xpm_LIB @@ -2215,6 +2249,8 @@ X11_Xv_INCLUDE_PATH-ADVANCED:INTERNAL=1 X11_Xv_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_Xxf86misc_LIB X11_Xxf86misc_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xxf86vm_LIB +X11_Xxf86vm_LIB-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_dpms_INCLUDE_PATH X11_dpms_INCLUDE_PATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_xf86misc_INCLUDE_PATH diff --git a/Maintenance/public_release/announcement/CGAL-3.8.1 b/Maintenance/public_release/announcement/CGAL-3.8.1 deleted file mode 100644 index 98be3611722..00000000000 --- a/Maintenance/public_release/announcement/CGAL-3.8.1 +++ /dev/null @@ -1,10 +0,0 @@ -Subject: CGAL 3.8.1 Released, Computational Geometry Algorithms Library -Body: - -The CGAL Open Source Project is pleased to announce the release 3.8.1 of -CGAL, the Computational Geometry Algorithms Library. - -Version 3.8.1 is a bug-fix release for version 3.8. No new feature has -been added in 3.8.1. The following corrections have been made: - -[...] diff --git a/Maintenance/public_release/announcement/CGAL-4.0.1 b/Maintenance/public_release/announcement/CGAL-4.0.1 new file mode 100644 index 00000000000..f7568825d44 --- /dev/null +++ b/Maintenance/public_release/announcement/CGAL-4.0.1 @@ -0,0 +1,69 @@ +Subject: CGAL 4.0.1 Released, Computational Geometry Algorithms Library +Body: + +The CGAL Open Source Project is pleased to announce the release 4.0.1 +of CGAL, the Computational Geometry Algorithms Library. + + +Version 4.0.1 is a bug-fix release for version 4.0. Apart various minor +fixes in the documentation, the following has been changed since CGAL-4.0: + + +* 2D Voronoi Diagram Adaptor (re-added) + + - The package 2D Voronoi Diagram Adaptor was temporarily removed from the + CGAL distribution because of license issues. That package is now back into + CGAL. + + +* 2D and 3D Geometry Kernel + + - Fix a bug in the Segment_3-Triangle_3 intersection function in the case + the segment is collinear with a triangle edge. + + +* Algebraic Kernel + + - Avoid the linking error "duplicate symbols" when two compilation units + using the algebraic kernel are linked. + + +* 3D Boolean Operations on Nef Polygons Embedded on the Sphere + + - Fix a memory leak due to the usage of an internal mechanism that has been + replaced by boost::any. This also influences the packages 2D Boolean + Operations on Nef Polygons, 3D Boolean Operations on Nef Polyhedra, Convex + Decomposition of Polyhedra, and 3D Minkowski Sum of Polyhedra. + + +* 2D Arrangement + + - Fix several memory leaks. + + +* 2D Mesh Generation + + - Fix a compilation error in the header + when g++ version 4.7 is used. + + +* Surface Mesh Generation and 3D Mesh Generation + + - Fix an important bug in the CGAL_ImageIO library, that could lead to wrong + result when meshing from a 3D image. + + - Fix the compilation of the demo in demo/Surface_mesher, when Boost version + 1.48 or 1.49 is used. + + +* Surface Mesh Parameterization + + - Fix a memory leak. + + - Fix a compatibility issue with Eigen-3.1 of Eigen_solver_traits. This fix + also affects the usage of that class in the package Surface Reconstruction + from Point Sets. + + +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/CGAL-4.0.2 b/Maintenance/public_release/announcement/CGAL-4.0.2 new file mode 100644 index 00000000000..48143c6e0eb --- /dev/null +++ b/Maintenance/public_release/announcement/CGAL-4.0.2 @@ -0,0 +1,10 @@ +Subject: CGAL 4.0.2 Released, Computational Geometry Algorithms Library +Body: + +Dear CGAL users, + +Yesterday, I have published a buggy release 4.0.1, where a bug in the +CMakeLists.txt for CGAL prevented even to build the CGAL libraries. That +bug slipped through our automatic tests. + +I have just published a new release 4.0.2 which fixes this problem. diff --git a/Maintenance/public_release/announcement/where_to_announce b/Maintenance/public_release/announcement/where_to_announce index 8e6f0da5932..965a16eb4b9 100644 --- a/Maintenance/public_release/announcement/where_to_announce +++ b/Maintenance/public_release/announcement/where_to_announce @@ -5,6 +5,11 @@ and discuss lists. Mailing lists: + ********************************************************************* + ** Note: add a Reply-To: cgal-discuss@lists-sop.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 @@ -15,8 +20,6 @@ And only for feature releases (not bug-fixes): mesh@sandia.gov communaute@medicis.polytechnique.fr -Note: add a Reply-To: cgal-discuss@lists-sop.inria.fr, to avoid cross-post -replies. diff --git a/Maintenance/public_release/scripts/prepare_release b/Maintenance/public_release/scripts/prepare_release index 1dba21cf2d2..2117216bb65 100755 --- a/Maintenance/public_release/scripts/prepare_release +++ b/Maintenance/public_release/scripts/prepare_release @@ -44,6 +44,12 @@ tar cf "$DEST_DIR/${PUBLIC_RELEASE_NAME}-doc_html.tar" -C "$DEST_DIR" doc_html printf "Create doc_html zip...\n" tar xf "$DEST_DIR/${PUBLIC_RELEASE_NAME}-doc_html.tar" -O | zip -q > "$DEST_DIR/${PUBLIC_RELEASE_NAME}-doc_html.zip" +printf "bzip2 doc_html tarball...\n" +bzip2 --best < "$DEST_DIR/${PUBLIC_RELEASE_NAME}-doc_html.tar" > "$DEST_DIR/${PUBLIC_RELEASE_NAME}-doc_html.tar.bz2" + +printf "bzip2 source tarball...\n" +zcat "$DEST_DIR/${PUBLIC_RELEASE_NAME}.tar.gz" | bzip2 --best > "$DEST_DIR/${PUBLIC_RELEASE_NAME}.tar.bz2" + printf "xz doc_html tarball...\n" xz --best < "$DEST_DIR/${PUBLIC_RELEASE_NAME}-doc_html.tar" > "$DEST_DIR/${PUBLIC_RELEASE_NAME}-doc_html.tar.xz" @@ -58,11 +64,13 @@ pushd "$DEST_DIR/doc_html" zip -r ../cgal_manual.zip cgal_manual popd +pushd "$DEST_DIR" printf "Untar examples/ and include/ for rsync to the server\n" tar xf "$DEST_DIR/${PUBLIC_RELEASE_NAME}.tar.gz" --strip-components 1 "${PUBLIC_RELEASE_NAME}"/examples "${PUBLIC_RELEASE_NAME}"/include -C "$DEST_DIR" printf "Compute md5sum.txt..." md5sum *.^txt > md5sum.txt +popd printf "Now use:\n" printf " cd ${DEST_DIR}\n" diff --git a/Maintenance/svn_server/hooks/start-commit b/Maintenance/svn_server/hooks/start-commit index db0ef248c5a..afbfdd71f7a 100755 --- a/Maintenance/svn_server/hooks/start-commit +++ b/Maintenance/svn_server/hooks/start-commit @@ -47,6 +47,8 @@ REPOS="$1" USER="$2" CAPABILITIES="$3" +SVNLOOK=/usr/bin/svnlook + #if [ "$USER" = "lrineau" ]; then # exec >&2 # if ! echo "$CAPABILITIES" | grep -q mergeinfo; then @@ -62,6 +64,25 @@ CAPABILITIES="$3" # fi #fi +if "$SVNLOOK" cat "$REPOS" branches/next/Maintenance/git/authors-file.txt | grep -qE "^$USER =" >&2; then + echo >/dev/null + # Commit will be accepted +else + echo "---------------------------------------------------------------------------" >&2 + echo "CGAL commit rejected!" >&2 + echo "" >&2 + echo "Your username $USER cannot be found in the following file:" >&2 + echo " branches/next/Maintenance/git/authors-file.txt" >&2 + echo "For that reason your commit has been rejected." >&2 + echo "Ask another CGAL developer to fill the file for you (in the 'next' branch)." >&2 + echo "" >&2 + echo " (check added by Laurent Rineau at the Tel Aviv CGAL developers meeting," >&2 + echo " 22 May 2012)" >&2 + echo "---------------------------------------------------------------------------" >&2 + + exit 1 +fi + #/home/groups/cgal/hooks/check-capabilities.pl "$REPOS" "$USER" "$CAPABILITIES" # All checks passed, so allow the commit. diff --git a/Manual/doc_tex/Manual/cgal_manual.sty b/Manual/doc_tex/Manual/cgal_manual.sty index b208b69369d..8eda6978d10 100644 --- a/Manual/doc_tex/Manual/cgal_manual.sty +++ b/Manual/doc_tex/Manual/cgal_manual.sty @@ -239,71 +239,110 @@ % ----------- thirdparty --------- \newcommand{\ccThirdParty}[1]{\ccRef[#1]{thirdparty:#1}} -\newcommand{\ccThirdPartyBoost}{\ccThirdParty{Boost}} -\newcommand{\ccThirdPartyCoin}{\ccThirdParty{Coin}} -\newcommand{\ccThirdPartyGMP}{\ccThirdParty{GMP}} -\newcommand{\ccThirdPartyLeda}{\ccThirdParty{Leda}} -\newcommand{\ccThirdPartyQt}{\ccThirdParty{Qt}} +% essential \newcommand{\ccThirdPartySTL}{\ccRef[Standard Template Library]{thirdparty:stl}} -\newcommand{\ccThirdPartyTaucs}{\ccThirdParty{Taucs}} +\newcommand{\ccThirdPartyBoost}{\ccThirdParty{Boost}} +\newcommand{\ccThirdPartyGMP}{\ccThirdParty{GMP}} +\newcommand{\ccThirdPartyMPFR}{\ccThirdParty{MPFR}} \newcommand{\ccThirdPartyZlib}{\ccThirdParty{zlib}} -\newcommand{\ccThirdPartyOpenNL}{\ccThirdParty{OpenNL}} -\newcommand{\ccThirdPartyLapack}{\ccThirdParty{Lapack}} -\newcommand{\ccThirdPartyBlas}{\ccThirdParty{Blas}} -\newcommand{\ccThirdPartyAtlas}{\ccThirdParty{Atlas}} -\newcommand{\ccThirdPartyRS}{\ccThirdParty{RS}} -\newcommand{\ccThirdPartyEigen}{\ccThirdParty{Eigen}} +\newcommand{\ccThirdPartyOpenGL}{\ccThirdParty{OpenGL}} +\newcommand{\ccThirdPartyQt}{\ccThirdParty{Qt}} +% optional +\newcommand{\ccThirdPartyLeda}{\ccThirdParty{Leda}} +\newcommand{\ccThirdPartyMPFI}{\ccThirdParty{MPFI}} +\newcommand{\ccThirdPartyRS}{\ccThirdParty{RS}} +\newcommand{\ccThirdPartyNTL}{\ccThirdParty{NTL}} +\newcommand{\ccThirdPartyOpenNL}{\ccThirdParty{OpenNL}} +\newcommand{\ccThirdPartyTaucs}{\ccThirdParty{Taucs}} +\newcommand{\ccThirdPartyBlas}{\ccThirdParty{Blas}} +\newcommand{\ccThirdPartyLapack}{\ccThirdParty{Lapack}} +\newcommand{\ccThirdPartyLibQGLViewer}{\ccThirdParty{libQGLViewer}} +\newcommand{\ccThirdPartyCoin}{\ccThirdParty{Coin3D}} +\newcommand{\ccThirdPartyEstbl}{\ccThirdParty{Estbl}} + +\newcommand{\ccThirdPartyFtoC}{\ccThirdParty{F2C}} +\newcommand{\ccThirdPartyVTL}{\ccThirdParty{Vtk}} + +% TODO EBEB delete? +\newcommand{\ccThirdPartyAtlas}{\ccThirdParty{Atlas}} +\newcommand{\ccThirdPartyEigen}{\ccThirdParty{Eigen}} % --------- plain names of thirdparty stuff ------- \newcommand{\gnu}{\textsc{Gnu}} -\newcommand{\qt}{\textsc{Qt}} -\newcommand{\gmp}{\textsc{Gmp}} -\newcommand{\mpfr}{\textsc{Mpfr}} -\newcommand{\mpfi}{\textsc{Mpfi}} -\newcommand{\boost}{\textsc{Boost}} -\newcommand{\core}{\textsc{Core}} -\newcommand{\taucs}{\textsc{Taucs}} -\newcommand{\rs}{RS} -\newcommand{\lidia}{\textsc{Lidia}} -\newcommand{\ntl}{\textsc{Ntl}} -\newcommand{\bgl}{\textsc{bgl}} -\newcommand{\blas}{\textsc{blas}} -\newcommand{\atlas}{\textsc{atlas}} -\newcommand{\lapack}{\textsc{lapack}} -\newcommand{\exacus}{\textsc{Exacus}} -\newcommand{\eigen}{\textsc{Eigen}} +% essential +\newcommand{\boost}{\textsc{Boost}} +\newcommand{\gmp}{\textsc{Gmp}} +\newcommand{\gmpxx}{\textsc{Gmpxx}} +\newcommand{\mpfr}{\textsc{Mpfr}} +\newcommand{\zlib}{\textsc{zlib}} +\newcommand{\opengl}{\textsc{OpenGL}} +\newcommand{\qt}{\textsc{Qt}} + +% optional +%\newcommand{\leda}{\textsc{Leda}} +\newcommand{\mpfi}{\textsc{Mpfi}} +\newcommand{\rs}{Rs} +\newcommand{\ntl}{\textsc{Ntl}} +\newcommand{\opennl}{\textsc{OpenNL}} +\newcommand{\taucs}{\textsc{Taucs}} +\newcommand{\blas}{\textsc{blas}} +\newcommand{\lapack}{\textsc{lapack}} +%\newcommand{\libqglviewer}{\textsc{libQGLViewer}} +\newcommand{\coin}{\textsc{Coin3D}} +\newcommand{\esbtl}{\textsc{Estbl}} +\newcommand{\vtk}{\textsc{Vtk}} +\newcommand{\ftoc}{\textsc{F2C}} + +% TODO EBEB What about these? +\newcommand{\core}{\textsc{Core}} +\newcommand{\lidia}{\textsc{Lidia}} +\newcommand{\bgl}{\textsc{bgl}} +\newcommand{\atlas}{\textsc{atlas}} +\newcommand{\eigen}{\textsc{Eigen}} +\newcommand{\exacus}{\textsc{Exacus}} % macros for WWW pages \newcommand{\cgalhomepage}{\path'http://www.cgal.org/'} \newcommand{\cgaldownloadpage}{\path'http://www.cgal.org/download.html'} -\newcommand{\gmppage}{\path'http://gmplib.org/'} -\newcommand{\mpfrpage}{\path'http://www.mpfr.org/'} -\newcommand{\mpfipage}{\path'http://mpfi.gforge.inria.fr/'} -\newcommand{\boostpage}{\path'http://www.boost.org/'} -\newcommand{\boostprodownloadpage}{\path'http://www.boostpro.com/download/'} -\newcommand{\corepage}{\path'http://www.cs.nyu.edu/exact/'} -\newcommand{\opennlpage}{\path'http://alice.loria.fr/index.php/software/4-library/23-opennl.html'} -\newcommand{\ledapage}{\path'http://www.algorithmic-solutions.com/leda/index.html'} -\newcommand{\qtpage}{\path'http://qt.nokia.com/'} -\newcommand{\coinpage}{\path'http://www.coin3d.org/'} -\newcommand{\libqglviewerpage}{\path'http://www.libqglviewer.com/'} -\newcommand{\blaspage}{\path'http://www.netlib.org/blas/'} -\newcommand{\atlaspage}{\path'http://math-atlas.sourceforge.net/'} -\newcommand{\lapackpage}{\path'http://www.netlib.org/lapack/'} -\newcommand{\taucspage}{\path'http://www.tau.ac.il/~stoledo/taucs/'} -\newcommand{\rspage}{\path'http://vegas.loria.fr/rs/'} -\newcommand{\xpage}{\path'http://www.x.org/'} -\newcommand{\zlibpage}{\path'http://www.zlib.net/'} -\newcommand{\esbtlpage}{\path'http://esbtl.sourceforge.net/'} \newcommand{\cmakepage}{\path'http://www.cmake.org/'} \newcommand{\cpackpage}{\path'http://www.cmake.org/cmake/help/cpack2.6docs.html'} + +% essential +\newcommand{\boostpage}{\path'http://www.boost.org/'} +\newcommand{\boostprodownloadpage}{\path'http://www.boostpro.com/download/'} +\newcommand{\gmppage}{\path'http://gmplib.org/'} +\newcommand{\mpfrpage}{\path'http://www.mpfr.org/'} +\newcommand{\zlibpage}{\path'http://www.zlib.net/'} +\newcommand{\openglpage}{\path'http://www.opengl.org/'} +\newcommand{\qtpage}{\path'http://qt.nokia.com/'} + +% optional +\newcommand{\ledapage}{\path'http://www.algorithmic-solutions.com/leda/index.html'} +\newcommand{\mpfipage}{\path'http://mpfi.gforge.inria.fr/'} +\newcommand{\rspage}{\path'http://vegas.loria.fr/rs/'} +\newcommand{\ntlpage}{\path'http://www.shoup.net/ntl/'} +\newcommand{\opennlpage}{\path'http://alice.loria.fr/index.php/software/4-library/23-opennl.html'} +\newcommand{\taucspage}{\path'http://www.tau.ac.il/~stoledo/taucs/'} +\newcommand{\blaspage}{\path'http://www.netlib.org/blas/'} +\newcommand{\lapackpage}{\path'http://www.netlib.org/lapack/'} +\newcommand{\libqglviewerpage}{\path'http://www.libqglviewer.com/'} +\newcommand{\coinpage}{\path'http://www.coin3d.org/'} +\newcommand{\esbtlpage}{\path'http://esbtl.sourceforge.net/'} + +% TODO EBEB What about pages for F2C, VTK? + +% TODO EBEB What about these pages? +\newcommand{\corepage}{\path'http://www.cs.nyu.edu/exact/'} +\newcommand{\atlaspage}{\path'http://math-atlas.sourceforge.net/'} +\newcommand{\xpage}{\path'http://www.x.org/'} \newcommand{\nsispage}{\path'http://nsis.sourceforge.net/Main\_Page'} \newcommand{\fhs}{\path'http://www.pathname.com/fhs/pub/fhs-2.3.html'} \newcommand{\eigenpage}{\path'http://eigen.tuxfamily.org'} + % Implement the two columns layout for the HTML converted part % ------------------------------------------------------------ diff --git a/Manual/doc_tex/Manual/geom.bib b/Manual/doc_tex/Manual/geom.bib index aa71e56cfe3..355b5e1fa05 100644 --- a/Manual/doc_tex/Manual/geom.bib +++ b/Manual/doc_tex/Manual/geom.bib @@ -151798,3 +151798,25 @@ amplification and suppression of local contrast. Contains C code." , year = 1999 } +@article{hh-esplp-08 +, author = "I. Haran and D. Halperin" +, title = "An experimental study of point location in planar arrangements in CGAL" +, journal = "ACM Journal of Experimental Algorithmics" +, volume = "13" +, year = 2008 +, pages = "" +} + +@article{hkh-iiplgtds-12 +, author = {{Hemmer}, M. and {Kleinbort}, M. and {Halperin}, D.} +, title = "{Improved Implementation of Point Location in General Two-Dimensional Subdivisions}" +, journal = {ArXiv e-prints} +, archivePrefix = "arXiv" +, eprint = {1205.5434} +, primaryClass = "cs.CG" +, keywords = {Computer Science - Computational Geometry, Computer Science - Data Structures and Algorithms} +, year = 2012 +, month = may +, adsurl = {http://adsabs.harvard.edu/abs/2012arXiv1205.5434H} +, adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} diff --git a/Manual/doc_tex/Manual/manual-4.0.bib b/Manual/doc_tex/Manual/manual-4.0.bib index f597560448e..72268a57672 100644 --- a/Manual/doc_tex/Manual/manual-4.0.bib +++ b/Manual/doc_tex/Manual/manual-4.0.bib @@ -307,7 +307,7 @@ } @incollection{cgal:wfzh-a2-12 -, author = "Ron Wein and Efi Fogel and Baruch Zukerman and Dan Halperin" +, author = "Ron Wein and Eric Berberich and Efi Fogel and Dan Halperin and Michael Hemmer and Oren Salzman and Baruch Zukerman" , title = "{2D} Arrangements" , publisher = "{CGAL Editorial Board}" , edition = "{4.0}" diff --git a/Manual/doc_tex/Manual/manual-4.1.bib b/Manual/doc_tex/Manual/manual-4.1.bib new file mode 100644 index 00000000000..2d8209e723b --- /dev/null +++ b/Manual/doc_tex/Manual/manual-4.1.bib @@ -0,0 +1,838 @@ +% please dont't modify the "arobase" string commands +% they are used by the scripts to create the "How to cite CGAL" web page +% thanks - Monique + +@string{ author_create_page = 0 } +@string{ category_create_page = 0 } +@string{ reduced_year_create_page = 0 } +@string{ complete_year_create_page = 0 } + +@string{ index_file_title = "How to cite CGAL" } +@string{ index_page_title = "How to cite CGAL" } + +@string{ complete_biblio_file_title = "CGAL Publications sorted by year" } +@string{ complete_biblio_page_title = "CGAL Publications sorted by year" } +@string{ filename_complete_biblio = "how_to_cite_cgal" } + +@string{ head_tag.end = "layout.html" } +%@string{ header_of_contents = "header_of_contents" } + +@string{ keyword_build_initials_index = 0 } +@string{ keyword_put_initials_in_index = 0 } + +@string{ keyword_write_bibtex_abstract = 0 } +@string{ complete_biblio_write_bibtex_abstract = 0 } + +@string{ disclaimer_2 = ""} +@STRING{ default_header_of_body = "" } +@STRING{ default_footer_of_contents = ""} +@string{ index_write_author = 0 } +@string{ keyword_write_author = 0 } +@string{ complete_biblio_write_author = 0 } + +@string{ index_write_date = 0 } +@string{ keyword_write_date = 0 } +@string{ complete_biblio_write_date = 0 } + + + +@book{ cgal:eb-12b +, title = "{CGAL} User and Reference Manual" +, author = "{The CGAL Project}" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, year = 2012 +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html" +} + + +@incollection{cgal:h-af-12b +, author = "Michael Hemmer" +, title = "Algebraic Foundations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlgebraicFoundations" +, year = 2012 +} + +@incollection{cgal:bht-ak-12b +, author = "Eric Berberich and Michael Hemmer and Sylvain Lazard and Luis Pe\~{n}aranda and Monique Teillaud" +, title = "Algebraic Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlgebraicKerneld" +, year = 2012 +} + +@incollection{cgal:hhkps-nt-12b +, author = "Michael Hemmer and Susan Hert and Lutz Kettner and Sylvain Pion and Stefan Schirra" +, title = "Number Types" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:NumberTypes" +, year = 2012 +} + +@incollection{cgal:h-p-12b +, author = "Michael Hemmer" +, title = "Polynomial" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Polynomial" +, year = 2012 +} + +@incollection{cgal:h-ma-12b +, author = "Michael Hemmer" +, title = "Modular Arithmetic" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ModularArithmetic" +, year = 2012 +} + +@incollection{cgal:bfghhkps-lgk23-12b +, author = "Herv{\'e} Br{\"o}nnimann and Andreas Fabri and Geert-Jan Giezeman and Susan Hert and Michael Hoffmann and Lutz Kettner and Sylvain Pion and Stefan Schirra" +, title = "{2D} and {3D} Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Kernel23" +, year = 2012 +} + +@incollection{cgal:s-gkd-12b +, author = "Michael Seel" +, title = "{dD} Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:KernelD" +, year = 2012 +} + +@incollection{cgal:cpt-cgk2-12b +, author = "Pedro Machado Manh\~{a}es de Castro and Sylvain Pion and Monique Teillaud" +, title = "{2D} Circular Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:CircularKernel2" +, year = 2012 +} + +@incollection{cgal:cclt-sgk3-12b +, author = "Pedro Machado Manh\~{a}es de Castro and Fr{\'e}d{\'e}ric Cazals and S{\'e}bastien Loriot and Monique Teillaud" +, title = "{3D} Spherical Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SphericalKernel3" +, year = 2012 +} + +@incollection{cgal:hs-chep2-12b +, author = "Susan Hert and Stefan Schirra" +, title = "{2D} Convex Hulls and Extreme Points" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexHull2" +, year = 2012 +} + +@incollection{cgal:hs-ch3-12b +, author = "Susan Hert and Stefan Schirra" +, title = "{3D} Convex Hulls" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexHull3" +, year = 2012 +} + +@incollection{cgal:gw-p2-12b +, author = "Geert-Jan Giezeman and Wieger Wesselink" +, title = "{2D} Polygons" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Polygon2" +, year = 2012 +} + +@incollection{cgal:h-pp2-12b +, author = "Susan Hert" +, title = "{2D} Polygon Partitioning" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PolygonPartitioning2" +, year = 2012 +} + +@incollection{cgal:hs-chdt3-12b +, author = "Susan Hert and Michael Seel" +, title = "{dD} Convex Hulls and {Delaunay} Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexHullD" +, year = 2012 +} + +@incollection{cgal:k-ps-12b +, author = "Lutz Kettner" +, title = "{3D} Polyhedral Surfaces" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Polyhedron" +, year = 2012 +} + +@incollection{cgal:k-hds-12b +, author = "Lutz Kettner" +, title = "Halfedge Data Structures" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:HDS" +, year = 2012 +} + +@incollection{cgal:d-cm-12b +, author = "Guillaume Damiand" +, title = "Combinatorial Maps" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:CombinatorialMaps" +, year = 2012 +} + +@incollection{cgal:d-lcc-12b +, author = "Guillaume Damiand" +, title = "Linear Cell Complex" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:LinearCellComplex" +, year = 2012 +} + +@incollection{cgal:fwzh-rbso2-12b +, author = "Efi Fogel and Ron Wein and Baruch Zukerman and Dan Halperin" +, title = "{2D} Regularized {Boolean} Set-Operations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BooleanSetOperations2" +, year = 2012 +} + +@incollection{cgal:w-rms2-12b +, author = "Ron Wein" +, title = "{2D} {Minkowski} Sums" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:MinkowskiSum2" +, year = 2012 +} + +@incollection{cgal:s-bonp2-12b +, author = "Michael Seel" +, title = "{2D} {Boolean} Operations on {Nef} Polygons" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Nef2" +, year = 2012 +} + +@incollection{cgal:hk-bonpes2-12b +, author = "Peter Hachenberger and Lutz Kettner" +, title = "{2D} {Boolean} Operations on {Nef} Polygons Embedded on the Sphere" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:NefS2" +, year = 2012 +} + +@incollection{cgal:hk-bonp3-12b +, author = "Peter Hachenberger and Lutz Kettner" +, title = "{3D} {Boolean} Operations on {Nef} Polyhedra" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Nef3" +, year = 2012 +} + +@incollection{cgal:h-emspe-12b +, author = "Peter Hachenberger" +, title = "Convex Decomposition of Polyhedra" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexDecomposition3" +, year = 2012 +} + +@incollection{cgal:h-msp3-12b +, author = "Peter Hachenberger" +, title = "{3D} {Minkowski} Sum of Polyhedra" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:MinkowskiSum3" +, year = 2012 +} + +@incollection{cgal:c-sspo2-12b +, author = "Fernando Cacciola" +, title = "{2D} Straight Skeleton and Polygon Offsetting" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:StraightSkeleton2" +, year = 2012 +} + +@incollection{cgal:wfzh-a2-12b +, author = "Ron Wein and Eric Berberich and Efi Fogel and Dan Halperin and Michael Hemmer and Oren Salzman and Baruch Zukerman" +, title = "{2D} Arrangements" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Arrangement2" +, year = 2012 +} + +@incollection{cgal:wfz-ic2-12b +, author = "Baruch Zukerman and Ron Wein and Efi Fogel" +, title = "{2D} Intersection of Curves" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:IntersectionOfCurves2" +, year = 2012 +} + +@incollection{cgal:p-sr2-12b +, author = "Eli Packer" +, title = "{2D} Snap Rounding" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SnapRounding2" +, year = 2012 +} + +@incollection{cgal:w-e2-12b +, author = "Ron Wein" +, title = "{2D} Envelopes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Envelope2" +, year = 2012 +} + +@incollection{cgal:mwz-e3-12b +, author = "Michal Meyerovitch and Ron Wein and Baruch Zukerman" +, title = "{3D} Envelopes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Envelope3" +, year = 2012 +} + +@incollection{cgal:y-t2-12b +, author = "Mariette Yvinec" +, title = "{2D} Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Triangulation2" +, year = 2012 +} + +@incollection{cgal:py-tds2-12b +, author = "Sylvain Pion and Mariette Yvinec" +, title = "{2D} Triangulation Data Structure" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:TDS2" +, year = 2012 +} + +@incollection{cgal:pt-t3-12b +, author = "Sylvain Pion and Monique Teillaud" +, title = "{3D} Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Triangulation3" +, year = 2012 +} + +@incollection{cgal:pt-tds3-12b +, author = "Sylvain Pion and Monique Teillaud" +, title = "{3D} Triangulation Data Structure" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:TDS3" +, year = 2012 +} + +@incollection{cgal:ct-pt3-12b +, author = "Manuel Caroli and Monique Teillaud" +, title = "{3D} Periodic Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Periodic3Triangulation3" +, year = 2012 +} + +@incollection{cgal:d-as2-12b +, author = "Tran Kai Frank Da" +, title = "{2D} Alpha Shapes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlphaShape2" +, year = 2012 +} + +@incollection{cgal:dy-as3-12b +, author = "Tran Kai Frank Da and Mariette Yvinec" +, title = "{3D} Alpha Shapes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlphaShapes3" +, year = 2012 +} + +@incollection{cgal:k-sdg2-12b +, author = "Menelaos Karavelas" +, title = "{2D} Segment {Delaunay} Graphs" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SegmentDelaunayGraph2" +, year = 2012 +} + +@incollection{cgal:ky-ag2-12b +, author = "Menelaos Karavelas and Mariette Yvinec" +, title = "{2D} {Apollonius} Graphs ({Delaunay} Graphs of Disks)" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ApolloniusGraph2" +, year = 2012 +} + +@incollection{cgal:k-vda2-12b +, author = "Menelaos Karavelas" +, title = "{2D} {Voronoi} Diagram Adaptor" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:VoronoiDiagramAdaptor2" +, Year = 2012 +} + +@incollection{cgal:r-ctm2-12b +, author = "Laurent Rineau" +, title = "{2D} Conforming Triangulations and Meshes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Mesh2" +, year = 2012 +} + +@incollection{cgal:ry-smg-12b +, author = "Laurent Rineau and Mariette Yvinec" +, title = "{3D} Surface Mesh Generation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceMesher3" +, year = 2012 +} + +@incollection{cgal:asg-srps-12b +, author = "Pierre Alliez and Laurent Saboret and Gael Guennebaud" +, title = "Surface Reconstruction from Point Sets" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceReconstructionFromPointSets" +, year = 2012 +} + +@incollection{cgal:k-ssm3-12b +, author = "Nico Kruithof" +, title = "{3D} Skin Surface Meshing" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SkinSurface3" +, year = 2012 +} + +@incollection{cgal:rty-m3-12b +, author = "Pierre Alliez and Laurent Rineau and St\'ephane Tayeb and Jane Tournois and Mariette Yvinec" +, title = "{3D} Mesh Generation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Mesh_3" +, year = 2012 +} + +@incollection{cgal:s-ssm2-12b +, author = "Le-Jeng Andy Shiue" +, title = "{3D} Surface Subdivision Methods" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceSubdivisionMethods3" +, year = 2012 +} + +@incollection{cgal:c-tsms-12b +, author = "Fernando Cacciola" +, title = "Triangulated Surface Mesh Simplification" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceMeshSimplification" +, year = 2012 +} + +@incollection{cgal:sal-pptsm2-12b +, author = "Laurent Saboret and Pierre Alliez and Bruno L\'evy" +, title = "Planar Parameterization of Triangulated Surface Meshes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceParameterization" +, year = 2012 +} + +@incollection{cgal:b-ss2-12b +, author = "Matthias B\"asken" +, title = "{2D} Range and Neighbor Search" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PointSet2" +, year = 2012 +} + +@incollection{cgal:n-rstd-12b +, author = "Gabriele Neyer" +, title = "{dD} Range and Segment Trees" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:RangeSegmentTreesD" +, year = 2012 +} + +@incollection{cgal:f-isl-12b +, author = "Andreas Fabri" +, title = "Interval Skip List" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:IntervalSkipList" +, year = 2012 +} + +@incollection{cgal:tf-ssd-12b +, author = "Hans Tangelder and Andreas Fabri" +, title = "{dD} Spatial Searching" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SpatialSearchingD" +, year = 2012 +} + +@incollection{cgal:kmz-isiobd-12b +, author = "Lutz Kettner and Andreas Meyer and Afra Zomorodian" +, title = "Intersecting Sequences of {dD} Iso-oriented Boxes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BoxIntersectionD" +, year = 2012 +} + +@incollection{cgal:fghhs-bv-12b +, author = "Kaspar Fischer and Bernd G{\"a}rtner and Thomas Herrmann and Michael Hoffmann and Sven Sch{\"o}nherr" +, title = "Bounding Volumes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BoundingVolumes" +, year = 2012 +} + +@incollection{cgal:fgsw-lqps-12b +, author = "Kaspar Fischer and Bernd G{\"a}rtner and Sven Sch{\"o}nherr and Frans Wessendorp" +, title = "Linear and Quadratic Programming Solver" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:QPSolver" +, year = 2012 +} + +@incollection{cgal:hp-ia-12b +, author = "Michael Hoffmann and Eli Packer" +, title = "Inscribed Areas" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:InscribedAreas" +, year = 2012 +} + +@incollection{cgal:fghhs-od-12b +, author = "Kaspar Fischer and Bernd G{\"a}rtner and Thomas Herrmann and Michael Hoffmann + and Sven Sch{\"o}nherr" +, title = "Optimal Distances" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:OptimalDistances" +, year = 2012 +} + +@incollection{cgal:f-i-12b +, author = "Julia Fl{\"o}totto" +, title = "{2D} and Surface Function Interpolation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Interpolation2" +, year = 2012 +} + +@incollection{cgal:ap-pcad-12b +, author = "Pierre Alliez and Sylvain Pion and Ankit Gupta" +, title = "Principal Component Analysis" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PrincipalComponentAnalysisD" +, year = 2012 +} + +@incollection{cgal:m-ps-12b +, author = "Abdelkrim Mebarki" +, title = "{2D} Placement of Streamlines" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PlacementOfStreamlines2" +, year = 2012 +} + +@incollection{cgal:cp-arutsm-12b +, author = "Marc Pouget and Fr\'ed\'eric Cazals" +, title = "Approximation of Ridges and Umbilics on Triangulated Surface Meshes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Ridges_3" +, year = 2012 +} + +@incollection{cgal:pc-eldp-12b +, author = "Marc Pouget and Fr\'ed\'eric Cazals" +, title = "Estimation of Local Differential Properties of Point-Sampled Surfaces" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Jet_fitting_3" +, year = 2012 +} + +@incollection{cgal:ass-psp-12b +, author = "Pierre Alliez and Laurent Saboret and Nader Salman" +, title = "Point Set Processing" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PointSetProcessing" +, year = 2012 +} + +@incollection{cgal:r-kds-12b +, author = "Daniel Russel" +, title = "Kinetic Data Structures" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Kds" +, year = 2012 +} + +@incollection{cgal:r-kdsf-12b +, author = "Daniel Russel" +, title = "Kinetic Framework" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:KdsFramework" +, year = 2012 +} + +@incollection{cgal:cfw-cbgl-12b +, author = "Andreas Fabri and Fernando Cacciola and Ron Wein" +, title = "{CGAL} and the {Boost} Graph Library" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BGL" +, year = 2012 +} + +@incollection{cgal:fs-cbpm-12b +, author = "Andreas Fabri and Laurent Saboret" +, title = "{CGAL} and {Boost} Property Maps" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Property_map" +, year = 2012 +} + +@incollection{cgal:dd-ss-12b +, author = "Christophe Delage and Olivier Devillers" +, title = "Spatial Sorting" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SpatialSorting" +, year = 2012 +} + +@incollection{cgal:atw-aabb-12b +, author = "Pierre Alliez and St\'ephane Tayeb and Camille Wormser" +, title = "3D Fast Intersection and Distance Computation (AABB Tree)" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AABB_tree" +, year = 2012 +} + +@incollection{cgal:h-msms-12b +, author = "Michael Hoffmann" +, title = "Monotone and Sorted Matrix Search" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:MatrixSearch" +, year = 2012 +} + +@incollection{cgal:hkpw-se-12b +, author = "Michael Hoffmann and Lutz Kettner and Sylvain Pion and Ron Wein" +, title = "STL Extensions for {CGAL}" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:StlExtension" +, year = 2012 +} + +@incollection{cgal:dksy-hc-12b +, author = "Olivier Devillers and Lutz Kettner and Michael Seel and Mariette Yvinec" +, title = "Handles and Circulators" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:HandlesAndCirculators" +, year = 2012 +} + +@incollection{cgal:dhhk-gog-12b +, author = "Olivier Devillers and Susan Hert and Michael Hoffmann and Lutz Kettner and Sven Sch\"onherr" +, title = "Geometric Object Generators" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Generators" +, year = 2012 +} + +@incollection{cgal:kps-pthum-12b +, author = "Lutz Kettner and Sylvain Pion and Michael Seel" +, title = "Profiling Tools Timers, Hash Map, Union-find, Modifiers" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ProfilingTools" +, year = 2012 +} + +@incollection{cgal:fgk-ios-12b +, author = "Andreas Fabri and Geert-Jan Giezeman and Lutz Kettner" +, title = "IO Streams" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:IOstreams" +, year = 2012 +} + +@incollection{cgal:fp-gv-12b +, author = "Andreas Fabri and Sylvain Pion" +, title = "Geomview" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Geomview" +, year = 2012 +} + +@incollection{cgal:fr-cqgvf-12b +, author = "Andreas Fabri and Laurent Rineau" +, title = "{CGAL} and the Qt Graphics View Framework " +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:GraphicsView" +, year = 2012 +} + +@incollection{cgal:lp-gi-12b +, author = "S\'ebastien Loriot and Sylvain Pion" +, title = "{CGAL} Ipelets " +, publisher = "{CGAL Editorial Board}" +, edition = "{4.1}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:CGALIpelets" +, year = 2012 +} diff --git a/Manual/doc_tex/Preliminaries/main.tex b/Manual/doc_tex/Preliminaries/main.tex index 9198e608e0c..9c9d10078f4 100644 --- a/Manual/doc_tex/Preliminaries/main.tex +++ b/Manual/doc_tex/Preliminaries/main.tex @@ -111,10 +111,19 @@ a command-line switch \ccc{-std=c++0x} which enables some of those features. some of these features if they are available, although no extensive support has been implemented yet. +\section{Functor Return Types} + +\cgal\ functors support the +\ccAnchor{http://www.boost.org/doc/libs/release/libs/utility/utility.htm#result_of}{result\_of} +protocol. If a functor \ccStyle{F} has the same return type across all +overloads of \ccStyle{operator()}, the nested type +\ccStyle{F::result_type} is defined to be that type. Otherwise the +return type of calling the functor with an argument of type +\ccStyle{Arg} can be accessed through +\ccStyle{boost::result_of::type}. \input{Preliminaries/checks} % extra chapter - \section{Identifying the Version of CGAL\label{sec:cgal_version}} \ccInclude{CGAL/config.h} diff --git a/Manual_tools/dont_submit b/Manual_tools/dont_submit index 42ed8f9806b..72e8ffc0db8 100644 --- a/Manual_tools/dont_submit +++ b/Manual_tools/dont_submit @@ -1,20 +1 @@ -aspell -CHANGES -doc_html -doc_pdf -doc_ps -dont_submit -example -image_makers -INSTALLATION -install.config -install.sh -package_info -README -release_procedure -scripts -src -sty -test -TO_DO - +* diff --git a/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.bib b/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.bib index 7f79ad9cfd3..01593204630 100644 --- a/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.bib +++ b/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.bib @@ -5,8 +5,8 @@ % % % automatically generated -% % bibtex2html ../../../../Manual/doc_tex/Manual/manual-4.0.bib -% Date: Fri Feb 10 11:12:12 2012 +% % bibtex2html /home/lrineau/next/Manual/doc_tex/Manual/manual-4.1.bib +% Date: Tue Jul 24 14:02:29 2012 % Author: lrineau % @@ -22,75 +22,75 @@ -@BOOK{cgal:eb-12, +@BOOK{cgal:eb-12b, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{CGAL} User and Reference Manual}, YEAR = {2012}, AUTHOR = {{The CGAL Project}}, ALTEDITOR = {}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html}}, } -@INCOLLECTION{cgal:h-af-12, +@INCOLLECTION{cgal:h-af-12b, AUTHOR = {Michael Hemmer}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Algebraic Foundations}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlgebraicFoundations}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:AlgebraicFoundations}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlgebraicFoundations}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlgebraicFoundations}}, } -@INCOLLECTION{cgal:bht-ak-12, +@INCOLLECTION{cgal:bht-ak-12b, AUTHOR = {Eric Berberich and Michael Hemmer and Sylvain Lazard and Luis Pearanda and Monique Teillaud}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Algebraic Kernel}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlgebraicKerneld}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:AlgebraicKerneld}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlgebraicKerneld}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlgebraicKerneld}}, } -@INCOLLECTION{cgal:hhkps-nt-12, +@INCOLLECTION{cgal:hhkps-nt-12b, AUTHOR = {Michael Hemmer and Susan Hert and Lutz Kettner and Sylvain Pion and Stefan Schirra}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Number Types}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:NumberTypes}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:NumberTypes}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:NumberTypes}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:NumberTypes}}, } -@INCOLLECTION{cgal:h-p-12, +@INCOLLECTION{cgal:h-p-12b, AUTHOR = {Michael Hemmer}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Polynomial}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Polynomial}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Polynomial}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Polynomial}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Polynomial}}, } -@INCOLLECTION{cgal:h-ma-12, +@INCOLLECTION{cgal:h-ma-12b, AUTHOR = {Michael Hemmer}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Modular Arithmetic}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:ModularArithmetic}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:ModularArithmetic}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:ModularArithmetic}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ModularArithmetic}}, } -@INCOLLECTION{cgal:bfghhkps-lgk23-12, +@INCOLLECTION{cgal:bfghhkps-lgk23-12b, AUTHOR = {Herv Brnnimann and Andreas Fabri and Geert-Jan Giezeman and Susan Hert and Michael Hoffmann and Lutz Kettner and Sylvain Pion and Stefan Schirra}, @@ -98,826 +98,826 @@ PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} and {3D} Geometry Kernel}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Kernel23}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Kernel23}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Kernel23}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Kernel23}}, } -@INCOLLECTION{cgal:s-gkd-12, +@INCOLLECTION{cgal:s-gkd-12b, AUTHOR = {Michael Seel}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{dD} Geometry Kernel}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:KernelD}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:KernelD}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:KernelD}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:KernelD}}, } -@INCOLLECTION{cgal:cpt-cgk2-12, +@INCOLLECTION{cgal:cpt-cgk2-12b, AUTHOR = {de Castro, Pedro Machado Manhes and Sylvain Pion and Monique Teillaud}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Circular Geometry Kernel}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:CircularKernel2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:CircularKernel2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:CircularKernel2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:CircularKernel2}}, } -@INCOLLECTION{cgal:cclt-sgk3-12, +@INCOLLECTION{cgal:cclt-sgk3-12b, AUTHOR = {de Castro, Pedro Machado Manhes and Frdric Cazals and Sbastien Loriot and Monique Teillaud}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Spherical Geometry Kernel}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SphericalKernel3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SphericalKernel3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SphericalKernel3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SphericalKernel3}}, } -@INCOLLECTION{cgal:hs-chep2-12, +@INCOLLECTION{cgal:hs-chep2-12b, AUTHOR = {Susan Hert and Stefan Schirra}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Convex Hulls and Extreme Points}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexHull2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:ConvexHull2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexHull2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexHull2}}, } -@INCOLLECTION{cgal:hs-ch3-12, +@INCOLLECTION{cgal:hs-ch3-12b, AUTHOR = {Susan Hert and Stefan Schirra}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Convex Hulls}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexHull3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:ConvexHull3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexHull3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexHull3}}, } -@INCOLLECTION{cgal:gw-p2-12, +@INCOLLECTION{cgal:gw-p2-12b, AUTHOR = {Geert-Jan Giezeman and Wieger Wesselink}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Polygons}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Polygon2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Polygon2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Polygon2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Polygon2}}, } -@INCOLLECTION{cgal:h-pp2-12, +@INCOLLECTION{cgal:h-pp2-12b, AUTHOR = {Susan Hert}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Polygon Partitioning}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:PolygonPartitioning2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:PolygonPartitioning2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:PolygonPartitioning2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PolygonPartitioning2}}, } -@INCOLLECTION{cgal:hs-chdt3-12, +@INCOLLECTION{cgal:hs-chdt3-12b, AUTHOR = {Susan Hert and Michael Seel}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{dD} Convex Hulls and {Delaunay} Triangulations}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexHullD}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:ConvexHullD}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexHullD}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexHullD}}, } -@INCOLLECTION{cgal:k-ps-12, +@INCOLLECTION{cgal:k-ps-12b, AUTHOR = {Lutz Kettner}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Polyhedral Surfaces}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Polyhedron}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Polyhedron}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Polyhedron}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Polyhedron}}, } -@INCOLLECTION{cgal:k-hds-12, +@INCOLLECTION{cgal:k-hds-12b, AUTHOR = {Lutz Kettner}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Halfedge Data Structures}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:HDS}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:HDS}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:HDS}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:HDS}}, } -@INCOLLECTION{cgal:d-cm-12, +@INCOLLECTION{cgal:d-cm-12b, AUTHOR = {Guillaume Damiand}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Combinatorial Maps}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:CombinatorialMaps}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:CombinatorialMaps}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:CombinatorialMaps}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:CombinatorialMaps}}, } -@INCOLLECTION{cgal:d-lcc-12, +@INCOLLECTION{cgal:d-lcc-12b, AUTHOR = {Guillaume Damiand}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Linear Cell Complex}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:LinearCellComplex}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:LinearCellComplex}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:LinearCellComplex}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:LinearCellComplex}}, } -@INCOLLECTION{cgal:fwzh-rbso2-12, +@INCOLLECTION{cgal:fwzh-rbso2-12b, AUTHOR = {Efi Fogel and Ron Wein and Baruch Zukerman and Dan Halperin}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Regularized {Boolean} Set-Operations}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:BooleanSetOperations2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:BooleanSetOperations2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:BooleanSetOperations2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BooleanSetOperations2}}, } -@INCOLLECTION{cgal:w-rms2-12, +@INCOLLECTION{cgal:w-rms2-12b, AUTHOR = {Ron Wein}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} {Minkowski} Sums}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:MinkowskiSum2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:MinkowskiSum2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:MinkowskiSum2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:MinkowskiSum2}}, } -@INCOLLECTION{cgal:s-bonp2-12, +@INCOLLECTION{cgal:s-bonp2-12b, AUTHOR = {Michael Seel}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} {Boolean} Operations on {Nef} Polygons}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Nef2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Nef2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Nef2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Nef2}}, } -@INCOLLECTION{cgal:hk-bonpes2-12, +@INCOLLECTION{cgal:hk-bonpes2-12b, AUTHOR = {Peter Hachenberger and Lutz Kettner}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} {Boolean} Operations on {Nef} Polygons Embedded on the Sphere}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:NefS2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:NefS2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:NefS2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:NefS2}}, } -@INCOLLECTION{cgal:hk-bonp3-12, +@INCOLLECTION{cgal:hk-bonp3-12b, AUTHOR = {Peter Hachenberger and Lutz Kettner}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} {Boolean} Operations on {Nef} Polyhedra}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Nef3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Nef3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Nef3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Nef3}}, } -@INCOLLECTION{cgal:h-emspe-12, +@INCOLLECTION{cgal:h-emspe-12b, AUTHOR = {Peter Hachenberger}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Convex Decomposition of Polyhedra}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexDecomposition3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:ConvexDecomposition3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:ConvexDecomposition3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ConvexDecomposition3}}, } -@INCOLLECTION{cgal:h-msp3-12, +@INCOLLECTION{cgal:h-msp3-12b, AUTHOR = {Peter Hachenberger}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} {Minkowski} Sum of Polyhedra}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:MinkowskiSum3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:MinkowskiSum3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:MinkowskiSum3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:MinkowskiSum3}}, } -@INCOLLECTION{cgal:c-sspo2-12, +@INCOLLECTION{cgal:c-sspo2-12b, AUTHOR = {Fernando Cacciola}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Straight Skeleton and Polygon Offsetting}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:StraightSkeleton2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:StraightSkeleton2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:StraightSkeleton2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:StraightSkeleton2}}, } -@INCOLLECTION{cgal:wfzh-a2-12, - AUTHOR = {Ron Wein and Efi Fogel and Baruch Zukerman and - Dan Halperin}, +@INCOLLECTION{cgal:wfzh-a2-12b, + AUTHOR = {Ron Wein and Eric Berberich and Efi Fogel and + Dan Halperin and Michael Hemmer and Oren Salzman and Baruch Zukerman}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Arrangements}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Arrangement2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Arrangement2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Arrangement2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Arrangement2}}, } -@INCOLLECTION{cgal:wfz-ic2-12, +@INCOLLECTION{cgal:wfz-ic2-12b, AUTHOR = {Baruch Zukerman and Ron Wein and Efi Fogel}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Intersection of Curves}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:IntersectionOfCurves2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:IntersectionOfCurves2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:IntersectionOfCurves2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:IntersectionOfCurves2}}, } -@INCOLLECTION{cgal:p-sr2-12, +@INCOLLECTION{cgal:p-sr2-12b, AUTHOR = {Eli Packer}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Snap Rounding}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SnapRounding2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SnapRounding2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SnapRounding2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SnapRounding2}}, } -@INCOLLECTION{cgal:w-e2-12, +@INCOLLECTION{cgal:w-e2-12b, AUTHOR = {Ron Wein}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Envelopes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Envelope2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Envelope2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Envelope2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Envelope2}}, } -@INCOLLECTION{cgal:mwz-e3-12, +@INCOLLECTION{cgal:mwz-e3-12b, AUTHOR = {Michal Meyerovitch and Ron Wein and Baruch Zukerman}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Envelopes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Envelope3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Envelope3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Envelope3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Envelope3}}, } -@INCOLLECTION{cgal:y-t2-12, +@INCOLLECTION{cgal:y-t2-12b, AUTHOR = {Mariette Yvinec}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Triangulations}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Triangulation2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Triangulation2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Triangulation2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Triangulation2}}, } -@INCOLLECTION{cgal:py-tds2-12, +@INCOLLECTION{cgal:py-tds2-12b, AUTHOR = {Sylvain Pion and Mariette Yvinec}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Triangulation Data Structure}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:TDS2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:TDS2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:TDS2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:TDS2}}, } -@INCOLLECTION{cgal:pt-t3-12, +@INCOLLECTION{cgal:pt-t3-12b, AUTHOR = {Sylvain Pion and Monique Teillaud}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Triangulations}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Triangulation3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Triangulation3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Triangulation3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Triangulation3}}, } -@INCOLLECTION{cgal:pt-tds3-12, +@INCOLLECTION{cgal:pt-tds3-12b, AUTHOR = {Sylvain Pion and Monique Teillaud}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Triangulation Data Structure}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:TDS3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:TDS3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:TDS3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:TDS3}}, } -@INCOLLECTION{cgal:ct-pt3-12, +@INCOLLECTION{cgal:ct-pt3-12b, AUTHOR = {Manuel Caroli and Monique Teillaud}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Periodic Triangulations}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Periodic3Triangulation3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Periodic3Triangulation3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Periodic3Triangulation3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Periodic3Triangulation3}}, } -@INCOLLECTION{cgal:d-as2-12, +@INCOLLECTION{cgal:d-as2-12b, AUTHOR = {Tran Kai Frank Da}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Alpha Shapes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlphaShape2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:AlphaShape2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlphaShape2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlphaShape2}}, } -@INCOLLECTION{cgal:dy-as3-12, +@INCOLLECTION{cgal:dy-as3-12b, AUTHOR = {Tran Kai Frank Da and Mariette Yvinec}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Alpha Shapes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlphaShapes3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:AlphaShapes3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:AlphaShapes3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AlphaShapes3}}, } -@INCOLLECTION{cgal:k-sdg2-12, +@INCOLLECTION{cgal:k-sdg2-12b, AUTHOR = {Menelaos Karavelas}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Segment {Delaunay} Graphs}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SegmentDelaunayGraph2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SegmentDelaunayGraph2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SegmentDelaunayGraph2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SegmentDelaunayGraph2}}, } -@INCOLLECTION{cgal:ky-ag2-12, +@INCOLLECTION{cgal:ky-ag2-12b, AUTHOR = {Menelaos Karavelas and Mariette Yvinec}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} {Apollonius} Graphs ({Delaunay} Graphs of Disks)}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:ApolloniusGraph2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:ApolloniusGraph2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:ApolloniusGraph2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ApolloniusGraph2}}, } -@INCOLLECTION{cgal:k-vda2-12, +@INCOLLECTION{cgal:k-vda2-12b, AUTHOR = {Menelaos Karavelas}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} {Voronoi} Diagram Adaptor}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:VoronoiDiagramAdaptor2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:VoronoiDiagramAdaptor2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:VoronoiDiagramAdaptor2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:VoronoiDiagramAdaptor2}}, } -@INCOLLECTION{cgal:r-ctm2-12, +@INCOLLECTION{cgal:r-ctm2-12b, AUTHOR = {Laurent Rineau}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Conforming Triangulations and Meshes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Mesh2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Mesh2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Mesh2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Mesh2}}, } -@INCOLLECTION{cgal:ry-smg-12, +@INCOLLECTION{cgal:ry-smg-12b, AUTHOR = {Laurent Rineau and Mariette Yvinec}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Surface Mesh Generation}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceMesher3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SurfaceMesher3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceMesher3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceMesher3}}, } -@INCOLLECTION{cgal:asg-srps-12, +@INCOLLECTION{cgal:asg-srps-12b, AUTHOR = {Pierre Alliez and Laurent Saboret and Gael Guennebaud}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Surface Reconstruction from Point Sets}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceReconstructionFromPointSets}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SurfaceReconstructionFromPointSets}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceReconstructionFromPointSets}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceReconstructionFromPointSets}}, } -@INCOLLECTION{cgal:k-ssm3-12, +@INCOLLECTION{cgal:k-ssm3-12b, AUTHOR = {Nico Kruithof}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Skin Surface Meshing}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SkinSurface3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SkinSurface3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SkinSurface3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SkinSurface3}}, } -@INCOLLECTION{cgal:rty-m3-12, +@INCOLLECTION{cgal:rty-m3-12b, AUTHOR = {Pierre Alliez and Laurent Rineau and Stphane Tayeb and Jane Tournois and Mariette Yvinec}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Mesh Generation}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Mesh\_3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Mesh_3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Mesh\_3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Mesh_3}}, } -@INCOLLECTION{cgal:s-ssm2-12, +@INCOLLECTION{cgal:s-ssm2-12b, AUTHOR = {Le-Jeng Andy Shiue}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Surface Subdivision Methods}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceSubdivisionMethods3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SurfaceSubdivisionMethods3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceSubdivisionMethods3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceSubdivisionMethods3}}, } -@INCOLLECTION{cgal:c-tsms-12, +@INCOLLECTION{cgal:c-tsms-12b, AUTHOR = {Fernando Cacciola}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Triangulated Surface Mesh Simplification}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceMeshSimplification}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SurfaceMeshSimplification}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceMeshSimplification}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceMeshSimplification}}, } -@INCOLLECTION{cgal:sal-pptsm2-12, +@INCOLLECTION{cgal:sal-pptsm2-12b, AUTHOR = {Laurent Saboret and Pierre Alliez and Bruno Lvy}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Planar Parameterization of Triangulated Surface Meshes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceParameterization}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SurfaceParameterization}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SurfaceParameterization}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SurfaceParameterization}}, } -@INCOLLECTION{cgal:b-ss2-12, +@INCOLLECTION{cgal:b-ss2-12b, AUTHOR = {Matthias Bsken}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Range and Neighbor Search}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:PointSet2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:PointSet2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:PointSet2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PointSet2}}, } -@INCOLLECTION{cgal:n-rstd-12, +@INCOLLECTION{cgal:n-rstd-12b, AUTHOR = {Gabriele Neyer}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{dD} Range and Segment Trees}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:RangeSegmentTreesD}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:RangeSegmentTreesD}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:RangeSegmentTreesD}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:RangeSegmentTreesD}}, } -@INCOLLECTION{cgal:f-isl-12, +@INCOLLECTION{cgal:f-isl-12b, AUTHOR = {Andreas Fabri}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Interval Skip List}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:IntervalSkipList}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:IntervalSkipList}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:IntervalSkipList}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:IntervalSkipList}}, } -@INCOLLECTION{cgal:tf-ssd-12, +@INCOLLECTION{cgal:tf-ssd-12b, AUTHOR = {Hans Tangelder and Andreas Fabri}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{dD} Spatial Searching}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SpatialSearchingD}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SpatialSearchingD}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SpatialSearchingD}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SpatialSearchingD}}, } -@INCOLLECTION{cgal:kmz-isiobd-12, +@INCOLLECTION{cgal:kmz-isiobd-12b, AUTHOR = {Lutz Kettner and Andreas Meyer and Afra Zomorodian}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Intersecting Sequences of {dD} Iso-oriented Boxes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:BoxIntersectionD}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:BoxIntersectionD}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:BoxIntersectionD}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BoxIntersectionD}}, } -@INCOLLECTION{cgal:fghhs-bv-12, +@INCOLLECTION{cgal:fghhs-bv-12b, AUTHOR = {Kaspar Fischer and Bernd Grtner and Thomas Herrmann and Michael Hoffmann and Sven Schnherr}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Bounding Volumes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:BoundingVolumes}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:BoundingVolumes}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:BoundingVolumes}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BoundingVolumes}}, } -@INCOLLECTION{cgal:fgsw-lqps-12, +@INCOLLECTION{cgal:fgsw-lqps-12b, AUTHOR = {Kaspar Fischer and Bernd Grtner and Sven Schnherr and Frans Wessendorp}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Linear and Quadratic Programming Solver}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:QPSolver}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:QPSolver}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:QPSolver}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:QPSolver}}, } -@INCOLLECTION{cgal:hp-ia-12, +@INCOLLECTION{cgal:hp-ia-12b, AUTHOR = {Michael Hoffmann and Eli Packer}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Inscribed Areas}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:InscribedAreas}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:InscribedAreas}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:InscribedAreas}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:InscribedAreas}}, } -@INCOLLECTION{cgal:fghhs-od-12, +@INCOLLECTION{cgal:fghhs-od-12b, AUTHOR = {Kaspar Fischer and Bernd Grtner and Thomas Herrmann and Michael Hoffmann and Sven Schnherr}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Optimal Distances}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:OptimalDistances}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:OptimalDistances}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:OptimalDistances}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:OptimalDistances}}, } -@INCOLLECTION{cgal:f-i-12, +@INCOLLECTION{cgal:f-i-12b, AUTHOR = {Julia Fltotto}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} and Surface Function Interpolation}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Interpolation2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Interpolation2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Interpolation2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Interpolation2}}, } -@INCOLLECTION{cgal:ap-pcad-12, +@INCOLLECTION{cgal:ap-pcad-12b, AUTHOR = {Pierre Alliez and Sylvain Pion and Ankit Gupta}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Principal Component Analysis}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:PrincipalComponentAnalysisD}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:PrincipalComponentAnalysisD}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:PrincipalComponentAnalysisD}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PrincipalComponentAnalysisD}}, } -@INCOLLECTION{cgal:m-ps-12, +@INCOLLECTION{cgal:m-ps-12b, AUTHOR = {Abdelkrim Mebarki}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{2D} Placement of Streamlines}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:PlacementOfStreamlines2}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:PlacementOfStreamlines2}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:PlacementOfStreamlines2}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PlacementOfStreamlines2}}, } -@INCOLLECTION{cgal:cp-arutsm-12, +@INCOLLECTION{cgal:cp-arutsm-12b, AUTHOR = {Marc Pouget and Frdric Cazals}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Approximation of Ridges and Umbilics on Triangulated Surface Meshes}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Ridges\_3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Ridges_3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Ridges\_3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Ridges_3}}, } -@INCOLLECTION{cgal:pc-eldp-12, +@INCOLLECTION{cgal:pc-eldp-12b, AUTHOR = {Marc Pouget and Frdric Cazals}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Estimation of Local Differential Properties of Point-Sampled Surfaces}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Jet\_fitting\_3}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Jet_fitting_3}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Jet\_fitting\_3}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Jet_fitting_3}}, } -@INCOLLECTION{cgal:ass-psp-12, +@INCOLLECTION{cgal:ass-psp-12b, AUTHOR = {Pierre Alliez and Laurent Saboret and Nader Salman}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Point Set Processing}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:PointSetProcessing}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:PointSetProcessing}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:PointSetProcessing}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:PointSetProcessing}}, } -@INCOLLECTION{cgal:r-kds-12, +@INCOLLECTION{cgal:r-kds-12b, AUTHOR = {Daniel Russel}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Kinetic Data Structures}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Kds}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Kds}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Kds}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Kds}}, } -@INCOLLECTION{cgal:r-kdsf-12, +@INCOLLECTION{cgal:r-kdsf-12b, AUTHOR = {Daniel Russel}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Kinetic Framework}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:KdsFramework}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:KdsFramework}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:KdsFramework}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:KdsFramework}}, } -@INCOLLECTION{cgal:cfw-cbgl-12, +@INCOLLECTION{cgal:cfw-cbgl-12b, AUTHOR = {Andreas Fabri and Fernando Cacciola and Ron Wein}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{CGAL} and the Boost Graph Library}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:BGL}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:BGL}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:BGL}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:BGL}}, } -@INCOLLECTION{cgal:fs-cbpm-12, +@INCOLLECTION{cgal:fs-cbpm-12b, AUTHOR = {Andreas Fabri and Laurent Saboret}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{CGAL} and Boost Property Maps}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Property\_map}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Property_map}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Property\_map}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Property_map}}, } -@INCOLLECTION{cgal:dd-ss-12, +@INCOLLECTION{cgal:dd-ss-12b, AUTHOR = {Christophe Delage and Olivier Devillers}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Spatial Sorting}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:SpatialSorting}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:SpatialSorting}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:SpatialSorting}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:SpatialSorting}}, } -@INCOLLECTION{cgal:atw-aabb-12, +@INCOLLECTION{cgal:atw-aabb-12b, AUTHOR = {Pierre Alliez and Stphane Tayeb and Camille Wormser}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{3D} Fast Intersection and Distance Computation (AABB Tree)}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:AABB\_tree}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:AABB_tree}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:AABB\_tree}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:AABB_tree}}, } -@INCOLLECTION{cgal:h-msms-12, +@INCOLLECTION{cgal:h-msms-12b, AUTHOR = {Michael Hoffmann}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Monotone and Sorted Matrix Search}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:MatrixSearch}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:MatrixSearch}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:MatrixSearch}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:MatrixSearch}}, } -@INCOLLECTION{cgal:hkpw-se-12, +@INCOLLECTION{cgal:hkpw-se-12b, AUTHOR = {Michael Hoffmann and Lutz Kettner and Sylvain Pion and Ron Wein}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {STL Extensions for CGAL}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:StlExtension}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:StlExtension}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:StlExtension}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:StlExtension}}, } -@INCOLLECTION{cgal:dksy-hc-12, +@INCOLLECTION{cgal:dksy-hc-12b, AUTHOR = {Olivier Devillers and Lutz Kettner and Michael Seel and Mariette Yvinec}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Handles and Circulators}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:HandlesAndCirculators}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:HandlesAndCirculators}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:HandlesAndCirculators}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:HandlesAndCirculators}}, } -@INCOLLECTION{cgal:dhhk-gog-12, +@INCOLLECTION{cgal:dhhk-gog-12b, AUTHOR = {Olivier Devillers and Susan Hert and Michael Hoffmann and Lutz Kettner and Sven Schnherr}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Geometric Object Generators}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Generators}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Generators}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Generators}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Generators}}, } -@INCOLLECTION{cgal:kps-pthum-12, +@INCOLLECTION{cgal:kps-pthum-12b, AUTHOR = {Lutz Kettner and Sylvain Pion and Michael Seel}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Profiling Tools Timers, Hash Map, Union-find, Modifiers}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:ProfilingTools}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:ProfilingTools}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:ProfilingTools}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ProfilingTools}}, } -@INCOLLECTION{cgal:fgk-ios-12, +@INCOLLECTION{cgal:fgk-ios-12b, AUTHOR = {Andreas Fabri and Geert-Jan Giezeman and Lutz Kettner}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {IO Streams}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:IOstreams}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:IOstreams}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:IOstreams}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:IOstreams}}, } -@INCOLLECTION{cgal:fp-gv-12, +@INCOLLECTION{cgal:fp-gv-12b, AUTHOR = {Andreas Fabri and Sylvain Pion}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {Geomview}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:Geomview}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:Geomview}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:Geomview}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:Geomview}}, } -@INCOLLECTION{cgal:fr-cqgvf-12, +@INCOLLECTION{cgal:fr-cqgvf-12b, AUTHOR = {Andreas Fabri and Laurent Rineau}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{CGAL} and the Qt Graphics View Framework}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:GraphicsView}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:GraphicsView}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:GraphicsView}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:GraphicsView}}, } -@INCOLLECTION{cgal:lp-gi-12, +@INCOLLECTION{cgal:lp-gi-12b, AUTHOR = {Sbastien Loriot and Sylvain Pion}, BOOKTITLE = {{CGAL} User and Reference Manual}, PUBLISHER = {{CGAL Editorial Board}}, TITLE = {{CGAL} Ipelets}, YEAR = {2012}, - EDITION = {{4.0}}, - NOTE = {http\string://www.cgal.org/Manual/4.0/doc\_html/cgal\_manual/packages.html\#Pkg\string:CGALIpelets}, - ALTNOTE = {\url{http://www.cgal.org/Manual/4.0/doc_html/cgal_manual/packages.html#Pkg:CGALIpelets}}, + EDITION = {{4.1}}, + NOTE = {http\string://www.cgal.org/Manual/4.1/doc\_html/cgal\_manual/packages.html\#Pkg\string:CGALIpelets}, + ALTNOTE = {\url{http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:CGALIpelets}}, } diff --git a/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.html b/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.html index c2ef3ee6319..eb22ed09d57 100644 --- a/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.html +++ b/Manual_tools/src/latex_converter_config/html/Biblio/how_to_cite_cgal.html @@ -21,34 +21,34 @@ CGAL Manual Chapters
  1. -The CGAL Project. +The CGAL Project. CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:eb-12 - bibtex file] +[bibtex-key = cgal:eb-12b]


  2. -Michael Hemmer. +Michael Hemmer. Algebraic Foundations. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:h-af-12 - bibtex file] +[bibtex-key = cgal:h-af-12b]


  3. -Eric Berberich, +Eric Berberich, Michael Hemmer, Sylvain Lazard, Luis Pearanda, @@ -56,17 +56,17 @@ Luis Pe Algebraic Kernel. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:bht-ak-12 - bibtex file] +[bibtex-key = cgal:bht-ak-12b]


  4. -Michael Hemmer, +Michael Hemmer, Susan Hert, Lutz Kettner, Sylvain Pion, @@ -74,45 +74,45 @@ Sylvain Pion, Number Types. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hhkps-nt-12 - bibtex file] +[bibtex-key = cgal:hhkps-nt-12b]


  5. -Michael Hemmer. +Michael Hemmer. Polynomial. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:h-p-12 - bibtex file] +[bibtex-key = cgal:h-p-12b]


  6. -Michael Hemmer. +Michael Hemmer. Modular Arithmetic. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:h-ma-12 - bibtex file] +[bibtex-key = cgal:h-ma-12b]


  7. -Herv Brnnimann, +Herv Brnnimann, Andreas Fabri, Geert-Jan Giezeman, Susan Hert, @@ -123,580 +123,583 @@ Sylvain Pion, 2D and 3D Geometry Kernel. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:bfghhkps-lgk23-12 - bibtex file] +[bibtex-key = cgal:bfghhkps-lgk23-12b]


  8. -Michael Seel. +Michael Seel. dD Geometry Kernel. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:s-gkd-12 - bibtex file] +[bibtex-key = cgal:s-gkd-12b]


  9. -Pedro Machado Manhes de Castro, +Pedro Machado Manhes de Castro, Sylvain Pion, and Monique Teillaud. 2D Circular Geometry Kernel. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:cpt-cgk2-12 - bibtex file] +[bibtex-key = cgal:cpt-cgk2-12b]


  10. -Pedro Machado Manhes de Castro, +Pedro Machado Manhes de Castro, Frdric Cazals, Sbastien Loriot, and Monique Teillaud. 3D Spherical Geometry Kernel. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:cclt-sgk3-12 - bibtex file] +[bibtex-key = cgal:cclt-sgk3-12b]


  11. -Susan Hert and Stefan Schirra. +Susan Hert and Stefan Schirra. 2D Convex Hulls and Extreme Points. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hs-chep2-12 - bibtex file] +[bibtex-key = cgal:hs-chep2-12b]


  12. -Susan Hert and Stefan Schirra. +Susan Hert and Stefan Schirra. 3D Convex Hulls. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hs-ch3-12 - bibtex file] +[bibtex-key = cgal:hs-ch3-12b]


  13. -Geert-Jan Giezeman and Wieger Wesselink. +Geert-Jan Giezeman and Wieger Wesselink. 2D Polygons. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:gw-p2-12 - bibtex file] +[bibtex-key = cgal:gw-p2-12b]


  14. -Susan Hert. +Susan Hert. 2D Polygon Partitioning. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:h-pp2-12 - bibtex file] +[bibtex-key = cgal:h-pp2-12b]


  15. -Susan Hert and Michael Seel. +Susan Hert and Michael Seel. dD Convex Hulls and Delaunay Triangulations. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hs-chdt3-12 - bibtex file] +[bibtex-key = cgal:hs-chdt3-12b]


  16. -Lutz Kettner. +Lutz Kettner. 3D Polyhedral Surfaces. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:k-ps-12 - bibtex file] +[bibtex-key = cgal:k-ps-12b]


  17. -Lutz Kettner. +Lutz Kettner. Halfedge Data Structures. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:k-hds-12 - bibtex file] +[bibtex-key = cgal:k-hds-12b]


  18. -Guillaume Damiand. +Guillaume Damiand. Combinatorial Maps. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:d-cm-12 - bibtex file] +[bibtex-key = cgal:d-cm-12b]


  19. -Guillaume Damiand. +Guillaume Damiand. Linear Cell Complex. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:d-lcc-12 - bibtex file] +[bibtex-key = cgal:d-lcc-12b]


  20. -Efi Fogel, +Efi Fogel, Ron Wein, Baruch Zukerman, and Dan Halperin. 2D Regularized Boolean Set-Operations. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fwzh-rbso2-12 - bibtex file] +[bibtex-key = cgal:fwzh-rbso2-12b]


  21. -Ron Wein. +Ron Wein. 2D Minkowski Sums. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:w-rms2-12 - bibtex file] +[bibtex-key = cgal:w-rms2-12b]


  22. -Michael Seel. +Michael Seel. 2D Boolean Operations on Nef Polygons. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:s-bonp2-12 - bibtex file] +[bibtex-key = cgal:s-bonp2-12b]


  23. -Peter Hachenberger and Lutz Kettner. +Peter Hachenberger and Lutz Kettner. 2D Boolean Operations on Nef Polygons Embedded on the Sphere. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hk-bonpes2-12 - bibtex file] +[bibtex-key = cgal:hk-bonpes2-12b]


  24. -Peter Hachenberger and Lutz Kettner. +Peter Hachenberger and Lutz Kettner. 3D Boolean Operations on Nef Polyhedra. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hk-bonp3-12 - bibtex file] +[bibtex-key = cgal:hk-bonp3-12b]


  25. -Peter Hachenberger. +Peter Hachenberger. Convex Decomposition of Polyhedra. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:h-emspe-12 - bibtex file] +[bibtex-key = cgal:h-emspe-12b]


  26. -Peter Hachenberger. +Peter Hachenberger. 3D Minkowski Sum of Polyhedra. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:h-msp3-12 - bibtex file] +[bibtex-key = cgal:h-msp3-12b]


  27. -Fernando Cacciola. +Fernando Cacciola. 2D Straight Skeleton and Polygon Offsetting. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:c-sspo2-12 - bibtex file] +[bibtex-key = cgal:c-sspo2-12b]


  28. -Ron Wein, +Ron Wein, +Eric Berberich, Efi Fogel, -Baruch Zukerman, - and Dan Halperin. +Dan Halperin, +Michael Hemmer, +Oren Salzman, + and Baruch Zukerman. 2D Arrangements. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:wfzh-a2-12 - bibtex file] +[bibtex-key = cgal:wfzh-a2-12b]


  29. -Baruch Zukerman, +Baruch Zukerman, Ron Wein, and Efi Fogel. 2D Intersection of Curves. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:wfz-ic2-12 - bibtex file] +[bibtex-key = cgal:wfz-ic2-12b]


  30. -Eli Packer. +Eli Packer. 2D Snap Rounding. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:p-sr2-12 - bibtex file] +[bibtex-key = cgal:p-sr2-12b]


  31. -Ron Wein. +Ron Wein. 2D Envelopes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:w-e2-12 - bibtex file] +[bibtex-key = cgal:w-e2-12b]


  32. -Michal Meyerovitch, +Michal Meyerovitch, Ron Wein, and Baruch Zukerman. 3D Envelopes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:mwz-e3-12 - bibtex file] +[bibtex-key = cgal:mwz-e3-12b]


  33. -Mariette Yvinec. +Mariette Yvinec. 2D Triangulations. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:y-t2-12 - bibtex file] +[bibtex-key = cgal:y-t2-12b]


  34. -Sylvain Pion and Mariette Yvinec. +Sylvain Pion and Mariette Yvinec. 2D Triangulation Data Structure. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:py-tds2-12 - bibtex file] +[bibtex-key = cgal:py-tds2-12b]


  35. -Sylvain Pion and Monique Teillaud. +Sylvain Pion and Monique Teillaud. 3D Triangulations. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:pt-t3-12 - bibtex file] +[bibtex-key = cgal:pt-t3-12b]


  36. -Sylvain Pion and Monique Teillaud. +Sylvain Pion and Monique Teillaud. 3D Triangulation Data Structure. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:pt-tds3-12 - bibtex file] +[bibtex-key = cgal:pt-tds3-12b]


  37. -Manuel Caroli and Monique Teillaud. +Manuel Caroli and Monique Teillaud. 3D Periodic Triangulations. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:ct-pt3-12 - bibtex file] +[bibtex-key = cgal:ct-pt3-12b]


  38. -Tran Kai Frank Da. +Tran Kai Frank Da. 2D Alpha Shapes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:d-as2-12 - bibtex file] +[bibtex-key = cgal:d-as2-12b]


  39. -Tran Kai Frank Da and Mariette Yvinec. +Tran Kai Frank Da and Mariette Yvinec. 3D Alpha Shapes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:dy-as3-12 - bibtex file] +[bibtex-key = cgal:dy-as3-12b]


  40. -Menelaos Karavelas. +Menelaos Karavelas. 2D Segment Delaunay Graphs. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:k-sdg2-12 - bibtex file] +[bibtex-key = cgal:k-sdg2-12b]


  41. -Menelaos Karavelas and Mariette Yvinec. +Menelaos Karavelas and Mariette Yvinec. 2D Apollonius Graphs (Delaunay Graphs of Disks). In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:ky-ag2-12 - bibtex file] +[bibtex-key = cgal:ky-ag2-12b]


  42. -Menelaos Karavelas. +Menelaos Karavelas. 2D Voronoi Diagram Adaptor. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:k-vda2-12 - bibtex file] +[bibtex-key = cgal:k-vda2-12b]


  43. -Laurent Rineau. +Laurent Rineau. 2D Conforming Triangulations and Meshes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:r-ctm2-12 - bibtex file] +[bibtex-key = cgal:r-ctm2-12b]


  44. -Laurent Rineau and Mariette Yvinec. +Laurent Rineau and Mariette Yvinec. 3D Surface Mesh Generation. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:ry-smg-12 - bibtex file] +[bibtex-key = cgal:ry-smg-12b]


  45. -Pierre Alliez, +Pierre Alliez, Laurent Saboret, and Gael Guennebaud. Surface Reconstruction from Point Sets. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:asg-srps-12 - bibtex file] +[bibtex-key = cgal:asg-srps-12b]


  46. -Nico Kruithof. +Nico Kruithof. 3D Skin Surface Meshing. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:k-ssm3-12 - bibtex file] +[bibtex-key = cgal:k-ssm3-12b]


  47. -Pierre Alliez, +Pierre Alliez, Laurent Rineau, Stphane Tayeb, Jane Tournois, @@ -704,133 +707,133 @@ Jane Tournois, 3D Mesh Generation. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:rty-m3-12 - bibtex file] +[bibtex-key = cgal:rty-m3-12b]


  48. -Le-Jeng Andy Shiue. +Le-Jeng Andy Shiue. 3D Surface Subdivision Methods. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:s-ssm2-12 - bibtex file] +[bibtex-key = cgal:s-ssm2-12b]


  49. -Fernando Cacciola. +Fernando Cacciola. Triangulated Surface Mesh Simplification. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:c-tsms-12 - bibtex file] +[bibtex-key = cgal:c-tsms-12b]


  50. -Laurent Saboret, +Laurent Saboret, Pierre Alliez, and Bruno Lvy. Planar Parameterization of Triangulated Surface Meshes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:sal-pptsm2-12 - bibtex file] +[bibtex-key = cgal:sal-pptsm2-12b]


  51. -Matthias Bsken. +Matthias Bsken. 2D Range and Neighbor Search. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:b-ss2-12 - bibtex file] +[bibtex-key = cgal:b-ss2-12b]


  52. -Gabriele Neyer. +Gabriele Neyer. dD Range and Segment Trees. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:n-rstd-12 - bibtex file] +[bibtex-key = cgal:n-rstd-12b]


  53. -Andreas Fabri. +Andreas Fabri. Interval Skip List. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:f-isl-12 - bibtex file] +[bibtex-key = cgal:f-isl-12b]


  54. -Hans Tangelder and Andreas Fabri. +Hans Tangelder and Andreas Fabri. dD Spatial Searching. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:tf-ssd-12 - bibtex file] +[bibtex-key = cgal:tf-ssd-12b]


  55. -Lutz Kettner, +Lutz Kettner, Andreas Meyer, and Afra Zomorodian. Intersecting Sequences of dD Iso-oriented Boxes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:kmz-isiobd-12 - bibtex file] +[bibtex-key = cgal:kmz-isiobd-12b]


  56. -Kaspar Fischer, +Kaspar Fischer, Bernd Grtner, Thomas Herrmann, Michael Hoffmann, @@ -838,48 +841,48 @@ Michael Hoffmann, Bounding Volumes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fghhs-bv-12 - bibtex file] +[bibtex-key = cgal:fghhs-bv-12b]


  57. -Kaspar Fischer, +Kaspar Fischer, Bernd Grtner, Sven Schnherr, and Frans Wessendorp. Linear and Quadratic Programming Solver. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fgsw-lqps-12 - bibtex file] +[bibtex-key = cgal:fgsw-lqps-12b]


  58. -Michael Hoffmann and Eli Packer. +Michael Hoffmann and Eli Packer. Inscribed Areas. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hp-ia-12 - bibtex file] +[bibtex-key = cgal:hp-ia-12b]


  59. -Kaspar Fischer, +Kaspar Fischer, Bernd Grtner, Thomas Herrmann, Michael Hoffmann, @@ -887,241 +890,241 @@ Michael Hoffmann, Optimal Distances. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fghhs-od-12 - bibtex file] +[bibtex-key = cgal:fghhs-od-12b]


  60. -Julia Fltotto. +Julia Fltotto. 2D and Surface Function Interpolation. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:f-i-12 - bibtex file] +[bibtex-key = cgal:f-i-12b]


  61. -Pierre Alliez, +Pierre Alliez, Sylvain Pion, and Ankit Gupta. Principal Component Analysis. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:ap-pcad-12 - bibtex file] +[bibtex-key = cgal:ap-pcad-12b]


  62. -Abdelkrim Mebarki. +Abdelkrim Mebarki. 2D Placement of Streamlines. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:m-ps-12 - bibtex file] +[bibtex-key = cgal:m-ps-12b]


  63. -Marc Pouget and Frdric Cazals. +Marc Pouget and Frdric Cazals. Approximation of Ridges and Umbilics on Triangulated Surface Meshes. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:cp-arutsm-12 - bibtex file] +[bibtex-key = cgal:cp-arutsm-12b]


  64. -Marc Pouget and Frdric Cazals. +Marc Pouget and Frdric Cazals. Estimation of Local Differential Properties of Point-Sampled Surfaces. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:pc-eldp-12 - bibtex file] +[bibtex-key = cgal:pc-eldp-12b]


  65. -Pierre Alliez, +Pierre Alliez, Laurent Saboret, and Nader Salman. Point Set Processing. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:ass-psp-12 - bibtex file] +[bibtex-key = cgal:ass-psp-12b]


  66. -Daniel Russel. +Daniel Russel. Kinetic Data Structures. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:r-kds-12 - bibtex file] +[bibtex-key = cgal:r-kds-12b]


  67. -Daniel Russel. +Daniel Russel. Kinetic Framework. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:r-kdsf-12 - bibtex file] +[bibtex-key = cgal:r-kdsf-12b]


  68. -Andreas Fabri, +Andreas Fabri, Fernando Cacciola, and Ron Wein. CGAL and the Boost Graph Library. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:cfw-cbgl-12 - bibtex file] +[bibtex-key = cgal:cfw-cbgl-12b]


  69. -Andreas Fabri and Laurent Saboret. +Andreas Fabri and Laurent Saboret. CGAL and Boost Property Maps. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fs-cbpm-12 - bibtex file] +[bibtex-key = cgal:fs-cbpm-12b]


  70. -Christophe Delage and Olivier Devillers. +Christophe Delage and Olivier Devillers. Spatial Sorting. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:dd-ss-12 - bibtex file] +[bibtex-key = cgal:dd-ss-12b]


  71. -Pierre Alliez, +Pierre Alliez, Stphane Tayeb, and Camille Wormser. 3D Fast Intersection and Distance Computation (AABB Tree). In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:atw-aabb-12 - bibtex file] +[bibtex-key = cgal:atw-aabb-12b]


  72. -Michael Hoffmann. +Michael Hoffmann. Monotone and Sorted Matrix Search. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:h-msms-12 - bibtex file] +[bibtex-key = cgal:h-msms-12b]


  73. -Michael Hoffmann, +Michael Hoffmann, Lutz Kettner, Sylvain Pion, and Ron Wein. STL Extensions for CGAL. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:hkpw-se-12 - bibtex file] +[bibtex-key = cgal:hkpw-se-12b]


  74. -Olivier Devillers, +Olivier Devillers, Lutz Kettner, Michael Seel, and Mariette Yvinec. Handles and Circulators. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:dksy-hc-12 - bibtex file] +[bibtex-key = cgal:dksy-hc-12b]


  75. -Olivier Devillers, +Olivier Devillers, Susan Hert, Michael Hoffmann, Lutz Kettner, @@ -1129,84 +1132,84 @@ Lutz Kettner, Geometric Object Generators. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:dhhk-gog-12 - bibtex file] +[bibtex-key = cgal:dhhk-gog-12b]


  76. -Lutz Kettner, +Lutz Kettner, Sylvain Pion, and Michael Seel. Profiling Tools Timers, Hash Map, Union-find, Modifiers. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:kps-pthum-12 - bibtex file] +[bibtex-key = cgal:kps-pthum-12b]


  77. -Andreas Fabri, +Andreas Fabri, Geert-Jan Giezeman, and Lutz Kettner. IO Streams. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fgk-ios-12 - bibtex file] +[bibtex-key = cgal:fgk-ios-12b]


  78. -Andreas Fabri and Sylvain Pion. +Andreas Fabri and Sylvain Pion. Geomview. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fp-gv-12 - bibtex file] +[bibtex-key = cgal:fp-gv-12b]


  79. -Andreas Fabri and Laurent Rineau. +Andreas Fabri and Laurent Rineau. CGAL and the Qt Graphics View Framework. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:fr-cqgvf-12 - bibtex file] +[bibtex-key = cgal:fr-cqgvf-12b]


  80. -Sbastien Loriot and Sylvain Pion. +Sbastien Loriot and Sylvain Pion. CGAL Ipelets. In CGAL User and Reference Manual. CGAL Editorial Board, -4.0 edition, +4.1 edition, 2012. [WWW] -[bibtex-key = cgal:lp-gi-12 - bibtex file] +[bibtex-key = cgal:lp-gi-12b]


  81. diff --git a/Matrix_search/include/CGAL/rectangular_3_center_2.h b/Matrix_search/include/CGAL/rectangular_3_center_2.h index c91845879c7..79a1cde94ba 100644 --- a/Matrix_search/include/CGAL/rectangular_3_center_2.h +++ b/Matrix_search/include/CGAL/rectangular_3_center_2.h @@ -1136,7 +1136,8 @@ rectangular_3_center_2_type2( // now s_b corresponds to the first moment in [s, m+1) // where q_t and q_r cover B - + CGAL_optimisation_assertion_code(bool loopcheck = false;) +CGAL_3CENTER_REPEAT_CHECK: // place q_t and q_r q_t = op.place_x_square(q_t_afap, r, op.delta()(*s_b)); q_r = op.place_y_square(q_r_afap, r, op.delta()(*s_b)); @@ -1157,7 +1158,15 @@ rectangular_3_center_2_type2( (!Q_t_empty && op.compute_x_distance(q_t, Q_t) > op.delta()(*s_b)) || (!Q_r_empty && op.compute_y_distance(q_r, Q_r) > op.delta()(*s_b))) { // no covering - CGAL_optimisation_assertion(b1 - s >= cutoff); + if (b1 - s < cutoff) { + // in degenerate situations it can happen that the number of + // points in R is too small => decrease radius and check again + --s_b; + CGAL_optimisation_assertion(!loopcheck); + CGAL_optimisation_assertion(s != s_b); + CGAL_optimisation_assertion_code(loopcheck = true;) + goto CGAL_3CENTER_REPEAT_CHECK; + } s = b1; rho_min = op.delta()(*s_b); q_t_at_rho_min = q_t, q_r_at_rho_min = q_r; diff --git a/Mesh_2/include/CGAL/Mesh_2/Do_not_refine_edges.h b/Mesh_2/include/CGAL/Mesh_2/Do_not_refine_edges.h index 13539047dc1..3acbe7e4dfe 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Do_not_refine_edges.h +++ b/Mesh_2/include/CGAL/Mesh_2/Do_not_refine_edges.h @@ -80,7 +80,7 @@ public: const Face_handle& fh = eit->first; const int& i = eit->second; - if(fh->is_constrained(i) && !is_locally_conform(this->tr, fh, i, p)) + if(fh->is_constrained(i) && !this->is_locally_conform(this->tr, fh, i, p)) { return CONFLICT_AND_ELEMENT_SHOULD_BE_DROPPED; } diff --git a/Mesh_2/test/Mesh_2/test_meshing.cpp b/Mesh_2/test/Mesh_2/test_meshing.cpp index 588c2a874fa..b9b271cdeea 100644 --- a/Mesh_2/test/Mesh_2/test_meshing.cpp +++ b/Mesh_2/test/Mesh_2/test_meshing.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -190,6 +191,15 @@ struct Tester2 { assert( number_of_vertices4 == number_of_vertices2 ); assert( number_of_vertices4 == step + inititial_number_of_vertices ); + + std::cerr << "Test the undocumented function:" + << " refine_Delaunay_mesh_2_without_edge_refinement\n" + << "with size 0.1..."; + cdt = cdt2; + CGAL::refine_Delaunay_mesh_2_without_edge_refinement(cdt, Criteria(0.125, 0.1)); + std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() + << "\n"; + assert(cdt.number_of_vertices() == 36); } }; diff --git a/Mesh_3/demo/Mesh_3/Polyhedron_type_fwd.h b/Mesh_3/demo/Mesh_3/Polyhedron_type_fwd.h index 61dd6b9361d..5b84ee5fb0d 100644 --- a/Mesh_3/demo/Mesh_3/Polyhedron_type_fwd.h +++ b/Mesh_3/demo/Mesh_3/Polyhedron_type_fwd.h @@ -17,18 +17,12 @@ namespace CGAL { class Polyhedron_items_3; -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> class HalfedgeDS_default; -#else - struct HalfedgeDS_default; -#endif template < class PolyhedronTraits_3, class PolyhedronItems_3, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class T_HDS, class Alloc > diff --git a/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex b/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex index f49366ab72f..2d3b2f8f785 100644 --- a/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex +++ b/Mesh_3/doc_tex/Mesh_3/mesh_3_user.tex @@ -350,11 +350,11 @@ A 3D mesh generation process is launched through a call class MeshCriteria> C3T3 make_mesh_3(MeshDomain_3 domain, MeshCriteria criteria, - Features features = parameters::features(domain), - Lloyd lloyd = parameters::no_lloyd(), - Odt odt = parameters::no_odt(), - Perturb perturb = parameters::perturb(), - Exude exude = parameters::exude()); }{} + parameters::internal::Features_options features = parameters::features(domain), + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude()); }{} \ccGlobalFunction{ @@ -364,10 +364,10 @@ A 3D mesh generation process is launched through a call void refine_mesh_3(C3T3& c3t3, MeshDomain_3 domain, MeshCriteria criteria, - Lloyd lloyd = parameters::no_lloyd(), - Odt odt = parameters::no_odt(), - Perturb perturb = parameters::perturb(), - Exude exude = parameters::exude()); }{} + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude()); }{} The function \ccc{make_mesh_3} generates from scratch a mesh diff --git a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex index 836aff7874a..d88a91a6168 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_polyhedron_3.tex @@ -12,7 +12,7 @@ % +------------------------------------------------------------------------+ -\begin{ccRefClass}{Mesh_polyhedron_3} %% add template arg's if necessary +\begin{ccRefClass}{Mesh_polyhedron_3} %% add template arg's if necessary %% \ccHtmlCrossLink{} %% add further rules for cross referencing links %% \ccHtmlIndexC[class]{} %% add further index entries @@ -28,16 +28,18 @@ detection algorithm. \ccParameters -Template parameter \ccc{Gt} stands for the geometric traits associated -to the meshing process. It should be a model of concept \ccc{PolyhedronTraits_3}. +Template parameter \ccc{IGT} stands for the geometric traits associated +to the meshing process. It should be a model of the two concepts +\ccc{PolyhedronTraits_3} and \ccc{IntersectionGeometricTraits_3}. \ccTypes -\ccNestedType{type}{\ccc{CGAL::Polyhedron_3} type with customized \ccc{PolyhedronItems_3} +\ccNestedType{type}{\ccc{CGAL::Polyhedron_3} type with customized \ccc{PolyhedronItems_3} designed to handle sharp feature detection.} \ccSeeAlso +\ccRefIdfierPage{CGAL::Polyhedron_3} \ccRefIdfierPage{CGAL::Polyhedral_mesh_domain_with_features_3} \end{ccRefClass} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex index 3c7ccb9f9cf..ff07014507c 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/Polyhedral_mesh_domain_with_features_3.tex @@ -53,7 +53,7 @@ instantiated with a model of the concept \ccc{IntersectionGeometricTraits_3}. \ccConstructor{template Polyhedral_mesh_domain_with_features_3(const Polyhedron& p);}{ Constructs a \ccc{Polyhedral_mesh_domain_with_features_3} from a \ccc{Polyhedron}. -The only requirement on type \ccc{Polyhedron} is that \ccc{CGAL::Polyhedron_3} should +The only requirement on type \ccc{Polyhedron} is that \ccc{CGAL::Mesh_polyhedron_3::type} should be constructible from \ccc{Polyhedron}. No feature detection is done at this level. Note that a copy of \ccc{p} will be done.} @@ -73,7 +73,7 @@ those triangles is a feature edge.} \ccRefConceptPage{MeshDomainWithFeatures_3} \\ \ccRefIdfierPage{CGAL::Mesh_domain_with_polyline_features_3} \\ \ccRefIdfierPage{CGAL::Polyhedral_mesh_domain_3} \\ -\ccRefConceptPage{Mesh_polyhedron_3} +\ccRefIdfierPage{CGAL::Mesh_polyhedron_3} \end{ccRefClass} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/intro.tex b/Mesh_3/doc_tex/Mesh_3_ref/intro.tex index dd1b5e63f7f..62b6ec7868c 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/intro.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/intro.tex @@ -51,7 +51,7 @@ and their associated classes: \ccRefIdfierPage{CGAL::Polyhedral_mesh_domain_with_features_3} \\ \ccRefIdfierPage{CGAL::Labeled_image_mesh_domain_3} \\ \ccRefIdfierPage{CGAL::Mesh_domain_with_polyline_features_3} \\ -\ccRefIdfierPage{CGAL::Mesh_polyhedron_3} \\ +\ccRefIdfierPage{CGAL::Mesh_polyhedron_3} \\ \ccRefIdfierPage{CGAL::Triangle_accessor_3,K>} \\ diff --git a/Mesh_3/doc_tex/Mesh_3_ref/make_mesh_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/make_mesh_3.tex index 17c65cccdf7..23357a47771 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/make_mesh_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/make_mesh_3.tex @@ -58,11 +58,11 @@ traverse the resulting mesh data structure or can be written to a file class MeshCriteria> C3T3 make_mesh_3(MeshDomain_3 domain, MeshCriteria criteria, - Features features = parameters::features(domain), - Lloyd lloyd = parameters::no_lloyd(), - Odt odt = parameters::no_odt(), - Perturb perturb = parameters::perturb(), - Exude exude = parameters::exude()); }{} + parameters::internal::Features_options features = parameters::features(domain), + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude()); }{} \ccParameters diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_exude.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_exude.tex index 1cc2730e770..c05aaac36bb 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_exude.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_exude.tex @@ -27,7 +27,7 @@ to the optimization function \ccc{exude_mesh_3} through these mesh generation fu \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Exude parameters::exude( +\ccGlobalFunction{parameters::internal::Exude_options parameters::exude( double parameters::time_limit = 0, double parameters::sliver_bound = 0);} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_lloyd.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_lloyd.tex index fef92a45909..20a3eccfd3c 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_lloyd.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_lloyd.tex @@ -27,7 +27,7 @@ parameters to the optimization function \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Lloyd parameters::lloyd( +\ccGlobalFunction{parameters::internal::Lloyd_options parameters::lloyd( double parameters::time_limit = 0, std::size_t parameters::max_iteration_number = 0, double parameters::convergence = 0.02, diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_exude.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_exude.tex index c559057f187..9c108df5aff 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_exude.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_exude.tex @@ -24,7 +24,7 @@ The function \ccRefName\ allows the user to tell the mesh generation functions \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Exude parameters::no_exude();} +\ccGlobalFunction{parameters::internal::Exude_options parameters::no_exude();} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_lloyd.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_lloyd.tex index 22ab2b803be..90f29774b61 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_lloyd.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_lloyd.tex @@ -24,7 +24,7 @@ The function \ccRefName\ allows the user to tell the mesh generation functions \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Lloyd parameters::no_lloyd();} +\ccGlobalFunction{parameters::internal::Lloyd_options parameters::no_lloyd();} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_odt.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_odt.tex index 6a8fe3dbde7..581a4231495 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_odt.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_odt.tex @@ -24,7 +24,7 @@ The function \ccRefName\ allows the user to tell the mesh generation functions \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Odt parameters::no_odt();} +\ccGlobalFunction{parameters::internal::Odt_options parameters::no_odt();} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_perturb.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_perturb.tex index 4774e2a43b2..008e2e632a6 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_perturb.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_no_perturb.tex @@ -24,7 +24,7 @@ The function \ccRefName\ allows the user to tell mesh generation global function \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Perturb parameters::no_perturb();} +\ccGlobalFunction{parameters::internal::Perturb_options parameters::no_perturb();} \ccParameters diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_odt.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_odt.tex index 99f735fb5f6..6babc8251c5 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_odt.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_odt.tex @@ -27,7 +27,7 @@ allows the user to pass parameters to the optimization function \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Odt parameters::odt( +\ccGlobalFunction{parameters::internal::Odt_options parameters::odt( double parameters::time_limit = 0, std::size_t parameters::max_iteration_number = 0, double parameters::convergence = 0.02, diff --git a/Mesh_3/doc_tex/Mesh_3_ref/parameters_perturb.tex b/Mesh_3/doc_tex/Mesh_3_ref/parameters_perturb.tex index 569236d4e96..559a2d83a95 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/parameters_perturb.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/parameters_perturb.tex @@ -26,7 +26,7 @@ to the optimization function \ccc{perturb_mesh_3} through these mesh generation \ccInclude{CGAL/refine_mesh_3.h} -\ccGlobalFunction{parameters::internal::Perturb parameters::perturb( +\ccGlobalFunction{parameters::internal::Perturb_options parameters::perturb( double parameters::time_limit = 0, double parameters::sliver_bound = 0);} diff --git a/Mesh_3/doc_tex/Mesh_3_ref/refine_mesh_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/refine_mesh_3.tex index d6403a485a3..cbccda88012 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/refine_mesh_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/refine_mesh_3.tex @@ -51,10 +51,10 @@ is further refined afterward. void refine_mesh_3(C3T3& c3t3, MeshDomain_3 mesh_domain, MeshCriteria mesh_criteria, - Lloyd lloyd = parameters::no_lloyd(), - Odt odt = parameters::no_odt(), - Perturb perturb = parameters::perturb(), - Exude exude = parameters::exude()); }{} + parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(), + parameters::internal::Odt_options odt = parameters::no_odt(), + parameters::internal::Perturb_options perturb = parameters::perturb(), + parameters::internal::Exude_options exude = parameters::exude()); }{} 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 0cb45915c6b..9592d6ff773 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -172,7 +172,7 @@ public: /// Job to do after insertion void after_insertion_impl(const Vertex_handle& v) - { restore_restricted_Delaunay(v); } + { restore_restricted_Delaunay(v); } /// Insert p into triangulation Vertex_handle insert_impl(const Point& p, const Zone& zone); diff --git a/Mesh_3/include/CGAL/Triangle_accessor_3.h b/Mesh_3/include/CGAL/Triangle_accessor_3.h index ae1faf5424e..f4ee9f91cf2 100644 --- a/Mesh_3/include/CGAL/Triangle_accessor_3.h +++ b/Mesh_3/include/CGAL/Triangle_accessor_3.h @@ -38,9 +38,7 @@ class Triangle_accessor_3 { template < class K,class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class T_HDS, class Alloc> class Triangle_accessor_3, K > diff --git a/Min_sphere_of_spheres_d/doc_tex/Bounding_volumes_ref/Min_sphere_of_points_d_traits_2.tex b/Min_sphere_of_spheres_d/doc_tex/Bounding_volumes_ref/Min_sphere_of_points_d_traits_2.tex index 6999a47389d..a3cec06a05a 100644 --- a/Min_sphere_of_spheres_d/doc_tex/Bounding_volumes_ref/Min_sphere_of_points_d_traits_2.tex +++ b/Min_sphere_of_spheres_d/doc_tex/Bounding_volumes_ref/Min_sphere_of_points_d_traits_2.tex @@ -1,5 +1,5 @@ -\begin{ccRefClass}{Min_sphere_of_spheres_d_traits_2} +\begin{ccRefClass}{Min_sphere_of_points_d_traits_2} % ----------------------------------------------------------------------------- \ccDefinition diff --git a/Nef_2/doc_tex/Nef_2_ref/ExtendedKernelTraits_2.tex b/Nef_2/doc_tex/Nef_2_ref/ExtendedKernelTraits_2.tex index 9ccf3c2b0d6..29758f13a42 100644 --- a/Nef_2/doc_tex/Nef_2_ref/ExtendedKernelTraits_2.tex +++ b/Nef_2/doc_tex/Nef_2_ref/ExtendedKernelTraits_2.tex @@ -10,7 +10,7 @@ geometry\footnote{It is called extended geometry for simplicity, though it is not a real geometry in the classical sense.}. Let \ccc{K} be an instance of the data type \ccc{ExtendedKernelTraits_2}. The -central notion of extended geomtry are extended points. An extended +central notion of extended geometry are extended points. An extended point represents either a standard affine point of the Cartesian plane or a non-standard point representing the equivalence class of rays where two rays are equivalent if one is contained in the other. diff --git a/Nef_2/include/CGAL/Extended_homogeneous.h b/Nef_2/include/CGAL/Extended_homogeneous.h index dfdefd175d3..f3ba74f655d 100644 --- a/Nef_2/include/CGAL/Extended_homogeneous.h +++ b/Nef_2/include/CGAL/Extended_homogeneous.h @@ -56,7 +56,7 @@ class Extended_homogeneous : public geometry\footnote{It is called extended geometry for simplicity, though it is not a real geometry in the classical sense.}. Let |\Mvar| be an instance of the data type |\Mname|. The central notion of -extended geomtry are extended points. An extended point represents +extended geometry are extended points. An extended point represents either a standard affine point of the Cartesian plane or a non-standard point representing the equivalence class of rays where two rays are equivalent if one is contained in the other. diff --git a/Nef_2/include/CGAL/Nef_2/HDS_items.h b/Nef_2/include/CGAL/Nef_2/HDS_items.h index 213e191b90c..ac11eea2930 100644 --- a/Nef_2/include/CGAL/Nef_2/HDS_items.h +++ b/Nef_2/include/CGAL/Nef_2/HDS_items.h @@ -26,6 +26,9 @@ #include #include #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -61,7 +64,11 @@ public: typedef typename Refs::Face_const_handle Face_const_handle; typedef typename Refs::Halfedge Halfedge; typedef typename Refs::Face Face; - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Traits::Point Point; // geometric embedding typedef typename Traits::Mark Mark; // information @@ -76,12 +83,20 @@ private: GenPtr _i; public: - Nef_vertex_2() : _h(),_f(),_ivit(),_m(0),_i((GenPtr)0xABCD) {} + Nef_vertex_2() : _h(),_f(),_ivit(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} // constructs an uninitialized vertex concerning embedding // and mark. All links are initialized by their default value. Nef_vertex_2( const Point& p) : - _h(),_f(),_p(p),_ivit(),_m(0),_i((GenPtr)0xABCD) {} + _h(),_f(),_p(p),_ivit(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} // constructs a vertex with embedding |p| and mark |m|. // All links are initialized by their default value. @@ -138,7 +153,11 @@ public: typedef typename Refs::Face_const_handle Face_const_handle; typedef typename Refs::Vertex Vertex; typedef typename Refs::Face Face; - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename std::list::iterator fc_iterator; @@ -154,7 +173,11 @@ protected: public: Nef_halfedge_2() : - opp(),prv(),nxt(),_v(),_f(),_fcit(),_m(0),_i((GenPtr)0xABCD) {} + opp(),prv(),nxt(),_v(),_f(),_fcit(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} /*{\Mcreate constructs an uninitialized halfedge concerning embedding and mark. All links are initialized by their default value.}*/ @@ -227,7 +250,11 @@ public: typedef typename Refs::Face_const_handle Face_const_handle; typedef typename Refs::Vertex Vertex; typedef typename Refs::Halfedge Halfedge; - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Traits::Mark Mark; // mark information @@ -300,7 +327,11 @@ private: GenPtr _i; public: - Nef_face_2() : _e(),_m(0),_i((GenPtr)0xABCD) {} + Nef_face_2() : _e(),_m(0) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + ,_i((GenPtr)0xABCD) + #endif + {} /*{\Mcreate constructs an uninitialized face with undefined mark, empty face cycle list, and empty isolated vertices list.}*/ diff --git a/Nef_2/include/CGAL/Nef_2/PM_checker.h b/Nef_2/include/CGAL/Nef_2/PM_checker.h index a22caee7723..339baf0d0ad 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_checker.h +++ b/Nef_2/include/CGAL/Nef_2/PM_checker.h @@ -174,9 +174,9 @@ check_forward_prefix_condition(Vertex_const_handle v) const error_status << " el_forward = " << el_forward; error_status << " is_left_turn = " << is_left_turn; CGAL_assertion_msg( (ef == el || - ef_forward && !el_forward || - ef_forward && el_forward && is_left_turn || - !ef_forward && !el_forward && is_left_turn) , + (ef_forward && !el_forward) || + (ef_forward && el_forward && is_left_turn) || + (!ef_forward && !el_forward && is_left_turn)) , error_status.str().c_str()); } diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index e0f6245e4d8..946f3313e3e 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -32,6 +32,10 @@ #define CGAL_NEF_DEBUG 7 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template @@ -132,8 +136,13 @@ typedef typename Traits::Mark Mark; /*{\Mtypemember All objects (vertices, edges, faces) are attributed by a |Mark| object.}*/ typedef size_t Size_type; +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO /*{\Mtypemember The size type.}*/ typedef void* GenPtr; +#else +typedef boost::any GenPtr; +#endif + typedef typename HDS::Vertex Vertex; @@ -403,7 +412,11 @@ std::string PE(HH e) { std::ostringstream os; if (e==HH()) return "nil"; os << "[" << PV(e->opposite()->vertex()) << "," - << PV(e->vertex()) << " " << e->info() << "]"; + << PV(e->vertex()) << " " + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + << e->info() + #endif + << "]"; return os.str(); } diff --git a/Nef_2/include/CGAL/Nef_2/PM_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_decorator.h index d4b0df31fcb..61a791c47dd 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_decorator.h @@ -21,7 +21,11 @@ #ifndef CGAL_PM_DECORATOR_H #define CGAL_PM_DECORATOR_H #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include diff --git a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h index 3e5827408d7..9703b10b272 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_overlayer.h +++ b/Nef_2/include/CGAL/Nef_2/PM_overlayer.h @@ -25,7 +25,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 13 #include @@ -49,7 +53,11 @@ struct PMO_from_segs { Vertex_handle new_vertex(const Point& p) { Vertex_handle v = G.new_vertex(p); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(G.info(v)); + #else + G.info(v)=Halfedge_handle(); + #endif return v; } @@ -78,15 +86,32 @@ struct PMO_from_segs { { D.ending_segment(v,it); } void halfedge_below(Vertex_handle v, Halfedge_handle e) const - { geninfo::access(G.info(v)) = e; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(G.info(v)) = e; + #else + *boost::any_cast(&G.info(v)) = e; + #endif + } Halfedge_handle halfedge_below(Vertex_handle v) const - { return geninfo::access(G.info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(G.info(v)); + #else + return + boost::any_cast(G.info(v)); + #endif + } void clear_temporary_vertex_info() const { Vertex_handle v; for(v = G.vertices_begin(); v!= G.vertices_end(); ++v) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); + #else + G.info(v)=boost::any(); + #endif } @@ -634,13 +659,32 @@ struct vertex_info { }; void assoc_info(Vertex_handle v) const -{ geninfo::create(info(v)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(v)); + #else + info(v)=vertex_info(); + #endif +} void discard_info(Vertex_handle v) const -{ geninfo::clear(info(v)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(v)); + #else + info(v)=boost::any(); + #endif +} vertex_info& ginfo(Vertex_handle v) const -{ return geninfo::access(info(v)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(v)); + #else + return + *boost::any_cast(&info(v)); + #endif +} Mark& mark(Vertex_handle v, int i) const { return ginfo(v).m[i]; } @@ -667,15 +711,36 @@ struct halfedge_info { }; void assoc_info(Halfedge_handle e) const -{ geninfo::create(info(e)); - geninfo::create(info(twin(e))); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(e)); + geninfo::create(info(twin(e))); + #else + info(e)=halfedge_info(); + info(twin(e))=halfedge_info(); + #endif +} void discard_info(Halfedge_handle e) const -{ geninfo::clear(info(e)); - geninfo::clear(info(twin(e))); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(e)); + geninfo::clear(info(twin(e))); + #else + info(e)=boost::any(); + info(twin(e))=boost::any(); + #endif +} halfedge_info& ginfo(Halfedge_handle e) const -{ return geninfo::access(info(e)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif +} Mark& mark(Halfedge_handle e, int i) const // uedge information we store in the smaller one @@ -702,13 +767,32 @@ struct face_info { }; void assoc_info(Face_handle f) const -{ geninfo::create(info(f)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(f)); + #else + info(f)=face_info(); + #endif +} void discard_info(Face_handle f) const -{ geninfo::clear(info(f)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(f)); + #else + info(f)=boost::any(); + #endif +} face_info& ginfo(Face_handle f) const -{ return geninfo::access(info(f)); } +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(f)); + #else + return + *boost::any_cast(&info(f)); + #endif +} Mark& mark(Face_handle f, int i) const { return ginfo(f).m[i]; } diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 2898d35fc71..e5a85a57dc8 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -29,7 +29,11 @@ #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 17 #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #ifdef CGAL_USE_LEDA #include @@ -468,27 +472,57 @@ public: void operator()(Vertex_handle vn, Vertex_const_handle vo) const { Face_const_handle f; if ( Po.is_isolated(vo) ) f = Po.face(vo); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(info(vn)); geninfo::access(info(vn)) = VF_pair(vo,f); + #else + info(vn) = VF_pair(vo,f); + #endif CGAL_NEF_TRACEN("linking to org "<::create(info(hn)); + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(hn)); geninfo::access(info(hn)) = EF_pair(ho,Po.face(ho)); + #else + info(hn) = EF_pair(ho,Po.face(ho)); + #endif CGAL_NEF_TRACEN("linking to org "<::const_access(CT.info(v)).first; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(CT.info(v)).first; + #else + return + boost::any_cast(CT.info(v)).first; + #endif + } Halfedge_const_handle input_halfedge(Halfedge_const_handle e) const - { return geninfo::const_access(CT.info(e)).first; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(CT.info(e)).first; + #else + return + boost::any_cast(CT.info(e)).first; + #endif + } Face_const_handle input_face(Halfedge_const_handle e) const - { return geninfo::const_access(CT.info(e)).second; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(CT.info(e)).second; + #else + return + boost::any_cast(CT.info(e)).second; + #endif + } Object_handle input_object(Vertex_const_handle v) const @@ -547,10 +581,19 @@ protected: { Halfedge_handle e_from = previous(e); Face_const_handle f; if ( is_closed_at_source(e) ) // source(e) was isolated before + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO f = geninfo::access(info(source(e))).second; else - f = geninfo::access(info(e_from)).second; + f = geninfo::access(info(e_from)).second; + #else + f = + boost::any_cast(info(source(e))).second; + else + f = + boost::any_cast(info(e_from)).second; + #endif mark(e) = _DP.mark(f); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(info(e)); geninfo::create(info(twin(e))); @@ -560,6 +603,10 @@ protected: geninfo::access(info(e)).second = geninfo::access(info(twin(e))).second = f; + #else + info(e)=EF_pair(Halfedge_const_handle(),f); + info(twin(e))=EF_pair(Halfedge_const_handle(),f); + #endif CGAL_NEF_TRACEN("CT_new_edge "<:: { CGAL_NEF_TRACEN("clear_static_point_locator"); Vertex_iterator vit, vend = CT.vertices_end(); for (vit = CT.vertices_begin(); vit != vend; ++vit) { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(vit)); + #else + CT.info(vit)=boost::any(); + #endif } Halfedge_iterator eit, eend = CT.halfedges_end(); for (eit = CT.halfedges_begin(); eit != eend; ++eit) { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(CT.info(eit)); + #else + CT.info(eit)=boost::any(); + #endif } CT.clear(); delete &(CT.plane_map()); diff --git a/Nef_2/include/CGAL/Nef_2/gen_point_location.h b/Nef_2/include/CGAL/Nef_2/gen_point_location.h index a9bbd396554..536ada6426c 100644 --- a/Nef_2/include/CGAL/Nef_2/gen_point_location.h +++ b/Nef_2/include/CGAL/Nef_2/gen_point_location.h @@ -33,7 +33,12 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif + #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 17 @@ -56,7 +61,11 @@ class GenericLocation { point location. It can store a node or an edge of a graph or the special value |nil| which is used to signal that no node or edge could be found. }*/ - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif public: /*{\Mtypes}*/ enum Type { NIL, NODE, EDGE }; @@ -85,7 +94,12 @@ public: if (type != NODE) CGAL_LEDA_SCOPE::error_handler(1, "Location: not convertible to node"); #endif + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO return geninfo::const_access(value); + #else + return + *boost::any_cast(&value); + #endif } /*{\Mconversion converts |\Mvar| into a node.\\ \precond |\Mvar| represents a node.}*/ @@ -96,7 +110,12 @@ public: if (type != EDGE) CGAL_LEDA_SCOPE::error_handler(1, "Location: not convertible to edge"); #endif + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO return geninfo::const_access(value); + #else + return + *boost::any_cast(&value); + #endif } /*{\Mconversion converts |\Mvar| into an edge.\\ \precond |\Mvar| represents an edge.}*/ @@ -125,20 +144,33 @@ public: void init() { type = NIL; } void init(Node n) { type = NODE; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(value); - geninfo::access(value) = n; + geninfo::access(value) = n; + #else + value=n; + #endif } void init(Edge e) { type = EDGE; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(value); - geninfo::access(value) = e; + geninfo::access(value) = e; + #else + value=e; + #endif } void clear() { switch(type) { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO case NODE: geninfo::clear(value); break; case EDGE: geninfo::clear(value); break; + #else + case NODE: value=boost::any(); break; + case EDGE: value=boost::any(); break; + #endif case NIL: break; } } @@ -148,10 +180,18 @@ public: type = L.type; switch(type) { case NODE: - geninfo::access(value) = geninfo::const_access(L.value); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(value) = geninfo::const_access(L.value); + #else + *boost_any_cast(&value) = boost::any_cast(L.value); + #endif break; case EDGE: + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::access(value) = geninfo::const_access(L.value); + #else + *boost::any_cast(&value) = boost::any_cast(L.value); + #endif break; case NIL: break; } diff --git a/Nef_2/include/CGAL/Nef_2/geninfo.h b/Nef_2/include/CGAL/Nef_2/geninfo.h index f27c85eb19e..1a26b4fe7cf 100644 --- a/Nef_2/include/CGAL/Nef_2/geninfo.h +++ b/Nef_2/include/CGAL/Nef_2/geninfo.h @@ -21,6 +21,11 @@ #ifndef CGAL_NEF_2_GENINFO_H #define CGAL_NEF_2_GENINFO_H + +//This file is deprecated and something like boost::any or boost::variant should +//be used instead +#include + #include #include diff --git a/Nef_2/noweb/Constrained_triang.lw b/Nef_2/noweb/Constrained_triang.lw index e5de0bd9712..1a4a847c0a8 100644 --- a/Nef_2/noweb/Constrained_triang.lw +++ b/Nef_2/noweb/Constrained_triang.lw @@ -970,7 +970,7 @@ triangulation algorithm. #include #include #include "Affine_geometry.h" -#undef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM + #include #include #include diff --git a/Nef_3/include/CGAL/Nef_3/Halfedge.h b/Nef_3/include/CGAL/Nef_3/Halfedge.h index b92186a7bdf..795578b10ca 100644 --- a/Nef_3/include/CGAL/Nef_3/Halfedge.h +++ b/Nef_3/include/CGAL/Nef_3/Halfedge.h @@ -34,12 +34,20 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class Halfedge_base { // == Halfedge + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vector_3 Vector_3; typedef typename Refs::Sphere_point Sphere_point; @@ -131,7 +139,11 @@ class Halfedge_base std::string debug() const { std::stringstream os; set_pretty_mode(os); - os<<"sv [ "< void initialize_hash(Handle h) {} + template void initialize_hash(Handle /*h*/) {} void initialize_hash(int i) {} void handle_support(SVertex_handle , SHalfedge_const_handle , diff --git a/Nef_3/include/CGAL/Nef_3/SFace.h b/Nef_3/include/CGAL/Nef_3/SFace.h index 2f617e185cc..f00c92682fe 100644 --- a/Nef_3/include/CGAL/Nef_3/SFace.h +++ b/Nef_3/include/CGAL/Nef_3/SFace.h @@ -33,11 +33,19 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class SFace_base { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Vertex_handle Vertex_handle; typedef typename Refs::Vertex_const_handle Vertex_const_handle; diff --git a/Nef_3/include/CGAL/Nef_3/SHalfedge.h b/Nef_3/include/CGAL/Nef_3/SHalfedge.h index 1ee884bdc3a..b5a882a4040 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfedge.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfedge.h @@ -33,11 +33,19 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class SHalfedge_base { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; @@ -199,7 +207,11 @@ class SHalfedge_base { { std::stringstream os; set_pretty_mode(os); os <<"e[ "<debug()<<", " - <source_->debug()<<" "<source_->debug() + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + <<" "< +#else +#include +#endif #include #include #include @@ -123,7 +126,12 @@ std::vector& Support; unsigned edge_number; Vertex_handle new_vertex(const Point& p) const -{ geninfo::create(p.vertex()->info()); +{ + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(p.vertex()->info()); + #else + p.vertex()->info()=unsigned(); + #endif return p.vertex(); } Halfedge_handle new_halfedge_pair_at_source(Vertex_handle v) @@ -135,7 +143,12 @@ void supporting_segment(Halfedge_handle e, I it) void halfedge_below(Vertex_handle v, Halfedge_handle e) { CGAL_NEF_TRACEN("halfedge_below point "<< v->point() <<": " << e); - geninfo::access(v->info()) = e; } + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(v->info()) = e; + #else + v->info() = e; + #endif +} // all empty, no update necessary void link_as_target_and_append(Vertex_handle, Halfedge_handle) @@ -396,7 +409,11 @@ protected: int fc = FacetCycle[e]; SHalfedge_handle e_min = MinimalEdge[fc]; SHalfedge_handle e_below = + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO Edge_of[geninfo::access(info(e_min->twin()->source()->twin()->source()))]; + #else + Edge_of[ boost::any_cast(info(e_min->twin()->source()->twin()->source())) ]; + #endif CGAL_assertion( e_below != SHalfedge_handle() ); CGAL_NEF_TRACEN(" edge below " << debug(e_below)); Halffacet_handle f = e_below->facet(); @@ -631,7 +648,11 @@ create_facet_objects(const Plane_3& plane_supporting_facet, CGAL_forall_iterators(lit,SHalfloops) { l=*lit; SHalfedge_handle e_below = - Edge_of[geninfo::access(info(l->incident_sface()->center_vertex()))]; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + Edge_of[geninfo::access(info(l->incident_sface()->center_vertex()))]; + #else + Edge_of[ boost::any_cast(info(l->incident_sface()->center_vertex())) ]; + #endif CGAL_assertion( e_below != SHalfedge_handle() ); CGAL_NEF_TRACEN("link sloop at vertex "<< l->incident_sface()->center_vertex()->point()); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h index 4d32ec743a7..f3c3c5a7806 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h @@ -25,7 +25,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #include diff --git a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h index 0bbeeae7f86..d556791b5cb 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_const_decorator.h @@ -36,6 +36,10 @@ #define CGAL_NEF_DEBUG 191 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class SM_const_decorator; @@ -116,7 +120,11 @@ public: SHalfedge_around_sface_const_circulator; public: + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif SNC_const_decorator() : sncp_(0) {} SNC_const_decorator(const SNC_structure& W) : sncp_(&W) {} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index 7cda2e5eb80..e70fcd38e6e 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -40,6 +40,10 @@ #define CGAL_NEF_DEBUG 19 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template @@ -155,7 +159,11 @@ class SNC_decorator : public SNC_const_decorator { enum {NO_SNC, WITH_SNC}; public: + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif SNC_decorator() : Base(), sncp_() {} SNC_decorator(SNC_structure& W) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h index 2b5d9beb8b7..031349c7d2c 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h @@ -39,6 +39,10 @@ #define CGAL_NEF_DEBUG 293 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template @@ -889,7 +893,11 @@ public: typedef typename Infi_box::Standard_vector Standard_vector; typedef typename Infi_box::Standard_plane Standard_plane; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif using Base::visit_shell_objects; diff --git a/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h b/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h index b55aa9769e5..0a94a198b88 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_ray_shooter.h @@ -42,6 +42,10 @@ #define CGAL_NEF_DEBUG 37 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { // ---------------------------------------------------------------------------- @@ -87,7 +91,11 @@ public: typedef typename SNC_structure::Mark Mark; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif SNC_ray_shooter() {} void initialize(SNC_structure* W) { *this = SNC_ray_shooter(*W);} diff --git a/Nef_3/include/CGAL/Nef_3/SNC_structure.h b/Nef_3/include/CGAL/Nef_3/SNC_structure.h index 4977f1f5d7e..7f767760b84 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_structure.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_structure.h @@ -1212,7 +1212,8 @@ public: sfaces_.erase(h); put_sface_node(&*h); } - + //SL: in the following function, I guess the sizeof(void*) is related to the void* info that was + //used together with geninfo to store an arbitrary type. I replaced that with any and did not changed that std::size_t bytes() { // bytes used for the SNC_structure @@ -1253,7 +1254,8 @@ public: return result; } - + //SL: in the following function, I guess the sizeof(void*) is related to the void* info that was + //used together with geninfo to store an arbitrary type. I replaced that with any and did not changed that std::size_t bytes_reduced() { // bytes used for the SNC_structure diff --git a/Nef_3/include/CGAL/Nef_3/Vertex.h b/Nef_3/include/CGAL/Nef_3/Vertex.h index 11c5c8bfd60..1e9792c009e 100644 --- a/Nef_3/include/CGAL/Nef_3/Vertex.h +++ b/Nef_3/include/CGAL/Nef_3/Vertex.h @@ -33,12 +33,20 @@ #define CGAL_NEF_DEBUG 83 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif + namespace CGAL { template class Vertex_base { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Point_3 Point_3; diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index ab1cb8d294c..7644f202392 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -556,9 +556,7 @@ protected: } template -#endif class T3, class T4 > Nef_polyhedron_3( CGAL::Polyhedron_3& P) { CGAL_NEF_TRACEN("construction from Polyhedron_3"); diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h index e7a1dae22ae..b674c70f59a 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_const_decorator.h @@ -36,6 +36,9 @@ #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 67 #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -74,7 +77,12 @@ typedef typename Map::Mark Mark; typedef size_t Size_type; /*{\Mtypemember size type.}*/ +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; +#else +typedef boost::any GenPtr; +#endif + // typedef typename Map::Constructor_const_parameter Constructor_parameter; typedef typename Map::SVertex_const_handle SVertex_const_handle; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h index b6c4a6b0939..7f418b32a75 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h @@ -35,6 +35,9 @@ #include #include #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -83,7 +86,11 @@ enum { BEFORE = -1, AFTER = 1 }; typedef typename Sphere_kernel::Aff_transformation_3 Aff_transformation_3; +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO typedef void* GenPtr; +#else +typedef boost::any GenPtr; +#endif typedef typename Map::SVertex SVertex; typedef typename Map::SVertex_handle SVertex_handle; typedef typename Map::SVertex_iterator SVertex_iterator; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_items.h b/Nef_S2/include/CGAL/Nef_S2/SM_items.h index a07bd316b0c..efd63d54c3f 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_items.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_items.h @@ -31,6 +31,9 @@ #include #include #include +#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO +#include +#endif namespace CGAL { @@ -44,7 +47,11 @@ public: template class SVertex { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_point Sphere_point; typedef typename Refs::SVertex_handle SVertex_handle; @@ -108,7 +115,11 @@ public: public: std::string debug() const { std::ostringstream os; set_pretty_mode(os); - os<<"V"< class SHalfedge { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; typedef typename Refs::SVertex_handle SVertex_handle; @@ -202,7 +217,11 @@ public: std::string debug() const { std::ostringstream os; set_pretty_mode(os); os <<"e["<debug()<<", " - <source_->debug()<<" "<source_->debug()<< + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + " "<< info_ << + #endif + "]"<<'\0'; std::string res(os.str()); return res; } @@ -211,7 +230,11 @@ public: template class SHalfloop { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Sphere_circle Sphere_circle; typedef typename Refs::SHalfloop_handle SHalfloop_handle; @@ -272,7 +295,11 @@ public: std::string debug() const { std::ostringstream os; set_pretty_mode(os); - os<<"l"< class SFace { - typedef void* GenPtr; + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + typedef void* GenPtr; + #else + typedef boost::any GenPtr; + #endif typedef typename Refs::Mark Mark; typedef typename Refs::Object_handle Object_handle; typedef typename Refs::Object_list Object_list; diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h index 881bd5b22b4..f4277148e8b 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h @@ -25,7 +25,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #include @@ -56,7 +60,11 @@ struct SMO_from_segs { Vertex_handle new_vertex(const Point& p) { Vertex_handle v = G.new_svertex(p); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::create(G.info(v)); + #else + G.info(v)=Halfedge_handle(); + #endif return v; } @@ -85,16 +93,35 @@ struct SMO_from_segs { { if ( M[it] ) v->mark() = true; } void halfedge_below(Vertex_handle v, Halfedge_handle e) const - { geninfo::access(G.info(v)) = e; } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::access(G.info(v)) = e; + #else + G.info(v)=e; + #endif + } Halfedge_handle halfedge_below(Vertex_handle v) const - { return geninfo::access(G.info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(G.info(v)); + #else + return + boost::any_cast( G.info(v) ); + #endif + } void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const { CGAL_assertion(v1->mark()==v2->mark()); } void discard_info(Vertex_handle v) const - { geninfo::clear(G.info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(G.info(v)); + #else + G.info(v)=boost::any(); + #endif + } void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const { CGAL_assertion(e1->mark()==e2->mark()); } @@ -104,7 +131,12 @@ struct SMO_from_segs { void clear_temporary_vertex_info() const { Vertex_handle v; CGAL_forall_svertices(v,G) + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO geninfo::clear(G.info(v)); + #else + G.info(v)=boost::any(); + #endif + } @@ -500,13 +532,32 @@ public: }; // vertex_info void assoc_info(SVertex_handle v) const - { geninfo::create(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(v)); + #else + info(v)=vertex_info(); + #endif + } void discard_info(SVertex_handle v) const - { geninfo::clear(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(v)); + #else + info(v)=boost::any(); + #endif + } vertex_info& ginfo(SVertex_handle v) const - { return geninfo::access(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(v)); + #else + return + *boost::any_cast(&info(v)); + #endif + } Mark& mark(SVertex_handle v, int i) const { return ginfo(v).m[i]; } @@ -532,15 +583,36 @@ public: }; void assoc_info(SHalfedge_handle e) const - { geninfo::create(info(e)); - geninfo::create(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(e)); + geninfo::create(info(e->twin())); + #else + info(e)=edge_info(); + info(e->twin())=edge_info(); + #endif + } void discard_info(SHalfedge_handle e) const - { geninfo::clear(info(e)); - geninfo::clear(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(e)); + geninfo::clear(info(e->twin())); + #else + info(e)=boost::any(); + info(e->twin())=boost::any(); + #endif + } edge_info& ginfo(SHalfedge_handle e) const - { return geninfo::access(info(e)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif + } Mark& mark(SHalfedge_handle e, int i) const { return ginfo(e).m[i]; } @@ -567,13 +639,32 @@ public: }; void assoc_info(SFace_handle f) const - { geninfo::create(info(f)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(f)); + #else + info(f)=face_info(); + #endif + } void discard_info(SFace_handle f) const - { geninfo::clear(info(f)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(f)); + #else + info(f)=boost::any(); + #endif + } face_info& ginfo(SFace_handle f) const - { return geninfo::access(info(f)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(f)); + #else + return + *boost::any_cast(&info(f)); + #endif + } Mark& mark(SFace_handle f, int i) const { return ginfo(f).m[i]; } @@ -1393,13 +1484,19 @@ subdivide(const Map* M0, const Map* M1, // DEBUG CODE: to do: have all svertices a halfedge below associated? CGAL_NEF_TRACEN("Vertex info after swep"); CGAL_assertion_code(SVertex_iterator svi); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO CGAL_assertion_code( for(svi=this->svertices_begin(); svi!=this->svertices_end(); svi++) { - CGAL_NEF_TRACEN("vertex "<point()<<" info "<point()<<" info "<< info(svi)<< " marks "<svertices_begin(); svi!=this->svertices_end(); svi++) { + CGAL_NEF_TRACEN("vertex "<point()<< " marks "<svertices_begin(),v,O); else @@ -1683,12 +1780,20 @@ subdivide(const Map* M0, const Map* M1, // DEBUG CODE: to do: have all svertices a halfedge below associated? CGAL_NEF_TRACEN("Vertex info after swep"); CGAL_assertion_code(SVertex_iterator svi); + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO CGAL_assertion_code( for(svi=this->svertices_begin(); svi!=this->svertices_end(); svi++) { - CGAL_NEF_TRACEN("vertex "<point()<<" info "<point() <<" info "<svertices_begin(); svi!=this->svertices_end(); svi++) { + CGAL_NEF_TRACEN("vertex "<point() << " marks "< #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #undef CGAL_NEF_DEBUG diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h index 65f1e280a9a..824eb5f1a3e 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h @@ -24,7 +24,11 @@ #include #include #include +#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO #include +#else +#include +#endif #include #include #include @@ -201,13 +205,32 @@ public: }; void assoc_info(SVertex_handle v) const - { geninfo::create(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(v)); + #else + info(v)=vertex_info(); + #endif + } void discard_info(SVertex_handle v) const - { geninfo::clear(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(v)); + #else + info(v)=boost::any(); + #endif + } vertex_info& ginfo(SVertex_handle v) const - { return geninfo::access(info(v)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(v)); + #else + return + *boost::any_cast(&info(v)); + #endif + } Object_handle& support(SVertex_handle v) const { return ginfo(v).o_; } @@ -224,15 +247,36 @@ public: }; void assoc_info(SHalfedge_handle e) const - { geninfo::create(info(e)); - geninfo::create(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::create(info(e)); + geninfo::create(info(e->twin())); + #else + info(e)=edge_info(); + info(e->twin())=edge_info(); + #endif + } void discard_info(SHalfedge_handle e) const - { geninfo::clear(info(e)); - geninfo::clear(info(e->twin())); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + geninfo::clear(info(e)); + geninfo::clear(info(e->twin())); + #else + info(e)=boost::any(); + info(e->twin())=boost::any(); + #endif + } edge_info& ginfo(SHalfedge_handle e) const - { return geninfo::access(info(e)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif + } Object_handle& support(SHalfedge_handle e) const // uedge information we store in the smaller one @@ -244,7 +288,14 @@ public: { return ginfo(e).m_left_; } const edge_info& ginfo(SHalfedge_const_handle e) const - { return geninfo::const_access(info(e)); } + { + #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO + return geninfo::const_access(info(e)); + #else + return + *boost::any_cast(&info(e)); + #endif + } const Mark& incident_mark(SHalfedge_const_handle e) const { return ginfo(e).m_left_; } diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex index 99d476f309a..ac2fba8676e 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfi.tex @@ -69,7 +69,7 @@ was constructed is guaranteed to be included in the constructed interval. that \([\ccc{left},\ccc{right}]\) is included in \ccVar .} \ccConstructor{template - Gmpfi(std::pair endpoints, + Gmpfi(const std::pair &endpoints, Precision_type p=get_default_precision());} {creates a \ccc{Gmpfi} initialized with endpoints \ccc{endpoints.first} and \ccc{endpoints.second}. \ccc{L} and @@ -290,13 +290,14 @@ of comparisons: \ccHeading{Input/Output} \ccFunction{std::istream& operator>>(std::istream &is,Gmpfi i);} - {Reads \ccc{i} from \ccc{is}. \ccc{is} has the form + {Reads \ccc{i} from \ccc{is}. \ccc{is} must have the form \ccc{[inf,sup]}, where \ccc{inf} and \ccc{sup} have valid - \ccc{Gmpfr} formats.} + \ccc{Gmpfr} input formats.} % TODO: add the possibility of reading a number in non-interval form \ccFunction{std::ostream& operator<<(std::ostream &os,const Gmpfi &i);} - {Writes \ccc{i} to \ccc{os}, in the form \ccc{[i.inf(),i.sup()]}.} + {Writes \ccc{i} to \ccc{os}, in the form \ccc{[i.inf(),i.sup()]}. + The endpoints are written according to the \ccc{Gmpfr} formatting.} \ccImplementation diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex index a1fa9cca5ad..3b9b396b0a4 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Gmpfr.tex @@ -73,7 +73,7 @@ This type is \ccc{ImplicitInteroperable} with \ccc{Gmpz}, \verb-long-, \ccConstructor{Gmpfr(const Gmpzf &zf);} {Creates a \ccc{Gmpfr}, initialized with the value of \ccc{zf}.} -\ccConstructor{Gmpfr(std::pair ie);} +\ccConstructor{Gmpfr(const std::pair &ie);} {Creates a \ccc{Gmpfr}, initialized with the value of \( ie.first \times 2^{ie.second} \) .} @@ -331,8 +331,8 @@ the compared numbers is \ccc{NaN}, the \ccc{erange} flag is set. \ccMethod{bool is_square(const Gmpfr &y);} {Returns \ccc{true} iff \ccVar~is the square of a number - representable by an object of this type, calculating it and storing - it in \ccc{y}.} + representable by an object of this type, computing and storing it + in \ccc{y}.} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -347,9 +347,10 @@ the compared numbers is \ccc{NaN}, the \ccc{erange} flag is set. \(M\) and the exponent \(E\) are integers in base 10.} \ccFunction{std::ostream& operator<<(std::ostream& out, const Gmpfr& f);} - {Writes \ccc{f} to the ostream \ccc{out}, in the form - \(MeE\), where \(M\) is its mantissa and \(E\) is its exponent, - both in base 10.} + {If the ostream \ccc{out} is in pretty-print mode, writes a decimal + approximation of \ccc{f} to \ccc{out}. Otherwise, writes \ccc{f} to + \ccc{out} in the form \(MeE\), where \(M\) is its mantissa and + \(E\) is its exponent, both in base 10.} \ccImplementation diff --git a/Number_types/doc_tex/NumberTypeSupport_ref/Protect_FPU_rounding.tex b/Number_types/doc_tex/NumberTypeSupport_ref/Protect_FPU_rounding.tex index 1f108f50a8b..7f784114ab6 100644 --- a/Number_types/doc_tex/NumberTypeSupport_ref/Protect_FPU_rounding.tex +++ b/Number_types/doc_tex/NumberTypeSupport_ref/Protect_FPU_rounding.tex @@ -37,7 +37,7 @@ The related class \ccc{Set_ieee_double_precision} allows to similarly protect a block of code from excess precision on some machines (x86 typically with the traditional FPU, not the more recent SSE2). Note that \ccc{Protect_FPU_rounding_mode}, when changing rounding modes, also sets the precision -to the correct 46 bit precision, hence providing a similar effect to +to the correct 64 bit precision, hence providing a similar effect to \ccc{Set_ieee_double_precision}. This notably affects the \ccc{Residue} class. Note for Visual C++ 64-bit users: due to a compiler bug, the stack unwinding diff --git a/Number_types/include/CGAL/CORE_BigFloat.h b/Number_types/include/CGAL/CORE_BigFloat.h index 06c3378f184..75133a78c01 100644 --- a/Number_types/include/CGAL/CORE_BigFloat.h +++ b/Number_types/include/CGAL/CORE_BigFloat.h @@ -264,8 +264,6 @@ round(const CORE::BigFloat& x, long rel_prec = CORE::defRelPrec.toLong() ){ // typedef CORE::BigFloat BF; // else typedef CORE::BigFloat BF; - typedef CORE::BigFloat BFI; - typedef CORE::BigInt Integer; BF xr; CORE::BigInt m = x.m(); diff --git a/Number_types/include/CGAL/CORE_BigInt.h b/Number_types/include/CGAL/CORE_BigInt.h index 4b3b7f239f8..eeab635c1f2 100644 --- a/Number_types/include/CGAL/CORE_BigInt.h +++ b/Number_types/include/CGAL/CORE_BigInt.h @@ -22,7 +22,10 @@ #ifndef CGAL_CORE_BIGINT_H #define CGAL_CORE_BIGINT_H +#include #include +#include +#include #include #include diff --git a/Number_types/include/CGAL/CORE_BigRat.h b/Number_types/include/CGAL/CORE_BigRat.h index 7cae269ff5d..ec07ef5e75a 100644 --- a/Number_types/include/CGAL/CORE_BigRat.h +++ b/Number_types/include/CGAL/CORE_BigRat.h @@ -22,7 +22,9 @@ #ifndef CGAL_CORE_BIGRAT_H #define CGAL_CORE_BIGRAT_H +#include #include +#include #include #include // used for To_interval-functor diff --git a/Number_types/include/CGAL/GMP/Gmpfi_type.h b/Number_types/include/CGAL/GMP/Gmpfi_type.h index 5c63330ff21..2f01245f6b1 100644 --- a/Number_types/include/CGAL/GMP/Gmpfi_type.h +++ b/Number_types/include/CGAL/GMP/Gmpfi_type.h @@ -242,7 +242,7 @@ CGAL_GMPFI_CONSTRUCTOR_FROM_SCALAR(Gmpz); CGAL_assertion(_right>=l||(_right.is_nan()&&r.is_nan())); } - Gmpfi(std::pair bounds, + Gmpfi(const std::pair &bounds, Gmpfi::Precision_type p=Gmpfi::get_default_precision()){ CGAL_assertion(p>=MPFR_PREC_MIN&&p<=MPFR_PREC_MAX); _left=Gmpfr(bounds.first,std::round_toward_neg_infinity,p); @@ -254,7 +254,7 @@ CGAL_GMPFI_CONSTRUCTOR_FROM_SCALAR(Gmpz); } template - Gmpfi(std::pair bounds, + Gmpfi(const std::pair &bounds, Gmpfi::Precision_type p=get_default_precision()){ CGAL_assertion(p>=MPFR_PREC_MIN&&p<=MPFR_PREC_MAX); _left=Gmpfr(bounds.first,std::round_toward_neg_infinity,p); @@ -797,7 +797,7 @@ std::pair Gmpfi::to_interval()const{ inline std::pair Gmpfi::to_double_exp()const{ mpfr_t middle; - long *e; + long *e=NULL; mpfr_init2(middle,53); mpfi_get_fr(middle,mpfi()); double d=mpfr_get_d_2exp(e,middle,mpfr_get_default_rounding_mode()); @@ -807,7 +807,7 @@ std::pair Gmpfi::to_double_exp()const{ inline std::pair,long> Gmpfi::to_interval_exp()const{ - long *e1,*e2; + long *e1=NULL,*e2=NULL; double d_low=mpfr_get_d_2exp(e1,left_mpfr(),GMP_RNDD); double d_upp=mpfr_get_d_2exp(e2,right_mpfr(),GMP_RNDU); if(e1>(std::istream& is,Gmpfi &f){ c=is.get(); if(c!=']') goto invalid_number; - Gmpfr::Precision_type p=left.get_precision()>right.get_precision()? - left.get_precision(): - right.get_precision(); - f=Gmpfi(std::make_pair(left,right),(Gmpfi::Precision_type)p); + // Why is this done the following way? Because left and right can + // have different precision. Doing this with a constructor would + // force to create a Gmpfi where both endpoints have the same + // precision, what can give a wrong reconstruction of a previously + // outputted number. (This function will give a good reconstruction + // iff Gmpfr gives a good reconstruction.) + Gmpfi temp(0,(Gmpfi::Precision_type)MPFR_PREC_MIN); + mpfr_swap(left.fr(), temp.inf().fr()); + mpfr_swap(right.fr(),temp.sup().fr()); + f=temp; return is; } diff --git a/Number_types/include/CGAL/GMP/Gmpfr_type.h b/Number_types/include/CGAL/GMP/Gmpfr_type.h index d61b3851109..a1449d20fc9 100644 --- a/Number_types/include/CGAL/GMP/Gmpfr_type.h +++ b/Number_types/include/CGAL/GMP/Gmpfr_type.h @@ -255,7 +255,7 @@ class Gmpfr: } } - Gmpfr(Gmpzf f, + Gmpfr(const Gmpzf &f, std::float_round_style r, Gmpfr::Precision_type p=Gmpfr::get_default_precision()){ CGAL_assertion(p>=MPFR_PREC_MIN&&p<=MPFR_PREC_MAX); @@ -264,7 +264,7 @@ class Gmpfr: mpfr_mul_2si(fr(),fr(),f.exp(),_gmp_rnd(r)); } - Gmpfr(Gmpzf f,Gmpfr::Precision_type p){ + Gmpfr(const Gmpzf &f,Gmpfr::Precision_type p){ CGAL_assertion(p>=MPFR_PREC_MIN&&p<=MPFR_PREC_MAX); mpfr_init2(fr(),p); mpfr_set_z(fr(),f.man(),mpfr_get_default_rounding_mode()); @@ -274,7 +274,7 @@ class Gmpfr: mpfr_get_default_rounding_mode()); } - Gmpfr(Gmpzf f){ + Gmpfr(const Gmpzf &f){ mpfr_init2(fr(), static_cast( mpz_sizeinbase(f.man(),2) intexp, + Gmpfr(const std::pair &intexp, std::float_round_style r=Gmpfr::get_default_rndmode(), Gmpfr::Precision_type p=Gmpfr::get_default_precision()){ CGAL_assertion(p>=MPFR_PREC_MIN&&p<=MPFR_PREC_MAX); @@ -297,7 +297,7 @@ class Gmpfr: mpfr_mul_2si(fr(),fr(),intexp.second,_gmp_rnd(r)); } - Gmpfr(std::pair intexp,Gmpfr::Precision_type p){ + Gmpfr(const std::pair &intexp,Gmpfr::Precision_type p){ CGAL_assertion(p>=MPFR_PREC_MIN&&p<=MPFR_PREC_MAX); mpfr_init2(fr(),p); mpfr_set_z(fr(), @@ -1155,9 +1155,49 @@ std::ostream& operator<<(std::ostream& os,const Gmpfr &a){ return os<<"nan"; if(a.is_inf()) return os<<(a<0?"-inf":"+inf"); - std::pair ie=a.to_integer_exp(); - os< ie=a.to_integer_exp(); + os << ie.first << 'e' << ie.second; + return os; + } else { + // human-readable format + mpfr_exp_t expptr; + char *str = mpfr_get_str(NULL, &expptr, 10, 0, a.fr(), + mpfr_get_default_rounding_mode()); + if (str == NULL) return os << "@err@"; + std::string s(str); + mpfr_free_str(str); + int i = 0; + size_t n = s.length(); + size_t k = 0; + while (k < n && s[n-k-1] == '0') k++; // count trailing zeros + if (k == n) return os << "0"; + else if (k) { + s.erase(n-k, k); // remove trailing zeros + n = s.length(); + } + bool exp = false; + if(s[0] == '-') { os << "-"; i++; n--; } // sign + if (expptr < -5) { // .125e-99 + s.insert(i, 1, '.'); exp = true; + } else if (expptr < 0) { + s.insert(i, -expptr, '0'); // .00000125 -- .0125 + s.insert(i, 1, '.'); + // The following cast of expptr is done for avoiding some + // compiler warnings. The cast is exact, because we know + // expptr is not negative here. + } else if ((size_t)expptr < n) { // .125 -- 12.5 + s.insert(i+expptr, 1, '.'); + } else if (expptr - n <= 5) { // 125 -- 12500000 + s.append(expptr - n, '0'); + } else { // .125e99 + s.insert(i, 1, '.'); exp = true; + } + os << s.substr(i); + if (exp) os << "e" << expptr; + return os; + } } // comparisons diff --git a/Number_types/include/CGAL/int.h b/Number_types/include/CGAL/int.h index 0c5b9703a11..8eef6095fb0 100644 --- a/Number_types/include/CGAL/int.h +++ b/Number_types/include/CGAL/int.h @@ -251,6 +251,16 @@ template<> class Algebraic_structure_traits< short int > template <> class Real_embeddable_traits< short int > : public INTERN_RET::Real_embeddable_traits_base< short int , CGAL::Tag_true > {}; +// unsigned int + +template <> class Real_embeddable_traits< unsigned int > + : public INTERN_RET::Real_embeddable_traits_base< unsigned int , CGAL::Tag_true > {}; + +// unsigned long + +template <> class Real_embeddable_traits< unsigned long > + : public INTERN_RET::Real_embeddable_traits_base< unsigned long , CGAL::Tag_true > {}; + // Note : "long long" support is in } //namespace CGAL diff --git a/Number_types/include/CGAL/long_long.h b/Number_types/include/CGAL/long_long.h index 2ce7b6996d2..d4895709293 100644 --- a/Number_types/include/CGAL/long_long.h +++ b/Number_types/include/CGAL/long_long.h @@ -78,6 +78,10 @@ template <> class Real_embeddable_traits< long long int > }; }; +// unsigned long long +template <> class Real_embeddable_traits< unsigned long long > + : public INTERN_RET::Real_embeddable_traits_base< unsigned long long , CGAL::Tag_true > {}; + } //namespace CGAL #include diff --git a/Number_types/test/Number_types/CMakeLists.txt b/Number_types/test/Number_types/CMakeLists.txt index 12972b28992..cc2b98de89f 100644 --- a/Number_types/test/Number_types/CMakeLists.txt +++ b/Number_types/test/Number_types/CMakeLists.txt @@ -73,6 +73,7 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "_test_valid_finite_double.cpp" ) create_single_source_cgal_program( "_test_valid_finite_float.cpp" ) create_single_source_cgal_program( "to_interval_test.cpp" ) + create_single_source_cgal_program( "unsigned.cpp" ) create_single_source_cgal_program( "utilities.cpp" ) if( MPFI_FOUND ) include( ${MPFI_USE_FILE} ) diff --git a/Number_types/test/Number_types/Gmpfr.cpp b/Number_types/test/Number_types/Gmpfr.cpp index 0412939457f..e1c1b5d0f96 100644 --- a/Number_types/test/Number_types/Gmpfr.cpp +++ b/Number_types/test/Number_types/Gmpfr.cpp @@ -116,15 +116,26 @@ int test_to_integer_exp(CGAL::Gmpfr f){ } } +// This function checks equality between an _NT x and a Gmpfr y. template -int test_constructors(_NT x){ +int are_different(const _NT &x,const CGAL::Gmpfr &y){ + return x!=y; +} + +template<> +int are_different(const std::pair &x,const CGAL::Gmpfr &y){ + return(mpfr_cmp_si_2exp(y.fr(),mpz_get_si(x.first.mpz()),x.second)); +} + +template +int test_constructors(const _NT &x){ typedef CGAL::Gmpfr Gmpfr; typedef _NT NT; bool fail=false; Gmpfr::set_default_precision(70); Gmpfr f(x); // this conversion should be exact - if(f!=x){ + if(are_different(x,f)){ std::cerr<<"failed default construction! (inexact)"<((CGAL::Gmpz(1)<<1000)+CGAL::Gmpz(1));) _TEST("constructors Gmpzf",test_constructors(1025);) + typedef std::pair MantExp; + _TEST("constructors pair", + test_constructors(std::make_pair(CGAL::Gmpz(4096),35));) _TEST("operators Gmpfr",test_operators();) _TEST("operators Gmpzf",test_operators();) diff --git a/Number_types/test/Number_types/Root_of_traits.cpp b/Number_types/test/Number_types/Root_of_traits.cpp index 86d1ef54716..a9cb2f5c2a2 100644 --- a/Number_types/test/Number_types/Root_of_traits.cpp +++ b/Number_types/test/Number_types/Root_of_traits.cpp @@ -46,6 +46,7 @@ void test_root_of_traits_for_set(Integer, Rational, FWS){ } int main(){ + std::cout << "Testing with double" << std::endl; CGAL::Test::test_root_of_traits< double , double , double >(); try{// just compile and try to get as far as you can go. @@ -56,6 +57,7 @@ int main(){ #ifdef CGAL_HAS_GMP_ARITHMETIC_KERNEL //TODO: switch to Gmpq { + std::cout << "Testing with GMP" << std::endl; typedef CGAL::GMP_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; @@ -65,6 +67,7 @@ int main(){ #endif #ifdef CGAL_HAS_LEDA_ARITHMETIC_KERNEL { + std::cout << "Testing with LEDA" << std::endl; typedef CGAL::LEDA_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; @@ -74,6 +77,7 @@ int main(){ #endif #ifdef CGAL_HAS_CORE_ARITHMETIC_KERNEL { + std::cout << "Testing with CORE" << std::endl; typedef CGAL::CORE_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; @@ -82,6 +86,7 @@ int main(){ } #endif { + std::cout << "Testing with MP_Float" << std::endl; typedef CGAL::MP_Float_arithmetic_kernel AK; typedef AK::Integer Integer; typedef AK::Rational Rational; diff --git a/Number_types/test/Number_types/unsigned.cpp b/Number_types/test/Number_types/unsigned.cpp new file mode 100644 index 00000000000..c842f21a93c --- /dev/null +++ b/Number_types/test/Number_types/unsigned.cpp @@ -0,0 +1,30 @@ +// Copyright (c) 2012 Inria Saclay (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: Marc Glisse + +#include + +int main(){ + unsigned int a = 42; + (void)CGAL::compare(a,a); + unsigned long b = 42; + (void)CGAL::compare(b,b); +#ifdef CGAL_USE_LONG_LONG + unsigned long long c = 42; + (void)CGAL::compare(c,c); +#endif +} diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 1cccf2dd8da..0d93bc25728 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -3583,7 +3583,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3 &tr) return os; // write the vertices - std::map V; + Unique_hash_map V; std::size_t i=0; if (tr.is_1_cover()) { for (Vertex_iterator it=tr.vertices_begin(); it!=tr.vertices_end(); ++it) { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt index 520a9cc4131..73ee6bd8ee7 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt @@ -59,7 +59,7 @@ if ( CGAL_FOUND ) # Use Eigen or BLAS and LAPACK (optional) - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) find_package(LAPACK) if(LAPACK_FOUND) diff --git a/Point_set_processing_3/include/CGAL/Index_property_map.h b/Point_set_processing_3/include/CGAL/Index_property_map.h index a6a79835324..9dc31a2ed3b 100644 --- a/Point_set_processing_3/include/CGAL/Index_property_map.h +++ b/Point_set_processing_3/include/CGAL/Index_property_map.h @@ -132,7 +132,7 @@ public: Index_property_map( Iter first, ///< iterator over the first element (index 0) - Iter beyond) ///< past-the-end iterator over the elements + Iter /*beyond*/) ///< past-the-end iterator over the elements : m_first(first) { CGAL_TRACE(" Index_property_map: optimized version for a random access container\n"); diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 5ffb8761289..d4a3d8f1c9d 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -135,7 +135,7 @@ jet_estimate_normals( PointPMap point_pmap, ///< property map InputIterator -> Point_3. NormalPMap normal_pmap, ///< property map InputIterator -> Vector_3. unsigned int k, ///< number of neighbors. - const Kernel& kernel, ///< geometric traits. + const Kernel& /*kernel*/, ///< geometric traits. unsigned int degree_fitting = 2) { CGAL_TRACE("Calls jet_estimate_normals()\n"); diff --git a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h index 396238c9bc5..f470e8c1fa0 100644 --- a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h @@ -131,7 +131,7 @@ jet_smooth_point_set( InputIterator beyond, ///< past-the-end iterator over the input points. PointPMap point_pmap, ///< property map InputIterator -> Point_3. unsigned int k, ///< number of neighbors. - const Kernel& kernel, ///< geometric traits. + const Kernel& /*kernel*/, ///< geometric traits. unsigned int degree_fitting = 2, unsigned int degree_monge = 2) { diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index ed63bbd5a1a..0f13d983b80 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -208,7 +208,7 @@ mst_find_source( ForwardIterator beyond, ///< past-the-end iterator over the input points. PointPMap point_pmap, ///< property map ForwardIterator -> Point_3 NormalPMap normal_pmap, ///< property map ForwardIterator -> Vector_3 - const Kernel& kernel) ///< geometric traits. + const Kernel& /*kernel*/) ///< geometric traits. { CGAL_TRACE(" mst_find_source()\n"); @@ -271,7 +271,7 @@ create_riemannian_graph( NormalPMap normal_pmap, ///< property map ForwardIterator -> Vector_3 IndexPMap index_pmap, ///< property map ForwardIterator -> index unsigned int k, ///< number of neighbors - const Kernel& kernel) ///< geometric traits. + const Kernel& /*kernel*/) ///< geometric traits. { // Input points types typedef typename boost::property_traits::value_type Point; diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 7cbfaee66e6..31cee85f420 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -130,7 +130,7 @@ pca_estimate_normals( PointPMap point_pmap, ///< property map InputIterator -> Point_3. NormalPMap normal_pmap, ///< property map InputIterator -> Vector_3. unsigned int k, ///< number of neighbors. - const Kernel& kernel) ///< geometric traits. + const Kernel& /*kernel*/) ///< geometric traits. { CGAL_TRACE("Calls pca_estimate_normals()\n"); diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index 6dd47df408c..aacd1ceaa51 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -55,7 +55,7 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "remove_outliers_test.cpp" ) # Use Eigen or BLAS and LAPACK (optional) - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) find_package(LAPACK) if(LAPACK_FOUND) diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index 40c2dd82ecc..51de4c29aea 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -62,7 +62,7 @@ endif(QT4_FOUND) # Eigen is now used by default -find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) # Find LAPACK (optional), for curvatures estimation find_package(LAPACK) @@ -126,8 +126,10 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) qt4_automoc(Scene.cpp Scene_item.cpp Scene_plane_item.cpp + Scene_combinatorial_map_item.cpp Scene_polygon_soup_item.cpp Scene_polyhedron_item.cpp + Scene_polylines_item.cpp Scene_edit_polyhedron_item.cpp Scene_textured_polyhedron_item.cpp Scene_c2t3_item.cpp @@ -173,6 +175,14 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) Scene_polyhedron_item.cpp Scene_polyhedron_item.moc) target_link_libraries(scene_polyhedron_item demo_framework) + add_library(scene_combinatorial_map_item SHARED + Scene_combinatorial_map_item.cpp Scene_combinatorial_map_item.moc) + target_link_libraries(scene_combinatorial_map_item demo_framework scene_polyhedron_item) + + add_library(scene_polylines_item SHARED + Scene_polylines_item.cpp Scene_polylines_item.moc) + target_link_libraries(scene_polylines_item demo_framework) + add_library(scene_edit_polyhedron_item SHARED Scene_edit_polyhedron_item.cpp Scene_edit_polyhedron_item.moc) target_link_libraries(scene_edit_polyhedron_item scene_polyhedron_item demo_framework) @@ -298,6 +308,9 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) polyhedron_demo_plugin(off_plugin Polyhedron_demo_off_plugin) target_link_libraries(off_plugin scene_polyhedron_item scene_polygon_soup_item) + polyhedron_demo_plugin(polylines_io_plugin Polyhedron_demo_polylines_io_plugin) + target_link_libraries(polylines_io_plugin scene_polylines_item) + polyhedron_demo_plugin(orient_soup_plugin Polyhedron_demo_orient_soup_plugin) target_link_libraries(orient_soup_plugin scene_polygon_soup_item scene_polyhedron_item) @@ -333,6 +346,12 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) polyhedron_demo_plugin(nef_plugin Polyhedron_demo_nef_plugin) target_link_libraries(nef_plugin scene_nef_polyhedron_item) + polyhedron_demo_plugin(intersection_plugin Polyhedron_demo_intersection_plugin) + target_link_libraries(intersection_plugin scene_polyhedron_item scene_polylines_item) + + polyhedron_demo_plugin(corefinement_plugin Polyhedron_demo_corefinement_plugin) + target_link_libraries(corefinement_plugin scene_polyhedron_item scene_combinatorial_map_item scene_polylines_item) + polyhedron_demo_plugin(trivial_plugin Polyhedron_demo_trivial_plugin) if(TAUCS_FOUND OR ( EIGEN3_FOUND AND SUPERLU_FOUND ) ) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 8ce88f1d6f5..29708f5b097 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -306,7 +306,7 @@ MainWindow::MainWindow(QWidget* parent) #ifdef QT_SCRIPT_LIB void MainWindow::evaluate_script(QString script, - const QString& filename, + const QString& /*filename*/, const bool quiet) { QScriptValue value = script_engine->evaluate(script); if(script_engine->hasUncaughtException()) { diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_corefinement_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_corefinement_plugin.cpp new file mode 100644 index 00000000000..6ac59533b33 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_corefinement_plugin.cpp @@ -0,0 +1,177 @@ +#include +#include +#include +#include "Scene_polyhedron_item.h" +#include "Scene_combinatorial_map_item.h" +#include "Polyhedron_type.h" +#include "Polyhedron_demo_plugin_interface.h" +#include "Polyhedron_demo_plugin_helper.h" + +#include "Scene_polylines_item.h" + +#include +#include +#include +#include +#include +#include +#include + +//#define PRINT_EACH_VOLUME + +class Polyhedron_demo_corefinement_plugin : + public QObject, + public Polyhedron_demo_plugin_helper +{ + Q_OBJECT + Q_INTERFACES(Polyhedron_demo_plugin_interface) + +public: + + + + QList actions() const { + return QList() << actionPolyhedronCorefinement_3; + } + + void init(QMainWindow* mainWindow, Scene_interface* scene_interface) { + this->scene = scene_interface; + this->mw = mainWindow; + actionPolyhedronCorefinement_3 = new QAction("Polyhedra corefinement", mw); + if(actionPolyhedronCorefinement_3) { + connect(actionPolyhedronCorefinement_3, SIGNAL(triggered()), + this, SLOT(corefinement())); + } + } + +private: + + QAction* actionPolyhedronCorefinement_3; + +public slots: + void corefinement(); + +}; // end class Polyhedron_demo_corefinement_plugin + + +struct Is_on_polyline{ + bool operator()(Polyhedron::Halfedge_handle he) const { + return he->is_feature_edge(); + } +}; + +struct Set_vertex_corner{ + template + void add_info_to_node(int, Polyhedron*,const Info&) { + } + + void operator()(Polyhedron::Vertex_handle v, int, Polyhedron*) { + ++v->nb_of_feature_edges; + } +}; + +void Polyhedron_demo_corefinement_plugin::corefinement() +{ + int indexA = scene->selectionAindex(); + int indexB = scene->selectionBindex(); + + Scene_polyhedron_item* itemA = + qobject_cast(scene->item(indexA)); + Scene_polyhedron_item* itemB = + qobject_cast(scene->item(indexB)); + if(!itemA || !itemB || itemA == itemB) + { + Q_FOREACH(int index, scene->selectionIndices()) { + Scene_polyhedron_item* item = + qobject_cast(scene->item(index)); + if(!item) + return; + } + if(scene->selectionIndices().size() == 2) { + indexA = scene->selectionIndices()[0]; + indexB = scene->selectionIndices()[1]; + itemA = + qobject_cast(scene->item(indexA)); + itemB = + qobject_cast(scene->item(indexB)); + } + } + std::vector poly_ptrs; + Q_FOREACH(int index, scene->selectionIndices()) { + Scene_polyhedron_item* item = + qobject_cast(scene->item(index)); + if(!item) + return; + else if(item != itemA) { + poly_ptrs.push_back(item->polyhedron()); + if(poly_ptrs.back() == 0) return; + } + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + + if(itemA && itemB && itemA != itemB) { + + // perform Boolean operation + QTime time; + time.start(); + + //since the visitor modify input polyhedra, we make copies. + Polyhedron A( *itemA->polyhedron() ); + Polyhedron B( *itemB->polyhedron() ); + + itemA->setVisible(false); + itemB->setVisible(false); + + Scene_polylines_item* new_item = new Scene_polylines_item(); + + #ifdef _COREFINEMENT_OUTPUT_IS_POLYHEDRON + typedef CGAL::Polyhedron_corefinement Corefinement; + Corefinement corefinement; + + typedef std::list > Decomposition; + Decomposition decomposition; + + #ifndef PRINT_EACH_VOLUME + int features=Corefinement::Join_tag+Corefinement::Intersection_tag+Corefinement::P_minus_Q_tag+Corefinement::Q_minus_P_tag; + #else + int features=Corefinement::Decomposition_tag; + #endif + corefinement(A, B, std::back_inserter(new_item->polylines),std::back_inserter(decomposition),features); + + + for (Decomposition::iterator it=decomposition.begin();it!=decomposition.end();++it) + { + Polyhedron* new_poly=it->first; + Scene_polyhedron_item* new_item_bool= new Scene_polyhedron_item(new_poly); + new_item_bool->setName( + QString::fromStdString( + corefinement.get_type_str(itemA->name().toStdString(),itemB->name().toStdString(),it->second) + ) + ); + scene->addItem(new_item_bool); + } + #else + Scene_combinatorial_map_item* cmap_item = new Scene_combinatorial_map_item(scene,static_cast(&A)); + typedef CGAL::Node_visitor_refine_polyhedra Split_visitor; + cmap_item->m_combinatorial_map=new Combinatorial_map_3(); + Split_visitor visitor(cmap_item->m_combinatorial_map); + CGAL::Intersection_of_Polyhedra_3 polyline_intersections(visitor); + polyline_intersections(A, B, std::back_inserter(new_item->polylines)); + cmap_item->setName(QString("%1_and_%2_corefined").arg(itemA->name()).arg(itemB->name())); + scene->addItem(cmap_item); + #endif + new_item->setName(tr("boundary intersection")); + new_item->setColor(Qt::green); + new_item->setRenderingMode(Wireframe); + scene->addItem(new_item); + std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; + + } + + QApplication::restoreOverrideCursor(); +} + +Q_EXPORT_PLUGIN2(Polyhedron_demo_corefinement_plugin, Polyhedron_demo_corefinement_plugin) + +#include "Polyhedron_demo_corefinement_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_intersection_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_intersection_plugin.cpp new file mode 100644 index 00000000000..ccc95d6d4cf --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_intersection_plugin.cpp @@ -0,0 +1,216 @@ +#define CGAL_USE_SEGMENT_APPROACH +#include +#ifdef CGAL_USE_SEGMENT_APPROACH +#include +#else +#include +#endif +#include +#include +#include "Scene_polyhedron_item.h" +#include "Polyhedron_type.h" +#include "Polyhedron_demo_plugin_interface.h" +#include "Polyhedron_demo_plugin_helper.h" + +#include "Scene_polylines_item.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +class Polyhedron_demo_intersection_plugin : + public QObject, + public Polyhedron_demo_plugin_helper +{ + Q_OBJECT + Q_INTERFACES(Polyhedron_demo_plugin_interface) + +public: + + + + QList actions() const { + return QList() << actionPolyhedronIntersection_3; + } + + void init(QMainWindow* mainWindow, Scene_interface* scene_interface) { + this->scene = scene_interface; + this->mw = mainWindow; + actionPolyhedronIntersection_3 = new QAction("Intersect polyhedra", mw); + if(actionPolyhedronIntersection_3) { + connect(actionPolyhedronIntersection_3, SIGNAL(triggered()), + this, SLOT(intersection())); + } + } + +private: + + QAction* actionPolyhedronIntersection_3; + +public slots: + void intersection(); + +}; // end class Polyhedron_demo_intersection_plugin + + +#ifdef CGAL_USE_SEGMENT_APPROACH +struct Is_on_polyline{ + bool operator()(Polyhedron::Halfedge_handle he) const { + return he->is_feature_edge(); + } +}; + +struct Set_vertex_corner{ + template + void add_info_to_node(int, Polyhedron*,const Info&) { + } + + void operator()(Polyhedron::Vertex_handle v, int, Polyhedron*) { + ++v->nb_of_feature_edges; + } +}; +#endif + +void Polyhedron_demo_intersection_plugin::intersection() +{ + int indexA = scene->selectionAindex(); + int indexB = scene->selectionBindex(); + + Scene_polyhedron_item* itemA = + qobject_cast(scene->item(indexA)); + Scene_polyhedron_item* itemB = + qobject_cast(scene->item(indexB)); + if(!itemA || !itemB || itemA == itemB) + { + Q_FOREACH(int index, scene->selectionIndices()) { + Scene_polyhedron_item* item = + qobject_cast(scene->item(index)); + if(!item) + return; + } + if(scene->selectionIndices().size() == 2) { + indexA = scene->selectionIndices()[0]; + indexB = scene->selectionIndices()[1]; + itemA = + qobject_cast(scene->item(indexA)); + itemB = + qobject_cast(scene->item(indexB)); + } + } +#ifndef CGAL_USE_SEGMENT_APPROACH + if(!itemA || !itemB || itemA == itemB) + return; +#else + std::vector poly_ptrs; + Q_FOREACH(int index, scene->selectionIndices()) { + Scene_polyhedron_item* item = + qobject_cast(scene->item(index)); + if(!item) + return; + else if(item != itemA) { + poly_ptrs.push_back(item->polyhedron()); + if(poly_ptrs.back() == 0) return; + } + } +#endif + + QApplication::setOverrideCursor(Qt::WaitCursor); + + Scene_polylines_item* new_item = new Scene_polylines_item(); + // perform Boolean operation + QTime time; + time.start(); + +#ifdef CGAL_USE_SEGMENT_APPROACH + typedef CGAL::Node_visitor_for_polyline_split Split_visitor; + + CGAL::Intersection_of_Polyhedra_3 polyline_intersections; + + typedef std::pair Pair_of_facet_handles; + typedef std::vector Polyline_info; + typedef std::vector Polylines_infos; + Polylines_infos polylines_infos; + + typedef Scene_polylines_item::Polylines_container Polylines_container; + typedef std::back_insert_iterator To_container; + typedef std::back_insert_iterator To_infos; + To_container to_container(new_item->polylines); + To_infos to_infos(polylines_infos); + CGAL::Dispatch_output_iterator< + CGAL::cpp0x::tuple, + CGAL::cpp0x::tuple > out_iterator(to_container, + to_infos); + + if(itemA && itemB && itemA != itemB) { + Polyhedron* A = itemA->polyhedron(); + Polyhedron* B = itemB->polyhedron(); + polyline_intersections(*A, *B, out_iterator); + } else { + if(itemA) { + Polyhedron* A = itemA->polyhedron(); + polyline_intersections(*A, + poly_ptrs.begin(), + poly_ptrs.end(), + out_iterator, + 0); + } else { + polyline_intersections(poly_ptrs.begin(), + poly_ptrs.end(), + out_iterator, + 0); + } + } + QStringList polylines_metadata; + BOOST_FOREACH(Polyline_info& info, polylines_infos) { + std::set indices; + BOOST_FOREACH(Pair_of_facet_handles p, info) + { + indices.insert(p.first->patch_id()); + indices.insert(p.second->patch_id()); + } + QString metadata; + BOOST_FOREACH(int index, indices) { + metadata = metadata + QString(" %1").arg(index); + } + std::cerr << "new polyline metadata: " << qPrintable(metadata) << "\n"; + polylines_metadata << metadata; + } + new_item->setProperty("polylines metadata", polylines_metadata); + new_item->setName(tr("intersection")); +#else + Polyhedron* A = itemA->polyhedron(); + Polyhedron* B = itemB->polyhedron(); + CGAL::intersection_Polyhedron_3_Polyhedron_3(*A, *B, std::back_inserter(new_item->polylines)); + + QString name = tr("%1 intersection %2"); + + new_item->setName(name.arg(itemA->name(), itemB->name())); + itemA->setRenderingMode(Wireframe); + itemB->setRenderingMode(Wireframe); + scene->itemChanged(indexA); + scene->itemChanged(indexB); +#endif + std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; + + new_item->setColor(Qt::green); + new_item->setRenderingMode(Wireframe); + scene->addItem(new_item); + + QApplication::restoreOverrideCursor(); +} + +Q_EXPORT_PLUGIN2(Polyhedron_demo_intersection_plugin, Polyhedron_demo_intersection_plugin) + +#include "Polyhedron_demo_intersection_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_polylines_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_polylines_io_plugin.cpp new file mode 100644 index 00000000000..4670a105972 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_polylines_io_plugin.cpp @@ -0,0 +1,127 @@ +#include "Scene_polylines_item.h" + +#include "Polyhedron_demo_io_plugin_interface.h" +#include +#include +#include + +class Polyhedron_demo_polylines_io_plugin : + public QObject, + public Polyhedron_demo_io_plugin_interface +{ + Q_OBJECT + Q_INTERFACES(Polyhedron_demo_io_plugin_interface) + +public: + QStringList nameFilters() const; + bool canLoad() const; + Scene_item* load(QFileInfo fileinfo); + + bool canSave(const Scene_item*); + bool save(const Scene_item*, QFileInfo fileinfo); +}; + +QStringList Polyhedron_demo_polylines_io_plugin::nameFilters() const { + return QStringList() << "Polylines files (*.polylines.txt *.cgal)"; +} + +bool Polyhedron_demo_polylines_io_plugin::canLoad() const { + return true; +} + + +Scene_item* +Polyhedron_demo_polylines_io_plugin::load(QFileInfo fileinfo) { + + // Open file + std::ifstream ifs(fileinfo.filePath().toUtf8()); + if(!ifs) { + std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; + return NULL; + } + + std::list > polylines; + QStringList polylines_metadata; + + int counter = 0; + std::size_t n; + while(ifs >> n) { + ++counter; + std::cerr << "Polyline #" << polylines.size() << ": " << n << " vertices"; + polylines.resize(polylines.size()+1); + std::vector& polyline = *(polylines.rbegin()); + while(n--){ + Scene_polylines_item::Point_3 p; + ifs >> p; + polyline.push_back(p); + if(!ifs.good()) return 0; + } + std::string line_remainder; + std::getline(ifs, line_remainder); + QString metadata(line_remainder.c_str()); + if(metadata[0].isSpace()) { + metadata.remove(0, 1); + } + polylines_metadata << metadata; + if(!metadata.isEmpty()) { + std::cerr << " (metadata: \"" << qPrintable(metadata) << "\")\n"; + } else { + std::cerr << "\n"; + } + if(ifs.bad() || ifs.fail()) return 0; + } + if(counter == 0) return 0; + Scene_polylines_item* item = new Scene_polylines_item; + item->polylines = polylines; + item->setName(fileinfo.baseName()); + item->setColor(Qt::black); + item->setProperty("polylines metadata", polylines_metadata); + std::cerr << "Number of polylines in item: " << item->polylines.size() << std::endl; + return item; +} + +bool Polyhedron_demo_polylines_io_plugin::canSave(const Scene_item*) +{ + return true; +} + +bool Polyhedron_demo_polylines_io_plugin::save(const Scene_item* item, QFileInfo fileinfo) +{ + const Scene_polylines_item* poly_item = + qobject_cast(item); + + if(!poly_item) + return false; + + std::ofstream out(fileinfo.filePath().toUtf8()); + + out.precision(17); + + if(!out) { + std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; + return false; + } + + typedef Scene_polylines_item::Polylines_container Polylines_container; + typedef Polylines_container::value_type Polyline; + typedef Polyline::value_type Point_3; + + QStringList metadata = item->property("polylines metadata").toStringList(); + + BOOST_FOREACH(const Polyline& polyline, poly_item->polylines) { + out << polyline.size(); + BOOST_FOREACH(const Point_3& p, polyline) { + out << " " << p.x() << " " << p.y() << " " << p.z(); + } + if(!metadata.isEmpty()) { + out << " " << qPrintable(metadata.front()); + metadata.pop_front(); + } + out << std::endl; + } + return out; +} + +#include +Q_EXPORT_PLUGIN2(Polyhedron_demo_polylines_io_plugin, Polyhedron_demo_polylines_io_plugin) +#include "Polyhedron_demo_polylines_io_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h b/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h index 294e96bdf5b..72f27dac265 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h +++ b/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h @@ -25,16 +25,12 @@ namespace CGAL { class Polyhedron_items_3; -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HalfedgeDS_default; template < class PolyhedronTraits_3, class PolyhedronItems_3, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class T_HDS, class Alloc > diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index 04a501d3f7d..04d2d53b34a 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -170,6 +170,18 @@ void Scene::initializeGL() # define lighter light #endif +bool +Scene::keyPressEvent(QKeyEvent* e){ + bool res=false; + for (QList::iterator it=selected_items_list.begin(),endit=selected_items_list.end(); + it!=endit;++it) + { + Scene_item* item=m_entries[*it]; + res |= item->keyPressEvent(e); + } + return res; +} + void Scene::draw() { diff --git a/Polyhedron/demo/Polyhedron/Scene.h b/Polyhedron/demo/Polyhedron/Scene.h index a00a012eea1..bde9b3233fa 100644 --- a/Polyhedron/demo/Polyhedron/Scene.h +++ b/Polyhedron/demo/Polyhedron/Scene.h @@ -68,6 +68,8 @@ public: // draw() is called by Viewer::draw() void draw(); void drawWithNames(); + + bool keyPressEvent(QKeyEvent* e); // Get scene bounding box Bbox bbox() const; diff --git a/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp new file mode 100644 index 00000000000..ed76937449d --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp @@ -0,0 +1,338 @@ +#include "Scene_combinatorial_map_item.h" +#include "Scene_polyhedron_item.h" +#include "Scene_interface.h" + +#include +#include +#include +#include + #include +#include + +Scene_combinatorial_map_item::Scene_combinatorial_map_item(Scene_interface* scene,void* address):last_known_scene(scene),volume_to_display(0),exportSelectedVolume(NULL),address_of_A(address){m_combinatorial_map=NULL;} +Scene_combinatorial_map_item::~Scene_combinatorial_map_item(){if (m_combinatorial_map!=NULL) delete m_combinatorial_map;} + +Scene_combinatorial_map_item* Scene_combinatorial_map_item::clone() const{return NULL;} + +Kernel::Vector_3 Scene_combinatorial_map_item::compute_face_normal(Combinatorial_map_3::Dart_const_handle adart) const +{ + typedef Combinatorial_map_3::Dart_of_orbit_const_range<1> Dart_in_facet_range; + typedef Kernel::Point_3 Point_3; + typedef Kernel::Vector_3 Vector_3; + Vector_3 normal = CGAL::NULL_VECTOR; + + Dart_in_facet_range vertices=combinatorial_map().darts_of_orbit<1>(adart); + Kernel::Point_3 points[3]; + int index=0; + Dart_in_facet_range::const_iterator pit=vertices.begin(); + for (;pit!=vertices.end() && index!=3;++pit,++index ){ + points[index]=pit->attribute<0>()->point(); + } + + if (index!=3) return normal; + + do{ + Vector_3 n = CGAL::cross_product(points[2]-points[1],points[0]-points[1]); + if (n != Vector_3(0,0,0) ) + normal = normal + (n / std::sqrt(n*n)); + points[0]=points[1]; + points[1]=points[2]; + if ( pit==vertices.end() ) break; + + points[2]=pit->attribute<0>()->point(); + ++pit; + }while(true); + + return normal == Vector_3(0,0,0)? normal : normal / std::sqrt(normal * normal); +} + +void Scene_combinatorial_map_item::set_next_volume(){ + ++volume_to_display; + volume_to_display=volume_to_display%(combinatorial_map().attributes<3>().size()+1); + emit itemChanged(); + + if (exportSelectedVolume!=NULL && ( volume_to_display==1 || volume_to_display==0 ) ) + exportSelectedVolume->setEnabled(!exportSelectedVolume->isEnabled()); +} + + +template +void Scene_combinatorial_map_item::export_as_polyhedron(Predicate pred,const QString& name) const { + typedef Combinatorial_map_3::Dart_const_handle Dart_handle; + typedef Combinatorial_map_3::One_dart_per_cell_const_range<3> One_dart_per_vol_range; + typedef CGAL::internal::Import_volume_as_polyhedron Volume_import_modifier; + + std::vector darts; + One_dart_per_vol_range cell_range=combinatorial_map().template one_dart_per_cell<3>(); + + + for (One_dart_per_vol_range::const_iterator it = cell_range.begin();it!= cell_range.end() ; ++it ) + if ( pred(it) ){ + darts.push_back(it); + if (Predicate::only_one_run) break; + } + + if (!darts.empty()) + { + Volume_import_modifier modifier=Predicate::swap_orientation? + Volume_import_modifier(combinatorial_map(),darts.begin(),darts.end(),Predicate::swap_orientation): + Volume_import_modifier(combinatorial_map(),darts.begin(),darts.end()); + + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + Scene_polyhedron_item* new_item = new Scene_polyhedron_item(new_poly); + new_item->setName(name); + last_known_scene->addItem(new_item); + } +} + +struct Select_volume{ + static const bool only_one_run=true; + static const bool swap_orientation=false; + Select_volume(int i):volume_to_select(i),index(0){} + template + bool operator() (Dart_handle){ + return ++index==volume_to_select; + } +private: + int volume_to_select; + int index; +}; + +void Scene_combinatorial_map_item::export_current_volume_as_polyhedron() const { + if (volume_to_display==0) return; //no volume selected + + Select_volume predicate(volume_to_display); + export_as_polyhedron(predicate,QString("%1_%2").arg(this->name()).arg(volume_to_display-1)); +} + +struct Select_union{ + static const bool only_one_run=false; + static const bool swap_orientation=true; + template + bool operator() (Dart_handle d){ return d->template attribute<3>()->info().outside.size()==2; } +}; + +struct Select_inter{ + static const bool only_one_run=false; + static const bool swap_orientation=false; + template + bool operator() (Dart_handle d){ return d->template attribute<3>()->info().inside.size()==2; } +}; + +struct Select_A_minus_B{ + static const bool only_one_run=false; + static const bool swap_orientation=false; + Select_A_minus_B(void* address):address_of_A(address){} + template + bool operator() (Dart_handle d){ + return d->template attribute<3>()->info().inside.size()==1 && + static_cast(*d->template attribute<3>()->info().inside.begin())==address_of_A; + } +private: + void* address_of_A; +}; + +struct Select_B_minus_A{ + static const bool only_one_run=false; + static const bool swap_orientation=false; + Select_B_minus_A(void* address):address_of_A(address){} + template + bool operator() (Dart_handle d){ + return d->template attribute<3>()->info().inside.size()==1 && + static_cast(*d->template attribute<3>()->info().inside.begin())!=address_of_A; + } +private: + void* address_of_A; +}; + +void Scene_combinatorial_map_item::export_union_as_polyhedron() const { + export_as_polyhedron(Select_union(),QString("%1_union_%2").arg("A").arg("B")); +} +void Scene_combinatorial_map_item::export_intersection_as_polyhedron() const{ + export_as_polyhedron(Select_inter(),QString("%1_inter_%2").arg("A").arg("B")); +} +void Scene_combinatorial_map_item::export_A_minus_B_as_polyhedron() const{ + Select_A_minus_B predicate(address_of_A); + export_as_polyhedron(predicate,QString("%1_minus_%2").arg("A").arg("B")); +} +void Scene_combinatorial_map_item::export_B_minus_A_as_polyhedron() const{ + Select_B_minus_A predicate(address_of_A); + export_as_polyhedron(predicate,QString("%1_minus_%2").arg("B").arg("A")); +} + +QMenu* Scene_combinatorial_map_item::contextMenu() +{ + const char* prop_name = "Menu modified by Scene_combinatorial_map_item."; + + QMenu* menu = Scene_item::contextMenu(); + + // Use dynamic properties: + // http://doc.trolltech.com/lastest/qobject.html#property + bool menuChanged = menu->property(prop_name).toBool(); + + if(!menuChanged) { + QAction* actionSelectNextVolume = + menu->addAction(tr("Iterate over volumes")); + actionSelectNextVolume->setObjectName("actionSelectNextVolume"); + connect(actionSelectNextVolume, SIGNAL(triggered()),this, SLOT(set_next_volume())); + + exportSelectedVolume = + menu->addAction(tr("Export current volume as polyhedron")); + exportSelectedVolume->setObjectName("exportSelectedVolume"); + connect(exportSelectedVolume, SIGNAL(triggered()),this, SLOT(export_current_volume_as_polyhedron())); + exportSelectedVolume->setEnabled(volume_to_display!=0); + menu->setProperty(prop_name, true); + + if(is_from_corefinement()){ + //Export union as polyhedron + QAction* exportUnion = + menu->addAction(tr("Export union as polyhedron")); + exportUnion->setObjectName("exportUnion"); + connect(exportUnion, SIGNAL(triggered()),this, SLOT(export_union_as_polyhedron())); + + //Export intersection as polyhedron + QAction* exportIntersection = + menu->addAction(tr("Export intersection as polyhedron")); + exportIntersection->setObjectName("exportIntersection"); + connect(exportIntersection, SIGNAL(triggered()),this, SLOT(export_intersection_as_polyhedron())); + + //Export A minus B as polyhedron + QAction* exportAMinusB = + menu->addAction(tr("Export A minus B as polyhedron")); + exportAMinusB->setObjectName("exportAMinusB"); + connect(exportAMinusB, SIGNAL(triggered()),this, SLOT(export_A_minus_B_as_polyhedron())); + + //Export B minus A as polyhedron + QAction* exportBMinusA = + menu->addAction(tr("Export B minus A as polyhedron")); + exportBMinusA->setObjectName("exportBMinusA"); + connect(exportBMinusA, SIGNAL(triggered()),this, SLOT(export_B_minus_A_as_polyhedron())); + + } + } + return menu; +} + +bool Scene_combinatorial_map_item::keyPressEvent(QKeyEvent* e){ + if (e->key()==Qt::Key_N){ + set_next_volume(); + return true; + } + return false; +} + +void Scene_combinatorial_map_item::direct_draw() const { + typedef Combinatorial_map_3::One_dart_per_cell_const_range<3> Volume_dart_range; + typedef Combinatorial_map_3::One_dart_per_incident_cell_const_range<2,3> Facet_in_volume_drange; + typedef Combinatorial_map_3::Dart_of_orbit_const_range<1> Dart_in_facet_range; + Volume_dart_range dart_per_volume_range = combinatorial_map().one_dart_per_cell<3>(); + + int index = 0; + for (Volume_dart_range::const_iterator vit=dart_per_volume_range.begin();vit!=dart_per_volume_range.end();++vit) + { + if (++index!=volume_to_display && volume_to_display!=0) continue; + Facet_in_volume_drange facet_range=combinatorial_map().one_dart_per_incident_cell<2,3>(vit); + + for(Facet_in_volume_drange::const_iterator fit=facet_range.begin();fit!=facet_range.end();++fit){ + Dart_in_facet_range vertices=combinatorial_map().darts_of_orbit<1>(fit); + Kernel::Vector_3 normal = compute_face_normal(fit); + + ::glBegin(GL_POLYGON); + ::glNormal3d(normal.x(),normal.y(),normal.z()); + + for (Dart_in_facet_range::const_iterator pit=vertices.begin();pit!=vertices.end();++pit ){ + const Kernel::Point_3& p= pit->attribute<0>()->point(); + ::glVertex3d(p.x(),p.y(),p.z()); + } + ::glEnd(); + } + } +} + +void Scene_combinatorial_map_item::direct_draw_edges() const { + typedef Combinatorial_map_3::One_dart_per_cell_const_range<1> Edge_darts; + Edge_darts darts=combinatorial_map().one_dart_per_cell<1>(); + ::glBegin(GL_LINES); + for (Edge_darts::const_iterator dit=darts.begin();dit!=darts.end();++dit){ + CGAL_assertion(!dit->is_free(1)); + const Kernel::Point_3& a = dit->attribute<0>()->point(); + const Kernel::Point_3& b = dit->beta(1)->attribute<0>()->point(); + ::glVertex3d(a.x(),a.y(),a.z()); + ::glVertex3d(b.x(),b.y(),b.z()); + } + ::glEnd(); +} + +void Scene_combinatorial_map_item::draw_points() const{ + typedef Combinatorial_map_3::Attribute_const_range<0>::type Point_range; + const Point_range& points=combinatorial_map().attributes<0>(); + ::glBegin(GL_POINTS); + for(Point_range::const_iterator pit=boost::next(points.begin());pit!=points.end();++pit){ + const Kernel::Point_3& p=pit->point(); + ::glVertex3d(p.x(),p.y(),p.z()); + } + ::glEnd(); +} + +bool Scene_combinatorial_map_item::isEmpty() const {return combinatorial_map().number_of_darts()==0;} + +Scene_combinatorial_map_item::Bbox +Scene_combinatorial_map_item::bbox() const { + typedef Combinatorial_map_3::Attribute_const_range<0>::type Point_range; + const Point_range& points=combinatorial_map().attributes<0>(); + CGAL::Bbox_3 bbox=points.begin()->point().bbox(); + for(Point_range::const_iterator pit=boost::next(points.begin());pit!=points.end();++pit) + bbox=bbox+pit->point().bbox(); + return Bbox(bbox.xmin(),bbox.ymin(),bbox.zmin(), + bbox.xmax(),bbox.ymax(),bbox.zmax()); +} + + +QString Scene_combinatorial_map_item::toolTip() const{ + if(!m_combinatorial_map) + return QString(); + + std::vector cells(5); + for (unsigned int i=0; i<=4; ++i) + cells[i]=i; + std::vector res = combinatorial_map().count_cells(cells); + if (volume_to_display==0) + return QObject::tr("

    Combinatorial_map_3 %1 (mode: %8, color: %9)

    " + "

    Number of darts: %2
    " + "Number of vertices: %3
    " + "Number of edges: %4
    " + "Number of facets: %5
    " + "Number of volumes: %6
    " + "Number of connected components: %7

    ") + .arg(this->name()) + .arg(combinatorial_map().number_of_darts()) + .arg(res[0]) + .arg(res[1]) + .arg(res[2]) + .arg(res[3]) + .arg(res[4]) + .arg(this->renderingModeName()) + .arg(this->color().name()); + return QObject::tr("

    Combinatorial_map_3 %1 (mode: %8, color: %9)

    " + "

    Number of darts: %2
    " + "Number of vertices: %3
    " + "Number of edges: %4
    " + "Number of facets: %5
    " + "Number of volumes: %6
    " + "Number of connected components: %7
    " + "Currently Displaying facets of volume: %10

    ") + .arg(this->name()) + .arg(combinatorial_map().number_of_darts()) + .arg(res[0]) + .arg(res[1]) + .arg(res[2]) + .arg(res[3]) + .arg(res[4]) + .arg(this->renderingModeName()) + .arg(this->color().name()) + .arg(volume_to_display-1); +} + + +#include "Scene_combinatorial_map_item.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h new file mode 100644 index 00000000000..144b8adec3b --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h @@ -0,0 +1,83 @@ +#ifndef SCENE_COMBINATORIAL_MAP_ITEM_H +#define SCENE_COMBINATORIAL_MAP_ITEM_H + + +//========= +#include +#include "Scene_combinatorial_map_item_config.h" +#include "Scene_item_with_display_list.h" +#include + +#include "Polyhedron_type.h" + +typedef CGAL::internal_IOP::Item_with_points_and_volume_info Items; +typedef CGAL::Combinatorial_map<3,Items> Combinatorial_map_3; +//========= + +class QMenu; +class QAction; +class Scene_interface; +class Scene_polyhedron_item; + +class SCENE_COMBINATORIAL_MAP_ITEM_EXPORT Scene_combinatorial_map_item + : public Scene_item_with_display_list +{ + Q_OBJECT +public: + Scene_combinatorial_map_item(Scene_interface*,void* ad_A=NULL); + ~Scene_combinatorial_map_item(); + + Scene_combinatorial_map_item* clone() const; + // Function to override the context menu + QMenu* contextMenu(); + +// bool load(std::istream& in); +// void load(Scene_polyhedron_item*); +// bool save(std::ostream& out) const; + + QString toolTip() const; + + // Indicate if rendering mode is supported + virtual bool supportsRenderingMode(RenderingMode m) const { return m != Gouraud; } // CHECK THIS! + //Event handling + virtual bool keyPressEvent(QKeyEvent*); + // OpenGL drawing in a display list + void direct_draw() const; + void direct_draw_edges() const; + void draw_points() const; + + bool isFinite() const { return true; } + bool is_from_corefinement() const {return address_of_A!=NULL;} + bool isEmpty() const; + Bbox bbox() const; + + const Combinatorial_map_3& combinatorial_map() const + { + return *m_combinatorial_map; + } + + Combinatorial_map_3& combinatorial_map() + { + return *m_combinatorial_map; + } + + Combinatorial_map_3* m_combinatorial_map; + +private: + Kernel::Vector_3 compute_face_normal(Combinatorial_map_3::Dart_const_handle adart) const; + Scene_interface* last_known_scene; + int volume_to_display; + QAction* exportSelectedVolume; + void* address_of_A; + template void export_as_polyhedron(Predicate,const QString&) const; + +public slots: + void set_next_volume(); + void export_current_volume_as_polyhedron() const; + void export_union_as_polyhedron() const; + void export_intersection_as_polyhedron() const; + void export_A_minus_B_as_polyhedron() const; + void export_B_minus_A_as_polyhedron() const; +}; // end class Scene_combinatorial_map_item + +#endif // SCENE_COMBINATORIAL_MAP_ITEM_H diff --git a/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item_config.h b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item_config.h new file mode 100644 index 00000000000..fbe1df44652 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item_config.h @@ -0,0 +1,10 @@ +#ifndef SCENE_COMBINATORIAL_MAP_ITEM_CONFIG_H +#define SCENE_COMBINATORIAL_MAP_ITEM_CONFIG_H + +#ifdef scene_combinatorial_map_item_EXPORTS +# define SCENE_COMBINATORIAL_MAP_ITEM_EXPORT Q_DECL_EXPORT +#else +# define SCENE_COMBINATORIAL_MAP_ITEM_EXPORT Q_DECL_IMPORT +#endif + +#endif // SCENE_COMBINATORIAL_MAP_ITEM_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Scene_draw_interface.h b/Polyhedron/demo/Polyhedron/Scene_draw_interface.h index 394ea7ebfd7..410fd6754f0 100644 --- a/Polyhedron/demo/Polyhedron/Scene_draw_interface.h +++ b/Polyhedron/demo/Polyhedron/Scene_draw_interface.h @@ -1,12 +1,15 @@ #ifndef SCENE_DRAW_INTERFACE_H #define SCENE_DRAW_INTERFACE_H +class QKeyEvent; + class Scene_draw_interface { public: virtual ~Scene_draw_interface(){} virtual void initializeGL() = 0; virtual void draw() = 0; virtual void drawWithNames() = 0; + virtual bool keyPressEvent(QKeyEvent* e) = 0; }; #endif // SCENE_DRAW_INTERFACE_H; diff --git a/Polyhedron/demo/Polyhedron/Scene_item.h b/Polyhedron/demo/Polyhedron/Scene_item.h index 0463b4e3978..e675e91e394 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_item.h @@ -12,6 +12,7 @@ namespace qglviewer { } class QMenu; +class QKeyEvent; // This class represents an object in the OpenGL scene class SCENE_ITEM_EXPORT Scene_item : public QObject { @@ -71,6 +72,8 @@ public: // Context menu virtual QMenu* contextMenu(); + // Event handling + virtual bool keyPressEvent(QKeyEvent*){return false;} public slots: // Call that once you have finished changing something in the item // (either the properties or internal data) diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index fe7a7238760..d1c3508fe8e 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -103,10 +103,10 @@ struct Polyhedron_to_polygon_soup_writer { } void write_header( std::ostream&, - std::size_t vertices, - std::size_t halfedges, - std::size_t facets, - bool normals = false ) { + std::size_t /* vertices */, + std::size_t /* halfedges */, + std::size_t /* facets */, + bool /* normals */ = false ) { soup->clear(); } @@ -117,7 +117,7 @@ struct Polyhedron_to_polygon_soup_writer { soup->points.push_back(Point_3(x, y, z)); } - void write_normal( const double& x, const double& y, const double& z) { + void write_normal( const double& /* x */, const double& /* y */, const double& /* z */) { } void write_facet_header() { diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp index 34bfb85fd94..c2fd5f390b9 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp @@ -325,8 +325,6 @@ Scene_polyhedron_item::select(double orig_x, if(closest != intersections.end()) { const Kernel::Point_3* closest_point = CGAL::object_cast(&closest->first); - Kernel::Compare_squared_distance_3 comp_sq_dist = - Kernel().compare_squared_distance_3_object(); for(Intersections::iterator it = boost::next(intersections.begin()), diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp new file mode 100644 index 00000000000..3667b6dfef7 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp @@ -0,0 +1,470 @@ +#include "Scene_polylines_item.h" + +#include +#include +#include +#include +#include + +#include + +namespace { + void CGALglcolor(QColor c, int dv = 0) + { + if ( 0 != dv ) + { +// workaround for Qt-4.2. +#if QT_VERSION < 0x040300 +# define darker dark +#endif + c = c.darker(dv); +#undef darker + } + ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + } +} + +class Scene_polylines_item_private { +public: + typedef Scene_polylines_item::K K; + typedef K::Point_3 Point_3; + + Scene_polylines_item_private() : + draw_extremities(false), + spheres_drawn_radius(0), + sphere_display_list(0), + quadric(0) + {} + + ~Scene_polylines_item_private() + { + if(quadric != 0) + gluDeleteQuadric(quadric); + if(sphere_display_list != 0) + glDeleteLists(sphere_display_list, 1); + } + + void draw_sphere(const K::Point_3&, double) const; + void draw_spheres(const Scene_polylines_item*) const; + + bool draw_extremities; + double spheres_drawn_radius; +private: + mutable GLuint sphere_display_list; + mutable GLUquadric* quadric; +}; + +Scene_polylines_item::Scene_polylines_item() + : d(new Scene_polylines_item_private()) +{ + +} + +Scene_polylines_item::~Scene_polylines_item() +{ + delete d; +} + +bool +Scene_polylines_item::isEmpty() const { + return polylines.empty(); +} + +Scene_interface::Bbox +Scene_polylines_item::bbox() const { + if(isEmpty()) + return Bbox(); + std::list boxes; + for(std::list >::const_iterator it = polylines.begin(); + it != polylines.end(); + ++it){ + if(it->begin() != it->end()) { + Iso_cuboid_3 cub = CGAL::bounding_box(it->begin(), it->end()); + boxes.push_back((cub.min)()); + boxes.push_back((cub.max)()); + } + } + Iso_cuboid_3 bbox = + boxes.begin() != boxes.end() ? + CGAL::bounding_box(boxes.begin(), boxes.end()) : + Iso_cuboid_3(); + + return Bbox(bbox.xmin(), + bbox.ymin(), + bbox.zmin(), + bbox.xmax(), + bbox.ymax(), + bbox.zmax()); +} + +Scene_polylines_item* +Scene_polylines_item::clone() const { + Scene_polylines_item* item = new Scene_polylines_item; + item->polylines = polylines; + QVariant metadata_variant = property("polylines metadata"); + if(metadata_variant.type() == QVariant::StringList) + { + item->setProperty("polylines metadata", metadata_variant); + } + return item; +} + +QString +Scene_polylines_item::toolTip() const { + QString s = + tr("

    %1 (mode: %2, color: %3)
    " + "Polylines

    " + "

    Number of polylines: %4

    ") + .arg(this->name()) + .arg(this->renderingModeName()) + .arg(this->color().name()) + .arg(polylines.size()); + if(d->draw_extremities) { + s += tr("

    Legende of endpoints colors:

      " + "
    • black: one incident polyline
    • " + "
    • green: two incident polylines
    • " + "
    • blue: three incident polylines
    • " + "
    • red: four incident polylines
    • " + "
    • fuchsia: five or more incident polylines
    • " + "

    "); + } + return s; +} + +bool +Scene_polylines_item::supportsRenderingMode(RenderingMode m) const { + return (m == Wireframe || + m == FlatPlusEdges || + m == Points); +} + +// Shaded OpenGL drawing: only draw spheres +void +Scene_polylines_item::draw() const { + if(d->draw_extremities) + d->draw_spheres(this); +} + +// Wireframe OpenGL drawing +void +Scene_polylines_item::draw_edges() const { + CGALglcolor(this->color()); + ::glBegin(GL_LINES); + for(std::list >::const_iterator it = polylines.begin(); + it != polylines.end(); + ++it){ + if(it->empty()) continue; + for(size_t i = 0, end = it->size()-1; + i < end; ++i) + { + const Point_3& a = (*it)[i]; + const Point_3& b = (*it)[i+1]; + ::glVertex3d(a.x(), a.y(), a.z()); + ::glVertex3d(b.x(), b.y(), b.z()); + } + } + ::glEnd(); + if(d->draw_extremities) + { + d->draw_spheres(this); + } +} + +void +Scene_polylines_item::draw_points() const { + ::glBegin(GL_POINTS); + // draw all points but endpoints + for(std::list >::const_iterator it = polylines.begin(); + it != polylines.end(); + ++it) + { + if(it->empty()) continue; + for(size_t i = 1, end = it->size()-1; + i < end; ++i) + { + const Point_3& a = (*it)[i]; + ::glVertex3d(a.x(), a.y(), a.z()); + } + } + ::glEnd(); + + ::glColor3d(1., 0., 0.); //red + // draw endpoints + ::glBegin(GL_POINTS); + for(std::list >::const_iterator it = polylines.begin(); + it != polylines.end(); + ++it){ + if(it->empty()) continue; + const Point_3& a = (*it)[0]; + const Point_3& b = (*it)[it->size()-1]; + ::glVertex3d(a.x(), a.y(), a.z()); + ::glVertex3d(b.x(), b.y(), b.z()); + } + ::glEnd(); +} + +void +Scene_polylines_item_private:: +draw_spheres(const Scene_polylines_item* item) const { + // FIRST, count the number of incident cycles and polylines + // for all extremities. + typedef std::map Point_to_int_map; + typedef Point_to_int_map::iterator iterator; + Point_to_int_map corner_polyline_nb; + + { // scope to fill corner_polyline_nb' + Point_to_int_map corner_cycles_nb; + + for(std::list >::const_iterator + it = item->polylines.begin(), + end = item->polylines.end(); + it != end; ++it) + { + const K::Point_3& a = *it->begin(); + const K::Point_3& b = *it->rbegin(); + if(a == b) { + if ( it->size()>1 ) + ++corner_cycles_nb[a]; + else + ++corner_polyline_nb[a]; + } + else { + ++corner_polyline_nb[a]; + ++corner_polyline_nb[b]; + } + } + // THEN, ignore points that are incident to one cycle only. + for(iterator + c_it = corner_cycles_nb.begin(), + end = corner_cycles_nb.end(); + c_it != end; ++c_it) + { + const Point_3& a = c_it->first; + + iterator p_it = corner_polyline_nb.find(a); + + // If the point 'a'=c_it->first has only incident cycles... + if(p_it == corner_polyline_nb.end()) { + // ...then count it as a corner only if it has two incident cycles + // or more. + if(c_it->second > 1) { + corner_polyline_nb[a] = c_it->second; + } + } else { + // else add the number of cycles. + p_it->second += c_it->second; + } + } + } + // At this point, 'corner_polyline_nb' gives the multiplicity of all + // corners. + for(iterator + p_it = corner_polyline_nb.begin(), + end = corner_polyline_nb.end(); + p_it != end; ++p_it) + { + switch(p_it->second) { + case 1: + ::glColor3d(0.0, 0.0, 0.0); // black + break; + case 2: + ::glColor3d(0.0, 0.8, 0.0); // green + break; + case 3: + ::glColor3d(0.0, 0.0, 0.8); // blue + break; + case 4: + ::glColor3d(0.8, 0.0, 0.0); //red + break; + default: + ::glColor3d(0.8, 0.0, 0.8); //fuschia + } + this->draw_sphere(p_it->first, this->spheres_drawn_radius); + } +} + +void +Scene_polylines_item_private::draw_sphere(const K::Point_3& p, + double r) const +{ + if(sphere_display_list == 0) { + sphere_display_list = glGenLists(1); + if(sphere_display_list == 0) + std::cerr << "ERROR: Cannot create display list!\n"; + if(quadric == 0) + quadric = gluNewQuadric(); + if(quadric == 0) + std::cerr << "ERROR: Cannot create GLU quadric!\n"; + glNewList(sphere_display_list, GL_COMPILE); + gluSphere(quadric, 1., 10, 10); + glEndList(); + if(glGetError() != GL_NO_ERROR) + std::cerr << gluErrorString(glGetError()); + } + glPushMatrix(); + glTranslated(CGAL::to_double(p.x()), + CGAL::to_double(p.y()), + CGAL::to_double(p.z())); + + glScaled(r, r, r); + glCallList(sphere_display_list); + glPopMatrix(); +} + +QMenu* Scene_polylines_item::contextMenu() +{ + const char* prop_name = "Menu modified by Scene_polylines_item."; + + QMenu* menu = Scene_item::contextMenu(); + + // Use dynamic properties: + // http://doc.trolltech.com/lastest/qobject.html#property + bool menuChanged = menu->property(prop_name).toBool(); + + if(!menuChanged) { + menu->addSeparator(); + // TODO: add actions to display corners + QAction* action = menu->addAction(tr("Display corners with radius...")); + connect(action, SIGNAL(triggered()), + this, SLOT(change_corner_radii())); + menu->setProperty(prop_name, true); + } + return menu; +} + +void Scene_polylines_item::change_corner_radii() { + bool ok = true; + double proposed_radius = d->spheres_drawn_radius; + if(proposed_radius == 0) { + Scene_interface::Bbox b = bbox(); + proposed_radius = (std::max)(b.xmax - b.xmin, + proposed_radius); + proposed_radius = (std::max)(b.ymax - b.ymin, + proposed_radius); + proposed_radius = (std::max)(b.zmax - b.zmin, + proposed_radius); + proposed_radius /= 100; + } + double r = QInputDialog::getDouble(NULL, + tr("Display corners with new radius..."), + tr("Radius:"), + proposed_radius, // value + 0., // min + 2147483647., // max + 10, // decimals + &ok); + if(ok) { + change_corner_radii(r); + } +} + +void Scene_polylines_item::change_corner_radii(double r) { + if(r >= 0) { + d->spheres_drawn_radius = r; + d->draw_extremities = (r > 0); + this->changed(); + emit itemChanged(); + } +} + +void Scene_polylines_item::split_at_sharp_angles() +{ + typedef Polylines_container Bare_polyline_container; + typedef Polyline Bare_polyline; + Polylines_container& bare_polylines = polylines; + + int counter = 0; + for(Bare_polyline_container::iterator + bare_polyline_it = bare_polylines.begin(); + bare_polyline_it != bare_polylines.end(); // the end changes + // during the loop + ++counter /* bare_polyline_it is incremented in the loop */) + { + Bare_polyline_container::iterator current_polyline_it = + bare_polyline_it; + Bare_polyline& bare_polyline = *bare_polyline_it; + Bare_polyline::iterator it = boost::next(bare_polyline.begin()); + + if(boost::next(bare_polyline.begin()) == bare_polyline.end()) + { + std::cerr << "WARNING: Isolated point in polylines\n"; + bare_polyline_it = bare_polylines.erase(bare_polyline_it); + continue; + } + else + ++bare_polyline_it; + if(it != bare_polyline.end()) { + for(; it != boost::prior(bare_polyline.end()); ++it) { + const Point_3 pv = *it; + const Point_3 pa = *boost::prior(it); + const Point_3 pb = *boost::next(it); + const K::Vector_3 av = pv - pa; + const K::Vector_3 bv = pv - pb; + const K::FT sc_prod = av * bv; + if( sc_prod >= 0 || + (sc_prod < 0 && + CGAL::square(sc_prod) < (av * av) * (bv * bv) / 4 ) ) + { +#ifdef PROTECTION_DEBUG + std::cerr << "Split polyline (small angle) " + << std::acos(sqrt(CGAL::square(sc_prod) / + ((av*av) * (bv*bv)))) * 180 /CGAL_PI + << " degres\n"; +#endif + Bare_polyline new_polyline; + std::copy(it, bare_polyline.end(), + std::back_inserter(new_polyline)); + + if(*bare_polyline.begin() == *bare_polyline.rbegin()) { + // if the polyline is a cycle, test if its beginning is a sharp + // angle... + const Point_3 pv = *bare_polyline.begin(); + const Point_3 pa = *boost::prior(boost::prior(bare_polyline.end())); + const Point_3 pb = *boost::next(bare_polyline.begin()); + const K::Vector_3 av = pv - pa; + const K::Vector_3 bv = pv - pb; + const K::FT sc_prod = av * bv; + if( sc_prod >= 0 || + (sc_prod < 0 && + CGAL::square(sc_prod) < (av * av) * (bv * bv) / 4 ) ) + { + // if its beginning is a sharp angle, then split + bare_polyline.erase(boost::next(it), bare_polyline.end()); + } + else { + // ...if not, modifies its beginning + std::copy(boost::next(bare_polyline.begin()), + boost::next(it), + std::back_inserter(new_polyline)); + bare_polylines.erase(current_polyline_it); + } + } + else { + bare_polyline.erase(boost::next(it), bare_polyline.end()); + } + bare_polylines.push_back(new_polyline); + break; + } + } + } + } + emit itemChanged(); +} + +void +Scene_polylines_item::merge(Scene_polylines_item* other_item) { + if(other_item == 0) return; + std::copy(other_item->polylines.begin(), + other_item->polylines.end(), + std::back_inserter(polylines)); + QVariant other_metadata_variant = other_item->property("polylines metadata"); + if(other_metadata_variant.type() == QVariant::StringList) + { + QStringList metadata = property("polylines metadata").toStringList(); + metadata.append(other_metadata_variant.toStringList()); + setProperty("polylines metadata", metadata); + } + changed(); +} + +#include "Scene_polylines_item.moc" diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.h b/Polyhedron/demo/Polyhedron/Scene_polylines_item.h new file mode 100644 index 00000000000..7a612ca1d2e --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.h @@ -0,0 +1,66 @@ +#ifndef SCENE_POLYLINES_ITEM_H +#define SCENE_POLYLINES_ITEM_H + +#include "Scene_polylines_item_config.h" + +#include +#include "Scene_item.h" + +#include + +#include +#include + +class Scene_polylines_item_private; + +class SCENE_POLYLINES_ITEM_EXPORT Scene_polylines_item : public Scene_item +{ + Q_OBJECT +public: + typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + typedef K::Point_3 Point_3; + typedef std::vector Polyline; + typedef std::list Polylines_container; + + typedef K::Iso_cuboid_3 Iso_cuboid_3; + + Scene_polylines_item(); + virtual ~Scene_polylines_item(); + + bool isFinite() const { return true; } + bool isEmpty() const; + Bbox bbox() const; + + Scene_polylines_item* clone() const; + + QString toolTip() const; + + // Indicate if rendering mode is supported + bool supportsRenderingMode(RenderingMode m) const; + + QMenu* contextMenu(); + + // Flat/Gouraud OpenGL drawing + void draw() const; + + // Wireframe OpenGL drawing + void draw_edges() const; + + void draw_points() const; + +public slots: + void change_corner_radii(double); + void change_corner_radii(); + void split_at_sharp_angles(); + + void merge(Scene_polylines_item*); + +public: + Polylines_container polylines; + + // http://en.wikipedia.org/wiki/D-pointer + Scene_polylines_item_private* d; + +}; // end class Scene_polylines_item + +#endif diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item_config.h b/Polyhedron/demo/Polyhedron/Scene_polylines_item_config.h new file mode 100644 index 00000000000..991f9136aec --- /dev/null +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item_config.h @@ -0,0 +1,10 @@ +#ifndef SCENE_POLYLINES_ITEM_CONFIG_H +#define SCENE_POLYLINES_ITEM_CONFIG_H + +#ifdef scene_polylines_item_EXPORTS +# define SCENE_POLYLINES_ITEM_EXPORT Q_DECL_EXPORT +#else +# define SCENE_POLYLINES_ITEM_EXPORT Q_DECL_IMPORT +#endif + +#endif // SCENE_POLYLINES_ITEM_CONFIG_H diff --git a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.h index 9dec7dfbc60..e3c66786904 100644 --- a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.h @@ -28,7 +28,7 @@ public: virtual QString toolTip() const; // Indicate if rendering mode is supported - virtual bool supportsRenderingMode(RenderingMode m) const { return true; } + virtual bool supportsRenderingMode(RenderingMode /* m */) const { return true; } // Points/Wireframe/Flat/Gouraud OpenGL drawing in a display list virtual void direct_draw() const; diff --git a/Polyhedron/demo/Polyhedron/Viewer.cpp b/Polyhedron/demo/Polyhedron/Viewer.cpp index bd69a082f2c..7e388703e7f 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.cpp +++ b/Polyhedron/demo/Polyhedron/Viewer.cpp @@ -122,7 +122,9 @@ void Viewer::keyPressEvent(QKeyEvent* e) return; } } - QGLViewer::keyPressEvent(e); + //forward the event to the scene (item handling of the event) + if (! d->scene->keyPressEvent(e) ) + QGLViewer::keyPressEvent(e); } void Viewer::turnCameraBy180Degres() { diff --git a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake b/Polyhedron/demo/Polyhedron/cgal_test_with_cmake index 558e253febd..54e8bf35e90 100755 --- a/Polyhedron/demo/Polyhedron/cgal_test_with_cmake +++ b/Polyhedron/demo/Polyhedron/cgal_test_with_cmake @@ -105,18 +105,23 @@ else scene_c2t3_item \ scene_edit_polyhedron_item \ scene_nef_polyhedron_item \ + scene_combinatorial_map_item \ + scene_polyline_item \ scene_polygon_soup_item \ scene_polyhedron_item \ scene_textured_polyhedron_item \ convex_hull_plugin \ + corefinement_plugin \ cut_plugin \ edit_polyhedron_plugin \ inside_out_plugin \ + intersection_plugin \ kernel_plugin \ mesh_3_plugin \ mesh_simplification_plugin \ nef_plugin \ off_plugin \ + polylines_io_plugin \ off_to_nef_plugin \ orient_soup_plugin \ parameterization_plugin \ diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/AABB_polyhedral_oracle.h b/Polyhedron/demo/Polyhedron/include/CGAL/AABB_polyhedral_oracle.h index f8d6ec227e1..096eb75d123 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/AABB_polyhedral_oracle.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/AABB_polyhedral_oracle.h @@ -137,9 +137,9 @@ namespace CGAL { } template - OutputIteratorPoints operator() (const Surface_3& surface, + OutputIteratorPoints operator() (const Surface_3& /* surface */, OutputIteratorPoints out, - int n) const + int /* n */) const { // std::cout << "AABB_polyhedral_oracle: empty initial point set" << std::endl; return out; diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg new file mode 100644 index 00000000000..84dbd660f59 --- /dev/null +++ b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler.svg @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf new file mode 100644 index 00000000000..259c5fb3a48 Binary files /dev/null and b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.pdf differ diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg new file mode 100644 index 00000000000..cde3e4a3371 --- /dev/null +++ b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_facet.svg @@ -0,0 +1,929 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf new file mode 100644 index 00000000000..baca524996d Binary files /dev/null and b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.pdf differ diff --git a/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg new file mode 100644 index 00000000000..5201ecd87e1 --- /dev/null +++ b/Polyhedron/doc_tex/Polyhedron_ref/fig/euler_vertex.svg @@ -0,0 +1,938 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Polyhedron/include/CGAL/Polyhedron_3.h b/Polyhedron/include/CGAL/Polyhedron_3.h index 9624dc53604..66cebb400f1 100644 --- a/Polyhedron/include/CGAL/Polyhedron_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_3.h @@ -461,9 +461,7 @@ public: template < class PolyhedronTraits_3, class PolyhedronItems_3 = Polyhedron_items_3, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class T_HDS = HalfedgeDS_default, class Alloc = CGAL_ALLOCATOR(int)> class Polyhedron_3 { @@ -491,11 +489,7 @@ public: typedef PolyhedronTraits_3 Traits; typedef PolyhedronItems_3 Items; typedef I_Polyhedron_derived_items_3 Derived_items; -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM typedef T_HDS< Traits, Derived_items, Alloc> HDS; -#else - typedef typename T_HDS::template HDS< Traits, Derived_items, Alloc> HDS; -#endif typedef HDS HalfedgeDS; // portability with older CGAL release diff --git a/Polyhedron/include/CGAL/corefinement_operations.h b/Polyhedron/include/CGAL/corefinement_operations.h new file mode 100644 index 00000000000..93dc933db35 --- /dev/null +++ b/Polyhedron/include/CGAL/corefinement_operations.h @@ -0,0 +1,486 @@ +// Copyright (c) 2011 GeometryFactory (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) : Sebastien Loriot + +#ifndef CGAL_COREFINEMENT_OPERATIONS_H +#define CGAL_COREFINEMENT_OPERATIONS_H + +#include +#include + +namespace CGAL{ +/** \cond */ +namespace internal{ + +template +class Import_volume_as_polyhedron : public CGAL::Modifier_base { + typedef typename HDS::Halfedge_handle Halfedge_handle; + typedef typename HDS::Vertex_handle Vertex_handle; + typedef typename HDS::Face_handle Face_handle; + typedef typename HDS::Vertex Vertex; + typedef typename HDS::Halfedge Halfedge; + typedef typename HDS::Face Face; + + //data members + Face_handle current_face; + std::vector< typename Vertex::Point > points; + std::size_t nb_edges; + std::vector > faces; + + typename HDS::Halfedge::Base* + unlock_halfedge(Halfedge_handle h){ + return static_cast(&(*h)); + } + + typename HDS::Face::Base* + unlock_face(Face_handle f){ + return static_cast(&(*f)); + } + +public: + + //to import each piece individually + template + Import_volume_as_polyhedron(const Combinatorial_map_3& map,typename Combinatorial_map_3::Dart_const_handle dart):nb_edges(0) + { + typedef Combinatorial_map_3 CMap; + typedef std::map Vertex_map; + Vertex_map vertex_map; + unsigned int index=0; + //recover all the vertices in the current volumeiterator over all the point + //map the vertex to the index of the point in the vector + for (typename CMap::template One_dart_per_incident_cell_const_range<0,3>::const_iterator + it=map.template one_dart_per_incident_cell<0,3>(dart).begin(), + itend=map.template one_dart_per_incident_cell<0,3>(dart).end(); + it!=itend; ++it) + { + points.push_back(it->template attribute<0>()->point()); + vertex_map.insert(std::make_pair(&it->template attribute<0>()->point(),index++)); + } + + //count the number of edges + nb_edges+=map.template one_dart_per_incident_cell<1,3>(dart).size(); + + //recover one dart per face + for (typename CMap::template One_dart_per_incident_cell_const_range<2,3>::const_iterator + it=map.template one_dart_per_incident_cell<2,3>(dart).begin(), + itend=map.template one_dart_per_incident_cell<2,3>(dart).end(); + it!=itend; ++it) + { + //warning: the convention used into a polyhedron is that the normal + // of a triangle indicates the outside of the object; thus + // we need to reverse the orientation of the faces of the + // combinatorial map. + unsigned int i=vertex_map[&it->template attribute<0>()->point()]; + unsigned int j=vertex_map[&it->beta(0)->template attribute<0>()->point()]; + unsigned int k=vertex_map[&it->beta(1)->template attribute<0>()->point()]; + faces.push_back(CGAL::cpp0x::make_tuple(i,j,k)); + } + } + + //for intersection and symetric difference + template + Import_volume_as_polyhedron(const Combinatorial_map_3& map, + Iterator dart_begin, + Iterator dart_end):nb_edges(0) + { + typedef Combinatorial_map_3 CMap; + typedef std::map Vertex_map; + Vertex_map vertex_map; + unsigned int index=0; + + for (Iterator it=dart_begin;it!=dart_end;++it) + { + typename Combinatorial_map_3::Dart_const_handle dart=*it; + //recover all the vertices in the current volumeiterator over all the point + //map the vertex to the index of the point in the vector + for (typename CMap::template One_dart_per_incident_cell_const_range<0,3>::const_iterator + it=map.template one_dart_per_incident_cell<0,3>(dart).begin(), + itend=map.template one_dart_per_incident_cell<0,3>(dart).end(); + it!=itend; ++it) + { + if ( vertex_map.insert(std::make_pair(&it->template attribute<0>()->point(),index)).second ) + { + points.push_back(it->template attribute<0>()->point()); + ++index; + } + } + + //count the number of edges + nb_edges+=map.template one_dart_per_incident_cell<1,3>(dart).size(); + + //recover one dart per face + for (typename CMap::template One_dart_per_incident_cell_const_range<2,3>::const_iterator + it=map.template one_dart_per_incident_cell<2,3>(dart).begin(), + itend=map.template one_dart_per_incident_cell<2,3>(dart).end(); + it!=itend; ++it) + { + //warning: the convention used into a polyhedron is that the normal + // of a triangle indicates the outside of the object; thus + // we need to reverse the orientation of the faces of the + // combinatorial map. + unsigned int i=vertex_map[&it->template attribute<0>()->point()]; + unsigned int j=vertex_map[&it->beta(0)->template attribute<0>()->point()]; + unsigned int k=vertex_map[&it->beta(1)->template attribute<0>()->point()]; + faces.push_back(CGAL::cpp0x::make_tuple(i,j,k)); + } + } + } + + //for union : use the inverse of the complementary + template + Import_volume_as_polyhedron(const Combinatorial_map_3& map, + Iterator dart_begin, + Iterator dart_end,bool):nb_edges(0) + { + typedef Combinatorial_map_3 CMap; + typedef std::map Vertex_map; + Vertex_map vertex_map; + unsigned int index=0; + + for (Iterator it=dart_begin;it!=dart_end;++it) + { + typename Combinatorial_map_3::Dart_const_handle dart=*it; + //recover all the vertices in the current volumeiterator over all the point + //map the vertex to the index of the point in the vector + for (typename CMap::template One_dart_per_incident_cell_const_range<0,3>::const_iterator + it=map.template one_dart_per_incident_cell<0,3>(dart).begin(), + itend=map.template one_dart_per_incident_cell<0,3>(dart).end(); + it!=itend; ++it) + { + if (vertex_map.insert(std::make_pair(&it->template attribute<0>()->point(),index)).second ) + { + points.push_back(it->template attribute<0>()->point()); + ++index; + } + } + + //count the number of edges + nb_edges+=map.template one_dart_per_incident_cell<1,3>(dart).size(); + + //recover one dart per face + for (typename CMap::template One_dart_per_incident_cell_const_range<2,3>::const_iterator + it=map.template one_dart_per_incident_cell<2,3>(dart).begin(), + itend=map.template one_dart_per_incident_cell<2,3>(dart).end(); + it!=itend; ++it) + { + //warning: the convention used into a polyhedron is that the normal + // of a triangle indicates the outside of the object; thus + // we need to reverse the orientation of the faces of the + // combinatorial map. Since to get the complementary we + // also need to reverse the orientation, we finally do + // not change it. + unsigned int i=vertex_map[&it->template attribute<0>()->point()]; + unsigned int j=vertex_map[&it->beta(1)->template attribute<0>()->point()]; + unsigned int k=vertex_map[&it->beta(0)->template attribute<0>()->point()]; + faces.push_back(CGAL::cpp0x::make_tuple(i,j,k)); + } + } + } + + + void operator()( HDS& hds) + { + CGAL::Polyhedron_incremental_builder_3 B(hds, true); + B.begin_surface( points.size(), faces.size(),2*nb_edges); + + //insert vertices + for (typename std::vector::iterator it=points.begin();it!=points.end();++it) + B.add_vertex(*it); + + //create faces + for (std::vector >::iterator it=faces.begin();it!=faces.end();++it) + { + B.begin_facet(); + B.add_vertex_to_facet(CGAL::cpp0x::get<0>(*it)); + B.add_vertex_to_facet(CGAL::cpp0x::get<1>(*it)); + B.add_vertex_to_facet(CGAL::cpp0x::get<2>(*it)); + B.end_facet(); + } + B.end_surface(); + } +}; + +} +/** \endcond */ + +/*! \class Polyhedron_corefinement corefinement_operations.h CGAL/corefinement_operations.h + * Function object to compute the decomposition of the space induced by two polyhedra. + * @tparam Polyhedron must be an instantiation of CGAL::Polyhedron_3. + * @tparam Kernel must be a CGAL Kernel compatible with the underlying kernel of Polyhedron. + */ +template +class Polyhedron_corefinement +{ + typedef internal::Import_volume_as_polyhedron Volume_import_modifier; + +public: + /** Enumeration of the different feature tags, listing all kind of space decomposition the functor can compute given two input polyhedra P and Q.*/ + enum Boolean_operation_tag + { + Join_tag=1, /*!< the union of P and Q. */ + Intersection_tag=2, /*!< the intersection of P and Q. */ + P_minus_Q_tag=4, /*!< P minus Q. */ + Q_minus_P_tag=8, /*!< Q minus P. */ + Parts_of_P_tag=32, /*!< decomposition of the volume bounded by P induced by Q. */ + Parts_of_Q_tag=64, /*!< decomposition of the volume bounded by Q induced by P. */ + Decomposition_tag=16 /*!< Both decompositions of P and Q. */ + }; + + /** + * This computes different polyhedra according to the value of features. + * Each input polyhedron is expected to bound a volume: the volume is bounded by the surface polyhedron with facet + * normals pointing outside the volume. Each facet is supposed to be counterclockwise oriented, that is its vertex + * sequence (induced by halfedges) is seen counterclockwise from the side of the facet pointed by its normal. If one or + * both polyhedra are not closed, the algorithm will end up correctly if each intersection polyline separates each surface + * in two components. In that case for each triangle of each surface path boundary, the interior of the volume is considered + * to be on the side opposite of that pointed by it normals (but the orientation must be consistent on each patch). + * the surface the volume bounded by an open surface is considered to be an infinite volume above + * or below the surface (the side not pointed by normal vectors). + * @tparam Polyline_output_iterator must be an output iterator of std::vector. + * @tparam Polyhedron_ptr_and_type_output_iterator an output iterator of std::pair. + * @param P is the first input triangulated polyhedron. Note that a reference is taken and P will be updated to contain the 1D intersection between the two surfaces P and Q. + * @param Q is the first input triangulated polyhedron. Note that a reference is taken and Q will be updated to contain the 1D intersection between the two surfaces P and Q. + * @param polyline_output is an output iterator that collects intersection polylines between P and Q. + * @param poly_output is an output iterator that collects output polyhedra. Note that each polyhedron is allocated within this function (thus must be explicitly deleted when no longer used). The integer is a feature tag corresponding to the volume represented by the polyhedron of the pair. + * @param features is an integer indicating what polyhedra the function must compute. If several kind of polyhedra are expected, feature tags must be combined by |. For example if features = Polyhedron_corefinement::Join_tag | Polyhedron_corefinement::Intersection_tag, then poly_output will collect two polyhedra, the union and the intersection of P and Q. + */ + template + void operator()( Polyhedron& P, Polyhedron& Q, + Polyline_output_iterator polyline_output, + Polyhedron_ptr_and_type_output_iterator poly_output, + int features) const + { + typedef CGAL::Node_visitor_refine_polyhedra Split_visitor; + Split_visitor visitor; + CGAL::Intersection_of_Polyhedra_3 polyline_intersections(visitor); + + polyline_intersections(P, Q, polyline_output); + + typedef typename Split_visitor::Combinatorial_map_3 Combinatorial_map_3; + typedef typename Split_visitor::Volume_info Volume_info; + typedef typename Combinatorial_map_3::Dart_const_handle Dart_const_handle; + + const typename Split_visitor::Combinatorial_map_3& final_map=visitor.combinatorial_map(); + + typename Combinatorial_map_3::template One_dart_per_cell_const_range<3> cell_range=final_map.template one_dart_per_cell<3>(); + + std::list intersection; + std::list union_; + std::list P_minus_Q; + std::list Q_minus_P; + + for (typename Combinatorial_map_3::template One_dart_per_cell_const_range<3>::const_iterator + it = cell_range.begin(), it_end= cell_range.end(); + it!= it_end; + ++it ) + { + + const Volume_info& info=it->template attribute<3>()->info(); + std::size_t inside_size=info.inside.size(); + std::size_t outside_size=info.outside.size(); + + if ( inside_size + outside_size != 2){ + std::cerr << "Error: One volume cannot be represented using a polyhedron. Aborted.\n"; + break; + } + + switch (outside_size) + { + case 2: + if (features & Join_tag) union_.push_back(it); + break; + case 0: + if (features & Intersection_tag) intersection.push_back(it); + break; + default: + if ( *info.inside.begin() == &P ) + { if (features & P_minus_Q_tag) P_minus_Q.push_back(it); } + else + { if (features & Q_minus_P_tag) Q_minus_P.push_back(it); } + } + + if ( features&Decomposition_tag ) + { + Volume_import_modifier modifier(final_map,it); + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + *poly_output++ = std::make_pair( new_poly,static_cast(Decomposition_tag) ); + } + + if ( features&Parts_of_P_tag && info.inside.find(&P)!=info.inside.end() ) + { + Volume_import_modifier modifier(final_map,it); + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + *poly_output++ = std::make_pair( new_poly,static_cast(Parts_of_P_tag) ); + } + + if ( features&Parts_of_Q_tag && info.inside.find(&Q)!=info.inside.end() ) + { + Volume_import_modifier modifier(final_map,it); + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + *poly_output++ = std::make_pair( new_poly,static_cast(Parts_of_Q_tag) ); + } + } + + if (!intersection.empty()) + { + Volume_import_modifier modifier(final_map,intersection.begin(),intersection.end()); + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + *poly_output++=std::make_pair( new_poly,static_cast(Intersection_tag) ); + } + + if (!P_minus_Q.empty()) + { + Volume_import_modifier modifier(final_map,P_minus_Q.begin(),P_minus_Q.end()); + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + *poly_output++=std::make_pair( new_poly,static_cast(P_minus_Q_tag) ); + } + + if (!Q_minus_P.empty()) + { + Volume_import_modifier modifier(final_map,Q_minus_P.begin(),Q_minus_P.end()); + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + *poly_output++=std::make_pair( new_poly,static_cast(Q_minus_P_tag) ); + } + + if (!union_.empty()) + { + Volume_import_modifier modifier(final_map,union_.begin(),union_.end(),true); + Polyhedron* new_poly=new Polyhedron(); + new_poly->delegate(modifier); + *poly_output++=std::make_pair( new_poly,static_cast(Join_tag) ); + } + } + /** + * This updates P according to the value of features. + * Each input polyhedron is expected to bound a volume: the volume is bounded by the surface polyhedron with facet + * normals pointing outside the volume. Each facet is supposed to be counterclockwise oriented, that is its vertex + * sequence (induced by halfedges) is seen counterclockwise from the side of the facet pointed by its normal. If one or + * both polyhedra are not closed, the algorithm will end up correctly if each intersection polyline separates each surface + * in two components. In that case for each triangle of each surface path boundary, the interior of the volume is considered + * to be on the side opposite of that pointed by it normals (but the orientation must be consistent on each patch). + * the surface the volume bounded by an open surface is considered to be an infinite volume above + * or below the surface (the side not pointed by normal vectors). + * @tparam Polyline_output_iterator must be an output iterator of std::vector. + * @param P is the first input triangulated polyhedron. Note that a reference is taken and P will be updated to contain the 1D intersection between the two surfaces P and Q. + * @param Q is the first input triangulated polyhedron. Note that a reference is taken and Q will be updated to contain the 1D intersection between the two surfaces P and Q. + * @param polyline_output is an output iterator that collects intersection polylines between P and Q. + * @param features is either Join_tag, Intersection_tag, P_minus_Q_tag or Q_minus_P_tag + */ + template + void operator()( Polyhedron& P, Polyhedron& Q, + Polyline_output_iterator polyline_output, + Boolean_operation_tag features) const + { + typedef CGAL::Node_visitor_refine_polyhedra Split_visitor; + Split_visitor visitor; + CGAL::Intersection_of_Polyhedra_3 polyline_intersections(visitor); + + polyline_intersections(P, Q, polyline_output); + + typedef typename Split_visitor::Combinatorial_map_3 Combinatorial_map_3; + typedef typename Split_visitor::Volume_info Volume_info; + typedef typename Combinatorial_map_3::Dart_const_handle Dart_const_handle; + + const typename Split_visitor::Combinatorial_map_3& final_map=visitor.combinatorial_map(); + + typename Combinatorial_map_3::template One_dart_per_cell_const_range<3> cell_range=final_map.template one_dart_per_cell<3>(); + + std::list darts; + + for (typename Combinatorial_map_3::template One_dart_per_cell_const_range<3>::const_iterator + it = cell_range.begin(), it_end= cell_range.end(); + it!= it_end; + ++it ) + { + + const Volume_info& info=it->template attribute<3>()->info(); + std::size_t inside_size=info.inside.size(); + std::size_t outside_size=info.outside.size(); + + if ( inside_size + outside_size != 2){ + std::cerr << "Error: One volume cannot be represented using a polyhedron. Aborted.\n"; + break; + } + + switch (outside_size) + { + case 2: + if ( features==Join_tag ) darts.push_back(it); + break; + case 0: + if ( features==Intersection_tag ) darts.push_back(it); + break; + default: + if ( *info.inside.begin() == &P ) + { if (features == P_minus_Q_tag) darts.push_back(it); } + else + { if (features == Q_minus_P_tag) darts.push_back(it); } + } + } + + P.clear(); + + if (!darts.empty()) + { + Volume_import_modifier modifier= + features==Join_tag? + Volume_import_modifier(final_map,darts.begin(),darts.end(),true) + : Volume_import_modifier(final_map,darts.begin(),darts.end()); + P.delegate(modifier); + } + } + + /** \cond */ + static std::string get_type_str(const std::string& Pname,const std::string& Qname,int i) + { + switch (i) + { + case Join_tag: + return Pname+std::string("_union_")+Qname; + case P_minus_Q_tag: + return Pname+std::string("_minus_")+Qname; + case Q_minus_P_tag: + return Qname+std::string("_minus_")+Pname; + case Intersection_tag: + return Pname+std::string("_inter_")+Qname; + case Decomposition_tag: + return std::string("Decomposition"); + } + return std::string("Unknow"); + } + /** \endcond */ +}; + + + + +} + +#endif // CGAL_COREFINEMENT_OPERATIONS_H diff --git a/Polyhedron/include/CGAL/internal/corefinement/Combinatorial_map_for_corefinement.h b/Polyhedron/include/CGAL/internal/corefinement/Combinatorial_map_for_corefinement.h new file mode 100644 index 00000000000..f5127b22015 --- /dev/null +++ b/Polyhedron/include/CGAL/internal/corefinement/Combinatorial_map_for_corefinement.h @@ -0,0 +1,111 @@ +// 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. +// +// $UR$ +// $Id$ +// +// +// Author(s) : Sebastien Loriot + +#ifndef CGAL_INTERNAL_COMBINATORIAL_MAP_FOR_COREFINEMENT_H +#define CGAL_INTERNAL_COMBINATORIAL_MAP_FOR_COREFINEMENT_H + +#include +#include +#include +#include + +namespace CGAL{ + namespace internal_IOP{ + +template +struct Volume_info{ + std::set outside; + std::set inside; + bool is_empty; + Volume_info():is_empty(false){} +}; + +struct Volume_on_merge +{ + template + void operator() (Attribute& a1,const Attribute& a2) const + { + CGAL_assertion(!a1.info().is_empty && !a2.info().is_empty); + std::copy(a2.info().outside.begin(),a2.info().outside.end(),std::inserter(a1.info().outside,a1.info().outside.begin())); + std::copy(a2.info().inside.begin(),a2.info().inside.end(),std::inserter(a1.info().inside,a1.info().inside.begin())); + } +}; + +#ifndef NDEBUG +struct Point_on_merge +{ + template + void operator() (Attribute& a1,const Attribute& a2) const + { + CGAL_assertion(a1.point()==a2.point() ); + } +}; +#endif + + +template < class Refs, class T, class Point_, + class Functor_on_merge_=CGAL::Null_functor, + class Functor_on_split_=CGAL::Null_functor > +class My_cell_attribute_with_point : + public CGAL::Cell_attribute_without_info +{ + Point_ mpoint; +public: + typedef Point_ Point; + typedef Functor_on_merge_ Functor_on_merge; + typedef Functor_on_split_ Functor_on_split; + + My_cell_attribute_with_point(){} + My_cell_attribute_with_point(const Point& apoint) : mpoint(apoint) {} + Point& point() { return mpoint; } + const Point& point() const { return mpoint; } + +}; + +template +class Item_with_points_and_volume_info +{ +public: + public: + static const unsigned int dimension = 3; + static const unsigned int NB_MARKS = 32; + template + struct Dart_wrapper + { + typedef CGAL::Dart<3, Refs > Dart; + typedef Traits_ Traits; + typedef typename Traits::FT FT; + typedef typename Traits::Point_3 Point; + typedef typename Traits::Vector_3 Vector; + #ifndef NDEBUG + typedef My_cell_attribute_with_point< Refs,CGAL::Tag_true,Point,Point_on_merge> Vertex_attribute; + #else + typedef My_cell_attribute_with_point< Refs,CGAL::Tag_true,Point> Vertex_attribute; + #endif + typedef CGAL::Cell_attribute< Refs,Volume_info,CGAL::Tag_true,Volume_on_merge > Volume_attribute; + typedef CGAL::cpp0x::tuple< Vertex_attribute, + void, + void, + Volume_attribute> Attributes; + }; +}; + +} } //namespace CGAL::internal_IOP + +#endif //CGAL_INTERNAL_COMBINATORIAL_MAP_FOR_COREFINEMENT_H diff --git a/Polyhedron/include/CGAL/internal/corefinement/Polyhedron_constness_types.h b/Polyhedron/include/CGAL/internal/corefinement/Polyhedron_constness_types.h new file mode 100644 index 00000000000..278b3bf556b --- /dev/null +++ b/Polyhedron/include/CGAL/internal/corefinement/Polyhedron_constness_types.h @@ -0,0 +1,58 @@ +// Copyright (c) 2011 GeometryFactory (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) : Sebastien Loriot + +#ifndef CGAL_INTERNAL_POLYHEDRON_CONSTNESS_TYPES_H +#define CGAL_INTERNAL_POLYHEDRON_CONSTNESS_TYPES_H + +namespace CGAL { +namespace internal_IOP{ + +template +struct Polyhedron_types; + +template +struct Polyhedron_types{ + typedef Polyhedron& Polyhedron_ref; + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Halfedge_iterator Halfedge_iterator; + typedef typename Polyhedron::Facet_iterator Facet_iterator; + typedef typename Polyhedron::Facet_handle Facet_handle; + typedef typename Polyhedron::Vertex_handle Vertex_handle; + typedef typename Polyhedron::Vertex Vertex; + typedef typename Polyhedron::Halfedge Halfedge; + typedef typename Polyhedron::Facet Facet; +}; + +template +struct Polyhedron_types{ + typedef const Polyhedron& Polyhedron_ref; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; + typedef typename Polyhedron::Halfedge_const_iterator Halfedge_iterator; + typedef typename Polyhedron::Facet_const_iterator Facet_iterator; + typedef typename Polyhedron::Facet_const_handle Facet_handle; + typedef typename Polyhedron::Vertex_const_handle Vertex_handle; + typedef const typename Polyhedron::Vertex Vertex; + typedef const typename Polyhedron::Halfedge Halfedge; + typedef const typename Polyhedron::Facet Facet; +}; + +} } //namespace CGAL::internal_IOP + +#endif //CGAL_INTERNAL_POLYHEDRON_CONSTNESS_TYPES_H diff --git a/Polyhedron/include/CGAL/internal/corefinement/Polyhedron_subset_extraction.h b/Polyhedron/include/CGAL/internal/corefinement/Polyhedron_subset_extraction.h new file mode 100644 index 00000000000..eb7d4e1c33f --- /dev/null +++ b/Polyhedron/include/CGAL/internal/corefinement/Polyhedron_subset_extraction.h @@ -0,0 +1,201 @@ +// Copyright (c) 2011 GeometryFactory (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) : Sebastien Loriot + +#ifndef CGAL_INTERNAL_POLYHEDRON_SUBSET_EXTRACTION_H +#define CGAL_INTERNAL_POLYHEDRON_SUBSET_EXTRACTION_H + +#include +#include +#include +#include + +namespace CGAL { + namespace internal{ + +template +struct Compare_handle_ptr{ + typedef typename Polyhedron::Facet_const_handle Facet_const_handle; + typedef typename Polyhedron::Vertex_const_handle Vertex_const_handle; + + bool operator()(Facet_const_handle f1,Facet_const_handle f2) const { + return &(*f1) < &(*f2); + } + + bool operator()(Vertex_const_handle v1,Vertex_const_handle v2) const { + return &(*v1) < &(*v2); + } +}; + +struct Dummy_true{ + template + bool operator()(T) const {return true;} +}; + +template +class Build_polyhedron_subset : public ::CGAL::Modifier_base { + typedef typename Polyhedron::Facet_const_handle Facet_const_handle; + typedef typename Polyhedron::Vertex_const_handle Vertex_const_handle; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; + + typedef typename HDS::Vertex::Point Point; + std::list points; + std::list< std::vector > facets; + + template + typename Polyhedron::Halfedge_const_handle get_facet_halfedge(Facet_iterator facet_it) const + { + return (*facet_it)->halfedge(); + } + + typename Polyhedron::Halfedge_const_handle get_facet_halfedge(typename Polyhedron::Facet_const_handle facet) const + { + return facet->halfedge(); + } + +public: + template + Build_polyhedron_subset(const Polyhedron&,Facets_const_iterator begin,Facets_const_iterator end) + { + typedef std::map > Vertices; + Vertices vertices; + unsigned int index=0; + //get vertices and get face description relatively to the restricted set of vertices + for (Facets_const_iterator it=begin;it!=end;++it) + { + Halfedge_const_handle start=get_facet_halfedge(it); + Halfedge_const_handle curr=start; + facets.push_back(std::vector()); + std::vector& indices = facets.back(); + do{ + bool is_new_vertex; + typename Vertices::iterator it_vertex; + ::CGAL::cpp0x::tie(it_vertex,is_new_vertex)=vertices.insert(std::make_pair(curr->vertex(),index)); + if (is_new_vertex) { + ++index; + points.push_back(curr->vertex()); + } + indices.push_back(it_vertex->second); + curr=curr->next(); + }while(curr!=start); + } + } + + void operator()( HDS& hds) { + ::CGAL::Polyhedron_incremental_builder_3 B( hds, true); + B.begin_surface( points.size(), facets.size() ); + for (typename std::list::iterator it=points.begin();it!=points.end();++it) + B.add_vertex((*it)->point()); + for (typename std::list< std::vector >::iterator + it=facets.begin();it!=facets.end();++it) + { + B.begin_facet(); + for (std::vector::iterator it_i=it->begin();it_i!=it->end();++it_i) + B.add_vertex_to_facet(*it_i); + B.end_facet(); + } + B.end_surface(); + } +}; + + + +template +void extract_connected_components( + const Polyhedron& P, + const Adjacency_criterium& adjacent, + CGAL::Union_find& uf, + Face_to_UF_handle_map& map_f2h, + Result& result + ) +{ + typedef typename Polyhedron::Facet_const_handle Facet_const_handle; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; + typedef ::CGAL::Union_find UF; + typedef typename UF::handle UF_handle; + typedef typename UF::iterator UF_iterator; + + CGAL_precondition(P.is_pure_triangle()); + +//init union-find: each facet is in its own set + for (typename Polyhedron::Facet_const_iterator it=P.facets_begin();it!=P.facets_end();++it){ + map_f2h.insert(std::make_pair(it,uf.make_set(it))); + } +//merge 2 facets if they share a common edge + for (typename Polyhedron::Facet_const_iterator it=P.facets_begin();it!=P.facets_end();++it){ + Facet_const_handle facet=it; + + UF_handle current=map_f2h.find(it)->second; + Halfedge_const_handle neighbors[3]; + neighbors[0]=facet->halfedge()->opposite(); + neighbors[1]=facet->halfedge()->next()->opposite(); + neighbors[2]=facet->halfedge()->next()->next()->opposite(); + + for (int i=0;i!=3;++i){ + if ( neighbors[i]->is_border_edge() ) continue; + UF_handle neigh=map_f2h.find(neighbors[i]->facet())->second; + if ( adjacent(neighbors[i]) && !uf.same_set(current,neigh) ){ + uf.unify_sets(current,neigh); + } + } + } + +//recover merged sets + for (UF_iterator it=uf.begin();it!=uf.end();++it){ + UF_handle master=uf.find(it); + result[*master].push_back(*it); + } +} + +template +void extract_connected_components(const Polyhedron& P,const Adjacency_criterium& adjacent,Output_iterator out) +{ + typedef typename Polyhedron::Facet_const_handle Facet_const_handle; + typedef ::CGAL::Union_find UF; + typedef typename UF::handle UF_handle; + typedef typename UF::iterator UF_iterator; + typedef std::map,Compare_handle_ptr > Result; + typedef std::map > Facet_to_handle_map; + + UF uf; + Facet_to_handle_map map_f2h; + Result result; + + extract_connected_components(P,adjacent,uf,map_f2h,result); + + for (typename Result::iterator it=result.begin();it!=result.end();++it) + { + typedef std::list Facets; + const Facets& facets=it->second; + Polyhedron new_poly; + Build_polyhedron_subset modifier(new_poly,facets.begin(),facets.end()); + new_poly.delegate(modifier); + *out++=new_poly; + } +} + +template +void extract_connected_components(const Polyhedron& P,Output_iterator out) +{ + extract_connected_components(P,Dummy_true(),out); +} + +} } //namespace CGAL::internal + +#endif //CGAL_INTERNAL_POLYHEDRON_SUBSET_EXTRACTION_H diff --git a/Polyhedron/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h b/Polyhedron/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h new file mode 100644 index 00000000000..596c09879c0 --- /dev/null +++ b/Polyhedron/include/CGAL/internal/corefinement/intersection_coplanar_triangles_3.h @@ -0,0 +1,328 @@ +// Copyright (c) 2011 GeometryFactory (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) : Sebastien Loriot + +#ifndef CGAL_INTERNAL_INTERSECTION_COPLANAR_TRIANGLES_3_H +#define CGAL_INTERNAL_INTERSECTION_COPLANAR_TRIANGLES_3_H + +#include //for Intersection_type +#include +#include +#include + +//TODO rename this file when doing proper integration +namespace CGAL{ +namespace internal_IOP{ + + +//intersection point of two coplanar triangles that keeps track of +//the location of that point onto the triangles. +template +struct Intersection_point_with_info +{ + typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; + typedef IK Input_kernel; + typedef CGAL::Cartesian_converter Converter; + + Intersection_type type_1,type_2; //intersection type for 1st and 2nd facets + Halfedge_handle info_1,info_2; //halfedge providing primitive indicated by type_1 and type_2 + typename Exact_kernel::Point_3 point; //the geometric embedding of the intersection + + //constructor from a vertex of first triangle initialized inside the second triangle + Intersection_point_with_info(Halfedge_handle info1,Halfedge_handle info2): + type_1(VERTEX),type_2(FACET),info_1(info1),info_2(info2) + { + Converter converter; + point=converter(info_1->vertex()->point()); + } + + //constructor for intersection of edges. prev and curr are two points on an edge of the first facet (preserving the + //orientation of the facet). This edge is intersected by info2 from the second facet. + // + //The rational is the following: we first check whether curr and prev are on the same edge. I so we create + //an intersection point between two edges. Otherwise, the point is a vertex of the second facet included into + //the first facet. + // + //(V,F) : point initialy constructed + //(V,E) : (V,F) updated by get_orientation_and_update_info_2 (i.e lies on one edge) + //(V,V) : (V,E) updated by get_orientation_and_update_info_2 (i.e lies on two edges) + //(E,E) : created in the following function when prev and curr lie on the same edge + //(E,V) : (E,E) updated by get_orientation_and_update_info_2 (always done as lies on two edges) + //(E,F) : impossible + //(F,V) : detected when curr and prev and not on the same edge + //(F,E) : impossible + //(F,F) : impossible + // + Intersection_point_with_info(Intersection_point_with_info prev,Intersection_point_with_info curr, + Halfedge_handle info1,Halfedge_handle info2): + type_2(EDGE),info_2(info2) + { + #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + std::cout << "prev: "; prev.print_debug(); + std::cout << "curr: "; curr.print_debug(); std::cout << std::endl; + #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + Converter converter; + if (prev.type_1==VERTEX && prev.info_1->next() == curr.info_1){ + CGAL_assertion(curr.type_1!=FACET); + type_1=EDGE; + info_1=curr.info_1; + } + else{ + if(curr.type_1==VERTEX && prev.info_1 == curr.info_1){ + CGAL_assertion(prev.type_1!=FACET); + type_1=EDGE; + info_1=curr.info_1; + } + else{ + if (curr.type_1==EDGE && prev.type_1==EDGE && curr.info_1==prev.info_1){ + type_1=EDGE; + info_1=curr.info_1; + } + else{ + //curr and prev are not on the same edge of the first facet. + //The intersection point to be computed is a VERTEX of the second facet + type_1=FACET; + info_1=info1; + type_2=VERTEX; + + //this is used to select the correct endpoint of the edge of the second facet + typename Exact_kernel::Collinear_3 is_collinear = Exact_kernel().collinear_3_object(); + if ( !is_collinear(prev.point,curr.point,converter(info_2->vertex()->point()) ) ){ + info_2=info_2->next()->next(); + CGAL_assertion( is_collinear(prev.point,curr.point,converter(info_2->vertex()->point()) ) ); + } + point = converter( info_2->vertex()->point() ); + return; + } + } + } + + //handle degenerate case when two edges overlap + //at least one of the two vertex has already been found as a vertex of a facet. Here we set it for the second point + if(prev.type_2!=FACET && curr.type_2!=FACET && (prev.type_1==VERTEX || prev.type_2==VERTEX) && (curr.type_1==VERTEX || curr.type_2==VERTEX)){ + typename Exact_kernel::Collinear_3 is_collinear = Exact_kernel().collinear_3_object(); + if ( is_collinear(prev.point,curr.point,converter(info_2->opposite()->vertex()->point()) ) ){ + info_2=info_2->next()->next(); + type_2=VERTEX; + point = converter( info_2->vertex()->point() ); + return; + } + if ( is_collinear(prev.point,curr.point,converter(info_2->vertex()->point()) ) ){ + type_2=VERTEX; + point = converter( info_2->vertex()->point() ); + return; + } + } + + //handle regular intersection of two edges + typename Exact_kernel::Construct_line_3 line_3=Exact_kernel().construct_line_3_object(); + typename Exact_kernel::Line_3 l1= + line_3(converter(info_2->vertex()->point()),converter(info_2->opposite()->vertex()->point())); + typename Exact_kernel::Line_3 l2=line_3(prev.point,curr.point); + CGAL::Object res=Exact_kernel().intersect_3_object()(l1,l2); + const typename Exact_kernel::Point_3* ptptr=CGAL::object_cast(&res); + CGAL_assertion(ptptr!=NULL); + point=*ptptr; + } + + void print_debug() const{ + std::cout << " ("; + if (type_1==VERTEX) std::cout << "V"; + if (type_1==EDGE) std::cout << "E"; + if (type_1==FACET) std::cout << "F"; + if (type_1==EMPTY) std::cout << "?"; + std::cout << "-" << &(*info_1); + std::cout << ";"; + if (type_2==VERTEX) std::cout << "V"; + if (type_2==EDGE) std::cout << "E"; + if (type_2==FACET) std::cout << "F"; + if (type_2==EMPTY) std::cout << "?"; + std::cout << ")" << "[" << CGAL::to_double(point.x()) << "," << CGAL::to_double(point.y()) << "," << CGAL::to_double(point.z()) << "]"; + } + + int debug_unique_type_int() const{ + int res=0; + switch (type_1){ + case VERTEX: res+=1; break; + case EDGE: res+=3; break; + case FACET: res+=7; break; + default: break; + } + switch (type_2){ + case VERTEX: res+=1; break; + case EDGE: res+=3; break; + case FACET: res+=7; break; + default: break; + } + return res; + } + + bool is_valid(Intersection_type type,Halfedge_handle info){ + bool valid=true; + Converter converter; + switch (type){ + case VERTEX: valid&= converter(info->vertex()->point())==point; break; + case EDGE:{ + typename Exact_kernel::Segment_3 seg= + Exact_kernel().construct_segment_3_object()( converter(info->vertex()->point()), + converter(info->opposite()->vertex()->point()) ); + valid&= Exact_kernel().has_on_3_object()(seg,point); + } + break; + case FACET:{ + typename Exact_kernel::Coplanar_orientation_3 orient=Exact_kernel().coplanar_orientation_3_object(); + typename Exact_kernel::Point_3 p=converter(info->vertex()->point()); + typename Exact_kernel::Point_3 q=converter(info->next()->vertex()->point()); + typename Exact_kernel::Point_3 r=converter(info->opposite()->vertex()->point()); + valid &= orient(p,q,r,point)==POSITIVE; + valid &= orient(q,r,p,point)==POSITIVE; + valid &= orient(r,p,q,point)==POSITIVE; + } + break; + default: valid=false; + } + return valid; + } + + bool is_valid(){ + return is_valid(type_1,info_1) && is_valid(type_2,info_2); + } + +}; + +template +CGAL::Orientation get_orientation_and_update_info_2(Halfedge_handle h,Inter_pt& p) +{ + typename Inter_pt::Exact_kernel::Coplanar_orientation_3 orient= + typename Inter_pt::Exact_kernel().coplanar_orientation_3_object(); + typename Inter_pt::Converter converter; + + CGAL::Orientation res = orient(converter(h->opposite()->vertex()->point()), + converter(h->vertex()->point()), + converter(h->next()->vertex()->point()), + p.point); + + if ( (p.type_1==VERTEX || p.type_1==EDGE) && res==COLLINEAR){ + if (p.type_2==FACET){ //detect a case (VERTEX,EDGE) + p.type_2=EDGE; + p.info_2=h; + } + else{ + //detect a case (VERTEX,VERTEX) or (EDGE,VERTEX) + CGAL_assertion(p.type_2==EDGE); + p.type_2=VERTEX; + if (p.info_2->next()!=h){ + CGAL_assertion(h->next()==p.info_2); + p.info_2=h; + } + } + } + + return res; +} + +template +void intersection_coplanar_facets_cutoff(Facet_handle f,std::list& inter_pts,Facet_handle other) +{ + #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + std::cout << "cutoff: " << f->opposite()->vertex()->point() << " " << f->vertex()->point() << std::endl; + #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + if ( inter_pts.empty() ) return; + typedef typename std::list::iterator Iterator; + + std::map orientations; + for (Iterator it=inter_pts.begin();it!=inter_pts.end();++it){ + #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + it->print_debug(); + #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + orientations[ &(*it) ]=get_orientation_and_update_info_2(f,*it); + } + #ifdef CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + std::cout << std::endl; + #endif //CGAL_DEBUG_COPLANAR_TRIANGLE_INTERSECTION + + int pt_added=0; + + Inter_pt* prev = &(*boost::prior(inter_pts.end())); + bool inter_pts_size_g_2 = inter_pts.size() > 2; + Iterator stop = inter_pts_size_g_2 ? inter_pts.end() : boost::prior(inter_pts.end()); + for (Iterator it=inter_pts.begin();it!=stop;++it) + { + Inter_pt* curr=&(*it); + if (!inter_pts_size_g_2) std::swap(prev,curr); + Orientation or_prev=orientations[prev],or_curr=orientations[curr]; + if ( (or_prev==POSITIVE && or_curr==NEGATIVE) || (or_prev==NEGATIVE && or_curr==POSITIVE) ) + { + Iterator it_curr = inter_pts_size_g_2 ? it:boost::next(it); + prev=&(* inter_pts.insert( it_curr,Inter_pt(*prev,*curr,other,f) ) ); + orientations[prev]=COLLINEAR; + ++pt_added; + } + prev=&(*it); + } + + CGAL_kernel_assertion(pt_added<3); + Iterator it=inter_pts.begin(); + std::size_t nb_interpt=inter_pts.size(); + //this boolean allows to reverse order of intersection points in case there were 3 remaining intersection points + //and the point in the middle was removed. In that case the order must be reversed to preserve the orientations + //of the last edge: + // A---X---B --> AB to be consistent with the other cases this should be BA! + // X---B---A --> BA + // B---A---X --> BA + // + bool should_revert_list=false; + + while(it!=inter_pts.end()) + { + if (orientations[&(*it)]==NEGATIVE){ + inter_pts.erase(it++); + if (--nb_interpt == 2 && it!=inter_pts.end() && boost::next(it)==inter_pts.end()) should_revert_list=true; + } + else + ++it; + } + if (should_revert_list && nb_interpt==2) inter_pts.reverse(); +} + +template +void +intersection_coplanar_facets( + Halfedge_handle f1, + Halfedge_handle f2, + std::list >& output ) +{ + typedef Intersection_point_with_info Inter_pt; + output.push_back( Inter_pt(f1,f2) ); + output.push_back( Inter_pt(f1->next(),f2) ); + output.push_back( Inter_pt(f1->next()->next(),f2) ); + + //intersect f2 with the three half planes which intersection defines f1 + intersection_coplanar_facets_cutoff(f2,output,f1); + intersection_coplanar_facets_cutoff(f2->next(),output,f1); + intersection_coplanar_facets_cutoff(f2->next()->next(),output,f1); +} + + + +} } //namespace CGAL::internal_IOP + + +#endif //CGAL_INTERNAL_INTERSECTION_COPLANAR_TRIANGLES_3_H + diff --git a/Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h b/Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h new file mode 100644 index 00000000000..80d7675e140 --- /dev/null +++ b/Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3.h @@ -0,0 +1,167 @@ +// Copyright (c) 2011 GeometryFactory (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) : Sebastien Loriot + +#ifndef CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_H +#define CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_H + +//TODO rename this file when doing proper integration +#include +#include +namespace CGAL{ +namespace internal_IOP{ + +enum Intersection_type {FACET,EDGE,VERTEX,EMPTY,COPLNR}; + + +//define shortcut for intersection result types +template +struct Intersection_types{ + typedef typename Polyhedron_types::Halfedge_handle Intersection_info; + typedef cpp0x::tuple Intersection_result; +}; + + +template +typename Intersection_types::Intersection_result +find_intersection(const typename Kernel::Point_3& p, const typename Kernel::Point_3& q, + const typename Kernel::Point_3& a, const typename Kernel::Point_3& b, const typename Kernel::Point_3& c, + typename Polyhedron_types::Halfedge_handle /*hh*/, + typename Polyhedron_types::Facet_handle fh, + bool is_vertex_coplanar=false,bool is_vertex_opposite_coplanar=false) +{ + typedef typename Intersection_types::Intersection_info Intersection_info; + typedef typename Intersection_types::Intersection_result Intersection_result; + + Orientation ab=orientation(p,q,a,b); + Orientation bc=orientation(p,q,b,c); + Orientation ca=orientation(p,q,c,a); + + if ( ab==POSITIVE || bc==POSITIVE || ca==POSITIVE ) + return Intersection_result(EMPTY,Intersection_info(),false,false); + + int nb_coplanar=(ab==COPLANAR?1:0) + (bc==COPLANAR?1:0) + (ca==COPLANAR?1:0); + + if ( nb_coplanar==0 ) + return cpp0x::make_tuple(FACET,Intersection_info(fh->halfedge()),is_vertex_coplanar,is_vertex_opposite_coplanar); + + if (nb_coplanar==1){ + if (ab==COPLANAR) + return cpp0x::make_tuple(EDGE,Intersection_info(fh->halfedge()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); + if (bc==COPLANAR) + return cpp0x::make_tuple(EDGE,Intersection_info(fh->halfedge()->next()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); + CGAL_assertion(ca==COPLANAR); + return cpp0x::make_tuple(EDGE,Intersection_info(fh->halfedge()),is_vertex_coplanar,is_vertex_opposite_coplanar); + } + + CGAL_assertion(nb_coplanar==2); + + if (ab!=COPLANAR) + return cpp0x::make_tuple(VERTEX,Intersection_info(fh->halfedge()->next()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); + if (bc!=COPLANAR) + return cpp0x::make_tuple(VERTEX,Intersection_info(fh->halfedge()),is_vertex_coplanar,is_vertex_opposite_coplanar); + CGAL_assertion(ca!=COPLANAR); + return cpp0x::make_tuple(VERTEX,Intersection_info(fh->halfedge()->next()),is_vertex_coplanar,is_vertex_opposite_coplanar); +} + + +template +typename Intersection_types::Intersection_result +do_intersect(typename Polyhedron_types::Halfedge_handle hh, + typename Polyhedron_types::Facet_handle fh) +{ + typedef typename Intersection_types::Intersection_info Intersection_info; + typedef typename Intersection_types::Intersection_result Intersection_result; + + const typename Kernel::Point_3 & a = fh->halfedge()->vertex()->point(); + const typename Kernel::Point_3 & b = fh->halfedge()->next()->vertex()->point(); + const typename Kernel::Point_3 & c = fh->halfedge()->next()->next()->vertex()->point(); + const typename Kernel::Point_3 & p = hh->vertex()->point(); + const typename Kernel::Point_3 & q = hh->opposite()->vertex()->point(); + + + const Orientation abcp = orientation(a,b,c,p); + const Orientation abcq = orientation(a,b,c,q); + + + switch ( abcp ) { + case POSITIVE: + switch ( abcq ) { + case POSITIVE: + // the segment lies in the positive open halfspaces defined by the + // triangle's supporting plane + return Intersection_result(EMPTY,Intersection_info(),false,false); + case NEGATIVE: + // p sees the triangle in counterclockwise order + return find_intersection(p,q,a,b,c,hh,fh); + case COPLANAR: + // q belongs to the triangle's supporting plane + // p sees the triangle in counterclockwise order + return find_intersection(p,q,a,b,c,hh,fh,false,true); + + default: // should not happen. + CGAL_assertion(false); + return Intersection_result(EMPTY,Intersection_info(),false,false); + } + case NEGATIVE: + switch ( abcq ) { + case POSITIVE: + // q sees the triangle in counterclockwise order + return find_intersection(q,p,a,b,c,hh,fh); + case NEGATIVE: + // the segment lies in the negative open halfspaces defined by the + // triangle's supporting plane + return Intersection_result(EMPTY,Intersection_info(),false,false); + case COPLANAR: + // q belongs to the triangle's supporting plane + // p sees the triangle in clockwise order + return find_intersection(q,p,a,b,c,hh,fh,false,true); + default: // should not happen. + CGAL_assertion(false); + return Intersection_result(EMPTY,Intersection_info(),false,false); + } + case COPLANAR: // p belongs to the triangle's supporting plane + switch ( abcq ) { + case POSITIVE: + // q sees the triangle in counterclockwise order + return find_intersection(q,p,a,b,c,hh,fh,true,false); + case NEGATIVE: + // q sees the triangle in clockwise order + return find_intersection(p,q,a,b,c,hh,fh,true,false); + case COPLANAR: + // the segment is coplanar with the triangle's supporting plane + // we test whether the segment intersects the triangle in the common + // supporting plane + if ( ::CGAL::internal::do_intersect_coplanar(a,b,c,p,q,Kernel()) ) + return Intersection_result(COPLNR,Intersection_info(),true,true); + return Intersection_result(EMPTY,Intersection_info(),true,true); + + default: // should not happen. + CGAL_assertion(false); + return Intersection_result(EMPTY,Intersection_info(),false,false); + } + default: // should not happen. + CGAL_assertion(false); + return Intersection_result(EMPTY,Intersection_info(),false,false); + } +} + +}} //namespace CGAL::internal_IOP + +#endif //CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_H diff --git a/Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h b/Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h new file mode 100644 index 00000000000..5da58e3c91f --- /dev/null +++ b/Polyhedron/include/CGAL/internal/corefinement/intersection_triangle_segment_3_coplanar.h @@ -0,0 +1,396 @@ +// Copyright (c) 2011 GeometryFactory (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) : Sebastien Loriot + +#ifndef CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_COPLANAR_H +#define CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_COPLANAR_H + + +namespace CGAL{ + namespace internal_IOP{ + +//enum Intersection_type {FACET,EDGE,VERTEX,EMPTY,COPLNR}; + +template +struct Intersection_point_coplanar{ + typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; + + Intersection_type type; + Halfedge_handle info; + Halfedge_handle segment_vertex; + + Intersection_point_coplanar(){}; + + Intersection_point_coplanar(Intersection_type type_, + Halfedge_handle info_, + Halfedge_handle segment_vertex_ + ) :type(type_),info(info_),segment_vertex(segment_vertex_){} +}; + +//test q vs segment bc +template +void point_vs_segment(Inter_pt_coplanar& pt, + Halfedge_handle bc, Halfedge_handle ab, + const Orientation& pqc, const Orientation& pqb) +{ + if (pqb==COLLINEAR){ + pt.type=VERTEX; + pt.info=ab; + } + else{ + if (pqc==COLLINEAR){ + pt.type=VERTEX; + pt.info=bc; + } + else{ + pt.type=EDGE; + pt.info=bc; + } + } +} + + +/* +// c +// / \ +// ___/___\____ with q-------p +// / \ +// a_______b +//supporting line of segment pq intersects ac and bc +*/ + +template +std::pair +decision_tree(const Point_3* a,const Point_3* b,const Point_3* c, + const Point_3* p,const Point_3* q, + const Orientation& pqa,const Orientation& pqb,const Orientation& pqc, + Halfedge_handle pq, + Halfedge_handle ca,Halfedge_handle ab,Halfedge_handle bc) +{ + CGAL_precondition(pqa!=NEGATIVE); + CGAL_precondition(pqb!=NEGATIVE); + CGAL_precondition(pqc!=POSITIVE); + + Inter_pt_coplanar pt1(EMPTY,NULL,NULL),pt2(EMPTY,NULL,NULL); + + //the segment supporting line intersects ac and bc + const Orientation bcq = coplanar_orientation(*b,*c,*q); + switch(bcq){ + case NEGATIVE: //segment does not intersect the triangle + return std::make_pair(pt1,pt2); + case COLLINEAR: //q \in [bc] + point_vs_segment(pt1,bc,ab,pqc,pqb); + pt1.segment_vertex=pq; + return std::make_pair(pt1,pt2); + default: + break; + } + + //===> q is to the left of bc + + const Orientation cap = coplanar_orientation(*c,*a,*p); + switch(cap){ + case NEGATIVE: //segment does not intersect the triangle + return false; + case COLLINEAR: //p \in [ca] + point_vs_segment(pt1,ca,bc,pqa,pqc); + pt1.segment_vertex=pq->opposite(); + return std::make_pair(pt1,pt2); + default: + break; + } + //===> p is to the right of ac + + + const Orientation cqa = coplanar_orientation(*c,*q,*a); + const Orientation cbp = coplanar_orientation(*c,*b,*p); + + if (pqc==COLLINEAR && cqa==POSITIVE && cbp==POSITIVE){ + //special case when c is inside the segment pq + pt1.type=VERTEX; + pt1.info=bc; + return std::make_pair(pt1,pt2); + } + + //where is located q? + switch (cqa){ + case POSITIVE: //q is outside the triangle + point_vs_segment(pt1,ca,bc,pqa,pqc); + break; + case NEGATIVE: //q is inside the triangle + pt1.type=FACET; + pt1.info=pq; + break; + case COLLINEAR: //q \in [ca] + point_vs_segment(pt1,ca,bc,pqa,pqc); + pt1.segment_vertex=pq; + break; + } + + //where is located p? + switch (cbp){ + case POSITIVE: //p is outside the triangle + point_vs_segment(pt2,bc,ab,pqc,pqb); + break; + case NEGATIVE: //p is inside the triangle + pt2.type=FACET; + pt2.info=pq->opposite(); + break; + case COLLINEAR: //p \in [bc] + point_vs_segment(pt2,bc,ab,pqc,pqb); + pt2.segment_vertex=pq->opposite(); + break; + } + return std::make_pair(pt1,pt2); +} + + +/* +// c +// / \ +// / \ +// / \ +// ____a_______b______ with q-------p +//supporting lines of segments pq and ab are the same. +*/ + +template +std::pair +collinear_decision_tree(const Point_3* a,const Point_3* b,const Point_3* c, + const Point_3* p,const Point_3* q, + const Orientation& pqa,const Orientation& pqb,const Orientation& pqc, + Halfedge_handle pq, + Halfedge_handle ca,Halfedge_handle ab,Halfedge_handle bc) +{ + CGAL_precondition(pqa==COLLINEAR); + CGAL_precondition(pqb==COLLINEAR); + CGAL_precondition(pqc==NEGATIVE); + + Inter_pt_coplanar pt1(EMPTY,NULL,NULL),pt2(EMPTY,NULL,NULL); + + //the segment supporting line intersects ac and bc + const Orientation bcq = coplanar_orientation(*b,*c,*q); + switch(bcq){ + case NEGATIVE: //segment does not intersect the triangle + return std::make_pair(pt1,pt2); + case COLLINEAR: // q = b + pt1.type=VERTEX; + pt1.info=ab; + pt1.segment_vertex=pq; + return std::make_pair(pt1,pt2); + default: + break; + } + + //===> q is to the left of b + + const Orientation cap = coplanar_orientation(*c,*a,*p); + switch(cap){ + case NEGATIVE: //segment does not intersect the triangle + return false; + case COLLINEAR: //p = a + pt1.type=VERTEX; + pt1.info=ca; + pt1.segment_vertex=pq->opposite(); + return std::make_pair(pt1,pt2); + default: + break; + } + + //===> p is to the right of a + + + const Orientation cqa = coplanar_orientation(*c,*q,*a); + const Orientation cbp = coplanar_orientation(*c,*b,*p); + + //where is located q? + switch (cqa){ + case POSITIVE: //q is to the left of a + pt1.type=VERTEX; + pt1.info=ca; + break; + case NEGATIVE: //q is to the right of a + pt1.type=EDGE; + pt1.info=ab; + pt1.segment_vertex=pq; + break; + case COLLINEAR: //q = a + pt1.type=VERTEX; + pt1.info=ca; + pt1.segment_vertex=pq; + break; + } + + //where is located p? + switch (cbp){ + case POSITIVE: //p is to the right of b + { + pt2.type=VERTEX; + pt2.info=ab; + } + break; + case NEGATIVE: //p is to the left of b + { + pt2.type=EDGE; + pt2.info=ab; + pt2.segment_vertex=pq->opposite(); + } + break; + case COLLINEAR: //p = b + pt2.type=VERTEX; + pt2.info=ab; + pt2.segment_vertex=pq->opposite(); + break; + } + + return std::make_pair(pt1,pt2); +} + +//std::pair,Intersection_point_coplanar > +template +std::pair,Intersection_point_coplanar > +do_intersect_coplanar(typename Polyhedron_types::Halfedge_handle pq, + typename Polyhedron_types::Face_handle fh) +{ + typedef Intersection_point_coplanar Inter_pt_coplanar; + typedef std::pair Return_type; + + + typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; + + const typename Kernel::Point_3 & A = fh->halfedge()->vertex()->point(); + const typename Kernel::Point_3 & B = fh->halfedge()->next()->vertex()->point(); + const typename Kernel::Point_3 & C = fh->halfedge()->next()->next()->vertex()->point(); + const typename Kernel::Point_3 & P = pq->vertex()->point(); + const typename Kernel::Point_3 & Q = pq->opposite()->vertex()->point(); + + const typename Kernel::Point_3 * a = &A; + const typename Kernel::Point_3 * b = &B; + const typename Kernel::Point_3 * c = &C; + + const typename Kernel::Point_3* p = &P; + const typename Kernel::Point_3* q = &Q; + + Halfedge_handle ca=fh->halfedge(); + Halfedge_handle ab=fh->halfedge()->next(); + Halfedge_handle bc=fh->halfedge()->next()->next(); + + + // Determine the orientation of the triangle in the common plane + + if (coplanar_orientation(A,B,C) != POSITIVE){ + // The triangle is not counterclockwise oriented swap two vertices. + b = &C; + c = &B; + std::swap(bc,ab); + } + + // Test whether the segment's supporting line intersects the + // triangle in the common plane + + Orientation pqa = coplanar_orientation(*p,*q,*a); + + //ensure pqa >= 0 + if (pqa == NEGATIVE){ + std::swap(p,q); + pqa=POSITIVE; + pq=pq->opposite(); + } + + const Orientation pqb = coplanar_orientation(*p,*q,*b); + const Orientation pqc = coplanar_orientation(*p,*q,*c); + + + + //Handle first case pq collinear with a triangle edge + if (pqa == COLLINEAR){ + if (pqb == COLLINEAR){ + //ab and pq are on the same line + if (pqc == NEGATIVE) + return collinear_decision_tree + (a,b,c,p,q,pqa,pqb,pqc,pq,ca,ab,bc); + else + return collinear_decision_tree + (a,b,c,q,p,pqa,pqb,NEGATIVE,pq->opposite(),ca,ab,bc); + } + if (pqc == COLLINEAR){ + //ac and pq are on the same line + if (pqb == NEGATIVE) + return collinear_decision_tree + (c,a,b,p,q,pqc,pqa,pqb,pq,bc,ca,ab); + else + return collinear_decision_tree + (c,a,b,q,p,pqc,pqa,NEGATIVE,pq->opposite(),bc,ca,ab); + } + } + else + if(pqb ==COLLINEAR && pqc == COLLINEAR){ + //bc and pq are on the same line + return collinear_decision_tree + (b,c,a,q,p,pqb,pqc,NEGATIVE,pq->opposite(),ab,bc,ca); + } + + + CGAL_assertion(pqa!=NEGATIVE); + + switch ( pqa ) { + case POSITIVE: + switch ( pqb ) { + case POSITIVE: + if (pqc == POSITIVE) + return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); + return decision_tree(a,b,c,p,q,pqa,pqb,pqc,pq,ca,ab,bc); + + case COLLINEAR: + case NEGATIVE: + if (pqc == POSITIVE) // b is isolated on the negative side + return decision_tree(c,a,b,p,q,pqc,pqa,pqb,pq,bc,ca,ab); + return decision_tree + (b,c,a,q,p,POSITIVE,opposite(pqc),NEGATIVE,pq->opposite(),ab,bc,ca); + default:// should not happen. + CGAL_assertion(false); + return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); + } + case COLLINEAR: + switch ( pqb ) { + case POSITIVE: + if (pqc == POSITIVE) // a is isolated on the negative side + return decision_tree(b,c,a,p,q,pqb,pqc,pqa,pq,ab,bc,ca); + return decision_tree(a,b,c,p,q,pqa,pqb,pqc,pq,ca,ab,bc); + + case NEGATIVE: + if (pqc == NEGATIVE) // a is isolated on the positive side + return decision_tree + (b,c,a,q,p,POSITIVE,POSITIVE,pqa,pq->opposite(),ab,bc,ca); + return decision_tree(c,a,b,p,q,pqc,pqa,pqb,pq,bc,ca,ab); + + default:// should not happen. + CGAL_assertion(false); + return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); + } + default:// should not happen. + CGAL_assertion(false); + return std::make_pair(Inter_pt_coplanar(EMPTY,NULL,NULL),Inter_pt_coplanar(EMPTY,NULL,NULL)); + + } +} + +}}//namespace CGAL::internal_IOP + +#endif //CGAL_INTERNAL_INTERSECTION_TRIANGLE_SEGMENT_3_COPLANAR_H diff --git a/Polyhedron/include/CGAL/intersection_of_Polyhedra_3.h b/Polyhedron/include/CGAL/intersection_of_Polyhedra_3.h new file mode 100644 index 00000000000..8694a6ea2c6 --- /dev/null +++ b/Polyhedron/include/CGAL/intersection_of_Polyhedra_3.h @@ -0,0 +1,1959 @@ +// Copyright (c) 2011 GeometryFactory (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) : Sebastien Loriot + +#ifndef CGAL_INTERSECTION_OF_POLYHEDRA_3_H +#define CGAL_INTERSECTION_OF_POLYHEDRA_3_H + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#ifdef CGAL_COREFINEMENT_DEBUG +#warning look at CGAL/Mesh_3/Robust_intersection_traits.h and the statically filtered decision tree +#endif + +namespace CGAL{ + +//This functor computes the pairwise intersection of polyhedral surfaces. +//Intersection are given as a set of polylines +//The algorithm works as follow: +//From each polyhedral surface we can get it as a set of segments or as a set of triangles. +//We first use Box_intersection_d to filter intersection between all polyhedral +//surface segments and polyhedral triangles. +//From this filtered set, for each pair (segment,triangle), we look at the +//intersection type. If not empty, we can have three different cases +// 1)the segment intersect the interior of the triangle: +// We compute the intersection point and for each triangle incident +// to the segment, we write the fact that the point belong to the intersection +// of these two triangles. +// 2)the segment intersect the triangle on an edge +// We do the same thing as described above but +// for all triangle incident to the edge intersected +// 3)the segment intersect the triangle at a vertex +// for each edge incident to the vertex, we do +// the same operations as in 2) +// +//In case the segment intersect the triangle at one of the segment endpoint, +//we repeat the same procedure for each segment incident to this +//endpoint. +// +//Note that given a pair (segment,triangle)=(S,T), if S belongs +//to the plane of T, we have nothing to do in the following cases: +// -- no triangle T' contains S such that T and T' are coplanar +// -- at least one triangle contains S +// Indeed, the intersection points of S and T will be found using segments +// of T or segments adjacent to S. + + +namespace internal_IOP { + //an enum do decide which kind of intersection points are needed + struct No_predicates_on_constructions{}; + struct Predicates_on_constructions{}; +} // namespace internal_IOP + +template +struct Empty_node_visitor{ + typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; + void new_node_added(int,internal_IOP::Intersection_type,Halfedge_handle,Halfedge_handle,bool,bool){} + template + void annotate_graph(Iterator,Iterator){} + void update_terminal_nodes(std::vector&){} + void set_number_of_intersection_points_from_coplanar_facets(int){}; + void add_filtered_intersection(Halfedge_handle,Halfedge_handle,const Polyhedron&,const Polyhedron&){} + void start_new_polyline(int,int){} + void add_node_to_polyline(int){} + void new_input_polyhedron(const Polyhedron&){} + template + void finalize(T&){} + typedef internal_IOP::No_predicates_on_constructions Node_storage_type; + typedef Tag_true Is_polyhedron_const; + static const bool do_need_vertex_graph = false; +}; + +namespace internal_IOP{ + +template +struct Compare_handles{ + typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron_types::Halfedge Halfedge; + typedef typename Polyhedron_types::Vertex Vertex; + typedef typename Polyhedron_types::Facet Facet; + typedef typename Polyhedron_types::Facet_handle Facet_handle; + typedef std::pair Vertex_handle_pair; + + static inline Vertex_handle_pair + make_sorted_pair_of_vertices(Halfedge_handle h) { + const Vertex* v1=&(* h->vertex() ); + const Vertex* v2=&(* h->opposite()->vertex() ); + if ( v1 < v2 ) + return Vertex_handle_pair(v1,v2); + return Vertex_handle_pair(v2,v1); + } + + bool operator()(Halfedge_handle h1,Halfedge_handle h2) const { + Vertex_handle_pair p1=make_sorted_pair_of_vertices(h1); + Vertex_handle_pair p2=make_sorted_pair_of_vertices(h2); + return p1 < p2; + } + + bool operator()(Facet_handle f1,Facet_handle f2) const { + return &(*f1) < &(*f2); + } + + bool operator()(const std::pair& p1, const std::pair& p2) const{ + Halfedge* h1= (std::min) ( &(*(p1.first)), &(*(p1.first->opposite())) ); + Halfedge* h2= (std::min) ( &(*(p2.first)), &(*(p2.first->opposite())) ); + return h1 +struct Compare_handle_pairs{ + typedef typename Polyhedron_types::Facet Facet; + typedef typename Polyhedron_types::Facet_handle Facet_handle; + typedef std::pair Facet_pair; + typedef std::pair Facet_pair_and_int; + + bool operator()(const Facet_pair& p1, const Facet_pair& p2) const{ + Facet* f1=&(*p1.first); + Facet* f2=&(*p2.first); + if (f1==f2){ + f1=&(*p1.second); + f2=&(*p2.second); + } + return f1f2) return false; + return p1.second +struct Order_along_a_halfedge{ + typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; + const Node_vector& nodes; + Halfedge_handle hedge; + + Order_along_a_halfedge(Halfedge_handle hedge_,const Node_vector& nodes_):nodes(nodes_),hedge(hedge_){} + bool operator()(int i,int j) const { + //returns true, iff q lies strictly between p and r. + try{ + typename Node_vector::Protector p; + return CGAL::collinear_are_strictly_ordered_along_line(nodes.to_interval(hedge->vertex()->point()), + nodes.interval_node(j), + nodes.interval_node(i)); + } + catch(CGAL::Uncertain_conversion_exception&){ + return CGAL::collinear_are_strictly_ordered_along_line(nodes.to_exact(hedge->vertex()->point()), + nodes.exact_node(j), + nodes.exact_node(i)); + } + } +}; + + +template +class Split_halfedge_at_point : public CGAL::Modifier_base { + typedef typename HDS::Halfedge_handle Halfedge_handle; + typedef typename HDS::Vertex_handle Vertex_handle; + typedef typename HDS::Vertex Vertex; + Halfedge_handle hedge; + Vertex vertex; + + typename HDS::Halfedge::Base* + unlock_halfedge(Halfedge_handle h){ + return static_cast(&(*h)); + } + +public: + + template + Split_halfedge_at_point( Halfedge_handle h,const Point_3& point):hedge(h),vertex(point){} + + void operator()( HDS& hds) { + + Vertex_handle v=hds.vertices_push_back(vertex); + Halfedge_handle opposite=hedge->opposite(); + + Halfedge_handle new_hedge=hds.edges_push_back(*hedge); + Halfedge_handle new_opposite=new_hedge->opposite(); + + //update next relations + unlock_halfedge(new_hedge)->set_next(hedge); + unlock_halfedge(new_hedge->prev())->set_next(new_hedge); + unlock_halfedge(hedge)->set_prev(new_hedge); + + unlock_halfedge(opposite)->set_next(new_opposite); + unlock_halfedge(new_opposite)->set_prev(opposite); + unlock_halfedge(new_opposite->next())->set_prev(new_opposite); + + unlock_halfedge(opposite)->set_vertex(v); + unlock_halfedge(new_hedge)->set_vertex(v); + + v->set_halfedge(new_hedge); + new_opposite->vertex()->set_halfedge(new_opposite); + } +}; + + + +} //namespace internal_IOP + + + +//WARNING THIS IS DONE ONLY FOR POLYHEDRON +template +class Node_visitor_for_polyline_split{ +//typedefs + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Halfedge Halfedge; + typedef typename Polyhedron::Vertex_handle Vertex_handle; + //Info stores information about a particular intersection on an + //edge or a vertex of a polyhedron. The two first elements in + //the template describe the intersected simplex of the considered + //polyhedron; the two last elements describe the element of the + //second polyhedron (can be either a vertex, an edge of a facet) + //involved in the intersection + typedef CGAL::cpp0x::tuple Info; + typedef std::map Hedge_to_polyhedron_map; + typedef std::vector Infos; + typedef std::map Node_to_infos_map; +//data members + Node_to_infos_map node_infos; + Hedge_to_polyhedron_map hedge_to_polyhedron; + Halfedge_predicate is_on_polyline; + Set_vertex_corner set_as_corner; +//functions + void handle_principal_edge(int node_id, + internal_IOP::Intersection_type type, + Halfedge_handle principal_edge, + Halfedge_handle additional_edge, + bool is_vertex_coplanar, + bool is_vertex_opposite_coplanar) + { + bool coplanar_v=false; + if (is_vertex_coplanar) coplanar_v=true; + else if (is_vertex_opposite_coplanar){ + principal_edge=principal_edge->opposite(); + coplanar_v=true; + } + + if (coplanar_v) + handle_on_vertex(node_id,principal_edge,type,additional_edge); + else{ + if ( is_on_polyline(principal_edge) ){ + typename Node_to_infos_map::iterator it_res= + node_infos.insert(std::make_pair(node_id,Infos())).first; + it_res->second.push_back( Info(internal_IOP::EDGE,principal_edge,type,additional_edge) ); + } + } + } + + void handle_on_vertex(int node_id,Halfedge_handle edge,internal_IOP::Intersection_type type,Halfedge_handle additional_edge){ + Halfedge_handle current=edge; + do{ + if (is_on_polyline(current)){ + typename Node_to_infos_map::iterator it_res= + node_infos.insert(std::make_pair(node_id,Infos())).first; + it_res->second.push_back( Info(internal_IOP::VERTEX,current,type,additional_edge) ); + break; + } + current=current->next()->opposite(); + } + while(current!=edge); + } + + Halfedge* make_unique_key(Halfedge_handle h){ + if (&(*h) < &(*h->opposite())) + return &(*h); + else + return &(*h->opposite()); + } + + // new_hedge hedge + // -----------> -----------> + // v + // <----------- <----------- + // new_opposite opposite + // + void split_edge_and_retriangulate(Halfedge_handle hedge,const typename Kernel::Point_3& point,Polyhedron& P){ + internal_IOP::Split_halfedge_at_point delegated(hedge,point); + P.delegate( delegated ); + CGAL_assertion(P.is_valid()); + //triangulate the two adjacent facets + if (!hedge->is_border()) + P.split_facet(hedge->prev(),hedge->next()); + if (!hedge->opposite()->is_border()) + P.split_facet(hedge->opposite(),hedge->opposite()->next()->next()); + CGAL_assertion(P.is_valid()); + } + + //sort node ids so that we can split the hedge + //consecutively + template + void sort_vertices_along_hedge(std::vector& node_ids,Halfedge_handle hedge,const Node_vector& nodes) + { + std::sort(node_ids.begin(), + node_ids.end(), + internal_IOP::Order_along_a_halfedge(hedge,nodes) + ); + } + +public: + static const bool do_need_vertex_graph = false; + typedef internal_IOP::Predicates_on_constructions Node_storage_type; + typedef Tag_false Is_polyhedron_const; + + Node_visitor_for_polyline_split(){} + Node_visitor_for_polyline_split(const Halfedge_predicate& getting, + const Set_vertex_corner& setting) + :is_on_polyline(getting),set_as_corner(setting){} + + void new_node_added(int node_id, + internal_IOP::Intersection_type type, + Halfedge_handle principal_edge, + Halfedge_handle additional_edge, + bool is_vertex_coplanar, + bool is_vertex_opposite_coplanar) + { + switch(type) + { + case internal_IOP::FACET: //Facet intersected by an edge + handle_principal_edge(node_id,type,principal_edge,additional_edge,is_vertex_coplanar,is_vertex_opposite_coplanar); + break; + case internal_IOP::EDGE: //Edge intersected by an edge + handle_principal_edge(node_id,type,principal_edge,additional_edge,is_vertex_coplanar,is_vertex_opposite_coplanar); + if ( is_on_polyline(additional_edge) ){ + typename Node_to_infos_map::iterator it_res= + node_infos.insert(std::make_pair(node_id,Infos())).first; + it_res->second.push_back( Info(type,additional_edge, + ( is_vertex_coplanar||is_vertex_opposite_coplanar ) ? internal_IOP::VERTEX:internal_IOP::EDGE, + is_vertex_opposite_coplanar?principal_edge->opposite():principal_edge) ); + } + break; + case internal_IOP::VERTEX://Vertex intersected by an edge + handle_principal_edge(node_id,type,principal_edge,additional_edge,is_vertex_coplanar,is_vertex_opposite_coplanar); + handle_on_vertex( node_id,additional_edge, + ( is_vertex_coplanar||is_vertex_opposite_coplanar ) ? internal_IOP::VERTEX:internal_IOP::EDGE, + is_vertex_opposite_coplanar?principal_edge->opposite():principal_edge); + break; + default: + break; + } + } + + template + void annotate_graph(Iterator begin,Iterator end){ + for(Iterator it=begin;it!=end;++it){ + typename Node_to_infos_map::iterator it_res=node_infos.find(it->first); + if (it_res!=node_infos.end()) + it->second.make_terminal(); + } + } + + void update_terminal_nodes(std::vector& terminal_bools){ + for (typename Node_to_infos_map::iterator it=node_infos.begin();it!=node_infos.end();++it){ + terminal_bools[it->first]=true; + } + } + + void new_input_polyhedron(const Polyhedron&){} + void start_new_polyline(int,int){} + void add_node_to_polyline(int){} + void set_number_of_intersection_points_from_coplanar_facets(int){} + + void add_filtered_intersection(Halfedge_handle eh,Halfedge_handle fh,Polyhedron& Pe,Polyhedron& Pf){ + hedge_to_polyhedron.insert(std::make_pair(make_unique_key(eh),&Pe)); + hedge_to_polyhedron.insert(std::make_pair(make_unique_key(fh),&Pf)); + hedge_to_polyhedron.insert(std::make_pair(make_unique_key(fh->next()),&Pf)); + hedge_to_polyhedron.insert(std::make_pair(make_unique_key(fh->next()->next()),&Pf)); + } + + //split_halfedges + template + void finalize(const Node_vector& nodes){ + typedef std::map, + std::vector,internal_IOP::Compare_handles > Halfedges_to_split; + + Halfedges_to_split halfedges_to_split; + + for (typename Node_to_infos_map::iterator it=node_infos.begin();it!=node_infos.end();++it){ + int node_id=it->first; + const Infos& infos=it->second; + std::map > hedges_to_split; + + //collect information about halfedge to split + typename Infos::const_iterator it_info=infos.begin(); + for (;it_info!=infos.end();++it_info) + { + typename Hedge_to_polyhedron_map::iterator it_poly= + hedge_to_polyhedron.find(make_unique_key(CGAL::cpp0x::get<1>(*it_info))); + CGAL_assertion(it_poly!=hedge_to_polyhedron.end()); + //associate information to an intersection point: + //we give which simplex of the other polyhedron intersect the simplex considered + set_as_corner.add_info_to_node(node_id,it_poly->second,*it_info); + switch(CGAL::cpp0x::get<0>(*it_info)) + { + case internal_IOP::EDGE: + { + halfedges_to_split.insert( + std::make_pair( std::make_pair(CGAL::cpp0x::get<1>(*it_info),&(*(it_poly->second))),std::vector() ) + ).first->second.push_back(node_id); + break; + } + case internal_IOP::VERTEX: + set_as_corner(CGAL::cpp0x::get<1>(*it_info)->vertex(),node_id,it_poly->second); + break; + default: + CGAL_assertion(false); + //should never be here + } + } + } + + + //do the split + for(typename Halfedges_to_split::iterator it=halfedges_to_split.begin();it!=halfedges_to_split.end();++it){ + Halfedge_handle hedge=it->first.first; + Polyhedron* P=it->first.second; + std::vector& node_ids=it->second; + + sort_vertices_along_hedge(node_ids,hedge,nodes); + for (std::vector::iterator it_id=node_ids.begin();it_id!=node_ids.end();++it_id){ + split_edge_and_retriangulate(hedge,nodes[*it_id],*P); + set_as_corner(hedge->opposite()->vertex(),*it_id,(Polyhedron*)(0)); + } + } + } +}; + + +namespace internal_IOP{ + + template + typename Exact_kernel::Point_3 + compute_triangle_segment_intersection_point( + typename Polyhedron::Vertex_const_handle vh1,typename Polyhedron::Vertex_const_handle vh2, + typename Polyhedron::Vertex_const_handle vf1,typename Polyhedron::Vertex_const_handle vf2,typename Polyhedron::Vertex_const_handle vf3, + const Exact_kernel& ek) + { + CGAL::Cartesian_converter to_exact; + typename Exact_kernel::Triangle_3 t(to_exact( vf1->point() ), + to_exact( vf2->point() ), + to_exact( vf3->point() ) + ); + + typename Exact_kernel::Segment_3 s (to_exact( vh1->point() ), + to_exact( vh2->point() ) + ); + + typename Exact_kernel::Intersect_3 exact_intersect=ek.intersect_3_object(); + CGAL::Object inter=exact_intersect(t,s); + CGAL_assertion(CGAL::do_intersect(t,s)); + const typename Exact_kernel::Point_3* e_pt=CGAL::object_cast(&inter); + CGAL_assertion(e_pt!=NULL); + return *e_pt; + } + + template + typename Exact_kernel::Point_3 + compute_triangle_segment_intersection_point( + typename Polyhedron::Halfedge_const_handle edge, + typename Polyhedron::Facet_const_handle facet, + const Exact_kernel& ek) + { + return compute_triangle_segment_intersection_point( + edge->vertex(),edge->opposite()->vertex(), + facet->halfedge()->vertex(),facet->halfedge()->next()->vertex(),facet->halfedge()->opposite()->vertex(), + ek); + + } + + + //A class containing a vector of the intersection points. + //The third template parameter indicates whether an + //exact representation is required + template ::value> + class Triangle_segment_intersection_point; + + + //Store only the double version of the intersection points. + template + class Triangle_segment_intersection_point + { + //typedefs + typedef std::vector Node_vector; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; + typedef typename Polyhedron::Facet_const_handle Facet_handle; + typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; + typedef CGAL::Cartesian_converter Exact_to_double; + //members + Node_vector nodes; + Exact_kernel ek; + Exact_to_double exact_to_double; + public: + typedef CGAL::Interval_nt::Protector Protector; + + const typename Kernel::Point_3& + operator[](int i) const { + return nodes[i]; + } + + const typename Kernel::Point_3& exact_node(int i) const {return nodes[i];} + const typename Kernel::Point_3& interval_node(int i) const {return nodes[i];} + const typename Kernel::Point_3& to_exact(const typename Kernel::Point_3& p) const {return p;} + const typename Kernel::Point_3& to_interval(const typename Kernel::Point_3& p) const {return p;} + + size_t size() const {return nodes.size();} + + //add a new node in the final graph. + //it is the intersection of the triangle with the segment + void add_new_node(Halfedge_handle edge,Facet_handle facet) + { + nodes.push_back ( exact_to_double( + compute_triangle_segment_intersection_point(edge,facet,ek) + )); + } + + void add_new_node(const typename Exact_kernel::Point_3& p) + { + nodes.push_back( exact_to_double(p) ); + } + + void add_new_node(const typename Kernel::Point_3& p) + { + nodes.push_back(p); + } + }; + + + //second specializations: store an exact copy of the points so that we can answer exactly predicates + //FYI, it used to have two specializations (one in the case the polyhedron + //can be edited and on if it cannot) building exact representation on demand. + //In the former case, we were using facet and halfedge while in the latter + //triple of vertex_handle and pair of vertex_handle + template + class Triangle_segment_intersection_point + { + //typedefs + public: + typedef CGAL::Simple_cartesian > Ikernel; + typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; + private: + typedef CGAL::Cartesian_converter Interval_to_double; + typedef CGAL::Cartesian_converter Double_to_interval; + typedef CGAL::Cartesian_converter Exact_to_interval; + typedef CGAL::Cartesian_converter Double_to_exact; + + typedef typename Polyhedron::Vertex_const_handle Vertex_handle; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; + typedef typename Polyhedron::Facet_const_handle Facet_handle; + + typedef std::vector Interval_nodes; + typedef std::vector Exact_nodes; + + + //members + Interval_nodes inodes; + Exact_nodes enodes; + + Interval_to_double interval_to_double; + Exact_to_interval exact_to_interval; + Double_to_interval double_to_interval; + Double_to_exact double_to_exact; + Exact_kernel ek; + + public: + typedef CGAL::Interval_nt::Protector Protector; + + typename Kernel::Point_3 + operator[](int i) const { + return interval_to_double(inodes[i]); + } + + const typename Ikernel::Point_3& + interval_node(int i) const { + return inodes[i]; + } + + typename Ikernel::Point_3 + to_interval(const typename Kernel::Point_3& p) const { + return double_to_interval(p); + } + + const Exact_kernel::Point_3 + exact_node(int i) const { + return enodes[i]; + } + + typename Exact_kernel::Point_3 + to_exact(const typename Kernel::Point_3& p) const { + return double_to_exact(p); + } + + + size_t size() const {return enodes.size();} + + void add_new_node(Halfedge_handle edge,Facet_handle facet) + { + enodes.push_back(compute_triangle_segment_intersection_point(edge,facet,ek) ); + inodes.push_back( exact_to_interval(enodes.back()) ); + } + + void add_new_node(const Exact_kernel::Point_3& p){ + enodes.push_back(p); + inodes.push_back( exact_to_interval(p) ); + } + + //the point is an input + void add_new_node(const typename Kernel::Point_3& p){ + enodes.push_back(to_exact(p)); + inodes.push_back( double_to_interval(p) ); + } + }; + + //Third specialization: The kernel already has exact constructions. + template + class Triangle_segment_intersection_point + { + //typedefs + typedef std::vector Node_vector; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_handle; + typedef typename Polyhedron::Facet_const_handle Facet_handle; + //members + Node_vector nodes; + Kernel k; + public: + typedef Kernel Ikernel; + typedef Kernel Exact_kernel; + typedef void* Protector; + const typename Kernel::Point_3& + operator[](int i) const { + return nodes[i]; + } + + size_t size() const {return nodes.size();} + const typename Kernel::Point_3& exact_node(int i) const {return nodes[i];} + const typename Kernel::Point_3& interval_node(int i) const {return nodes[i];} + + //add a new node in the final graph. + //it is the intersection of the triangle with the segment + void add_new_node(Halfedge_handle edge,Facet_handle facet) + { + nodes.push_back ( + compute_triangle_segment_intersection_point(edge,facet,k) + ); + } + + void add_new_node(const typename Kernel::Point_3& p) + { + nodes.push_back(p); + } + + const typename Kernel::Point_3& to_interval(const typename Kernel::Point_3& p) const { return p; } + const typename Kernel::Point_3& to_exact(const typename Kernel::Point_3& p) const { return p; } + + }; + +} + +//TODO an important requirement is that the Polyhedron should be based on a list-based +//HDS. We use a lot of maps that use the address of Facet,Halfedge and a reallocation would +//be dramatic. + +template< class Polyhedron, + class Kernel=typename Polyhedron::Traits::Kernel, + class Node_visitor=Empty_node_visitor, + class Node_storage_type=typename Node_visitor::Node_storage_type, + class Use_const_polyhedron=typename Node_visitor::Is_polyhedron_const + > +class Intersection_of_Polyhedra_3{ + +//typedefs + typedef typename Kernel::Triangle_3 Triangle; + typedef typename Kernel::Segment_3 Segment; + typedef internal_IOP:: + Polyhedron_types Polyhedron_types; + + typedef typename Polyhedron_types::Polyhedron_ref Polyhedron_ref; + typedef typename Polyhedron_types::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron_types::Halfedge_iterator Halfedge_iterator; + typedef typename Polyhedron_types::Facet_iterator Facet_iterator; + typedef typename Polyhedron_types::Facet_handle Facet_handle; + typedef typename Polyhedron_types::Vertex_handle Vertex_handle; + typedef typename Polyhedron_types::Vertex Vertex; + typedef typename Polyhedron_types::Facet Facet; + typedef CGAL::Box_intersection_d::Box_with_handle_d< + double, 3, Halfedge_handle> Box; + typedef std::pair Facet_pair; + typedef std::pair Facet_pair_and_int; + + typedef internal_IOP:: + Compare_handles Compare_handles; + + typedef internal_IOP:: + Compare_handle_pairs Compare_handle_pairs; + + + typedef std::map,Compare_handle_pairs> Facets_to_nodes_map;//Indeed the boundary of the intersection of two coplanar triangles may contain several segments. + typedef std::set Coplanar_facets_set;//any insertion should be done with make_sorted_pair_of_facets + typedef typename Kernel::Point_3 Node; + typedef internal_IOP::Triangle_segment_intersection_point + Node_vector; + + typedef typename internal_IOP:: + Intersection_types + ::Intersection_result Intersection_result; + + typedef std::set Facet_set; + + typedef std::map + Edge_to_intersected_facets; + #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES + typedef std::set Coplanar_duplicated_intersection_set; + #endif +//helper functions + static inline Facet_pair + make_sorted_pair_of_facets(Facet_handle fh1,Facet_handle fh2) { + const Facet* f1=&(*fh1); + const Facet* f2=&(*fh2); + if (f1 < f2) + return Facet_pair(fh1,fh2); + return Facet_pair(fh2,fh1); + } + + static inline Facet_pair_and_int + make_sorted_pair_of_facets_with_int(Facet_handle fh1,Facet_handle fh2,int i) { + return std::make_pair(make_sorted_pair_of_facets(fh1,fh2),i); + } + + static inline std::pair make_sorted_void_pair(void* v1,void* v2){ + if (v1opposite()) ) return h; + return h->opposite(); + } + +//member variables + Edge_to_intersected_facets edge_to_sfacet; //Associate a segment to a filtered set of facets that may be intersected + Facets_to_nodes_map f_to_node; //Associate a pair of triangle to their intersection points + Coplanar_facets_set coplanar_facets;//Contains all pairs of triangular facets intersecting that are coplanar + Node_vector nodes; //Contains intersection points of polyhedra + Node_visitor* visitor; + bool is_default_visitor; //indicates whether the visitor need to be deleted + #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES + //this does not occur only when one extremity of an edge is inside a face. + // The problem occur every time an edge or a part of an edge with two incident triangles + // is on the intersection polyline, I choose to direcly filter the output by removing duplicated edges + Coplanar_duplicated_intersection_set coplanar_duplicated_intersection;//Set containing edges that are duplicated because of edges (partially) included in a triangle + #endif + +//functions that should come from a traits class + bool has_at_least_two_incident_faces(Halfedge_handle edge) + { + return !edge->is_border_edge(); + } + + template + void get_incident_facets(Halfedge_handle edge,Output_iterator out){ + if (!edge->is_border()) *out++=edge->facet(); + if (!edge->opposite()->is_border()) *out++=edge->opposite()->facet(); + } + + template + void get_incident_edges_to_vertex(Halfedge_handle edge,Output_iterator out){ + Halfedge_handle current=edge; + do{ + *out++=current; + current=current->next()->opposite(); + } + while(current!=edge); + } + +//internal functions + + class Map_edge_facet_bbox_intersection { + Edge_to_intersected_facets& edge_to_sfacet; + Polyhedron_ref polyhedron_triangle; + Polyhedron_ref polyhedron_edge; + Node_visitor& visitor; + public: + Map_edge_facet_bbox_intersection(Edge_to_intersected_facets& map_, + Polyhedron_ref P, + Polyhedron_ref Q, + Node_visitor& visitor_) + :edge_to_sfacet(map_),polyhedron_triangle(P),polyhedron_edge(Q),visitor(visitor_){} + + void operator()( const Box* fb, const Box* eb) const { + Halfedge_handle fh = fb->handle(); + Halfedge_handle eh = eb->handle(); + + typename Edge_to_intersected_facets::iterator res= + edge_to_sfacet.insert(std::make_pair(eh,Facet_set())).first; + res->second.insert(fh->facet()); + visitor.add_filtered_intersection(eh,fh,polyhedron_edge,polyhedron_triangle); + } + }; + + class Map_edge_facet_bbox_intersection_extract_coplanar { + Edge_to_intersected_facets& edge_to_sfacet; + Coplanar_facets_set& coplanar_facets; + Polyhedron_ref polyhedron_triangle; + Polyhedron_ref polyhedron_edge; + Node_visitor& visitor; + public: + Map_edge_facet_bbox_intersection_extract_coplanar( + Edge_to_intersected_facets& map_, + Coplanar_facets_set& coplanar_facets_, + Polyhedron_ref P, + Polyhedron_ref Q, + Node_visitor& visitor_) + :edge_to_sfacet(map_),coplanar_facets(coplanar_facets_),polyhedron_triangle(P),polyhedron_edge(Q),visitor(visitor_) + {} + + void operator()( const Box* fb, const Box* eb) const { + Halfedge_handle fh = fb->handle(); + Halfedge_handle eh = eb->handle(); + + + //check if the segment intersects the plane of the facet or if it is included in the plane + const typename Kernel::Point_3 & a = fh->vertex()->point(); + const typename Kernel::Point_3 & b = fh->next()->vertex()->point(); + const typename Kernel::Point_3 & c = fh->next()->next()->vertex()->point(); + const Orientation abcp = orientation(a,b,c,eh->vertex()->point()); + const Orientation abcq = orientation(a,b,c,eh->opposite()->vertex()->point()); + if (abcp==abcq){ + if (abcp!=COPLANAR){ +// std::cout << "rejected " << &(*fh->facet()) << "{" << &(*eh->facet()) << " " <<&(*eh->opposite()->facet()) << " "<< eh->vertex()->point() << " " << eh->opposite()->vertex()->point() << "}" <is_border() && orientation(a,b,c,eh->next()->vertex()->point())==COPLANAR){ + coplanar_facets.insert(make_sorted_pair_of_facets(eh->facet(),fh->facet())); + } + if (!eh->opposite()->is_border() && orientation(a,b,c,eh->opposite()->next()->vertex()->point())==COPLANAR){ + coplanar_facets.insert(make_sorted_pair_of_facets(eh->opposite()->facet(),fh->facet())); + } + visitor.add_filtered_intersection(eh,fh,polyhedron_edge,polyhedron_triangle); + //in case only the edge is coplanar, the intersection points will be detected using an incident facet + //(see remark at the beginning of the file) + return; + } + + typename Edge_to_intersected_facets::iterator res= + edge_to_sfacet.insert(std::make_pair(eh,Facet_set())).first; + res->second.insert(fh->facet()); + visitor.add_filtered_intersection(eh,fh,polyhedron_edge,polyhedron_triangle); + } + }; + + // This function tests the intersection of the faces of P with the edges of Q + void filter_intersections( Polyhedron_ref P, Polyhedron_ref Q) { + std::vector facet_boxes, edge_boxes; + facet_boxes.reserve( P.size_of_facets()); + for ( Facet_iterator i = P.facets_begin(); i != P.facets_end(); ++i){ + facet_boxes.push_back( + Box( i->halfedge()->vertex()->point().bbox() + + i->halfedge()->next()->vertex()->point().bbox() + + i->halfedge()->next()->next()->vertex()->point().bbox(), + i->halfedge())); + } + std::vector facet_box_ptr; + facet_box_ptr.reserve( P.size_of_facets()); + for ( typename std::vector::iterator j = facet_boxes.begin(); j != facet_boxes.end(); ++j){ + facet_box_ptr.push_back( &*j); + } + + for ( Halfedge_iterator i = Q.halfedges_begin(); i != Q.halfedges_end(); ++i){ + if(&*i < &*(i->opposite())){ + edge_boxes.push_back( + Box( i->vertex()->point().bbox() + + i->opposite()->vertex()->point().bbox(), + i)); + } + } + + std::vector edge_box_ptr; + edge_box_ptr.reserve( Q.size_of_halfedges()/2); + for ( typename std::vector::iterator j = edge_boxes.begin(); j != edge_boxes.end(); ++j){ + edge_box_ptr.push_back( &*j); + } + + CGAL::box_intersection_d( facet_box_ptr.begin(), facet_box_ptr.end(), + edge_box_ptr.begin(), edge_box_ptr.end(), + #ifdef DO_NOT_HANDLE_COPLANAR_FACETS + Map_edge_facet_bbox_intersection(edge_to_sfacet,P,Q,*visitor), + #else + Map_edge_facet_bbox_intersection_extract_coplanar(edge_to_sfacet,coplanar_facets,P,Q,*visitor), + #endif + std::ptrdiff_t(2000) + ); + } + + + void add_intersection_point_to_facet_and_all_edge_incident_facets(Facet_handle facet, + Halfedge_handle edge, + int node_id) + { + std::vector incident_facets; + get_incident_facets(edge,std::back_inserter(incident_facets)); + for (typename std::vector::iterator it=incident_facets.begin(); + it!=incident_facets.end();++it) + { + CGAL_assertion(cgal_do_intersect_debug(facet,*it)); + + Facet_pair facet_pair = make_sorted_pair_of_facets(facet,*it); + if ( !coplanar_facets.empty() && coplanar_facets.find(facet_pair)!=coplanar_facets.end() ) continue; + typename Facets_to_nodes_map::iterator it_list= + f_to_node.insert( std::make_pair( Facet_pair_and_int(facet_pair,0),std::set()) ).first; + it_list->second.insert(node_id); + } + } + + void cip_handle_case_edge(int node_id, + Facet_set* fset, + Halfedge_handle edge, + Halfedge_handle edge_intersected) + { + //associate the intersection point to all facets incident to the intersected edge using edge + std::vector incident_facets; + get_incident_facets(edge_intersected,std::back_inserter(incident_facets)); + for (typename std::vector::iterator it=incident_facets.begin(); + it!=incident_facets.end();++it) + { + add_intersection_point_to_facet_and_all_edge_incident_facets(*it,edge,node_id); + if (fset!=NULL) fset->erase(*it); + } + incident_facets.clear(); + + //associate the intersection point to all facets incident to edge using the intersected edge + //at least one pair of facets is already handle above + + typename Edge_to_intersected_facets::iterator it_fset=edge_to_sfacet.find(edge_intersected); + if (it_fset==edge_to_sfacet.end()) return; + Facet_set& fset_bis=it_fset->second; + get_incident_facets(edge,std::back_inserter(incident_facets)); + for (typename std::vector::iterator it=incident_facets.begin(); + it!=incident_facets.end();++it) + { +// add_intersection_point_to_facet_and_all_edge_incident_facets(*it,edge_intersected,node_id); //this call is not needed, already done in the first loop + fset_bis.erase(*it); + } + } + + void cip_handle_case_vertex(int node_id, + Facet_set* fset, + Halfedge_handle edge, + Halfedge_handle vertex_intersected) + { + std::vector incident_halfedges; + get_incident_edges_to_vertex(vertex_intersected,std::back_inserter(incident_halfedges)); + for (typename std::vector::iterator + it=incident_halfedges.begin();it!=incident_halfedges.end();++it) + { + cip_handle_case_edge(node_id,fset,edge,*it); + } + } + + //add a new node in the final graph. + //it is the intersection of the triangle with the segment + void add_new_node(Halfedge_handle edge, + Facet_handle facet, + const Intersection_result& inter_res, + Node_vector& nodes) + { + bool is_vertex_coplanar = CGAL::cpp0x::get<2>(inter_res); + if (is_vertex_coplanar) + nodes.add_new_node(edge->vertex()->point()); + else{ + bool is_opposite_vertex_coplanar = CGAL::cpp0x::get<3>(inter_res); + if (is_opposite_vertex_coplanar) + nodes.add_new_node(edge->opposite()->vertex()->point()); + else + nodes.add_new_node(edge,facet); + } + } + + //either the exact or input point can be used to create a node + //with this function + template + void add_new_node(const Point& pt) + { + nodes.add_new_node(pt); + } + + + #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES + void check_coplanar_edge(Halfedge_handle hedge,Facet_handle facet) + { + const typename Kernel::Point_3& p0=facet->halfedge()->vertex()->point(); + const typename Kernel::Point_3& p1=facet->halfedge()->next()->vertex()->point(); + const typename Kernel::Point_3& p2=facet->halfedge()->opposite()->vertex()->point(); + CGAL_precondition( orientation( p0,p1,p2,hedge->vertex()->point() ) == COPLANAR ); + + if ( has_at_least_two_incident_faces(hedge) && orientation( p0,p1,p2,hedge->opposite()->vertex()->point() ) == COPLANAR ) + { + //In case two facets are incident along such this edge, the intersection + //will be reported twice. We keep track of this so that at the end, we can remove one intersecting edge out of the two + //choose the smaller of the two faces (only one need to de deleted) + Facet_handle smaller=make_sorted_pair_of_facets(hedge->face(),hedge->opposite()->face()).first; + coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(smaller,facet)); + } + } + + bool are_incident_facets_coplanar(Halfedge_handle hedge){ + const typename Kernel::Point_3& p0=hedge->vertex()->point(); + const typename Kernel::Point_3& p1=hedge->next()->vertex()->point(); + const typename Kernel::Point_3& p2=hedge->opposite()->vertex()->point(); + const typename Kernel::Point_3& p3=hedge->opposite()->next()->vertex()->point(); + return orientation( p0,p1,p2,p3 ) == COPLANAR; + } + + void check_coplanar_edge(Halfedge_handle hedge,Halfedge_handle additional_edge,internal_IOP::Intersection_type type) + { + switch(type){ + case internal_IOP::FACET: + check_coplanar_edge(hedge,additional_edge->face()); + break; + + case internal_IOP::EDGE: + if ( !additional_edge->is_border() ){ + check_coplanar_edge(hedge,additional_edge->face()); + } + if (!additional_edge->opposite()->is_border()) + check_coplanar_edge(hedge,additional_edge->opposite()->face()); + break; + case internal_IOP::VERTEX: + { + //consider all incident faces + Halfedge_handle current=additional_edge; + do{ + if( !current->is_border() ) + check_coplanar_edge(hedge,current->face()); + current=current->next()->opposite(); + } + while(current!=additional_edge); + } + break; + + default: + CGAL_assertion(type==internal_IOP::COPLNR); + break; + } + } + + void check_coplanar_edge_old(Halfedge_handle hedge,Halfedge_handle additional_edge,internal_IOP::Intersection_type type) + { + switch(type){ + case internal_IOP::FACET: + check_coplanar_edge(hedge,additional_edge->face()); + break; + + case internal_IOP::EDGE: + { + if ( !additional_edge->is_border() ){ + if (!additional_edge->opposite()->is_border()){ + if ( are_incident_facets_coplanar(additional_edge) ) + { + Facet_handle facet=additional_edge->face(); + const typename Kernel::Point_3& p0=facet->halfedge()->vertex()->point(); + const typename Kernel::Point_3& p1=facet->halfedge()->next()->vertex()->point(); + const typename Kernel::Point_3& p2=facet->halfedge()->opposite()->vertex()->point(); + CGAL_precondition( orientation( p0,p1,p2,hedge->vertex()->point() ) == COPLANAR ); + + if ( has_at_least_two_incident_faces(hedge) && orientation( p0,p1,p2,hedge->opposite()->vertex()->point() ) == COPLANAR ) + { + //In case two facets are incident along a common edge of two coplanar triangles. + //We need to remove three out of the four reported pair + Facet_handle smaller=make_sorted_pair_of_facets(hedge->face(),hedge->opposite()->face()).first; + coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(hedge->face(),facet)); + coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(hedge->opposite()->face(),facet)); + coplanar_duplicated_intersection.insert(make_sorted_pair_of_facets(hedge->opposite()->face(),additional_edge->opposite()->face())); + } + } + else + { + check_coplanar_edge(hedge,additional_edge->face()); + check_coplanar_edge(hedge,additional_edge->opposite()->face()); + } + } + else + check_coplanar_edge(hedge,additional_edge->face()); + } + else{ + CGAL_assertion(!additional_edge->opposite()->is_border()); + check_coplanar_edge(hedge,additional_edge->opposite()->face()); + } + } + break; + case internal_IOP::VERTEX: + + break; + + default: + CGAL_assertion(type==internal_IOP::COPLNR); + break; + } + } + + template + void check_coplanar_edges(Hedge_iterator begin,Hedge_iterator end,Halfedge_handle additional_edge,internal_IOP::Intersection_type type) + { + for (Hedge_iterator it=begin;it!=end;++it) + check_coplanar_edge(*it,additional_edge,type); + } + #endif + + void print_type_debug(internal_IOP::Intersection_type type,bool cpl,bool opp_cpl) + { + switch(type){ + case internal_IOP::COPLNR: + std::cout << "COPLNR " << cpl << " " << opp_cpl << std::endl; + break; + case internal_IOP::EMPTY: + std::cout << "EMPTY " << cpl << " " << opp_cpl << std::endl; + break; + + case internal_IOP::FACET: + std::cout << "FACET " << cpl << " " << opp_cpl << std::endl; + break; + + case internal_IOP::EDGE: + std::cout << "EDGE " << cpl << " " << opp_cpl << std::endl; + break; + case internal_IOP::VERTEX: + std::cout << "VERTEX " << cpl << " " << opp_cpl << std::endl; + break; + } + } + + + void handle_coplanar_case_VERTEX_FACET(Halfedge_handle vertex,Halfedge_handle facet,int node_id){ + visitor->new_node_added(node_id,internal_IOP::FACET,vertex,facet,true,false); + std::vector all_edges; + get_incident_edges_to_vertex(vertex,std::back_inserter(all_edges)); + typename std::vector::iterator it_edge=all_edges.begin(); + for (;it_edge!=all_edges.end();++it_edge){ + add_intersection_point_to_facet_and_all_edge_incident_facets(facet->facet(),*it_edge,node_id); + typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); + if (it_ets!=edge_to_sfacet.end()) it_ets->second.erase(facet->facet()); + } + } + + void handle_coplanar_case_VERTEX_EDGE(Halfedge_handle vertex,Halfedge_handle edge,int node_id){ + visitor->new_node_added(node_id,internal_IOP::VERTEX,edge,vertex,false,false); + std::vector all_edges; + get_incident_edges_to_vertex(vertex,std::back_inserter(all_edges)); + typename std::vector::iterator it_edge=all_edges.begin(); + for (;it_edge!=all_edges.end();++it_edge){ + typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); + Facet_set* fset = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; + cip_handle_case_edge(node_id,fset,*it_edge,edge); + } + } + + void handle_coplanar_case_VERTEX_VERTEX(Halfedge_handle vertex1,Halfedge_handle vertex2,int node_id){ + visitor->new_node_added(node_id,internal_IOP::VERTEX,vertex2,vertex1,true,false); + std::vector all_edges; + get_incident_edges_to_vertex(vertex1,std::back_inserter(all_edges)); + typename std::vector::iterator it_edge=all_edges.begin(); + for (;it_edge!=all_edges.end();++it_edge){ + typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); + Facet_set* fset = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; + cip_handle_case_vertex(node_id,fset,*it_edge,vertex2); + } + } + + + template + int get_or_create_node(Cpl_inter_pt& ipt,int& current_node,Coplanar_node_map& coplanar_node_map){ + void *v1, *v2; + switch(ipt.type_1){ + case internal_IOP::VERTEX: v1=(void*)( &(*(ipt.info_1->vertex())) ); break; + case internal_IOP::EDGE : v1=(void*)( &(*smaller_handle(ipt.info_1)) ); break; + case internal_IOP::FACET : v1=(void*)( &(*(ipt.info_1->facet())) ); break; + default: CGAL_assertion(!"Should not get there!"); + } + + switch(ipt.type_2){ + case internal_IOP::VERTEX: v2=(void*)( &(*(ipt.info_2->vertex())) ); break; + case internal_IOP::EDGE : v2=(void*)( &(*smaller_handle(ipt.info_2)) ); break; + case internal_IOP::FACET : v2=(void*)( &(*(ipt.info_2->facet())) ); break; + default: CGAL_assertion(!"Should not get there!"); + } + + std::pair key=make_sorted_void_pair(v1,v2); + + std::pair res=coplanar_node_map.insert(std::make_pair(key,current_node+1)); + if (res.second){ //insert a new node + + if (ipt.type_1==internal_IOP::VERTEX) + add_new_node(ipt.info_1->vertex()->point()); + else{ + if(ipt.type_2==internal_IOP::VERTEX) + add_new_node(ipt.info_2->vertex()->point()); + else + add_new_node(ipt.point); + } + return ++current_node; + } + return res.first->second; + } + + void compute_intersection_of_coplanar_facets(int& current_node){ + typedef std::map,int> Coplanar_node_map; + Coplanar_node_map coplanar_node_map; + + for (typename Coplanar_facets_set::iterator it=coplanar_facets.begin();it!=coplanar_facets.end();++it){ + Facet_handle f1=it->first; + Facet_handle f2=it->second; + typedef internal_IOP::Intersection_point_with_info Cpl_inter_pt; + std::list inter_pts; + internal_IOP::intersection_coplanar_facets(f1->halfedge(),f2->halfedge(),inter_pts); +// std::cout << "found " << inter_pts.size() << " inter pts: "; + std::size_t nb_pts=inter_pts.size(); + std::vector cpln_nodes; cpln_nodes.reserve(nb_pts); + for (typename std::list::iterator iti=inter_pts.begin();iti!=inter_pts.end();++iti){ + #ifdef CGAL_COREFINEMENT_DEBUG + //iti->print_debug(); + #endif + CGAL_assertion(iti->is_valid()); + int node_id=get_or_create_node(*iti,current_node,coplanar_node_map); + cpln_nodes.push_back(node_id); + + switch(iti->type_1){ + case internal_IOP::VERTEX: + { + switch(iti->type_2){ + case internal_IOP::VERTEX: handle_coplanar_case_VERTEX_VERTEX(iti->info_1,iti->info_2,node_id); break; + case internal_IOP::EDGE : handle_coplanar_case_VERTEX_EDGE(iti->info_1,iti->info_2,node_id); break; + case internal_IOP::FACET : handle_coplanar_case_VERTEX_FACET(iti->info_1,iti->info_2,node_id); break; + default: CGAL_assertion(!"Should not get there!"); + } + } + break; + case internal_IOP::EDGE:{ + switch(iti->type_2){ + case internal_IOP::VERTEX:handle_coplanar_case_VERTEX_EDGE(iti->info_2,iti->info_1,node_id);break; + case internal_IOP::EDGE: + { + visitor->new_node_added(node_id,internal_IOP::EDGE,iti->info_1,iti->info_2,false,false); + typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(iti->info_1); + Facet_set* fset = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; + cip_handle_case_edge(node_id,fset,iti->info_1,iti->info_2); + } + break; + default: CGAL_assertion(!"Should not get there!"); + } + } + break; + + case internal_IOP::FACET: + { + CGAL_assertion(iti->type_2==internal_IOP::VERTEX); + handle_coplanar_case_VERTEX_FACET(iti->info_2,iti->info_1,node_id); + } + break; + + default: CGAL_assertion(!"Should not get there!"); + } + } + switch (nb_pts){ + case 0: break; + case 1: + { + typename Facets_to_nodes_map::iterator it_list= + f_to_node.insert( std::make_pair( Facet_pair_and_int(*it,1),std::set()) ).first; + it_list->second.insert(cpln_nodes[0]); + } + break; + default: + { + int i=0; + std::size_t stop=nb_pts + (nb_pts<3?-1:0); + for (std::size_t k=0;k()) ).first; + it_list->second.insert( cpln_nodes[k] ); + it_list->second.insert( cpln_nodes[(k+1)%nb_pts] ); + } + } + } +// std::cout << std::endl; + } + } + + void compute_intersection_points(int& current_node){ + for(typename Edge_to_intersected_facets::iterator it=edge_to_sfacet.begin();it!=edge_to_sfacet.end();++it){ + Halfedge_handle edge=it->first; + Facet_set& fset=it->second; + while (!fset.empty()){ + Facet_handle facet=*fset.begin(); + + Intersection_result res=internal_IOP::do_intersect(edge,facet); + internal_IOP::Intersection_type type=CGAL::cpp0x::get<0>(res); + + //handle degenerate case: one extremity of edge below to facet + std::vector all_edges; + if ( CGAL::cpp0x::get<2>(res) ) + get_incident_edges_to_vertex(edge,std::back_inserter(all_edges)); + else{ + if ( CGAL::cpp0x::get<3>(res) ) + get_incident_edges_to_vertex(edge->opposite(),std::back_inserter(all_edges)); + else + all_edges.push_back(edge); + } + + CGAL_precondition(*all_edges.begin()==edge || *all_edges.begin()==edge->opposite()); +// print_type_debug(type,CGAL::cpp0x::get<2>(res),CGAL::cpp0x::get<3>(res)); + + #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES + check_coplanar_edges(boost::next(all_edges.begin()),all_edges.end(),CGAL::cpp0x::get<1>(res),type); + #endif + + typename std::vector::iterator it_edge=all_edges.begin(); + switch(type){ + case internal_IOP::COPLNR: + #ifndef DO_NOT_HANDLE_COPLANAR_FACETS + assert(!"COPLNR : this point should never be reached!"); + #else + //nothing need to be done, cf. comments at the beginning of the file + #endif + break; + case internal_IOP::EMPTY: + fset.erase(fset.begin()); + CGAL_assertion(!cgal_do_intersect_debug(edge,facet)); + break; + + case internal_IOP::FACET: + { + CGAL_assertion(cgal_do_intersect_debug(edge,facet)); + CGAL_assertion(facet==CGAL::cpp0x::get<1>(res)->face()); + + int node_id=++current_node; + add_new_node(edge,facet,res,nodes); + visitor->new_node_added(node_id,internal_IOP::FACET,edge,facet->halfedge(),CGAL::cpp0x::get<2>(res),CGAL::cpp0x::get<3>(res)); + for (;it_edge!=all_edges.end();++it_edge){ + add_intersection_point_to_facet_and_all_edge_incident_facets(facet,*it_edge,node_id); + //erase facet from the list to test intersection with it_edge + if ( it_edge==all_edges.begin() ) + fset.erase(fset.begin()); + else + { + typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); + if(it_ets!=edge_to_sfacet.end()) it_ets->second.erase(facet); + } + } + } + break; + + case internal_IOP::EDGE: + { + CGAL_assertion(cgal_do_intersect_debug(edge,facet)); + int node_id=++current_node; + add_new_node(edge,facet,res,nodes); + Halfedge_handle edge_intersected=CGAL::cpp0x::get<1>(res); + visitor->new_node_added(node_id,internal_IOP::EDGE,edge,edge_intersected,CGAL::cpp0x::get<2>(res),CGAL::cpp0x::get<3>(res)); + for (;it_edge!=all_edges.end();++it_edge){ + if ( it_edge!=all_edges.begin() ){ + typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); + Facet_set* fset_bis = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; + cip_handle_case_edge(node_id,fset_bis,*it_edge,edge_intersected); + } + else + cip_handle_case_edge(node_id,&fset,*it_edge,edge_intersected); + } + } + break; + + case internal_IOP::VERTEX: + { + CGAL_assertion(cgal_do_intersect_debug(edge,facet)); + int node_id=++current_node; + Halfedge_handle vertex_intersected=CGAL::cpp0x::get<1>(res); + add_new_node(vertex_intersected->vertex()->point()); //we use the original vertex to create the node + //before it was internal_IOP::FACET but do not remember why, probably a bug... + visitor->new_node_added(node_id,internal_IOP::VERTEX,edge,vertex_intersected,CGAL::cpp0x::get<2>(res),CGAL::cpp0x::get<3>(res)); + for (;it_edge!=all_edges.end();++it_edge){ + if ( it_edge!=all_edges.begin() ){ + typename Edge_to_intersected_facets::iterator it_ets=edge_to_sfacet.find(*it_edge); + Facet_set* fset_bis = (it_ets!=edge_to_sfacet.end())?&(it_ets->second):NULL; + cip_handle_case_vertex(node_id,fset_bis,*it_edge,vertex_intersected); + } + else + cip_handle_case_vertex(node_id,&fset,*it_edge,vertex_intersected); + } + } + break; + + } + } + } + CGAL_assertion(nodes.size()==unsigned(current_node+1)); + } + + #ifdef USE_DETECTION_MULTIPLE_DEFINED_EDGES + void remove_duplicated_intersecting_edges() + { + for (typename Coplanar_duplicated_intersection_set::iterator + it=coplanar_duplicated_intersection.begin(); + it!=coplanar_duplicated_intersection.end(); + ++it) + { + typename Facets_to_nodes_map::iterator res=f_to_node.find(*it); + //CGAL_assertion(res!=f_to_node.end()); + //we cannot use a precondition here: in some cases the coplanarity test is not sufficient. + //if on surface1 we have to coplanar triangle incident along edge e. Then in surface2, take a triangle + //with one edge inside one triangle of surface1 such that one vertex in on e. Then the collinearity test + //return true for both faces but only one implies a duplicated edge + if(res!=f_to_node.end()) + f_to_node.erase(res); + } + } + #else + void remove_duplicated_intersecting_edges() + { + std::set< std::pair > already_seen; + std::list to_erase; + for (typename Facets_to_nodes_map::iterator + it=f_to_node.begin(); + it!=f_to_node.end(); + ++it + ) + { + if (it->second.size()==1) continue; + CGAL_precondition(it->second.size()==2); + //it->second is a set so int are already sorted + bool is_new=already_seen.insert( std::make_pair( + *(it->second.begin()), + *boost::next(it->second.begin()) ) + ).second; + + if (!is_new) + to_erase.push_back(it); + } + + for ( typename std::list::iterator + it=to_erase.begin();it!=to_erase.end();++it + ) + f_to_node.erase(*it); + } + #endif + + + struct Graph_node{ + std::set neighbors; + unsigned size; + + Graph_node():size(0){} + + void insert(int i){ + ++size; + CGAL_assertion(neighbors.find(i)==neighbors.end()); + neighbors.insert(i); + } + + void erase(int i){ + CGAL_assertion(neighbors.find(i)!=neighbors.end()); + neighbors.erase(i); + } + void make_terminal() {size=45;} + bool is_terminal()const {return size!=2;} + bool empty() const {return neighbors.empty();} + int top() const {return *neighbors.begin();} + void pop() { + CGAL_assertion(!neighbors.empty()); + neighbors.erase(neighbors.begin()); + } + }; + + + template + void construct_polylines(Node_vector& nodes,Output_iterator out){ + typedef std::map Graph; + Graph graph; + + //counts the number of time each node has been seen + std::size_t nb_nodes=nodes.size(); + std::vector node_mult(nb_nodes,0); + bool isolated_point_seen=false; + for (typename Facets_to_nodes_map::iterator it=f_to_node.begin();it!=f_to_node.end();++it){ + const std::set& segment=it->second; + CGAL_assertion(segment.size()==2 || segment.size()==1); + if (segment.size()==2){ + int i=*segment.begin(); + int j=*boost::next(segment.begin()); + typename Graph::iterator ins_res=graph.insert(std::make_pair(i,Graph_node())).first; + ins_res->second.insert(j); + ins_res=graph.insert(std::make_pair(j,Graph_node())).first; + ins_res->second.insert(i); + ++(node_mult[i]); + ++(node_mult[j]); + } + else{ + CGAL_assertion(segment.size()==1); + isolated_point_seen=true; + } + } + + //add isolated points + if (isolated_point_seen){ + for (unsigned index=0;index(1,nodes[index]); + visitor->start_new_polyline(index,index); + } + } + + //visitor call + visitor->annotate_graph(graph.begin(),graph.end()); + + bool only_cycle=false; + while (!graph.empty()){ + typename Graph::iterator it=graph.begin(); + for (;!only_cycle && it!=graph.end();++it){ + if (it->second.is_terminal()) break; + } + + std::vector polyline; + + if(!only_cycle && it!=graph.end()){ + //this is a polyline + int i=it->first; + int j=it->second.top(); + visitor->start_new_polyline(i,j); + CGAL_assertion(i!=j); + it->second.pop(); + if (it->second.empty()) + graph.erase(it); + polyline.push_back(nodes[i]); + visitor->add_node_to_polyline(i); + while(true){ + it=graph.find(j); + CGAL_assertion(it!=graph.end()); + it->second.erase(i); + i=j; + polyline.push_back(nodes[i]); + visitor->add_node_to_polyline(i); + if (it->second.empty()){ + graph.erase(it); + break; + } + if (it->second.is_terminal()) break; + j=it->second.top(); + it->second.pop(); + if (it->second.empty()) + graph.erase(it); + } + *out++=polyline; + } + else{ + //it remains only cycles + only_cycle=true; + it=graph.begin(); + int i=it->first; + int j=it->second.top(); + visitor->start_new_polyline(i,j); + graph.erase(it); + polyline.push_back(nodes[i]); + visitor->add_node_to_polyline(i); + int first=i; + do{ + it=graph.find(j); + it->second.erase(i); + i=j; + polyline.push_back(nodes[i]); + visitor->add_node_to_polyline(i); + j=it->second.top(); + graph.erase(it); + }while(j!=first); + polyline.push_back(nodes[j]);// we duplicate first point for cycles + visitor->add_node_to_polyline(j); + *out++=polyline; + } + } + } + + int get_other_int(const std::set& s,int i) const { + if (*s.begin()!=i) return *s.begin(); + return *boost::next(s.begin()); + } + + template + bool is_grabbed(const Dispatch_out_it&) const{ + return CGAL::Is_in_tuple::value; + } + + + template + struct Is_dispatch_based_ouput_iterator{ + typedef boost::false_type type; + }; + + template class Dispatch_based_output_it,class V,class O> + struct Is_dispatch_based_ouput_iterator >{ + typedef typename boost::is_base_of< Dispatch_output_iterator, + Dispatch_based_output_it >::type type; + }; + + template + inline void construct_polylines_with_info(Node_vector& nodes,Output_iterator out){ + return construct_polylines_with_info(nodes,out,typename Is_dispatch_based_ouput_iterator::type()); + } + + template + void construct_polylines_with_info(Node_vector& nodes,Output_iterator out,boost::false_type){ + construct_polylines_with_info(nodes, + dispatch_or_drop_output >(out),boost::true_type()); + } + + template class Dispatch_based_output_it,class V,class O> + void construct_polylines_with_info(Node_vector& nodes, + Dispatch_based_output_it out,boost::true_type) + { + typedef typename Facets_to_nodes_map::value_type Edge; + typedef std::list Polyline_info; + + + std::size_t nb_nodes=nodes.size(); + std::vector node_mult(nb_nodes,0); + std::vector terminal_bools(nb_nodes,false); + std::vector< std::set > connections(nb_nodes); + // --counts the number of time each node has been seen + // --associate to each node its incident edges. An edge = a pair of Facet_handle+2 indices of intersection points + for (typename Facets_to_nodes_map::iterator it=f_to_node.begin();it!=f_to_node.end();++it){ + const std::set& segment=it->second; + CGAL_assertion(segment.size()==2 || segment.size()==1); + if (segment.size()==2){ + int i=*segment.begin(); + int j=*boost::next(segment.begin()); + connections[i].insert(&(*it)); + connections[j].insert(&(*it)); + ++(node_mult[i]); + ++(node_mult[j]); + } + } + + //detect terminal nodes and isolated nodes + for (unsigned k=0;k(1,nodes[k]); + if ( is_grabbed >(out)) + *out++=std::vector(); + } + } + + //visitor call + visitor->update_terminal_nodes(terminal_bools); + + //We start from a node N and recursively walk one edge to find other + // node. If this is a cycle we stop when we are back at the node N; + //otherwise we stop at a terminal node and restart a walk from N + //following another edge (if N is not terminal) until finding a terminal + //node. With this we can associate to each edge the pair of facet_handle + //intersecting that define this edge. + unsigned current_node=0; + while (current_node!=nb_nodes){ + if (connections[current_node].empty()){ + ++current_node; + continue; + } + + Edge* edge=*connections[current_node].begin(); + connections[current_node].erase(connections[current_node].begin()); + + Polyline_info polyline_info; + std::list polyline_embedding; + + if ( is_grabbed >(out)) + polyline_info.push_back(edge->first.first); + polyline_embedding.push_back(nodes[current_node]); + + unsigned i=current_node; + unsigned start_node=current_node; + bool reverse=false; + while (true){ + i=get_other_int(edge->second,i); + connections[i].erase(edge); + + if (reverse) polyline_embedding.push_front(nodes[i]); + else polyline_embedding.push_back(nodes[i]); + + if (i==start_node) break; + if (terminal_bools[i]){ + if (reverse || terminal_bools[current_node]) break; + reverse=true; + i=current_node; + if ( connections[i].empty() ) break; + } + + edge=*connections[i].begin(); + connections[i].erase(connections[i].begin()); + + if ( is_grabbed >(out)){ + if (reverse) polyline_info.push_front(edge->first.first); + else polyline_info.push_back(edge->first.first); + } + + } + + *out++=std::vector(polyline_embedding.begin(),polyline_embedding.end()); + if ( is_grabbed >(out)){ + CGAL_assertion(polyline_embedding.size()==polyline_info.size()+1); + *out++=std::vector(polyline_info.begin(),polyline_info.end()); + } + } + } + +//debug functions + + bool cgal_do_intersect_debug(Halfedge_handle eh,Facet_handle fh){ + Triangle t( fh->halfedge()->vertex()->point(), + fh->halfedge()->next()->vertex()->point(), + fh->halfedge()->next()->next()->vertex()->point()); + + Segment s( eh->vertex()->point(), + eh->opposite()->vertex()->point()); + + return CGAL::do_intersect( s, t); + } + + bool cgal_do_intersect_debug(Facet_handle fh1,Facet_handle fh2){ + Triangle t1( fh1->halfedge()->vertex()->point(), + fh1->halfedge()->next()->vertex()->point(), + fh1->halfedge()->next()->next()->vertex()->point()); + Triangle t2( fh2->halfedge()->vertex()->point(), + fh2->halfedge()->next()->vertex()->point(), + fh2->halfedge()->next()->next()->vertex()->point()); + + + return CGAL::do_intersect( t1, t2); + } + + void print_f_to_node_debug(){ + std::cout << "print_f_to_node_debug " << &f_to_node << std::endl; + for (typename Facets_to_nodes_map::iterator it=f_to_node.begin();it!=f_to_node.end();++it){ + std::cout << &(*(it->first.first.first)) << " " << &(*(it->first.first.second)) << " " << it->first.second << " -> {"; + std::copy(it->second.begin(),it->second.end(),std::ostream_iterator(std::cout,",")); + std::cout << "}" <& graph){ + for (typename std::map::const_iterator it=graph.begin();it!=graph.end();++it){ + std::cout << it->first << " -> {"; + std::copy(it->second.neighbors.begin(),it->second.neighbors.end(),std::ostream_iterator(std::cout,",")); + std::cout << "}" <second; + std::cout << &fset << " fset size " << fset.size() << std::endl; + } + } + + + template + OutputIterator main_run(OutputIterator out,bool build_polylines=true){ + // std::cout << edge_to_sfacet.size() << std::endl; + int current_node=-1; + + //print_edge_to_sfacet_debug(); + #ifndef DO_NOT_HANDLE_COPLANAR_FACETS + //first handle coplanar triangles + compute_intersection_of_coplanar_facets(current_node); + visitor->set_number_of_intersection_points_from_coplanar_facets(current_node+1); + #endif + //print_edge_to_sfacet_debug(); + //compute intersection points of segments and triangles. + //build node of the graph + //build connectivity info + compute_intersection_points(current_node); + + if (!build_polylines){ + visitor->finalize(nodes); + return out; + } + //remove duplicated intersecting edges: + // In case two facets are incident along such an edge coplanar in a facet of another polyhedron (and one extremity inside the facet), the intersection + // will be reported twice. We kept track (check_coplanar_edge(s)) of this so that, we can remove one intersecting edge out of the two + //print_f_to_node_debug(); + remove_duplicated_intersecting_edges(); + + //std::cout << "f_to_node "<< f_to_node.size() << std::endl; + //print_f_to_node_debug(); + //collect connectivity infos and create polylines + if ( Node_visitor::do_need_vertex_graph ) + construct_polylines(nodes,out); //using the graph approach (at some point we know all connections between intersection points) + else + construct_polylines_with_info(nodes,out); //direct construction by propagation + + visitor->finalize(nodes); + + return out; + } + +public: + Intersection_of_Polyhedra_3():visitor(new Node_visitor()),is_default_visitor(true){} + Intersection_of_Polyhedra_3(Node_visitor& v):visitor(&v),is_default_visitor(false){} + ~Intersection_of_Polyhedra_3(){if (is_default_visitor) delete visitor;} + //pairwise intersection between all elements in the range + template + OutputIterator + operator()(InputIterator begin, InputIterator end, OutputIterator out) { + for(InputIterator it1=begin;it1!=end;++it1){ + CGAL_precondition( it1->is_pure_triangle() ); + Polyhedron_ref P=*it1; + visitor->new_input_polyhedron(P); + for(InputIterator it2=boost::next(it1);it2!=end;++it2){ + CGAL_precondition( it2->is_pure_triangle() ); + Polyhedron_ref Q=*it2; + filter_intersections(P, Q); + filter_intersections(Q, P); + } + } + + return main_run(out); + } + + //pairwise intersection between all elements in the range + //(pointers version) + template + OutputIterator + operator()(InputIterator begin, InputIterator end, OutputIterator out, int) { + for(InputIterator it1=begin;it1!=end;++it1){ + CGAL_precondition( (*it1)->is_pure_triangle() ); + Polyhedron_ref P=**it1; + visitor->new_input_polyhedron(P); + for(InputIterator it2=boost::next(it1);it2!=end;++it2){ + CGAL_precondition( (*it2)->is_pure_triangle() ); + Polyhedron_ref Q=**it2; + filter_intersections(P, Q); + filter_intersections(Q, P); + } + } + + return main_run(out); + } + + //intersection between P and each element in the range + template + OutputIterator + operator()( Polyhedron_ref P, InputIterator begin, InputIterator end, OutputIterator out) { + CGAL_precondition( P.is_pure_triangle() ); + visitor->new_input_polyhedron(P); + for(InputIterator it=begin;it!=end;++it){ + CGAL_precondition( it->is_pure_triangle() ); + Polyhedron_ref Q=*it; + visitor->new_input_polyhedron(Q); + filter_intersections(P, Q); + filter_intersections(Q, P); + } + return main_run(out); + } + + //intersection between P and each element in the range + //(pointers version) + template + OutputIterator + operator()(Polyhedron_ref P, InputIterator begin, InputIterator end, OutputIterator out, int) { + CGAL_precondition( P.is_pure_triangle() ); + visitor->new_input_polyhedron(P); + for(InputIterator it=begin;it!=end;++it){ + CGAL_precondition( (*it)->is_pure_triangle() ); + Polyhedron_ref Q=**it; + visitor->new_input_polyhedron(Q); + filter_intersections(P, Q); + filter_intersections(Q, P); + } + return main_run(out); + } + + //intersection between P and Q + template + OutputIterator + operator()(Polyhedron_ref P, Polyhedron_ref Q, OutputIterator out) { + visitor->new_input_polyhedron(P); + visitor->new_input_polyhedron(Q); + filter_intersections(P, Q); + filter_intersections(Q, P); + return main_run(out); + } + + //intersection between P and Q, only visitor called not polyline is constructed + void operator()(Polyhedron_ref P, Polyhedron_ref Q) { + visitor->new_input_polyhedron(P); + visitor->new_input_polyhedron(Q); + filter_intersections(P, Q); + filter_intersections(Q, P); + main_run(Emptyset_iterator(),false); + } +}; + +template +OutputIterator +intersection_Polyhedron_3_Polyhedron_3(const Polyhedron& P, const Polyhedron& Q, OutputIterator out) +{ + return Intersection_of_Polyhedra_3()(P,Q,out); +} + +}// namespace CGAL + +#endif //CGAL_INTERSECTION_OF_POLYHEDRA_3_H diff --git a/Polyhedron/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h b/Polyhedron/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h new file mode 100644 index 00000000000..ae55dfba813 --- /dev/null +++ b/Polyhedron/include/CGAL/intersection_of_Polyhedra_3_refinement_visitor.h @@ -0,0 +1,2150 @@ +// Copyright (c) 2011 GeometryFactory (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. +// +// $UR$ +// $Id$ +// +// +// Author(s) : Sebastien Loriot + +#ifndef CGAL_INTERSECTION_OF_POLYHEDRA_3_REFINEMENT_VISITOR_H +#define CGAL_INTERSECTION_OF_POLYHEDRA_3_REFINEMENT_VISITOR_H + +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include + +// TODOCUMENT +// --We suppose that the two input polyhedra are triangulated orientable surfaces. +// --Any polyhedron defines two bounding volumes: one inside and one outside. +// The convention used is the following: the normal of a triangle always indicates +// the outside of the object. +// --The input polyhedra should not touch at only one point locally. If so, the current +// implementation just ignore it (TAG SL001) +// --Polyhedron type should be list-based or should guarantee no reallocation. We use maps +// on pointer of halfedges,facets and vertices +// --Polyhedral_mesh_domain requires the domain tp be closed: do not provided as input +// an open polyhedral surface and a polyhedron with a connected component free from intersection +//OPTIMIZATIONS +// --cdt: try using intervals? in that case, only points inside the face should be considered +// and points on edge should be handled by hand (simply start using the point opposite to the edge) +// --filtered_order_around_edge: can be done using the original supporting planes +// --in intersection_of_Polyhedra_3: upon call to Triangle_segment_intersection_point::add_new_node, interval and exact nodes are +// inserted into a vector. Since we do not know the final size of vector this lead to reallocation of data. +// --in Triangle_segment_intersection_point, try using EPEC instead of Interval_nt+SC +// --use a sorted pair of indices in edge_to_hedge+simplify the code TAG_SLXX1 +// --in sew_2_marked_darts arrange how darts are passed to avoid comparing to a Point_3 +//TODO: +// --validity of the embedding: points inserted in polyhedron are approximation of the real +// intersection points. It may happen that because of the approximation, the embedding gets +// wrong. To avoid this, for each new triangle created, we should make an orientation test +// with the approximated point to check if this is correct. If not, points must be moved +// within their double interval so that all triangles incident to each of these points are correctly +// oriented. This is probably an expensive test that can be activated only with a template parameter +// of something similar. +namespace CGAL +{ + + namespace internal_IOP + { + template + struct Compare_unik_address{ + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; + typedef typename Polyhedron::Halfedge Halfedge; + + bool operator()(Halfedge_handle h1,Halfedge_handle h2) const { + Halfedge* ph1=&(*h1) < &(*h1->opposite()) ? &(*h1) : &(*h1->opposite()); + Halfedge* ph2=&(*h2) < &(*h2->opposite()) ? &(*h2) : &(*h2->opposite()); + return ph1 < ph2; + } + + bool operator()(Halfedge_const_handle h1,Halfedge_const_handle h2) const { + const Halfedge* ph1=&(*h1) < &(*h1->opposite()) ? &(*h1) : &(*h1->opposite()); + const Halfedge* ph2=&(*h2) < &(*h2->opposite()) ? &(*h2) : &(*h2->opposite()); + return ph1 < ph2; + } + }; + + template + struct Compare_address{ + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; + typedef typename Polyhedron::Halfedge Halfedge; + + bool operator()(Halfedge_handle h1,Halfedge_handle h2) const { + return &(*h1) < &(*h2); + } + + bool operator()(Halfedge_const_handle h1,Halfedge_const_handle h2) const { + return &(*h1) < &(*h2); + } + }; + + template + class Non_intersection_halfedge{ + typedef std::map< typename Polyhedron::Halfedge_const_handle, + std::pair, + Compare_unik_address + > Intersection_hedges_set; + Intersection_hedges_set intersection_hedges_; + public: + Non_intersection_halfedge(const Intersection_hedges_set& the_set) : intersection_hedges_(the_set){} + + + bool operator()(typename Polyhedron::Halfedge_const_handle h) const + { + return intersection_hedges_.find(h)==intersection_hedges_.end(); + } + }; + + + template + class Triangulate_a_face : public CGAL::Modifier_base { + typedef typename HDS::Halfedge_handle Halfedge_handle; + typedef typename HDS::Vertex_handle Vertex_handle; + typedef typename HDS::Face_handle Face_handle; + typedef typename HDS::Vertex Vertex; + typedef typename HDS::Halfedge Halfedge; + typedef typename HDS::Face Face; + + //data members + Face_handle current_face; + std::map nodes_; + std::map& node_to_polyhedron_vertex_; + std::map,Halfedge_handle>& edge_to_hedge_; + std::vector > edges_to_create_; + std::vector > faces_to_create_; + + typename HDS::Halfedge::Base* + unlock_halfedge(Halfedge_handle h){ + return static_cast(&(*h)); + } + + typename HDS::Face::Base* + unlock_face(Face_handle f){ + return static_cast(&(*f)); + } + + public: + + template + Triangulate_a_face( Face_handle face, + const Node_vector& nodes, + const std::vector& node_ids, + std::map& node_to_polyhedron_vertex, + std::map,Halfedge_handle>& edge_to_hedge, + const Triangulation& triangulation) + :current_face(face),node_to_polyhedron_vertex_(node_to_polyhedron_vertex),edge_to_hedge_(edge_to_hedge) + { + //grab vertices to be inserted to copy them from the vector + for (std::vector::const_iterator it=node_ids.begin();it!=node_ids.end();++it) + { + nodes_.insert(std::make_pair(*it,nodes[*it])); + } + //grab edges that are not on the convex hull (these have already been created) + for (typename Triangulation::Finite_edges_iterator + it=triangulation.finite_edges_begin(); + it!=triangulation.finite_edges_end(); + ++it) + { + typename Triangulation::Vertex_handle v0=it->first->vertex((it->second+1)%3); + typename Triangulation::Vertex_handle v1=it->first->vertex((it->second+2)%3); + //warning in degenerate cases you can insert outsite expected convex hull edges: need exact here. + //an alternative is to test if one the incident faces are infinite (cf assertion below) + if ( edge_to_hedge_.find(std::make_pair(v0->info(),v1->info()))==edge_to_hedge_.end() && + edge_to_hedge_.find(std::make_pair(v1->info(),v0->info()))==edge_to_hedge_.end() ) + { + edges_to_create_.push_back( std::make_pair(v0->info(),v1->info()) ); + } + else + CGAL_assertion( triangulation.is_infinite(it->first->vertex(it->second)) || triangulation.is_infinite( triangulation.mirror_vertex(it->first,it->second)) ); + } + //grab triangles. + for (typename Triangulation::Finite_faces_iterator + it=triangulation.finite_faces_begin(); + it!=triangulation.finite_faces_end(); + ++it) + { + typename Triangulation::Vertex_handle v0=it->vertex(0); + typename Triangulation::Vertex_handle v1=it->vertex(1); + typename Triangulation::Vertex_handle v2=it->vertex(2); + //warning in degenerate case we can have non wanted triangles: need exact here + faces_to_create_.push_back( CGAL::cpp0x::make_tuple( v0->info(),v1->info(),v2->info() ) ); + } + } + + + + void operator()( HDS& hds) { +// std::cerr << "node_to_polyhedron_vertex_"<< std::endl; +// for (typename std::map::iterator it=node_to_polyhedron_vertex_.begin();it!=node_to_polyhedron_vertex_.end();++it) +// std::cerr << it->first << " " << &(*(it->second)) << std::endl; + + //insert the intersection point interior to the face inside the polyhedron and + //save their Polyhedron::vertex_handle + for (typename std::map::iterator it=nodes_.begin();it!=nodes_.end();++it) + { + Vertex_handle v=hds.vertices_push_back(Vertex(it->second)); + CGAL_assertion( node_to_polyhedron_vertex_.find( it->first ) == node_to_polyhedron_vertex_.end()); + node_to_polyhedron_vertex_.insert( std::make_pair(it->first,v) ); +// std::cerr << "vertices " << it->first << " " << &(*v) << std::endl; + } + + //insert the new halfedge and set their incident vertex + for (typename std::vector >::iterator + it=edges_to_create_.begin();it!=edges_to_create_.end();++it) + { + Halfedge_handle he=hds.edges_push_back(Halfedge(),Halfedge()); + + //associate edge to halfedge going from i to j with j as incident vertex + CGAL_assertion(node_to_polyhedron_vertex_.find(it->second)!= node_to_polyhedron_vertex_.end()); + Vertex_handle v=node_to_polyhedron_vertex_.find(it->second)->second; + unlock_halfedge(he)->set_vertex( v ); + v->set_halfedge(he); +// std::cerr << " --in edge " << &(*v) << std::endl; + edge_to_hedge_.insert( std::make_pair(*it,he) ); + v=node_to_polyhedron_vertex_.find(it->first)->second; +// std::cerr << " --in edge " << &(*v) << std::endl; + unlock_halfedge( he->opposite() )->set_vertex( v ); + v->set_halfedge(he->opposite()); + edge_to_hedge_.insert( std::make_pair(std::make_pair(it->second,it->first),he->opposite()) ); +// std::cerr << "edges " << it->first << " " << it->second << std::endl; + } + + std::vector >::iterator it=faces_to_create_.begin(); + + //create the new faces and update adjacencies + while (true) + { + int i=cpp0x::get<0>(*it),j=cpp0x::get<1>(*it),k=cpp0x::get<2>(*it); +// std::cerr << "faces " << i << " " << j << " " << k<< std::endl; + Halfedge_handle current = edge_to_hedge_.find(std::make_pair(i,j))->second; + Halfedge_handle next = edge_to_hedge_.find(std::make_pair(j,k))->second; + Halfedge_handle previous = edge_to_hedge_.find(std::make_pair(k,i))->second; + + + CGAL_assertion (edge_to_hedge_.find(std::make_pair(i,j))!=edge_to_hedge_.end()); + CGAL_assertion (edge_to_hedge_.find(std::make_pair(j,k))!=edge_to_hedge_.end()); + CGAL_assertion (edge_to_hedge_.find(std::make_pair(k,i))!=edge_to_hedge_.end()); + + CGAL_assertion(current->vertex()==node_to_polyhedron_vertex_.find(j)->second); + CGAL_assertion(next->vertex()==node_to_polyhedron_vertex_.find(k)->second); + CGAL_assertion(previous->vertex()==node_to_polyhedron_vertex_.find(i)->second); + + unlock_halfedge(current)->set_next(next); + unlock_halfedge(next)->set_next(previous); + unlock_halfedge(previous)->set_next(current); + + unlock_halfedge(current)->set_prev(previous); + unlock_halfedge(next)->set_prev(current); + unlock_halfedge(previous)->set_prev(next); + + //update face halfedge + unlock_face(current_face)->set_halfedge(current); + + //update face of halfedges + unlock_halfedge(current) ->set_face(current_face); + unlock_halfedge(next) ->set_face(current_face); + unlock_halfedge(previous) ->set_face(current_face); + + if ( ++it!=faces_to_create_.end() ) + current_face=hds.faces_push_back(Face()); + else + break; + } + } + }; + + } //namespace internal_IOP + + +//Considering the plane with normal vector [O_prime,O] and containing O. +//We define the counterclockwise order around O when looking from the side of the plane +//into which the vector [O_prime,O] is pointing. +//We consider the portion of the plane defined by rotating a ray starting at O +//from the planar projection of P1 to the planar projection of P2 in counterclockwise order. +//The predicates indicates whether the planar projection of point Q lies in this portion of the plane. +//Preconditions: +// O_prime,O,P1 are not collinear +// O_prime,O,P2 are not collinear +// O_prime,O,Q are not collinear +// O_prime,O,P1,Q are not coplanar or coplanar_orientation(O,O_prime,P1,Q)==NEGATIVE +// O_prime,O,P2,Q are not coplanar or coplanar_orientation(O,O_prime,P2,Q)==NEGATIVE +template +bool is_in_interior_of_object( + const typename Kernel::Point_3& O_prime,const typename Kernel::Point_3& O, + const typename Kernel::Point_3& P1,const typename Kernel::Point_3& P2, + const typename Kernel::Point_3& Q) +{ + //guarantee to have non-flat triangles + CGAL_precondition( !collinear(O_prime,O,P1) ); + CGAL_precondition( !collinear(O_prime,O,P2) ); + CGAL_precondition( !collinear(O_prime,O,Q) ); + + //no two triangles are coplanar and on the same side of their common edge + CGAL_precondition( !coplanar(O_prime,O,P1,Q) || coplanar_orientation(O,O_prime,P1,Q)==NEGATIVE ); + CGAL_precondition( !coplanar(O_prime,O,P2,Q) || coplanar_orientation(O,O_prime,P2,Q)==NEGATIVE ); + + Sign s0 = sign( determinant(O-O_prime,P1-O,P2-O) ); + + if ( s0==ZERO ){ + //O, O_prime, P1 and P2 are coplanar + Orientation o=orientation(O_prime,O,P1,Q); + CGAL_precondition(o!=COPLANAR); + return o==POSITIVE; + } + + //O, O_prime, P1 and P2 are not coplanar + Sign s1 = sign( determinant(O-O_prime,P1-O,Q -O) ); + Sign s2 = sign( determinant(O-O_prime,Q -O,P2-O) ); + + if (s0 == POSITIVE) // the angle P1,O,P2 is smaller that Pi. + return ( s1 == POSITIVE ) && ( s2 ==POSITIVE ); //true if the angles P1,O,Q and Q,O,P2 are smaller than Pi + else + return ( s1 != NEGATIVE ) || ( s2 != NEGATIVE ); //true if the angle P1,O,Q or the angle Q,O,P2 is smaller than or equal to Pi +} + +//import into the combinatorial map facets in the given range. +//they are supposed to be in the same connected component. +//two volume are created (each facets gives two opposite orientation 2-cell in the map) +template +typename Map::Dart_handle import_from_polyhedron_subset( Map& amap, + Face_iterator faces_begin, + Face_iterator faces_end, + const Non_special_edge_predicate& is_non_special_edge, + Halfedge_to_dart_map_& selected_hedge_to_dart, + int mark_index + ) +{ + typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; + typedef std::map < Halfedge_const_handle, typename Map::Dart_handle,internal_IOP::Compare_address > Halfedge_to_dart_map; + + Halfedge_to_dart_map hedge_to_dart; + typename Map::Dart_handle first_dart = NULL; + // First traversal to build the darts and link them. + for (Face_iterator it_face = faces_begin; it_face != faces_end; ++it_face) + { + Halfedge_const_handle start=(*it_face)->halfedge(); + + CGAL_precondition(start->next()!=start); + + Halfedge_const_handle current=start; + typename Map::Dart_handle prev = NULL; + typename Map::Dart_handle first_dart_of_face = NULL; + do + { + typename Map::Dart_handle d = amap.create_dart(); + amap.template link_beta<3>(d,amap.create_dart()); //for opposite volume + hedge_to_dart[current] = d; + + if (prev != NULL){ + amap.template link_beta<1>(prev, d); + amap.template link_beta<1>(d->beta(3),prev->beta(3));//for opposite volume + } + else + { + first_dart_of_face = d; + if (first_dart==NULL) first_dart=d; + } + + if ( is_non_special_edge (current) ){ + if ( !current->is_border_edge() ){ + CGAL_assertion(current != current->opposite()); + typename Halfedge_to_dart_map::iterator it = hedge_to_dart.find(current->opposite()); + if (it != hedge_to_dart.end()){ //link the opposites halfedges only when both corresponding darts have been created + amap.template link_beta<2>(d, it->second); + amap.template link_beta<2>(d->beta(3), it->second->beta(3));//for opposite volume + } + } + } + else{ + typename Halfedge_to_dart_map_::iterator it_hedge_map=selected_hedge_to_dart.find(current); + //all marked hedges are not the selected one for its polyline + if ( it_hedge_map!=selected_hedge_to_dart.end() ) it_hedge_map->second=d; + //darts d and d->beta(3) are special edges + amap.mark(d,mark_index); + amap.mark(d->beta(3),mark_index); + } + prev = d; + current=current->next(); + } + while (current != start); + amap.template link_beta<1>(prev, first_dart_of_face); + amap.template link_beta<1>(first_dart_of_face->beta(3),prev->beta(3));//for opposite volume + } + + // Second traversal to update the geometry. + // We run one again through the facets of the HDS. + for (Face_iterator it_face = faces_begin; it_face != faces_end; ++it_face) + { + Halfedge_const_handle start=(*it_face)->halfedge(); + Halfedge_const_handle current=start; + do + { + typename Map::Dart_handle d = hedge_to_dart[current]; // Get the dart associated to the Halfedge + if (d->template attribute<0>() == NULL) + { + amap.template set_attribute<0>(d, + amap.template create_attribute<0>(current->opposite()->vertex()->point())); + } + current=current->next(); + } + while (current != start); + } + + return first_dart; +} + + //turn around the target vertex of dart to find a marked dart +template +boost::optional +next_marked_dart_around_target_vertex( + const Combinatorial_map_3& final_map, + typename Combinatorial_map_3::Dart_handle dart, + int mark_index) +{ + CGAL_precondition(final_map.is_marked(dart,mark_index)); + typename Combinatorial_map_3::Dart_handle next=dart->beta(1); + while ( ! final_map.is_marked(next,mark_index) ){ + if (next->is_free(2) )//we reach a boundary + return boost::optional(); + next=next->beta(2)->beta(1); + } + if (next == dart) //no new dart have been found + return boost::optional(); + CGAL_precondition(&dart->beta(1)->template attribute<0>()->point() == &next->template attribute<0>()->point()); + return boost::optional (next); +} + +//turn around the target vertex of dart to find a marked dart +//with expected_target as target vertex +template +typename Combinatorial_map_3::Dart_handle +get_next_marked_dart_around_target_vertex( + const Combinatorial_map_3& final_map, + typename Combinatorial_map_3::Dart_handle dart, + int mark_index) +{ + CGAL_precondition(final_map.is_marked(dart,mark_index)); + typename Combinatorial_map_3::Dart_handle next=dart->beta(1); + while ( !final_map.is_marked(next,mark_index) ){ + CGAL_assertion( !next->is_free(2) ); + next=next->beta(2)->beta(1); + CGAL_assertion(next != dart); + } + CGAL_precondition(&dart->beta(1)->template attribute<0>()->point() == &next->template attribute<0>()->point()); + return next; +} + +//turn around the source vertex of dart to find a marked dart +//with expected_source as source vertex +template +typename Combinatorial_map_3::Dart_handle +get_next_marked_dart_around_source_vertex( + const Combinatorial_map_3& final_map, + typename Combinatorial_map_3::Dart_handle dart, + int mark_index) +{ + CGAL_precondition(final_map.is_marked(dart,mark_index)); + typename Combinatorial_map_3::Dart_handle next=dart->beta(0); + while ( ! final_map.is_marked(next,mark_index) ){ + CGAL_assertion( !next->is_free(2) ); + next=next->beta(2)->beta(0); + CGAL_assertion(next != dart); + } + CGAL_precondition(&dart->template attribute<0>()->point() == &next->beta(1)->template attribute<0>()->point()); + return next; +} + +//given two marked darts, this function links these two darts with beta<2> +//but in addition it follows the marked darts connected to the same vertex +//(there should be only one) to connect them all together +//( this function is a kind of zipper ;) ) +template +void sew_2_marked_darts( Combinatorial_map_3& final_map, + typename Combinatorial_map_3::Dart_handle dart_1 , + typename Combinatorial_map_3::Dart_handle dart_2 , + int mark_index, + const Node_vector& nodes, + const std::pair& indices, + const std::pair& polyline_info) +{ + typedef boost::optional O_Dart_handle; + + CGAL_precondition( dart_1->is_free(2) ); + CGAL_precondition( dart_2->is_free(2) ); + CGAL_precondition( final_map.is_marked(dart_1,mark_index) ); + CGAL_precondition( final_map.is_marked(dart_2,mark_index) ); + CGAL_precondition( dart_1->template attribute<0>()->point() == dart_2->beta(1)->template attribute<0>()->point() ); + CGAL_precondition( dart_1->beta(1)->template attribute<0>()->point() == dart_2->template attribute<0>()->point() ); + + int src_index = ( ( indices.first < indices.second) == polyline_info.first ) + ? indices.second:indices.first; + + if ( dart_1->template attribute<0>()->point() != nodes[ src_index ] ) std::swap(dart_1,dart_2); + + int nb_segs=polyline_info.second-1,k=1; + + do{ + CGAL_precondition( final_map.template is_sewable<2>(dart_1,dart_2) ); + final_map.template sew<2>(dart_1,dart_2); + + if (k==nb_segs) break; + + dart_1=get_next_marked_dart_around_target_vertex(final_map,dart_1,mark_index); + dart_2=get_next_marked_dart_around_source_vertex(final_map,dart_2,mark_index); + } + while(++k); +} + +//not_top and not_down are two darts from volumes that get merged with an existing +//other one because of a set of identical coplanar triangles. +//top and down is the dart of the volumes "replacing" that of not_top and not down respectively, +//The function is considering all triangles that are bounded by a cycle of marked edges. +//The volume not_top and not_down are part of are those that will disappear at the +//end of the main algorithm. +//( this function is a kind of facet gluer ;) ) +template +void sew_3_marked_darts( Combinatorial_map_3& final_map, + typename Combinatorial_map_3::Dart_handle not_top , + typename Combinatorial_map_3::Dart_handle not_down , + typename Combinatorial_map_3::Dart_handle top , + typename Combinatorial_map_3::Dart_handle down , + int mark_index, + std::set& darts_to_remove) +{ + typedef boost::optional O_Dart_handle; + + if ( not_top->template attribute<3>()->info().is_empty ){ + CGAL_assertion(not_down->template attribute<3>()->info().is_empty); + return; + } + + CGAL_assertion(!not_down->template attribute<3>()->info().is_empty); + + //merge attribute of the two volumes: + internal_IOP::Volume_on_merge merge_attributes; + merge_attributes(*top->template attribute<3>(),*not_top->template attribute<3>()); + merge_attributes(*down->template attribute<3>(),*not_down->template attribute<3>()); + + //set volume attributes as empty to avoid double sew_3 of the same topological disk of triangles + not_top->template attribute<3>()->info().is_empty=true; + not_down->template attribute<3>()->info().is_empty=true; + + CGAL_precondition( final_map.is_marked(not_top,mark_index) && final_map.is_marked(top,mark_index) ); + CGAL_precondition( final_map.is_marked(not_down,mark_index) && final_map.is_marked(down,mark_index) ); + CGAL_precondition( not_top->template attribute<0>()->point() == not_down->beta(1)->template attribute<0>()->point() ); + CGAL_precondition( not_top->beta(1)->template attribute<0>()->point() == not_down->template attribute<0>()->point() ); + CGAL_precondition( not_top->template attribute<0>()->point() == top->template attribute<0>()->point() ); + CGAL_precondition( not_down->template attribute<0>()->point() == down->template attribute<0>()->point() ); + + CGAL_assertion( top->beta(3)==down ); + + //set to be removed the darts of the two no longer used volumes + typename Combinatorial_map_3::Dart_handle start=not_top; + do + { + CGAL_assertion(!not_top->is_free(3)); + darts_to_remove.insert(not_top); darts_to_remove.insert(not_top->beta(1)); darts_to_remove.insert(not_top->beta(1)->beta(1)); + darts_to_remove.insert(not_top->beta(3)); darts_to_remove.insert(not_top->beta(3)->beta(1)); darts_to_remove.insert(not_top->beta(3)->beta(1)->beta(1)); + O_Dart_handle current_1=next_marked_dart_around_target_vertex(final_map,not_top,mark_index); + CGAL_precondition(current_1); + not_top=*current_1; + } + while(not_top!=start); +} + +template +struct Halfedge_marker{ + template + static void mark(Halfedge_handle){} +}; + +template<> +struct Halfedge_marker{ + template + static void mark(Halfedge_handle h){h->set_mark();} +}; + +template +class Node_visitor_refine_polyhedra{ +//typedefs + typedef typename Polyhedron::Halfedge_handle Halfedge_handle; + typedef typename Polyhedron::Halfedge_const_handle Halfedge_const_handle; + typedef typename Polyhedron::Face_handle Face_handle; + typedef typename Polyhedron::Halfedge Halfedge; + typedef typename Polyhedron::Vertex_handle Vertex_handle; + typedef internal_IOP::Compare_handles Cmp_handle; //This ensures uniqueness of edges when comparing halfedges + typedef internal_IOP::Compare_unik_address Cmp_unik_ad; //This ensures uniqueness of edges when comparing halfedges + + //constrained triangulation used for triangulation interior of faces + #ifdef DO_NO_USE_EXACT_CDT + typedef CGAL::Triangulation_vertex_base_with_info_2 Vbi; + typedef CGAL::Constrained_triangulation_face_base_2 Fb; + typedef CGAL::Triangulation_data_structure_2 TDS_2; + typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; //DO WE NEED DELAUNAY???? + #else + typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel; + typedef CGAL::Triangulation_vertex_base_with_info_2 Vbi; + typedef CGAL::Constrained_triangulation_face_base_2 Fb; + typedef CGAL::Triangulation_data_structure_2 TDS_2; + typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; //DO WE NEED DELAUNAY???? + #endif + + typedef std::map Hedge_to_polyhedron_map; + + typedef std::vector Node_ids; + typedef std::set Node_id_set; //avoid having duplicated node on edge of coplanar triangles + typedef std::map< Face_handle,Node_ids,Cmp_handle > In_face_map; + typedef std::map< Halfedge_handle,Node_id_set,Cmp_unik_ad > In_halfedge_map; + //to keep the correspondance between node_id and vertex_handle in each polyhedron + typedef std::map Node_to_polyhedron_vertex_map; + typedef std::map Poly_to_map_node; + //to maintain an polyhedron halfedge on each polyline + pair + //with first = "is the key (pair) was reversed?" and second is the number of edges +1 in the polyline + typedef std::map< std::pair, std::pair< std::map,std::pair > > An_edge_per_polyline_map; + //to handle coplanar halfedge of polyhedra that are full in the intersection + typedef std::map< int,Halfedge_handle > Node_to_target_of_hedge_map; + typedef std::map< Polyhedron*,Node_to_target_of_hedge_map> Poly_to_vertices_on_intersection_map; + + //Combinatorial map typedefs + typedef internal_IOP::Item_with_points_and_volume_info Items; + typedef CGAL::Combinatorial_map<3,Items> Combinatorial_map_3_; + typedef typename Combinatorial_map_3_::Dart_handle Dart_handle; + +//data members + Hedge_to_polyhedron_map hedge_to_polyhedron; + In_face_map in_face; + In_halfedge_map in_hedge; + std::map< int,std::set > graph_of_constraints; + std::map< int,std::set > coplanar_constraints; + An_edge_per_polyline_map an_edge_per_polyline; + typename An_edge_per_polyline_map::iterator last_polyline; + Poly_to_vertices_on_intersection_map poly_to_vertices_on_inter; + Poly_to_map_node polyhedron_to_map_node_to_polyhedron_vertex; + std::set non_manifold_nodes; //contain nodes that are original vertices of input polyhedron and that neighborhood is not a topological disk + std::map nodes_that_are_original_vertices;//to keep the correspondance between original polyhedron vertices that are also nodes + + Combinatorial_map_3_* final_map_ptr; + Combinatorial_map_3_& final_map() {return *final_map_ptr;} + bool final_map_comes_from_outside; + // new_hedge hedge + // -----------> -----------> + // v + // <----------- <----------- + // new_opposite opposite + // + Vertex_handle split_edge( Halfedge_handle hedge, + const typename Kernel::Point_3& point, + Polyhedron& P) + { + internal_IOP::Split_halfedge_at_point delegated(hedge,point); + P.delegate( delegated ); + CGAL_assertion(P.is_valid()); + + Vertex_handle v=boost::prior(P.vertices_end()); + CGAL_assertion(v->point()==point); + return v; + } + + //sort node ids so that we can split the hedge + //consecutively + template + void sort_vertices_along_hedge(std::vector& node_ids,Halfedge_handle hedge,const Node_vector& nodes) + { + std::sort(node_ids.begin(), + node_ids.end(), + internal_IOP::Order_along_a_halfedge(hedge,nodes) + ); + } + + //insert intersection as constrained edges in a CDT triangulation + template + void insert_constrained_edges_coplanar_case(int node_id, + CDT& triangulation, + std::map& id_to_CDT_vh) + { + if (node_id < number_coplanar_vertices){ + //XSL_TAG_CPL_VERT + //Insert constrained edges from coplanar facets that have been retriangulated. This ensure that triangulations are compatible + std::map< int,std::set >::iterator it_neighbors=coplanar_constraints.find(node_id); + if (it_neighbors!=coplanar_constraints.end()) + { + typename CDT::Vertex_handle vh=id_to_CDT_vh.find(node_id)->second; + for (std::set::iterator it_n=it_neighbors->second.begin();it_n!=it_neighbors->second.end();++it_n){ + typename std::map::iterator it_vh=id_to_CDT_vh.find(*it_n); + // this condition ensures to consider only graph edges that are in the same triangle (not in a neighbor one when involving node on a triangle edge) + // here we can't make the difference between a point on the interior or the boundary, so points_on_triangle is not used. + if ( it_vh!=id_to_CDT_vh.end() ){ + triangulation.insert_constraint(vh,id_to_CDT_vh.find(*it_n)->second); + } + } + } + } + } + //insert intersection as constrained edges in a CDT triangulation + template + void insert_constrained_edges(Node_ids& node_ids, //index of vertices we are interested in + CDT& triangulation, + std::map& id_to_CDT_vh, + Constrained_edges_map& constrained_edges, //list of pair of int to indicate edges that are constrained + bool points_on_triangle=false) + { + for (Node_ids::iterator it_node_id=node_ids.begin();it_node_id!=node_ids.end();++it_node_id){ + std::map< int,std::set >::iterator it_neighbors=graph_of_constraints.find(*it_node_id); + if (it_neighbors!=graph_of_constraints.end()) + { + typename CDT::Vertex_handle vh=id_to_CDT_vh.find(*it_node_id)->second; + for (std::set::iterator it_n=it_neighbors->second.begin();it_n!=it_neighbors->second.end();++it_n){ + typename std::map::iterator it_vh=id_to_CDT_vh.find(*it_n); + // this condition ensures to consider only graph edges that are in the same triangle (not in a neighbor one when involving node on a triangle edge) + if ( !points_on_triangle || it_vh!=id_to_CDT_vh.end() ){ + CGAL_assertion(it_vh!=id_to_CDT_vh.end()); + triangulation.insert_constraint(vh,id_to_CDT_vh.find(*it_n)->second); + constrained_edges.push_back(std::make_pair(*it_node_id,*it_n)); + } + } + } + #ifndef NDEBUG + else + { + std::cout << "X0: Found an isolated point" << std::endl; + } + #endif + + insert_constrained_edges_coplanar_case(*it_node_id,triangulation,id_to_CDT_vh); + } + } + + std::pair make_sorted_pair(int i,int j) const {return i indices,typename Polyhedron::Halfedge_handle hedge) + { + std::pair sorted_pair=make_sorted_pair(indices.first,indices.second); + typename An_edge_per_polyline_map::iterator it=an_edge_per_polyline.find(sorted_pair); + if (it!=an_edge_per_polyline.end()){ + it->second.first.insert(std::make_pair( P,sorted_pair.first==indices.first?hedge:hedge->opposite() )); + } + } + + int node_index_of_incident_vertex(Halfedge_const_handle h, + const std::map,Cmp_unik_ad >& border_halfedges) + { + //WARNING this may be expensive + typedef std::map,Cmp_unik_ad > Border_halfedges_map; + + Halfedge_const_handle start=h; + Halfedge_const_handle curr=start; + do{ + typename Border_halfedges_map::const_iterator it_border=border_halfedges.find( curr ); + if (it_border!=border_halfedges.end()) + return it_border->first==curr?it_border->second.second:it_border->second.first; + curr=curr->next()->opposite(); + }while(curr!=start); + + return -1; + } + + template + bool filtered_order_around_edge(int O_prime_index, + int O_index, + int P1_index, + int P2_index, + int Q_index, + Vertex_handle P1, + Vertex_handle P2, + Vertex_handle Q, + const Node_vector& nodes) + { + try{ + return is_in_interior_of_object( + nodes.interval_node(O_prime_index), + nodes.interval_node(O_index), + P1_index == -1 ? nodes.to_interval(P1->point()): nodes.interval_node(P1_index), + P2_index == -1 ? nodes.to_interval(P2->point()): nodes.interval_node(P2_index), + Q_index == -1 ? nodes.to_interval(Q->point()) : nodes.interval_node(Q_index ) + ); + } + catch(Uncertain_conversion_exception&){ + return is_in_interior_of_object( + nodes.exact_node(O_prime_index), + nodes.exact_node(O_index), + P1_index == -1 ? nodes.to_exact(P1->point()): nodes.exact_node(P1_index), + P2_index == -1 ? nodes.to_exact(P2->point()): nodes.exact_node(P2_index), + Q_index == -1 ? nodes.to_exact(Q->point()) : nodes.exact_node(Q_index ) + ); + } + } + +//keep track of the fact that a polyhedron original vertex is a node +void all_incident_faces_got_a_node_as_vertex(Halfedge_handle incident_to_vertex_edge,int node_id) +{ + nodes_that_are_original_vertices.insert(std::make_pair(incident_to_vertex_edge->vertex(),node_id)); +} + +//if an original polyhedron vertex is also a node, do no use a fake id +void set_triangle_boundary_indices( + Vertex_handle* triangle_boundary, + int* triangle_boundary_indices) +{ + triangle_boundary_indices[0]=-1; + triangle_boundary_indices[1]=-2; + triangle_boundary_indices[2]=-3; + + for (int k=0;k<3;++k){ + typename std::map::iterator it=nodes_that_are_original_vertices.find(triangle_boundary[k]); + if (it!=nodes_that_are_original_vertices.end()) + triangle_boundary_indices[k]=it->second; + } +} + +//======================================================================// +//functions internally used to glue piece of the final combinatorial map// +//======================================================================// + + + //-----first polyhedron +template +inline Dart_handle get_associated_dart(Halfedge_handle hedge,Halfedge_to_dart_map& selected_hedge_to_dart){ + typename Halfedge_to_dart_map::iterator it_saved_dart=selected_hedge_to_dart.find(hedge); + CGAL_assertion(it_saved_dart!=selected_hedge_to_dart.end()); + return it_saved_dart->second; +} + +//first_hedge defines four volumes, second_hedge only two +//first_poly is not needed as inside/outside volume is update during the merge +//of the sew. Only second_poly is needed +template +void sew_2_three_volumes_case( Halfedge_handle first_hedge, Halfedge_handle second_hedge, + const std::pair& indices, + const Node_vector& nodes, + Border_halfedges_map& border_halfedges, + Halfedge_to_dart_map& selected_hedge_to_dart, + Polyhedron* /*first_poly*/, Polyhedron* second_poly, + int mark_index, + std::set& darts_to_remove, + const std::pair& polyline_info) +{ + bool took_opposite=second_hedge->is_border(); + if (took_opposite) second_hedge=second_hedge->opposite(); + + Vertex_handle P1=first_hedge->opposite()->next()->vertex(); + Vertex_handle P2=first_hedge->next()->vertex(); + // when looking from the side of indices.second, the interior of the first polyhedron is described + // by turning counterclockwise from P1 to P2 + + Vertex_handle Q = second_hedge->next()->vertex(); + + //check if the third point of each triangular face is an original point (stay -1) + //or a intersection point (in that case we need the index of the corresponding node to + //have the exact value of the point) + int index_p1=node_index_of_incident_vertex(first_hedge->opposite()->next(),border_halfedges); + int index_p2=node_index_of_incident_vertex(first_hedge->next(),border_halfedges); + int index_q =node_index_of_incident_vertex(second_hedge->next(),border_halfedges); + + //Recover the dart that will be the start point of the different sewing + // dof_X_outside = dart of face of , meaning the triangle containing the + // point X and part of the volume outside of the corresponding polyhedron + //-----first polyhedron + Dart_handle dof_P1_outside = get_associated_dart(first_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_P2_outside = get_associated_dart(first_hedge,selected_hedge_to_dart); + //-----second polyhedron + Dart_handle dof_Q_outside = get_associated_dart(second_hedge,selected_hedge_to_dart); + + if (index_p1!=-1 && index_p1==index_q){ + Dart_handle top=dof_P1_outside->beta(3), not_top=took_opposite?dof_Q_outside->beta(3):dof_Q_outside; + Dart_handle down=dof_P1_outside, not_down=took_opposite?dof_Q_outside:dof_Q_outside->beta(3); + + if ( top->template attribute<3>()->info().is_empty ) std::swap(not_top,top); + if ( down->template attribute<3>()->info().is_empty ) std::swap(not_down,down); + CGAL_assertion( !top->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down->template attribute<3>()->info().is_empty ); + + sew_2_marked_darts( final_map(),top , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P1P2 or QP2 + sew_2_marked_darts( final_map(),dof_P2_outside , down ,mark_index, nodes, indices, polyline_info); //P2Q or P2P1 + sew_3_marked_darts( final_map(),not_top,not_down,top,down,mark_index,darts_to_remove); + + return; + } + + if (index_p2!=-1 && index_p2==index_q){ + Dart_handle top=dof_P2_outside->beta(3), not_top=took_opposite?dof_Q_outside:dof_Q_outside->beta(3); + Dart_handle down=dof_P2_outside, not_down=took_opposite?dof_Q_outside->beta(3):dof_Q_outside; + + if ( top->template attribute<3>()->info().is_empty ) std::swap(not_top,top); + if ( down->template attribute<3>()->info().is_empty ) std::swap(not_down,down); + CGAL_assertion( !top->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down->template attribute<3>()->info().is_empty ); + + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , top ,mark_index, nodes, indices, polyline_info); //P1Q or P1P2 + sew_2_marked_darts( final_map(),down , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //QP1 or P2P1 + sew_3_marked_darts( final_map(),not_top,not_down,top,down,mark_index,darts_to_remove); + + return; + } + + bool Q_is_between_P1P2 = filtered_order_around_edge(indices.first,indices.second,index_p1,index_p2,index_q,P1,P2,Q,nodes); + + + if (Q_is_between_P1P2) + { + // poly_first - poly_second = took_opposite?P1Q:QP2 + // poly_second - poly_first = {0} + // poly_first \cap poly_second = took_opposite?QP2:P1Q + // opposite( poly_first U poly_second ) = P2P1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , took_opposite?dof_Q_outside:dof_Q_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P1Q + sew_2_marked_darts( final_map(),took_opposite?dof_Q_outside->beta(3):dof_Q_outside , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //QP2 + sew_2_marked_darts( final_map(),dof_P2_outside , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //P2P1 + dof_P1_outside->template attribute<3>()->info().outside.insert(second_poly); //update P2P1 outside poly + } + else + { + // poly_first - poly_second = P1P2 + // poly_second - poly_first = took_opposite?QP1:P2Q + // poly_first \cap poly_second = {0} + // opposite( poly_first U poly_second ) = took_opposite?P2Q:QP1 + sew_2_marked_darts( final_map(),dof_P2_outside , took_opposite?dof_Q_outside:dof_Q_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P2Q + sew_2_marked_darts( final_map(),took_opposite?dof_Q_outside->beta(3):dof_Q_outside , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //QP1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P1P2 + dof_P1_outside->beta(3)->template attribute<3>()->info().outside.insert(second_poly); //update P1P2 outside poly + } +} + +//first_hedge defines two volumes, second_hedge only two +template +void sew_2_two_volumes_case( Halfedge_handle first_hedge, Halfedge_handle second_hedge, + Border_halfedges_map& border_halfedges, + Halfedge_to_dart_map& selected_hedge_to_dart, + int mark_index, + std::set& darts_to_remove, + const Node_vector& nodes, + const std::pair& indices, + const std::pair& polyline_info) +{ + bool first_took_opposite=first_hedge->is_border(); + if (first_took_opposite) first_hedge=first_hedge->opposite(); + bool second_took_opposite=second_hedge->is_border(); + if (second_took_opposite) second_hedge=second_hedge->opposite(); + + //-----first polyhedron + Dart_handle dof_P_outside = get_associated_dart(first_hedge,selected_hedge_to_dart); + //-----second polyhedron + Dart_handle dof_Q_outside = get_associated_dart(second_hedge,selected_hedge_to_dart); + + + + + int index_p =node_index_of_incident_vertex(first_hedge->next(),border_halfedges); + int index_q =node_index_of_incident_vertex(second_hedge->next(),border_halfedges); + + if (index_p!=-1 && index_q!=-1 && index_p==index_q){ + Dart_handle top=dof_P_outside, not_top=dof_Q_outside->beta(3); + Dart_handle down=dof_P_outside->beta(3), not_down=dof_Q_outside; + + if (first_took_opposite==second_took_opposite) + { + top=dof_P_outside->beta(3); not_top=dof_Q_outside->beta(3); + down=dof_P_outside; not_down=dof_Q_outside; + } + + if ( top->template attribute<3>()->info().is_empty ) std::swap(not_top,top); + if ( down->template attribute<3>()->info().is_empty ) std::swap(not_down,down); + CGAL_assertion( !top->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down->template attribute<3>()->info().is_empty ); + + sew_3_marked_darts( final_map(),not_top,not_down,top,down,mark_index,darts_to_remove); + + return; + } + + + + //since the edge is shared, the inside of each polyhedron must be on opposite orientation halfedges + if (first_took_opposite==second_took_opposite) + { + //sew out with in + sew_2_marked_darts( final_map(),dof_P_outside->beta(3) , dof_Q_outside ,mark_index, nodes, indices, polyline_info); //PQ + sew_2_marked_darts( final_map(),dof_Q_outside->beta(3) , dof_P_outside ,mark_index, nodes, indices, polyline_info); //QP + } + else + { + //sew in with in + sew_2_marked_darts( final_map(),dof_P_outside , dof_Q_outside ,mark_index, nodes, indices, polyline_info); //PQ + sew_2_marked_darts( final_map(),dof_Q_outside->beta(3), dof_P_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //QP + } +} + +//4 volume case with 2 identical volume +//Q2 is supposed to be identical to P2 +template +void sew_2_four_volumes_case_1( Halfedge_handle first_hedge, Halfedge_handle second_hedge, + const std::pair& indices, + const Node_vector& nodes, + int index_p1, int index_p2, int index_q1, + Halfedge_to_dart_map& selected_hedge_to_dart, + int mark_index, + std::set& darts_to_remove, + const std::pair& polyline_info, + bool swap_in_out_Q=false) +{ + Vertex_handle P1=first_hedge->opposite()->next()->vertex(); + Vertex_handle P2=first_hedge->next()->vertex(); + // when looking from the side of indices.second, the interior of the first polyhedron is described + // by turning counterclockwise from P1 to P2 + Vertex_handle Q1=second_hedge->opposite()->next()->vertex(); + // Vertex_handle Q2=second_hedge->next()->vertex(); + bool Q1_is_between_P1P2 = filtered_order_around_edge(indices.first,indices.second,index_p1,index_p2,index_q1,P1,P2,Q1,nodes); + + + //Recover the dart that will be the start point of the different sewing + // dof_X_outside = dart of face of , meaning the triangle containing the + // point X and part of the volume outside of the corresponding polyhedron + //-----first polyhedron + Dart_handle dof_P1_outside = get_associated_dart(first_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_P2_outside = get_associated_dart(first_hedge,selected_hedge_to_dart); + //-----second polyhedron + Dart_handle dof_Q1_outside = get_associated_dart(second_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_Q2_outside = get_associated_dart(second_hedge,selected_hedge_to_dart); + + if( swap_in_out_Q ){ + dof_Q1_outside=dof_Q1_outside->beta(3); + dof_Q2_outside=dof_Q2_outside->beta(3); + } + + if (Q1_is_between_P1P2){ + Dart_handle top=dof_Q2_outside->beta(3), not_top=dof_P2_outside->beta(3); + Dart_handle down=dof_Q2_outside, not_down=dof_P2_outside; + if ( top->template attribute<3>()->info().is_empty ) std::swap(not_top,top); + if ( down->template attribute<3>()->info().is_empty ) std::swap(not_down,down); + CGAL_assertion( !top->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down->template attribute<3>()->info().is_empty ); + + // poly_first - poly_second = P1Q1 + // poly_second - poly_first = {0} + // poly_first \cap poly_second = Q1P2 or Q1Q2 + // opposite( poly_first U poly_second ) = Q2P1 or P2P1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //P1Q1 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , top ,mark_index, nodes, indices, polyline_info); //Q1P2 or Q1Q2 + sew_2_marked_darts( final_map(),down , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //Q2P1 or P2P1 + sew_3_marked_darts( final_map(),not_top,not_down,top,down,mark_index,darts_to_remove); + + } + else{ + Dart_handle top=dof_Q2_outside->beta(3), not_top=dof_P2_outside->beta(3); + Dart_handle down=dof_Q2_outside, not_down=dof_P2_outside; + if ( top->template attribute<3>()->info().is_empty ) std::swap(not_top,top); + if ( down->template attribute<3>()->info().is_empty ) std::swap(not_down,down); + CGAL_assertion( !top->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down->template attribute<3>()->info().is_empty ); + + // poly_first - poly_second = {0} + // poly_second - poly_first = Q1P1 + // poly_first \cap poly_second = P1P2 or P1Q2 + // opposite( poly_first U poly_second ) = Q2Q1 or P2Q1 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //Q1P1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , top ,mark_index, nodes, indices, polyline_info); //P1P2 or P1Q2 + sew_2_marked_darts( final_map(),down , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //Q2Q1 or P2Q1 + sew_3_marked_darts( final_map(),not_top,not_down,top,down,mark_index,darts_to_remove); + } +} + +template +bool coplanar_triangles_case_handled(Halfedge_handle first_hedge,Halfedge_handle second_hedge, + const std::pair& indices, + const Node_vector& nodes, + int index_p1, int index_p2, int index_q1,int index_q2, + Halfedge_to_dart_map& selected_hedge_to_dart, + int mark_index, + std::set& darts_to_remove, + const std::pair& polyline_info) +{ + if( index_p1!=-1 ){ + if (index_p1==index_q1){ + if(index_p2!=-1){ + CGAL_assertion(index_p2!=index_q1); + if(index_p2==index_q2){ + //-----first polyhedron + Dart_handle dof_P1_outside = get_associated_dart(first_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_P2_outside = get_associated_dart(first_hedge,selected_hedge_to_dart); + //-----second polyhedron + Dart_handle dof_Q1_outside = get_associated_dart(second_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_Q2_outside = get_associated_dart(second_hedge,selected_hedge_to_dart); + + Dart_handle top_1=dof_P1_outside->beta(3), not_top_1=dof_Q1_outside->beta(3); + Dart_handle top_2=dof_P2_outside->beta(3), not_top_2=dof_Q2_outside->beta(3); + Dart_handle down_1=dof_P1_outside, not_down_1=dof_Q1_outside; + Dart_handle down_2=dof_P2_outside, not_down_2=dof_Q2_outside; + if ( top_1->template attribute<3>()->info().is_empty ) std::swap(top_1,not_top_1); + if ( top_2->template attribute<3>()->info().is_empty ) std::swap(top_2,not_top_2); + if ( down_1->template attribute<3>()->info().is_empty ) std::swap(down_1,not_down_1); + if ( down_2->template attribute<3>()->info().is_empty ) std::swap(down_2,not_down_2); + CGAL_assertion( !top_1->template attribute<3>()->info().is_empty ); + CGAL_assertion( !top_2->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down_1->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down_2->template attribute<3>()->info().is_empty ); + + // poly_first - poly_second = {0} + // poly_second - poly_first = {0} + // poly_first \cap poly_second = P1P2 or Q1Q2 or P1Q1 or Q1P2 + // opposite( poly_first U poly_second ) = P2P1 or Q2Q1 or P2Q1 or Q2P1 + sew_2_marked_darts( final_map(),top_1 , top_2 ,mark_index, nodes, indices, polyline_info); //P1P2 or Q1Q2 or P1Q1 or Q1P2 + sew_2_marked_darts( final_map(),down_2 , down_1 ,mark_index, nodes, indices, polyline_info); //P2P1 or Q2Q1 or P2Q1 or Q2P1 + sew_3_marked_darts( final_map(),not_top_1, not_down_1 ,top_1,down_1,mark_index,darts_to_remove); + sew_3_marked_darts( final_map(),not_top_2, not_down_2 ,top_2,down_2,mark_index,darts_to_remove); + return true; + } + } + sew_2_four_volumes_case_1(first_hedge->opposite(),second_hedge->opposite(),std::make_pair(indices.second,indices.first),nodes,index_p2,index_p1,index_q2,selected_hedge_to_dart,mark_index,darts_to_remove,polyline_info); + return true; + } + if (index_p1==index_q2){ + if(index_p2!=-1){ + CGAL_assertion(index_p2!=index_q2); + if(index_p2==index_q1){ + //-----first polyhedron + Dart_handle dof_P1_outside = get_associated_dart(first_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_P2_outside = get_associated_dart(first_hedge,selected_hedge_to_dart); + //-----second polyhedron + Dart_handle dof_Q1_outside = get_associated_dart(second_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_Q2_outside = get_associated_dart(second_hedge,selected_hedge_to_dart); + + Dart_handle top_1=dof_P1_outside->beta(3), not_top_1=dof_Q2_outside; + Dart_handle top_2=dof_P2_outside->beta(3), not_top_2=dof_Q1_outside; + Dart_handle down_1=dof_P1_outside, not_down_1=dof_Q2_outside->beta(3); + Dart_handle down_2=dof_P2_outside, not_down_2=dof_Q1_outside->beta(3); + if ( top_1->template attribute<3>()->info().is_empty ) std::swap(top_1,not_top_1); + if ( top_2->template attribute<3>()->info().is_empty ) std::swap(top_2,not_top_2); + if ( down_1->template attribute<3>()->info().is_empty ) std::swap(down_1,not_down_1); + if ( down_2->template attribute<3>()->info().is_empty ) std::swap(down_2,not_down_2); + CGAL_assertion( !top_1->template attribute<3>()->info().is_empty ); + CGAL_assertion( !top_2->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down_1->template attribute<3>()->info().is_empty ); + CGAL_assertion( !down_2->template attribute<3>()->info().is_empty ); + + // poly_first - poly_second = P1P2 or P1Q1 or Q2P2 or Q2Q1 + // poly_second - poly_first = Q1Q2 or Q1P1 or P2P1 or P2Q2 + // poly_first \cap poly_second = {0} + // opposite( poly_first U poly_second ) = all space + sew_2_marked_darts( final_map(),top_1 , top_2 ,mark_index, nodes, indices, polyline_info); //P1P2 or Q1Q2 or P1Q1 or Q1P2 + sew_2_marked_darts( final_map(),down_2 , down_1 ,mark_index, nodes, indices, polyline_info); //P2P1 or Q2Q1 or P2Q1 or Q2P1 + sew_3_marked_darts( final_map(),not_top_1, not_down_1 ,top_1,down_1,mark_index,darts_to_remove); + sew_3_marked_darts( final_map(),not_top_2, not_down_2 ,top_2,down_2,mark_index,darts_to_remove); + return true; + } + } + sew_2_four_volumes_case_1(first_hedge->opposite(),second_hedge,std::make_pair(indices.second,indices.first),nodes,index_p2,index_p1,index_q1,selected_hedge_to_dart,mark_index,darts_to_remove,polyline_info,true); + return true; + } + } + + if(index_p2!=-1){ + if (index_p2==index_q1){ + sew_2_four_volumes_case_1(first_hedge,second_hedge->opposite(),indices,nodes,index_p1,index_p2,index_q2,selected_hedge_to_dart,mark_index,darts_to_remove,polyline_info,true); + return true; + } + if(index_p2==index_q2){ + sew_2_four_volumes_case_1(first_hedge,second_hedge,indices,nodes,index_p1,index_p2,index_q1,selected_hedge_to_dart,mark_index,darts_to_remove,polyline_info); + return true; + } + } + + + return false; +} + +//===// +//end// +//===// + bool do_not_build_cmap; //set to true in the case only the corefinement must be done + int number_coplanar_vertices; //number of intersection points between coplanar facets, see fixes XSL_TAG_CPL_VERT +public: + Node_visitor_refine_polyhedra (Combinatorial_map_3_* ptr=NULL,bool do_not_build_cmap_=false):do_not_build_cmap(do_not_build_cmap_) + { + if (ptr!=NULL){ + final_map_comes_from_outside=true; + final_map_ptr=ptr; + } + else{ + final_map_comes_from_outside=false; + final_map_ptr=new Combinatorial_map_3_(); + } + } + + ~Node_visitor_refine_polyhedra(){ + if(!final_map_comes_from_outside) delete final_map_ptr; + } + + + typedef internal_IOP::Predicates_on_constructions Node_storage_type; + typedef Tag_false Is_polyhedron_const; + static const bool do_need_vertex_graph = true; //because we need to know which edges are constrained + + typedef Combinatorial_map_3_ Combinatorial_map_3; + typedef internal_IOP::Volume_info Volume_info; + + const Combinatorial_map_3& combinatorial_map() const {return *final_map_ptr;} + + void set_number_of_intersection_points_from_coplanar_facets(int n){ + number_coplanar_vertices=n; + } + + void check_node_on_non_manifold_vertex(int node_id,Halfedge_handle hedge){ + //we turn around the hedge and check no halfedge is a border halfedge + Halfedge_handle curr=hedge; + do{ + if ( curr->is_border_edge() ){ + non_manifold_nodes.insert(node_id); + return; + } + curr=curr->next()->opposite(); + } + while(curr!=hedge); + } + + void check_node_on_non_manifold_edge(int node_id,Halfedge_handle hedge){ + if ( hedge->is_border_edge() ) non_manifold_nodes.insert(node_id); + } + + void new_node_added(int node_id, + internal_IOP::Intersection_type type, + Halfedge_handle principal_edge, + Halfedge_handle additional_edge, + bool is_vertex_coplanar, + bool is_vertex_opposite_coplanar) + { + switch(type) + { + case internal_IOP::FACET: //Facet intersected by an edge + { + typename In_face_map::iterator it_fmap=in_face.insert(std::make_pair(additional_edge->face(), Node_ids())).first; + it_fmap->second.push_back(node_id); + } + break; + case internal_IOP::EDGE: //Edge intersected by an edge + { + typename In_halfedge_map::iterator it_hedge_map=in_hedge.insert(std::make_pair(additional_edge,Node_id_set())).first; + it_hedge_map->second.insert(node_id); + check_node_on_non_manifold_edge(node_id,additional_edge); + } + break; + case internal_IOP::VERTEX: + { + //grab original vertex that is on commom intersection + typename Hedge_to_polyhedron_map::iterator it=hedge_to_polyhedron.find(additional_edge->facet()->halfedge()); + CGAL_assertion(it!=hedge_to_polyhedron.end()); + poly_to_vertices_on_inter[it->second].insert(std::make_pair(node_id,additional_edge)); + polyhedron_to_map_node_to_polyhedron_vertex[it->second].insert(std::make_pair(node_id,additional_edge->vertex())); + all_incident_faces_got_a_node_as_vertex(additional_edge,node_id); + check_node_on_non_manifold_vertex(node_id,additional_edge); + } + break; + default: + return; + } + + CGAL_assertion(!is_vertex_coplanar || !is_vertex_opposite_coplanar); //coplanar edge are not forwarded + + + if ( is_vertex_coplanar ) + { + //grab original vertex that is on commom intersection + typename Hedge_to_polyhedron_map::iterator it=hedge_to_polyhedron.find(principal_edge->facet()->halfedge()); + poly_to_vertices_on_inter[it->second].insert(std::make_pair(node_id,principal_edge)); + polyhedron_to_map_node_to_polyhedron_vertex[it->second].insert(std::make_pair(node_id,principal_edge->vertex())); + all_incident_faces_got_a_node_as_vertex(principal_edge,node_id); + check_node_on_non_manifold_vertex(node_id,principal_edge); + } + else{ + if ( is_vertex_opposite_coplanar ){ + //grab original vertex that is on commom intersection + typename Hedge_to_polyhedron_map::iterator it=hedge_to_polyhedron.find(principal_edge->facet()->halfedge()); + poly_to_vertices_on_inter[it->second].insert(std::make_pair(node_id,principal_edge->opposite())); + polyhedron_to_map_node_to_polyhedron_vertex[it->second].insert(std::make_pair(node_id,principal_edge->opposite()->vertex())); + all_incident_faces_got_a_node_as_vertex(principal_edge->opposite(),node_id); + check_node_on_non_manifold_vertex(node_id,principal_edge->opposite()); + } + else{ + //handle intersection on principal edge + typename In_halfedge_map::iterator it_hedge_map=in_hedge.insert(std::make_pair(principal_edge,Node_id_set())).first; + it_hedge_map->second.insert(node_id); + check_node_on_non_manifold_edge(node_id,principal_edge); + } + } + } + + template + void annotate_graph(Iterator begin,Iterator end) + { +// std::cout << "Annotation graph..." << std::endl; + for (Iterator it=begin;it!=end;++it) + { + int node_id=it->first; + if (non_manifold_nodes.find(node_id)!=non_manifold_nodes.end()) it->second.make_terminal(); + const std::set& neighbors = it->second.neighbors; + graph_of_constraints.insert(std::make_pair(node_id,neighbors)); + } + } + + void update_terminal_nodes(std::vector&) + { + CGAL_assertion(!"Must not call this function"); + } + + void add_filtered_intersection(Halfedge_handle eh,Halfedge_handle fh,Polyhedron& Pe,Polyhedron& Pf){ + //use the representant halfedge of the facet as key + //--set polyhedron for the two facets incident to the edge + hedge_to_polyhedron.insert(std::make_pair(eh->facet()->halfedge(),&Pe)); + if ( !eh->opposite()->is_border() ) + hedge_to_polyhedron.insert(std::make_pair(eh->opposite()->facet()->halfedge(),&Pe)); + //--set polyhedron for the facet intersected by the edge + hedge_to_polyhedron.insert(std::make_pair(fh->facet()->halfedge(),&Pf)); + } + + + struct Polyhedron_face_boundary{ + std::vector node_ids_array[3]; // the node_ids on each halfedges + std::map hedges_ids; + Halfedge_handle halfedges[3]; //the three halfedges of the original face + Vertex_handle vertices[3]; //the three vertices of the original face + //node_ids_array[0] corresponds to the original edge vertices[0],vertices[1] = halfedges[0] + //node_ids_array[1] corresponds to the original edge vertices[1],vertices[2] = halfedges[1] + //node_ids_array[2] corresponds to the original edge vertices[2],vertices[0] = halfedges[2] + Polyhedron_face_boundary(Halfedge_handle first) + { + CGAL_assertion(first->next()->next()->next()==first); //the face is a triangle + hedges_ids.insert(std::make_pair(first,0)); + hedges_ids.insert(std::make_pair(first->next(),1)); + hedges_ids.insert(std::make_pair(first->next()->next(),2)); + halfedges[0]=first; + halfedges[1]=first->next(); + halfedges[2]=first->next()->next(); + + vertices[0]=halfedges[0]->opposite()->vertex(); + vertices[1]=halfedges[1]->opposite()->vertex(); + vertices[2]=halfedges[2]->opposite()->vertex(); + } + + //used when object was create with hedge but opposite was used to split the original face + void update_original_halfedge(Halfedge_handle original,Halfedge_handle new_hedge) + { + typename std::map::iterator it_id=hedges_ids.find(original); + CGAL_assertion(it_id!=hedges_ids.end()); + int index=it_id->second; + CGAL_assertion(halfedges[index]==original); + hedges_ids.erase(it_id); + hedges_ids.insert(std::make_pair(new_hedge,index)); + halfedges[index]=new_hedge; + } + + template + void copy_node_ids(Halfedge_handle hedge,Iterator begin,Iterator end) + { + typename std::map::iterator it_id=hedges_ids.find(hedge); + CGAL_assertion(it_id!=hedges_ids.end()); + std::copy(begin,end,std::back_inserter(node_ids_array[it_id->second])); + } + }; + + + void start_new_polyline(int i, int j) + { + if ( i==j ) //case of a single point + { + //TAG SL001 + //nothing is done + return; + } + std::pair res= + an_edge_per_polyline.insert( + std::make_pair( make_sorted_pair(i,j), + std::make_pair( std::map(),std::make_pair(false,0)) ) + ); + CGAL_assertion(res.second); + last_polyline=res.first; + if ( i !=last_polyline->first.first ) + last_polyline->second.second.first=true; + } + + void add_node_to_polyline(int){ + ++(last_polyline->second.second.second); + } + + void new_input_polyhedron(Polyhedron& P) + { + #ifndef NDEBUG + std::pair res = + #endif + polyhedron_to_map_node_to_polyhedron_vertex.insert(std::make_pair( &P,Node_to_polyhedron_vertex_map() )); + #ifndef NDEBUG + CGAL_assertion(res.second == true); + #endif + } + + //1) split_halfedges and retriangulate faces with no intersection point interior to the facet + //2) retriangulate using a constrained Delaunay triangulation each triangle in each Polyhedron that contains at least + // one intersection point inside the facet + //3) mark polyhedron edges that are on the intersection + //4) create one output polyhedron per connected component of polyhedron, connected by an edge which is not an intersection edge + //5) import each piece into a common combinatorial map + //6) glue all the pieces together + template + void finalize(const Node_vector& nodes){ + //mark halfedge that are on the intersection + //SL: I needed to use a map because to get the orientation around the edge, + // I need to know in the case the third vertex is a node its index (for exact construction) + typedef std::map,Cmp_unik_ad > Border_halfedges_map; + Border_halfedges_map border_halfedges; + + //Additionnal stuct to mark halfedge of the original polyhedra that are on the intersection + typedef Halfedge_marker Marker; + + //store for each triangle facet which boundary is intersected by the other surface, + //original vertices (and halfedges in the refined mesh pointing on these vertices) + typedef std::map Faces_boundary; + Faces_boundary faces_boundary; + + //0) For each polyhedron, collect original vertices that belongs to the intersection. + // From the graph of constaints, extract intersection edges that are incident to such vertices. In case + // there exists another original vertex adjacent to the first one found, this halfedge must be + // marked on the boundary (and possibly update an_edge_per_polyline). + // This is done first to avoid halfedges stored to be modified in the steps following. + for (typename Poly_to_vertices_on_intersection_map::iterator + it=poly_to_vertices_on_inter.begin(); + it!=poly_to_vertices_on_inter.end(); + ++it) + { + Polyhedron* poly=it->first; + std::set > already_done; + Node_to_target_of_hedge_map& nodes_to_hedge=it->second; + for(typename Node_to_target_of_hedge_map::iterator + it_node_2_hedge=nodes_to_hedge.begin(); + it_node_2_hedge!=nodes_to_hedge.end(); + ++it_node_2_hedge) + { + int node_id_of_first=it_node_2_hedge->first; + std::map< int,std::set >::iterator it_neighbors=graph_of_constraints.find(node_id_of_first); + if ( it_neighbors!=graph_of_constraints.end() ) + { + std::set& neighbors=it_neighbors->second; + for (std::set::iterator it_id=neighbors.begin();it_id!=neighbors.end();++it_id){ + if ( already_done.find(std::make_pair(*it_id,node_id_of_first))!=already_done.end() ) continue;//already done for the opposite + typename Node_to_target_of_hedge_map::iterator it_node_2_hedge_two=nodes_to_hedge.find(*it_id); + if ( it_node_2_hedge_two!=nodes_to_hedge.end() ) //a full edge is on intersection + { + //get the corresponding halfedge with vertex corresponding to node_id_of_first + Halfedge_handle hedge=it_node_2_hedge->second; + #ifndef NDEBUG + Halfedge_handle start=hedge; + #endif + while ( hedge->opposite()->vertex()!=it_node_2_hedge_two->second->vertex() ){ + hedge=hedge->next()->opposite(); + #ifndef NDEBUG + CGAL_assertion(hedge!=start); + #endif + } + std::pair edge_pair(*it_id,node_id_of_first); + border_halfedges.insert( std::make_pair(hedge,edge_pair) ); + Marker::mark(hedge); + update_edge_per_polyline(poly,edge_pair,hedge); + //save the fact that we already handle this edge + already_done.insert(std::make_pair(node_id_of_first,*it_id)); + } + } + } + #ifdef CGAL_COREFINEMENT_DEBUG + else + { + std::cout << "X1: Found an isolated point" << std::endl; + } + #endif + } + } + + //1) First split halfedges cut by the intersection polyline(s) + for (typename In_halfedge_map::iterator it=in_hedge.begin();it!=in_hedge.end();++it) + { + Halfedge_handle hedge=it->first; //the halfedge to be split (and its opposite too) + Node_ids node_ids; //indices of the intersection points to be inserted + //we used a set to avoid having duplicated nodes reported on an edge of two coplanar triangles + std::copy(it->second.begin(),it->second.end(),std::back_inserter(node_ids)); + typename Hedge_to_polyhedron_map::iterator it_poly=hedge_to_polyhedron.find( hedge->facet()->halfedge() ); + CGAL_assertion(it_poly!=hedge_to_polyhedron.end()); + Polyhedron* P=it_poly->second; //the polyhedron in which vertices should be added + + sort_vertices_along_hedge(node_ids,hedge,nodes); + + //save original face and nodes for face of hedge (1) + if ( !hedge->is_border() ){ + typename Faces_boundary::iterator it_face=faces_boundary.find(hedge->face()); + if (it_face==faces_boundary.end()) + it_face=faces_boundary.insert(std::make_pair(hedge->face(),Polyhedron_face_boundary(hedge))).first; + it_face->second.copy_node_ids(hedge,node_ids.begin(),node_ids.end()); + } + + //save original face and nodes for face of hedge->opposite (2) + typename Faces_boundary::iterator opposite_original_info=faces_boundary.end(); + if ( !hedge->opposite()->is_border() ){ + opposite_original_info=faces_boundary.find(hedge->opposite()->face()); + if (opposite_original_info==faces_boundary.end()) + opposite_original_info=faces_boundary.insert(std::make_pair(hedge->opposite()->face(),Polyhedron_face_boundary(hedge->opposite()))).first; + opposite_original_info->second.copy_node_ids(hedge->opposite(),node_ids.rbegin(),node_ids.rend()); + } + + typename Poly_to_map_node::iterator it_map=polyhedron_to_map_node_to_polyhedron_vertex.find(P); + CGAL_assertion(it_map!=polyhedron_to_map_node_to_polyhedron_vertex.end()); + //a map to identify the vertex in the polyhedron corresponding to an intersection point + Node_to_polyhedron_vertex_map& node_to_polyhedron_vertex=it_map->second; + + #ifndef NDEBUG + Vertex_handle original_vertex=hedge->opposite()->vertex(); + #endif + + //We need an edge incident to the source vertex of hedge. This is the first opposite edge created. + bool first=true; Halfedge_handle hedge_incident_to_src; + //do split the edges + for (std::vector::const_iterator it_id=node_ids.begin();it_id!=node_ids.end();++it_id){ + Vertex_handle v=split_edge(hedge,nodes[*it_id],*P); + node_to_polyhedron_vertex.insert(std::make_pair(*it_id,v)); + if (first){ + first=false; + hedge_incident_to_src=hedge->opposite()->next(); + } + } + + #ifndef NDEBUG + CGAL_assertion(hedge_incident_to_src->vertex()==original_vertex); + CGAL_assertion(hedge_incident_to_src->face()==hedge->opposite()->face()); + #endif + + //save original face and nodes for face of hedge->opposite (2) + if ( !hedge->opposite()->is_border() ){ + CGAL_assertion(opposite_original_info!=faces_boundary.end()); + opposite_original_info->second.update_original_halfedge(hedge->opposite(),hedge_incident_to_src); + } + + //insert the two incident faces in in_face map so that they will be triangulated. + if (!hedge->is_border()) in_face.insert(std::make_pair(hedge->face(),Node_ids())); + if (!hedge->opposite()->is_border()) in_face.insert(std::make_pair(hedge->opposite()->face(),Node_ids())); + } + + //2)triangulation of the triangle faces containing intersection point in their interior + // and also those with intersection points only on the boundary. + for (typename In_face_map::iterator it=in_face.begin();it!=in_face.end();++it) + { + Face_handle f = it->first; //the face to be retriangulated + Node_ids& node_ids = it->second; //the index of the intersection point that are interior to the face + typename Faces_boundary::iterator it_fb=faces_boundary.find(f); + + + typename Hedge_to_polyhedron_map::iterator it_polyhedron = hedge_to_polyhedron.find (f->halfedge()); //we can do this because the halfedge is still the same (at least its address)+no Face::set_halfedge called + CGAL_assertion(it_polyhedron != hedge_to_polyhedron.end()); + Polyhedron* P=it_polyhedron->second; + typename Poly_to_map_node::iterator it_map=polyhedron_to_map_node_to_polyhedron_vertex.find(P); + CGAL_assertion(it_map!=polyhedron_to_map_node_to_polyhedron_vertex.end()); + //a map to identify the vertex in the polyhedron corresponding to an intersection point + Node_to_polyhedron_vertex_map& node_to_polyhedron_vertex=it_map->second; + + std::map id_to_CDT_vh; + + //associate an edge of the triangulation to a halfedge in a given polyhedron + std::map,Halfedge_handle> edge_to_hedge; + + Vertex_handle triangle_boundary[3]; + int triangle_boundary_indices[3]; //the node_id of the triangle original vertex or a fake id + if (it_fb!=faces_boundary.end()){ //the boundary of the triangle face was refined + triangle_boundary[0]=it_fb->second.vertices[0]; + triangle_boundary[1]=it_fb->second.vertices[1]; + triangle_boundary[2]=it_fb->second.vertices[2]; + set_triangle_boundary_indices(triangle_boundary,triangle_boundary_indices); + } + else{ + triangle_boundary[0]=f->halfedge()->vertex(); //-1 + triangle_boundary[1]=f->halfedge()->next()->vertex(); //-2 + triangle_boundary[2]=f->halfedge()->next()->next()->vertex(); //-3 + CGAL_assertion(f->halfedge()->next()->next()->next()==f->halfedge());//check this is a triangle + set_triangle_boundary_indices(triangle_boundary,triangle_boundary_indices); + edge_to_hedge.insert (std::make_pair( std::make_pair( triangle_boundary_indices[2],triangle_boundary_indices[0] ) , f->halfedge() ) ); + edge_to_hedge.insert (std::make_pair( std::make_pair( triangle_boundary_indices[0],triangle_boundary_indices[1] ) , f->halfedge()->next() ) ); + edge_to_hedge.insert (std::make_pair( std::make_pair( triangle_boundary_indices[1],triangle_boundary_indices[2] ) , f->halfedge()->next()->next() ) ); + } + + + #ifdef DO_NO_USE_EXACT_CDT + typename Kernel::Plane_3 plane(triangle_boundary[0]->point(),triangle_boundary[1]->point(),triangle_boundary[2]->point()); + #else + CGAL::Cartesian_converter convert; + typename Exact_kernel::Plane_3 plane(convert(triangle_boundary[0]->point()),convert(triangle_boundary[1]->point()),convert(triangle_boundary[2]->point())); + #endif + CDT triangulation; + //insert point inside face + for (std::vector::iterator it_node_id=node_ids.begin();it_node_id!=node_ids.end();++it_node_id){ + #ifdef DO_NO_USE_EXACT_CDT + typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes[*it_node_id])); + #else + typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes.exact_node(*it_node_id))); + #endif + vh->info()=*it_node_id; + id_to_CDT_vh.insert(std::make_pair(*it_node_id,vh)); + } + + + typename CDT::Vertex_handle triangle_vertices[3]; + #ifdef DO_NO_USE_EXACT_CDT + triangle_vertices[0]=triangulation.insert(plane.to_2d(triangle_boundary[0]->point())); + triangle_vertices[1]=triangulation.insert(plane.to_2d(triangle_boundary[1]->point())); + triangle_vertices[2]=triangulation.insert(plane.to_2d(triangle_boundary[2]->point())); + #else + //we can do this because these are input points. + triangle_vertices[0]=triangulation.insert(plane.to_2d(convert(triangle_boundary[0]->point()))); + triangle_vertices[1]=triangulation.insert(plane.to_2d(convert(triangle_boundary[1]->point()))); + triangle_vertices[2]=triangulation.insert(plane.to_2d(convert(triangle_boundary[2]->point()))); + #endif + + triangle_vertices[0]->info()=triangle_boundary_indices[0]; + triangle_vertices[1]->info()=triangle_boundary_indices[1]; + triangle_vertices[2]->info()=triangle_boundary_indices[2]; + //insert face_extremities: we use operator[] because indice -1,-2,-3 are used in each loop and are specific to the current face + node_to_polyhedron_vertex[-1]=triangle_boundary[0]; + node_to_polyhedron_vertex[-2]=triangle_boundary[1]; + node_to_polyhedron_vertex[-3]=triangle_boundary[2]; + + //if one of the triangle original vertex is also a node + for (int ik=0;ik<3;++ik){ + if ( triangle_boundary_indices[ik]>=0 ) + id_to_CDT_vh.insert(std::make_pair(triangle_boundary_indices[ik],triangle_vertices[ik])); + } + //insert points on edges + #ifdef DO_NO_USE_EXACT_CDT + //and constrains these edges + #endif + if (it_fb!=faces_boundary.end()) //is there at least one intersection point on the boundary of the face? + { + //in the following loop, for each original edge of the triangle, we insert the constrained edges + // and we recover the halfedge_handle corresponding to these constrained (they are already in the polyhedron) + for (int i=0;i<3;++i){ +// std::cerr << "Boundary edges" << std::endl; +// std::cerr << " " << -1-i <second.node_ids_array[i]; + typename CDT::Vertex_handle previous=triangle_vertices[i]; + int previous_index=triangle_boundary_indices[i]; //index of original Polyhedron vertex + Halfedge_handle hedge = it_fb->second.halfedges[ (i+2) % 3]->next(); + CGAL_assertion( hedge->opposite()->vertex()==it_fb->second.vertices[i] ); + if (!bounding_ids.empty()){ //is there al least one intersection point on this edge? + for (Node_ids::iterator it_id=bounding_ids.begin();it_id!=bounding_ids.end();++it_id){ +// std::cerr << " "<< *it_id << std::endl; + #ifdef DO_NO_USE_EXACT_CDT + typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes[*it_id])); + #else + typename CDT::Vertex_handle vh=triangulation.insert(plane.to_2d(nodes.exact_node(*it_id))); + #endif + vh->info()=*it_id; + id_to_CDT_vh.insert(std::make_pair(*it_id,vh)); + #ifdef DO_NO_USE_EXACT_CDT + triangulation.insert_constraint(previous,vh); + #endif + edge_to_hedge.insert (std::make_pair( std::make_pair(previous_index,*it_id),hedge) ); + previous=vh; + hedge=hedge->next(); + previous_index=*it_id; + } + } + else{ + CGAL_assertion( it_fb->second.halfedges[i]->vertex() == it_fb->second.vertices[ (i+1) % 3 ] ); + CGAL_assertion( it_fb->second.halfedges[i]->opposite()->vertex() == it_fb->second.vertices[ i ] ); + } + CGAL_assertion(hedge==it_fb->second.halfedges[i]); + edge_to_hedge.insert (std::make_pair( std::make_pair(previous_index,triangle_boundary_indices[(i+1) % 3]) , it_fb->second.halfedges[i] ) ); +// std::cerr << " " << -1 - ( (i+1) % 3 ) < > constrained_edges; + + //insert constraints that are interior to the triangle (in the case no edges are collinear in the meshes) + insert_constrained_edges(node_ids,triangulation,id_to_CDT_vh,constrained_edges); + + //insert constraints between points that are on the boundary (not a contrained on the triangle boundary) + if (it_fb!=faces_boundary.end()) //is there at least one intersection point on the boundary of the face? + { + for (int i=0;i<3;++i){ + Node_ids& bounding_ids=it_fb->second.node_ids_array[i]; + insert_constrained_edges(bounding_ids,triangulation,id_to_CDT_vh,constrained_edges,true); + } + } + + //insert coplanar edges for endpoints of triangles + for (int i=0;i<3;++i){ + int nindex=triangle_vertices[i]->info(); + if ( nindex >=0 ) + insert_constrained_edges_coplanar_case(nindex,triangulation,id_to_CDT_vh); + } + + //XSL_TAG_CPL_VERT + //collect edges incident to a point that is the intersection of two coplanar faces. + //This ensure that triangulations are compatible. + if (it_fb!=faces_boundary.end()) //is there at least one intersection point on the boundary of the face? + { + for (typename CDT::Finite_vertices_iterator vit=triangulation.finite_vertices_begin(), + vit_end=triangulation.finite_vertices_end();vit_end!=vit;++vit) + { + //skip original vertices (that are not nodes) and non-coplanar facet issued vertices + //(this is working because intersection points between coplanar facets are the first inserted) + if ( vit->info() < 0 || vit->info() >= number_coplanar_vertices) continue; + std::map< int,std::set >::iterator res=coplanar_constraints.insert(std::make_pair(vit->info(),std::set())).first; + //turn around the vertex and get incident edge + typename CDT::Edge_circulator start=triangulation.incident_edges(vit); + typename CDT::Edge_circulator curr=start; + do{ + if (triangulation.is_infinite(*curr) ) continue; + typename CDT::Edge mirror_edge=triangulation.mirror_edge(*curr); + if ( triangulation.is_infinite( curr->first->vertex(curr->second) ) || + triangulation.is_infinite( mirror_edge.first->vertex(mirror_edge.second) ) ) + continue; //skip edges that are on the boundary of the triangle (these are already constrained) + //insert edges in the set of constraints + int nindex = + curr->first->vertex( (curr->second+1)%3 )==static_cast(vit)? + (curr->second+2)%3:(curr->second+1)%3; + typename CDT::Vertex_handle vn=curr->first->vertex(nindex); + if ( vit->info() > vn->info() ) continue; //take only one out of the two edges + skip negative vn->info() + CGAL_assertion(vn->info()>=0); + res->second.insert( vn->info() ).second; + }while(start!=++curr); + } + +// this is a working alternative that should be slower +// for (typename CDT::Finite_edges_iterator eit=triangulation.finite_edges_begin(), +// eit_end=triangulation.finite_edges_end();eit_end!=eit;++eit) +// { +// typename CDT::Edge mirror_edge=triangulation.mirror_edge(*eit); +// if ( triangulation.is_infinite( eit->first->vertex(eit->second) ) || +// triangulation.is_infinite( mirror_edge.first->vertex(mirror_edge.second) ) ) +// continue; //skip edges that are on the boundary of the triangle (these are already constrained) +// typename CDT::Vertex_handle v1=eit->first->vertex( (eit->second+1)%3 ), +// v2=eit->first->vertex( (eit->second+2)%3 ); +// if (v1->info()<0 || v2->info()<0) continue; +// if ( v1->info() > v2->info() ) std::swap(v1,v2); +// coplanar_constraints.insert(std::make_pair(v1->info(),std::set())).first->second.insert(v2->info()); +// } + } + + + //create a modifier to insert nodes and copy the triangulation of the face + //inside the polyhedron + internal_IOP::Triangulate_a_face modifier(f,nodes,node_ids,node_to_polyhedron_vertex,edge_to_hedge,triangulation); + + CGAL_assertion(P->is_valid()); + P->delegate(modifier); + CGAL_assertion(P->is_valid()); + + //3) mark halfedges that are common to two polyhedral surfaces + //recover halfedges inserted that are on the intersection + for (std::list >::iterator it_cst=constrained_edges.begin();it_cst!=constrained_edges.end();++it_cst) + { + typename std::map,Halfedge_handle>::iterator it_poly_hedge=edge_to_hedge.find(*it_cst); + //we cannot have an assertion here in the case an edge or part of an edge is a constraints. + //Indeed, the graph_of_constraints report an edge 0,1 and 1,0 for example while only one of the two + //is defined as one of them defines an adjacent face + //CGAL_assertion(it_poly_hedge!=edge_to_hedge.end()); + if( it_poly_hedge!=edge_to_hedge.end() ){ + border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),*it_cst) ); + Marker::mark(it_poly_hedge->second); + update_edge_per_polyline(P,it_poly_hedge->first,it_poly_hedge->second); + } + else{ + //WARNING: in few case this is needed if the marked edge is on the border + //to optimize it might be better to only use sorted pair. TAG_SLXX1 + std::pair opposite_pair(it_cst->second,it_cst->first); + it_poly_hedge=edge_to_hedge.find(opposite_pair); + CGAL_assertion( it_poly_hedge!=edge_to_hedge.end() ); + + border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),opposite_pair) ); + Marker::mark(it_poly_hedge->second); + update_edge_per_polyline(P,it_poly_hedge->first,it_poly_hedge->second); + } + } + } + + if (do_not_build_cmap) return; + + //4) create one output polyhedron per connected component of polyhedron, + // connected by an edge which is not an intersection edge + //5) import into a Combinatorial map + #ifdef CGAL_COREFINEMENT_DEBUG + std::cout << "Nb marked edges " << border_halfedges.size() << std::endl; +// for (typename Border_halfedges_map::iterator it=border_halfedges.begin();it!=border_halfedges.end();++it) +// std::cout << it->first->opposite()->vertex()->point() << " " << it->first->vertex()->point() << " is constrained " << std::endl; + std::cout << "Nb polylines " << an_edge_per_polyline.size() << std::endl; + #endif + + internal_IOP::Non_intersection_halfedge criterium(border_halfedges); + + int mark_index=final_map().get_new_mark(); //mark used to tag dart that are on an intersection + + //define a map that will contain the correspondance between selected halfedges of the boundary and + //their corresponding Dart_handle in the cmap. + typedef std::map > Halfedge_to_dart_map; + Halfedge_to_dart_map selected_hedge_to_dart; + for (typename An_edge_per_polyline_map::iterator it=an_edge_per_polyline.begin();it!=an_edge_per_polyline.end();++it) + { + CGAL_assertion(it->second.first.size()==2); + //orientation of faces around the edge (to be sure we can do it) + Halfedge_handle first_hedge=it->second.first.begin()->second; + Halfedge_handle second_hedge=boost::next(it->second.first.begin())->second; + + if (!first_hedge->is_border()) selected_hedge_to_dart.insert(std::make_pair(first_hedge,Dart_handle(NULL))); + if (!first_hedge->opposite()->is_border()) selected_hedge_to_dart.insert(std::make_pair(first_hedge->opposite(),Dart_handle(NULL))); + if (!second_hedge->is_border()) selected_hedge_to_dart.insert(std::make_pair(second_hedge,Dart_handle(NULL))); + if (!second_hedge->opposite()->is_border()) selected_hedge_to_dart.insert(std::make_pair(second_hedge->opposite(),Dart_handle(NULL))); + } + + #ifdef CGAL_COREFINEMENT_DEBUG + int polynb=0; + #endif + for (typename Poly_to_map_node::iterator + it=polyhedron_to_map_node_to_polyhedron_vertex.begin(); + it!=polyhedron_to_map_node_to_polyhedron_vertex.end(); + ++it + ) + { + typedef typename Polyhedron::Facet_const_handle Facet_const_handle; + typedef ::CGAL::Union_find UF; + typedef typename UF::handle UF_handle; + typedef typename UF::iterator UF_iterator; + typedef std::map,internal::Compare_handle_ptr > Result; + typedef std::map > Facet_to_handle_map; + + UF uf; + Facet_to_handle_map map_f2h; + Result result; + Polyhedron* current_poly=it->first; + + #ifdef CGAL_COREFINEMENT_DEBUG + std::cout << "writing poly debug"<< std::endl; + std::stringstream ss; + ss << "output_debug-" << ++polynb << ".off"; + std::ofstream output_debug(ss.str().c_str()); + output_debug << *current_poly; + #endif + + extract_connected_components(*(current_poly),criterium,uf,map_f2h,result); + + + //add each connected component in the map with 2 volumes per component. + for (typename Result::iterator it_res=result.begin();it_res!=result.end();++it_res) + { + //create in the final Cmap a 2D component containing faces of a connected component + //(twice: one with same orientation and one with the opposite orientation to model the other volume) + Dart_handle d = import_from_polyhedron_subset(final_map(),it_res->second.begin(),it_res->second.end(),criterium,selected_hedge_to_dart,mark_index); + //set an attribute to one volume represented by this component to indicates + //a part outside of the polyhedron current_poly + typename Combinatorial_map_3_::template Attribute_range<3>::type::iterator attrib=final_map().template create_attribute<3>(); + attrib->info().outside.insert(current_poly); + final_map().template set_attribute<3>(d,attrib); + //set the attribute for the opposite volume: represent a part inside current_poly + attrib=final_map().template create_attribute<3>(); + attrib->info().inside.insert(current_poly); + final_map().template set_attribute<3>(d->beta(3),attrib); + + #ifdef CGAL_COREFINEMENT_DEBUG + final_map().display_characteristics(std::cout); + std::cout << std::endl; + #endif + } + } + #ifndef NDEBUG + for(typename Halfedge_to_dart_map::iterator it=selected_hedge_to_dart.begin();it!=selected_hedge_to_dart.end();++it) + CGAL_assertion(it->second!=Dart_handle(NULL)); + #endif + + CGAL_assertion(final_map().is_valid()); + + std::set darts_to_remove; + + //6) Glue pieces together + // using one edge per intersection polyline, we merge the different volumes + for (typename An_edge_per_polyline_map::iterator it=an_edge_per_polyline.begin();it!=an_edge_per_polyline.end();++it) + { + CGAL_assertion(it->second.first.size()==2); + //orientation of faces around the edge (to be sure we can do it) + std::pair indices = it->first; + const std::pair& polyline_info=it->second.second; + + //get the two halfedges incident to the edge [indices.first,indices.second] + Halfedge_handle first_hedge=it->second.first.begin()->second; + Halfedge_handle second_hedge=boost::next(it->second.first.begin())->second; + + CGAL_assertion(nodes[indices.second]==first_hedge->vertex()->point()); + CGAL_assertion(nodes[indices.first]==first_hedge->opposite()->vertex()->point()); + CGAL_assertion(nodes[indices.second]==second_hedge->vertex()->point()); + CGAL_assertion(nodes[indices.first]==second_hedge->opposite()->vertex()->point()); + + Polyhedron* first_poly = it->second.first.begin()->first; + Polyhedron* second_poly = boost::next(it->second.first.begin())->first; + + //different handling depending on the number of incident triangles to the edge. + //After sewing there are two,three or four volumes if there are two,three or four incident triangles respectively + if ( first_hedge->is_border() || first_hedge->opposite()->is_border() ){ + if (second_hedge->is_border() || second_hedge->opposite()->is_border()) + sew_2_two_volumes_case(first_hedge,second_hedge,border_halfedges,selected_hedge_to_dart,mark_index,darts_to_remove,nodes,indices,polyline_info); + else + sew_2_three_volumes_case(second_hedge, first_hedge,indices,nodes,border_halfedges,selected_hedge_to_dart,second_poly,first_poly,mark_index,darts_to_remove,polyline_info); + } + else + if (second_hedge->is_border() || second_hedge->opposite()->is_border()) + sew_2_three_volumes_case(first_hedge, second_hedge,indices,nodes,border_halfedges,selected_hedge_to_dart,first_poly,second_poly,mark_index,darts_to_remove,polyline_info); + else + { + //Sort the four triangle facets around their common edge + // we suppose that the exterior of the polyhedron is indicated by + // counterclockwise oriented facets. + Vertex_handle P1=first_hedge->opposite()->next()->vertex(); + Vertex_handle P2=first_hedge->next()->vertex(); + // when looking from the side of indices.second, the interior of the first polyhedron is described + // by turning counterclockwise from P1 to P2 + Vertex_handle Q1=second_hedge->opposite()->next()->vertex(); + Vertex_handle Q2=second_hedge->next()->vertex(); + // when looking from the side of indices.second, the interior of the second polyhedron is described + // by turning from Q1 to Q2 + + //check if the third point of each triangular face is an original point (stay -1) + //or a intersection point (in that case we need the index of the corresponding node to + //have the exact value of the point) + int index_p1=node_index_of_incident_vertex(first_hedge->opposite()->next(),border_halfedges); + int index_p2=node_index_of_incident_vertex(first_hedge->next(),border_halfedges); + int index_q1=node_index_of_incident_vertex(second_hedge->opposite()->next(),border_halfedges); + int index_q2=node_index_of_incident_vertex(second_hedge->next(),border_halfedges); + + #ifdef CGAL_COREFINEMENT_DEBUG + std::cout << index_p1 << " " << index_p2 << " " << index_q1 << " " <point() << " | " << P2->point() << " | " << Q1->point() << " | " <point() << std::endl; + #endif + + if ( coplanar_triangles_case_handled(first_hedge,second_hedge,indices,nodes,index_p1,index_p2,index_q1,index_q2,selected_hedge_to_dart,mark_index,darts_to_remove,polyline_info) ) + continue; + + CGAL_assertion(P1->point() !=Q1->point() && P1->point()!=Q2->point() && P2->point() !=Q1->point() && P2->point()!=Q2->point()); + + bool Q1_is_between_P1P2 = filtered_order_around_edge(indices.first,indices.second,index_p1,index_p2,index_q1,P1,P2,Q1,nodes); + bool Q2_is_between_P1P2 = filtered_order_around_edge(indices.first,indices.second,index_p1,index_p2,index_q2,P1,P2,Q2,nodes); + + + //Recover the dart that will be the start point of the different sewing + // dof_X_outside = dart of face of , meaning the triangle containing the + // point X and part of the volume outside of the corresponding polyhedron + //-----first polyhedron + Dart_handle dof_P1_outside = get_associated_dart(first_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_P2_outside = get_associated_dart(first_hedge,selected_hedge_to_dart); + //-----second polyhedron + Dart_handle dof_Q1_outside = get_associated_dart(second_hedge->opposite(),selected_hedge_to_dart); + Dart_handle dof_Q2_outside = get_associated_dart(second_hedge,selected_hedge_to_dart); + + if ( Q1_is_between_P1P2 ){ + if( Q2_is_between_P1P2 ) + { + bool P1_is_between_Q1Q2 = filtered_order_around_edge(indices.first,indices.second,index_q1,index_q2,index_p1,Q1,Q2,P1,nodes); + if (!P1_is_between_Q1Q2){ + // poly_first - poly_second = P1Q1 U Q2P2 + // poly_second - poly_first = {0} + // poly_first \cap poly_second = Q1Q2 + // opposite( poly_first U poly_second ) = P2P1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //P1Q1 + sew_2_marked_darts( final_map(),dof_Q2_outside , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //Q2P2 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , dof_Q2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //Q1Q2 + sew_2_marked_darts( final_map(),dof_P2_outside , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //P2P1 + //update inside outside info (because darts from the same volume have been merged) + dof_Q1_outside->beta(3)->template attribute<3>()->info().inside.insert(first_poly); //update Q1Q2 inside poly + dof_P2_outside->template attribute<3>()->info().outside.insert(second_poly);//update P2P1 outside poly + } + else{ + // poly_first - poly_second = Q2Q1 + // poly_second - poly_first = P2P1 + // poly_first \cap poly_second = P1Q2 U Q1P2 + // opposite( poly_first U poly_second ) = {O} + sew_2_marked_darts( final_map(),dof_Q2_outside , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //Q2Q1 + sew_2_marked_darts( final_map(),dof_P2_outside , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //P2P1 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //Q1P2 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_Q2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P1Q2 + //update inside outside info (because darts from the same volume have been merged) + dof_Q2_outside->template attribute<3>()->info().inside.insert(first_poly); //update Q2Q1 inside poly + dof_P2_outside->template attribute<3>()->info().inside.insert(second_poly);//update P2P1 inside poly + } + } + else + { + // poly_first - poly_second = P1Q1 + // poly_second - poly_first = P2Q2 + // poly_first \cap poly_second = Q1P2 + // opposite( poly_first U poly_second ) = Q2P1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //P1Q1 + sew_2_marked_darts( final_map(),dof_P2_outside , dof_Q2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P2Q2 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //Q1P2 + sew_2_marked_darts( final_map(),dof_Q2_outside , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //Q2P1 + } + } + else + { + if( Q2_is_between_P1P2 ) + { + // poly_first - poly_second = Q2P2 + // poly_second - poly_first = Q1P1 + // poly_first \cap poly_second = P1Q2 + // opposite( poly_first U poly_second ) = P2Q1 + sew_2_marked_darts( final_map(),dof_Q2_outside , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //Q2P2 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //Q1P1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_Q2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P1Q2 + sew_2_marked_darts( final_map(),dof_P2_outside , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //P2Q1 + } + else + { + bool P1_is_between_Q1Q2 = filtered_order_around_edge(indices.first,indices.second,index_q1,index_q2,index_p1,Q1,Q2,P1,nodes); + if (!P1_is_between_Q1Q2){ + // poly_first - poly_second = P1P2 + // poly_second - poly_first = Q1Q2 + // poly_first \cap poly_second = {0} + // opposite( poly_first U poly_second ) = P2Q1 U Q2P1 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P1P2 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , dof_Q2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //Q1Q2 + sew_2_marked_darts( final_map(),dof_P2_outside , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //P2Q1 + sew_2_marked_darts( final_map(),dof_Q2_outside , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //Q2P1 + //update inside outside info (because darts from the same volume have been merged) + dof_Q1_outside->beta(3)->template attribute<3>()->info().outside.insert(first_poly); //update Q1Q2 outside poly + dof_P1_outside->beta(3)->template attribute<3>()->info().outside.insert(second_poly);//update P2P1 outside poly + } + else{ + // poly_first - poly_second = {0} + // poly_second - poly_first = Q1P1 U P2Q2 + // poly_first \cap poly_second = P1P2 + // opposite( poly_first U poly_second ) = Q2Q1 + sew_2_marked_darts( final_map(),dof_Q1_outside->beta(3) , dof_P1_outside ,mark_index, nodes, indices, polyline_info); //Q1P1 + sew_2_marked_darts( final_map(),dof_P2_outside , dof_Q2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P2Q2 + sew_2_marked_darts( final_map(),dof_P1_outside->beta(3) , dof_P2_outside->beta(3) ,mark_index, nodes, indices, polyline_info); //P1P2 + sew_2_marked_darts( final_map(),dof_Q2_outside , dof_Q1_outside ,mark_index, nodes, indices, polyline_info); //Q2Q1 + //update inside outside info (because darts from the same volume have been merged) + dof_P1_outside->beta(3)->template attribute<3>()->info().inside.insert(second_poly); //update P1P2 inside poly + dof_Q2_outside->template attribute<3>()->info().outside.insert(first_poly);//update Q2Q1 outside poly + } + } + } + } + } + + #ifdef CGAL_COREFINEMENT_DEBUG + std::cout << "number of darts to remove: " << darts_to_remove.size() <::iterator itdart=darts_to_remove.begin(),end=darts_to_remove.end();itdart!=end;++itdart){ + final_map().erase_dart(*itdart); + } + + //remove empty volumes + typedef typename Combinatorial_map_3_::template Attribute_range<3>::type Volume_attribute_range; + Volume_attribute_range& ratrib=final_map().template attributes<3>(); + typename Volume_attribute_range::iterator curr=ratrib.begin(),end=ratrib.end(); + do{ + if (curr->info().is_empty) + final_map().template erase_attribute<3>(curr++); + else + ++curr; + } + while(curr!=end); + + CGAL_assertion(final_map().is_valid()); + + //update the info of each volume knowing about only one polyhedron: + //this happens when one polyhedron has a connected component + //that do not intersect the other polyhedron + typedef CGAL::Polyhedral_mesh_domain_3 Mesh_domain; + CGAL_precondition(polyhedron_to_map_node_to_polyhedron_vertex.size()==2); + Polyhedron* Poly_A = polyhedron_to_map_node_to_polyhedron_vertex.begin()->first; + Polyhedron* Poly_B = boost::next(polyhedron_to_map_node_to_polyhedron_vertex.begin())->first; + Mesh_domain* domain_A_ptr=NULL; + Mesh_domain* domain_B_ptr=NULL; + + #ifdef CGAL_COREFINEMENT_DEBUG + final_map().display_characteristics(std::cout); std::cout << "\n"; + #endif + + typename Combinatorial_map_3::template One_dart_per_cell_range<3> cell_range=final_map().template one_dart_per_cell<3>(); + for (typename Combinatorial_map_3::template One_dart_per_cell_range<3>::iterator + it = cell_range.begin(), it_end=cell_range.end(); + it_end!= it; + ++it ) + { + internal_IOP::Volume_info& info=it->template attribute<3>()->info(); + std::size_t inside_size=info.inside.size(); + std::size_t outside_size=info.outside.size(); + if ( inside_size + outside_size == 1) + { + bool is_inside = (inside_size==1); + Polyhedron* current_poly= is_inside? (*info.inside.begin()):(*info.outside.begin()); + Polyhedron* test_poly; + Mesh_domain* domain_ptr; + if ( current_poly==Poly_A) + { + test_poly=Poly_B; + if (domain_B_ptr == NULL) domain_B_ptr=new Mesh_domain(*Poly_B); + domain_ptr=domain_B_ptr; + } + else + { + test_poly=Poly_A; + if (domain_A_ptr == NULL) domain_A_ptr=new Mesh_domain(*Poly_A); + domain_ptr=domain_A_ptr; + } + typename Mesh_domain::Is_in_domain is_in_domain(*domain_ptr); + typename Kernel::Point_3 query=it->template attribute<0>()->point(); + if ( is_in_domain(query) ) + info.inside.insert(test_poly); + else + info.outside.insert(test_poly); + } + + #ifdef CGAL_COREFINEMENT_DEBUG + std::cout << "This volume has inside: "; + for (typename std::set::iterator itpoly=info.inside.begin();itpoly!=info.inside.end();++itpoly) + std::cout << " " << *itpoly; + std::cout << " and outside: "; + for (typename std::set::iterator itpoly=info.outside.begin();itpoly!=info.outside.end();++itpoly) + std::cout << " " << *itpoly; + std::cout << std::endl; + #endif + } + if (domain_A_ptr!=NULL) delete domain_A_ptr; + if (domain_B_ptr!=NULL) delete domain_B_ptr; + + } +}; + +}//namespace CGAL + + + +#endif //CGAL_INTERSECTION_OF_POLYHEDRA_3_REFINEMENT_VISITOR_H diff --git a/Polyhedron_IO/examples/Polyhedron_IO/terr_trian.cpp b/Polyhedron_IO/examples/Polyhedron_IO/terr_trian.cpp index 995cd640504..ef896159368 100644 --- a/Polyhedron_IO/examples/Polyhedron_IO/terr_trian.cpp +++ b/Polyhedron_IO/examples/Polyhedron_IO/terr_trian.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -34,7 +34,7 @@ typedef CGAL::Simple_cartesian SC; typedef CGAL::Filtered_kernel Kernel; typedef Indexed_point IPoint; -typedef CGAL::Triangulation_euclidean_traits_xy_3 Gtraits; +typedef CGAL::Projection_traits_xy_3 Gtraits; struct Gt : public Gtraits { typedef IPoint Point; diff --git a/Polyhedron_IO/include/CGAL/IO/Polyhedron_VRML_2_ostream.h b/Polyhedron_IO/include/CGAL/IO/Polyhedron_VRML_2_ostream.h index 737eaa53543..2511cf41ec1 100644 --- a/Polyhedron_IO/include/CGAL/IO/Polyhedron_VRML_2_ostream.h +++ b/Polyhedron_IO/include/CGAL/IO/Polyhedron_VRML_2_ostream.h @@ -32,9 +32,7 @@ namespace CGAL { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> VRML_2_ostream& operator<<( VRML_2_ostream& out, diff --git a/Polyhedron_IO/include/CGAL/IO/Polyhedron_geomview_ostream.h b/Polyhedron_IO/include/CGAL/IO/Polyhedron_geomview_ostream.h index 85631511445..ee899ccd4a0 100644 --- a/Polyhedron_IO/include/CGAL/IO/Polyhedron_geomview_ostream.h +++ b/Polyhedron_IO/include/CGAL/IO/Polyhedron_geomview_ostream.h @@ -64,9 +64,7 @@ public: template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> Geomview_stream& operator<<( Geomview_stream &gv, diff --git a/Polyhedron_IO/include/CGAL/IO/Polyhedron_inventor_ostream.h b/Polyhedron_IO/include/CGAL/IO/Polyhedron_inventor_ostream.h index 3c6e8d7941c..60e8414efc4 100644 --- a/Polyhedron_IO/include/CGAL/IO/Polyhedron_inventor_ostream.h +++ b/Polyhedron_IO/include/CGAL/IO/Polyhedron_inventor_ostream.h @@ -30,9 +30,7 @@ namespace CGAL { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> Inventor_ostream_base& operator<<( Inventor_ostream_base& out, diff --git a/Polyhedron_IO/include/CGAL/IO/Polyhedron_iostream.h b/Polyhedron_IO/include/CGAL/IO/Polyhedron_iostream.h index c96495ef8b0..717fb064cda 100644 --- a/Polyhedron_IO/include/CGAL/IO/Polyhedron_iostream.h +++ b/Polyhedron_IO/include/CGAL/IO/Polyhedron_iostream.h @@ -30,9 +30,7 @@ namespace CGAL { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> std::ostream& operator<<( std::ostream& out, const Polyhedron_3& P) { @@ -45,9 +43,7 @@ operator<<( std::ostream& out, const Polyhedron_3& P) { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> std::istream& operator>>(std::istream& in, Polyhedron_3& P) { diff --git a/Polyhedron_IO/include/CGAL/IO/print_OFF.h b/Polyhedron_IO/include/CGAL/IO/print_OFF.h index 7d3a836c75c..ec5f96c1a51 100644 --- a/Polyhedron_IO/include/CGAL/IO/print_OFF.h +++ b/Polyhedron_IO/include/CGAL/IO/print_OFF.h @@ -55,9 +55,7 @@ void print_polyhedron_OFF( std::ostream& out, template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void print_OFF( std::ostream& out, @@ -73,9 +71,7 @@ print_OFF( std::ostream& out, template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void print_OFF( std::ostream& out, diff --git a/Polyhedron_IO/include/CGAL/IO/print_VRML_1.h b/Polyhedron_IO/include/CGAL/IO/print_VRML_1.h index e12337a1556..af17be56551 100644 --- a/Polyhedron_IO/include/CGAL/IO/print_VRML_1.h +++ b/Polyhedron_IO/include/CGAL/IO/print_VRML_1.h @@ -35,9 +35,7 @@ void print_polyhedron_VRML_1( std::ostream& out, const Polyhedron& P) { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void print_VRML_1( std::ostream& out, diff --git a/Polyhedron_IO/include/CGAL/IO/print_VRML_2.h b/Polyhedron_IO/include/CGAL/IO/print_VRML_2.h index a18c8d32046..40ac5682044 100644 --- a/Polyhedron_IO/include/CGAL/IO/print_VRML_2.h +++ b/Polyhedron_IO/include/CGAL/IO/print_VRML_2.h @@ -35,9 +35,7 @@ void print_polyhedron_VRML_2( std::ostream& out, const Polyhedron& P) { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void print_VRML_2( std::ostream& out, diff --git a/Polyhedron_IO/include/CGAL/IO/print_inventor.h b/Polyhedron_IO/include/CGAL/IO/print_inventor.h index 3dde3c3cbf7..841438a6811 100644 --- a/Polyhedron_IO/include/CGAL/IO/print_inventor.h +++ b/Polyhedron_IO/include/CGAL/IO/print_inventor.h @@ -36,9 +36,7 @@ void print_polyhedron_inventor( std::ostream& out, const Polyhedron& P) { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void print_inventor( std::ostream& out, diff --git a/Polyhedron_IO/include/CGAL/IO/print_wavefront.h b/Polyhedron_IO/include/CGAL/IO/print_wavefront.h index 7301ad7132a..a367097d64e 100644 --- a/Polyhedron_IO/include/CGAL/IO/print_wavefront.h +++ b/Polyhedron_IO/include/CGAL/IO/print_wavefront.h @@ -38,9 +38,7 @@ void print_polyhedron_wavefront( std::ostream& out, const Polyhedron& P) { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void print_wavefront( std::ostream& out, diff --git a/Polyhedron_IO/include/CGAL/IO/scan_OFF.h b/Polyhedron_IO/include/CGAL/IO/scan_OFF.h index 0f1c160e834..b99ee2a842c 100644 --- a/Polyhedron_IO/include/CGAL/IO/scan_OFF.h +++ b/Polyhedron_IO/include/CGAL/IO/scan_OFF.h @@ -29,9 +29,7 @@ namespace CGAL { template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void scan_OFF( std::istream& in, Polyhedron_3& P, @@ -48,9 +46,7 @@ void scan_OFF( std::istream& in, template < class Traits, class Items, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HDS, class Alloc> void scan_OFF( std::istream& in, Polyhedron_3& P, bool verbose = false) { diff --git a/Polynomial/include/CGAL/Polynomial/determinant.h b/Polynomial/include/CGAL/Polynomial/determinant.h index d357973cb4e..e81496048e5 100644 --- a/Polynomial/include/CGAL/Polynomial/determinant.h +++ b/Polynomial/include/CGAL/Polynomial/determinant.h @@ -134,7 +134,7 @@ namespace internal { template inline typename M::NT inexact_determinant_select (const M& matrix, int n, - other type) + other /* type */) { return det_berkowitz(matrix, n); } diff --git a/Polynomial/include/CGAL/Polynomial/subresultants.h b/Polynomial/include/CGAL/Polynomial/subresultants.h index 5589ee0e3af..3f65194b30e 100644 --- a/Polynomial/include/CGAL/Polynomial/subresultants.h +++ b/Polynomial/include/CGAL/Polynomial/subresultants.h @@ -777,11 +777,11 @@ namespace CGAL { typename OutputIterator2, typename OutputIterator3> OutputIterator1 polynomial_subresultants_with_cofactors_ - (typename Polynomial_traits_d::Polynomial_d P, - typename Polynomial_traits_d::Polynomial_d Q, + (typename Polynomial_traits_d::Polynomial_d /* P */, + typename Polynomial_traits_d::Polynomial_d /* Q */, OutputIterator1 sres_out, - OutputIterator2 coP_out, - OutputIterator3 coQ_out, + OutputIterator2 /* coP_out */, + OutputIterator3 /* coQ_out */, CGAL::Integral_domain_without_division_tag) { // polynomial_subresultants_with_cofactors requires // a model of IntegralDomain as coefficient type; diff --git a/Polynomial/test/Polynomial/sturm_habicht_sequence.cpp b/Polynomial/test/Polynomial/sturm_habicht_sequence.cpp index 80a7ccc35b8..d9ac6e6c228 100644 --- a/Polynomial/test/Polynomial/sturm_habicht_sequence.cpp +++ b/Polynomial/test/Polynomial/sturm_habicht_sequence.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/Qt_widget/include/CGAL/IO/Qt_help_window.h b/Qt_widget/include/CGAL/IO/Qt_help_window.h index 7a95a9bd60c..c490f28b355 100644 --- a/Qt_widget/include/CGAL/IO/Qt_help_window.h +++ b/Qt_widget/include/CGAL/IO/Qt_help_window.h @@ -79,7 +79,6 @@ private: QComboBox *pathCombo; int backwardId, forwardId; QStringList history; - QPopupMenu *hist; QMap mHistory; }; diff --git a/Qt_widget/include/CGAL/IO/Qt_widget_focus.h b/Qt_widget/include/CGAL/IO/Qt_widget_focus.h index 09311bb20c6..1689377e6b1 100644 --- a/Qt_widget/include/CGAL/IO/Qt_widget_focus.h +++ b/Qt_widget/include/CGAL/IO/Qt_widget_focus.h @@ -42,7 +42,6 @@ namespace CGAL { class Qt_widget_focus : public Qt_widget_layer { private: - int x2, y2; QPixmap *mouse_ico1, *mouse_ico2, *mouse_ico3; diff --git a/Qt_widget/src/CGALQt3/CMakeLists.txt b/Qt_widget/src/CGALQt3/CMakeLists.txt index 536ca0b0b47..7d9f3f45627 100644 --- a/Qt_widget/src/CGALQt3/CMakeLists.txt +++ b/Qt_widget/src/CGALQt3/CMakeLists.txt @@ -1,25 +1,11 @@ -project (CGAL_Qt3) +message("Configuring libCGAL_Qt3") -# Minimal version of CMake: -cmake_minimum_required(VERSION 2.6.2) - -# Tested version: -if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) - if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) - cmake_policy(VERSION 2.8.4) - else() - cmake_policy(VERSION 2.6) - endif() -endif() - -if ( NOT CGAL_FOUND ) - find_package(CGAL REQUIRED) -endif() - -include(${CGAL_USE_FILE}) +# added as ometimes CMake will refuse to compile files +# that one would think it would automatically know what to do with (e.g. C files): +ENABLE_LANGUAGE(C) +# see also http://david-web.appspot.com/cnt/CMakeProblemsSolutions/ find_package(OpenGL QUIET ) - find_package(Qt3-patched QUIET ) # FindQt3-patched.cmake is FindQt3.cmake patched by CGAL developers, so # that it can be used together with FindQt4: all its variables are prefixed @@ -29,7 +15,6 @@ if( QT3_FOUND ) if( OPENGL_FOUND ) - get_dependency_version(OPENGL) get_dependency_version(QT QT3) if(COMMAND add_config_flag) @@ -37,7 +22,6 @@ if( QT3_FOUND ) add_config_flag( CGAL_HAS_QT3 ) endif() - message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" ) message( STATUS "OpenGL include: ${OPENGL_INCLUDE_DIR}" ) message( STATUS "OpenGL libraries: ${OPENGL_LIBRARIES}" ) message( STATUS "OpenGL definitions: ${OPENGL_DEFINITIONS}" ) @@ -52,9 +36,13 @@ if( QT3_FOUND ) cache_set(CGAL_Qt3_3RD_PARTY_DEFINITIONS ${QT3_DEFINITIONS} ${OPENGL_DEFINITIONS} ) include(Qt3Macros-patched) + + use_essential_libs() include_directories( ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt3_3RD_PARTY_INCLUDE_DIRS} ) + link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) + # Make sure QT3_AUTOMOC compiler can find CGALQt3 include files include_directories( BEFORE ${CGAL_INCLUDE_DIRS} ) @@ -75,7 +63,7 @@ if( QT3_FOUND ) # message(STATUS QT3-mocfiles: ${CGAL_Qt3_MOC_FILES}) - build_cgal_library( CGAL_Qt3 CGALQt3 "${CGAL_Qt3_MOC_FILES}") + collect_cgal_library( CGAL_Qt3 CGALQt3 "${CGAL_Qt3_MOC_FILES}") foreach(mocfile ${CGAL_Qt3_MOC_FILES}) add_file_dependencies(${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp ${CMAKE_CURRENT_BINARY_DIR}/${mocfile}) @@ -87,6 +75,9 @@ if( QT3_FOUND ) add_definitions( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt3_3RD_PARTY_DEFINITIONS} ) + message("libCGAL_Qt3 is configured") + + else() message( STATUS "CGAL_Qt3 needs OpenGL, cannot be configured.") endif() diff --git a/Qt_widget/src/CGALQt3/Qt_help_window.cpp b/Qt_widget/src/CGALQt3/Qt_help_window.cpp index cc01b41267e..da7db75edec 100644 --- a/Qt_widget/src/CGALQt3/Qt_help_window.cpp +++ b/Qt_widget/src/CGALQt3/Qt_help_window.cpp @@ -223,8 +223,6 @@ void Qt_help_window::print() void Qt_help_window::pathSelected( const QString &_path ) { browser->setSource( _path ); - // if ( mHistory.values().contains(_path) ) - // mHistory[ hist->insertItem( _path ) ] = _path; } void Qt_help_window::histChosen( int i ) { diff --git a/Ridges_3/examples/Ridges_3/CMakeLists.txt b/Ridges_3/examples/Ridges_3/CMakeLists.txt index c0dc65b03ea..c595d80fe14 100644 --- a/Ridges_3/examples/Ridges_3/CMakeLists.txt +++ b/Ridges_3/examples/Ridges_3/CMakeLists.txt @@ -18,7 +18,7 @@ if ( CGAL_FOUND ) include( CGAL_CreateSingleSourceCGALProgram ) # use either Eigen or BLAS/LAPACK - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) find_package(LAPACK) if(LAPACK_FOUND) diff --git a/Ridges_3/test/Ridges_3/CMakeLists.txt b/Ridges_3/test/Ridges_3/CMakeLists.txt index 4ad42adab7e..a059d681f5b 100644 --- a/Ridges_3/test/Ridges_3/CMakeLists.txt +++ b/Ridges_3/test/Ridges_3/CMakeLists.txt @@ -22,7 +22,7 @@ if ( CGAL_FOUND ) include( CGAL_CreateSingleSourceCGALProgram ) # use either Eigen or BLAS/LAPACK - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) find_package(LAPACK) if(LAPACK_FOUND) diff --git a/STL_Extension/doc_tex/STL_Extension/main.tex b/STL_Extension/doc_tex/STL_Extension/main.tex index de28c5f647f..8a8d72c9828 100644 --- a/STL_Extension/doc_tex/STL_Extension/main.tex +++ b/STL_Extension/doc_tex/STL_Extension/main.tex @@ -154,3 +154,13 @@ list. Specifying that one wishes to use the default is simply done by omitting it. This is however possible only at the end of the list. \ccc{CGAL::Default} provides a simple mechanism that performs something equivalent anywhere in the sequence. + +\section{C++ 11 wrappers} + +Wrappers for the classes \ccc{array} and \ccc{tuple} which, based on +availability, either use the version of {\em Boost} or the one +provided by the standard library are provided in the namespace +\ccc{CGAL::cpp11}. The namespace alias \ccc{CGAL::cpp0x} is provided +for backward compatibility. Those are documented for completeness and +implementers. They are not intended to be used by users of the +library. diff --git a/STL_Extension/doc_tex/STL_Extension_ref/array.tex b/STL_Extension/doc_tex/STL_Extension_ref/array.tex index 8d6e3727c01..c202f0bb8de 100644 --- a/STL_Extension/doc_tex/STL_Extension_ref/array.tex +++ b/STL_Extension/doc_tex/STL_Extension_ref/array.tex @@ -10,14 +10,14 @@ %% +=========================================================================+ -\begin{ccRefClass}{cpp0x::array} +\begin{ccRefClass}{cpp11::array} \ccDefinition An object of the class \ccClassTemplateName\ represents an array of elements of type \ccc{T}, the number of which is specified by the second template argument. -There is actually no class in namespace \ccc{CGAL::cpp0x} with this name, but a using declaration which +There is actually no class in namespace \ccc{CGAL::cpp11} with this name, but a using declaration which imports a class from another namespace. By order of priority: the one in namespace \ccc{std} is used (provided by C++0x), if not found, then the one in namespace \ccc{std::tr1} is used (provided by TR1), and finally, the fallback solution diff --git a/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex b/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex index dc3804c965d..acee0bae49f 100644 --- a/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex +++ b/STL_Extension/doc_tex/STL_Extension_ref/stl_extension.tex @@ -38,7 +38,6 @@ %% +---------------------------------------------+ \begin{ccRefFunction}{cpp0x::prev} \label{sectionPrev} - \label{sectionGenericFunctions} If C++0x is available the function \ccc{std::prev} is imported into the namespace \ccc{CGAL::cpp0x}, otherwise \ccc{CGAL::cpp0x::prev} is declared with the signature as given in $\mathsection 24.4.4$ of the ISO C++ Standard @@ -60,7 +59,6 @@ %% +---------------------------------------------+ \begin{ccRefFunction}{predecessor} \label{sectionPredecessor} - \label{sectionGenericFunctions} This function is deprecated. \ccc{CGAL::cpp0x::prev} should be used instead. diff --git a/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex b/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex index b366e999da4..e44e31eb6d1 100644 --- a/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex +++ b/STL_Extension/doc_tex/STL_Extension_ref/tuple.tex @@ -10,14 +10,14 @@ %% +=========================================================================+ -\begin{ccRefClass}{cpp0x::tuple<...>} +\begin{ccRefClass}{cpp11::tuple<...>} \ccDefinition An object of the class \ccClassTemplateName\ represents a heterogeneous tuple of elements of the types specified in parameters, which are in variadic number. -There is actually no class in namespace \ccc{CGAL::cpp0x} with this name, but a using declaration which +There is actually no class in namespace \ccc{CGAL::cpp11} with this name, but a using declaration which imports a class from another namespace. By order of priority: the one in namespace \ccc{std} is used (provided by C++0x), if not found, then the one in namespace \ccc{std::tr1} is used (provided by TR1), and finally, the fallback solution @@ -32,8 +32,9 @@ is taken from Boost. \ccHeading{Free functions and helper classes} Some free functions part of the standard interface of \ccc{tuple} are also -brought in namespace \ccc{CGAL::cpp0x} with using declarations, these are \ccc{make_tuple}, -\ccc{get}, \ccc{tie}. +brought in namespace \ccc{CGAL::cpp11} with using declarations, these are \ccc{make_tuple}, +\ccc{get}, \ccc{tie}. Like in C++0x, the \ccc{get} function template is +specialized so that it can take \ccc{std::pair} as argument. Two standard helper classes are also provided for convenience (\ccc{tuple_size} and \ccc{tuple_element}). \end{ccRefClass} diff --git a/STL_Extension/include/CGAL/algorithm.h b/STL_Extension/include/CGAL/algorithm.h index 3432683bec0..05f7e2cbae6 100644 --- a/STL_Extension/include/CGAL/algorithm.h +++ b/STL_Extension/include/CGAL/algorithm.h @@ -38,7 +38,7 @@ namespace CGAL { -namespace cpp0x { +namespace cpp11 { #ifndef CGAL_CFG_NO_CPP0X_NEXT_PREV using std::next; using std::prev; @@ -54,7 +54,9 @@ namespace cpp0x { return boost::prior(x, n); } #endif -} +} // namespace cpp11 + +namespace cpp0x = cpp11; // copy_n is usually in the STL as well, but not in the official // standard. We provide our own copy_n. It is planned for C++0x. @@ -91,13 +93,16 @@ OutputIterator copy_n( InputIterator first, Size n, OutputIterator result ) } #endif // CGAL_CFG_NO_CPP0X_COPY_N -namespace cpp0x { +namespace cpp11 { #ifndef CGAL_CFG_NO_CPP0X_COPY_N using std::copy_n; #else using CGAL::copy_n; #endif -} // cpp0x +} // cpp11 + +namespace cpp0x = cpp11; + // Not documented template inline diff --git a/STL_Extension/include/CGAL/array.h b/STL_Extension/include/CGAL/array.h index 7644d77c185..eee9d005fc0 100644 --- a/STL_Extension/include/CGAL/array.h +++ b/STL_Extension/include/CGAL/array.h @@ -31,7 +31,7 @@ namespace CGAL { -namespace cpp0x { +namespace cpp11 { #ifndef CGAL_CFG_NO_CPP0X_ARRAY using std::array; @@ -41,12 +41,13 @@ using std::tr1::array; using boost::array; #endif -} // cpp0x +} // cpp11 +namespace cpp0x = cpp11; // This using is just for short-term backward-compat, people should take the // habit to use CGAL::cpp0x::array. -using cpp0x::array; +using cpp11::array; // The make_array() function simply constructs an std::array. @@ -80,61 +81,61 @@ using cpp0x::array; template< typename T, typename... Args > inline -cpp0x::array< T, 1 + sizeof...(Args) > +cpp11::array< T, 1 + sizeof...(Args) > make_array(const T & t, const Args & ... args) { - cpp0x::array< T, 1 + sizeof...(Args) > a = { { t, static_cast(args)... } }; + cpp11::array< T, 1 + sizeof...(Args) > a = { { t, static_cast(args)... } }; return a; } #else // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES template < typename T > inline -cpp0x::array +cpp11::array make_array(const T& b1) { - cpp0x::array a = { { b1 } }; + cpp11::array a = { { b1 } }; return a; } template < typename T > inline -cpp0x::array +cpp11::array make_array(const T& b1, const T& b2) { - cpp0x::array a = { { b1, b2 } }; + cpp11::array a = { { b1, b2 } }; return a; } template < typename T > inline -cpp0x::array +cpp11::array make_array(const T& b1, const T& b2, const T& b3) { - cpp0x::array a = { { b1, b2, b3 } }; + cpp11::array a = { { b1, b2, b3 } }; return a; } template < typename T > inline -cpp0x::array +cpp11::array make_array(const T& b1, const T& b2, const T& b3, const T& b4) { - cpp0x::array a = { { b1, b2, b3, b4 } }; + cpp11::array a = { { b1, b2, b3, b4 } }; return a; } template < typename T > inline -cpp0x::array +cpp11::array make_array(const T& b1, const T& b2, const T& b3, const T& b4, const T& b5) { - cpp0x::array a = { { b1, b2, b3, b4, b5 } }; + cpp11::array a = { { b1, b2, b3, b4, b5 } }; return a; } template < typename T > inline -cpp0x::array +cpp11::array make_array(const T& b1, const T& b2, const T& b3, const T& b4, const T& b5, const T& b6) { - cpp0x::array a = { { b1, b2, b3, b4, b5, b6 } }; + cpp11::array a = { { b1, b2, b3, b4, b5, b6 } }; return a; } diff --git a/STL_Extension/include/CGAL/is_streamable.h b/STL_Extension/include/CGAL/is_streamable.h new file mode 100644 index 00000000000..0decd728953 --- /dev/null +++ b/STL_Extension/include/CGAL/is_streamable.h @@ -0,0 +1,84 @@ +// Copyright (c) 2012 GeometryFactory Sarl (France) +// All rights reserved. +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// 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, Philipp Moeller + +#ifndef CGAL_IS_STREAMABLE_H +#define CGAL_IS_STREAMABLE_H + +#include +#include +#include +#include + +namespace CGAL { +namespace internal { +namespace is_streamable +{ + // A tag type returned by operator == for the any struct in this namespace + // when T does not support ==. + struct tag {}; + + // This type soaks up any implicit conversions and makes the following operator == + // less preferred than any other such operator found via ADL. + struct any + { + // Conversion constructor for any type. + template + any(T const&); + }; + + tag operator<<(any const&, any const&); + tag operator>>(any const&, any const&); + + // Two overloads to distinguish whether T supports a certain operator expression. + // The first overload returns a reference to a two-element character array and is chosen if + // T does not support the expression, such as ==, whereas the second overload returns a char + // directly and is chosen if T supports the expression. So using sizeof(check()) + // returns 2 for the first overload and 1 for the second overload. + typedef char yes; + typedef char (&no)[2]; + + no check(tag); + + template + yes check(T const&); + + template + struct is_streamable_impl + { + static typename boost::remove_cv::type>::type const & x; + static typename boost::remove_cv::type>::type & y; + + static const bool value = + sizeof(is_streamable::check(std::cout << x)) == sizeof(is_streamable::yes) && + sizeof(is_streamable::check(std::cin >> y)) == sizeof(is_streamable::yes); + }; + +} // end namespace internal::is_streamable +} // end namespace internal + + +/// is_streamable is a meta-function that checks if a type is streamable +/// +/// is_streamable::value is true iff the type T has stream operators << +/// and >>. Otherwise it is false. +template +struct is_streamable + : internal::is_streamable::is_streamable_impl {}; + +} // end namespace CGAL + +#endif // CGAL_IS_STREAMABLE_H diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 33636da9d3a..28ba59bd001 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -1237,7 +1237,7 @@ class Dispatch_output_iterator < cpp0x::tuple, cpp0x::tuple > static const int size = sizeof...(V); template - friend class internal::Derivator; + friend struct internal::Derivator; public: @@ -1296,7 +1296,7 @@ class Dispatch_or_drop_output_iterator < cpp0x::tuple, cpp0x::tuple typedef Dispatch_output_iterator< cpp0x::tuple, cpp0x::tuple > Base; template - friend class internal::Derivator; + friend struct internal::Derivator; public: diff --git a/STL_Extension/include/CGAL/min_max_n.h b/STL_Extension/include/CGAL/min_max_n.h index cd21566b8cb..3050fadfd83 100644 --- a/STL_Extension/include/CGAL/min_max_n.h +++ b/STL_Extension/include/CGAL/min_max_n.h @@ -71,6 +71,10 @@ min_n(const T& t0, const T& t1, const T& t2, const T& t3, const T& t4, { return (std::min)(t0, min_n(t1, t2, t3, t4, t5, t6, t7)); } +template inline +const T& +max_n(const T& t) { return t; } + template < typename T > inline const T& max_n(const T& t0, const T& t1) diff --git a/STL_Extension/include/CGAL/tuple.h b/STL_Extension/include/CGAL/tuple.h index 7caa2c05098..d9b99013525 100644 --- a/STL_Extension/include/CGAL/tuple.h +++ b/STL_Extension/include/CGAL/tuple.h @@ -27,15 +27,19 @@ #ifndef CGAL_CFG_NO_CPP0X_TUPLE # include -#elif !defined CGAL_CFG_NO_TR1_TUPLE -# include -#else -# include #endif +#ifndef CGAL_CFG_NO_TR1_TUPLE +# include +# include +#endif + +#include +#include +#include namespace CGAL { -namespace cpp0x { +namespace cpp11 { #ifndef CGAL_CFG_NO_CPP0X_TUPLE using std::tuple; @@ -67,7 +71,50 @@ struct tuple_element: public boost::tuples::element{}; #endif -} // cpp0x + +#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). + +//////////////////////////////////////////////////////////// +// // +// Allow CGAL::cpp0x::get(std::pair), if N==0 or N==1. // +// // +// That is already in TR1 and C++11, but not in Boost. // +// // +//////////////////////////////////////////////////////////// +template +struct pair_get; + +template +struct pair_get<0, T1, T2> { + static T1& get(std::pair& pair) { return pair.first; } + static const T1& get(const std::pair& pair) { return pair.first; } +}; // end specialization struct pair_get<0, T2, T2> + +template +struct pair_get<1, T1, T2> { + static T2& get(std::pair& pair) { return pair.second; } + static const T2& get(const std::pair& pair) { return pair.second; } +}; // end specialization struct pair_get<0, T2, T2> + +template +inline typename boost::tuples::element >::type& +get(std::pair& pair) { + return pair_get::get(pair); +} + +template +inline const typename boost::tuples::element >::type& +get(const std::pair& pair) { + return pair_get::get(pair); +} + +#endif // end if not C++11 tuple + + +} // cpp11 + +namespace cpp0x = cpp11; #ifndef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES diff --git a/STL_Extension/test/STL_Extension/test_Modifiable_priority_queue.cpp b/STL_Extension/test/STL_Extension/test_Modifiable_priority_queue.cpp index 9530c12e624..3c5105ff482 100644 --- a/STL_Extension/test/STL_Extension/test_Modifiable_priority_queue.cpp +++ b/STL_Extension/test/STL_Extension/test_Modifiable_priority_queue.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/STL_Extension/test/STL_Extension/test_is_iterator.cpp b/STL_Extension/test/STL_Extension/test_is_iterator.cpp new file mode 100644 index 00000000000..31aaf66957f --- /dev/null +++ b/STL_Extension/test/STL_Extension/test_is_iterator.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +int main() { + typedef std::vector::const_iterator vector_it; + typedef int* int_p; + using CGAL::is_iterator; + + CGAL_static_assertion(is_iterator::value); + CGAL_static_assertion(!is_iterator::value); + CGAL_static_assertion(!is_iterator::value); + CGAL_static_assertion(is_iterator::value); +} diff --git a/STL_Extension/test/STL_Extension/test_is_streamable.cpp b/STL_Extension/test/STL_Extension/test_is_streamable.cpp new file mode 100644 index 00000000000..c969eb94cbe --- /dev/null +++ b/STL_Extension/test/STL_Extension/test_is_streamable.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include // std::pair +#include +#include + +struct A {}; +struct B {}; +struct C {}; +struct D {}; + +using std::ostream; +using std::istream; + +ostream& operator<<(ostream& os, const B&) { return os; } +istream& operator>>(istream& is, const B&) { return is; } + +ostream& operator<<(ostream& os, const C&) { return os; } +istream& operator>>(istream& is, const D&) { return is; } + +int main() { + typedef std::vector::const_iterator vector_it; + typedef int* int_p; + using CGAL::is_streamable; + + CGAL_static_assertion(!is_streamable::value); + CGAL_static_assertion(is_streamable::value); + CGAL_static_assertion(!is_streamable::value); + CGAL_static_assertion(!is_streamable::value); + CGAL_static_assertion(is_streamable::value); + CGAL_static_assertion(is_streamable::value); + CGAL_static_assertion(! (is_streamable >::value) ); + CGAL_static_assertion( (is_streamable >::value) ); +} diff --git a/STL_Extension/test/STL_Extension/test_namespaces.cpp b/STL_Extension/test/STL_Extension/test_namespaces.cpp new file mode 100644 index 00000000000..bfcc8e0b0b9 --- /dev/null +++ b/STL_Extension/test/STL_Extension/test_namespaces.cpp @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() +{ + CGAL::cpp0x::array arr; + CGAL::cpp11::array arr2; + + CGAL::cpp0x::tuple tuple; + CGAL::cpp11::tuple tuple2; + + CGAL::copy_n(arr.begin(), 3, arr2.begin()); + CGAL::cpp0x::copy_n(arr.begin(), 3, arr2.begin()); + CGAL::cpp11::copy_n(arr.begin(), 3, arr2.begin()); + + CGAL::cpp0x::prev(arr.end()); + CGAL::cpp11::prev(arr.end()); + CGAL::cpp0x::next(arr.begin()); + CGAL::cpp11::next(arr.begin()); + return 0; +} + + diff --git a/STL_Extension/test/STL_Extension/test_stl_extension.cpp b/STL_Extension/test/STL_Extension/test_stl_extension.cpp index d81c78068db..75e8bbbb05e 100644 --- a/STL_Extension/test/STL_Extension/test_stl_extension.cpp +++ b/STL_Extension/test/STL_Extension/test_stl_extension.cpp @@ -8109,10 +8109,32 @@ void test_tuple(){ CGAL_static_assertion( (boost::is_same::type,My_to_int>::value) ); T1 t1=CGAL::cpp0x::make_tuple(1,2); + T1 t1_2=CGAL::cpp0x::make_tuple(1,2); + + CGAL_assertion(t1==t1_2); // test the equality operator + + // T2 t2 = T2(); + // CGAL_assertion( t2 == T2() ); + // + // Do not test equality between default initialized tuples, because + // GNU/g++ version 4.1.2 does not default-initialize correctly + // std::tr1::tuple. + + // Test CGAL::cpp0x::tie int i1=-1,i2=-1; CGAL::cpp0x::tie(i1,i2)=t1; CGAL_assertion( CGAL::cpp0x::get<0>(t1)==i1 ); CGAL_assertion( CGAL::cpp0x::get<1>(t1)==i2 ); + + // Test CGAL::cpp0x::get for a pair + double d = 1; + std::pair pair(-3, &d); + const std::pair const_pair(2, &d); + + assert(CGAL::cpp0x::get<0>(pair) == -3); + assert(CGAL::cpp0x::get<1>(pair) == &d); + assert(CGAL::cpp0x::get<0>(const_pair) == 2); + assert(CGAL::cpp0x::get<1>(const_pair) == &d); } void test_prev_next() diff --git a/Scripts/developer_scripts/cgal_generate_cmake_script b/Scripts/developer_scripts/cgal_generate_cmake_script new file mode 100755 index 00000000000..a69914d9e2f --- /dev/null +++ b/Scripts/developer_scripts/cgal_generate_cmake_script @@ -0,0 +1,37 @@ +#!/bin/bash + +# Copyright (c) 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; 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: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Scripts/scripts/cgal_create_makefile $ +# $Id: cgal_create_makefile 36976 2007-03-09 22:53:24Z reichel $ +# +# Author(s) : Eric Berberich + +# TODO usage + +# -s source +# -c cgalcomponent +# -b boost component + +# EBEB: For some reason, using "$@" only pushes the first word to cmake +cmake -DOPTIONS:STRING="$1 $2 $3 $4 $5 $6" -P cgal_generate_cmake_script.cmake + + +echo "------------------------ OUTPUT -------------------------" +cat CMakeLists.txt \ No newline at end of file diff --git a/Scripts/developer_scripts/cgal_generate_cmake_script.cmake b/Scripts/developer_scripts/cgal_generate_cmake_script.cmake new file mode 100755 index 00000000000..a28add1db32 --- /dev/null +++ b/Scripts/developer_scripts/cgal_generate_cmake_script.cmake @@ -0,0 +1,504 @@ +# Copyright (c) 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; 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: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Scripts/scripts/cgal_create_makefile $ +# $Id: cgal_create_makefile 36976 2007-03-09 22:53:24Z reichel $ +# +# Author(s) : Eric Berberich + +cmake_minimum_required(VERSION 2.6.2) + +message(STATUS "Create CMakeLists.txt") + +# message(STATUS "Repeat command line options: ${OPTIONS}") + +set(PROJECT CGAL) #`basename $PWD` # TODO set value based on dir/source dir +set(SINGLE_SOURCE "Polygon_2") +list(INSERT CGAL_COMPONENTS 0 Qt4 CoRe gmP MPFR Rs rs3 MPFI) # TODO default value +set(WITH_QT3 FALSE) +set(WITH_QT4 FALSE) +set(WITH_ALL_PRECONFIGURED_LIBS FALSE) +list(INSERT BOOST_COMPONENTS 0 thread) # TODO default value +set(WITH_TESTING FALSE) + +### Delete file if it exists + +if (EXISTS CMakeLists.txt) + file(RENAME CMakeLists.txt CMakeLists.bak) +endif() + +### Parse options + +# TODO parsing, i.e. +#-s +#-c /-p +#-b +#-t # for testing? +#-d directory for sources + + +### Start to write CMakeLists.txt + +file(APPEND CMakeLists.txt "# Created by the script cgal_generate_cmake_script\n" ) +file(APPEND CMakeLists.txt "# This is the CMake script for compiling a set of CGAL applications.\n\n" ) + +if ( "${SINGLE_SOURCE}" STREQUAL "" ) + file(APPEND CMakeLists.txt "project(${PROJECT})\n\n") +else() + file(APPEND CMakeLists.txt "project(${SINGLE_SOURCE})\n\n") +endif() + + +file(APPEND CMakeLists.txt +"cmake_minimum_required(VERSION 2.6.2) +if(\"\${CMAKE_MAJOR_VERSION}.\${CMAKE_MINOR_VERSION}\" VERSION_GREATER 2.6) + if(\"\${CMAKE_MAJOR_VERSION}.\${CMAKE_MINOR_VERSION}.\${CMAKE_PATCH_VERSION}\" VERSION_GREATER 2.8.3) + cmake_policy(VERSION 2.8.4) + else() + cmake_policy(VERSION 2.6) + endif() +endif() + +set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) + +if ( COMMAND cmake_policy ) + + cmake_policy( SET CMP0003 NEW ) + +endif() + +# CGAL and its components +") + +if (WITH_TESTING AND "${SINGLE_SOURCE}" STREQUAL "") + file(APPEND CMakeLists.txt "enable_testing()\n\n") +endif() + +foreach( component ${CGAL_COMPONENTS}) + + # ensure capitalization + # template: + #string(REGEX REPLACE "()" "" rewrote_component ${component}) + #set(component ${rewrote_component}) + + # CGAL: Core, Qt3, Qt4, PDB, ImageIO + string(REGEX REPLACE "([c|C][o|O][r|R][e|E])" "Core" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([i|I][m|M][a|A][g|G][e|E][i|I][o|O])" "ImageIO" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([q|Q][t|T]3)" "Qt3" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([q|Q][t|T]4)" "Qt4" rewrote_component ${component}) + set(component ${rewrote_component}) + + # external libs + string(REGEX REPLACE "([g|G][m|M][p|P])" "GMP" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([g|G][m|M][p|P][x|X][x|X])" "GMPXX" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([m|M][p|P][f|F][r|R])" "MPFR" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([l|L][e|E][d|D][a|A])" "LEDA" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([m|M][p|P][f|F][i|I])" "MPFI" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([r|R][s|S]$)" "RS" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([r|R][s|S]3)" "RS3" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([o|O][p|P][e|E][n|N][n|N][l|L])" "OpenNL" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([t|T][a|A][u|U][c|C][s|S])" "TAUCS" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([b|B][l|L][a|A][s|S])" "BLAS" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([l|L][a|A][p|P][a|A][c|C][k|K])" "LAPACK" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([q|Q][g|G][l|L][v|V][i|I][e|E][w|W][e|E][r|R])" "QGLViewer" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([z|Z][l|L][i|I][b|B])" "zlib" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([e|E][s|S][b|B][t|T][l|L])" "ESBTL" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([n|N][t|T][l|L])" "NTL" rewrote_component ${component}) + set(component ${rewrote_component}) + string(REGEX REPLACE "([o|O][p|P][e|E][n|N][g|G][l|L])" "OpenGL" rewrote_component ${component}) + set(component ${rewrote_component}) + +# TODO Other libs? +#F2C? +#IPE? +#MKL? + + list(APPEND CGAL_REWROTE_COMPONENTS ${component}) + + # detect qt3, qt4 + if ( ${component} STREQUAL "Qt3" ) + set(WITH_QT3 TRUE) + endif() + if ( ${component} STREQUAL "Qt4" ) + set(WITH_QT4 TRUE) + endif() +endforeach() + +set(CGAL_COMPONENTS ${CGAL_REWROTE_COMPONENTS}) + +if ( WITH_ALL_PRECONFIGURED_LIBS ) + list(APPEND CGAL_COMPONENTS ALL_PRECONFIGURED_LIBS) +endif() + + +if ( ${CGAL_COMPONENTS} STREQUAL "") + file(APPEND CMakeLists.txt "find_package( CGAL QUIET )\n\n") +else() + foreach(comp ${CGAL_COMPONENTS}) + set(CGAL_SPACED_COMPONENTS "${CGAL_SPACED_COMPONENTS} ${comp}") + endforeach() + file(APPEND CMakeLists.txt "find_package( CGAL QUIET COMPONENTS ${CGAL_SPACED_COMPONENTS} )\n\n") +endif() + + +file(APPEND CMakeLists.txt +"if ( NOT CGAL_FOUND ) + + message(STATUS \"This project requires the CGAL library, and will not be compiled.\") + return() + +endif() + +# include helper file +include( \${CGAL_USE_FILE} ) + +# Boost and its components +") + + +### Boost and its components + +if ( ${BOOST_COMPONENTS} STREQUAL "") + file(APPEND CMakeLists.txt "find_package( Boost REQUIRED )\n\n") +else() + foreach(comp ${BOOST_COMPONENTS}) + set(BOOST_SPACED_COMPONENTS "${BOOST_SPACED_COMPONENTS} ${comp}") + endforeach() + file(APPEND CMakeLists.txt "find_package( Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS} )\n\n") +endif() + +file(APPEND CMakeLists.txt +"if ( NOT Boost_FOUND ) + + message(STATUS \"This project requires the Boost library, and will not be compiled.\") + + return() + +endif() + +") + +# TODO add ${SOURCE_DIR} +if ( EXISTS include ) + file(APPEND CMakeLists.txt +"# include for local directory +include_directories( BEFORE include )\n\n") +endif() + +if ( EXISTS ../../include ) + file(APPEND CMakeLists.txt +"# includes for local package +include_directories( BEFORE ../../include )\n\n") +endif() + +if ( EXISTS ../include ) + file(APPEND CMakeLists.txt +"# includes for local package +include_directories( BEFORE ../include )\n\n") +endif() + + +if (WITH_QT3) + file(APPEND CMakeLists.txt +"# Qt3 +# FindQt3-patched.cmake is FindQt3.cmake patched by CGAL developers, so +# that it can be used together with FindQt4: all its variables are prefixed +# by \"QT3_\" instead of \"QT_\". +find_package(Qt3-patched QUIET ) + +if ( NOT QT3_FOUND ) + + message(STATUS \"This project requires the Qt3 library, and will not be compiled.\") + return() + +endif() + +if ( CGAL_Qt3_FOUND ) + + include( Qt3Macros-patched ) + +endif() + +") +endif() + +if (WITH_QT4) +file(APPEND CMakeLists.txt +"# Qt4 +set( QT_USE_QTXML true ) +set( QT_USE_QTMAIN true ) +set( QT_USE_QTSCRIPT true ) +set( QT_USE_QTOPENGL true ) + +find_package(Qt4) + +if ( NOT QT_FOUND ) + + message(STATUS \"This project requires the Qt4 library, and will not be compiled.\") + return() + +endif() + +") +endif() + + +if ( NOT ${BOOST_COMPONENTS} STREQUAL "") + + file(APPEND CMakeLists.txt "# Boost linking\n" ) + + foreach (BOOST_COMPONENT ${BOOST_COMPONENTS}) + file(APPEND CMakeLists.txt "link_libraries( \${Boost_${BOOST_COMPONENT}_LIBRARY} )\n") + endforeach() + + file(APPEND CMakeLists.txt "\n") + +endif() + + +# All Files or Single Source + +if ( "xxx${SINGLE_SOURCE}" STREQUAL "xxx" ) + + ############### + # ALL SOURCES # + ############### + + + file(APPEND CMakeLists.txt +"# Creating entries for all .cpp/.C files with "main" routine +# ########################################################## + +") + +if (WITH_QT4) + file(APPEND CMakeLists.txt "include( CGAL_CreateSingleSourceCGALProgramQt4 )\n\n") +else() + file(APPEND CMakeLists.txt "include( CGAL_CreateSingleSourceCGALProgram )\n\n") +endif() + + + if (WITH_QT3) + + file(APPEND CMakeLists.txt +"if ( CGAL_Qt3_FOUND AND QT3_FOUND ) + +") + + # TODO all globs in ${SOURCE_DIR} + # TODO check if globs are non-empty + file(GLOB SOURCE_FILES *.C *.cpp) # TODO sort? + foreach( file ${SOURCE_FILES} ) + file(STRINGS ${file} filecontent) + string(REGEX MATCH "(^main|[^a-zA-Z0-9_]main) *[(]" result ${filecontent}) + if (result) + file(APPEND CMakeLists.txt " qt3_automoc( ${file} )\n") + endif() + endforeach() + + file(APPEND CMakeLists.txt +"# Make sure the compiler can find generated .moc files + include_directories( BEFORE \${CMAKE_CURRENT_BINARY_DIR} ) + + include_directories( \${QT3_INCLUDE_DIR} ) + + link_libraries( \${QT3_LIBRARIES} ) + +endif() + +") + + endif(WITH_QT3) + + if (WITH_QT4) + + file(APPEND CMakeLists.txt +"if ( CGAL_Qt4_FOUND AND QT_FOUND ) + + include( \${QT_USE_FILE} ) + include_directories( \${QT_INCLUDE_DIR} ) + +endif() + +") + + endif(WITH_QT4) + + file(GLOB INPUT_FILES *.C *.cpp) # TODO sort? + foreach( file ${INPUT_FILES} ) + file(STRINGS ${file} filecontent) + string(REGEX MATCH "(^main|[^a-zA-Z0-9_]main) *[(]" result ${filecontent}) + if (result) + get_filename_component(fname ${file} NAME) + get_filename_component(fname_we ${file} NAME_WE) + + if (WITH_QT4) + file(APPEND CMakeLists.txt "create_single_source_cgal_program_qt4( \"${fname}\" )"\n) + else() + file(APPEND CMakeLists.txt "create_single_source_cgal_program( \"${fname}\" )\n") + endif() + if (WITH_TESTING) + if (EXISTS ${fname_we}.cin) + set(CIN " < ${fname_we}.cin") + else() + set(CIN "") + endif() + file(APPEND CMakeLists.txt +"add_test( "${fname_we}" \${CMAKE_CTEST_COMMAND} + --build-and-test "\${CMAKE_CURRENT_SOURCE_DIR}" + "\${CMAKE_CURRENT_BINARY_DIR}" + --build-generator "\${CMAKE_GENERATOR}" + --build-makeprogram "\${CMAKE_MAKE_PROGRAM}" + --build-target ${fname_we} + --build-no-clean + --build-run-dir "\${CMAKE_CURRENT_SOURCE_DIR}" + --test-command sh -c "\${CMAKE_CURRENT_BINARY_DIR}/${fname_we}${CIN}" ) + +") + endif() + endif() + endforeach() + +else() + + ################# + # SINGLE_SOURCE # + ################# + + file(APPEND CMakeLists.txt "\n\n# Creating entries for target: ${SINGLE_SOURCE}\n\n") + + file(GLOB ALL_SOURCES *.C *.cpp) # TODO sort sources? + + if (WITH_QT3) + + file(APPEND CMakeLists.txt +"if ( CGAL_Qt3_FOUND AND QT3_FOUND ) + + qt3_automoc( \${ALL_SOURCES} ) + + # Make sure the compiler can find generated .moc files + include_directories( BEFORE \${CMAKE_CURRENT_BINARY_DIR} ) + + include_directories( \${QT3_INCLUDE_DIR} ) + +endif() + +") + + endif(WITH_QT3) + + if(WITH_QT4) + + file(APPEND CMakeLists.txt +"if ( CGAL_Qt4_FOUND AND QT_FOUND ) + + include( \${QT_USE_FILE} ) + include_directories( \${QT_INCLUDE_DIR} ) + +") + + file(APPEND CMakeLists.txt " # UI files (Qt Designer files)\n") + file(GLOB UI_FILES *.ui) # TODO sort? + foreach( file ${UI_FILES} ) + file(APPEND CMakeLists.txt " qt4_wrap_ui( DT_UI_FILES ${file} )\n") + endforeach() + file(APPEND CMakeLists.txt "\n") + + file(APPEND CMakeLists.txt " # qrc files (resources files, that contain icons, at least)\n") + file(GLOB QRC_FILES *.qrc) # TODO sort? + foreach( file ${QRC_FILES} ) + file(APPEND CMakeLists.txt " qt4_add_resources ( DT_RESOURCE_FILES ${file} )\n") + endforeach() + file(APPEND CMakeLists.txt "\n") + + set(MOC_FILES "") + file(APPEND CMakeLists.txt " # use the Qt MOC preprocessor on classes that derives from QObject\n") + file(GLOB INPUT_FILES include/*.h *.h) # TODO sort? + foreach( file ${INPUT_FILES} ) + file(STRINGS ${file} filecontent) + string(REGEX MATCH "Q_OBJECT" result ${filecontent}) + if (result) + get_filename_component(fname ${file} NAME) + get_filename_component(fname_we ${file} NAME_WE) + file(APPEND CMakeLists.txt " qt4_generate_moc( ${file} ${fname_we}.moc )\n") + # ˆ^^^ need file with full path for "include/*.h" + set(MOC_FILES "${fname_we}.moc ${MOC_FILES}") + endif() + endforeach() + file(APPEND CMakeLists.txt "\n") + file(GLOB INPUT_FILES *.cpp) # TODO sort? + foreach( file ${INPUT_FILES} ) + file(STRINGS ${file} filecontent) + string(REGEX MATCH "Q_OBJECT" result ${filecontent}) + if (result) + get_filename_component(fname ${file} NAME) + get_filename_component(fname_we ${file} NAME_WE) + file(APPEND CMakeLists.txt " qt4_generate_moc( ${fname_we}.cpp ${fname_we}.moc )\n") + set(MOC_FILES "${fname_we}.moc ${MOC_FILES}") + endif() + endforeach() + file(APPEND CMakeLists.txt "\n") + + file(APPEND CMakeLists.txt "endif()\n\n") + + set( ALL_SOURCES "${ALL_SOURCES} ${MOC_FILES} \${DT_UI_FILES} \${DT_RESOURCE_FILES}") + + endif(WITH_QT4) + + file(APPEND CMakeLists.txt +" + +add_executable( ${SINGLE_SOURCE} ${ALL_SOURCES} ) + +add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${SINGLE_SOURCE} ) + +# Link the executable to CGAL and third-party libraries + +") + + set(LIBS "") + + if (WITH_QT3) + set(LIBS "\${QT3_LIBRARIES}") + endif(WITH_QT3) + if (WITH_QT4) + set(LIBS "\${QT_LIBRARIES}") + endif(WITH_QT4) + + file(APPEND CMakeLists.txt "target_link_libraries(${SINGLE_SOURCE} ${LIBS} \${CGAL_LIBRARIES} \${CGAL_3RD_PARTY_LIBRARIES})\n\n# EOF") + +endif() + +message(STATUS "CMakeLists.txt has been generated.") diff --git a/Scripts/developer_scripts/cgal_git_svn_clone b/Scripts/developer_scripts/cgal_git_svn_clone new file mode 100755 index 00000000000..13eafddd243 --- /dev/null +++ b/Scripts/developer_scripts/cgal_git_svn_clone @@ -0,0 +1,239 @@ +#!/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/clean_up_branch.sh b/Scripts/developer_scripts/clean_up_branch.sh old mode 100644 new mode 100755 diff --git a/Scripts/developer_scripts/update_git_svn_clone b/Scripts/developer_scripts/update_git_svn_clone new file mode 100755 index 00000000000..cbee62fb430 --- /dev/null +++ b/Scripts/developer_scripts/update_git_svn_clone @@ -0,0 +1,92 @@ +#!/bin/bash + +### Usage + +usage() +{ + echo "Usage: `basename` [-l userLogin] [-c cloneLocation]" >&2 + echo >&2 +} + +userLogin=eric +svnGforge=svn+ssh://$userLogin@scm.gforge.inria.fr/svn/cgal +fromSvn=$svnGforge +cloneLocation= + + +# parse command line arguments +while getopts "l:c:hv" OPT; do + case "$OPT" in + + l) userLogin=$OPTARG + ;; + + c) cloneLocation=$OPTARG + ;; + + +# for developers + h) usage + exit 0 + ;; + + v) echo "`basename $0` version 0.1" + exit 0 + ;; + +# for all + + \?) # getopts issues an error message + usage + exit 1 + ;; + esac +done + +#shift `expr $OPTIND - 1` + + ### Authors file + echo "Get authors file with svn" + svn cat $fromSvn/branches/next/Maintenance/git/authors-file.txt > /tmp/cgal-authors-file.txt + echo + # git config svn.authorsfile $(basename $(pwd))/git-authors + + if [ "$cloneLocation" != "" ]; then + + git fetch $cloneLocation --all + + 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 delete deleted branches + + # tags are cloned with git fetch + + fi + + git svn fetch # TODO AUTHORS FILE + + git svn rebase --all + + if [ "$cloneLocation" == "" ]; then + + # TODO delete deleted branches + + # TODO convert svn-tags to git-tags + + fi + + git branch -a + + rm -f /tmp/cgal-authors-files.txt + +fi + diff --git a/Scripts/scripts/cgal_create_CMakeLists b/Scripts/scripts/cgal_create_CMakeLists new file mode 100755 index 00000000000..4742c1dd760 --- /dev/null +++ b/Scripts/scripts/cgal_create_CMakeLists @@ -0,0 +1,710 @@ +#!/bin/bash + +# Copyright (c) 1999,2000,2002-2007,2009,2011,2012 +# Utrecht University (The Netherlands), +# ETH Zurich (Switzerland), +# INRIA Sophia-Antipolis (France), +# Max-Planck-Institute for Informatics 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: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Scripts/scripts/cgal_create_makefile $ +# $Id: cgal_create_makefile 36976 2007-03-09 22:53:24Z reichel $ +# +# Author(s) : various + +# This script creates a CGAL cmake script with entries for .C and .cpp +# files in the current directory - some options can be given or specified in a file + + +#LEDA +#GMP +#GMPXX +#MPFR +#MPFI +#RS +#TAUCS +#BLAS +#LAPACK +#OPENNL +#QGLViewer (or implied by Qt4?) +#ESBTL +#NTL + +#Core (implies GMP+GMPXX) +#Qt3 (implies QT3) +#Qt4 (implies QT4) +#ImageIO + +#not (yet) supported +#F2C (comes with BLAS/LAPACK - something like that) +#IPE (ask Laurent) +#MKL (ask Andreas) + +create_cmake_script_with_options() +{ + qt3='n' + qt4='n' + + # parse options file + if [ -e "$OPTIONS_FILE" ]; then + + OLDIFS="$IFS" + IFS=$'\n' + for LINE in `cat $OPTIONS_FILE`; do + + # CGAL components + if [ -z "$CGAL_COMPONENTS_GIVEN" ]; then # read file only if not given! + next_cgal_component=`echo $LINE | grep -v "#" | grep CGAL_COMPONENT` + if [ ! -z "$next_cgal_component" ]; then + next_cgal_component=${next_cgal_component/CGAL_COMPONENT /} + if [ -z "$CGAL_COMPONENTS" ]; then + CGAL_COMPONENTS=$next_cgal_component + else + CGAL_COMPONENTS=$CGAL_COMPONENTS":"$next_cgal_component + fi + fi + fi + + # Boost components + if [ -z "$BOOST_COMPONENTS_GIVEN" ]; then # read file only if not given! + next_boost_component=`echo $LINE | grep -v "#" | grep BOOST_COMPONENT` + if [ ! -z "$next_boost_component" ]; then + next_boost_component=${next_boost_component/BOOST_COMPONENT /} + if [ -z "$BOOST_COMPONENTS" ]; then + BOOST_COMPONENTS=$next_boost_component + else + BOOST_COMPONENTS=$BOOST_COMPONENTS":"$next_boost_component + fi + fi + fi + + done + IFS="$OLDIFS" + fi + + + # print makefile header + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' +# Created by the script cgal_create_cmake_script_with_options +# This is the CMake script for compiling a set of CGAL applications. + +EOF + #--------------------------------------------------------------------------- + if [ "$SINGLE_SOURCE" = "n" ]; then + echo "project( ${PROJECT} )" + else + echo "project( ${SOURCE} )" + fi + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + + +cmake_minimum_required(VERSION 2.6.2) +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) + if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) + cmake_policy(VERSION 2.8.4) + else() + cmake_policy(VERSION 2.6) + endif() +endif() + +set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) + +if ( COMMAND cmake_policy ) + + cmake_policy( SET CMP0003 NEW ) + +endif() + +# CGAL and its components +EOF +if [ -n "$ENABLE_CTEST" ]; then + echo "enable_testing()" +fi + #--------------------------------------------------------------------------- + # echo "CGAL_COMPONENTS: $CGAL_COMPONENTS" + # echo "CGAL_PRECONFIGURED_LIBS: $CGAL_PRECONFIGURED_LIBS" + if [ ! -z "$CGAL_COMPONENTS" ]; then + # ensure capitalization + + # CGAL: Core, Qt3, Qt4, PDB, ImageIO + CGAL_COMPONENTS=${CGAL_COMPONENTS//[c|C][o|O][r|R][e|E]/Core} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[q|Q][t|T]3/Qt3} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[q|Q][t|T]4/Qt4} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[i|I][m|M][a|A][g|G][e|E][i|I][o|O]/ImageIO} + + # external libs + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[g|G][m|M][p|P]/GMP} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[g|G][m|M][p|P][x|X][x|X]/GMPXX} + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[m|M][p|P][f|F][r|R]/MPFR} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[l|L][e|E][d|D][a|A]/LEDA} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[m|M][p|P][f|F][i|I]/MPFI} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[r|R][s|S]/RS} + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[o|O][p|P][e|E][n|N][n|N][l|L]/OpenNL} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[t|T][a|A][u|U][c|C][s|S]/TAUCS} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[b|B][l|L][a|A][s|S]/BLAS} + CGAL_COMPONENTS=${CGAL_COMPONENTS//[l|L][a|A][p|P][a|A][c|C][k|K]/LAPACK} + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[q|Q][g|G][l|L][v|V][i|I][e|E][w|W][e|E][r|R]/QGLViewer} + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[z|Z][l|L][i|I][b|B]/zlib} + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[e|E][s|S][b|B][t|T][l|L]/ESBTL} + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[n|N][t|T][l|L]/NTL} + + CGAL_COMPONENTS=${CGAL_COMPONENTS//[o|O][p|P][e|E][n|N][g|G][l|L]/OpenGL} + + +#F2C? +#IPE? +#MKL? + + OLDIFS="$IFS" + IFS=':' + for cgal_component in $CGAL_COMPONENTS; do + COMPONENT=`echo $cgal_component | tr '[:upper:]' '[:lower:]'` + + # for qtmoc + if [ "$COMPONENT" = "qt3" ]; then + qt3='y' + fi + if [ "$COMPONENT" = "qt4" ]; then + qt4='y' + fi + + done + IFS=$OLDIFS + + fi + + if [ "$CGAL_PRECONFIGURED_LIBS" = "y" ]; then + CGAL_COMPONENTS=${CGAL_COMPONENTS}" ALL_PRECONFIGURED_LIBS" + fi + + echo "find_package( CGAL QUIET COMPONENTS ${CGAL_COMPONENTS//:/ } )" + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +if ( NOT CGAL_FOUND ) + + message(STATUS "This project requires the CGAL library, and will not be compiled.") + return() + +endif() + +# include helper file +include( ${CGAL_USE_FILE} ) + +EOF + #--------------------------------------------------------------------------- + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +# Boost and its components +EOF + #--------------------------------------------------------------------------- + + if [ ! -z "$BOOST_COMPONENTS" ]; then + + echo "find_package( Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS//:/ } )" + + else + + echo "find_package( Boost REQUIRED )" + + fi # additional Boost components + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +if ( NOT Boost_FOUND ) + + message(STATUS "This project requires the Boost library, and will not be compiled.") + + return() + +endif() +EOF + #--------------------------------------------------------------------------- + + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +# include for local directory +EOF + #--------------------------------------------------------------------------- + + if [ -d include ] ; then + echo 'include_directories( BEFORE include )' + fi + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +# include for local package +EOF + #--------------------------------------------------------------------------- + + # includes for local package + if [ -d ../../include ] ; then + echo 'include_directories( BEFORE ../../include )' + fi + if [ -d ../include ] ; then + echo 'include_directories( BEFORE ../include )' + fi + + if [ ! -z "$PACKAGES" ]; then + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +# include of additional packages +EOF + #------------------------------------------------------------------------- + fi + + # Qt3 or Qt4 + if [ "$qt3" = "y" ]; then + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +# Qt3 +# FindQt3-patched.cmake is FindQt3.cmake patched by CGAL developers, so +# that it can be used together with FindQt4: all its variables are prefixed +# by "QT3_" instead of "QT_". +find_package(Qt3-patched QUIET ) + +if ( NOT QT3_FOUND ) + + message(STATUS "This project requires the Qt3 library, and will not be compiled.") + return() + +endif() + +if ( CGAL_Qt3_FOUND ) + + include( Qt3Macros-patched ) + +endif() +EOF + #------------------------------------------------------------------------- + fi # qt3 + + if [ "$qt4" = "y" ]; then + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +# Qt4 +set( QT_USE_QTXML true ) +set( QT_USE_QTMAIN true ) +set( QT_USE_QTSCRIPT true ) +set( QT_USE_QTOPENGL true ) + +find_package(Qt4) + +if ( NOT QT_FOUND ) + + message(STATUS "This project requires the Qt4 library, and will not be compiled.") + return() + +endif() +EOF + #------------------------------------------------------------------------- + + fi #qt4 + + if [ ! -z "$BOOST_COMPONENTS" ]; then + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +# Boost linking +EOF + #------------------------------------------------------------------------- + + OLDIFS="$IFS" + IFS=':' + for boost_component in $BOOST_COMPONENTS; do + BOOST_COMPONENT=`echo $boost_component | tr '[:lower:]' '[:upper:]'` + echo "link_libraries( \${Boost_${BOOST_COMPONENT}_LIBRARY} )" + done + IFS=$OLDIFS + + fi # additional Boost components + + + # All Files or Single Source + + if [ "$SINGLE_SOURCE" = "n" ]; then #======================================= + + ############### + # ALL SOURCES # + ############### + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + + +# Creating entries for all .cpp/.C files with "main" routine +# ########################################################## + +EOF + #------------------------------------------------------------------------- + + + if [ "$qt4" = "y" ]; then + + echo "include( CGAL_CreateSingleSourceCGALProgramQt4 )" + + else + + echo "include( CGAL_CreateSingleSourceCGALProgram )" + + fi + # add a new line + echo + + # Qt3 + if [ "$qt3" = "y" ]; then + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' +if ( CGAL_Qt3_FOUND AND QT3_FOUND ) + +EOF + #----------------------------------------------------------------------- + + for file in `ls *.C *.cpp 2> /dev/null | sort` ; do + # Create an executable for each cpp that contains a function "main()" + BASE=`basename $file .C` + BASE=`basename $BASE .cpp` + egrep '\bmain[ \t]*\(' $file >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "qt3_automoc( ${file} )" + fi + done + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + + # Make sure the compiler can find generated .moc files + include_directories( BEFORE ${CMAKE_CURRENT_BINARY_DIR} ) + + include_directories( ${QT3_INCLUDE_DIR} ) + + link_libraries( ${QT3_LIBRARIES} ) + +endif() + +EOF + #----------------------------------------------------------------------- + + fi # qt3 + + # Qt4 + if [ "$qt4" = "y" ]; then + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +if ( CGAL_Qt4_FOUND AND QT_FOUND ) + + include( ${QT_USE_FILE} ) + include_directories( ${QT_INCLUDE_DIR} ) + +endif() + +EOF + #----------------------------------------------------------------------- + fi # qt4 + + for file in `ls *.C *.cpp 2> /dev/null | sort`; do + # Create an executable for each cpp that contains a function "main()" + BASE=`basename $file .C` + BASE=`basename $BASE .cpp` + egrep '\bmain[ \t]*\(' $file >/dev/null 2>&1 + if [ $? -eq 0 ]; then + if [ "$qt4" = "y" ]; then + echo "create_single_source_cgal_program_qt4( \"$file\" )" + else + echo "create_single_source_cgal_program( \"$file\" )" + fi + if [ -n "$ENABLE_CTEST" ]; then + if [ -f "$BASE.cin" ] ; then + CIN=" < $BASE.cin" + else + CIN= + fi + cat < /dev/null | sort`; do + all="$all $file" + done + + # Qt3 + if [ "$qt3" = "y" ]; then + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +if ( CGAL_Qt3_FOUND AND QT3_FOUND ) + +EOF + #----------------------------------------------------------------------- + + echo "qt3_automoc( ${all} )" + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + + # Make sure the compiler can find generated .moc files + include_directories( BEFORE ${CMAKE_CURRENT_BINARY_DIR} ) + + include_directories( ${QT3_INCLUDE_DIR} ) + +endif() +EOF + #----------------------------------------------------------------------- + fi # qt3 + + # Qt4 + if [ "$qt4" = "y" ]; then + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +if ( CGAL_Qt4_FOUND AND QT_FOUND ) + + include( ${QT_USE_FILE} ) + include_directories( ${QT_INCLUDE_DIR} ) + +EOF + #----------------------------------------------------------------------- + + echo " # UI files (Qt Designer files)" + for file in `ls *.ui 2> /dev/null | sort`; do + echo " qt4_wrap_ui( DT_UI_FILES $file )" + done + echo + echo " # qrc files (resources files, that contain icons, at least)" + for file in `ls *.qrc 2> /dev/null | sort`; do + echo " qt4_add_resources ( DT_RESOURCE_FILES ./$file )" + done + echo + MOC_FILES="" + echo " # use the Qt MOC preprocessor on classes that derives from QObject" + for file in `ls include/*.h 2> /dev/null | sort`; do + BASE=`basename $file .h` + egrep 'Q_OBJECT' $file >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo " qt4_generate_moc( include/${BASE}.h ${BASE}.moc )" + MOC_FILES="${BASE}.moc $MOC_FILES" + fi + done + for file in `ls *.h 2> /dev/null | sort`; do + BASE=`basename $file .h` + egrep 'Q_OBJECT' $file >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo " qt4_generate_moc( ${BASE}.h ${BASE}.moc )" + MOC_FILES="${BASE}.moc $MOC_FILES" + fi + done + for file in `ls *.cpp 2> /dev/null | sort`; do + BASE=`basename $file .cpp` + egrep 'Q_OBJECT' $file >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo " qt4_generate_moc( ${BASE}.cpp ${BASE}.moc )" + MOC_FILES="${BASE}.moc $MOC_FILES" + fi + done + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' + +endif() +EOF + #----------------------------------------------------------------------- + + all="${all} ${MOC_FILES} \${DT_UI_FILES} \${DT_RESOURCE_FILES}" + + fi # qt4 + + # no 'cat' here, as variable substitution required + echo + echo "add_executable( ${target_name} ${all} )" + echo + echo "add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${target_name} )" + echo + echo "# Link the executable to CGAL and third-party libraries" + LIBS="" + if [ "$qt3" = "y" ]; then + LIBS="\${QT3_LIBRARIES}" + fi + if [ "$qt4" = "y" ]; then + LIBS="\${QT_LIBRARIES}" + fi + LIBS=$LIBS" \${CGAL_LIBRARIES} \${CGAL_3RD_PARTY_LIBRARIES}" + echo "target_link_libraries(${target_name} $LIBS )" + + fi # single source or all files #=========================================== + + #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + cat << 'EOF' +EOF + #--------------------------------------------------------------------------- + +echo + +} + +usage() +{ + echo "Usage: `basename $0` [-s source] [-c cgal-component1:cgal-component2:...] [-b boost-component1:boost-component2:...] [-p] [-o options_file='`pwd`/cgal_cmake_options:$HOME/.cgal_cmake_options_rc'] [-v] [-h]" >&2 + echo >&2 + echo " -s source If this parameter is given the script will create one single executable for 'source' with all source files; otherwise it creates one executable for each main'ed source." >&2 + echo " cgal_componentX - must be a valid cgal component, examples are 'Core','imageIO','Qt3','Qt4' ('benchmark', 'symbolic')." >&2 + echo " boost_componentX - must be a valid boost component, like 'filesystem', 'program_options'." >&2 + echo " -p use all of CGAL's preconfigured libraries" >&2 + echo " -o options_file - file with PACKAGE, DIRECTORY, CGAL_COMPONENT, and BOOST_COMPONENT directives" >&2 + echo " -v the version" >&2 + echo " -h this info screen" >&2 + echo >&2 +} + + +SINGLE_SOURCE='n' +SOURCE="" + +CGAL_COMPONENTS_GIVEN="" +CGAL_COMPONENTS="" + +CGAL_PRECONFIGURED_LIBS='n' + +BOOST_COMPONENTS_GIVEN="" +BOOST_COMPONENTS="" + +OPTIONS_FILE=`pwd`"/cgal_cmake_options" + +if [ ! -e "$OPTIONS_FILE" ]; then + OPTIONS_FILE="${HOME}/.cgal_cmake_options_rc" +fi + +# parse command line arguments +while getopts s:c:b:o:phvt OPT; do + case "$OPT" in + s) SINGLE_SOURCE='y' + SOURCE=$OPTARG + if [ "${SOURCE:(-4)}" = ".cpp" ]; then + echo "Error: Source must not end with '.cpp'!" >&2 + echo + usage + exit 2 + fi + if [ "${SOURCE:(-2)}" = ".C" ]; then + echo "Error: Source must not end with '.C'!" >&2 + echo + usage + exit 2 + fi + + ;; + + c) CGAL_COMPONENTS_GIVEN='y' + CGAL_COMPONENTS=$OPTARG + ;; + b) BOOST_COMPONENTS_GIVEN='y' + BOOST_COMPONENTS=$OPTARG + ;; + + o) OPTIONS_FILE=$OPTARG + if [ ! -e "$OPTIONS_FILE" ]; then + echo "Options-file '$OPTIONS_FILE' does not exist." >&2 + exit 1 + fi + ;; + p) CGAL_PRECONFIGURED_LIBS='y' + ;; + t) ENABLE_CTEST='y' + ;; + h) usage + exit 0 + ;; + v) echo "`basename $0` version 0.1" + exit 0 + ;; + \?) # getopts issues an error message + usage + exit 1 + ;; + esac +done + +shift `expr $OPTIND - 1` + +#echo "FILE: $OPTIONS_FILE" +#echo "BOOST_COMPONENTS: $BOOST_COMPONENTS" +echo "CGAL_COMPONENTS: $CGAL_COMPONENTS" +#echo "SINGLE_SOURCE: $SINGLE_SOURCE" +#echo "SOURCE: $SOURCE" + +OUTPUTFILE=CMakeLists.txt +PROJECT=`basename $PWD` + +if [ -f ${OUTPUTFILE} ] ; then + echo "moving $OUTPUTFILE to ${OUTPUTFILE}.bak ..." + echo + mv -f $OUTPUTFILE ${OUTPUTFILE}.bak +fi + +create_cmake_script_with_options | tee $OUTPUTFILE + +echo +echo "created $OUTPUTFILE in $PWD ..." diff --git a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt index 23cc86c517f..d0ee28db6fb 100644 --- a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt @@ -36,7 +36,7 @@ if (CGAL_FOUND) find_package(ESBTL) if(ESBTL_FOUND) - include( ${ESBTL_USE_FILE} ) + include_directories( ${ESBTL_INCLUDE_DIR} ) create_single_source_cgal_program( "skin_surface_pdb_reader.cpp" ) else(ESBTL_FOUND) message(STATUS "NOTICE: skin_surface_pdb_reader.cpp requires ESBTL library, and will not be compiled.") diff --git a/Solver_interface/include/CGAL/Eigen_solver_traits.h b/Solver_interface/include/CGAL/Eigen_solver_traits.h index be1001ec5cb..00a26016ff6 100644 --- a/Solver_interface/include/CGAL/Eigen_solver_traits.h +++ b/Solver_interface/include/CGAL/Eigen_solver_traits.h @@ -24,6 +24,7 @@ #include #include #include +#include namespace CGAL { @@ -67,11 +68,12 @@ public: // Public operations public: - Eigen_solver_traits():m_mat(NULL) + Eigen_solver_traits():m_mat(NULL), m_solver_sptr(new EigenSolverT) + Eigen_solver_traits(): { } - EigenSolverT& solver() { return m_solver; } + EigenSolverT& solver() { return *m_solver_sptr; } /// Solve the sparse linear system "A*X = B". /// Return true on success. The solution is then (1/D) * X. @@ -83,14 +85,14 @@ public: { D = 1; // Eigen does not support homogeneous coordinates - m_solver.compute(A.eigen_object()); + m_solver_sptr->compute(A.eigen_object()); - if(m_solver.info() != Eigen::Success) + if(m_solver_sptr->info() != Eigen::Success) return false; - X = m_solver.solve(B); + X = m_solver_sptr->solve(B); - return m_solver.info() == Eigen::Success; + return m_solver_sptr->info() == Eigen::Success; } bool pre_factor (const Matrix& A, NT& D) @@ -98,22 +100,70 @@ public: D = 1; m_mat = &A.eigen_object(); - m_solver.compute(*m_mat); - return m_solver.info() == Eigen::Success; + solver().compute(*m_mat); + return solver().info() == Eigen::Success; } bool linear_solver(const Vector& B, Vector& X) { CGAL_precondition(m_mat!=NULL); //pre_factor should have been called first - X = m_solver.solve(B); - return m_solver.info() == Eigen::Success; + X = solver().solve(B); + return solver().info() == Eigen::Success; } protected: - EigenSolverT m_solver; + boost::shared_ptr m_solver_sptr; const typename Matrix::EigenType* m_mat; }; +//specilization of the solver for BiCGSTAB as for surface parameterization, the +//intializer should be a vector of one's (this was the case in 3.1-alpha but not in the official 3.1). +template<> +class Eigen_solver_traits< Eigen::BiCGSTAB::EigenType> > +{ + typedef Eigen::BiCGSTAB::EigenType> EigenSolverT; + typedef EigenSolverT::Scalar Scalar; +// Public types +public: + typedef Scalar NT; + typedef internal::Get_eigen_matrix::type Matrix; + typedef Eigen_vector Vector; + + +// Public operations +public: + + Eigen_solver_traits(): m_solver_sptr(new EigenSolverT) + { + } + + EigenSolverT& solver() { return *m_solver_sptr; } + + /// Solve the sparse linear system "A*X = B". + /// Return true on success. The solution is then (1/D) * X. + /// + /// @commentheading Preconditions: + /// - A.row_dimension() == B.dimension(). + /// - A.column_dimension() == X.dimension(). + bool linear_solver(const Matrix& A, const Vector& B, Vector& X, NT& D) + { + D = 1; // Eigen does not support homogeneous coordinates + + m_solver_sptr->compute(A.eigen_object()); + + if(m_solver_sptr->info() != Eigen::Success) + return false; + + X.setOnes(B.rows()); + X = m_solver_sptr->solveWithGuess(B,X); + + return m_solver_sptr->info() == Eigen::Success; + } +protected: + boost::shared_ptr m_solver_sptr; + +}; + } //namespace CGAL #endif // CGAL_EIGEN_SOLVER_TRAITS_H diff --git a/Spatial_searching/include/CGAL/Fuzzy_iso_box.h b/Spatial_searching/include/CGAL/Fuzzy_iso_box.h index 2cf6718517a..2fb9ad71b95 100644 --- a/Spatial_searching/include/CGAL/Fuzzy_iso_box.h +++ b/Spatial_searching/include/CGAL/Fuzzy_iso_box.h @@ -58,7 +58,9 @@ namespace CGAL { private: - typename Construct_min_vertex_d::result_type min, max; + typename boost::remove_cv< + typename boost::remove_reference< typename Construct_min_vertex_d::result_type >::type + >::type min, max; Cartesian_const_iterator_d min_begin, max_begin; FT eps; unsigned int dim; diff --git a/Straight_skeleton_2/doc_tex/Straight_skeleton_2/Straight_skeleton_user.tex b/Straight_skeleton_2/doc_tex/Straight_skeleton_2/Straight_skeleton_user.tex index 84cf2ff3014..37016bb2e1f 100644 --- a/Straight_skeleton_2/doc_tex/Straight_skeleton_2/Straight_skeleton_user.tex +++ b/Straight_skeleton_2/doc_tex/Straight_skeleton_2/Straight_skeleton_user.tex @@ -338,7 +338,7 @@ Contour vertices have time zero. \begin{figure}[htbp] \begin{ccTexOnly} \begin{center} -\includegraphics{Straight_skeleton_2/fig6} % omit suffix .eps to support PS and PDF +\includegraphics[width=12cm]{Straight_skeleton_2/fig6} % omit suffix .eps to support PS and PDF \end{center} \end{ccTexOnly} diff --git a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h index 7994b531c21..ded63d4ab9f 100644 --- a/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_straight_skeleton_2.h @@ -135,6 +135,7 @@ boost::shared_ptr< Straight_skeleton_2 > inline create_interior_straight_skeleton_2 ( Polygon const& aOutContour, K const& k ) { + CGAL_precondition(aOutContour.is_simple() || !"The input polygon is not simple."); return create_interior_straight_skeleton_2(CGAL_SS_i::vertices_begin(aOutContour) ,CGAL_SS_i::vertices_end(aOutContour) ,k @@ -221,6 +222,7 @@ boost::shared_ptr< Straight_skeleton_2 > inline create_exterior_straight_skeleton_2 ( FT const& aMaxOffset, Polygon const& aPoly, K const& k ) { + CGAL_precondition(aPoly.is_simple() || !"The input polygon is not simple."); return create_exterior_straight_skeleton_2(aMaxOffset ,CGAL_SS_i::vertices_begin(aPoly) ,CGAL_SS_i::vertices_end (aPoly) diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt index 4a580707eb7..aba2919721d 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt @@ -82,7 +82,7 @@ if ( CGAL_FOUND ) # use either Eigen or TAUCS BLAS/LAPACK - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) endif() diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h index 6942c73b5f5..b0c240174c0 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h @@ -98,7 +98,12 @@ public: m_nb_borders = -1; m_genus = -1; } - virtual ~Parameterization_mesh_feature_extractor() {} + + virtual ~Parameterization_mesh_feature_extractor() { + for (typename Skeleton::iterator iter = m_skeleton.begin(); + iter != m_skeleton.end(); ++iter) + delete *iter; + } /// Get number of borders. int get_nb_borders() diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h index caa07bfbbb6..20ece77181c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_polyhedron_adaptor_3.h @@ -441,7 +441,7 @@ public: int index = 0; for (Vertex_iterator it=mesh_vertices_begin(); it!=mesh_vertices_end(); it++) { - Point_3 position = get_vertex_position(it); + // Point_3 position = get_vertex_position(it); /*#ifdef DEBUG_TRACE fprintf(stderr, " %d=(%f,%f,%f)\n", index, diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt index 146dbcd9159..b0b89455bc7 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt @@ -62,7 +62,7 @@ if ( CGAL_FOUND ) #find Eigen - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) endif() diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/halfedge_collapse_Polyhedron_3.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/halfedge_collapse_Polyhedron_3.h index 82b98f6db6e..59ced4834db 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/halfedge_collapse_Polyhedron_3.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/halfedge_collapse_Polyhedron_3.h @@ -22,11 +22,7 @@ #include #include -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM # define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS -#else -# define CGAL_HDS_PARAM_ class HDS -#endif namespace CGAL { @@ -124,7 +120,7 @@ halfedge_collapse( typename boost::graph_traits< Polyhedron_3 >::edg } //namespace CGAL -#undef CGAL_HDS_ +#undef CGAL_HDS_PARAM #endif // CGAL_SURFACE_MESH_SIMPLIFICATION_COLLAPSE_TRIANGULATION_EDGE_POLYHEDRON_3_H // EOF // diff --git a/Surface_mesher/demo/Surface_mesher/binary_image.h b/Surface_mesher/demo/Surface_mesher/binary_image.h index 78fa56b16a4..ed7ea390a1d 100644 --- a/Surface_mesher/demo/Surface_mesher/binary_image.h +++ b/Surface_mesher/demo/Surface_mesher/binary_image.h @@ -21,6 +21,8 @@ #include #include +#include +#include #include #include @@ -36,8 +38,8 @@ class CBinary_image_3 : public CGAL::Image_3 bool labellized_; public: - float min_value; - float max_value; + double min_value; + double max_value; typedef FT_ FT; @@ -58,6 +60,17 @@ public: { } + void finish_open() { + CGAL_IMAGE_IO_CASE(image_ptr.get(), + Word *min; Word *max; + (boost::tie(min, max)) = + (CGAL::min_max_element((Word*)(data()), + (Word*)(data()) + + xdim() * ydim() * zdim())); + min_value = *min; + max_value = *max;) + } + float xmax() const { return (float)(((image_ptr->xdim) - 1.0)*(image_ptr->vx)); @@ -139,11 +152,11 @@ public: if(interpolation()) { if(labellized()) { CGAL_IMAGE_IO_CASE(image_ptr.get(), - return (this->labellized_trilinear_interpolation(x, y, z, 0));) + return (this->labellized_trilinear_interpolation(x, y, z, min_value));) } else { CGAL_IMAGE_IO_CASE(image_ptr.get(), - return (this->trilinear_interpolation(x, y, z, 0));) + return (this->trilinear_interpolation(x, y, z, min_value));) } } else { diff --git a/Surface_mesher/demo/Surface_mesher/volume.cpp b/Surface_mesher/demo/Surface_mesher/volume.cpp index 27838df8352..2cc5d45fd6f 100644 --- a/Surface_mesher/demo/Surface_mesher/volume.cpp +++ b/Surface_mesher/demo/Surface_mesher/volume.cpp @@ -1,12 +1,14 @@ #include +#include "volume.h" + #include // std::sort #include #include +#include #include -#include "volume.h" #include "viewer.h" #include "mainwindow.h" #include "values_list.h" @@ -582,6 +584,7 @@ bool Volume::open(const QString& filename) void Volume::finish_open() { + m_image.finish_open(); mw->viewer->camera()->setSceneBoundingBox(qglviewer::Vec(0, 0, 0), qglviewer::Vec(m_image.xmax(), m_image.ymax(), @@ -844,7 +847,8 @@ void Volume::display_surface_mesher_result() if(mw->searchSeedsCheckBox->isChecked()) { - std::vector seeds; + typedef std::vector > Seeds; + Seeds seeds; { std::cerr << "Search seeds...\n"; std::set domains; @@ -863,23 +867,31 @@ void Volume::display_surface_mesher_result() } } } - for(std::vector::const_iterator it = seeds.begin(), end = seeds.end(); + std::ofstream seeds_out("seeds.off"); + std::ofstream segments_out("segments.txt"); + seeds_out.precision(18); + seeds_out << "OFF\n" << seeds.size() << " 0 0\n"; + segments_out.precision(18); + for(Seeds::const_iterator it = seeds.begin(), end = seeds.end(); it != end; ++it) { - CGAL::Random_points_on_sphere_3 random_points_on_sphere_3(2*m_image.radius()); + seeds_out << it->first << std::endl; + CGAL::Random_points_on_sphere_3 random_points_on_sphere_3(it->second); Oracle::Intersect_3 intersect = oracle.intersect_3_object(); for(int i = 0; i < 20; ++i) { - const Point test = *it + (*random_points_on_sphere_3++ - CGAL::ORIGIN); - CGAL::Object o = intersect(surface, Segment_3(*it, test)); - if (const Point* intersection = CGAL::object_cast(&o)) + const Point test = it->first + (*random_points_on_sphere_3++ - CGAL::ORIGIN); + CGAL::Object o = intersect(surface, Segment_3(it->first, test)); + if (const Point* intersection = CGAL::object_cast(&o)) { + segments_out << "2 " << it->first << " " << *intersection << std::endl; del.insert(*intersection); + } else { std::cerr << boost::format("Error. Segment (%1%, %2%) does not intersect the surface! values=(%3%, %4%)\n") - % *it % test - % surface(*it) % surface(test); + % it->first % test + % surface(it->first) % surface(test); } } } @@ -890,6 +902,16 @@ void Volume::display_surface_mesher_result() 20); } + std::ofstream points_out("initial-points.off"); + points_out.precision(18); + points_out << "OFF\n" << c2t3.triangulation().number_of_vertices() << " 0 0\n"; + BOOST_FOREACH(const Tr::Vertex& v, + std::make_pair(c2t3.triangulation().vertices_begin(), + c2t3.triangulation().vertices_end())) + { + points_out << v.point() << std::endl; + } + std::cerr << boost::format("Number of initial points: %1%\n") % del.number_of_vertices(); // defining meshing criteria diff --git a/Surface_mesher/demo/Surface_mesher/volume.h b/Surface_mesher/demo/Surface_mesher/volume.h index fabfab33b49..db31c5e8cfe 100644 --- a/Surface_mesher/demo/Surface_mesher/volume.h +++ b/Surface_mesher/demo/Surface_mesher/volume.h @@ -212,11 +212,15 @@ void Volume::search_for_connected_components(PointsOutputIterator it, const unsigned int ny = m_image.ydim(); const unsigned int nz = m_image.zdim(); + const double max_v = (std::max)((std::max)(m_image.vx(), + m_image.vy()), + m_image.vz()); + typedef unsigned char Marker; typedef typename TransformOperator::result_type Label; boost::multi_array visited(boost::extents[nx][ny][nz]); - typedef boost::tuple Indices; + typedef boost::tuple Indices; typedef std::queue Indices_queue; typedef std::vector Border_vector; @@ -246,7 +250,7 @@ void Volume::search_for_connected_components(PointsOutputIterator it, int nb_voxels = 0; Indices_queue queue; - Indices indices(i, j ,k); + Indices indices(i, j ,k, 0); queue.push(indices); Border_vector border; @@ -271,6 +275,7 @@ void Volume::search_for_connected_components(PointsOutputIterator it, const int i = boost::get<0>(indices); const int j = boost::get<1>(indices); const int k = boost::get<2>(indices); + const int depth = boost::get<3>(indices); if(visited[i][j][k] < pass) { @@ -313,7 +318,7 @@ void Volume::search_for_connected_components(PointsOutputIterator it, if(transform(m_image.value(i_n, j_n, k_n)) == current_label) { if(visited[i_n][j_n][k_n] < pass) { - Indices indices(i_n, j_n, k_n); + Indices indices(i_n, j_n, k_n, depth+1); queue.push(indices); } } @@ -340,7 +345,7 @@ void Volume::search_for_connected_components(PointsOutputIterator it, { // if(nb_voxels >= 100) { - *it++ = m_image.point(i, j, k); + *it++ = std::make_pair(m_image.point(i, j, k), (depth+1)*max_v); std::cerr << boost::format("Found seed %5%, which is voxel (%1%, %2%, %3%), value=%4%\n") % i % j % k % m_image.value(i, j, k) % m_image.point(i, j, k); } diff --git a/Surface_mesher/include/CGAL/enriched_polyhedron.h b/Surface_mesher/include/CGAL/enriched_polyhedron.h index 29c0f9d38ea..09ac52042ae 100644 --- a/Surface_mesher/include/CGAL/enriched_polyhedron.h +++ b/Surface_mesher/include/CGAL/enriched_polyhedron.h @@ -233,9 +233,7 @@ struct Vertex_normal // (functor) //********************************************************* template -#endif class HDS = CGAL::HalfedgeDS_default > class Enriched_polyhedron : public CGAL::Polyhedron_3 { diff --git a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/CMakeLists.txt b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/CMakeLists.txt index c6c0b48d86f..ca3220c906e 100644 --- a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/CMakeLists.txt +++ b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/CMakeLists.txt @@ -46,8 +46,8 @@ find_package(TAUCS) # Find BLAS and LAPACK only (optional), for Jet Fitting find_package(LAPACK) -# Find Eigen3 (requires 3.1.0-alpha1 or greater) -find_package(Eigen3 3.0.91) +# Find Eigen3 (requires 3.1.0 or greater) +find_package(Eigen3 3.1.0) # Find Glew (optional), for splatting set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/GlSplat/cmake) diff --git a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_off_plugin.cpp b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_off_plugin.cpp index b92a3ead58e..f86efd726ce 100644 --- a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_off_plugin.cpp +++ b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_off_plugin.cpp @@ -36,7 +36,7 @@ PS_demo_off_plugin::load(QFileInfo fileinfo) { // Check extension (quietly) std::string extension = fileinfo.suffix().toUtf8().data(); if (extension != "off" && extension != "OFF") - return false; + return NULL; // Open file std::ifstream in(fileinfo.filePath().toUtf8().data()); diff --git a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_xyz_plugin.cpp b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_xyz_plugin.cpp index 6f4c8fffb81..28f95867d34 100644 --- a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_xyz_plugin.cpp +++ b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/PS_demo_xyz_plugin.cpp @@ -37,7 +37,7 @@ PS_demo_xyz_plugin::load(QFileInfo fileinfo) std::string extension = fileinfo.suffix().toUtf8().data(); if (extension != "xyz" && extension != "XYZ" && extension != "pwn" && extension != "PWN") - return false; + return NULL; // Open file std::ifstream in(fileinfo.filePath().toUtf8().data()); diff --git a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/Polyhedron_type_fwd.h b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/Polyhedron_type_fwd.h index fd4bb815cfb..e0865e12d97 100644 --- a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/Polyhedron_type_fwd.h +++ b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/Polyhedron_type_fwd.h @@ -15,16 +15,12 @@ namespace CGAL { class Polyhedron_items_3; -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class HalfedgeDS_default; template < class PolyhedronTraits_3, class PolyhedronItems_3, -#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM template < class T, class I, class A> -#endif class T_HDS, class Alloc > diff --git a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/include/Point_set_3.h b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/include/Point_set_3.h index 4e2392b19df..bca6cbd0283 100644 --- a/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/include/Point_set_3.h +++ b/Surface_reconstruction_points_3/demo/Surface_reconstruction_points_3/include/Point_set_3.h @@ -102,9 +102,9 @@ public: // Repeat base class' public methods used below /// @cond SKIP_IN_MANUAL - Base::begin; - Base::end; - Base::size; + using Base::begin; + using Base::end; + using Base::size; /// @endcond /// Gets the number of selected points. diff --git a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex index 08859fd7c30..d2a19d5f902 100644 --- a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex +++ b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3/PkgDescription.tex @@ -2,7 +2,7 @@ \ccPkgHowToCiteCgal{cgal:asg-srps-12} \ccPkgSummary{ This \cgal\ package implements a surface reconstruction method: Poisson Surface Reconstruction. It takes as input a set of points with oriented normals and computes an implicit function. The \cgal\ surface mesh generator can then be used to extract an iso-surface from this function. } % -\ccPkgDependsOn{\ccThirdPartyEigen or \ccThirdPartyTaucs} +\ccPkgDependsOn{\ccThirdPartyEigen\ or \ccThirdPartyTaucs} \ccPkgIntroducedInCGAL{3.5} \ccPkgLicense{\ccLicenseGPL} \ccPkgDemo{Surface Reconstruction}{surface_reconstruction_points_3.zip} diff --git a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex index 8d135f4d2f8..c3cdfda0a12 100644 --- a/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex +++ b/Surface_reconstruction_points_3/doc_tex/Surface_reconstruction_points_3_ref/Poisson_reconstruction_function.tex @@ -108,7 +108,7 @@ Creates a Poisson implicit function from the [first, beyond) range of points. \ccCommentHeading{Template Parameters} \\ \ccc{InputIterator}: iterator over input points. \ccc{PointPMap}: is a model of \ccc{boost::ReadablePropertyMap} with a \ccc{value_type} = \ccc{Point_3}. It can be omitted if \ccc{InputIterator} \ccc{value_type} is convertible to \ccc{Point_3}. \ccc{NormalPMap}: is a model of \ccc{boost::ReadablePropertyMap} with a \ccc{value_type} = \ccc{Vector_3}. \ccCommentHeading{Parameters} \\ -\ccc{first}: iterator over the first input point. \ccc{beyond}: past-the-end iterator over the input points. \ccc{point_pmap}: property map to access the position of an input point. \ccc{normal_pmap}: property map to access the {\bf oriented} normal of an input point. +\ccc{first}: iterator over the first input point. \ccc{beyond}: past-the-end iterator over the input points. \ccc{point_pmap}: property map to access the position of an input point. \ccc{normal_pmap}: property map to access the oriented normal of an input point. } \ccGlue diff --git a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt index c52d576622a..227ca7618c9 100644 --- a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt +++ b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/CMakeLists.txt @@ -21,7 +21,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Installation/cmake/mo include_directories (BEFORE . include ../../include) # Find CGAL -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL QUIET COMPONENTS Core Eigen3 MPFI ) if ( CGAL_FOUND ) @@ -54,36 +54,25 @@ if ( CGAL_FOUND ) ADD_DEFINITIONS( "-DDEBUG_TRACE" ) # turn on traces - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) - if (NOT EIGEN3_FOUND) - find_package(TAUCS) - if(TAUCS_FOUND) - include( ${TAUCS_USE_FILE} ) - endif(TAUCS_FOUND) - else() +# find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) + if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) endif() + find_package(TAUCS) + if(TAUCS_FOUND) + include( ${TAUCS_USE_FILE} ) + endif(TAUCS_FOUND) + if (EIGEN3_FOUND OR TAUCS_FOUND) # Executables that require Eigen 3 or TAUCS create_single_source_cgal_program( "poisson_reconstruction_example.cpp" ) + create_single_source_cgal_program( "poisson_reconstruction.cpp" ) else() - message(STATUS "NOTICE: Example poisson_reconstruction_example.cpp needs Eigen 3.1 (or greater) or the TAUCS library and will not be compiled.") + message(STATUS "NOTICE: The examples needs Eigen 3.1 (or greater) or the TAUCS library and will not be compiled.") endif() - if (EIGEN3_FOUND) - # Link with BLAS, LAPACK and TAUCS (optional) - find_package(TAUCS) - endif() - if(TAUCS_FOUND) - include( ${TAUCS_USE_FILE} ) - # Executables that require TAUCS - create_single_source_cgal_program( "poisson_reconstruction.cpp" ) - else(TAUCS_FOUND) - message(STATUS "NOTICE: Some of the executables in this directory need the TAUCS library and will not be compiled.") - endif(TAUCS_FOUND) - else() message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") diff --git a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp index c9c9decd1e8..4e185deeacc 100644 --- a/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp +++ b/Surface_reconstruction_points_3/examples/Surface_reconstruction_points_3/poisson_reconstruction.cpp @@ -25,8 +25,9 @@ #include #include #include +#ifdef CGAL_TAUCS_ENABLED #include -//#include +#endif #include "compute_normal.h" @@ -92,7 +93,10 @@ int main(int argc, char * argv[]) std::cerr << "Options:\n"; std::cerr << " -sm_radius Radius upper bound (default=100 * average spacing)\n"; std::cerr << " -sm_distance Distance upper bound (default=0.25 * average spacing)\n"; - // std::cerr << " -solver taucs|mkl Sparse linear solver (default=TAUCS)\n"; + #if defined(CGAL_EIGEN3_ENABLED) && defined(CGAL_TAUCS_ENABLED) + std::cerr << " -solver eigen|taucs Sparse linear solver (default=eigen)\n"; + #endif + return EXIT_FAILURE; } @@ -100,7 +104,15 @@ int main(int argc, char * argv[]) FT sm_angle = 20.0; // Min triangle angle (degrees). FT sm_radius = 100; // Max triangle size w.r.t. point set average spacing. FT sm_distance = 0.25; // Approximation error w.r.t. point set average spacing. - std::string solver_name = "taucs"; // Sparse linear solver name. + #ifdef CGAL_EIGEN3_ENABLED + std::string solver_name = "eigen"; // Sparse linear solver name. + #else + #ifdef CGAL_TAUCS_ENABLED + std::string solver_name = "taucs"; // Sparse linear solver name. + #else + std::string solver_name = "no_solver_available"; + #endif + #endif // decode parameters std::string input_filename = argv[1]; @@ -217,6 +229,7 @@ int main(int argc, char * argv[]) points.begin(), points.end(), CGAL::make_normal_of_point_with_normal_pmap(points.begin())); + #ifdef CGAL_TAUCS_ENABLED if (solver_name == "taucs") { std::cerr << "Use TAUCS out-of-core Multifrontal Supernodal Cholesky Factorization\n"; @@ -242,29 +255,32 @@ int main(int argc, char * argv[]) return EXIT_FAILURE; } } - /* - else if (solver_name == "mkl") + else + #endif + #ifdef CGAL_EIGEN3_ENABLED { - std::cerr << "Use MKL Pardiso\n"; - - // Creates sparse linear solver: MKL Pardiso - //CGAL::MKL_symmetric_solver_traits solver; - CGAL::MKL_symmetric_solver_traits solver; - - // Computes the Poisson indicator function f() - // at each vertex of the triangulation. - if ( ! function.compute_implicit_function(solver) ) + if (solver_name == "eigen") { - std::cerr << "Error: cannot compute implicit function" << std::endl; + std::cerr << "Use Eigen 3\n"; + if ( ! function.compute_implicit_function() ) + { + std::cerr << "Error: cannot compute implicit function" << std::endl; + return EXIT_FAILURE; + } + } + else + { + std::cerr << "Error: invalid solver " << solver_name << "\n"; return EXIT_FAILURE; } } - */ - else + #else { std::cerr << "Error: invalid solver " << solver_name << "\n"; return EXIT_FAILURE; } + #endif + // Prints status std::cerr << "Total implicit function (triangulation+refinement+solver): " << task_timer.time() << " seconds\n"; diff --git a/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/CMakeLists.txt b/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/CMakeLists.txt index cb73acb4164..c525afa2725 100644 --- a/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/CMakeLists.txt +++ b/Surface_reconstruction_points_3/test/Surface_reconstruction_points_3/CMakeLists.txt @@ -52,7 +52,7 @@ if ( CGAL_FOUND ) # Temporary debugging stuff ADD_DEFINITIONS( "-DDEBUG_TRACE" ) # turn on traces - find_package(Eigen3 3.0.91) #(requires 3.1.0-alpha1 or greater) + find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) find_package(TAUCS) if(TAUCS_FOUND) diff --git a/Testsuite/test/collect_cgal_testresults_from_cmake b/Testsuite/test/collect_cgal_testresults_from_cmake index 3a861e89cd6..daa21f63f71 100755 --- a/Testsuite/test/collect_cgal_testresults_from_cmake +++ b/Testsuite/test/collect_cgal_testresults_from_cmake @@ -200,6 +200,17 @@ output_main_logs() echo "Not found!" >> "$INSTALLATION_TEST_REPORT" fi + echo "" >> "$INSTALLATION_TEST_REPORT" + echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" + echo " include/CGAL/compiler_config.h" >> "$INSTALLATION_TEST_REPORT" + echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" + echo "" >> "$INSTALLATION_TEST_REPORT" + if [ -f "../include/CGAL/compiler_config.h" ] ; then + cat "../include/CGAL/compiler_config.h" >> "$INSTALLATION_TEST_REPORT" + else + echo "Not found!" >> "$INSTALLATION_TEST_REPORT" + fi + echo "" >> "$INSTALLATION_TEST_REPORT" echo "---------------------------------------------------------------" >> "$INSTALLATION_TEST_REPORT" echo " CGALConfig.cmake" >> "$INSTALLATION_TEST_REPORT" diff --git a/Triangulation_2/benchmark/Triangulation_2/CDT_with_intersection_2.cpp b/Triangulation_2/benchmark/Triangulation_2/CDT_with_intersection_2.cpp new file mode 100644 index 00000000000..6075b23de80 --- /dev/null +++ b/Triangulation_2/benchmark/Triangulation_2/CDT_with_intersection_2.cpp @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + +typedef CGAL::Triangulation_vertex_base_2 Vb; +typedef CGAL::Constrained_triangulation_face_base_2 Fb; +typedef CGAL::Triangulation_data_structure_2 TDS; +typedef CGAL::Exact_predicates_tag Itag; +typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; +typedef CDT::Point Point; + +typedef CGAL::Creator_uniform_2 Creator; +typedef CGAL::Random_points_in_square_2 Point_generator; + + +int main(int argc,char** argv ) +{ + int n_segments=100000; + if (argc==2) n_segments=atoi(argv[1]); + + + CGAL::Random rand(0); + std::vector point_set; + point_set.reserve(2*n_segments); + + CGAL::cpp11::copy_n(Point_generator(1,rand), 2*n_segments,std::back_inserter(point_set)); + + std::cout << point_set.size()/2 << " segments" << std::endl; + + CDT cdt; + + CGAL::Timer time; + time.start(); + cdt.insert( point_set.begin(),point_set.end() ); + time.stop(); + + std::cout << "Inserting points in " << time.time() << std::endl; + time.reset(); + + std::vector vertex_handles; + vertex_handles.reserve(2*n_segments); + + for (CDT::Finite_vertices_iterator vit=cdt.finite_vertices_begin(), + vit_end=cdt.finite_vertices_end();vit!=vit_end;++vit) + { + vertex_handles.push_back(vit); + } + + boost::rand48 random; + boost::random_number_generator rng(random); + std::random_shuffle(vertex_handles.begin(),vertex_handles.end(),rng); + + time.start(); + for (int i=0;i(2*n_segments) << " intersection points\n"; + + return 0; +} diff --git a/Triangulation_2/benchmark/Triangulation_2/CMakeLists.txt b/Triangulation_2/benchmark/Triangulation_2/CMakeLists.txt index 16c110d8f82..e7e75190ef4 100644 --- a/Triangulation_2/benchmark/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/benchmark/Triangulation_2/CMakeLists.txt @@ -27,6 +27,7 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "Triangulation_benchmark_2.cpp" ) create_single_source_cgal_program( "Delaunay_remove.cpp" ) + create_single_source_cgal_program( "CDT_with_intersection_2.cpp" ) else() diff --git a/Triangulation_2/doc_tex/TDS_2_ref/TriangulationDataStructure_2.tex b/Triangulation_2/doc_tex/TDS_2_ref/TriangulationDataStructure_2.tex index b0ac3584626..577c0a593cc 100644 --- a/Triangulation_2/doc_tex/TDS_2_ref/TriangulationDataStructure_2.tex +++ b/Triangulation_2/doc_tex/TDS_2_ref/TriangulationDataStructure_2.tex @@ -89,6 +89,20 @@ supports the two dereference operators \ccc{*} and \ccc{->}. \ccGlue \ccNestedType{Face_handle}{Handle to a face.} +\begin{ccAdvanced} +\ccNestedType{template struct Rebind_vertex} +{This nested template class allows to get the type of a triangulation +data structure that only changes the vertex type. It has to define a type +\ccc{Other} which is a {\it rebound} triangulation data structure, that is, the +one whose \ccc{TriangulationDSVertexBase_2} will be \ccc{Vb2}.} +\ccGlue +\ccNestedType{template struct Rebind_face} +{This nested template class allows to get the type of a triangulation +data structure that only changes the face type. It has to define a type +\ccc{Other} which is a {\it rebound} triangulation data structure, that is, the +one whose \ccc{TriangulationDSFaceBase_2} will be \ccc{Fb2}.} +\end{ccAdvanced} + \ccTypedef{typedef std::pair Edge;}{The edge type. The \ccc{Edge(f,i)} is edge common to faces \ccc{f} and diff --git a/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex b/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex index 18368831f49..e9fbf24047d 100644 --- a/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex +++ b/Triangulation_2/doc_tex/Triangulation_2/triangulation_user.tex @@ -788,11 +788,11 @@ The class \ccc{Regular_triangulation_2} is designed to maintain the regular triangulation of a set of $2d$ weighted points. It derives from the class \ccc{Triangulation_2}. -The functions \ccc{insert} and +The functions \ccHtmlNoLinksFrom{\ccc{insert}} and \ccc{remove} are overwritten to handle weighted points and maintain the regular property. -In current version, function \ccc{move} is not +The function \ccHtmlNoLinksFrom{\ccc{move}} is not overwritten and thus does not preserve the regular property. The vertices of the regular triangulation of a set of weighted points ${PW}$ correspond only to a subset @@ -968,7 +968,7 @@ overrides the insertion and removal of a point to take care of the information about constrained edges. The class also allows inline insertion of a new constraint, given by its two endpoints or the removal of a constraint. -In current version, function \ccc{move} is not +In current version, function \ccHtmlNoLinksFrom{\ccc{move}} is not overwritten and thus does not take care of the constraints. \subsubsection{The Geometric Traits} @@ -1221,7 +1221,7 @@ classes. The class \ccc{Triangulation_hierarchy_2} inherits from the triangulation type passed as template parameter \ccc{Tr}. -The \ccc{insert}, \ccc{move}, and \ccc{remove} member functions +The \ccHtmlNoLinksFrom{\ccc{insert}}, \ccHtmlNoLinksFrom{\ccc{move}}, and \ccc{remove} member functions are overwritten to update the data structure at each operation. The locate queries are also overwritten to take advantage of the data structure for a fast processing. @@ -1382,7 +1382,7 @@ of the corresponding point given in the range. \subsubsection{Using an Iterator Over Pairs} Each point and its information are gathered into a pair. We provide -the \ccc{insert} function of the triangulation with a range of such pairs. +the \ccHtmlNoLinksFrom{\ccc{insert}} function of the triangulation with a range of such pairs. \ccIncludeExampleCode{Triangulation_2/info_insert_with_pair_iterator_2.cpp} diff --git a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex index 69ec9e2497a..1d7adf421c5 100644 --- a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex +++ b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_2.tex @@ -26,7 +26,7 @@ edges in the triangulation are called {\em constrained edges}. The endpoints of constrained edges are of course vertices of the triangulation. However the triangulation may include -include other vertices as well. +other vertices as well. There are three versions of constrained triangulations \begin{itemize} \item @@ -213,11 +213,11 @@ for the location of \ccc{p}.} is \ccc{Point}.} \ccMethod{void insert_constraint(Point a, Point b);} -{ Inserts points a and b, and inserts segment ab as a -constraint. Removes the faces crossed by segment ab and creates new -faces instead. If a vertex c lies on segment ab, constraint ab is -replaced by the two constraints ac and \ccc{cb}. Apart from the insertion of -a and b, the algorithm runs in time proportional to the number of +{ Inserts points \ccc{a} and \ccc{b}, and inserts segment \ccc{ab} as a +constraint. Removes the faces crossed by segment \ccc{ab} and creates new +faces instead. If a vertex \ccc{c} lies on segment \ccc{ab}, constraint \ccc{ab} is +replaced by the two constraints \ccc{ac} and \ccc{cb}. Apart from the insertion of +\ccc{a} and \ccc{b}, the algorithm runs in time proportional to the number of removed triangles. \ccPrecond The relative interior of segment \ccc{ab} does not intersect the relative interior of another constrained edge.} @@ -228,12 +228,12 @@ intersect the relative interior of another constrained edge.} \ccMethod{ void insert_constraint(const Vertex_handle & va, const Vertex_handle & vb);} { Inserts the line segment \ccc{s} whose endpoints are the vertices \ccc{va} and -\ccc{vb} as a constrained edge \ccc{e}. The triangles intersected by s +\ccc{vb} as a constrained edge \ccc{e}. The triangles intersected by \ccc{s} are removed and new ones are created.} \ccMethod{void remove(Vertex_handle v);} -{ Removes a vertex v. +{ Removes a vertex \ccc{v}. \ccPrecond Vertex \ccc{v} is not incident to a constrained edge.} \ccMethod{ void remove_incident_constraints(Vertex_handle v);} diff --git a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex index dc6a281517c..2f8d4476d4b 100644 --- a/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex +++ b/Triangulation_2/doc_tex/Triangulation_2_ref/Constrained_triangulation_plus_2.tex @@ -102,7 +102,7 @@ is \ccc{Context}.} \ccConstructor{Constrained_triangulation_plus_2(const Constrained_triangulation_plus_2& ct);}{Copy constructor.} -\ccConstructor{Constrained_triangulation_plus_2(std::list& lc, +\ccConstructor{Constrained_triangulation_plus_2(std::list& lc, const Geom_traits& t = Geom_traits())} {Introduces and builds a constrained triangulation from the list of constraints \ccc{lc}.} @@ -119,9 +119,9 @@ $\left[\right.$\ccc{first}, \ccc{last}$\left.\right)$. is \ccc{Constraint}. } -\ccFunction{void ~ctp();} -{Destructor. All vertices and faces are deleted. -The constraint hierarchy is deleted.} +%\ccFunction{void ~ctp();} +%{Destructor. All vertices and faces are deleted. +%The constraint hierarchy is deleted.} diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 7c009f4c51a..234723edded 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -617,6 +617,11 @@ intersect(Face_handle , int , Vertex_handle , No_intersection_tag) { + //SL: I added that to be able to throw while we find a better solution + #ifdef CGAL_CT2_WANTS_TO_HAVE_EXTRA_ACTION_FOR_INTERSECTING_CONSTRAINTS + CGAL_CDT2_EXTRA_ACTION_FOR_INTERSECTING_CONSTRAINTS + #endif + std::cerr << " sorry, this triangulation does not deal with" << std::endl << " intersecting constraints" << std::endl; diff --git a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h index 2021584905b..ea81ae1117a 100644 --- a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -62,6 +63,17 @@ class Triangulation_data_structure_2 friend class Triangulation_ds_vertex_circulator_2; public: + // Tools to change the Vertex and Face types of the TDS. + template < typename Vb2 > + struct Rebind_vertex { + typedef Triangulation_data_structure_2 Other; + }; + + template < typename Fb2 > + struct Rebind_face { + typedef Triangulation_data_structure_2 Other; + }; + typedef Vertex_base Vertex; typedef Face_base Face; @@ -286,7 +298,7 @@ public: Face_handle f1, Face_handle f2, Face_handle f3); - void set_adjacency(Face_handle f0, int i0, Face_handle f1, int i1) const; + void set_adjacency(Face_handle f0, int i0, Face_handle f1, int i1) const; void delete_face(Face_handle); void delete_vertex(Vertex_handle); @@ -1772,8 +1784,8 @@ copy_tds(const Tds &tds, Vertex_handle vh) if(n == 0) {return Vertex_handle();} //initializes maps - std::map vmap; - std::map fmap; + Unique_hash_map vmap; + Unique_hash_map fmap; // create vertices Vertex_iterator vit1 = tds.vertices_begin(); @@ -1825,8 +1837,9 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const else os << n << m << dimension(); if (n==0) return; - std::map V; - std::map F; + Unique_hash_map V; + Unique_hash_map F; + // first vertex int inum = 0; @@ -1961,7 +1974,8 @@ vrml_output( std::ostream& os, Vertex_handle v, bool skip_infinite) const os << "\t\tcoord Coordinate {" << std::endl; os << "\t\t\tpoint [" << std::endl; - std::map vmap; + Unique_hash_map vmap; + Vertex_iterator vit; Face_iterator fit; @@ -2030,7 +2044,7 @@ off_file_input( std::istream& is, bool verbose) typedef typename Vb::Point Point; // read vertices - int i; + std::size_t i; for ( i = 0; i < scanner.size_of_vertices(); i++) { Point p; file_scan_vertex( scanner, p); @@ -2060,14 +2074,14 @@ off_file_input( std::istream& is, bool verbose) return vinf; } - for ( int j = 0; j < no; ++j) { + for ( std::size_t j = 0; j < no; ++j) { std::size_t index; scanner.scan_facet_vertex_index( index, i); fh->set_vertex(j, vvh[index]); vvh[index]->set_face(fh); } - for (int ih = 0; ih < no; ++ih) { + for (std::size_t ih = 0; ih < no; ++ih) { set_adjacency(fh, ih, edge_map); } } diff --git a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xy_3.h b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xy_3.h index 616397da44b..961136ddffc 100644 --- a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xy_3.h +++ b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xy_3.h @@ -21,6 +21,10 @@ #ifndef CGAL_TRIANGULATION_EUCLIDEAN_TRAITS_XY_3_H #define CGAL_TRIANGULATION_EUCLIDEAN_TRAITS_XY_3_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xz_3.h b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xz_3.h index 86f35f3eca3..f0cdefa5aaf 100644 --- a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xz_3.h +++ b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_xz_3.h @@ -21,6 +21,10 @@ #ifndef CGAL_TRIANGULATION_EUCLIDEAN_TRAITS_XZ_3_H #define CGAL_TRIANGULATION_EUCLIDEAN_TRAITS_XZ_3_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + #include namespace CGAL { diff --git a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_yz_3.h b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_yz_3.h index cc164224912..8a92296c254 100644 --- a/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_yz_3.h +++ b/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_yz_3.h @@ -21,6 +21,10 @@ #ifndef CGAL_TRIANGULATION_EUCLIDEAN_TRAITS_YZ_3_H #define CGAL_TRIANGULATION_EUCLIDEAN_TRAITS_YZ_3_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + #include namespace CGAL { diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h index fdc73205eb5..7fc3279c2cb 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_hierarchy_2.h @@ -135,6 +135,8 @@ _test_cls_hierarchy_2() h.remove_constraint(v[3],v[4]); // h.print(); + for(int i=0; i <10; i++) { delete v[i];} + return; } diff --git a/Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_proj.cpp b/Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_proj.cpp index 9aa0850ea21..3a93c6afe32 100644 --- a/Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_proj.cpp +++ b/Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_proj.cpp @@ -1,3 +1,7 @@ +// This file tests the deprecated headers +// Triangulation_euclidean_traits_.._3 on purpose. +#define CGAL_NO_DEPRECATION_WARNINGS 1 + #include #include #include diff --git a/Triangulation_2/test/Triangulation_2/test_triangulation_geom_traits.cpp b/Triangulation_2/test/Triangulation_2/test_triangulation_geom_traits.cpp index 2f2559042c0..ee919bb9f76 100644 --- a/Triangulation_2/test/Triangulation_2/test_triangulation_geom_traits.cpp +++ b/Triangulation_2/test/Triangulation_2/test_triangulation_geom_traits.cpp @@ -23,13 +23,28 @@ #include #include -#include -#include -#include - +#include #include #include +// Just define our own traits for the tests here to prevent including +// the deprecated headers. Otherwise they trigger spurious warnings in +// the test suite. + +namespace CGAL { +template < class R > +class Triangulation_euclidean_traits_yz_3 + : public CGAL::internal::Projection_traits_3 +{}; +template < class R > +class Triangulation_euclidean_traits_xz_3 + : public CGAL::internal::Projection_traits_3 +{}; +template < class R > +class Triangulation_euclidean_traits_xy_3 + : public CGAL::internal::Projection_traits_3 +{}; +} // CGAL int main() diff --git a/Triangulation_3/doc_tex/TriangulationDS_3/TDS3.tex b/Triangulation_3/doc_tex/TriangulationDS_3/TDS3.tex index e4ff1beb7d2..a0e79bbed54 100644 --- a/Triangulation_3/doc_tex/TriangulationDS_3/TDS3.tex +++ b/Triangulation_3/doc_tex/TriangulationDS_3/TDS3.tex @@ -274,8 +274,8 @@ see Chapter~\ref{chapter-Triangulation3}). The user has several ways to add his own data in the vertex and cell base classes used by the TDS. He can either: \begin{itemize} -\item{} use the classes \ccc{Triangulation_vertex_base_with_info} -and \ccc{Triangulation_cell_base_with_info}, which allow to add one data member +\item{} use the classes \ccc{Triangulation_vertex_base_with_info_3} +and \ccc{Triangulation_cell_base_with_info_3}, which allow to add one data member of a user provided type, and give access to it. \item{} derive his own classes from the default base classes \ccc{Triangulation_ds_vertex_base}, and \ccc{Triangulation_ds_cell_base} (or diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 79a8a521374..894fee0afbe 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -47,12 +47,18 @@ namespace CGAL { +// Here is the declaration of a class template with three arguments, one +// having a default value. There is no definition of that class template. template < class Gt, class Tds_ = Default, class Location_policy = Default > class Delaunay_triangulation_3; +// There is a specialization Delaunay_triangulation_3 +// defined in . +// Here is the specialization Delaunay_triangulation_3, with two +// arguments, that is if Location_policy being the default value 'Default'. template < class Gt, class Tds_ > class Delaunay_triangulation_3 : public Triangulation_3 diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index a654029e7d3..c52ea6c70c5 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -1571,7 +1572,7 @@ operator<< (std::ostream& os, const Triangulation_3 &tr) CGAL_triangulation_assertion( i == n+1 ); CGAL_triangulation_assertion( tr.is_infinite(TV[0]) ); - std::map V; + Unique_hash_map V; V[tr.infinite_vertex()] = 0; for (i=1; i <= n; i++) { diff --git a/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h b/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h index 5c77dbd85d5..d0ca2a9bdf4 100644 --- a/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -303,7 +304,7 @@ public: std::size_t & m, std::map< std::size_t, Cell_handle > &C ); // not documented void print_cells(std::ostream& os, - const std::map &V ) const; + const Unique_hash_map &V ) const; // ACCESS FUNCTIONS @@ -1332,7 +1333,8 @@ operator<<(std::ostream& os, const Triangulation_data_structure_3 &tds) typedef typename Tds::Vertex_handle Vertex_handle; typedef typename Tds::Vertex_iterator Vertex_iterator; - std::map V; + + Unique_hash_map V; // outputs dimension and number of vertices size_type n = tds.number_of_vertices(); @@ -1915,7 +1917,7 @@ read_cells(std::istream& is, std::map< std::size_t, Vertex_handle > &V, template < class Vb, class Cb> void Triangulation_data_structure_3:: -print_cells(std::ostream& os, const std::map &V ) const +print_cells(std::ostream& os, const Unique_hash_map &V ) const { std::map C; std::size_t i = 0; @@ -1935,14 +1937,14 @@ print_cells(std::ostream& os, const std::map &V ) co C[it] = i++; for(int j = 0; j < 4; j++){ if(is_ascii(os)) { - os << V.find(it->vertex(j))->second; + os << V[it->vertex(j)]; if ( j==3 ) os << std::endl; else os << ' '; } else - write(os, V.find(it->vertex(j))->second); + write(os, V[it->vertex(j)]); } } CGAL_triangulation_assertion( i == m ); @@ -1977,14 +1979,14 @@ print_cells(std::ostream& os, const std::map &V ) co C[(*it).first] = i++; for(int j = 0; j < 3; j++){ if(is_ascii(os)) { - os << V.find((*it).first->vertex(j))->second; + os << V[(*it).first->vertex(j)]; if ( j==2 ) os << std::endl; else os << ' '; } else { - write(os, V.find((*it).first->vertex(j))->second); + write(os, V[(*it).first->vertex(j)]); } } } @@ -2020,14 +2022,14 @@ print_cells(std::ostream& os, const std::map &V ) co C[(*it).first] = i++; for(int j = 0; j < 2; j++){ if(is_ascii(os)) { - os << V.find((*it).first->vertex(j))->second; + os << V[(*it).first->vertex(j)]; if ( j==1 ) os << std::endl; else os << ' '; } else { - write(os, V.find((*it).first->vertex(j))->second); + write(os, V[(*it).first->vertex(j)]); } } } @@ -3337,8 +3339,8 @@ copy_tds(const Tds & tds, Vertex_handle vert ) CGAL_triangulation_assertion( i == n ); - std::map< Vertex_handle, Vertex_handle > V; - std::map< Cell_handle, Cell_handle > F; + Unique_hash_map V; + Unique_hash_map F; for (size_type i=0; i <= n-1; ++i) V[ TV[i] ] = create_vertex(TV[i]); diff --git a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h index c207324c03f..c52bec6781d 100644 --- a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h @@ -207,7 +207,7 @@ public: // some internal methods template Vertex_handle insert_and_give_new_cells(const Point& p, - OutputItCells fit, + OutputItCells /* fit */, Vertex_handle hint) { return insert_and_give_new_cells(p, hint == Vertex_handle() ? diff --git a/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h b/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h index 5d8d84ee1d3..aad149c1085 100644 --- a/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h +++ b/Triangulation_3/include/CGAL/constructions/constructions_on_weighted_points_cartesian_3.h @@ -375,9 +375,9 @@ power_productC3( template < class RT , class We> void -radical_axisC3(const RT &px, const RT &py, const RT &pz, const We &pw, - const RT &qx, const RT &qy, const RT &qz, const We &qw, - const RT &rx, const RT &ry, const RT &rz, const We &rw, +radical_axisC3(const RT &px, const RT &py, const RT &pz, const We & /* pw */, + const RT &qx, const RT &qy, const RT &qz, const We & /* qw */, + const RT &rx, const RT &ry, const RT &rz, const We & /* rw */, RT &a, RT &b, RT& c ) { RT dqx=qx-px, dqy=qy-py, dqz=qz-pz, drx=rx-px, dry=ry-py, drz=rz-pz; diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h index 0ec2c8806be..918d44283da 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_delaunay_3.h @@ -897,6 +897,7 @@ _test_cls_delaunay_3(const Triangulation &) { Cell_handle c = T4.finite_cells_begin(); Point p = T4.dual(c); + (void)p; Facet f = Facet(c, 2); CGAL::Object o = T4.dual(f); o = T4.dual(f.first, f.second); diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Apollonius_diagram_halfedge_2.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Apollonius_diagram_halfedge_2.h index 80759dc9124..f6bf4079263 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Apollonius_diagram_halfedge_2.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Apollonius_diagram_halfedge_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Voronoi_diagram_halfedge_2.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Voronoi_diagram_halfedge_2.h index 62db0e93e67..f56a5f9bceb 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Voronoi_diagram_halfedge_2.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_Voronoi_diagram_halfedge_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_power_diagram_halfedge_2.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_power_diagram_halfedge_2.h index 64ad90c176d..571af99449e 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_power_diagram_halfedge_2.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/CGAL/IO/Qt_widget_power_diagram_halfedge_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/Virtual_Voronoi_diagram_2.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/Virtual_Voronoi_diagram_2.h index 60311f39346..8b9a2428400 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/Virtual_Voronoi_diagram_2.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/include/Virtual_Voronoi_diagram_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/my_window.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/my_window.h index 8e9940ec2ff..51a1d9f151c 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/my_window.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/my_window.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_file_toolbar.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_file_toolbar.h index 0c6dc16627a..12cde0d7c0a 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_file_toolbar.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_file_toolbar.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers.h index 30b76b9fdbb..d06515f3c54 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers_toolbar.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers_toolbar.h index 152abbbfa59..0830020e1d4 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers_toolbar.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/qt_layers_toolbar.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/typedefs.h b/Voronoi_diagram_2/demo/Voronoi_diagram_2/typedefs.h index 399f419419e..82c51fce4c5 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/typedefs.h +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/typedefs.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/demo/Voronoi_diagram_2/voronoi_diagram_2.cpp b/Voronoi_diagram_2/demo/Voronoi_diagram_2/voronoi_diagram_2.cpp index 337178b2f77..51333388068 100644 --- a/Voronoi_diagram_2/demo/Voronoi_diagram_2/voronoi_diagram_2.cpp +++ b/Voronoi_diagram_2/demo/Voronoi_diagram_2/voronoi_diagram_2.cpp @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/PkgDescription.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/PkgDescription.tex index 34dc4f98293..415839acec7 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/PkgDescription.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/PkgDescription.tex @@ -15,7 +15,7 @@ Voronoi diagrams and can support point location queries. } % %\ccPkgDependsOn{} \ccPkgIntroducedInCGAL{3.2} -\ccPkgLicense{\ccLicenseQPL} +\ccPkgLicense{\ccLicenseGPL} \ccPkgDemo{2D Point Voronoi Diagram }{delaunay_triangulation_2.zip} \ccPkgDemo{2D Disk Voronoi Diagram}{apollonius_graph_2.zip} \ccPkgDemo{2D Segment Voronoi Diagram}{segment_voronoi_diagram_2.zip} diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2.tex index 4921b3dd6d5..af947fcbede 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2_examples.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2_examples.tex index 75cdbf90da9..c7cd3b4896d 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2_examples.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/Voronoi_diagram_adaptor_2_examples.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/main.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/main.tex index a681f479cc3..c4e17c431de 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/main.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2/main.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_caching_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_caching_degeneracy_removal_policy_2.tex index 666b8437f9a..38089a2ff08 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_caching_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_caching_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_degeneracy_removal_policy_2.tex index b4f7ae90a04..021361f1cf9 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AG_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationPolicy.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationPolicy.tex index b9e42725f00..64b08967c87 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationPolicy.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationPolicy.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationTraits_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationTraits_2.tex index 36f21ca40f2..0f3fbf1fb07 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationTraits_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/AdaptationTraits_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Apollonius_graph_adaptation_traits_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Apollonius_graph_adaptation_traits_2.tex index ab320f454b0..eb6614ee6e6 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Apollonius_graph_adaptation_traits_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Apollonius_graph_adaptation_traits_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_caching_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_caching_degeneracy_removal_policy_2.tex index 4900d275b95..5dfb209543d 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_caching_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_caching_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_degeneracy_removal_policy_2.tex index a41bd05b92a..fafd6132208 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DT_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DelaunayGraph_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DelaunayGraph_2.tex index 29ca2153c06..e568339412d 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DelaunayGraph_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/DelaunayGraph_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Delaunay_triangulation_adaptation_traits_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Delaunay_triangulation_adaptation_traits_2.tex index 5e3249c9668..23a6b91d289 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Delaunay_triangulation_adaptation_traits_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Delaunay_triangulation_adaptation_traits_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Identity_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Identity_policy_2.tex index 8e4874b965c..cd32ab52f5b 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Identity_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Identity_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_caching_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_caching_degeneracy_removal_policy_2.tex index 71c6b7c2df1..210b8ada3b7 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_caching_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_caching_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_degeneracy_removal_policy_2.tex index 1bb32d2e64e..f33682a4f5c 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/RT_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Regular_triangulation_adaptation_traits_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Regular_triangulation_adaptation_traits_2.tex index 1153f8018e9..ff702c23c70 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Regular_triangulation_adaptation_traits_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Regular_triangulation_adaptation_traits_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_caching_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_caching_degeneracy_removal_policy_2.tex index 5163ccccb3a..1516b5a7550 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_caching_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_caching_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_degeneracy_removal_policy_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_degeneracy_removal_policy_2.tex index a494b720da8..2a45f4617f7 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_degeneracy_removal_policy_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/SDG_degeneracy_removal_policy_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Segment_Delaunay_graph_adaptation_traits_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Segment_Delaunay_graph_adaptation_traits_2.tex index d537f93bbd1..6f9ef2e972e 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Segment_Delaunay_graph_adaptation_traits_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Segment_Delaunay_graph_adaptation_traits_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramFace_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramFace_2.tex index 35b8b921b69..7dcc3821871 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramFace_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramFace_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramHalfedge_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramHalfedge_2.tex index 4e602ab9721..a12241901de 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramHalfedge_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramHalfedge_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramVertex_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramVertex_2.tex index 1bb7650d2cd..0be9a7447fd 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramVertex_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/VoronoiDiagramVertex_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Voronoi_diagram_adaptor_2.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Voronoi_diagram_adaptor_2.tex index 1d0d46587c9..2481da7df63 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Voronoi_diagram_adaptor_2.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/Voronoi_diagram_adaptor_2.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/intro.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/intro.tex index b099dc63261..1733687aa69 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/intro.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/intro.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/main.tex b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/main.tex index 86d1866a086..60c5e1eb198 100644 --- a/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/main.tex +++ b/Voronoi_diagram_2/doc_tex/Voronoi_diagram_2_ref/main.tex @@ -1,9 +1,10 @@ %% Copyright (c) 2005 Foundation for Research and Technology-Hellas (Greece). %% All rights reserved. %% -%% This file is part of CGAL (www.cgal.org); you may redistribute it under -%% the terms of the Q Public License version 1.0. -%% See the file LICENSE.QPL distributed with CGAL. +%% 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. diff --git a/Voronoi_diagram_2/dont_submit b/Voronoi_diagram_2/dont_submit index bb01263ef21..1549b67ca59 100644 --- a/Voronoi_diagram_2/dont_submit +++ b/Voronoi_diagram_2/dont_submit @@ -1,2 +1 @@ -* demo diff --git a/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_policies_2.h b/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_policies_2.h index 273f6494129..6318d79ab20 100644 --- a/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_policies_2.h +++ b/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_policies_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_traits_2.h b/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_traits_2.h index 9ac4e325845..0f994a387cb 100644 --- a/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_traits_2.h +++ b/Voronoi_diagram_2/include/CGAL/Apollonius_graph_adaptation_traits_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_policies_2.h b/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_policies_2.h index 6f6b89de42f..c6cddc13022 100644 --- a/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_policies_2.h +++ b/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_policies_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_traits_2.h b/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_traits_2.h index f1fe9a900ab..a8f2b71a4b6 100644 --- a/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_traits_2.h +++ b/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_adaptation_traits_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Identity_policy_2.h b/Voronoi_diagram_2/include/CGAL/Identity_policy_2.h index 8b6cad12913..2ada2658229 100644 --- a/Voronoi_diagram_2/include/CGAL/Identity_policy_2.h +++ b/Voronoi_diagram_2/include/CGAL/Identity_policy_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_policies_2.h b/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_policies_2.h index 0588f07358a..d1ed0add3b4 100644 --- a/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_policies_2.h +++ b/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_policies_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_traits_2.h b/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_traits_2.h index e3c32bb2651..f3eec2ad2df 100644 --- a/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_traits_2.h +++ b/Voronoi_diagram_2/include/CGAL/Regular_triangulation_adaptation_traits_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h b/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h index 310d197957a..848bcbbb87d 100644 --- a/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h +++ b/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_policies_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h b/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h index 627ed220e34..56370de83ee 100644 --- a/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h +++ b/Voronoi_diagram_2/include/CGAL/Segment_Delaunay_graph_adaptation_traits_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h index 7293b86abfe..4fc82e351e2 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Accessor.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Accessor.h index 66864ebab81..d2bf8c98fe1 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Accessor.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Accessor.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_base_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_base_2.h index 09c856c8edf..a552a00b629 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_base_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_base_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_functors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_functors.h index 63ad6a286ee..ed02ee7ed0e 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_functors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Adaptation_traits_functors.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_degeneracy_testers.h index 9a83c92b1dd..d1ec214805c 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_degeneracy_testers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h index f59ad11d849..4d834d41a3b 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Apollonius_graph_nearest_site_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Cached_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Cached_degeneracy_testers.h index 88e9a82ceb7..fd3b8d10d45 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Cached_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Cached_degeneracy_testers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Circulator_adaptors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Circulator_adaptors.h index 5ee44dcac31..fa5e9cc11ae 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Circulator_adaptors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Circulator_adaptors.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Connected_components.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Connected_components.h index 64a1e1dda0c..ca19888e2b2 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Connected_components.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Connected_components.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h index 9ee77ea2728..2b3957e98d9 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h index f0053b0d013..b73075eea4d 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h index 647f7ca85f0..593f7632c69 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h index 564e4e8517f..1aeef798020 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_degeneracy_testers.h index 127a213323c..87ad86bdb4c 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_degeneracy_testers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h index 412822080b5..887302005b0 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Delaunay_triangulation_nearest_site_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Dummy_iterator.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Dummy_iterator.h index b13246cfbb6..a09d5d2faeb 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Dummy_iterator.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Dummy_iterator.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Edge_less.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Edge_less.h index 2613340a7ed..00292a2233e 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Edge_less.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Edge_less.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h index 7ae58d0688d..c307bbae43d 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Finder_classes.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Finder_classes.h index 1dd8c7f2ac4..c0f3923c00d 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Finder_classes.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Finder_classes.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h index 2f28dd025a9..2d06e6c995e 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Handle_adaptor.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Handle_adaptor.h index 7b79a2cd91d..e57f07a8f01 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Handle_adaptor.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Handle_adaptor.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h index 244e300cbbd..bf06534830b 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h index f4167435278..468c23956e8 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Policy_base.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Policy_base.h index 1ddd1737691..746142ef859 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Policy_base.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Policy_base.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_degeneracy_testers.h index a0666497f43..df005764930 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_degeneracy_testers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h index d57185d96aa..a512b530127 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Regular_triangulation_nearest_site_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h index a7dc102cf10..89d6b798007 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h index 9d04b7daab5..05ac879994a 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_nearest_site_2.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h index a4cdd8c259c..26f92013602 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h index a10c9a4e1df..3c41707d13a 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h index b0c02b7f885..a08ba6786f2 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h index 663253d62d5..6d002f45536 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h index 0bece4fe2ee..8d8ff272372 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/basic.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/basic.h index 362451c118e..eff7f6fcf7a 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/basic.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/basic.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/tags.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/tags.h deleted file mode 100644 index ef0335b94d1..00000000000 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/tags.h +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Menelaos Karavelas - -#ifndef CGAL_VORONOI_DIAGRAM_2_TAGS_H -#define CGAL_VORONOI_DIAGRAM_2_TAGS_H 1 - -#include -#include - -namespace CGAL { - -//namespace VoronoiDiagram_2 { namespace Internal { - -//==================================================================== -//==================================================================== - -Tag_true operator&&(const Tag_true&, const Tag_true&) { - return Tag_true(); -} - -Tag_false operator&&(const Tag_false&, const Tag_false&) { - return Tag_false(); -} - -Tag_false operator&&(const Tag_true&, const Tag_false&) { - return Tag_false(); -} - -Tag_false operator&&(const Tag_false&, const Tag_true&) { - return Tag_false(); -} - - -Tag_false operator||(const Tag_false&, const Tag_false&) { - return Tag_false(); -} - -Tag_true operator||(const Tag_true&, const Tag_true&) { - return Tag_true(); -} - -Tag_true operator||(const Tag_true&, const Tag_false&) { - return Tag_true(); -} - -Tag_true operator||(const Tag_false&, const Tag_true&) { - return Tag_true(); -} - -Tag_true operator!(const Tag_false&) { return Tag_true(); } -Tag_false operator!(const Tag_true&) { return Tag_false(); } - - -//==================================================================== -//==================================================================== - -template -struct Boolean_tag { - static const bool value = b; -}; - -//==================================================================== - -template -Boolean_tag operator&&(const Boolean_tag&, - const Boolean_tag&) { - return Boolean_tag(); -} - - -template -Boolean_tag operator||(const Boolean_tag&, - const Boolean_tag&) { - return Boolean_tag(); -} - -template -Boolean_tag operator!(const Boolean_tag&) { - return Boolean_tag(); -} - -//==================================================================== - -template struct To_boolean_tag; - -template<> -struct To_boolean_tag { - typedef Boolean_tag Tag; -}; - -template<> -struct To_boolean_tag { - typedef Boolean_tag Tag; -}; - -template struct To_tag_true_false; - -template<> -struct To_tag_true_false< Boolean_tag > { - typedef Tag_true Tag; -}; - -template<> -struct To_tag_true_false< Boolean_tag > { - typedef Tag_false Tag; -}; - -//==================================================================== - -template -struct Not { - typedef Boolean_tag Tag; -}; - -template -struct And { - typedef Boolean_tag Tag; -}; - -template -struct Or { - typedef Boolean_tag Tag; -}; - -//==================================================================== - -struct Tag_converter -{ - Boolean_tag operator()(const Tag_true&) const { - return Boolean_tag(); - } - - Boolean_tag operator()(const Tag_false&) const { - return Boolean_tag(); - } - - Tag_true operator()(const Boolean_tag&) const { - return Tag_true(); - } - - Tag_false operator()(const Boolean_tag&) const { - return Tag_false(); - } -}; - - -//} } //namespace VoronoiDiagram_2::Internal - -} //namespace CGAL - -#endif // CGAL_VORONOI_DIAGRAM_2_TAGS_H diff --git a/Voronoi_diagram_2/package_info/Voronoi_diagram_2/license.txt b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/license.txt index 27588bc0103..0d3d7e59728 100644 --- a/Voronoi_diagram_2/package_info/Voronoi_diagram_2/license.txt +++ b/Voronoi_diagram_2/package_info/Voronoi_diagram_2/license.txt @@ -1 +1 @@ -QPL +GPL (v3 or later) diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_policy_concept.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_policy_concept.h index 1e91b21c5f5..3e760c786af 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_policy_concept.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_policy_concept.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_traits_concept.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_traits_concept.h index 16d39221101..d1b858f1563 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_traits_concept.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Adaptation_traits_concept.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Delaunay_graph_concept.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Delaunay_graph_concept.h index 5f287173fc2..5924817fcaf 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Delaunay_graph_concept.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/Delaunay_graph_concept.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/helper_functions.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/helper_functions.h index 02fc151f3a5..2666c4e7787 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/helper_functions.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/helper_functions.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_aux.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_aux.h index 9941952d1fc..717e93c04ce 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_aux.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_aux.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h index 7bc20181bc8..c5a4d8e0f8e 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_print_report.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test.h index fd917398f99..4fe271ae573 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h index e70f7a806d1..b115d0a900b 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_concept.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h index a2d31ac4c28..d0b261bc29e 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_locate.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h index 2fce6dcc140..90c268a7fcc 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/include/vda_test_vda.h @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_ag.cpp b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_ag.cpp index a87ae730f81..2a93b2b690f 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_ag.cpp +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_ag.cpp @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_dt.cpp b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_dt.cpp index 7a7884407bb..87a908f9122 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_dt.cpp +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_dt.cpp @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_pt.cpp b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_pt.cpp index a9746b965c6..3c648dbccf7 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_pt.cpp +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_pt.cpp @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp index d877dbffe44..ef440b529cc 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_rt.cpp @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_sdg.cpp b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_sdg.cpp index 78c702db1c3..59d96957584 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_sdg.cpp +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/vda_sdg.cpp @@ -1,9 +1,10 @@ // Copyright (c) 2006 Foundation for Research and Technology-Hellas (Greece). // All rights reserved. // -// This file is part of CGAL (www.cgal.org); you may redistribute it under -// the terms of the Q Public License version 1.0. -// See the file LICENSE.QPL distributed with CGAL. +// 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. diff --git a/iostream/doc_tex/IOstream_ref/Color.tex b/iostream/doc_tex/IOstream_ref/Color.tex index dfcb870b448..d7a7fe5a077 100644 --- a/iostream/doc_tex/IOstream_ref/Color.tex +++ b/iostream/doc_tex/IOstream_ref/Color.tex @@ -8,7 +8,7 @@ \ccDefinition An object of the class \ccRefName\ is a color available for drawing operations in many \cgal\ output streams. -Each color is defined by a triple of integers $(r,g,b)$ with +Each color is defined by a triple of unsigned chars $(r,g,b)$ with $0\le r,g,b \le 255$, the so-called {\em rgb-value} of the color. \ccInclude{CGAL/IO/Color.h} @@ -28,7 +28,7 @@ $0\le r,g,b \le 255$, the so-called {\em rgb-value} of the color. \ccConstructor{Color();} {creates a color with rgb-value $(0,0,0)$, i.e.\ black.} -\ccConstructor{Color(int red, int green, int blue);} +\ccConstructor{Color(unsigned char red, unsigned char green, unsigned char blue);} {creates a color with rgb-value \ccStyle{(red,green,blue)}.} @@ -44,13 +44,13 @@ $0\le r,g,b \le 255$, the so-called {\em rgb-value} of the color. \ccMethod{bool operator!=(const Color &q) const;} {Test for inequality.} -\ccMethod{int red() const;} +\ccMethod{unsigned char red() const;} {returns the red component of \ccVar.} \ccGlue -\ccMethod{int green() const;} +\ccMethod{unsigned char green() const;} {returns the green component of \ccVar.} \ccGlue -\ccMethod{int blue() const;} +\ccMethod{unsigned char blue() const;} {returns the blue component of \ccVar.} \ccConstants diff --git a/iostream/include/CGAL/IO/io.h b/iostream/include/CGAL/IO/io.h index 826a676f809..4d2b777f2ed 100644 --- a/iostream/include/CGAL/IO/io.h +++ b/iostream/include/CGAL/IO/io.h @@ -259,7 +259,7 @@ std::ostream& operator<<( std::ostream& out, const Color& col) inline std::istream &operator>>(std::istream &is, Color& col) { - int r, g, b; + int r = 0, g = 0, b = 0; switch(is.iword(IO::mode)) { case IO::ASCII : is >> r >> g >> b;