Subject: CGAL users discussion list
List archive
- From: <>
- To:
- Subject: [cgal-discuss] Coordinates of vertices for segment_voronoi
- Date: Fri, 10 Apr 2009 22:34:03 +0200 (CEST)
Hello,
Like in the post of Amit :
https://lists-sop.inria.fr/sympa/arc/cgal-discuss/2008-04/msg00088.html
I am interested in the coordinates of the vertices of the edges given by
/CGAL/examples/Segment_Delaunay_graph_2/sdg-voronoi-edges.cpp
I tried to use the method suggsted by Amit (see below). When compiling thel
code, I get an error comming from
sdg = vd.dual();
I do not know what is wrong. Every remarks/suggestions are welcome,
Best regards, Edouard.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <CGAL/basic.h>
// standard includes
#include <iostream>
#include <fstream>
#include <cassert>
#include <string>
// define the kernel
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Filtered_kernel.h>
typedef CGAL::Simple_cartesian<double> CK;
typedef CGAL::Filtered_kernel<CK> Kernel;
// typedefs for the traits and the algorithm
#include <CGAL/Segment_Delaunay_graph_traits_2.h>
#include <CGAL/Segment_Delaunay_graph_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Voronoi_diagram_2.h>
#include <CGAL/Delaunay_triangulation_adaptation_traits_2.h>
#include <CGAL/Delaunay_triangulation_adaptation_policies_2.h>
typedef CGAL::Segment_Delaunay_graph_traits_2<Kernel> Gt;
typedef CGAL::Segment_Delaunay_graph_2<Gt> SDG2;
typedef CGAL::Exact_predicates_inexact_constructions_kernel
K;
typedef CGAL::Delaunay_triangulation_2<K>
DT;
typedef CGAL::Delaunay_triangulation_adaptation_traits_2<DT>
AT;
typedef CGAL::Delaunay_triangulation_caching_degeneracy_removal_policy_2<DT>
AP;
typedef CGAL::Voronoi_diagram_2<DT,AT,AP>
VD2;
using namespace std;
int main()
{
ifstream ifs("data/sites2.cin");
assert( ifs );
VD2 vd;
SDG2 sdg;
////SDG2::Site_2 site;
VD2::Site_2 site;
int compt;
// read the sites from the stream and insert them in the diagram
////while ( ifs >> site ) { sdg.insert( site ); }
while ( ifs >> site) { vd.insert(site); }
ifs.close();
// validate the diagram
////assert( sdg.is_valid(true, 1) );
assert( vd.is_valid(true, 1) );
cout << endl << endl;
////
sdg = vd.dual();
- [cgal-discuss] Coordinates of vertices for segment_voronoi, edouard.oudet, 04/10/2009
Archive powered by MHonArc 2.6.16.