* Now dispatching on Ambient_dimension

* incorporated result_type == Object to remove more ifdefs
This commit is contained in:
Philipp Möller 2011-11-09 11:35:04 +00:00
parent d316908076
commit c2bfb68112
32 changed files with 161 additions and 712 deletions

View File

@ -23,7 +23,10 @@
#include <CGAL/Kernel_traits.h>
#include <CGAL/Object.h>
#include <CGAL/assertions.h>
#include <CGAL/Dimension.h>
#include <boost/type_traits/is_same.hpp>
#include <boost/variant.hpp>
// The macro CGAL_INTERSECTION_VERSION controls which version of the
@ -38,29 +41,42 @@
#define CGAL_INTERSECTION_VERSION 2
#endif
#define CGAL_INTERSECTION_TRAITS_2(A, B, R1, R2, DIMTAG) \
#if CGAL_INTERSECTION_VERSION < 2
#define CGAL_INTERSECTION_TRAITS_2(A, B, R1, R2)
#define CGAL_INTERSECTION_TRAITS_3(A, B, R1, R2, R3)
#else
#define CGAL_INTERSECTION_TRAITS_2(A, B, R1, R2) \
template<typename K> \
struct Intersection_traits<K, typename K::A, typename K::B> { \
typedef typename boost::variant<typename K::R1, typename K::R2 > \
variant_type; \
typedef typename boost::optional< variant_type > result_type; \
typedef internal::DIMTAG Dim_tag; \
};
#define CGAL_INTERSECTION_TRAITS_3(A, B, R1, R2, R3, DIMTAG) \
#define CGAL_INTERSECTION_TRAITS_3(A, B, R1, R2, R3) \
template<typename K> \
struct Intersection_traits<K, typename K::A, typename K::B> { \
typedef typename boost::variant<typename K::R1, typename K::R2, \
typename K::R3> variant_type; \
typedef typename boost::optional< variant_type > result_type; \
typedef internal::DIMTAG Dim_tag; \
};
#endif
namespace CGAL {
// only declarationn
template<typename, typename, typename>
struct Intersection_traits {};
struct Intersection_traits {
// This defaults to Object, if we use VERSION < 2 and to nothing
// otherwise.
#if CGAL_INTERSECTION_VERSION < 2
typedef CGAL::Object result_type;
#endif
};
// alias
template<typename K, typename A, typename B>
@ -141,61 +157,44 @@ const T* intersect_get(const boost::variant<BOOST_VARIANT_ENUM_PARAMS(U)> & v) {
return boost::get<T>(&v);
}
// tags for dispatch
struct Intersection_dim_two {};
struct Intersection_dim_three {};
struct Intersection_dim_d {};
template<typename A, typename B>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT< typename CGAL::Kernel_traits<A>::Kernel, A, B>::result_type
#endif
intersection_impl(const A& a, const B& b, Intersection_dim_two) {
intersection_impl(const A& a, const B& b, CGAL::Dimension_tag<2>) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().intersect_2_object()(a, b);
}
template<typename A, typename B>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT< typename CGAL::Kernel_traits<A>::Kernel, A, B>::result_type
#endif
intersection_impl(const A& a, const B& b, Intersection_dim_three) {
intersection_impl(const A& a, const B& b, Dimension_tag<3>) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().intersect_3_object()(a, b);
}
template<typename A, typename B>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT< typename CGAL::Kernel_traits<A>::Kernel, A, B>::result_type
#endif
intersection_impl(const A& a, const B& b, Intersection_dim_d) {
intersection_impl(const A& a, const B& b, Dynamic_dimension_tag) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().intersect_d_object()(a, b);
}
template<typename A, typename B>
inline bool
do_intersect_impl(const A& a, const B& b, Intersection_dim_two) {
do_intersect_impl(const A& a, const B& b, CGAL::Dimension_tag<2>) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().do_intersect_2_object()(a, b);
}
template<typename A, typename B>
inline bool
do_intersect_impl(const A& a, const B& b, Intersection_dim_three) {
do_intersect_impl(const A& a, const B& b, Dimension_tag<3>) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().do_intersect_3_object()(a, b);
}
template<typename A, typename B>
inline bool
do_intersect_impl(const A& a, const B& b, Intersection_dim_d) {
do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().do_intersect_d_object()(a, b);
}
@ -204,23 +203,20 @@ do_intersect_impl(const A& a, const B& b, Intersection_dim_d) {
template<typename A, typename B>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT< typename Kernel_traits<A>::Kernel, A, B>::result_type
#endif
intersection(const A& a, const B& b) {
typedef typename Kernel_traits<A>::Kernel Kernel;
typedef IT<Kernel, A, B> Traits;
return internal::intersection_impl(a, b, typename Traits::Dim_tag());
CGAL_static_assertion_msg( (boost::is_same<typename A::Ambient_dimension, typename B::Ambient_dimension>::value),
"intersection with objects of different dimensions not supported");
return internal::intersection_impl(a, b, typename A::Ambient_dimension());
}
template<typename A, typename B>
inline bool
inline
bool
do_intersect(const A& a, const B& b) {
typedef typename Kernel_traits<A>::Kernel Kernel;
typedef IT<Kernel, A, B> Traits;
return internal::do_intersect_impl(a, b, typename Traits::Dim_tag());
CGAL_static_assertion_msg((boost::is_same<typename A::Ambient_dimension, typename B::Ambient_dimension>::value),
"do_intersect with objects of different dimensions not supported");
return internal::do_intersect_impl(a, b, typename A::Ambient_dimension());
}
} // CGAL

View File

@ -27,31 +27,34 @@
#include <boost/optional.hpp>
#include <vector>
#if !(CGAL_INTERSECTION_VERSION < 2)
namespace CGAL {
CGAL_INTERSECTION_TRAITS_2(Line_2, Line_2, Point_2, Line_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Line_2, Line_2, Point_2, Line_2)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Line_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Line_2, Segment_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Line_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Line_2, Segment_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Segment_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Segment_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Line_2, Point_2, Ray_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Line_2, Ray_2, Point_2, Ray_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Line_2, Point_2, Ray_2)
CGAL_INTERSECTION_TRAITS_2(Line_2, Ray_2, Point_2, Ray_2)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Segment_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Ray_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Segment_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Ray_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_3(Ray_2, Ray_2, Point_2, Segment_2, Ray_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_3(Ray_2, Ray_2, Point_2, Segment_2, Ray_2)
CGAL_INTERSECTION_TRAITS_2(Triangle_2, Line_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Line_2, Triangle_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Triangle_2, Line_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Line_2, Triangle_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Triangle_2, Segment_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Triangle_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Triangle_2, Segment_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Triangle_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Triangle_2, Ray_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Triangle_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Triangle_2, Ray_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Triangle_2, Point_2, Segment_2, Intersection_dim_two)
template<typename K>
struct Intersection_traits<K, typename K::Triangle_2, typename K::Triangle_2> {
@ -59,17 +62,16 @@ struct Intersection_traits<K, typename K::Triangle_2, typename K::Triangle_2> {
boost::variant< typename K::Point_2, typename K::Segment_2,
typename K::Triangle_2, typename std::vector< typename K::Point_2 > > variant_type;
typedef typename boost::optional< variant_type > result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
CGAL_INTERSECTION_TRAITS_2(Iso_rectangle_2, Line_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Line_2, Iso_rectangle_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Iso_rectangle_2, Line_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Line_2, Iso_rectangle_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Iso_rectangle_2, Segment_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Iso_rectangle_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Iso_rectangle_2, Segment_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Segment_2, Iso_rectangle_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Iso_rectangle_2, Ray_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Iso_rectangle_2, Point_2, Segment_2, Intersection_dim_two)
CGAL_INTERSECTION_TRAITS_2(Iso_rectangle_2, Ray_2, Point_2, Segment_2)
CGAL_INTERSECTION_TRAITS_2(Ray_2, Iso_rectangle_2, Point_2, Segment_2)
// undocumented
@ -78,21 +80,18 @@ template<typename K>
struct Intersection_traits<K, typename K::Iso_rectangle_2, typename K::Iso_rectangle_2> {
typedef typename boost::variant<typename K::Iso_rectangle_2> variant_type;
typedef boost::optional<variant_type> result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K, typename B>
struct Intersection_traits<K, typename K::Point_2, B> {
typedef typename boost::variant<typename K::Point_2> variant_type;
typedef boost::optional<variant_type> result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K, typename A>
struct Intersection_traits<K, A, typename K::Point_2> {
typedef typename boost::variant<typename K::Point_2> variant_type;
typedef boost::optional<variant_type> result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -102,7 +101,6 @@ struct Intersection_traits<K, typename K::Iso_rectangle_2, typename K::Triangle_
typename K::Point_2,
typename std::vector< typename K::Point_2 > > variant_type;
typedef typename boost::optional < variant_type > result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -119,7 +117,6 @@ struct Intersection_traits<K, typename K::Circle_2, typename K::Circle_2>
typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
@ -131,7 +128,6 @@ struct Intersection_traits<K, typename K::Circular_arc_2, typename K::Circular_a
typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -142,7 +138,6 @@ struct Intersection_traits<K, typename K::Line_arc_2, typename K::Line_arc_2>
typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -152,7 +147,6 @@ struct Intersection_traits<K, typename K::Line_arc_2, typename K::Circle_2>
boost::variant< typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -167,7 +161,6 @@ struct Intersection_traits<K, typename K::Line_arc_2, typename K::Circular_arc_2
boost::variant< typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -183,7 +176,6 @@ struct Intersection_traits<K, typename K::Line_arc_2, typename K::Line_2>
typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -198,7 +190,6 @@ struct Intersection_traits<K, typename K::Line_2, typename K::Circular_arc_2>
boost::variant< typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -228,7 +219,6 @@ struct Intersection_traits<K, typename K::Line_2, typename K::Circle_2>
boost::variant< typename std::pair< typename K::Circular_arc_point_2,
unsigned int > >
result_type;
typedef internal::Intersection_dim_two Dim_tag;
};
template<typename K>
@ -236,8 +226,9 @@ struct Intersection_traits<K, typename K::Circle_2, typename K::Line_2> :
public Intersection_traits<K, typename K::Line_2, typename K::Circle_2>
{};
} // namespace CGAL
#endif
#endif /* CGAL_INTERSECTION_TRAITS_2_H */

View File

@ -318,12 +318,8 @@ Triangle_2_Triangle_2_pair<K>::intersection_point() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Triangle_2, typename K::Triangle_2>::result_type
#endif
intersection(const typename K::Triangle_2 &tr1,
const typename K::Triangle_2 &tr2,
const K&)

View File

@ -33,12 +33,8 @@ namespace CGAL {
namespace internal {
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Iso_rectangle_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(
const typename K::Iso_rectangle_2 &irect1,
const typename K::Iso_rectangle_2 &irect2,

View File

@ -184,12 +184,8 @@ intersection_segment() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Line_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(const typename K::Line_2 &line,
const typename K::Iso_rectangle_2 &iso,
const K&)
@ -209,12 +205,8 @@ intersection(const typename K::Line_2 &line,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Line_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(const typename K::Iso_rectangle_2 &iso,
const typename K::Line_2 &line,
const K& k)

View File

@ -70,12 +70,8 @@ inline bool do_intersect(
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Line_2, typename K::Line_2>::result_type
#endif
intersection(const typename K::Line_2 &line1,
const typename K::Line_2 &line2,
const K&)

View File

@ -160,12 +160,8 @@ intersection_segment() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Line_2, typename K::Triangle_2>::result_type
#endif
intersection(const typename K::Line_2 &line,
const typename K::Triangle_2 &tr,
const K&)
@ -186,12 +182,8 @@ intersection(const typename K::Line_2 &line,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Line_2, typename K::Triangle_2>::result_type
#endif
intersection(const typename K::Triangle_2 &tr,
const typename K::Line_2 &line,
const K& k)

View File

@ -54,12 +54,8 @@ do_intersect(const typename K::Iso_rectangle_2 &iso,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Point_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(const typename K::Point_2 &pt,
const typename K::Iso_rectangle_2 &iso,
const K& k)
@ -74,12 +70,8 @@ intersection(const typename K::Point_2 &pt,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Point_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(const typename K::Iso_rectangle_2 &iso,
const typename K::Point_2 &pt,
const K& k)

View File

@ -52,12 +52,8 @@ do_intersect(const typename K::Line_2 &line,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Point_2, typename K::Line_2>::result_type
#endif
intersection(const typename K::Point_2 &pt,
const typename K::Line_2 &line,
const K& k)
@ -69,12 +65,8 @@ intersection(const typename K::Point_2 &pt,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Line_2, typename K::Point_2>::result_type
#endif
intersection(const typename K::Line_2 &line,
const typename K::Point_2 &pt,
const K& k)

View File

@ -46,13 +46,10 @@ typename CGAL::Intersection_traits
intersection(const typename K::Point_2 &pt1,
const typename K::Point_2 &pt2)
{
typedef typename CGAL::Intersection_traits
<K, typename K::Point_2, typename K::Point_2>::result_type result_type;
if (pt1 == pt2) {
return result_type(pt1);
return intersection_return<K, typename K::Point_2, typename K::Point_2>(pt1);
}
return result_type();
return intersection_return<K, typename K::Point_2, typename K::Point_2>();
}
}// namespace internal

View File

@ -56,12 +56,8 @@ do_intersect(const typename K::Ray_2 &ray,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Point_2, typename K::Ray_2>::result_type
#endif
intersection(const typename K::Point_2 &pt,
const typename K::Ray_2 &ray,
const K& k)
@ -73,12 +69,8 @@ intersection(const typename K::Point_2 &pt,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Point_2>::result_type
#endif
intersection(const typename K::Ray_2 &ray,
const typename K::Point_2 &pt,
const K& k)

View File

@ -56,12 +56,8 @@ do_intersect(const typename K::Segment_2 &seg,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Point_2, typename K::Segment_2>::result_type
#endif
intersection(const typename K::Point_2 &pt,
const typename K::Segment_2 &seg,
const K& k)
@ -74,12 +70,8 @@ intersection(const typename K::Point_2 &pt,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Segment_2, typename K::Point_2>::result_type
#endif
intersection( const typename K::Segment_2 &seg,
const typename K::Point_2 &pt,
const K& k)

View File

@ -127,12 +127,8 @@ intersection_point() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Point_2, typename K::Triangle_2>
::result_type
#endif
intersection(const typename K::Point_2 &pt,
const typename K::Triangle_2 &tr,
const K&)
@ -150,12 +146,8 @@ intersection(const typename K::Point_2 &pt,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Point_2, typename K::Triangle_2>
::result_type
#endif
intersection(const typename K::Triangle_2 &tr,
const typename K::Point_2 &pt,
const K&k)

View File

@ -79,12 +79,8 @@ inline bool do_intersect(const typename K::Iso_rectangle_2 &p2,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(const typename K::Ray_2 &ray,
const typename K::Iso_rectangle_2 &iso,
const K& )
@ -103,12 +99,8 @@ intersection(const typename K::Ray_2 &ray,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(const typename K::Iso_rectangle_2 &iso,
const typename K::Ray_2 &ray,
const K& k)

View File

@ -71,12 +71,8 @@ inline bool do_intersect(
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits
<K, typename K::Ray_2, typename K::Line_2>::result_type
#endif
intersection(const typename K::Ray_2 &ray,
const typename K::Line_2 &line,
const K&)
@ -97,12 +93,8 @@ intersection(const typename K::Ray_2 &ray,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits
<K, typename K::Line_2, typename K::Ray_2>::result_type
#endif
intersection(const typename K::Line_2 &line,
const typename K::Ray_2 &ray,
const K& k)

View File

@ -233,12 +233,8 @@ Ray_2_Ray_2_pair<K>::intersection_ray() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Ray_2>::result_type
#endif
intersection(const typename K::Ray_2 &ray1,
const typename K::Ray_2 &ray2,
const K&)

View File

@ -236,12 +236,8 @@ Ray_2_Segment_2_pair<K>::intersection_segment() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Segment_2>::result_type
#endif
intersection(const typename K::Ray_2 &ray,
const typename K::Segment_2 &seg,
const K&)
@ -261,12 +257,8 @@ intersection(const typename K::Ray_2 &ray,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Segment_2>::result_type
#endif
intersection(const typename K::Segment_2 &seg,
const typename K::Ray_2 &ray,
const K& k)

View File

@ -142,12 +142,8 @@ intersection_segment() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Triangle_2>::result_type
#endif
intersection(const typename K::Ray_2 &ray,
const typename K::Triangle_2&tr,
const K&)
@ -167,12 +163,8 @@ intersection(const typename K::Ray_2 &ray,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Ray_2, typename K::Triangle_2>::result_type
#endif
intersection(const typename K::Triangle_2&tr,
const typename K::Ray_2 &ray,
const K& k)

View File

@ -74,12 +74,8 @@ inline bool do_intersect(
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Segment_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(
const typename K::Segment_2 &seg,
const typename K::Iso_rectangle_2 &iso,
@ -100,12 +96,8 @@ intersection(
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Segment_2, typename K::Iso_rectangle_2>::result_type
#endif
intersection(const typename K::Iso_rectangle_2 &iso,
const typename K::Segment_2 &seg,
const K& k)

View File

@ -69,12 +69,8 @@ inline bool do_intersect(
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Segment_2, typename K::Line_2>::result_type
#endif
intersection(const typename K::Segment_2 &seg,
const typename K::Line_2 &line,
const K&)
@ -94,12 +90,8 @@ intersection(const typename K::Segment_2 &seg,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Line_2, typename K::Segment_2>::result_type
#endif
intersection(const typename K::Line_2 &line,
const typename K::Segment_2 &seg,
const K& k)

View File

@ -431,12 +431,8 @@ Segment_2_Segment_2_pair<K>::intersection_segment() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Segment_2, typename K::Segment_2>::result_type
#endif
intersection(const typename K::Segment_2 &seg1,
const typename K::Segment_2 &seg2,
const K&)

View File

@ -153,12 +153,8 @@ intersection_segment() const
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Segment_2, typename K::Triangle_2>::result_type
#endif
intersection(const typename K::Segment_2 &seg,
const typename K::Triangle_2&tr,
const K&)
@ -178,12 +174,8 @@ intersection(const typename K::Segment_2 &seg,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits
<K, typename K::Segment_2, typename K::Triangle_2>::result_type
#endif
intersection(const typename K::Triangle_2&tr,
const typename K::Segment_2 &seg,
const K& k)

View File

@ -34,11 +34,7 @@
namespace CGAL{
namespace internal {
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<R, typename R::Triangle_2, typename R::Iso_rectangle_2>::result_type
#endif
intersection(const Triangle_2<R> &t, const Iso_rectangle_2<R> &r, const R& rr)
{
typedef typename R::FT FT;
@ -152,18 +148,10 @@ namespace internal {
if(position[next][j]) // if it's a second point direction
{
//test for intersection
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<R, Segment, Segment>::result_type
#endif
v = internal::intersection(Segment(p[index], p[next]), s[j], rr);
if(v) {
#if CGAL_INTERSECTION_VERSION < 2
if(const Point *p_obj = object_cast<Point>(v))
#else
if(const Point *p_obj = boost::get<Point>(&*v))
#endif
if(const Point *p_obj = intersect_get<Point>(v))
{
//intersection found
outside = true;
@ -180,18 +168,10 @@ namespace internal {
if(position[index][j]) //watch only the first point directions
{
//test for intersection
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<R, Segment, Segment>::result_type
#endif
v = internal::intersection(Segment(p[index], p[next]), s[j], rr);
if(v) {
#if CGAL_INTERSECTION_VERSION < 2
if(const Point *p_obj = object_cast<Point>(v))
#else
if(const Point *p_obj = boost::get<Point>(&*v))
#endif
if(const Point *p_obj = intersect_get<Point>(v))
{
//intersection found
outside = false;
@ -224,19 +204,11 @@ namespace internal {
if(position[next][j])
{
//test for intersection
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<R, Segment, Segment>
::result_type
#endif
v = internal::intersection(Segment(p[index], p[next]), s[j]);
if(v) {
#if CGAL_INTERSECTION_VERSION < 3
if(const Point *p_obj = object_cast<Point>(&*v))
#else
if(const Point *p_obj = boost::get<Point>(&*v))
#endif
if(const Point *p_obj = intersect_get<Point>(v))
//found the second intersection
{
outside = true;

View File

@ -24,50 +24,52 @@
#include <CGAL/Intersection_traits.h>
#include <CGAL/Bbox_3.h>
#if !(CGAL_INTERSECTION_VERSION < 2)
namespace CGAL {
CGAL_INTERSECTION_TRAITS_2(Line_3, Line_3, Point_3, Line_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Line_3, Line_3, Point_3, Line_3)
CGAL_INTERSECTION_TRAITS_2(Line_3, Plane_3, Point_3, Line_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Line_3, Point_3, Line_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Line_3, Plane_3, Point_3, Line_3)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Line_3, Point_3, Line_3)
CGAL_INTERSECTION_TRAITS_2(Line_3, Ray_3, Point_3, Ray_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Line_3, Point_3, Ray_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Line_3, Ray_3, Point_3, Ray_3)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Line_3, Point_3, Ray_3)
CGAL_INTERSECTION_TRAITS_2(Line_3, Segment_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Line_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Line_3, Segment_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Line_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Line_3, Triangle_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Triangle_3, Line_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Line_3, Triangle_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Triangle_3, Line_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Plane_3, Line_3, Plane_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Plane_3, Line_3, Plane_3)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Ray_3, Point_3, Ray_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Plane_3, Point_3, Ray_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Ray_3, Point_3, Ray_3)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Plane_3, Point_3, Ray_3)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Segment_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Plane_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Segment_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Plane_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Sphere_3, Point_3, Circle_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Sphere_3, Plane_3, Point_3, Circle_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Plane_3, Sphere_3, Point_3, Circle_3)
CGAL_INTERSECTION_TRAITS_2(Sphere_3, Plane_3, Point_3, Circle_3)
CGAL_INTERSECTION_TRAITS_3(Plane_3, Triangle_3, Point_3, Segment_3, Triangle_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_3(Triangle_3, Plane_3, Point_3, Segment_3, Triangle_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_3(Plane_3, Triangle_3, Point_3, Segment_3, Triangle_3)
CGAL_INTERSECTION_TRAITS_3(Triangle_3, Plane_3, Point_3, Segment_3, Triangle_3)
CGAL_INTERSECTION_TRAITS_3(Ray_3, Ray_3, Point_3, Ray_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_3(Ray_3, Ray_3, Point_3, Ray_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Segment_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Ray_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Segment_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Ray_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Triangle_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Triangle_3, Ray_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Triangle_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Triangle_3, Ray_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Segment_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Segment_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Triangle_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Triangle_3, Segment_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Triangle_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Triangle_3, Segment_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_3(Sphere_3, Sphere_3, Point_3, Circle_3, Sphere_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_3(Sphere_3, Sphere_3, Point_3, Circle_3, Sphere_3)
template<typename K>
struct Intersection_traits<K, typename K::Triangle_3, typename K::Triangle_3> {
@ -75,22 +77,21 @@ struct Intersection_traits<K, typename K::Triangle_3, typename K::Triangle_3> {
boost::variant< typename K::Point_3, typename K::Segment_3, typename K::Triangle_3,
typename std::vector< typename K::Point_3 > > variant_type;
typedef typename boost::optional< variant_type > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
// !!! undocumented !!!
// Segment_3 Iso_cuboid_3
CGAL_INTERSECTION_TRAITS_2(Segment_3, Iso_cuboid_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Iso_cuboid_3, Segment_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Segment_3, Iso_cuboid_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Iso_cuboid_3, Segment_3, Point_3, Segment_3)
// Line_3 Iso_cuboid_3
CGAL_INTERSECTION_TRAITS_2(Line_3, Iso_cuboid_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Iso_cuboid_3, Line_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Line_3, Iso_cuboid_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Iso_cuboid_3, Line_3, Point_3, Segment_3)
// Ray_3 Iso_cuboid_3
CGAL_INTERSECTION_TRAITS_2(Ray_3, Iso_cuboid_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Iso_cuboid_3, Ray_3, Point_3, Segment_3, Intersection_dim_three)
CGAL_INTERSECTION_TRAITS_2(Ray_3, Iso_cuboid_3, Point_3, Segment_3)
CGAL_INTERSECTION_TRAITS_2(Iso_cuboid_3, Ray_3, Point_3, Segment_3)
// Iso_cuboid_3 Iso_cuboid_3, variant of one
template<typename K>
@ -98,7 +99,6 @@ struct Intersection_traits<K, typename K::Iso_cuboid_3, typename K::Iso_cuboid_3
typedef typename
boost::variant< typename K::Iso_cuboid_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
// Intersections with BBox returns the same for Ray_3, Line_3 and Segment_3
@ -108,7 +108,6 @@ struct Intersection_traits<K, CGAL::Bbox_3, typename K::Line_3> {
typedef typename
boost::variant< typename K::Segment_3, typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
template<typename K>
@ -151,7 +150,6 @@ struct Intersection_traits<K, typename K::Circle_3, typename K::Plane_3> {
typedef typename boost::variant< std::pair< typename K::Circular_arc_point_3,
unsigned int >,
typename K::Circle_3 > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
template<typename K>
@ -164,7 +162,6 @@ struct Intersection_traits<K, typename K::Circle_3, typename K::Sphere_3> {
typedef typename boost::variant< std::pair< typename K::Circular_arc_point_3,
unsigned int >,
typename K::Circle_3 > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
template<typename K>
@ -176,7 +173,6 @@ template<typename K>
struct Intersection_traits<K, typename K::Circle_3, typename K::Circle_3> {
typedef typename boost::variant< std::pair <typename K::Circular_arc_point_3, unsigned int >,
typename K::Circle_3 > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
// Circle_3 Circle_3
@ -184,7 +180,6 @@ template<typename K>
struct Intersection_traits<K, typename K::Circle_3, typename K::Line_3> {
typedef typename boost::variant<
std::pair <typename K::Circular_arc_point_3, unsigned int > > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
template<typename K>
@ -198,7 +193,6 @@ struct Intersection_traits<K, typename K::Circular_arc_3, typename K::Circular_a
typename K::Circle_3,
std::pair <typename K::Circular_arc_point_3, unsigned int >,
typename K::Circular_arc_3 > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
// Circular_arc_3 Plane_3
@ -207,7 +201,6 @@ struct Intersection_traits<K, typename K::Circular_arc_3, typename K::Plane_3> {
typedef typename boost::variant<
std::pair <typename K::Circular_arc_point_3, unsigned int >,
typename K::Circular_arc_3 > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
template<typename K>
@ -220,11 +213,12 @@ struct Intersection_traits<K, typename K::Line_arc_3, typename K::Line_arc_3> {
typedef typename boost::variant<
std::pair <typename K::Circular_arc_point_3, unsigned int >,
typename K::Line_arc_3 > result_type;
typedef internal::Intersection_dim_three Dim_tag;
};
} // namespace
#endif // !(CGAL_INTERSECTION_VERSION < 2)
#endif /* CGAL_INTERSECTION_TRAITS_3_H */

View File

@ -26,17 +26,14 @@
#include <CGAL/wmult.h>
#include <boost/next_prior.hpp>
#include <CGAL/Intersection_traits_3.h>
namespace CGAL {
namespace internal {
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Line_3>::result_type
#endif
intersection(const typename K::Plane_3 &plane,
const typename K::Line_3 &line,
const K&)
@ -70,11 +67,7 @@ intersection(const typename K::Plane_3 &plane,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Line_3>::result_type
#endif
intersection(const typename K::Line_3 &line,
const typename K::Plane_3 &plane,
const K& k)
@ -83,11 +76,7 @@ intersection(const typename K::Line_3 &line,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Plane_3>::result_type
#endif
intersection(const typename K::Plane_3 &plane1,
const typename K::Plane_3 &plane2,
const K&)
@ -159,10 +148,16 @@ intersection(const typename K::Plane_3 &plane1,
const typename K::Plane_3 &plane3,
const K& k)
{
typedef typename boost::optional<
typedef
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename boost::optional<
boost::variant<typename K::Point_3,
typename K::Line_3,
typename K::Plane_3> > result_type;
typename K::Plane_3> >
#endif
result_type;
typedef typename K::Point_3 Point_3;
@ -171,59 +166,43 @@ intersection(const typename K::Plane_3 &plane1,
// Intersection between plane1 and plane2 can either be
// a line, a plane, or empty.
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, Plane_3, Plane_3>::result_type
#endif
o12 = internal::intersection(plane1, plane2, k);
if(o12) {
if(const Line_3* l = intersect_get<Line_3>(o12)) {
// either point or line
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, Plane_3, Line_3>::result_type
#endif
v = internal::intersection(plane3, *l, k);
if(v) {
// don't use intersect get, we don't have traits and can't
// use intersect_return.
if(const Point_3* p = intersect_get<Point_3>(v))
#if CGAL_INTERSECTION_VERSION < 2
if(const Point_3* p = object_cast<Point_3>(&v))
return make_object(*p);
else if(const Line_3* l = object_cast<Line_3>(&v))
#else
return result_type(*p);
#endif
else if(const Line_3* l = intersect_get<Line_3>(v))
#if CGAL_INTERSECTION_VERSION < 2
return make_object(*l);
#else
if(const Point_3* p = boost::get<Point_3>(&*v))
return result_type(*p);
else if(const Line_3* l = boost::get<Line_3>(&*v))
return result_type(*l);
#endif
}
#if CGAL_INTERSECTION_VERSION < 2
} else if(const Plane_3 *pl = object_cast<Plane_3>(&o12)) {
#else
} else if(const Plane_3 *pl = boost::get<Plane_3>(&(*o12))) {
#endif
} else if(const Plane_3 *pl = intersect_get<Plane_3>(o12)) {
// either line or plane
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, Plane_3, Plane_3>::result_type
#endif
v = internal::intersection(plane3, *pl, k);
if(v) {
if(const Plane_3* p = intersect_get<Plane_3>(v))
#if CGAL_INTERSECTION_VERSION < 2
if(const Plane_3* p = object_cast<Plane_3>(&v))
return make_object(*p);
else if(const Line_3* l = object_cast<Line_3>(&v))
#else
return result_type(*p);
#endif
else if(const Line_3* l = intersect_get<Line_3>(v))
#if CGAL_INTERSECTION_VERSION < 2
return make_object(*l);
#else
if(const Plane_3* p = boost::get<Plane_3>(&*v))
return result_type(*p);
else if(const Line_3* l = boost::get<Line_3>(&*v))
return result_type(*l);
#endif
}
@ -276,11 +255,7 @@ do_intersect(const typename K::Line_3 &line,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Line_3>::result_type
#endif
intersection(const typename K::Line_3 &l1,
const typename K::Line_3 &l2,
const K&)
@ -338,11 +313,7 @@ do_intersect(const typename K::Line_3 &l1,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Segment_3>::result_type
#endif
intersection_collinear_segments(const typename K::Segment_3 &s1,
const typename K::Segment_3 &s2,
const K& k)
@ -381,12 +352,8 @@ intersection_collinear_segments(const typename K::Segment_3 &s1,
template<class K>
struct L_p_visitor : public boost::static_visitor<
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3,
typename K::Segment_3>::result_type
#endif
>
{
@ -397,46 +364,30 @@ CGAL::Object
const typename K::Segment_3& s1;
const typename K::Segment_3& s2;
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
result_type
#endif
operator()(const typename K::Point_3& p) const {
typename K::Collinear_are_ordered_along_line_3 cln_order=K().collinear_are_ordered_along_line_3_object();
if ( cln_order(s1[0],p,s1[1]) && cln_order(s2[0],p,s2[1]) )
return result_type(p);
return intersection_return<K, typename K::Segment_3, typename K::Segment_3>(p);
else
return result_type();
return intersection_return<K, typename K::Segment_3, typename K::Segment_3>();
}
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
result_type
#endif
operator()(const typename K::Line_3&) const {
return intersection_collinear_segments(s1,s2,K());
}
};
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Segment_3>::result_type
#endif
intersection(const typename K::Segment_3 &s1,
const typename K::Segment_3 &s2,
const K&)
{
CGAL_precondition(! s1.is_degenerate () && ! s2.is_degenerate () );
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Line_3>::result_type
#endif
v = internal::intersection(s1.supporting_line(),s2.supporting_line(), K());
if(v) {
@ -488,22 +439,14 @@ do_intersect(const typename K::Segment_3 &s1,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Segment_3>::result_type
#endif
intersection(const typename K::Line_3 &l,
const typename K::Segment_3 &s,
const K& k)
{
CGAL_precondition(! l.is_degenerate () && ! s.is_degenerate () );
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Line_3>::result_type
#endif
v = internal::intersection(l,s.supporting_line(), K());
if(v) {
@ -520,11 +463,7 @@ intersection(const typename K::Line_3 &l,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Segment_3>::result_type
#endif
intersection(const typename K::Segment_3 &s,
const typename K::Line_3 &l,
const K& k)
@ -584,22 +523,14 @@ Ray_3_has_on_collinear_Point_3(
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Ray_3>::result_type
#endif
intersection(const typename K::Line_3 &l,
const typename K::Ray_3 &r,
const K& k)
{
CGAL_precondition(! l.is_degenerate () && ! r.is_degenerate () );
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Line_3>::result_type
#endif
v = internal::intersection(l,r.supporting_line(), k);
if(v) {
@ -614,11 +545,7 @@ intersection(const typename K::Line_3 &l,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Ray_3, typename K::Line_3>::result_type
#endif
intersection(const typename K::Ray_3 &r,
const typename K::Line_3 &l,
const K& k)
@ -655,22 +582,14 @@ do_intersect(const typename K::Ray_3 &r,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Ray_3>::result_type
#endif
intersection(const typename K::Segment_3 &s,
const typename K::Ray_3 &r,
const K& k)
{
CGAL_precondition(! s.is_degenerate () && ! r.is_degenerate () );
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Segment_3>::result_type
#endif
v = internal::intersection(r.supporting_line(),s, K());
if(v) {
@ -708,11 +627,7 @@ intersection(const typename K::Segment_3 &s,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Ray_3, typename K::Segment_3>::result_type
#endif
intersection(const typename K::Ray_3 &r,
const typename K::Segment_3 &s,
const K& k)
@ -755,22 +670,14 @@ do_intersect(const typename K::Ray_3 &r,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Ray_3, typename K::Ray_3>::result_type
#endif
intersection(const typename K::Ray_3 &r1,
const typename K::Ray_3 &r2,
const K& k)
{
CGAL_precondition(! r1.is_degenerate () && ! r2.is_degenerate () );
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Ray_3>::result_type
#endif
v = internal::intersection(r1.supporting_line(),r2, k);
if(v) {
@ -829,11 +736,7 @@ do_intersect(const typename K::Ray_3 &r1,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Sphere_3>::result_type
#endif
intersection(const typename K::Plane_3 &p,
const typename K::Sphere_3 &s,
const K&)
@ -889,11 +792,7 @@ do_intersect(const typename K::Sphere_3 &s,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Sphere_3, typename K::Plane_3>::result_type
#endif
intersection(const typename K::Sphere_3 &s,
const typename K::Plane_3 &p,
const K& k)
@ -903,11 +802,7 @@ intersection(const typename K::Sphere_3 &s,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Sphere_3, typename K::Sphere_3>::result_type
#endif
intersection(const typename K::Sphere_3 &s1,
const typename K::Sphere_3 &s2,
const K& k)
@ -923,11 +818,7 @@ intersection(const typename K::Sphere_3 &s1,
Plane_3 p = K().construct_radical_plane_3_object()(s1,s2);
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Sphere_3, typename K::Plane_3>::result_type
#endif
v = intersection(p, s1, k);
@ -958,22 +849,14 @@ do_intersect(const typename K::Sphere_3 &s1,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Ray_3>::result_type
#endif
intersection(const typename K::Plane_3 &plane,
const typename K::Ray_3 &ray,
const K& k)
{
typedef typename K::Point_3 Point_3;
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Line_3>::result_type
#endif
v = internal::intersection(plane, ray.supporting_line(), k);
if(v) {
@ -993,11 +876,7 @@ intersection(const typename K::Plane_3 &plane,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Ray_3, typename K::Plane_3>::result_type
#endif
intersection(const typename K::Ray_3 &ray,
const typename K::Plane_3 &plane,
const K& k)
@ -1015,12 +894,8 @@ do_intersect(const typename K::Plane_3 &plane,
{
typedef typename K::Point_3 Point_3;
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Line_3>
::result_type
#endif
line_intersection = internal::intersection(plane, ray.supporting_line(), k);
if(!line_intersection)
@ -1044,11 +919,7 @@ do_intersect(const typename K::Ray_3 &ray,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Segment_3>::result_type
#endif
intersection(const typename K::Plane_3 &plane,
const typename K::Segment_3 &seg,
const K& k)
@ -1076,11 +947,7 @@ intersection(const typename K::Plane_3 &plane,
{
// intersection object should be a point, but rounding errors
// could lead to a line. In such case, return seg.
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Line_3>::result_type
#endif
v = internal::intersection(plane, seg.supporting_line(), k);
if(v) {
if(const typename K::Point_3* p = intersect_get<typename K::Point_3>(v))
@ -1098,11 +965,7 @@ intersection(const typename K::Plane_3 &plane,
{
// intersection object should be a point, but rounding errors
// could lead to a line. In such case, return seg.
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Line_3>::result_type
#endif
v = internal::intersection(plane, seg.supporting_line(), k);
if(v) {
if(const typename K::Point_3* p = intersect_get<typename K::Point_3>(v))
@ -1122,11 +985,7 @@ intersection(const typename K::Plane_3 &plane,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Plane_3>::result_type
#endif
intersection(const typename K::Segment_3 &seg,
const typename K::Plane_3 &plane,
const K& k)
@ -1168,21 +1027,13 @@ do_intersect(const typename K::Segment_3 &seg,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Triangle_3>::result_type
#endif
intersection(const typename K::Plane_3 &plane,
const typename K::Triangle_3 &tri,
const K& k)
{
typedef
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Line_3>::result_type
#endif
pl_res;
typename K::Construct_vertex_3 vertex_on =
@ -1277,11 +1128,7 @@ intersection(const typename K::Plane_3 &plane,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3, typename K::Plane_3>::result_type
#endif
intersection(const typename K::Triangle_3 &triangle,
const typename K::Plane_3 &plane,
const K& k)
@ -1290,11 +1137,7 @@ intersection(const typename K::Triangle_3 &triangle,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, Bbox_3>::result_type
#endif
intersection(const typename K::Line_3 &line,
const Bbox_3 &box,
const K&)
@ -1317,11 +1160,7 @@ intersection(const typename K::Line_3 &line,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, Bbox_3, typename K::Line_3>::result_type
#endif
intersection(const Bbox_3 &box,
const typename K::Line_3 &line,
const K& k)
@ -1331,11 +1170,7 @@ intersection(const Bbox_3 &box,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Ray_3, Bbox_3>::result_type
#endif
intersection(const typename K::Ray_3 &ray,
const Bbox_3 &box,
const K&)
@ -1358,11 +1193,7 @@ intersection(const typename K::Ray_3 &ray,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, Bbox_3, typename K::Ray_3>::result_type
#endif
intersection(const Bbox_3 &box,
const typename K::Ray_3 &ray,
const K& k)
@ -1373,11 +1204,7 @@ intersection(const Bbox_3 &box,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, Bbox_3>::result_type
#endif
intersection(const typename K::Segment_3 &seg,
const Bbox_3 &box,
const K&)
@ -1400,11 +1227,7 @@ intersection(const typename K::Segment_3 &seg,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, Bbox_3, typename K::Segment_3>::result_type
#endif
intersection(const Bbox_3 &box,
const typename K::Segment_3 &seg,
const K& k)
@ -1414,11 +1237,7 @@ intersection(const Bbox_3 &box,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Iso_cuboid_3>::result_type
#endif
intersection(const typename K::Line_3 &line,
const typename K::Iso_cuboid_3 &box,
const K&)
@ -1481,11 +1300,7 @@ intersection(const typename K::Line_3 &line,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Iso_cuboid_3, typename K::Line_3>::result_type
#endif
intersection(const typename K::Iso_cuboid_3 &box,
const typename K::Line_3 &line,
const K& k)
@ -1496,11 +1311,7 @@ intersection(const typename K::Iso_cuboid_3 &box,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Ray_3, typename K::Iso_cuboid_3>::result_type
#endif
intersection(const typename K::Ray_3 &ray,
const typename K::Iso_cuboid_3 &box,
const K&)
@ -1562,11 +1373,7 @@ intersection(const typename K::Ray_3 &ray,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Iso_cuboid_3, typename K::Ray_3>::result_type
#endif
intersection(const typename K::Iso_cuboid_3 &box,
const typename K::Ray_3 &ray,
const K& k)
@ -1576,11 +1383,7 @@ intersection(const typename K::Iso_cuboid_3 &box,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Iso_cuboid_3>::result_type
#endif
intersection(const typename K::Segment_3 &seg,
const typename K::Iso_cuboid_3 &box,
const K&)
@ -1642,11 +1445,7 @@ intersection(const typename K::Segment_3 &seg,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Iso_cuboid_3, typename K::Segment_3>::result_type
#endif
intersection(const typename K::Iso_cuboid_3 &box,
const typename K::Segment_3 &seg,
const K& k)
@ -1656,11 +1455,7 @@ intersection(const typename K::Iso_cuboid_3 &box,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Iso_cuboid_3, typename K::Iso_cuboid_3>::result_type
#endif
intersection(
const typename K::Iso_cuboid_3 &icub1,
const typename K::Iso_cuboid_3 &icub2,

View File

@ -61,13 +61,9 @@ void intersection_coplanar_triangles_cutoff(
Orientation or_prev=orientations[prev],or_curr=orientations[&curr];
if ( (or_prev==POSITIVE && or_curr==NEGATIVE) || (or_prev==NEGATIVE && or_curr==POSITIVE) )
{
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<Kernel, typename Kernel::Line_3,
typename Kernel::Line_3>
::result_type
#endif
obj = intersection(Line_3(p,q),Line_3(*prev,curr),k);
// assert "not empty"
CGAL_kernel_assertion(obj);
@ -92,11 +88,7 @@ void intersection_coplanar_triangles_cutoff(
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3, typename K::Triangle_3>::result_type
#endif
intersection_coplanar_triangles(
const typename K::Triangle_3& t1,
const typename K::Triangle_3& t2,
@ -133,12 +125,8 @@ intersection_coplanar_triangles(
template<typename K>
struct Triangle_Line_visitor {
#if CGAL_INTERSECTION_VERSION < 2
typedef CGAL::Object result_type;
#else
typedef typename Intersection_traits<K, typename K::Triangle_3, typename K::Triangle_3 >
::result_type result_type;
#endif
result_type
operator()(const typename K::Point_3& p, const typename K::Segment_3&) const {
@ -157,11 +145,7 @@ struct Triangle_Line_visitor {
result_type
operator()(const typename K::Segment_3& s1, const typename K::Segment_3& s2) const {
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Segment_3>::result_type
#endif
v = intersection_collinear_segments(s1,s2,K());
if(v) {
@ -176,11 +160,7 @@ struct Triangle_Line_visitor {
};
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3, typename K::Triangle_3>::result_type
#endif
intersection(
const typename K::Triangle_3& t1,
const typename K::Triangle_3& t2,
@ -188,11 +168,7 @@ intersection(
{
CGAL_precondition(!t1.is_degenerate() && !t2.is_degenerate());
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Plane_3, typename K::Plane_3>::result_type
#endif
v = internal::intersection(t1.supporting_plane(), t2.supporting_plane(), k);
if(!v) {
@ -208,11 +184,7 @@ intersection(
if(const typename K::Line_3* line=intersect_get<typename K::Line_3>(v)) {
//The supporting planes of the triangles intersect along a line.
typedef
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3, typename K::Line_3>::result_type
#endif
Triangle_Line_Inter;
Triangle_Line_Inter inter1 = intersection_coplanar(t1,*line,k);
@ -226,15 +198,15 @@ intersection(
Triangle_Line_visitor<K> vis;
if(const typename K::Point_3* p1 = intersect_get<typename K::Point_3>(inter1)) {
if(const typename K::Point_3* p2 = intersect_get<typename K::Point_3>(inter2)) {
vis(*p1, *p2);
return vis(*p1, *p2);
} else if(const typename K::Segment_3* s2 = intersect_get<typename K::Segment_3>(inter2)) {
vis(*p1, *s2);
return vis(*p1, *s2);
}
} else if(const typename K::Segment_3* s1 = intersect_get<typename K::Segment_3>(inter1)) {
if(const typename K::Point_3* p2 = intersect_get<typename K::Point_3>(inter2)) {
vis(*s1, *p2);
return vis(*s1, *p2);
} else if(const typename K::Segment_3* s2 = intersect_get<typename K::Segment_3>(inter2)) {
vis(*s1, *s2);
return vis(*s1, *s2);
}
}
#else

View File

@ -109,11 +109,7 @@ t3l3_intersection_coplanar_aux(const typename K::Point_3& a,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3, typename K::Line_3>::result_type
#endif
intersection_coplanar(const typename K::Triangle_3 &t,
const typename K::Line_3 &l,
const K & k )
@ -314,11 +310,7 @@ intersection_coplanar(const typename K::Triangle_3 &t,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits<K, typename K::Line_3, typename K::Triangle_3>::result_type
#endif
t3l3_intersection_aux(const typename K::Triangle_3 &t,
const typename K::Line_3 &l,
const K&)
@ -327,11 +319,7 @@ t3l3_intersection_aux(const typename K::Triangle_3 &t,
// k.intersect_3_object();
// The intersection between a Line and Plane is either Point or Line
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Plane_3>::result_type
#endif
v = internal::intersection(l,t.supporting_plane(), K());
// Intersection should be a point (because of orientation test done before)
@ -348,11 +336,7 @@ t3l3_intersection_aux(const typename K::Triangle_3 &t,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits<K, typename K::Line_3, typename K::Triangle_3>::result_type
#endif
intersection(const typename K::Triangle_3 &t,
const typename K::Line_3 &l,
const K& k)
@ -428,11 +412,7 @@ intersection(const typename K::Triangle_3 &t,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename CGAL::Intersection_traits<K, typename K::Line_3, typename K::Triangle_3>::result_type
#endif
intersection(const typename K::Line_3 &l,
const typename K::Triangle_3 &t,
const K& k)

View File

@ -70,14 +70,8 @@ t3r3_intersection_coplanar_aux(const typename K::Point_3& p,
}
// the return type is the same as the intersection(Triangle Ray). We
// spell it out here for clarity.
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename boost::optional< boost::variant< typename K::Point_3, typename K::Segment_3> >
#endif
typename IT<K, typename K::Triangle_3, typename K::Ray_3>::result_type
t3r3_intersection_coplanar_aux(const typename K::Point_3& a,
const typename K::Point_3& b,
const typename K::Point_3& c,
@ -167,14 +161,8 @@ t3r3_intersection_coplanar_aux(const typename K::Point_3& a,
return intersection_return<K, typename K::Triangle_3, typename K::Ray_3>();
}
// the return type is the same as the intersection(Triangle Ray). We
// spell it out here for clarity.
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename boost::optional< boost::variant< typename K::Point_3, typename K::Segment_3> >
#endif
typename IT<K, typename K::Triangle_3, typename K::Ray_3>::result_type
intersection_coplanar(const typename K::Triangle_3 &t,
const typename K::Ray_3 &r,
const K & k )
@ -441,12 +429,8 @@ t3r3_intersection_aux(const typename K::Triangle_3 &t,
const typename K::Ray_3 &r,
const K& k)
{
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Plane_3>
::result_type
#endif
v = internal::intersection(r.supporting_line(),t.supporting_plane(), k);
if(v) {
@ -458,12 +442,8 @@ t3r3_intersection_aux(const typename K::Triangle_3 &t,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3,
typename K::Ray_3>::result_type
#endif
intersection(const typename K::Triangle_3 &t,
const typename K::Ray_3 &r,
const K& k)
@ -604,11 +584,7 @@ intersection(const typename K::Triangle_3 &t,
}
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Ray_3, typename K::Triangle_3>::result_type
#endif
intersection(const typename K::Ray_3 &r,
const typename K::Triangle_3 &t,
const K& k) {

View File

@ -72,11 +72,7 @@ t3s3_intersection_coplanar_aux(const typename K::Point_3& p,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3, typename K::Segment_3>::result_type
#endif
t3s3_intersection_coplanar_aux(const typename K::Point_3& a,
const typename K::Point_3& b,
const typename K::Point_3& c,
@ -142,11 +138,7 @@ t3s3_intersection_coplanar_aux(const typename K::Point_3& a,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Triangle_3, typename K::Segment_3>::result_type
#endif
t3s3_intersection_collinear_aux(const typename K::Point_3& a,
const typename K::Point_3& b,
const typename K::Point_3& p,
@ -188,11 +180,7 @@ t3s3_intersection_collinear_aux(const typename K::Point_3& a,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Triangle_3>::result_type
#endif
intersection_coplanar(const typename K::Triangle_3 &t,
const typename K::Segment_3 &s,
const K & k )
@ -406,11 +394,7 @@ intersection_coplanar(const typename K::Triangle_3 &t,
template <class K>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3, typename K::Triangle_3>::result_type
#endif
intersection(const typename K::Triangle_3 &t,
const typename K::Segment_3 &s,
const K & k)
@ -457,12 +441,8 @@ intersection(const typename K::Triangle_3 &t,
{
// The intersection should be a point
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Plane_3>
::result_type
#endif
v = internal::intersection(s.supporting_line(),t.supporting_plane(), K());
if(v) {
if(const Point_3* res = intersect_get<Point_3>(v))
@ -498,11 +478,7 @@ intersection(const typename K::Triangle_3 &t,
&& orientation(q,p,b,c) != POSITIVE
&& orientation(q,p,c,a) != POSITIVE )
{
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Line_3, typename K::Plane_3>::result_type
#endif
v = internal::intersection(s.supporting_line(),t.supporting_plane(), K());
if(v) {
if(const Point_3* res = intersect_get<Point_3>(v))
@ -571,12 +547,8 @@ intersection(const typename K::Triangle_3 &t,
template <class K>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename Intersection_traits<K, typename K::Segment_3,
typename K::Triangle_3>::result_type
#endif
intersection(const typename K::Segment_3 &s,
const typename K::Triangle_3 &t,
const K & k)

View File

@ -44,11 +44,7 @@ namespace CGAL {
// intersections with Bbox_3 for which no kernel traits exist
template<class A>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT< typename CGAL::Kernel_traits<A>::Kernel, A, CGAL::Bbox_3 >::result_type
#endif
intersection(const A& a, const CGAL::Bbox_3& b) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().intersect_3_object()(a, b);
@ -56,11 +52,7 @@ namespace CGAL {
template<class A>
inline
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT< typename CGAL::Kernel_traits<A>::Kernel, A, CGAL::Bbox_3 >::result_type
#endif
intersection(const CGAL::Bbox_3& b, const A& a) {
typedef typename CGAL::Kernel_traits<A>::Kernel Kernel;
return Kernel().intersect_3_object()(a, b);

View File

@ -23,31 +23,35 @@
#include <CGAL/Intersection_traits.h>
#if !(CGAL_INTERSECTION_VERSION < 2)
namespace CGAL {
CGAL_INTERSECTION_TRAITS_2(Line_d, Line_d, Point_d, Line_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Line_d, Line_d, Point_d, Line_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Line_d, Point_d, Segment_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Line_d, Segment_d, Point_d, Segment_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Line_d, Point_d, Segment_d)
CGAL_INTERSECTION_TRAITS_2(Line_d, Segment_d, Point_d, Segment_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Segment_d, Point_d, Segment_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Segment_d, Point_d, Segment_d)
CGAL_INTERSECTION_TRAITS_2(Ray_d, Line_d, Point_d, Ray_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Line_d, Ray_d, Point_d, Ray_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Ray_d, Line_d, Point_d, Ray_d)
CGAL_INTERSECTION_TRAITS_2(Line_d, Ray_d, Point_d, Ray_d)
CGAL_INTERSECTION_TRAITS_2(Ray_d, Segment_d, Point_d, Segment_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Ray_d, Point_d, Segment_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Ray_d, Segment_d, Point_d, Segment_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Ray_d, Point_d, Segment_d)
CGAL_INTERSECTION_TRAITS_3(Ray_d, Ray_d, Point_d, Segment_d, Ray_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_3(Ray_d, Ray_d, Point_d, Segment_d, Ray_d)
CGAL_INTERSECTION_TRAITS_2(Hyperplane_d, Line_d, Point_d, Line_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Line_d, Hyperplane_d, Point_d, Line_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Hyperplane_d, Line_d, Point_d, Line_d)
CGAL_INTERSECTION_TRAITS_2(Line_d, Hyperplane_d, Point_d, Line_d)
CGAL_INTERSECTION_TRAITS_2(Hyperplane_d, Ray_d, Point_d, Ray_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Ray_d, Hyperplane_d, Point_d, Ray_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Hyperplane_d, Ray_d, Point_d, Ray_d)
CGAL_INTERSECTION_TRAITS_2(Ray_d, Hyperplane_d, Point_d, Ray_d)
CGAL_INTERSECTION_TRAITS_2(Hyperplane_d, Segment_d, Point_d, Segment_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Hyperplane_d, Point_d, Segment_d, Intersection_dim_d)
CGAL_INTERSECTION_TRAITS_2(Hyperplane_d, Segment_d, Point_d, Segment_d)
CGAL_INTERSECTION_TRAITS_2(Segment_d, Hyperplane_d, Point_d, Segment_d)
}
#endif // !(CGAL_INTERSECTION_VERSION < 2)
#endif /* CGAL_INTERSECTION_TRAITS_D_H */

View File

@ -34,11 +34,7 @@ namespace CGAL {
namespace internal {
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Line_d, typename R::Line_d>::result_type
#endif
intersection(const typename R::Line_d& l1, const typename R::Line_d& l2, const R&)
{
typedef typename R::Line_d_Line_d_pair ll_pair;
@ -59,11 +55,7 @@ intersection(const typename R::Line_d& l1, const typename R::Line_d& l2, const R
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Ray_d, typename R::Ray_d>::result_type
#endif
intersection(const typename R::Ray_d& l1, const typename R::Ray_d& l2, const R&)
{
typedef typename R::Ray_d_Ray_d_pair ll_pair;
@ -92,11 +84,7 @@ intersection(const typename R::Ray_d& l1, const typename R::Ray_d& l2, const R&)
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Segment_d, typename R::Segment_d>::result_type
#endif
intersection(const typename R::Segment_d& l1, const typename R::Segment_d& l2, const R&)
{
typedef typename R::Segment_d_Segment_d_pair ll_pair;
@ -120,11 +108,7 @@ intersection(const typename R::Segment_d& l1, const typename R::Segment_d& l2, c
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Line_d, typename R::Ray_d>::result_type
#endif
intersection(const typename R::Line_d& l, const typename R::Ray_d& r, const R&)
{
typedef typename R::Line_d_Ray_d_pair lr_pair;
@ -146,20 +130,12 @@ intersection(const typename R::Line_d& l, const typename R::Ray_d& r, const R&)
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Ray_d, typename R::Line_d>::result_type
#endif
intersection(const typename R::Ray_d& r, const typename R::Line_d& l, const R& k)
{ return intersection(l,r,k); }
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Ray_d, typename R::Segment_d>::result_type
#endif
intersection(const typename R::Ray_d& r, const typename R::Segment_d& s, const R&)
{
typedef typename R::Ray_d_Segment_d_pair rs_pair;
@ -183,20 +159,12 @@ intersection(const typename R::Ray_d& r, const typename R::Segment_d& s, const R
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Segment_d, typename R::Ray_d>::result_type
#endif
intersection(const typename R::Segment_d& s, const typename R::Ray_d& r, const R& k)
{ return intersection(r,s, k); }
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Line_d, typename R::Segment_d>::result_type
#endif
intersection(const typename R::Line_d& l, const typename R::Segment_d& s, const R&)
{
typedef typename R::Line_d_Segment_d_pair rs_pair;
@ -220,20 +188,12 @@ intersection(const typename R::Line_d& l, const typename R::Segment_d& s, const
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Segment_d, typename R::Line_d>::result_type
#endif
intersection(const typename R::Segment_d& s, const typename R::Line_d& l, const R& r)
{ return intersection(l,s,r); }
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Line_d, typename R::Hyperplane_d>::result_type
#endif
intersection(const typename R::Line_d& l, const typename R::Hyperplane_d& h, const R&)
{
typedef typename R::Line_d_Hyperplane_d_pair lh_pair;
@ -254,20 +214,12 @@ intersection(const typename R::Line_d& l, const typename R::Hyperplane_d& h, con
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Hyperplane_d, typename R::Line_d>::result_type
#endif
intersection(const typename R::Hyperplane_d& h, const typename R::Line_d& l, const R& r)
{ return intersection(l,h,r); }
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Ray_d, typename R::Hyperplane_d>::result_type
#endif
intersection(const typename R::Ray_d& r, const typename R::Hyperplane_d& h, const R&)
{
typedef typename R::Ray_d_Hyperplane_d_pair rh_pair;
@ -288,20 +240,12 @@ intersection(const typename R::Ray_d& r, const typename R::Hyperplane_d& h, cons
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Hyperplane_d, typename R::Ray_d>::result_type
#endif
intersection(const typename R::Hyperplane_d& h, const typename R::Ray_d& r, const R& k)
{ return intersection(r,h,k); }
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Segment_d, typename R::Hyperplane_d>::result_type
#endif
intersection(const typename R::Segment_d& s, const typename R::Hyperplane_d& h, const R&)
{
typedef typename R::Segment_d_Hyperplane_d_pair sh_pair;
@ -322,11 +266,7 @@ intersection(const typename R::Segment_d& s, const typename R::Hyperplane_d& h,
}
template <class R>
#if CGAL_INTERSECTION_VERSION < 2
CGAL::Object
#else
typename IT<R, typename R::Hyperplane_d, typename R::Segment_d>::result_type
#endif
intersection(const typename R::Hyperplane_d& h, const typename R::Segment_d& s, const R& r)
{ return intersection(s,h,r); }