fix warning + cosmetic changes

This commit is contained in:
Sébastien Loriot 2018-11-02 14:17:16 +01:00
parent aee51d4b42
commit 057f4eafe7
34 changed files with 300 additions and 324 deletions

View File

@ -32,7 +32,8 @@ namespace CGAL {
template<typename K> template<typename K>
bool do_intersect(const CGAL::Bbox_2& a, bool do_intersect(const CGAL::Bbox_2& a,
const Point_2<K>& b) { const Point_2<K>& b)
{
Point_2<K> bl(a.xmin(), a.ymin()), tr(a.xmax(), a.ymax()); Point_2<K> bl(a.xmin(), a.ymin()), tr(a.xmax(), a.ymax());
Iso_rectangle_2<K> ic(bl,tr); Iso_rectangle_2<K> ic(bl,tr);
@ -42,7 +43,8 @@ bool do_intersect(const CGAL::Bbox_2& a,
template<typename K> template<typename K>
bool do_intersect(const Point_2<K>& a, bool do_intersect(const Point_2<K>& a,
const CGAL::Bbox_2& b) { const CGAL::Bbox_2& b)
{
return do_intersect(b,a); return do_intersect(b,a);
} }
@ -53,11 +55,10 @@ namespace internal {
template<typename K> template<typename K>
typename CGAL::Intersection_traits<K, typename K::Point_2, CGAL::Bbox_2>::result_type typename CGAL::Intersection_traits<K, typename K::Point_2, CGAL::Bbox_2>::result_type
intersection(const Point_2<K>& a, intersection(const Point_2<K>& a,
const CGAL::Bbox_2& b const CGAL::Bbox_2& b)
) { {
if (do_intersect(a,b)) { if (do_intersect(a,b))
return Intersections::internal::intersection_return<typename K::Intersect_2, typename K::Point_2, CGAL::Bbox_2>(a); return Intersections::internal::intersection_return<typename K::Intersect_2, typename K::Point_2, CGAL::Bbox_2>(a);
}
return Intersections::internal::intersection_return<typename K::Intersect_2, typename K::Point_2, CGAL::Bbox_2>(); return Intersections::internal::intersection_return<typename K::Intersect_2, typename K::Point_2, CGAL::Bbox_2>();
} }
@ -66,10 +67,10 @@ template<typename K>
typename CGAL::Intersection_traits<K, CGAL::Bbox_2, typename K::Point_2>::result_type typename CGAL::Intersection_traits<K, CGAL::Bbox_2, typename K::Point_2>::result_type
intersection(const CGAL::Bbox_2& b, intersection(const CGAL::Bbox_2& b,
const typename K::Point_2 & a, const typename K::Point_2 & a,
const K& k ) { const K& /*k*/ )
if (do_intersect(a,b)) { {
if (do_intersect(a,b))
return Intersections::internal::intersection_return<typename K::Intersect_2, CGAL::Bbox_2, typename K::Point_2>(a); return Intersections::internal::intersection_return<typename K::Intersect_2, CGAL::Bbox_2, typename K::Point_2>(a);
}
return Intersections::internal::intersection_return<typename K::Intersect_2, CGAL::Bbox_2, typename K::Point_2>(); return Intersections::internal::intersection_return<typename K::Intersect_2, CGAL::Bbox_2, typename K::Point_2>();
} }
@ -83,7 +84,8 @@ intersection(const Bbox_2& b,
{ {
return Intersections::internal::intersection(b,a,K()); return Intersections::internal::intersection(b,a,K());
} }
template<typename K>
template<typename K>
typename CGAL::Intersection_traits<K, Bbox_2, Point_2<K> >::result_type typename CGAL::Intersection_traits<K, Bbox_2, Point_2<K> >::result_type
intersection(const Point_2<K> & a, intersection(const Point_2<K> & a,
const Bbox_2& b) const Bbox_2& b)

View File

@ -28,11 +28,8 @@
#include <CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h> #include <CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h>
namespace CGAL { namespace CGAL {
CGAL_DO_INTERSECT_FUNCTION(Iso_rectangle_2, Circle_2, 2) CGAL_DO_INTERSECT_FUNCTION(Iso_rectangle_2, Circle_2, 2)
} }
#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H #endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H

View File

@ -61,9 +61,8 @@ intersection(const typename K::Point_2 &pt,
const typename K::Circle_2 &circle, const typename K::Circle_2 &circle,
const K& k) const K& k)
{ {
if (do_intersect(pt,circle, k)) { if (do_intersect(pt,circle, k))
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Circle_2>(pt); return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Circle_2>(pt);
}
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Circle_2>(); return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Circle_2>();
} }

View File

@ -35,11 +35,11 @@ namespace Intersections {
namespace internal { namespace internal {
template <class K, class Box3> template <class K, class Box3>
bool do_intersect_circle_box_2(const typename K::Circle_2& circle, bool do_intersect_circle_box_2(const typename K::Circle_2& circle,
const Box3& bbox, const Box3& bbox,
const K&) const K&)
{ {
typedef typename K::FT FT; typedef typename K::FT FT;
typedef typename K::Point_2 Point; typedef typename K::Point_2 Point;
FT d = FT(0); FT d = FT(0);
@ -69,41 +69,41 @@ namespace internal {
} }
return distance <= circle.squared_radius(); return distance <= circle.squared_radius();
} }
template <class K> template <class K>
bool do_intersect(const CGAL::Bbox_2& bbox, bool do_intersect(const CGAL::Bbox_2& bbox,
const typename K::Circle_2& circle, const typename K::Circle_2& circle,
const K&) const K&)
{ {
return do_intersect_circle_box_2(circle, bbox, K()); return do_intersect_circle_box_2(circle, bbox, K());
} }
template <class K> template <class K>
bool do_intersect(const typename K::Circle_2& circle, bool do_intersect(const typename K::Circle_2& circle,
const CGAL::Bbox_2& bbox, const CGAL::Bbox_2& bbox,
const K&) const K&)
{ {
return do_intersect_circle_box_2(circle, bbox, K()); return do_intersect_circle_box_2(circle, bbox, K());
} }
template <class K> template <class K>
bool do_intersect(const typename K::Iso_rectangle_2& bbox, bool do_intersect(const typename K::Iso_rectangle_2& bbox,
const typename K::Circle_2& circle, const typename K::Circle_2& circle,
const K&) const K&)
{ {
return do_intersect_circle_box_2(circle, bbox, K()); return do_intersect_circle_box_2(circle, bbox, K());
} }
template <class K> template <class K>
bool do_intersect(const typename K::Circle_2& circle, bool do_intersect(const typename K::Circle_2& circle,
const typename K::Iso_rectangle_2& bbox, const typename K::Iso_rectangle_2& bbox,
const K&) const K&)
{ {
return do_intersect_circle_box_2(circle, bbox, K()); return do_intersect_circle_box_2(circle, bbox, K());
} }
} // namespace internal } // namespace internal
} // namespace Intersections } // namespace Intersections

View File

@ -27,13 +27,13 @@
#include <CGAL/Bbox_3.h> #include <CGAL/Bbox_3.h>
namespace CGAL { namespace CGAL {
bool bool
inline inline
do_intersect(const CGAL::Bbox_3& c, do_intersect(const CGAL::Bbox_3& c,
const CGAL::Bbox_3& bbox) const CGAL::Bbox_3& bbox)
{ {
return CGAL::do_overlap(c, bbox); return CGAL::do_overlap(c, bbox);
} }
} //namespace CGAL } //namespace CGAL

View File

@ -51,11 +51,10 @@ bool do_intersect(const Point_3<K>& a,
template<typename K> template<typename K>
typename Intersection_traits<K, typename K::Point_3, CGAL::Bbox_3>::result_type typename Intersection_traits<K, typename K::Point_3, CGAL::Bbox_3>::result_type
intersection(const Point_3<K>& a, intersection(const Point_3<K>& a,
const CGAL::Bbox_3& b const CGAL::Bbox_3& b)
) { {
if (do_intersect(a,b)) { if (do_intersect(a,b))
return Intersections::internal::intersection_return<typename K::Intersect_3, typename K::Point_3, CGAL::Bbox_3>(a); return Intersections::internal::intersection_return<typename K::Intersect_3, typename K::Point_3, CGAL::Bbox_3>(a);
}
return Intersections::internal::intersection_return<typename K::Intersect_3, typename K::Point_3, CGAL::Bbox_3>(); return Intersections::internal::intersection_return<typename K::Intersect_3, typename K::Point_3, CGAL::Bbox_3>();
} }
@ -63,10 +62,10 @@ intersection(const Point_3<K>& a,
template<typename K> template<typename K>
typename Intersection_traits<K, CGAL::Bbox_3, typename K::Point_3>::result_type typename Intersection_traits<K, CGAL::Bbox_3, typename K::Point_3>::result_type
intersection(const CGAL::Bbox_3& b, intersection(const CGAL::Bbox_3& b,
const Point_3<K>& a) { const Point_3<K>& a)
if (do_intersect(a,b)) { {
if (do_intersect(a,b))
return Intersections::internal::intersection_return<typename K::Intersect_3, CGAL::Bbox_3, typename K::Point_3>(a); return Intersections::internal::intersection_return<typename K::Intersect_3, CGAL::Bbox_3, typename K::Point_3>(a);
}
return Intersections::internal::intersection_return<typename K::Intersect_3, CGAL::Bbox_3, typename K::Point_3>(); return Intersections::internal::intersection_return<typename K::Intersect_3, CGAL::Bbox_3, typename K::Point_3>();
} }

View File

@ -57,9 +57,8 @@ intersection(const typename K::Point_3 &pt,
const typename K::Iso_cuboid_3 &iso, const typename K::Iso_cuboid_3 &iso,
const K& k) const K& k)
{ {
if (internal::do_intersect(pt,iso,k)) { if (internal::do_intersect(pt,iso,k))
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Iso_cuboid_3>(pt); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Iso_cuboid_3>(pt);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Iso_cuboid_3>(); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Iso_cuboid_3>();
} }

View File

@ -28,11 +28,8 @@
#include <CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h> #include <CGAL/Intersections_3/internal/Bbox_3_Sphere_3_do_intersect.h>
namespace CGAL { namespace CGAL {
CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Sphere_3, 3) CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Sphere_3, 3)
} }
#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_H #endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_H

View File

@ -30,7 +30,6 @@
namespace CGAL { namespace CGAL {
CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3) CGAL_DO_INTERSECT_FUNCTION(Iso_cuboid_3, Tetrahedron_3, 3)
} }
#endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H #endif // CGAL_INTERSECTIONS_3_ISO_CUBOID_3_TETRAHEDRON_3_H

View File

@ -57,9 +57,8 @@ intersection(const typename K::Point_3 &pt,
const typename K::Line_3 &line, const typename K::Line_3 &line,
const K& k) const K& k)
{ {
if (do_intersect(pt,line,k)) { if (do_intersect(pt,line,k))
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Line_3>(pt); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Line_3>(pt);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Line_3>(); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Line_3>();
} }

View File

@ -57,9 +57,8 @@ intersection(const typename K::Point_3 &pt,
const typename K::Plane_3 &plane, const typename K::Plane_3 &plane,
const K& k) const K& k)
{ {
if (do_intersect(pt,plane,k)) { if (do_intersect(pt,plane,k))
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Plane_3>(pt); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Plane_3>(pt);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Plane_3>(); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Plane_3>();
} }

View File

@ -47,9 +47,8 @@ intersection(const typename K::Point_3 &pt1,
const typename K::Point_3 &pt2, const typename K::Point_3 &pt2,
const K&) const K&)
{ {
if (pt1 == pt2) { if (pt1 == pt2)
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Point_3>(pt1); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Point_3>(pt1);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Point_3>(); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Point_3>();
} }

View File

@ -61,9 +61,8 @@ intersection(const typename K::Point_3 &pt,
const typename K::Segment_3 &seg, const typename K::Segment_3 &seg,
const K& k) const K& k)
{ {
if (do_intersect(pt,seg, k)) { if (do_intersect(pt,seg, k))
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Segment_3>(pt); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Segment_3>(pt);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Segment_3>(); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Segment_3>();
} }

View File

@ -61,9 +61,8 @@ intersection(const typename K::Point_3 &pt,
const typename K::Sphere_3 &sphere, const typename K::Sphere_3 &sphere,
const K& k) const K& k)
{ {
if (do_intersect(pt,sphere, k)) { if (do_intersect(pt,sphere, k))
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Sphere_3>(pt); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Sphere_3>(pt);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Sphere_3>(); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Sphere_3>();
} }

View File

@ -61,9 +61,8 @@ intersection(const typename K::Point_3 &pt,
const typename K::Tetrahedron_3 &tetrahedron, const typename K::Tetrahedron_3 &tetrahedron,
const K& k) const K& k)
{ {
if (do_intersect(pt,tetrahedron, k)) { if (do_intersect(pt,tetrahedron, k))
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Tetrahedron_3>(pt); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Tetrahedron_3>(pt);
}
return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Tetrahedron_3>(); return intersection_return<typename K::Intersect_3, typename K::Point_3, typename K::Tetrahedron_3>();
} }

View File

@ -30,7 +30,6 @@
namespace CGAL { namespace CGAL {
CGAL_DO_INTERSECT_FUNCTION(Segment_3, Tetrahedron_3, 3) CGAL_DO_INTERSECT_FUNCTION(Segment_3, Tetrahedron_3, 3)
} }
#endif // CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H #endif // CGAL_INTERSECTIONS_3_SEGMENT_3_TETRAHEDRON_3_H

View File

@ -30,7 +30,6 @@
namespace CGAL { namespace CGAL {
CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Tetrahedron_3, 3) CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Tetrahedron_3, 3)
} }
#endif // CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H #endif // CGAL_INTERSECTIONS_3_SPHERE_3_TETRAHEDRON_3_H

View File

@ -30,7 +30,6 @@
namespace CGAL { namespace CGAL {
CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Triangle_3, 3) CGAL_DO_INTERSECT_FUNCTION(Sphere_3, Triangle_3, 3)
} }
#endif // CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H #endif // CGAL_INTERSECTIONS_3_SPHERE_3_TRIANGLE_3_H

View File

@ -32,11 +32,11 @@ namespace Intersections {
namespace internal { namespace internal {
template <class K> template <class K>
bool do_intersect(const CGAL::Bbox_3& bb, bool do_intersect(const CGAL::Bbox_3& bb,
const typename K::Iso_cuboid_3& ic, const typename K::Iso_cuboid_3& ic,
const K& k) const K& /* k */)
{ {
if (bb.xmax() < ic.xmin() || ic.xmax() < bb.xmin()) if (bb.xmax() < ic.xmin() || ic.xmax() < bb.xmin())
return false; return false;
if (bb.ymax() < ic.ymin() || ic.ymax() < bb.ymin()) if (bb.ymax() < ic.ymin() || ic.ymax() < bb.ymin())
@ -44,7 +44,7 @@ namespace internal {
if (bb.zmax() < ic.zmin() || ic.zmax() < bb.zmin()) if (bb.zmax() < ic.zmin() || ic.zmax() < bb.zmin())
return false; return false;
return true; return true;
} }
} // namespace internal } // namespace internal
} // namespace Intersections } // namespace Intersections

View File

@ -37,11 +37,11 @@ namespace Intersections {
namespace internal { namespace internal {
template <class K> template <class K>
bool do_intersect(const typename K::Ray_3& ray, bool do_intersect(const typename K::Ray_3& ray,
const typename K::Iso_cuboid_3& ic, const typename K::Iso_cuboid_3& ic,
const K&) const K&)
{ {
typedef typename K::FT FT; typedef typename K::FT FT;
typedef typename K::Point_3 Point_3; typedef typename K::Point_3 Point_3;
@ -59,14 +59,14 @@ namespace internal {
(ic.min)().x(), (ic.min)().y(), (ic.min)().z(), (ic.min)().x(), (ic.min)().y(), (ic.min)().z(),
(ic.max)().x(), (ic.max)().y(), (ic.max)().z() (ic.max)().x(), (ic.max)().y(), (ic.max)().z()
); );
} }
template <class K> template <class K>
bool do_intersect(const typename K::Iso_cuboid_3& ic, bool do_intersect(const typename K::Iso_cuboid_3& ic,
const typename K::Ray_3& ray, const typename K::Ray_3& ray,
const K&) { const K&) {
return do_intersect(ray, ic, K()); return do_intersect(ray, ic, K());
} }
} // namespace internal } // namespace internal
} // namespace Intersections } // namespace Intersections

View File

@ -37,11 +37,11 @@ namespace Intersections {
namespace internal { namespace internal {
template <class K> template <class K>
bool do_intersect(const typename K::Segment_3& seg, bool do_intersect(const typename K::Segment_3& seg,
const typename K::Iso_cuboid_3& ic, const typename K::Iso_cuboid_3& ic,
const K&) const K&)
{ {
typedef typename K::FT FT; typedef typename K::FT FT;
typedef typename K::Point_3 Point_3; typedef typename K::Point_3 Point_3;
@ -59,14 +59,14 @@ namespace internal {
(ic.min)().x(), (ic.min)().y(), (ic.min)().z(), (ic.min)().x(), (ic.min)().y(), (ic.min)().z(),
(ic.max)().x(), (ic.max)().y(), (ic.max)().z() (ic.max)().x(), (ic.max)().y(), (ic.max)().z()
); );
} }
template <class K> template <class K>
bool do_intersect(const typename K::Iso_cuboid_3& ic, bool do_intersect(const typename K::Iso_cuboid_3& ic,
const typename K::Segment_3& seg, const typename K::Segment_3& seg,
const K&) { const K&) {
return do_intersect(seg, ic, K()); return do_intersect(seg, ic, K());
} }
} // namespace internal } // namespace internal
} // namespace Intersections } // namespace Intersections

View File

@ -33,21 +33,21 @@ namespace Intersections {
namespace internal { namespace internal {
template <class K> template <class K>
bool do_intersect(const typename K::Iso_cuboid_3& ic, bool do_intersect(const typename K::Iso_cuboid_3& ic,
const typename K::Sphere_3& sphere, const typename K::Sphere_3& sphere,
const K&) const K&)
{ {
return do_intersect_sphere_box_3(sphere, ic, K()); return do_intersect_sphere_box_3(sphere, ic, K());
} }
template <class K> template <class K>
bool do_intersect(const typename K::Sphere_3& sphere, bool do_intersect(const typename K::Sphere_3& sphere,
const typename K::Iso_cuboid_3& ic, const typename K::Iso_cuboid_3& ic,
const K&) const K&)
{ {
return do_intersect_sphere_box_3(sphere, ic, K()); return do_intersect_sphere_box_3(sphere, ic, K());
} }
} // namespace internal } // namespace internal
} // namespace Intersections } // namespace Intersections
@ -64,7 +64,6 @@ bool do_intersect(const Sphere_3<K>& a,
return K().do_intersect_3_object()(a, b); return K().do_intersect_3_object()(a, b);
} }
} //namespace CGAL } //namespace CGAL
#endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_DO_INTERSECT_H #endif // CGAL_INTERNAL_INTERSECTIONS_3_ISO_CUBOID_3_SPHERE_3_DO_INTERSECT_H

View File

@ -39,21 +39,21 @@ namespace Intersections {
namespace internal { namespace internal {
template <class K> template <class K>
bool do_intersect(const typename K::Triangle_3& triangle, bool do_intersect(const typename K::Triangle_3& triangle,
const typename K::Iso_cuboid_3& bbox, const typename K::Iso_cuboid_3& bbox,
const K& k) const K& k)
{ {
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
} }
template <class K> template <class K>
bool do_intersect(const typename K::Iso_cuboid_3& bbox, bool do_intersect(const typename K::Iso_cuboid_3& bbox,
const typename K::Triangle_3& triangle, const typename K::Triangle_3& triangle,
const K& k) const K& k)
{ {
return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k); return do_intersect_bbox_or_iso_cuboid(triangle, bbox, k);
} }
} // namespace internal } // namespace internal
} // namespace Intersections } // namespace Intersections

View File

@ -33,8 +33,8 @@
namespace CGAL { namespace CGAL {
template <class K> template <class K>
class Tetrahedron_3; class Tetrahedron_3;
namespace Intersections { namespace Intersections {
@ -110,7 +110,6 @@ do_intersect(const typename K::Segment_3 &seg,
return do_intersect_tetrahedron_bounded(seg, tet, seg.source(), k); return do_intersect_tetrahedron_bounded(seg, tet, seg.source(), k);
} }
template <class K> template <class K>
inline inline
typename K::Boolean typename K::Boolean
@ -131,7 +130,6 @@ do_intersect(const typename K::Iso_cuboid_3 &ic,
return do_intersect_tetrahedron_bounded(ic, tet, ic[0], k); return do_intersect_tetrahedron_bounded(ic, tet, ic[0], k);
} }
template <class K> template <class K>
inline inline
typename K::Boolean typename K::Boolean
@ -152,7 +150,6 @@ do_intersect(const typename K::Sphere_3 &sp,
return do_intersect_tetrahedron_bounded(sp, tet, sp.center(), k); return do_intersect_tetrahedron_bounded(sp, tet, sp.center(), k);
} }
template <class K> template <class K>
inline inline
typename K::Boolean typename K::Boolean

View File

@ -27,14 +27,14 @@
namespace CGAL { namespace CGAL {
template <class K> template <class K>
class Triangle_3; class Triangle_3;
template <class K> template <class K>
class Sphere_3; class Sphere_3;
template <class K> template <class K>
class Line_3; class Line_3;
namespace Intersections { namespace Intersections {
@ -45,7 +45,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Sphere_3 &sp, do_intersect(const typename K::Sphere_3 &sp,
const typename K::Triangle_3 &tr, const typename K::Triangle_3 &tr,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), tr) <= sp.squared_radius(); return squared_distance(sp.center(), tr) <= sp.squared_radius();
} }
@ -55,7 +55,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Triangle_3 &tr, do_intersect(const typename K::Triangle_3 &tr,
const typename K::Sphere_3 &sp, const typename K::Sphere_3 &sp,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), tr) <= sp.squared_radius(); return squared_distance(sp.center(), tr) <= sp.squared_radius();
} }
@ -64,7 +64,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Sphere_3 &sp, do_intersect(const typename K::Sphere_3 &sp,
const typename K::Line_3 &lin, const typename K::Line_3 &lin,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), lin) <= sp.squared_radius(); return squared_distance(sp.center(), lin) <= sp.squared_radius();
} }
@ -75,7 +75,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Line_3 &lin, do_intersect(const typename K::Line_3 &lin,
const typename K::Sphere_3 &sp, const typename K::Sphere_3 &sp,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), lin) <= sp.squared_radius(); return squared_distance(sp.center(), lin) <= sp.squared_radius();
} }
@ -87,7 +87,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Sphere_3 &sp, do_intersect(const typename K::Sphere_3 &sp,
const typename K::Ray_3 &lin, const typename K::Ray_3 &lin,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), lin) <= sp.squared_radius(); return squared_distance(sp.center(), lin) <= sp.squared_radius();
} }
@ -98,7 +98,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Ray_3 &lin, do_intersect(const typename K::Ray_3 &lin,
const typename K::Sphere_3 &sp, const typename K::Sphere_3 &sp,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), lin) <= sp.squared_radius(); return squared_distance(sp.center(), lin) <= sp.squared_radius();
} }
@ -108,7 +108,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Sphere_3 &sp, do_intersect(const typename K::Sphere_3 &sp,
const typename K::Segment_3 &lin, const typename K::Segment_3 &lin,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), lin) <= sp.squared_radius(); return squared_distance(sp.center(), lin) <= sp.squared_radius();
} }
@ -119,7 +119,7 @@ inline
typename K::Boolean typename K::Boolean
do_intersect(const typename K::Segment_3 &lin, do_intersect(const typename K::Segment_3 &lin,
const typename K::Sphere_3 &sp, const typename K::Sphere_3 &sp,
const K & k) const K & /* k */)
{ {
return squared_distance(sp.center(), lin) <= sp.squared_radius(); return squared_distance(sp.center(), lin) <= sp.squared_radius();
} }
@ -129,4 +129,3 @@ do_intersect(const typename K::Segment_3 &lin,
} // namespace CGAL } // namespace CGAL
#endif // CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H #endif // CGAL_TRIANGLE_3_SPHERE_3_DO_INTERSECT_H

View File

@ -36,7 +36,6 @@ int main()
CGAL::do_intersect(sp, Ray()); CGAL::do_intersect(sp, Ray());
CGAL::do_intersect(sp, Segment()); CGAL::do_intersect(sp, Segment());
CGAL::do_intersect(Triangle(), tet); CGAL::do_intersect(Triangle(), tet);
CGAL::do_intersect(Segment(), tet); CGAL::do_intersect(Segment(), tet);
CGAL::do_intersect(Iso_cuboid(), tet); CGAL::do_intersect(Iso_cuboid(), tet);
@ -52,5 +51,4 @@ int main()
return 0; return 0;
} }