Subject: CGAL users discussion list
List archive
- 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;
}
Brian.
- [cgal-discuss] Vertex indexing, Brian Sanjeewa Rupasinghe, 05/22/2011
- Re: [cgal-discuss] Vertex indexing, Daniel Duque, 05/22/2011
Archive powered by MHonArc 2.6.16.