NL3D::CBSPTree< T > Class Template Reference

#include <bsp_tree.h>


Detailed Description

template<class T>
class NL3D::CBSPTree< T >

class: CBSPTree.

A template CBSPTree.

Definition at line 51 of file bsp_tree.h.

Public Member Functions

 CBSPTree ()
 Default constructor, use axes XZ.

sint32 getNbNode ()
getSelection (sint32 i)
void insert (NLMISC::CTriangle &tri, T &value)
sint32 select (CVector &v1, CVector &v2)
 ~CBSPTree ()
 dtor.


Private Attributes

CBSPNode_Root
std::vector< CBSPNode * > _Selection


Constructor & Destructor Documentation

template<class T>
NL3D::CBSPTree< T >::CBSPTree  ) 
 

Default constructor, use axes XZ.

Definition at line 253 of file bsp_tree.h.

References NL3D::CBSPTree< T >::_Selection.

00253                                         : _Root(NULL)
00254 {
00255         _Selection.reserve( 64 );
00256 }

template<class T>
NL3D::CBSPTree< T >::~CBSPTree  ) 
 

dtor.

Definition at line 258 of file bsp_tree.h.

References NL3D::CBSPTree< T >::_Root.

00259 {
00260         if( _Root != NULL )
00261                 delete _Root;
00262 }


Member Function Documentation

template<class T>
sint32 NL3D::CBSPTree< T >::getNbNode  ) 
 

Definition at line 295 of file bsp_tree.h.

References NL3D::CBSPTree< T >::_Root, NL3D::CBSPTree< T >::CBSPNode::getNbNode(), and sint32.

00296 {
00297         return _Root->getNbNode();
00298 }

template<class T>
T NL3D::CBSPTree< T >::getSelection sint32  i  ) 
 

Definition at line 290 of file bsp_tree.h.

References NL3D::CBSPTree< T >::_Selection, and sint32.

00291 {
00292         return _Selection[i]->Value;
00293 }

template<class T>
void NL3D::CBSPTree< T >::insert NLMISC::CTriangle tri,
T &  value
 

Definition at line 270 of file bsp_tree.h.

References NL3D::CBSPTree< T >::_Root, and NL3D::CBSPTree< T >::CBSPNode::insert().

00271 {
00272         if( _Root == NULL )
00273                 _Root = new CBSPNode( tri, val );
00274         else
00275                 _Root->insert( tri, val );
00276 }

template<class T>
sint32 NL3D::CBSPTree< T >::select CVector v1,
CVector v2
 

Definition at line 278 of file bsp_tree.h.

References NL3D::CBSPTree< T >::_Root, NL3D::CBSPTree< T >::_Selection, NL3D::CBSPTree< T >::CBSPNode::select(), and sint32.

00279 {
00280         _Selection.clear();
00281         if( _Root != NULL )
00282         {
00283                 _Root->select( _Selection, v1, v2 );
00284                 return _Selection.size();
00285         }
00286         else 
00287                 return 0;
00288 }


Field Documentation

template<class T>
CBSPNode* NL3D::CBSPTree< T >::_Root [private]
 

Definition at line 243 of file bsp_tree.h.

Referenced by NL3D::CBSPTree< T >::getNbNode(), NL3D::CBSPTree< T >::insert(), NL3D::CBSPTree< T >::select(), and NL3D::CBSPTree< T >::~CBSPTree().

template<class T>
std::vector<CBSPNode*> NL3D::CBSPTree< T >::_Selection [private]
 

Definition at line 72 of file bsp_tree.h.

Referenced by NL3D::CBSPTree< T >::CBSPTree(), NL3D::CBSPTree< T >::getSelection(), and NL3D::CBSPTree< T >::select().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 06:44:41 2004 for NeL by doxygen 1.3.6