More errors and warnigns
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
#include <CGAL/box_intersection_d.h>
|
||||
|
||||
|
||||
template <typename Polyline>
|
||||
template <typename Poly>
|
||||
class Polylines_do_intersect
|
||||
{
|
||||
typedef typename Polyline::const_iterator Iterator;
|
||||
typedef typename Poly::const_iterator Iterator;
|
||||
typedef typename std::iterator_traits<Iterator>::value_type Point_2;
|
||||
typedef typename CGAL::Kernel_traits<Point_2>::Kernel::Segment_2 Segment_2;
|
||||
typedef CGAL::Bbox_2 Bbox_2;
|
||||
|
||||
const Polyline& pA, &pB;
|
||||
const Poly& pA, &pB;
|
||||
|
||||
struct Box : public CGAL::Box_intersection_d::Box_with_handle_d<double,2,Iterator> {
|
||||
|
||||
@@ -31,9 +31,9 @@ class Polylines_do_intersect
|
||||
|
||||
class Overlap {
|
||||
|
||||
const Polyline& pA, &pB;
|
||||
const Poly& pA, &pB;
|
||||
public:
|
||||
Overlap(const Polyline& pA, const Polyline& pB)
|
||||
Overlap(const Poly& pA, const Poly& pB)
|
||||
: pA(pA), pB(pB)
|
||||
{}
|
||||
|
||||
@@ -49,7 +49,7 @@ class Polylines_do_intersect
|
||||
|
||||
public:
|
||||
|
||||
Polylines_do_intersect(const Polyline& pA, const Polyline& pB)
|
||||
Polylines_do_intersect(const Poly& pA, const Poly& pB)
|
||||
: pA(pA), pB(pB)
|
||||
{}
|
||||
|
||||
@@ -83,22 +83,22 @@ public:
|
||||
};
|
||||
|
||||
|
||||
template <typename Polyline>
|
||||
bool polylines_do_intersect(const Polyline& pA,const Polyline& pB)
|
||||
template <typename Poly>
|
||||
bool polylines_do_intersect(const Poly& pA,const Poly& pB)
|
||||
{
|
||||
Polylines_do_intersect<Polyline> pdi(pA,pB);
|
||||
Polylines_do_intersect<Poly> pdi(pA,pB);
|
||||
return pdi();
|
||||
}
|
||||
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
typedef K::Point_2 Point_2;
|
||||
typedef std::vector<Point_2> Polyline;
|
||||
typedef std::vector<Point_2> CGAL_polyline;
|
||||
|
||||
int main()
|
||||
{
|
||||
Polyline pA = { Point_2(0,0), Point_2(1,0) };
|
||||
Polyline pB = { Point_2(0,0), Point_2(0,1), Point_2(2,1) , Point_2(1,0)};
|
||||
CGAL_polyline pA = { Point_2(0,0), Point_2(1,0) };
|
||||
CGAL_polyline pB = { Point_2(0,0), Point_2(0,1), Point_2(2,1) , Point_2(1,0)};
|
||||
|
||||
if(polylines_do_intersect(pA,pB)){
|
||||
std::cout << "intersection" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user