Go Back   Velocity Reviews > Newsgroups > C++
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

C++ - kd-tree implementation?

 
Thread Tools Search this Thread
Old 11-02-2009, 05:15 PM   #1
Default kd-tree implementation?


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?



carl
  Reply With Quote
Old 11-02-2009, 07:30 PM   #2
paperab
 
Posts: n/a
Default Re: kd-tree implementation?
On Nov 2, 5:15*pm, "carl" <carl@.com> wrote:
> 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


paperab
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
implementation of collapsible panel control in asp.net bhawneshkumar Software 0 07-17-2009 06:38 AM
can anyone guide me in flight-mode implementation for Windows mobile 5.0? vivekanand holla Wireless Networking 1 11-10-2005 11:15 AM
transport protocol implementation in NDIS zenhwa Wireless Networking 0 09-15-2004 12:38 AM
REVIEW: "Enterprise Directory and Security Implementation Guide", Charles Carrington et al Rob Slade, doting grandpa of Ryan and Trevor Computer Security 0 12-08-2003 03:43 PM
REVIEW: "Enterprise Directory and Security Implementation Guide", Charles Carrington et al Rob Slade, doting grandpa of Ryan and Trevor Computer Security 0 12-01-2003 03:43 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46