Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Cannot traverse vertices of Polygon_2 H E L P !!!

Subject: CGAL users discussion list

List archive

[cgal-discuss] Cannot traverse vertices of Polygon_2 H E L P !!!


Chronological Thread 
  • From: Gilles <>
  • To:
  • Subject: [cgal-discuss] Cannot traverse vertices of Polygon_2 H E L P !!!
  • Date: Sat, 14 Nov 2009 15:55:56 +0100 (CET)

Hello all,

I'm pretty new in CGAL (as well as in C++), it might be a silly question !

I really need help !!!

THE ERROR IS :

erreur: conversion from
«std::_List_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> > >» to non-scalar type
«__gnu_cxx::__normal_iterator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >*,
std::vector<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> > > > >» requested

THE CODE IS :

Polygon_2 polygon;
Polygon_list partition_polys;

CGAL::random_polygon_2(50, std::back_inserter(polygon),
Point_generator(100));

CGAL::approx_convex_partition_2(polygon.vertices_begin(),
polygon.vertices_end(),
std::back_inserter(partition_polys));

// transverse the polygon-list
for (Polygon_iterator poly_it = partition_polys.begin(); poly_it !=
partition_polys.end();poly_it++)
{
// HERE IS THE ERROR
for (Vertex_iterator it=(*poly_it).vertices_begin();it !=
(*poly_it).vertices_end();++it)
{

}

}

HERE IS THE INCLUDE / TYPE-DEF I USE :

#include <CGAL/basic.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_traits_2.h>
#include <CGAL/intersections.h>

#include <CGAL/Partition_traits_2.h>
#include <CGAL/partition_2.h>
#include <CGAL/point_generators_2.h>
#include <CGAL/random_polygon_2.h>
#include <cassert>
#include <list>

#include "../AC_Forme3D/ac_forme3d.h"
#include "../AC_Utilities/ac_utilities.h"


typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point;
typedef K::Segment_2 Segment_2;
typedef CGAL::Polygon_traits_2<K> Gp;
typedef CGAL::Polygon_2<Gp>::Vertex_iterator vertexIterator;

typedef CGAL::Partition_traits_2<K> Traits;
typedef Traits::Point_2 Point_2;
typedef Traits::Polygon_2 Polygon_2;
typedef Polygon_2::Vertex_iterator Vertex_iterator;
typedef std::list<Polygon_2> Polygon_list;
typedef CGAL::Creator_uniform_2<int, Point_2> Creator;
typedef CGAL::Random_points_in_square_2<Point_2, Creator> Point_generator;
typedef std::list<Polygon_2>::const_iterator Polygon_iterator;

Thanks in advance !


Gilles



Archive powered by MHonArc 2.6.16.

Top of Page