Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: <>
  • To:
  • Subject: Re: Re: [cgal-discuss] Inserting vertices into Voronoi Diagram
  • Date: Mon, 23 Nov 2009 13:13:14 +0100 (CET)

Hello,

your help actually cleared the fog in my head for a second and i changed the
code like that:

virtual void get_next_diagram(){

typedef std::vector<Point_2> Point_vector;

Point_vector pv;
Vertex_iterator vit;
Point_2 p;

for (vit = this->vertices_begin(); vit != this->vertices_end(); ++vit) {
p = Point_2((*vit).point().x(), (*vit).point().y());
pv.push_back(p);
}
this->clear();

for (unsigned int i = 0; i < pv.size(); i++) {

this->insert(pv[i]);
}
}


It works perfectly. The clear-Function seems have invalidated the vertices
indeed. So i used a point vector instead, saving the points instead of the
vertex references. Like both of you suggested. Thank you very much. I guess i
should have asked the mailing list much earlier.

Good day,

Artyom



Archive powered by MHonArc 2.6.16.

Top of Page