cgal/AABB_tree/doc_tex/AABB_tree/interface.tex

31 lines
2.6 KiB
TeX

\section{Interface}
\label{AABB_tree_section_interface}
The main entry point to the component is the class \ccc{AABB_tree} which represents a static AABB tree constructed from an iterator range of geometric data. Once instantiated an AABB tree can be queried for intersection and distance queries.\\
\paragraph{Intersections.} Assume for example that the tree contains triangle primitives. The tree can be queried for intersection against line objects (rays, segments or line) in various ways. We distinguish intersection \emph{tests} which do not construct any intersection objects, from \emph{intersections} which construct the intersection objects.\\
Tests:
\begin{itemize}
\item Function \ccc{do_intersect} tests if the input primitives are intersected by the query. This function is fast as it involves only predicates and stops after the first encountered intersection.
\item Function \ccc{number_of_intersected_primitives} counts all intersected primitives.
\item Function \ccc{all_intersected_primitives} enumerates all intersected primitives ids without constructing the corresponding intersection objects.
\item Function \ccc{any_intersected_primitive} returns the first encountered intersecting primitive id (if any) without constructing the corresponding intersection object, and stops after the first encountered intersection. Note that the traversal order of the tree is such that first herein does not refer to any particular ordering of the intersections with respect to the query.
\end{itemize}
Constructions:
\begin{itemize}
\item Function \ccc{all_intersections} detects and constructs all intersection objects with the input primitives.
\item Function \ccc{any_intersection} detects and constructs the first encountered intersection and constructs the corresponding object. This function is fast as it stops after the first encountered intersection.
\end{itemize}
\paragraph{Distance.} An AABB tree computes the closest point from a given point query to the input primitives through the function \ccc{closest_point(query)}. In addition, it can compute the id of the closest primitive from a given point query through the function \ccc{closest_point_and_primitive(query)}, i.e., the id of the primitive which realizes the minimum distance from the point query. The AABB tree uses a secondary search structure to speed up the distance queries. The construction of this secondary structure should be requested by the user by a call to \ccc{accelerate_distance_queries} before the first the distance computation. This data structure is not generated by default because it is used only for distance computations.