Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Gilles Kneuss <>
  • To:
  • Subject: Re: [cgal-discuss] Cannot traverse vertices of Polygon_2 H E L P !!!
  • Date: Sat, 14 Nov 2009 16:13:43 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vjCuHF/2eo2l+Cv3Wsfcu0TLxS21Dy7Sct4c3OxBh8UQVdyU2BZCSLTHXjYnnRWF6j GlNzqjzxmu8vQ/gUC81gANGSZlq9fAocQou6uXkt6kl+xgQ6gadrFvP7TpO2igBuRX4d koVBmhiENC4+8pA4nqfTOEn+Kr5o+J/gpBS/s=

...I have to tell you (it might be important) that I use the methode inside a class that inheritate from Polygon_2 !

Gilles

2009/11/14 Gilles <>
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

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss





Archive powered by MHonArc 2.6.16.

Top of Page