我对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')
以前有人用过那个图书馆吗?
答案 0 :(得分:2)
您需要替换:
typedef CGAL::Vertex_visibility_graph_2<Traits_2> Vis_graph;
通过
typedef CGAL::Vertex_visibility_graph_2<Kernel> Vis_graph;