Method for populating container with finite_vertices?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Method for populating container with finite_vertices?

Adam Getchell
Hi all,

Just in case I missed it in the documentation, is there a method which pushes all finite_vertices into a std::vector<Vertex_handle>?

(I know it’s trivial to write with the Finite_vertex_iterator, checking to see if I even need that.)

-- 

Reply | Threaded
Open this post in threaded view
|

Re: Method for populating container with finite_vertices?

andreas.fabri

std::vector<Vertex_handle> V(t.finite_vertices_begin(),
                              finite_vertices_end());

or the same with std::vector::insert(b.e)

andreas


On 28/04/2016 21:26, Adam Getchell wrote:

> Hi all,
>
> Just in case I missed it in the documentation, is there a method which
> pushes all finite_vertices into a std::vector<Vertex_handle>?
>
> (I know it’s trivial to write with the Finite_vertex_iterator, checking
> to see if I even need that.)
>
> --
> Adam Getchell
> about.me/adamgetchell <http://about.me/adamgetchell>
>

--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Method for populating container with finite_vertices?

Sebastien Loriot (GeometryFactory)
On 04/28/2016 09:50 PM, Andreas Fabri wrote:
>
> std::vector<Vertex_handle> V(t.finite_vertices_begin(),
>                               finite_vertices_end());
>
> or the same with std::vector::insert(b.e)

@Andreas I guess you meant std::vector<Vertex>.
@Adam, since Finite_vertex_iterator is convertible to Vertex_handle
you need a tranform_iterator that do not dereference the iterator.

Better do a classic for-loop

Sebastien.

>
> andreas
>
>
> On 28/04/2016 21:26, Adam Getchell wrote:
>> Hi all,
>>
>> Just in case I missed it in the documentation, is there a method which
>> pushes all finite_vertices into a std::vector<Vertex_handle>?
>>
>> (I know it’s trivial to write with the Finite_vertex_iterator, checking
>> to see if I even need that.)
>>
>> --
>> Adam Getchell
>> about.me/adamgetchell <http://about.me/adamgetchell>
>>
>


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: Method for populating container with finite_vertices?

Adam Getchell
Okay, thanks Sebastien and Andreas!

--
Adam Getchell
about.me/adamgetchell

> On Apr 28, 2016, at 12:54 PM, Sebastien Loriot (GeometryFactory) <[hidden email]> wrote:
>
> On 04/28/2016 09:50 PM, Andreas Fabri wrote:
>>
>> std::vector<Vertex_handle> V(t.finite_vertices_begin(),
>>                              finite_vertices_end());
>>
>> or the same with std::vector::insert(b.e)
>
> @Andreas I guess you meant std::vector<Vertex>.
> @Adam, since Finite_vertex_iterator is convertible to Vertex_handle
> you need a tranform_iterator that do not dereference the iterator.
>
> Better do a classic for-loop
>
> Sebastien.
>
>>
>> andreas
>>
>>
>> On 28/04/2016 21:26, Adam Getchell wrote:
>>> Hi all,
>>>
>>> Just in case I missed it in the documentation, is there a method which
>>> pushes all finite_vertices into a std::vector<Vertex_handle>?
>>>
>>> (I know it’s trivial to write with the Finite_vertex_iterator, checking
>>> to see if I even need that.)
>>>
>>> --
>>> Adam Getchell
>>> about.me/adamgetchell <http://about.me/adamgetchell>
>>>
>>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss