vcg::SpatialHashTable< ObjType, FLT > Class Template Reference

#include <spatial_hashing.h>

Inheritance diagram for vcg::SpatialHashTable< ObjType, FLT >:
Inheritance graph
[legend]

List of all members.

Classes

struct  CellIterator

Public Types

typedef BasicGrid< FLT >::Box3x Box3x
typedef Point3< ScalarTypeCoordType
typedef HashType::iterator HashIterator
typedef STDEXT::hash_multimap
< Point3i, ObjType
*, HashFunctor
HashType
typedef ObjTypeObjPtr
typedef ObjType::ScalarType ScalarType
typedef SpatialHashTable SpatialHashType

Public Member Functions

vcg::Box3i Add (ObjType *s)
size_t CellSize (const Point3i &cell)
void Clear ()
template<class OBJRAYISECTFUNCTOR , class OBJMARKER >
ObjPtr DoRay (OBJRAYISECTFUNCTOR &_rayIntersector, OBJMARKER &_marker, const Ray3< ScalarType > &_ray, const ScalarType &_maxDist, ScalarType &_t)
bool EmptyCell (const Point3i &cell) const
template<class OBJPOINTDISTFUNCTOR , class OBJMARKER >
ObjPtr GetClosest (OBJPOINTDISTFUNCTOR &_getPointDistance, OBJMARKER &_marker, const CoordType &_p, const ScalarType &_maxDist, ScalarType &_minDist, CoordType &_closestPt)
template<class OBJMARKER , class OBJPTRCONTAINER >
unsigned int GetInBox (OBJMARKER &_marker, const Box3x _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 Point3i &_c, CellIterator &first, CellIterator &end)
 return the simplexes on a specified cell
void Grid (int x, int y, int z, CellIterator &first, CellIterator &last)
 return the simplexes on a specified cell
void GridReal (const Point3< ScalarType > &p, CellIterator &first, CellIterator &last)
 return the simplexes of the cell that contain p
void InitEmpty (const Box3x &_bbox, vcg::Point3i grid_size)
 set an empty spatial hash table
void Remove (ObjType *s)
bool RemoveCell (ObjType *s)
 Remove all the objects contained in the cell containing s.
int RemoveInSphere (const Point3< ScalarType > &p, const ScalarType radius)
 insert a new cell
void RemovePunctual (ObjType *s)
template<class OBJITER >
void Set (const OBJITER &_oBegin, const OBJITER &_oEnd, const Box3x &_bbox=Box3x())
 Insert a mesh in the grid.
void UpdateAllocatedCells ()

Public Attributes

std::vector< Point3iAllocatedCells
HashType hash_table

Protected Member Functions

void InsertObject (ObjType *s, const Point3i &cell)
 insert a new cell
void RemoveCell (const Point3i &cell)
 remove all the objects in a cell
bool RemoveObject (ObjType *s, const Point3i &cell)

Detailed Description

template<typename ObjType, class FLT = double>
class vcg::SpatialHashTable< ObjType, FLT >

Spatial Hash Table Spatial Hashing as described in "Optimized Spatial Hashing for Coll ision Detection of Deformable Objects", Matthias Teschner and Bruno Heidelberger and Matthias Muller and Danat Pomeranets and Markus Gross

Definition at line 83 of file spatial_hashing.h.


Member Typedef Documentation

template<typename ObjType, class FLT = double>
typedef BasicGrid<FLT>::Box3x vcg::SpatialHashTable< ObjType, FLT >::Box3x

Reimplemented from vcg::BasicGrid< FLT >.

Reimplemented in vcg::DynamicSpatialHashTable< ContainerType, FLT >.

Definition at line 91 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
typedef Point3<ScalarType> vcg::SpatialHashTable< ObjType, FLT >::CoordType

Reimplemented from vcg::SpatialIndex< ObjType, FLT >.

Reimplemented in vcg::DynamicSpatialHashTable< ContainerType, FLT >.

Definition at line 90 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
typedef HashType::iterator vcg::SpatialHashTable< ObjType, FLT >::HashIterator

Definition at line 98 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
typedef STDEXT::hash_multimap<Point3i, ObjType *, HashFunctor> vcg::SpatialHashTable< ObjType, FLT >::HashType

Definition at line 97 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
typedef ObjType* vcg::SpatialHashTable< ObjType, FLT >::ObjPtr

Reimplemented from vcg::SpatialIndex< ObjType, FLT >.

Reimplemented in vcg::DynamicSpatialHashTable< ContainerType, FLT >.

Definition at line 88 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
typedef ObjType::ScalarType vcg::SpatialHashTable< ObjType, FLT >::ScalarType

Reimplemented from vcg::SpatialIndex< ObjType, FLT >.

Definition at line 89 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
typedef SpatialHashTable vcg::SpatialHashTable< ObjType, FLT >::SpatialHashType

Definition at line 87 of file spatial_hashing.h.


Member Function Documentation

