Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Vertices from a Finite_edges_iterator (Triangulation_2)

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Vertices from a Finite_edges_iterator (Triangulation_2)


Chronological Thread 
  • 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?

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>
}

Hello,

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.



Archive powered by MHonArc 2.6.16.

Top of Page