Reorganize header files

This commit is contained in:
Andreas Fabri 2018-02-20 16:48:11 +00:00
parent 09c7fe1103
commit 4111e3e20c
39 changed files with 331 additions and 419 deletions

View File

@ -30,7 +30,7 @@
#include <CGAL/internal/Static_filters/Static_filter_error.h>
#include <CGAL/internal/Static_filters/tools.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h>
#include <CGAL/Intersections_3/Bbox_3_Segment_3.h>
// for CGAL::internal::do_intersect_bbox_segment_aux
#include <iostream>

View File

@ -68,6 +68,16 @@
#endif
#define CGAL_NO_INTERSECTION_FUNCTION_SELF(A, DIM) \
template <typename K> \
inline void intersection(const A<K>&, const A<K>&) {}
#define CGAL_NO_INTERSECTION_FUNCTION(A, B, DIM) \
template <typename K> \
inline void intersection(const A<K>&, const B<K>&) {} \
template <typename K> \
inline void intersection(const B<K>&, const A<K>&) {}
#define CGAL_INTERSECTION_FUNCTION(A, B, DIM) \
template<typename K> \
inline \

View File

@ -143,6 +143,29 @@ struct Intersection_traits<K, typename K::Point_3, typename K::Iso_cuboid_3> {
typedef typename boost::optional< variant_type > result_type;
};
// Bbox_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, Bbox_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
template<typename K>
struct Intersection_traits<K, typename K::Point_3, Bbox_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Iso_cuboid_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Iso_cuboid_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Point_3 Line_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Point_3, typename K::Line_3> {
@ -151,6 +174,14 @@ struct Intersection_traits<K, typename K::Point_3, typename K::Line_3> {
typedef typename boost::optional< variant_type > result_type;
};
// Line_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Line_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Point_3 Ray_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Point_3, typename K::Ray_3> {
@ -159,6 +190,14 @@ struct Intersection_traits<K, typename K::Point_3, typename K::Ray_3> {
typedef typename boost::optional< variant_type > result_type;
};
// Ray_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Ray_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Point_3 Segment_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Point_3, typename K::Segment_3> {
@ -167,6 +206,14 @@ struct Intersection_traits<K, typename K::Point_3, typename K::Segment_3> {
typedef typename boost::optional< variant_type > result_type;
};
// Segment_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Segment_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Point_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Point_3, typename K::Point_3> {
@ -182,6 +229,59 @@ struct Intersection_traits<K, typename K::Point_3, typename K::Plane_3> {
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Plane_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Plane_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Point_3 Triangle_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Point_3, typename K::Triangle_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Triangle_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Triangle_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Point_3 Tetrahedron_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Point_3, typename K::Tetrahedron_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Tetrahedron_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Tetrahedron_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Point_3 Sphere_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Point_3, typename K::Sphere_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
// Sphere_3 Point_3, variant of one
template<typename K>
struct Intersection_traits<K, typename K::Sphere_3, typename K::Point_3> {
typedef typename
boost::variant< typename K::Point_3 > variant_type;
typedef typename boost::optional< variant_type > result_type;
};
} // namespace
#endif // !(CGAL_INTERSECTION_VERSION < 2)

View File

@ -19,8 +19,8 @@
//
// Author(s) : Maxime Gimeno
#ifndef CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H
#define CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H
#ifndef CGAL_INTERSECTIONS_3_ISO_CUBOID_3_POINT_3_H
#define CGAL_INTERSECTIONS_3_ISO_CUBOID_3_POINT_3_H
#include <CGAL/Iso_cuboid_3.h>
#include <CGAL/Point_3.h>
@ -81,4 +81,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Iso_cuboid_3, 3)
} //namespace CGAL
#endif // CGAL_POINT_3_ISO_CUBOID_3_INTERSECTION_H
#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_POINT_3_H

View File

@ -19,8 +19,8 @@
//
// Author(s) : Maxime Gimeno
#ifndef CGAL_POINT_3_LINE_3_INTERSECTION_H
#define CGAL_POINT_3_LINE_3_INTERSECTION_H
#ifndef CGAL_INTERSECTIONS_3_LINE_3_POINT_3_H
#define CGAL_INTERSECTIONS_3_LINE_3_POINT_3_H
#include <CGAL/Line_3.h>
#include <CGAL/Point_3.h>
@ -81,4 +81,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Line_3, 3)
} //namespace CGAL
#endif // CGAL_POINT_3_LINE_3_INTERSECTION_H
#endif // CGAL_INTERSECTIONS_3_LINE_3_POINT_3_H

