Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Vertex indexing

Subject: CGAL users discussion list

List archive

[cgal-discuss] Vertex indexing


Chronological Thread 
  • From: Brian Sanjeewa Rupasinghe <>
  • To:
  • Subject: [cgal-discuss] Vertex indexing
  • Date: Sun, 22 May 2011 15:14:39 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LSfNUPXfQh1k9rncLW49U/XLgOqcNYa/oJgoYx8J2BXC1u+ZrlhJqMGls1rxfi9ouq QP/tFJVYEVecsTPWqBvdWKxGhIjHGy6c+aVQX+LZy1HV9Elzw+FoZNCv8UyWBDb8Ae/L xnYV+0W9nM/d9qDCK3HhQkmUiY/5HAYyMMnqU=

Hi,

This is the code i have used to create Delaunay triangulation and then to print
number of vertices and faces. Now i need to retrieve coordinates of each vertex
using an index. Please let me know how it can be done?  I followed up tutorial in following link.
But could not get how to do it.

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Projection_traits_xy_3.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <fstream>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K>  Gt;
typedef CGAL::Delaunay_triangulation_2<Gt> Delaunay;
typedef K::Point_3   Point;

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;
Delaunay dt;
dt.insert(begin, end);
std::cout << dt.number_of_vertices() << std::endl;
std::cout << dt.number_of_faces() << std::endl;
std::cout << dt;

return 0;
}

Best regards,
Brian.



Archive powered by MHonArc 2.6.16.

Top of Page