#include <perfect_spatial_hashing.h>
Classes | |
struct | EntryIterator |
Public Types | |
typedef vcg::Point3i | CellCoordinate |
Public Member Functions | |
void | Allocate (const BoundingBoxType &bounding_box, const int cell_per_side) |
EntryIterator | Begin () |
EntryIterator | End () |
void | Finalize () |
void | GetCellsIndex (const ObjectPointer pObject, std::vector< CellCoordinate > &cells_occupied) |
NeighboringEntryIterator | GetNeighboringEntryIterator (const CellCoordinate &at) |
int | GetNumberOfNotEmptyCells () |
std::vector< ObjectPointer > * | GetObjects (const CellCoordinate &at) |
std::vector< ObjectPointer > * | GetObjects (const int i, const int j, const int k) |
int | GetResolution () const |
template<class OBJECT_ITERATOR > | |
void | InsertElements (const OBJECT_ITERATOR &begin, const OBJECT_ITERATOR &end) |
vcg::Box3i | Interize (const BoundingBoxType &bounding_box) const |
CellCoordinate | Interize (const CoordinateType &query) const |
std::vector< ObjectPointer > * | operator[] (const CellCoordinate &at) |
UniformGrid () | |
~UniformGrid () | |
Protected Attributes | |
BoundingBoxType | m_BoundingBox |
int | m_CellPerSide |
CoordinateType | m_CellSize |
std::vector< std::vector < std::vector< std::vector < ObjectPointer > > > > | m_Grid |
This class represent the domain U in the original article. It is used only during the construction of the offset and hash tables.
Definition at line 181 of file perfect_spatial_hashing.h.
typedef vcg::Point3i vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::CellCoordinate |
Definition at line 184 of file perfect_spatial_hashing.h.
vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::UniformGrid | ( | ) | [inline] |
Default constructor
Definition at line 274 of file perfect_spatial_hashing.h.
vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::~UniformGrid | ( | ) | [inline] |
Default destructor
Definition at line 279 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::Allocate | ( | const BoundingBoxType & | bounding_box, | |
const int | cell_per_side | |||
) | [inline] |
Allocate the necessary space for the uniform grid.
[in] | bounding_box | The bounding box enclosing the whole dataset. |
[in] | cell_per_side | The resolution of the grid. |
Definition at line 302 of file perfect_spatial_hashing.h.
EntryIterator vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::Begin | ( | ) | [inline] |
These functions return an iterator pointing to the first and the last cell of the grid respectively.
Definition at line 285 of file perfect_spatial_hashing.h.
EntryIterator vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::End | ( | ) | [inline] |
Definition at line 286 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::Finalize | ( | ) | [inline] |
Removes all the reference to the domain data from the UniformGrid cells.
Definition at line 321 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::GetCellsIndex | ( | const ObjectPointer | pObject, | |
std::vector< CellCoordinate > & | cells_occupied | |||
) | [inline] |
Given the pointer to an object, returns the set of cells in the uniform grid containing the object.
[in] | pObject | The pointer to the object |
[out] | cells_occuppied | The set of cell index containing the object |
Definition at line 383 of file perfect_spatial_hashing.h.
NeighboringEntryIterator vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::GetNeighboringEntryIterator | ( | const CellCoordinate & | at | ) | [inline] |
Return an iterator that iterates over the six adjacent cells of a given cell.
[in] | at | The cell around which this iterator takes values. |
at
. Definition at line 294 of file perfect_spatial_hashing.h.
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::GetNumberOfNotEmptyCells | ( | ) | [inline] |
Return the number of cells of the uniform grid where there are no item of the input dataset.
Definition at line 414 of file perfect_spatial_hashing.h.
std::vector< ObjectPointer >* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::GetObjects | ( | const CellCoordinate & | at | ) | [inline] |
Definition at line 438 of file perfect_spatial_hashing.h.
std::vector< ObjectPointer >* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::GetObjects | ( | const int | i, | |
const int | j, | |||
const int | k | |||
) | [inline] |
Return the pointer to a vector containing pointers to the objects falling in a given domain cell.
[in] | at | The index of the cell of the uniform grid where looking for |
at
. Definition at line 437 of file perfect_spatial_hashing.h.
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::GetResolution | ( | ) | const [inline] |
Returns the number of entries for each side of the grid.
Definition at line 429 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::InsertElements | ( | const OBJECT_ITERATOR & | begin, | |
const OBJECT_ITERATOR & | end | |||
) | [inline] |
Adds a set of elements to the uniform grid.
[in] | begin | The iterator addressing the position of the first element in the range to be added. |
[in] | end | The iterator addressing the position one past the final element in the range to be added. |
Definition at line 333 of file perfect_spatial_hashing.h.
vcg::Box3i vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::Interize | ( | const BoundingBoxType & | bounding_box | ) | const [inline] |
Given a bounding box contained in the UniformGrid, returns its integer-equivalent bounding box.
[in] | bounding_box | The bounding box in the 3D space. |
Definition at line 369 of file perfect_spatial_hashing.h.
CellCoordinate vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::Interize | ( | const CoordinateType & | query | ) | const [inline] |
Given a point contained in the UniformGrid, returns the index of the cell where it's contained.
[in] | query | The 3D point. |
Definition at line 355 of file perfect_spatial_hashing.h.
std::vector< ObjectPointer >* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::operator[] | ( | const CellCoordinate & | at | ) | [inline] |
Definition at line 439 of file perfect_spatial_hashing.h.
BoundingBoxType vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::m_BoundingBox [protected] |
The bounding box of the uniform grid.
Definition at line 444 of file perfect_spatial_hashing.h.
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::m_CellPerSide [protected] |
The number of cell per side.
Definition at line 445 of file perfect_spatial_hashing.h.
CoordinateType vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::m_CellSize [protected] |
The dimension of each cell.
Definition at line 446 of file perfect_spatial_hashing.h.
std::vector< std::vector< std::vector< std::vector< ObjectPointer > > > > vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::m_Grid [protected] |
The uniform grid
Definition at line 443 of file perfect_spatial_hashing.h.