proj home

Files   Classes   Functions   Hierarchy  

bsptreeD2find< PT, PD, INDX > Class Template Reference

Search the bsp tree. More...

#include <bsptreeD2.h>

Collaboration diagram for bsptreeD2find< PT, PD, INDX >:

List of all members.

Public Member Functions

 bsptreeD2find (bsptreeD2< PT, PD, INDX > &bsp_)
 Pass the bsp tree reference.
void find (INDX &i, PT const &pt)
 Find the index i that the point pt is in.

Public Attributes

bsptreeD2< PT, PD, INDX > & bsp
 The bsp tree.
vector< treeindexedD2node
< INDX > * > 
path
 List of nodes defining the current path from the last find.


Detailed Description

template<typename PT, typename PD, typename INDX>
class bsptreeD2find< PT, PD, INDX >

Search the bsp tree.

Definition at line 153 of file bsptreeD2.h.


Constructor & Destructor Documentation

template<typename PT, typename PD, typename INDX>
bsptreeD2find< PT, PD, INDX >::bsptreeD2find ( bsptreeD2< PT, PD, INDX > &  bsp_  )  [inline]

Pass the bsp tree reference.

Definition at line 165 of file bsptreeD2.h.

00166     : bsp(bsp_) {}


Member Function Documentation

template<typename PT , typename PD , typename INDX >
void bsptreeD2find< PT, PD, INDX >::find ( INDX &  i,
PT const &  pt 
) [inline]

Find the index i that the point pt is in.

Definition at line 258 of file bsptreeD2.h.

References treeindexedD2< INDX >::current, treeindexedD2< INDX >::moveleft(), treeindexedD2< INDX >::moveright(), and treeindexedD2< INDX >::reset().

Referenced by bsptreeD2< PT, PD, INDX >::serializeInverse().

00262 {
00263   treeindexedD2<INDX> & tree(bsp.tree);
00264   vector< halfspaceD2<PT,PD> > & vi(bsp.vi);
00265 
00266   tree.reset();
00267 
00268   assert(tree.current!=0);
00269 
00270   while (tree.current->isleaf() == false)
00271   {
00272     assert(tree.current->index < vi.size());
00273 
00274     path.push_back(tree.current);
00275     if (vi[tree.current->index].isInside(pt))
00276       tree.moveleft();
00277     else
00278       tree.moveright();
00279   
00280     assert(tree.current!=0);
00281   }
00282 
00283   path.push_back(tree.current);
00284   i = tree.current->index;
00285 }


Member Data Documentation

template<typename PT, typename PD, typename INDX>
bsptreeD2<PT,PD,INDX>& bsptreeD2find< PT, PD, INDX >::bsp

The bsp tree.

Definition at line 158 of file bsptreeD2.h.

template<typename PT, typename PD, typename INDX>
vector< treeindexedD2node<INDX> * > bsptreeD2find< PT, PD, INDX >::path

List of nodes defining the current path from the last find.

Definition at line 162 of file bsptreeD2.h.

Referenced by bsptreeD2< PT, PD, INDX >::serializeInverse().


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:49:51 2011 for Chelton Evans Source by  doxygen 1.5.8