c++ - CGAL 库 Vertex_visibility_graph_2.h 的问题

标签 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')

以前有人用过那个库吗?

最佳答案

您需要更换: 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/

相关文章:

graph - 如何在 Neo4j 等图形数据库中对机场/航类数据进行建模

javascript - 如何配置 flot 以在零点的 y 轴上绘制缺失的时间序列?

java - 为什么没有修饰符的字段在子类中可见?

Java:通过反射访问私有(private)字段(行为)

c++ - 打开文件以在 C++ 中显示内容

c++ - 模板编程 : specialization and enable_if

c++ - 无法初始化线程 vector

python - forEdges迭代器在networkit中的使用(python)

c++ - dynamic_cast 何时因隐藏符号而失败?

C++ 使用枚举变量调用构造函数