View File

@ -19,8 +19,8 @@
//
// Author(s) : Maxime Gimeno
#ifndef CGAL_POINT_3_PLANE_3_INTERSECTION_H
#define CGAL_POINT_3_PLANE_3_INTERSECTION_H
#ifndef CGAL_INTERSECTIONS_3_PLANE_3_POINT_3_PLANE_3_H
#define CGAL_INTERSECTIONS_3_PLANE_3_POINT_3_PLANE_3_H
#include <CGAL/Plane_3.h>
#include <CGAL/Point_3.h>
@ -80,4 +80,4 @@ CGAL_INTERSECTION_FUNCTION(Point_3, Plane_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Point_3, Plane_3, 3)
} //namespace CGAL
#endif // CGAL_POINT_3_PLANE_3_INTERSECTION_H
#endif // CGAL_INTERSECTIONS_3_PLANE_3_POINT_3_PLANE_3_H

View File

@ -19,8 +19,8 @@
//
// Author(s) : Maxime Gimeno
#ifndef CGAL_POINT_3_POINT_3_INTERSECTION_H
#define CGAL_POINT_3_POINT_3_INTERSECTION_H
#ifndef CGAL_INTERSECTIONS_3_POINT_3_POINT_3_H
#define CGAL_INTERSECTIONS_3_POINT_3_POINT_3_H
#include <CGAL/Point_3.h>
#include <CGAL/Intersection_traits_3.h>
@ -60,4 +60,4 @@ CGAL_INTERSECTION_FUNCTION_SELF(Point_3, 3)
CGAL_DO_INTERSECT_FUNCTION_SELF(Point_3, 3)
}//nmaespace cgal
#endif // CGAL_POINT_3_POINT_3_INTERSECTION_H
#endif // CGAL_INTERSECTIONS_3_POINT_3_POINT_3_H

View File

@ -19,8 +19,8 @@
//
// Author(s) : Maxime Gimeno
#ifndef CGAL_POINT_3_RAY_3_INTERSECTION_H
#define CGAL_POINT_3_RAY_3_INTERSECTION_H
#ifndef CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H
#define CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H
#include <CGAL/Ray_3.h>
#include <CGAL/Point_3.h>
@ -85,4 +85,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Ray_3, 3)
} //namespace CGAL
#endif // CGAL_POINT_3_RAY_3_INTERSECTION_H
#endif // CGAL_INTERSECTIONS_3_POINT_3_RAY_3_H

View File

@ -19,8 +19,8 @@
//
// Author(s) : Maxime Gimeno
#ifndef CGAL_POINT_3_SEGMENT_3_INTERSECTION_H
#define CGAL_POINT_3_SEGMENT_3_INTERSECTION_H
#ifndef CGAL_INTERSECTIONS_3_POINT_3_SEGMENT_3_H
#define CGAL_INTERSECTIONS_3_POINT_3_SEGMENT_3_H
#include <CGAL/Segment_3.h>
#include <CGAL/Point_3.h>
@ -86,4 +86,4 @@ CGAL_DO_INTERSECT_FUNCTION(Point_3, Segment_3, 3)
} //namespace CGAL
#endif // CGAL_POINT_3_SEGMENT_3_INTERSECTION_H
#endif // CGAL_INTERSECTIONS_3_POINT_3_SEGMENT_3_H

View File

@ -19,8 +19,8 @@
//
// Author(s) : Philippe Guigue
#ifndef CGAL_TRIANGLE_3_POINT_3_DO_INTERSECT_H
#define CGAL_TRIANGLE_3_POINT_3_DO_INTERSECT_H
#ifndef CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H
#define CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H
#include <CGAL/enum.h>
#include <CGAL/kernel_assertions.h>
@ -103,12 +103,36 @@ bool do_intersect(const typename K::Point_3 &p,
return do_intersect(t, p, k);
}
template <class K>
inline
typename CGAL::Intersection_traits
<K, typename K::Point_3, typename K::Triangle_3>::result_type
intersection(const typename K::Point_3 &pt,
const typename K::Triangle_3 &tr,
const K& k)
{
if (do_intersect(pt,tr, k)) {
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Triangle_3>(pt);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Triangle_3>();
}
template <class K>
inline
typename CGAL::Intersection_traits
<K, typename K::Triangle_3, typename K::Point_3>::result_type
intersection( const typename K::Triangle_3 &tr,
const typename K::Point_3 &pt,
const K& k)
{
return internal::intersection(pt, tr, k);
}
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Point_3, 3)
CGAL_INTERSECTION_FUNCTION(Triangle_3, Point_3, 3)
} //namespace CGAL
#endif // CGAL_TRIANGLE_3_POINT_3_DO_INTERSECT_H
#endif // CGAL_INTERSECTIONS_3_POINT_3_TRIANGLE_3_H

