kd-tree implementation?

C

carl

I am looking for a kd-tree implementation that returns the set of k closest
neighbors from a point P and a specified region R. Something like this:


std::vector<MyNeighborType> neighbors;
tree->Search( P, R, neighbors ) ;

In the implementation that I have found its not possible to specify a
neighbor type. I need this because each neighbor has some unique information
that I must use in the following computations.

Any suggestions on where to find a kd-tree that returns user-specified
objects instead of basic vectors - location?
 
P

paperab

I am looking for a kd-tree implementation that returns the set of k closest
neighbors from a point P and a specified region R. Something like this:

std::vector<MyNeighborType> neighbors;
  tree->Search( P, R, neighbors ) ;

In the implementation that I have found its not possible to specify a
neighbor type. I need this because each neighbor has some unique information
that I must use in the following computations.

Any suggestions on where to find a kd-tree that returns  user-specified
objects instead of basic vectors - location?

Memorize pointers to objects instead of objects, store the common base
class pointers into the vector and cast back the object with the
dynamic_cast.

This technique is often used in user interfaces where you cannot
predict which specific set of objects the user will select.

cheers
paperab
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top