Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Patch proposal: AABB_traits.h

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Patch proposal: AABB_traits.h


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Patch proposal: AABB_traits.h
  • Date: Thu, 08 Nov 2012 09:19:22 +0100
  • Organization: GeometryFactory

On 11/03/2012 07:22 PM, Sebastian Hegler wrote:
Hello!

The attached patch exposes the GeomTraits of the AABB_traits class, which is
basically the CGAL kernel type used for the instantiation, by using a public
typedef.
This one-liner makes my work a lot easier. If you find it worthy, feel free
to include it in the CGAL library.

I think the main reason why what you suggest is not done in CGAL,
is that all types that AABB_traits must provide are described in the AABBGeomTraits concept [1], and all those types are then exposed in
AABB_traits as a model of AABBTraits [1].

This means that you need this typedef to use other types not required
by the concept, which implies that your algorithm might not work with
an alternative traits for the AABB_tree (which is perfectly fine if you
don't expect to change the traits at some point).

If you really need it and want to use official CGAL, I suggest to get GeomTraits using a partial specialization of a class, something like:

template <class T>
struct Get_geom_traits;

template<typename GeomTraits, typename AABB_primitive>
struct Get_geom_traits< CGAL::AABB_traits<GeomTraits,AABB_primitive> >
{
typedef GeomTraits type;
};



[1] http://www.cgal.org/Manual/latest/doc_html/cgal_manual/AABB_tree_ref/Concept_AABBTraits.html

[2] http://www.cgal.org/Manual/latest/doc_html/cgal_manual/AABB_tree_ref/Concept_AABBGeomTraits.html

Yours,
Sebastian






Archive powered by MHonArc 2.6.18.

Top of Page