Skip to content

How to know whether Gt::Object_2 is a site or a line? (2D Apollonius diagram) #7580

Answered by stla
stla asked this question in Q&A
Discussion options

You must be logged in to vote

This compiles so that probably works:

    Traits traits = ag.geom_traits();
    Traits::Construct_object_2 cst = traits.construct_object_2_object();
    Object2 obj = cst(ag.dual(f));
    Traits::Assign_2 assgn = traits.assign_2_object();
    Site2 site;

    if(assgn(site, obj)) {
      Point2 pt  = site.point();
      DualPoints(fid, 0) = pt.x();
      DualPoints(fid, 1) = pt.y();
    } else {
      // ...
    }

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@lrineau
Comment options

@lrineau
Comment options

@stla
Comment options

@stla
Comment options

Answer selected by stla
Comment options

You must be logged in to vote
1 reply
@stla
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants