CGAL 2D Deluanay三角测量

时间:2014-06-17 20:45:56

标签: c++ cgal

我的查询与this SO question.相同 我在Ubuntu中使用CGAL。我正在尝试执行如下相同的代码。

#include <vector>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triangulation_2<K> Delaunay;
typedef K::Point_2 Point;

using namespace std;

void load_points(std::vector<Point>& rPoints)
{
  rPoints.push_back(Point(10,10));   // first point
  rPoints.push_back(Point(60,10));   // second point
  rPoints.push_back(Point(30,40));   // third point
  rPoints.push_back(Point(40,80));   // fourth point
}

int main()
{       
 std::vector<Point> points;
 load_points(points);

 Delaunay dt;
 dt.insert(points.begin(),points.end());

 for(Delaunay::Finite_edges_iterator it = dt.finite_edges_begin(); it != dt.finite_edges_end(); ++it)
 {
     Delaunay::Edge e=*it;
     int i1= e.first->vertex( (e.second+1)%3 )->info();
     int i2= e.first->vertex( (e.second+2)%3 )->info();
     cout << i1 << "," << i2 << endl;

 }


 return 0;   
 }

但我收到以下错误。我可以帮忙吗?

Delaunay.cpp: In function ‘int main()’:
Delaunay.cpp:30:47: error: ‘class CGAL::Triangulation_vertex_base_2<CGAL::Epick, CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::Epick, CGAL::Triangulation_ds_vertex_base_2<void> >, CGAL::Triangulation_ds_face_base_2<void> > > >’ has no member named ‘info’
int i1= e.first->vertex( (e.second+1)%3 )->info();
                                           ^


Delaunay.cpp:31:47: error: ‘class CGAL::Triangulation_vertex_base_2<CGAL::Epick, CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::Epick, CGAL::Triangulation_ds_vertex_base_2<void> >, CGAL::Triangulation_ds_face_base_2<void> > > >’ has no member named ‘info’
int i2= e.first->vertex( (e.second+2)%3 )->info();
                                           ^

0 个答案:

没有答案