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;
|
||||||
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
q.x(), q.y(), q.z(),
|
q.x(), q.y(), q.z(),
|
||||||
r.x(), r.y(), r.z(),
|
r.x(), r.y(), r.z(),
|
||||||
s.x(), s.y(), s.z() ),
|
s.x(), s.y(), s.z(),
|
||||||
ft);
|
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;
|
||||||
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
q.x(), q.y(), q.z(),
|
q.x(), q.y(), q.z(),
|
||||||
r.x(), r.y(), r.z()),
|
r.x(), r.y(), r.z(),
|
||||||
ft);
|
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;
|
||||||
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
q.x(), q.y(), q.z(),
|
q.x(), q.y(), q.z(),
|
||||||
r.x(), r.y(), r.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;
|
||||||
|
squared_radiusC3(p.x(), p.y(), p.z(),
|
||||||
q.x(), q.y(), q.z(),
|
q.x(), q.y(), q.z(),
|
||||||
r.x(), r.y(), r.z(),
|
r.x(), r.y(), r.z(),
|
||||||
s.x(), s.y(), s.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;
|
||||||
|
|
@ -171,21 +172,22 @@ squared_radiusC3(const FT &px, const FT &py, const FT &pz,
|
||||||
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,13 +86,6 @@ 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);
|
||||||
|
|
@ -110,6 +105,74 @@ Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
||||||
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)...);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
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
|
} // namespace CGAL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,16 +24,17 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
const typename K::Circle_2& circle,
|
const typename K::Circle_2& circle,
|
||||||
const K&)
|
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
|
||||||
|
do_intersect(const typename K::Circle_2& circle,
|
||||||
const CGAL::Bbox_2& bbox,
|
const CGAL::Bbox_2& bbox,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -44,14 +45,16 @@ 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
|
||||||
|
do_intersect(const CGAL::Bbox_2& a,
|
||||||
const Circle_2<K>& b)
|
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
|
||||||
|
do_intersect(const Circle_2<K>& a,
|
||||||
const CGAL::Bbox_2& b)
|
const CGAL::Bbox_2& b)
|
||||||
{
|
{
|
||||||
return K().do_intersect_2_object()(a, b);
|
return K().do_intersect_2_object()(a, b);
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,18 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template <typename K>
|
template <typename K>
|
||||||
inline bool do_intersect(const Iso_rectangle_2<K> &rect,
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const Iso_rectangle_2<K>& rect,
|
||||||
const Bbox_2& box)
|
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
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const Bbox_2 &box,
|
||||||
const Iso_rectangle_2<K> &rect)
|
const Iso_rectangle_2<K> &rect)
|
||||||
{
|
{
|
||||||
return do_intersect(rect, box);
|
return do_intersect(rect, box);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Line_2& line,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Line_2& line,
|
||||||
const CGAL::Bbox_2& bbox,
|
const CGAL::Bbox_2& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -36,7 +37,8 @@ bool do_intersect(const typename K::Line_2& line,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
const typename K::Line_2& line,
|
const typename K::Line_2& line,
|
||||||
const K& k)
|
const K& 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,7 +24,9 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const Bbox_2 &bbox,
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const Bbox_2 &bbox,
|
||||||
const Point_2<K> &pt,
|
const Point_2<K> &pt,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -36,7 +38,9 @@ inline bool do_intersect(const Bbox_2 &bbox,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const Point_2<K> &pt,
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const Point_2<K> &pt,
|
||||||
const Bbox_2& bbox,
|
const Bbox_2& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -69,14 +73,16 @@ 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
|
||||||
|
do_intersect(const CGAL::Bbox_2& a,
|
||||||
const Point_2<K>& b)
|
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
|
||||||
|
do_intersect(const Point_2<K>& a,
|
||||||
const CGAL::Bbox_2& b)
|
const CGAL::Bbox_2& b)
|
||||||
{
|
{
|
||||||
return Intersections::internal::do_intersect(b,a,K());
|
return Intersections::internal::do_intersect(b,a,K());
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Ray_2& ray,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Ray_2& ray,
|
||||||
const CGAL::Bbox_2& bbox,
|
const CGAL::Bbox_2& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -36,7 +37,8 @@ bool do_intersect(const typename K::Ray_2& ray,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_2& bbox,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_2& bbox,
|
||||||
const typename K::Ray_2& ray,
|
const typename K::Ray_2& ray,
|
||||||
const K& k)
|
const K& 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,10 +20,10 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Segment_2<K> &seg,
|
typename K::Boolean
|
||||||
|
do_intersect(const Segment_2<K>& seg,
|
||||||
const Bbox_2& box)
|
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());
|
||||||
|
|
@ -31,8 +31,9 @@ inline bool do_intersect(
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Bbox_2 &box,
|
typename K::Boolean
|
||||||
|
do_intersect(const Bbox_2& box,
|
||||||
const Segment_2<K>& seg)
|
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,10 +20,10 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Triangle_2<K> &tr,
|
typename K::Boolean
|
||||||
|
do_intersect(const Triangle_2<K>& tr,
|
||||||
const Bbox_2& box)
|
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());
|
||||||
|
|
@ -31,8 +31,9 @@ inline bool do_intersect(
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const Bbox_2 &box,
|
typename K::Boolean
|
||||||
|
do_intersect(const Bbox_2& box,
|
||||||
const Triangle_2<K>& tr)
|
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,7 +27,7 @@ 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&)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ 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&)
|
||||||
{
|
{
|
||||||
|
|
@ -92,16 +92,15 @@ 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&)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,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::Line_2& l,
|
const typename K::Line_2& l,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -38,7 +38,7 @@ 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&)
|
||||||
|
|
@ -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,7 +25,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::Circle_2& circle,
|
const typename K::Circle_2& circle,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -33,10 +33,9 @@ do_intersect(const typename K::Point_2 &pt,
|
||||||
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&)
|
||||||
|
|
@ -74,4 +73,5 @@ 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,7 +24,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::Ray_2& r,
|
const typename K::Ray_2& r,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -33,7 +33,7 @@ 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&)
|
||||||
|
|
@ -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,7 +24,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::Segment_2& s,
|
const typename K::Segment_2& s,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -33,7 +33,7 @@ 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&)
|
||||||
|
|
@ -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,7 +48,7 @@ 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&)
|
||||||
|
|
@ -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
|
||||||
|
do_intersect(const typename K::Line_2& l,
|
||||||
|
const typename K::Iso_rectangle_2& ir,
|
||||||
const K&)
|
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
|
||||||
|
do_intersect(const typename K::Iso_rectangle_2& ir,
|
||||||
|
const typename K::Line_2& l,
|
||||||
const K& k)
|
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,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::Iso_rectangle_2& iso,
|
const typename K::Iso_rectangle_2& iso,
|
||||||
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::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&)
|
||||||
|
|
@ -79,4 +79,4 @@ 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
|
||||||
|
do_intersect(const typename K::Ray_2& r,
|
||||||
|
const typename K::Iso_rectangle_2& ir,
|
||||||
const K&)
|
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
|
||||||
|
do_intersect(const typename K::Iso_rectangle_2& ir,
|
||||||
|
const typename K::Ray_2& r,
|
||||||
const K& k)
|
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,19 +193,28 @@ 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>
|
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::Segment_2& s,
|
||||||
|
const typename K::Iso_rectangle_2& ir,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Segment_2_Iso_rectangle_2_pair<K> pair_t;
|
typedef Segment_2_Iso_rectangle_2_pair<K> pair_t;
|
||||||
pair_t pair(&p2, &p1);
|
pair_t pair(&s, &ir);
|
||||||
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::Iso_rectangle_2& ir,
|
||||||
|
const typename K::Segment_2& s,
|
||||||
|
const K& k)
|
||||||
|
{
|
||||||
|
return do_intersect(s, ir, k);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -292,8 +292,8 @@ 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)
|
||||||
{
|
{
|
||||||
|
|
@ -318,8 +318,9 @@ namespace internal {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Iso_rectangle_2 &ir,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Iso_rectangle_2& ir,
|
||||||
const typename K::Triangle_2& tr,
|
const typename K::Triangle_2& tr,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -332,6 +333,6 @@ namespace internal {
|
||||||
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,19 +52,20 @@ protected:
|
||||||
mutable typename K::Point_2 _intersection_point;
|
mutable typename K::Point_2 _intersection_point;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(
|
inline
|
||||||
const typename K::Line_2 &p1,
|
typename K::Boolean
|
||||||
const typename K::Line_2 &p2,
|
do_intersect(const typename K::Line_2& l1,
|
||||||
|
const typename K::Line_2& l2,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
typedef Line_2_Line_2_pair<K> pair_t;
|
typedef Line_2_Line_2_pair<K> pair_t;
|
||||||
pair_t pair(&p1, &p2);
|
pair_t pair(&l1, &l2);
|
||||||
return pair.intersection_type() != pair_t::NO_INTERSECTION;
|
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::Line_2, typename K::Line_2>::result_type
|
<K, typename K::Line_2, typename K::Line_2>::result_type
|
||||||
|
|
@ -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
|
#endif // CGAL_INTERSECTIONS_2_LINE_2_LINE_2_H
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_2& pt,
|
do_intersect(const typename K::Point_2& pt,
|
||||||
const typename K::Line_2& line,
|
const typename K::Line_2& line,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -38,7 +39,8 @@ do_intersect(const typename K::Point_2 &pt,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Line_2& line,
|
do_intersect(const typename K::Line_2& line,
|
||||||
const typename K::Point_2& pt,
|
const typename K::Point_2& pt,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -78,4 +80,4 @@ 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 typename K::Line_2& l,
|
||||||
const K&)
|
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,16 +51,27 @@ 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 typename K::Line_2& l,
|
||||||
const K& )
|
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>
|
||||||
typename CGAL::Intersection_traits
|
typename CGAL::Intersection_traits
|
||||||
<K, typename K::Segment_2, typename K::Line_2>::result_type
|
<K, typename K::Segment_2, typename K::Line_2>::result_type
|
||||||
|
|
@ -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
|
#endif // CGAL_INTERSECTIONS_2_SEGMENT_2_LINE_2_H
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -192,4 +192,4 @@ CGAL_DO_INTERSECT_FUNCTION(Line_2, Triangle_2, 2)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_LINE_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -28,24 +28,24 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool
|
inline
|
||||||
|
typename K::Boolean
|
||||||
do_intersect(const typename K::Point_2& pt1,
|
do_intersect(const typename K::Point_2& pt1,
|
||||||
const typename K::Point_2& pt2,
|
const typename K::Point_2& pt2,
|
||||||
const K&)
|
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&)
|
const K& 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>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,7 +55,6 @@ intersection(const typename K::Point_2 &pt1,
|
||||||
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
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_POINT_2_H
|
||||||
|
|
|
||||||
|
|
@ -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::Ray_2& ray,
|
const typename K::Ray_2& ray,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -41,7 +41,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::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&)
|
||||||
|
|
@ -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
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_RAY_2_H
|
||||||
|
|
|
||||||
|
|
@ -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,7 +50,9 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline bool do_intersect(const typename K::Point_2 &p1,
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Point_2& p1,
|
||||||
const typename K::Triangle_2& p2,
|
const typename K::Triangle_2& p2,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -60,7 +62,9 @@ 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
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Triangle_2& p2,
|
||||||
const typename K::Point_2& p1,
|
const typename K::Point_2& p1,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -135,4 +139,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_2, Triangle_2, 2)
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif
|
#endif // CGAL_INTERSECTIONS_2_POINT_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -54,13 +54,14 @@ 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 typename K::Ray_2& r2,
|
||||||
const K&)
|
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
|
#endif // CGAL_INTERSECTIONS_2_RAY_2_RAY_2_H
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
do_intersect(const typename K::Ray_2& r,
|
||||||
|
const typename K::Segment_2& s,
|
||||||
const K&)
|
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
|
||||||
|
do_intersect(const typename K::Segment_2& s,
|
||||||
|
const typename K::Ray_2& r,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
return internal::do_intersect(p1, p2, k);
|
return internal::do_intersect(r, s, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
|
|
@ -267,4 +271,4 @@ 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 typename K::Triangle_2& tr,
|
||||||
const K&)
|
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
|
#endif // CGAL_INTERSECTIONS_2_RAY_2_TRIANGLE_2_H
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -494,4 +493,4 @@ 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 typename K::Triangle_2& tr,
|
||||||
const K&)
|
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,18 +181,6 @@ 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
|
||||||
|
|
||||||
|
|
@ -194,4 +189,4 @@ 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
|
||||||
|
|
||||||
|
|
@ -348,4 +347,4 @@ collinear_order(typename K::Point_2 const &pt1, typename K::Point_2 const & pt2)
|
||||||
} // 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
|
||||||
|
intersection_test_vertex(const typename K::Point_2* P1,
|
||||||
const typename K::Point_2* Q1,
|
const typename K::Point_2* Q1,
|
||||||
const typename K::Point_2* R1,
|
const typename K::Point_2* R1,
|
||||||
const typename K::Point_2* P2,
|
const typename K::Point_2* P2,
|
||||||
const typename K::Point_2* Q2,
|
const typename K::Point_2* 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)
|
||||||
|
|
@ -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
|
||||||
|
intersection_test_edge(const typename K::Point_2* P1,
|
||||||
const typename K::Point_2* Q1,
|
const typename K::Point_2* Q1,
|
||||||
const typename K::Point_2* R1,
|
const typename K::Point_2* R1,
|
||||||
const typename K::Point_2* P2,
|
const typename K::Point_2* P2,
|
||||||
const typename K::Point_2 *
|
const typename K::Point_2* CGAL_kernel_precondition_code(Q2),
|
||||||
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
|
||||||
|
do_intersect(const typename K::Triangle_2& t1,
|
||||||
const typename K::Triangle_2& t2,
|
const typename K::Triangle_2& t2,
|
||||||
const K & k ){
|
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) );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,14 +30,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Iso_cuboid_3<K>& ic)
|
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
|
||||||
|
do_intersect(const Iso_cuboid_3<K>& ic,
|
||||||
const CGAL::Bbox_3& box)
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(ic, box);
|
return K().do_intersect_3_object()(ic, box);
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Line_3<K>& l)
|
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
|
||||||
|
do_intersect(const Line_3<K>& l,
|
||||||
const CGAL::Bbox_3& box)
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(l, box);
|
return K().do_intersect_3_object()(l, box);
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Plane_3<K>& pl)
|
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
|
||||||
|
do_intersect(const Plane_3<K>& pl,
|
||||||
const CGAL::Bbox_3& box)
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(pl, box);
|
return K().do_intersect_3_object()(pl, box);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,8 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Point_3<K>& p)
|
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()),
|
||||||
|
|
@ -40,7 +41,8 @@ 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
|
||||||
|
do_intersect(const Point_3<K>& a,
|
||||||
const CGAL::Bbox_3& b)
|
const CGAL::Bbox_3& b)
|
||||||
{
|
{
|
||||||
return do_intersect(b,a);
|
return do_intersect(b,a);
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Ray_3<K>& r)
|
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
|
||||||
|
do_intersect(const Ray_3<K>& r,
|
||||||
const CGAL::Bbox_3& box)
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(r, box);
|
return K().do_intersect_3_object()(r, box);
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Segment_3<K>& s)
|
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
|
||||||
|
do_intersect(const Segment_3<K>& s,
|
||||||
const CGAL::Bbox_3& box)
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(s, box);
|
return K().do_intersect_3_object()(s, box);
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Sphere_3<K>& s)
|
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
|
||||||
|
do_intersect(const Sphere_3<K>& s,
|
||||||
const CGAL::Bbox_3& box)
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(s, box);
|
return K().do_intersect_3_object()(s, box);
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Tetrahedron_3<K>& t)
|
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
|
||||||
|
do_intersect(const Tetrahedron_3<K>& t,
|
||||||
const CGAL::Bbox_3& box)
|
const CGAL::Bbox_3& box)
|
||||||
{
|
{
|
||||||
return K().do_intersect_3_object()(t, box);
|
return K().do_intersect_3_object()(t, box);
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,16 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template<typename K>
|
template<typename K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& box,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& box,
|
||||||
const Triangle_3<K>& tr)
|
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
|
||||||
|
do_intersect(const Triangle_3<K>& tr,
|
||||||
const CGAL::Bbox_3& box)
|
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,7 +23,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bb,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& bb,
|
||||||
const typename K::Iso_cuboid_3& ic,
|
const typename K::Iso_cuboid_3& ic,
|
||||||
const K& /* k */)
|
const K& /* k */)
|
||||||
{
|
{
|
||||||
|
|
@ -38,7 +39,8 @@ 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
|
||||||
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const CGAL::Bbox_3& bb,
|
const CGAL::Bbox_3& bb,
|
||||||
const K& k)
|
const K& 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,7 +135,8 @@ 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
|
||||||
|
do_intersect(const typename K::Line_3& line,
|
||||||
const CGAL::Bbox_3& bbox,
|
const CGAL::Bbox_3& bbox,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -145,14 +146,15 @@ 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
|
||||||
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const typename K::Line_3& line,
|
const typename K::Line_3& line,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Plane_3& plane,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const Bbox_3& bbox,
|
const Bbox_3& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -30,7 +31,8 @@ bool do_intersect(const typename K::Plane_3& plane,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const Bbox_3& bbox,
|
typename K::Boolean
|
||||||
|
do_intersect(const Bbox_3& bbox,
|
||||||
const typename K::Plane_3& plane,
|
const typename K::Plane_3& plane,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Ray_3& ray,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Ray_3& ray,
|
||||||
const CGAL::Bbox_3& bbox,
|
const CGAL::Bbox_3& bbox,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -49,7 +50,8 @@ 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
|
||||||
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const typename K::Ray_3& ray,
|
const typename K::Ray_3& ray,
|
||||||
const K& k)
|
const K& 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,8 +453,7 @@ 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)
|
||||||
|
|
||||||
|
|
@ -467,7 +465,8 @@ do_intersect_bbox_segment_aux(
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Segment_3& segment,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Segment_3& segment,
|
||||||
const CGAL::Bbox_3& bbox,
|
const CGAL::Bbox_3& bbox,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -483,7 +482,8 @@ 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
|
||||||
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const typename K::Segment_3& segment,
|
const typename K::Segment_3& segment,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Sphere_3& sphere,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Sphere_3& sphere,
|
||||||
const CGAL::Bbox_3& bbox,
|
const CGAL::Bbox_3& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -34,7 +35,8 @@ 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
|
||||||
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const typename K::Sphere_3& sphere,
|
const typename K::Sphere_3& sphere,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,9 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline typename K::Boolean do_intersect(const CGAL::Bbox_3& aabb,
|
inline
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& aabb,
|
||||||
const typename K::Tetrahedron_3& tet,
|
const typename K::Tetrahedron_3& tet,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -57,7 +59,9 @@ 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
|
||||||
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Tetrahedron_3& tet,
|
||||||
const CGAL::Bbox_3& bb,
|
const CGAL::Bbox_3& bb,
|
||||||
const K &k)
|
const K &k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -397,7 +397,8 @@ 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
|
||||||
|
do_intersect_bbox_or_iso_cuboid(const typename K::Triangle_3& a_triangle,
|
||||||
const Box3& a_bbox,
|
const Box3& a_bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -423,12 +424,12 @@ 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
|
||||||
|
do_intersect(const typename K::Triangle_3& triangle,
|
||||||
const CGAL::Bbox_3& bbox,
|
const CGAL::Bbox_3& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -436,7 +437,8 @@ bool do_intersect(const typename K::Triangle_3& triangle,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const CGAL::Bbox_3& bbox,
|
typename K::Boolean
|
||||||
|
do_intersect(const CGAL::Bbox_3& bbox,
|
||||||
const typename K::Triangle_3& triangle,
|
const typename K::Triangle_3& triangle,
|
||||||
const K& k)
|
const K& 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,7 +79,7 @@ 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&)
|
||||||
{
|
{
|
||||||
|
|
@ -87,7 +87,8 @@ bool do_intersect_plane_box(const typename K::Plane_3& plane,
|
||||||
|
|
||||||
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,7 +115,8 @@ 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
|
||||||
|
do_intersect(const typename K::Plane_3& plane,
|
||||||
const typename K::Iso_cuboid_3& bbox,
|
const typename K::Iso_cuboid_3& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -122,7 +124,8 @@ bool do_intersect(const typename K::Plane_3& plane,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& bbox,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Iso_cuboid_3& bbox,
|
||||||
const typename K::Plane_3& plane,
|
const typename K::Plane_3& plane,
|
||||||
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::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,7 +27,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Ray_3& ray,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Ray_3& ray,
|
||||||
const typename K::Iso_cuboid_3& ic,
|
const typename K::Iso_cuboid_3& ic,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -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
|
||||||
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const typename K::Ray_3& ray,
|
const typename K::Ray_3& ray,
|
||||||
const K& k) {
|
const K& k)
|
||||||
|
{
|
||||||
return do_intersect(ray, ic, k);
|
return do_intersect(ray, ic, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Segment_3& seg,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Segment_3& seg,
|
||||||
const typename K::Iso_cuboid_3& ic,
|
const typename K::Iso_cuboid_3& ic,
|
||||||
const K&)
|
const K&)
|
||||||
{
|
{
|
||||||
|
|
@ -48,7 +49,8 @@ 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
|
||||||
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const typename K::Segment_3& seg,
|
const typename K::Segment_3& seg,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ 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
|
||||||
|
do_intersect_sphere_box_3(const typename K::Sphere_3& sphere,
|
||||||
const BFT bxmin, const BFT bymin, const BFT bzmin,
|
const BFT bxmin, const BFT bymin, const BFT bzmin,
|
||||||
const BFT bxmax, const BFT bymax, const BFT bzmax,
|
const BFT bxmax, const BFT bymax, const BFT bzmax,
|
||||||
const K&)
|
const K&)
|
||||||
|
|
@ -94,7 +95,8 @@ 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
|
||||||
|
do_intersect(const typename K::Sphere_3& sphere,
|
||||||
const typename K::Iso_cuboid_3& ic,
|
const typename K::Iso_cuboid_3& ic,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -105,7 +107,8 @@ 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
|
||||||
|
do_intersect(const typename K::Iso_cuboid_3& ic,
|
||||||
const typename K::Sphere_3& sphere,
|
const typename K::Sphere_3& sphere,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& triangle,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Triangle_3& triangle,
|
||||||
const typename K::Iso_cuboid_3& bbox,
|
const typename K::Iso_cuboid_3& bbox,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -29,7 +30,8 @@ bool do_intersect(const typename K::Triangle_3& triangle,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Iso_cuboid_3& bbox,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Iso_cuboid_3& bbox,
|
||||||
const typename K::Triangle_3& triangle,
|
const typename K::Triangle_3& triangle,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -38,9 +40,6 @@ bool do_intersect(const typename K::Iso_cuboid_3& bbox,
|
||||||
|
|
||||||
} // 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,7 +21,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const typename K::Line_3& l,
|
const typename K::Line_3& l,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -73,7 +74,8 @@ 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
|
||||||
|
do_intersect(const typename K::Line_3& l,
|
||||||
const typename K::Triangle_3& t,
|
const typename K::Triangle_3& t,
|
||||||
const K& k)
|
const K& 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,7 +21,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const typename K::Plane_3& h,
|
const typename K::Plane_3& h,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -49,7 +50,8 @@ 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
|
||||||
|
do_intersect(const typename K::Plane_3& h,
|
||||||
const typename K::Triangle_3& t,
|
const typename K::Triangle_3& t,
|
||||||
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::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,7 +21,8 @@ namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool do_intersect(const typename K::Triangle_3& t,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const typename K::Point_3& p,
|
const typename K::Point_3& p,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -68,7 +69,8 @@ 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
|
||||||
|
do_intersect(const typename K::Point_3& p,
|
||||||
const typename K::Triangle_3& t,
|
const typename K::Triangle_3& t,
|
||||||
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::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,7 +328,8 @@ 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
|
||||||
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const typename K::Ray_3& r,
|
const typename K::Ray_3& r,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -337,7 +338,8 @@ bool do_intersect(const typename K::Triangle_3& t,
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
inline
|
inline
|
||||||
bool do_intersect(const typename K::Ray_3& r,
|
typename K::Boolean
|
||||||
|
do_intersect(const typename K::Ray_3& r,
|
||||||
const typename K::Triangle_3& t,
|
const typename K::Triangle_3& t,
|
||||||
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::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,7 +174,8 @@ 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
|
||||||
|
do_intersect(const typename K::Triangle_3& t,
|
||||||
const typename K::Segment_3& s,
|
const typename K::Segment_3& s,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
@ -269,7 +271,8 @@ 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
|
||||||
|
do_intersect(const typename K::Segment_3& s,
|
||||||
const typename K::Triangle_3& t,
|
const typename K::Triangle_3& t,
|
||||||
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::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,7 +22,8 @@ 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
|
||||||
|
_intersection_test_vertex(const typename K::Point_3* p,
|
||||||
const typename K::Point_3* q,
|
const typename K::Point_3* q,
|
||||||
const typename K::Point_3* r,
|
const typename K::Point_3* r,
|
||||||
const typename K::Point_3* a,
|
const typename K::Point_3* a,
|
||||||
|
|
@ -64,7 +65,8 @@ 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
|
||||||
|
_intersection_test_edge(const typename K::Point_3* p,
|
||||||
const typename K::Point_3* q,
|
const typename K::Point_3* q,
|
||||||
const typename K::Point_3* r,
|
const typename K::Point_3* r,
|
||||||
const typename K::Point_3* a,
|
const typename K::Point_3* a,
|
||||||
|
|
@ -97,7 +99,8 @@ 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
|
||||||
|
do_intersect_coplanar(const typename K::Triangle_3& t1,
|
||||||
const typename K::Triangle_3& t2,
|
const typename K::Triangle_3& t2,
|
||||||
const K& k)
|
const K& k)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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,7 +736,8 @@ namespace CommonKernelFunctors {
|
||||||
|
|
||||||
typedef Comparison_result result_type;
|
typedef Comparison_result result_type;
|
||||||
|
|
||||||
result_type operator()(const Weighted_point_3 & p,
|
Needs_FT<result_type>
|
||||||
|
operator()(const Weighted_point_3 & p,
|
||||||
const Weighted_point_3 & q,
|
const Weighted_point_3 & q,
|
||||||
const Weighted_point_3 & r,
|
const Weighted_point_3 & r,
|
||||||
const Weighted_point_3 & s,
|
const Weighted_point_3 & s,
|
||||||
|
|
@ -750,7 +751,8 @@ namespace CommonKernelFunctors {
|
||||||
w);
|
w);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type operator()(const Weighted_point_3 & p,
|
Needs_FT<result_type>
|
||||||
|
operator()(const Weighted_point_3 & p,
|
||||||
const Weighted_point_3 & q,
|
const Weighted_point_3 & q,
|
||||||
const Weighted_point_3 & r,
|
const Weighted_point_3 & r,
|
||||||
const FT& w) const
|
const FT& w) const
|
||||||
|
|
@ -762,7 +764,8 @@ namespace CommonKernelFunctors {
|
||||||
w);
|
w);
|
||||||
}
|
}
|
||||||
|
|
||||||
result_type operator()(const Weighted_point_3 & p,
|
Needs_FT<result_type>
|
||||||
|
operator()(const Weighted_point_3 & p,
|
||||||
const Weighted_point_3 & q,
|
const Weighted_point_3 & q,
|
||||||
const FT& w) const
|
const FT& w) const
|
||||||
{
|
{
|
||||||
|
|
@ -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,7 +3336,9 @@ 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.
|
||||||
|
Needs_FT<result_type>
|
||||||
|
operator()(const Sphere_3& s1, const Sphere_3& s2,
|
||||||
const Point_3& a, const Point_3& b) const
|
const Point_3& a, const Point_3& b) const
|
||||||
{
|
{
|
||||||
typedef typename K::Circle_3 Circle_3;
|
typedef typename K::Circle_3 Circle_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