#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) |
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 (const Point3< ScalarType > &p, Cell &first, Cell &last) |
void | Grid (const int x, const int y, const int z, Cell &first, Cell &last) |
Cell * | Grid (const Point3i &pi) |
Cell * | Grid (const int x, const int y, const int z) |
BY INTEGER COORDS. | |
void | Grid (const Cell *g, Cell &first, Cell &last) |
Cell * | Grid (const int i) |
void | Grid (Point3i p, const int axis, std::vector< Cell * > &cl) |
Griglia vera e propria. | |
int | MemUsed () |
template<class OBJITER > | |
void | Set (const OBJITER &_oBegin, const OBJITER &_oEnd, const Box3x &_bbox, Point3i _siz) |
template<class OBJITER > | |
void | Set (const OBJITER &_oBegin, const OBJITER &_oEnd, const Box3x &_bbox) |
template<class OBJITER > | |
void | Set (const OBJITER &_oBegin, const OBJITER &_oEnd, const Box3x &_bbox, FLT radius) |
template<class OBJITER > | |
void | Set (const OBJITER &_oBegin, const OBJITER &_oEnd, int _size=0) |
template<class Box3Type > | |
void | SetBBox (const Box3Type &b) |
void | ShowStats (FILE *fp) |
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 434 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Gather | ( | GATHERFUNCTOR | gfunctor | ) | [inline] |
Definition at line 462 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 394 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 425 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 411 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 402 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const Point3< ScalarType > & | p, | |
Cell & | first, | |||
Cell & | last | |||
) | [inline] |
Definition at line 199 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 192 of file grid_static_ptr.h.
Cell* vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const Point3i & | pi | ) | [inline] |
Definition at line 187 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 180 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const Cell * | g, | |
Cell & | first, | |||
Cell & | last | |||
) | [inline] |
Definition at line 173 of file grid_static_ptr.h.
Cell* vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | const int | i | ) | [inline] |
BY CELL
Definition at line 169 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Grid | ( | Point3i | p, | |
const int | axis, | |||
std::vector< Cell * > & | cl | |||
) | [inline] |
Griglia vera e propria.
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 138 of file grid_static_ptr.h.
int vcg::GridStaticPtr< OBJTYPE, FLT >::MemUsed | ( | ) | [inline] |
Definition at line 387 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 315 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::Set | ( | const OBJITER & | _oBegin, | |
const OBJITER & | _oEnd, | |||
const Box3x & | _bbox | |||
) | [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, | |||
FLT | radius | |||
) | [inline] |
Definition at line 272 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 244 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 211 of file grid_static_ptr.h.
void vcg::GridStaticPtr< OBJTYPE, FLT >::ShowStats | ( | FILE * | fp | ) | [inline] |
Definition at line 222 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.