mirror of https://github.com/CGAL/cgal
Added compare_squared_radius, its functor, doc, testsuite
This commit is contained in:
parent
c9589121a1
commit
b997c33952
|
|
@ -0,0 +1,33 @@
|
|||
\begin{ccRefFunctionObjectConcept}{Kernel::CompareSquaredRadius_3}
|
||||
A model for this must provide:
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
|
||||
\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p,
|
||||
const Kernel::Point_3&q,
|
||||
const Kernel::FT& sr);}
|
||||
{compares the squared radius of the sphere defined by the
|
||||
points \ccc{p} and \ccc{q} to \ccc{sr}.}
|
||||
|
||||
\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p,
|
||||
const Kernel::Point_3&q,
|
||||
const Kernel::Point_3&r,
|
||||
const Kernel::FT& sr);}
|
||||
{compares the squared radius of the sphere defined by the
|
||||
points \ccc{p}, \ccc{q}, and \ccc{r} to \ccc{sr}.}
|
||||
|
||||
\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p,
|
||||
const Kernel::Point_3&q,
|
||||
const Kernel::Point_3&r,
|
||||
const Kernel::Point_3&s,
|
||||
const Kernel::FT& sr);}
|
||||
{compares the squared radius of the sphere defined by the
|
||||
points \ccc{p}, \ccc{q}, , \ccc{r}, and \ccc{s} to \ccc{sr}.}
|
||||
|
||||
\ccRefines
|
||||
\ccc{AdaptableFunctor} (with three arguments)
|
||||
|
||||
\ccSeeAlso
|
||||
\ccRefIdfierPage{CGAL::compare_squared_radius}
|
||||
|
||||
\end{ccRefFunctionObjectConcept}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
\begin{ccRefFunction}{compare_squared_radius}
|
||||
|
||||
\ccFunction{Comparison_result
|
||||
compare_squared_radius(const Point_3<Kernel>& p,
|
||||
const Point_3<Kernel>& q,
|
||||
const typename Kernel::FT& sr);}
|
||||
{compares the squared radius of the sphere defined by the
|
||||
points \ccStyle{p} and \ccStyle{q} to \ccStyle{sr}.}
|
||||
|
||||
|
||||
\ccFunction{Comparison_result
|
||||
compare_squared_radius(const Point_3<Kernel>& p,
|
||||
const Point_3<Kernel>& q,
|
||||
const Point_3<Kernel>& r,
|
||||
const typename Kernel::FT& sr);}
|
||||
{compares the squared radius of the sphere defined by the
|
||||
points \ccStyle{p}, \ccStyle{q}, and \ccStyle{r} to \ccStyle{sr}.}
|
||||
|
||||
\ccFunction{Comparison_result
|
||||
compare_squared_radius(const Point_3<Kernel>& p,
|
||||
const Point_3<Kernel>& q,
|
||||
const Point_3<Kernel>& r,
|
||||
const Point_3<Kernel>& s,
|
||||
const typename Kernel::FT& sr);}
|
||||
{compares the squared radius of the sphere defined by the
|
||||
points \ccStyle{p}, \ccStyle{q}, \ccStyle{r}, and \ccStyle{r} to \ccStyle{sr}.}
|
||||
|
||||
|
||||
|
||||
\end{ccRefFunction}
|
||||
|
|
@ -165,6 +165,7 @@ in the kernel.
|
|||
\input{Kernel_23_ref/compare_signed_distance_to_plane.tex}
|
||||
\input{Kernel_23_ref/compare_slopes.tex}
|
||||
\input{Kernel_23_ref/compare_squared_distance.tex}
|
||||
\input{Kernel_23_ref/compare_squared_radius.tex}
|
||||
\input{Kernel_23_ref/compare_x.tex}
|
||||
\input{Kernel_23_ref/compare_xy.tex}
|
||||
\input{Kernel_23_ref/compare_xyz.tex}
|
||||
|
|
@ -276,6 +277,7 @@ in the kernel.
|
|||
\input{Kernel_23_ref/Kernel_CompareSlope_2.tex}
|
||||
\input{Kernel_23_ref/Kernel_CompareSquaredDistance_2.tex}
|
||||
\input{Kernel_23_ref/Kernel_CompareSquaredDistance_3.tex}
|
||||
\input{Kernel_23_ref/Kernel_CompareSquaredRadius_3.tex}
|
||||
\input{Kernel_23_ref/Kernel_CompareXAtY_2.tex}
|
||||
\input{Kernel_23_ref/Kernel_CompareXYZ_3.tex}
|
||||
\input{Kernel_23_ref/Kernel_CompareXY_2.tex}
|
||||
|
|
|
|||
|
|
@ -280,6 +280,39 @@ compare_squared_distance(const Point_3<K> &p,
|
|||
return CGALi::compare_squared_distance(p, q, d2, K());
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
compare_squared_radius(const Point_3<K> &p,
|
||||
const Point_3<K> &q,
|
||||
const typename K::FT &sr)
|
||||
{
|
||||
return CGALi::compare_squared_radius(p, q, sr, K());
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
compare_squared_radius(const Point_3<K> &p,
|
||||
const Point_3<K> &q,
|
||||
const Point_3<K> &r,
|
||||
const typename K::FT &sr)
|
||||
{
|
||||
return CGALi::compare_squared_radius(p, q, r, sr, K());
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
compare_squared_radius(const Point_3<K> &p,
|
||||
const Point_3<K> &q,
|
||||
const Point_3<K> &r,
|
||||
const Point_3<K> &s,
|
||||
const typename K::FT &sr)
|
||||
{
|
||||
return CGALi::compare_squared_radius(p, q, r, s, sr, K());
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
|
|
|
|||
|
|
@ -280,6 +280,42 @@ compare_squared_distance(const typename K::Point_3 &p,
|
|||
return k.compare_squared_distance_3_object()(p, q, d2);
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
compare_squared_radius(const typename K::Point_3 &p,
|
||||
const typename K::Point_3 &q,
|
||||
const typename K::FT &sr,
|
||||
const K& k)
|
||||
{
|
||||
return k.compare_squared_radius_3_object()(p, q, sr);
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
compare_squared_radius(const typename K::Point_3 &p,
|
||||
const typename K::Point_3 &q,
|
||||
const typename K::Point_3 &r,
|
||||
const typename K::FT &sr,
|
||||
const K& k)
|
||||
{
|
||||
return k.compare_squared_radius_3_object()(p, q, r, sr);
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
compare_squared_radius(const typename K::Point_3 &p,
|
||||
const typename K::Point_3 &q,
|
||||
const typename K::Point_3 &r,
|
||||
const typename K::Point_3 &s,
|
||||
const typename K::FT &sr,
|
||||
const K& k)
|
||||
{
|
||||
return k.compare_squared_radius_3_object()(p, q, r, s, sr);
|
||||
}
|
||||
|
||||
template < class K >
|
||||
inline
|
||||
Comparison_result
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@ CGAL_Kernel_pred(Compare_squared_distance_2,
|
|||
compare_squared_distance_2_object)
|
||||
CGAL_Kernel_pred(Compare_squared_distance_3,
|
||||
compare_squared_distance_3_object)
|
||||
CGAL_Kernel_pred(Compare_squared_radius_3,
|
||||
compare_squared_radius_3_object)
|
||||
CGAL_Kernel_pred(Compare_x_at_y_2,
|
||||
compare_x_at_y_2_object)
|
||||
CGAL_Kernel_pred(Compare_xyz_3,
|
||||
|
|
|
|||
|
|
@ -204,6 +204,14 @@ _test_fct_point_3(const R& )
|
|||
assert( CGAL::compare_squared_distance(p0, p3, CGAL::squared_distance(p1,p0)) == CGAL::SMALLER );
|
||||
assert( CGAL::compare_squared_distance(p1, p3, CGAL::squared_distance(p5,p1)) == CGAL::SMALLER );
|
||||
|
||||
{
|
||||
CGAL::Point_3<R> p0(-2,0,0), p1(2,0,0), p2(0,2,0), p3(0,0,2);
|
||||
FT four(4);
|
||||
assert( CGAL::compare_squared_radius(p0, p1, four) == CGAL::EQUAL );
|
||||
assert( CGAL::compare_squared_radius(p0, p1, p2, four) == CGAL::EQUAL );
|
||||
assert( CGAL::compare_squared_radius(p0, p1, p2, p3, four) == CGAL::EQUAL );
|
||||
}
|
||||
|
||||
// More tests, that require sqrt().
|
||||
{
|
||||
typedef ::CGAL::Algebraic_structure_traits<FT> AST;
|
||||
|
|
|
|||
|
|
@ -592,6 +592,18 @@ test_new_3(const R& rep)
|
|||
= rep.compare_squared_distance_3_object();
|
||||
tmp34ab = compare_sq_dist(p2,p3,FT(1));
|
||||
|
||||
typename R::Compare_squared_radius_3 compare_sq_radius
|
||||
= rep.compare_squared_radius_3_object();
|
||||
|
||||
{
|
||||
FT rad(0);
|
||||
Comparison_result tmp;
|
||||
tmp = compare_sq_radius(p1, p2, p3, p4, rad);
|
||||
tmp = compare_sq_radius(p1, p2, p3, rad);
|
||||
tmp = compare_sq_radius(p1, p2, rad);
|
||||
(void)tmp;
|
||||
}
|
||||
|
||||
typename R::Collinear_3 collinear
|
||||
= rep.collinear_3_object();
|
||||
bool tmp29 = collinear(p2,p3,p4);
|
||||
|
|
|
|||
Loading…
Reference in New Issue