Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] From vertex pointers to vertex handles?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] From vertex pointers to vertex handles?


Chronological Thread 
  • From: Tom Kazimiers <>
  • To:
  • Subject: Re: [cgal-discuss] From vertex pointers to vertex handles?
  • Date: Sun, 22 Mar 2009 22:20:54 +0100

Manuel,

thanks for your answer. My application deals with a vertex data
structure called ILaunchSite (it is an interface, actually). The data
handling should be done by CGAL. To avhive this I implemented my own
vertex_base class (like in the "adding handles" example):

template < class VertexBase = CGAL::Triangulation_vertex_base_2<K> >
class CGALLaunchSite :
public ILaunchSite<PrecisionType>,
public VertexBase
{
...
};

Since I am not too experienced with C++ and didn't manage it to work
mostly with references to CGALLaunchSites, I work often with pointers to
this class. There are two concurenting data "managers". One is CGAL -
the other is something I tryed for testing and other purposes. However,
is it possible to do the same with Vertex_handles? Can I implement my
own vertex handle class? This would be great :)

Currently I don't know any way to do this and so I have a somewhere in
my app a pointer to an ILaunchSite (the interface, actually it is a
CGALLaunchSite). This pointer points to a vertex in a CGAL delaunay
triangulation. Now I want to get the neighbors of this vertex and think
I should call incident_vertices (Vertex_handle v). It compiles when I
pass the pointer directly to the method but fails in runtime - a
NULL-Pointer check in the constructor of Vertex_handle found out that I
was not passing a NULL pointer - and he dislikes it ;)

Do you have any hints?

To have something to work with, I currently use a lookup table (a map)
to get the Vertex_handle I get from insertion from a pointer to a
CGALLaunchSite.

Regards and thanks,
Tom

Manuel Caroli schrieb:
> Hi Tom,
>
> I'm not sure I understand your problem well but I don't see a direct
> solution here. Why don't you work with pointers to Vertex_handles or
> directly with Vertex_handles?
> Maybe it would be helpful if you could post some pieces of code to
> clarify.
>
> Manuel
>
>
> Tom Kazimiers wrote:
>> Hi,
>>
>> like in the triangulation example "adding handles" I have my own data
>> structure as vertex for constrained 2D delaunay triangulations.
>> This works pretty good and I have only one problem: Most of the time I
>> deal with pointers to my vertices in the triangulation.
>> If I now want to call a method on the mesh like incident_vertices (
>> Vertex_handle v) I have to get a vertex_handle out of the pointer to the
>> vertex.
>>
>> Is there a way to do this?
>>
>> Thanks in advance,
>> Tom
>




Archive powered by MHonArc 2.6.16.

Top of Page