bgl interface

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

bgl interface

王少东-2
Hi,

I want to write generic algorithms on top of cgal's halfedge data structures. So I wonder is there a way to get the FieldType of kernel from a Surface_mesh as well as Polyhedron_3 using the bgl interface?

Cheers,
Shaodong
Reply | Threaded
Open this post in threaded view
|

Re: bgl interface

Julia Fischer


On 18 June 2017 at 11:41, 王少东 <[hidden email]> wrote:
Hi,

I want to write generic algorithms on top of cgal's halfedge data structures. So I wonder is there a way to get the FieldType of kernel from a Surface_mesh as well as Polyhedron_3 using the bgl interface?

Cheers,
Shaodong


signature.txt (102K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: bgl interface

Sebastien Loriot (GeometryFactory)
In reply to this post by 王少东-2
On 06/18/2017 11:41 AM, 王少东 wrote:
> Hi,
>
> I want to write generic algorithms on top of cgal's halfedge data
> structures. So I wonder is there a way to get the FieldType of
> kernel from a Surface_mesh as well as Polyhedron_3 using the bgl interface?
>
> Cheers,
> Shaodong

The best way to do it is to ask a geometric traits class template
parameter in addition in your algorithm. From this traits class
you can extract the FT.

The hacking way is to get a Kernel from the point type and then
get the FT.

for example

typedef boost::property_map<boost::vertex_point, TriangleMesh>::type
Vpm; // the default vertex point map
typedef typename boost::property_traits<Vpm>::value_type Point_3; // the
point type
typedef  CGAL::Kernel_traits<Point_3>::Kernel::FT FT;

Sebastien.





--
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: bgl interface

王少东-2
Thank you for your help!

2017-06-19 8:58 GMT+01:00 Sebastien Loriot (GeometryFactory) <[hidden email]>:
On 06/18/2017 11:41 AM, 王少东 wrote:
Hi,

I want to write generic algorithms on top of cgal's halfedge data
structures. So I wonder is there a way to get the FieldType of
kernel from a Surface_mesh as well as Polyhedron_3 using the bgl interface?

Cheers,
Shaodong

The best way to do it is to ask a geometric traits class template
parameter in addition in your algorithm. From this traits class
you can extract the FT.

The hacking way is to get a Kernel from the point type and then
get the FT.

for example

typedef boost::property_map<boost::vertex_point, TriangleMesh>::type Vpm; // the default vertex point map
typedef typename boost::property_traits<Vpm>::value_type Point_3; // the point type
typedef  CGAL::Kernel_traits<Point_3>::Kernel::FT FT;

Sebastien.





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