Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation
- Date: Mon, 23 May 2011 10:32:29 +0200
Dear Brian,
I am sorry but you need to read the documentation:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/contents.html
The manual of CGAL is made of a user-manual where basically
a rationale and examples are given, and a reference manual
where the precise documentation of each member is given.
In your case have a look in the user manual of triangulation_2, for
the Adding color example here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_2/Chapter_main.html#Section_35.11
The reference for the class Triangulation_face_base_with_info_2 is here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_2_ref/Class_Triangulation_face_base_with_info_2.html
S.
Brian Sanjeewa Rupasinghe wrote:
Hi,
I added this code. But it did not work. I am relatively new to CGAL. Please help.
typedef CGAL::Triangulation_ds_face_base_with_info_2<Index, Gt> Info;
Brian.
On Mon, May 23, 2011 at 7:21 AM, Sebastien Loriot (GeometryFactory) <sloriot.ml <http://sloriot.ml>@gmail.com <http://gmail.com>> wrote:
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;
}
-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Brian Sanjeewa Rupasinghe, 05/22/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Sebastien Loriot (GeometryFactory), 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Brian Sanjeewa Rupasinghe, 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Samuel Hornus, 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Sebastien Loriot (GeometryFactory), 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Brian Sanjeewa Rupasinghe, 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Sebastien Loriot (GeometryFactory), 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Sebastien Loriot (GeometryFactory), 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Laurent Rineau (GeometryFactory), 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Brian Sanjeewa Rupasinghe, 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Samuel Hornus, 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Brian Sanjeewa Rupasinghe, 05/23/2011
- Re: [cgal-discuss] Creating Indices for vertices in Delanuay Triangulation, Sebastien Loriot (GeometryFactory), 05/23/2011
Archive powered by MHonArc 2.6.16.