View File

@ -39,6 +39,9 @@ namespace CGAL {
{
return CGAL::do_overlap(c, bbox);
}
void intersection(const CGAL::Bbox_3&,
const CGAL::Bbox_3&){}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_BBOX_3_DO_INTERSECT_H

View File

@ -48,21 +48,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Bbox_3& a,
const Iso_cuboid_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Iso_cuboid_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(b, a);
}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_ISO_CUBOID_3_DO_INTERSECT_H

View File

@ -158,20 +158,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Bbox_3 a,
const Line_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Line_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_LINE_3_DO_INTERSECT_H

View File

@ -153,31 +153,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Bbox_3 a,
const Plane_3<K>& b) {
return K().do_intersect_3_object()(b, a);
}
template<typename K>
bool do_intersect(const Plane_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Iso_cuboid_3<K>& a,
const Plane_3<K>& b) {
return K().do_intersect_3_object()(b, a);
}
template<typename K>
bool do_intersect(const Plane_3<K>& a,
const Iso_cuboid_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_PLANE_3_DO_INTERSECT_H

View File

@ -26,7 +26,7 @@
#include <CGAL/Ray_3.h>
#include <CGAL/Bbox_3.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h>
#include <CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h>
// for CGAL::internal::do_intersect_bbox_segment_aux
// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf
@ -69,19 +69,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Bbox_3 a,
const Ray_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Ray_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_RAY_3_DO_INTERSECT_H

View File

@ -461,20 +461,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Bbox_3 a,
const Segment_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Segment_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#include <CGAL/enable_warnings.h>

View File

@ -116,22 +116,25 @@ namespace internal {
return do_intersect_sphere_box_3(sphere, bbox, K());
}
template <class K>
bool do_intersect(const typename K::Iso_cuboid_3& bbox,
const typename K::Sphere_3& sphere,
const K&)
{
return do_intersect_sphere_box_3(sphere, bbox, K());
}
template <class K>
bool do_intersect(const typename K::Sphere_3& sphere,
const typename K::Iso_cuboid_3& bbox,
const K&)
{
return do_intersect_sphere_box_3(sphere, bbox, K());
}
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Bbox_3& a,
const Sphere_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Sphere_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_BBOX_3_SPHERE_3_DO_INTERSECT_H

View File

@ -33,7 +33,7 @@
// a minimal cost (and we use C++ ;).
#include <CGAL/Uncertain.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h>
#include <CGAL/Intersections_3/internal/Bbox_3_Plane_3_do_intersect.h>
namespace CGAL {
@ -399,20 +399,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Bbox_3& a,
const Triangle_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Triangle_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#include <CGAL/enable_warnings.h>

View File

@ -26,7 +26,7 @@
#include <CGAL/Ray_3.h>
#include <CGAL/Iso_cuboid_3.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h>
#include <CGAL/Intersections_3/internal/Bbox_3_Ray_3_do_intersect.h>
// for CGAL::internal::do_intersect_bbox_segment_aux
// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf
@ -70,19 +70,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const Iso_cuboid_3<K> a,
const Ray_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Ray_3<K>& a,
const Iso_cuboid_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_RAY_3_DO_INTERSECT_H

View File

@ -26,7 +26,7 @@
#include <CGAL/Segment_3.h>
#include <CGAL/Iso_cuboid_3.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h>
#include <CGAL/Intersections_3/internal/Bbox_3_Segment_3_do_intersect.h>
// for CGAL::internal::do_intersect_bbox_segment_aux
// inspired from http://cag.csail.mit.edu/~amy/papers/box-jgt.pdf
@ -70,19 +70,6 @@ namespace internal {
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const Iso_cuboid_3<K> a,
const Segment_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Segment_3<K>& a,
const Iso_cuboid_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SEGMENT_3_DO_INTERSECT_H

View File

@ -25,7 +25,7 @@
#include <CGAL/Sphere_3.h>
#include <CGAL/Iso_cuboid_3.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h>
#include <CGALL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h>
namespace CGAL {

View File

@ -31,7 +31,7 @@
// a minimal cost (and we use C++ ;).
#include <CGAL/Uncertain.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h>
#include <CGAL/Intersections_3/internal/Bbox_3_Triangle_3_do_intersect.h>
namespace CGAL {
@ -59,18 +59,6 @@ namespace internal {
} // namespace Intersections
template<typename K>
bool do_intersect(const Iso_cuboid_3<K>& a,
const Triangle_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const Triangle_3<K>& a,
const Iso_cuboid_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL

View File

@ -23,12 +23,13 @@
//
// Author(s) : Nico Kruithof
#ifndef CGAL_TRIANGLE_3_TETRAHEDRON_3_DO_INTERSECT_H
#define CGAL_TRIANGLE_3_TETRAHEDRON_3_DO_INTERSECT_H
#ifndef CGAL_TETRAHEDRON_3_BOUNDED_3_DO_INTERSECT_H
#define CGAL_TETRAHEDRON_3_BOUNDED_3_DO_INTERSECT_H
#include <CGAL/Triangle_3_Triangle_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h>
#include <CGAL/Intersections_3/Triangle_3_Triangle_3.h>
#include <CGAL/Intersections_3/Segment_3_Triangle_3.h>
#include <CGAL/Intersections_3/internal/Iso_cuboid_3_Triangle_3_do_intersect.h>
#include <CGAL/Intersections_3/internal/Triangle_3_Sphere_3_do_intersect.h>
namespace CGAL {
@ -175,7 +176,7 @@ do_intersect(const typename K::Tetrahedron_3 &tet,
template <class K>
inline
typename K::Boolean
do_intersect(const CGAL::Bbox_3 &bb,
do_intersect(const CGAL::Bbox_3 &bb,
const typename K::Tetrahedron_3 &tet,
const K & k)
{
@ -184,27 +185,6 @@ typename K::Boolean
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Tetrahedron_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Segment_3, Tetrahedron_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Tetrahedron_3, 3)
CGAL_DO_INTERSECT_FUNCTION_SELF(Tetrahedron_3, 3)
template<typename K>
bool do_intersect(const CGAL::Tetrahedron_3<K>& a,
const CGAL::Bbox_3& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const CGAL::Bbox_3& b,
const CGAL::Tetrahedron_3<K>& a) {
return K().do_intersect_3_object()(a, b);
}
} //namespace CGAL
#endif // CGAL_TRIANGLE_3_TETRAHEDRON_3_DO_INTERSECT_H
#endif // CGAL_TETRAHEDRON_3_BOUNDED_3_DO_INTERSECT_H

View File

@ -26,7 +26,8 @@
#include <CGAL/Plane_3.h>
#include <CGAL/Line_3.h>
#include <CGAL/Ray_3.h>
#include <CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h>
#include <CGAL/Intersections_3/Sphere_3_Triangle_3.h>
#include <CGAL/Intersections_3/Plane_3_Triangle_3.h>
namespace CGAL {
@ -48,6 +49,13 @@ bool do_intersect_tetrahedron_unbounded(const typename K::Tetrahedron_3& tet,
template<typename K>
bool do_intersect(const typename K::Plane_3& unb,
const typename K::Tetrahedron_3& tet,
const K& k) {
return do_intersect_tetrahedron_unbounded(tet, unb, k);
}
template<typename K>
bool do_intersect(const typename K::Tetrahedron_3& tet,
const typename K::Plane_3& unb,
@ -56,6 +64,13 @@ bool do_intersect(const typename K::Tetrahedron_3& tet,
}
template<typename K>
bool do_intersect(const typename K::Line_3& unb,
const typename K::Tetrahedron_3& tet,
const K& k) {
return do_intersect_tetrahedron_unbounded(tet, unb, k);
}
template<typename K>
bool do_intersect(const typename K::Tetrahedron_3& tet,
const typename K::Line_3& unb,
@ -64,6 +79,13 @@ bool do_intersect(const typename K::Tetrahedron_3& tet,
}
template<typename K>
bool do_intersect(const typename K::Ray_3& unb,
const typename K::Tetrahedron_3& tet,
const K& k) {
return do_intersect_tetrahedron_unbounded(tet, unb, k);
}
template<typename K>
bool do_intersect(const typename K::Tetrahedron_3& tet,
const typename K::Ray_3& unb,
@ -73,48 +95,6 @@ bool do_intersect(const typename K::Tetrahedron_3& tet,
} // namespace internal
} // namespace Intersections
template<typename K>
bool do_intersect(const CGAL::Tetrahedron_3<K>& a,
const CGAL::Plane_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const CGAL::Plane_3<K>& b,
const CGAL::Tetrahedron_3<K>& a) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const CGAL::Tetrahedron_3<K>& a,
const CGAL::Line_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const CGAL::Line_3<K>& b,
const CGAL::Tetrahedron_3<K>& a) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const CGAL::Tetrahedron_3<K>& a,
const CGAL::Ray_3<K>& b) {
return K().do_intersect_3_object()(a, b);
}
template<typename K>
bool do_intersect(const CGAL::Ray_3<K>& b,
const CGAL::Tetrahedron_3<K>& a) {
return K().do_intersect_3_object()(a, b);
}
} // namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_TETRAHEDRON_3_DO_INTERSECT_H

View File

@ -121,9 +121,6 @@ bool do_intersect(const typename K::Line_3 &l,
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Line_3, 3)
} //namespace CGAL
#endif //CGAL_TRIANGLE_3_LINE_3_DO_INTERSECT_H

View File

@ -424,10 +424,6 @@ intersection(const typename K::Line_3 &l,
} // end namespace internal
} // namespace Intersections
CGAL_INTERSECTION_FUNCTION(Triangle_3, Line_3, 3)
} // end namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_TRIANGLE_3_LINE_3_INTERSECTION_H

View File

@ -84,9 +84,6 @@ bool do_intersect(const typename K::Plane_3 &h,
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Plane_3, 3)
} //namespace CGAL
#endif //CGAL_TRIANGLE_3_PLANE_3_DO_INTERSECT_H

View File

@ -383,9 +383,6 @@ do_intersect_coplanar(const typename K::Triangle_3 &t,
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Ray_3, 3)
} //namespace CGAL
#endif // CGAL_TRIANGLE_3_RAY_3_DO_INTERSECT_H

View File

@ -585,9 +585,6 @@ intersection(const typename K::Ray_3 &r,
} // end namespace internal
} // namespace Intersections
CGAL_INTERSECTION_FUNCTION(Triangle_3, Ray_3, 3)
} // end namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_TRIANGLE_3_RAY_3_INTERSECTION_H

View File

@ -332,9 +332,6 @@ bool do_intersect(const typename K::Segment_3 &s,
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Segment_3, 3)
} //namespace CGAL
#endif //CGAL_TRIANGLE_3_SEGMENT_3_DO_INTERSECT_H

View File

@ -563,12 +563,8 @@ intersection(const typename K::Segment_3 &s,
return internal::intersection(t,s,k);
}
} // end namespace internal
} // namespace Intersections
CGAL_INTERSECTION_FUNCTION(Triangle_3, Segment_3, 3)
} // end namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_TRIANGLE_3_SEGMENT_3_INTERSECTION_H

View File

@ -50,6 +50,15 @@ do_intersect(const typename K::Sphere_3 &sp,
return squared_distance(sp.center(), tr) <= sp.squared_radius();
}
template <class K>
inline
typename K::Boolean
do_intersect(const typename K::Triangle_3 &tr,
const typename K::Sphere_3 &sp,
const K & k)
{
return squared_distance(sp.center(), tr) <= sp.squared_radius();
}
template <class K>
inline
typename K::Boolean
@ -117,12 +126,6 @@ do_intersect(const typename K::Segment_3 &lin,
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION(Triangle_3, Sphere_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Line_3, Sphere_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Ray_3, Sphere_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Segment_3, Sphere_3, 3)
} // namespace CGAL
#endif // CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H

View File

@ -453,9 +453,6 @@ do_intersect(const typename K::Triangle_3 &t1,
} // namespace internal
} // namespace Intersections
CGAL_DO_INTERSECT_FUNCTION_SELF(Triangle_3, 3)
} //namespace CGAL
#endif // CGAL_TRIANGLE_3_TRIANGLE_3_DO_INTERSECT_H

View File

@ -24,6 +24,7 @@
#define CGAL_TRIANGLE_3_TRIANGLE_3_INTERSECTION_H
#include <CGAL/Intersection_traits_3.h>
#include <CGAL/Intersections_3/Line_3_Triangle_3.h>
#include <boost/next_prior.hpp>
#include <list>
@ -230,9 +231,6 @@ intersection(
} //namespace internal
} // namespace Intersections
CGAL_INTERSECTION_FUNCTION_SELF(Triangle_3, 3)
} // namespace CGAL

