Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] drawing of the polygon/segment voronoi diagram

Subject: CGAL users discussion list

List archive

[cgal-discuss] drawing of the polygon/segment voronoi diagram


Chronological Thread 
  • From: "karine hins-mallet" <>
  • To: <>
  • Subject: [cgal-discuss] drawing of the polygon/segment voronoi diagram
  • Date: Fri, 15 Aug 2008 12:40:32 -0400

Hello,

 

I’m working with the polygon Delaunay graph demo. I’m presently trying to understand how the drawing function works. I have problems with the following code, which is in the pdg_draw.h file:

 

  typename T::Finite_edges_iterator eit = sdg.finite_edges_begin();

 

  for (; eit != sdg.finite_edges_end(); ++eit) {

      if ( eit->first->vertex( sdg.cw(eit->second) )->info() !=

       eit->first->vertex( sdg.ccw(eit->second) )->info() ) {

            {sdg.draw_dual_edge(*eit, widget);}

    }

 

 

I have two questions :

 

  1. The iterator declared here allows to visit the edges of the DELAUNAY graph, not the edges of the Voronoï graph. But the drawing function (draw dual edge) takes a VORONOI edge in parameter, not a Delaunay edge, and draws that edge to a stream. I know the Voronoï and Delaunay diagrams are dual, but a Delaunay edge is not an edge in the Voronoï diagram. So, what is the trick here? Maybe the draw_dual_edge function receives a Delaunay edge in parameter, but draws its dual edge (i.e. a Voronoï edge) to the stream? The doc is a bit unclear on this point.

 

2. I modified the demo so that all the segments of a polygon have the same ID (the sites “info”). The drawing function works like a charm, it draws only the lines of the polygon Voronoï cells, instead of drawing all the diagram lines (skeleton lines, segment Voronoï cells), as can be seen in the print screen I joined to this mail. But I don’t understand how the “if” condition works in the code above. Can someone explain it to me?

 

 

Thank you, any input is really appreciated!

 

 

Karine

MSc student, geomatics

Université Laval

Attachment: voronoi for polygons.gif
Description: GIF image



  • [cgal-discuss] drawing of the polygon/segment voronoi diagram, karine hins-mallet, 08/15/2008

Archive powered by MHonArc 2.6.16.

Top of Page