mirror of https://github.com/CGAL/cgal
rearranged function signatures and requirements
This commit is contained in:
parent
c274d01229
commit
b554f4d4cb
|
|
@ -6,8 +6,8 @@
|
|||
\ccDefinition
|
||||
|
||||
The function \ccRefName\ computes the convex hull of a given set of
|
||||
three-dimensional points using the quickhull algorithm of Barnard
|
||||
\textit{et al.} \cite{bdh-qach-96}. Two versions of this function
|
||||
three-dimensional points
|
||||
Two versions of this function
|
||||
are available. The first can be used when it is known that the result
|
||||
will be a polyhedron and the second when a degenerate hull
|
||||
may also be possible.
|
||||
|
|
@ -22,23 +22,12 @@ void convex_hull_3(InputIterator first, InputIterator last,
|
|||
}
|
||||
{
|
||||
computes the convex hull of the set of points in the range
|
||||
[\ccc{first}, \ccc{last}). The result is stored in \ccc{polyhedron}.
|
||||
[\ccc{first}, \ccc{last}). The result is stored in \ccc{polyhedron}
|
||||
and the plane equations of each face are computed.
|
||||
\ccPrecond: There are at least four points in the range
|
||||
[\ccc{first}, \ccc{last}) not all of which are collinear.
|
||||
}
|
||||
|
||||
\ccHeading{Requirements}
|
||||
\begin{enumerate}
|
||||
\item \ccc{InputIterator::value_type} should be \ccc{Traits::Point_3}.
|
||||
\item \ccc{Traits} is a model of the concept ConvexHullTraits\_3
|
||||
\ccIndexMainItem[c]{ConvexHullTraits_3}.
|
||||
For the purposes of checking the postcondition that the convex hull
|
||||
is valid, \ccc{Traits} should also be a model of the concept
|
||||
IsStronglyConvexTraits\_3.
|
||||
%\ccIndexMainItem[c]{IsStronglyConvexTraits_3}
|
||||
\item \ccc{Polyhedron_3} must be a model of ConvexHullPolyhedron\_3.
|
||||
\end{enumerate}
|
||||
|
||||
\ccFunction{
|
||||
template <class InputIterator, class Polyhedron_3, class Traits>
|
||||
void convex_hull_3(InputIterator first, InputIterator last,
|
||||
|
|
@ -48,13 +37,32 @@ void convex_hull_3(InputIterator first, InputIterator last,
|
|||
{
|
||||
computes the convex hull of the set of points in the range
|
||||
[\ccc{first}, \ccc{last}). The result, which may be a point, a segment,
|
||||
a triangle, or a polyhedron, is stored in \ccc{ch_object}.
|
||||
a triangle, or a polyhedron, is stored in \ccc{ch_object}. When
|
||||
the result is a polyhedron, the plane equations of each face are computed.
|
||||
}
|
||||
|
||||
\ccHeading{Requirements}
|
||||
In addition to the first two requirements listed above, \ccc{Traits} must
|
||||
define a type \ccc{Polyhedron_3} that is a model of ConvexHullPolyhedron\_3
|
||||
for this version of the function.
|
||||
Both functions require the following:
|
||||
\begin{enumerate}
|
||||
\item \ccc{InputIterator::value_type} is equivalent to \ccc{Traits::Point_3}.
|
||||
\item \ccc{Traits} is a model of the concept ConvexHullTraits\_3
|
||||
\ccIndexMainItem[c]{ConvexHullTraits_3}.
|
||||
For the purposes of checking the postcondition that the convex hull
|
||||
is valid, \ccc{Traits} should also be a model of the concept
|
||||
IsStronglyConvexTraits\_3.
|
||||
%\ccIndexMainItem[c]{IsStronglyConvexTraits_3}
|
||||
\end{enumerate}
|
||||
|
||||
Both functions have an additional requirement for the polyhedron that is
|
||||
to be constructed. For the first version this is that:
|
||||
\begin{itemize}
|
||||
\item \ccc{Polyhedron_3} is a model of ConvexHullPolyhedron\_3,
|
||||
\end{itemize}
|
||||
and for the second, it is required that
|
||||
\begin{itemize}
|
||||
\item \ccc{Traits} defines a type \ccc{Polyhedron_3} that is a model of
|
||||
ConvexHullPolyhedron\_3.
|
||||
\end{itemize}
|
||||
|
||||
The default traits class for both versions of \ccc{convex_hull_3} is
|
||||
\ccc{Convex_hull_traits_3<R>},%
|
||||
|
|
@ -66,6 +74,10 @@ with the representation determined by \ccc{InputIterator::value_type}.
|
|||
\ccRefIdfierPage{CGAL::ch_eddy} \\
|
||||
\ccRefIdfierPage{CGAL::convex_hull_points_2}
|
||||
|
||||
\ccImplementation
|
||||
The algorithm implemented by these functions is the quickhull algorithm of
|
||||
Barnard \textit{et al.} \cite{bdh-qach-96}.
|
||||
|
||||
\ccExample
|
||||
|
||||
The following program computes the convex hull of a set of 250 random
|
||||
|
|
|
|||
Loading…
Reference in New Issue