#include <face_grid.h>
Nevrax France
Definition at line 66 of file face_grid.h.
Public Member Functions | |
void | init (uint width, float elsize) |
Init an empty build object with width and size. | |
void | insert (const NLMISC::CVector &bmin, const NLMISC::CVector &bmax, uint32 value) |
Insert a value in the grid. | |
Data Fields | |
std::vector< std::vector< uint32 > > | Grid |
The grid. | |
float | Size |
The size of each element. | |
uint | Width |
The width, in number of rows and lines of the grid. |
|
Init an empty build object with width and size.
Definition at line 187 of file face_grid.h. References Grid, nlassert, uint, and width. Referenced by NLPACS::CLocalRetriever::initFaceGrid().
|
|
Insert a value in the grid.
Definition at line 196 of file face_grid.h. References Grid, sint, uint32, value, x, NLMISC::CVector::x, y, and NLMISC::CVector::y. Referenced by NLPACS::CLocalRetriever::initFaceGrid().
00199 { 00200 sint x0 = (sint)(bmin.x/Size), 00201 x1 = (sint)(bmax.x/Size), 00202 y0 = (sint)(bmin.y/Size), 00203 y1 = (sint)(bmax.y/Size); 00204 00205 if (x1-x0 >= (sint)Width) 00206 { 00207 x0 = 0; 00208 x1 = Width-1; 00209 } 00210 else 00211 { 00212 x0 &= (Width-1); 00213 x1 &= (Width-1); 00214 if (x1 < x0) 00215 x1 += Width; 00216 } 00217 00218 if (y1-y0 >= (sint)Width) 00219 { 00220 y0 = 0; 00221 y1 = Width-1; 00222 } 00223 else 00224 { 00225 y0 &= (Width-1); 00226 y1 &= (Width-1); 00227 if (y1 < y0) 00228 y1 += Width; 00229 } 00230 00231 sint x, y; 00232 00233 for (y=y0; y<=y1; ++y) 00234 for (x=x0; x<=x1; ++x) 00235 Grid[(x&(Width-1))+(y&(Width-1))*Width].push_back(value); 00236 } |
|
The grid.
Definition at line 70 of file face_grid.h. Referenced by NLPACS::CFaceGrid::create(), init(), and insert(). |
|
The size of each element.
Definition at line 76 of file face_grid.h. Referenced by NLPACS::CFaceGrid::create(). |
|
The width, in number of rows and lines of the grid.
Definition at line 73 of file face_grid.h. Referenced by NLPACS::CFaceGrid::create(). |