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: Mon, 23 Mar 2009 17:09:37 +0100

Tom Kazimiers schrieb:
> Benjamin schwarz schrieb:
>
>> If I understand your problem, you have 'p' a pointer to a vertex and
>> you would like to get a handle to that vertex. That is, you would like
>> to be able to do something like :
>> vertex_handle ph = p->vertex()
>>
>> According to the documentation, if you try to insert a point that
>> coincides with an existing point, there is no insertion and you get a
>> handle to the already existing point :
>> Vertex_handle t.insert ( Point p, Face_handle f = Face_handle())
>> Inserts point p in the triangulation and returns the
>> corresponding vertex.
>> If point p coincides with an already existing vertex, this vertex is
>> returned and the triangulation remains unchanged.
>>
>> I am not very familiar with that package though. Maybe another way to
>> get your handles is to "hack" through facets :
>> facet_handle fh = p->facet();
>> then test all three vertices in that facet to get a handle to the
>> vertex that coincides with your p->point()
>>
>> hope this helps
>>
>> --Ben
>>
>>
> Ben,
>
> thank you for your further suggestions. You understood my problem: I
> have a Vertex pointer 'p' and want to get ists handle. More precise I
> have a pointer to an object of my interface which is also a vertex - but
> the type of the pointer I get is a pointer to my interface type
> (ILaunchSite).
>
> I tryed the insertion method and it works, thank you :) It would be
> interesting to get some timings for what the fastest method would be. I
> will compare the methods.
>
> My problem with the facet method is that I get, like above said, a
> pointer to my type and would need a cast for this. And I try to avoid
> those little performance eaters. Well, on the other hand could this be a
> result of using a static interface class instead of a templated type
> (Which then would be the CGALLaunchSite implementation of ILaunchSite).
>
> Regards,
> Tom
>
>
>
I compared the method with a lookup table and the insertion method - 400
points each:

No optimization:
Insert: 63,7883ms
Map: 5,69598ms

Optimized:
Insert: 15,143ms
Map: 0,129905

I guess I stay with the map :)

Regards and thanks,
Tom



Archive powered by MHonArc 2.6.16.

Top of Page