From bb5b745d98d06a87f8419809cd23a1cddfb28c2c Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Fri, 10 Jul 2015 09:08:07 +0200 Subject: [PATCH] The torus is working fine, now --- .../Efficient_RANSAC_fake_traits_for_testing.h | 17 +++++++++-------- .../Shape_detection_3/Efficient_RANSAC_traits.h | 8 ++++++-- .../include/CGAL/Shape_detection_3/Torus.h | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_fake_traits_for_testing.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_fake_traits_for_testing.h index 25e2647ef13..f8615197b75 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_fake_traits_for_testing.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_fake_traits_for_testing.h @@ -131,17 +131,16 @@ namespace CGAL { } }; - struct Construct_point_3 + /*struct Construct_point_3 { Point_3 operator()() { return Point_3(); } }; Construct_point_3 construct_point_3_object() const - { return Construct_point_3(); } + { return Construct_point_3(); }*/ struct Construct_point_2 { - Point_2 operator()() { return Point_2(); } Point_2 operator()(FT a, FT b) { return Point_2(); } }; Construct_point_2 construct_point_2_object() const @@ -292,11 +291,13 @@ namespace CGAL { Construct_center_2 construct_center_2_object() const { return Construct_center_2(); } - /*struct Collinear_2 - { result_type operator()(const Point_2& p, const Point_2& q, const Point_2& r) const - { return false; } }; - Collinear_2 construct_collinear_2_object() const - { return Collinear_2(); }*/ + struct Collinear_2 + { + bool operator()(const Point_2& p, const Point_2& q, const Point_2& r) const + { return false; } + }; + Collinear_2 collinear_2_object() const + { return Collinear_2(); } /*struct Compute_squared_distance_3 { FT operator()(Point_3 const&, Point_3 const&) const { return 0; } }; diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h index 0dee9c9a8c8..2c7e6b064e2 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Efficient_RANSAC_traits.h @@ -76,9 +76,9 @@ namespace CGAL { Efficient_RANSAC_traits(const Gt& gt = Gt()) : m_gt(gt) {} - typedef typename Gt::Construct_point_3 Construct_point_3; + /*typedef typename Gt::Construct_point_3 Construct_point_3; Construct_point_3 construct_point_3_object() const - { return m_gt.construct_point_3_object(); } + { return m_gt.construct_point_3_object(); }*/ typedef typename Gt::Construct_vector_3 Construct_vector_3; Construct_vector_3 construct_vector_3_object() const @@ -171,6 +171,10 @@ namespace CGAL { typedef typename Gt::Compute_squared_radius_2 Compute_squared_radius_2; Compute_squared_radius_2 compute_squared_radius_2_object() const { return m_gt.compute_squared_radius_2_object(); } + + typedef typename Gt::Collinear_2 Collinear_2; + Collinear_2 collinear_2_object() const + { return m_gt.collinear_2_object(); } private: Gt m_gt; diff --git a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Torus.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Torus.h index 67ed02ff653..af03c92f5d0 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Torus.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Torus.h @@ -155,7 +155,7 @@ namespace CGAL { FT sqlen_2(const Vector_2& v) const { return m_traits.compute_squared_length_2_object()(v); } bool collinear_2(const Point_2& p, const Point_2& q, const Point_2& r) const - { return m_traits.construct_collinear_2_object()(p, q, r); } + { return m_traits.collinear_2_object()(p, q, r); } void create_shape(const std::vector &indices) { std::vector p;