mirror of https://github.com/CGAL/cgal
Merge pull request #6866 from lrineau/Kernel-Compare_distance_3_RT_FT__always_Filtered_predicate_RT_FT-GF
fix undefined
This commit is contained in:
commit
72d590ef44
|
|
@ -17,6 +17,7 @@
|
||||||
#ifndef CGAL_CARTESIAN_FUNCTION_OBJECTS_H
|
#ifndef CGAL_CARTESIAN_FUNCTION_OBJECTS_H
|
||||||
#define CGAL_CARTESIAN_FUNCTION_OBJECTS_H
|
#define CGAL_CARTESIAN_FUNCTION_OBJECTS_H
|
||||||
|
|
||||||
|
#include <CGAL/tags.h>
|
||||||
#include <CGAL/Kernel/function_objects.h>
|
#include <CGAL/Kernel/function_objects.h>
|
||||||
#include <CGAL/predicates/kernel_ftC2.h>
|
#include <CGAL/predicates/kernel_ftC2.h>
|
||||||
#include <CGAL/predicates/kernel_ftC3.h>
|
#include <CGAL/predicates/kernel_ftC3.h>
|
||||||
|
|
@ -445,14 +446,14 @@ namespace CartesianKernelFunctors {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T1, class T2, class T3>
|
template <class T1, class T2, class T3>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const T3& r) const
|
operator()(const T1& p, const T2& q, const T3& r) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
|
return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T1, class T2, class T3, class T4>
|
template <class T1, class T2, class T3, class T4>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
|
return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
|
||||||
|
|
@ -591,14 +592,14 @@ namespace CartesianKernelFunctors {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T1, class T2, class T3>
|
template <class T1, class T2, class T3>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const T3& r) const
|
operator()(const T1& p, const T2& q, const T3& r) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
|
return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T1, class T2, class T3, class T4>
|
template <class T1, class T2, class T3, class T4>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
|
return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
|
||||||
|
|
@ -668,28 +669,34 @@ namespace CartesianKernelFunctors {
|
||||||
result_type
|
result_type
|
||||||
operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const FT& ft) const
|
operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const FT& ft) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(),
|
FT num, den;
|
||||||
q.x(), q.y(), q.z(),
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
r.x(), r.y(), r.z(),
|
q.x(), q.y(), q.z(),
|
||||||
s.x(), s.y(), s.z() ),
|
r.x(), r.y(), r.z(),
|
||||||
ft);
|
s.x(), s.y(), s.z(),
|
||||||
|
num, den);
|
||||||
|
return CGAL::compare(num, den * ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
operator()(const Point_3& p, const Point_3& q, const Point_3& r, const FT& ft) const
|
operator()(const Point_3& p, const Point_3& q, const Point_3& r, const FT& ft) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(),
|
FT num, den;
|
||||||
q.x(), q.y(), q.z(),
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
r.x(), r.y(), r.z()),
|
q.x(), q.y(), q.z(),
|
||||||
ft);
|
r.x(), r.y(), r.z(),
|
||||||
|
num, den);
|
||||||
|
return CGAL::compare(num, den * ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
operator()(const Point_3& p, const Point_3& q, const FT& ft) const
|
operator()(const Point_3& p, const Point_3& q, const FT& ft) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(),
|
FT num, den;
|
||||||
q.x(), q.y(), q.z() ),
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
ft);
|
q.x(), q.y(), q.z(),
|
||||||
|
num, den);
|
||||||
|
return CGAL::compare(num, den * ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
|
|
@ -1234,26 +1241,35 @@ namespace CartesianKernelFunctors {
|
||||||
result_type
|
result_type
|
||||||
operator()( const Point_3& p, const Point_3& q) const
|
operator()( const Point_3& p, const Point_3& q) const
|
||||||
{
|
{
|
||||||
return squared_radiusC3(p.x(), p.y(), p.z(),
|
FT num, den;
|
||||||
q.x(), q.y(), q.z());
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
|
q.x(), q.y(), q.z(),
|
||||||
|
num, den);
|
||||||
|
return num / den;
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
operator()( const Point_3& p, const Point_3& q, const Point_3& r) const
|
operator()( const Point_3& p, const Point_3& q, const Point_3& r) const
|
||||||
{
|
{
|
||||||
return squared_radiusC3(p.x(), p.y(), p.z(),
|
FT num, den;
|
||||||
q.x(), q.y(), q.z(),
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
r.x(), r.y(), r.z());
|
q.x(), q.y(), q.z(),
|
||||||
|
r.x(), r.y(), r.z(),
|
||||||
|
num, den);
|
||||||
|
return num / den;
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
operator()( const Point_3& p, const Point_3& q,
|
operator()( const Point_3& p, const Point_3& q,
|
||||||
const Point_3& r, const Point_3& s) const
|
const Point_3& r, const Point_3& s) const
|
||||||
{
|
{
|
||||||
return squared_radiusC3(p.x(), p.y(), p.z(),
|
FT num, den;
|
||||||
q.x(), q.y(), q.z(),
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
r.x(), r.y(), r.z(),
|
q.x(), q.y(), q.z(),
|
||||||
s.x(), s.y(), s.z());
|
r.x(), r.y(), r.z(),
|
||||||
|
s.x(), s.y(), s.z(),
|
||||||
|
num, den);
|
||||||
|
return num / den;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2505,7 +2521,7 @@ namespace CartesianKernelFunctors {
|
||||||
FT rsy = psz*qsx-psx*qsz;
|
FT rsy = psz*qsx-psx*qsz;
|
||||||
FT rsz = psx*qsy-psy*qsx;
|
FT rsz = psx*qsy-psy*qsx;
|
||||||
|
|
||||||
// The following determinants can be developped and simplified.
|
// The following determinants can be developed and simplified.
|
||||||
//
|
//
|
||||||
// FT num_x = determinant(psy,psz,ps2,
|
// FT num_x = determinant(psy,psz,ps2,
|
||||||
// qsy,qsz,qs2,
|
// qsy,qsz,qs2,
|
||||||
|
|
@ -3961,7 +3977,7 @@ namespace CartesianKernelFunctors {
|
||||||
operator()(const Circle_3 &a, const Point_3 &p) const
|
operator()(const Circle_3 &a, const Point_3 &p) const
|
||||||
{ return a.rep().has_on(p); }
|
{ return a.rep().has_on(p); }
|
||||||
|
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const Sphere_3 &a, const Circle_3 &p) const
|
operator()(const Sphere_3 &a, const Circle_3 &p) const
|
||||||
{ return a.rep().has_on(p); }
|
{ return a.rep().has_on(p); }
|
||||||
|
|
||||||
|
|
@ -4205,8 +4221,7 @@ namespace CartesianKernelFunctors {
|
||||||
public:
|
public:
|
||||||
typedef typename K::Orientation result_type;
|
typedef typename K::Orientation result_type;
|
||||||
|
|
||||||
result_type
|
result_type operator()(const Point_2& p, const Point_2& q, const Point_2& r) const
|
||||||
operator()(const Point_2& p, const Point_2& q, const Point_2& r) const
|
|
||||||
{
|
{
|
||||||
return orientationC2(p.x(), p.y(), q.x(), q.y(), r.x(), r.y());
|
return orientationC2(p.x(), p.y(), q.x(), q.y(), r.x(), r.y());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,11 +142,12 @@ centroidC3( const FT &px, const FT &py, const FT &pz,
|
||||||
|
|
||||||
template < class FT >
|
template < class FT >
|
||||||
CGAL_KERNEL_MEDIUM_INLINE
|
CGAL_KERNEL_MEDIUM_INLINE
|
||||||
FT
|
void
|
||||||
squared_radiusC3(const FT &px, const FT &py, const FT &pz,
|
squared_radiusC3(const FT &px, const FT &py, const FT &pz,
|
||||||
const FT &qx, const FT &qy, const FT &qz,
|
const FT &qx, const FT &qy, const FT &qz,
|
||||||
const FT &rx, const FT &ry, const FT &rz,
|
const FT &rx, const FT &ry, const FT &rz,
|
||||||
const FT &sx, const FT &sy, const FT &sz)
|
const FT &sx, const FT &sy, const FT &sz,
|
||||||
|
FT &num, FT &den)
|
||||||
{
|
{
|
||||||
// Translate p to origin to simplify the expression.
|
// Translate p to origin to simplify the expression.
|
||||||
FT qpx = qx-px;
|
FT qpx = qx-px;
|
||||||
|
|
@ -163,29 +164,30 @@ squared_radiusC3(const FT &px, const FT &py, const FT &pz,
|
||||||
FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz);
|
FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz);
|
||||||
|
|
||||||
FT num_x = determinant(qpy,qpz,qp2,
|
FT num_x = determinant(qpy,qpz,qp2,
|
||||||
rpy,rpz,rp2,
|
rpy,rpz,rp2,
|
||||||
spy,spz,sp2);
|
spy,spz,sp2);
|
||||||
FT num_y = determinant(qpx,qpz,qp2,
|
FT num_y = determinant(qpx,qpz,qp2,
|
||||||
rpx,rpz,rp2,
|
rpx,rpz,rp2,
|
||||||
spx,spz,sp2);
|
spx,spz,sp2);
|
||||||
FT num_z = determinant(qpx,qpy,qp2,
|
FT num_z = determinant(qpx,qpy,qp2,
|
||||||
rpx,rpy,rp2,
|
rpx,rpy,rp2,
|
||||||
spx,spy,sp2);
|
spx,spy,sp2);
|
||||||
FT den = determinant(qpx,qpy,qpz,
|
FT dden = determinant(qpx,qpy,qpz,
|
||||||
rpx,rpy,rpz,
|
rpx,rpy,rpz,
|
||||||
spx,spy,spz);
|
spx,spy,spz);
|
||||||
CGAL_kernel_assertion( ! CGAL_NTS is_zero(den) );
|
CGAL_kernel_assertion( ! CGAL_NTS is_zero(dden) );
|
||||||
|
|
||||||
return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y)
|
num = CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z);
|
||||||
+ CGAL_NTS square(num_z)) / CGAL_NTS square(2 * den);
|
den = CGAL_NTS square(2 * dden);
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class FT >
|
template < class FT >
|
||||||
CGAL_KERNEL_MEDIUM_INLINE
|
CGAL_KERNEL_MEDIUM_INLINE
|
||||||
FT
|
void
|
||||||
squared_radiusC3(const FT &px, const FT &py, const FT &pz,
|
squared_radiusC3(const FT &px, const FT &py, const FT &pz,
|
||||||
const FT &qx, const FT &qy, const FT &qz,
|
const FT &qx, const FT &qy, const FT &qz,
|
||||||
const FT &sx, const FT &sy, const FT &sz)
|
const FT &sx, const FT &sy, const FT &sz,
|
||||||
|
FT &num, FT &den)
|
||||||
{
|
{
|
||||||
// Translate s to origin to simplify the expression.
|
// Translate s to origin to simplify the expression.
|
||||||
FT psx = px-sx;
|
FT psx = px-sx;
|
||||||
|
|
@ -207,14 +209,14 @@ squared_radiusC3(const FT &px, const FT &py, const FT &pz,
|
||||||
FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy)
|
FT num_z = ps2 * determinant(qsx,qsy,rsx,rsy)
|
||||||
- qs2 * determinant(psx,psy,rsx,rsy);
|
- qs2 * determinant(psx,psy,rsx,rsy);
|
||||||
|
|
||||||
FT den = determinant(psx,psy,psz,
|
FT dden = determinant(psx,psy,psz,
|
||||||
qsx,qsy,qsz,
|
qsx,qsy,qsz,
|
||||||
rsx,rsy,rsz);
|
rsx,rsy,rsz);
|
||||||
|
|
||||||
CGAL_kernel_assertion( den != 0 );
|
CGAL_kernel_assertion( dden != 0 );
|
||||||
|
|
||||||
return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y)
|
num = CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z);
|
||||||
+ CGAL_NTS square(num_z)) / CGAL_NTS square(2 * den);
|
den = CGAL_NTS square(2 * dden);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class FT>
|
template <class FT>
|
||||||
|
|
@ -305,11 +307,13 @@ squared_distanceC3( const FT &px, const FT &py, const FT &pz,
|
||||||
|
|
||||||
template < class FT >
|
template < class FT >
|
||||||
CGAL_KERNEL_INLINE
|
CGAL_KERNEL_INLINE
|
||||||
FT
|
void
|
||||||
squared_radiusC3( const FT &px, const FT &py, const FT &pz,
|
squared_radiusC3( const FT &px, const FT &py, const FT &pz,
|
||||||
const FT &qx, const FT &qy, const FT &qz)
|
const FT &qx, const FT &qy, const FT &qz,
|
||||||
|
FT &num, FT &den)
|
||||||
{
|
{
|
||||||
return squared_distanceC3(px, py, pz, qx, qy, qz) / 4;
|
num = squared_distanceC3(px, py, pz, qx, qy, qz);
|
||||||
|
den = FT(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class FT >
|
template < class FT >
|
||||||
|
|
|
||||||
|
|
@ -754,7 +754,7 @@ power_side_of_bounded_power_sphereC3(
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the sign of the power test of weighted point (rx,ry,rz,rw)
|
// return the sign of the power test of weighted point (rx,ry,rz,rw)
|
||||||
// with respect to the smallest sphere orthogoanal to
|
// with respect to the smallest sphere orthogonal to
|
||||||
// p,q
|
// p,q
|
||||||
template< class FT >
|
template< class FT >
|
||||||
typename Same_uncertainty_nt<Bounded_side, FT>::type
|
typename Same_uncertainty_nt<Bounded_side, FT>::type
|
||||||
|
|
@ -764,20 +764,19 @@ power_side_of_bounded_power_sphereC3(
|
||||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw)
|
const FT &rx, const FT &ry, const FT &rz, const FT &rw)
|
||||||
{
|
{
|
||||||
FT FT2(2);
|
FT FT2(2);
|
||||||
FT FT4(4);
|
|
||||||
FT dpx = px - qx;
|
FT dpx = px - qx;
|
||||||
FT dpy = py - qy;
|
FT dpy = py - qy;
|
||||||
FT dpz = pz - qz;
|
FT dpz = pz - qz;
|
||||||
FT dpw = pw - qw;
|
FT dpw = pw - qw;
|
||||||
FT dp2 = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + CGAL_NTS square(dpz);
|
FT dp2 = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + CGAL_NTS square(dpz);
|
||||||
FT drx = rx - (px + qx)/FT2;
|
FT drx = FT2 * rx - (px + qx);
|
||||||
FT dry = ry - (py + qy)/FT2;
|
FT dry = FT2 * ry - (py + qy);
|
||||||
FT drz = rz - (pz + qz)/FT2;
|
FT drz = FT2 * rz - (pz + qz);
|
||||||
FT drw = rw - (pw + qw)/FT2;
|
FT drw = FT2 * rw - (pw + qw);
|
||||||
FT dr2 = CGAL_NTS square(drx) + CGAL_NTS square(dry) + CGAL_NTS square(drz);
|
FT dr2 = CGAL_NTS square(drx) + CGAL_NTS square(dry) + CGAL_NTS square(drz);
|
||||||
FT dpr = dpx*drx + dpy*dry +dpz*drz;
|
FT dpr = dpx*drx + dpy*dry +dpz*drz;
|
||||||
return enum_cast<Bounded_side>(
|
return enum_cast<Bounded_side>(
|
||||||
- CGAL_NTS sign (dr2 - dp2/FT4 + dpr*dpw/dp2 - drw ));
|
- CGAL_NTS sign (dr2*dp2 - dp2*dp2 + FT2*dpr*dpw - FT2*drw*dp2 ));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -81,13 +81,16 @@ struct Filtered_kernel_base
|
||||||
Approximate_kernel approximate_kernel() const { return {}; }
|
Approximate_kernel approximate_kernel() const { return {}; }
|
||||||
|
|
||||||
// We change the predicates.
|
// We change the predicates.
|
||||||
#define CGAL_Kernel_pred(P, Pf) \
|
#define CGAL_Kernel_pred_RT_or_FT(P, Pf) \
|
||||||
typedef Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F> P; \
|
typedef Filtered_predicate_RT_FT<typename Exact_kernel_rt::P, \
|
||||||
|
typename Exact_kernel::P, \
|
||||||
|
typename Approximate_kernel::P, \
|
||||||
|
C2E_rt, \
|
||||||
|
C2E, \
|
||||||
|
C2F> P; \
|
||||||
P Pf() const { return P(); }
|
P Pf() const { return P(); }
|
||||||
|
|
||||||
#define CGAL_Kernel_pred_RT(P, Pf) \
|
#define CGAL_Kernel_pred(P, Pf) CGAL_Kernel_pred_RT_or_FT(P, Pf)
|
||||||
typedef Filtered_predicate<typename Exact_kernel_rt::P, typename Approximate_kernel::P, C2E_rt, C2F> P; \
|
|
||||||
P Pf() const { return P(); }
|
|
||||||
|
|
||||||
// We don't touch the constructions.
|
// We don't touch the constructions.
|
||||||
#define CGAL_Kernel_cons(Y,Z)
|
#define CGAL_Kernel_cons(Y,Z)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
#include <CGAL/Uncertain.h>
|
#include <CGAL/Uncertain.h>
|
||||||
#include <CGAL/Profile_counter.h>
|
#include <CGAL/Profile_counter.h>
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
// This template class is a wrapper that implements the filtering for any
|
// This template class is a wrapper that implements the filtering for any
|
||||||
|
|
@ -84,15 +86,8 @@ public:
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
result_type
|
result_type
|
||||||
operator()(const Args&... args) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class EP, class AP, class C2E, class C2A, bool Protection>
|
|
||||||
template <typename... Args>
|
|
||||||
typename Filtered_predicate<EP,AP,C2E,C2A,Protection>::result_type
|
|
||||||
Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
|
||||||
operator()(const Args&... args) const
|
operator()(const Args&... args) const
|
||||||
{
|
{
|
||||||
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
|
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
|
||||||
// Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
|
// Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
|
||||||
{
|
{
|
||||||
|
|
@ -109,8 +104,76 @@ Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
||||||
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
|
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
|
||||||
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
|
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
|
||||||
return ep(c2e(args)...);
|
return ep(c2e(args)...);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} //namespace CGAL
|
template <class EP_RT, class EP_FT, class AP, class C2E_RT, class C2E_FT, class C2A, bool Protection = true>
|
||||||
|
class Filtered_predicate_RT_FT
|
||||||
|
{
|
||||||
|
C2E_RT c2e_rt;
|
||||||
|
C2E_FT c2e_ft;
|
||||||
|
C2A c2a;
|
||||||
|
EP_RT ep_rt;
|
||||||
|
EP_FT ep_ft;
|
||||||
|
AP ap;
|
||||||
|
|
||||||
|
using Ares = typename Remove_needs_FT<typename AP::result_type>::Type;
|
||||||
|
|
||||||
|
public:
|
||||||
|
using result_type = typename Remove_needs_FT<typename EP_FT::result_type>::Type;
|
||||||
|
|
||||||
|
private:
|
||||||
|
template <typename... Args>
|
||||||
|
struct Call_operator_needs_FT
|
||||||
|
{
|
||||||
|
using Actual_approx_res = decltype(ap(c2a(std::declval<const Args&>())...));
|
||||||
|
using Approx_res = std::remove_cv_t<std::remove_reference_t<Actual_approx_res> >;
|
||||||
|
enum { value = std::is_same<Approx_res, Needs_FT<Ares> >::value };
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename... Args,
|
||||||
|
std::enable_if_t<Call_operator_needs_FT<Args...>::value>* = nullptr>
|
||||||
|
result_type call(const Args&... args) const { return ep_ft(c2e_ft(args)...); }
|
||||||
|
|
||||||
|
template <typename... Args,
|
||||||
|
std::enable_if_t<! Call_operator_needs_FT<Args...>::value>* = nullptr>
|
||||||
|
result_type call(const Args&... args) const { return ep_rt(c2e_rt(args)...); }
|
||||||
|
|
||||||
|
public:
|
||||||
|
// ## Important note
|
||||||
|
//
|
||||||
|
// If you want to remove of rename that member function template `needs_FT`,
|
||||||
|
// please also change the lines with
|
||||||
|
// `CGAL_GENERATE_MEMBER_DETECTOR(needs_FT);`
|
||||||
|
// or `has_needs_FT<typename R::Compare_distance_3>` in
|
||||||
|
// the file `Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h`.
|
||||||
|
template <typename... Args>
|
||||||
|
bool needs_FT(const Args&...) const { return Call_operator_needs_FT<Args...>::value; }
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
result_type
|
||||||
|
operator()(const Args&... args) const
|
||||||
|
{
|
||||||
|
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
|
||||||
|
// Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
|
||||||
|
{
|
||||||
|
Protect_FPU_rounding<Protection> p;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Ares res = ap(c2a(args)...);
|
||||||
|
if (is_certain(res))
|
||||||
|
return get_certain(res);
|
||||||
|
}
|
||||||
|
catch (Uncertain_conversion_exception&) {}
|
||||||
|
}
|
||||||
|
CGAL_BRANCH_PROFILER_BRANCH(tmp);
|
||||||
|
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
|
||||||
|
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
|
||||||
|
|
||||||
|
return call(args...);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_FILTERED_PREDICATE_H
|
#endif // CGAL_FILTERED_PREDICATE_H
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ protected:
|
||||||
// Exact_kernel = exact kernel that will be made lazy
|
// Exact_kernel = exact kernel that will be made lazy
|
||||||
// Kernel = lazy kernel
|
// Kernel = lazy kernel
|
||||||
|
|
||||||
// the Generic base simplies applies the generic magic functor stupidly.
|
// the Generic base simply applies the generic magic functor stupidly.
|
||||||
// then the real base fixes up a few special cases.
|
// then the real base fixes up a few special cases.
|
||||||
template < typename EK_, typename AK_, typename E2A_, typename Kernel_ >
|
template < typename EK_, typename AK_, typename E2A_, typename Kernel_ >
|
||||||
class Lazy_kernel_generic_base : protected internal::Enum_holder
|
class Lazy_kernel_generic_base : protected internal::Enum_holder
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,7 @@ function(CGAL_setup_CGAL_dependencies target)
|
||||||
target_compile_definitions(${target} INTERFACE CGAL_TEST_SUITE=1)
|
target_compile_definitions(${target} INTERFACE CGAL_TEST_SUITE=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# CGAL now requires C++14. `decltype(auto)` is used as a marker of
|
# CGAL now requires C++14. `decltype(auto)` is used as a marker of C++14.
|
||||||
# C++14.
|
|
||||||
target_compile_features(${target} INTERFACE cxx_decltype_auto)
|
target_compile_features(${target} INTERFACE cxx_decltype_auto)
|
||||||
|
|
||||||
use_CGAL_Boost_support(${target} INTERFACE)
|
use_CGAL_Boost_support(${target} INTERFACE)
|
||||||
|
|
|
||||||
|
|
@ -62,19 +62,19 @@
|
||||||
|
|
||||||
#define CGAL_DO_INTERSECT_FUNCTION(A, B, DIM) \
|
#define CGAL_DO_INTERSECT_FUNCTION(A, B, DIM) \
|
||||||
template<typename K> \
|
template<typename K> \
|
||||||
inline bool \
|
inline typename K::Boolean \
|
||||||
do_intersect(const A<K>& a, const B<K>& b) { \
|
do_intersect(const A<K>& a, const B<K>& b) { \
|
||||||
return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \
|
return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \
|
||||||
} \
|
} \
|
||||||
template<typename K> \
|
template<typename K> \
|
||||||
inline bool \
|
inline typename K::Boolean \
|
||||||
do_intersect(const B<K>& b, const A<K>& a) { \
|
do_intersect(const B<K>& b, const A<K>& a) { \
|
||||||
return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(b, a))); \
|
return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(b, a))); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CGAL_DO_INTERSECT_FUNCTION_SELF(A, DIM) \
|
#define CGAL_DO_INTERSECT_FUNCTION_SELF(A, DIM) \
|
||||||
template<typename K> \
|
template<typename K> \
|
||||||
inline bool \
|
inline typename K::Boolean \
|
||||||
do_intersect(const A<K> & a, const A<K> & b) { \
|
do_intersect(const A<K> & a, const A<K> & b) { \
|
||||||
return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \
|
return BOOST_PP_CAT(K().do_intersect_, BOOST_PP_CAT(DIM, _object()(a, b))); \
|
||||||
}
|
}
|
||||||
|
|
@ -152,21 +152,21 @@ intersection_impl(const A& a, const B& b, Dynamic_dimension_tag) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename A, typename B>
|
template<typename A, typename B>
|
||||||
inline bool
|
inline auto // K::Boolean
|
||||||
do_intersect_impl(const A& a, const B& b, CGAL::Dimension_tag<2>) {
|
do_intersect_impl(const A& a, const B& b, CGAL::Dimension_tag<2>) {
|
||||||
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
|
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
|
||||||
return Kernel().do_intersect_2_object()(a, b);
|
return Kernel().do_intersect_2_object()(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename A, typename B>
|
template<typename A, typename B>
|
||||||
inline bool
|
inline auto // K::Boolean
|
||||||
do_intersect_impl(const A& a, const B& b, Dimension_tag<3>) {
|
do_intersect_impl(const A& a, const B& b, Dimension_tag<3>) {
|
||||||
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
|
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
|
||||||
return Kernel().do_intersect_3_object()(a, b);
|
return Kernel().do_intersect_3_object()(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename A, typename B>
|
template<typename A, typename B>
|
||||||
inline bool
|
inline auto // K::Boolean
|
||||||
do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) {
|
do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) {
|
||||||
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
|
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
|
||||||
return Kernel().do_intersect_d_object()(a, b);
|
return Kernel().do_intersect_d_object()(a, b);
|
||||||
|
|
@ -188,7 +188,7 @@ do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) {
|
||||||
|
|
||||||
// template<typename A, typename B>
|
// template<typename A, typename B>
|
||||||
// inline
|
// inline
|
||||||
// bool
|
// auto // K::Boolean
|
||||||
// do_intersect(const A& a, const B& b) {
|
// do_intersect(const A& a, const B& b) {
|
||||||
// CGAL_static_assertion_msg((std::is_same<typename A::Ambient_dimension, typename B::Ambient_dimension>::value),
|
// CGAL_static_assertion_msg((std::is_same<typename A::Ambient_dimension, typename B::Ambient_dimension>::value),
|
||||||
// "do_intersect with objects of different dimensions not supported");
|
// "do_intersect with objects of different dimensions not supported");
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,19 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox,
|
typename K::Boolean
|
||||||
const typename K::Circle_2& circle,
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
const K&)
|
const typename K::Circle_2& circle,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
return do_intersect_circle_iso_rectangle_2(circle, bbox, K());
|
return do_intersect_circle_iso_rectangle_2(circle, bbox, K());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Circle_2& circle,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_2& bbox,
|
do_intersect(const typename K::Circle_2& circle,
|
||||||
const K&)
|
const CGAL::Bbox_2& bbox,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
return do_intersect_circle_iso_rectangle_2(circle, bbox, K());
|
return do_intersect_circle_iso_rectangle_2(circle, bbox, K());
|
||||||
}
|
}
|
||||||
|
|
@ -44,15 +45,17 @@ bool do_intersect(const typename K::Circle_2& circle,
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& a,
|
typename K::Boolean
|
||||||
const Circle_2<K>& b)
|
do_intersect(const CGAL::Bbox_2& a,
|
||||||
|
const Circle_2<K>& b)
|
||||||
{
|
{
|
||||||
return K().do_intersect_2_object()(a, b);
|
return K().do_intersect_2_object()(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Circle_2<K>& a,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_2& b)
|
do_intersect(const Circle_2<K>& a,
|
||||||
|
const CGAL::Bbox_2& b)
|
||||||
{
|
{
|
||||||
return K().do_intersect_2_object()(a, b);
|
return K().do_intersect_2_object()(a, b);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,19 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template <typename K>
|
template <typename K>
|
||||||
inline bool do_intersect(const Iso_rectangle_2<K> &rect,
|
inline
|
||||||
const Bbox_2 &box)
|
typename K::Boolean
|
||||||
|
do_intersect(const Iso_rectangle_2<K>& rect,
|
||||||
|
const Bbox_2& box)
|
||||||
{
|
{
|
||||||
return do_intersect(K::Iso_rectangle_2(box), rect);
|
return do_intersect(K::Iso_rectangle_2(box), rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename K>
|
template <typename K>
|
||||||
inline bool do_intersect(const Bbox_2 &box,
|
inline
|
||||||
const Iso_rectangle_2<K> &rect)
|
typename K::Boolean
|
||||||
|
do_intersect(const Bbox_2 &box,
|
||||||
|
const Iso_rectangle_2<K> &rect)
|
||||||
{
|
{
|
||||||
return do_intersect(rect, box);
|
return do_intersect(rect, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,18 +27,20 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Line_2& line,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_2& bbox,
|
do_intersect(const typename K::Line_2& line,
|
||||||
const K& k)
|
const CGAL::Bbox_2& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
typedef typename K::Iso_rectangle_2 Iso_rectangle_2;
|
typedef typename K::Iso_rectangle_2 Iso_rectangle_2;
|
||||||
return Intersections::internal::do_intersect(line, Iso_rectangle_2(bbox), k);
|
return Intersections::internal::do_intersect(line, Iso_rectangle_2(bbox), k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox,
|
typename K::Boolean
|
||||||
const typename K::Line_2& line,
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
const K& k)
|
const typename K::Line_2& line,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return Intersections::internal::do_intersect(line, bbox, k);
|
return Intersections::internal::do_intersect(line, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
@ -47,13 +49,17 @@ bool do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox, const Line_2<K>& line)
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
|
const Line_2<K>& line)
|
||||||
{
|
{
|
||||||
return K().do_intersect_2_object()(bbox, line);
|
return K().do_intersect_2_object()(bbox, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Line_2<K>& line, const CGAL::Bbox_2& bbox)
|
typename K::Boolean
|
||||||
|
do_intersect(const Line_2<K>& line,
|
||||||
|
const CGAL::Bbox_2& bbox)
|
||||||
{
|
{
|
||||||
return K().do_intersect_2_object()(line, bbox);
|
return K().do_intersect_2_object()(line, bbox);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const Bbox_2 &bbox,
|
inline
|
||||||
const Point_2<K> &pt,
|
typename K::Boolean
|
||||||
const K& k)
|
do_intersect(const Bbox_2 &bbox,
|
||||||
|
const Point_2<K> &pt,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
Point_2<K> bl(bbox.xmin(), bbox.ymin()),
|
Point_2<K> bl(bbox.xmin(), bbox.ymin()),
|
||||||
tr(bbox.xmax(), bbox.ymax());
|
tr(bbox.xmax(), bbox.ymax());
|
||||||
|
|
@ -36,9 +38,11 @@ inline bool do_intersect(const Bbox_2 &bbox,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const Point_2<K> &pt,
|
inline
|
||||||
const Bbox_2& bbox,
|
typename K::Boolean
|
||||||
const K& k)
|
do_intersect(const Point_2<K> &pt,
|
||||||
|
const Bbox_2& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(bbox, pt, k);
|
return do_intersect(bbox, pt, k);
|
||||||
}
|
}
|
||||||
|
|
@ -69,15 +73,17 @@ intersection(const CGAL::Bbox_2& b,
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& a,
|
typename K::Boolean
|
||||||
const Point_2<K>& b)
|
do_intersect(const CGAL::Bbox_2& a,
|
||||||
|
const Point_2<K>& b)
|
||||||
{
|
{
|
||||||
return Intersections::internal::do_intersect(a,b,K());
|
return Intersections::internal::do_intersect(a,b,K());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Point_2<K>& a,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_2& b)
|
do_intersect(const Point_2<K>& a,
|
||||||
|
const CGAL::Bbox_2& b)
|
||||||
{
|
{
|
||||||
return Intersections::internal::do_intersect(b,a,K());
|
return Intersections::internal::do_intersect(b,a,K());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,18 +27,20 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Ray_2& ray,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_2& bbox,
|
do_intersect(const typename K::Ray_2& ray,
|
||||||
const K& k)
|
const CGAL::Bbox_2& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
typedef typename K::Iso_rectangle_2 Iso_rectangle_2;
|
typedef typename K::Iso_rectangle_2 Iso_rectangle_2;
|
||||||
return Intersections::internal::do_intersect(ray, Iso_rectangle_2(bbox), k);
|
return Intersections::internal::do_intersect(ray, Iso_rectangle_2(bbox), k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox,
|
typename K::Boolean
|
||||||
const typename K::Ray_2& ray,
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
const K& k)
|
const typename K::Ray_2& ray,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return Intersections::internal::do_intersect(ray, bbox, k);
|
return Intersections::internal::do_intersect(ray, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
@ -47,13 +49,17 @@ bool do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox, const Ray_2<K>& ray)
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
|
const Ray_2<K>& ray)
|
||||||
{
|
{
|
||||||
return K().do_intersect_2_object()(bbox, ray);
|
return K().do_intersect_2_object()(bbox, ray);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Ray_2<K>& ray, const CGAL::Bbox_2& bbox)
|
typename K::Boolean
|
||||||
|
do_intersect(const Ray_2<K>& ray,
|
||||||
|
const CGAL::Bbox_2& bbox)
|
||||||
{
|
{
|
||||||
return K().do_intersect_2_object()(ray, bbox);
|
return K().do_intersect_2_object()(ray, bbox);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,20 +20,21 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Segment_2<K> &seg,
|
typename K::Boolean
|
||||||
const Bbox_2 &box)
|
do_intersect(const Segment_2<K>& seg,
|
||||||
|
const Bbox_2& box)
|
||||||
{
|
{
|
||||||
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
||||||
return do_intersect(rec, seg);
|
return do_intersect(rec, seg);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Bbox_2 &box,
|
typename K::Boolean
|
||||||
const Segment_2<K> &seg)
|
do_intersect(const Bbox_2& box,
|
||||||
|
const Segment_2<K>& seg)
|
||||||
{
|
{
|
||||||
return do_intersect(seg, box);
|
return do_intersect(seg, box);
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +42,8 @@ inline bool do_intersect(
|
||||||
template<typename K>
|
template<typename K>
|
||||||
typename Intersection_traits<K, typename K::Segment_2, Bbox_2>::result_type
|
typename Intersection_traits<K, typename K::Segment_2, Bbox_2>::result_type
|
||||||
intersection(const CGAL::Bbox_2& box,
|
intersection(const CGAL::Bbox_2& box,
|
||||||
const Segment_2<K>& seg) {
|
const Segment_2<K>& seg)
|
||||||
|
{
|
||||||
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
||||||
return intersection(rec, seg);
|
return intersection(rec, seg);
|
||||||
}
|
}
|
||||||
|
|
@ -49,9 +51,11 @@ intersection(const CGAL::Bbox_2& box,
|
||||||
template<typename K>
|
template<typename K>
|
||||||
typename Intersection_traits<K, typename K::Segment_2, Bbox_2>::result_type
|
typename Intersection_traits<K, typename K::Segment_2, Bbox_2>::result_type
|
||||||
intersection(const Segment_2<K>& seg,
|
intersection(const Segment_2<K>& seg,
|
||||||
const CGAL::Bbox_2& box) {
|
const CGAL::Bbox_2& box)
|
||||||
|
{
|
||||||
return intersection(box, seg);
|
return intersection(box, seg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERSECTIONS_BBOX_2_SEGMENT_2_H
|
#endif // CGAL_INTERSECTIONS_BBOX_2_SEGMENT_2_H
|
||||||
|
|
|
||||||
|
|
@ -20,20 +20,21 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Triangle_2<K> &tr,
|
typename K::Boolean
|
||||||
const Bbox_2 &box)
|
do_intersect(const Triangle_2<K>& tr,
|
||||||
|
const Bbox_2& box)
|
||||||
{
|
{
|
||||||
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
||||||
return do_intersect(rec, tr);
|
return do_intersect(rec, tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Bbox_2 &box,
|
typename K::Boolean
|
||||||
const Triangle_2<K> &tr)
|
do_intersect(const Bbox_2& box,
|
||||||
|
const Triangle_2<K>& tr)
|
||||||
{
|
{
|
||||||
return do_intersect(tr, box);
|
return do_intersect(tr, box);
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +42,8 @@ inline bool do_intersect(
|
||||||
template<typename K>
|
template<typename K>
|
||||||
typename Intersection_traits<K, typename K::Triangle_2, Bbox_2>::result_type
|
typename Intersection_traits<K, typename K::Triangle_2, Bbox_2>::result_type
|
||||||
intersection(const Bbox_2& box,
|
intersection(const Bbox_2& box,
|
||||||
const Triangle_2<K>& tr) {
|
const Triangle_2<K>& tr)
|
||||||
|
{
|
||||||
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
typename K::Iso_rectangle_2 rec(box.xmin(), box.ymin(), box.xmax(), box.ymax());
|
||||||
return intersection(rec, tr);
|
return intersection(rec, tr);
|
||||||
}
|
}
|
||||||
|
|
@ -49,9 +51,11 @@ intersection(const Bbox_2& box,
|
||||||
template<typename K>
|
template<typename K>
|
||||||
typename Intersection_traits<K, typename K::Triangle_2, Bbox_2>::result_type
|
typename Intersection_traits<K, typename K::Triangle_2, Bbox_2>::result_type
|
||||||
intersection(const Triangle_2<K>& tr,
|
intersection(const Triangle_2<K>& tr,
|
||||||
const Bbox_2& box) {
|
const Bbox_2& box)
|
||||||
|
{
|
||||||
return intersection(box, tr);
|
return intersection(box, tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERSECTIONS_BBOX_2_TRIANGLE_2_H
|
#endif // CGAL_INTERSECTIONS_BBOX_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Circle_2 & circ1,
|
typename K::Boolean do_intersect(const typename K::Circle_2& circ1,
|
||||||
const typename K::Circle_2& circ2,
|
const typename K::Circle_2& circ2,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ namespace internal {
|
||||||
|
|
||||||
// Circle_2 is not a disk, thus if the box is contained within the circle, there is no intersection.
|
// Circle_2 is not a disk, thus if the box is contained within the circle, there is no intersection.
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect_circle_iso_rectangle_2(const typename K::Circle_2& circle,
|
typename K::Boolean do_intersect_circle_iso_rectangle_2(const typename K::Circle_2& circle,
|
||||||
const typename K::Iso_rectangle_2& rec,
|
const typename K::Iso_rectangle_2& rec,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
typedef typename K::Point_2 Point;
|
typedef typename K::Point_2 Point;
|
||||||
|
|
@ -92,18 +92,17 @@ bool do_intersect_circle_iso_rectangle_2(const typename K::Circle_2& circle,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_rectangle_2& rec,
|
typename K::Boolean do_intersect(const typename K::Iso_rectangle_2& rec,
|
||||||
const typename K::Circle_2& circle,
|
const typename K::Circle_2& circle,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return do_intersect_circle_iso_rectangle_2(circle, rec, K());
|
return do_intersect_circle_iso_rectangle_2(circle, rec, K());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Circle_2& circle,
|
typename K::Boolean do_intersect(const typename K::Circle_2& circle,
|
||||||
const typename K::Iso_rectangle_2& rec,
|
const typename K::Iso_rectangle_2& rec,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return do_intersect_circle_iso_rectangle_2(circle, rec, K());
|
return do_intersect_circle_iso_rectangle_2(circle, rec, K());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Circle_2 & c,
|
do_intersect(const typename K::Circle_2& c,
|
||||||
const typename K::Line_2& l,
|
const typename K::Line_2& l,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -38,9 +38,9 @@ do_intersect(const typename K::Circle_2 & c,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_2& l,
|
do_intersect(const typename K::Line_2& l,
|
||||||
const typename K::Circle_2 & c,
|
const typename K::Circle_2& c,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return squared_distance(c.center(), l) <= c.squared_radius();
|
return squared_distance(c.center(), l) <= c.squared_radius();
|
||||||
|
|
@ -53,4 +53,4 @@ CGAL_DO_INTERSECT_FUNCTION(Circle_2, Line_2, 2)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_LINE_2_H
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,19 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_2 &pt,
|
do_intersect(const typename K::Point_2& pt,
|
||||||
const typename K::Circle_2 &circle,
|
const typename K::Circle_2& circle,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return circle.has_on_boundary(pt);
|
return circle.has_on_boundary(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Circle_2 &circle,
|
do_intersect(const typename K::Circle_2& circle,
|
||||||
const typename K::Point_2 &pt,
|
const typename K::Point_2& pt,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return circle.has_on_boundary(pt);
|
return circle.has_on_boundary(pt);
|
||||||
|
|
@ -48,8 +47,8 @@ do_intersect(const typename K::Circle_2 &circle,
|
||||||
template <class K>
|
template <class K>
|
||||||
typename CGAL::Intersection_traits
|
typename CGAL::Intersection_traits
|
||||||
<K, typename K::Point_2, typename K::Circle_2>::result_type
|
<K, typename K::Point_2, typename K::Circle_2>::result_type
|
||||||
intersection(const typename K::Point_2 &pt,
|
intersection(const typename K::Point_2& pt,
|
||||||
const typename K::Circle_2 &circle,
|
const typename K::Circle_2& circle,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
if (do_intersect(pt,circle, k))
|
if (do_intersect(pt,circle, k))
|
||||||
|
|
@ -60,8 +59,8 @@ intersection(const typename K::Point_2 &pt,
|
||||||
template <class K>
|
template <class K>
|
||||||
typename CGAL::Intersection_traits
|
typename CGAL::Intersection_traits
|
||||||
<K, typename K::Circle_2, typename K::Point_2>::result_type
|
<K, typename K::Circle_2, typename K::Point_2>::result_type
|
||||||
intersection(const typename K::Circle_2 &circle,
|
intersection(const typename K::Circle_2& circle,
|
||||||
const typename K::Point_2 &pt,
|
const typename K::Point_2& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
return internal::intersection(pt, circle, k);
|
return internal::intersection(pt, circle, k);
|
||||||
|
|
@ -73,5 +72,6 @@ intersection(const typename K::Circle_2 &circle,
|
||||||
CGAL_INTERSECTION_FUNCTION(Point_2, Circle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Point_2, Circle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Point_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Point_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Circle_2 & c,
|
do_intersect(const typename K::Circle_2& c,
|
||||||
const typename K::Ray_2& r,
|
const typename K::Ray_2& r,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -33,9 +33,9 @@ do_intersect(const typename K::Circle_2 & c,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Ray_2& r,
|
do_intersect(const typename K::Ray_2& r,
|
||||||
const typename K::Circle_2 & c,
|
const typename K::Circle_2& c,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return squared_distance(c.center(), r) <= c.squared_radius();
|
return squared_distance(c.center(), r) <= c.squared_radius();
|
||||||
|
|
@ -47,4 +47,5 @@ do_intersect(const typename K::Ray_2& r,
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Ray_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Ray_2, 2)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_RAY_2_H
|
#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_RAY_2_H
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Circle_2 & c,
|
do_intersect(const typename K::Circle_2& c,
|
||||||
const typename K::Segment_2& s,
|
const typename K::Segment_2& s,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -33,9 +33,9 @@ do_intersect(const typename K::Circle_2 & c,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_2& s,
|
do_intersect(const typename K::Segment_2& s,
|
||||||
const typename K::Circle_2 & c,
|
const typename K::Circle_2& c,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return squared_distance(c.center(), s) <= c.squared_radius();
|
return squared_distance(c.center(), s) <= c.squared_radius();
|
||||||
|
|
@ -47,4 +47,5 @@ do_intersect(const typename K::Segment_2& s,
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Segment_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Segment_2, 2)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_SEGMENT_2_H
|
#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_SEGMENT_2_H
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Circle_2 & c,
|
do_intersect(const typename K::Circle_2 & c,
|
||||||
const typename K::Triangle_2& t,
|
const typename K::Triangle_2& t,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -48,9 +48,9 @@ do_intersect(const typename K::Circle_2 & c,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Triangle_2& t,
|
do_intersect(const typename K::Triangle_2& t,
|
||||||
const typename K::Circle_2 & c,
|
const typename K::Circle_2& c,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return do_intersect(c,t);
|
return do_intersect(c,t);
|
||||||
|
|
@ -62,4 +62,5 @@ do_intersect(const typename K::Triangle_2& t,
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Triangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Triangle_2, 2)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_TRIANGLE_2_H
|
#endif // CGAL_INTERSECTIONS_2_CIRCLE_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -74,20 +74,20 @@ intersection(
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
inline bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Iso_rectangle_2 &irect1,
|
do_intersect(const typename K::Iso_rectangle_2& irect1,
|
||||||
const typename K::Iso_rectangle_2 &irect2,
|
const typename K::Iso_rectangle_2& irect2,
|
||||||
const K&) {
|
const K&)
|
||||||
|
{
|
||||||
return bool(intersection(irect1, irect2));
|
return bool(intersection(irect1, irect2));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
|
|
||||||
CGAL_INTERSECTION_FUNCTION_SELF(Iso_rectangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION_SELF(Iso_rectangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_rectangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_rectangle_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_ISO_RECTANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -58,25 +58,27 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Line_2 &p1,
|
inline
|
||||||
const typename K::Iso_rectangle_2 &p2,
|
typename K::Boolean
|
||||||
const K&)
|
do_intersect(const typename K::Line_2& l,
|
||||||
|
const typename K::Iso_rectangle_2& ir,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Line_2_Iso_rectangle_2_pair<K> pair_t;
|
typedef Line_2_Iso_rectangle_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&l, &ir);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Iso_rectangle_2 &p2,
|
inline
|
||||||
const typename K::Line_2 &p1,
|
typename K::Boolean
|
||||||
const K& k)
|
do_intersect(const typename K::Iso_rectangle_2& ir,
|
||||||
|
const typename K::Line_2& l,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return internal::do_intersect(p1, p2, k);
|
return internal::do_intersect(l, ir, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename Line_2_Iso_rectangle_2_pair<K>::Intersection_results
|
typename Line_2_Iso_rectangle_2_pair<K>::Intersection_results
|
||||||
Line_2_Iso_rectangle_2_pair<K>::intersection_type() const
|
Line_2_Iso_rectangle_2_pair<K>::intersection_type() const
|
||||||
|
|
@ -217,4 +219,4 @@ CGAL_DO_INTERSECT_FUNCTION(Line_2, Iso_rectangle_2, 2)
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
#include <CGAL/enable_warnings.h>
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_LINE_2_H
|
||||||
|
|
|
||||||
|
|
@ -30,22 +30,22 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_2 &pt,
|
do_intersect(const typename K::Point_2& pt,
|
||||||
const typename K::Iso_rectangle_2 &iso,
|
const typename K::Iso_rectangle_2& iso,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return !iso.has_on_unbounded_side(pt);
|
return !iso.has_on_unbounded_side(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Iso_rectangle_2 &iso,
|
do_intersect(const typename K::Iso_rectangle_2& iso,
|
||||||
const typename K::Point_2 &pt,
|
const typename K::Point_2& pt,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return !iso.has_on_unbounded_side(pt);
|
return !iso.has_on_unbounded_side(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -77,6 +77,6 @@ intersection(const typename K::Iso_rectangle_2 &iso,
|
||||||
CGAL_INTERSECTION_FUNCTION(Point_2, Iso_rectangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Point_2, Iso_rectangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Point_2, Iso_rectangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Point_2, Iso_rectangle_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_ISO_RECTANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -55,21 +55,25 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Ray_2 &p1,
|
inline
|
||||||
const typename K::Iso_rectangle_2 &p2,
|
typename K::Boolean
|
||||||
const K&)
|
do_intersect(const typename K::Ray_2& r,
|
||||||
|
const typename K::Iso_rectangle_2& ir,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Ray_2_Iso_rectangle_2_pair<K> pair_t;
|
typedef Ray_2_Iso_rectangle_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&r, &ir);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Iso_rectangle_2 &p2,
|
inline
|
||||||
const typename K::Ray_2 &p1,
|
typename K::Boolean
|
||||||
const K& k)
|
do_intersect(const typename K::Iso_rectangle_2& ir,
|
||||||
|
const typename K::Ray_2& r,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(p1, p2, k);
|
return do_intersect(r, ir, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -200,9 +204,8 @@ Ray_2_Iso_rectangle_2_pair<K>::intersection_point() const
|
||||||
CGAL_INTERSECTION_FUNCTION(Ray_2, Iso_rectangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Ray_2, Iso_rectangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Iso_rectangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Iso_rectangle_2, 2)
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
#include <CGAL/enable_warnings.h>
|
||||||
|
|
||||||
#endif // CGAL_RAY_2_iSO_RECTANGLE_2_INTERSECTION_H
|
#endif // CGAL_RAY_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||||
|
|
|
||||||
|
|
@ -54,21 +54,6 @@ protected:
|
||||||
_max;
|
_max;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
|
||||||
inline bool do_intersect(
|
|
||||||
const typename K::Segment_2 &p1,
|
|
||||||
const typename K::Iso_rectangle_2 &p2,
|
|
||||||
const K&)
|
|
||||||
{
|
|
||||||
typedef Segment_2_Iso_rectangle_2_pair<K> pair_t;
|
|
||||||
pair_t pair(&p1, &p2);
|
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename CGAL::Intersection_traits
|
typename CGAL::Intersection_traits
|
||||||
<K, typename K::Segment_2, typename K::Iso_rectangle_2>::result_type
|
<K, typename K::Segment_2, typename K::Iso_rectangle_2>::result_type
|
||||||
|
|
@ -208,17 +193,26 @@ intersection_point() const
|
||||||
return translated_point(_ref_point, construct_scaled_vector(_dir,_min));
|
return translated_point(_ref_point, construct_scaled_vector(_dir,_min));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class K>
|
||||||
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Segment_2& s,
|
||||||
|
const typename K::Iso_rectangle_2& ir,
|
||||||
|
const K&)
|
||||||
|
{
|
||||||
|
typedef Segment_2_Iso_rectangle_2_pair<K> pair_t;
|
||||||
|
pair_t pair(&s, &ir);
|
||||||
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Iso_rectangle_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Segment_2 &p2,
|
do_intersect(const typename K::Iso_rectangle_2& ir,
|
||||||
const K&)
|
const typename K::Segment_2& s,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
typedef Segment_2_Iso_rectangle_2_pair<K> pair_t;
|
return do_intersect(s, ir, k);
|
||||||
pair_t pair(&p2, &p1);
|
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
@ -227,7 +221,7 @@ inline bool do_intersect(
|
||||||
CGAL_INTERSECTION_FUNCTION(Segment_2, Iso_rectangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Segment_2, Iso_rectangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Iso_rectangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Iso_rectangle_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
#include <CGAL/enable_warnings.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -292,10 +292,10 @@ namespace internal {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(
|
typename K::Boolean
|
||||||
const typename K::Triangle_2 &tr,
|
do_intersect(const typename K::Triangle_2& tr,
|
||||||
const typename K::Iso_rectangle_2 &ir,
|
const typename K::Iso_rectangle_2& ir,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
//1) check if at least one vertex of tr is not outside ir
|
//1) check if at least one vertex of tr is not outside ir
|
||||||
//2) if not, check if at least on vertex of tr is not outside tr
|
//2) if not, check if at least on vertex of tr is not outside tr
|
||||||
|
|
@ -318,20 +318,21 @@ namespace internal {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Iso_rectangle_2 &ir,
|
typename K::Boolean
|
||||||
const typename K::Triangle_2 &tr,
|
do_intersect(const typename K::Iso_rectangle_2& ir,
|
||||||
const K& k)
|
const typename K::Triangle_2& tr,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(tr,ir,k);
|
return do_intersect(tr, ir, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
CGAL_INTERSECTION_FUNCTION(Triangle_2, Iso_rectangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Triangle_2, Iso_rectangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Triangle_2, Iso_rectangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Triangle_2, Iso_rectangle_2, 2)
|
||||||
|
|
||||||
}//end namespace
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -52,17 +52,18 @@ protected:
|
||||||
mutable typename K::Point_2 _intersection_point;
|
mutable typename K::Point_2 _intersection_point;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
|
||||||
inline bool do_intersect(
|
|
||||||
const typename K::Line_2 &p1,
|
|
||||||
const typename K::Line_2 &p2,
|
|
||||||
const K&)
|
|
||||||
{
|
|
||||||
typedef Line_2_Line_2_pair<K> pair_t;
|
|
||||||
pair_t pair(&p1, &p2);
|
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
template <class K>
|
||||||
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Line_2& l1,
|
||||||
|
const typename K::Line_2& l2,
|
||||||
|
const K&)
|
||||||
|
{
|
||||||
|
typedef Line_2_Line_2_pair<K> pair_t;
|
||||||
|
pair_t pair(&l1, &l2);
|
||||||
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -200,7 +201,6 @@ Line_2_Line_2_pair<K>::intersection_line() const
|
||||||
CGAL_INTERSECTION_FUNCTION_SELF(Line_2, 2)
|
CGAL_INTERSECTION_FUNCTION_SELF(Line_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Line_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION_SELF(Line_2, 2)
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
} //namespace CGAL
|
#endif // CGAL_INTERSECTIONS_2_LINE_2_LINE_2_H
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -29,21 +29,23 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
do_intersect(const typename K::Point_2 &pt,
|
typename K::Boolean
|
||||||
const typename K::Line_2 &line,
|
do_intersect(const typename K::Point_2& pt,
|
||||||
|
const typename K::Line_2& line,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return line.has_on(pt);
|
return line.has_on(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
do_intersect(const typename K::Line_2 &line,
|
typename K::Boolean
|
||||||
const typename K::Point_2 &pt,
|
do_intersect(const typename K::Line_2& line,
|
||||||
|
const typename K::Point_2& pt,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return line.has_on(pt);
|
return line.has_on(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -76,6 +78,6 @@ intersection(const typename K::Line_2 &line,
|
||||||
CGAL_INTERSECTION_FUNCTION(Point_2, Line_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Point_2, Line_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Point_2, Line_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Point_2, Line_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_LINE_2_H
|
||||||
|
|
|
||||||
|
|
@ -55,17 +55,26 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Ray_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Line_2 &p2,
|
do_intersect(const typename K::Ray_2& r,
|
||||||
const K&)
|
const typename K::Line_2& l,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Ray_2_Line_2_pair<K> pair_t;
|
typedef Ray_2_Line_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&r, &l);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class K>
|
||||||
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Line_2& l,
|
||||||
|
const typename K::Ray_2& r,
|
||||||
|
const K& k)
|
||||||
|
{
|
||||||
|
return do_intersect(r, l, k);
|
||||||
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename Intersection_traits
|
typename Intersection_traits
|
||||||
|
|
@ -99,20 +108,6 @@ intersection(const typename K::Line_2 &line,
|
||||||
return internal::intersection(ray, line, k);
|
return internal::intersection(ray, line, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
|
||||||
inline bool do_intersect(
|
|
||||||
const typename K::Line_2 &p1,
|
|
||||||
const typename K::Ray_2 &p2,
|
|
||||||
const K&)
|
|
||||||
{
|
|
||||||
typedef Ray_2_Line_2_pair<K> pair_t;
|
|
||||||
pair_t pair(&p2, &p1);
|
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename Ray_2_Line_2_pair<K>::Intersection_results
|
typename Ray_2_Line_2_pair<K>::Intersection_results
|
||||||
Ray_2_Line_2_pair<K>::intersection_type() const
|
Ray_2_Line_2_pair<K>::intersection_type() const
|
||||||
|
|
|
||||||
|
|
@ -51,14 +51,25 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Segment_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Line_2 &p2,
|
do_intersect(const typename K::Segment_2& s,
|
||||||
const K&)
|
const typename K::Line_2& l,
|
||||||
|
const K& )
|
||||||
{
|
{
|
||||||
typedef Segment_2_Line_2_pair<K> pair_t;
|
typedef Segment_2_Line_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&s, &l);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class K>
|
||||||
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Line_2& l,
|
||||||
|
const typename K::Segment_2& s,
|
||||||
|
const K& k)
|
||||||
|
{
|
||||||
|
return internal::do_intersect(s, l, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -92,17 +103,6 @@ intersection(const typename K::Line_2 &line,
|
||||||
return internal::intersection(seg, line, k);
|
return internal::intersection(seg, line, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
|
||||||
inline bool do_intersect(
|
|
||||||
const typename K::Line_2 &line,
|
|
||||||
const typename K::Segment_2 &seg,
|
|
||||||
const K& k)
|
|
||||||
{
|
|
||||||
return internal::do_intersect(seg, line, k);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename Segment_2_Line_2_pair<K>::Intersection_results
|
typename Segment_2_Line_2_pair<K>::Intersection_results
|
||||||
Segment_2_Line_2_pair<K>::intersection_type() const
|
Segment_2_Line_2_pair<K>::intersection_type() const
|
||||||
|
|
@ -156,7 +156,6 @@ Segment_2_Line_2_pair<K>::intersection_segment() const
|
||||||
CGAL_INTERSECTION_FUNCTION(Segment_2, Line_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Segment_2, Line_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Line_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Line_2, 2)
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
} //namespace CGAL
|
#endif // CGAL_INTERSECTIONS_2_SEGMENT_2_LINE_2_H
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -55,24 +55,24 @@ protected:
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_2 &p1,
|
do_intersect(const typename K::Line_2& l,
|
||||||
const typename K::Triangle_2 &p2,
|
const typename K::Triangle_2& tr,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Line_2_Triangle_2_pair<K> pair_t;
|
typedef Line_2_Triangle_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&l, &tr);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Triangle_2 &p2,
|
do_intersect(const typename K::Triangle_2& tr,
|
||||||
const typename K::Line_2 &p1,
|
const typename K::Line_2& l,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
return internal::do_intersect(p1, p2, k);
|
return internal::do_intersect(l, tr, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -190,6 +190,6 @@ intersection(const typename K::Triangle_2 &tr,
|
||||||
CGAL_INTERSECTION_FUNCTION(Line_2, Triangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Line_2, Triangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Line_2, Triangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Line_2, Triangle_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_LINE_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -28,34 +28,33 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
do_intersect(const typename K::Point_2 &pt1,
|
typename K::Boolean
|
||||||
const typename K::Point_2 &pt2,
|
do_intersect(const typename K::Point_2& pt1,
|
||||||
const K&)
|
const typename K::Point_2& pt2,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return pt1 == pt2;
|
return k.equal_2_object()(pt1, pt2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename CGAL::Intersection_traits
|
typename CGAL::Intersection_traits<K, typename K::Point_2, typename K::Point_2>::result_type
|
||||||
<K, typename K::Point_2, typename K::Point_2>::result_type
|
intersection(const typename K::Point_2& pt1,
|
||||||
intersection(const typename K::Point_2 &pt1,
|
const typename K::Point_2& pt2,
|
||||||
const typename K::Point_2 &pt2,
|
const K& k)
|
||||||
const K&)
|
|
||||||
{
|
{
|
||||||
if (pt1 == pt2) {
|
if (k.equal_2_object()(pt1, pt2))
|
||||||
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Point_2>(pt1);
|
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Point_2>(pt1);
|
||||||
}
|
|
||||||
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Point_2>();
|
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Point_2>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}// namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
CGAL_INTERSECTION_FUNCTION_SELF(Point_2, 2)
|
CGAL_INTERSECTION_FUNCTION_SELF(Point_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Point_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION_SELF(Point_2, 2)
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
} //namespace CGAL
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_POINT_2_H
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_2 &pt,
|
do_intersect(const typename K::Point_2& pt,
|
||||||
const typename K::Ray_2 &ray,
|
const typename K::Ray_2& ray,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return ray.has_on(pt);
|
return ray.has_on(pt);
|
||||||
|
|
@ -41,9 +41,9 @@ do_intersect(const typename K::Point_2 &pt,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Ray_2 &ray,
|
do_intersect(const typename K::Ray_2& ray,
|
||||||
const typename K::Point_2 &pt,
|
const typename K::Point_2& pt,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
return ray.has_on(pt);
|
return ray.has_on(pt);
|
||||||
|
|
@ -51,8 +51,7 @@ do_intersect(const typename K::Ray_2 &ray,
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename CGAL::Intersection_traits
|
typename CGAL::Intersection_traits<K, typename K::Point_2, typename K::Ray_2>::result_type
|
||||||
<K, typename K::Point_2, typename K::Ray_2>::result_type
|
|
||||||
intersection(const typename K::Point_2 &pt,
|
intersection(const typename K::Point_2 &pt,
|
||||||
const typename K::Ray_2 &ray,
|
const typename K::Ray_2 &ray,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -64,8 +63,7 @@ intersection(const typename K::Point_2 &pt,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename CGAL::Intersection_traits
|
typename CGAL::Intersection_traits<K, typename K::Ray_2, typename K::Point_2>::result_type
|
||||||
<K, typename K::Ray_2, typename K::Point_2>::result_type
|
|
||||||
intersection(const typename K::Ray_2 &ray,
|
intersection(const typename K::Ray_2 &ray,
|
||||||
const typename K::Point_2 &pt,
|
const typename K::Point_2 &pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -79,7 +77,6 @@ intersection(const typename K::Ray_2 &ray,
|
||||||
CGAL_INTERSECTION_FUNCTION(Point_2, Ray_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Point_2, Ray_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Point_2, Ray_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Point_2, Ray_2, 2)
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
} //namespace CGAL
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_RAY_2_H
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_2 &pt,
|
do_intersect(const typename K::Point_2 &pt,
|
||||||
const typename K::Segment_2 &seg,
|
const typename K::Segment_2 &seg,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -40,7 +40,7 @@ do_intersect(const typename K::Point_2 &pt,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_2 &seg,
|
do_intersect(const typename K::Segment_2 &seg,
|
||||||
const typename K::Point_2 &pt,
|
const typename K::Point_2 &pt,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -77,10 +77,9 @@ intersection( const typename K::Segment_2 &seg,
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
|
|
||||||
CGAL_INTERSECTION_FUNCTION(Point_2, Segment_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Point_2, Segment_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Point_2, Segment_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Point_2, Segment_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_SEGMENT_2_H
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,11 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Point_2 &p1,
|
inline
|
||||||
const typename K::Triangle_2 &p2,
|
typename K::Boolean
|
||||||
const K&)
|
do_intersect(const typename K::Point_2& p1,
|
||||||
|
const typename K::Triangle_2& p2,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Point_2_Triangle_2_pair<K> pair_t;
|
typedef Point_2_Triangle_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&p1, &p2);
|
||||||
|
|
@ -60,9 +62,11 @@ inline bool do_intersect(const typename K::Point_2 &p1,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Triangle_2 &p2,
|
inline
|
||||||
const typename K::Point_2 &p1,
|
typename K::Boolean
|
||||||
const K& k)
|
do_intersect(const typename K::Triangle_2& p2,
|
||||||
|
const typename K::Point_2& p1,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return internal::do_intersect(p1, p2, k);
|
return internal::do_intersect(p1, p2, k);
|
||||||
}
|
}
|
||||||
|
|
@ -133,6 +137,6 @@ intersection(const typename K::Triangle_2 &tr,
|
||||||
CGAL_INTERSECTION_FUNCTION(Point_2, Triangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Point_2, Triangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Point_2, Triangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Point_2, Triangle_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -54,14 +54,15 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Ray_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Ray_2 &p2,
|
do_intersect(const typename K::Ray_2& r1,
|
||||||
const K&)
|
const typename K::Ray_2& r2,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Ray_2_Ray_2_pair<K> pair_t;
|
typedef Ray_2_Ray_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&r1, &r2);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -252,7 +253,6 @@ intersection(const typename K::Ray_2 &ray1,
|
||||||
CGAL_INTERSECTION_FUNCTION_SELF(Ray_2, 2)
|
CGAL_INTERSECTION_FUNCTION_SELF(Ray_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_2, 2)
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
} //namespace CGAL
|
#endif // CGAL_INTERSECTIONS_2_RAY_2_RAY_2_H
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -54,21 +54,25 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Ray_2 &p1,
|
inline
|
||||||
const typename K::Segment_2 &p2,
|
typename K::Boolean
|
||||||
const K&)
|
do_intersect(const typename K::Ray_2& r,
|
||||||
|
const typename K::Segment_2& s,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Ray_2_Segment_2_pair<K> pair_t;
|
typedef Ray_2_Segment_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&r, &s);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Segment_2 &p2,
|
inline
|
||||||
const typename K::Ray_2 &p1,
|
typename K::Boolean
|
||||||
const K& k)
|
do_intersect(const typename K::Segment_2& s,
|
||||||
|
const typename K::Ray_2& r,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return internal::do_intersect(p1, p2, k);
|
return internal::do_intersect(r, s, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -265,6 +269,6 @@ intersection(const typename K::Segment_2 &seg,
|
||||||
CGAL_INTERSECTION_FUNCTION(Ray_2, Segment_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Ray_2, Segment_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Segment_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Segment_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_RAY_2_SEGMENT_2_H
|
||||||
|
|
|
||||||
|
|
@ -165,26 +165,26 @@ intersection(const typename K::Triangle_2&tr,
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Ray_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Triangle_2 &p2,
|
do_intersect(const typename K::Ray_2& r,
|
||||||
const K&)
|
const typename K::Triangle_2& tr,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Ray_2_Triangle_2_pair<K> pair_t;
|
typedef Ray_2_Triangle_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&r, &tr);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Triangle_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Ray_2 &p2,
|
do_intersect(const typename K::Triangle_2& tr,
|
||||||
const K&)
|
const typename K::Ray_2& r,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
typedef Ray_2_Triangle_2_pair<K> pair_t;
|
return do_intersect(r, tr, k);
|
||||||
pair_t pair(&p2, &p1);
|
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
@ -193,7 +193,6 @@ inline bool do_intersect(
|
||||||
CGAL_INTERSECTION_FUNCTION(Ray_2, Triangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Ray_2, Triangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Triangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Triangle_2, 2)
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
} //namespace CGAL
|
#endif // CGAL_INTERSECTIONS_2_RAY_2_TRIANGLE_2_H
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
#include <CGAL/predicates_on_points_2.h>
|
#include <CGAL/predicates_on_points_2.h>
|
||||||
#include <CGAL/Line_2.h>
|
#include <CGAL/Line_2.h>
|
||||||
#include <CGAL/Intersections_2/Line_2_Line_2.h>
|
#include <CGAL/Intersections_2/Line_2_Line_2.h>
|
||||||
#include <CGAL/Uncertain.h>
|
|
||||||
#include <CGAL/Intersection_traits_2.h>
|
#include <CGAL/Intersection_traits_2.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -326,7 +325,7 @@ do_intersect_with_info(const typename K::Segment_2 &seg1,
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_2 &seg1,
|
do_intersect(const typename K::Segment_2 &seg1,
|
||||||
const typename K::Segment_2 &seg2,
|
const typename K::Segment_2 &seg2,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -492,6 +491,6 @@ intersection(const typename K::Segment_2 &seg1,
|
||||||
CGAL_INTERSECTION_FUNCTION_SELF(Segment_2, 2)
|
CGAL_INTERSECTION_FUNCTION_SELF(Segment_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_SEGMENT_2_SEGMENT_2_H
|
||||||
|
|
|
||||||
|
|
@ -52,19 +52,26 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Segment_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Triangle_2 &p2,
|
do_intersect(const typename K::Segment_2& s,
|
||||||
const K&)
|
const typename K::Triangle_2& tr,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Segment_2_Triangle_2_pair<K> pair_t;
|
typedef Segment_2_Triangle_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&s, &tr);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class K>
|
||||||
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Triangle_2& tr,
|
||||||
|
const typename K::Segment_2& s,
|
||||||
|
const K& k)
|
||||||
|
{
|
||||||
|
return do_intersect(s, tr, k);
|
||||||
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
typename Segment_2_Triangle_2_pair<K>::Intersection_results
|
typename Segment_2_Triangle_2_pair<K>::Intersection_results
|
||||||
|
|
@ -174,24 +181,12 @@ intersection(const typename K::Triangle_2&tr,
|
||||||
return internal::intersection(seg, tr, k);
|
return internal::intersection(seg, tr, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
|
||||||
inline bool do_intersect(
|
|
||||||
const typename K::Triangle_2 &p1,
|
|
||||||
const typename K::Segment_2 &p2,
|
|
||||||
const K&)
|
|
||||||
{
|
|
||||||
typedef Segment_2_Triangle_2_pair<K> pair_t;
|
|
||||||
pair_t pair(&p2, &p1);
|
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
CGAL_INTERSECTION_FUNCTION(Segment_2, Triangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION(Segment_2, Triangle_2, 2)
|
||||||
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Triangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Triangle_2, 2)
|
||||||
|
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_SEGMENT_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,10 @@
|
||||||
#include <CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h>
|
#include <CGAL/Intersections_2/internal/Triangle_2_Triangle_2_intersection_impl.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_2, 2)
|
CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_2, 2)
|
||||||
CGAL_INTERSECTION_FUNCTION_SELF(Triangle_2, 2)
|
CGAL_INTERSECTION_FUNCTION_SELF(Triangle_2, 2)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_TRIANGLE_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Geert-Jan Giezeman
|
// Author(s) : Geert-Jan Giezeman
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H
|
#ifndef CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H
|
||||||
#define CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H
|
#define CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H
|
||||||
|
|
||||||
|
|
@ -346,6 +345,6 @@ collinear_order(typename K::Point_2 const &pt1, typename K::Point_2 const & pt2)
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_INTERNAL_STRAIGHT_2_H
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,15 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool intersection_test_vertex(const typename K::Point_2 * P1,
|
typename K::Boolean
|
||||||
const typename K::Point_2 * Q1,
|
intersection_test_vertex(const typename K::Point_2* P1,
|
||||||
const typename K::Point_2 * R1,
|
const typename K::Point_2* Q1,
|
||||||
const typename K::Point_2 * P2,
|
const typename K::Point_2* R1,
|
||||||
const typename K::Point_2 * Q2,
|
const typename K::Point_2* P2,
|
||||||
const typename K::Point_2 * R2,
|
const typename K::Point_2* Q2,
|
||||||
const K & k ){
|
const typename K::Point_2* R2,
|
||||||
|
const K& k)
|
||||||
|
{
|
||||||
CGAL_kernel_precondition( k.orientation_2_object() (*P1,*Q1,*R1)
|
CGAL_kernel_precondition( k.orientation_2_object() (*P1,*Q1,*R1)
|
||||||
== POSITIVE);
|
== POSITIVE);
|
||||||
CGAL_kernel_precondition( k.orientation_2_object() (*P2,*Q2,*R2)
|
CGAL_kernel_precondition( k.orientation_2_object() (*P2,*Q2,*R2)
|
||||||
|
|
@ -65,16 +65,15 @@ bool intersection_test_vertex(const typename K::Point_2 * P1,
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool intersection_test_edge(const typename K::Point_2 * P1,
|
typename K::Boolean
|
||||||
const typename K::Point_2 * Q1,
|
intersection_test_edge(const typename K::Point_2* P1,
|
||||||
const typename K::Point_2 * R1,
|
const typename K::Point_2* Q1,
|
||||||
const typename K::Point_2 * P2,
|
const typename K::Point_2* R1,
|
||||||
const typename K::Point_2 *
|
const typename K::Point_2* P2,
|
||||||
CGAL_kernel_precondition_code(Q2),
|
const typename K::Point_2* CGAL_kernel_precondition_code(Q2),
|
||||||
const typename K::Point_2 * R2,
|
const typename K::Point_2* R2,
|
||||||
const K & k ){
|
const K& k)
|
||||||
|
{
|
||||||
|
|
||||||
CGAL_kernel_precondition( k.orientation_2_object() (*P1,*Q1,*R1)
|
CGAL_kernel_precondition( k.orientation_2_object() (*P1,*Q1,*R1)
|
||||||
== POSITIVE);
|
== POSITIVE);
|
||||||
CGAL_kernel_precondition( k.orientation_2_object() (*P2,*Q2,*R2)
|
CGAL_kernel_precondition( k.orientation_2_object() (*P2,*Q2,*R2)
|
||||||
|
|
@ -99,12 +98,12 @@ bool intersection_test_edge(const typename K::Point_2 * P1,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_2 &t1,
|
typename K::Boolean
|
||||||
const typename K::Triangle_2 &t2,
|
do_intersect(const typename K::Triangle_2& t1,
|
||||||
const K & k ){
|
const typename K::Triangle_2& t2,
|
||||||
|
const K& k)
|
||||||
|
{
|
||||||
CGAL_kernel_precondition( ! k.is_degenerate_2_object() (t1) );
|
CGAL_kernel_precondition( ! k.is_degenerate_2_object() (t1) );
|
||||||
CGAL_kernel_precondition( ! k.is_degenerate_2_object() (t2) );
|
CGAL_kernel_precondition( ! k.is_degenerate_2_object() (t2) );
|
||||||
|
|
||||||
|
|
@ -164,6 +163,6 @@ bool do_intersect(const typename K::Triangle_2 &t1,
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
} //namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif //CGAL_TRIANGLE_2_TRIANGLE_2_DO_INTERSECT_H
|
#endif // CGAL_TRIANGLE_2_TRIANGLE_2_DO_INTERSECT_H
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
inline
|
inline
|
||||||
do_intersect(const CGAL::Bbox_3& c,
|
do_intersect(const CGAL::Bbox_3& c,
|
||||||
const CGAL::Bbox_3& bbox,
|
const CGAL::Bbox_3& bbox,
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Iso_cuboid_3<K>& ic)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Iso_cuboid_3<K>& ic)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, ic);
|
return K().do_intersect_3_object()(box, ic);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Iso_cuboid_3<K>& ic,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Iso_cuboid_3<K>& ic,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(ic, box);
|
return K().do_intersect_3_object()(ic, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Line_3<K>& l)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Line_3<K>& l)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, l);
|
return K().do_intersect_3_object()(box, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Line_3<K>& l,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Line_3<K>& l,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(l, box);
|
return K().do_intersect_3_object()(l, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Plane_3<K>& pl)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Plane_3<K>& pl)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, pl);
|
return K().do_intersect_3_object()(box, pl);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Plane_3<K>& pl,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Plane_3<K>& pl,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(pl, box);
|
return K().do_intersect_3_object()(pl, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,9 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Point_3<K>& p)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Point_3<K>& p)
|
||||||
{
|
{
|
||||||
Point_3<K> bl(box.xmin(), box.ymin(), box.zmin()),
|
Point_3<K> bl(box.xmin(), box.ymin(), box.zmin()),
|
||||||
tr(box.xmax(), box.ymax(), box.zmax());
|
tr(box.xmax(), box.ymax(), box.zmax());
|
||||||
|
|
@ -40,8 +41,9 @@ bool do_intersect(const CGAL::Bbox_3& box,
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Point_3<K>& a,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& b)
|
do_intersect(const Point_3<K>& a,
|
||||||
|
const CGAL::Bbox_3& b)
|
||||||
{
|
{
|
||||||
return do_intersect(b,a);
|
return do_intersect(b,a);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Ray_3<K>& r)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Ray_3<K>& r)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, r);
|
return K().do_intersect_3_object()(box, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Ray_3<K>& r,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Ray_3<K>& r,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(r, box);
|
return K().do_intersect_3_object()(r, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Segment_3<K>& s)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Segment_3<K>& s)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, s);
|
return K().do_intersect_3_object()(box, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Segment_3<K>& s,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Segment_3<K>& s,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(s, box);
|
return K().do_intersect_3_object()(s, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,15 +28,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Sphere_3<K>& s)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Sphere_3<K>& s)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, s);
|
return K().do_intersect_3_object()(box, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Sphere_3<K>& s,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Sphere_3<K>& s,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(s, box);
|
return K().do_intersect_3_object()(s, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,15 +28,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Tetrahedron_3<K>& t)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Tetrahedron_3<K>& t)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, t);
|
return K().do_intersect_3_object()(box, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Tetrahedron_3<K>& t,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Tetrahedron_3<K>& t,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(t, box);
|
return K().do_intersect_3_object()(t, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,15 +29,17 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
const Triangle_3<K>& tr)
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
|
const Triangle_3<K>& tr)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(box, tr);
|
return K().do_intersect_3_object()(box, tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const Triangle_3<K>& tr,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& box)
|
do_intersect(const Triangle_3<K>& tr,
|
||||||
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(tr, box);
|
return K().do_intersect_3_object()(tr, box);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,4 +34,4 @@ CGAL_INTERSECTION_FUNCTION(Iso_cuboid_3, Triangle_3, 3)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERSECTIONS_3_BBOX_3_TRIANGLE_3_H
|
#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_H
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,8 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
|
typename K::Boolean
|
||||||
do_intersect(const Plane_3<K>& plane1,
|
do_intersect(const Plane_3<K>& plane1,
|
||||||
const Plane_3<K>& plane2,
|
const Plane_3<K>& plane2,
|
||||||
const Plane_3<K>& plane3)
|
const Plane_3<K>& plane3)
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bb,
|
typename K::Boolean
|
||||||
const typename K::Iso_cuboid_3& ic,
|
do_intersect(const CGAL::Bbox_3& bb,
|
||||||
const K& /* k */)
|
const typename K::Iso_cuboid_3& ic,
|
||||||
|
const K& /* k */)
|
||||||
{
|
{
|
||||||
// use CGAL::compare to access the Coercion_traits between K::FT and double
|
// use CGAL::compare to access the Coercion_traits between K::FT and double
|
||||||
if(compare(bb.xmax(), ic.xmin()) == SMALLER || compare(ic.xmax(), bb.xmin()) == SMALLER)
|
if(compare(bb.xmax(), ic.xmin()) == SMALLER || compare(ic.xmax(), bb.xmin()) == SMALLER)
|
||||||
|
|
@ -38,9 +39,10 @@ bool do_intersect(const CGAL::Bbox_3& bb,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& ic,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& bb,
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const K& k)
|
const CGAL::Bbox_3& bb,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(bb, ic, k);
|
return do_intersect(bb, ic, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ namespace CGAL {
|
||||||
namespace Intersections {
|
namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <typename LFT, typename BFT>
|
template <typename K, typename LFT, typename BFT>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
bbox_line_do_intersect_aux(const LFT px, const LFT py, const LFT pz,
|
bbox_line_do_intersect_aux(const LFT px, const LFT py, const LFT pz,
|
||||||
const LFT vx, const LFT vy, const LFT vz,
|
const LFT vx, const LFT vy, const LFT vz,
|
||||||
const BFT bxmin, const BFT bymin, const BFT bzmin,
|
const BFT bxmin, const BFT bymin, const BFT bzmin,
|
||||||
|
|
@ -135,9 +135,10 @@ bbox_line_do_intersect_aux(const LFT px, const LFT py, const LFT pz,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Line_3& line,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& bbox,
|
do_intersect(const typename K::Line_3& line,
|
||||||
const K&)
|
const CGAL::Bbox_3& bbox,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
typedef typename K::Vector_3 Vector_3;
|
typedef typename K::Vector_3 Vector_3;
|
||||||
|
|
@ -145,16 +146,17 @@ bool do_intersect(const typename K::Line_3& line,
|
||||||
const Point_3& point = line.point();
|
const Point_3& point = line.point();
|
||||||
const Vector_3& v = line.to_vector();
|
const Vector_3& v = line.to_vector();
|
||||||
|
|
||||||
return bbox_line_do_intersect_aux(point.x(), point.y(), point.z(),
|
return bbox_line_do_intersect_aux<K>(point.x(), point.y(), point.z(),
|
||||||
v.x(), v.y(), v.z(),
|
v.x(), v.y(), v.z(),
|
||||||
bbox.xmin(), bbox.ymin(), bbox.zmin(),
|
bbox.xmin(), bbox.ymin(), bbox.zmin(),
|
||||||
bbox.xmax(), bbox.ymax(), bbox.zmax());
|
bbox.xmax(), bbox.ymax(), bbox.zmax());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Line_3& line,
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const K& k)
|
const typename K::Line_3& line,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(line, bbox, k);
|
return do_intersect(line, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,17 +22,19 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Plane_3& plane,
|
typename K::Boolean
|
||||||
const Bbox_3& bbox,
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const K& k)
|
const Bbox_3& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_plane_box(plane, bbox, k);
|
return do_intersect_plane_box(plane, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const Bbox_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Plane_3& plane,
|
do_intersect(const Bbox_3& bbox,
|
||||||
const K& k)
|
const typename K::Plane_3& plane,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_plane_box(plane, bbox, k);
|
return do_intersect_plane_box(plane, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Ray_3& ray,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& bbox,
|
do_intersect(const typename K::Ray_3& ray,
|
||||||
const K&)
|
const CGAL::Bbox_3& bbox,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
@ -49,9 +50,10 @@ bool do_intersect(const typename K::Ray_3& ray,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Ray_3& ray,
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const K& k)
|
const typename K::Ray_3& ray,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(ray, bbox, k);
|
return do_intersect(ray, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -224,10 +224,10 @@ do_intersect_bbox_segment_aux(const FT& px, const FT& py, const FT& pz,
|
||||||
|
|
||||||
CGAL_assertion(! is_negative(dmin));
|
CGAL_assertion(! is_negative(dmin));
|
||||||
CGAL_assertion(! is_negative(dmax));
|
CGAL_assertion(! is_negative(dmax));
|
||||||
if(bounded_0) {
|
CGAL_assertion_code(if(bounded_0) {)
|
||||||
CGAL_assertion(! is_negative(tmin));
|
CGAL_assertion(! is_negative(tmin));
|
||||||
CGAL_assertion(! is_negative(tmax));
|
CGAL_assertion(! is_negative(tmax));
|
||||||
}
|
CGAL_assertion_code(})
|
||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
// treat y coord
|
// treat y coord
|
||||||
|
|
@ -365,11 +365,10 @@ do_intersect_bbox_segment_aux(const FT& px, const FT& py, const FT& pz,
|
||||||
|
|
||||||
CGAL_assertion(! is_negative(dzmin));
|
CGAL_assertion(! is_negative(dzmin));
|
||||||
CGAL_assertion(! is_negative(dzmax));
|
CGAL_assertion(! is_negative(dzmax));
|
||||||
if(bounded_0)
|
CGAL_assertion_code(if(bounded_0) {)
|
||||||
{
|
|
||||||
CGAL_assertion(! is_negative(tzmin));
|
CGAL_assertion(! is_negative(tzmin));
|
||||||
CGAL_assertion(! is_negative(tzmax));
|
CGAL_assertion(! is_negative(tzmax));
|
||||||
}
|
CGAL_assertion_code(})
|
||||||
|
|
||||||
typedef Do_intersect_bbox_segment_aux_is_greater<CFT, bounded_0, use_static_filters> Is_greater;
|
typedef Do_intersect_bbox_segment_aux_is_greater<CFT, bounded_0, use_static_filters> Is_greater;
|
||||||
typedef typename Is_greater::result_type Is_greater_value;
|
typedef typename Is_greater::result_type Is_greater_value;
|
||||||
|
|
@ -454,10 +453,9 @@ template <typename FT,
|
||||||
bool use_static_filters>
|
bool use_static_filters>
|
||||||
inline
|
inline
|
||||||
typename Do_intersect_bbox_segment_aux_is_greater<FT, bounded_0, use_static_filters>::result_type
|
typename Do_intersect_bbox_segment_aux_is_greater<FT, bounded_0, use_static_filters>::result_type
|
||||||
do_intersect_bbox_segment_aux(
|
do_intersect_bbox_segment_aux(const FT& px, const FT& py, const FT& pz,
|
||||||
const FT& px, const FT& py, const FT& pz,
|
const FT& qx, const FT& qy, const FT& qz,
|
||||||
const FT& qx, const FT& qy, const FT& qz,
|
const Bbox_3& bb)
|
||||||
const Bbox_3& bb)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
return do_intersect_bbox_segment_aux<FT,double,bounded_0,bounded_1,use_static_filters>(px, py, pz,
|
return do_intersect_bbox_segment_aux<FT,double,bounded_0,bounded_1,use_static_filters>(px, py, pz,
|
||||||
|
|
@ -467,9 +465,10 @@ do_intersect_bbox_segment_aux(
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Segment_3& segment,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& bbox,
|
do_intersect(const typename K::Segment_3& segment,
|
||||||
const K&)
|
const CGAL::Bbox_3& bbox,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
@ -483,9 +482,10 @@ bool do_intersect(const typename K::Segment_3& segment,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Segment_3& segment,
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const K& k)
|
const typename K::Segment_3& segment,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(segment, bbox, k);
|
return do_intersect(segment, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Sphere_3& sphere,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& bbox,
|
do_intersect(const typename K::Sphere_3& sphere,
|
||||||
const K& k)
|
const CGAL::Bbox_3& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_sphere_box_3(sphere,
|
return do_intersect_sphere_box_3(sphere,
|
||||||
bbox.xmin(), bbox.ymin(), bbox.zmin(),
|
bbox.xmin(), bbox.ymin(), bbox.zmin(),
|
||||||
|
|
@ -34,9 +35,10 @@ bool do_intersect(const typename K::Sphere_3& sphere,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Sphere_3& sphere,
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const K& k)
|
const typename K::Sphere_3& sphere,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(sphere, bbox, k);
|
return do_intersect(sphere, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline typename K::Boolean do_intersect(const CGAL::Bbox_3& aabb,
|
inline
|
||||||
const typename K::Tetrahedron_3& tet,
|
typename K::Boolean
|
||||||
const K& k)
|
do_intersect(const CGAL::Bbox_3& aabb,
|
||||||
|
const typename K::Tetrahedron_3& tet,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
typename K::Construct_triangle_3 tr = k.construct_triangle_3_object();
|
typename K::Construct_triangle_3 tr = k.construct_triangle_3_object();
|
||||||
typename K::Boolean result = false;
|
typename K::Boolean result = false;
|
||||||
|
|
@ -57,9 +59,11 @@ inline typename K::Boolean do_intersect(const CGAL::Bbox_3& aabb,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline typename K::Boolean do_intersect(const typename K::Tetrahedron_3& tet,
|
inline
|
||||||
const CGAL::Bbox_3& bb,
|
typename K::Boolean
|
||||||
const K &k)
|
do_intersect(const typename K::Tetrahedron_3& tet,
|
||||||
|
const CGAL::Bbox_3& bb,
|
||||||
|
const K &k)
|
||||||
{
|
{
|
||||||
return do_intersect(bb, tet, k);
|
return do_intersect(bb, tet, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -397,9 +397,10 @@ do_intersect_bbox_or_iso_cuboid_impl(const std::array< std::array<FT, 3>, 3>& tr
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K, class Box3>
|
template <class K, class Box3>
|
||||||
bool do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle,
|
typename K::Boolean
|
||||||
const Box3& a_bbox,
|
do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle,
|
||||||
const K& k)
|
const Box3& a_bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
if(certainly_not(do_bbox_intersect<K>(a_triangle, a_bbox)))
|
if(certainly_not(do_bbox_intersect<K>(a_triangle, a_bbox)))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -423,22 +424,23 @@ bool do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle,
|
||||||
{ a_triangle[2][0], a_triangle[2][1], a_triangle[2][2] }
|
{ a_triangle[2][0], a_triangle[2][1], a_triangle[2][2] }
|
||||||
}};
|
}};
|
||||||
|
|
||||||
// exception will be thrown in case the output is indeterminate
|
|
||||||
return do_intersect_bbox_or_iso_cuboid_impl<FT>(triangle, a_bbox, do_axis_intersect_aux_impl);
|
return do_intersect_bbox_or_iso_cuboid_impl<FT>(triangle, a_bbox, do_axis_intersect_aux_impl);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& triangle,
|
typename K::Boolean
|
||||||
const CGAL::Bbox_3& bbox,
|
do_intersect(const typename K::Triangle_3& triangle,
|
||||||
const K& k)
|
const CGAL::Bbox_3& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& triangle,
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const K& k)
|
const typename K::Triangle_3& triangle,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Iso_cuboid_3& icub1,
|
do_intersect(const typename K::Iso_cuboid_3& icub1,
|
||||||
const typename K::Iso_cuboid_3& icub2,
|
const typename K::Iso_cuboid_3& icub2,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_3& line,
|
do_intersect(const typename K::Line_3& line,
|
||||||
const typename K::Iso_cuboid_3& ic,
|
const typename K::Iso_cuboid_3& ic,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -34,14 +35,15 @@ do_intersect(const typename K::Line_3& line,
|
||||||
const Point_3& point = line.point();
|
const Point_3& point = line.point();
|
||||||
const Vector_3& v = line.to_vector();
|
const Vector_3& v = line.to_vector();
|
||||||
|
|
||||||
return bbox_line_do_intersect_aux(point.x(), point.y(), point.z(),
|
return bbox_line_do_intersect_aux<K>(point.x(), point.y(), point.z(),
|
||||||
v.x(), v.y(), v.z(),
|
v.x(), v.y(), v.z(),
|
||||||
(ic.min)().x(), (ic.min)().y(), (ic.min)().z(),
|
(ic.min)().x(), (ic.min)().y(), (ic.min)().z(),
|
||||||
(ic.max)().x(), (ic.max)().y(), (ic.max)().z());
|
(ic.max)().x(), (ic.max)().y(), (ic.max)().z());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Iso_cuboid_3& ic,
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const typename K::Line_3& l,
|
const typename K::Line_3& l,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -79,15 +79,16 @@ Uncertain<bool> get_min_max(const typename K::Vector_3& p,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K, class Box3> // Iso_cuboid_3 or Bbox_3
|
template <class K, class Box3> // Iso_cuboid_3 or Bbox_3
|
||||||
bool do_intersect_plane_box(const typename K::Plane_3& plane,
|
typename K::Boolean do_intersect_plane_box(const typename K::Plane_3& plane,
|
||||||
const Box3& bbox,
|
const Box3& bbox,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
||||||
Point_3 p_max, p_min;
|
Point_3 p_max, p_min;
|
||||||
Uncertain<bool> b = get_min_max<K>(plane.orthogonal_vector(), bbox, p_min, p_max);
|
Uncertain<bool> b = get_min_max<K>(plane.orthogonal_vector(), bbox, p_min, p_max);
|
||||||
if(is_certain(b)){
|
if(is_certain(b))
|
||||||
|
{
|
||||||
return ! (plane.oriented_side(p_max) == ON_NEGATIVE_SIDE ||
|
return ! (plane.oriented_side(p_max) == ON_NEGATIVE_SIDE ||
|
||||||
plane.oriented_side(p_min) == ON_POSITIVE_SIDE);
|
plane.oriented_side(p_min) == ON_POSITIVE_SIDE);
|
||||||
}
|
}
|
||||||
|
|
@ -114,17 +115,19 @@ bool do_intersect_plane_box(const typename K::Plane_3& plane,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Plane_3& plane,
|
typename K::Boolean
|
||||||
const typename K::Iso_cuboid_3& bbox,
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const K& k)
|
const typename K::Iso_cuboid_3& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_plane_box(plane, bbox, k);
|
return do_intersect_plane_box(plane, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Plane_3& plane,
|
do_intersect(const typename K::Iso_cuboid_3& bbox,
|
||||||
const K& k)
|
const typename K::Plane_3& plane,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_plane_box(plane, bbox, k);
|
return do_intersect_plane_box(plane, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_3& pt,
|
do_intersect(const typename K::Point_3& pt,
|
||||||
const typename K::Iso_cuboid_3& iso,
|
const typename K::Iso_cuboid_3& iso,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Iso_cuboid_3& iso,
|
do_intersect(const typename K::Iso_cuboid_3& iso,
|
||||||
const typename K::Point_3& pt,
|
const typename K::Point_3& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Ray_3& ray,
|
typename K::Boolean
|
||||||
const typename K::Iso_cuboid_3& ic,
|
do_intersect(const typename K::Ray_3& ray,
|
||||||
const K&)
|
const typename K::Iso_cuboid_3& ic,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
@ -51,9 +52,11 @@ bool do_intersect(const typename K::Ray_3& ray,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& ic,
|
typename K::Boolean
|
||||||
const typename K::Ray_3& ray,
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const K& k) {
|
const typename K::Ray_3& ray,
|
||||||
|
const K& k)
|
||||||
|
{
|
||||||
return do_intersect(ray, ic, k);
|
return do_intersect(ray, ic, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Segment_3& seg,
|
typename K::Boolean
|
||||||
const typename K::Iso_cuboid_3& ic,
|
do_intersect(const typename K::Segment_3& seg,
|
||||||
const K&)
|
const typename K::Iso_cuboid_3& ic,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
@ -48,9 +49,10 @@ bool do_intersect(const typename K::Segment_3& seg,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& ic,
|
typename K::Boolean
|
||||||
const typename K::Segment_3& seg,
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const K& k)
|
const typename K::Segment_3& seg,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(seg, ic, k);
|
return do_intersect(seg, ic, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,11 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K, class BFT> // Iso_cuboid_3 or Bbox_3
|
template <class K, class BFT> // Iso_cuboid_3 or Bbox_3
|
||||||
bool do_intersect_sphere_box_3(const typename K::Sphere_3& sphere,
|
typename K::Boolean
|
||||||
const BFT bxmin, const BFT bymin, const BFT bzmin,
|
do_intersect_sphere_box_3(const typename K::Sphere_3& sphere,
|
||||||
const BFT bxmax, const BFT bymax, const BFT bzmax,
|
const BFT bxmin, const BFT bymin, const BFT bzmin,
|
||||||
const K&)
|
const BFT bxmax, const BFT bymax, const BFT bzmax,
|
||||||
|
const K&)
|
||||||
{
|
{
|
||||||
typedef typename K::FT SFT;
|
typedef typename K::FT SFT;
|
||||||
typedef typename Coercion_traits<SFT, BFT>::Type FT;
|
typedef typename Coercion_traits<SFT, BFT>::Type FT;
|
||||||
|
|
@ -94,9 +95,10 @@ bool do_intersect_sphere_box_3(const typename K::Sphere_3& sphere,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Sphere_3& sphere,
|
typename K::Boolean
|
||||||
const typename K::Iso_cuboid_3& ic,
|
do_intersect(const typename K::Sphere_3& sphere,
|
||||||
const K& k)
|
const typename K::Iso_cuboid_3& ic,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_sphere_box_3(sphere,
|
return do_intersect_sphere_box_3(sphere,
|
||||||
(ic.min)().x(), (ic.min)().y(), (ic.min)().z(),
|
(ic.min)().x(), (ic.min)().y(), (ic.min)().z(),
|
||||||
|
|
@ -105,9 +107,10 @@ bool do_intersect(const typename K::Sphere_3& sphere,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& ic,
|
typename K::Boolean
|
||||||
const typename K::Sphere_3& sphere,
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const K& k)
|
const typename K::Sphere_3& sphere,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(sphere, ic, k);
|
return do_intersect(sphere, ic, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,26 +21,25 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& triangle,
|
typename K::Boolean
|
||||||
const typename K::Iso_cuboid_3& bbox,
|
do_intersect(const typename K::Triangle_3& triangle,
|
||||||
const K& k)
|
const typename K::Iso_cuboid_3& bbox,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& bbox,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& triangle,
|
do_intersect(const typename K::Iso_cuboid_3& bbox,
|
||||||
const K& k)
|
const typename K::Triangle_3& triangle,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_DO_INTERSECT_H
|
#endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_TRIANGLE_3_DO_INTERSECT_H
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_3& l1,
|
do_intersect(const typename K::Line_3& l1,
|
||||||
const typename K::Line_3& l2,
|
const typename K::Line_3& l2,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Plane_3& plane,
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const typename K::Line_3& line,
|
const typename K::Line_3& line,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -48,7 +48,7 @@ do_intersect(const typename K::Plane_3& plane,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_3& line,
|
do_intersect(const typename K::Line_3& line,
|
||||||
const typename K::Plane_3& plane,
|
const typename K::Plane_3& plane,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline typename K::Boolean
|
||||||
do_intersect(const typename K::Point_3& pt,
|
do_intersect(const typename K::Point_3& pt,
|
||||||
const typename K::Line_3& line,
|
const typename K::Line_3& line,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -27,7 +27,7 @@ do_intersect(const typename K::Point_3& pt,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline typename K::Boolean
|
||||||
do_intersect(const typename K::Line_3& line,
|
do_intersect(const typename K::Line_3& line,
|
||||||
const typename K::Point_3& pt,
|
const typename K::Point_3& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_3& l,
|
do_intersect(const typename K::Line_3& l,
|
||||||
const typename K::Ray_3& r,
|
const typename K::Ray_3& r,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -47,7 +47,7 @@ do_intersect(const typename K::Line_3& l,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Ray_3& r,
|
do_intersect(const typename K::Ray_3& r,
|
||||||
const typename K::Line_3& l,
|
const typename K::Line_3& l,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_3& l,
|
do_intersect(const typename K::Line_3& l,
|
||||||
const typename K::Segment_3& s,
|
const typename K::Segment_3& s,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -52,7 +52,7 @@ do_intersect(const typename K::Line_3& l,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_3& s,
|
do_intersect(const typename K::Segment_3& s,
|
||||||
const typename K::Line_3& l,
|
const typename K::Line_3& l,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
const typename K::Line_3& l,
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const K& k)
|
const typename K::Line_3& l,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t));
|
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t));
|
||||||
CGAL_kernel_precondition(!k.is_degenerate_3_object()(l));
|
CGAL_kernel_precondition(!k.is_degenerate_3_object()(l));
|
||||||
|
|
@ -73,9 +74,10 @@ bool do_intersect(const typename K::Triangle_3& t,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool do_intersect(const typename K::Line_3& l,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& t,
|
do_intersect(const typename K::Line_3& l,
|
||||||
const K& k)
|
const typename K::Triangle_3& t,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(t, l, k);
|
return do_intersect(t, l, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline typename K::Boolean
|
||||||
do_intersect(const typename K::Plane_3& plane1,
|
do_intersect(const typename K::Plane_3& plane1,
|
||||||
const typename K::Plane_3& plane2,
|
const typename K::Plane_3& plane2,
|
||||||
const typename K::Plane_3& plane3,
|
const typename K::Plane_3& plane3,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline typename K::Boolean
|
||||||
do_intersect(const typename K::Plane_3& plane1,
|
do_intersect(const typename K::Plane_3& plane1,
|
||||||
const typename K::Plane_3& plane2,
|
const typename K::Plane_3& plane2,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline typename K::Boolean
|
||||||
do_intersect(const typename K::Point_3& pt,
|
do_intersect(const typename K::Point_3& pt,
|
||||||
const typename K::Plane_3& plane,
|
const typename K::Plane_3& plane,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -27,7 +27,7 @@ do_intersect(const typename K::Point_3& pt,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline typename K::Boolean
|
||||||
do_intersect(const typename K::Plane_3& plane,
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const typename K::Point_3& pt,
|
const typename K::Point_3& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Plane_3& plane,
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const typename K::Ray_3& ray,
|
const typename K::Ray_3& ray,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -40,7 +40,7 @@ do_intersect(const typename K::Plane_3& plane,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Ray_3& ray,
|
do_intersect(const typename K::Ray_3& ray,
|
||||||
const typename K::Plane_3& plane,
|
const typename K::Plane_3& plane,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Plane_3& plane,
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const typename K::Segment_3& seg,
|
const typename K::Segment_3& seg,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -41,7 +41,7 @@ do_intersect(const typename K::Plane_3& plane,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_3& seg,
|
do_intersect(const typename K::Segment_3& seg,
|
||||||
const typename K::Plane_3& plane,
|
const typename K::Plane_3& plane,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Plane_3& p,
|
do_intersect(const typename K::Plane_3& p,
|
||||||
const typename K::Sphere_3& s,
|
const typename K::Sphere_3& s,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -37,7 +37,7 @@ do_intersect(const typename K::Plane_3& p,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Sphere_3& s,
|
do_intersect(const typename K::Sphere_3& s,
|
||||||
const typename K::Plane_3& p,
|
const typename K::Plane_3& p,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
const typename K::Plane_3& h,
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const K& k)
|
const typename K::Plane_3& h,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t));
|
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t));
|
||||||
CGAL_kernel_precondition(!k.is_degenerate_3_object()(h));
|
CGAL_kernel_precondition(!k.is_degenerate_3_object()(h));
|
||||||
|
|
@ -49,9 +50,10 @@ bool do_intersect(const typename K::Triangle_3& t,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool do_intersect(const typename K::Plane_3& h,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& t,
|
do_intersect(const typename K::Plane_3& h,
|
||||||
const K& k)
|
const typename K::Triangle_3& t,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(t, h, k);
|
return do_intersect(t, h, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_3& pt,
|
do_intersect(const typename K::Point_3& pt,
|
||||||
const typename K::Ray_3& ray,
|
const typename K::Ray_3& ray,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Ray_3& ray,
|
do_intersect(const typename K::Ray_3& ray,
|
||||||
const typename K::Point_3& pt,
|
const typename K::Point_3& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -39,7 +39,7 @@ do_intersect(const typename K::Ray_3& ray,
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
typename K::Boolean
|
||||||
Ray_3_has_on_collinear_Point_3(const typename K::Ray_3& r,
|
Ray_3_has_on_collinear_Point_3(const typename K::Ray_3& r,
|
||||||
const typename K::Point_3& p,
|
const typename K::Point_3& p,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_3& pt,
|
do_intersect(const typename K::Point_3& pt,
|
||||||
const typename K::Segment_3& seg,
|
const typename K::Segment_3& seg,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_3& seg,
|
do_intersect(const typename K::Segment_3& seg,
|
||||||
const typename K::Point_3& pt,
|
const typename K::Point_3& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_3& pt,
|
do_intersect(const typename K::Point_3& pt,
|
||||||
const typename K::Sphere_3& sphere,
|
const typename K::Sphere_3& sphere,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Sphere_3& sphere,
|
do_intersect(const typename K::Sphere_3& sphere,
|
||||||
const typename K::Point_3& pt,
|
const typename K::Point_3& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_3& pt,
|
do_intersect(const typename K::Point_3& pt,
|
||||||
const typename K::Tetrahedron_3& tetrahedron,
|
const typename K::Tetrahedron_3& tetrahedron,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -29,7 +29,7 @@ do_intersect(const typename K::Point_3& pt,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Tetrahedron_3& tetrahedron,
|
do_intersect(const typename K::Tetrahedron_3& tetrahedron,
|
||||||
const typename K::Point_3& pt,
|
const typename K::Point_3& pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,10 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
const typename K::Point_3& p,
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const K& k)
|
const typename K::Point_3& p,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t));
|
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t));
|
||||||
|
|
||||||
|
|
@ -68,9 +69,10 @@ bool do_intersect(const typename K::Triangle_3& t,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Point_3& p,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& t,
|
do_intersect(const typename K::Point_3& p,
|
||||||
const K& k)
|
const typename K::Triangle_3& t,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(t, p, k);
|
return do_intersect(t, p, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Ray_3& r1,
|
do_intersect(const typename K::Ray_3& r1,
|
||||||
const typename K::Ray_3& r2,
|
const typename K::Ray_3& r2,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_3& s,
|
do_intersect(const typename K::Segment_3& s,
|
||||||
const typename K::Ray_3& r,
|
const typename K::Ray_3& r,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
@ -56,7 +56,7 @@ do_intersect(const typename K::Segment_3& s,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Ray_3& r,
|
do_intersect(const typename K::Ray_3& r,
|
||||||
const typename K::Segment_3& s,
|
const typename K::Segment_3& s,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -328,18 +328,20 @@ do_intersect(const typename K::Triangle_3& t,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
const typename K::Ray_3& r,
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const K& k)
|
const typename K::Ray_3& r,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(t, r, k, r3t3_do_intersect_empty_visitor());
|
return do_intersect(t, r, k, r3t3_do_intersect_empty_visitor());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool do_intersect(const typename K::Ray_3& r,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& t,
|
do_intersect(const typename K::Ray_3& r,
|
||||||
const K& k)
|
const typename K::Triangle_3& t,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(t, r, k);
|
return do_intersect(t, r, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Segment_3& s1,
|
do_intersect(const typename K::Segment_3& s1,
|
||||||
const typename K::Segment_3& s2,
|
const typename K::Segment_3& s2,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A,
|
||||||
const typename K::Point_3& B,
|
const typename K::Point_3& B,
|
||||||
const typename K::Point_3& C,
|
const typename K::Point_3& C,
|
||||||
const typename K::Point_3& p,
|
const typename K::Point_3& p,
|
||||||
const typename K::Point_3& q, const K& k)
|
const typename K::Point_3& q,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
||||||
|
|
@ -173,9 +174,10 @@ bool do_intersect_coplanar(const typename K::Triangle_3& t,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
const typename K::Segment_3& s,
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const K& k)
|
const typename K::Segment_3& s,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t) );
|
CGAL_kernel_precondition(!k.is_degenerate_3_object()(t) );
|
||||||
CGAL_kernel_precondition(!k.is_degenerate_3_object()(s) );
|
CGAL_kernel_precondition(!k.is_degenerate_3_object()(s) );
|
||||||
|
|
@ -269,9 +271,10 @@ bool do_intersect(const typename K::Triangle_3& t,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool do_intersect(const typename K::Segment_3& s,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& t,
|
do_intersect(const typename K::Segment_3& s,
|
||||||
const K& k)
|
const typename K::Triangle_3& t,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
return do_intersect(t, s, k);
|
return do_intersect(t, s, k);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Sphere_3& s1,
|
do_intersect(const typename K::Sphere_3& s1,
|
||||||
const typename K::Sphere_3& s2,
|
const typename K::Sphere_3& s2,
|
||||||
const K& k)
|
const K& k)
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,14 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool _intersection_test_vertex(const typename K::Point_3* p,
|
typename K::Boolean
|
||||||
const typename K::Point_3* q,
|
_intersection_test_vertex(const typename K::Point_3* p,
|
||||||
const typename K::Point_3* r,
|
const typename K::Point_3* q,
|
||||||
const typename K::Point_3* a,
|
const typename K::Point_3* r,
|
||||||
const typename K::Point_3* b,
|
const typename K::Point_3* a,
|
||||||
const typename K::Point_3* c,
|
const typename K::Point_3* b,
|
||||||
const K& k)
|
const typename K::Point_3* c,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
CGAL_kernel_precondition(k.coplanar_orientation_3_object()(*p,*q,*r) == POSITIVE);
|
CGAL_kernel_precondition(k.coplanar_orientation_3_object()(*p,*q,*r) == POSITIVE);
|
||||||
CGAL_kernel_precondition(k.coplanar_orientation_3_object()(*a,*b,*c) == POSITIVE);
|
CGAL_kernel_precondition(k.coplanar_orientation_3_object()(*a,*b,*c) == POSITIVE);
|
||||||
|
|
@ -64,13 +65,14 @@ bool _intersection_test_vertex(const typename K::Point_3* p,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool _intersection_test_edge(const typename K::Point_3* p,
|
typename K::Boolean
|
||||||
const typename K::Point_3* q,
|
_intersection_test_edge(const typename K::Point_3* p,
|
||||||
const typename K::Point_3* r,
|
const typename K::Point_3* q,
|
||||||
const typename K::Point_3* a,
|
const typename K::Point_3* r,
|
||||||
const typename K::Point_3* CGAL_kernel_precondition_code(b),
|
const typename K::Point_3* a,
|
||||||
const typename K::Point_3* c,
|
const typename K::Point_3* CGAL_kernel_precondition_code(b),
|
||||||
const K& k)
|
const typename K::Point_3* c,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
CGAL_kernel_precondition(k.coplanar_orientation_3_object() (*p,*q,*r) == POSITIVE);
|
CGAL_kernel_precondition(k.coplanar_orientation_3_object() (*p,*q,*r) == POSITIVE);
|
||||||
CGAL_kernel_precondition(k.coplanar_orientation_3_object() (*a,*b,*c) == POSITIVE);
|
CGAL_kernel_precondition(k.coplanar_orientation_3_object() (*a,*b,*c) == POSITIVE);
|
||||||
|
|
@ -97,9 +99,10 @@ bool _intersection_test_edge(const typename K::Point_3* p,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect_coplanar(const typename K::Triangle_3& t1,
|
typename K::Boolean
|
||||||
const typename K::Triangle_3& t2,
|
do_intersect_coplanar(const typename K::Triangle_3& t1,
|
||||||
const K& k)
|
const typename K::Triangle_3& t2,
|
||||||
|
const K& k)
|
||||||
{
|
{
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@
|
||||||
// Author(s) : Stephane Tayeb
|
// Author(s) : Stephane Tayeb
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <CGAL/config.h>
|
#include <CGAL/config.h>
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
#if defined(BOOST_MSVC)
|
||||||
|
|
@ -22,17 +20,19 @@
|
||||||
|
|
||||||
// leda_rational, or Gmpq, or Quotient<MP_float>
|
// leda_rational, or Gmpq, or Quotient<MP_float>
|
||||||
typedef CGAL::Exact_rational Rational;
|
typedef CGAL::Exact_rational Rational;
|
||||||
|
|
||||||
#include <CGAL/Cartesian.h>
|
#include <CGAL/Cartesian.h>
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
#include <CGAL/Kernel_traits.h>
|
#include <CGAL/Kernel_traits.h>
|
||||||
|
#include <CGAL/intersection_3.h>
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
#include <boost/math/special_functions/next.hpp> // for nextafter
|
#include <boost/math/special_functions/next.hpp> // for nextafter
|
||||||
|
|
||||||
|
#include <iomanip>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
double random_in(const double a,
|
double random_in(const double a,
|
||||||
const double b)
|
const double b)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#ifndef CGAL_KERNEL_FUNCTION_OBJECTS_H
|
#ifndef CGAL_KERNEL_FUNCTION_OBJECTS_H
|
||||||
#define CGAL_KERNEL_FUNCTION_OBJECTS_H
|
#define CGAL_KERNEL_FUNCTION_OBJECTS_H
|
||||||
|
|
||||||
|
#include <CGAL/tags.h>
|
||||||
#include <CGAL/Origin.h>
|
#include <CGAL/Origin.h>
|
||||||
#include <CGAL/Bbox_2.h>
|
#include <CGAL/Bbox_2.h>
|
||||||
#include <CGAL/Bbox_3.h>
|
#include <CGAL/Bbox_3.h>
|
||||||
|
|
@ -30,7 +31,6 @@
|
||||||
#include <CGAL/Kernel/Return_base_tag.h>
|
#include <CGAL/Kernel/Return_base_tag.h>
|
||||||
#include <CGAL/Kernel/global_functions_3.h>
|
#include <CGAL/Kernel/global_functions_3.h>
|
||||||
|
|
||||||
|
|
||||||
#include <cmath> // for Compute_dihedral_angle
|
#include <cmath> // for Compute_dihedral_angle
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -736,11 +736,12 @@ namespace CommonKernelFunctors {
|
||||||
|
|
||||||
typedef Comparison_result result_type;
|
typedef Comparison_result result_type;
|
||||||
|
|
||||||
result_type operator()(const Weighted_point_3 & p,
|
Needs_FT<result_type>
|
||||||
const Weighted_point_3 & q,
|
operator()(const Weighted_point_3 & p,
|
||||||
const Weighted_point_3 & r,
|
const Weighted_point_3 & q,
|
||||||
const Weighted_point_3 & s,
|
const Weighted_point_3 & r,
|
||||||
const FT& w) const
|
const Weighted_point_3 & s,
|
||||||
|
const FT& w) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_radius_orthogonal_sphereC3(
|
return CGAL::compare(squared_radius_orthogonal_sphereC3(
|
||||||
p.x(),p.y(),p.z(),p.weight(),
|
p.x(),p.y(),p.z(),p.weight(),
|
||||||
|
|
@ -750,10 +751,11 @@ namespace CommonKernelFunctors {
|
||||||
w);
|
w);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type operator()(const Weighted_point_3 & p,
|
Needs_FT<result_type>
|
||||||
const Weighted_point_3 & q,
|
operator()(const Weighted_point_3 & p,
|
||||||
const Weighted_point_3 & r,
|
const Weighted_point_3 & q,
|
||||||
const FT& w) const
|
const Weighted_point_3 & r,
|
||||||
|
const FT& w) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3(
|
return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3(
|
||||||
p.x(),p.y(),p.z(),p.weight(),
|
p.x(),p.y(),p.z(),p.weight(),
|
||||||
|
|
@ -762,9 +764,10 @@ namespace CommonKernelFunctors {
|
||||||
w);
|
w);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type operator()(const Weighted_point_3 & p,
|
Needs_FT<result_type>
|
||||||
const Weighted_point_3 & q,
|
operator()(const Weighted_point_3 & p,
|
||||||
const FT& w) const
|
const Weighted_point_3 & q,
|
||||||
|
const FT& w) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3(
|
return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3(
|
||||||
p.x(),p.y(),p.z(),p.weight(),
|
p.x(),p.y(),p.z(),p.weight(),
|
||||||
|
|
@ -817,17 +820,18 @@ namespace CommonKernelFunctors {
|
||||||
typedef typename K::Comparison_result result_type;
|
typedef typename K::Comparison_result result_type;
|
||||||
|
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const FT& d2) const
|
operator()(const T1& p, const T2& q, const FT& d2) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), d2);
|
return CGAL::compare(internal::squared_distance(p, q, K()), d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T1, class T2, class T3, class T4>
|
template <class T1, class T2, class T3, class T4>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
|
return CGAL::compare(internal::squared_distance(p, q, K()),
|
||||||
|
internal::squared_distance(r, s, K()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -839,17 +843,18 @@ namespace CommonKernelFunctors {
|
||||||
typedef typename K::Comparison_result result_type;
|
typedef typename K::Comparison_result result_type;
|
||||||
|
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const FT& d2) const
|
operator()(const T1& p, const T2& q, const FT& d2) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), d2);
|
return CGAL::compare(internal::squared_distance(p, q, K()), d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T1, class T2, class T3, class T4>
|
template <class T1, class T2, class T3, class T4>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
|
||||||
{
|
{
|
||||||
return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
|
return CGAL::compare(internal::squared_distance(p, q, K()),
|
||||||
|
internal::squared_distance(r, s, K()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -3018,10 +3023,11 @@ namespace CommonKernelFunctors {
|
||||||
public:
|
public:
|
||||||
typedef typename K::Boolean result_type;
|
typedef typename K::Boolean result_type;
|
||||||
|
|
||||||
|
// Needs_FT because Line/Line (and variations) as well as Circle_2/X compute intersections
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
result_type
|
Needs_FT<result_type>
|
||||||
operator()(const T1& t1, const T2& t2) const
|
operator()(const T1& t1, const T2& t2) const
|
||||||
{ return Intersections::internal::do_intersect(t1, t2, K()); }
|
{ return { Intersections::internal::do_intersect(t1, t2, K())}; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename K>
|
template <typename K>
|
||||||
|
|
@ -3035,10 +3041,12 @@ namespace CommonKernelFunctors {
|
||||||
operator()(const T1& t1, const T2& t2) const
|
operator()(const T1& t1, const T2& t2) const
|
||||||
{ return Intersections::internal::do_intersect(t1, t2, K()); }
|
{ return Intersections::internal::do_intersect(t1, t2, K()); }
|
||||||
|
|
||||||
result_type
|
result_type operator()(const typename K::Plane_3& pl1,
|
||||||
operator()(const typename K::Plane_3& pl1, const typename K::Plane_3& pl2, const typename K::Plane_3& pl3) const
|
const typename K::Plane_3& pl2,
|
||||||
{ return Intersections::internal::do_intersect(pl1, pl2, pl3, K() ); }
|
const typename K::Plane_3& pl3) const
|
||||||
|
{
|
||||||
|
return Intersections::internal::do_intersect(pl1, pl2, pl3, K());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename K>
|
template <typename K>
|
||||||
|
|
@ -3328,8 +3336,10 @@ namespace CommonKernelFunctors {
|
||||||
return c.rep().has_on_bounded_side(p);
|
return c.rep().has_on_bounded_side(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type operator()(const Sphere_3& s1, const Sphere_3& s2,
|
// returns true iff the line segment ab is inside the union of the bounded sides of s1 and s2.
|
||||||
const Point_3& a, const Point_3& b) const
|
Needs_FT<result_type>
|
||||||
|
operator()(const Sphere_3& s1, const Sphere_3& s2,
|
||||||
|
const Point_3& a, const Point_3& b) const
|
||||||
{
|
{
|
||||||
typedef typename K::Circle_3 Circle_3;
|
typedef typename K::Circle_3 Circle_3;
|
||||||
typedef typename K::Point_3 Point_3;
|
typedef typename K::Point_3 Point_3;
|
||||||
|
|
@ -3341,27 +3351,23 @@ namespace CommonKernelFunctors {
|
||||||
const bool a_in_s1 = has_on_bounded_side(s1, a);
|
const bool a_in_s1 = has_on_bounded_side(s1, a);
|
||||||
const bool a_in_s2 = has_on_bounded_side(s2, a);
|
const bool a_in_s2 = has_on_bounded_side(s2, a);
|
||||||
|
|
||||||
if(!(a_in_s1 || a_in_s2)) return false;
|
if(!(a_in_s1 || a_in_s2)) return {false};
|
||||||
|
|
||||||
const bool b_in_s1 = has_on_bounded_side(s1, b);
|
const bool b_in_s1 = has_on_bounded_side(s1, b);
|
||||||
const bool b_in_s2 = has_on_bounded_side(s2, b);
|
const bool b_in_s2 = has_on_bounded_side(s2, b);
|
||||||
|
|
||||||
if(!(b_in_s1 || b_in_s2)) return false;
|
if(!(b_in_s1 || b_in_s2)) return {false};
|
||||||
|
|
||||||
if(a_in_s1 && b_in_s1) return true;
|
if(a_in_s1 && b_in_s1) return {true};
|
||||||
if(a_in_s2 && b_in_s2) return true;
|
if(a_in_s2 && b_in_s2) return {true};
|
||||||
|
|
||||||
if(!K().do_intersect_3_object()(s1, s2)) return false;
|
if(!K().do_intersect_3_object()(s1, s2)) return {false};
|
||||||
const Circle_3 circ(s1, s2);
|
const Circle_3 circ(s1, s2);
|
||||||
const Plane_3& plane = circ.supporting_plane();
|
const Plane_3& plane = circ.supporting_plane();
|
||||||
const auto optional = K().intersect_3_object()(plane, Segment_3(a, b));
|
const auto optional = K().intersect_3_object()(plane, Segment_3(a, b));
|
||||||
CGAL_kernel_assertion_msg(bool(optional) == true,
|
CGAL_kernel_assertion_msg(bool(optional) == true, "the segment does not intersect the supporting plane");
|
||||||
"the segment does not intersect the supporting"
|
|
||||||
" plane");
|
|
||||||
const Point_3* p = boost::get<Point_3>(&*optional);
|
const Point_3* p = boost::get<Point_3>(&*optional);
|
||||||
CGAL_kernel_assertion_msg(p != 0,
|
CGAL_kernel_assertion_msg(p != 0, "the segment intersection with the plane is not a point");
|
||||||
"the segment intersection with the plane is "
|
|
||||||
"not a point");
|
|
||||||
return squared_distance(circ.center(), *p) < circ.squared_radius();
|
return squared_distance(circ.center(), *p) < circ.squared_radius();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue