Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] very very basic CGAL question : how to convert handles to native types

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] very very basic CGAL question : how to convert handles to native types


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] very very basic CGAL question : how to convert handles to native types
  • Date: Fri, 6 Nov 2009 15:56:30 +0100
  • Organization: GeometryFactory

On Friday 06 November 2009 15:39:11

wrote:
> thanks, I think I got it. If I'm not mistaken, the handle is just a pointer
> to the vertex, which represents the mathematical concept of a vertex. Then
> you call the appropriate function to get numerical representation of the
> data like point() for position in space, index() for the position in the
> data structure.
>
> Am I Correct ?

Yes, something like that. Handles are not exactly like pointers. You cannot
increment or decrement them. You can only dereference them, using operator*
or
operator-> (with the syntax *vh or vh->what_ever), and you can compare them.
The exact concept for CGAL handle is here:
http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Circulator_ref/Concept_Handle.html

When you have a What_ever_handle, you need to read the description of the
class What_ever that is the pointed by that type of handle. In your example,
that was the class C3t3::Triangulation::Vertex, for a given C3t3. The type of
Vertex in the triangulation depends on the type of triangulation you used to
instantiate the C3t3. My guess is that you used
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
like in examples. Then, have a look at:

http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Mesh_3_ref/Class_Mesh_triangulation_3.html
That page says that the type Vertex is:

http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Mesh_3_ref/Class_Mesh_vertex_base_3.html
which is a model of:

http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Mesh_3_ref/Concept_MeshVertexBase_3.html
and here you find the description of several methods of the Vertex type. But
that model refines another one:

http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Surface_mesher_ref/Concept_SurfaceMeshVertexBase_3.html
which refines another one:

http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Triangulation_3_ref/Concept_TriangulationVertexBase_3.html
and the latter describes the method Vertex::point.

I hope that example will help you find out informations in the CGAL manual.
As
you can see, that is not strait-forward for beginners. :-)

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/



Archive powered by MHonArc 2.6.16.

Top of Page