AABB: rename to less_x/y/z

This commit is contained in:
Pierre Alliez 2009-04-27 18:13:06 +00:00
parent 911c74c590
commit 6c4f25b95b
3 changed files with 13 additions and 14 deletions

View File

@ -57,7 +57,7 @@ Any instantiation of \ccc{CGAL::Kernel} is a model of this traits concept.
\ccSeeAlso \ccSeeAlso
\ccc{AABB_traits<GeomTraits,TrianglePrimitive>}. \ccc{AABB_traits<GeomTraits,AABBPrimitive>}.
\end{ccRefConcept} \end{ccRefConcept}

View File

@ -28,8 +28,7 @@ The concept \ccRefName\ provides the geometric primitive types and methods for t
\ccTypes \ccTypes
\ccNestedType{Primitive}{This type must be a model of the concept \ccNestedType{Primitive}{Type of primitive. Must be a model of the concept \ccc{AABBPrimitive}.}
\ccc{AABBPrimitive}.}
\ccGlue \ccGlue
\ccNestedType{Bounding_box}{Bounding box type.} \ccNestedType{Bounding_box}{Bounding box type.}
\ccGlue \ccGlue
@ -41,7 +40,7 @@ The following types are required for projection queries.
\ccGlue \ccGlue
\ccNestedType{Projection_query}{Type for which projection queries are issued.} \ccNestedType{Projection_query}{Type for which projection queries are issued.}
\ccGlue \ccGlue
\ccNestedType{Projection}{Type of projection output.} \ccNestedType{Projection}{Type of projection result.}
\ccCreation \ccCreation
@ -54,14 +53,14 @@ The following types are required for projection queries.
During the construction of the \ccc{AABB_tree}, the primitives are sorted according to some comparison functions related to the $x$, $y$ or $z$ coordinate axis. During the construction of the \ccc{AABB_tree}, the primitives are sorted according to some comparison functions related to the $x$, $y$ or $z$ coordinate axis.
% TODO: replace by sort function (way much faster as we do not have to sort many times) % TODO: replace by sort function (way much faster as we do not have to sort many times)
\ccMethod{bool x_less_than(const Primitive & pr1, const Primitive & pr2);}{} \ccMethod{bool less_x(const Primitive & pr1, const Primitive & pr2);}{}
\ccGlue \ccGlue
\ccMethod{bool y_less_than(const Primitive & pr1, const Primitive & pr2);}{} \ccMethod{bool less_y(const Primitive & pr1, const Primitive & pr2);}{}
\ccGlue \ccGlue
\ccMethod{bool z_less_than(const Primitive & pr1, const Primitive & pr2);}{} \ccMethod{bool less_z(const Primitive & pr1, const Primitive & pr2);}{}
\ccMethod{Bounding_box compute_bbox(const_primitive_iterator begin, const_primitive_iterator beyond);} \ccMethod{Bounding_box compute_bbox(const_primitive_iterator begin, const_primitive_iterator beyond);}
{Computes and returns the bounding box of a set of primitives.} {Returns the bounding box of a set of primitives.}
The following predicates are required for each type \ccc{Query} The following predicates are required for each type \ccc{Query}
for which the class \ccc{AABB_tree<Traits>} may receive a query. for which the class \ccc{AABB_tree<Traits>} may receive a query.

View File

@ -80,11 +80,11 @@ public:
~AABB_traits() { }; ~AABB_traits() { };
/// Comparison functions /// Comparison functions
static bool x_less_than(const Primitive& pr1, const Primitive& pr2) static bool less_x(const Primitive& pr1, const Primitive& pr2)
{ return pr1.reference_point().x() < pr2.reference_point().x(); } { return pr1.reference_point().x() < pr2.reference_point().x(); }
static bool y_less_than(const Primitive& pr1, const Primitive& pr2) static bool less_y(const Primitive& pr1, const Primitive& pr2)
{ return pr1.reference_point().y() < pr2.reference_point().y(); } { return pr1.reference_point().y() < pr2.reference_point().y(); }
static bool z_less_than(const Primitive& pr1, const Primitive& pr2) static bool less_z(const Primitive& pr1, const Primitive& pr2)
{ return pr1.reference_point().z() < pr2.reference_point().z(); } { return pr1.reference_point().z() < pr2.reference_point().z(); }
/// UNDOCUMENTED FEATURE /// UNDOCUMENTED FEATURE
@ -182,13 +182,13 @@ AABB_traits<GT,P>::sort_primitives(PrimitiveIterator first,
switch(longest_axis(bbox)) switch(longest_axis(bbox))
{ {
case CGAL_AXIS_X: // sort along x case CGAL_AXIS_X: // sort along x
std::nth_element(first, middle, beyond, x_less_than); std::nth_element(first, middle, beyond, less_x);
break; break;
case CGAL_AXIS_Y: // sort along y case CGAL_AXIS_Y: // sort along y
std::nth_element(first, middle, beyond, y_less_than); std::nth_element(first, middle, beyond, less_y);
break; break;
case CGAL_AXIS_Z: // sort along z case CGAL_AXIS_Z: // sort along z
std::nth_element(first, middle, beyond, z_less_than); std::nth_element(first, middle, beyond, less_z);
break; break;
default: default:
CGAL_error(); CGAL_error();