0

I have the same query as this SO question. I am using CGAL in Ubuntu. I am trying to execute the same code as follows.

#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;   
 }

But I am getting the following errors. Can I get some help please?

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();
                                           ^
Community
  • 1
  • 1
aghost
  • 235
  • 2
  • 12
  • Yes I understand that. I have referred to the post also. But how do I tackle the errors? – aghost Jun 17 '14 at 21:18
  • Fixed myself. [code] Delaunay::Edge e=*it; int x1 = e.first->vertex( (e.second + 1) % 3 )->point().x(); int y1 = e.first->vertex( (e.second + 1) % 3 )->point().y(); int x2 = e.first->vertex( (e.second + 2) % 3 )->point().x(); int y2 = e.first->vertex( (e.second + 2) % 3 )->point().y(); [/code] – aghost Jun 17 '14 at 22:56

0 Answers0