Subject: CGAL users discussion list
List archive
- From: smurf <>
- To:
- Subject: [cgal-discuss] Re: Beginner questions
- Date: Tue, 27 Mar 2012 07:57:19 -0700 (PDT)
Thank you for the reply, it was most helpful.
Unfortunately now I have another problem. I am trying to prune the dual
graph of Segment_Delaunay_graph_hierarchy of the edges that intersect the
input sites.
My problem is when I am trying to determine if an edge (segment) intersects
a input segment.
In order to do this I use the following bruteforce algorithm:
for (finite_edges_iterator = sdg.finite_edges_begin();
finite_edges_iterator != sdg.finite_edges_end();
++finite_edges_iterator){
for (std::vector<CGALPrimitive>::iterator it =
MiscCGAL::primitives.begin();
it != MiscCGAL::primitives.end(); ++it){
(*it).intersection((*finite_edges_iterator),
sdg);
}
The CGALPrimitive just has a vector of sites. The intersection function
takes each edge and does an assign
to either line/ray/segment etc.
CGAL::Object o = sdg.primal(e); //where e is Graph_traits::Edge
But when I check the intersection of the edges(the ones casted to segments)
with the input segment,
case segment:
//CGAL::do_
return (CGAL::do_intersect(site.segment(),s );
It finds and prunes only one of the edges intersecting one of the endpoints
of the segment, like in the image.
http://cgal-discuss.949826.n4.nabble.com/file/n4509071/problem.jpg
Here is the way I declared the sdg:
struct Graph_traits
: public
CGAL::Segment_Delaunay_graph_filtered_traits_without_intersections_2<CGAL::Exact_predicates_exact_constructions_kernel>
{};
typedef CGAL::Tag_true STag;
typedef CGAL::Segment_Delaunay_graph_storage_traits_2<Graph_traits>
StorageTraits;
typedef CGAL::Segment_Delaunay_graph_hierarchy_2<Graph_traits,
StorageTraits, STag> SDG2;
typedef CGAL::Exact_predicates_exact_constructions_kernel::Segment_2
Segment_2;
typedef Graph_traits::Ray_2 Ray_2;
typedef Graph_traits::Segment_2 Segment_2;
typedef CGAL::Parabola_segment_2<Graph_traits> Parabola_2;
typedef Graph_traits::Line_2 Line_2;
typedef SDG2::Site_2 Site;
typedef SDG2::Edge Edge;
Any help is appreciated. Thank you.
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Beginner-questions-tp4495335p4509071.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Beginner questions, smurf, 03/22/2012
- Re: [cgal-discuss] Beginner questions, Sebastien Loriot (GeometryFactory), 03/22/2012
- [cgal-discuss] Re: Beginner questions, smurf, 03/27/2012
- Re: [cgal-discuss] Beginner questions, Sebastien Loriot (GeometryFactory), 03/22/2012
Archive powered by MHonArc 2.6.16.