使用CGAL库Vertex_visibility_graph_2.h进行故障

时间:2012-11-27 01:29:32

标签: c++ graph visibility cgal

我对CGAL库 Vertex_visibility_graph_2.h 遇到了麻烦,因为可见性图表。 我正在尝试的代码如下:

    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());

但是当我尝试编译时,我收到错误:

/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')

以前有人用过那个图书馆吗?

1 个答案:

答案 0 :(得分:2)

您需要替换: typedef CGAL::Vertex_visibility_graph_2<Traits_2> Vis_graph; 通过 typedef CGAL::Vertex_visibility_graph_2<Kernel> Vis_graph;