Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Access to vertices coordinates from an existing triangulation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Access to vertices coordinates from an existing triangulation


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Access to vertices coordinates from an existing triangulation
  • Date: Thu, 20 May 2010 15:04:40 +0200

All vertices of a 2D CGAL triangulation are model of the concept
TriangulationVertexBase_2 described here:

http://www.cgal.org/Manual/last/doc_html/cgal_manual/Triangulation_2_ref/Concept_TriangulationVertexBase_2.html#Cross_link_anchor_1290

You will find documentation of methods point() and set_point(Point_2 p).

S.



Youssef ALJ wrote:
Hi all,

I'd like to know if there's any possibility for a given triangulation to access to vertices' coordinates once this triangulation is constructed.

Suppose we have the following code (from Geomview demo):

#include <CGAL/Cartesian <http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Kernel_23_ref/Class_Cartesian.html#Cross_link_anchor_1>.h>
#include <CGAL/Triangulation_euclidean_traits_xy_3 <http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Triangulation_2_ref/Class_Triangulation_euclidean_traits_xy_3.html#Cross_link_anchor_947>.h>
#include <CGAL/Delaunay_triangulation_2 <http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Triangulation_2_ref/Class_Delaunay_triangulation_2.html#Cross_link_anchor_930>.h>
#include <fstream>
#include <iostream>


typedef CGAL::Cartesian
<http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Kernel_23_ref/Class_Cartesian.html#Cross_link_anchor_1><double

<http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/NumberTypeSupport_ref/Class_double.html#Cross_link_anchor_582>>
K;
typedef CGAL::Triangulation_euclidean_traits_xy_3<K>
<http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Triangulation_2_ref/Class_Triangulation_euclidean_traits_xy_3.html#Cross_link_anchor_947>
Gt3;
typedef Gt3::Point Point3;
typedef CGAL::Delaunay_triangulation_2
<http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Triangulation_2_ref/Class_Delaunay_triangulation_2.html#Cross_link_anchor_930><Gt3>
Terrain;


int
<http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/NumberTypeSupport_ref/Class_int.html#Cross_link_anchor_577>
main()
{


Terrain T;

std::ifstream iFile("data/points3", std::ios::in);
Point3 p;
while ( iFile >> p )
{ T.insert( p );
}

return 0;

}

Then i'd like to access to vertices' coordinates. The purpose is to change the geometry of this triangulation (3D coordinates) without changing its connectivity (how faces rely on each other). I didn't find in Delaunay_triangulation_2 class any accessor to vertices. Could any body tell me how to do it?
Any suggestion is helpful.

Regards,
Youssef ALJ



------------------------------------------------------------------------
Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now. <https://signup.live.com/signup.aspx?id=60969>




Archive powered by MHonArc 2.6.16.

Top of Page