Subject: CGAL users discussion list
List archive
- From: Michael Hemmer <>
- To:
- Subject: Re: [cgal-discuss] Problem building a delaunay triangulation
- Date: Sat, 13 Mar 2010 09:15:25 +0100
Hi Ian,
seem that you have not chosen the right point type. Chose the one from the same Kernel that you use.
Michael
Ian Bentley wrote:
Hello , new to CGAL, and struggling with some basic concepts.
I create a std::vector< CGAL::Point_2< CGAL::Cartesian<double> > and fill it with a series of points often generated at random, but sometimes specified. Anyways, the exact location of these points is not particularly important, and as long as they are accurate to an epsilon of 0.001, Everything that I am concerned with will be fine. This is why I chose Cartesian<double> for my kernel, and that seems to work just fine.
Later however, I was looking to use this vector to create a delaunay triangulation of these points. Looking at the examples: http://www.cgal.org/Manual/last/doc_html/cgal_manual/Triangulation_2/Chapter_main.html there, I put together the following code:
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
void network::buildDelaunayTriangulation(){
CGAL::Delaunay_triangulation_2<K> l_delaunayTriangulation;
std::vector<point >::iterator it;
for(it=m_locations.begin(); it < m_locations.end(); it++){
l_delaunayTriangulation.insert((*it));
}
}
where m_locations is the vector of points created earlier.
When I run this code however I receive the error:
model/network.cc:29: error: no matching function for call to ‘CGAL::Delaunay_triangulation_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >, CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >, CGAL::Triangulation_ds_vertex_base_2<void> >, CGAL::Triangulation_ds_face_base_2<void> > >::insert(CGAL::Point_2<CGAL::Cartesian<double> >&)’
With a series of suggestions.
I suspect this is because I use the Exact_predicates_inexact_constructions_kernel to build the delaunay, but I'm not sure. How can I fix this code?
--
Ian Bentley
M.Sc. Student
Queen's University
Kingston, Ontario
--
Ian Bentley
M.Sc. Student
Queen's University
Kingston, Ontario
- [cgal-discuss] Problem building a delaunay triangulation, Ian Bentley, 03/12/2010
- Re: [cgal-discuss] Problem building a delaunay triangulation, Michael Hemmer, 03/13/2010
- Re: [cgal-discuss] Problem building a delaunay triangulation, Ian Bentley, 03/15/2010
- Re: [cgal-discuss] Problem building a delaunay triangulation, Andreas Fabri, 03/15/2010
- Re: [cgal-discuss] Problem building a delaunay triangulation, Ian Bentley, 03/15/2010
- Re: [cgal-discuss] Problem building a delaunay triangulation, Michael Hemmer, 03/13/2010
Archive powered by MHonArc 2.6.16.