Vertex handle from its associated info()

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

Vertex handle from its associated info()

GAD FLY
Hi all,

I'm new to CGAL so this question can be elementary!
I have a triangulation of a set of data points and I already assigned vertices with indices 0, 1, 2, ... via info(). My question is how to find a vertex handle by only using its index, i.e., its info()?

Thank you,
James
Reply | Threaded
Open this post in threaded view
|

Re: Vertex handle from its associated info()

yoapvol
Hi James,
I'm also quite new to CGAL, but from what I understand there is no built in
way to do what you ask.

You can either go over the vertices with an iterator/circulator looking for
the one that has the right info (inefficient I guess), or have some
book-keeping container (vector, list etc.) that stores the vertex handles.
e.g. I am using a vector of vertex handles constructed such that the index
of the vector element corresponds to the info of the vertex to which the
handle belongs. That way when I want the vertex handle of a given index, I
just go the the vector element of the same index.

Hope this helps.
Yoav.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
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: Vertex handle from its associated info()

GAD FLY
Thanks Yoav,
That is indeed the way I'm implementing it right now, however I thought maybe there is a simple built-in method to do this.

Thanks again,
James


On Wednesday, July 18, 2018 1:25 AM, yoapvol <[hidden email]> wrote:


Hi James,
I'm also quite new to CGAL, but from what I understand there is no built in
way to do what you ask.

You can either go over the vertices with an iterator/circulator looking for
the one that has the right info (inefficient I guess), or have some
book-keeping container (vector, list etc.) that stores the vertex handles.
e.g. I am using a vector of vertex handles constructed such that the index
of the vector element corresponds to the info of the vertex to which the
handle belongs. That way when I want the vertex handle of a given index, I
just go the the vector element of the same index.

Hope this helps.
Yoav.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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