Segment Voronoi Diagram

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Segment Voronoi Diagram

christi4n
Hello,

I am trying to construct the Voronoi diagram of segments via the Voronoi
diagram adaptor. My final goal is to iterate over the faces and the edges of
the Voronoi diagram.

I would like to insert the sites from
/cgal/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/data/sites2.cin,
but I always get the error "'INSERT_IS_NOT_SUPPORTED' was not declared in
this scope."

This is my code:

typedef CGAL::Quotient<CGAL::MP_Float>  ENT;
typedef CGAL::Simple_cartesian<double>     CK;
typedef CGAL::Simple_cartesian<ENT>        EK;
typedef
CGAL::Segment_Delaunay_graph_filtered_traits_2<CK,CGAL::Field_with_sqrt_tag,
EK,  CGAL::Field_tag>  Gt;
typedef CGAL::Segment_Delaunay_graph_2<Gt>             SDG2;
typedef CGAL::Segment_Delaunay_graph_adaptation_traits_2<SDG2> TRAIT;
typedef
CGAL::Segment_Delaunay_graph_caching_degeneracy_removal_policy_2<SDG2>
POLICY;
typedef CGAL::Voronoi_diagram_2<SDG2,TRAIT,POLICY> SEG_VD;

typedef TRAIT::Site_2 Site_2;
typedef TRAIT::Point_2 Point_2;

My main:

    std::ifstream
ifs("cgal/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/data/sites2.cin");
    assert( ifs );
    SEG_VD SEG;
    Site_2 site;
    std::vector<Site_2> sites;

    while ( ifs >> site ) { sites.push_back( site ); }
    ifs.close();

    SEG.insert(sites[0]);

The problem seems to be the last line (ie SEG.insert(sites[0]);). Changing
it to SEG.instert(sites[0], CGAL::Tag_true()) produes other errors.

I would be very pleased if someone could help me. To me it seems that I
missed something rather obvious as there are similar examples on this forum
that are supposed to be woking.

Thanks in advance.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Segment Voronoi Diagram

MaelRL

Hello,

Sorry, this thread slipped through the cracks.

The wrong policy is being used: Segment_Delaunay_graph_caching_degeneracy_removal_policy_2 caches the structure of the Voronoi and thus disables insertion of sites. It is meant to be used once you have constructed your primal. Here, you must use Segment_Delaunay_graph_degeneracy_removal_policy_2 instead.

Best,
Mael


    
On 02/07/2019 12:54, christi4n wrote:
Hello,

I am trying to construct the Voronoi diagram of segments via the Voronoi
diagram adaptor. My final goal is to iterate over the faces and the edges of
the Voronoi diagram.

I would like to insert the sites from
/cgal/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/data/sites2.cin,
but I always get the error "'INSERT_IS_NOT_SUPPORTED' was not declared in
this scope."

This is my code:

typedef CGAL::Quotient<CGAL::MP_Float>  ENT;
typedef CGAL::Simple_cartesian<double>     CK;
typedef CGAL::Simple_cartesian<ENT>        EK;
typedef
CGAL::Segment_Delaunay_graph_filtered_traits_2<CK,CGAL::Field_with_sqrt_tag,
EK,  CGAL::Field_tag>  Gt;
typedef CGAL::Segment_Delaunay_graph_2<Gt>             SDG2;
typedef CGAL::Segment_Delaunay_graph_adaptation_traits_2<SDG2> TRAIT;
typedef
CGAL::Segment_Delaunay_graph_caching_degeneracy_removal_policy_2<SDG2>
POLICY;
typedef CGAL::Voronoi_diagram_2<SDG2,TRAIT,POLICY> SEG_VD;

typedef TRAIT::Site_2 Site_2;
typedef TRAIT::Point_2 Point_2;

My main:

    std::ifstream
ifs("cgal/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/data/sites2.cin");
    assert( ifs );
    SEG_VD SEG;
    Site_2 site;
    std::vector<Site_2> sites;

    while ( ifs >> site ) { sites.push_back( site ); }
    ifs.close();

    SEG.insert(sites[0]);

The problem seems to be the last line (ie SEG.insert(sites[0]);). Changing
it to SEG.instert(sites[0], CGAL::Tag_true()) produes other errors.

I would be very pleased if someone could help me. To me it seems that I
missed something rather obvious as there are similar examples on this forum
that are supposed to be woking.

Thanks in advance.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/