Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Inserting vertices into Voronoi Diagram

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Inserting vertices into Voronoi Diagram


Chronological Thread 
  • From: Daniel Duque <>
  • To:
  • Subject: Re: [cgal-discuss] Inserting vertices into Voronoi Diagram
  • Date: Mon, 23 Nov 2009 13:00:48 +0100
  • Organization: UPM

Hi,

> typedef std::vector<Vertex> Vertex_vector;
>
> Vertex_vector vv;
> Vertex_iterator vit;
> Point_2 p;
>
> for (vit = this->vertices_begin(); vit != this->vertices_end(); ++vit) {
> vv.push_back(*vit);
> }

This is wrong. You want the _points_, not the vertices. Those are going down
the loo here:

> this->clear();

You'd need a sdt::vector<Point>, then push back the _points_ on that vector:

Also, beware you may do this in a point-by-point fashion. You may insert a
new
point, then delete the old one (or perhaps, delete then insert). This is
tricky, but there is a move() function to do this, which I am currently
trying
(I think it is not documented, but it's right there in the .h source).

Best,

Daniel




Archive powered by MHonArc 2.6.16.

Top of Page