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 1c5c55ef4e3..1501e50a96d 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 @@ -41,32 +41,24 @@ namespace CGAL { * function called "void _create_point_list(Point_list &)" which * actually creates the list of landmarks. */ -template > -class Arr_landmarks_generator_base - : public Arr_observer -{ +template > +class Arr_landmarks_generator_base : public Arr_observer { public: + typedef Arrangement_ Arrangement_2; + typedef Nearest_neighbor_ Nearest_neighbor; - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; - typedef Nearest_neighbor_ Nearest_neighbor; - - typedef Arr_landmarks_generator_base Self; - + typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_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::Vertex_const_iterator - Vertex_const_iterator; + typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; + Ccb_halfedge_circulator; typedef typename Arrangement_2::Point_2 Point_2; typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; @@ -75,16 +67,19 @@ public: typedef std::list NN_Points_set; typedef std::vector Points_set; - typedef std::pair PL_pair; + typedef std::pair PL_pair; typedef std::vector Pairs_set; typedef typename std::vector::iterator Pairs_iterator; -protected: +private: + typedef Arr_landmarks_generator_base + Self; +protected: typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; // Data members: - const Traits_adaptor_2 *m_traits; // The associated traits object. + const Traits_adaptor_2* m_traits; // The associated traits object. Nearest_neighbor nn; // The associated nearest neighbor object. bool ignore_notifications; bool updated; @@ -92,8 +87,8 @@ protected: public: bool is_empty() const { return nn.is_empty(); } -private: +private: /*! Copy constructor - not supported. */ Arr_landmarks_generator_base (const Self& ); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_grid_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_grid_generator.h index d161b559536..e0ff9d2b864 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_grid_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_grid_generator.h @@ -31,22 +31,15 @@ namespace CGAL { * A generator for the landmarks point-locatoion class, which uses a * set of points on a grid as its set of landmarks. */ -template > +template > class Arr_grid_landmarks_generator : public Arr_landmarks_generator_base { public: - - typedef Arrangement_ Arrangement_2; - typedef Nearest_neighbor_ Nearest_neighbor; - - typedef Arr_landmarks_generator_base Base; - typedef Arr_grid_landmarks_generator Self; + typedef Arrangement_ Arrangement_2; + typedef Nearest_neighbor_ Nearest_neighbor; typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; @@ -57,19 +50,25 @@ public: typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; typedef typename Arrangement_2::Face_handle Face_handle; typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; + Ccb_halfedge_circulator; - typedef typename Geometry_traits_2::Approximate_number_type ANT; + typedef typename Geometry_traits_2::Approximate_number_type + ANT; - typedef typename Arrangement_2::Point_2 Point_2; + typedef typename Arrangement_2::Point_2 Point_2; +private: + typedef Arr_landmarks_generator_base + Base; + typedef Arr_grid_landmarks_generator + Self; + protected: + typedef typename Base::Points_set Points_set; + typedef std::pair PL_pair; + typedef std::vector Pairs_set; - typedef typename Base::Points_set Points_set; - typedef std::pair PL_pair; - typedef std::vector Pairs_set; - - typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; + typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; // Data members: const Traits_adaptor_2 *m_traits; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_halton_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_halton_generator.h index 055f33d27ca..56ce1b2b636 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_halton_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_halton_generator.h @@ -31,45 +31,39 @@ namespace CGAL { * A generator for the landmarks point-locatoion class, which uses a * sequence of Halton points as its set of landmarks. */ -template > +template > class Arr_halton_landmarks_generator : public Arr_landmarks_generator_base { public: typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; typedef Nearest_neighbor_ Nearest_neighbor; - typedef Arr_landmarks_generator_base Base; - typedef Arr_halton_landmarks_generator Self; - +private: + typedef Arr_landmarks_generator_base + Base; + typedef Arr_halton_landmarks_generator + Self; +public: + typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; typedef typename Arrangement_2::Point_2 Point_2; typedef typename Base::Points_set Points_set; - - typedef typename Arrangement_2::Vertex_const_iterator - Vertex_const_iterator; + typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; protected: - - // Data members: + // Data members: unsigned int num_landmarks; private: - /*! Copy constructor - not supported. */ - Arr_halton_landmarks_generator (const Self& ); + Arr_halton_landmarks_generator(const Self&); /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); - + Self& operator=(const Self&); public: - /*! Constructor. */ Arr_halton_landmarks_generator (const Arrangement_2& arr, unsigned int n_landmarks = 0) : diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h index c98a2b02d39..9b2bedd87fa 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_middle_edges_generator.h @@ -36,18 +36,23 @@ namespace CGAL { * arrangement edges, which must be segments ! * IMPORTANT: THIS ALGORITHM WORKS ONLY FOR SEGMENTS !!! */ -template > -class Arr_middle_edges_landmarks_generator - : public Arr_landmarks_generator_base +template > +class Arr_middle_edges_landmarks_generator : + public Arr_landmarks_generator_base { public: - typedef Arrangement_ Arrangement_2; - typedef Arr_middle_edges_landmarks_generator Self; - typedef Arr_landmarks_generator_base Base; + typedef Arrangement_ Arrangement_2; + typedef Nearest_neighbor_ Nearest_neighbor; +private: + typedef Arr_middle_edges_landmarks_generator + Self; + typedef Arr_landmarks_generator_base + Base; + +public: typedef typename Arrangement_2::Traits_2 Traits_2; typedef typename Arrangement_2::Edge_const_iterator Edge_const_iterator; typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; @@ -58,33 +63,31 @@ public: typedef typename Arrangement_2::Face_handle Face_handle; typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; typedef typename Arrangement_2::Ccb_halfedge_circulator - Ccb_halfedge_circulator; - typedef typename Base::NN_Points_set NN_Points_set; - typedef typename Base::NN_Point_2 NN_Point_2; + Ccb_halfedge_circulator; + typedef typename Base::NN_Points_set NN_Points_set; + typedef typename Base::NN_Point_2 NN_Point_2; - typedef typename Traits_2::Point_2 Point_2; - typedef std::vector Points_set; + typedef typename Traits_2::Point_2 Point_2; + typedef std::vector Points_set; private: - /*! Copy constructor - not supported. */ - Arr_middle_edges_landmarks_generator (const Self& ); + Arr_middle_edges_landmarks_generator(const Self&); /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); - + Self& operator=(const Self&); public: /*! Constructor. */ - Arr_middle_edges_landmarks_generator - (const Arrangement_2& arr, int /* lm_num */ = -1) : + Arr_middle_edges_landmarks_generator(const Arrangement_2& arr, + int /* lm_num */ = -1) : Base (arr) { //CGAL_PRINT_DEBUG("Arr_middle_edges_landmarks_generator constructor."); this->build_landmark_set(); } - //Observer functions that should be empty, because they + // Observer functions that should be empty, because they // got nothing to do with middle edges //------------------------------------------------- virtual void after_create_vertex (Vertex_handle /* v */){} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h index 6fab7c972b7..54cce77f508 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h @@ -34,39 +34,31 @@ namespace CGAL { * It recieves a set of points, and builds a kd-tree for them. * Given a query point, it finds the closest point to the query. */ -template -class Arr_landmarks_nearest_neighbor -{ +template +class Arr_landmarks_nearest_neighbor { public: + typedef Arrangement_ Arrangement_2; - typedef GeomTraits_ Geometry_traits_2; - - typedef typename Geometry_traits_2::Approximate_number_type ANT; - typedef typename Geometry_traits_2::Point_2 Point_2; - typedef Arr_landmarks_nearest_neighbor Self; + typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; + typedef typename Geometry_traits_2::Approximate_number_type ANT; + typedef typename Geometry_traits_2::Point_2 Point_2; /*! \class NN_Point_2 * Stores a point along with its approximate coordinates and its location * in the arrangement. */ - class NN_Point_2 - { + class NN_Point_2 { public: - Point_2 m_point; // The point. Object m_object; // The arrangement feature containing the point. ANT m_vec[2]; // Approximate x and y-coordinates of the point. public: - /*! Default constructor. */ - NN_Point_2() - { - m_vec[0] = m_vec[1] = 0; - } + NN_Point_2() { m_vec[0] = m_vec[1] = 0; } /*! Constructor from a point. */ - NN_Point_2 (const Point_2 &p) : + NN_Point_2(const Point_2& p) : m_point (p) { // Obtain the coordinate approximations, @@ -76,7 +68,7 @@ public: } /*! Constructor from a point and an its location in the arrangement. */ - NN_Point_2 (const Point_2& p, const Object& obj) : + NN_Point_2(const Point_2& p, const Object& obj) : m_point (p), m_object (obj) { @@ -87,10 +79,7 @@ public: } /* Get the point. */ - const Point_2& point() const - { - return (m_point); - } + const Point_2& point() const { return (m_point); } /* Get the object representing the location in the arrangement. */ const Object& object() const @@ -99,30 +88,17 @@ public: } /*! Get an iterator for the approximate coordinates. */ - const ANT* begin () const - { - return (m_vec); - } + const ANT* begin () const { return (m_vec); } /*! Get a past-the-end iterator for the approximate coordinates. */ - const ANT* end () const - { - return (m_vec + 2); - } + const ANT* end () const { return (m_vec + 2); } /*! Equality operators. */ bool operator== (const NN_Point_2& nnp) const - { - return (m_vec[0] == nnp.m_vec[0] && - m_vec[1] == nnp.m_vec[1]); - } + { return (m_vec[0] == nnp.m_vec[0] && m_vec[1] == nnp.m_vec[1]); } bool operator!= (const NN_Point_2& nnp) const - { - return (m_vec[0] != nnp.m_vec[0] || - m_vec[1] != nnp.m_vec[1]); - } - + { return (m_vec[0] != nnp.m_vec[0] || m_vec[1] != nnp.m_vec[1]); } }; /*! \struct Construct_coord_iterator @@ -134,20 +110,15 @@ public: typedef const ANT* result_type; /*! Get an iterator for the approximate coordinates. */ - const ANT* operator() (const NN_Point_2& nnp) const - { - return (nnp.begin()); - } + const ANT* operator()(const NN_Point_2& nnp) const + { return (nnp.begin()); } /*! Get a past-the-end iterator for the approximate coordinates. */ - const ANT* operator() (const NN_Point_2& nnp, int) const - { - return (nnp.end()); - } + const ANT* operator()(const NN_Point_2& nnp, int) const + { return (nnp.end()); } }; protected: - typedef CGAL::Search_traits Search_traits; typedef CGAL::Orthogonal_k_neighbor_search Neighbor_search; @@ -155,19 +126,20 @@ protected: typedef typename Neighbor_search::Tree Tree; // Data members: - Tree *m_tree; // The search tree. - bool m_is_empty; // Is the search tree empty. + Tree* m_tree; // The search tree. + bool m_is_empty; // Is the search tree empty. public: - bool is_empty() const{ return m_is_empty; } + bool is_empty() const { return m_is_empty; } private: + typedef Arr_landmarks_nearest_neighbor Self; /*! Copy constructor - not supported. */ - Arr_landmarks_nearest_neighbor (const Self& ); + Arr_landmarks_nearest_neighbor(const Self& ); /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); + Self& operator=(const Self& ); public: 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 8487a5bd71a..33a29990da7 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 @@ -33,48 +33,43 @@ namespace CGAL { * random set of points as its set of landmarks. */ -template > +template > class Arr_random_landmarks_generator : public Arr_landmarks_generator_base { public: typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; typedef Nearest_neighbor_ Nearest_neighbor; - typedef Arr_landmarks_generator_base Base; - typedef Arr_random_landmarks_generator Self; +private: + typedef Arr_landmarks_generator_base + Base; + typedef Arr_random_landmarks_generator + Self; +public: + typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; typedef typename Arrangement_2::Point_2 Point_2; typedef typename Base::Points_set Points_set; - - typedef typename Arrangement_2::Vertex_const_iterator - Vertex_const_iterator; + typedef typename Arrangement_2::Vertex_const_iterator Vertex_const_iterator; protected: - // Data members: unsigned int num_landmarks; private: - /*! Copy constructor - not supported. */ - Arr_random_landmarks_generator (const Self& ); + Arr_random_landmarks_generator(const Self&); /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); - - -public: + Self& operator=(const Self&); +public: /*! Constructor. */ - Arr_random_landmarks_generator (const Arrangement_2& arr, - unsigned int n_landmarks = 0) : + Arr_random_landmarks_generator(const Arrangement_2& arr, + unsigned int n_landmarks = 0) : Base (arr), num_landmarks (n_landmarks) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_specified_points_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_specified_points_generator.h index 237c2fe7f3a..931708a051a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_specified_points_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_specified_points_generator.h @@ -30,24 +30,24 @@ namespace CGAL { * A generator for the landmarks point-locatoion class, which uses * specified set of points as its set of landmarks. */ -template > +template > class Arr_landmarks_specified_points_generator : public Arr_landmarks_generator_base { public: - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; typedef Nearest_neighbor_ Nearest_neighbor; - typedef Arr_landmarks_generator_base Base; - typedef Arr_landmarks_vertices_generator Self; +private: + typedef Arr_landmarks_generator_base + Base; + typedef Arr_landmarks_vertices_generator + Self; +public: + typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_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; @@ -63,32 +63,29 @@ public: typedef typename Nearest_neighbor::NN_Point_2 NN_Point_2; typedef std::list NN_Point_list; - + protected: - typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; typedef std::pair PL_pair; typedef std::vector Pairs_set; // Data members: - const Traits_adaptor_2 *m_traits; // Its associated traits object. + const Traits_adaptor_2* m_traits; // Its associated traits object. Points_set m_points; // container of the specified points Pairs_set lm_pairs; int num_landmarks; private: - /*! Copy constructor - not supported. */ - Arr_landmarks_specified_points_generator (const Self& ); + Arr_landmarks_specified_points_generator(const Self&); /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); + Self& operator=(const Self&); public: - /*! Constructor. */ - Arr_landmarks_specified_points_generator (const Arrangement_2& arr, - const Points_set points) : + Arr_landmarks_specified_points_generator(const Arrangement_2& arr, + const Points_set points) : Base (arr), num_landmarks(points.size()) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h index 6251b72b385..37444760fe0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_vertices_generator.h @@ -31,24 +31,24 @@ namespace CGAL { * A generator for the landmarks point-locatoion class, which uses the * arrangement vertices as its set of landmarks. */ -template > +template > class Arr_landmarks_vertices_generator : public Arr_landmarks_generator_base { public: - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_2; typedef Nearest_neighbor_ Nearest_neighbor; - typedef Arr_landmarks_generator_base Base; - typedef Arr_landmarks_vertices_generator Self; - +private: + typedef Arr_landmarks_generator_base + Base; + typedef Arr_landmarks_vertices_generator + Self; + +public: + typedef typename Arrangement_2::Geometry_traits_2 Geometry_traits_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; @@ -66,25 +66,22 @@ public: typedef std::list NN_Point_list; protected: - typedef Arr_traits_basic_adaptor_2 Traits_adaptor_2; // Data members: - const Traits_adaptor_2 *m_traits; // Its associated traits object. + const Traits_adaptor_2* m_traits; // Its associated traits object. int num_landmarks; private: - /*! Copy constructor - not supported. */ - Arr_landmarks_vertices_generator (const Self& ); + Arr_landmarks_vertices_generator(const Self&); /*! Assignment operator - not supported. */ - Self& operator= (const Self& ); - -public: + Self& operator=(const Self&); +public: /*! Constructor. */ - Arr_landmarks_vertices_generator (const Arrangement_2& arr) : + Arr_landmarks_vertices_generator(const Arrangement_2& arr) : Base (arr), num_landmarks(0) {