vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid Class Reference

#include <perfect_spatial_hashing.h>

List of all members.

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

Detailed Description

template<class OBJECT_TYPE, class SCALAR_TYPE>
class vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid

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.


Member Typedef Documentation

template<class OBJECT_TYPE , class SCALAR_TYPE >
typedef vcg::Point3i vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::CellCoordinate

Definition at line 184 of file perfect_spatial_hashing.h.


Constructor & Destructor Documentation

template<class OBJECT_TYPE , class SCALAR_TYPE >
vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::UniformGrid (  )  [inline]

Default constructor

Definition at line 274 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::~UniformGrid (  )  [inline]

Default destructor

Definition at line 279 of file perfect_spatial_hashing.h.


Member Function Documentation

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

Parameters:
[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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
EntryIterator vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::End (  )  [inline]

Definition at line 286 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

Parameters:
[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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

Parameters:
[in] at The cell around which this iterator takes values.
Returns:
The iterator over the neighboring cells of at.

Definition at line 294 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

Returns:
The number of cells occupied by at least one item.

Definition at line 414 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

Parameters:
[in] at The index of the cell of the uniform grid where looking for
Returns:
A pointer to a vector of pointers to the objects falling in the cell having index at.

Definition at line 437 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::UniformGrid::GetResolution (  )  const [inline]

Returns the number of entries for each side of the grid.

Returns:
The resolution of the UniformGrid in each dimension.

Definition at line 429 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
template<class OBJECT_ITERATOR >
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.

Parameters:
[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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

Parameters:
[in] bounding_box The bounding box in the 3D space.
Returns:
The integer representation of the bounding box.

Definition at line 369 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

Parameters:
[in] query The 3D point.
Returns:
The index of the UniformGrid entry where this point is contained.

Definition at line 355 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.


Member Data Documentation

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.

template<class OBJECT_TYPE , class SCALAR_TYPE >
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.


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:04 2013