Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulation with id insertion using range insert function?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulation with id insertion using range insert function?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Triangulation with id insertion using range insert function?
  • Date: Fri, 29 Oct 2010 08:57:31 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=tBPzGHjsIKsGYCUyoyXgJ3jdWpfgvZdbvEsjQic8X1Q3c1r2sQwaGDXgdy4zWopP1W 2vRwtN2qisbO7nd/Ma8OqAmQ6avxW3KqFmJ2fg4vS3zsKTdoS5vXMCNONsU1p5l99sCc Z86/Ue3e3aO/2T3vil2SqTfJUdqSLoRvzh8IU=

Manuel Caroli wrote:
Hi Sam,

the problem is that the range insertion changes the insertion order of the points. I'm afraid I don't have an idea how you can find a correspondence between the vertices and the id's corresponding to your input points.

Another possibility to speed-up your triangulation computation would be to use the Delaunay hierarchy (see http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_3/Chapter_main.html#Subsection_37.5.4).

Maybe somebody else has a better idea?

Even if not very elegant, here is a working solution

https://lists-sop.inria.fr/sympa/arc/cgal-discuss/2010-01/msg00004.html

I have a better solution still under internal review to be integrated directly into CGAL, but you'll have to wait for this one.

S.

Manuel

On 28/10/10 19:44, Samuel Gundry wrote:
Hi,

Is there a way to insert points into a triangulation using the range
insert function while assigning ids to each point (using
Triangulation_vertex_base_with_id_2)? Am I able able to use my point
types?

Currently, I'm iterating through the points, inserting, and then
assigning an id.

typedef CGAL::Triangulation_euclidean_traits_xy_3<K> TriangulationTraits;
typedef CGAL::Triangulation_vertex_base_with_id_2<TriangulationTraits>
TriangulationVertexBase;
typedef CGAL::Triangulation_data_structure_2<TriangulationVertexBase>
TriangulationDataStructure;
typedef CGAL::Delaunay_triangulation_2<TriangulationTraits,TriangulationDataStructure>
Trianglulation;

int id = 0;
vector< Point_3> points;
// ... fill points
for (vector< Point>::const_iterator p = points.begin(); p !=
points.end(); ++p, ++id ) {
Trianglulation::Vertex_handle v = triangulation.push_back(*p);
v->id() = id;
}

But, I thought, using the range iterator is more efficient:

vector< Point_3> points;
// ... fill points
triangulation.insert(points.begin(), points.end()); // How do I
assign an id to each vertex here?

Thanks,
Sam







Archive powered by MHonArc 2.6.16.

Top of Page