Skip to Content.
Sympa Menu

cgal-discuss - Re:Re: Re: [cgal-discuss] how to do that?

Subject: CGAL users discussion list

List archive

Re:Re: Re: [cgal-discuss] how to do that?


Chronological Thread 
  • From:
  • To:
  • Subject: Re:Re: Re: [cgal-discuss] how to do that?
  • Date: Wed, 23 Jan 2008 17:14:34 +0100 (CET)
  • Importance: Normal


You do not have to manipulate halfedges. The piece of code I gave allow
you to do what I done in the attached pdf.

The only thing to do I copy and paste the code, and adapt it to your own
problem.

So again:

typedef CGAL::Iso_rectangle_2<YOUR_KERNEL> Rectangle;
typedef CGAL::Segment_2<YOUR_KERNEL> Segment;
typedef CGAL::Ray_2<KernelCD> Ray;
typedef CGAL::Line_2<KernelCD> Line;
typedef std::list<Ray> RayList;
typedef std::list<Line> LineList;
typedef std::list<Segment> SegmentList;


struct Voronoi_recup { //Class using stream to get the voronoi diagram
RayList quR;
LineList quL;
SegmentList quS;

Voronoi_recup() {quR.clear();quL.clear();quS.clear();}

void operator<<(const Ray p){quR.insert(quR.begin(),p);}
void operator<<(const Line p){quL.insert(quL.begin(),p);}
void operator<<(const Segment p){quS.insert(quS.begin(),p);}

};

YOUR_TRIANGULATION T;
Voronoi_recup vor;
.......
.......
T.draw_dual(vor);
.......
.......
SegmentList Seglist ;
Rectangle bbox(ONE_CORNER,OPPOSITE CORNER);

//TODO: iterate over vor.quR , vor.quS and vor.quL to fill Seglist using
//iterator CGAL::intersection
CGAL::Object obj_cgal = CGAL::intersection(YOUR_OBJECT,bbox);
Segment s;
if (CGAL::assign(s, obj_cgal))
Seglist.push_back(s);


Hope I am clear.

Sebastien

Attachment: example.pdf
Description: application/binary




Archive powered by MHonArc 2.6.16.

Top of Page