# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CStaticQuadGrid Class Template Reference

This class is builded from a CQuadGrid, and is to be used when: sizeof(T) is small (ie a pointer) no dynamic insertion are made (builded from a CQuadGrid) selection is made with a point, not a BBox. More...

#include <static_quad_grid.h>

List of all members.

Public Methods

 CStaticQuadGrid ()
 Constructor. More...

 ~CStaticQuadGrid ()
 dtor. More...

Initialization
void build (CQuadGrid< T > &quadGrid)
 build from a CQuadGrid. More...

void clear ()
 Clear all the container. More...

Selection
const T * select (const NLMISC::CVector &point, uint &numElts)
 Select elements at a given point Speed is in O(1), because the array of the cell is returned. More...


Private Methods

void selectPoint (CVector point, sint &x0, sint &y0)

Private Attributes

std::vector< T > _Elements
std::vector< CQuadNode_Grid
sint _Size
sint _SizePower
float _EltSize
NLMISC::CMatrix _ChangeBasis


Detailed Description

template<class T>
class NL3D::CStaticQuadGrid< T >

This class is builded from a CQuadGrid, and is to be used when: sizeof(T) is small (ie a pointer) no dynamic insertion are made (builded from a CQuadGrid) selection is made with a point, not a BBox.

  • * - * - Because elements are duplicated all over cells and only one cell can be selected at a time.
Author:
Lionel Berenguier , Nevrax France
Date:
2002

Definition at line 51 of file static_quad_grid.h.


Constructor & Destructor Documentation

template<class T>
NL3D::CStaticQuadGrid< T >::CStaticQuadGrid  
 

Constructor.

Definition at line 146 of file static_quad_grid.h.

References _ChangeBasis, _EltSize, _Grid, _Size, _SizePower, and NLMISC::CMatrix::identity.

template<class T>
NL3D::CStaticQuadGrid< T >::~CStaticQuadGrid  
 

dtor.

Definition at line 156 of file static_quad_grid.h.

References clear.


Member Function Documentation

template<class T>
void NL3D::CStaticQuadGrid< T >::build CQuadGrid< T > &    quadGrid
 

build from a CQuadGrid.

Elements are copied, not referenced Elements may be duplicated in all cells they lie into. quadGrid selection is cleared

Definition at line 181 of file static_quad_grid.h.

References _ChangeBasis, _Elements, _EltSize, _Grid, _Size, _SizePower, clear, NLMISC::contReset, NLMISC::getPowerOf2, NLMISC::CMatrix::inverted, x, and y.

template<class T>
void NL3D::CStaticQuadGrid< T >::clear  
 

Clear all the container.

Elements are deleted, and the quadgrid is erased.

Definition at line 164 of file static_quad_grid.h.

References _ChangeBasis, _Elements, _EltSize, _Grid, _Size, _SizePower, and NLMISC::CMatrix::identity.

Referenced by build, and ~CStaticQuadGrid.

template<class T>
const T * NL3D::CStaticQuadGrid< T >::select const NLMISC::CVector   point,
uint   numElts
 

Select elements at a given point Speed is in O(1), because the array of the cell is returned.

NULL if size==0.

Parameters:
point  is the point used to select
numElts  number of elements returned
Returns:
a ptr on array of elements

Definition at line 269 of file static_quad_grid.h.

References _ChangeBasis, _Grid, _Size, selectPoint, x, and y.

template<class T>
void NL3D::CStaticQuadGrid< T >::selectPoint CVector    point,
sint   x0,
sint   y0
[inline, private]
 

Definition at line 114 of file static_quad_grid.h.

Referenced by select.


Member Data Documentation

template<class T>
NLMISC::CMatrix NL3D::CStaticQuadGrid::_ChangeBasis [private]
 

Definition at line 110 of file static_quad_grid.h.

Referenced by build, clear, CStaticQuadGrid, and select.

template<class T>
std::vector<T> NL3D::CStaticQuadGrid::_Elements [private]
 

Definition at line 105 of file static_quad_grid.h.

Referenced by build, and clear.

template<class T>
float NL3D::CStaticQuadGrid::_EltSize [private]
 

Definition at line 109 of file static_quad_grid.h.

Referenced by build, clear, CStaticQuadGrid, and NL3D::CStaticQuadGrid< const CTriangle * >::selectPoint.

template<class T>
std::vector<CQuadNode> NL3D::CStaticQuadGrid::_Grid [private]
 

Definition at line 106 of file static_quad_grid.h.

Referenced by build, clear, CStaticQuadGrid, and select.

template<class T>
sint NL3D::CStaticQuadGrid::_Size [private]
 

Definition at line 107 of file static_quad_grid.h.

Referenced by build, clear, CStaticQuadGrid, select, and NL3D::CStaticQuadGrid< const CTriangle * >::selectPoint.

template<class T>
sint NL3D::CStaticQuadGrid::_SizePower [private]
 

Definition at line 108 of file static_quad_grid.h.

Referenced by build, clear, and CStaticQuadGrid.


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