我在使用可见性图表的 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')
以前有人用过那个库吗?
最佳答案
您需要更换:
typedef CGAL::Vertex_visibility_graph_2<Traits_2> Vis_graph;
经过
typedef CGAL::Vertex_visibility_graph_2<Kernel> Vis_graph;
关于c++ - CGAL 库 Vertex_visibility_graph_2.h 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13576093/