diff --git a/AABB_tree/doc_tex/AABB_tree_ref/AABBPrimitive.tex b/AABB_tree/doc_tex/AABB_tree_ref/AABBPrimitive.tex index 3ba8bca1079..3c572b473a3 100644 --- a/AABB_tree/doc_tex/AABB_tree_ref/AABBPrimitive.tex +++ b/AABB_tree/doc_tex/AABB_tree_ref/AABBPrimitive.tex @@ -23,8 +23,6 @@ The concept \ccRefName\ describes the requirements for the primitives stored in \ccTypes -\ccNestedType{FT}{Field number type.} - \ccNestedType{Point}{3D point type.} \ccNestedType{Datum}{Type of input datum.} @@ -43,17 +41,8 @@ The concept \ccRefName\ describes the requirements for the primitives stored in \ccMethod{Id id();} {Returns the corresponding identifier. This identifier is only used as a reference for the objects in the output of the \ccc{AABB_tree} methods.} -\ccMethod{FT xref();} -{Returns the \ccc{x} reference coordinate of the primitive used for sorting the primitives. It can be the x coordinate of either one vertex of the geometric object, or of its centroid, or any other reference point taken on the object.} - -\ccMethod{FT yref();} -{Returns the \ccc{y} reference coordinate of the primitive used for sorting the primitives.} - -\ccMethod{FT zref();} -{Returns the \ccc{z} reference coordinate of the primitive used for sorting the primitives.} - -\ccMethod{Point point_on();} -{Returns a 3D point located on the geometric object wrapped by the primitive. This function is used to construct the search KD-tree internal to the AABB tree in order to accelerate projection queries.} +\ccMethod{Point reference_point();} +{Returns a 3D point located on the geometric object wrapped by the primitive. This function is used to sort the primitives during the AABB tree construction and to construct the search KD-tree internal to the AABB tree in order to accelerate projection queries.} \ccSeeAlso \ccc{AABB_tree} diff --git a/AABB_tree/include/CGAL/AABB_polyhedron_edge_primitive.h b/AABB_tree/include/CGAL/AABB_polyhedron_edge_primitive.h index d8c00d6772c..6bb7288871a 100644 --- a/AABB_tree/include/CGAL/AABB_polyhedron_edge_primitive.h +++ b/AABB_tree/include/CGAL/AABB_polyhedron_edge_primitive.h @@ -37,7 +37,6 @@ namespace CGAL { { public: /// AABBTrianglePrimitive types - typedef typename GeomTraits::FT FT; typedef typename GeomTraits::Point_3 Point; typedef typename GeomTraits::Segment_3 Datum; typedef typename Polyhedron::Halfedge_handle Id; @@ -60,13 +59,7 @@ namespace CGAL { const Id id() const { return m_halfedge_handle; } /// Returns a point on the primitive - Point point_on() const; - - /// Returns the x/y/z reference coordinate for sorting - /// here simply one vertex of the triangle - const FT xref() const { return m_halfedge_handle->vertex()->point().x(); } - const FT yref() const { return m_halfedge_handle->vertex()->point().y(); } - const FT zref() const { return m_halfedge_handle->vertex()->point().z(); } + Point reference_point() const; private: /// Id, here a polyhedron halfedge handle @@ -86,7 +79,7 @@ namespace CGAL { template typename AABB_polyhedron_edge_primitive::Point - AABB_polyhedron_edge_primitive::point_on() const + AABB_polyhedron_edge_primitive::reference_point() const { return m_halfedge_handle->vertex()->point(); } diff --git a/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h index a3f317f23e7..0c2bb5eef6e 100644 --- a/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_polyhedron_triangle_primitive.h @@ -37,7 +37,6 @@ namespace CGAL { { public: /// AABBTrianglePrimitive types - typedef typename GeomTraits::FT FT; typedef typename GeomTraits::Point_3 Point; typedef typename GeomTraits::Triangle_3 Datum; typedef typename Polyhedron::Facet_handle Id; @@ -58,17 +57,11 @@ namespace CGAL { Datum datum() const; /// Returns a point on the primitive - Point point_on() const; + Point reference_point() const; /// Returns the identifier const Id id() const { return m_facet_handle; } - /// Returns the x/y/z reference coordinate for sorting - /// here simply one vertex of the triangle - const FT xref() const { return m_facet_handle->halfedge()->vertex()->point().x(); } - const FT yref() const { return m_facet_handle->halfedge()->vertex()->point().y(); } - const FT zref() const { return m_facet_handle->halfedge()->vertex()->point().z(); } - private: /// The id, here a polyhedron facet handle Id m_facet_handle; @@ -88,7 +81,7 @@ namespace CGAL { template typename AABB_polyhedron_triangle_primitive::Point - AABB_polyhedron_triangle_primitive::point_on() const + AABB_polyhedron_triangle_primitive::reference_point() const { return m_facet_handle->halfedge()->vertex()->point(); } diff --git a/AABB_tree/include/CGAL/AABB_segment_primitive.h b/AABB_tree/include/CGAL/AABB_segment_primitive.h index 11a4b98d4d6..6fa815a179c 100644 --- a/AABB_tree/include/CGAL/AABB_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_segment_primitive.h @@ -32,7 +32,6 @@ class AABB_segment_primitive { // type public: - typedef typename GeomTraits::FT FT; // field number type typedef typename GeomTraits::Point_3 Point; // point type typedef typename GeomTraits::Segment_3 Datum; // datum type typedef Iterator Id; // Id type @@ -54,15 +53,8 @@ public: Datum& datum() { return m_datum; } const Datum& datum() const { return m_datum; } - /// Returns the x/y/z reference coordinate for sorting - /// here simply the source vertex of the segment - // (could be as well the centroid computed on the fly) - const FT xref() const { return m_datum.source().x(); } - const FT yref() const { return m_datum.source().y(); } - const FT zref() const { return m_datum.source().z(); } - /// Returns a point on the primitive - Point point_on() const { m_datum.source(); } + Point reference_point() const { return m_datum.source(); } }; } // end namespace CGAL diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index 1ebddc8bbd1..11b30d9bfb6 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -80,11 +80,11 @@ public: /// Comparison functions static bool x_less_than(const Primitive& pr1, const Primitive& pr2) - { return pr1.xref() < pr2.xref(); } + { return pr1.reference_point().x() < pr2.reference_point().x(); } static bool y_less_than(const Primitive& pr1, const Primitive& pr2) - { return pr1.yref() < pr2.yref(); } + { return pr1.reference_point().y() < pr2.reference_point().y(); } static bool z_less_than(const Primitive& pr1, const Primitive& pr2) - { return pr1.zref() < pr2.zref(); } + { return pr1.reference_point().z() < pr2.reference_point().z(); } /// UNDOCUMENTED FEATURE /// TODO: see what to do diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 4dd344f1b75..f86c5483a3a 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -352,7 +352,7 @@ namespace CGAL { for(it = m_data.begin(); it != m_data.end(); it++) { const Primitive& pr = *it; - points.push_back(pr.point_on()); + points.push_back(pr.reference_point()); } m_search_tree.init(points.begin(), points.end()); m_search_tree_constructed = true; diff --git a/AABB_tree/include/CGAL/AABB_triangle_primitive.h b/AABB_tree/include/CGAL/AABB_triangle_primitive.h index 5593dc7491f..287165a10a7 100644 --- a/AABB_tree/include/CGAL/AABB_triangle_primitive.h +++ b/AABB_tree/include/CGAL/AABB_triangle_primitive.h @@ -33,7 +33,6 @@ namespace CGAL { public: // types typedef Iterator Id; // Id type - typedef typename GeomTraits::FT FT; // field number type typedef typename GeomTraits::Point_3 Point; // point type typedef typename GeomTraits::Triangle_3 Datum; // datum type @@ -54,14 +53,8 @@ namespace CGAL { Datum& datum() { return m_datum; } const Datum& datum() const { return m_datum; } - /// Returns the x/y/z reference coordinate for sorting - /// here simply the first vertex of the triangle - const FT xref() const { return m_datum.vertex(0).x(); } - const FT yref() const { return m_datum.vertex(0).y(); } - const FT zref() const { return m_datum.vertex(0).z(); } - /// Returns a point on the primitive - Point point_on() const { m_datum.vertex(0); } + Point reference_point() const { return m_datum.vertex(0); } }; } // end namespace CGAL