template<typename ObjType, class FLT = double>
vcg::Box3i vcg::SpatialHashTable< ObjType, FLT >::Add ( ObjType s  )  [inline]

Definition at line 172 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
size_t vcg::SpatialHashTable< ObjType, FLT >::CellSize ( const Point3i cell  )  [inline]

Definition at line 119 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::Clear ( void   )  [inline]

Definition at line 337 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
template<class OBJRAYISECTFUNCTOR , class OBJMARKER >
ObjPtr vcg::SpatialHashTable< ObjType, FLT >::DoRay ( OBJRAYISECTFUNCTOR &  _rayIntersector,
OBJMARKER &  _marker,
const Ray3< ScalarType > &  _ray,
const ScalarType _maxDist,
ScalarType _t 
) [inline]

Definition at line 386 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
bool vcg::SpatialHashTable< ObjType, FLT >::EmptyCell ( const Point3i cell  )  const [inline]

Definition at line 124 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
template<class OBJPOINTDISTFUNCTOR , class OBJMARKER >
ObjPtr vcg::SpatialHashTable< ObjType, FLT >::GetClosest ( OBJPOINTDISTFUNCTOR &  _getPointDistance,
OBJMARKER &  _marker,
const CoordType _p,
const ScalarType _maxDist,
ScalarType _minDist,
CoordType _closestPt 
) [inline]

Definition at line 345 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
template<class OBJMARKER , class OBJPTRCONTAINER >
unsigned int vcg::SpatialHashTable< ObjType, FLT >::GetInBox ( OBJMARKER &  _marker,
const Box3x  _bbox,
OBJPTRCONTAINER &  _objectPtrs 
) [inline]

Definition at line 377 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
template<class OBJPOINTDISTFUNCTOR , class OBJMARKER , class OBJPTRCONTAINER , class DISTCONTAINER , class POINTCONTAINER >
unsigned int vcg::SpatialHashTable< ObjType, FLT >::GetInSphere ( OBJPOINTDISTFUNCTOR &  _getPointDistance,
OBJMARKER &  _marker,
const CoordType _p,
const ScalarType _r,
OBJPTRCONTAINER &  _objectPtrs,
DISTCONTAINER &  _distances,
POINTCONTAINER &  _points 
) [inline]

Definition at line 363 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
template<class OBJPOINTDISTFUNCTOR , class OBJMARKER , class OBJPTRCONTAINER , class DISTCONTAINER , class POINTCONTAINER >
unsigned int vcg::SpatialHashTable< 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 353 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::Grid ( const Point3i _c,
CellIterator first,
CellIterator end 
) [inline]

return the simplexes on a specified cell

Definition at line 330 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::Grid ( int  x,
int  y,
int  z,
CellIterator first,
CellIterator last 
) [inline]

return the simplexes on a specified cell

Definition at line 324 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::GridReal ( const Point3< ScalarType > &  p,
CellIterator first,
CellIterator last 
) [inline]

return the simplexes of the cell that contain p

Definition at line 316 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::InitEmpty ( const Box3x _bbox,
vcg::Point3i  grid_size 
) [inline]

set an empty spatial hash table

Definition at line 259 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::InsertObject ( ObjType s,
const Point3i cell 
) [inline, protected]

insert a new cell

Definition at line 142 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::Remove ( ObjType s  )  [inline]

Definition at line 245 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
bool vcg::SpatialHashTable< ObjType, FLT >::RemoveCell ( ObjType s  )  [inline]

Remove all the objects contained in the cell containing s.

Definition at line 189 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::RemoveCell ( const Point3i cell  )  [inline, protected]

remove all the objects in a cell

Definition at line 149 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
int vcg::SpatialHashTable< ObjType, FLT >::RemoveInSphere ( const Point3< ScalarType > &  p,
const ScalarType  radius 
) [inline]

insert a new cell

Definition at line 198 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
bool vcg::SpatialHashTable< ObjType, FLT >::RemoveObject ( ObjType s,
const Point3i cell 
) [inline, protected]

Definition at line 154 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::RemovePunctual ( ObjType s  )  [inline]

Definition at line 230 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
template<class OBJITER >
void vcg::SpatialHashTable< ObjType, FLT >::Set ( const OBJITER &  _oBegin,
const OBJITER &  _oEnd,
const Box3x _bbox = Box3x() 
) [inline]

Insert a mesh in the grid.

inflate the bb calculated

Definition at line 281 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
void vcg::SpatialHashTable< ObjType, FLT >::UpdateAllocatedCells (  )  [inline]

Definition at line 129 of file spatial_hashing.h.


Member Data Documentation

template<typename ObjType, class FLT = double>
std::vector<Point3i> vcg::SpatialHashTable< ObjType, FLT >::AllocatedCells

Definition at line 103 of file spatial_hashing.h.

template<typename ObjType, class FLT = double>
HashType vcg::SpatialHashTable< ObjType, FLT >::hash_table

Definition at line 99 of file spatial_hashing.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:23:05 2013