Subject: CGAL users discussion list
List archive
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] Problem building a delaunay triangulation
- Date: Mon, 15 Mar 2010 22:48:46 +0100
On 15/03/2010 22:43, Ian Bentley wrote:
Thanks for the help, but it doesn't really clarify for me. I am using
the point type
CGAL::Point_2< CGAL::Cartesian<double > >
and CGAL/Exact_predicates_inexact_constructions_kernel.h
<http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Kernel_23_ref/Class_Exact_predicates_inexact_constructions_kernel.html>
says that it uses:
"A typedef to a kernel which has the following properties:
* It uses Cartesian representation.
* It supports constructions of points from double Cartesian
coordinates.
* It provides exact geometric predicates, but inexact geometric
constructions."
This indicates to me that I am using the right one... What am I doing wrong?
Every bird is an animal, but not every animal is a bird.
It opnly says that the Point_2 of an Exact_predicates_inexact_constructions_kernel
is constructible from double, that is the following should work:
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point_2;
double x=3.1415;
Point_2 p(x,0);
Thanks.
On Sat, Mar 13, 2010 at 4:15 AM, Michael Hemmer
<
<mailto:>>
wrote:
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
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
--
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.