#include <grid_static_ptr.h>
Classes | |
class | Link |
Public Types | |
typedef Box3< ScalarType > | Box3x |
typedef BasicGrid< FLT > | BT |
typedef Link * | Cell |
typedef Cell | CellIterator |
typedef Point3< ScalarType > | CoordType |
typedef GridStaticPtr< OBJTYPE, FLT > | GridPtrType |
typedef Line3< ScalarType > | Line3x |
typedef ObjType * | ObjPtr |
typedef OBJTYPE | ObjType |
typedef ObjType::ScalarType | ScalarType |
Public Member Functions | |
template<class OBJRAYISECTFUNCTOR , class OBJMARKER > | |
ObjPtr | DoRay (OBJRAYISECTFUNCTOR &_rayIntersector, OBJMARKER &_marker, const Ray3< ScalarType > &_ray, const ScalarType &_maxDist, ScalarType &_t) |
bool | Empty () const |
Griglia vera e propria. | |
template<class GATHERFUNCTOR > | |
void | Gather (GATHERFUNCTOR gfunctor) |
template<class OBJPOINTDISTFUNCTOR , class OBJMARKER > | |
ObjPtr | GetClosest (OBJPOINTDISTFUNCTOR &_getPointDistance, OBJMARKER &_marker, const typename OBJPOINTDISTFUNCTOR::QueryType &_p, const ScalarType &_maxDist, ScalarType &_minDist, CoordType &_closestPt) |
template<class OBJMARKER , class OBJPTRCONTAINER > | |
unsigned int | GetInBox (OBJMARKER &_marker, const vcg::Box3< ScalarType > _bbox, OBJPTRCONTAINER &_objectPtrs) |
template<class OBJPOINTDISTFUNCTOR , class OBJMARKER , class OBJPTRCONTAINER , class DISTCONTAINER , class POINTCONTAINER > | |
unsigned int | GetInSphere (OBJPOINTDISTFUNCTOR &_getPointDistance, OBJMARKER &_marker, const CoordType &_p, const ScalarType &_r, OBJPTRCONTAINER &_objectPtrs, DISTCONTAINER &_distances, POINTCONTAINER &_points) |
template<class OBJPOINTDISTFUNCTOR , class OBJMARKER , class OBJPTRCONTAINER , class DISTCONTAINER , class POINTCONTAINER > | |
unsigned int | GetKClosest (OBJPOINTDISTFUNCTOR &_getPointDistance, OBJMARKER &_marker, const unsigned int _k, const CoordType &_p, const ScalarType &_maxDist, OBJPTRCONTAINER &_objectPtrs, DISTCONTAINER &_distances, POINTCONTAINER &_points) |
void | Grid (Point3i p, const int axis, std::vector< Cell * > &cl) |
Cell * | Grid (const int i) |
void | Grid (const Cell *g, Cell &first, Cell &last) |
Cell * | Grid (const int x, const int y, const int z) |
BY INTEGER COORDS. | |
Cell * | Grid (const Point3i &pi) |
void | Grid (const int x, const int y, const int z, Cell &first, Cell &last) |
void | Grid (const Point3< ScalarType > &p, Cell &first, Cell &last) |
int | MemUsed () |
template<class OBJITER > | |
void | Set (const OBJITER &_oBegin, const OBJITER &_oEnd, int _size=0) |
template<class OBJITER > | |
void | Set (const OBJITER &_oBegin, const OBJITER &_oEnd, const Box3x &_bbox, int _size=0) |
template<class OBJITER > | |
void | Set (const OBJITER &_oBegin, const OBJITER &_oEnd, const Box3x &_bbox, Point3i _siz) |
template<class Box3Type > | |
void | SetBBox (const Box3Type &b) |
template<class OBJITER > | |
void | SetWithRadius (const OBJITER &_oBegin, const OBJITER &_oEnd, FLT _cellRadius) |
Public Attributes | |
std::vector< Cell > | grid |
Insieme di tutti i links. | |
std::vector< Link > | links |
Static Uniform Grid A spatial search structure for a accessing a container of objects. It is based on a uniform grid overlayed over a protion of space. The grid partion the space into cells. Cells contains just pointers to the object that are stored elsewhere. The set of objects is meant to be static and pointer stable.
Useful for situation were many space related query are issued over the same dataset (ray tracing, measuring distances between meshes, re-detailing ecc.). Works well for distribution that ar reasonably uniform. How to use it: ContainerType must have a 'value_type' typedef inside. (stl containers already have it)
Objects pointed by cells (of kind 'value_type') must have a 'ScalarType' typedef (float or double usually) and a member function:
void GetBBox(Box3<ScalarType> &b) which return the bounding box of the object
When using the GetClosest() method, the user must supply a functor object (whose type is a method template argument) which expose the following operator ():
bool operator () (const ObjType & obj, const Point3f & point, ScalarType & mindist, Point3f & result); which return true if the distance from point to the object 'obj' is < mindist and set mindist to said distance, and result must be set as the closest point of the object to point)
Definition at line 72 of file grid_static_ptr.h.
typedef Box3<ScalarType> vcg::GridStaticPtr< OBJTYPE, FLT >::Box3x |
Reimplemented from vcg::BasicGrid< FLT >.
Definition at line 79 of file grid_static_ptr.h.
typedef BasicGrid<FLT> vcg::GridStaticPtr< OBJTYPE, FLT >::BT |
Definition at line 82 of file grid_static_ptr.h.
typedef Link* vcg::GridStaticPtr< OBJTYPE, FLT >::Cell |
Definition at line 126 of file grid_static_ptr.h.
typedef Cell vcg::GridStaticPtr< OBJTYPE, FLT >::CellIterator |
Definition at line 127 of file grid_static_ptr.h.
typedef Point3<ScalarType> vcg::GridStaticPtr< OBJTYPE, FLT >::CoordType |
Reimplemented from vcg::SpatialIndex< OBJTYPE, FLT >.
Definition at line 78 of file grid_static_ptr.h.
typedef GridStaticPtr<OBJTYPE,FLT> vcg::GridStaticPtr< OBJTYPE, FLT >::GridPtrType |
Definition at line 81 of file grid_static_ptr.h.
typedef Line3<ScalarType> vcg::GridStaticPtr< OBJTYPE, FLT >::Line3x |
Definition at line 80 of file grid_static_ptr.h.
typedef ObjType* vcg::GridStaticPtr< OBJTYPE, FLT >::ObjPtr |
Reimplemented from vcg::SpatialIndex< OBJTYPE, FLT >.
Definition at line 76 of file grid_static_ptr.h.
typedef OBJTYPE vcg::GridStaticPtr< OBJTYPE, FLT >::ObjType |
Reimplemented from vcg::SpatialIndex< OBJTYPE, FLT >.
Definition at line 75 of file grid_static_ptr.h.
typedef ObjType::ScalarType vcg::GridStaticPtr< OBJTYPE, FLT >::ScalarType |
Reimplemented from vcg::SpatialIndex< OBJTYPE, FLT >.
Definition at line 77 of file grid_static_ptr.h.
ObjPtr vcg::GridStaticPtr< OBJTYPE, FLT >::DoRay | ( | OBJRAYISECTFUNCTOR & | _rayIntersector, |
OBJMARKER & | _marker, | ||
const Ray3< ScalarType > & | _ray, | ||
const ScalarType & | _maxDist, | ||
ScalarType & | _t | ||
) | [inline] |
Definition at line 437 of file grid_static_ptr.h.
bool vcg::GridStaticPtr< OBJTYPE, FLT >::Empty | ( | ) | const [inline] |
Griglia vera e propria.
Definition at line 135 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Gather | ( | GATHERFUNCTOR | gfunctor | ) | [inline] |
Definition at line 465 of file grid_static_ptr.h.
ObjPtr vcg::GridStaticPtr< OBJTYPE, FLT >::GetClosest | ( | OBJPOINTDISTFUNCTOR & | _getPointDistance, |
OBJMARKER & | _marker, | ||
const typename OBJPOINTDISTFUNCTOR::QueryType & | _p, | ||
const ScalarType & | _maxDist, | ||
ScalarType & | _minDist, | ||
CoordType & | _closestPt | ||
) | [inline] |
Definition at line 397 of file grid_static_ptr.h.
unsigned int vcg::GridStaticPtr< OBJTYPE, FLT >::GetInBox | ( | OBJMARKER & | _marker, |
const vcg::Box3< ScalarType > | _bbox, | ||
OBJPTRCONTAINER & | _objectPtrs | ||
) | [inline] |
Definition at line 428 of file grid_static_ptr.h.
unsigned int vcg::GridStaticPtr< OBJTYPE, FLT >::GetInSphere | ( | OBJPOINTDISTFUNCTOR & | _getPointDistance, |
OBJMARKER & | _marker, | ||
const CoordType & | _p, | ||
const ScalarType & | _r, | ||
OBJPTRCONTAINER & | _objectPtrs, | ||
DISTCONTAINER & | _distances, | ||
POINTCONTAINER & | _points | ||
) | [inline] |
Definition at line 414 of file grid_static_ptr.h.
unsigned int vcg::GridStaticPtr< OBJTYPE, FLT >::GetKClosest | ( | OBJPOINTDISTFUNCTOR & | _getPointDistance, |
OBJMARKER & | _marker, | ||
const unsigned int | _k, | ||
const CoordType & | _p, | ||
const ScalarType & | _maxDist, | ||
OBJPTRCONTAINER & | _objectPtrs, | ||
DISTCONTAINER & | _distances, | ||
POINTCONTAINER & | _points | ||
) | [inline] |
Definition at line 405 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | Point3i | p, |
const int | axis, | ||
std::vector< Cell * > & | cl | ||
) | [inline] |
Date le coordinate di un grid point (corner minx,miy,minz) ritorna le celle che condividono l'edge cell che parte dal grid point in direzione axis
Definition at line 139 of file grid_static_ptr.h.
Cell* vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const int | i | ) | [inline] |
BY CELL
Definition at line 170 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const Cell * | g, |
Cell & | first, | ||
Cell & | last | ||
) | [inline] |
Definition at line 174 of file grid_static_ptr.h.
Cell* vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const int | x, |
const int | y, | ||
const int | z | ||
) | [inline] |
BY INTEGER COORDS.
Definition at line 181 of file grid_static_ptr.h.
Cell* vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const Point3i & | pi | ) | [inline] |
Definition at line 188 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const int | x, |
const int | y, | ||
const int | z, | ||
Cell & | first, | ||
Cell & | last | ||
) | [inline] |
Definition at line 193 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const Point3< ScalarType > & | p, |
Cell & | first, | ||
Cell & | last | ||
) | [inline] |
Definition at line 200 of file grid_static_ptr.h.
int vcg::GridStaticPtr< OBJTYPE, FLT >::MemUsed | ( | ) | [inline] |
Definition at line 390 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Set | ( | const OBJITER & | _oBegin, |
const OBJITER & | _oEnd, | ||
int | _size = 0 |
||
) | [inline] |
inflate the bb calculated
Definition at line 245 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Set | ( | const OBJITER & | _oBegin, |
const OBJITER & | _oEnd, | ||
const Box3x & | _bbox, | ||
int | _size = 0 |
||
) | [inline] |
Definition at line 303 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Set | ( | const OBJITER & | _oBegin, |
const OBJITER & | _oEnd, | ||
const Box3x & | _bbox, | ||
Point3i | _siz | ||
) | [inline] |
Definition at line 318 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::SetBBox | ( | const Box3Type & | b | ) | [inline] |
Set the bounding box of the grid We need some extra space for numerical precision.
Definition at line 212 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::SetWithRadius | ( | const OBJITER & | _oBegin, |
const OBJITER & | _oEnd, | ||
FLT | _cellRadius | ||
) | [inline] |
Definition at line 272 of file grid_static_ptr.h.
std::vector<Cell> vcg::GridStaticPtr< OBJTYPE, FLT >::grid |
Insieme di tutti i links.
Definition at line 131 of file grid_static_ptr.h.
std::vector<Link> vcg::GridStaticPtr< OBJTYPE, FLT >::links |
Definition at line 129 of file grid_static_ptr.h.