Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Access vertices of faces in Delaunay

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Access vertices of faces in Delaunay


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Access vertices of faces in Delaunay
  • Date: Sun, 15 Feb 2009 18:49:07 +0100

Hi Matthias,

int i = 0;
for(Finite_vertices_iterator fvi = dt.finite_vertices_begin(); .... ){
fvi->info() = i++;
}


or during the insertion of the i'th point:


Vertex_handle vh = dt.insert(points[i]);
vh->info() = i;


andreas




wrote:
I don't get it. I think my problem is to declare the correct data structure?

// additional .h files
#include <CGAL/Triangulation_vertex_base_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <CGAL/Triangulation_data_structure_2.h>

struct K : public CGAL::Exact_predicates_inexact_constructions_kernel {};

// Traits
typedef CGAL::Triangulation_euclidean_traits_xy_3<K> Gt;

// Data structure with info
typedef int Index;
typedef CGAL::Triangulation_vertex_base_with_info_2<Index, K> Info;
typedef CGAL::Triangulation_data_structure_2<Info> Tds;

// Triangulation constructor
typedef CGAL::Delaunay_triangulation_2<Gt,Tds> CDT;
typedef K::Point_3 Point;

typedef CDT::Finite_faces_iterator Finite_faces_iterator;

How do i assign indices to the vertices? Section 29.11 does not really help
me.
I'm new to CGAL.




Archive powered by MHonArc 2.6.16.

Top of Page