View File

@ -24,12 +24,17 @@
// Author(s) : Geert-Jan Giezeman <geert@cs.uu.nl>
// Sebastien Loriot <Sebastien.Loriot@geometryfactory.com>
#ifndef CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H
#define CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H
#include <CGAL/wmult.h>
#include <boost/next_prior.hpp>
#include <CGAL/Intersection_traits_3.h>
#include <CGAL/number_utils.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Line_3.h>
#include <CGAL/Intersections_3/internal/bbox_intersection_3.h>
namespace CGAL {
template <class K>
@ -70,100 +75,7 @@ intersection(const Plane_3<K> &plane1, const Plane_3<K> &plane2,
return K().intersect_3_object()(plane1, plane2, plane3);
}
CGAL_INTERSECTION_FUNCTION(Plane_3, Line_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Plane_3, Line_3, 3)
CGAL_INTERSECTION_FUNCTION_SELF(Plane_3, 3)
CGAL_INTERSECTION_FUNCTION_SELF(Line_3, 3)
CGAL_DO_INTERSECT_FUNCTION_SELF(Line_3, 3)
CGAL_INTERSECTION_FUNCTION_SELF(Segment_3, 3)
CGAL_DO_INTERSECT_FUNCTION_SELF(Segment_3, 3)
CGAL_INTERSECTION_FUNCTION(Line_3, Segment_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Line_3, Segment_3, 3)
CGAL_INTERSECTION_FUNCTION(Line_3, Ray_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Line_3, Ray_3, 3)
CGAL_INTERSECTION_FUNCTION(Segment_3, Ray_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Segment_3, Ray_3, 3)
CGAL_INTERSECTION_FUNCTION_SELF(Ray_3, 3)
CGAL_DO_INTERSECT_FUNCTION_SELF(Ray_3, 3)
CGAL_INTERSECTION_FUNCTION(Plane_3, Sphere_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Plane_3, Sphere_3, 3)
CGAL_INTERSECTION_FUNCTION_SELF(Sphere_3, 3)
CGAL_DO_INTERSECT_FUNCTION_SELF(Sphere_3, 3)
CGAL_INTERSECTION_FUNCTION(Plane_3, Ray_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Plane_3, Ray_3, 3)
CGAL_INTERSECTION_FUNCTION(Plane_3, Segment_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Plane_3, Segment_3, 3)
CGAL_INTERSECTION_FUNCTION(Plane_3, Triangle_3, 3)
template <class K>
inline typename
cpp11::result_of<typename K::Intersect_3(typename K::Line_3, Bbox_3)>::type
intersection(const Line_3<K> &a,
const Bbox_3 &b) {
return K().intersect_3_object()(a, b);
}
template <class K>
inline typename
cpp11::result_of<typename K::Intersect_3(typename K::Line_3, Bbox_3)>::type
intersection(const Bbox_3 &a,
const Line_3<K> &b) {
return K().intersect_3_object()(a, b);
}
template <class K>
inline typename
cpp11::result_of<typename K::Intersect_3(typename K::Ray_3, Bbox_3)>::type
intersection(const Ray_3<K> &a,
const Bbox_3 &b) {
return K().intersect_3_object()(a, b);
}
template <class K>
inline typename
cpp11::result_of<typename K::Intersect_3(typename K::Ray_3, Bbox_3)>::type
intersection(const Bbox_3 &a,
const Ray_3<K> &b) {
return K().intersect_3_object()(a, b);
}
template <class K>
inline typename
cpp11::result_of<typename K::Intersect_3(typename K::Segment_3, Bbox_3)>::type
intersection(const Segment_3<K> &a,
const Bbox_3 &b) {
return K().intersect_3_object()(a, b);
}
template <class K>
inline typename
cpp11::result_of<typename K::Intersect_3(typename K::Segment_3, Bbox_3)>::type
intersection(const Bbox_3 &a,
const Segment_3<K> &b) {
return K().intersect_3_object()(a, b);
}
CGAL_INTERSECTION_FUNCTION(Line_3, Iso_cuboid_3, 3)
CGAL_INTERSECTION_FUNCTION(Ray_3, Iso_cuboid_3, 3)
CGAL_INTERSECTION_FUNCTION(Segment_3, Iso_cuboid_3, 3)
CGAL_INTERSECTION_FUNCTION_SELF(Iso_cuboid_3, 3)
CGAL_DO_INTERSECT_FUNCTION_SELF(Plane_3, 3)
template <class R>
inline bool
@ -172,8 +84,7 @@ do_intersect(const Plane_3<R> &plane1, const Plane_3<R> &plane2,
return R().do_intersect_3_object()(plane1, plane2, plane3);
}
CGAL_DO_INTERSECT_FUNCTION_SELF(Iso_cuboid_3, 3)
CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Line_3, 3)
namespace Intersections {
@ -1705,3 +1616,5 @@ do_intersect(const Iso_cuboid_3<R> &j, const Line_3<R> &l, const R&)
} // namespace internal
} // namespace Intersections
} // namespace CGAL
#endif CGAL_INTERSECTIONS_3_INTERNAL_INTERSECTION_3_1_IMPL_H

