Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] how to extend kd-tree to range-query user defined point?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] how to extend kd-tree to range-query user defined point?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] how to extend kd-tree to range-query user defined point?
  • Date: Wed, 30 Mar 2011 14:42:09 +0200

There is a bug in the documentation we are aware of and that should be
fixed in the 3.9 release. Search_traits is not a real model of the
SearchTraits concept as it cannot be used for range-search queries.

It should not be hard to define your own traits class using this concept
page:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Spatial_searching_ref/Concept_SearchTraits.html#Cross_link_anchor_1634


For a concise view you can also have a look at
include/CGAL/Search_traits_2.h (which simply contains types that
need to be defined)

Basically you simply have to define more functors than in the example
here:

http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Spatial_searching/Chapter_main.html#Subsection_59.3.5


S.





yanyajie wrote:
> Hi,
>
> I have a specific point type, known as surfel. I would like to build a
> kd-tree for a bunch of surfels and to do range-query specified by a
> sphere queryitem. How can I extend the kd-tree to achieve my goal?
>
> I examined the search() routine in kd_tree_node.h and found kd_tree
> heavily rely on the query item’s contains() member to do actual query.
> Does that mean all I have to do is just implement my own extended
> version of query item, like a sphere, so that it can determine whether
> or not a surfel is contained in? Or do I have to provide another
> distance class as exemplified in the example?
>
> Really need some help here. Thanks in advance!!!
>
> Yan.
>
>
>
> -------------------------------------------------------------------------------------
> * The State Key Labratory of Virtual Reality and Technology
> * School of Computer Science and Engineering
> * Beijing University Aeronautics and Astronautics (Beihang Univ.)
> -------------------------------------------------------------------------------------




Archive powered by MHonArc 2.6.16.

Top of Page