Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Vertices from a Finite_edges_iterator (Triangulation_2)
- Date: Fri, 22 Jan 2010 08:15:22 +0100
Agnel C J Kurian wrote:
How do I get x and y co-ordinates from a Finite_edges_iterator?Hello,
struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Constrained_triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb,Fb> TDS;
typedef CGAL::Exact_predicates_tag Itag;
typedef CGAL::Constrained_triangulation_2<K, TDS, Itag> CT;
typedef CT::Point Point;
for (CT::Finite_edges_iterator eit = ct.finite_edges_begin();
eit != ct.finite_edges_end(); ++eit){
<b>// todo: list x and y co-ordinates here</b>
}
As indicated in the documentation of the Triangulation_data_structure_2:
http://www.cgal.org/Manual/last/doc_html/cgal_manual/TDS_2_ref/Concept_TriangulationDataStructure_2.html#Cross_link_anchor_1246
an edge is a pair <Face_handle,int> indicating the edge opposed to a vertex in a given face.
In your example, you should use:
eit->first->vertex(CGAL::cw(eit->second))->point()
eit->first->vertex(CGAL::ccw(eit->second))->point()
to access the two endpoints of the edge.
S.
- [cgal-discuss] Vertices from a Finite_edges_iterator (Triangulation_2), Agnel C J Kurian, 01/22/2010
- Re: [cgal-discuss] Vertices from a Finite_edges_iterator (Triangulation_2), Sebastien Loriot (GeometryFactory), 01/22/2010
- [cgal-discuss] Shortcuts, Andreas Fabri, 01/22/2010
- Re: [cgal-discuss] Vertices from a Finite_edges_iterator (Triangulation_2), Sebastien Loriot (GeometryFactory), 01/22/2010
Archive powered by MHonArc 2.6.16.