View File

@ -29,43 +29,72 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/intersection_3_1.h>
#include <CGAL/Intersections_3/Bbox_3_Bbox_3.h>
#include <CGAL/Intersections_3/Bbox_3_Iso_cuboid_3.h>
#include <CGAL/Intersections_3/Bbox_3_Line_3.h>
#include <CGAL/Intersections_3/Bbox_3_Plane_3.h>
#include <CGAL/Intersections_3/Bbox_3_Point_3.h>
#include <CGAL/Intersections_3/Bbox_3_Ray_3.h>
#include <CGAL/Intersections_3/Bbox_3_Segment_3.h>
#include <CGAL/Intersections_3/Bbox_3_Sphere_3.h>
#include <CGAL/Intersections_3/Bbox_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Bbox_3_Triangle_3.h>
#include <CGAL/internal/Intersections_3/Triangle_3_Line_3_intersection.h>
#include <CGAL/internal/Intersections_3/Triangle_3_Ray_3_intersection.h>
#include <CGAL/internal/Intersections_3/Triangle_3_Segment_3_intersection.h>
#include <CGAL/Triangle_3_Triangle_3_intersection.h>
#include <CGAL/Triangle_3_Line_3_do_intersect.h>
#include <CGAL/Triangle_3_Plane_3_do_intersect.h>
#include <CGAL/Triangle_3_Point_3_do_intersect.h>
#include <CGAL/Triangle_3_Ray_3_do_intersect.h>
#include <CGAL/Triangle_3_Segment_3_do_intersect.h>
#include <CGAL/Triangle_3_Tetrahedron_3_do_intersect.h>
#include <CGAL/Triangle_3_Triangle_3_do_intersect.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Iso_cuboid_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Line_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Plane_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Point_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Ray_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Segment_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Sphere_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Iso_cuboid_3_Triangle_3.h>
#include <CGAL/Point_3_Iso_cuboid_3_intersection.h>
#include <CGAL/Point_3_Line_3_intersection.h>
#include <CGAL/Point_3_Ray_3_intersection.h>
#include <CGAL/Point_3_Segment_3_intersection.h>
#include <CGAL/Point_3_Point_3_intersection.h>
#include <CGAL/Point_3_Plane_3_intersection.h>
#include <CGAL/Intersections_3/Line_3_Line_3.h>
#include <CGAL/Intersections_3/Line_3_Plane_3.h>
#include <CGAL/Intersections_3/Line_3_Point_3.h>
#include <CGAL/Intersections_3/Line_3_Ray_3.h>
#include <CGAL/Intersections_3/Line_3_Segment_3.h>
#include <CGAL/Intersections_3/Line_3_Sphere_3.h>
#include <CGAL/Intersections_3/Line_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Line_3_Triangle_3.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Bbox_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Line_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Ray_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Plane_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Sphere_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Bbox_3_Iso_cuboid_3_do_intersect.h>
#include <CGAL/Intersections_3/Plane_3_Plane_3.h>
#include <CGAL/Intersections_3/Plane_3_Point_3.h>
#include <CGAL/Intersections_3/Plane_3_Ray_3.h>
#include <CGAL/Intersections_3/Plane_3_Segment_3.h>
#include <CGAL/Intersections_3/Plane_3_Sphere_3.h>
#include <CGAL/Intersections_3/Plane_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Plane_3_Triangle_3.h>
#include <CGAL/internal/Intersections_3/Iso_cuboid_3_Segment_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Iso_cuboid_3_Ray_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Iso_cuboid_3_Sphere_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Iso_cuboid_3_Triangle_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Tetrahedron_3_do_intersect.h>
#include <CGAL/internal/Intersections_3/Triangle_3_Sphere_3_do_intersect.h>
#include <CGAL/Intersections_3/Point_3_Line_3.h>
#include <CGAL/Intersections_3/Point_3_Point_3.h>
#include <CGAL/Intersections_3/Point_3_Ray_3.h>
#include <CGAL/Intersections_3/Point_3_Segment_3.h>
#include <CGAL/Intersections_3/Point_3_Sphere_3.h>
#include <CGAL/Intersections_3/Point_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Point_3_Triangle_3.h>
#include <CGAL/Intersections_3/Ray_3_Ray_3.h>
#include <CGAL/Intersections_3/Ray_3_Segment_3.h>
#include <CGAL/Intersections_3/Ray_3_Sphere_3.h>
#include <CGAL/Intersections_3/Ray_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Ray_3_Triangle_3.h>
#include <CGAL/Intersections_3/Segment_3_Segment_3.h>
#include <CGAL/Intersections_3/Segment_3_Sphere_3.h>
#include <CGAL/Intersections_3/Segment_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Segment_3_Triangle_3.h>
#include <CGAL/Intersections_3/Sphere_3_Sphere_3.h>
#include <CGAL/Intersections_3/Sphere_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Sphere_3_Triangle_3.h>
#include <CGAL/Intersections_3/Tetrahedron_3_Tetrahedron_3.h>
#include <CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h>
#include <CGAL/Intersections_3/Triangle_3_Triangle_3.h>
#include <CGAL/enable_warnings.h>

