Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Accessing Finite_Vertex_Iterator as std::iterator

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Accessing Finite_Vertex_Iterator as std::iterator


Chronological Thread 
  • From: Tom Kazimiers <>
  • To:
  • Subject: Re: [cgal-discuss] Accessing Finite_Vertex_Iterator as std::iterator
  • Date: Tue, 24 Feb 2009 17:07:04 +0100

Sylvain Pion schrieb:
> Tom Kazimiers wrote:
>> Sylvain Pion schrieb:
>>> Tom Kazimiers wrote:
>>>> Sylvain Pion schrieb:
>>>>> Tom Kazimiers wrote:
>>>>>> Sylvain Pion schrieb:
>>>>>>> Tom Kazimiers wrote:
>>>>>>>> I have an interface which represents access to delaunay
>>>>>>>> triangulation.
>>>>>>>> Part of this interface should be an iterator which allows me to go
>>>>>>>> through all the vertices of the triangulation. As an
>>>>>>>> implementation of
>>>>>>>> this interface I built an adapter to CGAL which works pretty
>>>>>>>> well -
>>>>>>>> except for the iterator.
>>>>>>>> From CGAL I can get an Finite_vertices_iterator but I need a
>>>>>>>> std::iterator (or a boost iterator) (part of the interface)
>>>>>>>> - now I wonder if there is any other way for this then writing a
>>>>>>>> wrapper
>>>>>>>> class?
>>>>>>> It would be interesting to know the reason why you have such a
>>>>>>> requirement.
>>>>>>>
>>>>>> I am working currently on an university project in which I would
>>>>>> like to
>>>>>> easyly switch between delaunay triangulation variants (like between
>>>>>> CGAL
>>>>>> and an implementation of one of my professors). For this I wrote an
>>>>>> interface (lots of "virtual ... = 0;" functions) to write code only
>>>>>> against this interface (which is good habbit anyway I guess). This
>>>>>> again
>>>>>> would it make easy to see the behaviour of different triangulations
>>>>>> without changing much code.
>>>>> Then I guess the answer is that you have to write wrappers.
>>>>>
>>>>> You can also go on the generic programming path using a concept,
>>>>> and write adaptors for the 2 implementations.
>>>>>
>>>> Sylvain, thanks for your suggestions. CGAL makes a lot use of the
>>>> concept/template approach, doesn't it?
>>> Yes. You can even call it abuse, sometimes :)
>>>
>>> You will find the basic principles in the design of the STL.
>>>
>> Hehe, I see. Sorry, but I got one more littel question regarding the the
>> concept thing:
>> Concepts seem to be something like a not-written-out interface contract
>> - is this true? Like one assumes serveral methods in a instantiated
>> template.
>
> This is getting off-topic for this list.
> I'd suggest that you take a look at some good book,
> like Matt Austern's "Generic Programming and the STL".
>
Sure, I will take a look into this.

Thanks,
Tom




Archive powered by MHonArc 2.6.16.

Top of Page