0

对于可见性图,我在使用 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')

以前有人用过那个库吗?

4

1 回答 1

2

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

于 2012-11-27T07:08:56.777 回答