mirror of https://github.com/CGAL/cgal
Use the intersection traits macro to simplify code (cosmetic change)
This commit is contained in:
parent
58c894ed5e
commit
ab0ca8a735
|
|
@ -23,47 +23,38 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Geert-Jan Giezeman
|
// Author(s) : Geert-Jan Giezeman
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H
|
#ifndef CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H
|
||||||
#define CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H
|
#define CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H
|
||||||
|
|
||||||
#include <CGAL/Circle_2.h>
|
#include <CGAL/Circle_2.h>
|
||||||
#include <CGAL/squared_distance_2_1.h>
|
#include <CGAL/squared_distance_2_1.h>
|
||||||
|
|
||||||
namespace CGAL {
|
#include <CGAL/Intersection_traits_2.h>
|
||||||
|
|
||||||
namespace Intersections {
|
|
||||||
|
|
||||||
|
namespace CGAL {
|
||||||
|
namespace Intersections {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
template <class K>
|
template <class K>
|
||||||
bool
|
bool do_intersect(const typename K::Circle_2 & circ1,
|
||||||
do_intersect(const typename K::Circle_2 & circ1,
|
const typename K::Circle_2& circ2,
|
||||||
const typename K::Circle_2& circ2,
|
const K&)
|
||||||
const K&)
|
|
||||||
{
|
{
|
||||||
typedef typename K::FT FT;
|
typedef typename K::FT FT;
|
||||||
FT sr1 = circ1.squared_radius();
|
|
||||||
FT sr2 = circ2.squared_radius();
|
FT sr1 = circ1.squared_radius();
|
||||||
FT squared_dist = squared_distance(circ1.center(), circ2.center());
|
FT sr2 = circ2.squared_radius();
|
||||||
FT temp = sr1+sr2-squared_dist;
|
FT squared_dist = squared_distance(circ1.center(), circ2.center());
|
||||||
return !(FT(4)*sr1*sr2 < temp*temp);
|
FT temp = sr1+sr2-squared_dist;
|
||||||
|
|
||||||
|
return !(FT(4)*sr1*sr2 < temp*temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace Intersections
|
} // namespace Intersections
|
||||||
|
|
||||||
template <class K>
|
CGAL_DO_INTERSECT_FUNCTION_SELF(Circle_2, 2)
|
||||||
inline
|
|
||||||
bool
|
|
||||||
do_intersect(const Circle_2<K> & circ1,
|
|
||||||
const Circle_2<K> & circ2)
|
|
||||||
{
|
|
||||||
typedef typename K::Do_intersect_2 Do_intersect;
|
|
||||||
return Do_intersect()(circ1, circ2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue