Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions
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
std::unordered_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 ()
int CountInSphere (const Point3< ScalarType > &p, const ScalarType radius, std::vector< HashIterator > &inSphVec)
 insert a new cell
template<class OBJRAYISECTFUNCTOR , class OBJMARKER >
ObjPtr DoRay (OBJRAYISECTFUNCTOR &_rayIntersector, OBJMARKER &_marker, const Ray3< ScalarType > &_ray, const ScalarType &_maxDist, ScalarType &_t)
bool Empty () const
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 (int x, int y, int z, CellIterator &first, CellIterator &last)
 return the simplexes on a specified cell
void Grid (const Point3i &_c, CellIterator &first, CellIterator &end)
 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)
template<class DistanceFunctor >
int RemoveInSphereNormal (const Point3< ScalarType > &p, const Point3< ScalarType > &n, DistanceFunctor &DF, const ScalarType radius)
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 &)
 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 71 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 79 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 78 of file spatial_hashing.h.

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

Definition at line 86 of file spatial_hashing.h.

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

Definition at line 85 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 76 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 77 of file spatial_hashing.h.

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

Definition at line 75 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 164 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 111 of file spatial_hashing.h.

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

Definition at line 361 of file spatial_hashing.h.

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

insert a new cell

Definition at line 190 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 410 of file spatial_hashing.h.

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

Definition at line 106 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 116 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 369 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 401 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 387 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 377 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 348 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 354 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 340 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 283 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 134 of file spatial_hashing.h.

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

Definition at line 269 of file spatial_hashing.h.

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

remove all the objects in a cell

Definition at line 141 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 181 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]

Definition at line 212 of file spatial_hashing.h.

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

Definition at line 223 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 146 of file spatial_hashing.h.

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

Definition at line 254 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 305 of file spatial_hashing.h.

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

Definition at line 121 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 91 of file spatial_hashing.h.

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

Definition at line 87 of file spatial_hashing.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:20