Skip to content

k-d tree search with projection traits #7135

Answered by sloriot
ipadjen asked this question in Q&A
Discussion options

You must be logged in to vote

Some types are missing in Projection_traits_xy_3 so it's not a model of SearchGeomTraits_2. I think an easy option is to use the Search_traits_adaptor with a property map doing the projection on the fly.

Something like the following for the map:

template<class K>
struct Projection_xy_property_map
{
  typedef typename K::Point_3 key_type;
  typedef typename K::Point_2 value_type;
  typedef value_type reference;
  typedef boost::readable_property_map_tag category;


  friend value_type get(Projection_xy_property_map<K>, const key_type& k)
  {
    return value_type(k.x(), k.y());
  }
};

and the following typedefs:

typedef CGAL::Search_traits_2<Kernel>Traits_base;
typedef CGAL::Search_traits_…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@ipadjen
Comment options

@sloriot
Comment options

@ipadjen
Comment options

Answer selected by ipadjen
Comment options

You must be logged in to vote
4 replies
@sloriot
Comment options

@ipadjen
Comment options

@sloriot
Comment options

@ipadjen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants