Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From:
  • To:
  • Subject: Re: Re: [cgal-discuss] how to do that?
  • Date: Tue, 22 Jan 2008 18:38:21 +0100 (CET)
  • Importance: Normal

Hello,

Using function draw_dual of triangulation_2 you recover objects which are
lines, segments and rays. Then use Intersection function to get a set of
segments.

//==========================================

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 ;
CGAL::Object obj_cgal = CGAL::intersection(YOUR_OBJECT,bbox);
Segment s;
if (CGAL::assign(s, obj_cgal))
Seglist.push_back(s);


Best,

Sebastien

> hi,
>
> thank you for your response, but if i have an infinity vertex i should
> find the intersection of its halfedge and my box then add this vertex at
> the face.
> but the intersection function don't accept halfedge in parametres.
> So, i don't know how can i do that !
>
> my goal is to find of each point inserted in voronoi his cell (e.g.a
> polygone).
>
> Best,
> --
> 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