Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions
vcg::SpatialHashTable2D< ObjType, FLT > Class Template Reference

#include <spatial_hashing2d.h>

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

List of all members.

Classes

struct  CellIterator

Public Types

typedef BasicGrid2D< FLT >::Box2x Box2x
typedef Point2< ScalarTypeCoordType
typedef HashType::iterator HashIterator
typedef STDEXT::hash_multimap
< Point2i, ObjType
*, HashFunctor2D
HashType
typedef ObjTypeObjPtr
typedef ObjType::ScalarType ScalarType
typedef SpatialHashTable2D SpatialHashType

Public Member Functions

void Add (ObjType *s, bool subdivideBox=false)
size_t CellSize (const Point3i &cell)
void Clear ()
bool Empty () const
bool EmptyCell (const Point3i &cell) const
template<class OBJMARKER , class OBJPTRCONTAINER >
unsigned int GetInBox (OBJMARKER &_marker, const Box2x _bbox, OBJPTRCONTAINER &_objectPtrs)
template<class OBJMARKER , class OBJPTRCONTAINER >
unsigned int GetInBoxes (OBJMARKER &_marker, const std::vector< Box2x > &_bbox, OBJPTRCONTAINER &_objectPtrs)
void Grid (int x, int y, CellIterator &first, CellIterator &last)
 return the simplexes on a specified cell
void Grid (const Point2i &_c, CellIterator &first, CellIterator &end)
 return the simplexes on a specified cell
void GridReal (const Point2< ScalarType > &p, CellIterator &first, CellIterator &last)
 return the simplexes of the cell that contain p
void InitEmpty (const Box2x &_bbox, vcg::Point2i grid_size)
 set an empty spatial hash table
void Remove (ObjType *s)
 insert a new cell
bool RemoveCell (ObjType *s)
 Remove all the objects contained in the cell containing s.
template<class OBJITER >
void Set (const OBJITER &_oBegin, const OBJITER &_oEnd, bool subdivideBox=false, const Box2x &_bbox=Box2x())
template<class OBJITER >
void SetByPointers (const OBJITER &_oBegin, const OBJITER &_oEnd, const Point2i &cellsize=Point2i(-1,-1), bool subdivideBox=false, const Box2x &_bbox=Box2x())
 Insert a mesh in the grid.
void UpdateAllocatedCells ()

Public Attributes

std::vector< Point2iAllocatedCells
ScalarType cell_size
 the size of the diagonal of each cell
HashType hash_table

Protected Member Functions

void AddBox (ObjType *s, const Box2< ScalarType > &b)
void AddBoxes (ObjType *s, const std::vector< Box2< ScalarType > > &boxes)
void InsertObject (ObjType *s, const Point2i &cell)
 insert a new cell
void RemoveCell (const Point3i &)
 remove all the objects in a cell
bool RemoveObject (ObjType *s, const Point2i &cell)

Detailed Description

template<typename ObjType, class FLT = double>
class vcg::SpatialHashTable2D< 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 90 of file spatial_hashing2d.h.


Member Typedef Documentation

template<typename ObjType , class FLT = double>
typedef BasicGrid2D<FLT>::Box2x vcg::SpatialHashTable2D< ObjType, FLT >::Box2x

Reimplemented from vcg::BasicGrid2D< FLT >.

Definition at line 98 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
typedef Point2<ScalarType> vcg::SpatialHashTable2D< ObjType, FLT >::CoordType

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

Definition at line 97 of file spatial_hashing2d.h.

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

Definition at line 105 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
typedef STDEXT::hash_multimap<Point2i, ObjType *, HashFunctor2D> vcg::SpatialHashTable2D< ObjType, FLT >::HashType

Definition at line 104 of file spatial_hashing2d.h.

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

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

Definition at line 95 of file spatial_hashing2d.h.

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

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

Definition at line 96 of file spatial_hashing2d.h.

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

Definition at line 94 of file spatial_hashing2d.h.


Member Function Documentation

template<typename ObjType , class FLT = double>
void vcg::SpatialHashTable2D< ObjType, FLT >::Add ( ObjType s,
bool  subdivideBox = false 
) [inline]

Definition at line 217 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
void vcg::SpatialHashTable2D< ObjType, FLT >::AddBox ( ObjType s,
const Box2< ScalarType > &  b 
) [inline, protected]

Definition at line 183 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
void vcg::SpatialHashTable2D< ObjType, FLT >::AddBoxes ( ObjType s,
const std::vector< Box2< ScalarType > > &  boxes 
) [inline, protected]

Definition at line 194 of file spatial_hashing2d.h.

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

Definition at line 133 of file spatial_hashing2d.h.

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

Definition at line 502 of file spatial_hashing2d.h.

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

Definition at line 128 of file spatial_hashing2d.h.

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

Definition at line 138 of file spatial_hashing2d.h.

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

Definition at line 542 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
template<class OBJMARKER , class OBJPTRCONTAINER >
unsigned int vcg::SpatialHashTable2D< ObjType, FLT >::GetInBoxes ( OBJMARKER &  _marker,
const std::vector< Box2x > &  _bbox,
OBJPTRCONTAINER &  _objectPtrs 
) [inline]

Definition at line 552 of file spatial_hashing2d.h.

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

return the simplexes on a specified cell

Definition at line 489 of file spatial_hashing2d.h.

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

return the simplexes on a specified cell

Definition at line 495 of file spatial_hashing2d.h.

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

return the simplexes of the cell that contain p

Definition at line 481 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
void vcg::SpatialHashTable2D< ObjType, FLT >::InitEmpty ( const Box2x _bbox,
vcg::Point2i  grid_size 
) [inline]

set an empty spatial hash table

Definition at line 337 of file spatial_hashing2d.h.

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

insert a new cell

Definition at line 156 of file spatial_hashing2d.h.

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

insert a new cell

Definition at line 323 of file spatial_hashing2d.h.

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

remove all the objects in a cell

Definition at line 162 of file spatial_hashing2d.h.

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

Remove all the objects contained in the cell containing s.

Definition at line 238 of file spatial_hashing2d.h.

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

Definition at line 167 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
template<class OBJITER >
void vcg::SpatialHashTable2D< ObjType, FLT >::Set ( const OBJITER &  _oBegin,
const OBJITER &  _oEnd,
bool  subdivideBox = false,
const Box2x _bbox = Box2x() 
) [inline]

Insert a mesh in the grid.

inflate the bb calculated

Definition at line 396 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
template<class OBJITER >
void vcg::SpatialHashTable2D< ObjType, FLT >::SetByPointers ( const OBJITER &  _oBegin,
const OBJITER &  _oEnd,
const Point2i cellsize = Point2i(-1,-1),
bool  subdivideBox = false,
const Box2x _bbox = Box2x() 
) [inline]

Insert a mesh in the grid.

inflate the bb calculated

Definition at line 434 of file spatial_hashing2d.h.

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

Definition at line 143 of file spatial_hashing2d.h.


Member Data Documentation

template<typename ObjType , class FLT = double>
std::vector<Point2i> vcg::SpatialHashTable2D< ObjType, FLT >::AllocatedCells

Definition at line 110 of file spatial_hashing2d.h.

template<typename ObjType , class FLT = double>
ScalarType vcg::SpatialHashTable2D< ObjType, FLT >::cell_size

the size of the diagonal of each cell

Definition at line 113 of file spatial_hashing2d.h.

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

Definition at line 106 of file spatial_hashing2d.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