View File

@ -22,6 +22,17 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "${cppfile}" )
endforeach()
foreach(VAL RANGE 1 55)
message(STATUS "NOTICE: Compiling one_${VAL}")
add_executable(one_${VAL} one.cpp)
target_compile_definitions(one_${VAL} PRIVATE -DSEL=${VAL})
target_link_libraries(one_${VAL} PRIVATE CGAL::CGAL)
if(CGAL_3RD_PARTY_LIBRARIES)
target_link_libraries(one_${VAL} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES})
endif()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")

View File

@ -1,3 +1,18 @@
#if 0
#include <CGAL/Cartesian.h>
#include <CGAL/Intersections_3/Segment_3_Segment_3.h>
typedef CGAL::Cartesian<double> K;
int main()
{
K::Segment_3 s1, s2;
std::cout << do_intersect(s1,s2) << std::endl;
return 0;
}
#else
// 3D intersection tests.
#include <CGAL/Object.h>
@ -583,3 +598,4 @@ int main()
Test< CGAL::Homogeneous<CGAL::MP_Float> >().run();
// TODO : test more kernels.
}
#endif

View File

@ -1,13 +1,14 @@
#include <cassert>
#include <CGAL/Cartesian.h>
#include <CGAL/Triangle_2_Triangle_2_do_intersect.h>
#include <CGAL/Triangle_3_Line_3_do_intersect.h>
#include <CGAL/Triangle_3_Plane_3_do_intersect.h>
#include <CGAL/Triangle_3_Segment_3_do_intersect.h>
#include <CGAL/Triangle_3_Ray_3_do_intersect.h>
#include <CGAL/Triangle_3_Triangle_3_do_intersect.h>
#include <CGAL/Triangle_3_Tetrahedron_3_do_intersect.h>
#include <CGAL/Intersections_3/Triangle_3_Triangle_3.h>
#include <CGAL/Intersections_3/Line_3_Triangle_3.h>
#include <CGAL/Intersections_3/Plane_3_Triangle_3.h>
#include <CGAL/Intersections_3/Segment_3_Triangle_3.h>
#include <CGAL/Intersections_3/Ray_3_Triangle_3.h>
#include <CGAL/Intersections_3/Triangle_3_Triangle_3.h>
#include <CGAL/Intersections_3/Tetrahedron_3_Triangle_3.h>
#include <CGAL/Intersections_3/Plane_3_Tetrahedron_3.h>
#include <CGAL/Lazy_exact_nt.h>
#include <CGAL/Quotient.h>