% +------------------------------------------------------------------------+
% | Reference manual page: AABBTraits.tex
% +------------------------------------------------------------------------+
% | 21.02.2009   Author
% | Package: Package
% |
\RCSdef{\RCSAABBTraitsRev}{$Id: header.tex 40270 2007-09-07 15:29:10Z lsaboret $}
\RCSdefDate{\RCSAABBTraitsDate}{$Date: 2007-09-07 17:29:10 +0200 (Ven, 07 sep 2007) $}
% |
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+


\begin{ccRefConcept}{AABBTraits}

%% \ccHtmlCrossLink{}     %% add further rules for cross referencing links
%% \ccHtmlIndexC[concept]{} %% add further index entries

\ccDefinition
  
The concept \ccRefName\ provides the geometric primitive types and methods for the class \ccc{AABB_tree<Traits>}.

% \ccGeneralizes

% ThisConcept \\
% ThatConcept

\ccTypes

\ccNestedType{Primitive}{Type of primitive. Must be a model of the concept \ccc{AABBPrimitive}.}
\ccGlue
\ccNestedType{Bounding_box}{Bounding box type.}
\ccGlue
\ccNestedType{Intersection}{Type of intersection.}

The following types are required for projection queries.

\ccNestedType{Sphere}{Sphere type.}
\ccGlue
\ccNestedType{Projection_query}{Type for which projection queries are issued.}
\ccGlue
\ccNestedType{Projection}{Type of projection result.}
	

\ccCreation
\ccCreationVariable{traits}  %% choose variable name

\ccConstructor{AABBTraits();}{Default constructor.}

\ccOperations

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)
\ccMethod{bool less_x(const Primitive & pr1, const Primitive & pr2);}{}
\ccGlue
\ccMethod{bool less_y(const Primitive & pr1, const Primitive & pr2);}{}
\ccGlue
\ccMethod{bool less_z(const Primitive & pr1, const Primitive & pr2);}{}

\ccMethod{Bounding_box compute_bbox(const_primitive_iterator begin,                                                const_primitive_iterator beyond);}
{Returns the bounding box of a set of primitives.}

The following predicates are required for each type \ccc{Query}
for which the class \ccc{AABB_tree<Traits>} may receive a query.

\ccMethod{bool do_intersect(const Query & q, const Bounding_box & box);}
{Returns \ccc{true} iff the query intersects the bounding box.}
\ccGlue	
\ccMethod{bool do_intersect(const Query & q, const Primitive& primitive);}
{Returns \ccc{true} iff the query intersects the primitive.}
\ccGlue	
% TODO: replace return by pair<bool,Intersection>
\ccMethod{bool intersection(const Query & q, 
          const Primitive& primitive, 
          Intersection & intersection);}
{Returns \ccc{true} iff the query intersects the primitive. In the positive, stores the intersection in the last parameter. }

The following members are required only if projection queries are issued.
\ccMethod{Sphere sphere_from_query_and_hint(const Projection_query & center, 
                                const Projection & hint);}
{Returns a sphere centered at \ccc{center} and passing through \ccc{hint}.}

% TODO: replace return by pair<bool,Intersection>
\ccMethod{ bool intersection(const Sphere & sphere, 
                          const Primitive::Object object, 
                          const Projection & projection);}
{Returns \ccc{true} iff the primitive object is intersecting the ball defined as the interior of the sphere. In the positive, the point of the primitive closest to the center of the sphere is stored in the last parameter.}

\ccMethod{bool is_contained(const Sphere & a, const Sphere & b);}{Returns \ccc{true} iff sphere $a$ is contained in sphere $b$. Both spheres are assumed to share the same center.}

\ccHasModels

\ccc{AABB_traits<GeomTraits,TrianglePrimitive>}.

\ccSeeAlso
\ccc{AABB_traits<GeomTraits,TrianglePrimitive>}\\
\ccc{AABB_tree<Traits>}

\end{ccRefConcept}

% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+

