0

I'm having troubles with the CGAL library Vertex_visibility_graph_2.h, for visibility graphs. The code I'm trying is like the following:

    typedef CGAL::Cartesian<CGAL::Gmpq> Kernel;
    typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
    typedef CGAL::Vertex_visibility_graph_2<Traits_2> Vis_graph;  
    typedef CGAL::Polygon_2<Kernel> Polygon_2;

    Vis_graph graph(polygon.vertices_begin(), polygon.vertices_end());

But when I try to compile, I get the error:

/opt/local/include/CGAL/Partition_2/Vertex_visibility_graph_2_impl.h:528:30: error: 
      no matching function for call to object of type 'Intersect_2' (aka
      'CGAL::Arr_segment_traits_2<CGAL::Cartesian<CGAL::Gmpq>>::Intersect_2')

Has anybody used that library before?

Mauricio Zambon
  • 695
  • 2
  • 9
  • 17
  • Strange that you define `Kernel` as `Cartesian` while the error mentions `Cartesian`. It might well be a bug in CGAL with `Partition_2` using an old interface of `Intersect_2`. I'd recommend posting this on the cgal-discuss list to get the maintainers attention. – Sylvain Pion Nov 27 '12 at 03:45
  • Actually, it was my bad. I copied and pasted before changing types. – Mauricio Zambon Nov 27 '12 at 04:22

1 Answers1

2

You need to replace: typedef CGAL::Vertex_visibility_graph_2<Traits_2> Vis_graph; by typedef CGAL::Vertex_visibility_graph_2<Kernel> Vis_graph;

sloriot
  • 6,070
  • 18
  • 27