diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h index 3901d979fd1..16b77b01a35 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/generators.h @@ -305,7 +305,7 @@ void filter_by_distance( template void save_scene(const std::string &fn, const std::vector > &pts) { - std::ofstream plyFile(fn); + std::ofstream plyFile(fn.c_str()); plyFile << "ply" << std::endl; plyFile << "format ascii 1.0" << std::endl; diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cone_connected_component.cpp b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cone_connected_component.cpp index a1c2e2f59f8..3ae0b40b567 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cone_connected_component.cpp +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cone_connected_component.cpp @@ -47,12 +47,12 @@ bool test_cone_connected_component() { CGAL::Vector_3 n = random_normal(); n = CGAL::cross_product(axis, n); n = n * (FT) 1.0 / (CGAL::sqrt(n.squared_length())); - K::FT a = n * axis; + FT a = n * axis; CGAL::Plane_3 pl(apex, n); FT spacing = angle; - filter_by_distance(pl, spacing * (K::FT) 0.5, points); + filter_by_distance(pl, spacing * FT(0.5), points); Efficient_ransac ransac; @@ -73,9 +73,9 @@ bool test_cone_connected_component() { // a single shape and a lower cluster_epsilon for the second half // to get two separated shapes. if (i < NB_ROUNDS/2) - parameters.cluster_epsilon = spacing * (K::FT) 1.5; + parameters.cluster_epsilon = spacing * FT(1.5); else - parameters.cluster_epsilon = spacing * (K::FT) 0.8; + parameters.cluster_epsilon = spacing * FT(0.8); if (!ransac.detect(parameters)) { std::cout << " aborted" << std::endl; diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinder_connected_component.cpp b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinder_connected_component.cpp index 7455b172ce0..b6dc0b6e76c 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinder_connected_component.cpp +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinder_connected_component.cpp @@ -34,7 +34,7 @@ bool test_cylinder_connected_component() { // generate random points on random cylinder CGAL::Bbox_3 bbox(-10, -10, -10, 10, 10, 10); - typename FT radius = (FT) 1.0; + FT radius = FT(1.0); Vector axis = random_normal(); Point center = random_point_in(bbox); @@ -50,13 +50,13 @@ bool test_cylinder_connected_component() { save_scene("cylinder_pre.ply", points); - filter_by_distance(pl, spacing * (K::FT) 0.5, points); + filter_by_distance(pl, spacing * FT(0.5), points); save_scene("cylinder_post.ply", points); Efficient_ransac ransac; - ransac.add_shape_factory(); + ransac.template add_shape_factory(); ransac.set_input(points); diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_scene.cpp b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_scene.cpp index dab099c5f45..5637d27f33c 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_scene.cpp +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_scene.cpp @@ -75,11 +75,11 @@ bool test_scene() { typename Efficient_ransac::Shape_range shapes = ransac.shapes(); - Efficient_ransac::Shape_range::iterator it = shapes.begin(); + typename Efficient_ransac::Shape_range::iterator it = shapes.begin(); // Iterate through all shapes and access each point. while (it != shapes.end()) { - boost::shared_ptr shape = *it; + boost::shared_ptr shape = *it; // Sums distances of points to detected shapes. FT sum_distances = 0; diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_sphere_connected_component.cpp b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_sphere_connected_component.cpp index 2ad165f305d..83db1e43d4c 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_sphere_connected_component.cpp +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_sphere_connected_component.cpp @@ -13,10 +13,9 @@ bool test_sphere_connected_component() { const int NB_ROUNDS = 10; const int NB_POINTS = 2000; - typedef K::FT FT; + typedef typename K::FT FT; typedef CGAL::Point_with_normal_3 Pwn; typedef CGAL::Point_3 Point; - typedef CGAL::Vector_3 Vector; typedef std::vector Pwn_vector; typedef CGAL::Identity_property_map Point_map; typedef CGAL::Normal_of_point_with_normal_pmap Normal_map; @@ -33,7 +32,7 @@ bool test_sphere_connected_component() { Pwn_vector points; // generate random points on random sphere - typename FT radius = 1.0; + FT radius = 1.0; Point center; CGAL::Bbox_3 bbox(-10, -10, -10, 10, 10, 10); @@ -43,9 +42,9 @@ bool test_sphere_connected_component() { CGAL::Vector_3 n = random_normal(); CGAL::Plane_3 pl(center, n); - FT spacing = radius / K::FT(4); + FT spacing = radius / FT(4); - filter_by_distance(pl, spacing * (K::FT) 0.5, points); + filter_by_distance(pl, spacing * FT(0.5), points); Efficient_ransac ransac; @@ -65,9 +64,9 @@ bool test_sphere_connected_component() { // a single shape and a lower cluster_epsilon for the second half // to get two separated shapes. if (i < NB_ROUNDS/2) - parameters.cluster_epsilon = spacing * (K::FT) 1.5; + parameters.cluster_epsilon = spacing * FT(1.5); else - parameters.cluster_epsilon = spacing * (K::FT) 0.9; + parameters.cluster_epsilon = spacing * FT(0.9); if (!ransac.detect(parameters)) { std::cout << " aborted" << std::endl; diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_torus_connected_component.cpp b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_torus_connected_component.cpp index ff7f387590e..2fba77f3007 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_torus_connected_component.cpp +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_torus_connected_component.cpp @@ -49,10 +49,11 @@ bool test_torus_connected_component() { FT spacing = (FT) 1; - filter_by_distance(pl, spacing * (K::FT) 0.5, points); + filter_by_distance(pl, spacing * FT(0.5), points); Efficient_ransac ransac; + ransac.template add_shape_factory(); ransac.set_input(points);