Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation
  • Date: Mon, 23 May 2011 08:21:26 +0200

Brian Sanjeewa Rupasinghe wrote:
Hi,

When i run the following to create Delanuay Triangulation and index of the vertices,
Following error occurs.
error C2039: 'info' : is not a member of 'CGAL::Triangulation_ds_face_base_2<TDS>'

The error is explicit:

no info is in Triangulation_ds_face_base_2. So you need to use Triangulation_ds_face_base_with_info_2.

S.

I am new to CGAL. Please help

Brian.



// vertex.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Projection_traits_xy_3.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <fstream>
/////////////////
#include <CGAL/basic.h> #include <CGAL/Triangulation_face_base_2.h> #include <CGAL/Triangulation_vertex_base_2.h> #include <CGAL/Triangulation_vertex_base_with_info_2.h> #include <CGAL/Triangulation_data_structure_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Gt;
typedef K::Point_3 Point;
typedef CGAL::Delaunay_triangulation_2<Gt> CDT; typedef CGAL::Triangulation_face_base_2<Gt> Fb; typedef CDT::Finite_faces_iterator Finite_faces_iterator;
typedef CDT::Vertex_handle Vertex_handle; typedef CDT::Face_handle Face_handle; typedef int Index; typedef CGAL::Triangulation_vertex_base_with_info_2<Index, Gt> Info;
int _tmain()
{
//std::ifstream in("data/terrain.cin");
std::ifstream in("data/test.cin");
std::istream_iterator<Point> begin(in);
std::istream_iterator<Point> end;
CDT dt;
dt.insert(begin, end);
//
// Loop through faces of triangulation and assign index to vertices int q = 0; Finite_faces_iterator fvi = dt.finite_faces_begin();
for( ; fvi != dt.finite_faces_end(); ++fvi)
{ fvi->info()= q++; } //
std::cout << dt.number_of_vertices() << std::endl;
std::cout << dt.number_of_faces() << std::endl;
std::cout << dt;
return 0;
}




Archive powered by MHonArc 2.6.16.

Top of Page