From d2425251bfb32663db2a1df44c41c4356beb02fe Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 6 Oct 2017 09:41:36 +0100 Subject: [PATCH 01/10] Fix put(Dynamic_property_map&..) --- Property_map/include/CGAL/Dynamic_property_map.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Property_map/include/CGAL/Dynamic_property_map.h b/Property_map/include/CGAL/Dynamic_property_map.h index fd45e0a3a22..ce2106c60a1 100644 --- a/Property_map/include/CGAL/Dynamic_property_map.h +++ b/Property_map/include/CGAL/Dynamic_property_map.h @@ -49,22 +49,20 @@ struct Dynamic_property_map { } } - - friend reference get(const Dynamic_property_map& m, const key_type& k) + friend value_type get(const Dynamic_property_map& m, const key_type& k) { typename Map::const_iterator it = m.map_->find(k); if(it == m.map_->end()){ + (*(const_cast(m).map_))[k] = m.default_value(); return m.default_value(); } return it->second; } - friend void put(Dynamic_property_map& m, const key_type& k, const value_type& v) + friend void put(const Dynamic_property_map& m, const key_type& k, const value_type& v) { - if(v != m.default_value()){ - (*(m.map_))[k] = v; - } + (*(m.map_))[k] = v; } @@ -191,7 +189,7 @@ add_property(face_property_t prop, const G&) return internal::Dynamic_property_map(prop.t); } -template +template void remove_property( internal::Dynamic_property_map pm, const G&) From ce086fed46cf6c2dd719c57e54ea09180a2955f9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 6 Oct 2017 09:44:16 +0100 Subject: [PATCH 02/10] Add a testsuite --- .../test/Property_map/dynamic_property_map.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Property_map/test/Property_map/dynamic_property_map.cpp diff --git a/Property_map/test/Property_map/dynamic_property_map.cpp b/Property_map/test/Property_map/dynamic_property_map.cpp new file mode 100644 index 00000000000..d70118c5df9 --- /dev/null +++ b/Property_map/test/Property_map/dynamic_property_map.cpp @@ -0,0 +1,13 @@ +#include + +int main() +{ + CGAL::Dynamic_property_map dpm(2); + assert(dpm.default_value() == 2); + + assert(get(dpm, 0) == 2); + put(dpm, 0, 1); + assert(get(dpm, 0) == 1); + + return 0; +} From f74cf7fff6691df75e35da22186c02e993bd0e02 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 6 Oct 2017 17:23:14 +0100 Subject: [PATCH 03/10] value_type -> reference --- Property_map/include/CGAL/Dynamic_property_map.h | 2 +- Property_map/test/Property_map/dynamic_property_map.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Property_map/include/CGAL/Dynamic_property_map.h b/Property_map/include/CGAL/Dynamic_property_map.h index ce2106c60a1..173c0739596 100644 --- a/Property_map/include/CGAL/Dynamic_property_map.h +++ b/Property_map/include/CGAL/Dynamic_property_map.h @@ -49,7 +49,7 @@ struct Dynamic_property_map { } } - friend value_type get(const Dynamic_property_map& m, const key_type& k) + friend reference get(const Dynamic_property_map& m, const key_type& k) { typename Map::const_iterator it = m.map_->find(k); if(it == m.map_->end()){ diff --git a/Property_map/test/Property_map/dynamic_property_map.cpp b/Property_map/test/Property_map/dynamic_property_map.cpp index d70118c5df9..34848c86f8f 100644 --- a/Property_map/test/Property_map/dynamic_property_map.cpp +++ b/Property_map/test/Property_map/dynamic_property_map.cpp @@ -2,7 +2,7 @@ int main() { - CGAL::Dynamic_property_map dpm(2); + CGAL::internal::Dynamic_property_map dpm(2); assert(dpm.default_value() == 2); assert(get(dpm, 0) == 2); From 29e4e987f463c8889ed4efb9c85c8b14f7b07ebd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 9 Oct 2017 07:06:37 +0100 Subject: [PATCH 04/10] Add CMakeLists.txt --- Property_map/test/Property_map/CMakeLists.txt | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Property_map/test/Property_map/CMakeLists.txt diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt new file mode 100644 index 00000000000..2a1f5a3bdf5 --- /dev/null +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -0,0 +1,47 @@ +# Created by the script cgal_create_CMakeLists +# This is the CMake script for compiling a set of CGAL applications. + +project( Property_map ) + + +cmake_minimum_required(VERSION 2.8.11) + +# CGAL and its components +find_package( CGAL QUIET COMPONENTS ) + +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 +find_package( Boost REQUIRED ) + +if ( NOT Boost_FOUND ) + + message(STATUS "This project requires the Boost library, and will not be compiled.") + + return() + +endif() + +# include for local directory + +# include for local package +include_directories( BEFORE ../../include ) + + +# Creating entries for all C++ files with "main" routine +# ########################################################## + +include( CGAL_CreateSingleSourceCGALProgram ) + +create_single_source_cgal_program( "dynamic_property_map.cpp" ) + + From b32611175e2b28f11bf0a5cc5e067ddf9e9a22c4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Oct 2017 07:33:27 +0100 Subject: [PATCH 05/10] Add _Tests in the project name in the CMakeLists.txt --- Property_map/test/Property_map/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index 2a1f5a3bdf5..63e62cc1353 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -1,7 +1,7 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -project( Property_map ) +project( Property_map_Tests ) cmake_minimum_required(VERSION 2.8.11) From 51d620c3a4dd64571deb3bda0c729d943b8e6008 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 6 Nov 2017 11:54:28 +0100 Subject: [PATCH 06/10] run generate_travis and update the list of packages --- .travis.yml | 24 ++++++++++++------------ .travis/packages.txt | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index b210c218ae2..6b894338699 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,19 +31,19 @@ env: - PACKAGE='Point_set_shape_detection_3 Poisson_surface_reconstruction_3 Polygon ' - PACKAGE='Polygon_mesh_processing Polyhedron Polyhedron_IO ' - PACKAGE='Polyline_simplification_2 Polynomial Polytope_distance_d ' - - PACKAGE='Principal_component_analysis Profiling_tools QP_solver ' - - PACKAGE='Random_numbers Ridges_3 Scale_space_reconstruction_3 ' - - PACKAGE='Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 Set_movable_separability_2 ' - - PACKAGE='Skin_surface_3 Snap_rounding_2 Solver_interface ' - - PACKAGE='Spatial_searching Spatial_sorting STL_Extension ' - - PACKAGE='Straight_skeleton_2 Stream_lines_2 Stream_support ' - - PACKAGE='Subdivision_method_3 Surface_mesh Surface_mesh_deformation ' - - PACKAGE='Surface_mesher Surface_mesh_parameterization Surface_mesh_segmentation ' + - PACKAGE='Principal_component_analysis Profiling_tools Property_map ' + - PACKAGE='QP_solver Random_numbers Ridges_3 ' + - PACKAGE='Scale_space_reconstruction_3 Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 ' + - PACKAGE='Set_movable_separability_2 Skin_surface_3 Snap_rounding_2 ' + - PACKAGE='Solver_interface Spatial_searching Spatial_sorting ' + - PACKAGE='STL_Extension Straight_skeleton_2 Stream_lines_2 ' + - PACKAGE='Stream_support Subdivision_method_3 Surface_mesh ' + - PACKAGE='Surface_mesh_deformation Surface_mesh_parameterization Surface_mesh_segmentation ' - PACKAGE='Surface_mesh_shortest_path Surface_mesh_simplification Surface_mesh_skeletonization ' - - PACKAGE='Sweep_line_2 TDS_2 TDS_3 ' - - PACKAGE='Three Triangulation Triangulation_2 ' - - PACKAGE='Triangulation_3 Union_find Visibility_2 ' - - PACKAGE='Voronoi_diagram_2 ' + - PACKAGE='Surface_mesher Sweep_line_2 TDS_2 ' + - PACKAGE='TDS_3 Three Triangulation ' + - PACKAGE='Triangulation_2 Triangulation_3 Union_find ' + - PACKAGE='Visibility_2 Voronoi_diagram_2 ' - PACKAGE='Polyhedron_demo' compiler: - clang-3.6 diff --git a/.travis/packages.txt b/.travis/packages.txt index b0df6bcb445..bef5b367a98 100644 --- a/.travis/packages.txt +++ b/.travis/packages.txt @@ -81,6 +81,7 @@ Polynomial Polytope_distance_d Principal_component_analysis Profiling_tools +Property_map QP_solver Random_numbers Ridges_3 @@ -100,12 +101,12 @@ Stream_support Subdivision_method_3 Surface_mesh Surface_mesh_deformation -Surface_mesher Surface_mesh_parameterization Surface_mesh_segmentation Surface_mesh_shortest_path Surface_mesh_simplification Surface_mesh_skeletonization +Surface_mesher Sweep_line_2 TDS_2 TDS_3 From 092f81cc0afa6ee30a89f098f6f28455ed7ed937 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 6 Nov 2017 12:39:12 +0100 Subject: [PATCH 07/10] use `package_info` to detect packages instead of `test`, `examples`, or `demo` --- .travis/generate_travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/generate_travis.sh b/.travis/generate_travis.sh index e76b62547d7..50e4e9865b0 100755 --- a/.travis/generate_travis.sh +++ b/.travis/generate_travis.sh @@ -19,7 +19,7 @@ INDEX=0 i=0 for f in * do - if [ -d "$f/examples/$f" ] || [ -d "$f/test/$f" ] || [ -d "$f/demo/$f" ] + if [ -d "$f/package_info/$f" ] then PACKAGES[$INDEX]+="$f " i=$[i+1] From 7a605fd847a38ebc7bd2b3e68cc44dfdb1c8b08b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 6 Nov 2017 12:40:42 +0100 Subject: [PATCH 08/10] give some extra when travis fails because generate_travis should be run --- .travis/build_package.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis/build_package.sh b/.travis/build_package.sh index 4bbd9846925..7d924a55f80 100755 --- a/.travis/build_package.sh +++ b/.travis/build_package.sh @@ -87,6 +87,7 @@ do then echo "The matrix and the actual package list differ : ." echo ${DIFFERENCE[*]} + echo "You should run generate_travis.sh." exit 1 fi echo "Matrix is up to date." From e7659590cb4e7ee77520bc0ed5f2f0440b5a2cb3 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 6 Nov 2017 12:48:27 +0100 Subject: [PATCH 09/10] run generate_travis and update the list of packages --- .travis.yml | 67 ++++++++++++++++++++++++-------------------- .travis/packages.txt | 15 ++++++++++ 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b894338699..7b3d75ae95a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,41 +9,46 @@ env: - PACKAGE='Alpha_shapes_2 Alpha_shapes_3 Apollonius_graph_2 ' - PACKAGE='Arithmetic_kernel Arrangement_on_surface_2 Barycentric_coordinates_2 ' - PACKAGE='BGL Boolean_set_operations_2 Bounding_volumes ' - - PACKAGE='Box_intersection_d CGAL_ImageIO CGAL_ipelets ' - - PACKAGE='Circular_kernel_2 Circular_kernel_3 Circulator ' - - PACKAGE='Classification Combinatorial_map Cone_spanners_2 ' - - PACKAGE='Convex_decomposition_3 Convex_hull_2 Convex_hull_3 ' - - PACKAGE='Convex_hull_d Distance_2 Distance_3 ' - - PACKAGE='Envelope_2 Envelope_3 Filtered_kernel ' - - PACKAGE='Generalized_map Generator Geomview ' - - PACKAGE='GraphicsView HalfedgeDS Hash_map ' + - PACKAGE='Box_intersection_d Cartesian_kernel CGAL_Core ' + - PACKAGE='CGAL_ImageIO CGAL_ipelets Circular_kernel_2 ' + - PACKAGE='Circular_kernel_3 Circulator Classification ' + - PACKAGE='Combinatorial_map Cone_spanners_2 Convex_decomposition_3 ' + - PACKAGE='Convex_hull_2 Convex_hull_3 Convex_hull_d ' + - PACKAGE='Distance_2 Distance_3 Envelope_2 ' + - PACKAGE='Envelope_3 Filtered_kernel Generalized_map ' + - PACKAGE='Generator Geomview GraphicsView ' + - PACKAGE='HalfedgeDS Hash_map Homogeneous_kernel ' - PACKAGE='Inscribed_areas Installation Interpolation ' - PACKAGE='Intersections_2 Intersections_3 Interval_skip_list ' - PACKAGE='Interval_support Inventor Jet_fitting_3 ' - PACKAGE='Kernel_23 Kernel_d Kinetic_data_structures ' - - PACKAGE='Kinetic_framework Linear_cell_complex Matrix_search ' - - PACKAGE='Mesh_2 Mesh_3 Minkowski_sum_2 ' - - PACKAGE='Minkowski_sum_3 Modifier Modular_arithmetic ' - - PACKAGE='Nef_2 Nef_3 Nef_S2 ' - - PACKAGE='NewKernel_d Number_types Optimal_transportation_reconstruction_2 ' - - PACKAGE='Partition_2 Periodic_2_triangulation_2 Periodic_3_triangulation_3 ' - - PACKAGE='Point_set_2 Point_set_3 Point_set_processing_3 ' - - PACKAGE='Point_set_shape_detection_3 Poisson_surface_reconstruction_3 Polygon ' - - PACKAGE='Polygon_mesh_processing Polyhedron Polyhedron_IO ' - - PACKAGE='Polyline_simplification_2 Polynomial Polytope_distance_d ' - - PACKAGE='Principal_component_analysis Profiling_tools Property_map ' - - PACKAGE='QP_solver Random_numbers Ridges_3 ' - - PACKAGE='Scale_space_reconstruction_3 Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 ' - - PACKAGE='Set_movable_separability_2 Skin_surface_3 Snap_rounding_2 ' - - PACKAGE='Solver_interface Spatial_searching Spatial_sorting ' - - PACKAGE='STL_Extension Straight_skeleton_2 Stream_lines_2 ' - - PACKAGE='Stream_support Subdivision_method_3 Surface_mesh ' - - PACKAGE='Surface_mesh_deformation Surface_mesh_parameterization Surface_mesh_segmentation ' - - PACKAGE='Surface_mesh_shortest_path Surface_mesh_simplification Surface_mesh_skeletonization ' - - PACKAGE='Surface_mesher Sweep_line_2 TDS_2 ' - - PACKAGE='TDS_3 Three Triangulation ' - - PACKAGE='Triangulation_2 Triangulation_3 Union_find ' - - PACKAGE='Visibility_2 Voronoi_diagram_2 ' + - PACKAGE='Kinetic_framework LEDA Linear_cell_complex ' + - PACKAGE='MacOSX Maintenance Matrix_search ' + - PACKAGE='Mesh_2 Mesh_3 Mesher_level ' + - PACKAGE='Minkowski_sum_2 Minkowski_sum_3 Modifier ' + - PACKAGE='Modular_arithmetic Nef_2 Nef_3 ' + - PACKAGE='Nef_S2 NewKernel_d Number_types ' + - PACKAGE='OpenNL Operations_on_polyhedra Optimal_transportation_reconstruction_2 ' + - PACKAGE='Optimisation_basic Partition_2 Periodic_2_triangulation_2 ' + - PACKAGE='Periodic_3_triangulation_3 Point_set_2 Point_set_3 ' + - PACKAGE='Point_set_processing_3 Point_set_shape_detection_3 Poisson_surface_reconstruction_3 ' + - PACKAGE='Polygon Polygon_mesh_processing Polyhedron ' + - PACKAGE='Polyhedron_IO Polyline_simplification_2 Polynomial ' + - PACKAGE='Polytope_distance_d Principal_component_analysis Principal_component_analysis_LGPL ' + - PACKAGE='Profiling_tools Property_map QP_solver ' + - PACKAGE='Random_numbers Ridges_3 Scale_space_reconstruction_3 ' + - PACKAGE='Scripts SearchStructures Segment_Delaunay_graph_2 ' + - PACKAGE='Segment_Delaunay_graph_Linf_2 Set_movable_separability_2 Skin_surface_3 ' + - PACKAGE='Snap_rounding_2 Solver_interface Spatial_searching ' + - PACKAGE='Spatial_sorting STL_Extension Straight_skeleton_2 ' + - PACKAGE='Stream_lines_2 Stream_support Subdivision_method_3 ' + - PACKAGE='Surface_mesh Surface_mesh_deformation Surface_mesh_parameterization ' + - PACKAGE='Surface_mesh_segmentation Surface_mesh_shortest_path Surface_mesh_simplification ' + - PACKAGE='Surface_mesh_skeletonization Surface_mesher Sweep_line_2 ' + - PACKAGE='TDS_2 TDS_3 Testsuite ' + - PACKAGE='Three Triangulation Triangulation_2 ' + - PACKAGE='Triangulation_3 Union_find Visibility_2 ' + - PACKAGE='Voronoi_diagram_2 wininst ' - PACKAGE='Polyhedron_demo' compiler: - clang-3.6 diff --git a/.travis/packages.txt b/.travis/packages.txt index bef5b367a98..938e6693a65 100644 --- a/.travis/packages.txt +++ b/.travis/packages.txt @@ -14,6 +14,8 @@ BGL Boolean_set_operations_2 Bounding_volumes Box_intersection_d +Cartesian_kernel +CGAL_Core CGAL_ImageIO CGAL_ipelets Circular_kernel_2 @@ -37,6 +39,7 @@ Geomview GraphicsView HalfedgeDS Hash_map +Homogeneous_kernel Inscribed_areas Installation Interpolation @@ -50,10 +53,14 @@ Kernel_23 Kernel_d Kinetic_data_structures Kinetic_framework +LEDA Linear_cell_complex +MacOSX +Maintenance Matrix_search Mesh_2 Mesh_3 +Mesher_level Minkowski_sum_2 Minkowski_sum_3 Modifier @@ -63,7 +70,10 @@ Nef_3 Nef_S2 NewKernel_d Number_types +OpenNL +Operations_on_polyhedra Optimal_transportation_reconstruction_2 +Optimisation_basic Partition_2 Periodic_2_triangulation_2 Periodic_3_triangulation_3 @@ -80,12 +90,15 @@ Polyline_simplification_2 Polynomial Polytope_distance_d Principal_component_analysis +Principal_component_analysis_LGPL Profiling_tools Property_map QP_solver Random_numbers Ridges_3 Scale_space_reconstruction_3 +Scripts +SearchStructures Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 Set_movable_separability_2 @@ -110,6 +123,7 @@ Surface_mesher Sweep_line_2 TDS_2 TDS_3 +Testsuite Three Triangulation Triangulation_2 @@ -117,3 +131,4 @@ Triangulation_3 Union_find Visibility_2 Voronoi_diagram_2 +wininst From ea57dc7cbe2ad0dd0454f5a4063510c05507b191 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 8 Nov 2017 10:46:19 +0100 Subject: [PATCH 10/10] add missing change in CHECK test --- .travis/build_package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/build_package.sh b/.travis/build_package.sh index 7d924a55f80..680264ce10d 100755 --- a/.travis/build_package.sh +++ b/.travis/build_package.sh @@ -75,7 +75,7 @@ do cd .. for f in * do - if [ -d "$f/examples/$f" ] || [ -d "$f/test/$f" ] || [ -d "$f/demo/$f" ] + if [ -d "$f/package_info/$f" ] then PACKAGES+="$f " fi